happstack-yui 7360.4.1 → 7371.5.0
raw patch · 1615 files changed
+409360/−162980 lines, 1615 filesdep ~basedep ~template-haskelldep ~web-routes-boomerangbinary-added
Dependency ranges changed: base, template-haskell, web-routes-boomerang, web-routes-th
This diff is very large; some files are shown as “too large to diff”. Download the raw patch for the complete diff.
Files
- bundle/align-plugin/align-plugin-coverage.js +300/−0
- bundle/align-plugin/align-plugin-debug.js +3/−3
- bundle/align-plugin/align-plugin-min.js +2/−2
- bundle/align-plugin/align-plugin.js +3/−3
- bundle/anim-base/anim-base-coverage.js +932/−0
- bundle/anim-base/anim-base-debug.js +21/−13
- bundle/anim-base/anim-base-min.js +2/−2
- bundle/anim-base/anim-base.js +21/−13
- bundle/anim-color/anim-color-coverage.js +112/−0
- bundle/anim-color/anim-color-debug.js +20/−15
- bundle/anim-color/anim-color-min.js +2/−2
- bundle/anim-color/anim-color.js +20/−15
- bundle/anim-curve/anim-curve-coverage.js +118/−0
- bundle/anim-curve/anim-curve-debug.js +3/−3
- bundle/anim-curve/anim-curve-min.js +2/−2
- bundle/anim-curve/anim-curve.js +3/−3
- bundle/anim-easing/anim-easing-coverage.js +482/−0
- bundle/anim-easing/anim-easing-debug.js +3/−3
- bundle/anim-easing/anim-easing-min.js +2/−2
- bundle/anim-easing/anim-easing.js +3/−3
- bundle/anim-node-plugin/anim-node-plugin-coverage.js +77/−0
- bundle/anim-node-plugin/anim-node-plugin-debug.js +4/−4
- bundle/anim-node-plugin/anim-node-plugin-min.js +2/−2
- bundle/anim-node-plugin/anim-node-plugin.js +4/−4
- bundle/anim-scroll/anim-scroll-coverage.js +90/−0
- bundle/anim-scroll/anim-scroll-debug.js +3/−3
- bundle/anim-scroll/anim-scroll-min.js +2/−2
- bundle/anim-scroll/anim-scroll.js +3/−3
- bundle/anim-shape-transform/anim-shape-transform-coverage.js +192/−0
- bundle/anim-shape-transform/anim-shape-transform-debug.js +0/−112
- bundle/anim-shape-transform/anim-shape-transform-min.js +0/−7
- bundle/anim-shape-transform/anim-shape-transform.js +0/−112
- bundle/anim-shape/anim-shape-coverage.js +302/−0
- bundle/anim-shape/anim-shape-debug.js +195/−0
- bundle/anim-shape/anim-shape-min.js +7/−0
- bundle/anim-shape/anim-shape.js +195/−0
- bundle/anim-xy/anim-xy-coverage.js +73/−0
- bundle/anim-xy/anim-xy-debug.js +3/−3
- bundle/anim-xy/anim-xy-min.js +2/−2
- bundle/anim-xy/anim-xy.js +3/−3
- bundle/app-base/app-base-coverage.js +1280/−0
- bundle/app-base/app-base-debug.js +76/−114
- bundle/app-base/app-base-min.js +2/−2
- bundle/app-base/app-base.js +76/−114
- bundle/app-content/app-content-coverage.js +314/−0
- bundle/app-content/app-content-debug.js +239/−0
- bundle/app-content/app-content-min.js +7/−0
- bundle/app-content/app-content.js +239/−0
- bundle/app-transitions-css/app-transitions-css-min.css +2/−2
- bundle/app-transitions-css/app-transitions-css.css +6/−1
- bundle/app-transitions-native/app-transitions-native-coverage.js +486/−0
- bundle/app-transitions-native/app-transitions-native-debug.js +5/−4
- bundle/app-transitions-native/app-transitions-native-min.js +2/−2
- bundle/app-transitions-native/app-transitions-native.js +5/−4
- bundle/app-transitions/app-transitions-coverage.js +295/−0
- bundle/app-transitions/app-transitions-debug.js +18/−27
- bundle/app-transitions/app-transitions-min.js +2/−2
- bundle/app-transitions/app-transitions.js +18/−27
- bundle/array-extras/array-extras-coverage.js +549/−0
- bundle/array-extras/array-extras-debug.js +82/−43
- bundle/array-extras/array-extras-min.js +2/−2
- bundle/array-extras/array-extras.js +82/−42
- bundle/array-invoke/array-invoke-coverage.js +89/−0
- bundle/array-invoke/array-invoke-debug.js +3/−3
- bundle/array-invoke/array-invoke-min.js +2/−2
- bundle/array-invoke/array-invoke.js +3/−3
- bundle/arraylist-add/arraylist-add-coverage.js +145/−0
- bundle/arraylist-add/arraylist-add-debug.js +3/−3
- bundle/arraylist-add/arraylist-add-min.js +2/−2
- bundle/arraylist-add/arraylist-add.js +3/−3
- bundle/arraylist-filter/arraylist-filter-coverage.js +95/−0
- bundle/arraylist-filter/arraylist-filter-debug.js +3/−3
- bundle/arraylist-filter/arraylist-filter-min.js +2/−2
- bundle/arraylist-filter/arraylist-filter.js +3/−3
- bundle/arraylist/arraylist-coverage.js +301/−0
- bundle/arraylist/arraylist-debug.js +3/−3
- bundle/arraylist/arraylist-min.js +2/−2
- bundle/arraylist/arraylist.js +3/−3
- bundle/arraysort/arraysort-coverage.js +124/−0
- bundle/arraysort/arraysort-debug.js +3/−3
- bundle/arraysort/arraysort-min.js +2/−2
- bundle/arraysort/arraysort.js +3/−3
- bundle/assets/skins/sam/autocomplete-list.css +1/−1
- bundle/assets/skins/sam/calendar-base.css +2/−2
- bundle/assets/skins/sam/calendar.css +2/−2
- bundle/assets/skins/sam/calendarnavigator.css +2/−2
- bundle/assets/skins/sam/console-filters.css +1/−1
- bundle/assets/skins/sam/console.css +1/−1
- bundle/assets/skins/sam/datatable-base-deprecated.css +1/−1
- bundle/assets/skins/sam/datatable-base.css +1/−1
- bundle/assets/skins/sam/datatable-message.css +1/−1
- bundle/assets/skins/sam/datatable-scroll.css +1/−1
- bundle/assets/skins/sam/datatable-sort.css +1/−1
- bundle/assets/skins/sam/dial.css +1/−1
- bundle/assets/skins/sam/dt-arrow-dn.png binary
- bundle/assets/skins/sam/dt-arrow-up.png binary
- bundle/assets/skins/sam/node-flick.css +1/−1
- bundle/assets/skins/sam/node-menunav.css +1/−1
- bundle/assets/skins/sam/overlay.css +1/−1
- bundle/assets/skins/sam/panel.css +1/−1
- bundle/assets/skins/sam/resize-base.css +2/−2
- bundle/assets/skins/sam/scrollview-base.css +1/−1
- bundle/assets/skins/sam/scrollview-list.css +1/−1
- bundle/assets/skins/sam/scrollview-scrollbars.css +1/−1
- bundle/assets/skins/sam/skin.css +5/−6
- bundle/assets/skins/sam/slider-base.css +1/−1
- bundle/assets/skins/sam/sort-arrow-sprite-ie.png binary
- bundle/assets/skins/sam/sort-arrow-sprite.png binary
- bundle/assets/skins/sam/tabview.css +1/−1
- bundle/assets/skins/sam/test-console.css +1/−1
- bundle/assets/skins/sam/test.css +0/−7
- bundle/assets/skins/sam/widget-base.css +1/−1
- bundle/assets/skins/sam/widget-buttons.css +1/−1
- bundle/assets/skins/sam/widget-modality.css +1/−1
- bundle/assets/skins/sam/widget-stack.css +1/−1
- bundle/async-queue/async-queue-coverage.js +685/−0
- bundle/async-queue/async-queue-debug.js +3/−3
- bundle/async-queue/async-queue-min.js +2/−2
- bundle/async-queue/async-queue.js +3/−3
- bundle/attribute-base/attribute-base-coverage.js +158/−0
- bundle/attribute-base/attribute-base-debug.js +3/−4
- bundle/attribute-base/attribute-base-min.js +2/−2
- bundle/attribute-base/attribute-base.js +3/−4
- bundle/attribute-complex/attribute-complex-coverage.js +214/−0
- bundle/attribute-complex/attribute-complex-debug.js +21/−14
- bundle/attribute-complex/attribute-complex-min.js +2/−2
- bundle/attribute-complex/attribute-complex.js +21/−14
- bundle/attribute-core/attribute-core-coverage.js +1309/−0
- bundle/attribute-core/attribute-core-debug.js +72/−56
- bundle/attribute-core/attribute-core-min.js +2/−2
- bundle/attribute-core/attribute-core.js +72/−56
- bundle/attribute-events/attribute-events-coverage.js +275/−0
- bundle/attribute-events/attribute-events-debug.js +24/−3
- bundle/attribute-events/attribute-events-min.js +2/−2
- bundle/attribute-events/attribute-events.js +24/−3
- bundle/attribute-extras/attribute-extras-coverage.js +220/−0
- bundle/attribute-extras/attribute-extras-debug.js +3/−3
- bundle/attribute-extras/attribute-extras-min.js +2/−2
- bundle/attribute-extras/attribute-extras.js +3/−3
- bundle/autocomplete-base/autocomplete-base-coverage.js +1818/−0
- bundle/autocomplete-base/autocomplete-base-debug.js +3/−3
- bundle/autocomplete-base/autocomplete-base-min.js +2/−3
- bundle/autocomplete-base/autocomplete-base.js +3/−3
- bundle/autocomplete-filters-accentfold/autocomplete-filters-accentfold-coverage.js +218/−0
- bundle/autocomplete-filters-accentfold/autocomplete-filters-accentfold-debug.js +3/−3
- bundle/autocomplete-filters-accentfold/autocomplete-filters-accentfold-min.js +2/−2
- bundle/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js +3/−3
- bundle/autocomplete-filters/autocomplete-filters-coverage.js +334/−0
- bundle/autocomplete-filters/autocomplete-filters-debug.js +3/−3
- bundle/autocomplete-filters/autocomplete-filters-min.js +2/−2
- bundle/autocomplete-filters/autocomplete-filters.js +3/−3
- bundle/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold-coverage.js +172/−0
- bundle/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold-debug.js +3/−3
- bundle/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold-min.js +2/−2
- bundle/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js +3/−3
- bundle/autocomplete-highlighters/autocomplete-highlighters-coverage.js +273/−0
- bundle/autocomplete-highlighters/autocomplete-highlighters-debug.js +3/−3
- bundle/autocomplete-highlighters/autocomplete-highlighters-min.js +2/−2
- bundle/autocomplete-highlighters/autocomplete-highlighters.js +3/−3
- bundle/autocomplete-list-keys/autocomplete-list-keys-coverage.js +281/−0
- bundle/autocomplete-list-keys/autocomplete-list-keys-debug.js +3/−3
- bundle/autocomplete-list-keys/autocomplete-list-keys-min.js +2/−2
- bundle/autocomplete-list-keys/autocomplete-list-keys.js +3/−3
- bundle/autocomplete-list/assets/autocomplete-list-core.css +1/−1
- bundle/autocomplete-list/assets/skins/night/autocomplete-list-skin.css +1/−1
- bundle/autocomplete-list/assets/skins/night/autocomplete-list.css +1/−1
- bundle/autocomplete-list/assets/skins/sam/autocomplete-list-skin.css +1/−1
- bundle/autocomplete-list/assets/skins/sam/autocomplete-list.css +1/−1
- bundle/autocomplete-list/autocomplete-list-coverage.js +1131/−0
- bundle/autocomplete-list/autocomplete-list-debug.js +16/−9
- bundle/autocomplete-list/autocomplete-list-min.js +2/−3
- bundle/autocomplete-list/autocomplete-list.js +16/−9
- bundle/autocomplete-list/lang/autocomplete-list.js +2/−2
- bundle/autocomplete-list/lang/autocomplete-list_en.js +2/−2
- bundle/autocomplete-plugin/autocomplete-plugin-coverage.js +99/−0
- bundle/autocomplete-plugin/autocomplete-plugin-debug.js +3/−3
- bundle/autocomplete-plugin/autocomplete-plugin-min.js +2/−2
- bundle/autocomplete-plugin/autocomplete-plugin.js +3/−3
- bundle/autocomplete-sources/autocomplete-sources-coverage.js +648/−0
- bundle/autocomplete-sources/autocomplete-sources-debug.js +4/−5
- bundle/autocomplete-sources/autocomplete-sources-min.js +2/−2
- bundle/autocomplete-sources/autocomplete-sources.js +4/−5
- bundle/base-base/base-base-coverage.js +437/−0
- bundle/base-base/base-base-debug.js +5/−5
- bundle/base-base/base-base-min.js +2/−2
- bundle/base-base/base-base.js +5/−5
- bundle/base-build/base-build-coverage.js +597/−0
- bundle/base-build/base-build-debug.js +5/−5
- bundle/base-build/base-build-min.js +2/−2
- bundle/base-build/base-build.js +5/−5
- bundle/base-core/base-core-coverage.js +808/−0
- bundle/base-core/base-core-debug.js +13/−9
- bundle/base-core/base-core-min.js +2/−2
- bundle/base-core/base-core.js +13/−9
- bundle/base-pluginhost/base-pluginhost-coverage.js +81/−0
- bundle/base-pluginhost/base-pluginhost-debug.js +3/−3
- bundle/base-pluginhost/base-pluginhost-min.js +2/−2
- bundle/base-pluginhost/base-pluginhost.js +3/−3
- bundle/button-base/assets/icon-sprite-dark-and-light-24.png binary
- bundle/button-base/button-base-debug.js +0/−344
- bundle/button-base/button-base-min.js +0/−7
- bundle/button-base/button-base.js +0/−344
- bundle/button-core/button-core-coverage.js +340/−0
- bundle/button-core/button-core-debug.js +3/−3
- bundle/button-core/button-core-min.js +2/−2
- bundle/button-core/button-core.js +3/−3
- bundle/button-group/assets/icon-sprite-dark-and-light-24.png binary
- bundle/button-group/button-group-coverage.js +267/−0
- bundle/button-group/button-group-debug.js +22/−11
- bundle/button-group/button-group-min.js +2/−2
- bundle/button-group/button-group.js +22/−11
- bundle/button-plugin/button-plugin-coverage.js +202/−0
- bundle/button-plugin/button-plugin-debug.js +3/−3
- bundle/button-plugin/button-plugin-min.js +2/−2
- bundle/button-plugin/button-plugin.js +3/−3
- bundle/button/button-coverage.js +420/−0
- bundle/button/button-debug.js +3/−3
- bundle/button/button-min.js +2/−2
- bundle/button/button.js +3/−3
- bundle/cache-base/cache-base-coverage.js +546/−0
- bundle/cache-base/cache-base-debug.js +3/−3
- bundle/cache-base/cache-base-min.js +2/−2
- bundle/cache-base/cache-base.js +3/−3
- bundle/cache-offline/cache-offline-coverage.js +439/−0
- bundle/cache-offline/cache-offline-debug.js +3/−3
- bundle/cache-offline/cache-offline-min.js +2/−2
- bundle/cache-offline/cache-offline.js +3/−3
- bundle/cache-plugin/cache-plugin-coverage.js +101/−0
- bundle/cache-plugin/cache-plugin-debug.js +3/−3
- bundle/cache-plugin/cache-plugin-min.js +2/−2
- bundle/cache-plugin/cache-plugin.js +3/−3
- bundle/calendar-base/assets/calendar-base-core.css +1/−1
- bundle/calendar-base/assets/calendar-core.css +0/−37
- bundle/calendar-base/assets/calendarnavigator-core.css +0/−22
- bundle/calendar-base/assets/skins/night/calendar-base-skin.css +1/−1
- bundle/calendar-base/assets/skins/night/calendar-base.css +2/−2
- bundle/calendar-base/assets/skins/night/calendar-skin.css +0/−13
- bundle/calendar-base/assets/skins/night/calendarnavigator-skin.css +0/−39
- bundle/calendar-base/assets/skins/sam/calendar-base-skin.css +1/−1
- bundle/calendar-base/assets/skins/sam/calendar-base.css +2/−2
- bundle/calendar-base/assets/skins/sam/calendar-skin.css +0/−13
- bundle/calendar-base/assets/skins/sam/calendarnavigator-skin.css +0/−39
- bundle/calendar-base/calendar-base-coverage.js +2082/−0
- bundle/calendar-base/calendar-base-debug.js +13/−76
- bundle/calendar-base/calendar-base-min.js +2/−4
- bundle/calendar-base/calendar-base.js +13/−76
- bundle/calendar-base/lang/calendar-base.js +2/−2
- bundle/calendar-base/lang/calendar-base_de.js +2/−2
- bundle/calendar-base/lang/calendar-base_en.js +2/−2
- bundle/calendar-base/lang/calendar-base_fr.js +2/−2
- bundle/calendar-base/lang/calendar-base_ja.js +2/−2
- bundle/calendar-base/lang/calendar-base_nb-NO.js +2/−2
- bundle/calendar-base/lang/calendar-base_pt-BR.js +2/−2
- bundle/calendar-base/lang/calendar-base_ru.js +2/−2
- bundle/calendar-base/lang/calendar-base_zh-HANT-TW.js +2/−2
- bundle/calendar/assets/calendar-base-core.css +0/−27
- bundle/calendar/assets/calendar-core.css +1/−1
- bundle/calendar/assets/calendarnavigator-core.css +0/−22
- bundle/calendar/assets/skins/night/calendar-base-skin.css +0/−88
- bundle/calendar/assets/skins/night/calendar-skin.css +1/−1
- bundle/calendar/assets/skins/night/calendar.css +2/−2
- bundle/calendar/assets/skins/night/calendarnavigator-skin.css +0/−39
- bundle/calendar/assets/skins/sam/calendar-base-skin.css +0/−94
- bundle/calendar/assets/skins/sam/calendar-skin.css +1/−1
- bundle/calendar/assets/skins/sam/calendar.css +2/−2
- bundle/calendar/assets/skins/sam/calendarnavigator-skin.css +0/−39
- bundle/calendar/calendar-base-debug.js +0/−183
- bundle/calendar/calendar-base-min.js +0/−7
- bundle/calendar/calendar-base.js +0/−182
- bundle/calendar/calendar-coverage.js +759/−0
- bundle/calendar/calendar-debug.js +63/−54
- bundle/calendar/calendar-min.js +2/−2
- bundle/calendar/calendar.js +63/−54
- bundle/calendar/lang/calendar.js +2/−2
- bundle/calendar/lang/calendar_de.js +2/−2
- bundle/calendar/lang/calendar_en.js +2/−2
- bundle/calendar/lang/calendar_fr.js +2/−2
- bundle/calendar/lang/calendar_ja.js +2/−2
- bundle/calendar/lang/calendar_nb-NO.js +2/−2
- bundle/calendar/lang/calendar_pt-BR.js +2/−2
- bundle/calendar/lang/calendar_ru.js +2/−2
- bundle/calendar/lang/calendar_zh-HANT-TW.js +2/−2
- bundle/calendarnavigator/assets/calendar-base-core.css +0/−27
- bundle/calendarnavigator/assets/calendar-core.css +0/−37
- bundle/calendarnavigator/assets/calendarnavigator-core.css +1/−1
- bundle/calendarnavigator/assets/skins/night/calendar-base-skin.css +0/−88
- bundle/calendarnavigator/assets/skins/night/calendar-skin.css +0/−13
- bundle/calendarnavigator/assets/skins/night/calendarnavigator-skin.css +1/−1
- bundle/calendarnavigator/assets/skins/night/calendarnavigator.css +2/−2
- bundle/calendarnavigator/assets/skins/sam/calendar-base-skin.css +0/−94
- bundle/calendarnavigator/assets/skins/sam/calendar-skin.css +0/−13
- bundle/calendarnavigator/assets/skins/sam/calendarnavigator-skin.css +1/−1
- bundle/calendarnavigator/assets/skins/sam/calendarnavigator.css +2/−2
- bundle/calendarnavigator/calendarnavigator-coverage.js +410/−0
- bundle/calendarnavigator/calendarnavigator-debug.js +23/−6
- bundle/calendarnavigator/calendarnavigator-min.js +2/−2
- bundle/calendarnavigator/calendarnavigator.js +23/−6
- bundle/charts-base/charts-base-coverage.js +20682/−0
- bundle/charts-base/charts-base-debug.js +16204/−15450
- bundle/charts-base/charts-base-min.js +2/−22
- bundle/charts-base/charts-base.js +16204/−15450
- bundle/charts-legend/charts-legend-coverage.js +2307/−0
- bundle/charts-legend/charts-legend-debug.js +50/−17
- bundle/charts-legend/charts-legend-min.js +2/−4
- bundle/charts-legend/charts-legend.js +50/−17
- bundle/charts/charts-coverage.js +71/−0
- bundle/charts/charts-debug.js +3/−3
- bundle/charts/charts-min.js +2/−2
- bundle/charts/charts.js +3/−3
- bundle/classnamemanager/classnamemanager-coverage.js +138/−0
- bundle/classnamemanager/classnamemanager-debug.js +3/−3
- bundle/classnamemanager/classnamemanager-min.js +2/−2
- bundle/classnamemanager/classnamemanager.js +3/−3
- bundle/clickable-rail/assets/slider-base-core.css +1/−1
- bundle/clickable-rail/assets/slider-core.css +1/−1
- bundle/clickable-rail/clickable-rail-coverage.js +290/−0
- bundle/clickable-rail/clickable-rail-debug.js +3/−4
- bundle/clickable-rail/clickable-rail-min.js +2/−2
- bundle/clickable-rail/clickable-rail.js +3/−4
- bundle/console-filters/assets/console-filters-core.css +1/−1
- bundle/console-filters/assets/skins/sam/console-filters-skin.css +1/−1
- bundle/console-filters/assets/skins/sam/console-filters.css +1/−1
- bundle/console-filters/console-filters-coverage.js +920/−0
- bundle/console-filters/console-filters-debug.js +7/−7
- bundle/console-filters/console-filters-min.js +2/−2
- bundle/console-filters/console-filters.js +7/−7
- bundle/console/assets/console-core.css +1/−1
- bundle/console/assets/console-filters-core.css +1/−1
- bundle/console/assets/skins/sam/console-filters-skin.css +1/−1
- bundle/console/assets/skins/sam/console-filters.css +1/−1
- bundle/console/assets/skins/sam/console-skin.css +1/−1
- bundle/console/assets/skins/sam/console.css +1/−1
- bundle/console/console-coverage.js +1792/−0
- bundle/console/console-debug.js +8/−8
- bundle/console/console-min.js +2/−3
- bundle/console/console.js +8/−8
- bundle/console/lang/console.js +2/−2
- bundle/console/lang/console_en.js +2/−2
- bundle/console/lang/console_es.js +2/−2
- bundle/console/lang/console_ja.js +2/−2
- bundle/cookie/cookie-coverage.js +678/−0
- bundle/cookie/cookie-debug.js +3/−3
- bundle/cookie/cookie-min.js +2/−2
- bundle/cookie/cookie.js +3/−3
- bundle/createlink-base/createlink-base-coverage.js +151/−0
- bundle/createlink-base/createlink-base-debug.js +3/−3
- bundle/createlink-base/createlink-base-min.js +2/−2
- bundle/createlink-base/createlink-base.js +3/−3
- bundle/cssbase-context/base-context-min.css +1/−1
- bundle/cssbase-context/base-context.css +1/−1
- bundle/cssbase-context/cssbase-context-min.css +1/−1
- bundle/cssbase-context/cssbase-context.css +2/−1
- bundle/cssbase/base-min.css +1/−1
- bundle/cssbase/base.css +1/−1
- bundle/cssbase/cssbase-min.css +1/−1
- bundle/cssbase/cssbase.css +2/−1
- bundle/cssbutton/cssbutton-min.css +1/−1
- bundle/cssbutton/cssbutton.css +2/−1
- bundle/cssfonts-context/cssfonts-context-min.css +1/−1
- bundle/cssfonts-context/cssfonts-context.css +1/−1
- bundle/cssfonts-context/fonts-context-min.css +1/−1
- bundle/cssfonts-context/fonts-context.css +1/−1
- bundle/cssfonts/cssfonts-min.css +1/−1
- bundle/cssfonts/cssfonts.css +1/−1
- bundle/cssfonts/fonts-min.css +1/−1
- bundle/cssfonts/fonts.css +1/−1
- bundle/cssgrids-base/cssgrids-base-min.css +1/−1
- bundle/cssgrids-base/cssgrids-base.css +2/−1
- bundle/cssgrids-context-deprecated/grids-context-min.css +1/−1
- bundle/cssgrids-context-deprecated/grids-context.css +1/−1
- bundle/cssgrids-units/cssgrids-units-min.css +1/−1
- bundle/cssgrids-units/cssgrids-units.css +2/−1
- bundle/cssgrids/cssgrids-min.css +1/−1
- bundle/cssgrids/cssgrids.css +2/−1
- bundle/cssgrids/grids-min.css +1/−1
- bundle/cssgrids/grids.css +1/−1
- bundle/cssreset-context/cssreset-context-min.css +1/−1
- bundle/cssreset-context/cssreset-context.css +2/−1
- bundle/cssreset-context/reset-context-min.css +1/−1
- bundle/cssreset-context/reset-context.css +1/−1
- bundle/cssreset/cssreset-min.css +1/−1
- bundle/cssreset/cssreset.css +2/−1
- bundle/cssreset/reset-min.css +1/−1
- bundle/cssreset/reset.css +1/−1
- bundle/dataschema-array/dataschema-array-coverage.js +255/−0
- bundle/dataschema-array/dataschema-array-debug.js +3/−3
- bundle/dataschema-array/dataschema-array-min.js +2/−2
- bundle/dataschema-array/dataschema-array.js +3/−3
- bundle/dataschema-base/dataschema-base-coverage.js +118/−0
- bundle/dataschema-base/dataschema-base-debug.js +3/−3
- bundle/dataschema-base/dataschema-base-min.js +2/−2
- bundle/dataschema-base/dataschema-base.js +3/−3
- bundle/dataschema-json/dataschema-json-coverage.js +576/−0
- bundle/dataschema-json/dataschema-json-debug.js +3/−3
- bundle/dataschema-json/dataschema-json-min.js +2/−2
- bundle/dataschema-json/dataschema-json.js +3/−3
- bundle/dataschema-text/dataschema-text-coverage.js +250/−0
- bundle/dataschema-text/dataschema-text-debug.js +3/−3
- bundle/dataschema-text/dataschema-text-min.js +2/−2
- bundle/dataschema-text/dataschema-text.js +3/−3
- bundle/dataschema-xml/dataschema-xml-coverage.js too large to diff
- bundle/dataschema-xml/dataschema-xml-debug.js too large to diff
- bundle/dataschema-xml/dataschema-xml-min.js too large to diff
- bundle/dataschema-xml/dataschema-xml.js too large to diff
- bundle/datasource-arrayschema/datasource-arrayschema-coverage.js too large to diff
- bundle/datasource-arrayschema/datasource-arrayschema-debug.js too large to diff
- bundle/datasource-arrayschema/datasource-arrayschema-min.js too large to diff
- bundle/datasource-arrayschema/datasource-arrayschema.js too large to diff
- bundle/datasource-cache/datasource-cache-coverage.js too large to diff
- bundle/datasource-cache/datasource-cache-debug.js too large to diff
- bundle/datasource-cache/datasource-cache-min.js too large to diff
- bundle/datasource-cache/datasource-cache.js too large to diff
- bundle/datasource-function/datasource-function-coverage.js too large to diff
- bundle/datasource-function/datasource-function-debug.js too large to diff
- bundle/datasource-function/datasource-function-min.js too large to diff
- bundle/datasource-function/datasource-function.js too large to diff
- bundle/datasource-get/datasource-get-coverage.js too large to diff
- bundle/datasource-get/datasource-get-debug.js too large to diff
- bundle/datasource-get/datasource-get-min.js too large to diff
- bundle/datasource-get/datasource-get.js too large to diff
- bundle/datasource-io/datasource-io-coverage.js too large to diff
- bundle/datasource-io/datasource-io-debug.js too large to diff
- bundle/datasource-io/datasource-io-min.js too large to diff
- bundle/datasource-io/datasource-io.js too large to diff
- bundle/datasource-jsonschema/datasource-jsonschema-coverage.js too large to diff
- bundle/datasource-jsonschema/datasource-jsonschema-debug.js too large to diff
- bundle/datasource-jsonschema/datasource-jsonschema-min.js too large to diff
- bundle/datasource-jsonschema/datasource-jsonschema.js too large to diff
- bundle/datasource-local/datasource-local-coverage.js too large to diff
- bundle/datasource-local/datasource-local-debug.js too large to diff
- bundle/datasource-local/datasource-local-min.js too large to diff
- bundle/datasource-local/datasource-local.js too large to diff
- bundle/datasource-polling/datasource-polling-coverage.js too large to diff
- bundle/datasource-polling/datasource-polling-debug.js too large to diff
- bundle/datasource-polling/datasource-polling-min.js too large to diff
- bundle/datasource-polling/datasource-polling.js too large to diff
- bundle/datasource-textschema/datasource-textschema-coverage.js too large to diff
- bundle/datasource-textschema/datasource-textschema-debug.js too large to diff
- bundle/datasource-textschema/datasource-textschema-min.js too large to diff
- bundle/datasource-textschema/datasource-textschema.js too large to diff
- bundle/datasource-xmlschema/datasource-xmlschema-coverage.js too large to diff
- bundle/datasource-xmlschema/datasource-xmlschema-debug.js too large to diff
- bundle/datasource-xmlschema/datasource-xmlschema-min.js too large to diff
- bundle/datasource-xmlschema/datasource-xmlschema.js too large to diff
- bundle/datatable-base-deprecated/assets/datatable-base-deprecated-core.css too large to diff
- bundle/datatable-base-deprecated/assets/skins/night/datatable-base-deprecated-skin.css too large to diff
- bundle/datatable-base-deprecated/assets/skins/night/datatable-base-deprecated.css too large to diff
- bundle/datatable-base-deprecated/assets/skins/sam/datatable-base-deprecated-skin.css too large to diff
- bundle/datatable-base-deprecated/assets/skins/sam/datatable-base-deprecated.css too large to diff
- bundle/datatable-base-deprecated/assets/skins/sam/dt-arrow-dn.png too large to diff
- bundle/datatable-base-deprecated/assets/skins/sam/dt-arrow-up.png too large to diff
- bundle/datatable-base-deprecated/datatable-base-deprecated-coverage.js too large to diff
- bundle/datatable-base-deprecated/datatable-base-deprecated-debug.js too large to diff
- bundle/datatable-base-deprecated/datatable-base-deprecated-min.js too large to diff
- bundle/datatable-base-deprecated/datatable-base-deprecated.js too large to diff
- bundle/datatable-base/assets/datatable-base-core.css too large to diff
- bundle/datatable-base/assets/skins/night/datatable-base-skin.css too large to diff
- bundle/datatable-base/assets/skins/night/datatable-base.css too large to diff
- bundle/datatable-base/assets/skins/sam/datatable-base-skin.css too large to diff
- bundle/datatable-base/assets/skins/sam/datatable-base.css too large to diff
- bundle/datatable-base/datatable-base-coverage.js too large to diff
- bundle/datatable-base/datatable-base-debug.js too large to diff
- bundle/datatable-base/datatable-base-min.js too large to diff
- bundle/datatable-base/datatable-base.js too large to diff
- bundle/datatable-body/datatable-body-coverage.js too large to diff
- bundle/datatable-body/datatable-body-debug.js too large to diff
- bundle/datatable-body/datatable-body-min.js too large to diff
- bundle/datatable-body/datatable-body.js too large to diff
- bundle/datatable-column-widths/datatable-column-widths-coverage.js too large to diff
- bundle/datatable-column-widths/datatable-column-widths-debug.js too large to diff
- bundle/datatable-column-widths/datatable-column-widths-min.js too large to diff
- bundle/datatable-column-widths/datatable-column-widths.js too large to diff
- bundle/datatable-core/datatable-core-coverage.js too large to diff
- bundle/datatable-core/datatable-core-debug.js too large to diff
- bundle/datatable-core/datatable-core-min.js too large to diff
- bundle/datatable-core/datatable-core.js too large to diff
- bundle/datatable-datasource-deprecated/datatable-datasource-deprecated-coverage.js too large to diff
- bundle/datatable-datasource-deprecated/datatable-datasource-deprecated-debug.js too large to diff
- bundle/datatable-datasource-deprecated/datatable-datasource-deprecated-min.js too large to diff
- bundle/datatable-datasource-deprecated/datatable-datasource-deprecated.js too large to diff
- bundle/datatable-datasource/datatable-datasource-coverage.js too large to diff
- bundle/datatable-datasource/datatable-datasource-debug.js too large to diff
- bundle/datatable-datasource/datatable-datasource-min.js too large to diff
- bundle/datatable-datasource/datatable-datasource.js too large to diff
- bundle/datatable-head/datatable-head-coverage.js too large to diff
- bundle/datatable-head/datatable-head-debug.js too large to diff
- bundle/datatable-head/datatable-head-min.js too large to diff
- bundle/datatable-head/datatable-head.js too large to diff
- bundle/datatable-message/assets/datatable-message-core.css too large to diff
- bundle/datatable-message/assets/skins/night/datatable-message-skin.css too large to diff
- bundle/datatable-message/assets/skins/night/datatable-message.css too large to diff
- bundle/datatable-message/assets/skins/sam/datatable-message-skin.css too large to diff
- bundle/datatable-message/assets/skins/sam/datatable-message.css too large to diff
- bundle/datatable-message/datatable-message-coverage.js too large to diff
- bundle/datatable-message/datatable-message-debug.js too large to diff
- bundle/datatable-message/datatable-message-min.js too large to diff
- bundle/datatable-message/datatable-message.js too large to diff
- bundle/datatable-message/lang/datatable-message.js too large to diff
- bundle/datatable-message/lang/datatable-message_en.js too large to diff
- bundle/datatable-mutable/datatable-mutable-coverage.js too large to diff
- bundle/datatable-mutable/datatable-mutable-debug.js too large to diff
- bundle/datatable-mutable/datatable-mutable-min.js too large to diff
- bundle/datatable-mutable/datatable-mutable.js too large to diff
- bundle/datatable-scroll-deprecated/datatable-scroll-deprecated-coverage.js too large to diff
- bundle/datatable-scroll-deprecated/datatable-scroll-deprecated-debug.js too large to diff
- bundle/datatable-scroll-deprecated/datatable-scroll-deprecated-min.js too large to diff
- bundle/datatable-scroll-deprecated/datatable-scroll-deprecated.js too large to diff
- bundle/datatable-scroll/assets/datatable-scroll-core.css too large to diff
- bundle/datatable-scroll/assets/skins/night/datatable-scroll-skin.css too large to diff
- bundle/datatable-scroll/assets/skins/night/datatable-scroll.css too large to diff
- bundle/datatable-scroll/assets/skins/sam/datatable-scroll-skin.css too large to diff
- bundle/datatable-scroll/assets/skins/sam/datatable-scroll.css too large to diff
- bundle/datatable-scroll/datatable-scroll-coverage.js too large to diff
- bundle/datatable-scroll/datatable-scroll-debug.js too large to diff
- bundle/datatable-scroll/datatable-scroll-min.js too large to diff
- bundle/datatable-scroll/datatable-scroll.js too large to diff
- bundle/datatable-sort-deprecated/datatable-sort-deprecated-coverage.js too large to diff
- bundle/datatable-sort-deprecated/datatable-sort-deprecated-debug.js too large to diff
- bundle/datatable-sort-deprecated/datatable-sort-deprecated-min.js too large to diff
- bundle/datatable-sort-deprecated/datatable-sort-deprecated.js too large to diff
- bundle/datatable-sort-deprecated/lang/datatable-sort-deprecated.js too large to diff
- bundle/datatable-sort-deprecated/lang/datatable-sort-deprecated_en.js too large to diff
- bundle/datatable-sort/assets/datatable-sort-core.css too large to diff
- bundle/datatable-sort/assets/skins/night/datatable-sort-skin.css too large to diff
- bundle/datatable-sort/assets/skins/night/datatable-sort.css too large to diff
- bundle/datatable-sort/assets/skins/night/sort-arrow-sprite-ie.png too large to diff
- bundle/datatable-sort/assets/skins/night/sort-arrow-sprite.png too large to diff
- bundle/datatable-sort/assets/skins/sam/datatable-sort-skin.css too large to diff
- bundle/datatable-sort/assets/skins/sam/datatable-sort.css too large to diff
- bundle/datatable-sort/assets/skins/sam/sort-arrow-sprite-ie.png too large to diff
- bundle/datatable-sort/assets/skins/sam/sort-arrow-sprite.png too large to diff
- bundle/datatable-sort/datatable-sort-coverage.js too large to diff
- bundle/datatable-sort/datatable-sort-debug.js too large to diff
- bundle/datatable-sort/datatable-sort-min.js too large to diff
- bundle/datatable-sort/datatable-sort.js too large to diff
- bundle/datatable-sort/lang/datatable-sort.js too large to diff
- bundle/datatable-sort/lang/datatable-sort_en.js too large to diff
- bundle/datatable-table/datatable-table-coverage.js too large to diff
- bundle/datatable-table/datatable-table-debug.js too large to diff
- bundle/datatable-table/datatable-table-min.js too large to diff
- bundle/datatable-table/datatable-table.js too large to diff
- bundle/datatype-date-format/datatype-date-format-coverage.js too large to diff
- bundle/datatype-date-format/datatype-date-format-debug.js too large to diff
- bundle/datatype-date-format/datatype-date-format-min.js too large to diff
- bundle/datatype-date-format/datatype-date-format.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_ar-JO.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_ar.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_ca-ES.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_ca.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_da-DK.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_da.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_de-AT.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_de-DE.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_de.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_el-GR.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_el.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_en-AU.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_en-CA.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_en-GB.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_en-IE.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_en-IN.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_en-JO.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_en-MY.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_en-NZ.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_en-PH.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_en-SG.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_en-US.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_en.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_es-AR.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_es-BO.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_es-CL.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_es-CO.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_es-EC.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_es-ES.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_es-MX.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_es-PE.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_es-PY.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_es-US.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_es-UY.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_es-VE.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_es.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_fi-FI.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_fi.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_fr-BE.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_fr-CA.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_fr-FR.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_fr.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_hi-IN.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_hi.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_id-ID.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_id.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_it-IT.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_it.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_ja-JP.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_ja.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_ko-KR.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_ko.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_ms-MY.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_ms.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_nb-NO.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_nb.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_nl-BE.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_nl-NL.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_nl.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_pl-PL.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_pl.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_pt-BR.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_pt.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_ro-RO.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_ro.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_ru-RU.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_ru.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_sv-SE.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_sv.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_th-TH.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_th.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_tr-TR.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_tr.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_vi-VN.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_vi.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_zh-Hans-CN.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_zh-Hans.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_zh-Hant-HK.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_zh-Hant-TW.js too large to diff
- bundle/datatype-date-format/lang/datatype-date-format_zh-Hant.js too large to diff
- bundle/datatype-date-math/datatype-date-math-coverage.js too large to diff
- bundle/datatype-date-math/datatype-date-math-debug.js too large to diff
- bundle/datatype-date-math/datatype-date-math-min.js too large to diff
- bundle/datatype-date-math/datatype-date-math.js too large to diff
- bundle/datatype-date-parse/datatype-date-parse-coverage.js too large to diff
- bundle/datatype-date-parse/datatype-date-parse-debug.js too large to diff
- bundle/datatype-date-parse/datatype-date-parse-min.js too large to diff
- bundle/datatype-date-parse/datatype-date-parse.js too large to diff
- bundle/datatype-number-format/datatype-number-format-coverage.js too large to diff
- bundle/datatype-number-format/datatype-number-format-debug.js too large to diff
- bundle/datatype-number-format/datatype-number-format-min.js too large to diff
- bundle/datatype-number-format/datatype-number-format.js too large to diff
- bundle/datatype-number-parse/datatype-number-parse-coverage.js too large to diff
- bundle/datatype-number-parse/datatype-number-parse-debug.js too large to diff
- bundle/datatype-number-parse/datatype-number-parse-min.js too large to diff
- bundle/datatype-number-parse/datatype-number-parse.js too large to diff
- bundle/datatype-xml-format/datatype-xml-format-coverage.js too large to diff
- bundle/datatype-xml-format/datatype-xml-format-debug.js too large to diff
- bundle/datatype-xml-format/datatype-xml-format-min.js too large to diff
- bundle/datatype-xml-format/datatype-xml-format.js too large to diff
- bundle/datatype-xml-parse/datatype-xml-parse-coverage.js too large to diff
- bundle/datatype-xml-parse/datatype-xml-parse-debug.js too large to diff
- bundle/datatype-xml-parse/datatype-xml-parse-min.js too large to diff
- bundle/datatype-xml-parse/datatype-xml-parse.js too large to diff
- bundle/dd-constrain/dd-constrain-coverage.js too large to diff
- bundle/dd-constrain/dd-constrain-debug.js too large to diff
- bundle/dd-constrain/dd-constrain-min.js too large to diff
- bundle/dd-constrain/dd-constrain.js too large to diff
- bundle/dd-ddm-base/dd-ddm-base-coverage.js too large to diff
- bundle/dd-ddm-base/dd-ddm-base-debug.js too large to diff
- bundle/dd-ddm-base/dd-ddm-base-min.js too large to diff
- bundle/dd-ddm-base/dd-ddm-base.js too large to diff
- bundle/dd-ddm-drop/dd-ddm-drop-coverage.js too large to diff
- bundle/dd-ddm-drop/dd-ddm-drop-debug.js too large to diff
- bundle/dd-ddm-drop/dd-ddm-drop-min.js too large to diff
- bundle/dd-ddm-drop/dd-ddm-drop.js too large to diff
- bundle/dd-ddm/dd-ddm-coverage.js too large to diff
- bundle/dd-ddm/dd-ddm-debug.js too large to diff
- bundle/dd-ddm/dd-ddm-min.js too large to diff
- bundle/dd-ddm/dd-ddm.js too large to diff
- bundle/dd-delegate/dd-delegate-coverage.js too large to diff
- bundle/dd-delegate/dd-delegate-debug.js too large to diff
- bundle/dd-delegate/dd-delegate-min.js too large to diff
- bundle/dd-delegate/dd-delegate.js too large to diff
- bundle/dd-drag/dd-drag-coverage.js too large to diff
- bundle/dd-drag/dd-drag-debug.js too large to diff
- bundle/dd-drag/dd-drag-min.js too large to diff
- bundle/dd-drag/dd-drag.js too large to diff
- bundle/dd-drop-plugin/dd-drop-plugin-coverage.js too large to diff
- bundle/dd-drop-plugin/dd-drop-plugin-debug.js too large to diff
- bundle/dd-drop-plugin/dd-drop-plugin-min.js too large to diff
- bundle/dd-drop-plugin/dd-drop-plugin.js too large to diff
- bundle/dd-drop/dd-drop-coverage.js too large to diff
- bundle/dd-drop/dd-drop-debug.js too large to diff
- bundle/dd-drop/dd-drop-min.js too large to diff
- bundle/dd-drop/dd-drop.js too large to diff
- bundle/dd-gestures/dd-gestures-coverage.js too large to diff
- bundle/dd-gestures/dd-gestures-debug.js too large to diff
- bundle/dd-gestures/dd-gestures-min.js too large to diff
- bundle/dd-gestures/dd-gestures.js too large to diff
- bundle/dd-plugin/dd-plugin-coverage.js too large to diff
- bundle/dd-plugin/dd-plugin-debug.js too large to diff
- bundle/dd-plugin/dd-plugin-min.js too large to diff
- bundle/dd-plugin/dd-plugin.js too large to diff
- bundle/dd-proxy/dd-proxy-coverage.js too large to diff
- bundle/dd-proxy/dd-proxy-debug.js too large to diff
- bundle/dd-proxy/dd-proxy-min.js too large to diff
- bundle/dd-proxy/dd-proxy.js too large to diff
- bundle/dd-scroll/dd-scroll-coverage.js too large to diff
- bundle/dd-scroll/dd-scroll-debug.js too large to diff
- bundle/dd-scroll/dd-scroll-min.js too large to diff
- bundle/dd-scroll/dd-scroll.js too large to diff
- bundle/dial/assets/dial-core.css too large to diff
- bundle/dial/assets/skins/night/dial-skin.css too large to diff
- bundle/dial/assets/skins/night/dial.css too large to diff
- bundle/dial/assets/skins/sam/dial-skin.css too large to diff
- bundle/dial/assets/skins/sam/dial.css too large to diff
- bundle/dial/dial-coverage.js too large to diff
- bundle/dial/dial-debug.js too large to diff
- bundle/dial/dial-min.js too large to diff
- bundle/dial/dial.js too large to diff
- bundle/dial/lang/dial.js too large to diff
- bundle/dial/lang/dial_en.js too large to diff
- bundle/dial/lang/dial_es.js too large to diff
- bundle/dom-attrs/dom-attrs-debug.js too large to diff
- bundle/dom-attrs/dom-attrs-min.js too large to diff
- bundle/dom-attrs/dom-attrs.js too large to diff
- bundle/dom-base/dom-base-coverage.js too large to diff
- bundle/dom-base/dom-base-debug.js too large to diff
- bundle/dom-base/dom-base-min.js too large to diff
- bundle/dom-base/dom-base.js too large to diff
- bundle/dom-class/dom-class-debug.js too large to diff
- bundle/dom-class/dom-class-min.js too large to diff
- bundle/dom-class/dom-class.js too large to diff
- bundle/dom-core/dom-core-coverage.js too large to diff
- bundle/dom-core/dom-core-debug.js too large to diff
- bundle/dom-core/dom-core-min.js too large to diff
- bundle/dom-core/dom-core.js too large to diff
- bundle/dom-create/dom-create-debug.js too large to diff
- bundle/dom-create/dom-create-min.js too large to diff
- bundle/dom-create/dom-create.js too large to diff
- bundle/dom-deprecated/dom-deprecated-coverage.js too large to diff
- bundle/dom-deprecated/dom-deprecated-debug.js too large to diff
- bundle/dom-deprecated/dom-deprecated-min.js too large to diff
- bundle/dom-deprecated/dom-deprecated.js too large to diff
- bundle/dom-screen/dom-screen-coverage.js too large to diff
- bundle/dom-screen/dom-screen-debug.js too large to diff
- bundle/dom-screen/dom-screen-min.js too large to diff
- bundle/dom-screen/dom-screen.js too large to diff
- bundle/dom-size/dom-size-debug.js too large to diff
- bundle/dom-size/dom-size-min.js too large to diff
- bundle/dom-size/dom-size.js too large to diff
- bundle/dom-style-ie/dom-style-ie-coverage.js too large to diff
- bundle/dom-style-ie/dom-style-ie-debug.js too large to diff
- bundle/dom-style-ie/dom-style-ie-min.js too large to diff
- bundle/dom-style-ie/dom-style-ie.js too large to diff
- bundle/dom-style/dom-style-coverage.js too large to diff
- bundle/dom-style/dom-style-debug.js too large to diff
- bundle/dom-style/dom-style-min.js too large to diff
- bundle/dom-style/dom-style.js too large to diff
- bundle/dump/dump-coverage.js too large to diff
- bundle/dump/dump-debug.js too large to diff
- bundle/dump/dump-min.js too large to diff
- bundle/dump/dump.js too large to diff
- bundle/editor-base/editor-base-coverage.js too large to diff
- bundle/editor-base/editor-base-debug.js too large to diff
- bundle/editor-base/editor-base-min.js too large to diff
- bundle/editor-base/editor-base.js too large to diff
- bundle/editor-bidi/editor-bidi-coverage.js too large to diff
- bundle/editor-bidi/editor-bidi-debug.js too large to diff
- bundle/editor-bidi/editor-bidi-min.js too large to diff
- bundle/editor-bidi/editor-bidi.js too large to diff
- bundle/editor-br/editor-br-coverage.js too large to diff
- bundle/editor-br/editor-br-debug.js too large to diff
- bundle/editor-br/editor-br-min.js too large to diff
- bundle/editor-br/editor-br.js too large to diff
- bundle/editor-lists/editor-lists-coverage.js too large to diff
- bundle/editor-lists/editor-lists-debug.js too large to diff
- bundle/editor-lists/editor-lists-min.js too large to diff
- bundle/editor-lists/editor-lists.js too large to diff
- bundle/editor-para-base/editor-para-base-coverage.js too large to diff
- bundle/editor-para-base/editor-para-base-debug.js too large to diff
- bundle/editor-para-base/editor-para-base-min.js too large to diff
- bundle/editor-para-base/editor-para-base.js too large to diff
- bundle/editor-para-ie/editor-para-ie-coverage.js too large to diff
- bundle/editor-para-ie/editor-para-ie-debug.js too large to diff
- bundle/editor-para-ie/editor-para-ie-min.js too large to diff
- bundle/editor-para-ie/editor-para-ie.js too large to diff
- bundle/editor-para/editor-para-coverage.js too large to diff
- bundle/editor-para/editor-para-debug.js too large to diff
- bundle/editor-para/editor-para-min.js too large to diff
- bundle/editor-para/editor-para.js too large to diff
- bundle/editor-selection/editor-selection-coverage.js too large to diff
- bundle/editor-selection/editor-selection-debug.js too large to diff
- bundle/editor-selection/editor-selection-min.js too large to diff
- bundle/editor-selection/editor-selection.js too large to diff
- bundle/editor-tab/editor-tab-coverage.js too large to diff
- bundle/editor-tab/editor-tab-debug.js too large to diff
- bundle/editor-tab/editor-tab-min.js too large to diff
- bundle/editor-tab/editor-tab.js too large to diff
- bundle/escape/escape-coverage.js too large to diff
- bundle/escape/escape-debug.js too large to diff
- bundle/escape/escape-min.js too large to diff
- bundle/escape/escape.js too large to diff
- bundle/event-base-ie/event-base-ie-coverage.js too large to diff
- bundle/event-base-ie/event-base-ie-debug.js too large to diff
- bundle/event-base-ie/event-base-ie-min.js too large to diff
- bundle/event-base-ie/event-base-ie.js too large to diff
- bundle/event-base/event-base-coverage.js too large to diff
- bundle/event-base/event-base-debug.js too large to diff
- bundle/event-base/event-base-min.js too large to diff
- bundle/event-base/event-base.js too large to diff
- bundle/event-contextmenu/event-contextmenu-coverage.js too large to diff
- bundle/event-contextmenu/event-contextmenu-debug.js too large to diff
- bundle/event-contextmenu/event-contextmenu-min.js too large to diff
- bundle/event-contextmenu/event-contextmenu.js too large to diff
- bundle/event-custom-base/event-custom-base-coverage.js too large to diff
- bundle/event-custom-base/event-custom-base-debug.js too large to diff
- bundle/event-custom-base/event-custom-base-min.js too large to diff
- bundle/event-custom-base/event-custom-base.js too large to diff
- bundle/event-custom-complex/event-custom-complex-coverage.js too large to diff
- bundle/event-custom-complex/event-custom-complex-debug.js too large to diff
- bundle/event-custom-complex/event-custom-complex-min.js too large to diff
- bundle/event-custom-complex/event-custom-complex.js too large to diff
- bundle/event-delegate/event-delegate-coverage.js too large to diff
- bundle/event-delegate/event-delegate-debug.js too large to diff
- bundle/event-delegate/event-delegate-min.js too large to diff
- bundle/event-delegate/event-delegate.js too large to diff
- bundle/event-flick/event-flick-coverage.js too large to diff
- bundle/event-flick/event-flick-debug.js too large to diff
- bundle/event-flick/event-flick-min.js too large to diff
- bundle/event-flick/event-flick.js too large to diff
- bundle/event-focus/event-focus-coverage.js too large to diff
- bundle/event-focus/event-focus-debug.js too large to diff
- bundle/event-focus/event-focus-min.js too large to diff
- bundle/event-focus/event-focus.js too large to diff
- bundle/event-hover/event-hover-coverage.js too large to diff
- bundle/event-hover/event-hover-debug.js too large to diff
- bundle/event-hover/event-hover-min.js too large to diff
- bundle/event-hover/event-hover.js too large to diff
- bundle/event-key/event-key-coverage.js too large to diff
- bundle/event-key/event-key-debug.js too large to diff
- bundle/event-key/event-key-min.js too large to diff
- bundle/event-key/event-key.js too large to diff
- bundle/event-mouseenter/event-mouseenter-coverage.js too large to diff
- bundle/event-mouseenter/event-mouseenter-debug.js too large to diff
- bundle/event-mouseenter/event-mouseenter-min.js too large to diff
- bundle/event-mouseenter/event-mouseenter.js too large to diff
- bundle/event-mousewheel/event-mousewheel-coverage.js too large to diff
- bundle/event-mousewheel/event-mousewheel-debug.js too large to diff
- bundle/event-mousewheel/event-mousewheel-min.js too large to diff
- bundle/event-mousewheel/event-mousewheel.js too large to diff
- bundle/event-move/event-move-coverage.js too large to diff
- bundle/event-move/event-move-debug.js too large to diff
- bundle/event-move/event-move-min.js too large to diff
- bundle/event-move/event-move.js too large to diff
- bundle/event-outside/event-outside-coverage.js too large to diff
- bundle/event-outside/event-outside-debug.js too large to diff
- bundle/event-outside/event-outside-min.js too large to diff
- bundle/event-outside/event-outside.js too large to diff
- bundle/event-resize/event-resize-coverage.js too large to diff
- bundle/event-resize/event-resize-debug.js too large to diff
- bundle/event-resize/event-resize-min.js too large to diff
- bundle/event-resize/event-resize.js too large to diff
- bundle/event-simulate/event-simulate-coverage.js too large to diff
- bundle/event-simulate/event-simulate-debug.js too large to diff
- bundle/event-simulate/event-simulate-min.js too large to diff
- bundle/event-simulate/event-simulate.js too large to diff
- bundle/event-synthetic/event-synthetic-coverage.js too large to diff
- bundle/event-synthetic/event-synthetic-debug.js too large to diff
- bundle/event-synthetic/event-synthetic-min.js too large to diff
- bundle/event-synthetic/event-synthetic.js too large to diff
- bundle/event-tap/event-tap-coverage.js too large to diff
- bundle/event-tap/event-tap-debug.js too large to diff
- bundle/event-tap/event-tap-min.js too large to diff
- bundle/event-tap/event-tap.js too large to diff
- bundle/event-touch/event-touch-coverage.js too large to diff
- bundle/event-touch/event-touch-debug.js too large to diff
- bundle/event-touch/event-touch-min.js too large to diff
- bundle/event-touch/event-touch.js too large to diff
- bundle/event-valuechange/event-valuechange-coverage.js too large to diff
- bundle/event-valuechange/event-valuechange-debug.js too large to diff
- bundle/event-valuechange/event-valuechange-min.js too large to diff
- bundle/event-valuechange/event-valuechange.js too large to diff
- bundle/exec-command/exec-command-coverage.js too large to diff
- bundle/exec-command/exec-command-debug.js too large to diff
- bundle/exec-command/exec-command-min.js too large to diff
- bundle/exec-command/exec-command.js too large to diff
- bundle/features/features-coverage.js too large to diff
- bundle/features/features-debug.js too large to diff
- bundle/features/features-min.js too large to diff
- bundle/features/features.js too large to diff
- bundle/file-flash/file-flash-coverage.js too large to diff
- bundle/file-flash/file-flash-debug.js too large to diff
- bundle/file-flash/file-flash-min.js too large to diff
- bundle/file-flash/file-flash.js too large to diff
- bundle/file-html5/file-html5-coverage.js too large to diff
- bundle/file-html5/file-html5-debug.js too large to diff
- bundle/file-html5/file-html5-min.js too large to diff
- bundle/file-html5/file-html5.js too large to diff
- bundle/file/file-coverage.js too large to diff
- bundle/file/file-debug.js too large to diff
- bundle/file/file-min.js too large to diff
- bundle/file/file.js too large to diff
- bundle/frame/frame-coverage.js too large to diff
- bundle/frame/frame-debug.js too large to diff
- bundle/frame/frame-min.js too large to diff
- bundle/frame/frame.js too large to diff
- bundle/gesture-simulate/gesture-simulate-coverage.js too large to diff
- bundle/gesture-simulate/gesture-simulate-debug.js too large to diff
- bundle/gesture-simulate/gesture-simulate-min.js too large to diff
- bundle/gesture-simulate/gesture-simulate.js too large to diff
- bundle/get-nodejs/get-coverage.js too large to diff
- bundle/get-nodejs/get-debug.js too large to diff
- bundle/get-nodejs/get-min.js too large to diff
- bundle/get-nodejs/get-nodejs-coverage.js too large to diff
- bundle/get-nodejs/get-nodejs-debug.js too large to diff
- bundle/get-nodejs/get-nodejs-min.js too large to diff
- bundle/get-nodejs/get-nodejs.js too large to diff
- bundle/get-nodejs/get.js too large to diff
- bundle/get/get-coverage.js too large to diff
- bundle/get/get-debug.js too large to diff
- bundle/get/get-min.js too large to diff
- bundle/get/get.js too large to diff
- bundle/graphics-canvas-default/graphics-canvas-default-coverage.js too large to diff
- bundle/graphics-canvas-default/graphics-canvas-default-debug.js too large to diff
- bundle/graphics-canvas-default/graphics-canvas-default-min.js too large to diff
- bundle/graphics-canvas-default/graphics-canvas-default.js too large to diff
- bundle/graphics-canvas/graphics-canvas-coverage.js too large to diff
- bundle/graphics-canvas/graphics-canvas-debug.js too large to diff
- bundle/graphics-canvas/graphics-canvas-min.js too large to diff
- bundle/graphics-canvas/graphics-canvas.js too large to diff
- bundle/graphics-svg-default/graphics-svg-default-coverage.js too large to diff
- bundle/graphics-svg-default/graphics-svg-default-debug.js too large to diff
- bundle/graphics-svg-default/graphics-svg-default-min.js too large to diff
- bundle/graphics-svg-default/graphics-svg-default.js too large to diff
- bundle/graphics-svg/graphics-svg-coverage.js too large to diff
- bundle/graphics-svg/graphics-svg-debug.js too large to diff
- bundle/graphics-svg/graphics-svg-min.js too large to diff
- bundle/graphics-svg/graphics-svg.js too large to diff
- bundle/graphics-vml-default/graphics-vml-default-coverage.js too large to diff
- bundle/graphics-vml-default/graphics-vml-default-debug.js too large to diff
- bundle/graphics-vml-default/graphics-vml-default-min.js too large to diff
- bundle/graphics-vml-default/graphics-vml-default.js too large to diff
- bundle/graphics-vml/graphics-vml-coverage.js too large to diff
- bundle/graphics-vml/graphics-vml-debug.js too large to diff
- bundle/graphics-vml/graphics-vml-min.js too large to diff
- bundle/graphics-vml/graphics-vml.js too large to diff
- bundle/graphics/graphics-coverage.js too large to diff
- bundle/graphics/graphics-debug.js too large to diff
- bundle/graphics/graphics-min.js too large to diff
- bundle/graphics/graphics.js too large to diff
- bundle/handlebars-base/handlebars-base-coverage.js too large to diff
- bundle/handlebars-base/handlebars-base-debug.js too large to diff
- bundle/handlebars-base/handlebars-base-min.js too large to diff
- bundle/handlebars-base/handlebars-base.js too large to diff
- bundle/handlebars-compiler/handlebars-compiler-coverage.js too large to diff
- bundle/handlebars-compiler/handlebars-compiler-debug.js too large to diff
- bundle/handlebars-compiler/handlebars-compiler-min.js too large to diff
- bundle/handlebars-compiler/handlebars-compiler.js too large to diff
- bundle/highlight-accentfold/highlight-accentfold-coverage.js too large to diff
- bundle/highlight-accentfold/highlight-accentfold-debug.js too large to diff
- bundle/highlight-accentfold/highlight-accentfold-min.js too large to diff
- bundle/highlight-accentfold/highlight-accentfold.js too large to diff
- bundle/highlight-base/highlight-base-coverage.js too large to diff
- bundle/highlight-base/highlight-base-debug.js too large to diff
- bundle/highlight-base/highlight-base-min.js too large to diff
- bundle/highlight-base/highlight-base.js too large to diff
- bundle/history-base/history-base-coverage.js too large to diff
- bundle/history-base/history-base-debug.js too large to diff
- bundle/history-base/history-base-min.js too large to diff
- bundle/history-base/history-base.js too large to diff
- bundle/history-hash-ie/history-hash-ie-coverage.js too large to diff
- bundle/history-hash-ie/history-hash-ie-debug.js too large to diff
- bundle/history-hash-ie/history-hash-ie-min.js too large to diff
- bundle/history-hash-ie/history-hash-ie.js too large to diff
- bundle/history-hash/history-hash-coverage.js too large to diff
- bundle/history-hash/history-hash-debug.js too large to diff
- bundle/history-hash/history-hash-min.js too large to diff
- bundle/history-hash/history-hash.js too large to diff
- bundle/history-html5/history-html5-coverage.js too large to diff
- bundle/history-html5/history-html5-debug.js too large to diff
- bundle/history-html5/history-html5-min.js too large to diff
- bundle/history-html5/history-html5.js too large to diff
- bundle/imageloader/imageloader-coverage.js too large to diff
- bundle/imageloader/imageloader-debug.js too large to diff
- bundle/imageloader/imageloader-min.js too large to diff
- bundle/imageloader/imageloader.js too large to diff
- bundle/intl-base/intl-base-coverage.js too large to diff
- bundle/intl-base/intl-base-debug.js too large to diff
- bundle/intl-base/intl-base-min.js too large to diff
- bundle/intl-base/intl-base.js too large to diff
- bundle/intl/intl-coverage.js too large to diff
- bundle/intl/intl-debug.js too large to diff
- bundle/intl/intl-min.js too large to diff
- bundle/intl/intl.js too large to diff
- bundle/io-base/io-base-coverage.js too large to diff
- bundle/io-base/io-base-debug.js too large to diff
- bundle/io-base/io-base-min.js too large to diff
- bundle/io-base/io-base.js too large to diff
- bundle/io-form/io-form-coverage.js too large to diff
- bundle/io-form/io-form-debug.js too large to diff
- bundle/io-form/io-form-min.js too large to diff
- bundle/io-form/io-form.js too large to diff
- bundle/io-nodejs/io-nodejs-coverage.js too large to diff
- bundle/io-nodejs/io-nodejs-debug.js too large to diff
- bundle/io-nodejs/io-nodejs-min.js too large to diff
- bundle/io-nodejs/io-nodejs.js too large to diff
- bundle/io-queue/io-queue-coverage.js too large to diff
- bundle/io-queue/io-queue-debug.js too large to diff
- bundle/io-queue/io-queue-min.js too large to diff
- bundle/io-queue/io-queue.js too large to diff
- bundle/io-upload-iframe/io-upload-iframe-coverage.js too large to diff
- bundle/io-upload-iframe/io-upload-iframe-debug.js too large to diff
- bundle/io-upload-iframe/io-upload-iframe-min.js too large to diff
- bundle/io-upload-iframe/io-upload-iframe.js too large to diff
- bundle/io-xdr/io-xdr-coverage.js too large to diff
- bundle/io-xdr/io-xdr-debug.js too large to diff
- bundle/io-xdr/io-xdr-min.js too large to diff
- bundle/io-xdr/io-xdr.js too large to diff
- bundle/json-parse/json-parse-coverage.js too large to diff
- bundle/json-parse/json-parse-debug.js too large to diff
- bundle/json-parse/json-parse-min.js too large to diff
- bundle/json-parse/json-parse.js too large to diff
- bundle/json-stringify/json-stringify-coverage.js too large to diff
- bundle/json-stringify/json-stringify-debug.js too large to diff
- bundle/json-stringify/json-stringify-min.js too large to diff
- bundle/json-stringify/json-stringify.js too large to diff
- bundle/jsonp-url/jsonp-url-coverage.js too large to diff
- bundle/jsonp-url/jsonp-url-debug.js too large to diff
- bundle/jsonp-url/jsonp-url-min.js too large to diff
- bundle/jsonp-url/jsonp-url.js too large to diff
- bundle/jsonp/jsonp-coverage.js too large to diff
- bundle/jsonp/jsonp-debug.js too large to diff
- bundle/jsonp/jsonp-min.js too large to diff
- bundle/jsonp/jsonp.js too large to diff
- bundle/lazy-model-list/lazy-model-list-coverage.js too large to diff
- bundle/lazy-model-list/lazy-model-list-debug.js too large to diff
- bundle/lazy-model-list/lazy-model-list-min.js too large to diff
- bundle/lazy-model-list/lazy-model-list.js too large to diff
- bundle/loader-base/loader-base-coverage.js too large to diff
- bundle/loader-base/loader-base-debug.js too large to diff
- bundle/loader-base/loader-base-min.js too large to diff
- bundle/loader-base/loader-base.js too large to diff
- bundle/loader-rollup/loader-rollup-coverage.js too large to diff
- bundle/loader-rollup/loader-rollup-debug.js too large to diff
- bundle/loader-rollup/loader-rollup-min.js too large to diff
- bundle/loader-rollup/loader-rollup.js too large to diff
- bundle/loader-yui3/loader-yui3-coverage.js too large to diff
- bundle/loader-yui3/loader-yui3-debug.js too large to diff
- bundle/loader-yui3/loader-yui3-min.js too large to diff
- bundle/loader-yui3/loader-yui3.js too large to diff
- bundle/loader/loader-coverage.js too large to diff
- bundle/loader/loader-debug.js too large to diff
- bundle/loader/loader-min.js too large to diff
- bundle/loader/loader.js too large to diff
- bundle/matrix/matrix-coverage.js too large to diff
- bundle/matrix/matrix-debug.js too large to diff
- bundle/matrix/matrix-min.js too large to diff
- bundle/matrix/matrix.js too large to diff
- bundle/model-list/model-list-coverage.js too large to diff
- bundle/model-list/model-list-debug.js too large to diff
- bundle/model-list/model-list-min.js too large to diff
- bundle/model-list/model-list.js too large to diff
- bundle/model-sync-rest/model-sync-rest-coverage.js too large to diff
- bundle/model-sync-rest/model-sync-rest-debug.js too large to diff
- bundle/model-sync-rest/model-sync-rest-min.js too large to diff
- bundle/model-sync-rest/model-sync-rest.js too large to diff
- bundle/model/model-coverage.js too large to diff
- bundle/model/model-debug.js too large to diff
- bundle/model/model-min.js too large to diff
- bundle/model/model.js too large to diff
- bundle/node-base/node-base-coverage.js too large to diff
- bundle/node-base/node-base-debug.js too large to diff
- bundle/node-base/node-base-min.js too large to diff
- bundle/node-base/node-base.js too large to diff
- bundle/node-core/node-core-coverage.js too large to diff
- bundle/node-core/node-core-debug.js too large to diff
- bundle/node-core/node-core-min.js too large to diff
- bundle/node-core/node-core.js too large to diff
- bundle/node-deprecated/node-deprecated-coverage.js too large to diff
- bundle/node-deprecated/node-deprecated-debug.js too large to diff
- bundle/node-deprecated/node-deprecated-min.js too large to diff
- bundle/node-deprecated/node-deprecated.js too large to diff
- bundle/node-event-delegate/node-event-delegate-coverage.js too large to diff
- bundle/node-event-delegate/node-event-delegate-debug.js too large to diff
- bundle/node-event-delegate/node-event-delegate-min.js too large to diff
- bundle/node-event-delegate/node-event-delegate.js too large to diff
- bundle/node-event-html5/node-event-html5-coverage.js too large to diff
- bundle/node-event-html5/node-event-html5-debug.js too large to diff
- bundle/node-event-html5/node-event-html5-min.js too large to diff
- bundle/node-event-html5/node-event-html5.js too large to diff
- bundle/node-event-simulate/node-event-simulate-coverage.js too large to diff
- bundle/node-event-simulate/node-event-simulate-debug.js too large to diff
- bundle/node-event-simulate/node-event-simulate-min.js too large to diff
- bundle/node-event-simulate/node-event-simulate.js too large to diff
- bundle/node-flick/assets/node-flick-core.css too large to diff
- bundle/node-flick/assets/skins/sam/node-flick-skin.css too large to diff
- bundle/node-flick/assets/skins/sam/node-flick.css too large to diff
- bundle/node-flick/node-flick-coverage.js too large to diff
- bundle/node-flick/node-flick-debug.js too large to diff
- bundle/node-flick/node-flick-min.js too large to diff
- bundle/node-flick/node-flick.js too large to diff
- bundle/node-focusmanager/node-focusmanager-coverage.js too large to diff
- bundle/node-focusmanager/node-focusmanager-debug.js too large to diff
- bundle/node-focusmanager/node-focusmanager-min.js too large to diff
- bundle/node-focusmanager/node-focusmanager.js too large to diff
- bundle/node-load/node-load-coverage.js too large to diff
- bundle/node-load/node-load-debug.js too large to diff
- bundle/node-load/node-load-min.js too large to diff
- bundle/node-load/node-load.js too large to diff
- bundle/node-menunav/assets/node-menunav-core.css too large to diff
- bundle/node-menunav/assets/skins/night/node-menunav-skin.css too large to diff
- bundle/node-menunav/assets/skins/night/node-menunav.css too large to diff
- bundle/node-menunav/assets/skins/sam/node-menunav-skin.css too large to diff
- bundle/node-menunav/assets/skins/sam/node-menunav.css too large to diff
- bundle/node-menunav/node-menunav-coverage.js too large to diff
- bundle/node-menunav/node-menunav-debug.js too large to diff
- bundle/node-menunav/node-menunav-min.js too large to diff
- bundle/node-menunav/node-menunav.js too large to diff
- bundle/node-pluginhost/node-pluginhost-coverage.js too large to diff
- bundle/node-pluginhost/node-pluginhost-debug.js too large to diff
- bundle/node-pluginhost/node-pluginhost-min.js too large to diff
- bundle/node-pluginhost/node-pluginhost.js too large to diff
- bundle/node-screen/node-screen-coverage.js too large to diff
- bundle/node-screen/node-screen-debug.js too large to diff
- bundle/node-screen/node-screen-min.js too large to diff
- bundle/node-screen/node-screen.js too large to diff
- bundle/node-scroll-info/node-scroll-info-coverage.js too large to diff
- bundle/node-scroll-info/node-scroll-info-debug.js too large to diff
- bundle/node-scroll-info/node-scroll-info-min.js too large to diff
- bundle/node-scroll-info/node-scroll-info.js too large to diff
- bundle/node-style/node-style-coverage.js too large to diff
- bundle/node-style/node-style-debug.js too large to diff
- bundle/node-style/node-style-min.js too large to diff
- bundle/node-style/node-style.js too large to diff
- bundle/oop/oop-coverage.js too large to diff
- bundle/oop/oop-debug.js too large to diff
- bundle/oop/oop-min.js too large to diff
- bundle/oop/oop.js too large to diff
- bundle/overlay/assets/overlay-core.css too large to diff
- bundle/overlay/assets/skins/night/overlay-skin.css too large to diff
- bundle/overlay/assets/skins/night/overlay.css too large to diff
- bundle/overlay/assets/skins/sam/overlay-skin.css too large to diff
- bundle/overlay/assets/skins/sam/overlay.css too large to diff
- bundle/overlay/overlay-coverage.js too large to diff
- bundle/overlay/overlay-debug.js too large to diff
- bundle/overlay/overlay-min.js too large to diff
- bundle/overlay/overlay.js too large to diff
- bundle/panel/assets/panel-core.css too large to diff
- bundle/panel/assets/raw/icons_window_close_max_restore_min.psd too large to diff
- bundle/panel/assets/skins/night/panel-skin.css too large to diff
- bundle/panel/assets/skins/night/panel.css too large to diff
- bundle/panel/assets/skins/sam/panel-skin.css too large to diff
- bundle/panel/assets/skins/sam/panel.css too large to diff
- bundle/panel/panel-coverage.js too large to diff
- bundle/panel/panel-debug.js too large to diff
- bundle/panel/panel-min.js too large to diff
- bundle/panel/panel.js too large to diff
- bundle/parallel/parallel-coverage.js too large to diff
- bundle/parallel/parallel-debug.js too large to diff
- bundle/parallel/parallel-min.js too large to diff
- bundle/parallel/parallel.js too large to diff
- bundle/pjax-base/pjax-base-coverage.js too large to diff
- bundle/pjax-base/pjax-base-debug.js too large to diff
- bundle/pjax-base/pjax-base-min.js too large to diff
- bundle/pjax-base/pjax-base.js too large to diff
- bundle/pjax-content/pjax-content-coverage.js too large to diff
- bundle/pjax-content/pjax-content-debug.js too large to diff
- bundle/pjax-content/pjax-content-min.js too large to diff
- bundle/pjax-content/pjax-content.js too large to diff
- bundle/pjax-plugin/pjax-plugin-coverage.js too large to diff
- bundle/pjax-plugin/pjax-plugin-debug.js too large to diff
- bundle/pjax-plugin/pjax-plugin-min.js too large to diff
- bundle/pjax-plugin/pjax-plugin.js too large to diff
- bundle/pjax/pjax-coverage.js too large to diff
- bundle/pjax/pjax-debug.js too large to diff
- bundle/pjax/pjax-min.js too large to diff
- bundle/pjax/pjax.js too large to diff
- bundle/plugin/plugin-coverage.js too large to diff
- bundle/plugin/plugin-debug.js too large to diff
- bundle/plugin/plugin-min.js too large to diff
- bundle/plugin/plugin.js too large to diff
- bundle/pluginhost-base/pluginhost-base-coverage.js too large to diff
- bundle/pluginhost-base/pluginhost-base-debug.js too large to diff
- bundle/pluginhost-base/pluginhost-base-min.js too large to diff
- bundle/pluginhost-base/pluginhost-base.js too large to diff
- bundle/pluginhost-config/pluginhost-config-coverage.js too large to diff
- bundle/pluginhost-config/pluginhost-config-debug.js too large to diff
- bundle/pluginhost-config/pluginhost-config-min.js too large to diff
- bundle/pluginhost-config/pluginhost-config.js too large to diff
- bundle/profiler/profiler-coverage.js too large to diff
- bundle/profiler/profiler-debug.js too large to diff
- bundle/profiler/profiler-min.js too large to diff
- bundle/profiler/profiler.js too large to diff
- bundle/querystring-parse-simple/querystring-parse-simple-coverage.js too large to diff
- bundle/querystring-parse-simple/querystring-parse-simple-debug.js too large to diff
- bundle/querystring-parse-simple/querystring-parse-simple-min.js too large to diff
- bundle/querystring-parse-simple/querystring-parse-simple.js too large to diff
- bundle/querystring-parse/querystring-parse-coverage.js too large to diff
- bundle/querystring-parse/querystring-parse-debug.js too large to diff
- bundle/querystring-parse/querystring-parse-min.js too large to diff
- bundle/querystring-parse/querystring-parse.js too large to diff
- bundle/querystring-stringify-simple/querystring-stringify-simple-coverage.js too large to diff
- bundle/querystring-stringify-simple/querystring-stringify-simple-debug.js too large to diff
- bundle/querystring-stringify-simple/querystring-stringify-simple-min.js too large to diff
- bundle/querystring-stringify-simple/querystring-stringify-simple.js too large to diff
- bundle/querystring-stringify/querystring-stringify-coverage.js too large to diff
- bundle/querystring-stringify/querystring-stringify-debug.js too large to diff
- bundle/querystring-stringify/querystring-stringify-min.js too large to diff
- bundle/querystring-stringify/querystring-stringify.js too large to diff
- bundle/queue-promote/queue-promote-coverage.js too large to diff
- bundle/queue-promote/queue-promote-debug.js too large to diff
- bundle/queue-promote/queue-promote-min.js too large to diff
- bundle/queue-promote/queue-promote.js too large to diff
- bundle/range-slider/assets/slider-base-core.css too large to diff
- bundle/range-slider/assets/slider-core.css too large to diff
- bundle/range-slider/range-slider-coverage.js too large to diff
- bundle/range-slider/range-slider-debug.js too large to diff
- bundle/range-slider/range-slider-min.js too large to diff
- bundle/range-slider/range-slider.js too large to diff
- bundle/recordset-base/recordset-base-coverage.js too large to diff
- bundle/recordset-base/recordset-base-debug.js too large to diff
- bundle/recordset-base/recordset-base-min.js too large to diff
- bundle/recordset-base/recordset-base.js too large to diff
- bundle/recordset-filter/recordset-filter-coverage.js too large to diff
- bundle/recordset-filter/recordset-filter-debug.js too large to diff
- bundle/recordset-filter/recordset-filter-min.js too large to diff
- bundle/recordset-filter/recordset-filter.js too large to diff
- bundle/recordset-indexer/recordset-indexer-coverage.js too large to diff
- bundle/recordset-indexer/recordset-indexer-debug.js too large to diff
- bundle/recordset-indexer/recordset-indexer-min.js too large to diff
- bundle/recordset-indexer/recordset-indexer.js too large to diff
- bundle/recordset-sort/recordset-sort-coverage.js too large to diff
- bundle/recordset-sort/recordset-sort-debug.js too large to diff
- bundle/recordset-sort/recordset-sort-min.js too large to diff
- bundle/recordset-sort/recordset-sort.js too large to diff
- bundle/resize-base/assets/resize-base-core.css too large to diff
- bundle/resize-base/assets/skins/night/resize-base-skin.css too large to diff
- bundle/resize-base/assets/skins/night/resize-base.css too large to diff
- bundle/resize-base/assets/skins/sam/resize-base-skin.css too large to diff
- bundle/resize-base/assets/skins/sam/resize-base.css too large to diff
- bundle/resize-base/resize-base-coverage.js too large to diff
- bundle/resize-base/resize-base-debug.js too large to diff
- bundle/resize-base/resize-base-min.js too large to diff
- bundle/resize-base/resize-base.js too large to diff
- bundle/resize-constrain/assets/resize-base-core.css too large to diff
- bundle/resize-constrain/assets/skins/night/arrows.png too large to diff
- bundle/resize-constrain/assets/skins/night/resize-base-skin.css too large to diff
- bundle/resize-constrain/assets/skins/sam/arrows.png too large to diff
- bundle/resize-constrain/assets/skins/sam/resize-base-skin.css too large to diff
- bundle/resize-constrain/resize-constrain-coverage.js too large to diff
- bundle/resize-constrain/resize-constrain-debug.js too large to diff
- bundle/resize-constrain/resize-constrain-min.js too large to diff
- bundle/resize-constrain/resize-constrain.js too large to diff
- bundle/resize-plugin/assets/resize-base-core.css too large to diff
- bundle/resize-plugin/assets/skins/night/arrows.png too large to diff
- bundle/resize-plugin/assets/skins/night/resize-base-skin.css too large to diff
- bundle/resize-plugin/assets/skins/sam/arrows.png too large to diff
- bundle/resize-plugin/assets/skins/sam/resize-base-skin.css too large to diff
- bundle/resize-plugin/resize-plugin-coverage.js too large to diff
- bundle/resize-plugin/resize-plugin-debug.js too large to diff
- bundle/resize-plugin/resize-plugin-min.js too large to diff
- bundle/resize-plugin/resize-plugin.js too large to diff
- bundle/resize-proxy/assets/resize-base-core.css too large to diff
- bundle/resize-proxy/assets/skins/night/arrows.png too large to diff
- bundle/resize-proxy/assets/skins/night/resize-base-skin.css too large to diff
- bundle/resize-proxy/assets/skins/sam/arrows.png too large to diff
- bundle/resize-proxy/assets/skins/sam/resize-base-skin.css too large to diff
- bundle/resize-proxy/resize-proxy-coverage.js too large to diff
- bundle/resize-proxy/resize-proxy-debug.js too large to diff
- bundle/resize-proxy/resize-proxy-min.js too large to diff
- bundle/resize-proxy/resize-proxy.js too large to diff
- bundle/router/router-coverage.js too large to diff
- bundle/router/router-debug.js too large to diff
- bundle/router/router-min.js too large to diff
- bundle/router/router.js too large to diff
- bundle/scrollview-base-ie/scrollview-base-ie-coverage.js too large to diff
- bundle/scrollview-base-ie/scrollview-base-ie-debug.js too large to diff
- bundle/scrollview-base-ie/scrollview-base-ie-min.js too large to diff
- bundle/scrollview-base-ie/scrollview-base-ie.js too large to diff
- bundle/scrollview-base/assets/scrollview-base-core.css too large to diff
- bundle/scrollview-base/assets/skins/night/scrollview-base-skin.css too large to diff
- bundle/scrollview-base/assets/skins/night/scrollview-base.css too large to diff
- bundle/scrollview-base/assets/skins/sam/scrollview-base-skin.css too large to diff
- bundle/scrollview-base/assets/skins/sam/scrollview-base.css too large to diff
- bundle/scrollview-base/scrollview-base-coverage.js too large to diff
- bundle/scrollview-base/scrollview-base-debug.js too large to diff
- bundle/scrollview-base/scrollview-base-min.js too large to diff
- bundle/scrollview-base/scrollview-base.js too large to diff
- bundle/scrollview-list/assets/scrollview-list-core.css too large to diff
- bundle/scrollview-list/assets/skins/night/scrollview-list-skin.css too large to diff
- bundle/scrollview-list/assets/skins/night/scrollview-list.css too large to diff
- bundle/scrollview-list/assets/skins/sam/scrollview-list-skin.css too large to diff
- bundle/scrollview-list/assets/skins/sam/scrollview-list.css too large to diff
- bundle/scrollview-list/scrollview-list-coverage.js too large to diff
- bundle/scrollview-list/scrollview-list-debug.js too large to diff
- bundle/scrollview-list/scrollview-list-min.js too large to diff
- bundle/scrollview-list/scrollview-list.js too large to diff
- bundle/scrollview-paginator/scrollview-paginator-coverage.js too large to diff
- bundle/scrollview-paginator/scrollview-paginator-debug.js too large to diff
- bundle/scrollview-paginator/scrollview-paginator-min.js too large to diff
- bundle/scrollview-paginator/scrollview-paginator.js too large to diff
- bundle/scrollview-scrollbars/assets/scrollview-scrollbars-core.css too large to diff
- bundle/scrollview-scrollbars/assets/skins/night/scrollview-scrollbars-skin.css too large to diff
- bundle/scrollview-scrollbars/assets/skins/night/scrollview-scrollbars.css too large to diff
- bundle/scrollview-scrollbars/assets/skins/sam/scrollview-scrollbars-skin.css too large to diff
- bundle/scrollview-scrollbars/assets/skins/sam/scrollview-scrollbars.css too large to diff
- bundle/scrollview-scrollbars/scrollview-scrollbars-coverage.js too large to diff
- bundle/scrollview-scrollbars/scrollview-scrollbars-debug.js too large to diff
- bundle/scrollview-scrollbars/scrollview-scrollbars-min.js too large to diff
- bundle/scrollview-scrollbars/scrollview-scrollbars.js too large to diff
- bundle/scrollview/scrollview-coverage.js too large to diff
- bundle/scrollview/scrollview-debug.js too large to diff
- bundle/scrollview/scrollview-min.js too large to diff
- bundle/scrollview/scrollview.js too large to diff
- bundle/selector-css2/selector-css2-coverage.js too large to diff
- bundle/selector-css2/selector-css2-debug.js too large to diff
- bundle/selector-css2/selector-css2-min.js too large to diff
- bundle/selector-css2/selector-css2.js too large to diff
- bundle/selector-css3/selector-css3-coverage.js too large to diff
- bundle/selector-css3/selector-css3-debug.js too large to diff
- bundle/selector-css3/selector-css3-min.js too large to diff
- bundle/selector-css3/selector-css3.js too large to diff
- bundle/selector-native/selector-native-coverage.js too large to diff
- bundle/selector-native/selector-native-debug.js too large to diff
- bundle/selector-native/selector-native-min.js too large to diff
- bundle/selector-native/selector-native.js too large to diff
- bundle/selector/selector-coverage.js too large to diff
- bundle/selector/selector-debug.js too large to diff
- bundle/selector/selector-min.js too large to diff
- bundle/selector/selector.js too large to diff
- bundle/shim-plugin/shim-plugin-coverage.js too large to diff
- bundle/shim-plugin/shim-plugin-debug.js too large to diff
- bundle/shim-plugin/shim-plugin-min.js too large to diff
- bundle/shim-plugin/shim-plugin.js too large to diff
- bundle/simpleyui/simpleyui-debug.js too large to diff
- bundle/simpleyui/simpleyui-min.js too large to diff
- bundle/simpleyui/simpleyui.js too large to diff
- bundle/slider-base/assets/skins/audio-light/slider-base-skin.css too large to diff
- bundle/slider-base/assets/skins/audio-light/slider-base.css too large to diff
- bundle/slider-base/assets/skins/audio-light/slider-skin.css too large to diff
- bundle/slider-base/assets/skins/audio/slider-base-skin.css too large to diff
- bundle/slider-base/assets/skins/audio/slider-base.css too large to diff
- bundle/slider-base/assets/skins/audio/slider-skin.css too large to diff
- bundle/slider-base/assets/skins/capsule-dark/slider-base-skin.css too large to diff
- bundle/slider-base/assets/skins/capsule-dark/slider-base.css too large to diff
- bundle/slider-base/assets/skins/capsule-dark/slider-skin.css too large to diff
- bundle/slider-base/assets/skins/capsule/slider-base-skin.css too large to diff
- bundle/slider-base/assets/skins/capsule/slider-base.css too large to diff
- bundle/slider-base/assets/skins/capsule/slider-skin.css too large to diff
- bundle/slider-base/assets/skins/night/slider-base-skin.css too large to diff
- bundle/slider-base/assets/skins/night/slider-base.css too large to diff
- bundle/slider-base/assets/skins/night/slider-skin.css too large to diff
- bundle/slider-base/assets/skins/round-dark/slider-base-skin.css too large to diff
- bundle/slider-base/assets/skins/round-dark/slider-base.css too large to diff
- bundle/slider-base/assets/skins/round-dark/slider-skin.css too large to diff
- bundle/slider-base/assets/skins/round/slider-base-skin.css too large to diff
- bundle/slider-base/assets/skins/round/slider-base.css too large to diff
- bundle/slider-base/assets/skins/round/slider-skin.css too large to diff
- bundle/slider-base/assets/skins/sam-dark/slider-base-skin.css too large to diff
- bundle/slider-base/assets/skins/sam-dark/slider-base.css too large to diff
- bundle/slider-base/assets/skins/sam-dark/slider-skin.css too large to diff
- bundle/slider-base/assets/skins/sam/slider-base-skin.css too large to diff
- bundle/slider-base/assets/skins/sam/slider-base.css too large to diff
- bundle/slider-base/assets/skins/sam/slider-skin.css too large to diff
- bundle/slider-base/assets/slider-base-core.css too large to diff
- bundle/slider-base/assets/slider-core.css too large to diff
- bundle/slider-base/slider-base-coverage.js too large to diff
- bundle/slider-base/slider-base-debug.js too large to diff
- bundle/slider-base/slider-base-min.js too large to diff
- bundle/slider-base/slider-base.js too large to diff
- bundle/slider-value-range/assets/slider-base-core.css too large to diff
- bundle/slider-value-range/assets/slider-core.css too large to diff
- bundle/slider-value-range/slider-value-range-coverage.js too large to diff
- bundle/slider-value-range/slider-value-range-debug.js too large to diff
- bundle/slider-value-range/slider-value-range-min.js too large to diff
- bundle/slider-value-range/slider-value-range.js too large to diff
- bundle/sortable-scroll/sortable-scroll-coverage.js too large to diff
- bundle/sortable-scroll/sortable-scroll-debug.js too large to diff
- bundle/sortable-scroll/sortable-scroll-min.js too large to diff
- bundle/sortable-scroll/sortable-scroll.js too large to diff
- bundle/sortable/sortable-coverage.js too large to diff
- bundle/sortable/sortable-debug.js too large to diff
- bundle/sortable/sortable-min.js too large to diff
- bundle/sortable/sortable.js too large to diff
- bundle/stylesheet/stylesheet-coverage.js too large to diff
- bundle/stylesheet/stylesheet-debug.js too large to diff
- bundle/stylesheet/stylesheet-min.js too large to diff
- bundle/stylesheet/stylesheet.js too large to diff
- bundle/substitute/substitute-coverage.js too large to diff
- bundle/substitute/substitute-debug.js too large to diff
- bundle/substitute/substitute-min.js too large to diff
- bundle/substitute/substitute.js too large to diff
- bundle/swf/swf-coverage.js too large to diff
- bundle/swf/swf-debug.js too large to diff
- bundle/swf/swf-min.js too large to diff
- bundle/swf/swf.js too large to diff
- bundle/swfdetect/swfdetect-coverage.js too large to diff
- bundle/swfdetect/swfdetect-debug.js too large to diff
- bundle/swfdetect/swfdetect-min.js too large to diff
- bundle/swfdetect/swfdetect.js too large to diff
- bundle/tabview-base/assets/tabview-core.css too large to diff
- bundle/tabview-base/assets/tabview.css too large to diff
- bundle/tabview-base/tabview-base-coverage.js too large to diff
- bundle/tabview-base/tabview-base-debug.js too large to diff
- bundle/tabview-base/tabview-base-min.js too large to diff
- bundle/tabview-base/tabview-base.js too large to diff
- bundle/tabview-plugin/assets/tabview-core.css too large to diff
- bundle/tabview-plugin/assets/tabview.css too large to diff
- bundle/tabview-plugin/tabview-plugin-coverage.js too large to diff
- bundle/tabview-plugin/tabview-plugin-debug.js too large to diff
- bundle/tabview-plugin/tabview-plugin-min.js too large to diff
- bundle/tabview-plugin/tabview-plugin.js too large to diff
- bundle/tabview/assets/skins/night/tabview-skin.css too large to diff
- bundle/tabview/assets/skins/night/tabview.css too large to diff
- bundle/tabview/assets/skins/sam/tabview-skin.css too large to diff
- bundle/tabview/assets/skins/sam/tabview.css too large to diff
- bundle/tabview/assets/tabview-core.css too large to diff
- bundle/tabview/assets/tabview.css too large to diff
- bundle/tabview/tabview-coverage.js too large to diff
- bundle/tabview/tabview-debug.js too large to diff
- bundle/tabview/tabview-min.js too large to diff
- bundle/tabview/tabview.js too large to diff
- bundle/test-console/assets/skins/sam/test-console-skin.css too large to diff
- bundle/test-console/assets/skins/sam/test-console.css too large to diff
- bundle/test-console/assets/test-console-core.css too large to diff
- bundle/test-console/test-console-coverage.js too large to diff
- bundle/test-console/test-console-debug.js too large to diff
- bundle/test-console/test-console-min.js too large to diff
- bundle/test-console/test-console.js too large to diff
- bundle/test/assets/skins/sam/test-skin.css too large to diff
- bundle/test/assets/skins/sam/test.css too large to diff
- bundle/test/assets/test-console.css too large to diff
- bundle/test/test-coverage.js too large to diff
- bundle/test/test-debug.js too large to diff
- bundle/test/test-min.js too large to diff
- bundle/test/test.js too large to diff
- bundle/text-accentfold/text-accentfold-coverage.js too large to diff
- bundle/text-accentfold/text-accentfold-debug.js too large to diff
- bundle/text-accentfold/text-accentfold-min.js too large to diff
- bundle/text-accentfold/text-accentfold.js too large to diff
- bundle/text-data-accentfold/text-data-accentfold-coverage.js too large to diff
- bundle/text-data-accentfold/text-data-accentfold-debug.js too large to diff
- bundle/text-data-accentfold/text-data-accentfold-min.js too large to diff
- bundle/text-data-accentfold/text-data-accentfold.js too large to diff
- bundle/text-data-wordbreak/text-data-wordbreak-coverage.js too large to diff
- bundle/text-data-wordbreak/text-data-wordbreak-debug.js too large to diff
- bundle/text-data-wordbreak/text-data-wordbreak-min.js too large to diff
- bundle/text-data-wordbreak/text-data-wordbreak.js too large to diff
- bundle/text-wordbreak/text-wordbreak-coverage.js too large to diff
- bundle/text-wordbreak/text-wordbreak-debug.js too large to diff
- bundle/text-wordbreak/text-wordbreak-min.js too large to diff
- bundle/text-wordbreak/text-wordbreak.js too large to diff
- bundle/transition-native/transition-native-debug.js too large to diff
- bundle/transition-native/transition-native-min.js too large to diff
- bundle/transition-native/transition-native.js too large to diff
- bundle/transition-timer/transition-timer-coverage.js too large to diff
- bundle/transition-timer/transition-timer-debug.js too large to diff
- bundle/transition-timer/transition-timer-min.js too large to diff
- bundle/transition-timer/transition-timer.js too large to diff
- bundle/transition/transition-coverage.js too large to diff
- bundle/transition/transition-debug.js too large to diff
- bundle/transition/transition-min.js too large to diff
- bundle/transition/transition.js too large to diff
- bundle/uploader-deprecated/uploader-deprecated-coverage.js too large to diff
- bundle/uploader-deprecated/uploader-deprecated-debug.js too large to diff
- bundle/uploader-deprecated/uploader-deprecated-min.js too large to diff
- bundle/uploader-deprecated/uploader-deprecated.js too large to diff
- bundle/uploader-flash/assets/uploader-flash-core.css too large to diff
- bundle/uploader-flash/uploader-flash-coverage.js too large to diff
- bundle/uploader-flash/uploader-flash-debug.js too large to diff
- bundle/uploader-flash/uploader-flash-min.js too large to diff
- bundle/uploader-flash/uploader-flash.js too large to diff
- bundle/uploader-html5/assets/uploader-flash-core.css too large to diff
- bundle/uploader-html5/uploader-html5-coverage.js too large to diff
- bundle/uploader-html5/uploader-html5-debug.js too large to diff
- bundle/uploader-html5/uploader-html5-min.js too large to diff
- bundle/uploader-html5/uploader-html5.js too large to diff
- bundle/uploader-queue/assets/uploader-flash-core.css too large to diff
- bundle/uploader-queue/uploader-queue-coverage.js too large to diff
- bundle/uploader-queue/uploader-queue-debug.js too large to diff
- bundle/uploader-queue/uploader-queue-min.js too large to diff
- bundle/uploader-queue/uploader-queue.js too large to diff
- bundle/uploader/assets/flashuploader.swf too large to diff
- bundle/uploader/assets/uploader-flash-core.css too large to diff
- bundle/uploader/uploader-coverage.js too large to diff
- bundle/uploader/uploader-debug.js too large to diff
- bundle/uploader/uploader-min.js too large to diff
- bundle/uploader/uploader.js too large to diff
- bundle/view-node-map/view-node-map-coverage.js too large to diff
- bundle/view-node-map/view-node-map-debug.js too large to diff
- bundle/view-node-map/view-node-map-min.js too large to diff
- bundle/view-node-map/view-node-map.js too large to diff
- bundle/view/view-coverage.js too large to diff
- bundle/view/view-debug.js too large to diff
- bundle/view/view-min.js too large to diff
- bundle/view/view.js too large to diff
- bundle/widget-anim/widget-anim-coverage.js too large to diff
- bundle/widget-anim/widget-anim-debug.js too large to diff
- bundle/widget-anim/widget-anim-min.js too large to diff
- bundle/widget-anim/widget-anim.js too large to diff
- bundle/widget-autohide/widget-autohide-coverage.js too large to diff
- bundle/widget-autohide/widget-autohide-debug.js too large to diff
- bundle/widget-autohide/widget-autohide-min.js too large to diff
- bundle/widget-autohide/widget-autohide.js too large to diff
- bundle/widget-base-ie/assets/widget-base-core.css too large to diff
- bundle/widget-base-ie/widget-base-ie-coverage.js too large to diff
- bundle/widget-base-ie/widget-base-ie-debug.js too large to diff
- bundle/widget-base-ie/widget-base-ie-min.js too large to diff
- bundle/widget-base-ie/widget-base-ie.js too large to diff
- bundle/widget-base/assets/skins/night/widget-base-skin.css too large to diff
- bundle/widget-base/assets/skins/night/widget-base.css too large to diff
- bundle/widget-base/assets/skins/sam/widget-base-skin.css too large to diff
- bundle/widget-base/assets/skins/sam/widget-base.css too large to diff
- bundle/widget-base/assets/widget-base-core.css too large to diff
- bundle/widget-base/widget-base-coverage.js too large to diff
- bundle/widget-base/widget-base-debug.js too large to diff
- bundle/widget-base/widget-base-min.js too large to diff
- bundle/widget-base/widget-base.js too large to diff
- bundle/widget-buttons/assets/skins/night/widget-buttons-skin.css too large to diff
- bundle/widget-buttons/assets/skins/night/widget-buttons.css too large to diff
- bundle/widget-buttons/assets/skins/sam/widget-buttons-skin.css too large to diff
- bundle/widget-buttons/assets/skins/sam/widget-buttons.css too large to diff
- bundle/widget-buttons/assets/widget-buttons-core.css too large to diff
- bundle/widget-buttons/widget-buttons-coverage.js too large to diff
- bundle/widget-buttons/widget-buttons-debug.js too large to diff
- bundle/widget-buttons/widget-buttons-min.js too large to diff
- bundle/widget-buttons/widget-buttons.js too large to diff
- bundle/widget-child/widget-child-coverage.js too large to diff
- bundle/widget-child/widget-child-debug.js too large to diff
- bundle/widget-child/widget-child-min.js too large to diff
- bundle/widget-child/widget-child.js too large to diff
- bundle/widget-htmlparser/assets/widget-base-core.css too large to diff
- bundle/widget-htmlparser/widget-htmlparser-coverage.js too large to diff
- bundle/widget-htmlparser/widget-htmlparser-debug.js too large to diff
- bundle/widget-htmlparser/widget-htmlparser-min.js too large to diff
- bundle/widget-htmlparser/widget-htmlparser.js too large to diff
- bundle/widget-locale/assets/widget-base-core.css too large to diff
- bundle/widget-locale/widget-locale-coverage.js too large to diff
- bundle/widget-locale/widget-locale-debug.js too large to diff
- bundle/widget-locale/widget-locale-min.js too large to diff
- bundle/widget-locale/widget-locale.js too large to diff
- bundle/widget-modality/assets/skins/night/widget-modality-skin.css too large to diff
- bundle/widget-modality/assets/skins/night/widget-modality.css too large to diff
- bundle/widget-modality/assets/skins/sam/widget-modality-skin.css too large to diff
- bundle/widget-modality/assets/skins/sam/widget-modality.css too large to diff
- bundle/widget-modality/assets/widget-modality-core.css too large to diff
- bundle/widget-modality/widget-modality-coverage.js too large to diff
- bundle/widget-modality/widget-modality-debug.js too large to diff
- bundle/widget-modality/widget-modality-min.js too large to diff
- bundle/widget-modality/widget-modality.js too large to diff
- bundle/widget-parent/widget-parent-coverage.js too large to diff
- bundle/widget-parent/widget-parent-debug.js too large to diff
- bundle/widget-parent/widget-parent-min.js too large to diff
- bundle/widget-parent/widget-parent.js too large to diff
- bundle/widget-position-align/widget-position-align-coverage.js too large to diff
- bundle/widget-position-align/widget-position-align-debug.js too large to diff
- bundle/widget-position-align/widget-position-align-min.js too large to diff
- bundle/widget-position-align/widget-position-align.js too large to diff
- bundle/widget-position-constrain/widget-position-constrain-coverage.js too large to diff
- bundle/widget-position-constrain/widget-position-constrain-debug.js too large to diff
- bundle/widget-position-constrain/widget-position-constrain-min.js too large to diff
- bundle/widget-position-constrain/widget-position-constrain.js too large to diff
- bundle/widget-position/widget-position-coverage.js too large to diff
- bundle/widget-position/widget-position-debug.js too large to diff
- bundle/widget-position/widget-position-min.js too large to diff
- bundle/widget-position/widget-position.js too large to diff
- bundle/widget-skin/assets/widget-base-core.css too large to diff
- bundle/widget-skin/widget-skin-coverage.js too large to diff
- bundle/widget-skin/widget-skin-debug.js too large to diff
- bundle/widget-skin/widget-skin-min.js too large to diff
- bundle/widget-skin/widget-skin.js too large to diff
- bundle/widget-stack/assets/skins/night/widget-stack-skin.css too large to diff
- bundle/widget-stack/assets/skins/night/widget-stack.css too large to diff
- bundle/widget-stack/assets/skins/sam/widget-stack-skin.css too large to diff
- bundle/widget-stack/assets/skins/sam/widget-stack.css too large to diff
- bundle/widget-stack/assets/widget-stack-core.css too large to diff
- bundle/widget-stack/widget-stack-coverage.js too large to diff
- bundle/widget-stack/widget-stack-debug.js too large to diff
- bundle/widget-stack/widget-stack-min.js too large to diff
- bundle/widget-stack/widget-stack.js too large to diff
- bundle/widget-stdmod/widget-stdmod-coverage.js too large to diff
- bundle/widget-stdmod/widget-stdmod-debug.js too large to diff
- bundle/widget-stdmod/widget-stdmod-min.js too large to diff
- bundle/widget-stdmod/widget-stdmod.js too large to diff
- bundle/widget-uievents/assets/widget-base-core.css too large to diff
- bundle/widget-uievents/widget-uievents-coverage.js too large to diff
- bundle/widget-uievents/widget-uievents-debug.js too large to diff
- bundle/widget-uievents/widget-uievents-min.js too large to diff
- bundle/widget-uievents/widget-uievents.js too large to diff
- bundle/yql/yql-coverage.js too large to diff
- bundle/yql/yql-debug.js too large to diff
- bundle/yql/yql-min.js too large to diff
- bundle/yql/yql.js too large to diff
- bundle/yui-base/yui-base-coverage.js too large to diff
- bundle/yui-base/yui-base-debug.js too large to diff
- bundle/yui-base/yui-base-min.js too large to diff
- bundle/yui-base/yui-base.js too large to diff
- bundle/yui-core/yui-core-coverage.js too large to diff
- bundle/yui-core/yui-core-debug.js too large to diff
- bundle/yui-core/yui-core-min.js too large to diff
- bundle/yui-core/yui-core.js too large to diff
- bundle/yui-later/yui-later-coverage.js too large to diff
- bundle/yui-later/yui-later-debug.js too large to diff
- bundle/yui-later/yui-later-min.js too large to diff
- bundle/yui-later/yui-later.js too large to diff
- bundle/yui-log-nodejs/yui-log-nodejs-coverage.js too large to diff
- bundle/yui-log-nodejs/yui-log-nodejs-debug.js too large to diff
- bundle/yui-log-nodejs/yui-log-nodejs-min.js too large to diff
- bundle/yui-log-nodejs/yui-log-nodejs.js too large to diff
- bundle/yui-log/yui-log-coverage.js too large to diff
- bundle/yui-log/yui-log-debug.js too large to diff
- bundle/yui-log/yui-log-min.js too large to diff
- bundle/yui-log/yui-log.js too large to diff
- bundle/yui-nodejs/yui-nodejs-coverage.js too large to diff
- bundle/yui-nodejs/yui-nodejs-debug.js too large to diff
- bundle/yui-nodejs/yui-nodejs-min.js too large to diff
- bundle/yui-nodejs/yui-nodejs.js too large to diff
- bundle/yui-throttle/yui-throttle-coverage.js too large to diff
- bundle/yui-throttle/yui-throttle-debug.js too large to diff
- bundle/yui-throttle/yui-throttle-min.js too large to diff
- bundle/yui-throttle/yui-throttle.js too large to diff
- bundle/yui/yui-coverage.js too large to diff
- bundle/yui/yui-debug.js too large to diff
- bundle/yui/yui-min.js too large to diff
- bundle/yui/yui.js too large to diff
- happstack-yui.cabal too large to diff
- src/Happstack/Server/YUI.hs too large to diff
@@ -0,0 +1,300 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/align-plugin/align-plugin.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/align-plugin/align-plugin.js",+ code: []+};+_yuitest_coverage["build/align-plugin/align-plugin.js"].code=["YUI.add('align-plugin', function (Y, NAME) {",""," /**"," * Provides advanced positioning support for Node via a Plugin"," * for centering and alignment. "," * @module align-plugin"," */",""," var OFFSET_WIDTH = 'offsetWidth',"," OFFSET_HEIGHT = 'offsetHeight',"," undefined = undefined;",""," /**"," * Node plugin which can be used to align a node with another node,"," * region, or the viewport."," *"," * @class Plugin.Align"," * @param {Object} User configuration object"," */"," function Align(config) {"," if (config.host) {"," this._host = config.host;"," }"," }"," "," Align.prototype = {"," /**"," * Aligns node with a point on another node or region."," * Possible alignment points are:"," * <dl>"," * <dt>tl</dt>"," * <dd>top left</dd>"," * <dt>tr</dt>"," * <dd>top right</dd>"," * <dt>bl</dt>"," * <dd>bottom left</dd>"," * <dt>br</dt>"," * <dd>bottom right</dd>"," * <dt>tc</dt>"," * <dd>top center</dd>"," * <dt>bc</dt>"," * <dd>bottom center</dd>"," * <dt>rc</dt>"," * <dd>right center</dd>"," * <dt>lc</dt>"," * <dd>left center</dd>"," * <dt>cc</dt>"," * <dd>center center</dd>"," * </dl>"," * @method to "," * @param region {String || Node || HTMLElement || Object} The node or"," * region to align with. Defaults to the viewport region."," * @param regionPoint {String} The point of the region to align with."," * @param point {String} The point of the node aligned to the region. "," * @param resize {Boolean} Whether or not the node should re-align when"," * the window is resized. Defaults to false."," */"," to: function(region, regionPoint, point, syncOnResize) {"," // cache original args for syncing"," this._syncArgs = Y.Array(arguments);",""," if (region.top === undefined) {"," region = Y.one(region).get('region');"," }",""," if (region) {"," var xy = [region.left, region.top],"," offxy = [region.width, region.height],"," points = Align.points,"," node = this._host,"," NULL = null,"," size = node.getAttrs([OFFSET_HEIGHT, OFFSET_WIDTH]),"," nodeoff = [0 - size[OFFSET_WIDTH], 0 - size[OFFSET_HEIGHT]], // reverse offsets"," regionFn0 = regionPoint ? points[regionPoint.charAt(0)]: NULL,"," regionFn1 = (regionPoint && regionPoint !== 'cc') ? points[regionPoint.charAt(1)] : NULL,"," nodeFn0 = point ? points[point.charAt(0)] : NULL,"," nodeFn1 = (point && point !== 'cc') ? points[point.charAt(1)] : NULL;",""," if (regionFn0) {"," xy = regionFn0(xy, offxy, regionPoint);"," }"," if (regionFn1) {"," xy = regionFn1(xy, offxy, regionPoint);"," }",""," if (nodeFn0) {"," xy = nodeFn0(xy, nodeoff, point);"," }"," if (nodeFn1) {"," xy = nodeFn1(xy, nodeoff, point);"," }",""," if (xy && node) {"," node.setXY(xy);"," }"," "," this._resize(syncOnResize);",""," }"," return this;"," },",""," sync: function() {"," this.to.apply(this, this._syncArgs);"," return this;"," },",""," _resize: function(add) {"," var handle = this._handle;"," if (add && !handle) {"," this._handle = Y.on('resize', this._onresize, window, this);"," } else if (!add && handle) {"," handle.detach();"," }",""," },",""," _onresize: function() {"," var self = this;"," setTimeout(function() { // for performance"," self.sync();"," });"," },"," "," /**"," * Aligns the center of a node to the center of another node or region."," * @method center "," * @param region {Node || HTMLElement || Object} optional The node or"," * region to align with. Defaults to the viewport region."," * the window is resized. If centering to viewport, this defaults"," * to true, otherwise default is false."," */"," center: function(region, resize) {"," this.to(region, 'cc', 'cc', resize); "," return this;"," },",""," /**"," * Removes the resize handler, if any. This is called automatically"," * when unplugged from the host node."," * @method destroy "," */"," destroy: function() {"," var handle = this._handle;"," if (handle) {"," handle.detach();"," }"," }"," };",""," Align.points = {"," 't': function(xy, off) {"," return xy;"," },",""," 'r': function(xy, off) {"," return [xy[0] + off[0], xy[1]];"," },",""," 'b': function(xy, off) {"," return [xy[0], xy[1] + off[1]];"," },",""," 'l': function(xy, off) {"," return xy;"," },",""," 'c': function(xy, off, point) {"," var axis = (point[0] === 't' || point[0] === 'b') ? 0 : 1,"," ret, val;",""," if (point === 'cc') {"," ret = [xy[0] + off[0] / 2, xy[1] + off[1] / 2];"," } else {"," val = xy[axis] + off[axis] / 2;"," ret = (axis) ? [xy[0], val] : [val, xy[1]];"," }",""," return ret;"," }"," };",""," Align.NAME = 'Align';"," Align.NS = 'align';",""," Align.prototype.constructor = Align;",""," Y.namespace('Plugin');"," Y.Plugin.Align = Align;","","","","}, '3.7.1', {\"requires\": [\"node-screen\", \"node-pluginhost\"]});"];+_yuitest_coverage["build/align-plugin/align-plugin.js"].lines = {"1":0,"9":0,"20":0,"21":0,"22":0,"26":0,"60":0,"62":0,"63":0,"66":0,"67":0,"79":0,"80":0,"82":0,"83":0,"86":0,"87":0,"89":0,"90":0,"93":0,"94":0,"97":0,"100":0,"104":0,"105":0,"109":0,"110":0,"111":0,"112":0,"113":0,"119":0,"120":0,"121":0,"134":0,"135":0,"144":0,"145":0,"146":0,"151":0,"153":0,"157":0,"161":0,"165":0,"169":0,"172":0,"173":0,"175":0,"176":0,"179":0,"183":0,"184":0,"186":0,"188":0,"189":0};+_yuitest_coverage["build/align-plugin/align-plugin.js"].functions = {"Align:20":0,"to:58":0,"sync:103":0,"_resize:108":0,"(anonymous 2):120":0,"_onresize:118":0,"center:133":0,"destroy:143":0,"\'t\':152":0,"\'r\':156":0,"\'b\':160":0,"\'l\':164":0,"\'c\':168":0,"(anonymous 1):1":0};+_yuitest_coverage["build/align-plugin/align-plugin.js"].coveredLines = 54;+_yuitest_coverage["build/align-plugin/align-plugin.js"].coveredFunctions = 14;+_yuitest_coverline("build/align-plugin/align-plugin.js", 1);+YUI.add('align-plugin', function (Y, NAME) {++ /**+ * Provides advanced positioning support for Node via a Plugin+ * for centering and alignment. + * @module align-plugin+ */++ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "(anonymous 1)", 1);+_yuitest_coverline("build/align-plugin/align-plugin.js", 9);+var OFFSET_WIDTH = 'offsetWidth',+ OFFSET_HEIGHT = 'offsetHeight',+ undefined = undefined;++ /**+ * Node plugin which can be used to align a node with another node,+ * region, or the viewport.+ *+ * @class Plugin.Align+ * @param {Object} User configuration object+ */+ _yuitest_coverline("build/align-plugin/align-plugin.js", 20);+function Align(config) {+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "Align", 20);+_yuitest_coverline("build/align-plugin/align-plugin.js", 21);+if (config.host) {+ _yuitest_coverline("build/align-plugin/align-plugin.js", 22);+this._host = config.host;+ }+ }+ + _yuitest_coverline("build/align-plugin/align-plugin.js", 26);+Align.prototype = {+ /**+ * Aligns node with a point on another node or region.+ * Possible alignment points are:+ * <dl>+ * <dt>tl</dt>+ * <dd>top left</dd>+ * <dt>tr</dt>+ * <dd>top right</dd>+ * <dt>bl</dt>+ * <dd>bottom left</dd>+ * <dt>br</dt>+ * <dd>bottom right</dd>+ * <dt>tc</dt>+ * <dd>top center</dd>+ * <dt>bc</dt>+ * <dd>bottom center</dd>+ * <dt>rc</dt>+ * <dd>right center</dd>+ * <dt>lc</dt>+ * <dd>left center</dd>+ * <dt>cc</dt>+ * <dd>center center</dd>+ * </dl>+ * @method to + * @param region {String || Node || HTMLElement || Object} The node or+ * region to align with. Defaults to the viewport region.+ * @param regionPoint {String} The point of the region to align with.+ * @param point {String} The point of the node aligned to the region. + * @param resize {Boolean} Whether or not the node should re-align when+ * the window is resized. Defaults to false.+ */+ to: function(region, regionPoint, point, syncOnResize) {+ // cache original args for syncing+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "to", 58);+_yuitest_coverline("build/align-plugin/align-plugin.js", 60);+this._syncArgs = Y.Array(arguments);++ _yuitest_coverline("build/align-plugin/align-plugin.js", 62);+if (region.top === undefined) {+ _yuitest_coverline("build/align-plugin/align-plugin.js", 63);+region = Y.one(region).get('region');+ }++ _yuitest_coverline("build/align-plugin/align-plugin.js", 66);+if (region) {+ _yuitest_coverline("build/align-plugin/align-plugin.js", 67);+var xy = [region.left, region.top],+ offxy = [region.width, region.height],+ points = Align.points,+ node = this._host,+ NULL = null,+ size = node.getAttrs([OFFSET_HEIGHT, OFFSET_WIDTH]),+ nodeoff = [0 - size[OFFSET_WIDTH], 0 - size[OFFSET_HEIGHT]], // reverse offsets+ regionFn0 = regionPoint ? points[regionPoint.charAt(0)]: NULL,+ regionFn1 = (regionPoint && regionPoint !== 'cc') ? points[regionPoint.charAt(1)] : NULL,+ nodeFn0 = point ? points[point.charAt(0)] : NULL,+ nodeFn1 = (point && point !== 'cc') ? points[point.charAt(1)] : NULL;++ _yuitest_coverline("build/align-plugin/align-plugin.js", 79);+if (regionFn0) {+ _yuitest_coverline("build/align-plugin/align-plugin.js", 80);+xy = regionFn0(xy, offxy, regionPoint);+ }+ _yuitest_coverline("build/align-plugin/align-plugin.js", 82);+if (regionFn1) {+ _yuitest_coverline("build/align-plugin/align-plugin.js", 83);+xy = regionFn1(xy, offxy, regionPoint);+ }++ _yuitest_coverline("build/align-plugin/align-plugin.js", 86);+if (nodeFn0) {+ _yuitest_coverline("build/align-plugin/align-plugin.js", 87);+xy = nodeFn0(xy, nodeoff, point);+ }+ _yuitest_coverline("build/align-plugin/align-plugin.js", 89);+if (nodeFn1) {+ _yuitest_coverline("build/align-plugin/align-plugin.js", 90);+xy = nodeFn1(xy, nodeoff, point);+ }++ _yuitest_coverline("build/align-plugin/align-plugin.js", 93);+if (xy && node) {+ _yuitest_coverline("build/align-plugin/align-plugin.js", 94);+node.setXY(xy);+ }+ + _yuitest_coverline("build/align-plugin/align-plugin.js", 97);+this._resize(syncOnResize);++ }+ _yuitest_coverline("build/align-plugin/align-plugin.js", 100);+return this;+ },++ sync: function() {+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "sync", 103);+_yuitest_coverline("build/align-plugin/align-plugin.js", 104);+this.to.apply(this, this._syncArgs);+ _yuitest_coverline("build/align-plugin/align-plugin.js", 105);+return this;+ },++ _resize: function(add) {+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "_resize", 108);+_yuitest_coverline("build/align-plugin/align-plugin.js", 109);+var handle = this._handle;+ _yuitest_coverline("build/align-plugin/align-plugin.js", 110);+if (add && !handle) {+ _yuitest_coverline("build/align-plugin/align-plugin.js", 111);+this._handle = Y.on('resize', this._onresize, window, this);+ } else {_yuitest_coverline("build/align-plugin/align-plugin.js", 112);+if (!add && handle) {+ _yuitest_coverline("build/align-plugin/align-plugin.js", 113);+handle.detach();+ }}++ },++ _onresize: function() {+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "_onresize", 118);+_yuitest_coverline("build/align-plugin/align-plugin.js", 119);+var self = this;+ _yuitest_coverline("build/align-plugin/align-plugin.js", 120);+setTimeout(function() { // for performance+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "(anonymous 2)", 120);+_yuitest_coverline("build/align-plugin/align-plugin.js", 121);+self.sync();+ });+ },+ + /**+ * Aligns the center of a node to the center of another node or region.+ * @method center + * @param region {Node || HTMLElement || Object} optional The node or+ * region to align with. Defaults to the viewport region.+ * the window is resized. If centering to viewport, this defaults+ * to true, otherwise default is false.+ */+ center: function(region, resize) {+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "center", 133);+_yuitest_coverline("build/align-plugin/align-plugin.js", 134);+this.to(region, 'cc', 'cc', resize); + _yuitest_coverline("build/align-plugin/align-plugin.js", 135);+return this;+ },++ /**+ * Removes the resize handler, if any. This is called automatically+ * when unplugged from the host node.+ * @method destroy + */+ destroy: function() {+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "destroy", 143);+_yuitest_coverline("build/align-plugin/align-plugin.js", 144);+var handle = this._handle;+ _yuitest_coverline("build/align-plugin/align-plugin.js", 145);+if (handle) {+ _yuitest_coverline("build/align-plugin/align-plugin.js", 146);+handle.detach();+ }+ }+ };++ _yuitest_coverline("build/align-plugin/align-plugin.js", 151);+Align.points = {+ 't': function(xy, off) {+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "\'t\'", 152);+_yuitest_coverline("build/align-plugin/align-plugin.js", 153);+return xy;+ },++ 'r': function(xy, off) {+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "\'r\'", 156);+_yuitest_coverline("build/align-plugin/align-plugin.js", 157);+return [xy[0] + off[0], xy[1]];+ },++ 'b': function(xy, off) {+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "\'b\'", 160);+_yuitest_coverline("build/align-plugin/align-plugin.js", 161);+return [xy[0], xy[1] + off[1]];+ },++ 'l': function(xy, off) {+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "\'l\'", 164);+_yuitest_coverline("build/align-plugin/align-plugin.js", 165);+return xy;+ },++ 'c': function(xy, off, point) {+ _yuitest_coverfunc("build/align-plugin/align-plugin.js", "\'c\'", 168);+_yuitest_coverline("build/align-plugin/align-plugin.js", 169);+var axis = (point[0] === 't' || point[0] === 'b') ? 0 : 1,+ ret, val;++ _yuitest_coverline("build/align-plugin/align-plugin.js", 172);+if (point === 'cc') {+ _yuitest_coverline("build/align-plugin/align-plugin.js", 173);+ret = [xy[0] + off[0] / 2, xy[1] + off[1] / 2];+ } else {+ _yuitest_coverline("build/align-plugin/align-plugin.js", 175);+val = xy[axis] + off[axis] / 2;+ _yuitest_coverline("build/align-plugin/align-plugin.js", 176);+ret = (axis) ? [xy[0], val] : [val, xy[1]];+ }++ _yuitest_coverline("build/align-plugin/align-plugin.js", 179);+return ret;+ }+ };++ _yuitest_coverline("build/align-plugin/align-plugin.js", 183);+Align.NAME = 'Align';+ _yuitest_coverline("build/align-plugin/align-plugin.js", 184);+Align.NS = 'align';++ _yuitest_coverline("build/align-plugin/align-plugin.js", 186);+Align.prototype.constructor = Align;++ _yuitest_coverline("build/align-plugin/align-plugin.js", 188);+Y.namespace('Plugin');+ _yuitest_coverline("build/align-plugin/align-plugin.js", 189);+Y.Plugin.Align = Align;++++}, '3.7.1', {"requires": ["node-screen", "node-pluginhost"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('align-plugin', function(Y) {+YUI.add('align-plugin', function (Y, NAME) { /** * Provides advanced positioning support for Node via a Plugin@@ -196,4 +196,4 @@ -}, '3.5.1' ,{requires:['node-pluginhost', 'node-screen']});+}, '3.7.1', {"requires": ["node-screen", "node-pluginhost"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("align-plugin",function(c){var e="offsetWidth",d="offsetHeight",b=b;function a(f){if(f.host){this._host=f.host;}}a.prototype={to:function(j,t,l,o){this._syncArgs=c.Array(arguments);if(j.top===b){j=c.one(j).get("region");}if(j){var s=[j.left,j.top],q=[j.width,j.height],n=a.points,f=this._host,h=null,r=f.getAttrs([d,e]),k=[0-r[e],0-r[d]],p=t?n[t.charAt(0)]:h,m=(t&&t!=="cc")?n[t.charAt(1)]:h,i=l?n[l.charAt(0)]:h,g=(l&&l!=="cc")?n[l.charAt(1)]:h;if(p){s=p(s,q,t);}if(m){s=m(s,q,t);}if(i){s=i(s,k,l);}if(g){s=g(s,k,l);}if(s&&f){f.setXY(s);}this._resize(o);}return this;},sync:function(){this.to.apply(this,this._syncArgs);return this;},_resize:function(g){var f=this._handle;if(g&&!f){this._handle=c.on("resize",this._onresize,window,this);}else{if(!g&&f){f.detach();}}},_onresize:function(){var f=this;setTimeout(function(){f.sync();});},center:function(g,f){this.to(g,"cc","cc",f);return this;},destroy:function(){var f=this._handle;if(f){f.detach();}}};a.points={"t":function(f,g){return f;},"r":function(f,g){return[f[0]+g[0],f[1]];},"b":function(f,g){return[f[0],f[1]+g[1]];},"l":function(f,g){return f;},"c":function(i,k,f){var h=(f[0]==="t"||f[0]==="b")?0:1,g,j;if(f==="cc"){g=[i[0]+k[0]/2,i[1]+k[1]/2];}else{j=i[h]+k[h]/2;g=(h)?[i[0],j]:[j,i[1]];}return g;}};a.NAME="Align";a.NS="align";a.prototype.constructor=a;c.namespace("Plugin");c.Plugin.Align=a;},"3.5.1",{requires:["node-pluginhost","node-screen"]});+YUI.add("align-plugin",function(e,t){function s(e){e.host&&(this._host=e.host)}var n="offsetWidth",r="offsetHeight",i=i;s.prototype={to:function(t,o,u,a){this._syncArgs=e.Array(arguments),t.top===i&&(t=e.one(t).get("region"));if(t){var f=[t.left,t.top],l=[t.width,t.height],c=s.points,h=this._host,p=null,d=h.getAttrs([r,n]),v=[0-d[n],0-d[r]],m=o?c[o.charAt(0)]:p,g=o&&o!=="cc"?c[o.charAt(1)]:p,y=u?c[u.charAt(0)]:p,b=u&&u!=="cc"?c[u.charAt(1)]:p;m&&(f=m(f,l,o)),g&&(f=g(f,l,o)),y&&(f=y(f,v,u)),b&&(f=b(f,v,u)),f&&h&&h.setXY(f),this._resize(a)}return this},sync:function(){return this.to.apply(this,this._syncArgs),this},_resize:function(t){var n=this._handle;t&&!n?this._handle=e.on("resize",this._onresize,window,this):!t&&n&&n.detach()},_onresize:function(){var e=this;setTimeout(function(){e.sync()})},center:function(e,t){return this.to(e,"cc","cc",t),this},destroy:function(){var e=this._handle;e&&e.detach()}},s.points={t:function(e,t){return e},r:function(e,t){return[e[0]+t[0],e[1]]},b:function(e,t){return[e[0],e[1]+t[1]]},l:function(e,t){return e},c:function(e,t,n){var r=n[0]==="t"||n[0]==="b"?0:1,i,s;return n==="cc"?i=[e[0]+t[0]/2,e[1]+t[1]/2]:(s=e[r]+t[r]/2,i=r?[e[0],s]:[s,e[1]]),i}},s.NAME="Align",s.NS="align",s.prototype.constructor=s,e.namespace("Plugin"),e.Plugin.Align=s},"3.7.1",{requires:["node-screen","node-pluginhost"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('align-plugin', function(Y) {+YUI.add('align-plugin', function (Y, NAME) { /** * Provides advanced positioning support for Node via a Plugin@@ -196,4 +196,4 @@ -}, '3.5.1' ,{requires:['node-pluginhost', 'node-screen']});+}, '3.7.1', {"requires": ["node-screen", "node-pluginhost"]});
@@ -0,0 +1,932 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/anim-base/anim-base.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/anim-base/anim-base.js",+ code: []+};+_yuitest_coverage["build/anim-base/anim-base.js"].code=["YUI.add('anim-base', function (Y, NAME) {","","/**","* The Animation Utility provides an API for creating advanced transitions.","* @module anim","*/","","/**","* Provides the base Anim class, for animating numeric properties.","*","* @module anim","* @submodule anim-base","*/",""," /**"," * A class for constructing animation instances."," * @class Anim"," * @for Anim"," * @constructor"," * @extends Base"," */",""," var RUNNING = 'running',"," START_TIME = 'startTime',"," ELAPSED_TIME = 'elapsedTime',"," /**"," * @for Anim"," * @event start"," * @description fires when an animation begins."," * @param {Event} ev The start event."," * @type Event.Custom"," */"," START = 'start',",""," /**"," * @event tween"," * @description fires every frame of the animation."," * @param {Event} ev The tween event."," * @type Event.Custom"," */"," TWEEN = 'tween',",""," /**"," * @event end"," * @description fires after the animation completes."," * @param {Event} ev The end event."," * @type Event.Custom"," */"," END = 'end',"," NODE = 'node',"," PAUSED = 'paused',"," REVERSE = 'reverse', // TODO: cleanup"," ITERATION_COUNT = 'iterationCount',",""," NUM = Number;",""," var _running = {},"," _timer;",""," Y.Anim = function() {"," Y.Anim.superclass.constructor.apply(this, arguments);"," Y.Anim._instances[Y.stamp(this)] = this;"," };",""," Y.Anim.NAME = 'anim';",""," Y.Anim._instances = {};",""," /**"," * Regex of properties that should use the default unit."," *"," * @property RE_DEFAULT_UNIT"," * @static"," */"," Y.Anim.RE_DEFAULT_UNIT = /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;",""," /**"," * The default unit to use with properties that pass the RE_DEFAULT_UNIT test."," *"," * @property DEFAULT_UNIT"," * @static"," */"," Y.Anim.DEFAULT_UNIT = 'px';",""," Y.Anim.DEFAULT_EASING = function (t, b, c, d) {"," return c * t / d + b; // linear easing"," };",""," /**"," * Time in milliseconds passed to setInterval for frame processing "," *"," * @property intervalTime"," * @default 20"," * @static"," */"," Y.Anim._intervalTime = 20;",""," /**"," * Bucket for custom getters and setters"," *"," * @property behaviors"," * @static"," */"," Y.Anim.behaviors = {"," left: {"," get: function(anim, attr) {"," return anim._getOffset(attr);"," }"," }"," };",""," Y.Anim.behaviors.top = Y.Anim.behaviors.left;",""," /**"," * The default setter to use when setting object properties."," *"," * @property DEFAULT_SETTER"," * @static"," */"," Y.Anim.DEFAULT_SETTER = function(anim, att, from, to, elapsed, duration, fn, unit) {"," var node = anim._node,"," domNode = node._node,"," val = fn(elapsed, NUM(from), NUM(to) - NUM(from), duration);",""," if (domNode) {"," if ('style' in domNode && (att in domNode.style || att in Y.DOM.CUSTOM_STYLES)) {"," unit = unit || '';"," node.setStyle(att, val + unit);"," } else if ('attributes' in domNode && att in domNode.attributes) {"," node.setAttribute(att, val);"," } else if (att in domNode) {"," domNode[att] = val;"," }"," } else if (node.set) {"," node.set(att, val);"," } else if (att in node) {"," node[att] = val;"," }"," };",""," /**"," * The default getter to use when getting object properties."," *"," * @property DEFAULT_GETTER"," * @static"," */"," Y.Anim.DEFAULT_GETTER = function(anim, att) {"," var node = anim._node,"," domNode = node._node,"," val = '';",""," if (domNode) {"," if ('style' in domNode && (att in domNode.style || att in Y.DOM.CUSTOM_STYLES)) {"," val = node.getComputedStyle(att);"," } else if ('attributes' in domNode && att in domNode.attributes) {"," val = node.getAttribute(att);"," } else if (att in domNode) {"," val = domNode[att];"," }"," } else if (node.get) {"," val = node.get(att);"," } else if (att in node) {"," val = node[att];"," }",""," return val;"," };",""," Y.Anim.ATTRS = {"," /**"," * The object to be animated."," * @attribute node"," * @type Node"," */"," node: {"," setter: function(node) {"," if (node) {"," if (typeof node == 'string' || node.nodeType) {"," node = Y.one(node);"," }"," }",""," this._node = node;"," if (!node) {"," }"," return node;"," }"," },",""," /**"," * The length of the animation. Defaults to \"1\" (second)."," * @attribute duration"," * @type NUM"," */"," duration: {"," value: 1"," },",""," /**"," * The method that will provide values to the attribute(s) during the animation. "," * Defaults to \"Easing.easeNone\"."," * @attribute easing"," * @type Function"," */"," easing: {"," value: Y.Anim.DEFAULT_EASING,",""," setter: function(val) {"," if (typeof val === 'string' && Y.Easing) {"," return Y.Easing[val];"," }"," }"," },",""," /**"," * The starting values for the animated properties."," *"," * Fields may be strings, numbers, or functions."," * If a function is used, the return value becomes the from value."," * If no from value is specified, the DEFAULT_GETTER will be used."," * Supports any unit, provided it matches the \"to\" (or default)"," * unit (e.g. `{width: '10em', color: 'rgb(0, 0, 0)', borderColor: '#ccc'}`)."," *"," * If using the default ('px' for length-based units), the unit may be omitted"," * (e.g. `{width: 100}, borderColor: 'ccc'}`, which defaults to pixels"," * and hex, respectively)."," *"," * @attribute from"," * @type Object"," */"," from: {},",""," /**"," * The ending values for the animated properties."," *"," * Fields may be strings, numbers, or functions."," * Supports any unit, provided it matches the \"from\" (or default)"," * unit (e.g. `{width: '50%', color: 'red', borderColor: '#ccc'}`)."," *"," * If using the default ('px' for length-based units), the unit may be omitted"," * (e.g. `{width: 100, borderColor: 'ccc'}`, which defaults to pixels"," * and hex, respectively)."," *"," * @attribute to"," * @type Object"," */"," to: {},",""," /**"," * Date stamp for the first frame of the animation."," * @attribute startTime"," * @type Int"," * @default 0 "," * @readOnly"," */"," startTime: {"," value: 0,"," readOnly: true"," },",""," /**"," * Current time the animation has been running."," * @attribute elapsedTime"," * @type Int"," * @default 0 "," * @readOnly"," */"," elapsedTime: {"," value: 0,"," readOnly: true"," },",""," /**"," * Whether or not the animation is currently running."," * @attribute running "," * @type Boolean"," * @default false "," * @readOnly"," */"," running: {"," getter: function() {"," return !!_running[Y.stamp(this)];"," },"," value: false,"," readOnly: true"," },",""," /**"," * The number of times the animation should run "," * @attribute iterations"," * @type Int"," * @default 1 "," */"," iterations: {"," value: 1"," },",""," /**"," * The number of iterations that have occurred."," * Resets when an animation ends (reaches iteration count or stop() called). "," * @attribute iterationCount"," * @type Int"," * @default 0"," * @readOnly"," */"," iterationCount: {"," value: 0,"," readOnly: true"," },",""," /**"," * How iterations of the animation should behave. "," * Possible values are \"normal\" and \"alternate\"."," * Normal will repeat the animation, alternate will reverse on every other pass."," *"," * @attribute direction"," * @type String"," * @default \"normal\""," */"," direction: {"," value: 'normal' // | alternate (fwd on odd, rev on even per spec)"," },",""," /**"," * Whether or not the animation is currently paused."," * @attribute paused "," * @type Boolean"," * @default false "," * @readOnly"," */"," paused: {"," readOnly: true,"," value: false"," },",""," /**"," * If true, animation begins from last frame"," * @attribute reverse"," * @type Boolean"," * @default false "," */"," reverse: {"," value: false"," }","",""," };",""," /**"," * Runs all animation instances."," * @method run"," * @static"," */ "," Y.Anim.run = function() {"," var instances = Y.Anim._instances;"," for (var i in instances) {"," if (instances[i].run) {"," instances[i].run();"," }"," }"," };",""," /**"," * Pauses all animation instances."," * @method pause"," * @static"," */ "," Y.Anim.pause = function() {"," for (var i in _running) { // stop timer if nothing running"," if (_running[i].pause) {"," _running[i].pause();"," }"," }",""," Y.Anim._stopTimer();"," };",""," /**"," * Stops all animation instances."," * @method stop"," * @static"," */ "," Y.Anim.stop = function() {"," for (var i in _running) { // stop timer if nothing running"," if (_running[i].stop) {"," _running[i].stop();"," }"," }"," Y.Anim._stopTimer();"," };"," "," Y.Anim._startTimer = function() {"," if (!_timer) {"," _timer = setInterval(Y.Anim._runFrame, Y.Anim._intervalTime);"," }"," };",""," Y.Anim._stopTimer = function() {"," clearInterval(_timer);"," _timer = 0;"," };",""," /**"," * Called per Interval to handle each animation frame."," * @method _runFrame"," * @private"," * @static"," */ "," Y.Anim._runFrame = function() {"," var done = true;"," for (var anim in _running) {"," if (_running[anim]._runFrame) {"," done = false;"," _running[anim]._runFrame();"," }"," }",""," if (done) {"," Y.Anim._stopTimer();"," }"," };",""," Y.Anim.RE_UNITS = /^(-?\\d*\\.?\\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;",""," var proto = {"," /**"," * Starts or resumes an animation."," * @method run"," * @chainable"," */ "," run: function() {"," if (this.get(PAUSED)) {"," this._resume();"," } else if (!this.get(RUNNING)) {"," this._start();"," }"," return this;"," },",""," /**"," * Pauses the animation and"," * freezes it in its current state and time."," * Calling run() will continue where it left off."," * @method pause"," * @chainable"," */ "," pause: function() {"," if (this.get(RUNNING)) {"," this._pause();"," }"," return this;"," },",""," /**"," * Stops the animation and resets its time."," * @method stop"," * @param {Boolean} finish If true, the animation will move to the last frame"," * @chainable"," */ "," stop: function(finish) {"," if (this.get(RUNNING) || this.get(PAUSED)) {"," this._end(finish);"," }"," return this;"," },",""," _added: false,",""," _start: function() {"," this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));"," this._actualFrames = 0;"," if (!this.get(PAUSED)) {"," this._initAnimAttr();"," }"," _running[Y.stamp(this)] = this;"," Y.Anim._startTimer();",""," this.fire(START);"," },",""," _pause: function() {"," this._set(START_TIME, null);"," this._set(PAUSED, true);"," delete _running[Y.stamp(this)];",""," /**"," * @event pause"," * @description fires when an animation is paused."," * @param {Event} ev The pause event."," * @type Event.Custom"," */"," this.fire('pause');"," },",""," _resume: function() {"," this._set(PAUSED, false);"," _running[Y.stamp(this)] = this;"," this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));"," Y.Anim._startTimer();",""," /**"," * @event resume"," * @description fires when an animation is resumed (run from pause)."," * @param {Event} ev The pause event."," * @type Event.Custom"," */"," this.fire('resume');"," },",""," _end: function(finish) {"," var duration = this.get('duration') * 1000;"," if (finish) { // jump to last frame"," this._runAttrs(duration, duration, this.get(REVERSE));"," }",""," this._set(START_TIME, null);"," this._set(ELAPSED_TIME, 0);"," this._set(PAUSED, false);",""," delete _running[Y.stamp(this)];"," this.fire(END, {elapsed: this.get(ELAPSED_TIME)});"," },",""," _runFrame: function() {"," var d = this._runtimeAttr.duration,"," t = new Date() - this.get(START_TIME),"," reverse = this.get(REVERSE),"," done = (t >= d),"," attribute,"," setter;"," "," this._runAttrs(t, d, reverse);"," this._actualFrames += 1;"," this._set(ELAPSED_TIME, t);",""," this.fire(TWEEN);"," if (done) {"," this._lastFrame();"," }"," },",""," _runAttrs: function(t, d, reverse) {"," var attr = this._runtimeAttr,"," customAttr = Y.Anim.behaviors,"," easing = attr.easing,"," lastFrame = d,"," done = false,"," attribute,"," setter,"," i;",""," if (t >= d) {"," done = true;"," }",""," if (reverse) {"," t = d - t;"," lastFrame = 0;"," }",""," for (i in attr) {"," if (attr[i].to) {"," attribute = attr[i];"," setter = (i in customAttr && 'set' in customAttr[i]) ?"," customAttr[i].set : Y.Anim.DEFAULT_SETTER;",""," if (!done) {"," setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit); "," } else {"," setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit); "," }"," }"," }","",""," },",""," _lastFrame: function() {"," var iter = this.get('iterations'),"," iterCount = this.get(ITERATION_COUNT);",""," iterCount += 1;"," if (iter === 'infinite' || iterCount < iter) {"," if (this.get('direction') === 'alternate') {"," this.set(REVERSE, !this.get(REVERSE)); // flip it"," }"," /**"," * @event iteration"," * @description fires when an animation begins an iteration."," * @param {Event} ev The iteration event."," * @type Event.Custom"," */"," this.fire('iteration');"," } else {"," iterCount = 0;"," this._end();"," }",""," this._set(START_TIME, new Date());"," this._set(ITERATION_COUNT, iterCount);"," },",""," _initAnimAttr: function() {"," var from = this.get('from') || {},"," to = this.get('to') || {},"," attr = {"," duration: this.get('duration') * 1000,"," easing: this.get('easing')"," },"," customAttr = Y.Anim.behaviors,"," node = this.get(NODE), // implicit attr init"," unit, begin, end;",""," Y.each(to, function(val, name) {"," if (typeof val === 'function') {"," val = val.call(this, node);"," }",""," begin = from[name];"," if (begin === undefined) {"," begin = (name in customAttr && 'get' in customAttr[name]) ?"," customAttr[name].get(this, name) : Y.Anim.DEFAULT_GETTER(this, name);"," } else if (typeof begin === 'function') {"," begin = begin.call(this, node);"," }",""," var mFrom = Y.Anim.RE_UNITS.exec(begin);"," var mTo = Y.Anim.RE_UNITS.exec(val);",""," begin = mFrom ? mFrom[1] : begin;"," end = mTo ? mTo[1] : val;"," unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units",""," if (!unit && Y.Anim.RE_DEFAULT_UNIT.test(name)) {"," unit = Y.Anim.DEFAULT_UNIT;"," }",""," if (!begin || !end) {"," Y.error('invalid \"from\" or \"to\" for \"' + name + '\"', 'Anim');"," return;"," }",""," attr[name] = {"," from: Y.Lang.isObject(begin) ? Y.clone(begin) : begin,"," to: end,"," unit: unit"," };",""," }, this);",""," this._runtimeAttr = attr;"," },","",""," // TODO: move to computedStyle? (browsers dont agree on default computed offsets)"," _getOffset: function(attr) {"," var node = this._node,"," val = node.getComputedStyle(attr),"," get = (attr === 'left') ? 'getX': 'getY',"," set = (attr === 'left') ? 'setX': 'setY';",""," if (val === 'auto') {"," var position = node.getStyle('position');"," if (position === 'absolute' || position === 'fixed') {"," val = node[get]();"," node[set](val);"," } else {"," val = 0;"," }"," }",""," return val;"," },",""," destructor: function() {"," delete Y.Anim._instances[Y.stamp(this)];"," }"," };",""," Y.extend(Y.Anim, Y.Base, proto);","","","}, '3.7.1', {\"requires\": [\"base-base\", \"node-style\"]});"];+_yuitest_coverage["build/anim-base/anim-base.js"].lines = {"1":0,"23":0,"57":0,"60":0,"61":0,"62":0,"65":0,"67":0,"75":0,"83":0,"85":0,"86":0,"96":0,"104":0,"107":0,"112":0,"120":0,"121":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"134":0,"135":0,"136":0,"137":0,"147":0,"148":0,"152":0,"153":0,"154":0,"155":0,"156":0,"157":0,"158":0,"160":0,"161":0,"162":0,"163":0,"166":0,"169":0,"177":0,"178":0,"179":0,"183":0,"184":0,"186":0,"209":0,"210":0,"282":0,"354":0,"355":0,"356":0,"357":0,"358":0,"368":0,"369":0,"370":0,"371":0,"375":0,"383":0,"384":0,"385":0,"386":0,"389":0,"392":0,"393":0,"394":0,"398":0,"399":0,"400":0,"409":0,"410":0,"411":0,"412":0,"413":0,"414":0,"418":0,"419":0,"423":0,"425":0,"432":0,"433":0,"434":0,"435":0,"437":0,"448":0,"449":0,"451":0,"461":0,"462":0,"464":0,"470":0,"471":0,"472":0,"473":0,"475":0,"476":0,"478":0,"482":0,"483":0,"484":0,"492":0,"496":0,"497":0,"498":0,"499":0,"507":0,"511":0,"512":0,"513":0,"516":0,"517":0,"518":0,"520":0,"521":0,"525":0,"532":0,"533":0,"534":0,"536":0,"537":0,"538":0,"543":0,"552":0,"553":0,"556":0,"557":0,"558":0,"561":0,"562":0,"563":0,"564":0,"567":0,"568":0,"570":0,"579":0,"582":0,"583":0,"584":0,"585":0,"593":0,"595":0,"596":0,"599":0,"600":0,"604":0,"614":0,"615":0,"616":0,"619":0,"620":0,"621":0,"623":0,"624":0,"627":0,"628":0,"630":0,"631":0,"632":0,"634":0,"635":0,"638":0,"639":0,"640":0,"643":0,"651":0,"657":0,"662":0,"663":0,"664":0,"665":0,"666":0,"668":0,"672":0,"676":0,"680":0};+_yuitest_coverage["build/anim-base/anim-base.js"].functions = {"Anim:60":0,"DEFAULT_EASING:85":0,"get:106":0,"DEFAULT_SETTER:120":0,"DEFAULT_GETTER:147":0,"setter:176":0,"setter:208":0,"getter:281":0,"run:354":0,"pause:368":0,"stop:383":0,"_startTimer:392":0,"_stopTimer:398":0,"_runFrame:409":0,"run:431":0,"pause:447":0,"stop:460":0,"_start:469":0,"_pause:481":0,"_resume:495":0,"_end:510":0,"_runFrame:524":0,"_runAttrs:542":0,"_lastFrame:578":0,"(anonymous 2):614":0,"_initAnimAttr:603":0,"_getOffset:656":0,"destructor:675":0,"(anonymous 1):1":0};+_yuitest_coverage["build/anim-base/anim-base.js"].coveredLines = 181;+_yuitest_coverage["build/anim-base/anim-base.js"].coveredFunctions = 29;+_yuitest_coverline("build/anim-base/anim-base.js", 1);+YUI.add('anim-base', function (Y, NAME) {++/**+* The Animation Utility provides an API for creating advanced transitions.+* @module anim+*/++/**+* Provides the base Anim class, for animating numeric properties.+*+* @module anim+* @submodule anim-base+*/++ /**+ * A class for constructing animation instances.+ * @class Anim+ * @for Anim+ * @constructor+ * @extends Base+ */++ _yuitest_coverfunc("build/anim-base/anim-base.js", "(anonymous 1)", 1);+_yuitest_coverline("build/anim-base/anim-base.js", 23);+var RUNNING = 'running',+ START_TIME = 'startTime',+ ELAPSED_TIME = 'elapsedTime',+ /**+ * @for Anim+ * @event start+ * @description fires when an animation begins.+ * @param {Event} ev The start event.+ * @type Event.Custom+ */+ START = 'start',++ /**+ * @event tween+ * @description fires every frame of the animation.+ * @param {Event} ev The tween event.+ * @type Event.Custom+ */+ TWEEN = 'tween',++ /**+ * @event end+ * @description fires after the animation completes.+ * @param {Event} ev The end event.+ * @type Event.Custom+ */+ END = 'end',+ NODE = 'node',+ PAUSED = 'paused',+ REVERSE = 'reverse', // TODO: cleanup+ ITERATION_COUNT = 'iterationCount',++ NUM = Number;++ _yuitest_coverline("build/anim-base/anim-base.js", 57);+var _running = {},+ _timer;++ _yuitest_coverline("build/anim-base/anim-base.js", 60);+Y.Anim = function() {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "Anim", 60);+_yuitest_coverline("build/anim-base/anim-base.js", 61);+Y.Anim.superclass.constructor.apply(this, arguments);+ _yuitest_coverline("build/anim-base/anim-base.js", 62);+Y.Anim._instances[Y.stamp(this)] = this;+ };++ _yuitest_coverline("build/anim-base/anim-base.js", 65);+Y.Anim.NAME = 'anim';++ _yuitest_coverline("build/anim-base/anim-base.js", 67);+Y.Anim._instances = {};++ /**+ * Regex of properties that should use the default unit.+ *+ * @property RE_DEFAULT_UNIT+ * @static+ */+ _yuitest_coverline("build/anim-base/anim-base.js", 75);+Y.Anim.RE_DEFAULT_UNIT = /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;++ /**+ * The default unit to use with properties that pass the RE_DEFAULT_UNIT test.+ *+ * @property DEFAULT_UNIT+ * @static+ */+ _yuitest_coverline("build/anim-base/anim-base.js", 83);+Y.Anim.DEFAULT_UNIT = 'px';++ _yuitest_coverline("build/anim-base/anim-base.js", 85);+Y.Anim.DEFAULT_EASING = function (t, b, c, d) {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "DEFAULT_EASING", 85);+_yuitest_coverline("build/anim-base/anim-base.js", 86);+return c * t / d + b; // linear easing+ };++ /**+ * Time in milliseconds passed to setInterval for frame processing + *+ * @property intervalTime+ * @default 20+ * @static+ */+ _yuitest_coverline("build/anim-base/anim-base.js", 96);+Y.Anim._intervalTime = 20;++ /**+ * Bucket for custom getters and setters+ *+ * @property behaviors+ * @static+ */+ _yuitest_coverline("build/anim-base/anim-base.js", 104);+Y.Anim.behaviors = {+ left: {+ get: function(anim, attr) {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "get", 106);+_yuitest_coverline("build/anim-base/anim-base.js", 107);+return anim._getOffset(attr);+ }+ }+ };++ _yuitest_coverline("build/anim-base/anim-base.js", 112);+Y.Anim.behaviors.top = Y.Anim.behaviors.left;++ /**+ * The default setter to use when setting object properties.+ *+ * @property DEFAULT_SETTER+ * @static+ */+ _yuitest_coverline("build/anim-base/anim-base.js", 120);+Y.Anim.DEFAULT_SETTER = function(anim, att, from, to, elapsed, duration, fn, unit) {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "DEFAULT_SETTER", 120);+_yuitest_coverline("build/anim-base/anim-base.js", 121);+var node = anim._node,+ domNode = node._node,+ val = fn(elapsed, NUM(from), NUM(to) - NUM(from), duration);++ _yuitest_coverline("build/anim-base/anim-base.js", 125);+if (domNode) {+ _yuitest_coverline("build/anim-base/anim-base.js", 126);+if ('style' in domNode && (att in domNode.style || att in Y.DOM.CUSTOM_STYLES)) {+ _yuitest_coverline("build/anim-base/anim-base.js", 127);+unit = unit || '';+ _yuitest_coverline("build/anim-base/anim-base.js", 128);+node.setStyle(att, val + unit);+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 129);+if ('attributes' in domNode && att in domNode.attributes) {+ _yuitest_coverline("build/anim-base/anim-base.js", 130);+node.setAttribute(att, val);+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 131);+if (att in domNode) {+ _yuitest_coverline("build/anim-base/anim-base.js", 132);+domNode[att] = val;+ }}}+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 134);+if (node.set) {+ _yuitest_coverline("build/anim-base/anim-base.js", 135);+node.set(att, val);+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 136);+if (att in node) {+ _yuitest_coverline("build/anim-base/anim-base.js", 137);+node[att] = val;+ }}}+ };++ /**+ * The default getter to use when getting object properties.+ *+ * @property DEFAULT_GETTER+ * @static+ */+ _yuitest_coverline("build/anim-base/anim-base.js", 147);+Y.Anim.DEFAULT_GETTER = function(anim, att) {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "DEFAULT_GETTER", 147);+_yuitest_coverline("build/anim-base/anim-base.js", 148);+var node = anim._node,+ domNode = node._node,+ val = '';++ _yuitest_coverline("build/anim-base/anim-base.js", 152);+if (domNode) {+ _yuitest_coverline("build/anim-base/anim-base.js", 153);+if ('style' in domNode && (att in domNode.style || att in Y.DOM.CUSTOM_STYLES)) {+ _yuitest_coverline("build/anim-base/anim-base.js", 154);+val = node.getComputedStyle(att);+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 155);+if ('attributes' in domNode && att in domNode.attributes) {+ _yuitest_coverline("build/anim-base/anim-base.js", 156);+val = node.getAttribute(att);+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 157);+if (att in domNode) {+ _yuitest_coverline("build/anim-base/anim-base.js", 158);+val = domNode[att];+ }}}+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 160);+if (node.get) {+ _yuitest_coverline("build/anim-base/anim-base.js", 161);+val = node.get(att);+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 162);+if (att in node) {+ _yuitest_coverline("build/anim-base/anim-base.js", 163);+val = node[att];+ }}}++ _yuitest_coverline("build/anim-base/anim-base.js", 166);+return val;+ };++ _yuitest_coverline("build/anim-base/anim-base.js", 169);+Y.Anim.ATTRS = {+ /**+ * The object to be animated.+ * @attribute node+ * @type Node+ */+ node: {+ setter: function(node) {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "setter", 176);+_yuitest_coverline("build/anim-base/anim-base.js", 177);+if (node) {+ _yuitest_coverline("build/anim-base/anim-base.js", 178);+if (typeof node == 'string' || node.nodeType) {+ _yuitest_coverline("build/anim-base/anim-base.js", 179);+node = Y.one(node);+ }+ }++ _yuitest_coverline("build/anim-base/anim-base.js", 183);+this._node = node;+ _yuitest_coverline("build/anim-base/anim-base.js", 184);+if (!node) {+ }+ _yuitest_coverline("build/anim-base/anim-base.js", 186);+return node;+ }+ },++ /**+ * The length of the animation. Defaults to "1" (second).+ * @attribute duration+ * @type NUM+ */+ duration: {+ value: 1+ },++ /**+ * The method that will provide values to the attribute(s) during the animation. + * Defaults to "Easing.easeNone".+ * @attribute easing+ * @type Function+ */+ easing: {+ value: Y.Anim.DEFAULT_EASING,++ setter: function(val) {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "setter", 208);+_yuitest_coverline("build/anim-base/anim-base.js", 209);+if (typeof val === 'string' && Y.Easing) {+ _yuitest_coverline("build/anim-base/anim-base.js", 210);+return Y.Easing[val];+ }+ }+ },++ /**+ * The starting values for the animated properties.+ *+ * Fields may be strings, numbers, or functions.+ * If a function is used, the return value becomes the from value.+ * If no from value is specified, the DEFAULT_GETTER will be used.+ * Supports any unit, provided it matches the "to" (or default)+ * unit (e.g. `{width: '10em', color: 'rgb(0, 0, 0)', borderColor: '#ccc'}`).+ *+ * If using the default ('px' for length-based units), the unit may be omitted+ * (e.g. `{width: 100}, borderColor: 'ccc'}`, which defaults to pixels+ * and hex, respectively).+ *+ * @attribute from+ * @type Object+ */+ from: {},++ /**+ * The ending values for the animated properties.+ *+ * Fields may be strings, numbers, or functions.+ * Supports any unit, provided it matches the "from" (or default)+ * unit (e.g. `{width: '50%', color: 'red', borderColor: '#ccc'}`).+ *+ * If using the default ('px' for length-based units), the unit may be omitted+ * (e.g. `{width: 100, borderColor: 'ccc'}`, which defaults to pixels+ * and hex, respectively).+ *+ * @attribute to+ * @type Object+ */+ to: {},++ /**+ * Date stamp for the first frame of the animation.+ * @attribute startTime+ * @type Int+ * @default 0 + * @readOnly+ */+ startTime: {+ value: 0,+ readOnly: true+ },++ /**+ * Current time the animation has been running.+ * @attribute elapsedTime+ * @type Int+ * @default 0 + * @readOnly+ */+ elapsedTime: {+ value: 0,+ readOnly: true+ },++ /**+ * Whether or not the animation is currently running.+ * @attribute running + * @type Boolean+ * @default false + * @readOnly+ */+ running: {+ getter: function() {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "getter", 281);+_yuitest_coverline("build/anim-base/anim-base.js", 282);+return !!_running[Y.stamp(this)];+ },+ value: false,+ readOnly: true+ },++ /**+ * The number of times the animation should run + * @attribute iterations+ * @type Int+ * @default 1 + */+ iterations: {+ value: 1+ },++ /**+ * The number of iterations that have occurred.+ * Resets when an animation ends (reaches iteration count or stop() called). + * @attribute iterationCount+ * @type Int+ * @default 0+ * @readOnly+ */+ iterationCount: {+ value: 0,+ readOnly: true+ },++ /**+ * How iterations of the animation should behave. + * Possible values are "normal" and "alternate".+ * Normal will repeat the animation, alternate will reverse on every other pass.+ *+ * @attribute direction+ * @type String+ * @default "normal"+ */+ direction: {+ value: 'normal' // | alternate (fwd on odd, rev on even per spec)+ },++ /**+ * Whether or not the animation is currently paused.+ * @attribute paused + * @type Boolean+ * @default false + * @readOnly+ */+ paused: {+ readOnly: true,+ value: false+ },++ /**+ * If true, animation begins from last frame+ * @attribute reverse+ * @type Boolean+ * @default false + */+ reverse: {+ value: false+ }+++ };++ /**+ * Runs all animation instances.+ * @method run+ * @static+ */ + _yuitest_coverline("build/anim-base/anim-base.js", 354);+Y.Anim.run = function() {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "run", 354);+_yuitest_coverline("build/anim-base/anim-base.js", 355);+var instances = Y.Anim._instances;+ _yuitest_coverline("build/anim-base/anim-base.js", 356);+for (var i in instances) {+ _yuitest_coverline("build/anim-base/anim-base.js", 357);+if (instances[i].run) {+ _yuitest_coverline("build/anim-base/anim-base.js", 358);+instances[i].run();+ }+ }+ };++ /**+ * Pauses all animation instances.+ * @method pause+ * @static+ */ + _yuitest_coverline("build/anim-base/anim-base.js", 368);+Y.Anim.pause = function() {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "pause", 368);+_yuitest_coverline("build/anim-base/anim-base.js", 369);+for (var i in _running) { // stop timer if nothing running+ _yuitest_coverline("build/anim-base/anim-base.js", 370);+if (_running[i].pause) {+ _yuitest_coverline("build/anim-base/anim-base.js", 371);+_running[i].pause();+ }+ }++ _yuitest_coverline("build/anim-base/anim-base.js", 375);+Y.Anim._stopTimer();+ };++ /**+ * Stops all animation instances.+ * @method stop+ * @static+ */ + _yuitest_coverline("build/anim-base/anim-base.js", 383);+Y.Anim.stop = function() {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "stop", 383);+_yuitest_coverline("build/anim-base/anim-base.js", 384);+for (var i in _running) { // stop timer if nothing running+ _yuitest_coverline("build/anim-base/anim-base.js", 385);+if (_running[i].stop) {+ _yuitest_coverline("build/anim-base/anim-base.js", 386);+_running[i].stop();+ }+ }+ _yuitest_coverline("build/anim-base/anim-base.js", 389);+Y.Anim._stopTimer();+ };+ + _yuitest_coverline("build/anim-base/anim-base.js", 392);+Y.Anim._startTimer = function() {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_startTimer", 392);+_yuitest_coverline("build/anim-base/anim-base.js", 393);+if (!_timer) {+ _yuitest_coverline("build/anim-base/anim-base.js", 394);+_timer = setInterval(Y.Anim._runFrame, Y.Anim._intervalTime);+ }+ };++ _yuitest_coverline("build/anim-base/anim-base.js", 398);+Y.Anim._stopTimer = function() {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_stopTimer", 398);+_yuitest_coverline("build/anim-base/anim-base.js", 399);+clearInterval(_timer);+ _yuitest_coverline("build/anim-base/anim-base.js", 400);+_timer = 0;+ };++ /**+ * Called per Interval to handle each animation frame.+ * @method _runFrame+ * @private+ * @static+ */ + _yuitest_coverline("build/anim-base/anim-base.js", 409);+Y.Anim._runFrame = function() {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_runFrame", 409);+_yuitest_coverline("build/anim-base/anim-base.js", 410);+var done = true;+ _yuitest_coverline("build/anim-base/anim-base.js", 411);+for (var anim in _running) {+ _yuitest_coverline("build/anim-base/anim-base.js", 412);+if (_running[anim]._runFrame) {+ _yuitest_coverline("build/anim-base/anim-base.js", 413);+done = false;+ _yuitest_coverline("build/anim-base/anim-base.js", 414);+_running[anim]._runFrame();+ }+ }++ _yuitest_coverline("build/anim-base/anim-base.js", 418);+if (done) {+ _yuitest_coverline("build/anim-base/anim-base.js", 419);+Y.Anim._stopTimer();+ }+ };++ _yuitest_coverline("build/anim-base/anim-base.js", 423);+Y.Anim.RE_UNITS = /^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;++ _yuitest_coverline("build/anim-base/anim-base.js", 425);+var proto = {+ /**+ * Starts or resumes an animation.+ * @method run+ * @chainable+ */ + run: function() {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "run", 431);+_yuitest_coverline("build/anim-base/anim-base.js", 432);+if (this.get(PAUSED)) {+ _yuitest_coverline("build/anim-base/anim-base.js", 433);+this._resume();+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 434);+if (!this.get(RUNNING)) {+ _yuitest_coverline("build/anim-base/anim-base.js", 435);+this._start();+ }}+ _yuitest_coverline("build/anim-base/anim-base.js", 437);+return this;+ },++ /**+ * Pauses the animation and+ * freezes it in its current state and time.+ * Calling run() will continue where it left off.+ * @method pause+ * @chainable+ */ + pause: function() {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "pause", 447);+_yuitest_coverline("build/anim-base/anim-base.js", 448);+if (this.get(RUNNING)) {+ _yuitest_coverline("build/anim-base/anim-base.js", 449);+this._pause();+ }+ _yuitest_coverline("build/anim-base/anim-base.js", 451);+return this;+ },++ /**+ * Stops the animation and resets its time.+ * @method stop+ * @param {Boolean} finish If true, the animation will move to the last frame+ * @chainable+ */ + stop: function(finish) {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "stop", 460);+_yuitest_coverline("build/anim-base/anim-base.js", 461);+if (this.get(RUNNING) || this.get(PAUSED)) {+ _yuitest_coverline("build/anim-base/anim-base.js", 462);+this._end(finish);+ }+ _yuitest_coverline("build/anim-base/anim-base.js", 464);+return this;+ },++ _added: false,++ _start: function() {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_start", 469);+_yuitest_coverline("build/anim-base/anim-base.js", 470);+this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));+ _yuitest_coverline("build/anim-base/anim-base.js", 471);+this._actualFrames = 0;+ _yuitest_coverline("build/anim-base/anim-base.js", 472);+if (!this.get(PAUSED)) {+ _yuitest_coverline("build/anim-base/anim-base.js", 473);+this._initAnimAttr();+ }+ _yuitest_coverline("build/anim-base/anim-base.js", 475);+_running[Y.stamp(this)] = this;+ _yuitest_coverline("build/anim-base/anim-base.js", 476);+Y.Anim._startTimer();++ _yuitest_coverline("build/anim-base/anim-base.js", 478);+this.fire(START);+ },++ _pause: function() {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_pause", 481);+_yuitest_coverline("build/anim-base/anim-base.js", 482);+this._set(START_TIME, null);+ _yuitest_coverline("build/anim-base/anim-base.js", 483);+this._set(PAUSED, true);+ _yuitest_coverline("build/anim-base/anim-base.js", 484);+delete _running[Y.stamp(this)];++ /**+ * @event pause+ * @description fires when an animation is paused.+ * @param {Event} ev The pause event.+ * @type Event.Custom+ */+ _yuitest_coverline("build/anim-base/anim-base.js", 492);+this.fire('pause');+ },++ _resume: function() {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_resume", 495);+_yuitest_coverline("build/anim-base/anim-base.js", 496);+this._set(PAUSED, false);+ _yuitest_coverline("build/anim-base/anim-base.js", 497);+_running[Y.stamp(this)] = this;+ _yuitest_coverline("build/anim-base/anim-base.js", 498);+this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));+ _yuitest_coverline("build/anim-base/anim-base.js", 499);+Y.Anim._startTimer();++ /**+ * @event resume+ * @description fires when an animation is resumed (run from pause).+ * @param {Event} ev The pause event.+ * @type Event.Custom+ */+ _yuitest_coverline("build/anim-base/anim-base.js", 507);+this.fire('resume');+ },++ _end: function(finish) {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_end", 510);+_yuitest_coverline("build/anim-base/anim-base.js", 511);+var duration = this.get('duration') * 1000;+ _yuitest_coverline("build/anim-base/anim-base.js", 512);+if (finish) { // jump to last frame+ _yuitest_coverline("build/anim-base/anim-base.js", 513);+this._runAttrs(duration, duration, this.get(REVERSE));+ }++ _yuitest_coverline("build/anim-base/anim-base.js", 516);+this._set(START_TIME, null);+ _yuitest_coverline("build/anim-base/anim-base.js", 517);+this._set(ELAPSED_TIME, 0);+ _yuitest_coverline("build/anim-base/anim-base.js", 518);+this._set(PAUSED, false);++ _yuitest_coverline("build/anim-base/anim-base.js", 520);+delete _running[Y.stamp(this)];+ _yuitest_coverline("build/anim-base/anim-base.js", 521);+this.fire(END, {elapsed: this.get(ELAPSED_TIME)});+ },++ _runFrame: function() {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_runFrame", 524);+_yuitest_coverline("build/anim-base/anim-base.js", 525);+var d = this._runtimeAttr.duration,+ t = new Date() - this.get(START_TIME),+ reverse = this.get(REVERSE),+ done = (t >= d),+ attribute,+ setter;+ + _yuitest_coverline("build/anim-base/anim-base.js", 532);+this._runAttrs(t, d, reverse);+ _yuitest_coverline("build/anim-base/anim-base.js", 533);+this._actualFrames += 1;+ _yuitest_coverline("build/anim-base/anim-base.js", 534);+this._set(ELAPSED_TIME, t);++ _yuitest_coverline("build/anim-base/anim-base.js", 536);+this.fire(TWEEN);+ _yuitest_coverline("build/anim-base/anim-base.js", 537);+if (done) {+ _yuitest_coverline("build/anim-base/anim-base.js", 538);+this._lastFrame();+ }+ },++ _runAttrs: function(t, d, reverse) {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_runAttrs", 542);+_yuitest_coverline("build/anim-base/anim-base.js", 543);+var attr = this._runtimeAttr,+ customAttr = Y.Anim.behaviors,+ easing = attr.easing,+ lastFrame = d,+ done = false,+ attribute,+ setter,+ i;++ _yuitest_coverline("build/anim-base/anim-base.js", 552);+if (t >= d) {+ _yuitest_coverline("build/anim-base/anim-base.js", 553);+done = true;+ }++ _yuitest_coverline("build/anim-base/anim-base.js", 556);+if (reverse) {+ _yuitest_coverline("build/anim-base/anim-base.js", 557);+t = d - t;+ _yuitest_coverline("build/anim-base/anim-base.js", 558);+lastFrame = 0;+ }++ _yuitest_coverline("build/anim-base/anim-base.js", 561);+for (i in attr) {+ _yuitest_coverline("build/anim-base/anim-base.js", 562);+if (attr[i].to) {+ _yuitest_coverline("build/anim-base/anim-base.js", 563);+attribute = attr[i];+ _yuitest_coverline("build/anim-base/anim-base.js", 564);+setter = (i in customAttr && 'set' in customAttr[i]) ?+ customAttr[i].set : Y.Anim.DEFAULT_SETTER;++ _yuitest_coverline("build/anim-base/anim-base.js", 567);+if (!done) {+ _yuitest_coverline("build/anim-base/anim-base.js", 568);+setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit); + } else {+ _yuitest_coverline("build/anim-base/anim-base.js", 570);+setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit); + }+ }+ }+++ },++ _lastFrame: function() {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_lastFrame", 578);+_yuitest_coverline("build/anim-base/anim-base.js", 579);+var iter = this.get('iterations'),+ iterCount = this.get(ITERATION_COUNT);++ _yuitest_coverline("build/anim-base/anim-base.js", 582);+iterCount += 1;+ _yuitest_coverline("build/anim-base/anim-base.js", 583);+if (iter === 'infinite' || iterCount < iter) {+ _yuitest_coverline("build/anim-base/anim-base.js", 584);+if (this.get('direction') === 'alternate') {+ _yuitest_coverline("build/anim-base/anim-base.js", 585);+this.set(REVERSE, !this.get(REVERSE)); // flip it+ }+ /**+ * @event iteration+ * @description fires when an animation begins an iteration.+ * @param {Event} ev The iteration event.+ * @type Event.Custom+ */+ _yuitest_coverline("build/anim-base/anim-base.js", 593);+this.fire('iteration');+ } else {+ _yuitest_coverline("build/anim-base/anim-base.js", 595);+iterCount = 0;+ _yuitest_coverline("build/anim-base/anim-base.js", 596);+this._end();+ }++ _yuitest_coverline("build/anim-base/anim-base.js", 599);+this._set(START_TIME, new Date());+ _yuitest_coverline("build/anim-base/anim-base.js", 600);+this._set(ITERATION_COUNT, iterCount);+ },++ _initAnimAttr: function() {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_initAnimAttr", 603);+_yuitest_coverline("build/anim-base/anim-base.js", 604);+var from = this.get('from') || {},+ to = this.get('to') || {},+ attr = {+ duration: this.get('duration') * 1000,+ easing: this.get('easing')+ },+ customAttr = Y.Anim.behaviors,+ node = this.get(NODE), // implicit attr init+ unit, begin, end;++ _yuitest_coverline("build/anim-base/anim-base.js", 614);+Y.each(to, function(val, name) {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "(anonymous 2)", 614);+_yuitest_coverline("build/anim-base/anim-base.js", 615);+if (typeof val === 'function') {+ _yuitest_coverline("build/anim-base/anim-base.js", 616);+val = val.call(this, node);+ }++ _yuitest_coverline("build/anim-base/anim-base.js", 619);+begin = from[name];+ _yuitest_coverline("build/anim-base/anim-base.js", 620);+if (begin === undefined) {+ _yuitest_coverline("build/anim-base/anim-base.js", 621);+begin = (name in customAttr && 'get' in customAttr[name]) ?+ customAttr[name].get(this, name) : Y.Anim.DEFAULT_GETTER(this, name);+ } else {_yuitest_coverline("build/anim-base/anim-base.js", 623);+if (typeof begin === 'function') {+ _yuitest_coverline("build/anim-base/anim-base.js", 624);+begin = begin.call(this, node);+ }}++ _yuitest_coverline("build/anim-base/anim-base.js", 627);+var mFrom = Y.Anim.RE_UNITS.exec(begin);+ _yuitest_coverline("build/anim-base/anim-base.js", 628);+var mTo = Y.Anim.RE_UNITS.exec(val);++ _yuitest_coverline("build/anim-base/anim-base.js", 630);+begin = mFrom ? mFrom[1] : begin;+ _yuitest_coverline("build/anim-base/anim-base.js", 631);+end = mTo ? mTo[1] : val;+ _yuitest_coverline("build/anim-base/anim-base.js", 632);+unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units++ _yuitest_coverline("build/anim-base/anim-base.js", 634);+if (!unit && Y.Anim.RE_DEFAULT_UNIT.test(name)) {+ _yuitest_coverline("build/anim-base/anim-base.js", 635);+unit = Y.Anim.DEFAULT_UNIT;+ }++ _yuitest_coverline("build/anim-base/anim-base.js", 638);+if (!begin || !end) {+ _yuitest_coverline("build/anim-base/anim-base.js", 639);+Y.error('invalid "from" or "to" for "' + name + '"', 'Anim');+ _yuitest_coverline("build/anim-base/anim-base.js", 640);+return;+ }++ _yuitest_coverline("build/anim-base/anim-base.js", 643);+attr[name] = {+ from: Y.Lang.isObject(begin) ? Y.clone(begin) : begin,+ to: end,+ unit: unit+ };++ }, this);++ _yuitest_coverline("build/anim-base/anim-base.js", 651);+this._runtimeAttr = attr;+ },+++ // TODO: move to computedStyle? (browsers dont agree on default computed offsets)+ _getOffset: function(attr) {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "_getOffset", 656);+_yuitest_coverline("build/anim-base/anim-base.js", 657);+var node = this._node,+ val = node.getComputedStyle(attr),+ get = (attr === 'left') ? 'getX': 'getY',+ set = (attr === 'left') ? 'setX': 'setY';++ _yuitest_coverline("build/anim-base/anim-base.js", 662);+if (val === 'auto') {+ _yuitest_coverline("build/anim-base/anim-base.js", 663);+var position = node.getStyle('position');+ _yuitest_coverline("build/anim-base/anim-base.js", 664);+if (position === 'absolute' || position === 'fixed') {+ _yuitest_coverline("build/anim-base/anim-base.js", 665);+val = node[get]();+ _yuitest_coverline("build/anim-base/anim-base.js", 666);+node[set](val);+ } else {+ _yuitest_coverline("build/anim-base/anim-base.js", 668);+val = 0;+ }+ }++ _yuitest_coverline("build/anim-base/anim-base.js", 672);+return val;+ },++ destructor: function() {+ _yuitest_coverfunc("build/anim-base/anim-base.js", "destructor", 675);+_yuitest_coverline("build/anim-base/anim-base.js", 676);+delete Y.Anim._instances[Y.stamp(this)];+ }+ };++ _yuitest_coverline("build/anim-base/anim-base.js", 680);+Y.extend(Y.Anim, Y.Base, proto);+++}, '3.7.1', {"requires": ["base-base", "node-style"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('anim-base', function(Y) {+YUI.add('anim-base', function (Y, NAME) { /** * The Animation Utility provides an API for creating advanced transitions.@@ -127,16 +127,20 @@ var node = anim._node, domNode = node._node, val = fn(elapsed, NUM(from), NUM(to) - NUM(from), duration);- //make sure node instance- if (domNode && (domNode.style || domNode.attributes)) {- if (att in domNode.style || att in Y.DOM.CUSTOM_STYLES) {++ if (domNode) {+ if ('style' in domNode && (att in domNode.style || att in Y.DOM.CUSTOM_STYLES)) { unit = unit || ''; node.setStyle(att, val + unit);- } else if (domNode.attributes[att]) {+ } else if ('attributes' in domNode && att in domNode.attributes) { node.setAttribute(att, val);+ } else if (att in domNode) {+ domNode[att] = val; } } else if (node.set) { node.set(att, val);+ } else if (att in node) {+ node[att] = val; } }; @@ -150,15 +154,19 @@ var node = anim._node, domNode = node._node, val = '';- //make sure node instance- if (domNode && (domNode.style || domNode.attributes)) {- if (att in domNode.style || att in Y.DOM.CUSTOM_STYLES) {++ if (domNode) {+ if ('style' in domNode && (att in domNode.style || att in Y.DOM.CUSTOM_STYLES)) { val = node.getComputedStyle(att);- } else if (domNode.attributes[att]) {+ } else if ('attributes' in domNode && att in domNode.attributes) { val = node.getAttribute(att);+ } else if (att in domNode) {+ val = domNode[att]; } } else if (node.get) { val = node.get(att);+ } else if (att in node) {+ val = node[att]; } return val;@@ -218,7 +226,7 @@ * If a function is used, the return value becomes the from value. * If no from value is specified, the DEFAULT_GETTER will be used. * Supports any unit, provided it matches the "to" (or default)- * unit (e.g. `{width: '10em', color: 'rgb(0, 0 0)', borderColor: '#ccc'}`).+ * unit (e.g. `{width: '10em', color: 'rgb(0, 0, 0)', borderColor: '#ccc'}`). * * If using the default ('px' for length-based units), the unit may be omitted * (e.g. `{width: 100}, borderColor: 'ccc'}`, which defaults to pixels@@ -640,7 +648,7 @@ } attr[name] = {- from: begin,+ from: Y.Lang.isObject(begin) ? Y.clone(begin) : begin, to: end, unit: unit };@@ -679,4 +687,4 @@ Y.extend(Y.Anim, Y.Base, proto); -}, '3.5.1' ,{requires:['base-base', 'node-style']});+}, '3.7.1', {"requires": ["base-base", "node-style"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("anim-base",function(b){var c="running",n="startTime",l="elapsedTime",j="start",i="tween",m="end",d="node",k="paused",o="reverse",h="iterationCount",a=Number;var f={},e;b.Anim=function(){b.Anim.superclass.constructor.apply(this,arguments);b.Anim._instances[b.stamp(this)]=this;};b.Anim.NAME="anim";b.Anim._instances={};b.Anim.RE_DEFAULT_UNIT=/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;b.Anim.DEFAULT_UNIT="px";b.Anim.DEFAULT_EASING=function(q,p,s,r){return s*q/r+p;};b.Anim._intervalTime=20;b.Anim.behaviors={left:{get:function(q,p){return q._getOffset(p);}}};b.Anim.behaviors.top=b.Anim.behaviors.left;b.Anim.DEFAULT_SETTER=function(t,u,w,x,z,s,v,y){var q=t._node,r=q._node,p=v(z,a(w),a(x)-a(w),s);if(r&&(r.style||r.attributes)){if(u in r.style||u in b.DOM.CUSTOM_STYLES){y=y||"";q.setStyle(u,p+y);}else{if(r.attributes[u]){q.setAttribute(u,p);}}}else{if(q.set){q.set(u,p);}}};b.Anim.DEFAULT_GETTER=function(s,p){var r=s._node,q=r._node,t="";if(q&&(q.style||q.attributes)){if(p in q.style||p in b.DOM.CUSTOM_STYLES){t=r.getComputedStyle(p);}else{if(q.attributes[p]){t=r.getAttribute(p);}}}else{if(r.get){t=r.get(p);}}return t;};b.Anim.ATTRS={node:{setter:function(p){if(p){if(typeof p=="string"||p.nodeType){p=b.one(p);}}this._node=p;if(!p){}return p;}},duration:{value:1},easing:{value:b.Anim.DEFAULT_EASING,setter:function(p){if(typeof p==="string"&&b.Easing){return b.Easing[p];}}},from:{},to:{},startTime:{value:0,readOnly:true},elapsedTime:{value:0,readOnly:true},running:{getter:function(){return !!f[b.stamp(this)];},value:false,readOnly:true},iterations:{value:1},iterationCount:{value:0,readOnly:true},direction:{value:"normal"},paused:{readOnly:true,value:false},reverse:{value:false}};b.Anim.run=function(){var q=b.Anim._instances;for(var p in q){if(q[p].run){q[p].run();}}};b.Anim.pause=function(){for(var p in f){if(f[p].pause){f[p].pause();}}b.Anim._stopTimer();};b.Anim.stop=function(){for(var p in f){if(f[p].stop){f[p].stop();}}b.Anim._stopTimer();};b.Anim._startTimer=function(){if(!e){e=setInterval(b.Anim._runFrame,b.Anim._intervalTime);}};b.Anim._stopTimer=function(){clearInterval(e);e=0;};b.Anim._runFrame=function(){var p=true;for(var q in f){if(f[q]._runFrame){p=false;f[q]._runFrame();}}if(p){b.Anim._stopTimer();}};b.Anim.RE_UNITS=/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;var g={run:function(){if(this.get(k)){this._resume();}else{if(!this.get(c)){this._start();}}return this;},pause:function(){if(this.get(c)){this._pause();}return this;},stop:function(p){if(this.get(c)||this.get(k)){this._end(p);}return this;},_added:false,_start:function(){this._set(n,new Date()-this.get(l));this._actualFrames=0;if(!this.get(k)){this._initAnimAttr();}f[b.stamp(this)]=this;b.Anim._startTimer();this.fire(j);},_pause:function(){this._set(n,null);this._set(k,true);delete f[b.stamp(this)];this.fire("pause");},_resume:function(){this._set(k,false);f[b.stamp(this)]=this;this._set(n,new Date()-this.get(l));b.Anim._startTimer();this.fire("resume");},_end:function(p){var q=this.get("duration")*1000;if(p){this._runAttrs(q,q,this.get(o));}this._set(n,null);this._set(l,0);this._set(k,false);delete f[b.stamp(this)];this.fire(m,{elapsed:this.get(l)});},_runFrame:function(){var u=this._runtimeAttr.duration,r=new Date()-this.get(n),q=this.get(o),p=(r>=u),s,v;this._runAttrs(r,u,q);this._actualFrames+=1;this._set(l,r);this.fire(i);if(p){this._lastFrame();}},_runAttrs:function(A,z,w){var x=this._runtimeAttr,r=b.Anim.behaviors,y=x.easing,p=z,u=false,q,s,v;if(A>=z){u=true;}if(w){A=z-A;p=0;}for(v in x){if(x[v].to){q=x[v];s=(v in r&&"set" in r[v])?r[v].set:b.Anim.DEFAULT_SETTER;if(!u){s(this,v,q.from,q.to,A,z,y,q.unit);}else{s(this,v,q.from,q.to,p,z,y,q.unit);}}}},_lastFrame:function(){var p=this.get("iterations"),q=this.get(h);q+=1;if(p==="infinite"||q<p){if(this.get("direction")==="alternate"){this.set(o,!this.get(o));}this.fire("iteration");}else{q=0;this._end();}this._set(n,new Date());this._set(h,q);},_initAnimAttr:function(){var w=this.get("from")||{},v=this.get("to")||{},p={duration:this.get("duration")*1000,easing:this.get("easing")},r=b.Anim.behaviors,u=this.get(d),t,s,q;b.each(v,function(A,y){if(typeof A==="function"){A=A.call(this,u);}s=w[y];if(s===undefined){s=(y in r&&"get" in r[y])?r[y].get(this,y):b.Anim.DEFAULT_GETTER(this,y);}else{if(typeof s==="function"){s=s.call(this,u);}}var x=b.Anim.RE_UNITS.exec(s);var z=b.Anim.RE_UNITS.exec(A);s=x?x[1]:s;q=z?z[1]:A;t=z?z[2]:x?x[2]:"";if(!t&&b.Anim.RE_DEFAULT_UNIT.test(y)){t=b.Anim.DEFAULT_UNIT;}if(!s||!q){b.error('invalid "from" or "to" for "'+y+'"',"Anim");return;}p[y]={from:s,to:q,unit:t};},this);this._runtimeAttr=p;},_getOffset:function(q){var s=this._node,t=s.getComputedStyle(q),r=(q==="left")?"getX":"getY",u=(q==="left")?"setX":"setY";if(t==="auto"){var p=s.getStyle("position");if(p==="absolute"||p==="fixed"){t=s[r]();s[u](t);}else{t=0;}}return t;},destructor:function(){delete b.Anim._instances[b.stamp(this)];}};b.extend(b.Anim,b.Base,g);},"3.5.1",{requires:["base-base","node-style"]});+YUI.add("anim-base",function(e,t){var n="running",r="startTime",i="elapsedTime",s="start",o="tween",u="end",a="node",f="paused",l="reverse",c="iterationCount",h=Number,p={},d;e.Anim=function(){e.Anim.superclass.constructor.apply(this,arguments),e.Anim._instances[e.stamp(this)]=this},e.Anim.NAME="anim",e.Anim._instances={},e.Anim.RE_DEFAULT_UNIT=/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i,e.Anim.DEFAULT_UNIT="px",e.Anim.DEFAULT_EASING=function(e,t,n,r){return n*e/r+t},e.Anim._intervalTime=20,e.Anim.behaviors={left:{get:function(e,t){return e._getOffset(t)}}},e.Anim.behaviors.top=e.Anim.behaviors.left,e.Anim.DEFAULT_SETTER=function(t,n,r,i,s,o,u,a){var f=t._node,l=f._node,c=u(s,h(r),h(i)-h(r),o);l?"style"in l&&(n in l.style||n in e.DOM.CUSTOM_STYLES)?(a=a||"",f.setStyle(n,c+a)):"attributes"in l&&n in l.attributes?f.setAttribute(n,c):n in l&&(l[n]=c):f.set?f.set(n,c):n in f&&(f[n]=c)},e.Anim.DEFAULT_GETTER=function(t,n){var r=t._node,i=r._node,s="";return i?"style"in i&&(n in i.style||n in e.DOM.CUSTOM_STYLES)?s=r.getComputedStyle(n):"attributes"in i&&n in i.attributes?s=r.getAttribute(n):n in i&&(s=i[n]):r.get?s=r.get(n):n in r&&(s=r[n]),s},e.Anim.ATTRS={node:{setter:function(t){return t&&(typeof t=="string"||t.nodeType)&&(t=e.one(t)),this._node=t,!t,t}},duration:{value:1},easing:{value:e.Anim.DEFAULT_EASING,setter:function(t){if(typeof t=="string"&&e.Easing)return e.Easing[t]}},from:{},to:{},startTime:{value:0,readOnly:!0},elapsedTime:{value:0,readOnly:!0},running:{getter:function(){return!!p[e.stamp(this)]},value:!1,readOnly:!0},iterations:{value:1},iterationCount:{value:0,readOnly:!0},direction:{value:"normal"},paused:{readOnly:!0,value:!1},reverse:{value:!1}},e.Anim.run=function(){var t=e.Anim._instances;for(var n in t)t[n].run&&t[n].run()},e.Anim.pause=function(){for(var t in p)p[t].pause&&p[t].pause();e.Anim._stopTimer()},e.Anim.stop=function(){for(var t in p)p[t].stop&&p[t].stop();e.Anim._stopTimer()},e.Anim._startTimer=function(){d||(d=setInterval(e.Anim._runFrame,e.Anim._intervalTime))},e.Anim._stopTimer=function(){clearInterval(d),d=0},e.Anim._runFrame=function(){var t=!0;for(var n in p)p[n]._runFrame&&(t=!1,p[n]._runFrame());t&&e.Anim._stopTimer()},e.Anim.RE_UNITS=/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;var v={run:function(){return this.get(f)?this._resume():this.get(n)||this._start(),this},pause:function(){return this.get(n)&&this._pause(),this},stop:function(e){return(this.get(n)||this.get(f))&&this._end(e),this},_added:!1,_start:function(){this._set(r,new Date-this.get(i)),this._actualFrames=0,this.get(f)||this._initAnimAttr(),p[e.stamp(this)]=this,e.Anim._startTimer(),this.fire(s)},_pause:function(){this._set(r,null),this._set(f,!0),delete p[e.stamp(this)],this.fire("pause")},_resume:function(){this._set(f,!1),p[e.stamp(this)]=this,this._set(r,new Date-this.get(i)),e.Anim._startTimer(),this.fire("resume")},_end:function(t){var n=this.get("duration")*1e3;t&&this._runAttrs(n,n,this.get(l)),this._set(r,null),this._set(i,0),this._set(f,!1),delete p[e.stamp(this)],this.fire(u,{elapsed:this.get(i)})},_runFrame:function(){var e=this._runtimeAttr.duration,t=new Date-this.get(r),n=this.get(l),s=t>=e,u,a;this._runAttrs(t,e,n),this._actualFrames+=1,this._set(i,t),this.fire(o),s&&this._lastFrame()},_runAttrs:function(t,n,r){var i=this._runtimeAttr,s=e.Anim.behaviors,o=i.easing,u=n,a=!1,f,l,c;t>=n&&(a=!0),r&&(t=n-t,u=0);for(c in i)i[c].to&&(f=i[c],l=c in s&&"set"in s[c]?s[c].set:e.Anim.DEFAULT_SETTER,a?l(this,c,f.from,f.to,u,n,o,f.unit):l(this,c,f.from,f.to,t,n,o,f.unit))},_lastFrame:function(){var e=this.get("iterations"),t=this.get(c);t+=1,e==="infinite"||t<e?(this.get("direction")==="alternate"&&this.set(l,!this.get(l)),this.fire("iteration")):(t=0,this._end()),this._set(r,new Date),this._set(c,t)},_initAnimAttr:function(){var t=this.get("from")||{},n=this.get("to")||{},r={duration:this.get("duration")*1e3,easing:this.get("easing")},i=e.Anim.behaviors,s=this.get(a),o,u,f;e.each(n,function(n,a){typeof n=="function"&&(n=n.call(this,s)),u=t[a],u===undefined?u=a in i&&"get"in i[a]?i[a].get(this,a):e.Anim.DEFAULT_GETTER(this,a):typeof u=="function"&&(u=u.call(this,s));var l=e.Anim.RE_UNITS.exec(u),c=e.Anim.RE_UNITS.exec(n);u=l?l[1]:u,f=c?c[1]:n,o=c?c[2]:l?l[2]:"",!o&&e.Anim.RE_DEFAULT_UNIT.test(a)&&(o=e.Anim.DEFAULT_UNIT);if(!u||!f){e.error('invalid "from" or "to" for "'+a+'"',"Anim");return}r[a]={from:e.Lang.isObject(u)?e.clone(u):u,to:f,unit:o}},this),this._runtimeAttr=r},_getOffset:function(e){var t=this._node,n=t.getComputedStyle(e),r=e==="left"?"getX":"getY",i=e==="left"?"setX":"setY";if(n==="auto"){var s=t.getStyle("position");s==="absolute"||s==="fixed"?(n=t[r](),t[i](n)):n=0}return n},destructor:function(){delete e.Anim._instances[e.stamp(this)]}};e.extend(e.Anim,e.Base,v)},"3.7.1",{requires:["base-base","node-style"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('anim-base', function(Y) {+YUI.add('anim-base', function (Y, NAME) { /** * The Animation Utility provides an API for creating advanced transitions.@@ -127,16 +127,20 @@ var node = anim._node, domNode = node._node, val = fn(elapsed, NUM(from), NUM(to) - NUM(from), duration);- //make sure node instance- if (domNode && (domNode.style || domNode.attributes)) {- if (att in domNode.style || att in Y.DOM.CUSTOM_STYLES) {++ if (domNode) {+ if ('style' in domNode && (att in domNode.style || att in Y.DOM.CUSTOM_STYLES)) { unit = unit || ''; node.setStyle(att, val + unit);- } else if (domNode.attributes[att]) {+ } else if ('attributes' in domNode && att in domNode.attributes) { node.setAttribute(att, val);+ } else if (att in domNode) {+ domNode[att] = val; } } else if (node.set) { node.set(att, val);+ } else if (att in node) {+ node[att] = val; } }; @@ -150,15 +154,19 @@ var node = anim._node, domNode = node._node, val = '';- //make sure node instance- if (domNode && (domNode.style || domNode.attributes)) {- if (att in domNode.style || att in Y.DOM.CUSTOM_STYLES) {++ if (domNode) {+ if ('style' in domNode && (att in domNode.style || att in Y.DOM.CUSTOM_STYLES)) { val = node.getComputedStyle(att);- } else if (domNode.attributes[att]) {+ } else if ('attributes' in domNode && att in domNode.attributes) { val = node.getAttribute(att);+ } else if (att in domNode) {+ val = domNode[att]; } } else if (node.get) { val = node.get(att);+ } else if (att in node) {+ val = node[att]; } return val;@@ -217,7 +225,7 @@ * If a function is used, the return value becomes the from value. * If no from value is specified, the DEFAULT_GETTER will be used. * Supports any unit, provided it matches the "to" (or default)- * unit (e.g. `{width: '10em', color: 'rgb(0, 0 0)', borderColor: '#ccc'}`).+ * unit (e.g. `{width: '10em', color: 'rgb(0, 0, 0)', borderColor: '#ccc'}`). * * If using the default ('px' for length-based units), the unit may be omitted * (e.g. `{width: 100}, borderColor: 'ccc'}`, which defaults to pixels@@ -639,7 +647,7 @@ } attr[name] = {- from: begin,+ from: Y.Lang.isObject(begin) ? Y.clone(begin) : begin, to: end, unit: unit };@@ -678,4 +686,4 @@ Y.extend(Y.Anim, Y.Base, proto); -}, '3.5.1' ,{requires:['base-base', 'node-style']});+}, '3.7.1', {"requires": ["base-base", "node-style"]});
@@ -0,0 +1,112 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/anim-color/anim-color.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/anim-color/anim-color.js",+ code: []+};+_yuitest_coverage["build/anim-color/anim-color.js"].code=["YUI.add('anim-color', function (Y, NAME) {","","/**"," * Adds support for color properties in <code>to</code>"," * and <code>from</code> attributes."," * @module anim"," * @submodule anim-color"," */","","var NUM = Number;","","Y.Anim.getUpdatedColorValue = function(fromColor, toColor, elapsed, duration, fn)","{"," fromColor = Y.Color.re_RGB.exec(Y.Color.toRGB(fromColor));"," toColor = Y.Color.re_RGB.exec(Y.Color.toRGB(toColor));",""," if (!fromColor || fromColor.length < 3 || !toColor || toColor.length < 3) {"," Y.error('invalid from or to passed to color behavior');"," }",""," return 'rgb(' + ["," Math.floor(fn(elapsed, NUM(fromColor[1]), NUM(toColor[1]) - NUM(fromColor[1]), duration)),"," Math.floor(fn(elapsed, NUM(fromColor[2]), NUM(toColor[2]) - NUM(fromColor[2]), duration)),"," Math.floor(fn(elapsed, NUM(fromColor[3]), NUM(toColor[3]) - NUM(fromColor[3]), duration))"," ].join(', ') + ')';","};","","Y.Anim.behaviors.color = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," anim._node.setStyle(att, Y.Anim.getUpdatedColorValue(from, to, elapsed, duration, fn)); "," },"," "," // TODO: default bgcolor const"," get: function(anim, att) {"," var val = anim._node.getComputedStyle(att);"," val = (val === 'transparent') ? 'rgb(255, 255, 255)' : val;"," return val;"," }","};","","Y.each(['backgroundColor',"," 'borderColor',"," 'borderTopColor',"," 'borderRightColor', "," 'borderBottomColor', "," 'borderLeftColor'],"," function(v, i) {"," Y.Anim.behaviors[v] = Y.Anim.behaviors.color;"," }",");","","","}, '3.7.1', {\"requires\": [\"anim-base\"]});"];+_yuitest_coverage["build/anim-color/anim-color.js"].lines = {"1":0,"10":0,"12":0,"14":0,"15":0,"17":0,"18":0,"21":0,"28":0,"30":0,"35":0,"36":0,"37":0,"41":0,"48":0};+_yuitest_coverage["build/anim-color/anim-color.js"].functions = {"getUpdatedColorValue:12":0,"set:29":0,"get:34":0,"(anonymous 2):47":0,"(anonymous 1):1":0};+_yuitest_coverage["build/anim-color/anim-color.js"].coveredLines = 15;+_yuitest_coverage["build/anim-color/anim-color.js"].coveredFunctions = 5;+_yuitest_coverline("build/anim-color/anim-color.js", 1);+YUI.add('anim-color', function (Y, NAME) {++/**+ * Adds support for color properties in <code>to</code>+ * and <code>from</code> attributes.+ * @module anim+ * @submodule anim-color+ */++_yuitest_coverfunc("build/anim-color/anim-color.js", "(anonymous 1)", 1);+_yuitest_coverline("build/anim-color/anim-color.js", 10);+var NUM = Number;++_yuitest_coverline("build/anim-color/anim-color.js", 12);+Y.Anim.getUpdatedColorValue = function(fromColor, toColor, elapsed, duration, fn)+{+ _yuitest_coverfunc("build/anim-color/anim-color.js", "getUpdatedColorValue", 12);+_yuitest_coverline("build/anim-color/anim-color.js", 14);+fromColor = Y.Color.re_RGB.exec(Y.Color.toRGB(fromColor));+ _yuitest_coverline("build/anim-color/anim-color.js", 15);+toColor = Y.Color.re_RGB.exec(Y.Color.toRGB(toColor));++ _yuitest_coverline("build/anim-color/anim-color.js", 17);+if (!fromColor || fromColor.length < 3 || !toColor || toColor.length < 3) {+ _yuitest_coverline("build/anim-color/anim-color.js", 18);+Y.error('invalid from or to passed to color behavior');+ }++ _yuitest_coverline("build/anim-color/anim-color.js", 21);+return 'rgb(' + [+ Math.floor(fn(elapsed, NUM(fromColor[1]), NUM(toColor[1]) - NUM(fromColor[1]), duration)),+ Math.floor(fn(elapsed, NUM(fromColor[2]), NUM(toColor[2]) - NUM(fromColor[2]), duration)),+ Math.floor(fn(elapsed, NUM(fromColor[3]), NUM(toColor[3]) - NUM(fromColor[3]), duration))+ ].join(', ') + ')';+};++_yuitest_coverline("build/anim-color/anim-color.js", 28);+Y.Anim.behaviors.color = {+ set: function(anim, att, from, to, elapsed, duration, fn) {+ _yuitest_coverfunc("build/anim-color/anim-color.js", "set", 29);+_yuitest_coverline("build/anim-color/anim-color.js", 30);+anim._node.setStyle(att, Y.Anim.getUpdatedColorValue(from, to, elapsed, duration, fn)); + },+ + // TODO: default bgcolor const+ get: function(anim, att) {+ _yuitest_coverfunc("build/anim-color/anim-color.js", "get", 34);+_yuitest_coverline("build/anim-color/anim-color.js", 35);+var val = anim._node.getComputedStyle(att);+ _yuitest_coverline("build/anim-color/anim-color.js", 36);+val = (val === 'transparent') ? 'rgb(255, 255, 255)' : val;+ _yuitest_coverline("build/anim-color/anim-color.js", 37);+return val;+ }+};++_yuitest_coverline("build/anim-color/anim-color.js", 41);+Y.each(['backgroundColor',+ 'borderColor',+ 'borderTopColor',+ 'borderRightColor', + 'borderBottomColor', + 'borderLeftColor'],+ function(v, i) {+ _yuitest_coverfunc("build/anim-color/anim-color.js", "(anonymous 2)", 47);+_yuitest_coverline("build/anim-color/anim-color.js", 48);+Y.Anim.behaviors[v] = Y.Anim.behaviors.color;+ }+);+++}, '3.7.1', {"requires": ["anim-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('anim-color', function(Y) {+YUI.add('anim-color', function (Y, NAME) { /** * Adds support for color properties in <code>to</code>@@ -15,20 +15,25 @@ var NUM = Number; -Y.Anim.behaviors.color = {- set: function(anim, att, from, to, elapsed, duration, fn) {- from = Y.Color.re_RGB.exec(Y.Color.toRGB(from));- to = Y.Color.re_RGB.exec(Y.Color.toRGB(to));+Y.Anim.getUpdatedColorValue = function(fromColor, toColor, elapsed, duration, fn)+{+ fromColor = Y.Color.re_RGB.exec(Y.Color.toRGB(fromColor));+ toColor = Y.Color.re_RGB.exec(Y.Color.toRGB(toColor)); - if (!from || from.length < 3 || !to || to.length < 3) {- Y.error('invalid from or to passed to color behavior');- }+ if (!fromColor || fromColor.length < 3 || !toColor || toColor.length < 3) {+ Y.error('invalid from or to passed to color behavior');+ } - anim._node.setStyle(att, 'rgb(' + [- Math.floor(fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)),- Math.floor(fn(elapsed, NUM(from[2]), NUM(to[2]) - NUM(from[2]), duration)),- Math.floor(fn(elapsed, NUM(from[3]), NUM(to[3]) - NUM(from[3]), duration))- ].join(', ') + ')');+ return 'rgb(' + [+ Math.floor(fn(elapsed, NUM(fromColor[1]), NUM(toColor[1]) - NUM(fromColor[1]), duration)),+ Math.floor(fn(elapsed, NUM(fromColor[2]), NUM(toColor[2]) - NUM(fromColor[2]), duration)),+ Math.floor(fn(elapsed, NUM(fromColor[3]), NUM(toColor[3]) - NUM(fromColor[3]), duration))+ ].join(', ') + ')';+};++Y.Anim.behaviors.color = {+ set: function(anim, att, from, to, elapsed, duration, fn) {+ anim._node.setStyle(att, Y.Anim.getUpdatedColorValue(from, to, elapsed, duration, fn)); }, // TODO: default bgcolor const@@ -51,4 +56,4 @@ ); -}, '3.5.1' ,{requires:['anim-base']});+}, '3.7.1', {"requires": ["anim-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("anim-color",function(b){var a=Number;b.Anim.behaviors.color={set:function(f,d,i,h,c,g,e){i=b.Color.re_RGB.exec(b.Color.toRGB(i));h=b.Color.re_RGB.exec(b.Color.toRGB(h));if(!i||i.length<3||!h||h.length<3){b.error("invalid from or to passed to color behavior");}f._node.setStyle(d,"rgb("+[Math.floor(e(c,a(i[1]),a(h[1])-a(i[1]),g)),Math.floor(e(c,a(i[2]),a(h[2])-a(i[2]),g)),Math.floor(e(c,a(i[3]),a(h[3])-a(i[3]),g))].join(", ")+")");},get:function(d,c){var e=d._node.getComputedStyle(c);e=(e==="transparent")?"rgb(255, 255, 255)":e;return e;}};b.each(["backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],function(c,d){b.Anim.behaviors[c]=b.Anim.behaviors.color;});},"3.5.1",{requires:["anim-base"]});+YUI.add("anim-color",function(e,t){var n=Number;e.Anim.getUpdatedColorValue=function(t,r,i,s,o){return t=e.Color.re_RGB.exec(e.Color.toRGB(t)),r=e.Color.re_RGB.exec(e.Color.toRGB(r)),(!t||t.length<3||!r||r.length<3)&&e.error("invalid from or to passed to color behavior"),"rgb("+[Math.floor(o(i,n(t[1]),n(r[1])-n(t[1]),s)),Math.floor(o(i,n(t[2]),n(r[2])-n(t[2]),s)),Math.floor(o(i,n(t[3]),n(r[3])-n(t[3]),s))].join(", ")+")"},e.Anim.behaviors.color={set:function(t,n,r,i,s,o,u){t._node.setStyle(n,e.Anim.getUpdatedColorValue(r,i,s,o,u))},get:function(e,t){var n=e._node.getComputedStyle(t);return n=n==="transparent"?"rgb(255, 255, 255)":n,n}},e.each(["backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],function(t,n){e.Anim.behaviors[t]=e.Anim.behaviors.color})},"3.7.1",{requires:["anim-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('anim-color', function(Y) {+YUI.add('anim-color', function (Y, NAME) { /** * Adds support for color properties in <code>to</code>@@ -15,20 +15,25 @@ var NUM = Number; -Y.Anim.behaviors.color = {- set: function(anim, att, from, to, elapsed, duration, fn) {- from = Y.Color.re_RGB.exec(Y.Color.toRGB(from));- to = Y.Color.re_RGB.exec(Y.Color.toRGB(to));+Y.Anim.getUpdatedColorValue = function(fromColor, toColor, elapsed, duration, fn)+{+ fromColor = Y.Color.re_RGB.exec(Y.Color.toRGB(fromColor));+ toColor = Y.Color.re_RGB.exec(Y.Color.toRGB(toColor)); - if (!from || from.length < 3 || !to || to.length < 3) {- Y.error('invalid from or to passed to color behavior');- }+ if (!fromColor || fromColor.length < 3 || !toColor || toColor.length < 3) {+ Y.error('invalid from or to passed to color behavior');+ } - anim._node.setStyle(att, 'rgb(' + [- Math.floor(fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)),- Math.floor(fn(elapsed, NUM(from[2]), NUM(to[2]) - NUM(from[2]), duration)),- Math.floor(fn(elapsed, NUM(from[3]), NUM(to[3]) - NUM(from[3]), duration))- ].join(', ') + ')');+ return 'rgb(' + [+ Math.floor(fn(elapsed, NUM(fromColor[1]), NUM(toColor[1]) - NUM(fromColor[1]), duration)),+ Math.floor(fn(elapsed, NUM(fromColor[2]), NUM(toColor[2]) - NUM(fromColor[2]), duration)),+ Math.floor(fn(elapsed, NUM(fromColor[3]), NUM(toColor[3]) - NUM(fromColor[3]), duration))+ ].join(', ') + ')';+};++Y.Anim.behaviors.color = {+ set: function(anim, att, from, to, elapsed, duration, fn) {+ anim._node.setStyle(att, Y.Anim.getUpdatedColorValue(from, to, elapsed, duration, fn)); }, // TODO: default bgcolor const@@ -51,4 +56,4 @@ ); -}, '3.5.1' ,{requires:['anim-base']});+}, '3.7.1', {"requires": ["anim-base"]});
@@ -0,0 +1,118 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/anim-curve/anim-curve.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/anim-curve/anim-curve.js",+ code: []+};+_yuitest_coverage["build/anim-curve/anim-curve.js"].code=["YUI.add('anim-curve', function (Y, NAME) {","","/**"," * Adds support for the <code>curve</code> property for the <code>to</code> "," * attribute. A curve is zero or more control points and an end point."," * @module anim"," * @submodule anim-curve"," */","","Y.Anim.behaviors.curve = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," from = from.slice.call(from);"," to = to.slice.call(to);"," var t = fn(elapsed, 0, 100, duration) / 100;"," to.unshift(from);"," anim._node.setXY(Y.Anim.getBezier(to, t));"," },",""," get: function(anim, att) {"," return anim._node.getXY();"," }","};","","/**"," * Get the current position of the animated element based on t."," * Each point is an array of \"x\" and \"y\" values (0 = x, 1 = y)"," * At least 2 points are required (start and end)."," * First point is start. Last point is end."," * Additional control points are optional. "," * @for Anim"," * @method getBezier"," * @static"," * @param {Array} points An array containing Bezier points"," * @param {Number} t A number between 0 and 1 which is the basis for determining current position"," * @return {Array} An array containing int x and y member data"," */","Y.Anim.getBezier = function(points, t) { "," var n = points.length;"," var tmp = [];",""," for (var i = 0; i < n; ++i){"," tmp[i] = [points[i][0], points[i][1]]; // save input"," }"," "," for (var j = 1; j < n; ++j) {"," for (i = 0; i < n - j; ++i) {"," tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];"," tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; "," }"," }",""," return [ tmp[0][0], tmp[0][1] ]; ","","};","","","}, '3.7.1', {\"requires\": [\"anim-xy\"]});"];+_yuitest_coverage["build/anim-curve/anim-curve.js"].lines = {"1":0,"10":0,"12":0,"13":0,"14":0,"15":0,"16":0,"20":0,"37":0,"38":0,"39":0,"41":0,"42":0,"45":0,"46":0,"47":0,"48":0,"52":0};+_yuitest_coverage["build/anim-curve/anim-curve.js"].functions = {"set:11":0,"get:19":0,"getBezier:37":0,"(anonymous 1):1":0};+_yuitest_coverage["build/anim-curve/anim-curve.js"].coveredLines = 18;+_yuitest_coverage["build/anim-curve/anim-curve.js"].coveredFunctions = 4;+_yuitest_coverline("build/anim-curve/anim-curve.js", 1);+YUI.add('anim-curve', function (Y, NAME) {++/**+ * Adds support for the <code>curve</code> property for the <code>to</code> + * attribute. A curve is zero or more control points and an end point.+ * @module anim+ * @submodule anim-curve+ */++_yuitest_coverfunc("build/anim-curve/anim-curve.js", "(anonymous 1)", 1);+_yuitest_coverline("build/anim-curve/anim-curve.js", 10);+Y.Anim.behaviors.curve = {+ set: function(anim, att, from, to, elapsed, duration, fn) {+ _yuitest_coverfunc("build/anim-curve/anim-curve.js", "set", 11);+_yuitest_coverline("build/anim-curve/anim-curve.js", 12);+from = from.slice.call(from);+ _yuitest_coverline("build/anim-curve/anim-curve.js", 13);+to = to.slice.call(to);+ _yuitest_coverline("build/anim-curve/anim-curve.js", 14);+var t = fn(elapsed, 0, 100, duration) / 100;+ _yuitest_coverline("build/anim-curve/anim-curve.js", 15);+to.unshift(from);+ _yuitest_coverline("build/anim-curve/anim-curve.js", 16);+anim._node.setXY(Y.Anim.getBezier(to, t));+ },++ get: function(anim, att) {+ _yuitest_coverfunc("build/anim-curve/anim-curve.js", "get", 19);+_yuitest_coverline("build/anim-curve/anim-curve.js", 20);+return anim._node.getXY();+ }+};++/**+ * Get the current position of the animated element based on t.+ * Each point is an array of "x" and "y" values (0 = x, 1 = y)+ * At least 2 points are required (start and end).+ * First point is start. Last point is end.+ * Additional control points are optional. + * @for Anim+ * @method getBezier+ * @static+ * @param {Array} points An array containing Bezier points+ * @param {Number} t A number between 0 and 1 which is the basis for determining current position+ * @return {Array} An array containing int x and y member data+ */+_yuitest_coverline("build/anim-curve/anim-curve.js", 37);+Y.Anim.getBezier = function(points, t) { + _yuitest_coverfunc("build/anim-curve/anim-curve.js", "getBezier", 37);+_yuitest_coverline("build/anim-curve/anim-curve.js", 38);+var n = points.length;+ _yuitest_coverline("build/anim-curve/anim-curve.js", 39);+var tmp = [];++ _yuitest_coverline("build/anim-curve/anim-curve.js", 41);+for (var i = 0; i < n; ++i){+ _yuitest_coverline("build/anim-curve/anim-curve.js", 42);+tmp[i] = [points[i][0], points[i][1]]; // save input+ }+ + _yuitest_coverline("build/anim-curve/anim-curve.js", 45);+for (var j = 1; j < n; ++j) {+ _yuitest_coverline("build/anim-curve/anim-curve.js", 46);+for (i = 0; i < n - j; ++i) {+ _yuitest_coverline("build/anim-curve/anim-curve.js", 47);+tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];+ _yuitest_coverline("build/anim-curve/anim-curve.js", 48);+tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; + }+ }++ _yuitest_coverline("build/anim-curve/anim-curve.js", 52);+return [ tmp[0][0], tmp[0][1] ]; ++};+++}, '3.7.1', {"requires": ["anim-xy"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('anim-curve', function(Y) {+YUI.add('anim-curve', function (Y, NAME) { /** * Adds support for the <code>curve</code> property for the <code>to</code> @@ -60,4 +60,4 @@ }; -}, '3.5.1' ,{requires:['anim-xy']});+}, '3.7.1', {"requires": ["anim-xy"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("anim-curve",function(a){a.Anim.behaviors.curve={set:function(f,c,i,h,b,g,e){i=i.slice.call(i);h=h.slice.call(h);var d=e(b,0,100,g)/100;h.unshift(i);f._node.setXY(a.Anim.getBezier(h,d));},get:function(c,b){return c._node.getXY();}};a.Anim.getBezier=function(f,e){var g=f.length;var d=[];for(var c=0;c<g;++c){d[c]=[f[c][0],f[c][1]];}for(var b=1;b<g;++b){for(c=0;c<g-b;++c){d[c][0]=(1-e)*d[c][0]+e*d[parseInt(c+1,10)][0];d[c][1]=(1-e)*d[c][1]+e*d[parseInt(c+1,10)][1];}}return[d[0][0],d[0][1]];};},"3.5.1",{requires:["anim-xy"]});+YUI.add("anim-curve",function(e,t){e.Anim.behaviors.curve={set:function(t,n,r,i,s,o,u){r=r.slice.call(r),i=i.slice.call(i);var a=u(s,0,100,o)/100;i.unshift(r),t._node.setXY(e.Anim.getBezier(i,a))},get:function(e,t){return e._node.getXY()}},e.Anim.getBezier=function(e,t){var n=e.length,r=[];for(var i=0;i<n;++i)r[i]=[e[i][0],e[i][1]];for(var s=1;s<n;++s)for(i=0;i<n-s;++i)r[i][0]=(1-t)*r[i][0]+t*r[parseInt(i+1,10)][0],r[i][1]=(1-t)*r[i][1]+t*r[parseInt(i+1,10)][1];return[r[0][0],r[0][1]]}},"3.7.1",{requires:["anim-xy"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('anim-curve', function(Y) {+YUI.add('anim-curve', function (Y, NAME) { /** * Adds support for the <code>curve</code> property for the <code>to</code> @@ -60,4 +60,4 @@ }; -}, '3.5.1' ,{requires:['anim-xy']});+}, '3.7.1', {"requires": ["anim-xy"]});
@@ -0,0 +1,482 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/anim-easing/anim-easing.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/anim-easing/anim-easing.js",+ code: []+};+_yuitest_coverage["build/anim-easing/anim-easing.js"].code=["YUI.add('anim-easing', function (Y, NAME) {","","/*","TERMS OF USE - EASING EQUATIONS","Open source under the BSD License.","Copyright 2001 Robert Penner All rights reserved.","","Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:",""," * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer."," * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution."," * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.","","THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","*/","","/**"," * The easing module provides methods for customizing"," * how an animation behaves during each run."," * @class Easing"," * @module anim"," * @submodule anim-easing"," */","","var Easing = {",""," /**"," * Uniform speed between points."," * @for Easing"," * @method easeNone"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeNone: function (t, b, c, d) {"," return c*t/d + b;"," },"," "," /**"," * Begins slowly and accelerates towards end. (quadratic)"," * @method easeIn"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeIn: function (t, b, c, d) {"," return c*(t/=d)*t + b;"," },",""," /**"," * Begins quickly and decelerates towards end. (quadratic)"," * @method easeOut"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeOut: function (t, b, c, d) {"," return -c *(t/=d)*(t-2) + b;"," },"," "," /**"," * Begins slowly and decelerates towards end. (quadratic)"," * @method easeBoth"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeBoth: function (t, b, c, d) {"," if ((t/=d/2) < 1) {"," return c/2*t*t + b;"," }"," "," return -c/2 * ((--t)*(t-2) - 1) + b;"," },"," "," /**"," * Begins slowly and accelerates towards end. (quartic)"," * @method easeInStrong"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeInStrong: function (t, b, c, d) {"," return c*(t/=d)*t*t*t + b;"," },"," "," /**"," * Begins quickly and decelerates towards end. (quartic)"," * @method easeOutStrong"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeOutStrong: function (t, b, c, d) {"," return -c * ((t=t/d-1)*t*t*t - 1) + b;"," },"," "," /**"," * Begins slowly and decelerates towards end. (quartic)"," * @method easeBothStrong"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeBothStrong: function (t, b, c, d) {"," if ((t/=d/2) < 1) {"," return c/2*t*t*t*t + b;"," }"," "," return -c/2 * ((t-=2)*t*t*t - 2) + b;"," },",""," /**"," * Snap in elastic effect."," * @method elasticIn"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} a Amplitude (optional)"," * @param {Number} p Period (optional)"," * @return {Number} The computed value for the current animation frame"," */",""," elasticIn: function (t, b, c, d, a, p) {"," var s;"," if (t === 0) {"," return b;"," }"," if ( (t /= d) === 1 ) {"," return b+c;"," }"," if (!p) {"," p = d* 0.3;"," }"," "," if (!a || a < Math.abs(c)) {"," a = c; "," s = p/4;"," }"," else {"," s = p/(2*Math.PI) * Math.asin (c/a);"," }"," "," return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;"," },",""," /**"," * Snap out elastic effect."," * @method elasticOut"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} a Amplitude (optional)"," * @param {Number} p Period (optional)"," * @return {Number} The computed value for the current animation frame"," */"," elasticOut: function (t, b, c, d, a, p) {"," var s;"," if (t === 0) {"," return b;"," }"," if ( (t /= d) === 1 ) {"," return b+c;"," }"," if (!p) {"," p=d * 0.3;"," }"," "," if (!a || a < Math.abs(c)) {"," a = c;"," s = p / 4;"," }"," else {"," s = p/(2*Math.PI) * Math.asin (c/a);"," }"," "," return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;"," },"," "," /**"," * Snap both elastic effect."," * @method elasticBoth"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} a Amplitude (optional)"," * @param {Number} p Period (optional)"," * @return {Number} The computed value for the current animation frame"," */"," elasticBoth: function (t, b, c, d, a, p) {"," var s;"," if (t === 0) {"," return b;"," }"," "," if ( (t /= d/2) === 2 ) {"," return b+c;"," }"," "," if (!p) {"," p = d*(0.3*1.5);"," }"," "," if ( !a || a < Math.abs(c) ) {"," a = c; "," s = p/4;"," }"," else {"," s = p/(2*Math.PI) * Math.asin (c/a);"," }"," "," if (t < 1) {"," return -0.5*(a*Math.pow(2,10*(t-=1)) * "," Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;"," }"," return a*Math.pow(2,-10*(t-=1)) * "," Math.sin( (t*d-s)*(2*Math.PI)/p )*0.5 + c + b;"," },","",""," /**"," * Backtracks slightly, then reverses direction and moves to end."," * @method backIn"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} s Overshoot (optional)"," * @return {Number} The computed value for the current animation frame"," */"," backIn: function (t, b, c, d, s) {"," if (s === undefined) {"," s = 1.70158;"," }"," if (t === d) {"," t -= 0.001;"," }"," return c*(t/=d)*t*((s+1)*t - s) + b;"," },",""," /**"," * Overshoots end, then reverses and comes back to end."," * @method backOut"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} s Overshoot (optional)"," * @return {Number} The computed value for the current animation frame"," */"," backOut: function (t, b, c, d, s) {"," if (typeof s === 'undefined') {"," s = 1.70158;"," }"," return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;"," },"," "," /**"," * Backtracks slightly, then reverses direction, overshoots end, "," * then reverses and comes back to end."," * @method backBoth"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} s Overshoot (optional)"," * @return {Number} The computed value for the current animation frame"," */"," backBoth: function (t, b, c, d, s) {"," if (typeof s === 'undefined') {"," s = 1.70158; "," }"," "," if ((t /= d/2 ) < 1) {"," return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;"," }"," return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;"," },",""," /**"," * Bounce off of start."," * @method bounceIn"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," bounceIn: function (t, b, c, d) {"," return c - Y.Easing.bounceOut(d-t, 0, c, d) + b;"," },"," "," /**"," * Bounces off end."," * @method bounceOut"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," bounceOut: function (t, b, c, d) {"," if ((t/=d) < (1/2.75)) {"," return c*(7.5625*t*t) + b;"," } else if (t < (2/2.75)) {"," return c*(7.5625*(t-=(1.5/2.75))*t + 0.75) + b;"," } else if (t < (2.5/2.75)) {"," return c*(7.5625*(t-=(2.25/2.75))*t + 0.9375) + b;"," }"," return c*(7.5625*(t-=(2.625/2.75))*t + 0.984375) + b;"," },"," "," /**"," * Bounces off start and end."," * @method bounceBoth"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," bounceBoth: function (t, b, c, d) {"," if (t < d/2) {"," return Y.Easing.bounceIn(t * 2, 0, c, d) * 0.5 + b;"," }"," return Y.Easing.bounceOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;"," }","};","","Y.Easing = Easing;","","","}, '3.7.1', {\"requires\": [\"anim-base\"]});"];+_yuitest_coverage["build/anim-easing/anim-easing.js"].lines = {"1":0,"25":0,"38":0,"51":0,"64":0,"77":0,"78":0,"81":0,"94":0,"107":0,"120":0,"121":0,"124":0,"140":0,"141":0,"142":0,"144":0,"145":0,"147":0,"148":0,"151":0,"152":0,"153":0,"156":0,"159":0,"174":0,"175":0,"176":0,"178":0,"179":0,"181":0,"182":0,"185":0,"186":0,"187":0,"190":0,"193":0,"208":0,"209":0,"210":0,"213":0,"214":0,"217":0,"218":0,"221":0,"222":0,"223":0,"226":0,"229":0,"230":0,"233":0,"249":0,"250":0,"252":0,"253":0,"255":0,"269":0,"270":0,"272":0,"287":0,"288":0,"291":0,"292":0,"294":0,"307":0,"320":0,"321":0,"322":0,"323":0,"324":0,"325":0,"327":0,"340":0,"341":0,"343":0,"347":0};+_yuitest_coverage["build/anim-easing/anim-easing.js"].functions = {"easeNone:37":0,"easeIn:50":0,"easeOut:63":0,"easeBoth:76":0,"easeInStrong:93":0,"easeOutStrong:106":0,"easeBothStrong:119":0,"elasticIn:139":0,"elasticOut:173":0,"elasticBoth:207":0,"backIn:248":0,"backOut:268":0,"backBoth:286":0,"bounceIn:306":0,"bounceOut:319":0,"bounceBoth:339":0,"(anonymous 1):1":0};+_yuitest_coverage["build/anim-easing/anim-easing.js"].coveredLines = 76;+_yuitest_coverage["build/anim-easing/anim-easing.js"].coveredFunctions = 17;+_yuitest_coverline("build/anim-easing/anim-easing.js", 1);+YUI.add('anim-easing', function (Y, NAME) {++/*+TERMS OF USE - EASING EQUATIONS+Open source under the BSD License.+Copyright 2001 Robert Penner All rights reserved.++Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:++ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.+ * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+*/++/**+ * The easing module provides methods for customizing+ * how an animation behaves during each run.+ * @class Easing+ * @module anim+ * @submodule anim-easing+ */++_yuitest_coverfunc("build/anim-easing/anim-easing.js", "(anonymous 1)", 1);+_yuitest_coverline("build/anim-easing/anim-easing.js", 25);+var Easing = {++ /**+ * Uniform speed between points.+ * @for Easing+ * @method easeNone+ * @param {Number} t Time value used to compute current value+ * @param {Number} b Starting value+ * @param {Number} c Delta between start and end values+ * @param {Number} d Total length of animation+ * @return {Number} The computed value for the current animation frame+ */+ easeNone: function (t, b, c, d) {+ _yuitest_coverfunc("build/anim-easing/anim-easing.js", "easeNone", 37);+_yuitest_coverline("build/anim-easing/anim-easing.js", 38);+return c*t/d + b;+ },+ + /**+ * Begins slowly and accelerates towards end. (quadratic)+ * @method easeIn+ * @param {Number} t Time value used to compute current value+ * @param {Number} b Starting value+ * @param {Number} c Delta between start and end values+ * @param {Number} d Total length of animation+ * @return {Number} The computed value for the current animation frame+ */+ easeIn: function (t, b, c, d) {+ _yuitest_coverfunc("build/anim-easing/anim-easing.js", "easeIn", 50);+_yuitest_coverline("build/anim-easing/anim-easing.js", 51);+return c*(t/=d)*t + b;+ },++ /**+ * Begins quickly and decelerates towards end. (quadratic)+ * @method easeOut+ * @param {Number} t Time value used to compute current value+ * @param {Number} b Starting value+ * @param {Number} c Delta between start and end values+ * @param {Number} d Total length of animation+ * @return {Number} The computed value for the current animation frame+ */+ easeOut: function (t, b, c, d) {+ _yuitest_coverfunc("build/anim-easing/anim-easing.js", "easeOut", 63);+_yuitest_coverline("build/anim-easing/anim-easing.js", 64);+return -c *(t/=d)*(t-2) + b;+ },+ + /**+ * Begins slowly and decelerates towards end. (quadratic)+ * @method easeBoth+ * @param {Number} t Time value used to compute current value+ * @param {Number} b Starting value+ * @param {Number} c Delta between start and end values+ * @param {Number} d Total length of animation+ * @return {Number} The computed value for the current animation frame+ */+ easeBoth: function (t, b, c, d) {+ _yuitest_coverfunc("build/anim-easing/anim-easing.js", "easeBoth", 76);+_yuitest_coverline("build/anim-easing/anim-easing.js", 77);+if ((t/=d/2) < 1) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 78);+return c/2*t*t + b;+ }+ + _yuitest_coverline("build/anim-easing/anim-easing.js", 81);+return -c/2 * ((--t)*(t-2) - 1) + b;+ },+ + /**+ * Begins slowly and accelerates towards end. (quartic)+ * @method easeInStrong+ * @param {Number} t Time value used to compute current value+ * @param {Number} b Starting value+ * @param {Number} c Delta between start and end values+ * @param {Number} d Total length of animation+ * @return {Number} The computed value for the current animation frame+ */+ easeInStrong: function (t, b, c, d) {+ _yuitest_coverfunc("build/anim-easing/anim-easing.js", "easeInStrong", 93);+_yuitest_coverline("build/anim-easing/anim-easing.js", 94);+return c*(t/=d)*t*t*t + b;+ },+ + /**+ * Begins quickly and decelerates towards end. (quartic)+ * @method easeOutStrong+ * @param {Number} t Time value used to compute current value+ * @param {Number} b Starting value+ * @param {Number} c Delta between start and end values+ * @param {Number} d Total length of animation+ * @return {Number} The computed value for the current animation frame+ */+ easeOutStrong: function (t, b, c, d) {+ _yuitest_coverfunc("build/anim-easing/anim-easing.js", "easeOutStrong", 106);+_yuitest_coverline("build/anim-easing/anim-easing.js", 107);+return -c * ((t=t/d-1)*t*t*t - 1) + b;+ },+ + /**+ * Begins slowly and decelerates towards end. (quartic)+ * @method easeBothStrong+ * @param {Number} t Time value used to compute current value+ * @param {Number} b Starting value+ * @param {Number} c Delta between start and end values+ * @param {Number} d Total length of animation+ * @return {Number} The computed value for the current animation frame+ */+ easeBothStrong: function (t, b, c, d) {+ _yuitest_coverfunc("build/anim-easing/anim-easing.js", "easeBothStrong", 119);+_yuitest_coverline("build/anim-easing/anim-easing.js", 120);+if ((t/=d/2) < 1) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 121);+return c/2*t*t*t*t + b;+ }+ + _yuitest_coverline("build/anim-easing/anim-easing.js", 124);+return -c/2 * ((t-=2)*t*t*t - 2) + b;+ },++ /**+ * Snap in elastic effect.+ * @method elasticIn+ * @param {Number} t Time value used to compute current value+ * @param {Number} b Starting value+ * @param {Number} c Delta between start and end values+ * @param {Number} d Total length of animation+ * @param {Number} a Amplitude (optional)+ * @param {Number} p Period (optional)+ * @return {Number} The computed value for the current animation frame+ */++ elasticIn: function (t, b, c, d, a, p) {+ _yuitest_coverfunc("build/anim-easing/anim-easing.js", "elasticIn", 139);+_yuitest_coverline("build/anim-easing/anim-easing.js", 140);+var s;+ _yuitest_coverline("build/anim-easing/anim-easing.js", 141);+if (t === 0) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 142);+return b;+ }+ _yuitest_coverline("build/anim-easing/anim-easing.js", 144);+if ( (t /= d) === 1 ) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 145);+return b+c;+ }+ _yuitest_coverline("build/anim-easing/anim-easing.js", 147);+if (!p) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 148);+p = d* 0.3;+ }+ + _yuitest_coverline("build/anim-easing/anim-easing.js", 151);+if (!a || a < Math.abs(c)) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 152);+a = c; + _yuitest_coverline("build/anim-easing/anim-easing.js", 153);+s = p/4;+ }+ else {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 156);+s = p/(2*Math.PI) * Math.asin (c/a);+ }+ + _yuitest_coverline("build/anim-easing/anim-easing.js", 159);+return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;+ },++ /**+ * Snap out elastic effect.+ * @method elasticOut+ * @param {Number} t Time value used to compute current value+ * @param {Number} b Starting value+ * @param {Number} c Delta between start and end values+ * @param {Number} d Total length of animation+ * @param {Number} a Amplitude (optional)+ * @param {Number} p Period (optional)+ * @return {Number} The computed value for the current animation frame+ */+ elasticOut: function (t, b, c, d, a, p) {+ _yuitest_coverfunc("build/anim-easing/anim-easing.js", "elasticOut", 173);+_yuitest_coverline("build/anim-easing/anim-easing.js", 174);+var s;+ _yuitest_coverline("build/anim-easing/anim-easing.js", 175);+if (t === 0) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 176);+return b;+ }+ _yuitest_coverline("build/anim-easing/anim-easing.js", 178);+if ( (t /= d) === 1 ) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 179);+return b+c;+ }+ _yuitest_coverline("build/anim-easing/anim-easing.js", 181);+if (!p) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 182);+p=d * 0.3;+ }+ + _yuitest_coverline("build/anim-easing/anim-easing.js", 185);+if (!a || a < Math.abs(c)) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 186);+a = c;+ _yuitest_coverline("build/anim-easing/anim-easing.js", 187);+s = p / 4;+ }+ else {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 190);+s = p/(2*Math.PI) * Math.asin (c/a);+ }+ + _yuitest_coverline("build/anim-easing/anim-easing.js", 193);+return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;+ },+ + /**+ * Snap both elastic effect.+ * @method elasticBoth+ * @param {Number} t Time value used to compute current value+ * @param {Number} b Starting value+ * @param {Number} c Delta between start and end values+ * @param {Number} d Total length of animation+ * @param {Number} a Amplitude (optional)+ * @param {Number} p Period (optional)+ * @return {Number} The computed value for the current animation frame+ */+ elasticBoth: function (t, b, c, d, a, p) {+ _yuitest_coverfunc("build/anim-easing/anim-easing.js", "elasticBoth", 207);+_yuitest_coverline("build/anim-easing/anim-easing.js", 208);+var s;+ _yuitest_coverline("build/anim-easing/anim-easing.js", 209);+if (t === 0) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 210);+return b;+ }+ + _yuitest_coverline("build/anim-easing/anim-easing.js", 213);+if ( (t /= d/2) === 2 ) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 214);+return b+c;+ }+ + _yuitest_coverline("build/anim-easing/anim-easing.js", 217);+if (!p) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 218);+p = d*(0.3*1.5);+ }+ + _yuitest_coverline("build/anim-easing/anim-easing.js", 221);+if ( !a || a < Math.abs(c) ) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 222);+a = c; + _yuitest_coverline("build/anim-easing/anim-easing.js", 223);+s = p/4;+ }+ else {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 226);+s = p/(2*Math.PI) * Math.asin (c/a);+ }+ + _yuitest_coverline("build/anim-easing/anim-easing.js", 229);+if (t < 1) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 230);+return -0.5*(a*Math.pow(2,10*(t-=1)) * + Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;+ }+ _yuitest_coverline("build/anim-easing/anim-easing.js", 233);+return a*Math.pow(2,-10*(t-=1)) * + Math.sin( (t*d-s)*(2*Math.PI)/p )*0.5 + c + b;+ },+++ /**+ * Backtracks slightly, then reverses direction and moves to end.+ * @method backIn+ * @param {Number} t Time value used to compute current value+ * @param {Number} b Starting value+ * @param {Number} c Delta between start and end values+ * @param {Number} d Total length of animation+ * @param {Number} s Overshoot (optional)+ * @return {Number} The computed value for the current animation frame+ */+ backIn: function (t, b, c, d, s) {+ _yuitest_coverfunc("build/anim-easing/anim-easing.js", "backIn", 248);+_yuitest_coverline("build/anim-easing/anim-easing.js", 249);+if (s === undefined) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 250);+s = 1.70158;+ }+ _yuitest_coverline("build/anim-easing/anim-easing.js", 252);+if (t === d) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 253);+t -= 0.001;+ }+ _yuitest_coverline("build/anim-easing/anim-easing.js", 255);+return c*(t/=d)*t*((s+1)*t - s) + b;+ },++ /**+ * Overshoots end, then reverses and comes back to end.+ * @method backOut+ * @param {Number} t Time value used to compute current value+ * @param {Number} b Starting value+ * @param {Number} c Delta between start and end values+ * @param {Number} d Total length of animation+ * @param {Number} s Overshoot (optional)+ * @return {Number} The computed value for the current animation frame+ */+ backOut: function (t, b, c, d, s) {+ _yuitest_coverfunc("build/anim-easing/anim-easing.js", "backOut", 268);+_yuitest_coverline("build/anim-easing/anim-easing.js", 269);+if (typeof s === 'undefined') {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 270);+s = 1.70158;+ }+ _yuitest_coverline("build/anim-easing/anim-easing.js", 272);+return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;+ },+ + /**+ * Backtracks slightly, then reverses direction, overshoots end, + * then reverses and comes back to end.+ * @method backBoth+ * @param {Number} t Time value used to compute current value+ * @param {Number} b Starting value+ * @param {Number} c Delta between start and end values+ * @param {Number} d Total length of animation+ * @param {Number} s Overshoot (optional)+ * @return {Number} The computed value for the current animation frame+ */+ backBoth: function (t, b, c, d, s) {+ _yuitest_coverfunc("build/anim-easing/anim-easing.js", "backBoth", 286);+_yuitest_coverline("build/anim-easing/anim-easing.js", 287);+if (typeof s === 'undefined') {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 288);+s = 1.70158; + }+ + _yuitest_coverline("build/anim-easing/anim-easing.js", 291);+if ((t /= d/2 ) < 1) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 292);+return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;+ }+ _yuitest_coverline("build/anim-easing/anim-easing.js", 294);+return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;+ },++ /**+ * Bounce off of start.+ * @method bounceIn+ * @param {Number} t Time value used to compute current value+ * @param {Number} b Starting value+ * @param {Number} c Delta between start and end values+ * @param {Number} d Total length of animation+ * @return {Number} The computed value for the current animation frame+ */+ bounceIn: function (t, b, c, d) {+ _yuitest_coverfunc("build/anim-easing/anim-easing.js", "bounceIn", 306);+_yuitest_coverline("build/anim-easing/anim-easing.js", 307);+return c - Y.Easing.bounceOut(d-t, 0, c, d) + b;+ },+ + /**+ * Bounces off end.+ * @method bounceOut+ * @param {Number} t Time value used to compute current value+ * @param {Number} b Starting value+ * @param {Number} c Delta between start and end values+ * @param {Number} d Total length of animation+ * @return {Number} The computed value for the current animation frame+ */+ bounceOut: function (t, b, c, d) {+ _yuitest_coverfunc("build/anim-easing/anim-easing.js", "bounceOut", 319);+_yuitest_coverline("build/anim-easing/anim-easing.js", 320);+if ((t/=d) < (1/2.75)) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 321);+return c*(7.5625*t*t) + b;+ } else {_yuitest_coverline("build/anim-easing/anim-easing.js", 322);+if (t < (2/2.75)) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 323);+return c*(7.5625*(t-=(1.5/2.75))*t + 0.75) + b;+ } else {_yuitest_coverline("build/anim-easing/anim-easing.js", 324);+if (t < (2.5/2.75)) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 325);+return c*(7.5625*(t-=(2.25/2.75))*t + 0.9375) + b;+ }}}+ _yuitest_coverline("build/anim-easing/anim-easing.js", 327);+return c*(7.5625*(t-=(2.625/2.75))*t + 0.984375) + b;+ },+ + /**+ * Bounces off start and end.+ * @method bounceBoth+ * @param {Number} t Time value used to compute current value+ * @param {Number} b Starting value+ * @param {Number} c Delta between start and end values+ * @param {Number} d Total length of animation+ * @return {Number} The computed value for the current animation frame+ */+ bounceBoth: function (t, b, c, d) {+ _yuitest_coverfunc("build/anim-easing/anim-easing.js", "bounceBoth", 339);+_yuitest_coverline("build/anim-easing/anim-easing.js", 340);+if (t < d/2) {+ _yuitest_coverline("build/anim-easing/anim-easing.js", 341);+return Y.Easing.bounceIn(t * 2, 0, c, d) * 0.5 + b;+ }+ _yuitest_coverline("build/anim-easing/anim-easing.js", 343);+return Y.Easing.bounceOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;+ }+};++_yuitest_coverline("build/anim-easing/anim-easing.js", 347);+Y.Easing = Easing;+++}, '3.7.1', {"requires": ["anim-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('anim-easing', function(Y) {+YUI.add('anim-easing', function (Y, NAME) { /* TERMS OF USE - EASING EQUATIONS@@ -353,4 +353,4 @@ Y.Easing = Easing; -}, '3.5.1' ,{requires:['anim-base']});+}, '3.7.1', {"requires": ["anim-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("anim-easing",function(b){var a={easeNone:function(f,e,h,g){return h*f/g+e;},easeIn:function(f,e,h,g){return h*(f/=g)*f+e;},easeOut:function(f,e,h,g){return -h*(f/=g)*(f-2)+e;},easeBoth:function(f,e,h,g){if((f/=g/2)<1){return h/2*f*f+e;}return -h/2*((--f)*(f-2)-1)+e;},easeInStrong:function(f,e,h,g){return h*(f/=g)*f*f*f+e;},easeOutStrong:function(f,e,h,g){return -h*((f=f/g-1)*f*f*f-1)+e;},easeBothStrong:function(f,e,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+e;}return -h/2*((f-=2)*f*f*f-2)+e;},elasticIn:function(g,e,k,j,f,i){var h;if(g===0){return e;}if((g/=j)===1){return e+k;}if(!i){i=j*0.3;}if(!f||f<Math.abs(k)){f=k;h=i/4;}else{h=i/(2*Math.PI)*Math.asin(k/f);}return -(f*Math.pow(2,10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i))+e;},elasticOut:function(g,e,k,j,f,i){var h;if(g===0){return e;}if((g/=j)===1){return e+k;}if(!i){i=j*0.3;}if(!f||f<Math.abs(k)){f=k;h=i/4;}else{h=i/(2*Math.PI)*Math.asin(k/f);}return f*Math.pow(2,-10*g)*Math.sin((g*j-h)*(2*Math.PI)/i)+k+e;},elasticBoth:function(g,e,k,j,f,i){var h;if(g===0){return e;}if((g/=j/2)===2){return e+k;}if(!i){i=j*(0.3*1.5);}if(!f||f<Math.abs(k)){f=k;h=i/4;}else{h=i/(2*Math.PI)*Math.asin(k/f);}if(g<1){return -0.5*(f*Math.pow(2,10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i))+e;}return f*Math.pow(2,-10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i)*0.5+k+e;},backIn:function(f,e,i,h,g){if(g===undefined){g=1.70158;}if(f===h){f-=0.001;}return i*(f/=h)*f*((g+1)*f-g)+e;},backOut:function(f,e,i,h,g){if(typeof g==="undefined"){g=1.70158;}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+e;},backBoth:function(f,e,i,h,g){if(typeof g==="undefined"){g=1.70158;}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+e;}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+e;},bounceIn:function(f,e,h,g){return h-b.Easing.bounceOut(g-f,0,h,g)+e;},bounceOut:function(f,e,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+e;}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+e;}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+e;}}}return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+e;},bounceBoth:function(f,e,h,g){if(f<g/2){return b.Easing.bounceIn(f*2,0,h,g)*0.5+e;}return b.Easing.bounceOut(f*2-g,0,h,g)*0.5+h*0.5+e;}};b.Easing=a;},"3.5.1",{requires:["anim-base"]});+YUI.add("anim-easing",function(e,t){var n={easeNone:function(e,t,n,r){return n*e/r+t},easeIn:function(e,t,n,r){return n*(e/=r)*e+t},easeOut:function(e,t,n,r){return-n*(e/=r)*(e-2)+t},easeBoth:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t},easeInStrong:function(e,t,n,r){return n*(e/=r)*e*e*e+t},easeOutStrong:function(e,t,n,r){return-n*((e=e/r-1)*e*e*e-1)+t},easeBothStrong:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e+t:-n/2*((e-=2)*e*e*e-2)+t},elasticIn:function(e,t,n,r,i,s){var o;return e===0?t:(e/=r)===1?t+n:(s||(s=r*.3),!i||i<Math.abs(n)?(i=n,o=s/4):o=s/(2*Math.PI)*Math.asin(n/i),-(i*Math.pow(2,10*(e-=1))*Math.sin((e*r-o)*2*Math.PI/s))+t)},elasticOut:function(e,t,n,r,i,s){var o;return e===0?t:(e/=r)===1?t+n:(s||(s=r*.3),!i||i<Math.abs(n)?(i=n,o=s/4):o=s/(2*Math.PI)*Math.asin(n/i),i*Math.pow(2,-10*e)*Math.sin((e*r-o)*2*Math.PI/s)+n+t)},elasticBoth:function(e,t,n,r,i,s){var o;return e===0?t:(e/=r/2)===2?t+n:(s||(s=r*.3*1.5),!i||i<Math.abs(n)?(i=n,o=s/4):o=s/(2*Math.PI)*Math.asin(n/i),e<1?-0.5*i*Math.pow(2,10*(e-=1))*Math.sin((e*r-o)*2*Math.PI/s)+t:i*Math.pow(2,-10*(e-=1))*Math.sin((e*r-o)*2*Math.PI/s)*.5+n+t)},backIn:function(e,t,n,r,i){return i===undefined&&(i=1.70158),e===r&&(e-=.001),n*(e/=r)*e*((i+1)*e-i)+t},backOut:function(e,t,n,r,i){return typeof i=="undefined"&&(i=1.70158),n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},backBoth:function(e,t,n,r,i){return typeof i=="undefined"&&(i=1.70158),(e/=r/2)<1?n/2*e*e*(((i*=1.525)+1)*e-i)+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},bounceIn:function(t,n,r,i){return r-e.Easing.bounceOut(i-t,0,r,i)+n},bounceOut:function(e,t,n,r){return(e/=r)<1/2.75?n*7.5625*e*e+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t},bounceBoth:function(t,n,r,i){return t<i/2?e.Easing.bounceIn(t*2,0,r,i)*.5+n:e.Easing.bounceOut(t*2-i,0,r,i)*.5+r*.5+n}};e.Easing=n},"3.7.1",{requires:["anim-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('anim-easing', function(Y) {+YUI.add('anim-easing', function (Y, NAME) { /* TERMS OF USE - EASING EQUATIONS@@ -353,4 +353,4 @@ Y.Easing = Easing; -}, '3.5.1' ,{requires:['anim-base']});+}, '3.7.1', {"requires": ["anim-base"]});
@@ -0,0 +1,77 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/anim-node-plugin/anim-node-plugin.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/anim-node-plugin/anim-node-plugin.js",+ code: []+};+_yuitest_coverage["build/anim-node-plugin/anim-node-plugin.js"].code=["YUI.add('anim-node-plugin', function (Y, NAME) {","","/**"," * Binds an Anim instance to a Node instance"," * @module anim"," * @class Plugin.NodeFX"," * @extends Anim"," * @submodule anim-node-plugin"," */","","var NodeFX = function(config) {"," config = (config) ? Y.merge(config) : {};"," config.node = config.host;"," NodeFX.superclass.constructor.apply(this, arguments);","};","","NodeFX.NAME = \"nodefx\";","NodeFX.NS = \"fx\";","","Y.extend(NodeFX, Y.Anim);","","Y.namespace('Plugin');","Y.Plugin.NodeFX = NodeFX;","","","}, '3.7.1', {\"requires\": [\"node-pluginhost\", \"anim-base\"]});"];+_yuitest_coverage["build/anim-node-plugin/anim-node-plugin.js"].lines = {"1":0,"11":0,"12":0,"13":0,"14":0,"17":0,"18":0,"20":0,"22":0,"23":0};+_yuitest_coverage["build/anim-node-plugin/anim-node-plugin.js"].functions = {"NodeFX:11":0,"(anonymous 1):1":0};+_yuitest_coverage["build/anim-node-plugin/anim-node-plugin.js"].coveredLines = 10;+_yuitest_coverage["build/anim-node-plugin/anim-node-plugin.js"].coveredFunctions = 2;+_yuitest_coverline("build/anim-node-plugin/anim-node-plugin.js", 1);+YUI.add('anim-node-plugin', function (Y, NAME) {++/**+ * Binds an Anim instance to a Node instance+ * @module anim+ * @class Plugin.NodeFX+ * @extends Anim+ * @submodule anim-node-plugin+ */++_yuitest_coverfunc("build/anim-node-plugin/anim-node-plugin.js", "(anonymous 1)", 1);+_yuitest_coverline("build/anim-node-plugin/anim-node-plugin.js", 11);+var NodeFX = function(config) {+ _yuitest_coverfunc("build/anim-node-plugin/anim-node-plugin.js", "NodeFX", 11);+_yuitest_coverline("build/anim-node-plugin/anim-node-plugin.js", 12);+config = (config) ? Y.merge(config) : {};+ _yuitest_coverline("build/anim-node-plugin/anim-node-plugin.js", 13);+config.node = config.host;+ _yuitest_coverline("build/anim-node-plugin/anim-node-plugin.js", 14);+NodeFX.superclass.constructor.apply(this, arguments);+};++_yuitest_coverline("build/anim-node-plugin/anim-node-plugin.js", 17);+NodeFX.NAME = "nodefx";+_yuitest_coverline("build/anim-node-plugin/anim-node-plugin.js", 18);+NodeFX.NS = "fx";++_yuitest_coverline("build/anim-node-plugin/anim-node-plugin.js", 20);+Y.extend(NodeFX, Y.Anim);++_yuitest_coverline("build/anim-node-plugin/anim-node-plugin.js", 22);+Y.namespace('Plugin');+_yuitest_coverline("build/anim-node-plugin/anim-node-plugin.js", 23);+Y.Plugin.NodeFX = NodeFX;+++}, '3.7.1', {"requires": ["node-pluginhost", "anim-base"]});
@@ -1,16 +1,16 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('anim-node-plugin', function(Y) {+YUI.add('anim-node-plugin', function (Y, NAME) { /** * Binds an Anim instance to a Node instance * @module anim * @class Plugin.NodeFX- * @extends Base+ * @extends Anim * @submodule anim-node-plugin */ @@ -29,4 +29,4 @@ Y.Plugin.NodeFX = NodeFX; -}, '3.5.1' ,{requires:['node-pluginhost', 'anim-base']});+}, '3.7.1', {"requires": ["node-pluginhost", "anim-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("anim-node-plugin",function(b){var a=function(c){c=(c)?b.merge(c):{};c.node=c.host;a.superclass.constructor.apply(this,arguments);};a.NAME="nodefx";a.NS="fx";b.extend(a,b.Anim);b.namespace("Plugin");b.Plugin.NodeFX=a;},"3.5.1",{requires:["node-pluginhost","anim-base"]});+YUI.add("anim-node-plugin",function(e,t){var n=function(t){t=t?e.merge(t):{},t.node=t.host,n.superclass.constructor.apply(this,arguments)};n.NAME="nodefx",n.NS="fx",e.extend(n,e.Anim),e.namespace("Plugin"),e.Plugin.NodeFX=n},"3.7.1",{requires:["node-pluginhost","anim-base"]});
@@ -1,16 +1,16 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('anim-node-plugin', function(Y) {+YUI.add('anim-node-plugin', function (Y, NAME) { /** * Binds an Anim instance to a Node instance * @module anim * @class Plugin.NodeFX- * @extends Base+ * @extends Anim * @submodule anim-node-plugin */ @@ -29,4 +29,4 @@ Y.Plugin.NodeFX = NodeFX; -}, '3.5.1' ,{requires:['node-pluginhost', 'anim-base']});+}, '3.7.1', {"requires": ["node-pluginhost", "anim-base"]});
@@ -0,0 +1,90 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/anim-scroll/anim-scroll.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/anim-scroll/anim-scroll.js",+ code: []+};+_yuitest_coverage["build/anim-scroll/anim-scroll.js"].code=["YUI.add('anim-scroll', function (Y, NAME) {","","/**"," * Adds support for the <code>scroll</code> property in <code>to</code>"," * and <code>from</code> attributes."," * @module anim"," * @submodule anim-scroll"," */","","var NUM = Number;","","//TODO: deprecate for scrollTop/Left properties?","Y.Anim.behaviors.scroll = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," var"," node = anim._node, "," val = (["," fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),"," fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)"," ]);",""," if (val[0]) {"," node.set('scrollLeft', val[0]);"," }",""," if (val[1]) {"," node.set('scrollTop', val[1]);"," }"," },"," get: function(anim) {"," var node = anim._node;"," return [node.get('scrollLeft'), node.get('scrollTop')];"," }","};","","","","}, '3.7.1', {\"requires\": [\"anim-base\"]});"];+_yuitest_coverage["build/anim-scroll/anim-scroll.js"].lines = {"1":0,"10":0,"13":0,"15":0,"22":0,"23":0,"26":0,"27":0,"31":0,"32":0};+_yuitest_coverage["build/anim-scroll/anim-scroll.js"].functions = {"set:14":0,"get:30":0,"(anonymous 1):1":0};+_yuitest_coverage["build/anim-scroll/anim-scroll.js"].coveredLines = 10;+_yuitest_coverage["build/anim-scroll/anim-scroll.js"].coveredFunctions = 3;+_yuitest_coverline("build/anim-scroll/anim-scroll.js", 1);+YUI.add('anim-scroll', function (Y, NAME) {++/**+ * Adds support for the <code>scroll</code> property in <code>to</code>+ * and <code>from</code> attributes.+ * @module anim+ * @submodule anim-scroll+ */++_yuitest_coverfunc("build/anim-scroll/anim-scroll.js", "(anonymous 1)", 1);+_yuitest_coverline("build/anim-scroll/anim-scroll.js", 10);+var NUM = Number;++//TODO: deprecate for scrollTop/Left properties?+_yuitest_coverline("build/anim-scroll/anim-scroll.js", 13);+Y.Anim.behaviors.scroll = {+ set: function(anim, att, from, to, elapsed, duration, fn) {+ _yuitest_coverfunc("build/anim-scroll/anim-scroll.js", "set", 14);+_yuitest_coverline("build/anim-scroll/anim-scroll.js", 15);+var+ node = anim._node, + val = ([+ fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),+ fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)+ ]);++ _yuitest_coverline("build/anim-scroll/anim-scroll.js", 22);+if (val[0]) {+ _yuitest_coverline("build/anim-scroll/anim-scroll.js", 23);+node.set('scrollLeft', val[0]);+ }++ _yuitest_coverline("build/anim-scroll/anim-scroll.js", 26);+if (val[1]) {+ _yuitest_coverline("build/anim-scroll/anim-scroll.js", 27);+node.set('scrollTop', val[1]);+ }+ },+ get: function(anim) {+ _yuitest_coverfunc("build/anim-scroll/anim-scroll.js", "get", 30);+_yuitest_coverline("build/anim-scroll/anim-scroll.js", 31);+var node = anim._node;+ _yuitest_coverline("build/anim-scroll/anim-scroll.js", 32);+return [node.get('scrollLeft'), node.get('scrollTop')];+ }+};++++}, '3.7.1', {"requires": ["anim-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('anim-scroll', function(Y) {+YUI.add('anim-scroll', function (Y, NAME) { /** * Adds support for the <code>scroll</code> property in <code>to</code>@@ -41,4 +41,4 @@ -}, '3.5.1' ,{requires:['anim-base']});+}, '3.7.1', {"requires": ["anim-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("anim-scroll",function(b){var a=Number;b.Anim.behaviors.scroll={set:function(f,g,i,j,k,e,h){var d=f._node,c=([h(k,a(i[0]),a(j[0])-a(i[0]),e),h(k,a(i[1]),a(j[1])-a(i[1]),e)]);if(c[0]){d.set("scrollLeft",c[0]);}if(c[1]){d.set("scrollTop",c[1]);}},get:function(d){var c=d._node;return[c.get("scrollLeft"),c.get("scrollTop")];}};},"3.5.1",{requires:["anim-base"]});+YUI.add("anim-scroll",function(e,t){var n=Number;e.Anim.behaviors.scroll={set:function(e,t,r,i,s,o,u){var a=e._node,f=[u(s,n(r[0]),n(i[0])-n(r[0]),o),u(s,n(r[1]),n(i[1])-n(r[1]),o)];f[0]&&a.set("scrollLeft",f[0]),f[1]&&a.set("scrollTop",f[1])},get:function(e){var t=e._node;return[t.get("scrollLeft"),t.get("scrollTop")]}}},"3.7.1",{requires:["anim-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('anim-scroll', function(Y) {+YUI.add('anim-scroll', function (Y, NAME) { /** * Adds support for the <code>scroll</code> property in <code>to</code>@@ -41,4 +41,4 @@ -}, '3.5.1' ,{requires:['anim-base']});+}, '3.7.1', {"requires": ["anim-base"]});
@@ -0,0 +1,192 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/anim-shape-transform/anim-shape-transform.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/anim-shape-transform/anim-shape-transform.js",+ code: []+};+_yuitest_coverage["build/anim-shape-transform/anim-shape-transform.js"].code=["YUI.add('anim-shape-transform', function (Y, NAME) {","","/**"," * Adds support for the <code>transform</code> attribute of <code>Graphic</code>"," * <code>Shape</code> instances."," * @module anim"," * @submodule anim-shape-transform"," */"," var NUM = Number,"," TO,"," TOSTRING;",""," Y.Anim.behaviors.transform = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," var node = anim._node,"," transform = \"\","," transformTo,"," transformFrom,"," toArgs,"," fromArgs,"," i = 0,"," j,"," argLen,"," len;"," to = TO;"," len = TO.length;"," for(; i < len; ++i)"," {"," toArgs = to[i].concat();"," fromArgs = from[i].concat();"," transformTo = toArgs.shift();"," transformFrom = fromArgs.shift();"," argLen = toArgs.length;"," transform += transformTo + \"(\";"," for(j = 0; j < argLen; ++j)"," {"," transform += fn(elapsed, NUM(fromArgs[j]), NUM(toArgs[j]) - NUM(fromArgs[j]), duration);"," if(j < argLen - 1)"," {"," transform += \", \";"," }"," }"," transform += \");\";"," }"," if(transform)"," {"," node.set('transform', transform);"," }"," node._transform = TOSTRING;"," },"," "," get: function(anim) {"," var node = anim._node,"," fromMatrix = node.matrix,"," toAttr = anim.get(\"to\") || {},"," toString = anim.get(\"to\").transform,"," fromString = node.get(\"transform\"),"," toArray = Y.MatrixUtil.getTransformArray(toString),"," fromArray = fromString ? Y.MatrixUtil.getTransformArray(fromString) : null,"," toMatrix,"," i,"," len,"," transformFunction,"," from;"," if(toArray)"," {"," if(!fromArray || fromArray.length < 1)"," {"," fromArray = [];"," len = toArray.length;"," for(i = 0; i < len; ++i)"," {"," transformFunction = toArray[i][0];"," fromArray[i] = Y.MatrixUtil.getTransformFunctionArray(transformFunction);"," }"," TO = toArray;"," from = fromArray;"," }"," else if(Y.MatrixUtil.compareTransformSequence(toArray, fromArray))"," {"," TO = toArray;"," from = fromArray;"," }"," else"," {"," toMatrix = new Y.Matrix();"," len = toArray.length;"," for(i = 0; i < len; ++i)"," {"," transformFunction = toArray[i].shift();"," transformFunction = transformFunction == \"matrix\" ? \"multiply\" : transformFunction;"," toMatrix[transformFunction].apply(toMatrix, toArray[i]); "," }",""," TO = toMatrix.decompose();"," from = fromMatrix.decompose();"," }"," }"," TOSTRING = toString;"," return from;"," }"," }; ","","","","}, '3.7.1', {\"requires\": [\"anim-base\", \"anim-easing\", \"matrix\"]});"];+_yuitest_coverage["build/anim-shape-transform/anim-shape-transform.js"].lines = {"1":0,"9":0,"13":0,"15":0,"25":0,"26":0,"27":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"37":0,"38":0,"40":0,"43":0,"45":0,"47":0,"49":0,"53":0,"65":0,"67":0,"69":0,"70":0,"71":0,"73":0,"74":0,"76":0,"77":0,"79":0,"81":0,"82":0,"86":0,"87":0,"88":0,"90":0,"91":0,"92":0,"95":0,"96":0,"99":0,"100":0};+_yuitest_coverage["build/anim-shape-transform/anim-shape-transform.js"].functions = {"set:14":0,"get:52":0,"(anonymous 1):1":0};+_yuitest_coverage["build/anim-shape-transform/anim-shape-transform.js"].coveredLines = 44;+_yuitest_coverage["build/anim-shape-transform/anim-shape-transform.js"].coveredFunctions = 3;+_yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 1);+YUI.add('anim-shape-transform', function (Y, NAME) {++/**+ * Adds support for the <code>transform</code> attribute of <code>Graphic</code>+ * <code>Shape</code> instances.+ * @module anim+ * @submodule anim-shape-transform+ */+ _yuitest_coverfunc("build/anim-shape-transform/anim-shape-transform.js", "(anonymous 1)", 1);+_yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 9);+var NUM = Number,+ TO,+ TOSTRING;++ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 13);+Y.Anim.behaviors.transform = {+ set: function(anim, att, from, to, elapsed, duration, fn) {+ _yuitest_coverfunc("build/anim-shape-transform/anim-shape-transform.js", "set", 14);+_yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 15);+var node = anim._node,+ transform = "",+ transformTo,+ transformFrom,+ toArgs,+ fromArgs,+ i = 0,+ j,+ argLen,+ len;+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 25);+to = TO;+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 26);+len = TO.length;+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 27);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 29);+toArgs = to[i].concat();+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 30);+fromArgs = from[i].concat();+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 31);+transformTo = toArgs.shift();+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 32);+transformFrom = fromArgs.shift();+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 33);+argLen = toArgs.length;+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 34);+transform += transformTo + "(";+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 35);+for(j = 0; j < argLen; ++j)+ {+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 37);+transform += fn(elapsed, NUM(fromArgs[j]), NUM(toArgs[j]) - NUM(fromArgs[j]), duration);+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 38);+if(j < argLen - 1)+ {+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 40);+transform += ", ";+ }+ }+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 43);+transform += ");";+ }+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 45);+if(transform)+ {+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 47);+node.set('transform', transform);+ }+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 49);+node._transform = TOSTRING;+ },+ + get: function(anim) {+ _yuitest_coverfunc("build/anim-shape-transform/anim-shape-transform.js", "get", 52);+_yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 53);+var node = anim._node,+ fromMatrix = node.matrix,+ toAttr = anim.get("to") || {},+ toString = anim.get("to").transform,+ fromString = node.get("transform"),+ toArray = Y.MatrixUtil.getTransformArray(toString),+ fromArray = fromString ? Y.MatrixUtil.getTransformArray(fromString) : null,+ toMatrix,+ i,+ len,+ transformFunction,+ from;+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 65);+if(toArray)+ {+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 67);+if(!fromArray || fromArray.length < 1)+ {+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 69);+fromArray = [];+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 70);+len = toArray.length;+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 71);+for(i = 0; i < len; ++i)+ {+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 73);+transformFunction = toArray[i][0];+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 74);+fromArray[i] = Y.MatrixUtil.getTransformFunctionArray(transformFunction);+ }+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 76);+TO = toArray;+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 77);+from = fromArray;+ }+ else {_yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 79);+if(Y.MatrixUtil.compareTransformSequence(toArray, fromArray))+ {+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 81);+TO = toArray;+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 82);+from = fromArray;+ }+ else+ {+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 86);+toMatrix = new Y.Matrix();+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 87);+len = toArray.length;+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 88);+for(i = 0; i < len; ++i)+ {+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 90);+transformFunction = toArray[i].shift();+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 91);+transformFunction = transformFunction == "matrix" ? "multiply" : transformFunction;+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 92);+toMatrix[transformFunction].apply(toMatrix, toArray[i]); + }++ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 95);+TO = toMatrix.decompose();+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 96);+from = fromMatrix.decompose();+ }}+ }+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 99);+TOSTRING = toString;+ _yuitest_coverline("build/anim-shape-transform/anim-shape-transform.js", 100);+return from;+ }+ }; ++++}, '3.7.1', {"requires": ["anim-base", "anim-easing", "matrix"]});
@@ -1,112 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-YUI.add('anim-shape-transform', function(Y) {--/**- * Adds support for the <code>transform</code> attribute of <code>Graphic</code>- * <code>Shape</code> instances.- * @module anim- * @submodule anim-shape-transform- */- var NUM = Number,- TO,- TOSTRING;-- Y.Anim.behaviors.transform = {- set: function(anim, att, from, to, elapsed, duration, fn) {- var node = anim._node,- transform = "",- transformTo,- transformFrom,- toArgs,- fromArgs,- i = 0,- j,- argLen,- len;- to = TO;- len = TO.length;- for(; i < len; ++i)- {- toArgs = to[i].concat();- fromArgs = from[i].concat();- transformTo = toArgs.shift();- transformFrom = fromArgs.shift();- argLen = toArgs.length;- transform += transformTo + "(";- for(j = 0; j < argLen; ++j)- {- transform += fn(elapsed, NUM(fromArgs[j]), NUM(toArgs[j]) - NUM(fromArgs[j]), duration);- if(j < argLen - 1)- {- transform += ", ";- }- }- transform += ");";- }- if(transform)- {- node.set('transform', transform);- }- node._transform = TOSTRING;- },- - get: function(anim) {- var node = anim._node,- fromMatrix = node.matrix,- toAttr = anim.get("to") || {},- toString = anim.get("to").transform,- fromString = node.get("transform"),- toArray = Y.MatrixUtil.getTransformArray(toString),- fromArray = fromString ? Y.MatrixUtil.getTransformArray(fromString) : null,- toMatrix,- i,- len,- transformFunction,- from;- if(toArray)- {- if(!fromArray || fromArray.length < 1)- {- fromArray = [];- len = toArray.length;- for(i = 0; i < len; ++i)- {- transformFunction = toArray[i][0];- fromArray[i] = Y.MatrixUtil.getTransformFunctionArray(transformFunction);- }- TO = toArray;- from = fromArray;- }- else if(Y.MatrixUtil.compareTransformSequence(toArray, fromArray))- {- TO = toArray;- from = fromArray;- }- else- {- toMatrix = new Y.Matrix();- len = toArray.length;- for(i = 0; i < len; ++i)- {- transformFunction = toArray[i].shift();- transformFunction = transformFunction == "matrix" ? "multiply" : transformFunction;- toMatrix[transformFunction].apply(toMatrix, toArray[i]); - }-- TO = toMatrix.decompose();- from = fromMatrix.decompose();- }- }- TOSTRING = toString;- return from;- }- }; ----}, '3.5.1' ,{requires:['anim-base','matrix']});
@@ -1,7 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-YUI.add("anim-shape-transform",function(d){var b=Number,a,c;d.Anim.behaviors.transform={set:function(k,q,t,u,v,h,s){var g=k._node,f="",r,n,w,e,m=0,l,p,o;u=a;o=a.length;for(;m<o;++m){w=u[m].concat();e=t[m].concat();r=w.shift();n=e.shift();p=w.length;f+=r+"(";for(l=0;l<p;++l){f+=s(v,b(e[l]),b(w[l])-b(e[l]),h);if(l<p-1){f+=", ";}}f+=");";}if(f){g.set("transform",f);}g._transform=c;},get:function(k){var j=k._node,h=j.matrix,r=k.get("to")||{},e=k.get("to").transform,g=j.get("transform"),l=d.MatrixUtil.getTransformArray(e),q=g?d.MatrixUtil.getTransformArray(g):null,n,m,o,f,p;if(l){if(!q||q.length<1){q=[];o=l.length;for(m=0;m<o;++m){f=l[m][0];q[m]=d.MatrixUtil.getTransformFunctionArray(f);}a=l;p=q;}else{if(d.MatrixUtil.compareTransformSequence(l,q)){a=l;p=q;}else{n=new d.Matrix();o=l.length;for(m=0;m<o;++m){f=l[m].shift();f=f=="matrix"?"multiply":f;n[f].apply(n,l[m]);}a=n.decompose();p=h.decompose();}}}c=e;return p;}};},"3.5.1",{requires:["anim-base","matrix"]});
@@ -1,112 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-YUI.add('anim-shape-transform', function(Y) {--/**- * Adds support for the <code>transform</code> attribute of <code>Graphic</code>- * <code>Shape</code> instances.- * @module anim- * @submodule anim-shape-transform- */- var NUM = Number,- TO,- TOSTRING;-- Y.Anim.behaviors.transform = {- set: function(anim, att, from, to, elapsed, duration, fn) {- var node = anim._node,- transform = "",- transformTo,- transformFrom,- toArgs,- fromArgs,- i = 0,- j,- argLen,- len;- to = TO;- len = TO.length;- for(; i < len; ++i)- {- toArgs = to[i].concat();- fromArgs = from[i].concat();- transformTo = toArgs.shift();- transformFrom = fromArgs.shift();- argLen = toArgs.length;- transform += transformTo + "(";- for(j = 0; j < argLen; ++j)- {- transform += fn(elapsed, NUM(fromArgs[j]), NUM(toArgs[j]) - NUM(fromArgs[j]), duration);- if(j < argLen - 1)- {- transform += ", ";- }- }- transform += ");";- }- if(transform)- {- node.set('transform', transform);- }- node._transform = TOSTRING;- },- - get: function(anim) {- var node = anim._node,- fromMatrix = node.matrix,- toAttr = anim.get("to") || {},- toString = anim.get("to").transform,- fromString = node.get("transform"),- toArray = Y.MatrixUtil.getTransformArray(toString),- fromArray = fromString ? Y.MatrixUtil.getTransformArray(fromString) : null,- toMatrix,- i,- len,- transformFunction,- from;- if(toArray)- {- if(!fromArray || fromArray.length < 1)- {- fromArray = [];- len = toArray.length;- for(i = 0; i < len; ++i)- {- transformFunction = toArray[i][0];- fromArray[i] = Y.MatrixUtil.getTransformFunctionArray(transformFunction);- }- TO = toArray;- from = fromArray;- }- else if(Y.MatrixUtil.compareTransformSequence(toArray, fromArray))- {- TO = toArray;- from = fromArray;- }- else- {- toMatrix = new Y.Matrix();- len = toArray.length;- for(i = 0; i < len; ++i)- {- transformFunction = toArray[i].shift();- transformFunction = transformFunction == "matrix" ? "multiply" : transformFunction;- toMatrix[transformFunction].apply(toMatrix, toArray[i]); - }-- TO = toMatrix.decompose();- from = fromMatrix.decompose();- }- }- TOSTRING = toString;- return from;- }- }; ----}, '3.5.1' ,{requires:['anim-base','matrix']});
@@ -0,0 +1,302 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/anim-shape/anim-shape.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/anim-shape/anim-shape.js",+ code: []+};+_yuitest_coverage["build/anim-shape/anim-shape.js"].code=["YUI.add('anim-shape', function (Y, NAME) {","","/**"," * Adds support for the <code>transform</code> attribute of <code>Graphic</code>"," * <code>Shape</code> instances."," * @module anim"," * @submodule anim-shape-transform"," * @deprecated Use anim-shape instead."," */","/**"," * Adds support for the <code>transform</code>, <code>fill</code>, and <code> attributes of <code>Graphic</code>"," * <code>Shape</code> instances. The <code>anim-shape</code> submodule can be used for all animations involving"," * <code>Graphic</code> <code>Shape</code> attributes. "," * "," * @module anim"," * @submodule anim-shape"," */"," var NUM = Number,"," TO,"," TOSTRING,"," COLOR = \"color\","," STOPS = \"stops\","," TYPE = \"type\","," GETUPDATEDSTOPS = function(anim, from, to, elapsed, duration, fn)"," {"," var i = 0,"," getUpdatedColorValue = Y.Anim.getUpdatedColorValue,"," toStop,"," fromStop,"," prop,"," len = to.length,"," color,"," opacity,"," offset,"," rotation,"," r,"," fx,"," fy,"," cx,"," cy,"," stops = [],"," stop;"," for(; i < len; i = i + 1)"," {"," toStop = to[i];"," fromStop = from[i];"," stop = {};"," for(prop in toStop)"," {"," if(toStop.hasOwnProperty(prop))"," {"," if(prop == COLOR)"," {"," stop[prop] = Y.Color.toHex(getUpdatedColorValue(Y.Color.toHex(fromStop[prop]), Y.Color.toHex(toStop[prop]), elapsed, duration, fn));"," }"," else"," {"," stop[prop] = fn(elapsed, NUM(fromStop[prop]), NUM(toStop[prop]) - NUM(fromStop[prop]), duration);"," }"," }"," }"," stops.push(stop);"," }"," return stops;"," },"," FILLANDSTROKEBEHAVIOR = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," var i,"," updated = {},"," getUpdatedColorValue = Y.Anim.getUpdatedColorValue,"," getUpdatedStops = GETUPDATEDSTOPS;"," for(i in to)"," {"," if(to.hasOwnProperty(i) && i != TYPE)"," {"," switch(i)"," {"," case COLOR :"," updated[i] = getUpdatedColorValue(from[i], to[i], elapsed, duration, fn);"," break;"," case STOPS :"," updated[i] = getUpdatedStops(anim, from[i], to[i], elapsed, duration, fn);"," break;"," default :"," updated[i] = fn(elapsed, NUM(from[i]), NUM(to[i]) - NUM(from[i]), duration);"," break;"," }"," }"," }"," anim._node.set(att, updated);"," }"," };"," Y.Anim.behaviors.fill = FILLANDSTROKEBEHAVIOR;"," Y.Anim.behaviors.stroke = FILLANDSTROKEBEHAVIOR; ",""," Y.Anim.behaviors.transform = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," var node = anim._node,"," transform = \"\","," transformTo,"," transformFrom,"," toArgs,"," fromArgs,"," i = 0,"," j,"," argLen,"," len;"," to = TO;"," len = TO.length;"," for(; i < len; ++i)"," {"," toArgs = to[i].concat();"," fromArgs = from[i].concat();"," transformTo = toArgs.shift();"," transformFrom = fromArgs.shift();"," argLen = toArgs.length;"," transform += transformTo + \"(\";"," for(j = 0; j < argLen; ++j)"," {"," transform += fn(elapsed, NUM(fromArgs[j]), NUM(toArgs[j]) - NUM(fromArgs[j]), duration);"," if(j < argLen - 1)"," {"," transform += \", \";"," }"," }"," transform += \");\";"," }"," if(transform)"," {"," node.set('transform', transform);"," }"," node._transform = TOSTRING;"," },"," "," get: function(anim) {"," var node = anim._node,"," fromMatrix = node.matrix,"," toAttr = anim.get(\"to\") || {},"," toString = anim.get(\"to\").transform,"," fromString = node.get(\"transform\"),"," toArray = Y.MatrixUtil.getTransformArray(toString),"," fromArray = fromString ? Y.MatrixUtil.getTransformArray(fromString) : null,"," toMatrix,"," i,"," len,"," transformFunction,"," from;"," if(toArray)"," {"," if(!fromArray || fromArray.length < 1)"," {"," fromArray = [];"," len = toArray.length;"," for(i = 0; i < len; ++i)"," {"," transformFunction = toArray[i][0];"," fromArray[i] = Y.MatrixUtil.getTransformFunctionArray(transformFunction);"," }"," TO = toArray;"," from = fromArray;"," }"," else if(Y.MatrixUtil.compareTransformSequence(toArray, fromArray))"," {"," TO = toArray;"," from = fromArray;"," }"," else"," {"," toMatrix = new Y.Matrix();"," len = toArray.length;"," for(i = 0; i < len; ++i)"," {"," transformFunction = toArray[i].shift();"," transformFunction = transformFunction == \"matrix\" ? \"multiply\" : transformFunction;"," toMatrix[transformFunction].apply(toMatrix, toArray[i]); "," }",""," TO = toMatrix.decompose();"," from = fromMatrix.decompose();"," }"," }"," TOSTRING = toString;"," return from;"," }"," }; ","","","","}, '3.7.1', {\"requires\": [\"anim-base\", \"anim-easing\", \"anim-color\", \"matrix\"]});"];+_yuitest_coverage["build/anim-shape/anim-shape.js"].lines = {"1":0,"18":0,"26":0,"43":0,"45":0,"46":0,"47":0,"48":0,"50":0,"52":0,"54":0,"58":0,"62":0,"64":0,"68":0,"72":0,"74":0,"76":0,"79":0,"80":0,"82":0,"83":0,"85":0,"86":0,"90":0,"93":0,"94":0,"96":0,"98":0,"108":0,"109":0,"110":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"120":0,"121":0,"123":0,"126":0,"128":0,"130":0,"132":0,"136":0,"148":0,"150":0,"152":0,"153":0,"154":0,"156":0,"157":0,"159":0,"160":0,"162":0,"164":0,"165":0,"169":0,"170":0,"171":0,"173":0,"174":0,"175":0,"178":0,"179":0,"182":0,"183":0};+_yuitest_coverage["build/anim-shape/anim-shape.js"].functions = {"GETUPDATEDSTOPS:24":0,"set:67":0,"set:97":0,"get:135":0,"(anonymous 1):1":0};+_yuitest_coverage["build/anim-shape/anim-shape.js"].coveredLines = 69;+_yuitest_coverage["build/anim-shape/anim-shape.js"].coveredFunctions = 5;+_yuitest_coverline("build/anim-shape/anim-shape.js", 1);+YUI.add('anim-shape', function (Y, NAME) {++/**+ * Adds support for the <code>transform</code> attribute of <code>Graphic</code>+ * <code>Shape</code> instances.+ * @module anim+ * @submodule anim-shape-transform+ * @deprecated Use anim-shape instead.+ */+/**+ * Adds support for the <code>transform</code>, <code>fill</code>, and <code> attributes of <code>Graphic</code>+ * <code>Shape</code> instances. The <code>anim-shape</code> submodule can be used for all animations involving+ * <code>Graphic</code> <code>Shape</code> attributes. + * + * @module anim+ * @submodule anim-shape+ */+ _yuitest_coverfunc("build/anim-shape/anim-shape.js", "(anonymous 1)", 1);+_yuitest_coverline("build/anim-shape/anim-shape.js", 18);+var NUM = Number,+ TO,+ TOSTRING,+ COLOR = "color",+ STOPS = "stops",+ TYPE = "type",+ GETUPDATEDSTOPS = function(anim, from, to, elapsed, duration, fn)+ {+ _yuitest_coverfunc("build/anim-shape/anim-shape.js", "GETUPDATEDSTOPS", 24);+_yuitest_coverline("build/anim-shape/anim-shape.js", 26);+var i = 0,+ getUpdatedColorValue = Y.Anim.getUpdatedColorValue,+ toStop,+ fromStop,+ prop,+ len = to.length,+ color,+ opacity,+ offset,+ rotation,+ r,+ fx,+ fy,+ cx,+ cy,+ stops = [],+ stop;+ _yuitest_coverline("build/anim-shape/anim-shape.js", 43);+for(; i < len; i = i + 1)+ {+ _yuitest_coverline("build/anim-shape/anim-shape.js", 45);+toStop = to[i];+ _yuitest_coverline("build/anim-shape/anim-shape.js", 46);+fromStop = from[i];+ _yuitest_coverline("build/anim-shape/anim-shape.js", 47);+stop = {};+ _yuitest_coverline("build/anim-shape/anim-shape.js", 48);+for(prop in toStop)+ {+ _yuitest_coverline("build/anim-shape/anim-shape.js", 50);+if(toStop.hasOwnProperty(prop))+ {+ _yuitest_coverline("build/anim-shape/anim-shape.js", 52);+if(prop == COLOR)+ {+ _yuitest_coverline("build/anim-shape/anim-shape.js", 54);+stop[prop] = Y.Color.toHex(getUpdatedColorValue(Y.Color.toHex(fromStop[prop]), Y.Color.toHex(toStop[prop]), elapsed, duration, fn));+ }+ else+ {+ _yuitest_coverline("build/anim-shape/anim-shape.js", 58);+stop[prop] = fn(elapsed, NUM(fromStop[prop]), NUM(toStop[prop]) - NUM(fromStop[prop]), duration);+ }+ }+ }+ _yuitest_coverline("build/anim-shape/anim-shape.js", 62);+stops.push(stop);+ }+ _yuitest_coverline("build/anim-shape/anim-shape.js", 64);+return stops;+ },+ FILLANDSTROKEBEHAVIOR = {+ set: function(anim, att, from, to, elapsed, duration, fn) {+ _yuitest_coverfunc("build/anim-shape/anim-shape.js", "set", 67);+_yuitest_coverline("build/anim-shape/anim-shape.js", 68);+var i,+ updated = {},+ getUpdatedColorValue = Y.Anim.getUpdatedColorValue,+ getUpdatedStops = GETUPDATEDSTOPS;+ _yuitest_coverline("build/anim-shape/anim-shape.js", 72);+for(i in to)+ {+ _yuitest_coverline("build/anim-shape/anim-shape.js", 74);+if(to.hasOwnProperty(i) && i != TYPE)+ {+ _yuitest_coverline("build/anim-shape/anim-shape.js", 76);+switch(i)+ {+ case COLOR :+ _yuitest_coverline("build/anim-shape/anim-shape.js", 79);+updated[i] = getUpdatedColorValue(from[i], to[i], elapsed, duration, fn);+ _yuitest_coverline("build/anim-shape/anim-shape.js", 80);+break;+ case STOPS :+ _yuitest_coverline("build/anim-shape/anim-shape.js", 82);+updated[i] = getUpdatedStops(anim, from[i], to[i], elapsed, duration, fn);+ _yuitest_coverline("build/anim-shape/anim-shape.js", 83);+break;+ default :+ _yuitest_coverline("build/anim-shape/anim-shape.js", 85);+updated[i] = fn(elapsed, NUM(from[i]), NUM(to[i]) - NUM(from[i]), duration);+ _yuitest_coverline("build/anim-shape/anim-shape.js", 86);+break;+ }+ }+ }+ _yuitest_coverline("build/anim-shape/anim-shape.js", 90);+anim._node.set(att, updated);+ }+ };+ _yuitest_coverline("build/anim-shape/anim-shape.js", 93);+Y.Anim.behaviors.fill = FILLANDSTROKEBEHAVIOR;+ _yuitest_coverline("build/anim-shape/anim-shape.js", 94);+Y.Anim.behaviors.stroke = FILLANDSTROKEBEHAVIOR; ++ _yuitest_coverline("build/anim-shape/anim-shape.js", 96);+Y.Anim.behaviors.transform = {+ set: function(anim, att, from, to, elapsed, duration, fn) {+ _yuitest_coverfunc("build/anim-shape/anim-shape.js", "set", 97);+_yuitest_coverline("build/anim-shape/anim-shape.js", 98);+var node = anim._node,+ transform = "",+ transformTo,+ transformFrom,+ toArgs,+ fromArgs,+ i = 0,+ j,+ argLen,+ len;+ _yuitest_coverline("build/anim-shape/anim-shape.js", 108);+to = TO;+ _yuitest_coverline("build/anim-shape/anim-shape.js", 109);+len = TO.length;+ _yuitest_coverline("build/anim-shape/anim-shape.js", 110);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/anim-shape/anim-shape.js", 112);+toArgs = to[i].concat();+ _yuitest_coverline("build/anim-shape/anim-shape.js", 113);+fromArgs = from[i].concat();+ _yuitest_coverline("build/anim-shape/anim-shape.js", 114);+transformTo = toArgs.shift();+ _yuitest_coverline("build/anim-shape/anim-shape.js", 115);+transformFrom = fromArgs.shift();+ _yuitest_coverline("build/anim-shape/anim-shape.js", 116);+argLen = toArgs.length;+ _yuitest_coverline("build/anim-shape/anim-shape.js", 117);+transform += transformTo + "(";+ _yuitest_coverline("build/anim-shape/anim-shape.js", 118);+for(j = 0; j < argLen; ++j)+ {+ _yuitest_coverline("build/anim-shape/anim-shape.js", 120);+transform += fn(elapsed, NUM(fromArgs[j]), NUM(toArgs[j]) - NUM(fromArgs[j]), duration);+ _yuitest_coverline("build/anim-shape/anim-shape.js", 121);+if(j < argLen - 1)+ {+ _yuitest_coverline("build/anim-shape/anim-shape.js", 123);+transform += ", ";+ }+ }+ _yuitest_coverline("build/anim-shape/anim-shape.js", 126);+transform += ");";+ }+ _yuitest_coverline("build/anim-shape/anim-shape.js", 128);+if(transform)+ {+ _yuitest_coverline("build/anim-shape/anim-shape.js", 130);+node.set('transform', transform);+ }+ _yuitest_coverline("build/anim-shape/anim-shape.js", 132);+node._transform = TOSTRING;+ },+ + get: function(anim) {+ _yuitest_coverfunc("build/anim-shape/anim-shape.js", "get", 135);+_yuitest_coverline("build/anim-shape/anim-shape.js", 136);+var node = anim._node,+ fromMatrix = node.matrix,+ toAttr = anim.get("to") || {},+ toString = anim.get("to").transform,+ fromString = node.get("transform"),+ toArray = Y.MatrixUtil.getTransformArray(toString),+ fromArray = fromString ? Y.MatrixUtil.getTransformArray(fromString) : null,+ toMatrix,+ i,+ len,+ transformFunction,+ from;+ _yuitest_coverline("build/anim-shape/anim-shape.js", 148);+if(toArray)+ {+ _yuitest_coverline("build/anim-shape/anim-shape.js", 150);+if(!fromArray || fromArray.length < 1)+ {+ _yuitest_coverline("build/anim-shape/anim-shape.js", 152);+fromArray = [];+ _yuitest_coverline("build/anim-shape/anim-shape.js", 153);+len = toArray.length;+ _yuitest_coverline("build/anim-shape/anim-shape.js", 154);+for(i = 0; i < len; ++i)+ {+ _yuitest_coverline("build/anim-shape/anim-shape.js", 156);+transformFunction = toArray[i][0];+ _yuitest_coverline("build/anim-shape/anim-shape.js", 157);+fromArray[i] = Y.MatrixUtil.getTransformFunctionArray(transformFunction);+ }+ _yuitest_coverline("build/anim-shape/anim-shape.js", 159);+TO = toArray;+ _yuitest_coverline("build/anim-shape/anim-shape.js", 160);+from = fromArray;+ }+ else {_yuitest_coverline("build/anim-shape/anim-shape.js", 162);+if(Y.MatrixUtil.compareTransformSequence(toArray, fromArray))+ {+ _yuitest_coverline("build/anim-shape/anim-shape.js", 164);+TO = toArray;+ _yuitest_coverline("build/anim-shape/anim-shape.js", 165);+from = fromArray;+ }+ else+ {+ _yuitest_coverline("build/anim-shape/anim-shape.js", 169);+toMatrix = new Y.Matrix();+ _yuitest_coverline("build/anim-shape/anim-shape.js", 170);+len = toArray.length;+ _yuitest_coverline("build/anim-shape/anim-shape.js", 171);+for(i = 0; i < len; ++i)+ {+ _yuitest_coverline("build/anim-shape/anim-shape.js", 173);+transformFunction = toArray[i].shift();+ _yuitest_coverline("build/anim-shape/anim-shape.js", 174);+transformFunction = transformFunction == "matrix" ? "multiply" : transformFunction;+ _yuitest_coverline("build/anim-shape/anim-shape.js", 175);+toMatrix[transformFunction].apply(toMatrix, toArray[i]); + }++ _yuitest_coverline("build/anim-shape/anim-shape.js", 178);+TO = toMatrix.decompose();+ _yuitest_coverline("build/anim-shape/anim-shape.js", 179);+from = fromMatrix.decompose();+ }}+ }+ _yuitest_coverline("build/anim-shape/anim-shape.js", 182);+TOSTRING = toString;+ _yuitest_coverline("build/anim-shape/anim-shape.js", 183);+return from;+ }+ }; ++++}, '3.7.1', {"requires": ["anim-base", "anim-easing", "anim-color", "matrix"]});
@@ -0,0 +1,195 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+YUI.add('anim-shape', function (Y, NAME) {++/**+ * Adds support for the <code>transform</code> attribute of <code>Graphic</code>+ * <code>Shape</code> instances.+ * @module anim+ * @submodule anim-shape-transform+ * @deprecated Use anim-shape instead.+ */+/**+ * Adds support for the <code>transform</code>, <code>fill</code>, and <code> attributes of <code>Graphic</code>+ * <code>Shape</code> instances. The <code>anim-shape</code> submodule can be used for all animations involving+ * <code>Graphic</code> <code>Shape</code> attributes. + * + * @module anim+ * @submodule anim-shape+ */+ var NUM = Number,+ TO,+ TOSTRING,+ COLOR = "color",+ STOPS = "stops",+ TYPE = "type",+ GETUPDATEDSTOPS = function(anim, from, to, elapsed, duration, fn)+ {+ var i = 0,+ getUpdatedColorValue = Y.Anim.getUpdatedColorValue,+ toStop,+ fromStop,+ prop,+ len = to.length,+ color,+ opacity,+ offset,+ rotation,+ r,+ fx,+ fy,+ cx,+ cy,+ stops = [],+ stop;+ for(; i < len; i = i + 1)+ {+ toStop = to[i];+ fromStop = from[i];+ stop = {};+ for(prop in toStop)+ {+ if(toStop.hasOwnProperty(prop))+ {+ if(prop == COLOR)+ {+ stop[prop] = Y.Color.toHex(getUpdatedColorValue(Y.Color.toHex(fromStop[prop]), Y.Color.toHex(toStop[prop]), elapsed, duration, fn));+ }+ else+ {+ stop[prop] = fn(elapsed, NUM(fromStop[prop]), NUM(toStop[prop]) - NUM(fromStop[prop]), duration);+ }+ }+ }+ stops.push(stop);+ }+ return stops;+ },+ FILLANDSTROKEBEHAVIOR = {+ set: function(anim, att, from, to, elapsed, duration, fn) {+ var i,+ updated = {},+ getUpdatedColorValue = Y.Anim.getUpdatedColorValue,+ getUpdatedStops = GETUPDATEDSTOPS;+ for(i in to)+ {+ if(to.hasOwnProperty(i) && i != TYPE)+ {+ switch(i)+ {+ case COLOR :+ updated[i] = getUpdatedColorValue(from[i], to[i], elapsed, duration, fn);+ break;+ case STOPS :+ updated[i] = getUpdatedStops(anim, from[i], to[i], elapsed, duration, fn);+ break;+ default :+ updated[i] = fn(elapsed, NUM(from[i]), NUM(to[i]) - NUM(from[i]), duration);+ break;+ }+ }+ }+ anim._node.set(att, updated);+ }+ };+ Y.Anim.behaviors.fill = FILLANDSTROKEBEHAVIOR;+ Y.Anim.behaviors.stroke = FILLANDSTROKEBEHAVIOR; ++ Y.Anim.behaviors.transform = {+ set: function(anim, att, from, to, elapsed, duration, fn) {+ var node = anim._node,+ transform = "",+ transformTo,+ transformFrom,+ toArgs,+ fromArgs,+ i = 0,+ j,+ argLen,+ len;+ to = TO;+ len = TO.length;+ for(; i < len; ++i)+ {+ toArgs = to[i].concat();+ fromArgs = from[i].concat();+ transformTo = toArgs.shift();+ transformFrom = fromArgs.shift();+ argLen = toArgs.length;+ transform += transformTo + "(";+ for(j = 0; j < argLen; ++j)+ {+ transform += fn(elapsed, NUM(fromArgs[j]), NUM(toArgs[j]) - NUM(fromArgs[j]), duration);+ if(j < argLen - 1)+ {+ transform += ", ";+ }+ }+ transform += ");";+ }+ if(transform)+ {+ node.set('transform', transform);+ }+ node._transform = TOSTRING;+ },+ + get: function(anim) {+ var node = anim._node,+ fromMatrix = node.matrix,+ toAttr = anim.get("to") || {},+ toString = anim.get("to").transform,+ fromString = node.get("transform"),+ toArray = Y.MatrixUtil.getTransformArray(toString),+ fromArray = fromString ? Y.MatrixUtil.getTransformArray(fromString) : null,+ toMatrix,+ i,+ len,+ transformFunction,+ from;+ if(toArray)+ {+ if(!fromArray || fromArray.length < 1)+ {+ fromArray = [];+ len = toArray.length;+ for(i = 0; i < len; ++i)+ {+ transformFunction = toArray[i][0];+ fromArray[i] = Y.MatrixUtil.getTransformFunctionArray(transformFunction);+ }+ TO = toArray;+ from = fromArray;+ }+ else if(Y.MatrixUtil.compareTransformSequence(toArray, fromArray))+ {+ TO = toArray;+ from = fromArray;+ }+ else+ {+ toMatrix = new Y.Matrix();+ len = toArray.length;+ for(i = 0; i < len; ++i)+ {+ transformFunction = toArray[i].shift();+ transformFunction = transformFunction == "matrix" ? "multiply" : transformFunction;+ toMatrix[transformFunction].apply(toMatrix, toArray[i]); + }++ TO = toMatrix.decompose();+ from = fromMatrix.decompose();+ }+ }+ TOSTRING = toString;+ return from;+ }+ }; ++++}, '3.7.1', {"requires": ["anim-base", "anim-easing", "anim-color", "matrix"]});
@@ -0,0 +1,7 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+YUI.add("anim-shape",function(e,t){var n=Number,r,i,s="color",o="stops",u="type",a=function(t,r,i,o,u,a){var f=0,l=e.Anim.getUpdatedColorValue,c,h,p,d=i.length,v,m,g,y,b,w,E,S,x,T=[],N;for(;f<d;f+=1){c=i[f],h=r[f],N={};for(p in c)c.hasOwnProperty(p)&&(p==s?N[p]=e.Color.toHex(l(e.Color.toHex(h[p]),e.Color.toHex(c[p]),o,u,a)):N[p]=a(o,n(h[p]),n(c[p])-n(h[p]),u));T.push(N)}return T},f={set:function(t,r,i,f,l,c,h){var p,d={},v=e.Anim.getUpdatedColorValue,m=a;for(p in f)if(f.hasOwnProperty(p)&&p!=u)switch(p){case s:d[p]=v(i[p],f[p],l,c,h);break;case o:d[p]=m(t,i[p],f[p],l,c,h);break;default:d[p]=h(l,n(i[p]),n(f[p])-n(i[p]),c)}t._node.set(r,d)}};e.Anim.behaviors.fill=f,e.Anim.behaviors.stroke=f,e.Anim.behaviors.transform={set:function(e,t,s,o,u,a,f){var l=e._node,c="",h,p,d,v,m=0,g,y,b;o=r,b=r.length;for(;m<b;++m){d=o[m].concat(),v=s[m].concat(),h=d.shift(),p=v.shift(),y=d.length,c+=h+"(";for(g=0;g<y;++g)c+=f(u,n(v[g]),n(d[g])-n(v[g]),a),g<y-1&&(c+=", ");c+=");"}c&&l.set("transform",c),l._transform=i},get:function(t){var n=t._node,s=n.matrix,o=t.get("to")||{},u=t.get("to").transform,a=n.get("transform"),f=e.MatrixUtil.getTransformArray(u),l=a?e.MatrixUtil.getTransformArray(a):null,c,h,p,d,v;if(f)if(!l||l.length<1){l=[],p=f.length;for(h=0;h<p;++h)d=f[h][0],l[h]=e.MatrixUtil.getTransformFunctionArray(d);r=f,v=l}else if(e.MatrixUtil.compareTransformSequence(f,l))r=f,v=l;else{c=new e.Matrix,p=f.length;for(h=0;h<p;++h)d=f[h].shift(),d=d=="matrix"?"multiply":d,c[d].apply(c,f[h]);r=c.decompose(),v=s.decompose()}return i=u,v}}},"3.7.1",{requires:["anim-base","anim-easing","anim-color","matrix"]});
@@ -0,0 +1,195 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+YUI.add('anim-shape', function (Y, NAME) {++/**+ * Adds support for the <code>transform</code> attribute of <code>Graphic</code>+ * <code>Shape</code> instances.+ * @module anim+ * @submodule anim-shape-transform+ * @deprecated Use anim-shape instead.+ */+/**+ * Adds support for the <code>transform</code>, <code>fill</code>, and <code> attributes of <code>Graphic</code>+ * <code>Shape</code> instances. The <code>anim-shape</code> submodule can be used for all animations involving+ * <code>Graphic</code> <code>Shape</code> attributes. + * + * @module anim+ * @submodule anim-shape+ */+ var NUM = Number,+ TO,+ TOSTRING,+ COLOR = "color",+ STOPS = "stops",+ TYPE = "type",+ GETUPDATEDSTOPS = function(anim, from, to, elapsed, duration, fn)+ {+ var i = 0,+ getUpdatedColorValue = Y.Anim.getUpdatedColorValue,+ toStop,+ fromStop,+ prop,+ len = to.length,+ color,+ opacity,+ offset,+ rotation,+ r,+ fx,+ fy,+ cx,+ cy,+ stops = [],+ stop;+ for(; i < len; i = i + 1)+ {+ toStop = to[i];+ fromStop = from[i];+ stop = {};+ for(prop in toStop)+ {+ if(toStop.hasOwnProperty(prop))+ {+ if(prop == COLOR)+ {+ stop[prop] = Y.Color.toHex(getUpdatedColorValue(Y.Color.toHex(fromStop[prop]), Y.Color.toHex(toStop[prop]), elapsed, duration, fn));+ }+ else+ {+ stop[prop] = fn(elapsed, NUM(fromStop[prop]), NUM(toStop[prop]) - NUM(fromStop[prop]), duration);+ }+ }+ }+ stops.push(stop);+ }+ return stops;+ },+ FILLANDSTROKEBEHAVIOR = {+ set: function(anim, att, from, to, elapsed, duration, fn) {+ var i,+ updated = {},+ getUpdatedColorValue = Y.Anim.getUpdatedColorValue,+ getUpdatedStops = GETUPDATEDSTOPS;+ for(i in to)+ {+ if(to.hasOwnProperty(i) && i != TYPE)+ {+ switch(i)+ {+ case COLOR :+ updated[i] = getUpdatedColorValue(from[i], to[i], elapsed, duration, fn);+ break;+ case STOPS :+ updated[i] = getUpdatedStops(anim, from[i], to[i], elapsed, duration, fn);+ break;+ default :+ updated[i] = fn(elapsed, NUM(from[i]), NUM(to[i]) - NUM(from[i]), duration);+ break;+ }+ }+ }+ anim._node.set(att, updated);+ }+ };+ Y.Anim.behaviors.fill = FILLANDSTROKEBEHAVIOR;+ Y.Anim.behaviors.stroke = FILLANDSTROKEBEHAVIOR; ++ Y.Anim.behaviors.transform = {+ set: function(anim, att, from, to, elapsed, duration, fn) {+ var node = anim._node,+ transform = "",+ transformTo,+ transformFrom,+ toArgs,+ fromArgs,+ i = 0,+ j,+ argLen,+ len;+ to = TO;+ len = TO.length;+ for(; i < len; ++i)+ {+ toArgs = to[i].concat();+ fromArgs = from[i].concat();+ transformTo = toArgs.shift();+ transformFrom = fromArgs.shift();+ argLen = toArgs.length;+ transform += transformTo + "(";+ for(j = 0; j < argLen; ++j)+ {+ transform += fn(elapsed, NUM(fromArgs[j]), NUM(toArgs[j]) - NUM(fromArgs[j]), duration);+ if(j < argLen - 1)+ {+ transform += ", ";+ }+ }+ transform += ");";+ }+ if(transform)+ {+ node.set('transform', transform);+ }+ node._transform = TOSTRING;+ },+ + get: function(anim) {+ var node = anim._node,+ fromMatrix = node.matrix,+ toAttr = anim.get("to") || {},+ toString = anim.get("to").transform,+ fromString = node.get("transform"),+ toArray = Y.MatrixUtil.getTransformArray(toString),+ fromArray = fromString ? Y.MatrixUtil.getTransformArray(fromString) : null,+ toMatrix,+ i,+ len,+ transformFunction,+ from;+ if(toArray)+ {+ if(!fromArray || fromArray.length < 1)+ {+ fromArray = [];+ len = toArray.length;+ for(i = 0; i < len; ++i)+ {+ transformFunction = toArray[i][0];+ fromArray[i] = Y.MatrixUtil.getTransformFunctionArray(transformFunction);+ }+ TO = toArray;+ from = fromArray;+ }+ else if(Y.MatrixUtil.compareTransformSequence(toArray, fromArray))+ {+ TO = toArray;+ from = fromArray;+ }+ else+ {+ toMatrix = new Y.Matrix();+ len = toArray.length;+ for(i = 0; i < len; ++i)+ {+ transformFunction = toArray[i].shift();+ transformFunction = transformFunction == "matrix" ? "multiply" : transformFunction;+ toMatrix[transformFunction].apply(toMatrix, toArray[i]); + }++ TO = toMatrix.decompose();+ from = fromMatrix.decompose();+ }+ }+ TOSTRING = toString;+ return from;+ }+ }; ++++}, '3.7.1', {"requires": ["anim-base", "anim-easing", "anim-color", "matrix"]});
@@ -0,0 +1,73 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/anim-xy/anim-xy.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/anim-xy/anim-xy.js",+ code: []+};+_yuitest_coverage["build/anim-xy/anim-xy.js"].code=["YUI.add('anim-xy', function (Y, NAME) {","","/**"," * Adds support for the <code>xy</code> property in <code>from</code> and "," * <code>to</code> attributes."," * @module anim"," * @submodule anim-xy"," */","","var NUM = Number;","","Y.Anim.behaviors.xy = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," anim._node.setXY(["," fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),"," fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)"," ]);"," },"," get: function(anim) {"," return anim._node.getXY();"," }","};","","","","}, '3.7.1', {\"requires\": [\"anim-base\", \"node-screen\"]});"];+_yuitest_coverage["build/anim-xy/anim-xy.js"].lines = {"1":0,"10":0,"12":0,"14":0,"20":0};+_yuitest_coverage["build/anim-xy/anim-xy.js"].functions = {"set:13":0,"get:19":0,"(anonymous 1):1":0};+_yuitest_coverage["build/anim-xy/anim-xy.js"].coveredLines = 5;+_yuitest_coverage["build/anim-xy/anim-xy.js"].coveredFunctions = 3;+_yuitest_coverline("build/anim-xy/anim-xy.js", 1);+YUI.add('anim-xy', function (Y, NAME) {++/**+ * Adds support for the <code>xy</code> property in <code>from</code> and + * <code>to</code> attributes.+ * @module anim+ * @submodule anim-xy+ */++_yuitest_coverfunc("build/anim-xy/anim-xy.js", "(anonymous 1)", 1);+_yuitest_coverline("build/anim-xy/anim-xy.js", 10);+var NUM = Number;++_yuitest_coverline("build/anim-xy/anim-xy.js", 12);+Y.Anim.behaviors.xy = {+ set: function(anim, att, from, to, elapsed, duration, fn) {+ _yuitest_coverfunc("build/anim-xy/anim-xy.js", "set", 13);+_yuitest_coverline("build/anim-xy/anim-xy.js", 14);+anim._node.setXY([+ fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),+ fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)+ ]);+ },+ get: function(anim) {+ _yuitest_coverfunc("build/anim-xy/anim-xy.js", "get", 19);+_yuitest_coverline("build/anim-xy/anim-xy.js", 20);+return anim._node.getXY();+ }+};++++}, '3.7.1', {"requires": ["anim-base", "node-screen"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('anim-xy', function(Y) {+YUI.add('anim-xy', function (Y, NAME) { /** * Adds support for the <code>xy</code> property in <code>from</code> and @@ -29,4 +29,4 @@ -}, '3.5.1' ,{requires:['anim-base', 'node-screen']});+}, '3.7.1', {"requires": ["anim-base", "node-screen"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("anim-xy",function(b){var a=Number;b.Anim.behaviors.xy={set:function(f,d,i,h,c,g,e){f._node.setXY([e(c,a(i[0]),a(h[0])-a(i[0]),g),e(c,a(i[1]),a(h[1])-a(i[1]),g)]);},get:function(c){return c._node.getXY();}};},"3.5.1",{requires:["anim-base","node-screen"]});+YUI.add("anim-xy",function(e,t){var n=Number;e.Anim.behaviors.xy={set:function(e,t,r,i,s,o,u){e._node.setXY([u(s,n(r[0]),n(i[0])-n(r[0]),o),u(s,n(r[1]),n(i[1])-n(r[1]),o)])},get:function(e){return e._node.getXY()}}},"3.7.1",{requires:["anim-base","node-screen"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('anim-xy', function(Y) {+YUI.add('anim-xy', function (Y, NAME) { /** * Adds support for the <code>xy</code> property in <code>from</code> and @@ -29,4 +29,4 @@ -}, '3.5.1' ,{requires:['anim-base', 'node-screen']});+}, '3.7.1', {"requires": ["anim-base", "node-screen"]});
@@ -0,0 +1,1280 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/app-base/app-base.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/app-base/app-base.js",+ code: []+};+_yuitest_coverage["build/app-base/app-base.js"].code=["YUI.add('app-base', function (Y, NAME) {","","/**","The App Framework provides simple MVC-like building blocks (models, model lists,","views, and URL-based routing) for writing single-page JavaScript applications.","","@main app","@module app","@since 3.4.0","**/","","/**","Provides a top-level application component which manages navigation and views.","","@module app","@submodule app-base","@since 3.5.0","**/","","// TODO: Better handling of lifecycle for registered views:","//","// * [!] Just redo basically everything with view management so there are no","// pre-`activeViewChange` side effects and handle the rest of these things:","//","// * Seems like any view created via `createView` should listen for the view's","// `destroy` event and use that to remove it from the `_viewsInfoMap`. I","// should look at what ModelList does for Models as a reference.","//","// * Should we have a companion `destroyView()` method? Maybe this wouldn't be","// needed if we have a `getView(name, create)` method, and already doing the","// above? We could do `app.getView('foo').destroy()` and it would be removed","// from the `_viewsInfoMap` as well.","//","// * Should we wait to call a view's `render()` method inside of the","// `_attachView()` method?","//","// * Should named views support a collection of instances instead of just one?","//","","var Lang = Y.Lang,"," YObject = Y.Object,",""," PjaxBase = Y.PjaxBase,"," Router = Y.Router,"," View = Y.View,",""," getClassName = Y.ClassNameManager.getClassName,",""," win = Y.config.win,",""," AppBase;","","/**","Provides a top-level application component which manages navigation and views.","","This gives you a foundation and structure on which to build your application; it","combines robust URL navigation with powerful routing and flexible view","management.","","@class App.Base","@param {Object} [config] The following are configuration properties that can be"," specified _in addition_ to default attribute values and the non-attribute"," properties provided by `Y.Base`:"," @param {Object} [config.views] Hash of view-name to metadata used to"," declaratively describe an application's views and their relationship with"," the app and other views. The views specified here will override any defaults"," provided by the `views` object on the `prototype`.","@constructor","@extends Base","@uses View","@uses Router","@uses PjaxBase","@since 3.5.0","**/","AppBase = Y.Base.create('app', Y.Base, [View, Router, PjaxBase], {"," // -- Public Properties ----------------------------------------------------",""," /**"," Hash of view-name to metadata used to declaratively describe an"," application's views and their relationship with the app and its other views.",""," The view metadata is composed of Objects keyed to a view-name that can have"," any or all of the following properties:",""," * `type`: Function or a string representing the view constructor to use to"," create view instances. If a string is used, the constructor function is"," assumed to be on the `Y` object; e.g. `\"SomeView\"` -> `Y.SomeView`.",""," * `preserve`: Boolean for whether the view instance should be retained. By"," default, the view instance will be destroyed when it is no longer the"," `activeView`. If `true` the view instance will simply be `removed()`"," from the DOM when it is no longer active. This is useful when the view"," is frequently used and may be expensive to re-create.",""," * `parent`: String to another named view in this hash that represents the"," parent view within the application's view hierarchy; e.g. a `\"photo\"`"," view could have `\"album\"` has its `parent` view. This parent/child"," relationship is a useful cue for things like transitions.",""," * `instance`: Used internally to manage the current instance of this named"," view. This can be used if your view instance is created up-front, or if"," you would rather manage the View lifecycle, but you probably should just"," let this be handled for you.",""," If `views` are specified at instantiation time, the metadata in the `views`"," Object here will be used as defaults when creating the instance's `views`.",""," Every `Y.App` instance gets its own copy of a `views` object so this Object"," on the prototype will not be polluted.",""," @example"," // Imagine that `Y.UsersView` and `Y.UserView` have been defined."," var app = new Y.App({"," views: {"," users: {"," type : Y.UsersView,"," preserve: true"," },",""," user: {"," type : Y.UserView,"," parent: 'users'"," }"," }"," });",""," @property views"," @type Object"," @default {}"," @since 3.5.0"," **/"," views: {},",""," // -- Protected Properties -------------------------------------------------",""," /**"," Map of view instance id (via `Y.stamp()`) to view-info object in `views`.",""," This mapping is used to tie a specific view instance back to its metadata by"," adding a reference to the the related view info on the `views` object.",""," @property _viewInfoMap"," @type Object"," @default {}"," @protected"," @since 3.5.0"," **/",""," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function (config) {"," config || (config = {});",""," var views = {};",""," // Merges-in specified view metadata into local `views` object."," function mergeViewConfig(view, name) {"," views[name] = Y.merge(views[name], view);"," }",""," // First, each view in the `views` prototype object gets its metadata"," // merged-in, providing the defaults."," YObject.each(this.views, mergeViewConfig);",""," // Then, each view in the specified `config.views` object gets its"," // metadata merged-in."," YObject.each(config.views, mergeViewConfig);",""," // The resulting hodgepodge of metadata is then stored as the instance's"," // `views` object, and no one's objects were harmed in the making."," this.views = views;"," this._viewInfoMap = {};",""," // Using `bind()` to aid extensibility."," this.after('activeViewChange', Y.bind('_afterActiveViewChange', this));",""," // PjaxBase will bind click events when `html5` is `true`, so this just"," // forces the binding when `serverRouting` and `html5` are both falsy."," if (!this.get('serverRouting')) {"," this._pjaxBindUI();"," }"," },",""," // TODO: `destructor` to destroy the `activeView`?",""," // -- Public Methods -------------------------------------------------------",""," /**"," Creates and returns a new view instance using the provided `name` to look up"," the view info metadata defined in the `views` object. The passed-in `config`"," object is passed to the view constructor function.",""," This function also maps a view instance back to its view info metadata.",""," @method createView"," @param {String} name The name of a view defined on the `views` object."," @param {Object} [config] The configuration object passed to the view"," constructor function when creating the new view instance."," @return {View} The new view instance."," @since 3.5.0"," **/"," createView: function (name, config) {"," var viewInfo = this.getViewInfo(name),"," type = (viewInfo && viewInfo.type) || View,"," ViewConstructor, view;",""," // Looks for a namespaced constructor function on `Y`."," ViewConstructor = Lang.isString(type) ?"," YObject.getValue(Y, type.split('.')) : type;",""," // Create the view instance and map it with its metadata."," view = new ViewConstructor(config);"," this._viewInfoMap[Y.stamp(view, true)] = viewInfo;",""," return view;"," },",""," /**"," Returns the metadata associated with a view instance or view name defined on"," the `views` object.",""," @method getViewInfo"," @param {View|String} view View instance, or name of a view defined on the"," `views` object."," @return {Object} The metadata for the view, or `undefined` if the view is"," not registered."," @since 3.5.0"," **/"," getViewInfo: function (view) {"," if (Lang.isString(view)) {"," return this.views[view];"," }",""," return view && this._viewInfoMap[Y.stamp(view, true)];"," },",""," /**"," Navigates to the specified URL if there is a route handler that matches. In"," browsers capable of using HTML5 history or when `serverRouting` is falsy,"," the navigation will be enhanced by firing the `navigate` event and having"," the app handle the \"request\". When `serverRouting` is `true`, non-HTML5"," browsers will navigate to the new URL via a full page reload.",""," When there is a route handler for the specified URL and it is being"," navigated to, this method will return `true`, otherwise it will return"," `false`.",""," **Note:** The specified URL _must_ be of the same origin as the current URL,"," otherwise an error will be logged and navigation will not occur. This is"," intended as both a security constraint and a purposely imposed limitation as"," it does not make sense to tell the app to navigate to a URL on a"," different scheme, host, or port.",""," @method navigate"," @param {String} url The URL to navigate to. This must be of the same origin"," as the current URL."," @param {Object} [options] Additional options to configure the navigation."," These are mixed into the `navigate` event facade."," @param {Boolean} [options.replace] Whether or not the current history"," entry will be replaced, or a new entry will be created. Will default"," to `true` if the specified `url` is the same as the current URL."," @param {Boolean} [options.force] Whether the enhanced navigation"," should occur even in browsers without HTML5 history. Will default to"," `true` when `serverRouting` is falsy."," @see PjaxBase.navigate()"," **/"," // Does not override `navigate()` but does use extra `options`.",""," /**"," Renders this application by appending the `viewContainer` node to the"," `container` node if it isn't already a child of the container, and the"," `activeView` will be appended the view container, if it isn't already.",""," You should call this method at least once, usually after the initialization"," of your app instance so the proper DOM structure is setup and optionally"," append the container to the DOM if it's not there already.",""," You may override this method to customize the app's rendering, but you"," should expect that the `viewContainer`'s contents will be modified by the"," app for the purpose of rendering the `activeView` when it changes.",""," @method render"," @chainable"," @see View.render()"," **/"," render: function () {"," var CLASS_NAMES = Y.App.CLASS_NAMES,"," container = this.get('container'),"," viewContainer = this.get('viewContainer'),"," activeView = this.get('activeView'),"," activeViewContainer = activeView && activeView.get('container'),"," areSame = container.compareTo(viewContainer);",""," container.addClass(CLASS_NAMES.app);"," viewContainer.addClass(CLASS_NAMES.views);",""," // Prevents needless shuffling around of nodes and maintains DOM order."," if (activeView && !viewContainer.contains(activeViewContainer)) {"," viewContainer.appendChild(activeViewContainer);"," }",""," // Prevents needless shuffling around of nodes and maintains DOM order."," if (!container.contains(viewContainer) && !areSame) {"," container.appendChild(viewContainer);"," }",""," return this;"," },",""," /**"," Sets which view is active/visible for the application. This will set the"," app's `activeView` attribute to the specified `view`.",""," The `view` will be \"attached\" to this app, meaning it will be both rendered"," into this app's `viewContainer` node and all of its events will bubble to"," the app. The previous `activeView` will be \"detached\" from this app.",""," When a string-name is provided for a view which has been registered on this"," app's `views` object, the referenced metadata will be used and the"," `activeView` will be set to either a preserved view instance, or a new"," instance of the registered view will be created using the specified `config`"," object passed-into this method.",""," A callback function can be specified as either the third or fourth argument,"," and this function will be called after the new `view` becomes the"," `activeView`, is rendered to the `viewContainer`, and is ready to use.",""," @example"," var app = new Y.App({"," views: {"," usersView: {"," // Imagine that `Y.UsersView` has been defined."," type: Y.UsersView"," }"," },",""," users: new Y.ModelList()"," });",""," app.route('/users/', function () {"," this.showView('usersView', {users: this.get('users')});"," });",""," app.render();"," app.navigate('/uses/'); // => Creates a new `Y.UsersView` and shows it.",""," @method showView"," @param {String|View} view The name of a view defined in the `views` object,"," or a view instance which should become this app's `activeView`."," @param {Object} [config] Optional configuration to use when creating a new"," view instance. This config object can also be used to update an existing"," or preserved view's attributes when `options.update` is `true`."," @param {Object} [options] Optional object containing any of the following"," properties:"," @param {Function} [options.callback] Optional callback function to call"," after new `activeView` is ready to use, the function will be passed:"," @param {View} options.callback.view A reference to the new"," `activeView`."," @param {Boolean} [options.prepend=false] Whether the `view` should be"," prepended instead of appended to the `viewContainer`."," @param {Boolean} [options.render] Whether the `view` should be rendered."," **Note:** If no value is specified, a view instance will only be"," rendered if it's newly created by this method."," @param {Boolean} [options.update=false] Whether an existing view should"," have its attributes updated by passing the `config` object to its"," `setAttrs()` method. **Note:** This option does not have an effect if"," the `view` instance is created as a result of calling this method."," @param {Function} [callback] Optional callback Function to call after the"," new `activeView` is ready to use. **Note:** this will override"," `options.callback` and it can be specified as either the third or fourth"," argument. The function will be passed the following:"," @param {View} callback.view A reference to the new `activeView`."," @chainable"," @since 3.5.0"," **/"," showView: function (view, config, options, callback) {"," var viewInfo, created;",""," options || (options = {});",""," // Support the callback function being either the third or fourth arg."," if (callback) {"," options = Y.merge(options, {callback: callback});"," } else if (Lang.isFunction(options)) {"," options = {callback: options};"," }",""," if (Lang.isString(view)) {"," viewInfo = this.getViewInfo(view);",""," // Use the preserved view instance, or create a new view."," // TODO: Maybe we can remove the strict check for `preserve` and"," // assume we'll use a View instance if it is there, and just check"," // `preserve` when detaching?"," if (viewInfo && viewInfo.preserve && viewInfo.instance) {"," view = viewInfo.instance;",""," // Make sure there's a mapping back to the view metadata."," this._viewInfoMap[Y.stamp(view, true)] = viewInfo;"," } else {"," // TODO: Add the app as a bubble target during construction, but"," // make sure to check that it isn't already in `bubbleTargets`!"," // This will allow the app to be notified for about _all_ of the"," // view's events. **Note:** This should _only_ happen if the"," // view is created _after_ `activeViewChange`.",""," view = this.createView(view, config);"," created = true;"," }"," }",""," // Update the specified or preserved `view` when signaled to do so."," // There's no need to updated a view if it was _just_ created."," if (options.update && !created) {"," view.setAttrs(config);"," }",""," // TODO: Hold off on rendering the view until after it has been"," // \"attached\", and move the call to render into `_attachView()`.",""," // When a value is specified for `options.render`, prefer it because it"," // represents the developer's intent. When no value is specified, the"," // `view` will only be rendered if it was just created."," if ('render' in options) {"," if (options.render) {"," view.render();"," }"," } else if (created) {"," view.render();"," }",""," return this._set('activeView', view, {options: options});"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Helper method to attach the view instance to the application by making the"," app a bubble target of the view, append the view to the `viewContainer`, and"," assign it to the `instance` property of the associated view info metadata.",""," @method _attachView"," @param {View} view View to attach."," @param {Boolean} prepend=false Whether the view should be prepended instead"," of appended to the `viewContainer`."," @protected"," @since 3.5.0"," **/"," _attachView: function (view, prepend) {"," if (!view) {"," return;"," }",""," var viewInfo = this.getViewInfo(view),"," viewContainer = this.get('viewContainer');",""," // Bubble the view's events to this app."," view.addTarget(this);",""," // Save the view instance in the `views` registry."," if (viewInfo) {"," viewInfo.instance = view;"," }",""," // TODO: Attach events here for persevered Views?"," // See related TODO in `_detachView`.",""," // TODO: Actually render the view here so that it gets \"attached\" before"," // it gets rendered?",""," // Insert view into the DOM."," viewContainer[prepend ? 'prepend' : 'append'](view.get('container'));"," },",""," /**"," Overrides View's container destruction to deal with the `viewContainer` and"," checks to make sure not to remove and purge the `<body>`.",""," @method _destroyContainer"," @protected"," @see View._destroyContainer()"," **/"," _destroyContainer: function () {"," var CLASS_NAMES = Y.App.CLASS_NAMES,"," container = this.get('container'),"," viewContainer = this.get('viewContainer'),"," areSame = container.compareTo(viewContainer);",""," // We do not want to remove or destroy the `<body>`."," if (Y.one('body').compareTo(container)) {"," // Just clean-up our events listeners."," this.detachEvents();",""," // Clean-up `yui3-app` CSS class on the `container`."," container.removeClass(CLASS_NAMES.app);",""," if (areSame) {"," // Clean-up `yui3-app-views` CSS class on the `container`."," container.removeClass(CLASS_NAMES.views);"," } else {"," // Destroy and purge the `viewContainer`."," viewContainer.remove(true);"," }",""," return;"," }",""," // Remove and purge events from both containers.",""," viewContainer.remove(true);",""," if (!areSame) {"," container.remove(true);"," }"," },",""," /**"," Helper method to detach the view instance from the application by removing"," the application as a bubble target of the view, and either just removing the"," view if it is intended to be preserved, or destroying the instance"," completely.",""," @method _detachView"," @param {View} view View to detach."," @protected"," @since 3.5.0"," **/"," _detachView: function (view) {"," if (!view) {"," return;"," }",""," var viewInfo = this.getViewInfo(view) || {};",""," if (viewInfo.preserve) {"," view.remove();"," // TODO: Detach events here for preserved Views? It is possible that"," // some event subscriptions are made on elements other than the"," // View's `container`."," } else {"," view.destroy({remove: true});",""," // TODO: The following should probably happen automagically from"," // `destroy()` being called! Possibly `removeTarget()` as well.",""," // Remove from view to view-info map."," delete this._viewInfoMap[Y.stamp(view, true)];",""," // Remove from view-info instance property."," if (view === viewInfo.instance) {"," delete viewInfo.instance;"," }"," }",""," view.removeTarget(this);"," },",""," /**"," Getter for the `viewContainer` attribute.",""," @method _getViewContainer"," @param {Node|null} value Current attribute value."," @return {Node} View container node."," @protected"," @since 3.5.0"," **/"," _getViewContainer: function (value) {"," // This wackiness is necessary to enable fully lazy creation of the"," // container node both when no container is specified and when one is"," // specified via a valueFn.",""," if (!value && !this._viewContainer) {"," // Create a default container and set that as the new attribute"," // value. The `this._viewContainer` property prevents infinite"," // recursion."," value = this._viewContainer = this.create();"," this._set('viewContainer', value);"," }",""," return value;"," },",""," /**"," Provides the default value for the `html5` attribute.",""," The value returned is dependent on the value of the `serverRouting`"," attribute. When `serverRouting` is explicit set to `false` (not just falsy),"," the default value for `html5` will be set to `false` for *all* browsers.",""," When `serverRouting` is `true` or `undefined` the returned value will be"," dependent on the browser's capability of using HTML5 history.",""," @method _initHtml5"," @return {Boolean} Whether or not HTML5 history should be used."," @protected"," @since 3.5.0"," **/"," _initHtml5: function () {"," // When `serverRouting` is explicitly set to `false` (not just falsy),"," // forcing hash-based URLs in all browsers."," if (this.get('serverRouting') === false) {"," return false;"," }",""," // Defaults to whether or not the browser supports HTML5 history."," return Router.html5;"," },",""," /**"," Determines if the specified `view` is configured as a child of the specified"," `parent` view. This requires both views to be either named-views, or view"," instances created using configuration data that exists in the `views`"," object, e.g. created by the `createView()` or `showView()` method.",""," @method _isChildView"," @param {View|String} view The name of a view defined in the `views` object,"," or a view instance."," @param {View|String} parent The name of a view defined in the `views`"," object, or a view instance."," @return {Boolean} Whether the view is configured as a child of the parent."," @protected"," @since 3.5.0"," **/"," _isChildView: function (view, parent) {"," var viewInfo = this.getViewInfo(view),"," parentInfo = this.getViewInfo(parent);",""," if (viewInfo && parentInfo) {"," return this.getViewInfo(viewInfo.parent) === parentInfo;"," }",""," return false;"," },",""," /**"," Determines if the specified `view` is configured as the parent of the"," specified `child` view. This requires both views to be either named-views,"," or view instances created using configuration data that exists in the"," `views` object, e.g. created by the `createView()` or `showView()` method.",""," @method _isParentView"," @param {View|String} view The name of a view defined in the `views` object,"," or a view instance."," @param {View|String} parent The name of a view defined in the `views`"," object, or a view instance."," @return {Boolean} Whether the view is configured as the parent of the child."," @protected"," @since 3.5.0"," **/"," _isParentView: function (view, child) {"," var viewInfo = this.getViewInfo(view),"," childInfo = this.getViewInfo(child);",""," if (viewInfo && childInfo) {"," return this.getViewInfo(childInfo.parent) === viewInfo;"," }",""," return false;"," },",""," /**"," Underlying implementation for `navigate()`.",""," @method _navigate"," @param {String} url The fully-resolved URL that the app should dispatch to"," its route handlers to fulfill the enhanced navigation \"request\", or use to"," update `window.location` in non-HTML5 history capable browsers when"," `serverRouting` is `true`."," @param {Object} [options] Additional options to configure the navigation."," These are mixed into the `navigate` event facade."," @param {Boolean} [options.replace] Whether or not the current history"," entry will be replaced, or a new entry will be created. Will default"," to `true` if the specified `url` is the same as the current URL."," @param {Boolean} [options.force] Whether the enhanced navigation"," should occur even in browsers without HTML5 history. Will default to"," `true` when `serverRouting` is falsy."," @protected"," @see PjaxBase._navigate()"," **/"," _navigate: function (url, options) {"," if (!this.get('serverRouting')) {"," // Force navigation to be enhanced and handled by the app when"," // `serverRouting` is falsy because the server might not be able to"," // properly handle the request."," options = Y.merge({force: true}, options);"," }",""," return PjaxBase.prototype._navigate.call(this, url, options);"," },",""," /**"," Will either save a history entry using `pushState()` or the location hash,"," or gracefully-degrade to sending a request to the server causing a full-page"," reload.",""," Overrides Router's `_save()` method to preform graceful-degradation when the"," app's `serverRouting` is `true` and `html5` is `false` by updating the full"," URL via standard assignment to `window.location` or by calling"," `window.location.replace()`; both of which will cause a request to the"," server resulting in a full-page reload.",""," Otherwise this will just delegate off to Router's `_save()` method allowing"," the client-side enhanced routing to occur.",""," @method _save"," @param {String} [url] URL for the history entry."," @param {Boolean} [replace=false] If `true`, the current history entry will"," be replaced instead of a new one being added."," @chainable"," @protected"," @see Router._save()"," **/"," _save: function (url, replace) {"," var path;",""," // Forces full-path URLs to always be used by modifying"," // `window.location` in non-HTML5 history capable browsers."," if (this.get('serverRouting') && !this.get('html5')) {"," // Perform same-origin check on the specified URL."," if (!this._hasSameOrigin(url)) {"," Y.error('Security error: The new URL must be of the same origin as the current URL.');"," return this;"," }",""," // Either replace the current history entry or create a new one"," // while navigating to the `url`."," if (win) {"," // Results in the URL's full path starting with '/'."," path = this._joinURL(url || '');",""," if (replace) {"," win.location.replace(path);"," } else {"," win.location = path;"," }"," }",""," return this;"," }",""," return Router.prototype._save.apply(this, arguments);"," },",""," /**"," Performs the actual change of this app's `activeView` by attaching the"," `newView` to this app, and detaching the `oldView` from this app using any"," specified `options`.",""," The `newView` is attached to the app by rendering it to the `viewContainer`,"," and making this app a bubble target of its events.",""," The `oldView` is detached from the app by removing it from the"," `viewContainer`, and removing this app as a bubble target for its events."," The `oldView` will either be preserved or properly destroyed.",""," **Note:** The `activeView` attribute is read-only and can be changed by"," calling the `showView()` method.",""," @method _uiSetActiveView"," @param {View} newView The View which is now this app's `activeView`."," @param {View} [oldView] The View which was this app's `activeView`."," @param {Object} [options] Optional object containing any of the following"," properties:"," @param {Function} [options.callback] Optional callback function to call"," after new `activeView` is ready to use, the function will be passed:"," @param {View} options.callback.view A reference to the new"," `activeView`."," @param {Boolean} [options.prepend=false] Whether the `view` should be"," prepended instead of appended to the `viewContainer`."," @param {Boolean} [options.render] Whether the `view` should be rendered."," **Note:** If no value is specified, a view instance will only be"," rendered if it's newly created by this method."," @param {Boolean} [options.update=false] Whether an existing view should"," have its attributes updated by passing the `config` object to its"," `setAttrs()` method. **Note:** This option does not have an effect if"," the `view` instance is created as a result of calling this method."," @protected"," @since 3.5.0"," **/"," _uiSetActiveView: function (newView, oldView, options) {"," options || (options = {});",""," var callback = options.callback,"," isChild = this._isChildView(newView, oldView),"," isParent = !isChild && this._isParentView(newView, oldView),"," prepend = !!options.prepend || isParent;",""," // Prevent detaching (thus removing) the view we want to show. Also hard"," // to animate out and in, the same view."," if (newView === oldView) {"," return callback && callback.call(this, newView);"," }",""," this._attachView(newView, prepend);"," this._detachView(oldView);",""," if (callback) {"," callback.call(this, newView);"," }"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles the application's `activeViewChange` event (which is fired when the"," `activeView` attribute changes) by detaching the old view, attaching the new"," view.",""," The `activeView` attribute is read-only, so the public API to change its"," value is through the `showView()` method.",""," @method _afterActiveViewChange"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _afterActiveViewChange: function (e) {"," this._uiSetActiveView(e.newVal, e.prevVal, e.options);"," }","}, {"," ATTRS: {"," /**"," The application's active/visible view.",""," This attribute is read-only, to set the `activeView` use the"," `showView()` method.",""," @attribute activeView"," @type View"," @default null"," @readOnly"," @see App.Base.showView()"," @since 3.5.0"," **/"," activeView: {"," value : null,"," readOnly: true"," },",""," /**"," Container node which represents the application's bounding-box, into"," which this app's content will be rendered.",""," The container node serves as the host for all DOM events attached by the"," app. Delegation is used to handle events on children of the container,"," allowing the container's contents to be re-rendered at any time without"," losing event subscriptions.",""," The default container is the `<body>` Node, but you can override this in"," a subclass, or by passing in a custom `container` config value at"," instantiation time.",""," When `container` is overridden by a subclass or passed as a config"," option at instantiation time, it may be provided as a selector string, a"," DOM element, or a `Y.Node` instance. During initialization, this app's"," `create()` method will be called to convert the container into a"," `Y.Node` instance if it isn't one already and stamp it with the CSS"," class: `\"yui3-app\"`.",""," The container is not added to the page automatically. This allows you to"," have full control over how and when your app is actually rendered to"," the page.",""," @attribute container"," @type HTMLElement|Node|String"," @default Y.one('body')"," @initOnly"," **/"," container: {"," valueFn: function () {"," return Y.one('body');"," }"," },",""," /**"," Whether or not this browser is capable of using HTML5 history.",""," This value is dependent on the value of `serverRouting` and will default"," accordingly.",""," Setting this to `false` will force the use of hash-based history even on"," HTML5 browsers, but please don't do this unless you understand the"," consequences.",""," @attribute html5"," @type Boolean"," @initOnly"," @see serverRouting"," **/"," html5: {"," valueFn: '_initHtml5'"," },",""," /**"," CSS selector string used to filter link click events so that only the"," links which match it will have the enhanced-navigation behavior of pjax"," applied.",""," When a link is clicked and that link matches this selector, navigating"," to the link's `href` URL using the enhanced, pjax, behavior will be"," attempted; and the browser's default way to navigate to new pages will"," be the fallback.",""," By default this selector will match _all_ links on the page.",""," @attribute linkSelector"," @type String|Function"," @default \"a\""," **/"," linkSelector: {"," value: 'a'"," },",""," /**"," Whether or not this application's server is capable of properly routing"," all requests and rendering the initial state in the HTML responses.",""," This can have three different values, each having particular"," implications on how the app will handle routing and navigation:",""," * `undefined`: The best form of URLs will be chosen based on the"," capabilities of the browser. Given no information about the server"," environmentm a balanced approach to routing and navigation is"," chosen.",""," The server should be capable of handling full-path requests, since"," full-URLs will be generated by browsers using HTML5 history. If this"," is a client-side-only app the server could handle full-URL requests"," by sending a redirect back to the root with a hash-based URL, e.g:",""," Request: http://example.com/users/1"," Redirect to: http://example.com/#/users/1",""," * `true`: The server is *fully* capable of properly handling requests"," to all full-path URLs the app can produce.",""," This is the best option for progressive-enhancement because it will"," cause **all URLs to always have full-paths**, which means the server"," will be able to accurately handle all URLs this app produces. e.g.",""," http://example.com/users/1",""," To meet this strict full-URL requirement, browsers which are not"," capable of using HTML5 history will make requests to the server"," resulting in full-page reloads.",""," * `false`: The server is *not* capable of properly handling requests"," to all full-path URLs the app can produce, therefore all routing"," will be handled by this App instance.",""," Be aware that this will cause **all URLs to always be hash-based**,"," even in browsers that are capable of using HTML5 history. e.g.",""," http://example.com/#/users/1",""," A single-page or client-side-only app where the server sends a"," \"shell\" page with JavaScript to the client might have this"," restriction. If you're setting this to `false`, read the following:",""," **Note:** When this is set to `false`, the server will *never* receive"," the full URL because browsers do not send the fragment-part to the"," server, that is everything after and including the \"#\".",""," Consider the following example:",""," URL shown in browser: http://example.com/#/users/1"," URL sent to server: http://example.com/",""," You should feel bad about hurting our precious web if you forcefully set"," either `serverRouting` or `html5` to `false`, because you're basically"," punching the web in the face here with your lossy URLs! Please make sure"," you know what you're doing and that you understand the implications.",""," Ideally you should always prefer full-path URLs (not /#/foo/), and want"," full-page reloads when the client's browser is not capable of enhancing"," the experience using the HTML5 history APIs. Setting this to `true` is"," the best option for progressive-enhancement (and graceful-degradation).",""," @attribute serverRouting"," @type Boolean"," @default undefined"," @initOnly"," @since 3.5.0"," **/"," serverRouting: {"," valueFn : function () { return Y.App.serverRouting; },"," writeOnce: 'initOnly'"," },",""," /**"," The node into which this app's `views` will be rendered when they become"," the `activeView`.",""," The view container node serves as the container to hold the app's"," `activeView`. Each time the `activeView` is set via `showView()`, the"," previous view will be removed from this node, and the new active view's"," `container` node will be appended.",""," The default view container is a `<div>` Node, but you can override this"," in a subclass, or by passing in a custom `viewContainer` config value at"," instantiation time. The `viewContainer` may be provided as a selector"," string, DOM element, or a `Y.Node` instance (having the `viewContainer`"," and the `container` be the same node is also supported).",""," The app's `render()` method will stamp the view container with the CSS"," class `\"yui3-app-views\"` and append it to the app's `container` node if"," it isn't already, and any `activeView` will be appended to this node if"," it isn't already.",""," @attribute viewContainer"," @type HTMLElement|Node|String"," @default Y.Node.create(this.containerTemplate)"," @initOnly"," @since 3.5.0"," **/"," viewContainer: {"," getter : '_getViewContainer',"," setter : Y.one,"," writeOnce: true"," }"," },",""," /**"," Properties that shouldn't be turned into ad-hoc attributes when passed to"," App's constructor.",""," @property _NON_ATTRS_CFG"," @type Array"," @static"," @protected"," @since 3.5.0"," **/"," _NON_ATTRS_CFG: ['views']","});","","// -- Namespace ----------------------------------------------------------------","Y.namespace('App').Base = AppBase;","","/**","Provides a top-level application component which manages navigation and views.","","This gives you a foundation and structure on which to build your application; it","combines robust URL navigation with powerful routing and flexible view","management.","","`Y.App` is both a namespace and constructor function. The `Y.App` class is","special in that any `Y.App` class extensions that are included in the YUI","instance will be **auto-mixed** on to the `Y.App` class. Consider this example:",""," YUI().use('app-base', 'app-transitions', function (Y) {"," // This will create two YUI Apps, `basicApp` will not have transitions,"," // but `fancyApp` will have transitions support included and turn it on."," var basicApp = new Y.App.Base(),"," fancyApp = new Y.App({transitions: true});"," });","","@class App","@param {Object} [config] The following are configuration properties that can be"," specified _in addition_ to default attribute values and the non-attribute"," properties provided by `Y.Base`:"," @param {Object} [config.views] Hash of view-name to metadata used to"," declaratively describe an application's views and their relationship with"," the app and other views. The views specified here will override any defaults"," provided by the `views` object on the `prototype`.","@constructor","@extends App.Base","@uses App.Content","@uses App.Transitions","@uses PjaxContent","@since 3.5.0","**/","Y.App = Y.mix(Y.Base.create('app', AppBase, []), Y.App, true);","","/**","CSS classes used by `Y.App`.","","@property CLASS_NAMES","@type Object","@default {}","@static","@since 3.6.0","**/","Y.App.CLASS_NAMES = {"," app : getClassName('app'),"," views: getClassName('app', 'views')","};","","/**","Default `serverRouting` attribute value for all apps.","","@property serverRouting","@type Boolean","@default undefined","@static","@since 3.6.0","**/","","","}, '3.7.1', {\"requires\": [\"classnamemanager\", \"pjax-base\", \"router\", \"view\"]});"];+_yuitest_coverage["build/app-base/app-base.js"].lines = {"1":0,"40":0,"75":0,"151":0,"153":0,"156":0,"157":0,"162":0,"166":0,"170":0,"171":0,"174":0,"178":0,"179":0,"202":0,"207":0,"211":0,"212":0,"214":0,"229":0,"230":0,"233":0,"286":0,"293":0,"294":0,"297":0,"298":0,"302":0,"303":0,"306":0,"376":0,"378":0,"381":0,"382":0,"383":0,"384":0,"387":0,"388":0,"394":0,"395":0,"398":0,"406":0,"407":0,"413":0,"414":0,"423":0,"424":0,"425":0,"427":0,"428":0,"431":0,"449":0,"450":0,"453":0,"457":0,"460":0,"461":0,"471":0,"483":0,"489":0,"491":0,"494":0,"496":0,"498":0,"501":0,"504":0,"509":0,"511":0,"512":0,"528":0,"529":0,"532":0,"534":0,"535":0,"540":0,"546":0,"549":0,"550":0,"554":0,"571":0,"575":0,"576":0,"579":0,"600":0,"601":0,"605":0,"624":0,"627":0,"628":0,"631":0,"650":0,"653":0,"654":0,"657":0,"680":0,"684":0,"687":0,"713":0,"717":0,"719":0,"720":0,"721":0,"726":0,"728":0,"730":0,"731":0,"733":0,"737":0,"740":0,"780":0,"782":0,"789":0,"790":0,"793":0,"794":0,"796":0,"797":0,"817":0,"870":0,"985":0,"1036":0,"1071":0,"1082":0};+_yuitest_coverage["build/app-base/app-base.js"].functions = {"mergeViewConfig:156":0,"initializer:150":0,"createView:201":0,"getViewInfo:228":0,"render:285":0,"showView:375":0,"_attachView:448":0,"_destroyContainer:482":0,"_detachView:527":0,"_getViewContainer:566":0,"_initHtml5:597":0,"_isChildView:623":0,"_isParentView:649":0,"_navigate:679":0,"_save:712":0,"_uiSetActiveView:779":0,"_afterActiveViewChange:816":0,"valueFn:869":0,"valueFn:985":0,"(anonymous 1):1":0};+_yuitest_coverage["build/app-base/app-base.js"].coveredLines = 123;+_yuitest_coverage["build/app-base/app-base.js"].coveredFunctions = 20;+_yuitest_coverline("build/app-base/app-base.js", 1);+YUI.add('app-base', function (Y, NAME) {++/**+The App Framework provides simple MVC-like building blocks (models, model lists,+views, and URL-based routing) for writing single-page JavaScript applications.++@main app+@module app+@since 3.4.0+**/++/**+Provides a top-level application component which manages navigation and views.++@module app+@submodule app-base+@since 3.5.0+**/++// TODO: Better handling of lifecycle for registered views:+//+// * [!] Just redo basically everything with view management so there are no+// pre-`activeViewChange` side effects and handle the rest of these things:+//+// * Seems like any view created via `createView` should listen for the view's+// `destroy` event and use that to remove it from the `_viewsInfoMap`. I+// should look at what ModelList does for Models as a reference.+//+// * Should we have a companion `destroyView()` method? Maybe this wouldn't be+// needed if we have a `getView(name, create)` method, and already doing the+// above? We could do `app.getView('foo').destroy()` and it would be removed+// from the `_viewsInfoMap` as well.+//+// * Should we wait to call a view's `render()` method inside of the+// `_attachView()` method?+//+// * Should named views support a collection of instances instead of just one?+//++_yuitest_coverfunc("build/app-base/app-base.js", "(anonymous 1)", 1);+_yuitest_coverline("build/app-base/app-base.js", 40);+var Lang = Y.Lang,+ YObject = Y.Object,++ PjaxBase = Y.PjaxBase,+ Router = Y.Router,+ View = Y.View,++ getClassName = Y.ClassNameManager.getClassName,++ win = Y.config.win,++ AppBase;++/**+Provides a top-level application component which manages navigation and views.++This gives you a foundation and structure on which to build your application; it+combines robust URL navigation with powerful routing and flexible view+management.++@class App.Base+@param {Object} [config] The following are configuration properties that can be+ specified _in addition_ to default attribute values and the non-attribute+ properties provided by `Y.Base`:+ @param {Object} [config.views] Hash of view-name to metadata used to+ declaratively describe an application's views and their relationship with+ the app and other views. The views specified here will override any defaults+ provided by the `views` object on the `prototype`.+@constructor+@extends Base+@uses View+@uses Router+@uses PjaxBase+@since 3.5.0+**/+_yuitest_coverline("build/app-base/app-base.js", 75);+AppBase = Y.Base.create('app', Y.Base, [View, Router, PjaxBase], {+ // -- Public Properties ----------------------------------------------------++ /**+ Hash of view-name to metadata used to declaratively describe an+ application's views and their relationship with the app and its other views.++ The view metadata is composed of Objects keyed to a view-name that can have+ any or all of the following properties:++ * `type`: Function or a string representing the view constructor to use to+ create view instances. If a string is used, the constructor function is+ assumed to be on the `Y` object; e.g. `"SomeView"` -> `Y.SomeView`.++ * `preserve`: Boolean for whether the view instance should be retained. By+ default, the view instance will be destroyed when it is no longer the+ `activeView`. If `true` the view instance will simply be `removed()`+ from the DOM when it is no longer active. This is useful when the view+ is frequently used and may be expensive to re-create.++ * `parent`: String to another named view in this hash that represents the+ parent view within the application's view hierarchy; e.g. a `"photo"`+ view could have `"album"` has its `parent` view. This parent/child+ relationship is a useful cue for things like transitions.++ * `instance`: Used internally to manage the current instance of this named+ view. This can be used if your view instance is created up-front, or if+ you would rather manage the View lifecycle, but you probably should just+ let this be handled for you.++ If `views` are specified at instantiation time, the metadata in the `views`+ Object here will be used as defaults when creating the instance's `views`.++ Every `Y.App` instance gets its own copy of a `views` object so this Object+ on the prototype will not be polluted.++ @example+ // Imagine that `Y.UsersView` and `Y.UserView` have been defined.+ var app = new Y.App({+ views: {+ users: {+ type : Y.UsersView,+ preserve: true+ },++ user: {+ type : Y.UserView,+ parent: 'users'+ }+ }+ });++ @property views+ @type Object+ @default {}+ @since 3.5.0+ **/+ views: {},++ // -- Protected Properties -------------------------------------------------++ /**+ Map of view instance id (via `Y.stamp()`) to view-info object in `views`.++ This mapping is used to tie a specific view instance back to its metadata by+ adding a reference to the the related view info on the `views` object.++ @property _viewInfoMap+ @type Object+ @default {}+ @protected+ @since 3.5.0+ **/++ // -- Lifecycle Methods ----------------------------------------------------+ initializer: function (config) {+ _yuitest_coverfunc("build/app-base/app-base.js", "initializer", 150);+_yuitest_coverline("build/app-base/app-base.js", 151);+config || (config = {});++ _yuitest_coverline("build/app-base/app-base.js", 153);+var views = {};++ // Merges-in specified view metadata into local `views` object.+ _yuitest_coverline("build/app-base/app-base.js", 156);+function mergeViewConfig(view, name) {+ _yuitest_coverfunc("build/app-base/app-base.js", "mergeViewConfig", 156);+_yuitest_coverline("build/app-base/app-base.js", 157);+views[name] = Y.merge(views[name], view);+ }++ // First, each view in the `views` prototype object gets its metadata+ // merged-in, providing the defaults.+ _yuitest_coverline("build/app-base/app-base.js", 162);+YObject.each(this.views, mergeViewConfig);++ // Then, each view in the specified `config.views` object gets its+ // metadata merged-in.+ _yuitest_coverline("build/app-base/app-base.js", 166);+YObject.each(config.views, mergeViewConfig);++ // The resulting hodgepodge of metadata is then stored as the instance's+ // `views` object, and no one's objects were harmed in the making.+ _yuitest_coverline("build/app-base/app-base.js", 170);+this.views = views;+ _yuitest_coverline("build/app-base/app-base.js", 171);+this._viewInfoMap = {};++ // Using `bind()` to aid extensibility.+ _yuitest_coverline("build/app-base/app-base.js", 174);+this.after('activeViewChange', Y.bind('_afterActiveViewChange', this));++ // PjaxBase will bind click events when `html5` is `true`, so this just+ // forces the binding when `serverRouting` and `html5` are both falsy.+ _yuitest_coverline("build/app-base/app-base.js", 178);+if (!this.get('serverRouting')) {+ _yuitest_coverline("build/app-base/app-base.js", 179);+this._pjaxBindUI();+ }+ },++ // TODO: `destructor` to destroy the `activeView`?++ // -- Public Methods -------------------------------------------------------++ /**+ Creates and returns a new view instance using the provided `name` to look up+ the view info metadata defined in the `views` object. The passed-in `config`+ object is passed to the view constructor function.++ This function also maps a view instance back to its view info metadata.++ @method createView+ @param {String} name The name of a view defined on the `views` object.+ @param {Object} [config] The configuration object passed to the view+ constructor function when creating the new view instance.+ @return {View} The new view instance.+ @since 3.5.0+ **/+ createView: function (name, config) {+ _yuitest_coverfunc("build/app-base/app-base.js", "createView", 201);+_yuitest_coverline("build/app-base/app-base.js", 202);+var viewInfo = this.getViewInfo(name),+ type = (viewInfo && viewInfo.type) || View,+ ViewConstructor, view;++ // Looks for a namespaced constructor function on `Y`.+ _yuitest_coverline("build/app-base/app-base.js", 207);+ViewConstructor = Lang.isString(type) ?+ YObject.getValue(Y, type.split('.')) : type;++ // Create the view instance and map it with its metadata.+ _yuitest_coverline("build/app-base/app-base.js", 211);+view = new ViewConstructor(config);+ _yuitest_coverline("build/app-base/app-base.js", 212);+this._viewInfoMap[Y.stamp(view, true)] = viewInfo;++ _yuitest_coverline("build/app-base/app-base.js", 214);+return view;+ },++ /**+ Returns the metadata associated with a view instance or view name defined on+ the `views` object.++ @method getViewInfo+ @param {View|String} view View instance, or name of a view defined on the+ `views` object.+ @return {Object} The metadata for the view, or `undefined` if the view is+ not registered.+ @since 3.5.0+ **/+ getViewInfo: function (view) {+ _yuitest_coverfunc("build/app-base/app-base.js", "getViewInfo", 228);+_yuitest_coverline("build/app-base/app-base.js", 229);+if (Lang.isString(view)) {+ _yuitest_coverline("build/app-base/app-base.js", 230);+return this.views[view];+ }++ _yuitest_coverline("build/app-base/app-base.js", 233);+return view && this._viewInfoMap[Y.stamp(view, true)];+ },++ /**+ Navigates to the specified URL if there is a route handler that matches. In+ browsers capable of using HTML5 history or when `serverRouting` is falsy,+ the navigation will be enhanced by firing the `navigate` event and having+ the app handle the "request". When `serverRouting` is `true`, non-HTML5+ browsers will navigate to the new URL via a full page reload.++ When there is a route handler for the specified URL and it is being+ navigated to, this method will return `true`, otherwise it will return+ `false`.++ **Note:** The specified URL _must_ be of the same origin as the current URL,+ otherwise an error will be logged and navigation will not occur. This is+ intended as both a security constraint and a purposely imposed limitation as+ it does not make sense to tell the app to navigate to a URL on a+ different scheme, host, or port.++ @method navigate+ @param {String} url The URL to navigate to. This must be of the same origin+ as the current URL.+ @param {Object} [options] Additional options to configure the navigation.+ These are mixed into the `navigate` event facade.+ @param {Boolean} [options.replace] Whether or not the current history+ entry will be replaced, or a new entry will be created. Will default+ to `true` if the specified `url` is the same as the current URL.+ @param {Boolean} [options.force] Whether the enhanced navigation+ should occur even in browsers without HTML5 history. Will default to+ `true` when `serverRouting` is falsy.+ @see PjaxBase.navigate()+ **/+ // Does not override `navigate()` but does use extra `options`.++ /**+ Renders this application by appending the `viewContainer` node to the+ `container` node if it isn't already a child of the container, and the+ `activeView` will be appended the view container, if it isn't already.++ You should call this method at least once, usually after the initialization+ of your app instance so the proper DOM structure is setup and optionally+ append the container to the DOM if it's not there already.++ You may override this method to customize the app's rendering, but you+ should expect that the `viewContainer`'s contents will be modified by the+ app for the purpose of rendering the `activeView` when it changes.++ @method render+ @chainable+ @see View.render()+ **/+ render: function () {+ _yuitest_coverfunc("build/app-base/app-base.js", "render", 285);+_yuitest_coverline("build/app-base/app-base.js", 286);+var CLASS_NAMES = Y.App.CLASS_NAMES,+ container = this.get('container'),+ viewContainer = this.get('viewContainer'),+ activeView = this.get('activeView'),+ activeViewContainer = activeView && activeView.get('container'),+ areSame = container.compareTo(viewContainer);++ _yuitest_coverline("build/app-base/app-base.js", 293);+container.addClass(CLASS_NAMES.app);+ _yuitest_coverline("build/app-base/app-base.js", 294);+viewContainer.addClass(CLASS_NAMES.views);++ // Prevents needless shuffling around of nodes and maintains DOM order.+ _yuitest_coverline("build/app-base/app-base.js", 297);+if (activeView && !viewContainer.contains(activeViewContainer)) {+ _yuitest_coverline("build/app-base/app-base.js", 298);+viewContainer.appendChild(activeViewContainer);+ }++ // Prevents needless shuffling around of nodes and maintains DOM order.+ _yuitest_coverline("build/app-base/app-base.js", 302);+if (!container.contains(viewContainer) && !areSame) {+ _yuitest_coverline("build/app-base/app-base.js", 303);+container.appendChild(viewContainer);+ }++ _yuitest_coverline("build/app-base/app-base.js", 306);+return this;+ },++ /**+ Sets which view is active/visible for the application. This will set the+ app's `activeView` attribute to the specified `view`.++ The `view` will be "attached" to this app, meaning it will be both rendered+ into this app's `viewContainer` node and all of its events will bubble to+ the app. The previous `activeView` will be "detached" from this app.++ When a string-name is provided for a view which has been registered on this+ app's `views` object, the referenced metadata will be used and the+ `activeView` will be set to either a preserved view instance, or a new+ instance of the registered view will be created using the specified `config`+ object passed-into this method.++ A callback function can be specified as either the third or fourth argument,+ and this function will be called after the new `view` becomes the+ `activeView`, is rendered to the `viewContainer`, and is ready to use.++ @example+ var app = new Y.App({+ views: {+ usersView: {+ // Imagine that `Y.UsersView` has been defined.+ type: Y.UsersView+ }+ },++ users: new Y.ModelList()+ });++ app.route('/users/', function () {+ this.showView('usersView', {users: this.get('users')});+ });++ app.render();+ app.navigate('/uses/'); // => Creates a new `Y.UsersView` and shows it.++ @method showView+ @param {String|View} view The name of a view defined in the `views` object,+ or a view instance which should become this app's `activeView`.+ @param {Object} [config] Optional configuration to use when creating a new+ view instance. This config object can also be used to update an existing+ or preserved view's attributes when `options.update` is `true`.+ @param {Object} [options] Optional object containing any of the following+ properties:+ @param {Function} [options.callback] Optional callback function to call+ after new `activeView` is ready to use, the function will be passed:+ @param {View} options.callback.view A reference to the new+ `activeView`.+ @param {Boolean} [options.prepend=false] Whether the `view` should be+ prepended instead of appended to the `viewContainer`.+ @param {Boolean} [options.render] Whether the `view` should be rendered.+ **Note:** If no value is specified, a view instance will only be+ rendered if it's newly created by this method.+ @param {Boolean} [options.update=false] Whether an existing view should+ have its attributes updated by passing the `config` object to its+ `setAttrs()` method. **Note:** This option does not have an effect if+ the `view` instance is created as a result of calling this method.+ @param {Function} [callback] Optional callback Function to call after the+ new `activeView` is ready to use. **Note:** this will override+ `options.callback` and it can be specified as either the third or fourth+ argument. The function will be passed the following:+ @param {View} callback.view A reference to the new `activeView`.+ @chainable+ @since 3.5.0+ **/+ showView: function (view, config, options, callback) {+ _yuitest_coverfunc("build/app-base/app-base.js", "showView", 375);+_yuitest_coverline("build/app-base/app-base.js", 376);+var viewInfo, created;++ _yuitest_coverline("build/app-base/app-base.js", 378);+options || (options = {});++ // Support the callback function being either the third or fourth arg.+ _yuitest_coverline("build/app-base/app-base.js", 381);+if (callback) {+ _yuitest_coverline("build/app-base/app-base.js", 382);+options = Y.merge(options, {callback: callback});+ } else {_yuitest_coverline("build/app-base/app-base.js", 383);+if (Lang.isFunction(options)) {+ _yuitest_coverline("build/app-base/app-base.js", 384);+options = {callback: options};+ }}++ _yuitest_coverline("build/app-base/app-base.js", 387);+if (Lang.isString(view)) {+ _yuitest_coverline("build/app-base/app-base.js", 388);+viewInfo = this.getViewInfo(view);++ // Use the preserved view instance, or create a new view.+ // TODO: Maybe we can remove the strict check for `preserve` and+ // assume we'll use a View instance if it is there, and just check+ // `preserve` when detaching?+ _yuitest_coverline("build/app-base/app-base.js", 394);+if (viewInfo && viewInfo.preserve && viewInfo.instance) {+ _yuitest_coverline("build/app-base/app-base.js", 395);+view = viewInfo.instance;++ // Make sure there's a mapping back to the view metadata.+ _yuitest_coverline("build/app-base/app-base.js", 398);+this._viewInfoMap[Y.stamp(view, true)] = viewInfo;+ } else {+ // TODO: Add the app as a bubble target during construction, but+ // make sure to check that it isn't already in `bubbleTargets`!+ // This will allow the app to be notified for about _all_ of the+ // view's events. **Note:** This should _only_ happen if the+ // view is created _after_ `activeViewChange`.++ _yuitest_coverline("build/app-base/app-base.js", 406);+view = this.createView(view, config);+ _yuitest_coverline("build/app-base/app-base.js", 407);+created = true;+ }+ }++ // Update the specified or preserved `view` when signaled to do so.+ // There's no need to updated a view if it was _just_ created.+ _yuitest_coverline("build/app-base/app-base.js", 413);+if (options.update && !created) {+ _yuitest_coverline("build/app-base/app-base.js", 414);+view.setAttrs(config);+ }++ // TODO: Hold off on rendering the view until after it has been+ // "attached", and move the call to render into `_attachView()`.++ // When a value is specified for `options.render`, prefer it because it+ // represents the developer's intent. When no value is specified, the+ // `view` will only be rendered if it was just created.+ _yuitest_coverline("build/app-base/app-base.js", 423);+if ('render' in options) {+ _yuitest_coverline("build/app-base/app-base.js", 424);+if (options.render) {+ _yuitest_coverline("build/app-base/app-base.js", 425);+view.render();+ }+ } else {_yuitest_coverline("build/app-base/app-base.js", 427);+if (created) {+ _yuitest_coverline("build/app-base/app-base.js", 428);+view.render();+ }}++ _yuitest_coverline("build/app-base/app-base.js", 431);+return this._set('activeView', view, {options: options});+ },++ // -- Protected Methods ----------------------------------------------------++ /**+ Helper method to attach the view instance to the application by making the+ app a bubble target of the view, append the view to the `viewContainer`, and+ assign it to the `instance` property of the associated view info metadata.++ @method _attachView+ @param {View} view View to attach.+ @param {Boolean} prepend=false Whether the view should be prepended instead+ of appended to the `viewContainer`.+ @protected+ @since 3.5.0+ **/+ _attachView: function (view, prepend) {+ _yuitest_coverfunc("build/app-base/app-base.js", "_attachView", 448);+_yuitest_coverline("build/app-base/app-base.js", 449);+if (!view) {+ _yuitest_coverline("build/app-base/app-base.js", 450);+return;+ }++ _yuitest_coverline("build/app-base/app-base.js", 453);+var viewInfo = this.getViewInfo(view),+ viewContainer = this.get('viewContainer');++ // Bubble the view's events to this app.+ _yuitest_coverline("build/app-base/app-base.js", 457);+view.addTarget(this);++ // Save the view instance in the `views` registry.+ _yuitest_coverline("build/app-base/app-base.js", 460);+if (viewInfo) {+ _yuitest_coverline("build/app-base/app-base.js", 461);+viewInfo.instance = view;+ }++ // TODO: Attach events here for persevered Views?+ // See related TODO in `_detachView`.++ // TODO: Actually render the view here so that it gets "attached" before+ // it gets rendered?++ // Insert view into the DOM.+ _yuitest_coverline("build/app-base/app-base.js", 471);+viewContainer[prepend ? 'prepend' : 'append'](view.get('container'));+ },++ /**+ Overrides View's container destruction to deal with the `viewContainer` and+ checks to make sure not to remove and purge the `<body>`.++ @method _destroyContainer+ @protected+ @see View._destroyContainer()+ **/+ _destroyContainer: function () {+ _yuitest_coverfunc("build/app-base/app-base.js", "_destroyContainer", 482);+_yuitest_coverline("build/app-base/app-base.js", 483);+var CLASS_NAMES = Y.App.CLASS_NAMES,+ container = this.get('container'),+ viewContainer = this.get('viewContainer'),+ areSame = container.compareTo(viewContainer);++ // We do not want to remove or destroy the `<body>`.+ _yuitest_coverline("build/app-base/app-base.js", 489);+if (Y.one('body').compareTo(container)) {+ // Just clean-up our events listeners.+ _yuitest_coverline("build/app-base/app-base.js", 491);+this.detachEvents();++ // Clean-up `yui3-app` CSS class on the `container`.+ _yuitest_coverline("build/app-base/app-base.js", 494);+container.removeClass(CLASS_NAMES.app);++ _yuitest_coverline("build/app-base/app-base.js", 496);+if (areSame) {+ // Clean-up `yui3-app-views` CSS class on the `container`.+ _yuitest_coverline("build/app-base/app-base.js", 498);+container.removeClass(CLASS_NAMES.views);+ } else {+ // Destroy and purge the `viewContainer`.+ _yuitest_coverline("build/app-base/app-base.js", 501);+viewContainer.remove(true);+ }++ _yuitest_coverline("build/app-base/app-base.js", 504);+return;+ }++ // Remove and purge events from both containers.++ _yuitest_coverline("build/app-base/app-base.js", 509);+viewContainer.remove(true);++ _yuitest_coverline("build/app-base/app-base.js", 511);+if (!areSame) {+ _yuitest_coverline("build/app-base/app-base.js", 512);+container.remove(true);+ }+ },++ /**+ Helper method to detach the view instance from the application by removing+ the application as a bubble target of the view, and either just removing the+ view if it is intended to be preserved, or destroying the instance+ completely.++ @method _detachView+ @param {View} view View to detach.+ @protected+ @since 3.5.0+ **/+ _detachView: function (view) {+ _yuitest_coverfunc("build/app-base/app-base.js", "_detachView", 527);+_yuitest_coverline("build/app-base/app-base.js", 528);+if (!view) {+ _yuitest_coverline("build/app-base/app-base.js", 529);+return;+ }++ _yuitest_coverline("build/app-base/app-base.js", 532);+var viewInfo = this.getViewInfo(view) || {};++ _yuitest_coverline("build/app-base/app-base.js", 534);+if (viewInfo.preserve) {+ _yuitest_coverline("build/app-base/app-base.js", 535);+view.remove();+ // TODO: Detach events here for preserved Views? It is possible that+ // some event subscriptions are made on elements other than the+ // View's `container`.+ } else {+ _yuitest_coverline("build/app-base/app-base.js", 540);+view.destroy({remove: true});++ // TODO: The following should probably happen automagically from+ // `destroy()` being called! Possibly `removeTarget()` as well.++ // Remove from view to view-info map.+ _yuitest_coverline("build/app-base/app-base.js", 546);+delete this._viewInfoMap[Y.stamp(view, true)];++ // Remove from view-info instance property.+ _yuitest_coverline("build/app-base/app-base.js", 549);+if (view === viewInfo.instance) {+ _yuitest_coverline("build/app-base/app-base.js", 550);+delete viewInfo.instance;+ }+ }++ _yuitest_coverline("build/app-base/app-base.js", 554);+view.removeTarget(this);+ },++ /**+ Getter for the `viewContainer` attribute.++ @method _getViewContainer+ @param {Node|null} value Current attribute value.+ @return {Node} View container node.+ @protected+ @since 3.5.0+ **/+ _getViewContainer: function (value) {+ // This wackiness is necessary to enable fully lazy creation of the+ // container node both when no container is specified and when one is+ // specified via a valueFn.++ _yuitest_coverfunc("build/app-base/app-base.js", "_getViewContainer", 566);+_yuitest_coverline("build/app-base/app-base.js", 571);+if (!value && !this._viewContainer) {+ // Create a default container and set that as the new attribute+ // value. The `this._viewContainer` property prevents infinite+ // recursion.+ _yuitest_coverline("build/app-base/app-base.js", 575);+value = this._viewContainer = this.create();+ _yuitest_coverline("build/app-base/app-base.js", 576);+this._set('viewContainer', value);+ }++ _yuitest_coverline("build/app-base/app-base.js", 579);+return value;+ },++ /**+ Provides the default value for the `html5` attribute.++ The value returned is dependent on the value of the `serverRouting`+ attribute. When `serverRouting` is explicit set to `false` (not just falsy),+ the default value for `html5` will be set to `false` for *all* browsers.++ When `serverRouting` is `true` or `undefined` the returned value will be+ dependent on the browser's capability of using HTML5 history.++ @method _initHtml5+ @return {Boolean} Whether or not HTML5 history should be used.+ @protected+ @since 3.5.0+ **/+ _initHtml5: function () {+ // When `serverRouting` is explicitly set to `false` (not just falsy),+ // forcing hash-based URLs in all browsers.+ _yuitest_coverfunc("build/app-base/app-base.js", "_initHtml5", 597);+_yuitest_coverline("build/app-base/app-base.js", 600);+if (this.get('serverRouting') === false) {+ _yuitest_coverline("build/app-base/app-base.js", 601);+return false;+ }++ // Defaults to whether or not the browser supports HTML5 history.+ _yuitest_coverline("build/app-base/app-base.js", 605);+return Router.html5;+ },++ /**+ Determines if the specified `view` is configured as a child of the specified+ `parent` view. This requires both views to be either named-views, or view+ instances created using configuration data that exists in the `views`+ object, e.g. created by the `createView()` or `showView()` method.++ @method _isChildView+ @param {View|String} view The name of a view defined in the `views` object,+ or a view instance.+ @param {View|String} parent The name of a view defined in the `views`+ object, or a view instance.+ @return {Boolean} Whether the view is configured as a child of the parent.+ @protected+ @since 3.5.0+ **/+ _isChildView: function (view, parent) {+ _yuitest_coverfunc("build/app-base/app-base.js", "_isChildView", 623);+_yuitest_coverline("build/app-base/app-base.js", 624);+var viewInfo = this.getViewInfo(view),+ parentInfo = this.getViewInfo(parent);++ _yuitest_coverline("build/app-base/app-base.js", 627);+if (viewInfo && parentInfo) {+ _yuitest_coverline("build/app-base/app-base.js", 628);+return this.getViewInfo(viewInfo.parent) === parentInfo;+ }++ _yuitest_coverline("build/app-base/app-base.js", 631);+return false;+ },++ /**+ Determines if the specified `view` is configured as the parent of the+ specified `child` view. This requires both views to be either named-views,+ or view instances created using configuration data that exists in the+ `views` object, e.g. created by the `createView()` or `showView()` method.++ @method _isParentView+ @param {View|String} view The name of a view defined in the `views` object,+ or a view instance.+ @param {View|String} parent The name of a view defined in the `views`+ object, or a view instance.+ @return {Boolean} Whether the view is configured as the parent of the child.+ @protected+ @since 3.5.0+ **/+ _isParentView: function (view, child) {+ _yuitest_coverfunc("build/app-base/app-base.js", "_isParentView", 649);+_yuitest_coverline("build/app-base/app-base.js", 650);+var viewInfo = this.getViewInfo(view),+ childInfo = this.getViewInfo(child);++ _yuitest_coverline("build/app-base/app-base.js", 653);+if (viewInfo && childInfo) {+ _yuitest_coverline("build/app-base/app-base.js", 654);+return this.getViewInfo(childInfo.parent) === viewInfo;+ }++ _yuitest_coverline("build/app-base/app-base.js", 657);+return false;+ },++ /**+ Underlying implementation for `navigate()`.++ @method _navigate+ @param {String} url The fully-resolved URL that the app should dispatch to+ its route handlers to fulfill the enhanced navigation "request", or use to+ update `window.location` in non-HTML5 history capable browsers when+ `serverRouting` is `true`.+ @param {Object} [options] Additional options to configure the navigation.+ These are mixed into the `navigate` event facade.+ @param {Boolean} [options.replace] Whether or not the current history+ entry will be replaced, or a new entry will be created. Will default+ to `true` if the specified `url` is the same as the current URL.+ @param {Boolean} [options.force] Whether the enhanced navigation+ should occur even in browsers without HTML5 history. Will default to+ `true` when `serverRouting` is falsy.+ @protected+ @see PjaxBase._navigate()+ **/+ _navigate: function (url, options) {+ _yuitest_coverfunc("build/app-base/app-base.js", "_navigate", 679);+_yuitest_coverline("build/app-base/app-base.js", 680);+if (!this.get('serverRouting')) {+ // Force navigation to be enhanced and handled by the app when+ // `serverRouting` is falsy because the server might not be able to+ // properly handle the request.+ _yuitest_coverline("build/app-base/app-base.js", 684);+options = Y.merge({force: true}, options);+ }++ _yuitest_coverline("build/app-base/app-base.js", 687);+return PjaxBase.prototype._navigate.call(this, url, options);+ },++ /**+ Will either save a history entry using `pushState()` or the location hash,+ or gracefully-degrade to sending a request to the server causing a full-page+ reload.++ Overrides Router's `_save()` method to preform graceful-degradation when the+ app's `serverRouting` is `true` and `html5` is `false` by updating the full+ URL via standard assignment to `window.location` or by calling+ `window.location.replace()`; both of which will cause a request to the+ server resulting in a full-page reload.++ Otherwise this will just delegate off to Router's `_save()` method allowing+ the client-side enhanced routing to occur.++ @method _save+ @param {String} [url] URL for the history entry.+ @param {Boolean} [replace=false] If `true`, the current history entry will+ be replaced instead of a new one being added.+ @chainable+ @protected+ @see Router._save()+ **/+ _save: function (url, replace) {+ _yuitest_coverfunc("build/app-base/app-base.js", "_save", 712);+_yuitest_coverline("build/app-base/app-base.js", 713);+var path;++ // Forces full-path URLs to always be used by modifying+ // `window.location` in non-HTML5 history capable browsers.+ _yuitest_coverline("build/app-base/app-base.js", 717);+if (this.get('serverRouting') && !this.get('html5')) {+ // Perform same-origin check on the specified URL.+ _yuitest_coverline("build/app-base/app-base.js", 719);+if (!this._hasSameOrigin(url)) {+ _yuitest_coverline("build/app-base/app-base.js", 720);+Y.error('Security error: The new URL must be of the same origin as the current URL.');+ _yuitest_coverline("build/app-base/app-base.js", 721);+return this;+ }++ // Either replace the current history entry or create a new one+ // while navigating to the `url`.+ _yuitest_coverline("build/app-base/app-base.js", 726);+if (win) {+ // Results in the URL's full path starting with '/'.+ _yuitest_coverline("build/app-base/app-base.js", 728);+path = this._joinURL(url || '');++ _yuitest_coverline("build/app-base/app-base.js", 730);+if (replace) {+ _yuitest_coverline("build/app-base/app-base.js", 731);+win.location.replace(path);+ } else {+ _yuitest_coverline("build/app-base/app-base.js", 733);+win.location = path;+ }+ }++ _yuitest_coverline("build/app-base/app-base.js", 737);+return this;+ }++ _yuitest_coverline("build/app-base/app-base.js", 740);+return Router.prototype._save.apply(this, arguments);+ },++ /**+ Performs the actual change of this app's `activeView` by attaching the+ `newView` to this app, and detaching the `oldView` from this app using any+ specified `options`.++ The `newView` is attached to the app by rendering it to the `viewContainer`,+ and making this app a bubble target of its events.++ The `oldView` is detached from the app by removing it from the+ `viewContainer`, and removing this app as a bubble target for its events.+ The `oldView` will either be preserved or properly destroyed.++ **Note:** The `activeView` attribute is read-only and can be changed by+ calling the `showView()` method.++ @method _uiSetActiveView+ @param {View} newView The View which is now this app's `activeView`.+ @param {View} [oldView] The View which was this app's `activeView`.+ @param {Object} [options] Optional object containing any of the following+ properties:+ @param {Function} [options.callback] Optional callback function to call+ after new `activeView` is ready to use, the function will be passed:+ @param {View} options.callback.view A reference to the new+ `activeView`.+ @param {Boolean} [options.prepend=false] Whether the `view` should be+ prepended instead of appended to the `viewContainer`.+ @param {Boolean} [options.render] Whether the `view` should be rendered.+ **Note:** If no value is specified, a view instance will only be+ rendered if it's newly created by this method.+ @param {Boolean} [options.update=false] Whether an existing view should+ have its attributes updated by passing the `config` object to its+ `setAttrs()` method. **Note:** This option does not have an effect if+ the `view` instance is created as a result of calling this method.+ @protected+ @since 3.5.0+ **/+ _uiSetActiveView: function (newView, oldView, options) {+ _yuitest_coverfunc("build/app-base/app-base.js", "_uiSetActiveView", 779);+_yuitest_coverline("build/app-base/app-base.js", 780);+options || (options = {});++ _yuitest_coverline("build/app-base/app-base.js", 782);+var callback = options.callback,+ isChild = this._isChildView(newView, oldView),+ isParent = !isChild && this._isParentView(newView, oldView),+ prepend = !!options.prepend || isParent;++ // Prevent detaching (thus removing) the view we want to show. Also hard+ // to animate out and in, the same view.+ _yuitest_coverline("build/app-base/app-base.js", 789);+if (newView === oldView) {+ _yuitest_coverline("build/app-base/app-base.js", 790);+return callback && callback.call(this, newView);+ }++ _yuitest_coverline("build/app-base/app-base.js", 793);+this._attachView(newView, prepend);+ _yuitest_coverline("build/app-base/app-base.js", 794);+this._detachView(oldView);++ _yuitest_coverline("build/app-base/app-base.js", 796);+if (callback) {+ _yuitest_coverline("build/app-base/app-base.js", 797);+callback.call(this, newView);+ }+ },++ // -- Protected Event Handlers ---------------------------------------------++ /**+ Handles the application's `activeViewChange` event (which is fired when the+ `activeView` attribute changes) by detaching the old view, attaching the new+ view.++ The `activeView` attribute is read-only, so the public API to change its+ value is through the `showView()` method.++ @method _afterActiveViewChange+ @param {EventFacade} e+ @protected+ @since 3.5.0+ **/+ _afterActiveViewChange: function (e) {+ _yuitest_coverfunc("build/app-base/app-base.js", "_afterActiveViewChange", 816);+_yuitest_coverline("build/app-base/app-base.js", 817);+this._uiSetActiveView(e.newVal, e.prevVal, e.options);+ }+}, {+ ATTRS: {+ /**+ The application's active/visible view.++ This attribute is read-only, to set the `activeView` use the+ `showView()` method.++ @attribute activeView+ @type View+ @default null+ @readOnly+ @see App.Base.showView()+ @since 3.5.0+ **/+ activeView: {+ value : null,+ readOnly: true+ },++ /**+ Container node which represents the application's bounding-box, into+ which this app's content will be rendered.++ The container node serves as the host for all DOM events attached by the+ app. Delegation is used to handle events on children of the container,+ allowing the container's contents to be re-rendered at any time without+ losing event subscriptions.++ The default container is the `<body>` Node, but you can override this in+ a subclass, or by passing in a custom `container` config value at+ instantiation time.++ When `container` is overridden by a subclass or passed as a config+ option at instantiation time, it may be provided as a selector string, a+ DOM element, or a `Y.Node` instance. During initialization, this app's+ `create()` method will be called to convert the container into a+ `Y.Node` instance if it isn't one already and stamp it with the CSS+ class: `"yui3-app"`.++ The container is not added to the page automatically. This allows you to+ have full control over how and when your app is actually rendered to+ the page.++ @attribute container+ @type HTMLElement|Node|String+ @default Y.one('body')+ @initOnly+ **/+ container: {+ valueFn: function () {+ _yuitest_coverfunc("build/app-base/app-base.js", "valueFn", 869);+_yuitest_coverline("build/app-base/app-base.js", 870);+return Y.one('body');+ }+ },++ /**+ Whether or not this browser is capable of using HTML5 history.++ This value is dependent on the value of `serverRouting` and will default+ accordingly.++ Setting this to `false` will force the use of hash-based history even on+ HTML5 browsers, but please don't do this unless you understand the+ consequences.++ @attribute html5+ @type Boolean+ @initOnly+ @see serverRouting+ **/+ html5: {+ valueFn: '_initHtml5'+ },++ /**+ CSS selector string used to filter link click events so that only the+ links which match it will have the enhanced-navigation behavior of pjax+ applied.++ When a link is clicked and that link matches this selector, navigating+ to the link's `href` URL using the enhanced, pjax, behavior will be+ attempted; and the browser's default way to navigate to new pages will+ be the fallback.++ By default this selector will match _all_ links on the page.++ @attribute linkSelector+ @type String|Function+ @default "a"+ **/+ linkSelector: {+ value: 'a'+ },++ /**+ Whether or not this application's server is capable of properly routing+ all requests and rendering the initial state in the HTML responses.++ This can have three different values, each having particular+ implications on how the app will handle routing and navigation:++ * `undefined`: The best form of URLs will be chosen based on the+ capabilities of the browser. Given no information about the server+ environmentm a balanced approach to routing and navigation is+ chosen.++ The server should be capable of handling full-path requests, since+ full-URLs will be generated by browsers using HTML5 history. If this+ is a client-side-only app the server could handle full-URL requests+ by sending a redirect back to the root with a hash-based URL, e.g:++ Request: http://example.com/users/1+ Redirect to: http://example.com/#/users/1++ * `true`: The server is *fully* capable of properly handling requests+ to all full-path URLs the app can produce.++ This is the best option for progressive-enhancement because it will+ cause **all URLs to always have full-paths**, which means the server+ will be able to accurately handle all URLs this app produces. e.g.++ http://example.com/users/1++ To meet this strict full-URL requirement, browsers which are not+ capable of using HTML5 history will make requests to the server+ resulting in full-page reloads.++ * `false`: The server is *not* capable of properly handling requests+ to all full-path URLs the app can produce, therefore all routing+ will be handled by this App instance.++ Be aware that this will cause **all URLs to always be hash-based**,+ even in browsers that are capable of using HTML5 history. e.g.++ http://example.com/#/users/1++ A single-page or client-side-only app where the server sends a+ "shell" page with JavaScript to the client might have this+ restriction. If you're setting this to `false`, read the following:++ **Note:** When this is set to `false`, the server will *never* receive+ the full URL because browsers do not send the fragment-part to the+ server, that is everything after and including the "#".++ Consider the following example:++ URL shown in browser: http://example.com/#/users/1+ URL sent to server: http://example.com/++ You should feel bad about hurting our precious web if you forcefully set+ either `serverRouting` or `html5` to `false`, because you're basically+ punching the web in the face here with your lossy URLs! Please make sure+ you know what you're doing and that you understand the implications.++ Ideally you should always prefer full-path URLs (not /#/foo/), and want+ full-page reloads when the client's browser is not capable of enhancing+ the experience using the HTML5 history APIs. Setting this to `true` is+ the best option for progressive-enhancement (and graceful-degradation).++ @attribute serverRouting+ @type Boolean+ @default undefined+ @initOnly+ @since 3.5.0+ **/+ serverRouting: {+ valueFn : function () { _yuitest_coverfunc("build/app-base/app-base.js", "valueFn", 985);+_yuitest_coverline("build/app-base/app-base.js", 985);+return Y.App.serverRouting; },+ writeOnce: 'initOnly'+ },++ /**+ The node into which this app's `views` will be rendered when they become+ the `activeView`.++ The view container node serves as the container to hold the app's+ `activeView`. Each time the `activeView` is set via `showView()`, the+ previous view will be removed from this node, and the new active view's+ `container` node will be appended.++ The default view container is a `<div>` Node, but you can override this+ in a subclass, or by passing in a custom `viewContainer` config value at+ instantiation time. The `viewContainer` may be provided as a selector+ string, DOM element, or a `Y.Node` instance (having the `viewContainer`+ and the `container` be the same node is also supported).++ The app's `render()` method will stamp the view container with the CSS+ class `"yui3-app-views"` and append it to the app's `container` node if+ it isn't already, and any `activeView` will be appended to this node if+ it isn't already.++ @attribute viewContainer+ @type HTMLElement|Node|String+ @default Y.Node.create(this.containerTemplate)+ @initOnly+ @since 3.5.0+ **/+ viewContainer: {+ getter : '_getViewContainer',+ setter : Y.one,+ writeOnce: true+ }+ },++ /**+ Properties that shouldn't be turned into ad-hoc attributes when passed to+ App's constructor.++ @property _NON_ATTRS_CFG+ @type Array+ @static+ @protected+ @since 3.5.0+ **/+ _NON_ATTRS_CFG: ['views']+});++// -- Namespace ----------------------------------------------------------------+_yuitest_coverline("build/app-base/app-base.js", 1036);+Y.namespace('App').Base = AppBase;++/**+Provides a top-level application component which manages navigation and views.++This gives you a foundation and structure on which to build your application; it+combines robust URL navigation with powerful routing and flexible view+management.++`Y.App` is both a namespace and constructor function. The `Y.App` class is+special in that any `Y.App` class extensions that are included in the YUI+instance will be **auto-mixed** on to the `Y.App` class. Consider this example:++ YUI().use('app-base', 'app-transitions', function (Y) {+ // This will create two YUI Apps, `basicApp` will not have transitions,+ // but `fancyApp` will have transitions support included and turn it on.+ var basicApp = new Y.App.Base(),+ fancyApp = new Y.App({transitions: true});+ });++@class App+@param {Object} [config] The following are configuration properties that can be+ specified _in addition_ to default attribute values and the non-attribute+ properties provided by `Y.Base`:+ @param {Object} [config.views] Hash of view-name to metadata used to+ declaratively describe an application's views and their relationship with+ the app and other views. The views specified here will override any defaults+ provided by the `views` object on the `prototype`.+@constructor+@extends App.Base+@uses App.Content+@uses App.Transitions+@uses PjaxContent+@since 3.5.0+**/+_yuitest_coverline("build/app-base/app-base.js", 1071);+Y.App = Y.mix(Y.Base.create('app', AppBase, []), Y.App, true);++/**+CSS classes used by `Y.App`.++@property CLASS_NAMES+@type Object+@default {}+@static+@since 3.6.0+**/+_yuitest_coverline("build/app-base/app-base.js", 1082);+Y.App.CLASS_NAMES = {+ app : getClassName('app'),+ views: getClassName('app', 'views')+};++/**+Default `serverRouting` attribute value for all apps.++@property serverRouting+@type Boolean+@default undefined+@static+@since 3.6.0+**/+++}, '3.7.1', {"requires": ["classnamemanager", "pjax-base", "router", "view"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('app-base', function(Y) {+YUI.add('app-base', function (Y, NAME) { /** The App Framework provides simple MVC-like building blocks (models, model lists,@@ -54,7 +54,7 @@ win = Y.config.win, - App;+ AppBase; /** Provides a top-level application component which manages navigation and views.@@ -78,7 +78,7 @@ @uses PjaxBase @since 3.5.0 **/-App = Y.Base.create('app', Y.Base, [View, Router, PjaxBase], {+AppBase = Y.Base.create('app', Y.Base, [View, Router, PjaxBase], { // -- Public Properties ---------------------------------------------------- /**@@ -289,14 +289,15 @@ @see View.render() **/ render: function () {- var container = this.get('container'),+ var CLASS_NAMES = Y.App.CLASS_NAMES,+ container = this.get('container'), viewContainer = this.get('viewContainer'), activeView = this.get('activeView'), activeViewContainer = activeView && activeView.get('container'), areSame = container.compareTo(viewContainer); - container.addClass(App.CSS_CLASS);- viewContainer.addClass(App.VIEWS_CSS_CLASS);+ container.addClass(CLASS_NAMES.app);+ viewContainer.addClass(CLASS_NAMES.views); // Prevents needless shuffling around of nodes and maintains DOM order. if (activeView && !viewContainer.contains(activeViewContainer)) {@@ -384,7 +385,7 @@ // Support the callback function being either the third or fourth arg. if (callback) {- options.callback = callback;+ options = Y.merge(options, {callback: callback}); } else if (Lang.isFunction(options)) { options = {callback: options}; }@@ -426,7 +427,9 @@ // represents the developer's intent. When no value is specified, the // `view` will only be rendered if it was just created. if ('render' in options) {- options.render && view.render();+ if (options.render) {+ view.render();+ } } else if (created) { view.render(); }@@ -456,9 +459,14 @@ var viewInfo = this.getViewInfo(view), viewContainer = this.get('viewContainer'); + // Bubble the view's events to this app. view.addTarget(this);- viewInfo && (viewInfo.instance = view); + // Save the view instance in the `views` registry.+ if (viewInfo) {+ viewInfo.instance = view;+ }+ // TODO: Attach events here for persevered Views? // See related TODO in `_detachView`. @@ -478,7 +486,8 @@ @see View._destroyContainer() **/ _destroyContainer: function () {- var container = this.get('container'),+ var CLASS_NAMES = Y.App.CLASS_NAMES,+ container = this.get('container'), viewContainer = this.get('viewContainer'), areSame = container.compareTo(viewContainer); @@ -488,22 +497,26 @@ this.detachEvents(); // Clean-up `yui3-app` CSS class on the `container`.- container && container.removeClass(App.CSS_CLASS);+ container.removeClass(CLASS_NAMES.app); if (areSame) { // Clean-up `yui3-app-views` CSS class on the `container`.- container && container.removeClass(App.VIEWS_CSS_CLASS);+ container.removeClass(CLASS_NAMES.views); } else { // Destroy and purge the `viewContainer`.- viewContainer && viewContainer.remove(true);+ viewContainer.remove(true); } return; } // Remove and purge events from both containers.- viewContainer && viewContainer.remove(true);- !areSame && container && container.remove(true);++ viewContainer.remove(true);++ if (!areSame) {+ container.remove(true);+ } }, /**@@ -573,20 +586,6 @@ }, /**- Gets the current full URL. When `html5` is false, the URL will first be- upgraded before it's returned.-- @method _getURL- @return {String} URL.- @protected- @see Router._getURL()- **/- _getURL: function () {- var url = Y.getLocation().toString();- return this._html5 ? url : this._upgradeURL(url);- },-- /** Provides the default value for the `html5` attribute. The value returned is dependent on the value of the `serverRouting`@@ -606,9 +605,10 @@ // forcing hash-based URLs in all browsers. if (this.get('serverRouting') === false) { return false;- } else {- return Router.html5; }++ // Defaults to whether or not the browser supports HTML5 history.+ return Router.html5; }, /**@@ -683,15 +683,11 @@ @see PjaxBase._navigate() **/ _navigate: function (url, options) {- url = this._upgradeURL(url);-- options || (options = {});- if (!this.get('serverRouting')) { // Force navigation to be enhanced and handled by the app when // `serverRouting` is falsy because the server might not be able to // properly handle the request.- 'force' in options || (options.force = true);+ options = Y.merge({force: true}, options); } return PjaxBase.prototype._navigate.call(this, url, options);@@ -720,6 +716,8 @@ @see Router._save() **/ _save: function (url, replace) {+ var path;+ // Forces full-path URLs to always be used by modifying // `window.location` in non-HTML5 history capable browsers. if (this.get('serverRouting') && !this.get('html5')) {@@ -729,15 +727,17 @@ return this; } - // Results in the URL's full path starting with '/'.- url = this._joinURL(url || '');- // Either replace the current history entry or create a new one // while navigating to the `url`.- if (replace) {- win && win.location.replace(url);- } else {- win && (win.location = url);+ if (win) {+ // Results in the URL's full path starting with '/'.+ path = this._joinURL(url || '');++ if (replace) {+ win.location.replace(path);+ } else {+ win.location = path;+ } } return this;@@ -799,48 +799,9 @@ this._attachView(newView, prepend); this._detachView(oldView); - callback && callback.call(this, newView);- },-- /**- Upgrades a hash-based URL to a full-path URL, if necessary.-- The specified `url` will be upgraded if its of the same origin as the- current URL and has a path-like hash. URLs that don't need upgrading will be- returned as-is.-- @example- app._upgradeURL('http://example.com/#/foo/'); // => 'http://example.com/foo/';-- @method _upgradeURL- @param {String} url The URL to upgrade from hash-based to full-path.- @return {String} The upgraded URL, or the specified URL untouched.- @protected- @since 3.5.0- **/- _upgradeURL: function (url) {- // We should not try to upgrade paths for external URLs.- if (!this._hasSameOrigin(url)) {- return url;- }-- // TODO: Should the `root` be removed first, and the hash only- // considered if in the form of '/#/'?- var hash = (url.match(/#(.*)$/) || [])[1] || '',- hashPrefix = Y.HistoryHash.hashPrefix;-- // Strip any hash prefix, like hash-bangs.- if (hashPrefix && hash.indexOf(hashPrefix) === 0) {- hash = hash.replace(hashPrefix, '');- }-- // If the hash looks like a URL path, assume it is, and upgrade it!- if (hash && hash.charAt(0) === '/') {- // Re-join with configured `root` before resolving.- url = this._resolveURL(this._joinURL(hash));+ if (callback) {+ callback.call(this, newView); }-- return url; }, // -- Protected Event Handlers ---------------------------------------------@@ -1027,7 +988,7 @@ @since 3.5.0 **/ serverRouting: {- value : undefined,+ valueFn : function () { return Y.App.serverRouting; }, writeOnce: 'initOnly' }, @@ -1064,32 +1025,7 @@ } }, - // TODO: Should these go on the `prototype`?- // TODO: These should also just go in a `CLASS_NAMES` object.- /**- CSS class added to an app's `container` node.-- @property CSS_CLASS- @type String- @default "yui3-app"- @static- @since 3.5.0- **/- CSS_CLASS: getClassName('app'),-- /**- CSS class added to an app's `viewContainer` node.-- @property VIEWS_CSS_CLASS- @type String- @default "yui3-app-views"- @static- @since 3.5.0- **/- VIEWS_CSS_CLASS: getClassName('app', 'views'),-- /** Properties that shouldn't be turned into ad-hoc attributes when passed to App's constructor. @@ -1103,7 +1039,7 @@ }); // -- Namespace -----------------------------------------------------------------Y.namespace('App').Base = App;+Y.namespace('App').Base = AppBase; /** Provides a top-level application component which manages navigation and views.@@ -1133,10 +1069,36 @@ provided by the `views` object on the `prototype`. @constructor @extends App.Base+@uses App.Content @uses App.Transitions+@uses PjaxContent @since 3.5.0 **/-Y.App = Y.mix(Y.Base.create('app', Y.App.Base, []), Y.App, true);+Y.App = Y.mix(Y.Base.create('app', AppBase, []), Y.App, true); +/**+CSS classes used by `Y.App`. -}, '3.5.1' ,{requires:['classnamemanager', 'pjax-base', 'router', 'view']});+@property CLASS_NAMES+@type Object+@default {}+@static+@since 3.6.0+**/+Y.App.CLASS_NAMES = {+ app : getClassName('app'),+ views: getClassName('app', 'views')+};++/**+Default `serverRouting` attribute value for all apps.++@property serverRouting+@type Boolean+@default undefined+@static+@since 3.6.0+**/+++}, '3.7.1', {"requires": ["classnamemanager", "pjax-base", "router", "view"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("app-base",function(c){var g=c.Lang,i=c.Object,a=c.PjaxBase,d=c.Router,b=c.View,e=c.ClassNameManager.getClassName,h=c.config.win,f;f=c.Base.create("app",c.Base,[b,d,a],{views:{},initializer:function(k){k||(k={});var j={};function l(m,n){j[n]=c.merge(j[n],m);}i.each(this.views,l);i.each(k.views,l);this.views=j;this._viewInfoMap={};this.after("activeViewChange",c.bind("_afterActiveViewChange",this));if(!this.get("serverRouting")){this._pjaxBindUI();}},createView:function(m,l){var k=this.getViewInfo(m),n=(k&&k.type)||b,o,j;o=g.isString(n)?i.getValue(c,n.split(".")):n;j=new o(l);this._viewInfoMap[c.stamp(j,true)]=k;return j;},getViewInfo:function(j){if(g.isString(j)){return this.views[j];}return j&&this._viewInfoMap[c.stamp(j,true)];},render:function(){var k=this.get("container"),j=this.get("viewContainer"),l=this.get("activeView"),n=l&&l.get("container"),m=k.compareTo(j);k.addClass(f.CSS_CLASS);j.addClass(f.VIEWS_CSS_CLASS);if(l&&!j.contains(n)){j.appendChild(n);}if(!k.contains(j)&&!m){k.appendChild(j);}return this;},showView:function(j,m,l,o){var k,n;l||(l={});if(o){l.callback=o;}else{if(g.isFunction(l)){l={callback:l};}}if(g.isString(j)){k=this.getViewInfo(j);if(k&&k.preserve&&k.instance){j=k.instance;this._viewInfoMap[c.stamp(j,true)]=k;}else{j=this.createView(j,m);n=true;}}if(l.update&&!n){j.setAttrs(m);}if("render" in l){l.render&&j.render();}else{if(n){j.render();}}return this._set("activeView",j,{options:l});},_attachView:function(k,l){if(!k){return;}var m=this.getViewInfo(k),j=this.get("viewContainer");k.addTarget(this);m&&(m.instance=k);j[l?"prepend":"append"](k.get("container"));},_destroyContainer:function(){var k=this.get("container"),j=this.get("viewContainer"),l=k.compareTo(j);if(c.one("body").compareTo(k)){this.detachEvents();k&&k.removeClass(f.CSS_CLASS);if(l){k&&k.removeClass(f.VIEWS_CSS_CLASS);}else{j&&j.remove(true);}return;}j&&j.remove(true);!l&&k&&k.remove(true);},_detachView:function(j){if(!j){return;}var k=this.getViewInfo(j)||{};if(k.preserve){j.remove();}else{j.destroy({remove:true});delete this._viewInfoMap[c.stamp(j,true)];if(j===k.instance){delete k.instance;}}j.removeTarget(this);},_getViewContainer:function(j){if(!j&&!this._viewContainer){j=this._viewContainer=this.create();this._set("viewContainer",j);}return j;},_getURL:function(){var j=c.getLocation().toString();return this._html5?j:this._upgradeURL(j);},_initHtml5:function(){if(this.get("serverRouting")===false){return false;}else{return d.html5;}},_isChildView:function(j,m){var l=this.getViewInfo(j),k=this.getViewInfo(m);if(l&&k){return this.getViewInfo(l.parent)===k;}return false;},_isParentView:function(j,m){var k=this.getViewInfo(j),l=this.getViewInfo(m);if(k&&l){return this.getViewInfo(l.parent)===k;}return false;},_navigate:function(k,j){k=this._upgradeURL(k);j||(j={});if(!this.get("serverRouting")){"force" in j||(j.force=true);}return a.prototype._navigate.call(this,k,j);},_save:function(j,k){if(this.get("serverRouting")&&!this.get("html5")){if(!this._hasSameOrigin(j)){c.error("Security error: The new URL must be of the same origin as the current URL.");return this;}j=this._joinURL(j||"");if(k){h&&h.location.replace(j);}else{h&&(h.location=j);}return this;}return d.prototype._save.apply(this,arguments);},_uiSetActiveView:function(p,n,m){m||(m={});var o=m.callback,j=this._isChildView(p,n),l=!j&&this._isParentView(p,n),k=!!m.prepend||l;if(p===n){return o&&o.call(this,p);}this._attachView(p,k);this._detachView(n);o&&o.call(this,p);},_upgradeURL:function(k){if(!this._hasSameOrigin(k)){return k;}var l=(k.match(/#(.*)$/)||[])[1]||"",j=c.HistoryHash.hashPrefix;if(j&&l.indexOf(j)===0){l=l.replace(j,"");}if(l&&l.charAt(0)==="/"){k=this._resolveURL(this._joinURL(l));}return k;},_afterActiveViewChange:function(j){this._uiSetActiveView(j.newVal,j.prevVal,j.options);}},{ATTRS:{activeView:{value:null,readOnly:true},container:{valueFn:function(){return c.one("body");}},html5:{valueFn:"_initHtml5"},linkSelector:{value:"a"},serverRouting:{value:undefined,writeOnce:"initOnly"},viewContainer:{getter:"_getViewContainer",setter:c.one,writeOnce:true}},CSS_CLASS:e("app"),VIEWS_CSS_CLASS:e("app","views"),_NON_ATTRS_CFG:["views"]});c.namespace("App").Base=f;c.App=c.mix(c.Base.create("app",c.App.Base,[]),c.App,true);},"3.5.1",{requires:["classnamemanager","pjax-base","router","view"]});+YUI.add("app-base",function(e,t){var n=e.Lang,r=e.Object,i=e.PjaxBase,s=e.Router,o=e.View,u=e.ClassNameManager.getClassName,a=e.config.win,f;f=e.Base.create("app",e.Base,[o,s,i],{views:{},initializer:function(t){function i(t,r){n[r]=e.merge(n[r],t)}t||(t={});var n={};r.each(this.views,i),r.each(t.views,i),this.views=n,this._viewInfoMap={},this.after("activeViewChange",e.bind("_afterActiveViewChange",this)),this.get("serverRouting")||this._pjaxBindUI()},createView:function(t,i){var s=this.getViewInfo(t),u=s&&s.type||o,a,f;return a=n.isString(u)?r.getValue(e,u.split(".")):u,f=new a(i),this._viewInfoMap[e.stamp(f,!0)]=s,f},getViewInfo:function(t){return n.isString(t)?this.views[t]:t&&this._viewInfoMap[e.stamp(t,!0)]},render:function(){var t=e.App.CLASS_NAMES,n=this.get("container"),r=this.get("viewContainer"),i=this.get("activeView"),s=i&&i.get("container"),o=n.compareTo(r);return n.addClass(t.app),r.addClass(t.views),i&&!r.contains(s)&&r.appendChild(s),!n.contains(r)&&!o&&n.appendChild(r),this},showView:function(t,r,i,s){var o,u;return i||(i={}),s?i=e.merge(i,{callback:s}):n.isFunction(i)&&(i={callback:i}),n.isString(t)&&(o=this.getViewInfo(t),o&&o.preserve&&o.instance?(t=o.instance,this._viewInfoMap[e.stamp(t,!0)]=o):(t=this.createView(t,r),u=!0)),i.update&&!u&&t.setAttrs(r),"render"in i?i.render&&t.render():u&&t.render(),this._set("activeView",t,{options:i})},_attachView:function(e,t){if(!e)return;var n=this.getViewInfo(e),r=this.get("viewContainer");e.addTarget(this),n&&(n.instance=e),r[t?"prepend":"append"](e.get("container"))},_destroyContainer:function(){var t=e.App.CLASS_NAMES,n=this.get("container"),r=this.get("viewContainer"),i=n.compareTo(r);if(e.one("body").compareTo(n)){this.detachEvents(),n.removeClass(t.app),i?n.removeClass(t.views):r.remove(!0);return}r.remove(!0),i||n.remove(!0)},_detachView:function(t){if(!t)return;var n=this.getViewInfo(t)||{};n.preserve?t.remove():(t.destroy({remove:!0}),delete this._viewInfoMap[e.stamp(t,!0)],t===n.instance&&delete n.instance),t.removeTarget(this)},_getViewContainer:function(e){return!e&&!this._viewContainer&&(e=this._viewContainer=this.create(),this._set("viewContainer",e)),e},_initHtml5:function(){return this.get("serverRouting")===!1?!1:s.html5},_isChildView:function(e,t){var n=this.getViewInfo(e),r=this.getViewInfo(t);return n&&r?this.getViewInfo(n.parent)===r:!1},_isParentView:function(e,t){var n=this.getViewInfo(e),r=this.getViewInfo(t);return n&&r?this.getViewInfo(r.parent)===n:!1},_navigate:function(t,n){return this.get("serverRouting")||(n=e.merge({force:!0},n)),i.prototype._navigate.call(this,t,n)},_save:function(t,n){var r;return this.get("serverRouting")&&!this.get("html5")?this._hasSameOrigin(t)?(a&&(r=this._joinURL(t||""),n?a.location.replace(r):a.location=r),this):(e.error("Security error: The new URL must be of the same origin as the current URL."),this):s.prototype._save.apply(this,arguments)},_uiSetActiveView:function(e,t,n){n||(n={});var r=n.callback,i=this._isChildView(e,t),s=!i&&this._isParentView(e,t),o=!!n.prepend||s;if(e===t)return r&&r.call(this,e);this._attachView(e,o),this._detachView(t),r&&r.call(this,e)},_afterActiveViewChange:function(e){this._uiSetActiveView(e.newVal,e.prevVal,e.options)}},{ATTRS:{activeView:{value:null,readOnly:!0},container:{valueFn:function(){return e.one("body")}},html5:{valueFn:"_initHtml5"},linkSelector:{value:"a"},serverRouting:{valueFn:function(){return e.App.serverRouting},writeOnce:"initOnly"},viewContainer:{getter:"_getViewContainer",setter:e.one,writeOnce:!0}},_NON_ATTRS_CFG:["views"]}),e.namespace("App").Base=f,e.App=e.mix(e.Base.create("app",f,[]),e.App,!0),e.App.CLASS_NAMES={app:u("app"),views:u("app","views")}},"3.7.1",{requires:["classnamemanager","pjax-base","router","view"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('app-base', function(Y) {+YUI.add('app-base', function (Y, NAME) { /** The App Framework provides simple MVC-like building blocks (models, model lists,@@ -54,7 +54,7 @@ win = Y.config.win, - App;+ AppBase; /** Provides a top-level application component which manages navigation and views.@@ -78,7 +78,7 @@ @uses PjaxBase @since 3.5.0 **/-App = Y.Base.create('app', Y.Base, [View, Router, PjaxBase], {+AppBase = Y.Base.create('app', Y.Base, [View, Router, PjaxBase], { // -- Public Properties ---------------------------------------------------- /**@@ -289,14 +289,15 @@ @see View.render() **/ render: function () {- var container = this.get('container'),+ var CLASS_NAMES = Y.App.CLASS_NAMES,+ container = this.get('container'), viewContainer = this.get('viewContainer'), activeView = this.get('activeView'), activeViewContainer = activeView && activeView.get('container'), areSame = container.compareTo(viewContainer); - container.addClass(App.CSS_CLASS);- viewContainer.addClass(App.VIEWS_CSS_CLASS);+ container.addClass(CLASS_NAMES.app);+ viewContainer.addClass(CLASS_NAMES.views); // Prevents needless shuffling around of nodes and maintains DOM order. if (activeView && !viewContainer.contains(activeViewContainer)) {@@ -384,7 +385,7 @@ // Support the callback function being either the third or fourth arg. if (callback) {- options.callback = callback;+ options = Y.merge(options, {callback: callback}); } else if (Lang.isFunction(options)) { options = {callback: options}; }@@ -426,7 +427,9 @@ // represents the developer's intent. When no value is specified, the // `view` will only be rendered if it was just created. if ('render' in options) {- options.render && view.render();+ if (options.render) {+ view.render();+ } } else if (created) { view.render(); }@@ -456,9 +459,14 @@ var viewInfo = this.getViewInfo(view), viewContainer = this.get('viewContainer'); + // Bubble the view's events to this app. view.addTarget(this);- viewInfo && (viewInfo.instance = view); + // Save the view instance in the `views` registry.+ if (viewInfo) {+ viewInfo.instance = view;+ }+ // TODO: Attach events here for persevered Views? // See related TODO in `_detachView`. @@ -478,7 +486,8 @@ @see View._destroyContainer() **/ _destroyContainer: function () {- var container = this.get('container'),+ var CLASS_NAMES = Y.App.CLASS_NAMES,+ container = this.get('container'), viewContainer = this.get('viewContainer'), areSame = container.compareTo(viewContainer); @@ -488,22 +497,26 @@ this.detachEvents(); // Clean-up `yui3-app` CSS class on the `container`.- container && container.removeClass(App.CSS_CLASS);+ container.removeClass(CLASS_NAMES.app); if (areSame) { // Clean-up `yui3-app-views` CSS class on the `container`.- container && container.removeClass(App.VIEWS_CSS_CLASS);+ container.removeClass(CLASS_NAMES.views); } else { // Destroy and purge the `viewContainer`.- viewContainer && viewContainer.remove(true);+ viewContainer.remove(true); } return; } // Remove and purge events from both containers.- viewContainer && viewContainer.remove(true);- !areSame && container && container.remove(true);++ viewContainer.remove(true);++ if (!areSame) {+ container.remove(true);+ } }, /**@@ -573,20 +586,6 @@ }, /**- Gets the current full URL. When `html5` is false, the URL will first be- upgraded before it's returned.-- @method _getURL- @return {String} URL.- @protected- @see Router._getURL()- **/- _getURL: function () {- var url = Y.getLocation().toString();- return this._html5 ? url : this._upgradeURL(url);- },-- /** Provides the default value for the `html5` attribute. The value returned is dependent on the value of the `serverRouting`@@ -606,9 +605,10 @@ // forcing hash-based URLs in all browsers. if (this.get('serverRouting') === false) { return false;- } else {- return Router.html5; }++ // Defaults to whether or not the browser supports HTML5 history.+ return Router.html5; }, /**@@ -683,15 +683,11 @@ @see PjaxBase._navigate() **/ _navigate: function (url, options) {- url = this._upgradeURL(url);-- options || (options = {});- if (!this.get('serverRouting')) { // Force navigation to be enhanced and handled by the app when // `serverRouting` is falsy because the server might not be able to // properly handle the request.- 'force' in options || (options.force = true);+ options = Y.merge({force: true}, options); } return PjaxBase.prototype._navigate.call(this, url, options);@@ -720,6 +716,8 @@ @see Router._save() **/ _save: function (url, replace) {+ var path;+ // Forces full-path URLs to always be used by modifying // `window.location` in non-HTML5 history capable browsers. if (this.get('serverRouting') && !this.get('html5')) {@@ -729,15 +727,17 @@ return this; } - // Results in the URL's full path starting with '/'.- url = this._joinURL(url || '');- // Either replace the current history entry or create a new one // while navigating to the `url`.- if (replace) {- win && win.location.replace(url);- } else {- win && (win.location = url);+ if (win) {+ // Results in the URL's full path starting with '/'.+ path = this._joinURL(url || '');++ if (replace) {+ win.location.replace(path);+ } else {+ win.location = path;+ } } return this;@@ -799,48 +799,9 @@ this._attachView(newView, prepend); this._detachView(oldView); - callback && callback.call(this, newView);- },-- /**- Upgrades a hash-based URL to a full-path URL, if necessary.-- The specified `url` will be upgraded if its of the same origin as the- current URL and has a path-like hash. URLs that don't need upgrading will be- returned as-is.-- @example- app._upgradeURL('http://example.com/#/foo/'); // => 'http://example.com/foo/';-- @method _upgradeURL- @param {String} url The URL to upgrade from hash-based to full-path.- @return {String} The upgraded URL, or the specified URL untouched.- @protected- @since 3.5.0- **/- _upgradeURL: function (url) {- // We should not try to upgrade paths for external URLs.- if (!this._hasSameOrigin(url)) {- return url;- }-- // TODO: Should the `root` be removed first, and the hash only- // considered if in the form of '/#/'?- var hash = (url.match(/#(.*)$/) || [])[1] || '',- hashPrefix = Y.HistoryHash.hashPrefix;-- // Strip any hash prefix, like hash-bangs.- if (hashPrefix && hash.indexOf(hashPrefix) === 0) {- hash = hash.replace(hashPrefix, '');- }-- // If the hash looks like a URL path, assume it is, and upgrade it!- if (hash && hash.charAt(0) === '/') {- // Re-join with configured `root` before resolving.- url = this._resolveURL(this._joinURL(hash));+ if (callback) {+ callback.call(this, newView); }-- return url; }, // -- Protected Event Handlers ---------------------------------------------@@ -1027,7 +988,7 @@ @since 3.5.0 **/ serverRouting: {- value : undefined,+ valueFn : function () { return Y.App.serverRouting; }, writeOnce: 'initOnly' }, @@ -1064,32 +1025,7 @@ } }, - // TODO: Should these go on the `prototype`?- // TODO: These should also just go in a `CLASS_NAMES` object.- /**- CSS class added to an app's `container` node.-- @property CSS_CLASS- @type String- @default "yui3-app"- @static- @since 3.5.0- **/- CSS_CLASS: getClassName('app'),-- /**- CSS class added to an app's `viewContainer` node.-- @property VIEWS_CSS_CLASS- @type String- @default "yui3-app-views"- @static- @since 3.5.0- **/- VIEWS_CSS_CLASS: getClassName('app', 'views'),-- /** Properties that shouldn't be turned into ad-hoc attributes when passed to App's constructor. @@ -1103,7 +1039,7 @@ }); // -- Namespace -----------------------------------------------------------------Y.namespace('App').Base = App;+Y.namespace('App').Base = AppBase; /** Provides a top-level application component which manages navigation and views.@@ -1133,10 +1069,36 @@ provided by the `views` object on the `prototype`. @constructor @extends App.Base+@uses App.Content @uses App.Transitions+@uses PjaxContent @since 3.5.0 **/-Y.App = Y.mix(Y.Base.create('app', Y.App.Base, []), Y.App, true);+Y.App = Y.mix(Y.Base.create('app', AppBase, []), Y.App, true); +/**+CSS classes used by `Y.App`. -}, '3.5.1' ,{requires:['classnamemanager', 'pjax-base', 'router', 'view']});+@property CLASS_NAMES+@type Object+@default {}+@static+@since 3.6.0+**/+Y.App.CLASS_NAMES = {+ app : getClassName('app'),+ views: getClassName('app', 'views')+};++/**+Default `serverRouting` attribute value for all apps.++@property serverRouting+@type Boolean+@default undefined+@static+@since 3.6.0+**/+++}, '3.7.1', {"requires": ["classnamemanager", "pjax-base", "router", "view"]});
@@ -0,0 +1,314 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/app-content/app-content.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/app-content/app-content.js",+ code: []+};+_yuitest_coverage["build/app-content/app-content.js"].code=["YUI.add('app-content', function (Y, NAME) {","","/**","`Y.App` extension that provides pjax-style content fetching and handling.","","@module app","@submodule app-content","@since 3.7.0","**/","","var PjaxContent = Y.PjaxContent;","","/**","`Y.App` extension that provides pjax-style content fetching and handling.","","This makes it easy to fetch server rendered content for URLs using Ajax. The","HTML content returned from the server will be view-ified and set as the app's","main content, making it seamless to use a mixture of server and client rendered","views.","","When the `\"app-content\"` module is used, it will automatically mix itself into","`Y.App`, and it provides three main features:",""," - **`Y.App.Content.route`**: A stack of middleware which forms a pjax-style"," content route.",""," - **`loadContent()`**: Route middleware which load content from a server. This"," makes an Ajax request for the requested URL, parses the returned content and"," puts it on the route's response object.",""," - **`showContent()`**: Method which provides an easy way to view-ify HTML"," content which should be shown as an app's active/visible view.","","The following is an example of how these features can be used:",""," // Creates a new app and registers the `\"post\"` view."," var app = new Y.App({"," views: {"," post: {type: Y.PostView}"," }"," });",""," // Uses a simple server rendered content route for the About page."," app.route('/about/', Y.App.Content.route);",""," // Uses the `loadContent()` middleware to fetch the contents of the post"," // from the server and shows that content in a `\"post\"` view."," app.route('/posts/:id/', 'loadContent', function (req, res, next) {"," this.showContent(res.content.node, {view: 'post'});"," });","","@class App.Content","@uses PjaxContent","@extensionfor App","@since 3.7.0","**/","function AppContent() {"," PjaxContent.apply(this, arguments);","}","","/**","A stack of middleware which forms a pjax-style content route.","","This route will load the rendered HTML content from the server, then create and","show a new view using those contents.","","@property route","@type Array","@static","@since 3.7.0","**/","AppContent.route = ['loadContent', '_contentRoute'];","","AppContent.prototype = {"," // -- Public Methods -------------------------------------------------------",""," /**"," Sets this app's `activeView` attribute using the specified `content`.",""," This provides an easy way to view-ify HTML content which should be shown as"," this app's active/visible view. This method will determine the appropriate"," view `container` node based on the specified `content`. By default, a new"," `Y.View` instance will be created unless `options.view` is specified.",""," Under the hood, this method calls the `showView()` method, so refer to its"," docs for more information.",""," @method showContent"," @param {HTMLElement|Node|String} content The content to show, it may be"," provided as a selector string, a DOM element, or a `Y.Node` instance."," @param {Object} [options] Optional objects containing any of the following"," properties in addition to any `showView()` options:",""," @param {Object|String} [options.view] The name of a view defined in this"," app's `views`, or an object with the following properties:",""," @param {String} options.view.name The name of a view defined in this"," app's `views`."," @param {Object} [options.view.config] Optional configuration to use when"," creating the new view instance. This config object can also be used"," to update an existing or preserved view's attributes when"," `options.update` is `true`. **Note:** If a `container` is specified,"," it will be overridden by the `content` specified in the first"," argument.",""," @param {Function} [callback] Optional callback function to call after the"," new `activeView` is ready to use. **Note:** this will override"," `options.callback` and it can be specified as either the second or third"," argument. The function will be passed the following:",""," @param {View} callback.view A reference to the new `activeView`.",""," @since 3.7.0"," @see App.showView()"," **/"," showContent: function (content, options, callback) {"," // Makes sure we have a node instance, and will query selector strings."," content = Y.one(content);",""," // Support the callback function being either the second or third arg."," if (typeof options === 'function') {"," options = {callback: options};"," callback = null;"," }",""," // Mix in default option to *not* render the view because presumably we"," // have pre-rendered content here. This also creates a copy so we can"," // modify the object."," options = Y.merge({render: false}, options);",""," var view = options.view || '',"," viewName = typeof view === 'string' ? view : view.name,"," viewConfig = typeof view !== 'string' ? view.config : {},"," viewInfo = this.getViewInfo(viewName),"," container, template, type, ViewConstructor;",""," // Remove `view` from the `options` which will be passed along to the"," // `showView()` method."," delete options.view;",""," // When the specified `content` is a document fragment, we want to see"," // if it only contains a single node, and use that as the content. This"," // checks `childNodes` which will include text nodes."," if (content && content.isFragment() &&"," content.get('childNodes').size() === 1) {",""," content = content.get('firstChild');"," }",""," // When the `content` is an element node (`nodeType` 1), we can use it"," // as-is for the `container`. Otherwise, we'll construct a new container"," // based on the `options.view`'s `containerTemplate`."," if (content && content.get('nodeType') === 1) {"," container = content;"," } else {"," type = (viewInfo && viewInfo.type) || Y.View;",""," // Looks for a namespaced constructor function on `Y`."," ViewConstructor = typeof type === 'string' ?"," Y.Object.getValue(Y, type.split('.')) : type;",""," // Find the correct node template for the view."," template = ViewConstructor.prototype.containerTemplate;"," container = Y.Node.create(template);",""," // Append the document fragment to the newly created `container`"," // node. This is the worst case where we have to create a wrapper"," // node around the `content`."," container.append(content);"," }",""," // Makes sure the view is created using _our_ `container` node."," viewConfig = Y.merge(viewConfig, {container: container});",""," // Finally switch to the new `activeView`. We want to make sure `view`"," // is a string if it's falsy, that way a new view will be created."," return this.showView(viewName, viewConfig, options, callback);"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Provides a default content route which will show a server rendered view.",""," **Note:** This route callback assumes that it's called after the"," `loadContent()` middleware.",""," @method _contentRoute"," @param {Object} req Request object."," @param {Object} res Response Object."," @param {Function} next Function to pass control to the next route callback."," @protected"," @since 3.7.0"," @see Y.App.Content.route"," **/"," _contentRoute: function (req, res, next) {"," var content = res.content,"," doc = Y.config.doc,"," activeViewHandle;",""," // We must have some content to work with."," if (!(content && content.node)) { return next(); }",""," if (content.title && doc) {"," // Make sure the `activeView` does actually change before we go"," // messing with the page title."," activeViewHandle = this.onceAfter('activeViewChange', function () {"," doc.title = content.title;"," });"," }",""," this.showContent(content.node);",""," // Detach the handle just in case."," if (activeViewHandle) {"," activeViewHandle.detach();"," }",""," next();"," }","};","","// Mix statics.","Y.mix(AppContent, PjaxContent);","// Mix prototype.","Y.mix(AppContent, PjaxContent, false, null, 1);","","// -- Namespace ----------------------------------------------------------------","Y.App.Content = AppContent;","Y.Base.mix(Y.App, [AppContent]);","","","}, '3.7.1', {\"requires\": [\"app-base\", \"pjax-content\"]});"];+_yuitest_coverage["build/app-content/app-content.js"].lines = {"1":0,"11":0,"57":0,"58":0,"72":0,"74":0,"118":0,"121":0,"122":0,"123":0,"129":0,"131":0,"139":0,"144":0,"147":0,"153":0,"154":0,"156":0,"159":0,"163":0,"164":0,"169":0,"173":0,"177":0,"197":0,"202":0,"204":0,"207":0,"208":0,"212":0,"215":0,"216":0,"219":0,"224":0,"226":0,"229":0,"230":0};+_yuitest_coverage["build/app-content/app-content.js"].functions = {"AppContent:57":0,"showContent:116":0,"(anonymous 2):207":0,"_contentRoute:196":0,"(anonymous 1):1":0};+_yuitest_coverage["build/app-content/app-content.js"].coveredLines = 37;+_yuitest_coverage["build/app-content/app-content.js"].coveredFunctions = 5;+_yuitest_coverline("build/app-content/app-content.js", 1);+YUI.add('app-content', function (Y, NAME) {++/**+`Y.App` extension that provides pjax-style content fetching and handling.++@module app+@submodule app-content+@since 3.7.0+**/++_yuitest_coverfunc("build/app-content/app-content.js", "(anonymous 1)", 1);+_yuitest_coverline("build/app-content/app-content.js", 11);+var PjaxContent = Y.PjaxContent;++/**+`Y.App` extension that provides pjax-style content fetching and handling.++This makes it easy to fetch server rendered content for URLs using Ajax. The+HTML content returned from the server will be view-ified and set as the app's+main content, making it seamless to use a mixture of server and client rendered+views.++When the `"app-content"` module is used, it will automatically mix itself into+`Y.App`, and it provides three main features:++ - **`Y.App.Content.route`**: A stack of middleware which forms a pjax-style+ content route.++ - **`loadContent()`**: Route middleware which load content from a server. This+ makes an Ajax request for the requested URL, parses the returned content and+ puts it on the route's response object.++ - **`showContent()`**: Method which provides an easy way to view-ify HTML+ content which should be shown as an app's active/visible view.++The following is an example of how these features can be used:++ // Creates a new app and registers the `"post"` view.+ var app = new Y.App({+ views: {+ post: {type: Y.PostView}+ }+ });++ // Uses a simple server rendered content route for the About page.+ app.route('/about/', Y.App.Content.route);++ // Uses the `loadContent()` middleware to fetch the contents of the post+ // from the server and shows that content in a `"post"` view.+ app.route('/posts/:id/', 'loadContent', function (req, res, next) {+ this.showContent(res.content.node, {view: 'post'});+ });++@class App.Content+@uses PjaxContent+@extensionfor App+@since 3.7.0+**/+_yuitest_coverline("build/app-content/app-content.js", 57);+function AppContent() {+ _yuitest_coverfunc("build/app-content/app-content.js", "AppContent", 57);+_yuitest_coverline("build/app-content/app-content.js", 58);+PjaxContent.apply(this, arguments);+}++/**+A stack of middleware which forms a pjax-style content route.++This route will load the rendered HTML content from the server, then create and+show a new view using those contents.++@property route+@type Array+@static+@since 3.7.0+**/+_yuitest_coverline("build/app-content/app-content.js", 72);+AppContent.route = ['loadContent', '_contentRoute'];++_yuitest_coverline("build/app-content/app-content.js", 74);+AppContent.prototype = {+ // -- Public Methods -------------------------------------------------------++ /**+ Sets this app's `activeView` attribute using the specified `content`.++ This provides an easy way to view-ify HTML content which should be shown as+ this app's active/visible view. This method will determine the appropriate+ view `container` node based on the specified `content`. By default, a new+ `Y.View` instance will be created unless `options.view` is specified.++ Under the hood, this method calls the `showView()` method, so refer to its+ docs for more information.++ @method showContent+ @param {HTMLElement|Node|String} content The content to show, it may be+ provided as a selector string, a DOM element, or a `Y.Node` instance.+ @param {Object} [options] Optional objects containing any of the following+ properties in addition to any `showView()` options:++ @param {Object|String} [options.view] The name of a view defined in this+ app's `views`, or an object with the following properties:++ @param {String} options.view.name The name of a view defined in this+ app's `views`.+ @param {Object} [options.view.config] Optional configuration to use when+ creating the new view instance. This config object can also be used+ to update an existing or preserved view's attributes when+ `options.update` is `true`. **Note:** If a `container` is specified,+ it will be overridden by the `content` specified in the first+ argument.++ @param {Function} [callback] Optional callback function to call after the+ new `activeView` is ready to use. **Note:** this will override+ `options.callback` and it can be specified as either the second or third+ argument. The function will be passed the following:++ @param {View} callback.view A reference to the new `activeView`.++ @since 3.7.0+ @see App.showView()+ **/+ showContent: function (content, options, callback) {+ // Makes sure we have a node instance, and will query selector strings.+ _yuitest_coverfunc("build/app-content/app-content.js", "showContent", 116);+_yuitest_coverline("build/app-content/app-content.js", 118);+content = Y.one(content);++ // Support the callback function being either the second or third arg.+ _yuitest_coverline("build/app-content/app-content.js", 121);+if (typeof options === 'function') {+ _yuitest_coverline("build/app-content/app-content.js", 122);+options = {callback: options};+ _yuitest_coverline("build/app-content/app-content.js", 123);+callback = null;+ }++ // Mix in default option to *not* render the view because presumably we+ // have pre-rendered content here. This also creates a copy so we can+ // modify the object.+ _yuitest_coverline("build/app-content/app-content.js", 129);+options = Y.merge({render: false}, options);++ _yuitest_coverline("build/app-content/app-content.js", 131);+var view = options.view || '',+ viewName = typeof view === 'string' ? view : view.name,+ viewConfig = typeof view !== 'string' ? view.config : {},+ viewInfo = this.getViewInfo(viewName),+ container, template, type, ViewConstructor;++ // Remove `view` from the `options` which will be passed along to the+ // `showView()` method.+ _yuitest_coverline("build/app-content/app-content.js", 139);+delete options.view;++ // When the specified `content` is a document fragment, we want to see+ // if it only contains a single node, and use that as the content. This+ // checks `childNodes` which will include text nodes.+ _yuitest_coverline("build/app-content/app-content.js", 144);+if (content && content.isFragment() &&+ content.get('childNodes').size() === 1) {++ _yuitest_coverline("build/app-content/app-content.js", 147);+content = content.get('firstChild');+ }++ // When the `content` is an element node (`nodeType` 1), we can use it+ // as-is for the `container`. Otherwise, we'll construct a new container+ // based on the `options.view`'s `containerTemplate`.+ _yuitest_coverline("build/app-content/app-content.js", 153);+if (content && content.get('nodeType') === 1) {+ _yuitest_coverline("build/app-content/app-content.js", 154);+container = content;+ } else {+ _yuitest_coverline("build/app-content/app-content.js", 156);+type = (viewInfo && viewInfo.type) || Y.View;++ // Looks for a namespaced constructor function on `Y`.+ _yuitest_coverline("build/app-content/app-content.js", 159);+ViewConstructor = typeof type === 'string' ?+ Y.Object.getValue(Y, type.split('.')) : type;++ // Find the correct node template for the view.+ _yuitest_coverline("build/app-content/app-content.js", 163);+template = ViewConstructor.prototype.containerTemplate;+ _yuitest_coverline("build/app-content/app-content.js", 164);+container = Y.Node.create(template);++ // Append the document fragment to the newly created `container`+ // node. This is the worst case where we have to create a wrapper+ // node around the `content`.+ _yuitest_coverline("build/app-content/app-content.js", 169);+container.append(content);+ }++ // Makes sure the view is created using _our_ `container` node.+ _yuitest_coverline("build/app-content/app-content.js", 173);+viewConfig = Y.merge(viewConfig, {container: container});++ // Finally switch to the new `activeView`. We want to make sure `view`+ // is a string if it's falsy, that way a new view will be created.+ _yuitest_coverline("build/app-content/app-content.js", 177);+return this.showView(viewName, viewConfig, options, callback);+ },++ // -- Protected Methods ----------------------------------------------------++ /**+ Provides a default content route which will show a server rendered view.++ **Note:** This route callback assumes that it's called after the+ `loadContent()` middleware.++ @method _contentRoute+ @param {Object} req Request object.+ @param {Object} res Response Object.+ @param {Function} next Function to pass control to the next route callback.+ @protected+ @since 3.7.0+ @see Y.App.Content.route+ **/+ _contentRoute: function (req, res, next) {+ _yuitest_coverfunc("build/app-content/app-content.js", "_contentRoute", 196);+_yuitest_coverline("build/app-content/app-content.js", 197);+var content = res.content,+ doc = Y.config.doc,+ activeViewHandle;++ // We must have some content to work with.+ _yuitest_coverline("build/app-content/app-content.js", 202);+if (!(content && content.node)) { return next(); }++ _yuitest_coverline("build/app-content/app-content.js", 204);+if (content.title && doc) {+ // Make sure the `activeView` does actually change before we go+ // messing with the page title.+ _yuitest_coverline("build/app-content/app-content.js", 207);+activeViewHandle = this.onceAfter('activeViewChange', function () {+ _yuitest_coverfunc("build/app-content/app-content.js", "(anonymous 2)", 207);+_yuitest_coverline("build/app-content/app-content.js", 208);+doc.title = content.title;+ });+ }++ _yuitest_coverline("build/app-content/app-content.js", 212);+this.showContent(content.node);++ // Detach the handle just in case.+ _yuitest_coverline("build/app-content/app-content.js", 215);+if (activeViewHandle) {+ _yuitest_coverline("build/app-content/app-content.js", 216);+activeViewHandle.detach();+ }++ _yuitest_coverline("build/app-content/app-content.js", 219);+next();+ }+};++// Mix statics.+_yuitest_coverline("build/app-content/app-content.js", 224);+Y.mix(AppContent, PjaxContent);+// Mix prototype.+_yuitest_coverline("build/app-content/app-content.js", 226);+Y.mix(AppContent, PjaxContent, false, null, 1);++// -- Namespace ----------------------------------------------------------------+_yuitest_coverline("build/app-content/app-content.js", 229);+Y.App.Content = AppContent;+_yuitest_coverline("build/app-content/app-content.js", 230);+Y.Base.mix(Y.App, [AppContent]);+++}, '3.7.1', {"requires": ["app-base", "pjax-content"]});
@@ -0,0 +1,239 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+YUI.add('app-content', function (Y, NAME) {++/**+`Y.App` extension that provides pjax-style content fetching and handling.++@module app+@submodule app-content+@since 3.7.0+**/++var PjaxContent = Y.PjaxContent;++/**+`Y.App` extension that provides pjax-style content fetching and handling.++This makes it easy to fetch server rendered content for URLs using Ajax. The+HTML content returned from the server will be view-ified and set as the app's+main content, making it seamless to use a mixture of server and client rendered+views.++When the `"app-content"` module is used, it will automatically mix itself into+`Y.App`, and it provides three main features:++ - **`Y.App.Content.route`**: A stack of middleware which forms a pjax-style+ content route.++ - **`loadContent()`**: Route middleware which load content from a server. This+ makes an Ajax request for the requested URL, parses the returned content and+ puts it on the route's response object.++ - **`showContent()`**: Method which provides an easy way to view-ify HTML+ content which should be shown as an app's active/visible view.++The following is an example of how these features can be used:++ // Creates a new app and registers the `"post"` view.+ var app = new Y.App({+ views: {+ post: {type: Y.PostView}+ }+ });++ // Uses a simple server rendered content route for the About page.+ app.route('/about/', Y.App.Content.route);++ // Uses the `loadContent()` middleware to fetch the contents of the post+ // from the server and shows that content in a `"post"` view.+ app.route('/posts/:id/', 'loadContent', function (req, res, next) {+ this.showContent(res.content.node, {view: 'post'});+ });++@class App.Content+@uses PjaxContent+@extensionfor App+@since 3.7.0+**/+function AppContent() {+ PjaxContent.apply(this, arguments);+}++/**+A stack of middleware which forms a pjax-style content route.++This route will load the rendered HTML content from the server, then create and+show a new view using those contents.++@property route+@type Array+@static+@since 3.7.0+**/+AppContent.route = ['loadContent', '_contentRoute'];++AppContent.prototype = {+ // -- Public Methods -------------------------------------------------------++ /**+ Sets this app's `activeView` attribute using the specified `content`.++ This provides an easy way to view-ify HTML content which should be shown as+ this app's active/visible view. This method will determine the appropriate+ view `container` node based on the specified `content`. By default, a new+ `Y.View` instance will be created unless `options.view` is specified.++ Under the hood, this method calls the `showView()` method, so refer to its+ docs for more information.++ @method showContent+ @param {HTMLElement|Node|String} content The content to show, it may be+ provided as a selector string, a DOM element, or a `Y.Node` instance.+ @param {Object} [options] Optional objects containing any of the following+ properties in addition to any `showView()` options:++ @param {Object|String} [options.view] The name of a view defined in this+ app's `views`, or an object with the following properties:++ @param {String} options.view.name The name of a view defined in this+ app's `views`.+ @param {Object} [options.view.config] Optional configuration to use when+ creating the new view instance. This config object can also be used+ to update an existing or preserved view's attributes when+ `options.update` is `true`. **Note:** If a `container` is specified,+ it will be overridden by the `content` specified in the first+ argument.++ @param {Function} [callback] Optional callback function to call after the+ new `activeView` is ready to use. **Note:** this will override+ `options.callback` and it can be specified as either the second or third+ argument. The function will be passed the following:++ @param {View} callback.view A reference to the new `activeView`.++ @since 3.7.0+ @see App.showView()+ **/+ showContent: function (content, options, callback) {+ // Makes sure we have a node instance, and will query selector strings.+ content = Y.one(content);++ // Support the callback function being either the second or third arg.+ if (typeof options === 'function') {+ options = {callback: options};+ callback = null;+ }++ // Mix in default option to *not* render the view because presumably we+ // have pre-rendered content here. This also creates a copy so we can+ // modify the object.+ options = Y.merge({render: false}, options);++ var view = options.view || '',+ viewName = typeof view === 'string' ? view : view.name,+ viewConfig = typeof view !== 'string' ? view.config : {},+ viewInfo = this.getViewInfo(viewName),+ container, template, type, ViewConstructor;++ // Remove `view` from the `options` which will be passed along to the+ // `showView()` method.+ delete options.view;++ // When the specified `content` is a document fragment, we want to see+ // if it only contains a single node, and use that as the content. This+ // checks `childNodes` which will include text nodes.+ if (content && content.isFragment() &&+ content.get('childNodes').size() === 1) {++ content = content.get('firstChild');+ }++ // When the `content` is an element node (`nodeType` 1), we can use it+ // as-is for the `container`. Otherwise, we'll construct a new container+ // based on the `options.view`'s `containerTemplate`.+ if (content && content.get('nodeType') === 1) {+ container = content;+ } else {+ type = (viewInfo && viewInfo.type) || Y.View;++ // Looks for a namespaced constructor function on `Y`.+ ViewConstructor = typeof type === 'string' ?+ Y.Object.getValue(Y, type.split('.')) : type;++ // Find the correct node template for the view.+ template = ViewConstructor.prototype.containerTemplate;+ container = Y.Node.create(template);++ // Append the document fragment to the newly created `container`+ // node. This is the worst case where we have to create a wrapper+ // node around the `content`.+ container.append(content);+ }++ // Makes sure the view is created using _our_ `container` node.+ viewConfig = Y.merge(viewConfig, {container: container});++ // Finally switch to the new `activeView`. We want to make sure `view`+ // is a string if it's falsy, that way a new view will be created.+ return this.showView(viewName, viewConfig, options, callback);+ },++ // -- Protected Methods ----------------------------------------------------++ /**+ Provides a default content route which will show a server rendered view.++ **Note:** This route callback assumes that it's called after the+ `loadContent()` middleware.++ @method _contentRoute+ @param {Object} req Request object.+ @param {Object} res Response Object.+ @param {Function} next Function to pass control to the next route callback.+ @protected+ @since 3.7.0+ @see Y.App.Content.route+ **/+ _contentRoute: function (req, res, next) {+ var content = res.content,+ doc = Y.config.doc,+ activeViewHandle;++ // We must have some content to work with.+ if (!(content && content.node)) { return next(); }++ if (content.title && doc) {+ // Make sure the `activeView` does actually change before we go+ // messing with the page title.+ activeViewHandle = this.onceAfter('activeViewChange', function () {+ doc.title = content.title;+ });+ }++ this.showContent(content.node);++ // Detach the handle just in case.+ if (activeViewHandle) {+ activeViewHandle.detach();+ }++ next();+ }+};++// Mix statics.+Y.mix(AppContent, PjaxContent);+// Mix prototype.+Y.mix(AppContent, PjaxContent, false, null, 1);++// -- Namespace ----------------------------------------------------------------+Y.App.Content = AppContent;+Y.Base.mix(Y.App, [AppContent]);+++}, '3.7.1', {"requires": ["app-base", "pjax-content"]});
@@ -0,0 +1,7 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+YUI.add("app-content",function(e,t){function r(){n.apply(this,arguments)}var n=e.PjaxContent;r.route=["loadContent","_contentRoute"],r.prototype={showContent:function(t,n,r){t=e.one(t),typeof n=="function"&&(n={callback:n},r=null),n=e.merge({render:!1},n);var i=n.view||"",s=typeof i=="string"?i:i.name,o=typeof i!="string"?i.config:{},u=this.getViewInfo(s),a,f,l,c;return delete n.view,t&&t.isFragment()&&t.get("childNodes").size()===1&&(t=t.get("firstChild")),t&&t.get("nodeType")===1?a=t:(l=u&&u.type||e.View,c=typeof l=="string"?e.Object.getValue(e,l.split(".")):l,f=c.prototype.containerTemplate,a=e.Node.create(f),a.append(t)),o=e.merge(o,{container:a}),this.showView(s,o,n,r)},_contentRoute:function(t,n,r){var i=n.content,s=e.config.doc,o;if(!i||!i.node)return r();i.title&&s&&(o=this.onceAfter("activeViewChange",function(){s.title=i.title})),this.showContent(i.node),o&&o.detach(),r()}},e.mix(r,n),e.mix(r,n,!1,null,1),e.App.Content=r,e.Base.mix(e.App,[r])},"3.7.1",{requires:["app-base","pjax-content"]});
@@ -0,0 +1,239 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+YUI.add('app-content', function (Y, NAME) {++/**+`Y.App` extension that provides pjax-style content fetching and handling.++@module app+@submodule app-content+@since 3.7.0+**/++var PjaxContent = Y.PjaxContent;++/**+`Y.App` extension that provides pjax-style content fetching and handling.++This makes it easy to fetch server rendered content for URLs using Ajax. The+HTML content returned from the server will be view-ified and set as the app's+main content, making it seamless to use a mixture of server and client rendered+views.++When the `"app-content"` module is used, it will automatically mix itself into+`Y.App`, and it provides three main features:++ - **`Y.App.Content.route`**: A stack of middleware which forms a pjax-style+ content route.++ - **`loadContent()`**: Route middleware which load content from a server. This+ makes an Ajax request for the requested URL, parses the returned content and+ puts it on the route's response object.++ - **`showContent()`**: Method which provides an easy way to view-ify HTML+ content which should be shown as an app's active/visible view.++The following is an example of how these features can be used:++ // Creates a new app and registers the `"post"` view.+ var app = new Y.App({+ views: {+ post: {type: Y.PostView}+ }+ });++ // Uses a simple server rendered content route for the About page.+ app.route('/about/', Y.App.Content.route);++ // Uses the `loadContent()` middleware to fetch the contents of the post+ // from the server and shows that content in a `"post"` view.+ app.route('/posts/:id/', 'loadContent', function (req, res, next) {+ this.showContent(res.content.node, {view: 'post'});+ });++@class App.Content+@uses PjaxContent+@extensionfor App+@since 3.7.0+**/+function AppContent() {+ PjaxContent.apply(this, arguments);+}++/**+A stack of middleware which forms a pjax-style content route.++This route will load the rendered HTML content from the server, then create and+show a new view using those contents.++@property route+@type Array+@static+@since 3.7.0+**/+AppContent.route = ['loadContent', '_contentRoute'];++AppContent.prototype = {+ // -- Public Methods -------------------------------------------------------++ /**+ Sets this app's `activeView` attribute using the specified `content`.++ This provides an easy way to view-ify HTML content which should be shown as+ this app's active/visible view. This method will determine the appropriate+ view `container` node based on the specified `content`. By default, a new+ `Y.View` instance will be created unless `options.view` is specified.++ Under the hood, this method calls the `showView()` method, so refer to its+ docs for more information.++ @method showContent+ @param {HTMLElement|Node|String} content The content to show, it may be+ provided as a selector string, a DOM element, or a `Y.Node` instance.+ @param {Object} [options] Optional objects containing any of the following+ properties in addition to any `showView()` options:++ @param {Object|String} [options.view] The name of a view defined in this+ app's `views`, or an object with the following properties:++ @param {String} options.view.name The name of a view defined in this+ app's `views`.+ @param {Object} [options.view.config] Optional configuration to use when+ creating the new view instance. This config object can also be used+ to update an existing or preserved view's attributes when+ `options.update` is `true`. **Note:** If a `container` is specified,+ it will be overridden by the `content` specified in the first+ argument.++ @param {Function} [callback] Optional callback function to call after the+ new `activeView` is ready to use. **Note:** this will override+ `options.callback` and it can be specified as either the second or third+ argument. The function will be passed the following:++ @param {View} callback.view A reference to the new `activeView`.++ @since 3.7.0+ @see App.showView()+ **/+ showContent: function (content, options, callback) {+ // Makes sure we have a node instance, and will query selector strings.+ content = Y.one(content);++ // Support the callback function being either the second or third arg.+ if (typeof options === 'function') {+ options = {callback: options};+ callback = null;+ }++ // Mix in default option to *not* render the view because presumably we+ // have pre-rendered content here. This also creates a copy so we can+ // modify the object.+ options = Y.merge({render: false}, options);++ var view = options.view || '',+ viewName = typeof view === 'string' ? view : view.name,+ viewConfig = typeof view !== 'string' ? view.config : {},+ viewInfo = this.getViewInfo(viewName),+ container, template, type, ViewConstructor;++ // Remove `view` from the `options` which will be passed along to the+ // `showView()` method.+ delete options.view;++ // When the specified `content` is a document fragment, we want to see+ // if it only contains a single node, and use that as the content. This+ // checks `childNodes` which will include text nodes.+ if (content && content.isFragment() &&+ content.get('childNodes').size() === 1) {++ content = content.get('firstChild');+ }++ // When the `content` is an element node (`nodeType` 1), we can use it+ // as-is for the `container`. Otherwise, we'll construct a new container+ // based on the `options.view`'s `containerTemplate`.+ if (content && content.get('nodeType') === 1) {+ container = content;+ } else {+ type = (viewInfo && viewInfo.type) || Y.View;++ // Looks for a namespaced constructor function on `Y`.+ ViewConstructor = typeof type === 'string' ?+ Y.Object.getValue(Y, type.split('.')) : type;++ // Find the correct node template for the view.+ template = ViewConstructor.prototype.containerTemplate;+ container = Y.Node.create(template);++ // Append the document fragment to the newly created `container`+ // node. This is the worst case where we have to create a wrapper+ // node around the `content`.+ container.append(content);+ }++ // Makes sure the view is created using _our_ `container` node.+ viewConfig = Y.merge(viewConfig, {container: container});++ // Finally switch to the new `activeView`. We want to make sure `view`+ // is a string if it's falsy, that way a new view will be created.+ return this.showView(viewName, viewConfig, options, callback);+ },++ // -- Protected Methods ----------------------------------------------------++ /**+ Provides a default content route which will show a server rendered view.++ **Note:** This route callback assumes that it's called after the+ `loadContent()` middleware.++ @method _contentRoute+ @param {Object} req Request object.+ @param {Object} res Response Object.+ @param {Function} next Function to pass control to the next route callback.+ @protected+ @since 3.7.0+ @see Y.App.Content.route+ **/+ _contentRoute: function (req, res, next) {+ var content = res.content,+ doc = Y.config.doc,+ activeViewHandle;++ // We must have some content to work with.+ if (!(content && content.node)) { return next(); }++ if (content.title && doc) {+ // Make sure the `activeView` does actually change before we go+ // messing with the page title.+ activeViewHandle = this.onceAfter('activeViewChange', function () {+ doc.title = content.title;+ });+ }++ this.showContent(content.node);++ // Detach the handle just in case.+ if (activeViewHandle) {+ activeViewHandle.detach();+ }++ next();+ }+};++// Mix statics.+Y.mix(AppContent, PjaxContent);+// Mix prototype.+Y.mix(AppContent, PjaxContent, false, null, 1);++// -- Namespace ----------------------------------------------------------------+Y.App.Content = AppContent;+Y.Base.mix(Y.App, [AppContent]);+++}, '3.7.1', {"requires": ["app-base", "pjax-content"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-.yui3-app-transitioning .yui3-app-views,.yui3-app-views.yui3-app-transitioning{overflow-x:hidden;position:relative;white-space:nowrap}.yui3-app-transitioning .yui3-app-views>*,.yui3-app-views.yui3-app-transitioning>*{display:inline-block;width:100%;vertical-align:top;white-space:normal;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#yui3-css-stamp.app-transitions-css{display:none}+.yui3-app-transitioning .yui3-app-views,.yui3-app-views.yui3-app-transitioning{overflow-x:hidden;position:relative;white-space:nowrap;letter-spacing:-0.31em;word-spacing:-0.43em}.yui3-app-transitioning .yui3-app-views>*,.yui3-app-views.yui3-app-transitioning>*{display:inline-block;width:100%;vertical-align:top;white-space:normal;letter-spacing:normal;word-spacing:normal;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#yui3-css-stamp.app-transitions-css{display:none}
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -9,6 +9,8 @@ overflow-x: hidden; position: relative; white-space: nowrap;+ letter-spacing: -0.31em; /* webkit: collapse white-space between units */+ word-spacing: -0.43em; /* IE < 8 && gecko: collapse white-space between units */ } .yui3-app-transitioning .yui3-app-views > *, .yui3-app-views.yui3-app-transitioning > * {@@ -16,9 +18,12 @@ width: 100%; vertical-align: top; white-space: normal;+ letter-spacing: normal;+ word-spacing: normal; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }+ /* YUI CSS Detection Stamp */ #yui3-css-stamp.app-transitions-css { display: none; }
@@ -0,0 +1,486 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/app-transitions-native/app-transitions-native.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/app-transitions-native/app-transitions-native.js",+ code: []+};+_yuitest_coverage["build/app-transitions-native/app-transitions-native.js"].code=["YUI.add('app-transitions-native', function (Y, NAME) {","","/**","Provides the implementation of view transitions for `Y.App.Transitions` in","browsers which support native CSS3 transitions.","","@module app","@submodule app-transitions-native","@since 3.5.0","**/","","var AppTransitions = Y.App.Transitions;","","/**","Provides the implementation of view transitions for `Y.App.Transitions` in","browsers which support native CSS3 transitions.","","When this module is used, `Y.App.TransitionsNative` will automatically mix","itself in to `Y.App`.","","@class App.TransitionsNative","@extensionfor App","@since 3.5.0","**/","function AppTransitionsNative() {}","","AppTransitionsNative.prototype = {"," // -- Protected Properties -------------------------------------------------",""," /**"," Whether this app is currently transitioning its `activeView`.",""," @property _transitioning"," @type Boolean"," @default false"," @protected"," @since 3.5.0"," **/",""," /**"," A queue that holds pending calls to this app's `_uiTransitionActiveView()`"," method.",""," @property _viewTransitionQueue"," @type Array"," @default []"," @protected"," @since 3.5.0"," **/",""," // -- Lifecycle Methods ----------------------------------------------------",""," initializer: function () {"," this._transitioning = false;"," this._viewTransitionQueue = [];",""," // TODO: Consider the AOP approach that `Plugin.WidgetAnim` uses."," Y.Do.before(this._queueActiveView, this, '_uiSetActiveView');"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Dequeues any pending calls to `_uiTransitionActiveView()`.",""," **Note:** When there is more than one queued transition, only the most"," recent `activeView` change will be visually transitioned, while the others"," will have their `transition` option overridden to `false`.",""," @method _dequeueActiveView"," @protected"," @since 3.5.0"," **/"," _dequeueActiveView: function () {"," var queue = this._viewTransitionQueue,"," transition = queue.shift(),"," options;",""," if (transition) {"," // When items are still left in the queue, override the transition"," // so it does not run."," if (queue.length) {"," // Overrides `transition` option and splices in the new options."," options = Y.merge(transition[2], {transition: false});"," transition.splice(2, 1, options);"," }",""," this._uiTransitionActiveView.apply(this, transition);"," }"," },",""," /**"," Returns an object containing a named fx for both `viewIn` and `viewOut`"," based on the relationship between the specified `newView` and `oldView`.",""," @method _getFx"," @param {View} newView The view being transitioned-in."," @param {View} oldView The view being transitioned-out."," @param {String} [transition] The preferred transition to use."," @return {Object} An object containing a named fx for both `viewIn` and"," `viewOut`."," @protected"," @since 3.5.0"," **/"," _getFx: function (newView, oldView, transition) {"," var fx = AppTransitions.FX,"," transitions = this.get('transitions');",""," if (transition === false || !transitions) {"," return null;"," }",""," if (transition) {"," return fx[transition];"," }",""," if (this._isChildView(newView, oldView)) {"," return fx[transitions.toChild];"," }",""," if (this._isParentView(newView, oldView)) {"," return fx[transitions.toParent];"," }",""," return fx[transitions.navigate];"," },",""," /**"," Queues calls to `_uiTransitionActiveView()` to make sure a currently running"," transition isn't interrupted.",""," **Note:** This method prevents the default `_uiSetActiveView()` method from"," running.",""," @method _queueActiveView"," @protected"," @since 3.5.0"," **/"," _queueActiveView: function () {"," var args = Y.Array(arguments, 0, true);",""," this._viewTransitionQueue.push(args);",""," if (!this._transitioning) {"," this._dequeueActiveView();"," }",""," return new Y.Do.Prevent();"," },",""," /**"," Performs the actual change of this app's `activeView` by visually"," transitioning between the `newView` and `oldView` using any specified"," `options`.",""," The `newView` is attached to the app by rendering it to the `viewContainer`,"," and making this app a bubble target of its events.",""," The `oldView` is detached from the app by removing it from the"," `viewContainer`, and removing this app as a bubble target for its events."," The `oldView` will either be preserved or properly destroyed.",""," **Note:** This method overrides `_uiSetActiveView()` and provides all of its"," functionality plus supports visual transitions. Also, the `activeView`"," attribute is read-only and can be changed by calling the `showView()`"," method.",""," @method _uiTransitionActiveView"," @param {View} newView The View which is now this app's `activeView`."," @param {View} [oldView] The View which was this app's `activeView`."," @param {Object} [options] Optional object containing any of the following"," properties:"," @param {Function} [options.callback] Optional callback function to call"," after new `activeView` is ready to use, the function will be passed:"," @param {View} options.callback.view A reference to the new"," `activeView`."," @param {Boolean} [options.prepend=false] Whether the `view` should be"," prepended instead of appended to the `viewContainer`."," @param {Boolean} [options.render] Whether the `view` should be rendered."," **Note:** If no value is specified, a view instance will only be"," rendered if it's newly created by this method."," @param {Boolean|String} [options.transition] Optional transition override."," A transition can be specified which will override the default, or"," `false` for no transition."," @param {Boolean} [options.update=false] Whether an existing view should"," have its attributes updated by passing the `config` object to its"," `setAttrs()` method. **Note:** This option does not have an effect if"," the `view` instance is created as a result of calling this method."," @protected"," @since 3.5.0"," **/"," _uiTransitionActiveView: function (newView, oldView, options) {"," options || (options = {});",""," var callback = options.callback,"," container, transitioning, isChild, isParent, prepend,"," fx, fxConfig, transitions;",""," // Quits early when to new and old views are the same."," if (newView === oldView) {"," callback && callback.call(this, newView);",""," this._transitioning = false;"," return this._dequeueActiveView();"," }",""," fx = this._getFx(newView, oldView, options.transition);"," isChild = this._isChildView(newView, oldView);"," isParent = !isChild && this._isParentView(newView, oldView);"," prepend = !!options.prepend || isParent;",""," // Preforms simply attach/detach of the new and old view respectively"," // when there's no transition to perform."," if (!fx) {"," this._attachView(newView, prepend);"," this._detachView(oldView);"," callback && callback.call(this, newView);",""," this._transitioning = false;"," return this._dequeueActiveView();"," }",""," this._transitioning = true;",""," container = this.get('container');"," transitioning = Y.App.CLASS_NAMES.transitioning;",""," container.addClass(transitioning);",""," this._attachView(newView, prepend);",""," // Called when view transitions completed, if none were added this will"," // run right away."," function complete() {"," this._detachView(oldView);"," container.removeClass(transitioning);"," callback && callback.call(this, newView);",""," this._transitioning = false;"," return this._dequeueActiveView();"," }",""," // Setup a new stack to run the view transitions in parallel."," transitions = new Y.Parallel({context: this});"," fxConfig = {"," crossView: !!oldView && !!newView,"," prepended: prepend"," };",""," // Transition the new view first to prevent a gap when sliding."," if (newView && fx.viewIn) {"," newView.get('container')"," .transition(fx.viewIn, fxConfig, transitions.add());"," }",""," if (oldView && fx.viewOut) {"," oldView.get('container')"," .transition(fx.viewOut, fxConfig, transitions.add());"," }",""," transitions.done(complete);"," }","};","","// -- Transition fx ------------------------------------------------------------","Y.mix(Y.Transition.fx, {"," 'app:fadeIn': {"," opacity : 1,"," duration: 0.3,",""," on: {"," start: function (data) {"," var styles = {opacity: 0},"," config = data.config;",""," if (config.crossView && !config.prepended) {"," styles.transform = 'translateX(-100%)';"," }",""," this.setStyles(styles);"," },",""," end: function () {"," this.setStyle('transform', 'translateX(0)');"," }"," }"," },",""," 'app:fadeOut': {"," opacity : 0,"," duration: 0.3,",""," on: {"," start: function (data) {"," var styles = {opacity: 1},"," config = data.config;",""," if (config.crossView && config.prepended) {"," styles.transform = 'translateX(-100%)';"," }",""," this.setStyles(styles);"," },",""," end: function () {"," this.setStyle('transform', 'translateX(0)');"," }"," }"," },",""," 'app:slideLeft': {"," duration : 0.3,"," transform: 'translateX(-100%)',",""," on: {"," start: function () {"," this.setStyles({"," opacity : 1,"," transform: 'translateX(0%)'"," });"," },",""," end: function () {"," this.setStyle('transform', 'translateX(0)');"," }"," }"," },",""," 'app:slideRight': {"," duration : 0.3,"," transform: 'translateX(0)',",""," on: {"," start: function () {"," this.setStyles({"," opacity : 1,"," transform: 'translateX(-100%)'"," });"," },",""," end: function () {"," this.setStyle('transform', 'translateX(0)');"," }"," }"," }","});","","// -- Namespacae ---------------------------------------------------------------","Y.App.TransitionsNative = AppTransitionsNative;","Y.Base.mix(Y.App, [AppTransitionsNative]);","","","}, '3.7.1', {\"requires\": [\"app-transitions\", \"app-transitions-css\", \"parallel\", \"transition\"]});"];+_yuitest_coverage["build/app-transitions-native/app-transitions-native.js"].lines = {"1":0,"12":0,"25":0,"27":0,"54":0,"55":0,"58":0,"75":0,"79":0,"82":0,"84":0,"85":0,"88":0,"106":0,"109":0,"110":0,"113":0,"114":0,"117":0,"118":0,"121":0,"122":0,"125":0,"140":0,"142":0,"144":0,"145":0,"148":0,"193":0,"195":0,"200":0,"201":0,"203":0,"204":0,"207":0,"208":0,"209":0,"210":0,"214":0,"215":0,"216":0,"217":0,"219":0,"220":0,"223":0,"225":0,"226":0,"228":0,"230":0,"234":0,"235":0,"236":0,"237":0,"239":0,"240":0,"244":0,"245":0,"251":0,"252":0,"256":0,"257":0,"261":0,"266":0,"273":0,"276":0,"277":0,"280":0,"284":0,"295":0,"298":0,"299":0,"302":0,"306":0,"317":0,"324":0,"335":0,"342":0,"349":0,"350":0};+_yuitest_coverage["build/app-transitions-native/app-transitions-native.js"].functions = {"AppTransitionsNative:25":0,"initializer:53":0,"_dequeueActiveView:74":0,"_getFx:105":0,"_queueActiveView:139":0,"complete:234":0,"_uiTransitionActiveView:192":0,"start:272":0,"end:283":0,"start:294":0,"end:305":0,"start:316":0,"end:323":0,"start:334":0,"end:341":0,"(anonymous 1):1":0};+_yuitest_coverage["build/app-transitions-native/app-transitions-native.js"].coveredLines = 79;+_yuitest_coverage["build/app-transitions-native/app-transitions-native.js"].coveredFunctions = 16;+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 1);+YUI.add('app-transitions-native', function (Y, NAME) {++/**+Provides the implementation of view transitions for `Y.App.Transitions` in+browsers which support native CSS3 transitions.++@module app+@submodule app-transitions-native+@since 3.5.0+**/++_yuitest_coverfunc("build/app-transitions-native/app-transitions-native.js", "(anonymous 1)", 1);+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 12);+var AppTransitions = Y.App.Transitions;++/**+Provides the implementation of view transitions for `Y.App.Transitions` in+browsers which support native CSS3 transitions.++When this module is used, `Y.App.TransitionsNative` will automatically mix+itself in to `Y.App`.++@class App.TransitionsNative+@extensionfor App+@since 3.5.0+**/+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 25);+function AppTransitionsNative() {}++_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 27);+AppTransitionsNative.prototype = {+ // -- Protected Properties -------------------------------------------------++ /**+ Whether this app is currently transitioning its `activeView`.++ @property _transitioning+ @type Boolean+ @default false+ @protected+ @since 3.5.0+ **/++ /**+ A queue that holds pending calls to this app's `_uiTransitionActiveView()`+ method.++ @property _viewTransitionQueue+ @type Array+ @default []+ @protected+ @since 3.5.0+ **/++ // -- Lifecycle Methods ----------------------------------------------------++ initializer: function () {+ _yuitest_coverfunc("build/app-transitions-native/app-transitions-native.js", "initializer", 53);+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 54);+this._transitioning = false;+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 55);+this._viewTransitionQueue = [];++ // TODO: Consider the AOP approach that `Plugin.WidgetAnim` uses.+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 58);+Y.Do.before(this._queueActiveView, this, '_uiSetActiveView');+ },++ // -- Protected Methods ----------------------------------------------------++ /**+ Dequeues any pending calls to `_uiTransitionActiveView()`.++ **Note:** When there is more than one queued transition, only the most+ recent `activeView` change will be visually transitioned, while the others+ will have their `transition` option overridden to `false`.++ @method _dequeueActiveView+ @protected+ @since 3.5.0+ **/+ _dequeueActiveView: function () {+ _yuitest_coverfunc("build/app-transitions-native/app-transitions-native.js", "_dequeueActiveView", 74);+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 75);+var queue = this._viewTransitionQueue,+ transition = queue.shift(),+ options;++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 79);+if (transition) {+ // When items are still left in the queue, override the transition+ // so it does not run.+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 82);+if (queue.length) {+ // Overrides `transition` option and splices in the new options.+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 84);+options = Y.merge(transition[2], {transition: false});+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 85);+transition.splice(2, 1, options);+ }++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 88);+this._uiTransitionActiveView.apply(this, transition);+ }+ },++ /**+ Returns an object containing a named fx for both `viewIn` and `viewOut`+ based on the relationship between the specified `newView` and `oldView`.++ @method _getFx+ @param {View} newView The view being transitioned-in.+ @param {View} oldView The view being transitioned-out.+ @param {String} [transition] The preferred transition to use.+ @return {Object} An object containing a named fx for both `viewIn` and+ `viewOut`.+ @protected+ @since 3.5.0+ **/+ _getFx: function (newView, oldView, transition) {+ _yuitest_coverfunc("build/app-transitions-native/app-transitions-native.js", "_getFx", 105);+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 106);+var fx = AppTransitions.FX,+ transitions = this.get('transitions');++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 109);+if (transition === false || !transitions) {+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 110);+return null;+ }++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 113);+if (transition) {+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 114);+return fx[transition];+ }++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 117);+if (this._isChildView(newView, oldView)) {+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 118);+return fx[transitions.toChild];+ }++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 121);+if (this._isParentView(newView, oldView)) {+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 122);+return fx[transitions.toParent];+ }++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 125);+return fx[transitions.navigate];+ },++ /**+ Queues calls to `_uiTransitionActiveView()` to make sure a currently running+ transition isn't interrupted.++ **Note:** This method prevents the default `_uiSetActiveView()` method from+ running.++ @method _queueActiveView+ @protected+ @since 3.5.0+ **/+ _queueActiveView: function () {+ _yuitest_coverfunc("build/app-transitions-native/app-transitions-native.js", "_queueActiveView", 139);+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 140);+var args = Y.Array(arguments, 0, true);++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 142);+this._viewTransitionQueue.push(args);++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 144);+if (!this._transitioning) {+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 145);+this._dequeueActiveView();+ }++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 148);+return new Y.Do.Prevent();+ },++ /**+ Performs the actual change of this app's `activeView` by visually+ transitioning between the `newView` and `oldView` using any specified+ `options`.++ The `newView` is attached to the app by rendering it to the `viewContainer`,+ and making this app a bubble target of its events.++ The `oldView` is detached from the app by removing it from the+ `viewContainer`, and removing this app as a bubble target for its events.+ The `oldView` will either be preserved or properly destroyed.++ **Note:** This method overrides `_uiSetActiveView()` and provides all of its+ functionality plus supports visual transitions. Also, the `activeView`+ attribute is read-only and can be changed by calling the `showView()`+ method.++ @method _uiTransitionActiveView+ @param {View} newView The View which is now this app's `activeView`.+ @param {View} [oldView] The View which was this app's `activeView`.+ @param {Object} [options] Optional object containing any of the following+ properties:+ @param {Function} [options.callback] Optional callback function to call+ after new `activeView` is ready to use, the function will be passed:+ @param {View} options.callback.view A reference to the new+ `activeView`.+ @param {Boolean} [options.prepend=false] Whether the `view` should be+ prepended instead of appended to the `viewContainer`.+ @param {Boolean} [options.render] Whether the `view` should be rendered.+ **Note:** If no value is specified, a view instance will only be+ rendered if it's newly created by this method.+ @param {Boolean|String} [options.transition] Optional transition override.+ A transition can be specified which will override the default, or+ `false` for no transition.+ @param {Boolean} [options.update=false] Whether an existing view should+ have its attributes updated by passing the `config` object to its+ `setAttrs()` method. **Note:** This option does not have an effect if+ the `view` instance is created as a result of calling this method.+ @protected+ @since 3.5.0+ **/+ _uiTransitionActiveView: function (newView, oldView, options) {+ _yuitest_coverfunc("build/app-transitions-native/app-transitions-native.js", "_uiTransitionActiveView", 192);+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 193);+options || (options = {});++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 195);+var callback = options.callback,+ container, transitioning, isChild, isParent, prepend,+ fx, fxConfig, transitions;++ // Quits early when to new and old views are the same.+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 200);+if (newView === oldView) {+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 201);+callback && callback.call(this, newView);++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 203);+this._transitioning = false;+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 204);+return this._dequeueActiveView();+ }++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 207);+fx = this._getFx(newView, oldView, options.transition);+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 208);+isChild = this._isChildView(newView, oldView);+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 209);+isParent = !isChild && this._isParentView(newView, oldView);+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 210);+prepend = !!options.prepend || isParent;++ // Preforms simply attach/detach of the new and old view respectively+ // when there's no transition to perform.+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 214);+if (!fx) {+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 215);+this._attachView(newView, prepend);+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 216);+this._detachView(oldView);+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 217);+callback && callback.call(this, newView);++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 219);+this._transitioning = false;+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 220);+return this._dequeueActiveView();+ }++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 223);+this._transitioning = true;++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 225);+container = this.get('container');+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 226);+transitioning = Y.App.CLASS_NAMES.transitioning;++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 228);+container.addClass(transitioning);++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 230);+this._attachView(newView, prepend);++ // Called when view transitions completed, if none were added this will+ // run right away.+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 234);+function complete() {+ _yuitest_coverfunc("build/app-transitions-native/app-transitions-native.js", "complete", 234);+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 235);+this._detachView(oldView);+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 236);+container.removeClass(transitioning);+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 237);+callback && callback.call(this, newView);++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 239);+this._transitioning = false;+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 240);+return this._dequeueActiveView();+ }++ // Setup a new stack to run the view transitions in parallel.+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 244);+transitions = new Y.Parallel({context: this});+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 245);+fxConfig = {+ crossView: !!oldView && !!newView,+ prepended: prepend+ };++ // Transition the new view first to prevent a gap when sliding.+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 251);+if (newView && fx.viewIn) {+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 252);+newView.get('container')+ .transition(fx.viewIn, fxConfig, transitions.add());+ }++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 256);+if (oldView && fx.viewOut) {+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 257);+oldView.get('container')+ .transition(fx.viewOut, fxConfig, transitions.add());+ }++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 261);+transitions.done(complete);+ }+};++// -- Transition fx ------------------------------------------------------------+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 266);+Y.mix(Y.Transition.fx, {+ 'app:fadeIn': {+ opacity : 1,+ duration: 0.3,++ on: {+ start: function (data) {+ _yuitest_coverfunc("build/app-transitions-native/app-transitions-native.js", "start", 272);+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 273);+var styles = {opacity: 0},+ config = data.config;++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 276);+if (config.crossView && !config.prepended) {+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 277);+styles.transform = 'translateX(-100%)';+ }++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 280);+this.setStyles(styles);+ },++ end: function () {+ _yuitest_coverfunc("build/app-transitions-native/app-transitions-native.js", "end", 283);+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 284);+this.setStyle('transform', 'translateX(0)');+ }+ }+ },++ 'app:fadeOut': {+ opacity : 0,+ duration: 0.3,++ on: {+ start: function (data) {+ _yuitest_coverfunc("build/app-transitions-native/app-transitions-native.js", "start", 294);+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 295);+var styles = {opacity: 1},+ config = data.config;++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 298);+if (config.crossView && config.prepended) {+ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 299);+styles.transform = 'translateX(-100%)';+ }++ _yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 302);+this.setStyles(styles);+ },++ end: function () {+ _yuitest_coverfunc("build/app-transitions-native/app-transitions-native.js", "end", 305);+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 306);+this.setStyle('transform', 'translateX(0)');+ }+ }+ },++ 'app:slideLeft': {+ duration : 0.3,+ transform: 'translateX(-100%)',++ on: {+ start: function () {+ _yuitest_coverfunc("build/app-transitions-native/app-transitions-native.js", "start", 316);+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 317);+this.setStyles({+ opacity : 1,+ transform: 'translateX(0%)'+ });+ },++ end: function () {+ _yuitest_coverfunc("build/app-transitions-native/app-transitions-native.js", "end", 323);+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 324);+this.setStyle('transform', 'translateX(0)');+ }+ }+ },++ 'app:slideRight': {+ duration : 0.3,+ transform: 'translateX(0)',++ on: {+ start: function () {+ _yuitest_coverfunc("build/app-transitions-native/app-transitions-native.js", "start", 334);+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 335);+this.setStyles({+ opacity : 1,+ transform: 'translateX(-100%)'+ });+ },++ end: function () {+ _yuitest_coverfunc("build/app-transitions-native/app-transitions-native.js", "end", 341);+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 342);+this.setStyle('transform', 'translateX(0)');+ }+ }+ }+});++// -- Namespacae ---------------------------------------------------------------+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 349);+Y.App.TransitionsNative = AppTransitionsNative;+_yuitest_coverline("build/app-transitions-native/app-transitions-native.js", 350);+Y.Base.mix(Y.App, [AppTransitionsNative]);+++}, '3.7.1', {"requires": ["app-transitions", "app-transitions-css", "parallel", "transition"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('app-transitions-native', function(Y) {+YUI.add('app-transitions-native', function (Y, NAME) { /** Provides the implementation of view transitions for `Y.App.Transitions` in@@ -25,6 +25,7 @@ itself in to `Y.App`. @class App.TransitionsNative+@extensionfor App @since 3.5.0 **/ function AppTransitionsNative() {}@@ -228,7 +229,7 @@ this._transitioning = true; container = this.get('container');- transitioning = AppTransitions.CLASS_NAMES.transitioning;+ transitioning = Y.App.CLASS_NAMES.transitioning; container.addClass(transitioning); @@ -355,4 +356,4 @@ Y.Base.mix(Y.App, [AppTransitionsNative]); -}, '3.5.1' ,{requires:['app-transitions', 'app-transitions-css', 'parallel', 'transition']});+}, '3.7.1', {"requires": ["app-transitions", "app-transitions-css", "parallel", "transition"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("app-transitions-native",function(c){var a=c.App.Transitions;function b(){}b.prototype={initializer:function(){this._transitioning=false;this._viewTransitionQueue=[];c.Do.before(this._queueActiveView,this,"_uiSetActiveView");},_dequeueActiveView:function(){var d=this._viewTransitionQueue,f=d.shift(),e;if(f){if(d.length){e=c.merge(f[2],{transition:false});f.splice(2,1,e);}this._uiTransitionActiveView.apply(this,f);}},_getFx:function(h,d,g){var e=a.FX,f=this.get("transitions");if(g===false||!f){return null;}if(g){return e[g];}if(this._isChildView(h,d)){return e[f.toChild];}if(this._isParentView(h,d)){return e[f.toParent];}return e[f.navigate];},_queueActiveView:function(){var d=c.Array(arguments,0,true);this._viewTransitionQueue.push(d);if(!this._transitioning){this._dequeueActiveView();}return new c.Do.Prevent();},_uiTransitionActiveView:function(i,l,p){p||(p={});var n=p.callback,d,m,e,j,o,h,g,k;if(i===l){n&&n.call(this,i);this._transitioning=false;return this._dequeueActiveView();}h=this._getFx(i,l,p.transition);e=this._isChildView(i,l);j=!e&&this._isParentView(i,l);o=!!p.prepend||j;if(!h){this._attachView(i,o);this._detachView(l);n&&n.call(this,i);this._transitioning=false;return this._dequeueActiveView();}this._transitioning=true;d=this.get("container");m=a.CLASS_NAMES.transitioning;d.addClass(m);this._attachView(i,o);function f(){this._detachView(l);d.removeClass(m);n&&n.call(this,i);this._transitioning=false;return this._dequeueActiveView();}k=new c.Parallel({context:this});g={crossView:!!l&&!!i,prepended:o};if(i&&h.viewIn){i.get("container").transition(h.viewIn,g,k.add());}if(l&&h.viewOut){l.get("container").transition(h.viewOut,g,k.add());}k.done(f);}};c.mix(c.Transition.fx,{"app:fadeIn":{opacity:1,duration:0.3,on:{start:function(f){var e={opacity:0},d=f.config;if(d.crossView&&!d.prepended){e.transform="translateX(-100%)";}this.setStyles(e);},end:function(){this.setStyle("transform","translateX(0)");}}},"app:fadeOut":{opacity:0,duration:0.3,on:{start:function(f){var e={opacity:1},d=f.config;if(d.crossView&&d.prepended){e.transform="translateX(-100%)";}this.setStyles(e);},end:function(){this.setStyle("transform","translateX(0)");}}},"app:slideLeft":{duration:0.3,transform:"translateX(-100%)",on:{start:function(){this.setStyles({opacity:1,transform:"translateX(0%)"});},end:function(){this.setStyle("transform","translateX(0)");}}},"app:slideRight":{duration:0.3,transform:"translateX(0)",on:{start:function(){this.setStyles({opacity:1,transform:"translateX(-100%)"});},end:function(){this.setStyle("transform","translateX(0)");}}}});c.App.TransitionsNative=b;c.Base.mix(c.App,[b]);},"3.5.1",{requires:["app-transitions","app-transitions-css","parallel","transition"]});+YUI.add("app-transitions-native",function(e,t){function r(){}var n=e.App.Transitions;r.prototype={initializer:function(){this._transitioning=!1,this._viewTransitionQueue=[],e.Do.before(this._queueActiveView,this,"_uiSetActiveView")},_dequeueActiveView:function(){var t=this._viewTransitionQueue,n=t.shift(),r;n&&(t.length&&(r=e.merge(n[2],{transition:!1}),n.splice(2,1,r)),this._uiTransitionActiveView.apply(this,n))},_getFx:function(e,t,r){var i=n.FX,s=this.get("transitions");return r===!1||!s?null:r?i[r]:this._isChildView(e,t)?i[s.toChild]:this._isParentView(e,t)?i[s.toParent]:i[s.navigate]},_queueActiveView:function(){var t=e.Array(arguments,0,!0);return this._viewTransitionQueue.push(t),this._transitioning||this._dequeueActiveView(),new e.Do.Prevent},_uiTransitionActiveView:function(t,n,r){function p(){return this._detachView(n),s.removeClass(o),i&&i.call(this,t),this._transitioning=!1,this._dequeueActiveView()}r||(r={});var i=r.callback,s,o,u,a,f,l,c,h;if(t===n)return i&&i.call(this,t),this._transitioning=!1,this._dequeueActiveView();l=this._getFx(t,n,r.transition),u=this._isChildView(t,n),a=!u&&this._isParentView(t,n),f=!!r.prepend||a;if(!l)return this._attachView(t,f),this._detachView(n),i&&i.call(this,t),this._transitioning=!1,this._dequeueActiveView();this._transitioning=!0,s=this.get("container"),o=e.App.CLASS_NAMES.transitioning,s.addClass(o),this._attachView(t,f),h=new e.Parallel({context:this}),c={crossView:!!n&&!!t,prepended:f},t&&l.viewIn&&t.get("container").transition(l.viewIn,c,h.add()),n&&l.viewOut&&n.get("container").transition(l.viewOut,c,h.add()),h.done(p)}},e.mix(e.Transition.fx,{"app:fadeIn":{opacity:1,duration:.3,on:{start:function(e){var t={opacity:0},n=e.config;n.crossView&&!n.prepended&&(t.transform="translateX(-100%)"),this.setStyles(t)},end:function(){this.setStyle("transform","translateX(0)")}}},"app:fadeOut":{opacity:0,duration:.3,on:{start:function(e){var t={opacity:1},n=e.config;n.crossView&&n.prepended&&(t.transform="translateX(-100%)"),this.setStyles(t)},end:function(){this.setStyle("transform","translateX(0)")}}},"app:slideLeft":{duration:.3,transform:"translateX(-100%)",on:{start:function(){this.setStyles({opacity:1,transform:"translateX(0%)"})},end:function(){this.setStyle("transform","translateX(0)")}}},"app:slideRight":{duration:.3,transform:"translateX(0)",on:{start:function(){this.setStyles({opacity:1,transform:"translateX(-100%)"})},end:function(){this.setStyle("transform","translateX(0)")}}}}),e.App.TransitionsNative=r,e.Base.mix(e.App,[r])},"3.7.1",{requires:["app-transitions","app-transitions-css","parallel","transition"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('app-transitions-native', function(Y) {+YUI.add('app-transitions-native', function (Y, NAME) { /** Provides the implementation of view transitions for `Y.App.Transitions` in@@ -25,6 +25,7 @@ itself in to `Y.App`. @class App.TransitionsNative+@extensionfor App @since 3.5.0 **/ function AppTransitionsNative() {}@@ -228,7 +229,7 @@ this._transitioning = true; container = this.get('container');- transitioning = AppTransitions.CLASS_NAMES.transitioning;+ transitioning = Y.App.CLASS_NAMES.transitioning; container.addClass(transitioning); @@ -355,4 +356,4 @@ Y.Base.mix(Y.App, [AppTransitionsNative]); -}, '3.5.1' ,{requires:['app-transitions', 'app-transitions-css', 'parallel', 'transition']});+}, '3.7.1', {"requires": ["app-transitions", "app-transitions-css", "parallel", "transition"]});
@@ -0,0 +1,295 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/app-transitions/app-transitions.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/app-transitions/app-transitions.js",+ code: []+};+_yuitest_coverage["build/app-transitions/app-transitions.js"].code=["YUI.add('app-transitions', function (Y, NAME) {","","/**","`Y.App` extension that provides view transitions in browsers which support","native CSS3 transitions.","","@module app","@submodule app-transitions","@since 3.5.0","**/","","/**","`Y.App` extension that provides view transitions in browsers which support","native CSS3 transitions.","","View transitions provide an nice way to move from one \"page\" to the next that is","both pleasant to the user and helps to communicate a hierarchy between sections","of an application.","","When the `\"app-transitions\"` module is used, it will automatically mix itself","into `Y.App` and transition between `activeView` changes using the following","effects:",""," - **`fade`**: Cross-fades between the old an new active views.",""," - **`slideLeft`**: The old and new active views are positioned next to each"," other and both slide to the left.",""," - **`slideRight`**: The old and new active views are positioned next to each"," other and both slide to the right.","","**Note:** Transitions are an opt-in feature and are enabled via an app's","`transitions` attribute.","","@class App.Transitions","@uses App.TransitionsNative","@extensionfor App","@since 3.5.0","**/","function AppTransitions() {}","","AppTransitions.ATTRS = {"," /**"," Whether or not this application should use view transitions, and if so then"," which ones or `true` for the defaults which are specified by the"," `transitions` prototype property.",""," **Note:** Transitions are an opt-in feature and will only be used in"," browsers which support native CSS3 transitions.",""," @attribute transitions"," @type Boolean|Object"," @default false"," @since 3.5.0"," **/"," transitions: {"," setter: '_setTransitions',"," value : false"," }","};","","/**","Collect of transitions -> fx.","","A transition (e.g. \"fade\") is a simple name given to a configuration of fx to","apply, consisting of `viewIn` and `viewOut` properties who's values are names of","fx registered on `Y.Transition.fx`.","","By default transitions: `fade`, `slideLeft`, and `slideRight` have fx defined.","","@property FX","@type Object","@static","@since 3.5.0","**/","AppTransitions.FX = {"," fade: {"," viewIn : 'app:fadeIn',"," viewOut: 'app:fadeOut'"," },",""," slideLeft: {"," viewIn : 'app:slideLeft',"," viewOut: 'app:slideLeft'"," },",""," slideRight: {"," viewIn : 'app:slideRight',"," viewOut: 'app:slideRight'"," }","};","","AppTransitions.prototype = {"," // -- Public Properties ----------------------------------------------------",""," /**"," Default transitions to use when the `activeView` changes.",""," The following are types of changes for which transitions can be defined that"," correspond to the relationship between the new and previous `activeView`:",""," * `navigate`: The default transition to use when changing the `activeView`"," of the application.",""," * `toChild`: The transition to use when the new `activeView` is configured"," as a child of the previously active view via its `parent` property as"," defined in this app's `views`.",""," * `toParent`: The transition to use when the new `activeView` is"," configured as the `parent` of the previously active view as defined in"," this app's `views`.",""," **Note:** Transitions are an opt-in feature and will only be used in"," browsers which support native CSS3 transitions.",""," @property transitions"," @type Object"," @default"," {"," navigate: 'fade',"," toChild : 'slideLeft',"," toParent: 'slideRight'"," }"," @since 3.5.0"," **/"," transitions: {"," navigate: 'fade',"," toChild : 'slideLeft',"," toParent: 'slideRight'"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Sets which view is active/visible for the application. This will set the"," app's `activeView` attribute to the specified `view`.",""," The `view` will be \"attached\" to this app, meaning it will be both rendered"," into this app's `viewContainer` node and all of its events will bubble to"," the app. The previous `activeView` will be \"detached\" from this app.",""," When a string-name is provided for a view which has been registered on this"," app's `views` object, the referenced metadata will be used and the"," `activeView` will be set to either a preserved view instance, or a new"," instance of the registered view will be created using the specified `config`"," object passed-into this method.",""," A callback function can be specified as either the third or fourth argument,"," and this function will be called after the new `view` becomes the"," `activeView`, is rendered to the `viewContainer`, and is ready to use.",""," @example"," var app = new Y.App({"," views: {"," usersView: {"," // Imagine that `Y.UsersView` has been defined."," type: Y.UsersView"," }"," },",""," transitions: true,"," users : new Y.ModelList()"," });",""," app.route('/users/', function () {"," this.showView('usersView', {users: this.get('users')});"," });",""," app.render();"," app.navigate('/uses/');"," // => Creates a new `Y.UsersView` and transitions to it.",""," @method showView"," @param {String|View} view The name of a view defined in the `views` object,"," or a view instance which should become this app's `activeView`."," @param {Object} [config] Optional configuration to use when creating a new"," view instance. This config object can also be used to update an existing"," or preserved view's attributes when `options.update` is `true`."," @param {Object} [options] Optional object containing any of the following"," properties:"," @param {Function} [options.callback] Optional callback function to call"," after new `activeView` is ready to use, the function will be passed:"," @param {View} options.callback.view A reference to the new"," `activeView`."," @param {Boolean} [options.prepend=false] Whether the `view` should be"," prepended instead of appended to the `viewContainer`."," @param {Boolean} [options.render] Whether the `view` should be rendered."," **Note:** If no value is specified, a view instance will only be"," rendered if it's newly created by this method."," @param {Boolean|String} [options.transition] Optional transition override."," A transition can be specified which will override the default, or"," `false` for no transition."," @param {Boolean} [options.update=false] Whether an existing view should"," have its attributes updated by passing the `config` object to its"," `setAttrs()` method. **Note:** This option does not have an effect if"," the `view` instance is created as a result of calling this method."," @param {Function} [callback] Optional callback Function to call after the"," new `activeView` is ready to use. **Note:** this will override"," `options.callback` and it can be specified as either the third or fourth"," argument. The function will be passed the following:"," @param {View} callback.view A reference to the new `activeView`."," @chainable"," @since 3.5.0"," **/"," // Does not override `showView()` but does use `options.transitions`.",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Setter for `transitions` attribute.",""," When specified as `true`, the defaults will be use as specified by the"," `transitions` prototype property.",""," @method _setTransitions"," @param {Boolean|Object} transitions The new `transitions` attribute value."," @return {Mixed} The processed value which represents the new state."," @protected"," @see App.Base.showView()"," @since 3.5.0"," **/"," _setTransitions: function (transitions) {"," var defTransitions = this.transitions;",""," if (transitions && transitions === true) {"," return Y.merge(defTransitions);"," }",""," return transitions;"," }","};","","// -- Namespace ----------------------------------------------------------------","Y.App.Transitions = AppTransitions;","Y.Base.mix(Y.App, [AppTransitions]);","","Y.mix(Y.App.CLASS_NAMES, {"," transitioning: Y.ClassNameManager.getClassName('app', 'transitioning')","});","","","}, '3.7.1', {\"requires\": [\"app-base\"]});"];+_yuitest_coverage["build/app-transitions/app-transitions.js"].lines = {"1":0,"40":0,"42":0,"76":0,"93":0,"223":0,"225":0,"226":0,"229":0,"234":0,"235":0,"237":0};+_yuitest_coverage["build/app-transitions/app-transitions.js"].functions = {"AppTransitions:40":0,"_setTransitions:222":0,"(anonymous 1):1":0};+_yuitest_coverage["build/app-transitions/app-transitions.js"].coveredLines = 12;+_yuitest_coverage["build/app-transitions/app-transitions.js"].coveredFunctions = 3;+_yuitest_coverline("build/app-transitions/app-transitions.js", 1);+YUI.add('app-transitions', function (Y, NAME) {++/**+`Y.App` extension that provides view transitions in browsers which support+native CSS3 transitions.++@module app+@submodule app-transitions+@since 3.5.0+**/++/**+`Y.App` extension that provides view transitions in browsers which support+native CSS3 transitions.++View transitions provide an nice way to move from one "page" to the next that is+both pleasant to the user and helps to communicate a hierarchy between sections+of an application.++When the `"app-transitions"` module is used, it will automatically mix itself+into `Y.App` and transition between `activeView` changes using the following+effects:++ - **`fade`**: Cross-fades between the old an new active views.++ - **`slideLeft`**: The old and new active views are positioned next to each+ other and both slide to the left.++ - **`slideRight`**: The old and new active views are positioned next to each+ other and both slide to the right.++**Note:** Transitions are an opt-in feature and are enabled via an app's+`transitions` attribute.++@class App.Transitions+@uses App.TransitionsNative+@extensionfor App+@since 3.5.0+**/+_yuitest_coverfunc("build/app-transitions/app-transitions.js", "(anonymous 1)", 1);+_yuitest_coverline("build/app-transitions/app-transitions.js", 40);+function AppTransitions() {}++_yuitest_coverline("build/app-transitions/app-transitions.js", 42);+AppTransitions.ATTRS = {+ /**+ Whether or not this application should use view transitions, and if so then+ which ones or `true` for the defaults which are specified by the+ `transitions` prototype property.++ **Note:** Transitions are an opt-in feature and will only be used in+ browsers which support native CSS3 transitions.++ @attribute transitions+ @type Boolean|Object+ @default false+ @since 3.5.0+ **/+ transitions: {+ setter: '_setTransitions',+ value : false+ }+};++/**+Collect of transitions -> fx.++A transition (e.g. "fade") is a simple name given to a configuration of fx to+apply, consisting of `viewIn` and `viewOut` properties who's values are names of+fx registered on `Y.Transition.fx`.++By default transitions: `fade`, `slideLeft`, and `slideRight` have fx defined.++@property FX+@type Object+@static+@since 3.5.0+**/+_yuitest_coverline("build/app-transitions/app-transitions.js", 76);+AppTransitions.FX = {+ fade: {+ viewIn : 'app:fadeIn',+ viewOut: 'app:fadeOut'+ },++ slideLeft: {+ viewIn : 'app:slideLeft',+ viewOut: 'app:slideLeft'+ },++ slideRight: {+ viewIn : 'app:slideRight',+ viewOut: 'app:slideRight'+ }+};++_yuitest_coverline("build/app-transitions/app-transitions.js", 93);+AppTransitions.prototype = {+ // -- Public Properties ----------------------------------------------------++ /**+ Default transitions to use when the `activeView` changes.++ The following are types of changes for which transitions can be defined that+ correspond to the relationship between the new and previous `activeView`:++ * `navigate`: The default transition to use when changing the `activeView`+ of the application.++ * `toChild`: The transition to use when the new `activeView` is configured+ as a child of the previously active view via its `parent` property as+ defined in this app's `views`.++ * `toParent`: The transition to use when the new `activeView` is+ configured as the `parent` of the previously active view as defined in+ this app's `views`.++ **Note:** Transitions are an opt-in feature and will only be used in+ browsers which support native CSS3 transitions.++ @property transitions+ @type Object+ @default+ {+ navigate: 'fade',+ toChild : 'slideLeft',+ toParent: 'slideRight'+ }+ @since 3.5.0+ **/+ transitions: {+ navigate: 'fade',+ toChild : 'slideLeft',+ toParent: 'slideRight'+ },++ // -- Public Methods -------------------------------------------------------++ /**+ Sets which view is active/visible for the application. This will set the+ app's `activeView` attribute to the specified `view`.++ The `view` will be "attached" to this app, meaning it will be both rendered+ into this app's `viewContainer` node and all of its events will bubble to+ the app. The previous `activeView` will be "detached" from this app.++ When a string-name is provided for a view which has been registered on this+ app's `views` object, the referenced metadata will be used and the+ `activeView` will be set to either a preserved view instance, or a new+ instance of the registered view will be created using the specified `config`+ object passed-into this method.++ A callback function can be specified as either the third or fourth argument,+ and this function will be called after the new `view` becomes the+ `activeView`, is rendered to the `viewContainer`, and is ready to use.++ @example+ var app = new Y.App({+ views: {+ usersView: {+ // Imagine that `Y.UsersView` has been defined.+ type: Y.UsersView+ }+ },++ transitions: true,+ users : new Y.ModelList()+ });++ app.route('/users/', function () {+ this.showView('usersView', {users: this.get('users')});+ });++ app.render();+ app.navigate('/uses/');+ // => Creates a new `Y.UsersView` and transitions to it.++ @method showView+ @param {String|View} view The name of a view defined in the `views` object,+ or a view instance which should become this app's `activeView`.+ @param {Object} [config] Optional configuration to use when creating a new+ view instance. This config object can also be used to update an existing+ or preserved view's attributes when `options.update` is `true`.+ @param {Object} [options] Optional object containing any of the following+ properties:+ @param {Function} [options.callback] Optional callback function to call+ after new `activeView` is ready to use, the function will be passed:+ @param {View} options.callback.view A reference to the new+ `activeView`.+ @param {Boolean} [options.prepend=false] Whether the `view` should be+ prepended instead of appended to the `viewContainer`.+ @param {Boolean} [options.render] Whether the `view` should be rendered.+ **Note:** If no value is specified, a view instance will only be+ rendered if it's newly created by this method.+ @param {Boolean|String} [options.transition] Optional transition override.+ A transition can be specified which will override the default, or+ `false` for no transition.+ @param {Boolean} [options.update=false] Whether an existing view should+ have its attributes updated by passing the `config` object to its+ `setAttrs()` method. **Note:** This option does not have an effect if+ the `view` instance is created as a result of calling this method.+ @param {Function} [callback] Optional callback Function to call after the+ new `activeView` is ready to use. **Note:** this will override+ `options.callback` and it can be specified as either the third or fourth+ argument. The function will be passed the following:+ @param {View} callback.view A reference to the new `activeView`.+ @chainable+ @since 3.5.0+ **/+ // Does not override `showView()` but does use `options.transitions`.++ // -- Protected Methods ----------------------------------------------------++ /**+ Setter for `transitions` attribute.++ When specified as `true`, the defaults will be use as specified by the+ `transitions` prototype property.++ @method _setTransitions+ @param {Boolean|Object} transitions The new `transitions` attribute value.+ @return {Mixed} The processed value which represents the new state.+ @protected+ @see App.Base.showView()+ @since 3.5.0+ **/+ _setTransitions: function (transitions) {+ _yuitest_coverfunc("build/app-transitions/app-transitions.js", "_setTransitions", 222);+_yuitest_coverline("build/app-transitions/app-transitions.js", 223);+var defTransitions = this.transitions;++ _yuitest_coverline("build/app-transitions/app-transitions.js", 225);+if (transitions && transitions === true) {+ _yuitest_coverline("build/app-transitions/app-transitions.js", 226);+return Y.merge(defTransitions);+ }++ _yuitest_coverline("build/app-transitions/app-transitions.js", 229);+return transitions;+ }+};++// -- Namespace ----------------------------------------------------------------+_yuitest_coverline("build/app-transitions/app-transitions.js", 234);+Y.App.Transitions = AppTransitions;+_yuitest_coverline("build/app-transitions/app-transitions.js", 235);+Y.Base.mix(Y.App, [AppTransitions]);++_yuitest_coverline("build/app-transitions/app-transitions.js", 237);+Y.mix(Y.App.CLASS_NAMES, {+ transitioning: Y.ClassNameManager.getClassName('app', 'transitioning')+});+++}, '3.7.1', {"requires": ["app-base"]});
@@ -1,14 +1,14 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('app-transitions', function(Y) {+YUI.add('app-transitions', function (Y, NAME) { /**-Provides view transitions for `Y.App` in browsers which support native CSS3-transitions.+`Y.App` extension that provides view transitions in browsers which support+native CSS3 transitions. @module app @submodule app-transitions@@ -16,22 +16,23 @@ **/ /**-Provides view transitions for `Y.App` in browsers which support native CSS3-transitions.+`Y.App` extension that provides view transitions in browsers which support+native CSS3 transitions. View transitions provide an nice way to move from one "page" to the next that is both pleasant to the user and helps to communicate a hierarchy between sections of an application. -When this module is used, it will automatically mix itself in to `Y.App` and-transition between `activeView` changes using the following effects:+When the `"app-transitions"` module is used, it will automatically mix itself+into `Y.App` and transition between `activeView` changes using the following+effects: - * **`fade`**: Cross-fades between the old an new active views.+ - **`fade`**: Cross-fades between the old an new active views. - * **`slideLeft`**: The old and new active views are positioned next to each+ - **`slideLeft`**: The old and new active views are positioned next to each other and both slide to the left. - * **`slideRight`**: The old and new active views are positioned next to each+ - **`slideRight`**: The old and new active views are positioned next to each other and both slide to the right. **Note:** Transitions are an opt-in feature and are enabled via an app's@@ -39,6 +40,7 @@ @class App.Transitions @uses App.TransitionsNative+@extensionfor App @since 3.5.0 **/ function AppTransitions() {}@@ -64,21 +66,6 @@ }; /**-CSS classes used by `App.Transitions`.--When an app is transitioning between `activeView`s, its `container` node will-have the "yui3-app-transitioning" CSS class added.--@property CLASS_NAMES-@type Object-@static-@since 3.5.0-**/-AppTransitions.CLASS_NAMES = {- transitioning: Y.ClassNameManager.getClassName('app', 'transitioning')-};--/** Collect of transitions -> fx. A transition (e.g. "fade") is a simple name given to a configuration of fx to@@ -253,5 +240,9 @@ Y.App.Transitions = AppTransitions; Y.Base.mix(Y.App, [AppTransitions]); +Y.mix(Y.App.CLASS_NAMES, {+ transitioning: Y.ClassNameManager.getClassName('app', 'transitioning')+}); -}, '3.5.1' ,{requires:['app-base']});++}, '3.7.1', {"requires": ["app-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("app-transitions",function(b){function a(){}a.ATTRS={transitions:{setter:"_setTransitions",value:false}};a.CLASS_NAMES={transitioning:b.ClassNameManager.getClassName("app","transitioning")};a.FX={fade:{viewIn:"app:fadeIn",viewOut:"app:fadeOut"},slideLeft:{viewIn:"app:slideLeft",viewOut:"app:slideLeft"},slideRight:{viewIn:"app:slideRight",viewOut:"app:slideRight"}};a.prototype={transitions:{navigate:"fade",toChild:"slideLeft",toParent:"slideRight"},_setTransitions:function(d){var c=this.transitions;if(d&&d===true){return b.merge(c);}return d;}};b.App.Transitions=a;b.Base.mix(b.App,[a]);},"3.5.1",{requires:["app-base"]});+YUI.add("app-transitions",function(e,t){function n(){}n.ATTRS={transitions:{setter:"_setTransitions",value:!1}},n.FX={fade:{viewIn:"app:fadeIn",viewOut:"app:fadeOut"},slideLeft:{viewIn:"app:slideLeft",viewOut:"app:slideLeft"},slideRight:{viewIn:"app:slideRight",viewOut:"app:slideRight"}},n.prototype={transitions:{navigate:"fade",toChild:"slideLeft",toParent:"slideRight"},_setTransitions:function(t){var n=this.transitions;return t&&t===!0?e.merge(n):t}},e.App.Transitions=n,e.Base.mix(e.App,[n]),e.mix(e.App.CLASS_NAMES,{transitioning:e.ClassNameManager.getClassName("app","transitioning")})},"3.7.1",{requires:["app-base"]});
@@ -1,14 +1,14 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('app-transitions', function(Y) {+YUI.add('app-transitions', function (Y, NAME) { /**-Provides view transitions for `Y.App` in browsers which support native CSS3-transitions.+`Y.App` extension that provides view transitions in browsers which support+native CSS3 transitions. @module app @submodule app-transitions@@ -16,22 +16,23 @@ **/ /**-Provides view transitions for `Y.App` in browsers which support native CSS3-transitions.+`Y.App` extension that provides view transitions in browsers which support+native CSS3 transitions. View transitions provide an nice way to move from one "page" to the next that is both pleasant to the user and helps to communicate a hierarchy between sections of an application. -When this module is used, it will automatically mix itself in to `Y.App` and-transition between `activeView` changes using the following effects:+When the `"app-transitions"` module is used, it will automatically mix itself+into `Y.App` and transition between `activeView` changes using the following+effects: - * **`fade`**: Cross-fades between the old an new active views.+ - **`fade`**: Cross-fades between the old an new active views. - * **`slideLeft`**: The old and new active views are positioned next to each+ - **`slideLeft`**: The old and new active views are positioned next to each other and both slide to the left. - * **`slideRight`**: The old and new active views are positioned next to each+ - **`slideRight`**: The old and new active views are positioned next to each other and both slide to the right. **Note:** Transitions are an opt-in feature and are enabled via an app's@@ -39,6 +40,7 @@ @class App.Transitions @uses App.TransitionsNative+@extensionfor App @since 3.5.0 **/ function AppTransitions() {}@@ -64,21 +66,6 @@ }; /**-CSS classes used by `App.Transitions`.--When an app is transitioning between `activeView`s, its `container` node will-have the "yui3-app-transitioning" CSS class added.--@property CLASS_NAMES-@type Object-@static-@since 3.5.0-**/-AppTransitions.CLASS_NAMES = {- transitioning: Y.ClassNameManager.getClassName('app', 'transitioning')-};--/** Collect of transitions -> fx. A transition (e.g. "fade") is a simple name given to a configuration of fx to@@ -253,5 +240,9 @@ Y.App.Transitions = AppTransitions; Y.Base.mix(Y.App, [AppTransitions]); +Y.mix(Y.App.CLASS_NAMES, {+ transitioning: Y.ClassNameManager.getClassName('app', 'transitioning')+}); -}, '3.5.1' ,{requires:['app-base']});++}, '3.7.1', {"requires": ["app-base"]});
@@ -0,0 +1,549 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/array-extras/array-extras.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/array-extras/array-extras.js",+ code: []+};+_yuitest_coverage["build/array-extras/array-extras.js"].code=["YUI.add('array-extras', function (Y, NAME) {","","/**","Adds additional utility methods to the `Y.Array` class.","","@module collection","@submodule array-extras","**/","","var A = Y.Array,"," L = Y.Lang,"," ArrayProto = Array.prototype;","","/**","Returns the index of the last item in the array that contains the specified","value, or `-1` if the value isn't found.","","@method lastIndexOf","@param {Array} a Array to search in.","@param {Any} val Value to search for.","@param {Number} [fromIndex] Index at which to start searching backwards."," Defaults to the array's length - 1. If negative, it will be taken as an offset"," from the end of the array. If the calculated index is less than 0, the array"," will not be searched and `-1` will be returned.","@return {Number} Index of the item that contains the value, or `-1` if not"," found.","@static","@for Array","**/","A.lastIndexOf = L._isNative(ArrayProto.lastIndexOf) ?"," function(a, val, fromIndex) {"," // An undefined fromIndex is still considered a value by some (all?)"," // native implementations, so we can't pass it unless it's actually"," // specified."," return fromIndex || fromIndex === 0 ? a.lastIndexOf(val, fromIndex) :"," a.lastIndexOf(val);"," } :"," function(a, val, fromIndex) {"," var len = a.length,"," i = len - 1;",""," if (fromIndex || fromIndex === 0) {"," i = Math.min(fromIndex < 0 ? len + fromIndex : fromIndex, len);"," }",""," if (i > -1 && len > 0) {"," for (; i > -1; --i) {"," if (i in a && a[i] === val) {"," return i;"," }"," }"," }",""," return -1;"," };","","/**","Returns a copy of the input array with duplicate items removed.","","Note: If the input array only contains strings, the `Y.Array.dedupe()` method is","a much faster alternative.","","@method unique","@param {Array} array Array to dedupe.","@param {Function} [testFn] Custom function to use to test the equality of two"," values. A truthy return value indicates that the values are equal. A falsy"," return value indicates that the values are not equal.",""," @param {Any} testFn.a First value to compare."," @param {Any} testFn.b Second value to compare."," @param {Number} testFn.index Index of the current item in the original"," array."," @param {Array} testFn.array The original array."," @return {Boolean} _true_ if the items are equal, _false_ otherwise.","","@return {Array} Copy of the input array with duplicate items removed.","@static","**/","A.unique = function (array, testFn) {"," var i = 0,"," len = array.length,"," results = [],"," j, result, resultLen, value;",""," // Note the label here. It's used to jump out of the inner loop when a value"," // is not unique."," outerLoop: for (; i < len; i++) {"," value = array[i];",""," // For each value in the input array, iterate through the result array"," // and check for uniqueness against each result value."," for (j = 0, resultLen = results.length; j < resultLen; j++) {"," result = results[j];",""," // If the test function returns true or there's no test function and"," // the value equals the current result item, stop iterating over the"," // results and continue to the next value in the input array."," if (testFn) {"," if (testFn.call(array, value, result, i, array)) {"," continue outerLoop;"," }"," } else if (value === result) {"," continue outerLoop;"," }"," }",""," // If we get this far, that means the current value is not already in"," // the result array, so add it."," results.push(value);"," }",""," return results;","};","","/**","Executes the supplied function on each item in the array. Returns a new array","containing the items for which the supplied function returned a truthy value.","","@method filter","@param {Array} a Array to filter.","@param {Function} f Function to execute on each item.","@param {Object} [o] Optional context object.","@return {Array} Array of items for which the supplied function returned a"," truthy value (empty if it never returned a truthy value).","@static","*/","A.filter = L._isNative(ArrayProto.filter) ?"," function(a, f, o) {"," return ArrayProto.filter.call(a, f, o);"," } :"," function(a, f, o) {"," var i = 0,"," len = a.length,"," results = [],"," item;",""," for (; i < len; ++i) {"," if (i in a) {"," item = a[i];",""," if (f.call(o, item, i, a)) {"," results.push(item);"," }"," }"," }",""," return results;"," };","","/**","The inverse of `Array.filter()`. Executes the supplied function on each item.","Returns a new array containing the items for which the supplied function","returned `false`.","","@method reject","@param {Array} a the array to iterate.","@param {Function} f the function to execute on each item.","@param {object} [o] Optional context object.","@return {Array} The items for which the supplied function returned `false`.","@static","*/","A.reject = function(a, f, o) {"," return A.filter(a, function(item, i, a) {"," return !f.call(o, item, i, a);"," });","};","","/**","Executes the supplied function on each item in the array. Iteration stops if the","supplied function does not return a truthy value.","","@method every","@param {Array} a the array to iterate.","@param {Function} f the function to execute on each item.","@param {Object} [o] Optional context object.","@return {Boolean} `true` if every item in the array returns `true` from the"," supplied function, `false` otherwise.","@static","*/","A.every = L._isNative(ArrayProto.every) ?"," function(a, f, o) {"," return ArrayProto.every.call(a, f, o);"," } :"," function(a, f, o) {"," for (var i = 0, l = a.length; i < l; ++i) {"," if (i in a && !f.call(o, a[i], i, a)) {"," return false;"," }"," }",""," return true;"," };","","/**","Executes the supplied function on each item in the array and returns a new array","containing all the values returned by the supplied function.","","@example",""," // Convert an array of numbers into an array of strings."," Y.Array.map([1, 2, 3, 4], function (item) {"," return '' + item;"," });"," // => ['1', '2', '3', '4']","","@method map","@param {Array} a the array to iterate.","@param {Function} f the function to execute on each item.","@param {object} [o] Optional context object.","@return {Array} A new array containing the return value of the supplied function"," for each item in the original array.","@static","*/","A.map = L._isNative(ArrayProto.map) ?"," function(a, f, o) {"," return ArrayProto.map.call(a, f, o);"," } :"," function(a, f, o) {"," var i = 0,"," len = a.length,"," results = ArrayProto.concat.call(a);",""," for (; i < len; ++i) {"," if (i in a) {"," results[i] = f.call(o, a[i], i, a);"," }"," }",""," return results;"," };","","","/**","Executes the supplied function on each item in the array, \"folding\" the array","into a single value.","","@method reduce","@param {Array} a Array to iterate.","@param {Any} init Initial value to start with.","@param {Function} f Function to execute on each item. This function should"," update and return the value of the computation. It will receive the following"," arguments:"," @param {Any} f.previousValue Value returned from the previous iteration,"," or the initial value if this is the first iteration."," @param {Any} f.currentValue Value of the current item being iterated."," @param {Number} f.index Index of the current item."," @param {Array} f.array Array being iterated.","@param {Object} [o] Optional context object.","@return {Any} Final result from iteratively applying the given function to each"," element in the array.","@static","*/","A.reduce = L._isNative(ArrayProto.reduce) ?"," function(a, init, f, o) {"," // ES5 Array.reduce doesn't support a thisObject, so we need to"," // implement it manually."," return ArrayProto.reduce.call(a, function(init, item, i, a) {"," return f.call(o, init, item, i, a);"," }, init);"," } :"," function(a, init, f, o) {"," var i = 0,"," len = a.length,"," result = init;",""," for (; i < len; ++i) {"," if (i in a) {"," result = f.call(o, result, a[i], i, a);"," }"," }",""," return result;"," };","","/**","Executes the supplied function on each item in the array, searching for the","first item that matches the supplied function.","","@method find","@param {Array} a the array to search.","@param {Function} f the function to execute on each item. Iteration is stopped"," as soon as this function returns `true`.","@param {Object} [o] Optional context object.","@return {Object} the first item that the supplied function returns `true` for,"," or `null` if it never returns `true`.","@static","*/","A.find = function(a, f, o) {"," for (var i = 0, l = a.length; i < l; i++) {"," if (i in a && f.call(o, a[i], i, a)) {"," return a[i];"," }"," }"," return null;","};","","/**","Iterates over an array, returning a new array of all the elements that match the","supplied regular expression.","","@method grep","@param {Array} a Array to iterate over.","@param {RegExp} pattern Regular expression to test against each item.","@return {Array} All the items in the array that produce a match against the"," supplied regular expression. If no items match, an empty array is returned.","@static","*/","A.grep = function(a, pattern) {"," return A.filter(a, function(item, index) {"," return pattern.test(item);"," });","};","","/**","Partitions an array into two new arrays, one with the items for which the","supplied function returns `true`, and one with the items for which the function","returns `false`.","","@method partition","@param {Array} a Array to iterate over.","@param {Function} f Function to execute for each item in the array. It will"," receive the following arguments:"," @param {Any} f.item Current item."," @param {Number} f.index Index of the current item."," @param {Array} f.array The array being iterated.","@param {Object} [o] Optional execution context.","@return {Object} An object with two properties: `matches` and `rejects`. Each is"," an array containing the items that were selected or rejected by the test"," function (or an empty array if none).","@static","*/","A.partition = function(a, f, o) {"," var results = {"," matches: [],"," rejects: []"," };",""," A.each(a, function(item, index) {"," var set = f.call(o, item, index, a) ? results.matches : results.rejects;"," set.push(item);"," });",""," return results;","};","","/**","Creates an array of arrays by pairing the corresponding elements of two arrays","together into a new array.","","@method zip","@param {Array} a Array to iterate over.","@param {Array} a2 Another array whose values will be paired with values of the"," first array.","@return {Array} An array of arrays formed by pairing each element of the first"," array with an item in the second array having the corresponding index.","@static","*/","A.zip = function(a, a2) {"," var results = [];"," A.each(a, function(item, index) {"," results.push([item, a2[index]]);"," });"," return results;","};","","/**","Flattens an array of nested arrays at any abitrary depth into a single, flat","array.","","@method flatten","@param {Array} a Array with nested arrays to flatten.","@return {Array} An array whose nested arrays have been flattened.","@static","@since 3.7.0","**/","A.flatten = function(a) {"," var result = [],"," i, len, val;",""," // Always return an array."," if (!a) {"," return result;"," }",""," for (i = 0, len = a.length; i < len; ++i) {"," val = a[i];",""," if (L.isArray(val)) {"," // Recusively flattens any nested arrays."," result.push.apply(result, A.flatten(val));"," } else {"," result.push(val);"," }"," }",""," return result;","};","","","}, '3.7.1', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/array-extras/array-extras.js"].lines = {"1":0,"10":0,"30":0,"35":0,"39":0,"42":0,"43":0,"46":0,"47":0,"48":0,"49":0,"54":0,"79":0,"80":0,"87":0,"88":0,"92":0,"93":0,"98":0,"99":0,"100":0,"102":0,"103":0,"109":0,"112":0,"127":0,"129":0,"132":0,"137":0,"138":0,"139":0,"141":0,"142":0,"147":0,"162":0,"163":0,"164":0,"180":0,"182":0,"185":0,"186":0,"187":0,"191":0,"214":0,"216":0,"219":0,"223":0,"224":0,"225":0,"229":0,"253":0,"257":0,"258":0,"262":0,"266":0,"267":0,"268":0,"272":0,"288":0,"289":0,"290":0,"291":0,"294":0,"308":0,"309":0,"310":0,"332":0,"333":0,"338":0,"339":0,"340":0,"343":0,"358":0,"359":0,"360":0,"361":0,"363":0,"376":0,"377":0,"381":0,"382":0,"385":0,"386":0,"388":0,"390":0,"392":0,"396":0};+_yuitest_coverage["build/array-extras/array-extras.js"].functions = {"(anonymous 2):31":0,"}:38":0,"unique:79":0,"(anonymous 3):128":0,"}:131":0,"(anonymous 4):163":0,"reject:162":0,"(anonymous 5):181":0,"}:184":0,"(anonymous 6):215":0,"}:218":0,"(anonymous 8):257":0,"(anonymous 7):254":0,"}:261":0,"find:288":0,"(anonymous 9):309":0,"grep:308":0,"(anonymous 10):338":0,"partition:332":0,"(anonymous 11):360":0,"zip:358":0,"flatten:376":0,"(anonymous 1):1":0};+_yuitest_coverage["build/array-extras/array-extras.js"].coveredLines = 87;+_yuitest_coverage["build/array-extras/array-extras.js"].coveredFunctions = 23;+_yuitest_coverline("build/array-extras/array-extras.js", 1);+YUI.add('array-extras', function (Y, NAME) {++/**+Adds additional utility methods to the `Y.Array` class.++@module collection+@submodule array-extras+**/++_yuitest_coverfunc("build/array-extras/array-extras.js", "(anonymous 1)", 1);+_yuitest_coverline("build/array-extras/array-extras.js", 10);+var A = Y.Array,+ L = Y.Lang,+ ArrayProto = Array.prototype;++/**+Returns the index of the last item in the array that contains the specified+value, or `-1` if the value isn't found.++@method lastIndexOf+@param {Array} a Array to search in.+@param {Any} val Value to search for.+@param {Number} [fromIndex] Index at which to start searching backwards.+ Defaults to the array's length - 1. If negative, it will be taken as an offset+ from the end of the array. If the calculated index is less than 0, the array+ will not be searched and `-1` will be returned.+@return {Number} Index of the item that contains the value, or `-1` if not+ found.+@static+@for Array+**/+_yuitest_coverline("build/array-extras/array-extras.js", 30);+A.lastIndexOf = L._isNative(ArrayProto.lastIndexOf) ?+ function(a, val, fromIndex) {+ // An undefined fromIndex is still considered a value by some (all?)+ // native implementations, so we can't pass it unless it's actually+ // specified.+ _yuitest_coverfunc("build/array-extras/array-extras.js", "(anonymous 2)", 31);+_yuitest_coverline("build/array-extras/array-extras.js", 35);+return fromIndex || fromIndex === 0 ? a.lastIndexOf(val, fromIndex) :+ a.lastIndexOf(val);+ } :+ function(a, val, fromIndex) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "}", 38);+_yuitest_coverline("build/array-extras/array-extras.js", 39);+var len = a.length,+ i = len - 1;++ _yuitest_coverline("build/array-extras/array-extras.js", 42);+if (fromIndex || fromIndex === 0) {+ _yuitest_coverline("build/array-extras/array-extras.js", 43);+i = Math.min(fromIndex < 0 ? len + fromIndex : fromIndex, len);+ }++ _yuitest_coverline("build/array-extras/array-extras.js", 46);+if (i > -1 && len > 0) {+ _yuitest_coverline("build/array-extras/array-extras.js", 47);+for (; i > -1; --i) {+ _yuitest_coverline("build/array-extras/array-extras.js", 48);+if (i in a && a[i] === val) {+ _yuitest_coverline("build/array-extras/array-extras.js", 49);+return i;+ }+ }+ }++ _yuitest_coverline("build/array-extras/array-extras.js", 54);+return -1;+ };++/**+Returns a copy of the input array with duplicate items removed.++Note: If the input array only contains strings, the `Y.Array.dedupe()` method is+a much faster alternative.++@method unique+@param {Array} array Array to dedupe.+@param {Function} [testFn] Custom function to use to test the equality of two+ values. A truthy return value indicates that the values are equal. A falsy+ return value indicates that the values are not equal.++ @param {Any} testFn.a First value to compare.+ @param {Any} testFn.b Second value to compare.+ @param {Number} testFn.index Index of the current item in the original+ array.+ @param {Array} testFn.array The original array.+ @return {Boolean} _true_ if the items are equal, _false_ otherwise.++@return {Array} Copy of the input array with duplicate items removed.+@static+**/+_yuitest_coverline("build/array-extras/array-extras.js", 79);+A.unique = function (array, testFn) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "unique", 79);+_yuitest_coverline("build/array-extras/array-extras.js", 80);+var i = 0,+ len = array.length,+ results = [],+ j, result, resultLen, value;++ // Note the label here. It's used to jump out of the inner loop when a value+ // is not unique.+ _yuitest_coverline("build/array-extras/array-extras.js", 87);+outerLoop: for (; i < len; i++) {+ _yuitest_coverline("build/array-extras/array-extras.js", 88);+value = array[i];++ // For each value in the input array, iterate through the result array+ // and check for uniqueness against each result value.+ _yuitest_coverline("build/array-extras/array-extras.js", 92);+for (j = 0, resultLen = results.length; j < resultLen; j++) {+ _yuitest_coverline("build/array-extras/array-extras.js", 93);+result = results[j];++ // If the test function returns true or there's no test function and+ // the value equals the current result item, stop iterating over the+ // results and continue to the next value in the input array.+ _yuitest_coverline("build/array-extras/array-extras.js", 98);+if (testFn) {+ _yuitest_coverline("build/array-extras/array-extras.js", 99);+if (testFn.call(array, value, result, i, array)) {+ _yuitest_coverline("build/array-extras/array-extras.js", 100);+continue outerLoop;+ }+ } else {_yuitest_coverline("build/array-extras/array-extras.js", 102);+if (value === result) {+ _yuitest_coverline("build/array-extras/array-extras.js", 103);+continue outerLoop;+ }}+ }++ // If we get this far, that means the current value is not already in+ // the result array, so add it.+ _yuitest_coverline("build/array-extras/array-extras.js", 109);+results.push(value);+ }++ _yuitest_coverline("build/array-extras/array-extras.js", 112);+return results;+};++/**+Executes the supplied function on each item in the array. Returns a new array+containing the items for which the supplied function returned a truthy value.++@method filter+@param {Array} a Array to filter.+@param {Function} f Function to execute on each item.+@param {Object} [o] Optional context object.+@return {Array} Array of items for which the supplied function returned a+ truthy value (empty if it never returned a truthy value).+@static+*/+_yuitest_coverline("build/array-extras/array-extras.js", 127);+A.filter = L._isNative(ArrayProto.filter) ?+ function(a, f, o) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "(anonymous 3)", 128);+_yuitest_coverline("build/array-extras/array-extras.js", 129);+return ArrayProto.filter.call(a, f, o);+ } :+ function(a, f, o) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "}", 131);+_yuitest_coverline("build/array-extras/array-extras.js", 132);+var i = 0,+ len = a.length,+ results = [],+ item;++ _yuitest_coverline("build/array-extras/array-extras.js", 137);+for (; i < len; ++i) {+ _yuitest_coverline("build/array-extras/array-extras.js", 138);+if (i in a) {+ _yuitest_coverline("build/array-extras/array-extras.js", 139);+item = a[i];++ _yuitest_coverline("build/array-extras/array-extras.js", 141);+if (f.call(o, item, i, a)) {+ _yuitest_coverline("build/array-extras/array-extras.js", 142);+results.push(item);+ }+ }+ }++ _yuitest_coverline("build/array-extras/array-extras.js", 147);+return results;+ };++/**+The inverse of `Array.filter()`. Executes the supplied function on each item.+Returns a new array containing the items for which the supplied function+returned `false`.++@method reject+@param {Array} a the array to iterate.+@param {Function} f the function to execute on each item.+@param {object} [o] Optional context object.+@return {Array} The items for which the supplied function returned `false`.+@static+*/+_yuitest_coverline("build/array-extras/array-extras.js", 162);+A.reject = function(a, f, o) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "reject", 162);+_yuitest_coverline("build/array-extras/array-extras.js", 163);+return A.filter(a, function(item, i, a) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "(anonymous 4)", 163);+_yuitest_coverline("build/array-extras/array-extras.js", 164);+return !f.call(o, item, i, a);+ });+};++/**+Executes the supplied function on each item in the array. Iteration stops if the+supplied function does not return a truthy value.++@method every+@param {Array} a the array to iterate.+@param {Function} f the function to execute on each item.+@param {Object} [o] Optional context object.+@return {Boolean} `true` if every item in the array returns `true` from the+ supplied function, `false` otherwise.+@static+*/+_yuitest_coverline("build/array-extras/array-extras.js", 180);+A.every = L._isNative(ArrayProto.every) ?+ function(a, f, o) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "(anonymous 5)", 181);+_yuitest_coverline("build/array-extras/array-extras.js", 182);+return ArrayProto.every.call(a, f, o);+ } :+ function(a, f, o) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "}", 184);+_yuitest_coverline("build/array-extras/array-extras.js", 185);+for (var i = 0, l = a.length; i < l; ++i) {+ _yuitest_coverline("build/array-extras/array-extras.js", 186);+if (i in a && !f.call(o, a[i], i, a)) {+ _yuitest_coverline("build/array-extras/array-extras.js", 187);+return false;+ }+ }++ _yuitest_coverline("build/array-extras/array-extras.js", 191);+return true;+ };++/**+Executes the supplied function on each item in the array and returns a new array+containing all the values returned by the supplied function.++@example++ // Convert an array of numbers into an array of strings.+ Y.Array.map([1, 2, 3, 4], function (item) {+ return '' + item;+ });+ // => ['1', '2', '3', '4']++@method map+@param {Array} a the array to iterate.+@param {Function} f the function to execute on each item.+@param {object} [o] Optional context object.+@return {Array} A new array containing the return value of the supplied function+ for each item in the original array.+@static+*/+_yuitest_coverline("build/array-extras/array-extras.js", 214);+A.map = L._isNative(ArrayProto.map) ?+ function(a, f, o) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "(anonymous 6)", 215);+_yuitest_coverline("build/array-extras/array-extras.js", 216);+return ArrayProto.map.call(a, f, o);+ } :+ function(a, f, o) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "}", 218);+_yuitest_coverline("build/array-extras/array-extras.js", 219);+var i = 0,+ len = a.length,+ results = ArrayProto.concat.call(a);++ _yuitest_coverline("build/array-extras/array-extras.js", 223);+for (; i < len; ++i) {+ _yuitest_coverline("build/array-extras/array-extras.js", 224);+if (i in a) {+ _yuitest_coverline("build/array-extras/array-extras.js", 225);+results[i] = f.call(o, a[i], i, a);+ }+ }++ _yuitest_coverline("build/array-extras/array-extras.js", 229);+return results;+ };+++/**+Executes the supplied function on each item in the array, "folding" the array+into a single value.++@method reduce+@param {Array} a Array to iterate.+@param {Any} init Initial value to start with.+@param {Function} f Function to execute on each item. This function should+ update and return the value of the computation. It will receive the following+ arguments:+ @param {Any} f.previousValue Value returned from the previous iteration,+ or the initial value if this is the first iteration.+ @param {Any} f.currentValue Value of the current item being iterated.+ @param {Number} f.index Index of the current item.+ @param {Array} f.array Array being iterated.+@param {Object} [o] Optional context object.+@return {Any} Final result from iteratively applying the given function to each+ element in the array.+@static+*/+_yuitest_coverline("build/array-extras/array-extras.js", 253);+A.reduce = L._isNative(ArrayProto.reduce) ?+ function(a, init, f, o) {+ // ES5 Array.reduce doesn't support a thisObject, so we need to+ // implement it manually.+ _yuitest_coverfunc("build/array-extras/array-extras.js", "(anonymous 7)", 254);+_yuitest_coverline("build/array-extras/array-extras.js", 257);+return ArrayProto.reduce.call(a, function(init, item, i, a) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "(anonymous 8)", 257);+_yuitest_coverline("build/array-extras/array-extras.js", 258);+return f.call(o, init, item, i, a);+ }, init);+ } :+ function(a, init, f, o) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "}", 261);+_yuitest_coverline("build/array-extras/array-extras.js", 262);+var i = 0,+ len = a.length,+ result = init;++ _yuitest_coverline("build/array-extras/array-extras.js", 266);+for (; i < len; ++i) {+ _yuitest_coverline("build/array-extras/array-extras.js", 267);+if (i in a) {+ _yuitest_coverline("build/array-extras/array-extras.js", 268);+result = f.call(o, result, a[i], i, a);+ }+ }++ _yuitest_coverline("build/array-extras/array-extras.js", 272);+return result;+ };++/**+Executes the supplied function on each item in the array, searching for the+first item that matches the supplied function.++@method find+@param {Array} a the array to search.+@param {Function} f the function to execute on each item. Iteration is stopped+ as soon as this function returns `true`.+@param {Object} [o] Optional context object.+@return {Object} the first item that the supplied function returns `true` for,+ or `null` if it never returns `true`.+@static+*/+_yuitest_coverline("build/array-extras/array-extras.js", 288);+A.find = function(a, f, o) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "find", 288);+_yuitest_coverline("build/array-extras/array-extras.js", 289);+for (var i = 0, l = a.length; i < l; i++) {+ _yuitest_coverline("build/array-extras/array-extras.js", 290);+if (i in a && f.call(o, a[i], i, a)) {+ _yuitest_coverline("build/array-extras/array-extras.js", 291);+return a[i];+ }+ }+ _yuitest_coverline("build/array-extras/array-extras.js", 294);+return null;+};++/**+Iterates over an array, returning a new array of all the elements that match the+supplied regular expression.++@method grep+@param {Array} a Array to iterate over.+@param {RegExp} pattern Regular expression to test against each item.+@return {Array} All the items in the array that produce a match against the+ supplied regular expression. If no items match, an empty array is returned.+@static+*/+_yuitest_coverline("build/array-extras/array-extras.js", 308);+A.grep = function(a, pattern) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "grep", 308);+_yuitest_coverline("build/array-extras/array-extras.js", 309);+return A.filter(a, function(item, index) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "(anonymous 9)", 309);+_yuitest_coverline("build/array-extras/array-extras.js", 310);+return pattern.test(item);+ });+};++/**+Partitions an array into two new arrays, one with the items for which the+supplied function returns `true`, and one with the items for which the function+returns `false`.++@method partition+@param {Array} a Array to iterate over.+@param {Function} f Function to execute for each item in the array. It will+ receive the following arguments:+ @param {Any} f.item Current item.+ @param {Number} f.index Index of the current item.+ @param {Array} f.array The array being iterated.+@param {Object} [o] Optional execution context.+@return {Object} An object with two properties: `matches` and `rejects`. Each is+ an array containing the items that were selected or rejected by the test+ function (or an empty array if none).+@static+*/+_yuitest_coverline("build/array-extras/array-extras.js", 332);+A.partition = function(a, f, o) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "partition", 332);+_yuitest_coverline("build/array-extras/array-extras.js", 333);+var results = {+ matches: [],+ rejects: []+ };++ _yuitest_coverline("build/array-extras/array-extras.js", 338);+A.each(a, function(item, index) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "(anonymous 10)", 338);+_yuitest_coverline("build/array-extras/array-extras.js", 339);+var set = f.call(o, item, index, a) ? results.matches : results.rejects;+ _yuitest_coverline("build/array-extras/array-extras.js", 340);+set.push(item);+ });++ _yuitest_coverline("build/array-extras/array-extras.js", 343);+return results;+};++/**+Creates an array of arrays by pairing the corresponding elements of two arrays+together into a new array.++@method zip+@param {Array} a Array to iterate over.+@param {Array} a2 Another array whose values will be paired with values of the+ first array.+@return {Array} An array of arrays formed by pairing each element of the first+ array with an item in the second array having the corresponding index.+@static+*/+_yuitest_coverline("build/array-extras/array-extras.js", 358);+A.zip = function(a, a2) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "zip", 358);+_yuitest_coverline("build/array-extras/array-extras.js", 359);+var results = [];+ _yuitest_coverline("build/array-extras/array-extras.js", 360);+A.each(a, function(item, index) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "(anonymous 11)", 360);+_yuitest_coverline("build/array-extras/array-extras.js", 361);+results.push([item, a2[index]]);+ });+ _yuitest_coverline("build/array-extras/array-extras.js", 363);+return results;+};++/**+Flattens an array of nested arrays at any abitrary depth into a single, flat+array.++@method flatten+@param {Array} a Array with nested arrays to flatten.+@return {Array} An array whose nested arrays have been flattened.+@static+@since 3.7.0+**/+_yuitest_coverline("build/array-extras/array-extras.js", 376);+A.flatten = function(a) {+ _yuitest_coverfunc("build/array-extras/array-extras.js", "flatten", 376);+_yuitest_coverline("build/array-extras/array-extras.js", 377);+var result = [],+ i, len, val;++ // Always return an array.+ _yuitest_coverline("build/array-extras/array-extras.js", 381);+if (!a) {+ _yuitest_coverline("build/array-extras/array-extras.js", 382);+return result;+ }++ _yuitest_coverline("build/array-extras/array-extras.js", 385);+for (i = 0, len = a.length; i < len; ++i) {+ _yuitest_coverline("build/array-extras/array-extras.js", 386);+val = a[i];++ _yuitest_coverline("build/array-extras/array-extras.js", 388);+if (L.isArray(val)) {+ // Recusively flattens any nested arrays.+ _yuitest_coverline("build/array-extras/array-extras.js", 390);+result.push.apply(result, A.flatten(val));+ } else {+ _yuitest_coverline("build/array-extras/array-extras.js", 392);+result.push(val);+ }+ }++ _yuitest_coverline("build/array-extras/array-extras.js", 396);+return result;+};+++}, '3.7.1', {"requires": ["yui-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('array-extras', function(Y) {+YUI.add('array-extras', function (Y, NAME) { /** Adds additional utility methods to the `Y.Array` class.@@ -61,52 +61,58 @@ }; /**-Returns a copy of the specified array with duplicate items removed.+Returns a copy of the input array with duplicate items removed. +Note: If the input array only contains strings, the `Y.Array.dedupe()` method is+a much faster alternative.+ @method unique-@param {Array} a Array to dedupe.-@return {Array} Copy of the array with duplicate items removed.+@param {Array} array Array to dedupe.+@param {Function} [testFn] Custom function to use to test the equality of two+ values. A truthy return value indicates that the values are equal. A falsy+ return value indicates that the values are not equal.++ @param {Any} testFn.a First value to compare.+ @param {Any} testFn.b Second value to compare.+ @param {Number} testFn.index Index of the current item in the original+ array.+ @param {Array} testFn.array The original array.+ @return {Boolean} _true_ if the items are equal, _false_ otherwise.++@return {Array} Copy of the input array with duplicate items removed. @static **/-A.unique = function(a, sort) {- // Note: the sort param is deprecated and intentionally undocumented since- // YUI 3.3.0. It never did what the API docs said it did (see the older- // comment below as well).+A.unique = function (array, testFn) { var i = 0,- len = a.length,+ len = array.length, results = [],- item, j;+ j, result, resultLen, value; - for (; i < len; ++i) {- item = a[i];+ // Note the label here. It's used to jump out of the inner loop when a value+ // is not unique.+ outerLoop: for (; i < len; i++) {+ value = array[i]; - // This loop iterates over the results array in reverse order and stops- // if it finds an item that matches the current input array item (a- // dupe). If it makes it all the way through without finding a dupe, the- // current item is pushed onto the results array.- for (j = results.length; j > -1; --j) {- if (item === results[j]) {- break;+ // For each value in the input array, iterate through the result array+ // and check for uniqueness against each result value.+ for (j = 0, resultLen = results.length; j < resultLen; j++) {+ result = results[j];++ // If the test function returns true or there's no test function and+ // the value equals the current result item, stop iterating over the+ // results and continue to the next value in the input array.+ if (testFn) {+ if (testFn.call(array, value, result, i, array)) {+ continue outerLoop;+ }+ } else if (value === result) {+ continue outerLoop; } } - if (j === -1) {- results.push(item);- }- }-- // Note: the sort option doesn't really belong here... I think it was added- // because there was a way to fast path the two operations together. That- // implementation was not working, so I replaced it with the following.- // Leaving it in so that the API doesn't get broken.- if (sort) {- Y.log('The sort parameter is deprecated and will be removed in a future version of YUI.', 'warn', 'deprecated');-- if (L.isNumber(results[0])) {- results.sort(A.numericSort);- } else {- results.sort();- }+ // If we get this far, that means the current value is not already in+ // the result array, so add it.+ results.push(value); } return results;@@ -126,7 +132,7 @@ */ A.filter = L._isNative(ArrayProto.filter) ? function(a, f, o) {- return a.filter(f, o);+ return ArrayProto.filter.call(a, f, o); } : function(a, f, o) { var i = 0,@@ -179,7 +185,7 @@ */ A.every = L._isNative(ArrayProto.every) ? function(a, f, o) {- return a.every(f, o);+ return ArrayProto.every.call(a, f, o); } : function(a, f, o) { for (var i = 0, l = a.length; i < l; ++i) {@@ -213,12 +219,12 @@ */ A.map = L._isNative(ArrayProto.map) ? function(a, f, o) {- return a.map(f, o);+ return ArrayProto.map.call(a, f, o); } : function(a, f, o) { var i = 0, len = a.length,- results = a.concat();+ results = ArrayProto.concat.call(a); for (; i < len; ++i) { if (i in a) {@@ -254,7 +260,7 @@ function(a, init, f, o) { // ES5 Array.reduce doesn't support a thisObject, so we need to // implement it manually.- return a.reduce(function(init, item, i, a) {+ return ArrayProto.reduce.call(a, function(init, item, i, a) { return f.call(o, init, item, i, a); }, init); } :@@ -363,5 +369,38 @@ return results; }; +/**+Flattens an array of nested arrays at any abitrary depth into a single, flat+array. -}, '3.5.1' ,{requires:['yui-base']});+@method flatten+@param {Array} a Array with nested arrays to flatten.+@return {Array} An array whose nested arrays have been flattened.+@static+@since 3.7.0+**/+A.flatten = function(a) {+ var result = [],+ i, len, val;++ // Always return an array.+ if (!a) {+ return result;+ }++ for (i = 0, len = a.length; i < len; ++i) {+ val = a[i];++ if (L.isArray(val)) {+ // Recusively flattens any nested arrays.+ result.push.apply(result, A.flatten(val));+ } else {+ result.push(val);+ }+ }++ return result;+};+++}, '3.7.1', {"requires": ["yui-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("array-extras",function(d){var b=d.Array,a=d.Lang,c=Array.prototype;b.lastIndexOf=a._isNative(c.lastIndexOf)?function(e,g,f){return f||f===0?e.lastIndexOf(g,f):e.lastIndexOf(g);}:function(f,j,h){var e=f.length,g=e-1;if(h||h===0){g=Math.min(h<0?e+h:h,e);}if(g>-1&&e>0){for(;g>-1;--g){if(g in f&&f[g]===j){return g;}}}return -1;};b.unique=function(f,l){var k=0,e=f.length,h=[],m,g;for(;k<e;++k){m=f[k];for(g=h.length;g>-1;--g){if(m===h[g]){break;}}if(g===-1){h.push(m);}}if(l){if(a.isNumber(h[0])){h.sort(b.numericSort);}else{h.sort();}}return h;};b.filter=a._isNative(c.filter)?function(e,g,h){return e.filter(g,h);}:function(g,l,m){var j=0,e=g.length,h=[],k;for(;j<e;++j){if(j in g){k=g[j];if(l.call(m,k,j,g)){h.push(k);}}}return h;};b.reject=function(e,g,h){return b.filter(e,function(k,j,f){return !g.call(h,k,j,f);});};b.every=a._isNative(c.every)?function(e,g,h){return e.every(g,h);}:function(g,j,k){for(var h=0,e=g.length;h<e;++h){if(h in g&&!j.call(k,g[h],h,g)){return false;}}return true;};b.map=a._isNative(c.map)?function(e,g,h){return e.map(g,h);}:function(g,k,l){var j=0,e=g.length,h=g.concat();for(;j<e;++j){if(j in g){h[j]=k.call(l,g[j],j,g);}}return h;};b.reduce=a._isNative(c.reduce)?function(e,i,g,h){return e.reduce(function(l,k,j,f){return g.call(h,l,k,j,f);},i);}:function(h,m,k,l){var j=0,g=h.length,e=m;for(;j<g;++j){if(j in h){e=k.call(l,e,h[j],j,h);}}return e;};b.find=function(g,j,k){for(var h=0,e=g.length;h<e;h++){if(h in g&&j.call(k,g[h],h,g)){return g[h];}}return null;};b.grep=function(e,f){return b.filter(e,function(h,g){return f.test(h);});};b.partition=function(e,h,i){var g={matches:[],rejects:[]};b.each(e,function(j,f){var k=h.call(i,j,f,e)?g.matches:g.rejects;k.push(j);});return g;};b.zip=function(f,e){var g=[];b.each(f,function(i,h){g.push([i,e[h]]);});return g;};},"3.5.1",{requires:["yui-base"]});+YUI.add("array-extras",function(e,t){var n=e.Array,r=e.Lang,i=Array.prototype;n.lastIndexOf=r._isNative(i.lastIndexOf)?function(e,t,n){return n||n===0?e.lastIndexOf(t,n):e.lastIndexOf(t)}:function(e,t,n){var r=e.length,i=r-1;if(n||n===0)i=Math.min(n<0?r+n:n,r);if(i>-1&&r>0)for(;i>-1;--i)if(i in e&&e[i]===t)return i;return-1},n.unique=function(e,t){var n=0,r=e.length,i=[],s,o,u,a;e:for(;n<r;n++){a=e[n];for(s=0,u=i.length;s<u;s++){o=i[s];if(t){if(t.call(e,a,o,n,e))continue e}else if(a===o)continue e}i.push(a)}return i},n.filter=r._isNative(i.filter)?function(e,t,n){return i.filter.call(e,t,n)}:function(e,t,n){var r=0,i=e.length,s=[],o;for(;r<i;++r)r in e&&(o=e[r],t.call(n,o,r,e)&&s.push(o));return s},n.reject=function(e,t,r){return n.filter(e,function(e,n,i){return!t.call(r,e,n,i)})},n.every=r._isNative(i.every)?function(e,t,n){return i.every.call(e,t,n)}:function(e,t,n){for(var r=0,i=e.length;r<i;++r)if(r in e&&!t.call(n,e[r],r,e))return!1;return!0},n.map=r._isNative(i.map)?function(e,t,n){return i.map.call(e,t,n)}:function(e,t,n){var r=0,s=e.length,o=i.concat.call(e);for(;r<s;++r)r in e&&(o[r]=t.call(n,e[r],r,e));return o},n.reduce=r._isNative(i.reduce)?function(e,t,n,r){return i.reduce.call(e,function(e,t,i,s){return n.call(r,e,t,i,s)},t)}:function(e,t,n,r){var i=0,s=e.length,o=t;for(;i<s;++i)i in e&&(o=n.call(r,o,e[i],i,e));return o},n.find=function(e,t,n){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r,e))return e[r];return null},n.grep=function(e,t){return n.filter(e,function(e,n){return t.test(e)})},n.partition=function(e,t,r){var i={matches:[],rejects:[]};return n.each(e,function(n,s){var u=t.call(r,n,s,e)?i.matches:i.rejects;u.push(n)}),i},n.zip=function(e,t){var r=[];return n.each(e,function(e,n){r.push([e,t[n]])}),r},n.flatten=function(e){var t=[],i,s,o;if(!e)return t;for(i=0,s=e.length;i<s;++i)o=e[i],r.isArray(o)?t.push.apply(t,n.flatten(o)):t.push(o);return t}},"3.7.1",{requires:["yui-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('array-extras', function(Y) {+YUI.add('array-extras', function (Y, NAME) { /** Adds additional utility methods to the `Y.Array` class.@@ -61,51 +61,58 @@ }; /**-Returns a copy of the specified array with duplicate items removed.+Returns a copy of the input array with duplicate items removed. +Note: If the input array only contains strings, the `Y.Array.dedupe()` method is+a much faster alternative.+ @method unique-@param {Array} a Array to dedupe.-@return {Array} Copy of the array with duplicate items removed.+@param {Array} array Array to dedupe.+@param {Function} [testFn] Custom function to use to test the equality of two+ values. A truthy return value indicates that the values are equal. A falsy+ return value indicates that the values are not equal.++ @param {Any} testFn.a First value to compare.+ @param {Any} testFn.b Second value to compare.+ @param {Number} testFn.index Index of the current item in the original+ array.+ @param {Array} testFn.array The original array.+ @return {Boolean} _true_ if the items are equal, _false_ otherwise.++@return {Array} Copy of the input array with duplicate items removed. @static **/-A.unique = function(a, sort) {- // Note: the sort param is deprecated and intentionally undocumented since- // YUI 3.3.0. It never did what the API docs said it did (see the older- // comment below as well).+A.unique = function (array, testFn) { var i = 0,- len = a.length,+ len = array.length, results = [],- item, j;+ j, result, resultLen, value; - for (; i < len; ++i) {- item = a[i];+ // Note the label here. It's used to jump out of the inner loop when a value+ // is not unique.+ outerLoop: for (; i < len; i++) {+ value = array[i]; - // This loop iterates over the results array in reverse order and stops- // if it finds an item that matches the current input array item (a- // dupe). If it makes it all the way through without finding a dupe, the- // current item is pushed onto the results array.- for (j = results.length; j > -1; --j) {- if (item === results[j]) {- break;+ // For each value in the input array, iterate through the result array+ // and check for uniqueness against each result value.+ for (j = 0, resultLen = results.length; j < resultLen; j++) {+ result = results[j];++ // If the test function returns true or there's no test function and+ // the value equals the current result item, stop iterating over the+ // results and continue to the next value in the input array.+ if (testFn) {+ if (testFn.call(array, value, result, i, array)) {+ continue outerLoop;+ }+ } else if (value === result) {+ continue outerLoop; } } - if (j === -1) {- results.push(item);- }- }-- // Note: the sort option doesn't really belong here... I think it was added- // because there was a way to fast path the two operations together. That- // implementation was not working, so I replaced it with the following.- // Leaving it in so that the API doesn't get broken.- if (sort) {-- if (L.isNumber(results[0])) {- results.sort(A.numericSort);- } else {- results.sort();- }+ // If we get this far, that means the current value is not already in+ // the result array, so add it.+ results.push(value); } return results;@@ -125,7 +132,7 @@ */ A.filter = L._isNative(ArrayProto.filter) ? function(a, f, o) {- return a.filter(f, o);+ return ArrayProto.filter.call(a, f, o); } : function(a, f, o) { var i = 0,@@ -178,7 +185,7 @@ */ A.every = L._isNative(ArrayProto.every) ? function(a, f, o) {- return a.every(f, o);+ return ArrayProto.every.call(a, f, o); } : function(a, f, o) { for (var i = 0, l = a.length; i < l; ++i) {@@ -212,12 +219,12 @@ */ A.map = L._isNative(ArrayProto.map) ? function(a, f, o) {- return a.map(f, o);+ return ArrayProto.map.call(a, f, o); } : function(a, f, o) { var i = 0, len = a.length,- results = a.concat();+ results = ArrayProto.concat.call(a); for (; i < len; ++i) { if (i in a) {@@ -253,7 +260,7 @@ function(a, init, f, o) { // ES5 Array.reduce doesn't support a thisObject, so we need to // implement it manually.- return a.reduce(function(init, item, i, a) {+ return ArrayProto.reduce.call(a, function(init, item, i, a) { return f.call(o, init, item, i, a); }, init); } :@@ -362,5 +369,38 @@ return results; }; +/**+Flattens an array of nested arrays at any abitrary depth into a single, flat+array. -}, '3.5.1' ,{requires:['yui-base']});+@method flatten+@param {Array} a Array with nested arrays to flatten.+@return {Array} An array whose nested arrays have been flattened.+@static+@since 3.7.0+**/+A.flatten = function(a) {+ var result = [],+ i, len, val;++ // Always return an array.+ if (!a) {+ return result;+ }++ for (i = 0, len = a.length; i < len; ++i) {+ val = a[i];++ if (L.isArray(val)) {+ // Recusively flattens any nested arrays.+ result.push.apply(result, A.flatten(val));+ } else {+ result.push(val);+ }+ }++ return result;+};+++}, '3.7.1', {"requires": ["yui-base"]});
@@ -0,0 +1,89 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/array-invoke/array-invoke.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/array-invoke/array-invoke.js",+ code: []+};+_yuitest_coverage["build/array-invoke/array-invoke.js"].code=["YUI.add('array-invoke', function (Y, NAME) {","","/**","@module collection","@submodule array-invoke","*/","","/**","Executes a named method on each item in an array of objects. Items in the array","that do not have a function by that name will be skipped.","","@example",""," Y.Array.invoke(arrayOfDrags, 'plug', Y.Plugin.DDProxy);","","@method invoke","@param {Array} items Array of objects supporting the named method.","@param {String} name the name of the method to execute on each item.","@param {Any} [args*] Any number of additional args are passed as parameters to"," the execution of the named method.","@return {Array} All return values, indexed according to the item index.","@static","@for Array","**/","Y.Array.invoke = function(items, name) {"," var args = Y.Array(arguments, 2, true),"," isFunction = Y.Lang.isFunction,"," ret = [];",""," Y.Array.each(Y.Array(items), function(item, i) {"," if (item && isFunction(item[name])) {"," ret[i] = item[name].apply(item, args);"," }"," });",""," return ret;","};","","","}, '3.7.1', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/array-invoke/array-invoke.js"].lines = {"1":0,"25":0,"26":0,"30":0,"31":0,"32":0,"36":0};+_yuitest_coverage["build/array-invoke/array-invoke.js"].functions = {"(anonymous 2):30":0,"invoke:25":0,"(anonymous 1):1":0};+_yuitest_coverage["build/array-invoke/array-invoke.js"].coveredLines = 7;+_yuitest_coverage["build/array-invoke/array-invoke.js"].coveredFunctions = 3;+_yuitest_coverline("build/array-invoke/array-invoke.js", 1);+YUI.add('array-invoke', function (Y, NAME) {++/**+@module collection+@submodule array-invoke+*/++/**+Executes a named method on each item in an array of objects. Items in the array+that do not have a function by that name will be skipped.++@example++ Y.Array.invoke(arrayOfDrags, 'plug', Y.Plugin.DDProxy);++@method invoke+@param {Array} items Array of objects supporting the named method.+@param {String} name the name of the method to execute on each item.+@param {Any} [args*] Any number of additional args are passed as parameters to+ the execution of the named method.+@return {Array} All return values, indexed according to the item index.+@static+@for Array+**/+_yuitest_coverfunc("build/array-invoke/array-invoke.js", "(anonymous 1)", 1);+_yuitest_coverline("build/array-invoke/array-invoke.js", 25);+Y.Array.invoke = function(items, name) {+ _yuitest_coverfunc("build/array-invoke/array-invoke.js", "invoke", 25);+_yuitest_coverline("build/array-invoke/array-invoke.js", 26);+var args = Y.Array(arguments, 2, true),+ isFunction = Y.Lang.isFunction,+ ret = [];++ _yuitest_coverline("build/array-invoke/array-invoke.js", 30);+Y.Array.each(Y.Array(items), function(item, i) {+ _yuitest_coverfunc("build/array-invoke/array-invoke.js", "(anonymous 2)", 30);+_yuitest_coverline("build/array-invoke/array-invoke.js", 31);+if (item && isFunction(item[name])) {+ _yuitest_coverline("build/array-invoke/array-invoke.js", 32);+ret[i] = item[name].apply(item, args);+ }+ });++ _yuitest_coverline("build/array-invoke/array-invoke.js", 36);+return ret;+};+++}, '3.7.1', {"requires": ["yui-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('array-invoke', function(Y) {+YUI.add('array-invoke', function (Y, NAME) { /** @module collection@@ -43,4 +43,4 @@ }; -}, '3.5.1' ,{requires:['yui-base']});+}, '3.7.1', {"requires": ["yui-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("array-invoke",function(a){a.Array.invoke=function(b,e){var d=a.Array(arguments,2,true),f=a.Lang.isFunction,c=[];a.Array.each(a.Array(b),function(h,g){if(h&&f(h[e])){c[g]=h[e].apply(h,d);}});return c;};},"3.5.1",{requires:["yui-base"]});+YUI.add("array-invoke",function(e,t){e.Array.invoke=function(t,n){var r=e.Array(arguments,2,!0),i=e.Lang.isFunction,s=[];return e.Array.each(e.Array(t),function(e,t){e&&i(e[n])&&(s[t]=e[n].apply(e,r))}),s}},"3.7.1",{requires:["yui-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('array-invoke', function(Y) {+YUI.add('array-invoke', function (Y, NAME) { /** @module collection@@ -43,4 +43,4 @@ }; -}, '3.5.1' ,{requires:['yui-base']});+}, '3.7.1', {"requires": ["yui-base"]});
@@ -0,0 +1,145 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/arraylist-add/arraylist-add.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/arraylist-add/arraylist-add.js",+ code: []+};+_yuitest_coverage["build/arraylist-add/arraylist-add.js"].code=["YUI.add('arraylist-add', function (Y, NAME) {","","/**"," * Collection utilities beyond what is provided in the YUI core"," * @module collection"," * @submodule arraylist-add"," * @deprecated Use ModelList or a custom ArrayList subclass"," */","","/*"," * Adds methods add and remove to Y.ArrayList"," */","Y.mix(Y.ArrayList.prototype, {",""," /**"," * Add a single item to the ArrayList. Does not prevent duplicates."," *"," * @method add"," * @param { mixed } item Item presumably of the same type as others in the"," * ArrayList."," * @param {Number} index (Optional.) Number representing the position at"," * which the item should be inserted."," * @return {ArrayList} the instance."," * @for ArrayList"," * @deprecated Use ModelList or a custom ArrayList subclass"," * @chainable"," */"," add: function(item, index) {"," var items = this._items;",""," if (Y.Lang.isNumber(index)) {"," items.splice(index, 0, item);"," }"," else {"," items.push(item);"," }",""," return this;"," },",""," /**"," * Removes first or all occurrences of an item to the ArrayList. If a"," * comparator is not provided, uses itemsAreEqual method to determine"," * matches."," *"," * @method remove"," * @param { mixed } needle Item to find and remove from the list."," * @param { Boolean } all If true, remove all occurrences."," * @param { Function } comparator optional a/b function to test equivalence."," * @return {ArrayList} the instance."," * @for ArrayList"," * @deprecated Use ModelList or a custom ArrayList subclass"," * @chainable"," */"," remove: function(needle, all, comparator) {"," comparator = comparator || this.itemsAreEqual;",""," for (var i = this._items.length - 1; i >= 0; --i) {"," if (comparator.call(this, needle, this.item(i))) {"," this._items.splice(i, 1);"," if (!all) {"," break;"," }"," }"," }",""," return this;"," },",""," /**"," * Default comparator for items stored in this list. Used by remove()."," *"," * @method itemsAreEqual"," * @param { mixed } a item to test equivalence with."," * @param { mixed } b other item to test equivalance."," * @return { Boolean } true if items are deemed equivalent."," * @for ArrayList"," * @deprecated Use ModelList or a custom ArrayList subclass"," */"," itemsAreEqual: function(a, b) {"," return a === b;"," }","","});","","","}, '3.7.1', {\"requires\": [\"arraylist\"]});"];+_yuitest_coverage["build/arraylist-add/arraylist-add.js"].lines = {"1":0,"13":0,"29":0,"31":0,"32":0,"35":0,"38":0,"56":0,"58":0,"59":0,"60":0,"61":0,"62":0,"67":0,"81":0};+_yuitest_coverage["build/arraylist-add/arraylist-add.js"].functions = {"add:28":0,"remove:55":0,"itemsAreEqual:80":0,"(anonymous 1):1":0};+_yuitest_coverage["build/arraylist-add/arraylist-add.js"].coveredLines = 15;+_yuitest_coverage["build/arraylist-add/arraylist-add.js"].coveredFunctions = 4;+_yuitest_coverline("build/arraylist-add/arraylist-add.js", 1);+YUI.add('arraylist-add', function (Y, NAME) {++/**+ * Collection utilities beyond what is provided in the YUI core+ * @module collection+ * @submodule arraylist-add+ * @deprecated Use ModelList or a custom ArrayList subclass+ */++/*+ * Adds methods add and remove to Y.ArrayList+ */+_yuitest_coverfunc("build/arraylist-add/arraylist-add.js", "(anonymous 1)", 1);+_yuitest_coverline("build/arraylist-add/arraylist-add.js", 13);+Y.mix(Y.ArrayList.prototype, {++ /**+ * Add a single item to the ArrayList. Does not prevent duplicates.+ *+ * @method add+ * @param { mixed } item Item presumably of the same type as others in the+ * ArrayList.+ * @param {Number} index (Optional.) Number representing the position at+ * which the item should be inserted.+ * @return {ArrayList} the instance.+ * @for ArrayList+ * @deprecated Use ModelList or a custom ArrayList subclass+ * @chainable+ */+ add: function(item, index) {+ _yuitest_coverfunc("build/arraylist-add/arraylist-add.js", "add", 28);+_yuitest_coverline("build/arraylist-add/arraylist-add.js", 29);+var items = this._items;++ _yuitest_coverline("build/arraylist-add/arraylist-add.js", 31);+if (Y.Lang.isNumber(index)) {+ _yuitest_coverline("build/arraylist-add/arraylist-add.js", 32);+items.splice(index, 0, item);+ }+ else {+ _yuitest_coverline("build/arraylist-add/arraylist-add.js", 35);+items.push(item);+ }++ _yuitest_coverline("build/arraylist-add/arraylist-add.js", 38);+return this;+ },++ /**+ * Removes first or all occurrences of an item to the ArrayList. If a+ * comparator is not provided, uses itemsAreEqual method to determine+ * matches.+ *+ * @method remove+ * @param { mixed } needle Item to find and remove from the list.+ * @param { Boolean } all If true, remove all occurrences.+ * @param { Function } comparator optional a/b function to test equivalence.+ * @return {ArrayList} the instance.+ * @for ArrayList+ * @deprecated Use ModelList or a custom ArrayList subclass+ * @chainable+ */+ remove: function(needle, all, comparator) {+ _yuitest_coverfunc("build/arraylist-add/arraylist-add.js", "remove", 55);+_yuitest_coverline("build/arraylist-add/arraylist-add.js", 56);+comparator = comparator || this.itemsAreEqual;++ _yuitest_coverline("build/arraylist-add/arraylist-add.js", 58);+for (var i = this._items.length - 1; i >= 0; --i) {+ _yuitest_coverline("build/arraylist-add/arraylist-add.js", 59);+if (comparator.call(this, needle, this.item(i))) {+ _yuitest_coverline("build/arraylist-add/arraylist-add.js", 60);+this._items.splice(i, 1);+ _yuitest_coverline("build/arraylist-add/arraylist-add.js", 61);+if (!all) {+ _yuitest_coverline("build/arraylist-add/arraylist-add.js", 62);+break;+ }+ }+ }++ _yuitest_coverline("build/arraylist-add/arraylist-add.js", 67);+return this;+ },++ /**+ * Default comparator for items stored in this list. Used by remove().+ *+ * @method itemsAreEqual+ * @param { mixed } a item to test equivalence with.+ * @param { mixed } b other item to test equivalance.+ * @return { Boolean } true if items are deemed equivalent.+ * @for ArrayList+ * @deprecated Use ModelList or a custom ArrayList subclass+ */+ itemsAreEqual: function(a, b) {+ _yuitest_coverfunc("build/arraylist-add/arraylist-add.js", "itemsAreEqual", 80);+_yuitest_coverline("build/arraylist-add/arraylist-add.js", 81);+return a === b;+ }++});+++}, '3.7.1', {"requires": ["arraylist"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('arraylist-add', function(Y) {+YUI.add('arraylist-add', function (Y, NAME) { /** * Collection utilities beyond what is provided in the YUI core@@ -90,4 +90,4 @@ }); -}, '3.5.1' ,{requires:['arraylist']});+}, '3.7.1', {"requires": ["arraylist"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("arraylist-add",function(a){a.mix(a.ArrayList.prototype,{add:function(d,c){var b=this._items;if(a.Lang.isNumber(c)){b.splice(c,0,d);}else{b.push(d);}return this;},remove:function(e,d,b){b=b||this.itemsAreEqual;for(var c=this._items.length-1;c>=0;--c){if(b.call(this,e,this.item(c))){this._items.splice(c,1);if(!d){break;}}}return this;},itemsAreEqual:function(d,c){return d===c;}});},"3.5.1",{requires:["arraylist"]});+YUI.add("arraylist-add",function(e,t){e.mix(e.ArrayList.prototype,{add:function(t,n){var r=this._items;return e.Lang.isNumber(n)?r.splice(n,0,t):r.push(t),this},remove:function(e,t,n){n=n||this.itemsAreEqual;for(var r=this._items.length-1;r>=0;--r)if(n.call(this,e,this.item(r))){this._items.splice(r,1);if(!t)break}return this},itemsAreEqual:function(e,t){return e===t}})},"3.7.1",{requires:["arraylist"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('arraylist-add', function(Y) {+YUI.add('arraylist-add', function (Y, NAME) { /** * Collection utilities beyond what is provided in the YUI core@@ -90,4 +90,4 @@ }); -}, '3.5.1' ,{requires:['arraylist']});+}, '3.7.1', {"requires": ["arraylist"]});
@@ -0,0 +1,95 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/arraylist-filter/arraylist-filter.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/arraylist-filter/arraylist-filter.js",+ code: []+};+_yuitest_coverage["build/arraylist-filter/arraylist-filter.js"].code=["YUI.add('arraylist-filter', function (Y, NAME) {","","/**"," * Collection utilities beyond what is provided in the YUI core"," * @module collection"," * @submodule arraylist-filter"," * @deprecated Use ModelList or a custom subclass implementation"," */","","/*"," * Adds filter method to ArrayList prototype"," */","Y.mix(Y.ArrayList.prototype, {",""," /**"," * <p>Create a new ArrayList (or augmenting class instance) from a subset"," * of items as determined by the boolean function passed as the"," * argument. The original ArrayList is unchanged.</p>"," *"," * <p>The validator signature is <code>validator( item )</code>.</p>"," *"," * @method filter"," * @param { Function } validator Boolean function to determine in or out."," * @return { ArrayList } New instance based on who passed the validator."," * @for ArrayList"," * @deprecated Use ModelList or a custom subclass implementation"," */"," filter: function(validator) {"," var items = [];",""," Y.Array.each(this._items, function(item, i) {"," item = this.item(i);",""," if (validator(item)) {"," items.push(item);"," }"," }, this);",""," return new this.constructor(items);"," }","","});","","","}, '3.7.1', {\"requires\": [\"arraylist\"]});"];+_yuitest_coverage["build/arraylist-filter/arraylist-filter.js"].lines = {"1":0,"13":0,"29":0,"31":0,"32":0,"34":0,"35":0,"39":0};+_yuitest_coverage["build/arraylist-filter/arraylist-filter.js"].functions = {"(anonymous 2):31":0,"filter:28":0,"(anonymous 1):1":0};+_yuitest_coverage["build/arraylist-filter/arraylist-filter.js"].coveredLines = 8;+_yuitest_coverage["build/arraylist-filter/arraylist-filter.js"].coveredFunctions = 3;+_yuitest_coverline("build/arraylist-filter/arraylist-filter.js", 1);+YUI.add('arraylist-filter', function (Y, NAME) {++/**+ * Collection utilities beyond what is provided in the YUI core+ * @module collection+ * @submodule arraylist-filter+ * @deprecated Use ModelList or a custom subclass implementation+ */++/*+ * Adds filter method to ArrayList prototype+ */+_yuitest_coverfunc("build/arraylist-filter/arraylist-filter.js", "(anonymous 1)", 1);+_yuitest_coverline("build/arraylist-filter/arraylist-filter.js", 13);+Y.mix(Y.ArrayList.prototype, {++ /**+ * <p>Create a new ArrayList (or augmenting class instance) from a subset+ * of items as determined by the boolean function passed as the+ * argument. The original ArrayList is unchanged.</p>+ *+ * <p>The validator signature is <code>validator( item )</code>.</p>+ *+ * @method filter+ * @param { Function } validator Boolean function to determine in or out.+ * @return { ArrayList } New instance based on who passed the validator.+ * @for ArrayList+ * @deprecated Use ModelList or a custom subclass implementation+ */+ filter: function(validator) {+ _yuitest_coverfunc("build/arraylist-filter/arraylist-filter.js", "filter", 28);+_yuitest_coverline("build/arraylist-filter/arraylist-filter.js", 29);+var items = [];++ _yuitest_coverline("build/arraylist-filter/arraylist-filter.js", 31);+Y.Array.each(this._items, function(item, i) {+ _yuitest_coverfunc("build/arraylist-filter/arraylist-filter.js", "(anonymous 2)", 31);+_yuitest_coverline("build/arraylist-filter/arraylist-filter.js", 32);+item = this.item(i);++ _yuitest_coverline("build/arraylist-filter/arraylist-filter.js", 34);+if (validator(item)) {+ _yuitest_coverline("build/arraylist-filter/arraylist-filter.js", 35);+items.push(item);+ }+ }, this);++ _yuitest_coverline("build/arraylist-filter/arraylist-filter.js", 39);+return new this.constructor(items);+ }++});+++}, '3.7.1', {"requires": ["arraylist"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('arraylist-filter', function(Y) {+YUI.add('arraylist-filter', function (Y, NAME) { /** * Collection utilities beyond what is provided in the YUI core@@ -48,4 +48,4 @@ }); -}, '3.5.1' ,{requires:['arraylist']});+}, '3.7.1', {"requires": ["arraylist"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("arraylist-filter",function(a){a.mix(a.ArrayList.prototype,{filter:function(c){var b=[];a.Array.each(this._items,function(e,d){e=this.item(d);if(c(e)){b.push(e);}},this);return new this.constructor(b);}});},"3.5.1",{requires:["arraylist"]});+YUI.add("arraylist-filter",function(e,t){e.mix(e.ArrayList.prototype,{filter:function(t){var n=[];return e.Array.each(this._items,function(e,r){e=this.item(r),t(e)&&n.push(e)},this),new this.constructor(n)}})},"3.7.1",{requires:["arraylist"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('arraylist-filter', function(Y) {+YUI.add('arraylist-filter', function (Y, NAME) { /** * Collection utilities beyond what is provided in the YUI core@@ -48,4 +48,4 @@ }); -}, '3.5.1' ,{requires:['arraylist']});+}, '3.7.1', {"requires": ["arraylist"]});
@@ -0,0 +1,301 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/arraylist/arraylist.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/arraylist/arraylist.js",+ code: []+};+_yuitest_coverage["build/arraylist/arraylist.js"].code=["YUI.add('arraylist', function (Y, NAME) {","","/**"," * Collection utilities beyond what is provided in the YUI core"," * @module collection"," * @submodule arraylist"," */","","var YArray = Y.Array,"," YArray_each = YArray.each,"," ArrayListProto;","","/**"," * Generic ArrayList class for managing lists of items and iterating operations"," * over them. The targeted use for this class is for augmentation onto a"," * class that is responsible for managing multiple instances of another class"," * (e.g. NodeList for Nodes). The recommended use is to augment your class with"," * ArrayList, then use ArrayList.addMethod to mirror the API of the constituent"," * items on the list's API."," *"," * The default implementation creates immutable lists, but mutability can be"," * provided via the arraylist-add submodule or by implementing mutation methods"," * directly on the augmented class's prototype."," *"," * @class ArrayList"," * @constructor"," * @param items { Array } array of items this list will be responsible for"," */","function ArrayList( items ) {"," if ( items !== undefined ) {"," this._items = Y.Lang.isArray( items ) ? items : YArray( items );"," } else {"," // ||= to support lazy initialization from augment"," this._items = this._items || [];"," }","}","","ArrayListProto = {"," /**"," * Get an item by index from the list. Override this method if managing a"," * list of objects that have a different public representation (e.g. Node"," * instances vs DOM nodes). The iteration methods that accept a user"," * function will use this method for access list items for operation."," *"," * @method item"," * @param i { Integer } index to fetch"," * @return { mixed } the item at the requested index"," */"," item: function ( i ) {"," return this._items[i];"," },",""," /**"," * <p>Execute a function on each item of the list, optionally providing a"," * custom execution context. Default context is the item.</p>"," *"," * <p>The callback signature is <code>callback( item, index )</code>.</p>"," *"," * @method each"," * @param fn { Function } the function to execute"," * @param context { mixed } optional override 'this' in the function"," * @return { ArrayList } this instance"," * @chainable"," */"," each: function ( fn, context ) {"," YArray_each( this._items, function ( item, i ) {"," item = this.item( i );",""," fn.call( context || item, item, i, this );"," }, this);",""," return this;"," },",""," /**"," * <p>Execute a function on each item of the list, optionally providing a"," * custom execution context. Default context is the item.</p>"," *"," * <p>The callback signature is <code>callback( item, index )</code>.</p>"," *"," * <p>Unlike <code>each</code>, if the callback returns true, the"," * iteratation will stop.</p>"," *"," * @method some"," * @param fn { Function } the function to execute"," * @param context { mixed } optional override 'this' in the function"," * @return { Boolean } True if the function returned true on an item"," */"," some: function ( fn, context ) {"," return YArray.some( this._items, function ( item, i ) {"," item = this.item( i );",""," return fn.call( context || item, item, i, this );"," }, this);"," },",""," /**"," * Finds the first index of the needle in the managed array of items."," *"," * @method indexOf"," * @param needle { mixed } The item to search for"," * @return { Integer } Array index if found. Otherwise -1"," */"," indexOf: function ( needle ) {"," return YArray.indexOf( this._items, needle );"," },",""," /**"," * How many items are in this list?"," *"," * @method size"," * @return { Integer } Number of items in the list"," */"," size: function () {"," return this._items.length;"," },",""," /**"," * Is this instance managing any items?"," *"," * @method isEmpty"," * @return { Boolean } true if 1 or more items are being managed"," */"," isEmpty: function () {"," return !this.size();"," },",""," /**"," * Provides an array-like representation for JSON.stringify."," *"," * @method toJSON"," * @return { Array } an array representation of the ArrayList"," */"," toJSON: function () {"," return this._items;"," }","};","// Default implementation does not distinguish between public and private","// item getter","/**"," * Protected method for optimizations that may be appropriate for API"," * mirroring. Similar in functionality to <code>item</code>, but is used by"," * methods added with <code>ArrayList.addMethod()</code>."," *"," * @method _item"," * @protected"," * @param i { Integer } Index of item to fetch"," * @return { mixed } The item appropriate for pass through API methods"," */","ArrayListProto._item = ArrayListProto.item;","","// Mixed onto existing proto to preserve constructor NOT being an own property.","// This has bitten me when composing classes by enumerating, copying prototypes.","Y.mix(ArrayList.prototype, ArrayListProto);","","Y.mix( ArrayList, {",""," /**"," * <p>Adds a pass through method to dest (typically the prototype of a list"," * class) that calls the named method on each item in the list with"," * whatever parameters are passed in. Allows for API indirection via list"," * instances.</p>"," *"," * <p>Accepts a single string name or an array of string names.</p>"," *"," * <pre><code>list.each( function ( item ) {"," * item.methodName( 1, 2, 3 );"," * } );"," * // becomes"," * list.methodName( 1, 2, 3 );</code></pre>"," *"," * <p>Additionally, the pass through methods use the item retrieved by the"," * <code>_item</code> method in case there is any special behavior that is"," * appropriate for API mirroring.</p>"," *"," * <p>If the iterated method returns a value, the return value from the"," * added method will be an array of values with each value being at the"," * corresponding index for that item. If the iterated method does not"," * return a value, the added method will be chainable."," *"," * @method addMethod"," * @static"," * @param dest {Object} Object or prototype to receive the iterator method"," * @param name {String|String[]} Name of method of methods to create"," */"," addMethod: function ( dest, names ) {",""," names = YArray( names );",""," YArray_each( names, function ( name ) {"," dest[ name ] = function () {"," var args = YArray( arguments, 0, true ),"," ret = [];",""," YArray_each( this._items, function ( item, i ) {"," item = this._item( i );",""," var result = item[ name ].apply( item, args );",""," if ( result !== undefined && result !== item ) {"," ret[i] = result;"," }"," }, this);",""," return ret.length ? ret : this;"," };"," } );"," }","} );","","Y.ArrayList = ArrayList;","","","}, '3.7.1', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/arraylist/arraylist.js"].lines = {"1":0,"9":0,"29":0,"30":0,"31":0,"34":0,"38":0,"50":0,"66":0,"67":0,"69":0,"72":0,"90":0,"91":0,"93":0,"105":0,"115":0,"125":0,"135":0,"150":0,"154":0,"156":0,"188":0,"190":0,"191":0,"192":0,"195":0,"196":0,"198":0,"200":0,"201":0,"205":0,"211":0};+_yuitest_coverage["build/arraylist/arraylist.js"].functions = {"ArrayList:29":0,"item:49":0,"(anonymous 2):66":0,"each:65":0,"(anonymous 3):90":0,"some:89":0,"indexOf:104":0,"size:114":0,"isEmpty:124":0,"toJSON:134":0,"(anonymous 5):195":0,"]:191":0,"(anonymous 4):190":0,"addMethod:186":0,"(anonymous 1):1":0};+_yuitest_coverage["build/arraylist/arraylist.js"].coveredLines = 33;+_yuitest_coverage["build/arraylist/arraylist.js"].coveredFunctions = 15;+_yuitest_coverline("build/arraylist/arraylist.js", 1);+YUI.add('arraylist', function (Y, NAME) {++/**+ * Collection utilities beyond what is provided in the YUI core+ * @module collection+ * @submodule arraylist+ */++_yuitest_coverfunc("build/arraylist/arraylist.js", "(anonymous 1)", 1);+_yuitest_coverline("build/arraylist/arraylist.js", 9);+var YArray = Y.Array,+ YArray_each = YArray.each,+ ArrayListProto;++/**+ * Generic ArrayList class for managing lists of items and iterating operations+ * over them. The targeted use for this class is for augmentation onto a+ * class that is responsible for managing multiple instances of another class+ * (e.g. NodeList for Nodes). The recommended use is to augment your class with+ * ArrayList, then use ArrayList.addMethod to mirror the API of the constituent+ * items on the list's API.+ *+ * The default implementation creates immutable lists, but mutability can be+ * provided via the arraylist-add submodule or by implementing mutation methods+ * directly on the augmented class's prototype.+ *+ * @class ArrayList+ * @constructor+ * @param items { Array } array of items this list will be responsible for+ */+_yuitest_coverline("build/arraylist/arraylist.js", 29);+function ArrayList( items ) {+ _yuitest_coverfunc("build/arraylist/arraylist.js", "ArrayList", 29);+_yuitest_coverline("build/arraylist/arraylist.js", 30);+if ( items !== undefined ) {+ _yuitest_coverline("build/arraylist/arraylist.js", 31);+this._items = Y.Lang.isArray( items ) ? items : YArray( items );+ } else {+ // ||= to support lazy initialization from augment+ _yuitest_coverline("build/arraylist/arraylist.js", 34);+this._items = this._items || [];+ }+}++_yuitest_coverline("build/arraylist/arraylist.js", 38);+ArrayListProto = {+ /**+ * Get an item by index from the list. Override this method if managing a+ * list of objects that have a different public representation (e.g. Node+ * instances vs DOM nodes). The iteration methods that accept a user+ * function will use this method for access list items for operation.+ *+ * @method item+ * @param i { Integer } index to fetch+ * @return { mixed } the item at the requested index+ */+ item: function ( i ) {+ _yuitest_coverfunc("build/arraylist/arraylist.js", "item", 49);+_yuitest_coverline("build/arraylist/arraylist.js", 50);+return this._items[i];+ },++ /**+ * <p>Execute a function on each item of the list, optionally providing a+ * custom execution context. Default context is the item.</p>+ *+ * <p>The callback signature is <code>callback( item, index )</code>.</p>+ *+ * @method each+ * @param fn { Function } the function to execute+ * @param context { mixed } optional override 'this' in the function+ * @return { ArrayList } this instance+ * @chainable+ */+ each: function ( fn, context ) {+ _yuitest_coverfunc("build/arraylist/arraylist.js", "each", 65);+_yuitest_coverline("build/arraylist/arraylist.js", 66);+YArray_each( this._items, function ( item, i ) {+ _yuitest_coverfunc("build/arraylist/arraylist.js", "(anonymous 2)", 66);+_yuitest_coverline("build/arraylist/arraylist.js", 67);+item = this.item( i );++ _yuitest_coverline("build/arraylist/arraylist.js", 69);+fn.call( context || item, item, i, this );+ }, this);++ _yuitest_coverline("build/arraylist/arraylist.js", 72);+return this;+ },++ /**+ * <p>Execute a function on each item of the list, optionally providing a+ * custom execution context. Default context is the item.</p>+ *+ * <p>The callback signature is <code>callback( item, index )</code>.</p>+ *+ * <p>Unlike <code>each</code>, if the callback returns true, the+ * iteratation will stop.</p>+ *+ * @method some+ * @param fn { Function } the function to execute+ * @param context { mixed } optional override 'this' in the function+ * @return { Boolean } True if the function returned true on an item+ */+ some: function ( fn, context ) {+ _yuitest_coverfunc("build/arraylist/arraylist.js", "some", 89);+_yuitest_coverline("build/arraylist/arraylist.js", 90);+return YArray.some( this._items, function ( item, i ) {+ _yuitest_coverfunc("build/arraylist/arraylist.js", "(anonymous 3)", 90);+_yuitest_coverline("build/arraylist/arraylist.js", 91);+item = this.item( i );++ _yuitest_coverline("build/arraylist/arraylist.js", 93);+return fn.call( context || item, item, i, this );+ }, this);+ },++ /**+ * Finds the first index of the needle in the managed array of items.+ *+ * @method indexOf+ * @param needle { mixed } The item to search for+ * @return { Integer } Array index if found. Otherwise -1+ */+ indexOf: function ( needle ) {+ _yuitest_coverfunc("build/arraylist/arraylist.js", "indexOf", 104);+_yuitest_coverline("build/arraylist/arraylist.js", 105);+return YArray.indexOf( this._items, needle );+ },++ /**+ * How many items are in this list?+ *+ * @method size+ * @return { Integer } Number of items in the list+ */+ size: function () {+ _yuitest_coverfunc("build/arraylist/arraylist.js", "size", 114);+_yuitest_coverline("build/arraylist/arraylist.js", 115);+return this._items.length;+ },++ /**+ * Is this instance managing any items?+ *+ * @method isEmpty+ * @return { Boolean } true if 1 or more items are being managed+ */+ isEmpty: function () {+ _yuitest_coverfunc("build/arraylist/arraylist.js", "isEmpty", 124);+_yuitest_coverline("build/arraylist/arraylist.js", 125);+return !this.size();+ },++ /**+ * Provides an array-like representation for JSON.stringify.+ *+ * @method toJSON+ * @return { Array } an array representation of the ArrayList+ */+ toJSON: function () {+ _yuitest_coverfunc("build/arraylist/arraylist.js", "toJSON", 134);+_yuitest_coverline("build/arraylist/arraylist.js", 135);+return this._items;+ }+};+// Default implementation does not distinguish between public and private+// item getter+/**+ * Protected method for optimizations that may be appropriate for API+ * mirroring. Similar in functionality to <code>item</code>, but is used by+ * methods added with <code>ArrayList.addMethod()</code>.+ *+ * @method _item+ * @protected+ * @param i { Integer } Index of item to fetch+ * @return { mixed } The item appropriate for pass through API methods+ */+_yuitest_coverline("build/arraylist/arraylist.js", 150);+ArrayListProto._item = ArrayListProto.item;++// Mixed onto existing proto to preserve constructor NOT being an own property.+// This has bitten me when composing classes by enumerating, copying prototypes.+_yuitest_coverline("build/arraylist/arraylist.js", 154);+Y.mix(ArrayList.prototype, ArrayListProto);++_yuitest_coverline("build/arraylist/arraylist.js", 156);+Y.mix( ArrayList, {++ /**+ * <p>Adds a pass through method to dest (typically the prototype of a list+ * class) that calls the named method on each item in the list with+ * whatever parameters are passed in. Allows for API indirection via list+ * instances.</p>+ *+ * <p>Accepts a single string name or an array of string names.</p>+ *+ * <pre><code>list.each( function ( item ) {+ * item.methodName( 1, 2, 3 );+ * } );+ * // becomes+ * list.methodName( 1, 2, 3 );</code></pre>+ *+ * <p>Additionally, the pass through methods use the item retrieved by the+ * <code>_item</code> method in case there is any special behavior that is+ * appropriate for API mirroring.</p>+ *+ * <p>If the iterated method returns a value, the return value from the+ * added method will be an array of values with each value being at the+ * corresponding index for that item. If the iterated method does not+ * return a value, the added method will be chainable.+ *+ * @method addMethod+ * @static+ * @param dest {Object} Object or prototype to receive the iterator method+ * @param name {String|String[]} Name of method of methods to create+ */+ addMethod: function ( dest, names ) {++ _yuitest_coverfunc("build/arraylist/arraylist.js", "addMethod", 186);+_yuitest_coverline("build/arraylist/arraylist.js", 188);+names = YArray( names );++ _yuitest_coverline("build/arraylist/arraylist.js", 190);+YArray_each( names, function ( name ) {+ _yuitest_coverfunc("build/arraylist/arraylist.js", "(anonymous 4)", 190);+_yuitest_coverline("build/arraylist/arraylist.js", 191);+dest[ name ] = function () {+ _yuitest_coverfunc("build/arraylist/arraylist.js", "]", 191);+_yuitest_coverline("build/arraylist/arraylist.js", 192);+var args = YArray( arguments, 0, true ),+ ret = [];++ _yuitest_coverline("build/arraylist/arraylist.js", 195);+YArray_each( this._items, function ( item, i ) {+ _yuitest_coverfunc("build/arraylist/arraylist.js", "(anonymous 5)", 195);+_yuitest_coverline("build/arraylist/arraylist.js", 196);+item = this._item( i );++ _yuitest_coverline("build/arraylist/arraylist.js", 198);+var result = item[ name ].apply( item, args );++ _yuitest_coverline("build/arraylist/arraylist.js", 200);+if ( result !== undefined && result !== item ) {+ _yuitest_coverline("build/arraylist/arraylist.js", 201);+ret[i] = result;+ }+ }, this);++ _yuitest_coverline("build/arraylist/arraylist.js", 205);+return ret.length ? ret : this;+ };+ } );+ }+} );++_yuitest_coverline("build/arraylist/arraylist.js", 211);+Y.ArrayList = ArrayList;+++}, '3.7.1', {"requires": ["yui-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('arraylist', function(Y) {+YUI.add('arraylist', function (Y, NAME) { /** * Collection utilities beyond what is provided in the YUI core@@ -217,4 +217,4 @@ Y.ArrayList = ArrayList; -}, '3.5.1' ,{requires:['yui-base']});+}, '3.7.1', {"requires": ["yui-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("arraylist",function(e){var d=e.Array,c=d.each,a;function b(f){if(f!==undefined){this._items=e.Lang.isArray(f)?f:d(f);}else{this._items=this._items||[];}}a={item:function(f){return this._items[f];},each:function(g,f){c(this._items,function(j,h){j=this.item(h);g.call(f||j,j,h,this);},this);return this;},some:function(g,f){return d.some(this._items,function(j,h){j=this.item(h);return g.call(f||j,j,h,this);},this);},indexOf:function(f){return d.indexOf(this._items,f);},size:function(){return this._items.length;},isEmpty:function(){return !this.size();},toJSON:function(){return this._items;}};a._item=a.item;e.mix(b.prototype,a);e.mix(b,{addMethod:function(f,g){g=d(g);c(g,function(h){f[h]=function(){var j=d(arguments,0,true),i=[];c(this._items,function(m,l){m=this._item(l);var k=m[h].apply(m,j);if(k!==undefined&&k!==m){i[l]=k;}},this);return i.length?i:this;};});}});e.ArrayList=b;},"3.5.1",{requires:["yui-base"]});+YUI.add("arraylist",function(e,t){function s(t){t!==undefined?this._items=e.Lang.isArray(t)?t:n(t):this._items=this._items||[]}var n=e.Array,r=n.each,i;i={item:function(e){return this._items[e]},each:function(e,t){return r(this._items,function(n,r){n=this.item(r),e.call(t||n,n,r,this)},this),this},some:function(e,t){return n.some(this._items,function(n,r){return n=this.item(r),e.call(t||n,n,r,this)},this)},indexOf:function(e){return n.indexOf(this._items,e)},size:function(){return this._items.length},isEmpty:function(){return!this.size()},toJSON:function(){return this._items}},i._item=i.item,e.mix(s.prototype,i),e.mix(s,{addMethod:function(e,t){t=n(t),r(t,function(t){e[t]=function(){var e=n(arguments,0,!0),i=[];return r(this._items,function(n,r){n=this._item(r);var s=n[t].apply(n,e);s!==undefined&&s!==n&&(i[r]=s)},this),i.length?i:this}})}}),e.ArrayList=s},"3.7.1",{requires:["yui-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('arraylist', function(Y) {+YUI.add('arraylist', function (Y, NAME) { /** * Collection utilities beyond what is provided in the YUI core@@ -217,4 +217,4 @@ Y.ArrayList = ArrayList; -}, '3.5.1' ,{requires:['yui-base']});+}, '3.7.1', {"requires": ["yui-base"]});
@@ -0,0 +1,124 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/arraysort/arraysort.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/arraysort/arraysort.js",+ code: []+};+_yuitest_coverage["build/arraysort/arraysort.js"].code=["YUI.add('arraysort', function (Y, NAME) {","","/**","Provides a case-insenstive comparator which can be used for array sorting.","","@module arraysort","*/","","var LANG = Y.Lang,"," ISVALUE = LANG.isValue,"," ISSTRING = LANG.isString;","","/**","Provides a case-insenstive comparator which can be used for array sorting.","","@class ArraySort","*/","","Y.ArraySort = {",""," /**"," Comparator function for simple case-insensitive sorting of an array of"," strings.",""," @method compare"," @param a {Object} First sort argument."," @param b {Object} Second sort argument."," @param desc {Boolean} `true` if sort direction is descending, `false` if"," sort direction is ascending."," @return {Boolean} -1 when a < b. 0 when a == b. 1 when a > b."," */"," compare: function(a, b, desc) {"," if(!ISVALUE(a)) {"," if(!ISVALUE(b)) {"," return 0;"," }"," else {"," return 1;"," }"," }"," else if(!ISVALUE(b)) {"," return -1;"," }",""," if(ISSTRING(a)) {"," a = a.toLowerCase();"," }"," if(ISSTRING(b)) {"," b = b.toLowerCase();"," }"," if(a < b) {"," return (desc) ? 1 : -1;"," }"," else if (a > b) {"," return (desc) ? -1 : 1;"," }"," else {"," return 0;"," }"," }","","};","","","}, '3.7.1', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/arraysort/arraysort.js"].lines = {"1":0,"9":0,"19":0,"33":0,"34":0,"35":0,"38":0,"41":0,"42":0,"45":0,"46":0,"48":0,"49":0,"51":0,"52":0,"54":0,"55":0,"58":0};+_yuitest_coverage["build/arraysort/arraysort.js"].functions = {"compare:32":0,"(anonymous 1):1":0};+_yuitest_coverage["build/arraysort/arraysort.js"].coveredLines = 18;+_yuitest_coverage["build/arraysort/arraysort.js"].coveredFunctions = 2;+_yuitest_coverline("build/arraysort/arraysort.js", 1);+YUI.add('arraysort', function (Y, NAME) {++/**+Provides a case-insenstive comparator which can be used for array sorting.++@module arraysort+*/++_yuitest_coverfunc("build/arraysort/arraysort.js", "(anonymous 1)", 1);+_yuitest_coverline("build/arraysort/arraysort.js", 9);+var LANG = Y.Lang,+ ISVALUE = LANG.isValue,+ ISSTRING = LANG.isString;++/**+Provides a case-insenstive comparator which can be used for array sorting.++@class ArraySort+*/++_yuitest_coverline("build/arraysort/arraysort.js", 19);+Y.ArraySort = {++ /**+ Comparator function for simple case-insensitive sorting of an array of+ strings.++ @method compare+ @param a {Object} First sort argument.+ @param b {Object} Second sort argument.+ @param desc {Boolean} `true` if sort direction is descending, `false` if+ sort direction is ascending.+ @return {Boolean} -1 when a < b. 0 when a == b. 1 when a > b.+ */+ compare: function(a, b, desc) {+ _yuitest_coverfunc("build/arraysort/arraysort.js", "compare", 32);+_yuitest_coverline("build/arraysort/arraysort.js", 33);+if(!ISVALUE(a)) {+ _yuitest_coverline("build/arraysort/arraysort.js", 34);+if(!ISVALUE(b)) {+ _yuitest_coverline("build/arraysort/arraysort.js", 35);+return 0;+ }+ else {+ _yuitest_coverline("build/arraysort/arraysort.js", 38);+return 1;+ }+ }+ else {_yuitest_coverline("build/arraysort/arraysort.js", 41);+if(!ISVALUE(b)) {+ _yuitest_coverline("build/arraysort/arraysort.js", 42);+return -1;+ }}++ _yuitest_coverline("build/arraysort/arraysort.js", 45);+if(ISSTRING(a)) {+ _yuitest_coverline("build/arraysort/arraysort.js", 46);+a = a.toLowerCase();+ }+ _yuitest_coverline("build/arraysort/arraysort.js", 48);+if(ISSTRING(b)) {+ _yuitest_coverline("build/arraysort/arraysort.js", 49);+b = b.toLowerCase();+ }+ _yuitest_coverline("build/arraysort/arraysort.js", 51);+if(a < b) {+ _yuitest_coverline("build/arraysort/arraysort.js", 52);+return (desc) ? 1 : -1;+ }+ else {_yuitest_coverline("build/arraysort/arraysort.js", 54);+if (a > b) {+ _yuitest_coverline("build/arraysort/arraysort.js", 55);+return (desc) ? -1 : 1;+ }+ else {+ _yuitest_coverline("build/arraysort/arraysort.js", 58);+return 0;+ }}+ }++};+++}, '3.7.1', {"requires": ["yui-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('arraysort', function(Y) {+YUI.add('arraysort', function (Y, NAME) { /** Provides a case-insenstive comparator which can be used for array sorting.@@ -68,4 +68,4 @@ }; -}, '3.5.1' ,{requires:['yui-base']});+}, '3.7.1', {"requires": ["yui-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("arraysort",function(c){var b=c.Lang,a=b.isValue,d=b.isString;c.ArraySort={compare:function(f,e,g){if(!a(f)){if(!a(e)){return 0;}else{return 1;}}else{if(!a(e)){return -1;}}if(d(f)){f=f.toLowerCase();}if(d(e)){e=e.toLowerCase();}if(f<e){return(g)?1:-1;}else{if(f>e){return(g)?-1:1;}else{return 0;}}}};},"3.5.1",{requires:["yui-base"]});+YUI.add("arraysort",function(e,t){var n=e.Lang,r=n.isValue,i=n.isString;e.ArraySort={compare:function(e,t,n){return r(e)?r(t)?(i(e)&&(e=e.toLowerCase()),i(t)&&(t=t.toLowerCase()),e<t?n?1:-1:e>t?n?-1:1:0):-1:r(t)?1:0}}},"3.7.1",{requires:["yui-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('arraysort', function(Y) {+YUI.add('arraysort', function (Y, NAME) { /** Provides a case-insenstive comparator which can be used for array sorting.@@ -68,4 +68,4 @@ }; -}, '3.5.1' ,{requires:['yui-base']});+}, '3.7.1', {"requires": ["yui-base"]});
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-.yui3-calendar-pane{width:100%}.yui3-calendar-grid{width:100%}.yui3-calendar-column-hidden,.yui3-calendar-hidden{display:none}.yui3-skin-sam .yui3-calendar-content{padding:10px;color:#000;border:1px solid gray;background:#f2f2f2;background:-moz-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#f9f9f9),color-stop(100%,#f2f2f2));background:-webkit-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);background:-o-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);background:-ms-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9',endColorstr='#f2f2f2',GradientType=0);background:linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);-moz-border-radius:5px;border-radius:5px}.yui3-skin-sam .yui3-calendar-grid{padding:5px;border-collapse:collapse}.yui3-skin-sam .yui3-calendar-header{padding-bottom:10px}.yui3-skin-sam .yui3-calendar-header-label{margin:0;font-size:1em;font-weight:bold}.yui3-skin-sam .yui3-calendar-day,.yui3-skin-sam .yui3-calendar-prevmonth-day,.yui3-skin-sam .yui3-calendar-nextmonth-day{padding:5px;border:1px solid #ccc;background:#fff;text-align:center}.yui3-skin-sam .yui3-calendar-day:hover{background:#06c;color:#fff}.yui3-skin-sam .yui3-calendar-selection-disabled,.yui3-skin-sam .yui3-calendar-selection-disabled:hover{color:#a6a6a6;background:#ccc}.yui3-skin-sam .yui3-calendar-weekday{font-weight:bold}.yui3-skin-sam .yui3-calendar-prevmonth-day,.yui3-skin-sam .yui3-calendar-nextmonth-day{color:#a6a6a6}.yui3-skin-sam .yui3-calendar-day{font-weight:bold}.yui3-skin-sam .yui3-calendar-day-selected{background-color:#b3d4ff;color:#000}.yui3-skin-sam .yui3-calendar-header-label{text-align:center}.yui3-skin-sam .yui3-calendar-left-grid{margin-right:1em}.yui3-skin-sam .yui3-calendar-right-grid{margin-left:1em}.yui3-skin-sam .yui3-calendar-day-highlighted{background-color:#dcdef5}.yui3-skin-sam .yui3-calendar-day-selected.yui3-calendar-day-highlighted{background-color:#758fbb}+.yui3-calendar-pane{width:100%}.yui3-calendar-grid{width:100%}.yui3-calendar-column-hidden,.yui3-calendar-hidden{display:none}.yui3-skin-sam .yui3-calendar-content{padding:10px;color:#000;border:1px solid gray;background:#f2f2f2;background:-moz-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#f9f9f9),color-stop(100%,#f2f2f2));background:-webkit-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);background:-o-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);background:-ms-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9',endColorstr='#f2f2f2',GradientType=0);background:linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);-moz-border-radius:5px;border-radius:5px}.yui3-skin-sam .yui3-calendar-grid{padding:5px;border-collapse:collapse}.yui3-skin-sam .yui3-calendar-header{padding-bottom:10px}.yui3-skin-sam .yui3-calendar-header-label{margin:0;font-size:1em;font-weight:bold}.yui3-skin-sam .yui3-calendar-day,.yui3-skin-sam .yui3-calendar-prevmonth-day,.yui3-skin-sam .yui3-calendar-nextmonth-day{padding:5px;border:1px solid #ccc;background:#fff;text-align:center}.yui3-skin-sam .yui3-calendar-day:hover{background:#06c;color:#fff}.yui3-skin-sam .yui3-calendar-selection-disabled,.yui3-skin-sam .yui3-calendar-selection-disabled:hover{color:#a6a6a6;background:#ccc}.yui3-skin-sam .yui3-calendar-weekday{font-weight:bold}.yui3-skin-sam .yui3-calendar-prevmonth-day,.yui3-skin-sam .yui3-calendar-nextmonth-day{color:#a6a6a6}.yui3-skin-sam .yui3-calendar-day{font-weight:bold}.yui3-skin-sam .yui3-calendar-day-selected{background-color:#b3d4ff;color:#000}.yui3-skin-sam .yui3-calendar-header-label{text-align:center}.yui3-skin-sam .yui3-calendar-left-grid{margin-right:1em}.yui3-skin-sam .yui3-calendar-right-grid{margin-left:1em}.yui3-skin-sam .yui3-calendar-day-highlighted{background-color:#dcdef5}.yui3-skin-sam .yui3-calendar-day-selected.yui3-calendar-day-highlighted{background-color:#758fbb}#yui3-css-stamp.skin-sam-calendar-base{display:none}
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-.yui3-calendar-column-hidden,.yui3-calendar-hidden{display:none}.yui3-calendar-day{cursor:pointer}.yui3-calendar-selection-disabled{cursor:default}.yui3-calendar-prevmonth-day{cursor:default}.yui3-calendar-nextmonth-day{cursor:default}.yui3-calendar-content:hover .yui3-calendar-day,.yui3-calendar-content:hover .yui3-calendar-prevmonth-day,.yui3-calendar-content:hover .yui3-calendar-nextmonth-day{-moz-user-select:none}.yui3-skin-sam .yui3-calendar-day-highlighted{background-color:#dcdef5}.yui3-skin-sam .yui3-calendar-day-selected.yui3-calendar-day-highlighted{background-color:#758fbb}+.yui3-calendar-column-hidden,.yui3-calendar-hidden{display:none}.yui3-calendar-day{cursor:pointer}.yui3-calendar-selection-disabled{cursor:default}.yui3-calendar-prevmonth-day{cursor:default}.yui3-calendar-nextmonth-day{cursor:default}.yui3-calendar-content:hover .yui3-calendar-day,.yui3-calendar-content:hover .yui3-calendar-prevmonth-day,.yui3-calendar-content:hover .yui3-calendar-nextmonth-day{-moz-user-select:none}.yui3-skin-sam .yui3-calendar-day-highlighted{background-color:#dcdef5}.yui3-skin-sam .yui3-calendar-day-selected.yui3-calendar-day-highlighted{background-color:#758fbb}#yui3-css-stamp.skin-sam-calendar{display:none}
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-.yui3-calendar-header{padding-left:15px;padding-right:15px}.yui3-calendar-header-label{width:100%}.yui3-calendarnav-prevmonth{cursor:pointer}.yui3-calendarnav-nextmonth{cursor:pointer}.yui3-skin-sam .yui3-calendarnav-prevmonth,.yui3-skin-sam .yui3-calendarnav-nextmonth{color:#000;width:12px;height:14px;background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAKNJREFUeNpiYCAeSAPxUiiWZqAi4ATiaiD+DMT/ofgzVIyTUsMDgfghksHo+CFUDcnAAIgP4DEYHR+A6iEIhIB4GgkGo+NpUDMwADMQFwHxBwoMh+EPULOYYYZ7APFVKhiMjkFmejBBLWFjoD5gQ+dQO4iwOloUiOdQYPgcqBkDl0zRQRQRGS2KGkVFHRB/QzL4G1SMk5qpQg6psJMjVhNAgAEAH+qPqeiPEUsAAAAASUVORK5CYII=);background-repeat:no-repeat}.yui3-skin-sam .yui3-calendarnav-prevmonth:hover,.yui3-skin-sam .yui3-calendarnav-nextmonth:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPpJREFUeNpi/P//PwMxQD9jszSQ6oJyyy7O8H1KjD5GQhYADeYEUkVAXAHEPFDhL0DcAcR9QIu+k20B0PBAIDUBiOVwKHkExAVAS9aTZAHQYAOowfYMxIGDUIsu4LUAaLAQkGoB4kwG8sB0IK4BWvQOxQKgwcxAdj4Q1wExPwNl4CMQNwHxRKBFfxn10jd5ADm9QKzFQF1wDYiLmaAcNgbqA7CZTEBv7ADS2iDboN5joEIQgczSBpmNHsmiQKodiJPJNHwuEFcCDX49MMkUi0VRUB/hy2ggFy+jtKgohRYVnFDh79CiopuiogLNIjmobxigrn5EjD6AAAMAok9vhfHG8wQAAAAASUVORK5CYII=);color:#06c}.yui3-skin-sam .yui3-calendarnav-month-disabled,.yui3-skin-sam .yui3-calendarnav-month-disabled:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQhJREFUeNqs0yGLAlEUhuHrKoIgCFbBJghb3F+g0WrVarEqLIhBEEFYWKNNMBktU4z6C5RNkwyCyWQSTPuOfCOCrHNnxwMPyOGe73DAiTmOYywrhy/9/sTBZujN4k0KPbioi6teKuqCmsKGSN/10+q5ehN6QQkrLJB/Mp/Xm5VmAhdkMcEGZWNfZc1MlPGwII42dmiZ/1dLGW1lXhdU8YNvZEz0yijLy6z6FyTN6yvpX7DEOzo4vSD4pCwvc+lfcMEYBUwjhE+VMVbmw7/oiCY+sA4RvNZMUxmB38EWFTSwfxK815uKZkJ/yXMU0cf5rn9Wr6g3f1bC4nwvbIAZRup1Ay671a8AAwC3OzOqxK+rkwAAAABJRU5ErkJggg==);cursor:default;color:#ccc}.yui3-skin-sam .yui3-calendarnav-prevmonth,.yui3-skin-sam .yui3-calendarnav-prevmonth:hover{background-position:0 0;margin-left:-12px}.yui3-skin-sam .yui3-calendarnav-nextmonth,.yui3-skin-sam .yui3-calendarnav-nextmonth:hover{background-position:-12px 0;margin-right:-12px}.yui3-skin-sam .yui3-calendarnav-prevmonth span,.yui3-skin-sam .yui3-calendarnav-nextmonth span{display:none;*display:block}+.yui3-calendar-header{padding-left:15px;padding-right:15px}.yui3-calendar-header-label{width:100%}.yui3-calendarnav-prevmonth{cursor:pointer}.yui3-calendarnav-nextmonth{cursor:pointer}.yui3-skin-sam .yui3-calendarnav-prevmonth,.yui3-skin-sam .yui3-calendarnav-nextmonth{color:#000;width:12px;height:14px;background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAKNJREFUeNpiYCAeSAPxUiiWZqAi4ATiaiD+DMT/ofgzVIyTUsMDgfghksHo+CFUDcnAAIgP4DEYHR+A6iEIhIB4GgkGo+NpUDMwADMQFwHxBwoMh+EPULOYYYZ7APFVKhiMjkFmejBBLWFjoD5gQ+dQO4iwOloUiOdQYPgcqBkDl0zRQRQRGS2KGkVFHRB/QzL4G1SMk5qpQg6psJMjVhNAgAEAH+qPqeiPEUsAAAAASUVORK5CYII=);background-repeat:no-repeat}.yui3-skin-sam .yui3-calendarnav-prevmonth:hover,.yui3-skin-sam .yui3-calendarnav-nextmonth:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPpJREFUeNpi/P//PwMxQD9jszSQ6oJyyy7O8H1KjD5GQhYADeYEUkVAXAHEPFDhL0DcAcR9QIu+k20B0PBAIDUBiOVwKHkExAVAS9aTZAHQYAOowfYMxIGDUIsu4LUAaLAQkGoB4kwG8sB0IK4BWvQOxQKgwcxAdj4Q1wExPwNl4CMQNwHxRKBFfxn10jd5ADm9QKzFQF1wDYiLmaAcNgbqA7CZTEBv7ADS2iDboN5joEIQgczSBpmNHsmiQKodiJPJNHwuEFcCDX49MMkUi0VRUB/hy2ggFy+jtKgohRYVnFDh79CiopuiogLNIjmobxigrn5EjD6AAAMAok9vhfHG8wQAAAAASUVORK5CYII=);color:#06c}.yui3-skin-sam .yui3-calendarnav-month-disabled,.yui3-skin-sam .yui3-calendarnav-month-disabled:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQhJREFUeNqs0yGLAlEUhuHrKoIgCFbBJghb3F+g0WrVarEqLIhBEEFYWKNNMBktU4z6C5RNkwyCyWQSTPuOfCOCrHNnxwMPyOGe73DAiTmOYywrhy/9/sTBZujN4k0KPbioi6teKuqCmsKGSN/10+q5ehN6QQkrLJB/Mp/Xm5VmAhdkMcEGZWNfZc1MlPGwII42dmiZ/1dLGW1lXhdU8YNvZEz0yijLy6z6FyTN6yvpX7DEOzo4vSD4pCwvc+lfcMEYBUwjhE+VMVbmw7/oiCY+sA4RvNZMUxmB38EWFTSwfxK815uKZkJ/yXMU0cf5rn9Wr6g3f1bC4nwvbIAZRup1Ay671a8AAwC3OzOqxK+rkwAAAABJRU5ErkJggg==);cursor:default;color:#ccc}.yui3-skin-sam .yui3-calendarnav-prevmonth,.yui3-skin-sam .yui3-calendarnav-prevmonth:hover{background-position:0 0;margin-left:-12px}.yui3-skin-sam .yui3-calendarnav-nextmonth,.yui3-skin-sam .yui3-calendarnav-nextmonth:hover{background-position:-12px 0;margin-right:-12px}.yui3-skin-sam .yui3-calendarnav-prevmonth span,.yui3-skin-sam .yui3-calendarnav-nextmonth span{display:none;*display:block}#yui3-css-stamp.skin-sam-calendarnavigator{display:none}
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
binary file changed (absent → 101 bytes)
binary file changed (absent → 99 bytes)
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-.yui3-resize,.yui3-resize-wrapper{z-index:0;zoom:1}.yui3-resize-handle{position:absolute;display:block;z-index:100;zoom:1}.yui3-resize-proxy{position:absolute;border:1px dashed #000;position:absolute;z-index:10000}.yui3-resize-hidden-handles .yui3-resize-handle{opacity:0;filter:alpha(opacity=0)}.yui3-resize-handle-t,.yui3-resize-handle-b{width:100%;left:0;height:6px}.yui3-resize-handle-l,.yui3-resize-handle-r{height:100%;top:0;width:6px}.yui3-resize-handle-t{cursor:n-resize;top:0}.yui3-resize-handle-b{cursor:s-resize;bottom:0}.yui3-resize-handle-l{cursor:w-resize;left:0}.yui3-resize-handle-r{cursor:e-resize;right:0}.yui3-resize-handle-inner{position:absolute;zoom:1}.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b{margin-left:-8px;left:50%}.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-r{margin-top:-8px;top:50%}.yui3-resize-handle-inner-t{top:-4px}.yui3-resize-handle-inner-b{bottom:-4px}.yui3-resize-handle-inner-l{left:-4px}.yui3-resize-handle-inner-r{right:-4px}.yui3-resize-handle-tr,.yui3-resize-handle-br,.yui3-resize-handle-tl,.yui3-resize-handle-bl{height:15px;width:15px;z-index:200}.yui3-resize-handle-tr{cursor:ne-resize;top:0;right:0}.yui3-resize-handle-tl{cursor:nw-resize;top:0;left:0}.yui3-resize-handle-br{cursor:se-resize;bottom:0;right:0}.yui3-resize-handle-bl{cursor:sw-resize;bottom:0;left:0}.yui3-resize-handle-inner-r,.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-tr,.yui3-resize-handle-inner-br,.yui3-resize-handle-inner-tl,.yui3-resize-handle-inner-bl{background-repeat:no-repeat;background:url(arrows.png) no-repeat 0 0;display:block;height:15px;overflow:hidden;text-indent:-99999em;width:15px}.yui3-resize-handle-inner-br{background-position:-30px 0;bottom:-2px;right:-2px}.yui3-resize-handle-inner-tr{background-position:-58px 0;bottom:0;right:-2px}.yui3-resize-handle-inner-bl{background-position:-75px 0;bottom:-2px;right:-2px}.yui3-resize-handle-inner-tl{background-position:-47px 0;bottom:0;right:-2px}.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-t{background-position:-15px 0}#yui3-css-stamp.skin-sam-resize-base{display:none}+.yui3-resize,.yui3-resize-wrapper{z-index:0;zoom:1}.yui3-resize-handle{position:absolute;display:block;z-index:100;zoom:1}.yui3-resize-proxy{position:absolute;border:1px dashed #000;position:absolute;z-index:10000}.yui3-resize-hidden-handles .yui3-resize-handle{opacity:0;filter:alpha(opacity=0)}.yui3-resize-handle-t,.yui3-resize-handle-b{width:100%;left:0;height:6px}.yui3-resize-handle-l,.yui3-resize-handle-r{height:100%;top:0;width:6px}.yui3-resize-handle-t{cursor:n-resize;top:0}.yui3-resize-handle-b{cursor:s-resize;bottom:0}.yui3-resize-handle-l{cursor:w-resize;left:0}.yui3-resize-handle-r{cursor:e-resize;right:0}.yui3-resize-handle-inner{position:absolute;zoom:1}@media only screen and (min-device-width :320px) and (max-device-width:480px){.yui3-resize-handle-inner:after{content:"";width:40px;height:40px;position:absolute}.yui3-resize-handle-inner-r,.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-tr,.yui3-resize-handle-inner-br,.yui3-resize-handle-inner-tl,.yui3-resize-handle-inner-bl{overflow:visible!important}.yui3-resize-handle-inner-r:after{top:-12px;right:0}.yui3-resize-handle-inner-l:after{top:-12px;left:0}.yui3-resize-handle-inner-t:after{top:0;left:-12px}.yui3-resize-handle-inner-b:after{bottom:0;left:-12px}.yui3-resize-handle-inner-tr:after{top:0;right:0}.yui3-resize-handle-inner-br:after{bottom:0;right:0}.yui3-resize-handle-inner-tl:after{top:0;left:0}.yui3-resize-handle-inner-bl:after{bottom:0;left:0}}@media only screen and (min-device-width :768px) and (max-device-width:1024px){.yui3-resize-handle-inner:after{content:"";width:30px;height:30px;position:absolute}.yui3-resize-handle-inner-r,.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-tr,.yui3-resize-handle-inner-br,.yui3-resize-handle-inner-tl,.yui3-resize-handle-inner-bl{overflow:visible!important}.yui3-resize-handle-inner-r:after{top:-6px;right:0}.yui3-resize-handle-inner-l:after{top:-6px;left:0}.yui3-resize-handle-inner-t:after{top:0;left:-6px}.yui3-resize-handle-inner-b:after{bottom:0;left:-6px}.yui3-resize-handle-inner-tr:after{top:0;right:0}.yui3-resize-handle-inner-br:after{bottom:0;right:0}.yui3-resize-handle-inner-tl:after{top:0;left:0}.yui3-resize-handle-inner-bl:after{bottom:0;left:0}}.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b{margin-left:-8px;left:50%}.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-r{margin-top:-8px;top:50%}.yui3-resize-handle-inner-t{top:-4px}.yui3-resize-handle-inner-b{bottom:-4px}.yui3-resize-handle-inner-l{left:-4px}.yui3-resize-handle-inner-r{right:-4px}.yui3-resize-handle-tr,.yui3-resize-handle-br,.yui3-resize-handle-tl,.yui3-resize-handle-bl{height:15px;width:15px;z-index:200}.yui3-resize-handle-tr{cursor:ne-resize;top:0;right:0}.yui3-resize-handle-tl{cursor:nw-resize;top:0;left:0}.yui3-resize-handle-br{cursor:se-resize;bottom:0;right:0}.yui3-resize-handle-bl{cursor:sw-resize;bottom:0;left:0}.yui3-resize-handle-inner-r,.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-tr,.yui3-resize-handle-inner-br,.yui3-resize-handle-inner-tl,.yui3-resize-handle-inner-bl{background-repeat:no-repeat;background:url(arrows.png) no-repeat 0 0;display:block;height:15px;overflow:hidden;text-indent:-99999em;width:15px}.yui3-resize-handle-inner-br{background-position:-30px 0;bottom:-2px;right:-2px}.yui3-resize-handle-inner-tr{background-position:-58px 0;bottom:0;right:-2px}.yui3-resize-handle-inner-bl{background-position:-75px 0;bottom:-2px;right:-2px}.yui3-resize-handle-inner-tl{background-position:-47px 0;bottom:0;right:-2px}.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-t{background-position:-15px 0}#yui3-css-stamp.skin-sam-resize-base{display:none}
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,13 +1,13 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ .yui3-aclist{position:absolute;z-index:1}.yui3-aclist-hidden{visibility:hidden}.yui3-aclist-aria{left:-9999px;position:absolute}.yui3-aclist-list{list-style:none;margin:0;overflow:hidden;padding:0}.yui3-aclist-item{cursor:pointer;list-style:none;padding:2px 5px}.yui3-aclist-item-active{outline:#afafaf dotted thin}.yui3-skin-sam .yui3-aclist-content{background:#fff;border:1px solid #afafaf;-moz-box-shadow:1px 1px 4px rgba(0,0,0,0.58);-webkit-box-shadow:1px 1px 4px rgba(0,0,0,0.58);box-shadow:1px 1px 4px rgba(0,0,0,0.58)}.yui3-skin-sam .yui3-aclist-item-hover{background:#bfdaff}.yui3-skin-sam .yui3-aclist-item-active{background:#2647a0;color:#fff;outline:0}#yui3-css-stamp.skin-sam-autocomplete-list{display:none}-.yui3-calendar-pane{width:100%}.yui3-calendar-grid{width:100%}.yui3-calendar-column-hidden,.yui3-calendar-hidden{display:none}.yui3-skin-sam .yui3-calendar-content{padding:10px;color:#000;border:1px solid gray;background:#f2f2f2;background:-moz-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#f9f9f9),color-stop(100%,#f2f2f2));background:-webkit-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);background:-o-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);background:-ms-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9',endColorstr='#f2f2f2',GradientType=0);background:linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);-moz-border-radius:5px;border-radius:5px}.yui3-skin-sam .yui3-calendar-grid{padding:5px;border-collapse:collapse}.yui3-skin-sam .yui3-calendar-header{padding-bottom:10px}.yui3-skin-sam .yui3-calendar-header-label{margin:0;font-size:1em;font-weight:bold}.yui3-skin-sam .yui3-calendar-day,.yui3-skin-sam .yui3-calendar-prevmonth-day,.yui3-skin-sam .yui3-calendar-nextmonth-day{padding:5px;border:1px solid #ccc;background:#fff;text-align:center}.yui3-skin-sam .yui3-calendar-day:hover{background:#06c;color:#fff}.yui3-skin-sam .yui3-calendar-selection-disabled,.yui3-skin-sam .yui3-calendar-selection-disabled:hover{color:#a6a6a6;background:#ccc}.yui3-skin-sam .yui3-calendar-weekday{font-weight:bold}.yui3-skin-sam .yui3-calendar-prevmonth-day,.yui3-skin-sam .yui3-calendar-nextmonth-day{color:#a6a6a6}.yui3-skin-sam .yui3-calendar-day{font-weight:bold}.yui3-skin-sam .yui3-calendar-day-selected{background-color:#b3d4ff;color:#000}.yui3-skin-sam .yui3-calendar-header-label{text-align:center}.yui3-skin-sam .yui3-calendar-left-grid{margin-right:1em}.yui3-skin-sam .yui3-calendar-right-grid{margin-left:1em}.yui3-skin-sam .yui3-calendar-day-highlighted{background-color:#dcdef5}.yui3-skin-sam .yui3-calendar-day-selected.yui3-calendar-day-highlighted{background-color:#758fbb}-.yui3-calendar-column-hidden,.yui3-calendar-hidden{display:none}.yui3-calendar-day{cursor:pointer}.yui3-calendar-selection-disabled{cursor:default}.yui3-calendar-prevmonth-day{cursor:default}.yui3-calendar-nextmonth-day{cursor:default}.yui3-calendar-content:hover .yui3-calendar-day,.yui3-calendar-content:hover .yui3-calendar-prevmonth-day,.yui3-calendar-content:hover .yui3-calendar-nextmonth-day{-moz-user-select:none}.yui3-skin-sam .yui3-calendar-day-highlighted{background-color:#dcdef5}.yui3-skin-sam .yui3-calendar-day-selected.yui3-calendar-day-highlighted{background-color:#758fbb}-.yui3-calendar-header{padding-left:15px;padding-right:15px}.yui3-calendar-header-label{width:100%}.yui3-calendarnav-prevmonth{cursor:pointer}.yui3-calendarnav-nextmonth{cursor:pointer}.yui3-skin-sam .yui3-calendarnav-prevmonth,.yui3-skin-sam .yui3-calendarnav-nextmonth{color:#000;width:12px;height:14px;background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAKNJREFUeNpiYCAeSAPxUiiWZqAi4ATiaiD+DMT/ofgzVIyTUsMDgfghksHo+CFUDcnAAIgP4DEYHR+A6iEIhIB4GgkGo+NpUDMwADMQFwHxBwoMh+EPULOYYYZ7APFVKhiMjkFmejBBLWFjoD5gQ+dQO4iwOloUiOdQYPgcqBkDl0zRQRQRGS2KGkVFHRB/QzL4G1SMk5qpQg6psJMjVhNAgAEAH+qPqeiPEUsAAAAASUVORK5CYII=);background-repeat:no-repeat}.yui3-skin-sam .yui3-calendarnav-prevmonth:hover,.yui3-skin-sam .yui3-calendarnav-nextmonth:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPpJREFUeNpi/P//PwMxQD9jszSQ6oJyyy7O8H1KjD5GQhYADeYEUkVAXAHEPFDhL0DcAcR9QIu+k20B0PBAIDUBiOVwKHkExAVAS9aTZAHQYAOowfYMxIGDUIsu4LUAaLAQkGoB4kwG8sB0IK4BWvQOxQKgwcxAdj4Q1wExPwNl4CMQNwHxRKBFfxn10jd5ADm9QKzFQF1wDYiLmaAcNgbqA7CZTEBv7ADS2iDboN5joEIQgczSBpmNHsmiQKodiJPJNHwuEFcCDX49MMkUi0VRUB/hy2ggFy+jtKgohRYVnFDh79CiopuiogLNIjmobxigrn5EjD6AAAMAok9vhfHG8wQAAAAASUVORK5CYII=);color:#06c}.yui3-skin-sam .yui3-calendarnav-month-disabled,.yui3-skin-sam .yui3-calendarnav-month-disabled:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQhJREFUeNqs0yGLAlEUhuHrKoIgCFbBJghb3F+g0WrVarEqLIhBEEFYWKNNMBktU4z6C5RNkwyCyWQSTPuOfCOCrHNnxwMPyOGe73DAiTmOYywrhy/9/sTBZujN4k0KPbioi6teKuqCmsKGSN/10+q5ehN6QQkrLJB/Mp/Xm5VmAhdkMcEGZWNfZc1MlPGwII42dmiZ/1dLGW1lXhdU8YNvZEz0yijLy6z6FyTN6yvpX7DEOzo4vSD4pCwvc+lfcMEYBUwjhE+VMVbmw7/oiCY+sA4RvNZMUxmB38EWFTSwfxK815uKZkJ/yXMU0cf5rn9Wr6g3f1bC4nwvbIAZRup1Ay671a8AAwC3OzOqxK+rkwAAAABJRU5ErkJggg==);cursor:default;color:#ccc}.yui3-skin-sam .yui3-calendarnav-prevmonth,.yui3-skin-sam .yui3-calendarnav-prevmonth:hover{background-position:0 0;margin-left:-12px}.yui3-skin-sam .yui3-calendarnav-nextmonth,.yui3-skin-sam .yui3-calendarnav-nextmonth:hover{background-position:-12px 0;margin-right:-12px}.yui3-skin-sam .yui3-calendarnav-prevmonth span,.yui3-skin-sam .yui3-calendarnav-nextmonth span{display:none;*display:block}+.yui3-calendar-pane{width:100%}.yui3-calendar-grid{width:100%}.yui3-calendar-column-hidden,.yui3-calendar-hidden{display:none}.yui3-skin-sam .yui3-calendar-content{padding:10px;color:#000;border:1px solid gray;background:#f2f2f2;background:-moz-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#f9f9f9),color-stop(100%,#f2f2f2));background:-webkit-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);background:-o-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);background:-ms-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9',endColorstr='#f2f2f2',GradientType=0);background:linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);-moz-border-radius:5px;border-radius:5px}.yui3-skin-sam .yui3-calendar-grid{padding:5px;border-collapse:collapse}.yui3-skin-sam .yui3-calendar-header{padding-bottom:10px}.yui3-skin-sam .yui3-calendar-header-label{margin:0;font-size:1em;font-weight:bold}.yui3-skin-sam .yui3-calendar-day,.yui3-skin-sam .yui3-calendar-prevmonth-day,.yui3-skin-sam .yui3-calendar-nextmonth-day{padding:5px;border:1px solid #ccc;background:#fff;text-align:center}.yui3-skin-sam .yui3-calendar-day:hover{background:#06c;color:#fff}.yui3-skin-sam .yui3-calendar-selection-disabled,.yui3-skin-sam .yui3-calendar-selection-disabled:hover{color:#a6a6a6;background:#ccc}.yui3-skin-sam .yui3-calendar-weekday{font-weight:bold}.yui3-skin-sam .yui3-calendar-prevmonth-day,.yui3-skin-sam .yui3-calendar-nextmonth-day{color:#a6a6a6}.yui3-skin-sam .yui3-calendar-day{font-weight:bold}.yui3-skin-sam .yui3-calendar-day-selected{background-color:#b3d4ff;color:#000}.yui3-skin-sam .yui3-calendar-header-label{text-align:center}.yui3-skin-sam .yui3-calendar-left-grid{margin-right:1em}.yui3-skin-sam .yui3-calendar-right-grid{margin-left:1em}.yui3-skin-sam .yui3-calendar-day-highlighted{background-color:#dcdef5}.yui3-skin-sam .yui3-calendar-day-selected.yui3-calendar-day-highlighted{background-color:#758fbb}#yui3-css-stamp.skin-sam-calendar-base{display:none}+.yui3-calendar-column-hidden,.yui3-calendar-hidden{display:none}.yui3-calendar-day{cursor:pointer}.yui3-calendar-selection-disabled{cursor:default}.yui3-calendar-prevmonth-day{cursor:default}.yui3-calendar-nextmonth-day{cursor:default}.yui3-calendar-content:hover .yui3-calendar-day,.yui3-calendar-content:hover .yui3-calendar-prevmonth-day,.yui3-calendar-content:hover .yui3-calendar-nextmonth-day{-moz-user-select:none}.yui3-skin-sam .yui3-calendar-day-highlighted{background-color:#dcdef5}.yui3-skin-sam .yui3-calendar-day-selected.yui3-calendar-day-highlighted{background-color:#758fbb}#yui3-css-stamp.skin-sam-calendar{display:none}+.yui3-calendar-header{padding-left:15px;padding-right:15px}.yui3-calendar-header-label{width:100%}.yui3-calendarnav-prevmonth{cursor:pointer}.yui3-calendarnav-nextmonth{cursor:pointer}.yui3-skin-sam .yui3-calendarnav-prevmonth,.yui3-skin-sam .yui3-calendarnav-nextmonth{color:#000;width:12px;height:14px;background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAKNJREFUeNpiYCAeSAPxUiiWZqAi4ATiaiD+DMT/ofgzVIyTUsMDgfghksHo+CFUDcnAAIgP4DEYHR+A6iEIhIB4GgkGo+NpUDMwADMQFwHxBwoMh+EPULOYYYZ7APFVKhiMjkFmejBBLWFjoD5gQ+dQO4iwOloUiOdQYPgcqBkDl0zRQRQRGS2KGkVFHRB/QzL4G1SMk5qpQg6psJMjVhNAgAEAH+qPqeiPEUsAAAAASUVORK5CYII=);background-repeat:no-repeat}.yui3-skin-sam .yui3-calendarnav-prevmonth:hover,.yui3-skin-sam .yui3-calendarnav-nextmonth:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPpJREFUeNpi/P//PwMxQD9jszSQ6oJyyy7O8H1KjD5GQhYADeYEUkVAXAHEPFDhL0DcAcR9QIu+k20B0PBAIDUBiOVwKHkExAVAS9aTZAHQYAOowfYMxIGDUIsu4LUAaLAQkGoB4kwG8sB0IK4BWvQOxQKgwcxAdj4Q1wExPwNl4CMQNwHxRKBFfxn10jd5ADm9QKzFQF1wDYiLmaAcNgbqA7CZTEBv7ADS2iDboN5joEIQgczSBpmNHsmiQKodiJPJNHwuEFcCDX49MMkUi0VRUB/hy2ggFy+jtKgohRYVnFDh79CiopuiogLNIjmobxigrn5EjD6AAAMAok9vhfHG8wQAAAAASUVORK5CYII=);color:#06c}.yui3-skin-sam .yui3-calendarnav-month-disabled,.yui3-skin-sam .yui3-calendarnav-month-disabled:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQhJREFUeNqs0yGLAlEUhuHrKoIgCFbBJghb3F+g0WrVarEqLIhBEEFYWKNNMBktU4z6C5RNkwyCyWQSTPuOfCOCrHNnxwMPyOGe73DAiTmOYywrhy/9/sTBZujN4k0KPbioi6teKuqCmsKGSN/10+q5ehN6QQkrLJB/Mp/Xm5VmAhdkMcEGZWNfZc1MlPGwII42dmiZ/1dLGW1lXhdU8YNvZEz0yijLy6z6FyTN6yvpX7DEOzo4vSD4pCwvc+lfcMEYBUwjhE+VMVbmw7/oiCY+sA4RvNZMUxmB38EWFTSwfxK815uKZkJ/yXMU0cf5rn9Wr6g3f1bC4nwvbIAZRup1Ay671a8AAwC3OzOqxK+rkwAAAABJRU5ErkJggg==);cursor:default;color:#ccc}.yui3-skin-sam .yui3-calendarnav-prevmonth,.yui3-skin-sam .yui3-calendarnav-prevmonth:hover{background-position:0 0;margin-left:-12px}.yui3-skin-sam .yui3-calendarnav-nextmonth,.yui3-skin-sam .yui3-calendarnav-nextmonth:hover{background-position:-12px 0;margin-right:-12px}.yui3-skin-sam .yui3-calendarnav-prevmonth span,.yui3-skin-sam .yui3-calendarnav-nextmonth span{display:none;*display:block}#yui3-css-stamp.skin-sam-calendarnavigator{display:none} .yui3-skin-sam .yui3-console-ft .yui3-console-filters-categories,.yui3-skin-sam .yui3-console-ft .yui3-console-filters-sources{text-align:left;padding:5px 0;border:1px inset;margin:0 2px}.yui3-skin-sam .yui3-console-ft .yui3-console-filters-categories{background:#fff;border-bottom:2px ridge}.yui3-skin-sam .yui3-console-ft .yui3-console-filters-sources{background:#fff;margin-bottom:2px;border-top:0 none;border-bottom-right-radius:10px;border-bottom-left-radius:10px;-moz-border-radius-bottomright:10px;-moz-border-radius-bottomleft:10px;-webkit-border-bottom-right-radius:10px;-webkit-border-bottom-left-radius:10px}.yui3-skin-sam .yui3-console-filter-label{white-space:nowrap;margin-left:1ex}#yui3-css-stamp.skin-sam-console-filters{display:none} .yui3-skin-sam .yui3-console-separate{position:absolute;right:1em;top:1em;z-index:999}.yui3-skin-sam .yui3-console-inline{display:-moz-inline-stack;display:inline-block;*display:inline;zoom:1;vertical-align:top}.yui3-skin-sam .yui3-console-inline .yui3-console-content{position:relative}.yui3-skin-sam .yui3-console-content{background:#777;_background:#d8d8da url(bg.png) repeat-x 0 0;font:normal 13px/1.3 Arial,sans-serif;text-align:left;border:1px solid #777;border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:10px}.yui3-skin-sam .yui3-console-hd,.yui3-skin-sam .yui3-console-bd,.yui3-skin-sam .yui3-console-ft{position:relative}.yui3-skin-sam .yui3-console-hd,.yui3-skin-sam .yui3-console-ft .yui3-console-controls{text-align:right}.yui3-skin-sam .yui3-console-hd{background:#d8d8da url(bg.png) repeat-x 0 0;padding:1ex;border:1px solid transparent;_border:0 none;border-top-right-radius:10px;border-top-left-radius:10px;-moz-border-radius-topright:10px;-moz-border-radius-topleft:10px;-webkit-border-top-right-radius:10px;-webkit-border-top-left-radius:10px}.yui3-skin-sam .yui3-console-bd{background:#fff;border-top:1px solid #777;border-bottom:1px solid #777;color:#000;font-size:11px;overflow:auto;overflow-x:auto;overflow-y:scroll;_width:100%}.yui3-skin-sam .yui3-console-ft{background:#d8d8da url(bg.png) repeat-x 0 0;border:1px solid transparent;_border:0 none;border-bottom-right-radius:10px;border-bottom-left-radius:10px;-moz-border-radius-bottomright:10px;-moz-border-radius-bottomleft:10px;-webkit-border-bottom-right-radius:10px;-webkit-border-bottom-left-radius:10px}.yui3-skin-sam .yui3-console-controls{padding:4px 1ex;zoom:1}.yui3-skin-sam .yui3-console-title{color:#000;display:inline;float:left;font-weight:bold;font-size:13px;height:24px;line-height:24px;margin:0;padding-left:1ex}.yui3-skin-sam .yui3-console-pause-label{float:left}.yui3-skin-sam .yui3-console-button{line-height:1.3}.yui3-skin-sam .yui3-console-collapsed .yui3-console-bd,.yui3-skin-sam .yui3-console-collapsed .yui3-console-ft{display:none}.yui3-skin-sam .yui3-console-content.yui3-console-collapsed{-webkit-border-radius:0}.yui3-skin-sam .yui3-console-collapsed .yui3-console-hd{border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:0}.yui3-skin-sam .yui3-console-entry{border-bottom:1px solid #aaa;min-height:32px;_height:32px}.yui3-skin-sam .yui3-console-entry-meta{margin:0;overflow:hidden}.yui3-skin-sam .yui3-console-entry-content{margin:0;padding:0 1ex;white-space:pre-wrap;word-wrap:break-word}.yui3-skin-sam .yui3-console-entry-meta .yui3-console-entry-src{color:#000;font-style:italic;font-weight:bold;float:right;margin:2px 5px 0 0}.yui3-skin-sam .yui3-console-entry-meta .yui3-console-entry-time{color:#777;padding-left:1ex}.yui3-skin-sam .yui3-console-entry-warn .yui3-console-entry-meta .yui3-console-entry-time{color:#555}.yui3-skin-sam .yui3-console-entry-info .yui3-console-entry-meta .yui3-console-entry-cat,.yui3-skin-sam .yui3-console-entry-warn .yui3-console-entry-meta .yui3-console-entry-cat,.yui3-skin-sam .yui3-console-entry-error .yui3-console-entry-meta .yui3-console-entry-cat{display:none}.yui3-skin-sam .yui3-console-entry-warn{background:#aee url(warn_error.png) no-repeat -15px 15px}.yui3-skin-sam .yui3-console-entry-error{background:#ffa url(warn_error.png) no-repeat 5px -24px;color:#900}.yui3-skin-sam .yui3-console-entry-warn .yui3-console-entry-content,.yui3-skin-sam .yui3-console-entry-error .yui3-console-entry-content{padding-left:24px}.yui3-skin-sam .yui3-console-entry-cat{text-transform:uppercase;padding:1px 4px;background-color:#ccc}.yui3-skin-sam .yui3-console-entry-info .yui3-console-entry-cat{background-color:#ac2}.yui3-skin-sam .yui3-console-entry-warn .yui3-console-entry-cat{background-color:#e81}.yui3-skin-sam .yui3-console-entry-error .yui3-console-entry-cat{background-color:#b00;color:#fff}.yui3-skin-sam .yui3-console-hidden{display:none}#yui3-css-stamp.skin-sam-console{display:none} .yui3-skin-sam .yui3-datatable-mask{position:absolute;z-index:9500}.yui3-datatable-tmp{position:absolute;left:-9000px}.yui3-datatable-scrollable .yui3-datatable-bd{overflow:auto}.yui3-datatable-scrollable .yui3-datatable-hd{overflow:hidden;position:relative}.yui3-datatable-scrollable .yui3-datatable-bd thead tr,.yui3-datatable-scrollable .yui3-datatable-bd thead th{position:absolute;left:-1500px}.yui3-datatable-scrollable tbody{-moz-outline:0}.yui3-skin-sam thead .yui3-datatable-sortable{cursor:pointer}.yui3-skin-sam thead .yui3-datatable-draggable{cursor:move}.yui3-datatable-coltarget{position:absolute;z-index:999}.yui3-datatable-hd{zoom:1}th.yui3-datatable-resizeable .yui3-datatable-resizerliner{position:relative}.yui3-datatable-resizer{position:absolute;right:0;bottom:0;height:100%;cursor:e-resize;cursor:col-resize;background-color:#CCC;opacity:0;filter:alpha(opacity=0)}.yui3-datatable-resizerproxy{visibility:hidden;position:absolute;z-index:9000;background-color:#CCC;opacity:0;filter:alpha(opacity=0)}th.yui3-datatable-hidden .yui3-datatable-liner,td.yui3-datatable-hidden .yui3-datatable-liner,th.yui3-datatable-hidden .yui3-datatable-resizer{display:none}.yui3-datatable-editor,.yui3-datatable-editor-shim{position:absolute;z-index:9000}.yui3-skin-sam .yui3-datatable table{margin:0;padding:0;font-family:arial;font-size:inherit;border-collapse:separate;*border-collapse:collapse;border-spacing:0;border:1px solid #7f7f7f}.yui3-skin-sam .yui3-datatable thead{border-spacing:0}.yui3-skin-sam .yui3-datatable caption{color:#000;font-size:85%;font-weight:normal;font-style:italic;line-height:1;padding:1em 0;text-align:center}.yui3-skin-sam .yui3-datatable th{background:#d8d8da url(sprite.png) repeat-x 0 0}.yui3-skin-sam .yui3-datatable th,.yui3-skin-sam .yui3-datatable th a{font-weight:normal;text-decoration:none;color:#000;vertical-align:bottom}.yui3-skin-sam .yui3-datatable th{margin:0;padding:0;border:0;border-right:1px solid #cbcbcb}.yui3-skin-sam .yui3-datatable tr.yui3-datatable-first td{border-top:1px solid #7f7f7f}.yui3-skin-sam .yui3-datatable th .yui3-datatable-liner{white-space:nowrap}.yui3-skin-sam .yui3-datatable-liner{margin:0;padding:0;padding:4px 10px 4px 10px;overflow:visible;border:0 solid black}.yui3-skin-sam .yui3-datatable-coltarget{width:5px;background-color:red}.yui3-skin-sam .yui3-datatable td{margin:0;padding:0;border:0;border-right:1px solid #cbcbcb;text-align:left}.yui3-skin-sam .yui3-datatable-list td{border-right:0}.yui3-skin-sam .yui3-datatable-resizer{width:6px}.yui3-skin-sam .yui3-datatable-mask{background-color:#000;opacity:.25;filter:alpha(opacity=25)}.yui3-skin-sam .yui3-datatable-message{background-color:#FFF}.yui3-skin-sam .yui3-datatable-scrollable table{border:0}.yui3-skin-sam .yui3-datatable-scrollable .yui3-datatable-hd{border-left:1px solid #7f7f7f;border-top:1px solid #7f7f7f;border-right:1px solid #7f7f7f}.yui3-skin-sam .yui3-datatable-scrollable .yui3-datatable-bd{border-left:1px solid #7f7f7f;border-bottom:1px solid #7f7f7f;border-right:1px solid #7f7f7f;background-color:#FFF}.yui3-skin-sam .yui3-datatable-scrollable .yui3-datatable-data tr.yui3-datatable-last td{border-bottom:1px solid #7f7f7f}.yui3-skin-sam th.yui3-datatable-asc,.yui3-skin-sam th.yui3-datatable-desc{background:url(sprite.png) repeat-x 0 -100px}.yui3-skin-sam th.yui3-datatable-sortable .yui3-datatable-liner{padding-right:20px}.yui3-skin-sam th.yui3-datatable-asc .yui3-datatable-liner{background:url(dt-arrow-up.png) no-repeat right}.yui3-skin-sam th.yui3-datatable-desc .yui3-datatable-liner{background:url(dt-arrow-dn.png) no-repeat right}tbody .yui3-datatable-editable{cursor:pointer}.yui3-datatable-editor{text-align:left;background-color:#f2f2f2;border:1px solid #808080;padding:6px}.yui3-datatable-editor label{padding-left:4px;padding-right:6px}.yui3-datatable-editor .yui3-datatable-button{padding-top:6px;text-align:right}.yui3-datatable-editor .yui3-datatable-button button{background:url(sprite.png) repeat-x 0 0;border:1px solid #999;width:4em;height:1.8em;margin-left:6px}.yui3-datatable-editor .yui3-datatable-button button.yui3-datatable-default{background:url(sprite.png) repeat-x 0 -1400px;background-color:#5584e0;border:1px solid #304369;color:#FFF}.yui3-datatable-editor .yui3-datatable-button button:hover{background:url(sprite.png) repeat-x 0 -1300px;color:#000}.yui3-datatable-editor .yui3-datatable-button button:active{background:url(sprite.png) repeat-x 0 -1700px;color:#000}.yui3-skin-sam .yui3-datatable td{background-color:transparent}.yui3-skin-sam tr.yui3-datatable-even td{background-color:#FFF}.yui3-skin-sam tr.yui3-datatable-odd td{background-color:#edf5ff}.yui3-skin-sam tr.yui3-datatable-even td.yui3-datatable-asc,.yui3-skin-sam tr.yui3-datatable-even td.yui3-datatable-desc{background-color:#edf5ff}.yui3-skin-sam tr.yui3-datatable-odd td.yui3-datatable-asc,.yui3-skin-sam tr.yui3-datatable-odd td.yui3-datatable-desc{background-color:#dbeaff}.yui3-skin-sam .yui3-datatable-list tr.yui3-datatable-even{background-color:#FFF}.yui3-skin-sam .yui3-datatable-list tr.yui3-datatable-odd{background-color:#FFF}.yui3-skin-sam .yui3-datatable-list tr.yui3-datatable-even td.yui3-datatable-asc,.yui3-skin-sam .yui3-datatable-list tr.yui3-datatable-even td.yui3-datatable-desc{background-color:#edf5ff}.yui3-skin-sam .yui3-datatable-list tr.yui3-datatable-odd td.yui3-datatable-asc,.yui3-skin-sam .yui3-datatable-list tr.yui3-datatable-odd td.yui3-datatable-desc{background-color:#edf5ff}.yui3-skin-sam th.yui3-datatable-highlighted,.yui3-skin-sam th.yui3-datatable-highlighted a{background-color:#b2d2ff}.yui3-skin-sam tr.yui3-datatable-highlighted,.yui3-skin-sam tr.yui3-datatable-highlighted td.yui3-datatable-asc,.yui3-skin-sam tr.yui3-datatable-highlighted td.yui3-datatable-desc,.yui3-skin-sam tr.yui3-datatable-even td.yui3-datatable-highlighted,.yui3-skin-sam tr.yui3-datatable-odd td.yui3-datatable-highlighted{cursor:pointer;background-color:#b2d2ff}@@ -21,14 +21,13 @@ .yui3-menu .yui3-menu{position:absolute;z-index:1}.yui3-menu .yui3-shim{position:absolute;top:0;left:0;z-index:-1;opacity:0;filter:alpha(opacity=0);border:0;margin:0;padding:0;height:100%;width:100%}.yui3-menu-hidden{top:-10000px;left:-10000px;visibility:hidden}.yui3-menu li{list-style-type:none}.yui3-menu ul,.yui3-menu li{margin:0;padding:0}.yui3-menu-label,.yui3-menuitem-content{text-align:left;white-space:nowrap;display:block}.yui3-menu-horizontal li{float:left;width:auto}.yui3-menu-horizontal li li{float:none}.yui3-menu-horizontal ul{*zoom:1}.yui3-menu-horizontal ul ul{*zoom:normal}.yui3-menu-horizontal>.yui3-menu-content>ul:after{content:"";display:block;clear:both;line-height:0;font-size:0;visibility:hidden}.yui3-menu-content{*zoom:1}.yui3-menu-hidden .yui3-menu-content{*zoom:normal}.yui3-menuitem-content,.yui3-menu-label{_zoom:1}.yui3-menu-hidden .yui3-menuitem-content,.yui3-menu-hidden .yui3-menu-label{_zoom:normal}.yui3-skin-sam .yui3-menu-content,.yui3-skin-sam .yui3-menu .yui3-menu .yui3-menu-content{font-size:93%;line-height:1.5;*line-height:1.45;border:solid 1px #808080;background:#fff;padding:3px 0}.yui3-skin-sam .yui3-menu .yui3-menu .yui3-menu-content{font-size:100%}.yui3-skin-sam .yui3-menu-horizontal .yui3-menu-content{line-height:2;*line-height:1.9;background:url(sprite.png) repeat-x 0 0;padding:0}.yui3-skin-sam .yui3-menu ul,.yui3-skin-sam .yui3-menu ul ul{margin-top:3px;padding-top:3px;border-top:solid 1px #ccc}.yui3-skin-sam .yui3-menu ul.first-of-type{border:0;margin:0;padding:0}.yui3-skin-sam .yui3-menu-horizontal ul{padding:0;margin:0;border:0}.yui3-skin-sam .yui3-menu li,.yui3-skin-sam .yui3-menu .yui3-menu li{_border-bottom:solid 1px #fff}.yui3-skin-sam .yui3-menu-horizontal li{_border-bottom:0}.yui3-skin-sam .yui3-menubuttonnav li{border-right:solid 1px #ccc}.yui3-skin-sam .yui3-splitbuttonnav li{border-right:solid 1px #808080}.yui3-skin-sam .yui3-menubuttonnav li li,.yui3-skin-sam .yui3-splitbuttonnav li li{border-right:0}.yui3-skin-sam .yui3-menu-label,.yui3-skin-sam .yui3-menu .yui3-menu .yui3-menu-label,.yui3-skin-sam .yui3-menuitem-content,.yui3-skin-sam .yui3-menu .yui3-menu .yui3-menuitem-content{padding:0 1em;color:#000;text-decoration:none;cursor:default;float:none;border:0;margin:0}.yui3-skin-sam .yui3-menu-horizontal .yui3-menu-label,.yui3-skin-sam .yui3-menu-horizontal .yui3-menuitem-content{padding:0 10px;border-style:solid;border-color:#808080;border-width:1px 0;margin:-1px 0;float:left;width:auto}.yui3-skin-sam .yui3-menu-label,.yui3-skin-sam .yui3-menu .yui3-menu .yui3-menu-label{background:url(vertical-menu-submenu-indicator.png) right center no-repeat}.yui3-skin-sam .yui3-menu-horizontal .yui3-menu-label{background:url(sprite.png) repeat-x 0 0}.yui3-skin-sam .yui3-menubuttonnav .yui3-menu-label,.yui3-skin-sam .yui3-splitbuttonnav .yui3-menu-label{background-image:none}.yui3-skin-sam .yui3-menubuttonnav .yui3-menu-label{padding-right:0}.yui3-skin-sam .yui3-menubuttonnav .yui3-menu-label em{font-style:normal;padding-right:20px;display:block;background:url(horizontal-menu-submenu-indicator.png) right center no-repeat}.yui3-skin-sam .yui3-splitbuttonnav .yui3-menu-label{padding:0}.yui3-skin-sam .yui3-splitbuttonnav .yui3-menu-label a{float:left;width:auto;color:#000;text-decoration:none;cursor:default;padding:0 5px 0 10px}.yui3-skin-sam .yui3-splitbuttonnav .yui3-menu-label .yui3-menu-toggle{padding:0;border-left:solid 1px #ccc;width:15px;overflow:hidden;text-indent:-1000px;background:url(horizontal-menu-submenu-indicator.png) 3px center no-repeat}.yui3-skin-sam .yui3-menu-label-active,.yui3-skin-sam .yui3-menu-label-menuvisible,.yui3-skin-sam .yui3-menu .yui3-menu .yui3-menu-label-active,.yui3-skin-sam .yui3-menu .yui3-menu .yui3-menu-label-menuvisible{background-color:#b3d4ff}.yui3-skin-sam .yui3-menuitem-active .yui3-menuitem-content,.yui3-skin-sam .yui3-menu .yui3-menu .yui3-menuitem-active .yui3-menuitem-content{background-image:none;background-color:#b3d4ff;border-left-width:0;margin-left:0}.yui3-skin-sam .yui3-menu-horizontal .yui3-menu-label-active,.yui3-skin-sam .yui3-menu-horizontal .yui3-menuitem-active .yui3-menuitem-content,.yui3-skin-sam .yui3-menu-horizontal .yui3-menu-label-menuvisible{border-color:#7d98b8;background:url(sprite.png) repeat-x 0 -1700px}.yui3-skin-sam .yui3-menubuttonnav .yui3-menu-label-active,.yui3-skin-sam .yui3-menubuttonnav .yui3-menuitem-active .yui3-menuitem-content,.yui3-skin-sam .yui3-menubuttonnav .yui3-menu-label-menuvisible,.yui3-skin-sam .yui3-splitbuttonnav .yui3-menu-label-active,.yui3-skin-sam .yui3-splitbuttonnav .yui3-menuitem-active .yui3-menuitem-content,.yui3-skin-sam .yui3-splitbuttonnav .yui3-menu-label-menuvisible{border-left-width:1px;margin-left:-1px}.yui3-skin-sam .yui3-splitbuttonnav .yui3-menu-label-menuvisible{border-color:#808080;background:transparent}.yui3-skin-sam .yui3-splitbuttonnav .yui3-menu-label-menuvisible .yui3-menu-toggle{border-color:#7d98b8;background:url(horizontal-menu-submenu-toggle.png) left center no-repeat}#yui3-css-stamp.skin-sam-node-menunav{display:none} .yui3-overlay{position:absolute}.yui3-overlay-hidden{visibility:hidden}.yui3-widget-tmp-forcesize .yui3-overlay-content{overflow:hidden!important}#yui3-css-stamp.skin-sam-overlay{display:none} .yui3-panel{position:absolute}.yui3-panel-hidden{visibility:hidden}.yui3-widget-tmp-forcesize .yui3-panel-content{overflow:hidden!important}.yui3-panel .yui3-widget-hd{position:relative}.yui3-panel .yui3-widget-hd .yui3-widget-buttons{position:absolute;top:0;right:0}.yui3-panel .yui3-widget-ft .yui3-widget-buttons{display:inline-block;*display:inline;zoom:1}.yui3-skin-sam .yui3-panel-content{-webkit-box-shadow:0 0 5px #333;-moz-box-shadow:0 0 5px #333;box-shadow:0 0 5px #333;border:1px solid black;background:white}.yui3-skin-sam .yui3-panel .yui3-widget-hd{padding:8px 28px 8px 8px;min-height:13px;_height:13px;color:white;background-color:#3961c5;background:-moz-linear-gradient(0% 100% 90deg,#2647a0 7%,#3d67ce 50%,#426fd9 100%);background:-webkit-gradient(linear,left bottom,left top,from(#2647a0),color-stop(0.07,#2647a0),color-stop(0.5,#3d67ce),to(#426fd9))}.yui3-skin-sam .yui3-panel .yui3-widget-hd .yui3-widget-buttons{padding:8px}.yui3-skin-sam .yui3-panel .yui3-widget-bd{padding:10px}.yui3-skin-sam .yui3-panel .yui3-widget-ft{background:#edf5ff;padding:8px;text-align:right}.yui3-skin-sam .yui3-panel .yui3-widget-ft .yui3-button{margin-left:8px}.yui3-skin-sam .yui3-panel .yui3-widget-hd .yui3-button-close{background:transparent;filter:none;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;width:13px;height:13px;padding:0;overflow:hidden;vertical-align:top;*font-size:0;*line-height:0;*letter-spacing:-1000px;*color:#86a5ec;*background:url(sprite_icons.png) no-repeat 1px 1px}.yui3-skin-sam .yui3-panel .yui3-widget-hd .yui3-button-close:before{content:url(sprite_icons.png);display:inline-block;text-align:center;font-size:0;line-height:0;width:13px;margin:1px 0 0 1px}.yui3-skin-sam .yui3-panel-hidden .yui3-widget-hd .yui3-button-close{display:none}#yui3-css-stamp.skin-sam-panel{display:none}-.yui3-resize,.yui3-resize-wrapper{z-index:0;zoom:1}.yui3-resize-handle{position:absolute;display:block;z-index:100;zoom:1}.yui3-resize-proxy{position:absolute;border:1px dashed #000;position:absolute;z-index:10000}.yui3-resize-hidden-handles .yui3-resize-handle{opacity:0;filter:alpha(opacity=0)}.yui3-resize-handle-t,.yui3-resize-handle-b{width:100%;left:0;height:6px}.yui3-resize-handle-l,.yui3-resize-handle-r{height:100%;top:0;width:6px}.yui3-resize-handle-t{cursor:n-resize;top:0}.yui3-resize-handle-b{cursor:s-resize;bottom:0}.yui3-resize-handle-l{cursor:w-resize;left:0}.yui3-resize-handle-r{cursor:e-resize;right:0}.yui3-resize-handle-inner{position:absolute;zoom:1}.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b{margin-left:-8px;left:50%}.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-r{margin-top:-8px;top:50%}.yui3-resize-handle-inner-t{top:-4px}.yui3-resize-handle-inner-b{bottom:-4px}.yui3-resize-handle-inner-l{left:-4px}.yui3-resize-handle-inner-r{right:-4px}.yui3-resize-handle-tr,.yui3-resize-handle-br,.yui3-resize-handle-tl,.yui3-resize-handle-bl{height:15px;width:15px;z-index:200}.yui3-resize-handle-tr{cursor:ne-resize;top:0;right:0}.yui3-resize-handle-tl{cursor:nw-resize;top:0;left:0}.yui3-resize-handle-br{cursor:se-resize;bottom:0;right:0}.yui3-resize-handle-bl{cursor:sw-resize;bottom:0;left:0}.yui3-resize-handle-inner-r,.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-tr,.yui3-resize-handle-inner-br,.yui3-resize-handle-inner-tl,.yui3-resize-handle-inner-bl{background-repeat:no-repeat;background:url(arrows.png) no-repeat 0 0;display:block;height:15px;overflow:hidden;text-indent:-99999em;width:15px}.yui3-resize-handle-inner-br{background-position:-30px 0;bottom:-2px;right:-2px}.yui3-resize-handle-inner-tr{background-position:-58px 0;bottom:0;right:-2px}.yui3-resize-handle-inner-bl{background-position:-75px 0;bottom:-2px;right:-2px}.yui3-resize-handle-inner-tl{background-position:-47px 0;bottom:0;right:-2px}.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-t{background-position:-15px 0}#yui3-css-stamp.skin-sam-resize-base{display:none}+.yui3-resize,.yui3-resize-wrapper{z-index:0;zoom:1}.yui3-resize-handle{position:absolute;display:block;z-index:100;zoom:1}.yui3-resize-proxy{position:absolute;border:1px dashed #000;position:absolute;z-index:10000}.yui3-resize-hidden-handles .yui3-resize-handle{opacity:0;filter:alpha(opacity=0)}.yui3-resize-handle-t,.yui3-resize-handle-b{width:100%;left:0;height:6px}.yui3-resize-handle-l,.yui3-resize-handle-r{height:100%;top:0;width:6px}.yui3-resize-handle-t{cursor:n-resize;top:0}.yui3-resize-handle-b{cursor:s-resize;bottom:0}.yui3-resize-handle-l{cursor:w-resize;left:0}.yui3-resize-handle-r{cursor:e-resize;right:0}.yui3-resize-handle-inner{position:absolute;zoom:1}@media only screen and (min-device-width :320px) and (max-device-width:480px){.yui3-resize-handle-inner:after{content:"";width:40px;height:40px;position:absolute}.yui3-resize-handle-inner-r,.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-tr,.yui3-resize-handle-inner-br,.yui3-resize-handle-inner-tl,.yui3-resize-handle-inner-bl{overflow:visible!important}.yui3-resize-handle-inner-r:after{top:-12px;right:0}.yui3-resize-handle-inner-l:after{top:-12px;left:0}.yui3-resize-handle-inner-t:after{top:0;left:-12px}.yui3-resize-handle-inner-b:after{bottom:0;left:-12px}.yui3-resize-handle-inner-tr:after{top:0;right:0}.yui3-resize-handle-inner-br:after{bottom:0;right:0}.yui3-resize-handle-inner-tl:after{top:0;left:0}.yui3-resize-handle-inner-bl:after{bottom:0;left:0}}@media only screen and (min-device-width :768px) and (max-device-width:1024px){.yui3-resize-handle-inner:after{content:"";width:30px;height:30px;position:absolute}.yui3-resize-handle-inner-r,.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-tr,.yui3-resize-handle-inner-br,.yui3-resize-handle-inner-tl,.yui3-resize-handle-inner-bl{overflow:visible!important}.yui3-resize-handle-inner-r:after{top:-6px;right:0}.yui3-resize-handle-inner-l:after{top:-6px;left:0}.yui3-resize-handle-inner-t:after{top:0;left:-6px}.yui3-resize-handle-inner-b:after{bottom:0;left:-6px}.yui3-resize-handle-inner-tr:after{top:0;right:0}.yui3-resize-handle-inner-br:after{bottom:0;right:0}.yui3-resize-handle-inner-tl:after{top:0;left:0}.yui3-resize-handle-inner-bl:after{bottom:0;left:0}}.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b{margin-left:-8px;left:50%}.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-r{margin-top:-8px;top:50%}.yui3-resize-handle-inner-t{top:-4px}.yui3-resize-handle-inner-b{bottom:-4px}.yui3-resize-handle-inner-l{left:-4px}.yui3-resize-handle-inner-r{right:-4px}.yui3-resize-handle-tr,.yui3-resize-handle-br,.yui3-resize-handle-tl,.yui3-resize-handle-bl{height:15px;width:15px;z-index:200}.yui3-resize-handle-tr{cursor:ne-resize;top:0;right:0}.yui3-resize-handle-tl{cursor:nw-resize;top:0;left:0}.yui3-resize-handle-br{cursor:se-resize;bottom:0;right:0}.yui3-resize-handle-bl{cursor:sw-resize;bottom:0;left:0}.yui3-resize-handle-inner-r,.yui3-resize-handle-inner-l,.yui3-resize-handle-inner-t,.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-tr,.yui3-resize-handle-inner-br,.yui3-resize-handle-inner-tl,.yui3-resize-handle-inner-bl{background-repeat:no-repeat;background:url(arrows.png) no-repeat 0 0;display:block;height:15px;overflow:hidden;text-indent:-99999em;width:15px}.yui3-resize-handle-inner-br{background-position:-30px 0;bottom:-2px;right:-2px}.yui3-resize-handle-inner-tr{background-position:-58px 0;bottom:0;right:-2px}.yui3-resize-handle-inner-bl{background-position:-75px 0;bottom:-2px;right:-2px}.yui3-resize-handle-inner-tl{background-position:-47px 0;bottom:0;right:-2px}.yui3-resize-handle-inner-b,.yui3-resize-handle-inner-t{background-position:-15px 0}#yui3-css-stamp.skin-sam-resize-base{display:none} .yui3-scrollview{position:relative;overflow:hidden;-webkit-user-select:none;-moz-user-select:none}.yui3-scrollview-hidden{display:none}.yui3-scrollview-content{position:relative}.yui3-skin-sam .yui3-scrollview{-webkit-tap-highlight-color:rgba(255,255,255,0)}#yui3-css-stamp.skin-sam-scrollview-base{display:none} .yui3-skin-sam .yui3-scrollview{-webkit-tap-highlight-color:rgba(255,255,255,0)}.yui3-skin-sam .yui3-scrollview{background-color:white}.yui3-skin-sam .yui3-scrollview-vert .yui3-scrollview-content .yui3-scrollview-item{*zoom:1}.yui3-skin-sam .yui3-scrollview-vert .yui3-scrollview-content .yui3-scrollview-list{*zoom:1;list-style:none;padding:0;margin:0}.yui3-skin-sam .yui3-scrollview-vert .yui3-scrollview-content{border-top:0;background-color:white;font-family:HelveticaNeue,arial,helvetica,clean,sans-serif;color:black}.yui3-skin-sam .yui3-scrollview-vert .yui3-scrollview-content .yui3-scrollview-item{border-bottom:1px solid #303030;padding:15px 20px 16px;font-size:100%;font-weight:bold;background-color:white;cursor:pointer}#yui3-css-stamp.skin-sam-scrollview-list{display:none} .yui3-scrollview-scrollbar{opacity:1;position:absolute;width:6px;height:10px}.yui3-scrollview-scrollbar{top:0;right:1px}.yui3-scrollview-scrollbar-horiz{top:auto;height:8px;width:20px;bottom:1px;left:0}.yui3-scrollview-scrollbar .yui3-scrollview-child{position:absolute;right:0;display:block;width:100%;height:4px}.yui3-scrollview-scrollbar .yui3-scrollview-first{top:0}.yui3-scrollview-scrollbar .yui3-scrollview-last{top:0}.yui3-scrollview-scrollbar .yui3-scrollview-middle{position:absolute;top:4px;height:1px}.yui3-scrollview-scrollbar-horiz .yui3-scrollview-child{display:-moz-inline-stack;display:inline-block;zoom:1;*display:inline;top:0;left:0;bottom:auto;right:auto}.yui3-scrollview-scrollbar-horiz .yui3-scrollview-first,.yui3-scrollview-scrollbar-horiz .yui3-scrollview-last{width:4px;height:6px}.yui3-scrollview-scrollbar-horiz .yui3-scrollview-middle{top:0;left:4px;width:1px;height:6px}.yui3-scrollview-scrollbar-vert-basic{height:auto}.yui3-scrollview-scrollbar-vert-basic .yui3-scrollview-child{position:static;_overflow:hidden;_line-height:4px}.yui3-scrollview-scrollbar-horiz-basic{width:auto;white-space:nowrap;line-height:6px;_overflow:hidden}.yui3-scrollview-scrollbar-horiz-basic .yui3-scrollview-child{position:static;padding:0;margin:0;top:auto;left:auto;right:auto;bottom:auto}.yui3-skin-sam .yui3-scrollview-scrollbar{-webkit-transform:translate3d(0,0,0);-moz-transform:translate(0,0)}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first,.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle,.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last{border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==)}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-first,.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last{border-bottom-right-radius:0;border-bottom-left-radius:0;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;-moz-border-radius-bottomright:0;-moz-border-radius-bottomleft:0}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-last{border-radius:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px;-webkit-border-radius:0;-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:3px;-webkit-transform:translate3d(0,0,0);-moz-border-radius:0;-moz-border-radius-bottomright:3px;-moz-border-radius-bottomleft:3px;-moz-transform:translate(0,0)}.yui3-skin-sam .yui3-scrollview-scrollbar .yui3-scrollview-middle{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;-webkit-transform:translate3d(0,0,0) scaleY(1);-webkit-transform-origin-y:0;-moz-transform:translate(0,0) scaleY(1);-moz-transform-origin:0 0}.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-first,.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last{border-top-right-radius:0;border-bottom-left-radius:3px;-webkit-border-top-right-radius:0;-webkit-border-bottom-left-radius:3px;-moz-border-radius-topright:0;-moz-border-radius-bottomleft:3px}.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-last{border-bottom-left-radius:0;border-top-right-radius:3px;-webkit-border-bottom-left-radius:0;-webkit-border-top-right-radius:3px;-moz-border-radius-bottomleft:0;-moz-border-radius-topright:3px}.yui3-skin-sam .yui3-scrollview-scrollbar-horiz .yui3-scrollview-middle{-webkit-transform:translate3d(0,0,0) scaleX(1);-webkit-transform-origin:0 0;-moz-transform:translate(0,0) scaleX(1);-moz-transform-origin:0 0}.yui3-skin-sam .yui3-scrollview-scrollbar-vert-basic .yui3-scrollview-child,.yui3-skin-sam .yui3-scrollview-scrollbar-horiz-basic .yui3-scrollview-child{background-color:#aaa;background-image:none}#yui3-css-stamp.skin-sam-scrollview-scrollbars{display:none} .yui3-slider,.yui3-slider-rail{display:-moz-inline-stack;display:inline-block;*display:inline;zoom:1;vertical-align:middle}.yui3-slider-content{position:relative;display:block}.yui3-slider-rail{position:relative}.yui3-slider-rail-cap-top,.yui3-slider-rail-cap-left,.yui3-slider-rail-cap-bottom,.yui3-slider-rail-cap-right,.yui3-slider-thumb,.yui3-slider-thumb-image,.yui3-slider-thumb-shadow{position:absolute}.yui3-slider-thumb{overflow:hidden}.yui3-skin-sam .yui3-slider-x .yui3-slider-rail,.yui3-skin-sam .yui3-slider-x .yui3-slider-rail-cap-left,.yui3-skin-sam .yui3-slider-x .yui3-slider-rail-cap-right{background-image:url(rail-x.png);background-repeat:repeat-x}.yui3-skin-sam .yui3-slider-x .yui3-slider-rail{height:26px}.yui3-skin-sam .yui3-slider-x .yui3-slider-thumb{height:26px;width:15px}.yui3-skin-sam .yui3-slider-x .yui3-slider-rail-cap-left{background-position:0 -20px;height:20px;left:-2px;width:5px}.yui3-skin-sam .yui3-slider-x .yui3-slider-rail-cap-right{background-position:0 -40px;height:20px;right:-2px;width:5px}.yui3-skin-sam .yui3-slider-x .yui3-slider-thumb-image{left:0;top:-10px}.yui3-skin-sam .yui3-slider-x .yui3-slider-thumb-shadow{left:0;opacity:.15;filter:alpha(opacity=15);top:-50px}.yui3-skin-sam .yui3-slider-y .yui3-slider-rail,.yui3-skin-sam .yui3-slider-y .yui3-slider-rail-cap-top,.yui3-skin-sam .yui3-slider-y .yui3-slider-rail-cap-bottom{background-image:url(rail-y.png);background-repeat:repeat-y}.yui3-skin-sam .yui3-slider-y .yui3-slider-rail{width:26px}.yui3-skin-sam .yui3-slider-y .yui3-slider-thumb{width:26px;height:15px}.yui3-skin-sam .yui3-slider-y .yui3-slider-rail-cap-top{background-position:-20px 0;width:20px;top:-2px;height:5px}.yui3-skin-sam .yui3-slider-y .yui3-slider-rail-cap-bottom{background-position:-40px 0;width:20px;bottom:-2px;height:5px}.yui3-skin-sam .yui3-slider-y .yui3-slider-thumb-image{left:-10px;top:0}.yui3-skin-sam .yui3-slider-y .yui3-slider-thumb-shadow{left:-50px;opacity:.15;filter:alpha(opacity=15);top:0}#yui3-css-stamp.skin-sam-slider-base{display:none} .yui3-tab-panel{display:none}.yui3-tab-panel-selected{display:block}.yui3-tabview-list,.yui3-tab{margin:0;padding:0;list-style:none}.yui3-tabview{position:relative}.yui3-tabview,.yui3-tabview-list,.yui3-tabview-panel,.yui3-tab,.yui3-tab-panel{zoom:1}.yui3-tab{display:inline-block;*display:inline;vertical-align:bottom;cursor:pointer}.yui3-tab-label{display:block;display:inline-block;padding:6px 10px;position:relative;text-decoration:none;vertical-align:bottom}.yui3-skin-sam .yui3-tabview-list{border:solid #2647a0;border-width:0 0 5px;zoom:1}.yui3-skin-sam .yui3-tab{margin:0 .2em 0 0;padding:1px 0 0;zoom:1}.yui3-skin-sam .yui3-tab-selected{margin-bottom:-1px}.yui3-skin-sam .yui3-tab-label{background:#d8d8d8 url(sprite.png) repeat-x;border:solid #a3a3a3;border-width:1px 1px 0 1px;color:#000;cursor:pointer;font-size:85%;padding:.3em .75em;text-decoration:none}.yui3-skin-sam .yui3-tab-label:hover,.yui3-skin-sam .yui3-tab-label:focus{background:#bfdaff url(sprite.png) repeat-x left -1300px;outline:0}.yui3-skin-sam .yui3-tab-selected .yui3-tab-label,.yui3-skin-sam .yui3-tab-selected .yui3-tab-label:focus,.yui3-skin-sam .yui3-tab-selected .yui3-tab-label:hover{background:#2647a0 url(sprite.png) repeat-x left -1400px;color:#fff}.yui3-skin-sam .yui3-tab-selected .yui3-tab-label{padding:.4em .75em}.yui3-skin-sam .yui3-tab-selected .yui3-tab-label{border-color:#243356}.yui3-skin-sam .yui3-tabview-panel{background:#edf5ff}.yui3-skin-sam .yui3-tabview-panel{border:1px solid #808080;border-top-color:#243356;padding:.25em .5em}#yui3-css-stamp.skin-sam-tabview{display:none} .yui3-testconsole .yui3-console-entry{min-height:inherit;padding:5px}.yui3-testconsole .yui3-console-controls{display:none}.yui3-skin-sam .yui3-testconsole .yui3-console-content,.yui3-skin-sam .yui3-testconsole .yui3-console-bd,.yui3-skin-sam .yui3-testconsole .yui3-console-entry,.yui3-skin-sam .yui3-testconsole .yui3-console-ft,.yui3-skin-sam .yui3-testconsole .yui3-console-ft .yui3-console-filters-categories,.yui3-skin-sam .yui3-testconsole .yui3-console-ft .yui3-console-filters-sources,.yui3-skin-sam .yui3-testconsole .yui3-console-hd{background:0;border:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.yui3-skin-sam .yui3-testconsole-content,.yui3-skin-sam .yui3-testconsole .yui3-console-bd{color:#333;font:13px/1.4 Helvetica,'DejaVu Sans','Bitstream Vera Sans',Arial,sans-serif}.yui3-skin-sam .yui3-testconsole-content{border:1px solid #afafaf}.yui3-skin-sam .yui3-testconsole .yui3-console-entry{border-bottom:1px solid #eaeaea;font-family:Menlo,Inconsolata,Consolas,'DejaVu Mono','Bitstream Vera Sans Mono',monospace;font-size:11px}.yui3-skin-sam .yui3-testconsole .yui3-console-ft{border-top:1px solid}.yui3-skin-sam .yui3-testconsole .yui3-console-hd{border-bottom:1px solid;*zoom:1}.yui3-skin-sam .yui3-testconsole.yui3-console-collapsed .yui3-console-hd{border:0}.yui3-skin-sam .yui3-testconsole .yui3-console-ft,.yui3-skin-sam .yui3-testconsole .yui3-console-hd{border-color:#cfcfcf}.yui3-skin-sam .yui3-testconsole .yui3-testconsole-entry-fail{background-color:#ffe0e0;border-bottom-color:#ffc5c4}.yui3-skin-sam .yui3-testconsole .yui3-testconsole-entry-pass{background-color:#ecffea;border-bottom-color:#d1ffcc}#yui3-css-stamp.skin-sam-test-console{display:none}-.yui3-skin-sam .yui3-console-entry-pass .yui3-console-entry-cat{background-color:green;color:#fff;}.yui3-skin-sam .yui3-console-entry-fail .yui3-console-entry-cat{background-color:red;color:#fff;}.yui3-skin-sam .yui3-console-entry-ignore .yui3-console-entry-cat{background-color:#666;} .yui3-widget-hidden{display:none}.yui3-widget-content{overflow:hidden}.yui3-widget-content-expanded{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;height:100%}.yui3-widget-tmp-forcesize{overflow:hidden!important}#yui3-css-stamp.skin-sam-widget-base{display:none} .yui3-widget-buttons .yui3-button-close,.yui3-widget-buttons .yui3-button-close .yui3-button-content,.yui3-widget-buttons .yui3-button-close .yui3-button-icon{display:inline-block;*display:inline;zoom:1;width:13px;height:13px;line-height:13px;vertical-align:top}.yui3-widget-buttons .yui3-button-close .yui3-button-icon{background-repeat:no-repeat;background-position:1px 1px}.yui3-skin-sam .yui3-widget-buttons .yui3-button-icon{background-image:url(sprite_icons.gif)}#yui3-css-stamp.skin-sam-widget-buttons{display:none} .yui3-skin-sam .yui3-widget-mask{background-color:black;zoom:1;-ms-filter:"alpha(opacity=40)";filter:alpha(opacity=40);opacity:.4}#yui3-css-stamp.skin-sam-widget-modality{display:none}
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
binary file changed (190 → 3628 bytes)
binary file changed (209 → 2884 bytes)
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,7 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-skin-sam .yui3-console-entry-pass .yui3-console-entry-cat{background-color:green;color:#fff;}.yui3-skin-sam .yui3-console-entry-fail .yui3-console-entry-cat{background-color:red;color:#fff;}.yui3-skin-sam .yui3-console-entry-ignore .yui3-console-entry-cat{background-color:#666;}
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -0,0 +1,685 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/async-queue/async-queue.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/async-queue/async-queue.js",+ code: []+};+_yuitest_coverage["build/async-queue/async-queue.js"].code=["YUI.add('async-queue', function (Y, NAME) {","","/**"," * <p>AsyncQueue allows you create a chain of function callbacks executed"," * via setTimeout (or synchronously) that are guaranteed to run in order."," * Items in the queue can be promoted or removed. Start or resume the"," * execution chain with run(). pause() to temporarily delay execution, or"," * stop() to halt and clear the queue.</p>"," *"," * @module async-queue"," */","","/**"," * <p>A specialized queue class that supports scheduling callbacks to execute"," * sequentially, iteratively, even asynchronously.</p>"," *"," * <p>Callbacks can be function refs or objects with the following keys. Only"," * the <code>fn</code> key is required.</p>"," *"," * <ul>"," * <li><code>fn</code> -- The callback function</li>"," * <li><code>context</code> -- The execution context for the callbackFn.</li>"," * <li><code>args</code> -- Arguments to pass to callbackFn.</li>"," * <li><code>timeout</code> -- Millisecond delay before executing callbackFn."," * (Applies to each iterative execution of callback)</li>"," * <li><code>iterations</code> -- Number of times to repeat the callback."," * <li><code>until</code> -- Repeat the callback until this function returns"," * true. This setting trumps iterations.</li>"," * <li><code>autoContinue</code> -- Set to false to prevent the AsyncQueue from"," * executing the next callback in the Queue after"," * the callback completes.</li>"," * <li><code>id</code> -- Name that can be used to get, promote, get the"," * indexOf, or delete this callback.</li>"," * </ul>"," *"," * @class AsyncQueue"," * @extends EventTarget"," * @constructor"," * @param callback* {Function|Object} 0..n callbacks to seed the queue"," */","Y.AsyncQueue = function() {"," this._init();"," this.add.apply(this, arguments);","};","","var Queue = Y.AsyncQueue,"," EXECUTE = 'execute',"," SHIFT = 'shift',"," PROMOTE = 'promote',"," REMOVE = 'remove',",""," isObject = Y.Lang.isObject,"," isFunction = Y.Lang.isFunction;","","/**"," * <p>Static default values used to populate callback configuration properties."," * Preconfigured defaults include:</p>"," *"," * <ul>"," * <li><code>autoContinue</code>: <code>true</code></li>"," * <li><code>iterations</code>: 1</li>"," * <li><code>timeout</code>: 10 (10ms between callbacks)</li>"," * <li><code>until</code>: (function to run until iterations <= 0)</li>"," * </ul>"," *"," * @property defaults"," * @type {Object}"," * @static"," */","Queue.defaults = Y.mix({"," autoContinue : true,"," iterations : 1,"," timeout : 10,"," until : function () {"," this.iterations |= 0;"," return this.iterations <= 0;"," }","}, Y.config.queueDefaults || {});","","Y.extend(Queue, Y.EventTarget, {"," /**"," * Used to indicate the queue is currently executing a callback."," *"," * @property _running"," * @type {Boolean|Object} true for synchronous callback execution, the"," * return handle from Y.later for async callbacks."," * Otherwise false."," * @protected"," */"," _running : false,",""," /**"," * Initializes the AsyncQueue instance properties and events."," *"," * @method _init"," * @protected"," */"," _init : function () {"," Y.EventTarget.call(this, { prefix: 'queue', emitFacade: true });",""," this._q = [];",""," /** "," * Callback defaults for this instance. Static defaults that are not"," * overridden are also included."," *"," * @property defaults"," * @type {Object}"," */"," this.defaults = {};",""," this._initEvents();"," },",""," /**"," * Initializes the instance events."," *"," * @method _initEvents"," * @protected"," */"," _initEvents : function () {"," this.publish({"," 'execute' : { defaultFn : this._defExecFn, emitFacade: true },"," 'shift' : { defaultFn : this._defShiftFn, emitFacade: true },"," 'add' : { defaultFn : this._defAddFn, emitFacade: true },"," 'promote' : { defaultFn : this._defPromoteFn, emitFacade: true },"," 'remove' : { defaultFn : this._defRemoveFn, emitFacade: true }"," });"," },",""," /**"," * Returns the next callback needing execution. If a callback is"," * configured to repeat via iterations or until, it will be returned until"," * the completion criteria is met."," *"," * When the queue is empty, null is returned."," *"," * @method next"," * @return {Function} the callback to execute"," */"," next : function () {"," var callback;",""," while (this._q.length) {"," callback = this._q[0] = this._prepare(this._q[0]);"," if (callback && callback.until()) {"," this.fire(SHIFT, { callback: callback });"," callback = null;"," } else {"," break;"," }"," }",""," return callback || null;"," },",""," /**"," * Default functionality for the "shift" event. Shifts the"," * callback stored in the event object's <em>callback</em> property from"," * the queue if it is the first item."," *"," * @method _defShiftFn"," * @param e {Event} The event object"," * @protected"," */"," _defShiftFn : function (e) {"," if (this.indexOf(e.callback) === 0) {"," this._q.shift();"," }"," },",""," /**"," * Creates a wrapper function to execute the callback using the aggregated "," * configuration generated by combining the static AsyncQueue.defaults, the"," * instance defaults, and the specified callback settings."," *"," * The wrapper function is decorated with the callback configuration as"," * properties for runtime modification."," *"," * @method _prepare"," * @param callback {Object|Function} the raw callback"," * @return {Function} a decorated function wrapper to execute the callback"," * @protected"," */"," _prepare: function (callback) {"," if (isFunction(callback) && callback._prepared) {"," return callback;"," }",""," var config = Y.merge("," Queue.defaults,"," { context : this, args: [], _prepared: true },"," this.defaults,"," (isFunction(callback) ? { fn: callback } : callback)),"," "," wrapper = Y.bind(function () {"," if (!wrapper._running) {"," wrapper.iterations--;"," }"," if (isFunction(wrapper.fn)) {"," wrapper.fn.apply(wrapper.context || Y,"," Y.Array(wrapper.args));"," }"," }, this);"," "," return Y.mix(wrapper, config);"," },",""," /**"," * Sets the queue in motion. All queued callbacks will be executed in"," * order unless pause() or stop() is called or if one of the callbacks is"," * configured with autoContinue: false."," *"," * @method run"," * @return {AsyncQueue} the AsyncQueue instance"," * @chainable"," */"," run : function () {"," var callback,"," cont = true;",""," for (callback = this.next();"," cont && callback && !this.isRunning();"," callback = this.next())"," {"," cont = (callback.timeout < 0) ?"," this._execute(callback) :"," this._schedule(callback);"," }",""," if (!callback) {"," /**"," * Event fired after the last queued callback is executed."," * @event complete"," */"," this.fire('complete');"," }",""," return this;"," },",""," /**"," * Handles the execution of callbacks. Returns a boolean indicating"," * whether it is appropriate to continue running."," *"," * @method _execute"," * @param callback {Object} the callback object to execute"," * @return {Boolean} whether the run loop should continue"," * @protected"," */"," _execute : function (callback) {"," this._running = callback._running = true;",""," callback.iterations--;"," this.fire(EXECUTE, { callback: callback });",""," var cont = this._running && callback.autoContinue;",""," this._running = callback._running = false;",""," return cont;"," },",""," /**"," * Schedules the execution of asynchronous callbacks."," *"," * @method _schedule"," * @param callback {Object} the callback object to execute"," * @return {Boolean} whether the run loop should continue"," * @protected"," */"," _schedule : function (callback) {"," this._running = Y.later(callback.timeout, this, function () {"," if (this._execute(callback)) {"," this.run();"," }"," });",""," return false;"," },",""," /**"," * Determines if the queue is waiting for a callback to complete execution."," *"," * @method isRunning"," * @return {Boolean} true if queue is waiting for a "," * from any initiated transactions"," */"," isRunning : function () {"," return !!this._running;"," },",""," /**"," * Default functionality for the "execute" event. Executes the"," * callback function"," *"," * @method _defExecFn"," * @param e {Event} the event object"," * @protected"," */"," _defExecFn : function (e) {"," e.callback();"," },",""," /**"," * Add any number of callbacks to the end of the queue. Callbacks may be"," * provided as functions or objects."," *"," * @method add"," * @param callback* {Function|Object} 0..n callbacks"," * @return {AsyncQueue} the AsyncQueue instance"," * @chainable"," */"," add : function () {"," this.fire('add', { callbacks: Y.Array(arguments,0,true) });",""," return this;"," },",""," /**"," * Default functionality for the "add" event. Adds the callbacks"," * in the event facade to the queue. Callbacks successfully added to the"," * queue are present in the event's <code>added</code> property in the"," * after phase."," *"," * @method _defAddFn"," * @param e {Event} the event object"," * @protected"," */"," _defAddFn : function(e) {"," var _q = this._q,"," added = [];",""," Y.Array.each(e.callbacks, function (c) {"," if (isObject(c)) {"," _q.push(c);"," added.push(c);"," }"," });",""," e.added = added;"," },",""," /**"," * Pause the execution of the queue after the execution of the current"," * callback completes. If called from code outside of a queued callback,"," * clears the timeout for the pending callback. Paused queue can be"," * restarted with q.run()"," *"," * @method pause"," * @return {AsyncQueue} the AsyncQueue instance"," * @chainable"," */"," pause: function () {"," if (isObject(this._running)) {"," this._running.cancel();"," }",""," this._running = false;",""," return this;"," },",""," /**"," * Stop and clear the queue after the current execution of the"," * current callback completes."," *"," * @method stop"," * @return {AsyncQueue} the AsyncQueue instance"," * @chainable"," */"," stop : function () { "," this._q = [];",""," return this.pause();"," },",""," /** "," * Returns the current index of a callback. Pass in either the id or"," * callback function from getCallback."," *"," * @method indexOf"," * @param callback {String|Function} the callback or its specified id"," * @return {Number} index of the callback or -1 if not found"," */"," indexOf : function (callback) {"," var i = 0, len = this._q.length, c;",""," for (; i < len; ++i) {"," c = this._q[i];"," if (c === callback || c.id === callback) {"," return i;"," }"," }",""," return -1;"," },",""," /**"," * Retrieve a callback by its id. Useful to modify the configuration"," * while the queue is running."," *"," * @method getCallback"," * @param id {String} the id assigned to the callback"," * @return {Object} the callback object"," */"," getCallback : function (id) {"," var i = this.indexOf(id);",""," return (i > -1) ? this._q[i] : null;"," },",""," /**"," * Promotes the named callback to the top of the queue. If a callback is"," * currently executing or looping (via until or iterations), the promotion"," * is scheduled to occur after the current callback has completed."," *"," * @method promote"," * @param callback {String|Object} the callback object or a callback's id"," * @return {AsyncQueue} the AsyncQueue instance"," * @chainable"," */"," promote : function (callback) {"," var payload = { callback : callback },e;",""," if (this.isRunning()) {"," e = this.after(SHIFT, function () {"," this.fire(PROMOTE, payload);"," e.detach();"," }, this);"," } else {"," this.fire(PROMOTE, payload);"," }",""," return this;"," },",""," /**"," * <p>Default functionality for the "promote" event. Promotes the"," * named callback to the head of the queue.</p>"," *"," * <p>The event object will contain a property "callback", which"," * holds the id of a callback or the callback object itself.</p>"," *"," * @method _defPromoteFn"," * @param e {Event} the custom event"," * @protected"," */"," _defPromoteFn : function (e) {"," var i = this.indexOf(e.callback),"," promoted = (i > -1) ? this._q.splice(i,1)[0] : null;",""," e.promoted = promoted;",""," if (promoted) {"," this._q.unshift(promoted);"," }"," },",""," /**"," * Removes the callback from the queue. If the queue is active, the"," * removal is scheduled to occur after the current callback has completed."," *"," * @method remove"," * @param callback {String|Object} the callback object or a callback's id"," * @return {AsyncQueue} the AsyncQueue instance"," * @chainable"," */"," remove : function (callback) {"," var payload = { callback : callback },e;",""," // Can't return the removed callback because of the deferral until"," // current callback is complete"," if (this.isRunning()) {"," e = this.after(SHIFT, function () {"," this.fire(REMOVE, payload);"," e.detach();"," },this);"," } else {"," this.fire(REMOVE, payload);"," }",""," return this;"," },",""," /**"," * <p>Default functionality for the "remove" event. Removes the"," * callback from the queue.</p>"," *"," * <p>The event object will contain a property "callback", which"," * holds the id of a callback or the callback object itself.</p>"," *"," * @method _defRemoveFn"," * @param e {Event} the custom event"," * @protected"," */"," _defRemoveFn : function (e) {"," var i = this.indexOf(e.callback);",""," e.removed = (i > -1) ? this._q.splice(i,1)[0] : null;"," },",""," /**"," * Returns the number of callbacks in the queue."," *"," * @method size"," * @return {Number}"," */"," size : function () {"," // next() flushes callbacks that have met their until() criteria and"," // therefore shouldn't count since they wouldn't execute anyway."," if (!this.isRunning()) {"," this.next();"," }",""," return this._q.length;"," }","});","","","","}, '3.7.1', {\"requires\": [\"event-custom\"]});"];+_yuitest_coverage["build/async-queue/async-queue.js"].lines = {"1":0,"41":0,"42":0,"43":0,"46":0,"70":0,"75":0,"76":0,"80":0,"99":0,"101":0,"110":0,"112":0,"122":0,"142":0,"144":0,"145":0,"146":0,"147":0,"148":0,"150":0,"154":0,"167":0,"168":0,"186":0,"187":0,"190":0,"197":0,"198":0,"200":0,"201":0,"206":0,"219":0,"222":0,"226":0,"231":0,"236":0,"239":0,"252":0,"254":0,"255":0,"257":0,"259":0,"261":0,"273":0,"274":0,"275":0,"279":0,"290":0,"302":0,"315":0,"317":0,"331":0,"334":0,"335":0,"336":0,"337":0,"341":0,"355":0,"356":0,"359":0,"361":0,"373":0,"375":0,"387":0,"389":0,"390":0,"391":0,"392":0,"396":0,"408":0,"410":0,"424":0,"426":0,"427":0,"428":0,"429":0,"432":0,"435":0,"450":0,"453":0,"455":0,"456":0,"470":0,"474":0,"475":0,"476":0,"477":0,"480":0,"483":0,"498":0,"500":0,"512":0,"513":0,"516":0};+_yuitest_coverage["build/async-queue/async-queue.js"].functions = {"AsyncQueue:41":0,"until:74":0,"_init:98":0,"_initEvents:121":0,"next:141":0,"_defShiftFn:166":0,"(anonymous 2):196":0,"_prepare:185":0,"run:218":0,"_execute:251":0,"(anonymous 3):273":0,"_schedule:272":0,"isRunning:289":0,"_defExecFn:301":0,"add:314":0,"(anonymous 4):334":0,"_defAddFn:330":0,"pause:354":0,"stop:372":0,"indexOf:386":0,"getCallback:407":0,"(anonymous 5):427":0,"promote:423":0,"_defPromoteFn:449":0,"(anonymous 6):475":0,"remove:469":0,"_defRemoveFn:497":0,"size:509":0,"(anonymous 1):1":0};+_yuitest_coverage["build/async-queue/async-queue.js"].coveredLines = 95;+_yuitest_coverage["build/async-queue/async-queue.js"].coveredFunctions = 29;+_yuitest_coverline("build/async-queue/async-queue.js", 1);+YUI.add('async-queue', function (Y, NAME) {++/**+ * <p>AsyncQueue allows you create a chain of function callbacks executed+ * via setTimeout (or synchronously) that are guaranteed to run in order.+ * Items in the queue can be promoted or removed. Start or resume the+ * execution chain with run(). pause() to temporarily delay execution, or+ * stop() to halt and clear the queue.</p>+ *+ * @module async-queue+ */++/**+ * <p>A specialized queue class that supports scheduling callbacks to execute+ * sequentially, iteratively, even asynchronously.</p>+ *+ * <p>Callbacks can be function refs or objects with the following keys. Only+ * the <code>fn</code> key is required.</p>+ *+ * <ul>+ * <li><code>fn</code> -- The callback function</li>+ * <li><code>context</code> -- The execution context for the callbackFn.</li>+ * <li><code>args</code> -- Arguments to pass to callbackFn.</li>+ * <li><code>timeout</code> -- Millisecond delay before executing callbackFn.+ * (Applies to each iterative execution of callback)</li>+ * <li><code>iterations</code> -- Number of times to repeat the callback.+ * <li><code>until</code> -- Repeat the callback until this function returns+ * true. This setting trumps iterations.</li>+ * <li><code>autoContinue</code> -- Set to false to prevent the AsyncQueue from+ * executing the next callback in the Queue after+ * the callback completes.</li>+ * <li><code>id</code> -- Name that can be used to get, promote, get the+ * indexOf, or delete this callback.</li>+ * </ul>+ *+ * @class AsyncQueue+ * @extends EventTarget+ * @constructor+ * @param callback* {Function|Object} 0..n callbacks to seed the queue+ */+_yuitest_coverfunc("build/async-queue/async-queue.js", "(anonymous 1)", 1);+_yuitest_coverline("build/async-queue/async-queue.js", 41);+Y.AsyncQueue = function() {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "AsyncQueue", 41);+_yuitest_coverline("build/async-queue/async-queue.js", 42);+this._init();+ _yuitest_coverline("build/async-queue/async-queue.js", 43);+this.add.apply(this, arguments);+};++_yuitest_coverline("build/async-queue/async-queue.js", 46);+var Queue = Y.AsyncQueue,+ EXECUTE = 'execute',+ SHIFT = 'shift',+ PROMOTE = 'promote',+ REMOVE = 'remove',++ isObject = Y.Lang.isObject,+ isFunction = Y.Lang.isFunction;++/**+ * <p>Static default values used to populate callback configuration properties.+ * Preconfigured defaults include:</p>+ *+ * <ul>+ * <li><code>autoContinue</code>: <code>true</code></li>+ * <li><code>iterations</code>: 1</li>+ * <li><code>timeout</code>: 10 (10ms between callbacks)</li>+ * <li><code>until</code>: (function to run until iterations <= 0)</li>+ * </ul>+ *+ * @property defaults+ * @type {Object}+ * @static+ */+_yuitest_coverline("build/async-queue/async-queue.js", 70);+Queue.defaults = Y.mix({+ autoContinue : true,+ iterations : 1,+ timeout : 10,+ until : function () {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "until", 74);+_yuitest_coverline("build/async-queue/async-queue.js", 75);+this.iterations |= 0;+ _yuitest_coverline("build/async-queue/async-queue.js", 76);+return this.iterations <= 0;+ }+}, Y.config.queueDefaults || {});++_yuitest_coverline("build/async-queue/async-queue.js", 80);+Y.extend(Queue, Y.EventTarget, {+ /**+ * Used to indicate the queue is currently executing a callback.+ *+ * @property _running+ * @type {Boolean|Object} true for synchronous callback execution, the+ * return handle from Y.later for async callbacks.+ * Otherwise false.+ * @protected+ */+ _running : false,++ /**+ * Initializes the AsyncQueue instance properties and events.+ *+ * @method _init+ * @protected+ */+ _init : function () {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "_init", 98);+_yuitest_coverline("build/async-queue/async-queue.js", 99);+Y.EventTarget.call(this, { prefix: 'queue', emitFacade: true });++ _yuitest_coverline("build/async-queue/async-queue.js", 101);+this._q = [];++ /** + * Callback defaults for this instance. Static defaults that are not+ * overridden are also included.+ *+ * @property defaults+ * @type {Object}+ */+ _yuitest_coverline("build/async-queue/async-queue.js", 110);+this.defaults = {};++ _yuitest_coverline("build/async-queue/async-queue.js", 112);+this._initEvents();+ },++ /**+ * Initializes the instance events.+ *+ * @method _initEvents+ * @protected+ */+ _initEvents : function () {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "_initEvents", 121);+_yuitest_coverline("build/async-queue/async-queue.js", 122);+this.publish({+ 'execute' : { defaultFn : this._defExecFn, emitFacade: true },+ 'shift' : { defaultFn : this._defShiftFn, emitFacade: true },+ 'add' : { defaultFn : this._defAddFn, emitFacade: true },+ 'promote' : { defaultFn : this._defPromoteFn, emitFacade: true },+ 'remove' : { defaultFn : this._defRemoveFn, emitFacade: true }+ });+ },++ /**+ * Returns the next callback needing execution. If a callback is+ * configured to repeat via iterations or until, it will be returned until+ * the completion criteria is met.+ *+ * When the queue is empty, null is returned.+ *+ * @method next+ * @return {Function} the callback to execute+ */+ next : function () {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "next", 141);+_yuitest_coverline("build/async-queue/async-queue.js", 142);+var callback;++ _yuitest_coverline("build/async-queue/async-queue.js", 144);+while (this._q.length) {+ _yuitest_coverline("build/async-queue/async-queue.js", 145);+callback = this._q[0] = this._prepare(this._q[0]);+ _yuitest_coverline("build/async-queue/async-queue.js", 146);+if (callback && callback.until()) {+ _yuitest_coverline("build/async-queue/async-queue.js", 147);+this.fire(SHIFT, { callback: callback });+ _yuitest_coverline("build/async-queue/async-queue.js", 148);+callback = null;+ } else {+ _yuitest_coverline("build/async-queue/async-queue.js", 150);+break;+ }+ }++ _yuitest_coverline("build/async-queue/async-queue.js", 154);+return callback || null;+ },++ /**+ * Default functionality for the "shift" event. Shifts the+ * callback stored in the event object's <em>callback</em> property from+ * the queue if it is the first item.+ *+ * @method _defShiftFn+ * @param e {Event} The event object+ * @protected+ */+ _defShiftFn : function (e) {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "_defShiftFn", 166);+_yuitest_coverline("build/async-queue/async-queue.js", 167);+if (this.indexOf(e.callback) === 0) {+ _yuitest_coverline("build/async-queue/async-queue.js", 168);+this._q.shift();+ }+ },++ /**+ * Creates a wrapper function to execute the callback using the aggregated + * configuration generated by combining the static AsyncQueue.defaults, the+ * instance defaults, and the specified callback settings.+ *+ * The wrapper function is decorated with the callback configuration as+ * properties for runtime modification.+ *+ * @method _prepare+ * @param callback {Object|Function} the raw callback+ * @return {Function} a decorated function wrapper to execute the callback+ * @protected+ */+ _prepare: function (callback) {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "_prepare", 185);+_yuitest_coverline("build/async-queue/async-queue.js", 186);+if (isFunction(callback) && callback._prepared) {+ _yuitest_coverline("build/async-queue/async-queue.js", 187);+return callback;+ }++ _yuitest_coverline("build/async-queue/async-queue.js", 190);+var config = Y.merge(+ Queue.defaults,+ { context : this, args: [], _prepared: true },+ this.defaults,+ (isFunction(callback) ? { fn: callback } : callback)),+ + wrapper = Y.bind(function () {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "(anonymous 2)", 196);+_yuitest_coverline("build/async-queue/async-queue.js", 197);+if (!wrapper._running) {+ _yuitest_coverline("build/async-queue/async-queue.js", 198);+wrapper.iterations--;+ }+ _yuitest_coverline("build/async-queue/async-queue.js", 200);+if (isFunction(wrapper.fn)) {+ _yuitest_coverline("build/async-queue/async-queue.js", 201);+wrapper.fn.apply(wrapper.context || Y,+ Y.Array(wrapper.args));+ }+ }, this);+ + _yuitest_coverline("build/async-queue/async-queue.js", 206);+return Y.mix(wrapper, config);+ },++ /**+ * Sets the queue in motion. All queued callbacks will be executed in+ * order unless pause() or stop() is called or if one of the callbacks is+ * configured with autoContinue: false.+ *+ * @method run+ * @return {AsyncQueue} the AsyncQueue instance+ * @chainable+ */+ run : function () {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "run", 218);+_yuitest_coverline("build/async-queue/async-queue.js", 219);+var callback,+ cont = true;++ _yuitest_coverline("build/async-queue/async-queue.js", 222);+for (callback = this.next();+ cont && callback && !this.isRunning();+ callback = this.next())+ {+ _yuitest_coverline("build/async-queue/async-queue.js", 226);+cont = (callback.timeout < 0) ?+ this._execute(callback) :+ this._schedule(callback);+ }++ _yuitest_coverline("build/async-queue/async-queue.js", 231);+if (!callback) {+ /**+ * Event fired after the last queued callback is executed.+ * @event complete+ */+ _yuitest_coverline("build/async-queue/async-queue.js", 236);+this.fire('complete');+ }++ _yuitest_coverline("build/async-queue/async-queue.js", 239);+return this;+ },++ /**+ * Handles the execution of callbacks. Returns a boolean indicating+ * whether it is appropriate to continue running.+ *+ * @method _execute+ * @param callback {Object} the callback object to execute+ * @return {Boolean} whether the run loop should continue+ * @protected+ */+ _execute : function (callback) {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "_execute", 251);+_yuitest_coverline("build/async-queue/async-queue.js", 252);+this._running = callback._running = true;++ _yuitest_coverline("build/async-queue/async-queue.js", 254);+callback.iterations--;+ _yuitest_coverline("build/async-queue/async-queue.js", 255);+this.fire(EXECUTE, { callback: callback });++ _yuitest_coverline("build/async-queue/async-queue.js", 257);+var cont = this._running && callback.autoContinue;++ _yuitest_coverline("build/async-queue/async-queue.js", 259);+this._running = callback._running = false;++ _yuitest_coverline("build/async-queue/async-queue.js", 261);+return cont;+ },++ /**+ * Schedules the execution of asynchronous callbacks.+ *+ * @method _schedule+ * @param callback {Object} the callback object to execute+ * @return {Boolean} whether the run loop should continue+ * @protected+ */+ _schedule : function (callback) {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "_schedule", 272);+_yuitest_coverline("build/async-queue/async-queue.js", 273);+this._running = Y.later(callback.timeout, this, function () {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "(anonymous 3)", 273);+_yuitest_coverline("build/async-queue/async-queue.js", 274);+if (this._execute(callback)) {+ _yuitest_coverline("build/async-queue/async-queue.js", 275);+this.run();+ }+ });++ _yuitest_coverline("build/async-queue/async-queue.js", 279);+return false;+ },++ /**+ * Determines if the queue is waiting for a callback to complete execution.+ *+ * @method isRunning+ * @return {Boolean} true if queue is waiting for a + * from any initiated transactions+ */+ isRunning : function () {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "isRunning", 289);+_yuitest_coverline("build/async-queue/async-queue.js", 290);+return !!this._running;+ },++ /**+ * Default functionality for the "execute" event. Executes the+ * callback function+ *+ * @method _defExecFn+ * @param e {Event} the event object+ * @protected+ */+ _defExecFn : function (e) {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "_defExecFn", 301);+_yuitest_coverline("build/async-queue/async-queue.js", 302);+e.callback();+ },++ /**+ * Add any number of callbacks to the end of the queue. Callbacks may be+ * provided as functions or objects.+ *+ * @method add+ * @param callback* {Function|Object} 0..n callbacks+ * @return {AsyncQueue} the AsyncQueue instance+ * @chainable+ */+ add : function () {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "add", 314);+_yuitest_coverline("build/async-queue/async-queue.js", 315);+this.fire('add', { callbacks: Y.Array(arguments,0,true) });++ _yuitest_coverline("build/async-queue/async-queue.js", 317);+return this;+ },++ /**+ * Default functionality for the "add" event. Adds the callbacks+ * in the event facade to the queue. Callbacks successfully added to the+ * queue are present in the event's <code>added</code> property in the+ * after phase.+ *+ * @method _defAddFn+ * @param e {Event} the event object+ * @protected+ */+ _defAddFn : function(e) {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "_defAddFn", 330);+_yuitest_coverline("build/async-queue/async-queue.js", 331);+var _q = this._q,+ added = [];++ _yuitest_coverline("build/async-queue/async-queue.js", 334);+Y.Array.each(e.callbacks, function (c) {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "(anonymous 4)", 334);+_yuitest_coverline("build/async-queue/async-queue.js", 335);+if (isObject(c)) {+ _yuitest_coverline("build/async-queue/async-queue.js", 336);+_q.push(c);+ _yuitest_coverline("build/async-queue/async-queue.js", 337);+added.push(c);+ }+ });++ _yuitest_coverline("build/async-queue/async-queue.js", 341);+e.added = added;+ },++ /**+ * Pause the execution of the queue after the execution of the current+ * callback completes. If called from code outside of a queued callback,+ * clears the timeout for the pending callback. Paused queue can be+ * restarted with q.run()+ *+ * @method pause+ * @return {AsyncQueue} the AsyncQueue instance+ * @chainable+ */+ pause: function () {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "pause", 354);+_yuitest_coverline("build/async-queue/async-queue.js", 355);+if (isObject(this._running)) {+ _yuitest_coverline("build/async-queue/async-queue.js", 356);+this._running.cancel();+ }++ _yuitest_coverline("build/async-queue/async-queue.js", 359);+this._running = false;++ _yuitest_coverline("build/async-queue/async-queue.js", 361);+return this;+ },++ /**+ * Stop and clear the queue after the current execution of the+ * current callback completes.+ *+ * @method stop+ * @return {AsyncQueue} the AsyncQueue instance+ * @chainable+ */+ stop : function () { + _yuitest_coverfunc("build/async-queue/async-queue.js", "stop", 372);+_yuitest_coverline("build/async-queue/async-queue.js", 373);+this._q = [];++ _yuitest_coverline("build/async-queue/async-queue.js", 375);+return this.pause();+ },++ /** + * Returns the current index of a callback. Pass in either the id or+ * callback function from getCallback.+ *+ * @method indexOf+ * @param callback {String|Function} the callback or its specified id+ * @return {Number} index of the callback or -1 if not found+ */+ indexOf : function (callback) {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "indexOf", 386);+_yuitest_coverline("build/async-queue/async-queue.js", 387);+var i = 0, len = this._q.length, c;++ _yuitest_coverline("build/async-queue/async-queue.js", 389);+for (; i < len; ++i) {+ _yuitest_coverline("build/async-queue/async-queue.js", 390);+c = this._q[i];+ _yuitest_coverline("build/async-queue/async-queue.js", 391);+if (c === callback || c.id === callback) {+ _yuitest_coverline("build/async-queue/async-queue.js", 392);+return i;+ }+ }++ _yuitest_coverline("build/async-queue/async-queue.js", 396);+return -1;+ },++ /**+ * Retrieve a callback by its id. Useful to modify the configuration+ * while the queue is running.+ *+ * @method getCallback+ * @param id {String} the id assigned to the callback+ * @return {Object} the callback object+ */+ getCallback : function (id) {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "getCallback", 407);+_yuitest_coverline("build/async-queue/async-queue.js", 408);+var i = this.indexOf(id);++ _yuitest_coverline("build/async-queue/async-queue.js", 410);+return (i > -1) ? this._q[i] : null;+ },++ /**+ * Promotes the named callback to the top of the queue. If a callback is+ * currently executing or looping (via until or iterations), the promotion+ * is scheduled to occur after the current callback has completed.+ *+ * @method promote+ * @param callback {String|Object} the callback object or a callback's id+ * @return {AsyncQueue} the AsyncQueue instance+ * @chainable+ */+ promote : function (callback) {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "promote", 423);+_yuitest_coverline("build/async-queue/async-queue.js", 424);+var payload = { callback : callback },e;++ _yuitest_coverline("build/async-queue/async-queue.js", 426);+if (this.isRunning()) {+ _yuitest_coverline("build/async-queue/async-queue.js", 427);+e = this.after(SHIFT, function () {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "(anonymous 5)", 427);+_yuitest_coverline("build/async-queue/async-queue.js", 428);+this.fire(PROMOTE, payload);+ _yuitest_coverline("build/async-queue/async-queue.js", 429);+e.detach();+ }, this);+ } else {+ _yuitest_coverline("build/async-queue/async-queue.js", 432);+this.fire(PROMOTE, payload);+ }++ _yuitest_coverline("build/async-queue/async-queue.js", 435);+return this;+ },++ /**+ * <p>Default functionality for the "promote" event. Promotes the+ * named callback to the head of the queue.</p>+ *+ * <p>The event object will contain a property "callback", which+ * holds the id of a callback or the callback object itself.</p>+ *+ * @method _defPromoteFn+ * @param e {Event} the custom event+ * @protected+ */+ _defPromoteFn : function (e) {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "_defPromoteFn", 449);+_yuitest_coverline("build/async-queue/async-queue.js", 450);+var i = this.indexOf(e.callback),+ promoted = (i > -1) ? this._q.splice(i,1)[0] : null;++ _yuitest_coverline("build/async-queue/async-queue.js", 453);+e.promoted = promoted;++ _yuitest_coverline("build/async-queue/async-queue.js", 455);+if (promoted) {+ _yuitest_coverline("build/async-queue/async-queue.js", 456);+this._q.unshift(promoted);+ }+ },++ /**+ * Removes the callback from the queue. If the queue is active, the+ * removal is scheduled to occur after the current callback has completed.+ *+ * @method remove+ * @param callback {String|Object} the callback object or a callback's id+ * @return {AsyncQueue} the AsyncQueue instance+ * @chainable+ */+ remove : function (callback) {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "remove", 469);+_yuitest_coverline("build/async-queue/async-queue.js", 470);+var payload = { callback : callback },e;++ // Can't return the removed callback because of the deferral until+ // current callback is complete+ _yuitest_coverline("build/async-queue/async-queue.js", 474);+if (this.isRunning()) {+ _yuitest_coverline("build/async-queue/async-queue.js", 475);+e = this.after(SHIFT, function () {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "(anonymous 6)", 475);+_yuitest_coverline("build/async-queue/async-queue.js", 476);+this.fire(REMOVE, payload);+ _yuitest_coverline("build/async-queue/async-queue.js", 477);+e.detach();+ },this);+ } else {+ _yuitest_coverline("build/async-queue/async-queue.js", 480);+this.fire(REMOVE, payload);+ }++ _yuitest_coverline("build/async-queue/async-queue.js", 483);+return this;+ },++ /**+ * <p>Default functionality for the "remove" event. Removes the+ * callback from the queue.</p>+ *+ * <p>The event object will contain a property "callback", which+ * holds the id of a callback or the callback object itself.</p>+ *+ * @method _defRemoveFn+ * @param e {Event} the custom event+ * @protected+ */+ _defRemoveFn : function (e) {+ _yuitest_coverfunc("build/async-queue/async-queue.js", "_defRemoveFn", 497);+_yuitest_coverline("build/async-queue/async-queue.js", 498);+var i = this.indexOf(e.callback);++ _yuitest_coverline("build/async-queue/async-queue.js", 500);+e.removed = (i > -1) ? this._q.splice(i,1)[0] : null;+ },++ /**+ * Returns the number of callbacks in the queue.+ *+ * @method size+ * @return {Number}+ */+ size : function () {+ // next() flushes callbacks that have met their until() criteria and+ // therefore shouldn't count since they wouldn't execute anyway.+ _yuitest_coverfunc("build/async-queue/async-queue.js", "size", 509);+_yuitest_coverline("build/async-queue/async-queue.js", 512);+if (!this.isRunning()) {+ _yuitest_coverline("build/async-queue/async-queue.js", 513);+this.next();+ }++ _yuitest_coverline("build/async-queue/async-queue.js", 516);+return this._q.length;+ }+});++++}, '3.7.1', {"requires": ["event-custom"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('async-queue', function(Y) {+YUI.add('async-queue', function (Y, NAME) { /** * <p>AsyncQueue allows you create a chain of function callbacks executed@@ -525,4 +525,4 @@ -}, '3.5.1' ,{requires:['event-custom']});+}, '3.7.1', {"requires": ["event-custom"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("async-queue",function(g){g.AsyncQueue=function(){this._init();this.add.apply(this,arguments);};var e=g.AsyncQueue,c="execute",b="shift",d="promote",h="remove",a=g.Lang.isObject,f=g.Lang.isFunction;e.defaults=g.mix({autoContinue:true,iterations:1,timeout:10,until:function(){this.iterations|=0;return this.iterations<=0;}},g.config.queueDefaults||{});g.extend(e,g.EventTarget,{_running:false,_init:function(){g.EventTarget.call(this,{prefix:"queue",emitFacade:true});this._q=[];this.defaults={};this._initEvents();},_initEvents:function(){this.publish({"execute":{defaultFn:this._defExecFn,emitFacade:true},"shift":{defaultFn:this._defShiftFn,emitFacade:true},"add":{defaultFn:this._defAddFn,emitFacade:true},"promote":{defaultFn:this._defPromoteFn,emitFacade:true},"remove":{defaultFn:this._defRemoveFn,emitFacade:true}});},next:function(){var i;while(this._q.length){i=this._q[0]=this._prepare(this._q[0]);if(i&&i.until()){this.fire(b,{callback:i});i=null;}else{break;}}return i||null;},_defShiftFn:function(i){if(this.indexOf(i.callback)===0){this._q.shift();}},_prepare:function(k){if(f(k)&&k._prepared){return k;}var i=g.merge(e.defaults,{context:this,args:[],_prepared:true},this.defaults,(f(k)?{fn:k}:k)),j=g.bind(function(){if(!j._running){j.iterations--;}if(f(j.fn)){j.fn.apply(j.context||g,g.Array(j.args));}},this);return g.mix(j,i);},run:function(){var j,i=true;for(j=this.next();i&&j&&!this.isRunning();j=this.next()){i=(j.timeout<0)?this._execute(j):this._schedule(j);}if(!j){this.fire("complete");}return this;},_execute:function(j){this._running=j._running=true;j.iterations--;this.fire(c,{callback:j});var i=this._running&&j.autoContinue;this._running=j._running=false;return i;},_schedule:function(i){this._running=g.later(i.timeout,this,function(){if(this._execute(i)){this.run();}});return false;},isRunning:function(){return !!this._running;},_defExecFn:function(i){i.callback();},add:function(){this.fire("add",{callbacks:g.Array(arguments,0,true)});return this;},_defAddFn:function(j){var k=this._q,i=[];g.Array.each(j.callbacks,function(l){if(a(l)){k.push(l);i.push(l);}});j.added=i;},pause:function(){if(a(this._running)){this._running.cancel();}this._running=false;return this;},stop:function(){this._q=[];return this.pause();},indexOf:function(m){var k=0,j=this._q.length,l;for(;k<j;++k){l=this._q[k];if(l===m||l.id===m){return k;}}return -1;},getCallback:function(k){var j=this.indexOf(k);return(j>-1)?this._q[j]:null;},promote:function(k){var j={callback:k},i;if(this.isRunning()){i=this.after(b,function(){this.fire(d,j);i.detach();},this);}else{this.fire(d,j);}return this;},_defPromoteFn:function(l){var j=this.indexOf(l.callback),k=(j>-1)?this._q.splice(j,1)[0]:null;l.promoted=k;if(k){this._q.unshift(k);}},remove:function(k){var j={callback:k},i;if(this.isRunning()){i=this.after(b,function(){this.fire(h,j);i.detach();},this);}else{this.fire(h,j);}return this;},_defRemoveFn:function(k){var j=this.indexOf(k.callback);k.removed=(j>-1)?this._q.splice(j,1)[0]:null;},size:function(){if(!this.isRunning()){this.next();}return this._q.length;}});},"3.5.1",{requires:["event-custom"]});+YUI.add("async-queue",function(e,t){e.AsyncQueue=function(){this._init(),this.add.apply(this,arguments)};var n=e.AsyncQueue,r="execute",i="shift",s="promote",o="remove",u=e.Lang.isObject,a=e.Lang.isFunction;n.defaults=e.mix({autoContinue:!0,iterations:1,timeout:10,until:function(){return this.iterations|=0,this.iterations<=0}},e.config.queueDefaults||{}),e.extend(n,e.EventTarget,{_running:!1,_init:function(){e.EventTarget.call(this,{prefix:"queue",emitFacade:!0}),this._q=[],this.defaults={},this._initEvents()},_initEvents:function(){this.publish({execute:{defaultFn:this._defExecFn,emitFacade:!0},shift:{defaultFn:this._defShiftFn,emitFacade:!0},add:{defaultFn:this._defAddFn,emitFacade:!0},promote:{defaultFn:this._defPromoteFn,emitFacade:!0},remove:{defaultFn:this._defRemoveFn,emitFacade:!0}})},next:function(){var e;while(this._q.length){e=this._q[0]=this._prepare(this._q[0]);if(!e||!e.until())break;this.fire(i,{callback:e}),e=null}return e||null},_defShiftFn:function(e){this.indexOf(e.callback)===0&&this._q.shift()},_prepare:function(t){if(a(t)&&t._prepared)return t;var r=e.merge(n.defaults,{context:this,args:[],_prepared:!0},this.defaults,a(t)?{fn:t}:t),i=e.bind(function(){i._running||i.iterations--,a(i.fn)&&i.fn.apply(i.context||e,e.Array(i.args))},this);return e.mix(i,r)},run:function(){var e,t=!0;for(e=this.next();t&&e&&!this.isRunning();e=this.next())t=e.timeout<0?this._execute(e):this._schedule(e);return e||this.fire("complete"),this},_execute:function(e){this._running=e._running=!0,e.iterations--,this.fire(r,{callback:e});var t=this._running&&e.autoContinue;return this._running=e._running=!1,t},_schedule:function(t){return this._running=e.later(t.timeout,this,function(){this._execute(t)&&this.run()}),!1},isRunning:function(){return!!this._running},_defExecFn:function(e){e.callback()},add:function(){return this.fire("add",{callbacks:e.Array(arguments,0,!0)}),this},_defAddFn:function(t){var n=this._q,r=[];e.Array.each(t.callbacks,function(e){u(e)&&(n.push(e),r.push(e))}),t.added=r},pause:function(){return u(this._running)&&this._running.cancel(),this._running=!1,this},stop:function(){return this._q=[],this.pause()},indexOf:function(e){var t=0,n=this._q.length,r;for(;t<n;++t){r=this._q[t];if(r===e||r.id===e)return t}return-1},getCallback:function(e){var t=this.indexOf(e);return t>-1?this._q[t]:null},promote:function(e){var t={callback:e},n;return this.isRunning()?n=this.after(i,function(){this.fire(s,t),n.detach()},this):this.fire(s,t),this},_defPromoteFn:function(e){var t=this.indexOf(e.callback),n=t>-1?this._q.splice(t,1)[0]:null;e.promoted=n,n&&this._q.unshift(n)},remove:function(e){var t={callback:e},n;return this.isRunning()?n=this.after(i,function(){this.fire(o,t),n.detach()},this):this.fire(o,t),this},_defRemoveFn:function(e){var t=this.indexOf(e.callback);e.removed=t>-1?this._q.splice(t,1)[0]:null},size:function(){return this.isRunning()||this.next(),this._q.length}})},"3.7.1",{requires:["event-custom"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('async-queue', function(Y) {+YUI.add('async-queue', function (Y, NAME) { /** * <p>AsyncQueue allows you create a chain of function callbacks executed@@ -525,4 +525,4 @@ -}, '3.5.1' ,{requires:['event-custom']});+}, '3.7.1', {"requires": ["event-custom"]});
@@ -0,0 +1,158 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/attribute-base/attribute-base.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/attribute-base/attribute-base.js",+ code: []+};+_yuitest_coverage["build/attribute-base/attribute-base.js"].code=["YUI.add('attribute-base', function (Y, NAME) {",""," /**"," * The attribute module provides an augmentable Attribute implementation, which "," * adds configurable attributes and attribute change events to the class being "," * augmented. It also provides a State class, which is used internally by Attribute,"," * but can also be used independently to provide a name/property/value data structure to"," * store state."," *"," * @module attribute"," */",""," /**"," * The attribute-base submodule provides core attribute handling support, with everything"," * aside from complex attribute handling in the provider's constructor."," *"," * @module attribute"," * @submodule attribute-base"," */"," "," /**"," * <p>"," * Attribute provides configurable attribute support along with attribute change events. It is designed to be "," * augmented on to a host class, and provides the host with the ability to configure attributes to store and retrieve state, "," * along with attribute change events."," * </p>"," * <p>For example, attributes added to the host can be configured:</p>"," * <ul>"," * <li>As read only.</li>"," * <li>As write once.</li>"," * <li>With a setter function, which can be used to manipulate"," * values passed to Attribute's <a href=\"#method_set\">set</a> method, before they are stored.</li>"," * <li>With a getter function, which can be used to manipulate stored values,"," * before they are returned by Attribute's <a href=\"#method_get\">get</a> method.</li>"," * <li>With a validator function, to validate values before they are stored.</li>"," * </ul>"," *"," * <p>See the <a href=\"#method_addAttr\">addAttr</a> method, for the complete set of configuration"," * options available for attributes.</p>"," *"," * <p><strong>NOTE:</strong> Most implementations will be better off extending the <a href=\"Base.html\">Base</a> class, "," * instead of augmenting Attribute directly. Base augments Attribute and will handle the initial configuration "," * of attributes for derived classes, accounting for values passed into the constructor.</p>"," *"," * @class Attribute"," * @param attrs {Object} The attributes to add during construction (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor."," * @param values {Object} The initial attribute values to apply (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These are not merged/cloned. The caller is responsible for isolating user provided values if required."," * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href=\"#method_addAttrs\">addAttrs</a>)."," * @uses AttributeCore"," * @uses AttributeEvents"," * @uses EventTarget"," * @uses AttributeExtras"," */"," var Attribute = function() {",""," // Fix #2531929 "," // Complete hack, to make sure the first clone of a node value in IE doesn't doesn't hurt state - maintains 3.4.1 behavior."," // Too late in the release cycle to do anything about the core problem."," // The root issue is that cloning a Y.Node instance results in an object which barfs in IE, when you access it's properties (since 3.3.0)."," this._ATTR_E_FACADE = null;"," this._yuievt = null;",""," Y.AttributeCore.apply(this, arguments);"," Y.AttributeEvents.apply(this, arguments);"," Y.AttributeExtras.apply(this, arguments);"," };",""," Y.mix(Attribute, Y.AttributeCore, false, null, 1);"," Y.mix(Attribute, Y.AttributeExtras, false, null, 1);",""," // Needs to be \"true\", to overwrite methods from AttributeCore"," Y.mix(Attribute, Y.AttributeEvents, true, null, 1);",""," /**"," * <p>The value to return from an attribute setter in order to prevent the set from going through.</p>"," *"," * <p>You can return this value from your setter if you wish to combine validator and setter "," * functionality into a single setter function, which either returns the massaged value to be stored or "," * AttributeCore.INVALID_VALUE to prevent invalid values from being stored.</p>"," *"," * @property INVALID_VALUE"," * @type Object"," * @static"," * @final"," */"," Attribute.INVALID_VALUE = Y.AttributeCore.INVALID_VALUE;",""," /**"," * The list of properties which can be configured for "," * each attribute (e.g. setter, getter, writeOnce etc.)."," *"," * This property is used internally as a whitelist for faster"," * Y.mix operations."," *"," * @property _ATTR_CFG"," * @type Array"," * @static"," * @protected"," */"," Attribute._ATTR_CFG = Y.AttributeCore._ATTR_CFG.concat(Y.AttributeEvents._ATTR_CFG);",""," Y.Attribute = Attribute;","","}, '3.7.1', {\"requires\": [\"attribute-core\", \"attribute-events\", \"attribute-extras\"]});"];+_yuitest_coverage["build/attribute-base/attribute-base.js"].lines = {"1":0,"54":0,"60":0,"61":0,"63":0,"64":0,"65":0,"68":0,"69":0,"72":0,"86":0,"100":0,"102":0};+_yuitest_coverage["build/attribute-base/attribute-base.js"].functions = {"Attribute:54":0,"(anonymous 1):1":0};+_yuitest_coverage["build/attribute-base/attribute-base.js"].coveredLines = 13;+_yuitest_coverage["build/attribute-base/attribute-base.js"].coveredFunctions = 2;+_yuitest_coverline("build/attribute-base/attribute-base.js", 1);+YUI.add('attribute-base', function (Y, NAME) {++ /**+ * The attribute module provides an augmentable Attribute implementation, which + * adds configurable attributes and attribute change events to the class being + * augmented. It also provides a State class, which is used internally by Attribute,+ * but can also be used independently to provide a name/property/value data structure to+ * store state.+ *+ * @module attribute+ */++ /**+ * The attribute-base submodule provides core attribute handling support, with everything+ * aside from complex attribute handling in the provider's constructor.+ *+ * @module attribute+ * @submodule attribute-base+ */+ + /**+ * <p>+ * Attribute provides configurable attribute support along with attribute change events. It is designed to be + * augmented on to a host class, and provides the host with the ability to configure attributes to store and retrieve state, + * along with attribute change events.+ * </p>+ * <p>For example, attributes added to the host can be configured:</p>+ * <ul>+ * <li>As read only.</li>+ * <li>As write once.</li>+ * <li>With a setter function, which can be used to manipulate+ * values passed to Attribute's <a href="#method_set">set</a> method, before they are stored.</li>+ * <li>With a getter function, which can be used to manipulate stored values,+ * before they are returned by Attribute's <a href="#method_get">get</a> method.</li>+ * <li>With a validator function, to validate values before they are stored.</li>+ * </ul>+ *+ * <p>See the <a href="#method_addAttr">addAttr</a> method, for the complete set of configuration+ * options available for attributes.</p>+ *+ * <p><strong>NOTE:</strong> Most implementations will be better off extending the <a href="Base.html">Base</a> class, + * instead of augmenting Attribute directly. Base augments Attribute and will handle the initial configuration + * of attributes for derived classes, accounting for values passed into the constructor.</p>+ *+ * @class Attribute+ * @param attrs {Object} The attributes to add during construction (passed through to <a href="#method_addAttrs">addAttrs</a>). These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor.+ * @param values {Object} The initial attribute values to apply (passed through to <a href="#method_addAttrs">addAttrs</a>). These are not merged/cloned. The caller is responsible for isolating user provided values if required.+ * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href="#method_addAttrs">addAttrs</a>).+ * @uses AttributeCore+ * @uses AttributeEvents+ * @uses EventTarget+ * @uses AttributeExtras+ */+ _yuitest_coverfunc("build/attribute-base/attribute-base.js", "(anonymous 1)", 1);+_yuitest_coverline("build/attribute-base/attribute-base.js", 54);+var Attribute = function() {++ // Fix #2531929 + // Complete hack, to make sure the first clone of a node value in IE doesn't doesn't hurt state - maintains 3.4.1 behavior.+ // Too late in the release cycle to do anything about the core problem.+ // The root issue is that cloning a Y.Node instance results in an object which barfs in IE, when you access it's properties (since 3.3.0).+ _yuitest_coverfunc("build/attribute-base/attribute-base.js", "Attribute", 54);+_yuitest_coverline("build/attribute-base/attribute-base.js", 60);+this._ATTR_E_FACADE = null;+ _yuitest_coverline("build/attribute-base/attribute-base.js", 61);+this._yuievt = null;++ _yuitest_coverline("build/attribute-base/attribute-base.js", 63);+Y.AttributeCore.apply(this, arguments);+ _yuitest_coverline("build/attribute-base/attribute-base.js", 64);+Y.AttributeEvents.apply(this, arguments);+ _yuitest_coverline("build/attribute-base/attribute-base.js", 65);+Y.AttributeExtras.apply(this, arguments);+ };++ _yuitest_coverline("build/attribute-base/attribute-base.js", 68);+Y.mix(Attribute, Y.AttributeCore, false, null, 1);+ _yuitest_coverline("build/attribute-base/attribute-base.js", 69);+Y.mix(Attribute, Y.AttributeExtras, false, null, 1);++ // Needs to be "true", to overwrite methods from AttributeCore+ _yuitest_coverline("build/attribute-base/attribute-base.js", 72);+Y.mix(Attribute, Y.AttributeEvents, true, null, 1);++ /**+ * <p>The value to return from an attribute setter in order to prevent the set from going through.</p>+ *+ * <p>You can return this value from your setter if you wish to combine validator and setter + * functionality into a single setter function, which either returns the massaged value to be stored or + * AttributeCore.INVALID_VALUE to prevent invalid values from being stored.</p>+ *+ * @property INVALID_VALUE+ * @type Object+ * @static+ * @final+ */+ _yuitest_coverline("build/attribute-base/attribute-base.js", 86);+Attribute.INVALID_VALUE = Y.AttributeCore.INVALID_VALUE;++ /**+ * The list of properties which can be configured for + * each attribute (e.g. setter, getter, writeOnce etc.).+ *+ * This property is used internally as a whitelist for faster+ * Y.mix operations.+ *+ * @property _ATTR_CFG+ * @type Array+ * @static+ * @protected+ */+ _yuitest_coverline("build/attribute-base/attribute-base.js", 100);+Attribute._ATTR_CFG = Y.AttributeCore._ATTR_CFG.concat(Y.AttributeEvents._ATTR_CFG);++ _yuitest_coverline("build/attribute-base/attribute-base.js", 102);+Y.Attribute = Attribute;++}, '3.7.1', {"requires": ["attribute-core", "attribute-events", "attribute-extras"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('attribute-base', function(Y) {+YUI.add('attribute-base', function (Y, NAME) { /** * The attribute module provides an augmentable Attribute implementation, which @@ -107,5 +107,4 @@ Y.Attribute = Attribute; --}, '3.5.1' ,{requires:['attribute-core', 'attribute-events', 'attribute-extras']});+}, '3.7.1', {"requires": ["attribute-core", "attribute-events", "attribute-extras"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("attribute-base",function(b){var a=function(){this._ATTR_E_FACADE=null;this._yuievt=null;b.AttributeCore.apply(this,arguments);b.AttributeEvents.apply(this,arguments);b.AttributeExtras.apply(this,arguments);};b.mix(a,b.AttributeCore,false,null,1);b.mix(a,b.AttributeExtras,false,null,1);b.mix(a,b.AttributeEvents,true,null,1);a.INVALID_VALUE=b.AttributeCore.INVALID_VALUE;a._ATTR_CFG=b.AttributeCore._ATTR_CFG.concat(b.AttributeEvents._ATTR_CFG);b.Attribute=a;},"3.5.1",{requires:["attribute-core","attribute-events","attribute-extras"]});+YUI.add("attribute-base",function(e,t){var n=function(){this._ATTR_E_FACADE=null,this._yuievt=null,e.AttributeCore.apply(this,arguments),e.AttributeEvents.apply(this,arguments),e.AttributeExtras.apply(this,arguments)};e.mix(n,e.AttributeCore,!1,null,1),e.mix(n,e.AttributeExtras,!1,null,1),e.mix(n,e.AttributeEvents,!0,null,1),n.INVALID_VALUE=e.AttributeCore.INVALID_VALUE,n._ATTR_CFG=e.AttributeCore._ATTR_CFG.concat(e.AttributeEvents._ATTR_CFG),e.Attribute=n},"3.7.1",{requires:["attribute-core","attribute-events","attribute-extras"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('attribute-base', function(Y) {+YUI.add('attribute-base', function (Y, NAME) { /** * The attribute module provides an augmentable Attribute implementation, which @@ -107,5 +107,4 @@ Y.Attribute = Attribute; --}, '3.5.1' ,{requires:['attribute-core', 'attribute-events', 'attribute-extras']});+}, '3.7.1', {"requires": ["attribute-core", "attribute-events", "attribute-extras"]});
@@ -0,0 +1,214 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/attribute-complex/attribute-complex.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/attribute-complex/attribute-complex.js",+ code: []+};+_yuitest_coverage["build/attribute-complex/attribute-complex.js"].code=["YUI.add('attribute-complex', function (Y, NAME) {",""," /**"," * Adds support for attribute providers to handle complex attributes in the constructor"," *"," * @module attribute"," * @submodule attribute-complex"," * @for Attribute"," */",""," var O = Y.Object,"," DOT = \".\";",""," Y.Attribute.Complex = function() {};"," Y.Attribute.Complex.prototype = {",""," /**"," * Utility method to split out simple attribute name/value pairs (\"x\") "," * from complex attribute name/value pairs (\"x.y.z\"), so that complex"," * attributes can be keyed by the top level attribute name."," *"," * @method _normAttrVals"," * @param {Object} valueHash An object with attribute name/value pairs"," *"," * @return {Object} An object literal with 2 properties - \"simple\" and \"complex\","," * containing simple and complex attribute values respectively keyed "," * by the top level attribute name, or null, if valueHash is falsey."," *"," * @private"," */"," _normAttrVals : function(valueHash) {"," var vals = {},"," subvals = {},"," path,"," attr,"," v, k;",""," if (valueHash) {"," for (k in valueHash) {"," if (valueHash.hasOwnProperty(k)) {"," if (k.indexOf(DOT) !== -1) {"," path = k.split(DOT);"," attr = path.shift();"," v = subvals[attr] = subvals[attr] || [];"," v[v.length] = {"," path : path,"," value: valueHash[k]"," };"," } else {"," vals[k] = valueHash[k];"," }"," }"," }"," return { simple:vals, complex:subvals };"," } else {"," return null;"," }"," },",""," /**"," * Returns the initial value of the given attribute from"," * either the default configuration provided, or the "," * over-ridden value if it exists in the set of initValues "," * provided and the attribute is not read-only."," *"," * @param {String} attr The name of the attribute"," * @param {Object} cfg The attribute configuration object"," * @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals"," *"," * @return {Any} The initial value of the attribute."," *"," * @method _getAttrInitVal"," * @private"," */"," _getAttrInitVal : function(attr, cfg, initValues) {",""," var val = cfg.value,"," valFn = cfg.valueFn,"," tmpVal,"," initValSet = false,"," simple,"," complex,"," i,"," l,"," path,"," subval,"," subvals;",""," if (!cfg.readOnly && initValues) {"," // Simple Attributes"," simple = initValues.simple;"," if (simple && simple.hasOwnProperty(attr)) {"," val = simple[attr];"," initValSet = true;"," }"," }",""," if (valFn && !initValSet) {"," if (!valFn.call) {"," valFn = this[valFn];"," }"," if (valFn) {"," tmpVal = valFn.call(this, attr);"," val = tmpVal;"," }"," }",""," if (!cfg.readOnly && initValues) {",""," // Complex Attributes (complex values applied, after simple, in case both are set)"," complex = initValues.complex;",""," if (complex && complex.hasOwnProperty(attr) && (val !== undefined) && (val !== null)) {"," subvals = complex[attr];"," for (i = 0, l = subvals.length; i < l; ++i) {"," path = subvals[i].path;"," subval = subvals[i].value;"," O.setValue(val, path, subval);"," }"," }"," }",""," return val;"," }"," };",""," Y.mix(Y.Attribute, Y.Attribute.Complex, true, null, 1);",""," // Consistency with the rest of the Attribute addons for now. "," Y.AttributeComplex = Y.Attribute.Complex;","","","}, '3.7.1', {\"requires\": [\"attribute-base\"]});"];+_yuitest_coverage["build/attribute-complex/attribute-complex.js"].lines = {"1":0,"11":0,"14":0,"15":0,"32":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"50":0,"54":0,"56":0,"77":0,"89":0,"91":0,"92":0,"93":0,"94":0,"98":0,"99":0,"100":0,"102":0,"103":0,"104":0,"108":0,"111":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"123":0,"127":0,"130":0};+_yuitest_coverage["build/attribute-complex/attribute-complex.js"].functions = {"_normAttrVals:31":0,"_getAttrInitVal:75":0,"(anonymous 1):1":0};+_yuitest_coverage["build/attribute-complex/attribute-complex.js"].coveredLines = 39;+_yuitest_coverage["build/attribute-complex/attribute-complex.js"].coveredFunctions = 3;+_yuitest_coverline("build/attribute-complex/attribute-complex.js", 1);+YUI.add('attribute-complex', function (Y, NAME) {++ /**+ * Adds support for attribute providers to handle complex attributes in the constructor+ *+ * @module attribute+ * @submodule attribute-complex+ * @for Attribute+ */++ _yuitest_coverfunc("build/attribute-complex/attribute-complex.js", "(anonymous 1)", 1);+_yuitest_coverline("build/attribute-complex/attribute-complex.js", 11);+var O = Y.Object,+ DOT = ".";++ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 14);+Y.Attribute.Complex = function() {};+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 15);+Y.Attribute.Complex.prototype = {++ /**+ * Utility method to split out simple attribute name/value pairs ("x") + * from complex attribute name/value pairs ("x.y.z"), so that complex+ * attributes can be keyed by the top level attribute name.+ *+ * @method _normAttrVals+ * @param {Object} valueHash An object with attribute name/value pairs+ *+ * @return {Object} An object literal with 2 properties - "simple" and "complex",+ * containing simple and complex attribute values respectively keyed + * by the top level attribute name, or null, if valueHash is falsey.+ *+ * @private+ */+ _normAttrVals : function(valueHash) {+ _yuitest_coverfunc("build/attribute-complex/attribute-complex.js", "_normAttrVals", 31);+_yuitest_coverline("build/attribute-complex/attribute-complex.js", 32);+var vals = {},+ subvals = {},+ path,+ attr,+ v, k;++ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 38);+if (valueHash) {+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 39);+for (k in valueHash) {+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 40);+if (valueHash.hasOwnProperty(k)) {+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 41);+if (k.indexOf(DOT) !== -1) {+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 42);+path = k.split(DOT);+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 43);+attr = path.shift();+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 44);+v = subvals[attr] = subvals[attr] || [];+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 45);+v[v.length] = {+ path : path,+ value: valueHash[k]+ };+ } else {+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 50);+vals[k] = valueHash[k];+ }+ }+ }+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 54);+return { simple:vals, complex:subvals };+ } else {+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 56);+return null;+ }+ },++ /**+ * Returns the initial value of the given attribute from+ * either the default configuration provided, or the + * over-ridden value if it exists in the set of initValues + * provided and the attribute is not read-only.+ *+ * @param {String} attr The name of the attribute+ * @param {Object} cfg The attribute configuration object+ * @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals+ *+ * @return {Any} The initial value of the attribute.+ *+ * @method _getAttrInitVal+ * @private+ */+ _getAttrInitVal : function(attr, cfg, initValues) {++ _yuitest_coverfunc("build/attribute-complex/attribute-complex.js", "_getAttrInitVal", 75);+_yuitest_coverline("build/attribute-complex/attribute-complex.js", 77);+var val = cfg.value,+ valFn = cfg.valueFn,+ tmpVal,+ initValSet = false,+ simple,+ complex,+ i,+ l,+ path,+ subval,+ subvals;++ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 89);+if (!cfg.readOnly && initValues) {+ // Simple Attributes+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 91);+simple = initValues.simple;+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 92);+if (simple && simple.hasOwnProperty(attr)) {+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 93);+val = simple[attr];+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 94);+initValSet = true;+ }+ }++ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 98);+if (valFn && !initValSet) {+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 99);+if (!valFn.call) {+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 100);+valFn = this[valFn];+ }+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 102);+if (valFn) {+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 103);+tmpVal = valFn.call(this, attr);+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 104);+val = tmpVal;+ }+ }++ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 108);+if (!cfg.readOnly && initValues) {++ // Complex Attributes (complex values applied, after simple, in case both are set)+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 111);+complex = initValues.complex;++ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 113);+if (complex && complex.hasOwnProperty(attr) && (val !== undefined) && (val !== null)) {+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 114);+subvals = complex[attr];+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 115);+for (i = 0, l = subvals.length; i < l; ++i) {+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 116);+path = subvals[i].path;+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 117);+subval = subvals[i].value;+ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 118);+O.setValue(val, path, subval);+ }+ }+ }++ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 123);+return val;+ }+ };++ _yuitest_coverline("build/attribute-complex/attribute-complex.js", 127);+Y.mix(Y.Attribute, Y.Attribute.Complex, true, null, 1);++ // Consistency with the rest of the Attribute addons for now. + _yuitest_coverline("build/attribute-complex/attribute-complex.js", 130);+Y.AttributeComplex = Y.Attribute.Complex;+++}, '3.7.1', {"requires": ["attribute-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('attribute-complex', function(Y) {+YUI.add('attribute-complex', function (Y, NAME) { /** * Adds support for attribute providers to handle complex attributes in the constructor@@ -49,7 +49,7 @@ attr = path.shift(); v = subvals[attr] = subvals[attr] || []; v[v.length] = {- path : path, + path : path, value: valueHash[k] }; } else {@@ -82,6 +82,8 @@ var val = cfg.value, valFn = cfg.valueFn,+ tmpVal,+ initValSet = false, simple, complex, i,@@ -90,26 +92,31 @@ subval, subvals; - if (valFn) {+ if (!cfg.readOnly && initValues) {+ // Simple Attributes+ simple = initValues.simple;+ if (simple && simple.hasOwnProperty(attr)) {+ val = simple[attr];+ initValSet = true;+ }+ }++ if (valFn && !initValSet) { if (!valFn.call) { valFn = this[valFn]; } if (valFn) {- val = valFn.call(this, attr);+ tmpVal = valFn.call(this, attr);+ val = tmpVal; } } if (!cfg.readOnly && initValues) { - // Simple Attributes- simple = initValues.simple;- if (simple && simple.hasOwnProperty(attr)) {- val = simple[attr];- }-- // Complex Attributes (complex values applied, after simple, incase both are set)+ // Complex Attributes (complex values applied, after simple, in case both are set) complex = initValues.complex;- if (complex && complex.hasOwnProperty(attr)) {++ if (complex && complex.hasOwnProperty(attr) && (val !== undefined) && (val !== null)) { subvals = complex[attr]; for (i = 0, l = subvals.length; i < l; ++i) { path = subvals[i].path;@@ -129,4 +136,4 @@ Y.AttributeComplex = Y.Attribute.Complex; -}, '3.5.1' ,{requires:['attribute-base']});+}, '3.7.1', {"requires": ["attribute-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("attribute-complex",function(b){var a=b.Object,c=".";b.Attribute.Complex=function(){};b.Attribute.Complex.prototype={_normAttrVals:function(g){var i={},h={},j,d,f,e;if(g){for(e in g){if(g.hasOwnProperty(e)){if(e.indexOf(c)!==-1){j=e.split(c);d=j.shift();f=h[d]=h[d]||[];f[f.length]={path:j,value:g[e]};}else{i[e]=g[e];}}}return{simple:i,complex:h};}else{return null;}},_getAttrInitVal:function(m,j,p){var e=j.value,o=j.valueFn,d,f,h,g,q,n,k;if(o){if(!o.call){o=this[o];}if(o){e=o.call(this,m);}}if(!j.readOnly&&p){d=p.simple;if(d&&d.hasOwnProperty(m)){e=d[m];}f=p.complex;if(f&&f.hasOwnProperty(m)){k=f[m];for(h=0,g=k.length;h<g;++h){q=k[h].path;n=k[h].value;a.setValue(e,q,n);}}}return e;}};b.mix(b.Attribute,b.Attribute.Complex,true,null,1);b.AttributeComplex=b.Attribute.Complex;},"3.5.1",{requires:["attribute-base"]});+YUI.add("attribute-complex",function(e,t){var n=e.Object,r=".";e.Attribute.Complex=function(){},e.Attribute.Complex.prototype={_normAttrVals:function(e){var t={},n={},i,s,o,u;if(e){for(u in e)e.hasOwnProperty(u)&&(u.indexOf(r)!==-1?(i=u.split(r),s=i.shift(),o=n[s]=n[s]||[],o[o.length]={path:i,value:e[u]}):t[u]=e[u]);return{simple:t,complex:n}}return null},_getAttrInitVal:function(e,t,r){var i=t.value,s=t.valueFn,o,u=!1,a,f,l,c,h,p,d;!t.readOnly&&r&&(a=r.simple,a&&a.hasOwnProperty(e)&&(i=a[e],u=!0)),s&&!u&&(s.call||(s=this[s]),s&&(o=s.call(this,e),i=o));if(!t.readOnly&&r){f=r.complex;if(f&&f.hasOwnProperty(e)&&i!==undefined&&i!==null){d=f[e];for(l=0,c=d.length;l<c;++l)h=d[l].path,p=d[l].value,n.setValue(i,h,p)}}return i}},e.mix(e.Attribute,e.Attribute.Complex,!0,null,1),e.AttributeComplex=e.Attribute.Complex},"3.7.1",{requires:["attribute-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('attribute-complex', function(Y) {+YUI.add('attribute-complex', function (Y, NAME) { /** * Adds support for attribute providers to handle complex attributes in the constructor@@ -49,7 +49,7 @@ attr = path.shift(); v = subvals[attr] = subvals[attr] || []; v[v.length] = {- path : path, + path : path, value: valueHash[k] }; } else {@@ -82,6 +82,8 @@ var val = cfg.value, valFn = cfg.valueFn,+ tmpVal,+ initValSet = false, simple, complex, i,@@ -90,26 +92,31 @@ subval, subvals; - if (valFn) {+ if (!cfg.readOnly && initValues) {+ // Simple Attributes+ simple = initValues.simple;+ if (simple && simple.hasOwnProperty(attr)) {+ val = simple[attr];+ initValSet = true;+ }+ }++ if (valFn && !initValSet) { if (!valFn.call) { valFn = this[valFn]; } if (valFn) {- val = valFn.call(this, attr);+ tmpVal = valFn.call(this, attr);+ val = tmpVal; } } if (!cfg.readOnly && initValues) { - // Simple Attributes- simple = initValues.simple;- if (simple && simple.hasOwnProperty(attr)) {- val = simple[attr];- }-- // Complex Attributes (complex values applied, after simple, incase both are set)+ // Complex Attributes (complex values applied, after simple, in case both are set) complex = initValues.complex;- if (complex && complex.hasOwnProperty(attr)) {++ if (complex && complex.hasOwnProperty(attr) && (val !== undefined) && (val !== null)) { subvals = complex[attr]; for (i = 0, l = subvals.length; i < l; ++i) { path = subvals[i].path;@@ -129,4 +136,4 @@ Y.AttributeComplex = Y.Attribute.Complex; -}, '3.5.1' ,{requires:['attribute-base']});+}, '3.7.1', {"requires": ["attribute-base"]});
@@ -0,0 +1,1309 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/attribute-core/attribute-core.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/attribute-core/attribute-core.js",+ code: []+};+_yuitest_coverage["build/attribute-core/attribute-core.js"].code=["YUI.add('attribute-core', function (Y, NAME) {",""," /**"," * The State class maintains state for a collection of named items, with"," * a varying number of properties defined."," *"," * It avoids the need to create a separate class for the item, and separate instances"," * of these classes for each item, by storing the state in a 2 level hash table,"," * improving performance when the number of items is likely to be large."," *"," * @constructor"," * @class State"," */"," Y.State = function() {"," /**"," * Hash of attributes"," * @property data"," */"," this.data = {};"," };",""," Y.State.prototype = {",""," /**"," * Adds a property to an item."," *"," * @method add"," * @param name {String} The name of the item."," * @param key {String} The name of the property."," * @param val {Any} The value of the property."," */"," add: function(name, key, val) {"," var item = this.data[name];",""," if (!item) {"," item = this.data[name] = {};"," }",""," item[key] = val;"," },",""," /**"," * Adds multiple properties to an item."," *"," * @method addAll"," * @param name {String} The name of the item."," * @param obj {Object} A hash of property/value pairs."," */"," addAll: function(name, obj) {"," var item = this.data[name],"," key;",""," if (!item) {"," item = this.data[name] = {};"," }",""," for (key in obj) {"," if (obj.hasOwnProperty(key)) {"," item[key] = obj[key];"," }"," }"," },",""," /**"," * Removes a property from an item."," *"," * @method remove"," * @param name {String} The name of the item."," * @param key {String} The property to remove."," */"," remove: function(name, key) {"," var item = this.data[name];",""," if (item) {"," delete item[key];"," }"," },",""," /**"," * Removes multiple properties from an item, or removes the item completely."," *"," * @method removeAll"," * @param name {String} The name of the item."," * @param obj {Object|Array} Collection of properties to delete. If not provided, the entire item is removed."," */"," removeAll: function(name, obj) {"," var data;",""," if (!obj) {"," data = this.data;",""," if (name in data) {"," delete data[name];"," }"," } else {"," Y.each(obj, function(value, key) {"," this.remove(name, typeof key === 'string' ? key : value);"," }, this);"," }"," },",""," /**"," * For a given item, returns the value of the property requested, or undefined if not found."," *"," * @method get"," * @param name {String} The name of the item"," * @param key {String} Optional. The property value to retrieve."," * @return {Any} The value of the supplied property."," */"," get: function(name, key) {"," var item = this.data[name];",""," if (item) {"," return item[key];"," }"," },",""," /**"," * For the given item, returns an object with all of the"," * item's property/value pairs. By default the object returned"," * is a shallow copy of the stored data, but passing in true"," * as the second parameter will return a reference to the stored"," * data."," *"," * @method getAll"," * @param name {String} The name of the item"," * @param reference {boolean} true, if you want a reference to the stored"," * object"," * @return {Object} An object with property/value pairs for the item."," */"," getAll : function(name, reference) {"," var item = this.data[name],"," key, obj;",""," if (reference) {"," obj = item;"," } else if (item) {"," obj = {};",""," for (key in item) {"," if (item.hasOwnProperty(key)) {"," obj[key] = item[key];"," }"," }"," }",""," return obj;"," }"," };"," /**"," * The attribute module provides an augmentable Attribute implementation, which "," * adds configurable attributes and attribute change events to the class being "," * augmented. It also provides a State class, which is used internally by Attribute,"," * but can also be used independently to provide a name/property/value data structure to"," * store state."," *"," * @module attribute"," */",""," /**"," * The attribute-core submodule provides the lightest level of attribute handling support "," * without Attribute change events, or lesser used methods such as reset(), modifyAttrs(),"," * and removeAttr()."," *"," * @module attribute"," * @submodule attribute-core"," */"," var O = Y.Object,"," Lang = Y.Lang,",""," DOT = \".\",",""," // Externally configurable props"," GETTER = \"getter\","," SETTER = \"setter\","," READ_ONLY = \"readOnly\","," WRITE_ONCE = \"writeOnce\","," INIT_ONLY = \"initOnly\","," VALIDATOR = \"validator\","," VALUE = \"value\","," VALUE_FN = \"valueFn\","," LAZY_ADD = \"lazyAdd\",",""," // Used for internal state management"," ADDED = \"added\","," BYPASS_PROXY = \"_bypassProxy\","," INITIALIZING = \"initializing\","," INIT_VALUE = \"initValue\","," LAZY = \"lazy\","," IS_LAZY_ADD = \"isLazyAdd\",",""," INVALID_VALUE;",""," /**"," * <p>"," * AttributeCore provides the lightest level of configurable attribute support. It is designed to be "," * augmented on to a host class, and provides the host with the ability to configure "," * attributes to store and retrieve state, <strong>but without support for attribute change events</strong>."," * </p>"," * <p>For example, attributes added to the host can be configured:</p>"," * <ul>"," * <li>As read only.</li>"," * <li>As write once.</li>"," * <li>With a setter function, which can be used to manipulate"," * values passed to Attribute's <a href=\"#method_set\">set</a> method, before they are stored.</li>"," * <li>With a getter function, which can be used to manipulate stored values,"," * before they are returned by Attribute's <a href=\"#method_get\">get</a> method.</li>"," * <li>With a validator function, to validate values before they are stored.</li>"," * </ul>"," *"," * <p>See the <a href=\"#method_addAttr\">addAttr</a> method, for the complete set of configuration"," * options available for attributes.</p>"," * "," * <p>Object/Classes based on AttributeCore can augment <a href=\"AttributeEvents.html\">AttributeEvents</a> "," * (with true for overwrite) and <a href=\"AttributeExtras.html\">AttributeExtras</a> to add attribute event and "," * additional, less commonly used attribute methods, such as `modifyAttr`, `removeAttr` and `reset`.</p> "," *"," * @class AttributeCore"," * @param attrs {Object} The attributes to add during construction (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor."," * @param values {Object} The initial attribute values to apply (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These are not merged/cloned. The caller is responsible for isolating user provided values if required."," * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href=\"#method_addAttrs\">addAttrs</a>)."," */"," function AttributeCore(attrs, values, lazy) {"," this._initAttrHost(attrs, values, lazy); "," }",""," /**"," * <p>The value to return from an attribute setter in order to prevent the set from going through.</p>"," *"," * <p>You can return this value from your setter if you wish to combine validator and setter "," * functionality into a single setter function, which either returns the massaged value to be stored or "," * AttributeCore.INVALID_VALUE to prevent invalid values from being stored.</p>"," *"," * @property INVALID_VALUE"," * @type Object"," * @static"," * @final"," */"," AttributeCore.INVALID_VALUE = {};"," INVALID_VALUE = AttributeCore.INVALID_VALUE;",""," /**"," * The list of properties which can be configured for "," * each attribute (e.g. setter, getter, writeOnce etc.)."," *"," * This property is used internally as a whitelist for faster"," * Y.mix operations."," *"," * @property _ATTR_CFG"," * @type Array"," * @static"," * @protected"," */"," AttributeCore._ATTR_CFG = [SETTER, GETTER, VALIDATOR, VALUE, VALUE_FN, WRITE_ONCE, READ_ONLY, LAZY_ADD, BYPASS_PROXY];",""," AttributeCore.prototype = {",""," /**"," * Constructor logic for attributes. Initializes the host state, and sets up the inital attributes passed to the "," * constructor."," *"," * @method _initAttrHost"," * @param attrs {Object} The attributes to add during construction (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor."," * @param values {Object} The initial attribute values to apply (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These are not merged/cloned. The caller is responsible for isolating user provided values if required."," * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href=\"#method_addAttrs\">addAttrs</a>)."," * @private"," */"," _initAttrHost : function(attrs, values, lazy) {"," this._state = new Y.State();"," this._initAttrs(attrs, values, lazy);"," },",""," /**"," * <p>"," * Adds an attribute with the provided configuration to the host object."," * </p>"," * <p>"," * The config argument object supports the following properties:"," * </p>"," * "," * <dl>"," * <dt>value <Any></dt>"," * <dd>The initial value to set on the attribute</dd>"," *"," * <dt>valueFn <Function | String></dt>"," * <dd>"," * <p>A function, which will return the initial value to set on the attribute. This is useful"," * for cases where the attribute configuration is defined statically, but needs to "," * reference the host instance (\"this\") to obtain an initial value. If both the value and valueFn properties are defined, "," * the value returned by the valueFn has precedence over the value property, unless it returns undefined, in which "," * case the value property is used.</p>"," *"," * <p>valueFn can also be set to a string, representing the name of the instance method to be used to retrieve the value.</p>"," * </dd>"," *"," * <dt>readOnly <boolean></dt>"," * <dd>Whether or not the attribute is read only. Attributes having readOnly set to true"," * cannot be modified by invoking the set method.</dd>"," *"," * <dt>writeOnce <boolean> or <string></dt>"," * <dd>"," * Whether or not the attribute is \"write once\". Attributes having writeOnce set to true, "," * can only have their values set once, be it through the default configuration, "," * constructor configuration arguments, or by invoking set."," * <p>The writeOnce attribute can also be set to the string \"initOnly\", in which case the attribute can only be set during initialization"," * (when used with Base, this means it can only be set during construction)</p>"," * </dd>"," *"," * <dt>setter <Function | String></dt>"," * <dd>"," * <p>The setter function used to massage or normalize the value passed to the set method for the attribute. "," * The value returned by the setter will be the final stored value. Returning"," * <a href=\"#property_Attribute.INVALID_VALUE\">Attribute.INVALID_VALUE</a>, from the setter will prevent"," * the value from being stored."," * </p>"," * "," * <p>setter can also be set to a string, representing the name of the instance method to be used as the setter function.</p>"," * </dd>"," * "," * <dt>getter <Function | String></dt>"," * <dd>"," * <p>"," * The getter function used to massage or normalize the value returned by the get method for the attribute."," * The value returned by the getter function is the value which will be returned to the user when they "," * invoke get."," * </p>"," *"," * <p>getter can also be set to a string, representing the name of the instance method to be used as the getter function.</p>"," * </dd>"," *"," * <dt>validator <Function | String></dt>"," * <dd>"," * <p>"," * The validator function invoked prior to setting the stored value. Returning"," * false from the validator function will prevent the value from being stored."," * </p>"," * "," * <p>validator can also be set to a string, representing the name of the instance method to be used as the validator function.</p>"," * </dd>"," *"," * <dt>lazyAdd <boolean></dt>"," * <dd>Whether or not to delay initialization of the attribute until the first call to get/set it. "," * This flag can be used to over-ride lazy initialization on a per attribute basis, when adding multiple attributes through "," * the <a href=\"#method_addAttrs\">addAttrs</a> method.</dd>"," *"," * </dl>"," *"," * <p>The setter, getter and validator are invoked with the value and name passed in as the first and second arguments, and with"," * the context (\"this\") set to the host object.</p>"," *"," * <p>Configuration properties outside of the list mentioned above are considered private properties used internally by attribute, "," * and are not intended for public use.</p>"," * "," * @method addAttr"," *"," * @param {String} name The name of the attribute."," * @param {Object} config An object with attribute configuration property/value pairs, specifying the configuration for the attribute."," *"," * <p>"," * <strong>NOTE:</strong> The configuration object is modified when adding an attribute, so if you need "," * to protect the original values, you will need to merge the object."," * </p>"," *"," * @param {boolean} lazy (optional) Whether or not to add this attribute lazily (on the first call to get/set). "," *"," * @return {Object} A reference to the host object."," *"," * @chainable"," */"," addAttr: function(name, config, lazy) {","",""," var host = this, // help compression"," state = host._state,"," value,"," hasValue;",""," config = config || {};",""," lazy = (LAZY_ADD in config) ? config[LAZY_ADD] : lazy;",""," if (lazy && !host.attrAdded(name)) {"," state.addAll(name, {"," lazy : config,"," added : true"," });"," } else {","",""," if (!host.attrAdded(name) || state.get(name, IS_LAZY_ADD)) {",""," hasValue = (VALUE in config);","",""," if (hasValue) {"," // We'll go through set, don't want to set value in config directly"," value = config.value;"," delete config.value;"," }",""," config.added = true;"," config.initializing = true;",""," state.addAll(name, config);",""," if (hasValue) {"," // Go through set, so that raw values get normalized/validated"," host.set(name, value);"," }",""," state.remove(name, INITIALIZING);"," }"," }",""," return host;"," },",""," /**"," * Checks if the given attribute has been added to the host"," *"," * @method attrAdded"," * @param {String} name The name of the attribute to check."," * @return {boolean} true if an attribute with the given name has been added, false if it hasn't. This method will return true for lazily added attributes."," */"," attrAdded: function(name) {"," return !!this._state.get(name, ADDED);"," },",""," /**"," * Returns the current value of the attribute. If the attribute"," * has been configured with a 'getter' function, this method will delegate"," * to the 'getter' to obtain the value of the attribute."," *"," * @method get"," *"," * @param {String} name The name of the attribute. If the value of the attribute is an Object, "," * dot notation can be used to obtain the value of a property of the object (e.g. <code>get(\"x.y.z\")</code>)"," *"," * @return {Any} The value of the attribute"," */"," get : function(name) {"," return this._getAttr(name);"," },",""," /**"," * Checks whether or not the attribute is one which has been"," * added lazily and still requires initialization."," *"," * @method _isLazyAttr"," * @private"," * @param {String} name The name of the attribute"," * @return {boolean} true if it's a lazily added attribute, false otherwise."," */"," _isLazyAttr: function(name) {"," return this._state.get(name, LAZY);"," },",""," /**"," * Finishes initializing an attribute which has been lazily added."," *"," * @method _addLazyAttr"," * @private"," * @param {Object} name The name of the attribute"," */"," _addLazyAttr: function(name, cfg) {"," var state = this._state,"," lazyCfg = state.get(name, LAZY);",""," state.add(name, IS_LAZY_ADD, true);"," state.remove(name, LAZY);"," this.addAttr(name, lazyCfg);"," },",""," /**"," * Sets the value of an attribute."," *"," * @method set"," * @chainable"," *"," * @param {String} name The name of the attribute. If the "," * current value of the attribute is an Object, dot notation can be used"," * to set the value of a property within the object (e.g. <code>set(\"x.y.z\", 5)</code>)."," *"," * @param {Any} value The value to set the attribute to."," *"," * @return {Object} A reference to the host object."," */"," set : function(name, val) {"," return this._setAttr(name, val);"," },",""," /**"," * Allows setting of readOnly/writeOnce attributes. See <a href=\"#method_set\">set</a> for argument details."," *"," * @method _set"," * @protected"," * @chainable"," * "," * @param {String} name The name of the attribute."," * @param {Any} val The value to set the attribute to."," * @return {Object} A reference to the host object."," */"," _set : function(name, val) {"," return this._setAttr(name, val, null, true);"," },",""," /**"," * Provides the common implementation for the public set and protected _set methods."," *"," * See <a href=\"#method_set\">set</a> for argument details."," *"," * @method _setAttr"," * @protected"," * @chainable"," *"," * @param {String} name The name of the attribute."," * @param {Any} value The value to set the attribute to."," * @param {Object} opts (Optional) Optional event data to be mixed into"," * the event facade passed to subscribers of the attribute's change event."," * This is currently a hack. There's no real need for the AttributeCore implementation"," * to support this parameter, but breaking it out into AttributeEvents, results in"," * additional function hops for the critical path."," * @param {boolean} force If true, allows the caller to set values for "," * readOnly or writeOnce attributes which have already been set."," *"," * @return {Object} A reference to the host object."," */"," _setAttr : function(name, val, opts, force) {"," "," // HACK - no real reason core needs to know about opts, but "," // it adds fn hops if we want to break it out. "," // Not sure it's worth it for this critical path"," "," var allowSet = true,"," state = this._state,"," stateProxy = this._stateProxy,"," cfg,"," initialSet,"," strPath,"," path,"," currVal,"," writeOnce,"," initializing;",""," if (name.indexOf(DOT) !== -1) {"," strPath = name;"," path = name.split(DOT);"," name = path.shift();"," }",""," if (this._isLazyAttr(name)) {"," this._addLazyAttr(name);"," }",""," cfg = state.getAll(name, true) || {}; ",""," initialSet = (!(VALUE in cfg));",""," if (stateProxy && name in stateProxy && !cfg._bypassProxy) {"," // TODO: Value is always set for proxy. Can we do any better? Maybe take a snapshot as the initial value for the first call to set? "," initialSet = false;"," }",""," writeOnce = cfg.writeOnce;"," initializing = cfg.initializing;",""," if (!initialSet && !force) {",""," if (writeOnce) {"," allowSet = false;"," }",""," if (cfg.readOnly) {"," allowSet = false;"," }"," }",""," if (!initializing && !force && writeOnce === INIT_ONLY) {"," allowSet = false;"," }",""," if (allowSet) {"," // Don't need currVal if initialSet (might fail in custom getter if it always expects a non-undefined/non-null value)"," if (!initialSet) {"," currVal = this.get(name);"," }",""," if (path) {"," val = O.setValue(Y.clone(currVal), path, val);",""," if (val === undefined) {"," allowSet = false;"," }"," }",""," if (allowSet) {"," if (!this._fireAttrChange || initializing) {"," this._setAttrVal(name, strPath, currVal, val);"," } else {"," // HACK - no real reason core needs to know about _fireAttrChange, but "," // it adds fn hops if we want to break it out. Not sure it's worth it for this critical path"," this._fireAttrChange(name, strPath, currVal, val, opts);"," }"," }"," }",""," return this;"," },",""," /**"," * Provides the common implementation for the public get method,"," * allowing Attribute hosts to over-ride either method."," *"," * See <a href=\"#method_get\">get</a> for argument details."," *"," * @method _getAttr"," * @protected"," * @chainable"," *"," * @param {String} name The name of the attribute."," * @return {Any} The value of the attribute."," */"," _getAttr : function(name) {"," var host = this, // help compression"," fullName = name,"," state = host._state,"," path,"," getter,"," val,"," cfg;",""," if (name.indexOf(DOT) !== -1) {"," path = name.split(DOT);"," name = path.shift();"," }",""," // On Demand - Should be rare - handles out of order valueFn references"," if (host._tCfgs && host._tCfgs[name]) {"," cfg = {};"," cfg[name] = host._tCfgs[name];"," delete host._tCfgs[name];"," host._addAttrs(cfg, host._tVals);"," }"," "," // Lazy Init"," if (host._isLazyAttr(name)) {"," host._addLazyAttr(name);"," }",""," val = host._getStateVal(name);"," "," getter = state.get(name, GETTER);",""," if (getter && !getter.call) {"," getter = this[getter];"," }",""," val = (getter) ? getter.call(host, val, fullName) : val;"," val = (path) ? O.getValue(val, path) : val;",""," return val;"," },",""," /**"," * Gets the stored value for the attribute, from either the "," * internal state object, or the state proxy if it exits"," * "," * @method _getStateVal"," * @private"," * @param {String} name The name of the attribute"," * @return {Any} The stored value of the attribute"," */"," _getStateVal : function(name) {"," var stateProxy = this._stateProxy;"," return stateProxy && (name in stateProxy) && !this._state.get(name, BYPASS_PROXY) ? stateProxy[name] : this._state.get(name, VALUE);"," },",""," /**"," * Sets the stored value for the attribute, in either the "," * internal state object, or the state proxy if it exits"," *"," * @method _setStateVal"," * @private"," * @param {String} name The name of the attribute"," * @param {Any} value The value of the attribute"," */"," _setStateVal : function(name, value) {"," var stateProxy = this._stateProxy;"," if (stateProxy && (name in stateProxy) && !this._state.get(name, BYPASS_PROXY)) {"," stateProxy[name] = value;"," } else {"," this._state.add(name, VALUE, value);"," }"," },",""," /**"," * Updates the stored value of the attribute in the privately held State object,"," * if validation and setter passes."," *"," * @method _setAttrVal"," * @private"," * @param {String} attrName The attribute name."," * @param {String} subAttrName The sub-attribute name, if setting a sub-attribute property (\"x.y.z\")."," * @param {Any} prevVal The currently stored value of the attribute."," * @param {Any} newVal The value which is going to be stored."," * "," * @return {booolean} true if the new attribute value was stored, false if not."," */"," _setAttrVal : function(attrName, subAttrName, prevVal, newVal) {",""," var host = this,"," allowSet = true,"," cfg = this._state.getAll(attrName, true) || {},"," validator = cfg.validator,"," setter = cfg.setter,"," initializing = cfg.initializing,"," prevRawVal = this._getStateVal(attrName),"," name = subAttrName || attrName,"," retVal,"," valid;",""," if (validator) {"," if (!validator.call) { "," // Assume string - trying to keep critical path tight, so avoiding Lang check"," validator = this[validator];"," }"," if (validator) {"," valid = validator.call(host, newVal, name);",""," if (!valid && initializing) {"," newVal = cfg.defaultValue;"," valid = true; // Assume it's valid, for perf."," }"," }"," }",""," if (!validator || valid) {"," if (setter) {"," if (!setter.call) {"," // Assume string - trying to keep critical path tight, so avoiding Lang check"," setter = this[setter];"," }"," if (setter) {"," retVal = setter.call(host, newVal, name);",""," if (retVal === INVALID_VALUE) {"," allowSet = false;"," } else if (retVal !== undefined){"," newVal = retVal;"," }"," }"," }",""," if (allowSet) {"," if(!subAttrName && (newVal === prevRawVal) && !Lang.isObject(newVal)) {"," allowSet = false;"," } else {"," // Store value"," if (!(INIT_VALUE in cfg)) {"," cfg.initValue = newVal;"," }"," host._setStateVal(attrName, newVal);"," }"," }",""," } else {"," allowSet = false;"," }",""," return allowSet;"," },",""," /**"," * Sets multiple attribute values."," *"," * @method setAttrs"," * @param {Object} attrs An object with attributes name/value pairs."," * @return {Object} A reference to the host object."," * @chainable"," */"," setAttrs : function(attrs) {"," return this._setAttrs(attrs);"," },",""," /**"," * Implementation behind the public setAttrs method, to set multiple attribute values."," *"," * @method _setAttrs"," * @protected"," * @param {Object} attrs An object with attributes name/value pairs."," * @return {Object} A reference to the host object."," * @chainable"," */"," _setAttrs : function(attrs) {"," var attr;"," for (attr in attrs) {"," if ( attrs.hasOwnProperty(attr) ) {"," this.set(attr, attrs[attr]);"," }"," }"," return this;"," },",""," /**"," * Gets multiple attribute values."," *"," * @method getAttrs"," * @param {Array | boolean} attrs Optional. An array of attribute names. If omitted, all attribute values are"," * returned. If set to true, all attributes modified from their initial values are returned."," * @return {Object} An object with attribute name/value pairs."," */"," getAttrs : function(attrs) {"," return this._getAttrs(attrs);"," },",""," /**"," * Implementation behind the public getAttrs method, to get multiple attribute values."," *"," * @method _getAttrs"," * @protected"," * @param {Array | boolean} attrs Optional. An array of attribute names. If omitted, all attribute values are"," * returned. If set to true, all attributes modified from their initial values are returned."," * @return {Object} An object with attribute name/value pairs."," */"," _getAttrs : function(attrs) {"," var obj = {},"," attr, i, len,"," modifiedOnly = (attrs === true);",""," // TODO - figure out how to get all \"added\""," if (!attrs || modifiedOnly) {"," attrs = O.keys(this._state.data);"," }",""," for (i = 0, len = attrs.length; i < len; i++) {"," attr = attrs[i];",""," if (!modifiedOnly || this._getStateVal(attr) != this._state.get(attr, INIT_VALUE)) {"," // Go through get, to honor cloning/normalization"," obj[attr] = this.get(attr);"," }"," }",""," return obj;"," },",""," /**"," * Configures a group of attributes, and sets initial values."," *"," * <p>"," * <strong>NOTE:</strong> This method does not isolate the configuration object by merging/cloning. "," * The caller is responsible for merging/cloning the configuration object if required."," * </p>"," *"," * @method addAttrs"," * @chainable"," *"," * @param {Object} cfgs An object with attribute name/configuration pairs."," * @param {Object} values An object with attribute name/value pairs, defining the initial values to apply."," * Values defined in the cfgs argument will be over-written by values in this argument unless defined as read only."," * @param {boolean} lazy Whether or not to delay the intialization of these attributes until the first call to get/set."," * Individual attributes can over-ride this behavior by defining a lazyAdd configuration property in their configuration."," * See <a href=\"#method_addAttr\">addAttr</a>."," * "," * @return {Object} A reference to the host object."," */"," addAttrs : function(cfgs, values, lazy) {"," var host = this; // help compression"," if (cfgs) {"," host._tCfgs = cfgs;"," host._tVals = host._normAttrVals(values);"," host._addAttrs(cfgs, host._tVals, lazy);"," host._tCfgs = host._tVals = null;"," }",""," return host;"," },",""," /**"," * Implementation behind the public addAttrs method. "," * "," * This method is invoked directly by get if it encounters a scenario "," * in which an attribute's valueFn attempts to obtain the "," * value an attribute in the same group of attributes, which has not yet "," * been added (on demand initialization)."," *"," * @method _addAttrs"," * @private"," * @param {Object} cfgs An object with attribute name/configuration pairs."," * @param {Object} values An object with attribute name/value pairs, defining the initial values to apply."," * Values defined in the cfgs argument will be over-written by values in this argument unless defined as read only."," * @param {boolean} lazy Whether or not to delay the intialization of these attributes until the first call to get/set."," * Individual attributes can over-ride this behavior by defining a lazyAdd configuration property in their configuration."," * See <a href=\"#method_addAttr\">addAttr</a>."," */"," _addAttrs : function(cfgs, values, lazy) {"," var host = this, // help compression"," attr,"," attrCfg,"," value;",""," for (attr in cfgs) {"," if (cfgs.hasOwnProperty(attr)) {",""," // Not Merging. Caller is responsible for isolating configs"," attrCfg = cfgs[attr];"," attrCfg.defaultValue = attrCfg.value;",""," // Handle simple, complex and user values, accounting for read-only"," value = host._getAttrInitVal(attr, attrCfg, host._tVals);",""," if (value !== undefined) {"," attrCfg.value = value;"," }",""," if (host._tCfgs[attr]) {"," delete host._tCfgs[attr];"," }",""," host.addAttr(attr, attrCfg, lazy);"," }"," }"," },",""," /**"," * Utility method to protect an attribute configuration"," * hash, by merging the entire object and the individual "," * attr config objects. "," *"," * @method _protectAttrs"," * @protected"," * @param {Object} attrs A hash of attribute to configuration object pairs."," * @return {Object} A protected version of the attrs argument."," */"," _protectAttrs : function(attrs) {"," if (attrs) {"," attrs = Y.merge(attrs);"," for (var attr in attrs) {"," if (attrs.hasOwnProperty(attr)) {"," attrs[attr] = Y.merge(attrs[attr]);"," }"," }"," }"," return attrs;"," },",""," /**"," * Utility method to normalize attribute values. The base implementation "," * simply merges the hash to protect the original."," *"," * @method _normAttrVals"," * @param {Object} valueHash An object with attribute name/value pairs"," *"," * @return {Object}"," *"," * @private"," */"," _normAttrVals : function(valueHash) {"," return (valueHash) ? Y.merge(valueHash) : null;"," },",""," /**"," * Returns the initial value of the given attribute from"," * either the default configuration provided, or the "," * over-ridden value if it exists in the set of initValues "," * provided and the attribute is not read-only."," *"," * @param {String} attr The name of the attribute"," * @param {Object} cfg The attribute configuration object"," * @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals"," *"," * @return {Any} The initial value of the attribute."," *"," * @method _getAttrInitVal"," * @private"," */"," _getAttrInitVal : function(attr, cfg, initValues) {"," var val, valFn;"," // init value is provided by the user if it exists, else, provided by the config"," if (!cfg.readOnly && initValues && initValues.hasOwnProperty(attr)) {"," val = initValues[attr];"," } else {"," val = cfg.value;"," valFn = cfg.valueFn;"," "," if (valFn) {"," if (!valFn.call) {"," valFn = this[valFn];"," }"," if (valFn) {"," val = valFn.call(this, attr);"," }"," }"," }","",""," return val;"," },",""," /**"," * Utility method to set up initial attributes defined during construction, either through the constructor.ATTRS property, or explicitly passed in."," * "," * @method _initAttrs"," * @protected"," * @param attrs {Object} The attributes to add during construction (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor."," * @param values {Object} The initial attribute values to apply (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These are not merged/cloned. The caller is responsible for isolating user provided values if required."," * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href=\"#method_addAttrs\">addAttrs</a>)."," */"," _initAttrs : function(attrs, values, lazy) {"," // ATTRS support for Node, which is not Base based"," attrs = attrs || this.constructor.ATTRS;"," "," var Base = Y.Base,"," BaseCore = Y.BaseCore,"," baseInst = (Base && Y.instanceOf(this, Base)),"," baseCoreInst = (!baseInst && BaseCore && Y.instanceOf(this, BaseCore));",""," if ( attrs && !baseInst && !baseCoreInst) {"," this.addAttrs(this._protectAttrs(attrs), values, lazy);"," }"," }"," };",""," Y.AttributeCore = AttributeCore;","","","}, '3.7.1', {\"requires\": [\"oop\"]});"];+_yuitest_coverage["build/attribute-core/attribute-core.js"].lines = {"1":0,"14":0,"19":0,"22":0,"33":0,"35":0,"36":0,"39":0,"50":0,"53":0,"54":0,"57":0,"58":0,"59":0,"72":0,"74":0,"75":0,"87":0,"89":0,"90":0,"92":0,"93":0,"96":0,"97":0,"111":0,"113":0,"114":0,"132":0,"135":0,"136":0,"137":0,"138":0,"140":0,"141":0,"142":0,"147":0,"168":0,"223":0,"224":0,"239":0,"240":0,"254":0,"256":0,"269":0,"270":0,"373":0,"378":0,"380":0,"382":0,"383":0,"390":0,"392":0,"395":0,"397":0,"398":0,"401":0,"402":0,"404":0,"406":0,"408":0,"411":0,"415":0,"426":0,"442":0,"455":0,"466":0,"469":0,"470":0,"471":0,"489":0,"504":0,"534":0,"545":0,"546":0,"547":0,"548":0,"551":0,"552":0,"555":0,"557":0,"559":0,"561":0,"564":0,"565":0,"567":0,"569":0,"570":0,"573":0,"574":0,"578":0,"579":0,"582":0,"584":0,"585":0,"588":0,"589":0,"591":0,"592":0,"596":0,"597":0,"598":0,"602":0,"607":0,"624":0,"632":0,"633":0,"634":0,"638":0,"639":0,"640":0,"641":0,"642":0,"646":0,"647":0,"650":0,"652":0,"654":0,"655":0,"658":0,"659":0,"661":0,"674":0,"675":0,"688":0,"689":0,"690":0,"692":0,"711":0,"722":0,"723":0,"725":0,"727":0,"728":0,"730":0,"731":0,"732":0,"737":0,"738":0,"739":0,"741":0,"743":0,"744":0,"746":0,"747":0,"748":0,"749":0,"754":0,"755":0,"756":0,"759":0,"760":0,"762":0,"767":0,"770":0,"782":0,"795":0,"796":0,"797":0,"798":0,"801":0,"813":0,"826":0,"831":0,"832":0,"835":0,"836":0,"838":0,"840":0,"844":0,"868":0,"869":0,"870":0,"871":0,"872":0,"873":0,"876":0,"897":0,"902":0,"903":0,"906":0,"907":0,"910":0,"912":0,"913":0,"916":0,"917":0,"920":0,"936":0,"937":0,"938":0,"939":0,"940":0,"944":0,"959":0,"978":0,"980":0,"981":0,"983":0,"984":0,"986":0,"987":0,"988":0,"990":0,"991":0,"997":0,"1011":0,"1013":0,"1018":0,"1019":0,"1024":0};+_yuitest_coverage["build/attribute-core/attribute-core.js"].functions = {"State:14":0,"add:32":0,"addAll:49":0,"remove:71":0,"(anonymous 2):96":0,"removeAll:86":0,"get:110":0,"getAll:131":0,"AttributeCore:223":0,"_initAttrHost:268":0,"addAttr:370":0,"attrAdded:425":0,"get:441":0,"_isLazyAttr:454":0,"_addLazyAttr:465":0,"set:488":0,"_set:503":0,"_setAttr:528":0,"_getAttr:623":0,"_getStateVal:673":0,"_setStateVal:687":0,"_setAttrVal:709":0,"setAttrs:781":0,"_setAttrs:794":0,"getAttrs:812":0,"_getAttrs:825":0,"addAttrs:867":0,"_addAttrs:896":0,"_protectAttrs:935":0,"_normAttrVals:958":0,"_getAttrInitVal:977":0,"_initAttrs:1009":0,"(anonymous 1):1":0};+_yuitest_coverage["build/attribute-core/attribute-core.js"].coveredLines = 210;+_yuitest_coverage["build/attribute-core/attribute-core.js"].coveredFunctions = 33;+_yuitest_coverline("build/attribute-core/attribute-core.js", 1);+YUI.add('attribute-core', function (Y, NAME) {++ /**+ * The State class maintains state for a collection of named items, with+ * a varying number of properties defined.+ *+ * It avoids the need to create a separate class for the item, and separate instances+ * of these classes for each item, by storing the state in a 2 level hash table,+ * improving performance when the number of items is likely to be large.+ *+ * @constructor+ * @class State+ */+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "(anonymous 1)", 1);+_yuitest_coverline("build/attribute-core/attribute-core.js", 14);+Y.State = function() {+ /**+ * Hash of attributes+ * @property data+ */+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "State", 14);+_yuitest_coverline("build/attribute-core/attribute-core.js", 19);+this.data = {};+ };++ _yuitest_coverline("build/attribute-core/attribute-core.js", 22);+Y.State.prototype = {++ /**+ * Adds a property to an item.+ *+ * @method add+ * @param name {String} The name of the item.+ * @param key {String} The name of the property.+ * @param val {Any} The value of the property.+ */+ add: function(name, key, val) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "add", 32);+_yuitest_coverline("build/attribute-core/attribute-core.js", 33);+var item = this.data[name];++ _yuitest_coverline("build/attribute-core/attribute-core.js", 35);+if (!item) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 36);+item = this.data[name] = {};+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 39);+item[key] = val;+ },++ /**+ * Adds multiple properties to an item.+ *+ * @method addAll+ * @param name {String} The name of the item.+ * @param obj {Object} A hash of property/value pairs.+ */+ addAll: function(name, obj) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "addAll", 49);+_yuitest_coverline("build/attribute-core/attribute-core.js", 50);+var item = this.data[name],+ key;++ _yuitest_coverline("build/attribute-core/attribute-core.js", 53);+if (!item) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 54);+item = this.data[name] = {};+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 57);+for (key in obj) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 58);+if (obj.hasOwnProperty(key)) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 59);+item[key] = obj[key];+ }+ }+ },++ /**+ * Removes a property from an item.+ *+ * @method remove+ * @param name {String} The name of the item.+ * @param key {String} The property to remove.+ */+ remove: function(name, key) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "remove", 71);+_yuitest_coverline("build/attribute-core/attribute-core.js", 72);+var item = this.data[name];++ _yuitest_coverline("build/attribute-core/attribute-core.js", 74);+if (item) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 75);+delete item[key];+ }+ },++ /**+ * Removes multiple properties from an item, or removes the item completely.+ *+ * @method removeAll+ * @param name {String} The name of the item.+ * @param obj {Object|Array} Collection of properties to delete. If not provided, the entire item is removed.+ */+ removeAll: function(name, obj) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "removeAll", 86);+_yuitest_coverline("build/attribute-core/attribute-core.js", 87);+var data;++ _yuitest_coverline("build/attribute-core/attribute-core.js", 89);+if (!obj) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 90);+data = this.data;++ _yuitest_coverline("build/attribute-core/attribute-core.js", 92);+if (name in data) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 93);+delete data[name];+ }+ } else {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 96);+Y.each(obj, function(value, key) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "(anonymous 2)", 96);+_yuitest_coverline("build/attribute-core/attribute-core.js", 97);+this.remove(name, typeof key === 'string' ? key : value);+ }, this);+ }+ },++ /**+ * For a given item, returns the value of the property requested, or undefined if not found.+ *+ * @method get+ * @param name {String} The name of the item+ * @param key {String} Optional. The property value to retrieve.+ * @return {Any} The value of the supplied property.+ */+ get: function(name, key) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "get", 110);+_yuitest_coverline("build/attribute-core/attribute-core.js", 111);+var item = this.data[name];++ _yuitest_coverline("build/attribute-core/attribute-core.js", 113);+if (item) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 114);+return item[key];+ }+ },++ /**+ * For the given item, returns an object with all of the+ * item's property/value pairs. By default the object returned+ * is a shallow copy of the stored data, but passing in true+ * as the second parameter will return a reference to the stored+ * data.+ *+ * @method getAll+ * @param name {String} The name of the item+ * @param reference {boolean} true, if you want a reference to the stored+ * object+ * @return {Object} An object with property/value pairs for the item.+ */+ getAll : function(name, reference) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "getAll", 131);+_yuitest_coverline("build/attribute-core/attribute-core.js", 132);+var item = this.data[name],+ key, obj;++ _yuitest_coverline("build/attribute-core/attribute-core.js", 135);+if (reference) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 136);+obj = item;+ } else {_yuitest_coverline("build/attribute-core/attribute-core.js", 137);+if (item) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 138);+obj = {};++ _yuitest_coverline("build/attribute-core/attribute-core.js", 140);+for (key in item) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 141);+if (item.hasOwnProperty(key)) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 142);+obj[key] = item[key];+ }+ }+ }}++ _yuitest_coverline("build/attribute-core/attribute-core.js", 147);+return obj;+ }+ };+ /**+ * The attribute module provides an augmentable Attribute implementation, which + * adds configurable attributes and attribute change events to the class being + * augmented. It also provides a State class, which is used internally by Attribute,+ * but can also be used independently to provide a name/property/value data structure to+ * store state.+ *+ * @module attribute+ */++ /**+ * The attribute-core submodule provides the lightest level of attribute handling support + * without Attribute change events, or lesser used methods such as reset(), modifyAttrs(),+ * and removeAttr().+ *+ * @module attribute+ * @submodule attribute-core+ */+ _yuitest_coverline("build/attribute-core/attribute-core.js", 168);+var O = Y.Object,+ Lang = Y.Lang,++ DOT = ".",++ // Externally configurable props+ GETTER = "getter",+ SETTER = "setter",+ READ_ONLY = "readOnly",+ WRITE_ONCE = "writeOnce",+ INIT_ONLY = "initOnly",+ VALIDATOR = "validator",+ VALUE = "value",+ VALUE_FN = "valueFn",+ LAZY_ADD = "lazyAdd",++ // Used for internal state management+ ADDED = "added",+ BYPASS_PROXY = "_bypassProxy",+ INITIALIZING = "initializing",+ INIT_VALUE = "initValue",+ LAZY = "lazy",+ IS_LAZY_ADD = "isLazyAdd",++ INVALID_VALUE;++ /**+ * <p>+ * AttributeCore provides the lightest level of configurable attribute support. It is designed to be + * augmented on to a host class, and provides the host with the ability to configure + * attributes to store and retrieve state, <strong>but without support for attribute change events</strong>.+ * </p>+ * <p>For example, attributes added to the host can be configured:</p>+ * <ul>+ * <li>As read only.</li>+ * <li>As write once.</li>+ * <li>With a setter function, which can be used to manipulate+ * values passed to Attribute's <a href="#method_set">set</a> method, before they are stored.</li>+ * <li>With a getter function, which can be used to manipulate stored values,+ * before they are returned by Attribute's <a href="#method_get">get</a> method.</li>+ * <li>With a validator function, to validate values before they are stored.</li>+ * </ul>+ *+ * <p>See the <a href="#method_addAttr">addAttr</a> method, for the complete set of configuration+ * options available for attributes.</p>+ * + * <p>Object/Classes based on AttributeCore can augment <a href="AttributeEvents.html">AttributeEvents</a> + * (with true for overwrite) and <a href="AttributeExtras.html">AttributeExtras</a> to add attribute event and + * additional, less commonly used attribute methods, such as `modifyAttr`, `removeAttr` and `reset`.</p> + *+ * @class AttributeCore+ * @param attrs {Object} The attributes to add during construction (passed through to <a href="#method_addAttrs">addAttrs</a>). These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor.+ * @param values {Object} The initial attribute values to apply (passed through to <a href="#method_addAttrs">addAttrs</a>). These are not merged/cloned. The caller is responsible for isolating user provided values if required.+ * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href="#method_addAttrs">addAttrs</a>).+ */+ _yuitest_coverline("build/attribute-core/attribute-core.js", 223);+function AttributeCore(attrs, values, lazy) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "AttributeCore", 223);+_yuitest_coverline("build/attribute-core/attribute-core.js", 224);+this._initAttrHost(attrs, values, lazy); + }++ /**+ * <p>The value to return from an attribute setter in order to prevent the set from going through.</p>+ *+ * <p>You can return this value from your setter if you wish to combine validator and setter + * functionality into a single setter function, which either returns the massaged value to be stored or + * AttributeCore.INVALID_VALUE to prevent invalid values from being stored.</p>+ *+ * @property INVALID_VALUE+ * @type Object+ * @static+ * @final+ */+ _yuitest_coverline("build/attribute-core/attribute-core.js", 239);+AttributeCore.INVALID_VALUE = {};+ _yuitest_coverline("build/attribute-core/attribute-core.js", 240);+INVALID_VALUE = AttributeCore.INVALID_VALUE;++ /**+ * The list of properties which can be configured for + * each attribute (e.g. setter, getter, writeOnce etc.).+ *+ * This property is used internally as a whitelist for faster+ * Y.mix operations.+ *+ * @property _ATTR_CFG+ * @type Array+ * @static+ * @protected+ */+ _yuitest_coverline("build/attribute-core/attribute-core.js", 254);+AttributeCore._ATTR_CFG = [SETTER, GETTER, VALIDATOR, VALUE, VALUE_FN, WRITE_ONCE, READ_ONLY, LAZY_ADD, BYPASS_PROXY];++ _yuitest_coverline("build/attribute-core/attribute-core.js", 256);+AttributeCore.prototype = {++ /**+ * Constructor logic for attributes. Initializes the host state, and sets up the inital attributes passed to the + * constructor.+ *+ * @method _initAttrHost+ * @param attrs {Object} The attributes to add during construction (passed through to <a href="#method_addAttrs">addAttrs</a>). These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor.+ * @param values {Object} The initial attribute values to apply (passed through to <a href="#method_addAttrs">addAttrs</a>). These are not merged/cloned. The caller is responsible for isolating user provided values if required.+ * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href="#method_addAttrs">addAttrs</a>).+ * @private+ */+ _initAttrHost : function(attrs, values, lazy) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "_initAttrHost", 268);+_yuitest_coverline("build/attribute-core/attribute-core.js", 269);+this._state = new Y.State();+ _yuitest_coverline("build/attribute-core/attribute-core.js", 270);+this._initAttrs(attrs, values, lazy);+ },++ /**+ * <p>+ * Adds an attribute with the provided configuration to the host object.+ * </p>+ * <p>+ * The config argument object supports the following properties:+ * </p>+ * + * <dl>+ * <dt>value <Any></dt>+ * <dd>The initial value to set on the attribute</dd>+ *+ * <dt>valueFn <Function | String></dt>+ * <dd>+ * <p>A function, which will return the initial value to set on the attribute. This is useful+ * for cases where the attribute configuration is defined statically, but needs to + * reference the host instance ("this") to obtain an initial value. If both the value and valueFn properties are defined, + * the value returned by the valueFn has precedence over the value property, unless it returns undefined, in which + * case the value property is used.</p>+ *+ * <p>valueFn can also be set to a string, representing the name of the instance method to be used to retrieve the value.</p>+ * </dd>+ *+ * <dt>readOnly <boolean></dt>+ * <dd>Whether or not the attribute is read only. Attributes having readOnly set to true+ * cannot be modified by invoking the set method.</dd>+ *+ * <dt>writeOnce <boolean> or <string></dt>+ * <dd>+ * Whether or not the attribute is "write once". Attributes having writeOnce set to true, + * can only have their values set once, be it through the default configuration, + * constructor configuration arguments, or by invoking set.+ * <p>The writeOnce attribute can also be set to the string "initOnly", in which case the attribute can only be set during initialization+ * (when used with Base, this means it can only be set during construction)</p>+ * </dd>+ *+ * <dt>setter <Function | String></dt>+ * <dd>+ * <p>The setter function used to massage or normalize the value passed to the set method for the attribute. + * The value returned by the setter will be the final stored value. Returning+ * <a href="#property_Attribute.INVALID_VALUE">Attribute.INVALID_VALUE</a>, from the setter will prevent+ * the value from being stored.+ * </p>+ * + * <p>setter can also be set to a string, representing the name of the instance method to be used as the setter function.</p>+ * </dd>+ * + * <dt>getter <Function | String></dt>+ * <dd>+ * <p>+ * The getter function used to massage or normalize the value returned by the get method for the attribute.+ * The value returned by the getter function is the value which will be returned to the user when they + * invoke get.+ * </p>+ *+ * <p>getter can also be set to a string, representing the name of the instance method to be used as the getter function.</p>+ * </dd>+ *+ * <dt>validator <Function | String></dt>+ * <dd>+ * <p>+ * The validator function invoked prior to setting the stored value. Returning+ * false from the validator function will prevent the value from being stored.+ * </p>+ * + * <p>validator can also be set to a string, representing the name of the instance method to be used as the validator function.</p>+ * </dd>+ *+ * <dt>lazyAdd <boolean></dt>+ * <dd>Whether or not to delay initialization of the attribute until the first call to get/set it. + * This flag can be used to over-ride lazy initialization on a per attribute basis, when adding multiple attributes through + * the <a href="#method_addAttrs">addAttrs</a> method.</dd>+ *+ * </dl>+ *+ * <p>The setter, getter and validator are invoked with the value and name passed in as the first and second arguments, and with+ * the context ("this") set to the host object.</p>+ *+ * <p>Configuration properties outside of the list mentioned above are considered private properties used internally by attribute, + * and are not intended for public use.</p>+ * + * @method addAttr+ *+ * @param {String} name The name of the attribute.+ * @param {Object} config An object with attribute configuration property/value pairs, specifying the configuration for the attribute.+ *+ * <p>+ * <strong>NOTE:</strong> The configuration object is modified when adding an attribute, so if you need + * to protect the original values, you will need to merge the object.+ * </p>+ *+ * @param {boolean} lazy (optional) Whether or not to add this attribute lazily (on the first call to get/set). + *+ * @return {Object} A reference to the host object.+ *+ * @chainable+ */+ addAttr: function(name, config, lazy) {+++ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "addAttr", 370);+_yuitest_coverline("build/attribute-core/attribute-core.js", 373);+var host = this, // help compression+ state = host._state,+ value,+ hasValue;++ _yuitest_coverline("build/attribute-core/attribute-core.js", 378);+config = config || {};++ _yuitest_coverline("build/attribute-core/attribute-core.js", 380);+lazy = (LAZY_ADD in config) ? config[LAZY_ADD] : lazy;++ _yuitest_coverline("build/attribute-core/attribute-core.js", 382);+if (lazy && !host.attrAdded(name)) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 383);+state.addAll(name, {+ lazy : config,+ added : true+ });+ } else {+++ _yuitest_coverline("build/attribute-core/attribute-core.js", 390);+if (!host.attrAdded(name) || state.get(name, IS_LAZY_ADD)) {++ _yuitest_coverline("build/attribute-core/attribute-core.js", 392);+hasValue = (VALUE in config);+++ _yuitest_coverline("build/attribute-core/attribute-core.js", 395);+if (hasValue) {+ // We'll go through set, don't want to set value in config directly+ _yuitest_coverline("build/attribute-core/attribute-core.js", 397);+value = config.value;+ _yuitest_coverline("build/attribute-core/attribute-core.js", 398);+delete config.value;+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 401);+config.added = true;+ _yuitest_coverline("build/attribute-core/attribute-core.js", 402);+config.initializing = true;++ _yuitest_coverline("build/attribute-core/attribute-core.js", 404);+state.addAll(name, config);++ _yuitest_coverline("build/attribute-core/attribute-core.js", 406);+if (hasValue) {+ // Go through set, so that raw values get normalized/validated+ _yuitest_coverline("build/attribute-core/attribute-core.js", 408);+host.set(name, value);+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 411);+state.remove(name, INITIALIZING);+ }+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 415);+return host;+ },++ /**+ * Checks if the given attribute has been added to the host+ *+ * @method attrAdded+ * @param {String} name The name of the attribute to check.+ * @return {boolean} true if an attribute with the given name has been added, false if it hasn't. This method will return true for lazily added attributes.+ */+ attrAdded: function(name) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "attrAdded", 425);+_yuitest_coverline("build/attribute-core/attribute-core.js", 426);+return !!this._state.get(name, ADDED);+ },++ /**+ * Returns the current value of the attribute. If the attribute+ * has been configured with a 'getter' function, this method will delegate+ * to the 'getter' to obtain the value of the attribute.+ *+ * @method get+ *+ * @param {String} name The name of the attribute. If the value of the attribute is an Object, + * dot notation can be used to obtain the value of a property of the object (e.g. <code>get("x.y.z")</code>)+ *+ * @return {Any} The value of the attribute+ */+ get : function(name) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "get", 441);+_yuitest_coverline("build/attribute-core/attribute-core.js", 442);+return this._getAttr(name);+ },++ /**+ * Checks whether or not the attribute is one which has been+ * added lazily and still requires initialization.+ *+ * @method _isLazyAttr+ * @private+ * @param {String} name The name of the attribute+ * @return {boolean} true if it's a lazily added attribute, false otherwise.+ */+ _isLazyAttr: function(name) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "_isLazyAttr", 454);+_yuitest_coverline("build/attribute-core/attribute-core.js", 455);+return this._state.get(name, LAZY);+ },++ /**+ * Finishes initializing an attribute which has been lazily added.+ *+ * @method _addLazyAttr+ * @private+ * @param {Object} name The name of the attribute+ */+ _addLazyAttr: function(name, cfg) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "_addLazyAttr", 465);+_yuitest_coverline("build/attribute-core/attribute-core.js", 466);+var state = this._state,+ lazyCfg = state.get(name, LAZY);++ _yuitest_coverline("build/attribute-core/attribute-core.js", 469);+state.add(name, IS_LAZY_ADD, true);+ _yuitest_coverline("build/attribute-core/attribute-core.js", 470);+state.remove(name, LAZY);+ _yuitest_coverline("build/attribute-core/attribute-core.js", 471);+this.addAttr(name, lazyCfg);+ },++ /**+ * Sets the value of an attribute.+ *+ * @method set+ * @chainable+ *+ * @param {String} name The name of the attribute. If the + * current value of the attribute is an Object, dot notation can be used+ * to set the value of a property within the object (e.g. <code>set("x.y.z", 5)</code>).+ *+ * @param {Any} value The value to set the attribute to.+ *+ * @return {Object} A reference to the host object.+ */+ set : function(name, val) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "set", 488);+_yuitest_coverline("build/attribute-core/attribute-core.js", 489);+return this._setAttr(name, val);+ },++ /**+ * Allows setting of readOnly/writeOnce attributes. See <a href="#method_set">set</a> for argument details.+ *+ * @method _set+ * @protected+ * @chainable+ * + * @param {String} name The name of the attribute.+ * @param {Any} val The value to set the attribute to.+ * @return {Object} A reference to the host object.+ */+ _set : function(name, val) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "_set", 503);+_yuitest_coverline("build/attribute-core/attribute-core.js", 504);+return this._setAttr(name, val, null, true);+ },++ /**+ * Provides the common implementation for the public set and protected _set methods.+ *+ * See <a href="#method_set">set</a> for argument details.+ *+ * @method _setAttr+ * @protected+ * @chainable+ *+ * @param {String} name The name of the attribute.+ * @param {Any} value The value to set the attribute to.+ * @param {Object} opts (Optional) Optional event data to be mixed into+ * the event facade passed to subscribers of the attribute's change event.+ * This is currently a hack. There's no real need for the AttributeCore implementation+ * to support this parameter, but breaking it out into AttributeEvents, results in+ * additional function hops for the critical path.+ * @param {boolean} force If true, allows the caller to set values for + * readOnly or writeOnce attributes which have already been set.+ *+ * @return {Object} A reference to the host object.+ */+ _setAttr : function(name, val, opts, force) {+ + // HACK - no real reason core needs to know about opts, but + // it adds fn hops if we want to break it out. + // Not sure it's worth it for this critical path+ + _yuitest_coverfunc("build/attribute-core/attribute-core.js", "_setAttr", 528);+_yuitest_coverline("build/attribute-core/attribute-core.js", 534);+var allowSet = true,+ state = this._state,+ stateProxy = this._stateProxy,+ cfg,+ initialSet,+ strPath,+ path,+ currVal,+ writeOnce,+ initializing;++ _yuitest_coverline("build/attribute-core/attribute-core.js", 545);+if (name.indexOf(DOT) !== -1) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 546);+strPath = name;+ _yuitest_coverline("build/attribute-core/attribute-core.js", 547);+path = name.split(DOT);+ _yuitest_coverline("build/attribute-core/attribute-core.js", 548);+name = path.shift();+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 551);+if (this._isLazyAttr(name)) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 552);+this._addLazyAttr(name);+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 555);+cfg = state.getAll(name, true) || {}; ++ _yuitest_coverline("build/attribute-core/attribute-core.js", 557);+initialSet = (!(VALUE in cfg));++ _yuitest_coverline("build/attribute-core/attribute-core.js", 559);+if (stateProxy && name in stateProxy && !cfg._bypassProxy) {+ // TODO: Value is always set for proxy. Can we do any better? Maybe take a snapshot as the initial value for the first call to set? + _yuitest_coverline("build/attribute-core/attribute-core.js", 561);+initialSet = false;+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 564);+writeOnce = cfg.writeOnce;+ _yuitest_coverline("build/attribute-core/attribute-core.js", 565);+initializing = cfg.initializing;++ _yuitest_coverline("build/attribute-core/attribute-core.js", 567);+if (!initialSet && !force) {++ _yuitest_coverline("build/attribute-core/attribute-core.js", 569);+if (writeOnce) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 570);+allowSet = false;+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 573);+if (cfg.readOnly) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 574);+allowSet = false;+ }+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 578);+if (!initializing && !force && writeOnce === INIT_ONLY) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 579);+allowSet = false;+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 582);+if (allowSet) {+ // Don't need currVal if initialSet (might fail in custom getter if it always expects a non-undefined/non-null value)+ _yuitest_coverline("build/attribute-core/attribute-core.js", 584);+if (!initialSet) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 585);+currVal = this.get(name);+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 588);+if (path) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 589);+val = O.setValue(Y.clone(currVal), path, val);++ _yuitest_coverline("build/attribute-core/attribute-core.js", 591);+if (val === undefined) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 592);+allowSet = false;+ }+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 596);+if (allowSet) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 597);+if (!this._fireAttrChange || initializing) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 598);+this._setAttrVal(name, strPath, currVal, val);+ } else {+ // HACK - no real reason core needs to know about _fireAttrChange, but + // it adds fn hops if we want to break it out. Not sure it's worth it for this critical path+ _yuitest_coverline("build/attribute-core/attribute-core.js", 602);+this._fireAttrChange(name, strPath, currVal, val, opts);+ }+ }+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 607);+return this;+ },++ /**+ * Provides the common implementation for the public get method,+ * allowing Attribute hosts to over-ride either method.+ *+ * See <a href="#method_get">get</a> for argument details.+ *+ * @method _getAttr+ * @protected+ * @chainable+ *+ * @param {String} name The name of the attribute.+ * @return {Any} The value of the attribute.+ */+ _getAttr : function(name) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "_getAttr", 623);+_yuitest_coverline("build/attribute-core/attribute-core.js", 624);+var host = this, // help compression+ fullName = name,+ state = host._state,+ path,+ getter,+ val,+ cfg;++ _yuitest_coverline("build/attribute-core/attribute-core.js", 632);+if (name.indexOf(DOT) !== -1) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 633);+path = name.split(DOT);+ _yuitest_coverline("build/attribute-core/attribute-core.js", 634);+name = path.shift();+ }++ // On Demand - Should be rare - handles out of order valueFn references+ _yuitest_coverline("build/attribute-core/attribute-core.js", 638);+if (host._tCfgs && host._tCfgs[name]) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 639);+cfg = {};+ _yuitest_coverline("build/attribute-core/attribute-core.js", 640);+cfg[name] = host._tCfgs[name];+ _yuitest_coverline("build/attribute-core/attribute-core.js", 641);+delete host._tCfgs[name];+ _yuitest_coverline("build/attribute-core/attribute-core.js", 642);+host._addAttrs(cfg, host._tVals);+ }+ + // Lazy Init+ _yuitest_coverline("build/attribute-core/attribute-core.js", 646);+if (host._isLazyAttr(name)) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 647);+host._addLazyAttr(name);+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 650);+val = host._getStateVal(name);+ + _yuitest_coverline("build/attribute-core/attribute-core.js", 652);+getter = state.get(name, GETTER);++ _yuitest_coverline("build/attribute-core/attribute-core.js", 654);+if (getter && !getter.call) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 655);+getter = this[getter];+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 658);+val = (getter) ? getter.call(host, val, fullName) : val;+ _yuitest_coverline("build/attribute-core/attribute-core.js", 659);+val = (path) ? O.getValue(val, path) : val;++ _yuitest_coverline("build/attribute-core/attribute-core.js", 661);+return val;+ },++ /**+ * Gets the stored value for the attribute, from either the + * internal state object, or the state proxy if it exits+ * + * @method _getStateVal+ * @private+ * @param {String} name The name of the attribute+ * @return {Any} The stored value of the attribute+ */+ _getStateVal : function(name) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "_getStateVal", 673);+_yuitest_coverline("build/attribute-core/attribute-core.js", 674);+var stateProxy = this._stateProxy;+ _yuitest_coverline("build/attribute-core/attribute-core.js", 675);+return stateProxy && (name in stateProxy) && !this._state.get(name, BYPASS_PROXY) ? stateProxy[name] : this._state.get(name, VALUE);+ },++ /**+ * Sets the stored value for the attribute, in either the + * internal state object, or the state proxy if it exits+ *+ * @method _setStateVal+ * @private+ * @param {String} name The name of the attribute+ * @param {Any} value The value of the attribute+ */+ _setStateVal : function(name, value) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "_setStateVal", 687);+_yuitest_coverline("build/attribute-core/attribute-core.js", 688);+var stateProxy = this._stateProxy;+ _yuitest_coverline("build/attribute-core/attribute-core.js", 689);+if (stateProxy && (name in stateProxy) && !this._state.get(name, BYPASS_PROXY)) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 690);+stateProxy[name] = value;+ } else {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 692);+this._state.add(name, VALUE, value);+ }+ },++ /**+ * Updates the stored value of the attribute in the privately held State object,+ * if validation and setter passes.+ *+ * @method _setAttrVal+ * @private+ * @param {String} attrName The attribute name.+ * @param {String} subAttrName The sub-attribute name, if setting a sub-attribute property ("x.y.z").+ * @param {Any} prevVal The currently stored value of the attribute.+ * @param {Any} newVal The value which is going to be stored.+ * + * @return {booolean} true if the new attribute value was stored, false if not.+ */+ _setAttrVal : function(attrName, subAttrName, prevVal, newVal) {++ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "_setAttrVal", 709);+_yuitest_coverline("build/attribute-core/attribute-core.js", 711);+var host = this,+ allowSet = true,+ cfg = this._state.getAll(attrName, true) || {},+ validator = cfg.validator,+ setter = cfg.setter,+ initializing = cfg.initializing,+ prevRawVal = this._getStateVal(attrName),+ name = subAttrName || attrName,+ retVal,+ valid;++ _yuitest_coverline("build/attribute-core/attribute-core.js", 722);+if (validator) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 723);+if (!validator.call) { + // Assume string - trying to keep critical path tight, so avoiding Lang check+ _yuitest_coverline("build/attribute-core/attribute-core.js", 725);+validator = this[validator];+ }+ _yuitest_coverline("build/attribute-core/attribute-core.js", 727);+if (validator) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 728);+valid = validator.call(host, newVal, name);++ _yuitest_coverline("build/attribute-core/attribute-core.js", 730);+if (!valid && initializing) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 731);+newVal = cfg.defaultValue;+ _yuitest_coverline("build/attribute-core/attribute-core.js", 732);+valid = true; // Assume it's valid, for perf.+ }+ }+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 737);+if (!validator || valid) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 738);+if (setter) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 739);+if (!setter.call) {+ // Assume string - trying to keep critical path tight, so avoiding Lang check+ _yuitest_coverline("build/attribute-core/attribute-core.js", 741);+setter = this[setter];+ }+ _yuitest_coverline("build/attribute-core/attribute-core.js", 743);+if (setter) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 744);+retVal = setter.call(host, newVal, name);++ _yuitest_coverline("build/attribute-core/attribute-core.js", 746);+if (retVal === INVALID_VALUE) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 747);+allowSet = false;+ } else {_yuitest_coverline("build/attribute-core/attribute-core.js", 748);+if (retVal !== undefined){+ _yuitest_coverline("build/attribute-core/attribute-core.js", 749);+newVal = retVal;+ }}+ }+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 754);+if (allowSet) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 755);+if(!subAttrName && (newVal === prevRawVal) && !Lang.isObject(newVal)) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 756);+allowSet = false;+ } else {+ // Store value+ _yuitest_coverline("build/attribute-core/attribute-core.js", 759);+if (!(INIT_VALUE in cfg)) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 760);+cfg.initValue = newVal;+ }+ _yuitest_coverline("build/attribute-core/attribute-core.js", 762);+host._setStateVal(attrName, newVal);+ }+ }++ } else {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 767);+allowSet = false;+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 770);+return allowSet;+ },++ /**+ * Sets multiple attribute values.+ *+ * @method setAttrs+ * @param {Object} attrs An object with attributes name/value pairs.+ * @return {Object} A reference to the host object.+ * @chainable+ */+ setAttrs : function(attrs) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "setAttrs", 781);+_yuitest_coverline("build/attribute-core/attribute-core.js", 782);+return this._setAttrs(attrs);+ },++ /**+ * Implementation behind the public setAttrs method, to set multiple attribute values.+ *+ * @method _setAttrs+ * @protected+ * @param {Object} attrs An object with attributes name/value pairs.+ * @return {Object} A reference to the host object.+ * @chainable+ */+ _setAttrs : function(attrs) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "_setAttrs", 794);+_yuitest_coverline("build/attribute-core/attribute-core.js", 795);+var attr;+ _yuitest_coverline("build/attribute-core/attribute-core.js", 796);+for (attr in attrs) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 797);+if ( attrs.hasOwnProperty(attr) ) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 798);+this.set(attr, attrs[attr]);+ }+ }+ _yuitest_coverline("build/attribute-core/attribute-core.js", 801);+return this;+ },++ /**+ * Gets multiple attribute values.+ *+ * @method getAttrs+ * @param {Array | boolean} attrs Optional. An array of attribute names. If omitted, all attribute values are+ * returned. If set to true, all attributes modified from their initial values are returned.+ * @return {Object} An object with attribute name/value pairs.+ */+ getAttrs : function(attrs) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "getAttrs", 812);+_yuitest_coverline("build/attribute-core/attribute-core.js", 813);+return this._getAttrs(attrs);+ },++ /**+ * Implementation behind the public getAttrs method, to get multiple attribute values.+ *+ * @method _getAttrs+ * @protected+ * @param {Array | boolean} attrs Optional. An array of attribute names. If omitted, all attribute values are+ * returned. If set to true, all attributes modified from their initial values are returned.+ * @return {Object} An object with attribute name/value pairs.+ */+ _getAttrs : function(attrs) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "_getAttrs", 825);+_yuitest_coverline("build/attribute-core/attribute-core.js", 826);+var obj = {},+ attr, i, len,+ modifiedOnly = (attrs === true);++ // TODO - figure out how to get all "added"+ _yuitest_coverline("build/attribute-core/attribute-core.js", 831);+if (!attrs || modifiedOnly) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 832);+attrs = O.keys(this._state.data);+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 835);+for (i = 0, len = attrs.length; i < len; i++) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 836);+attr = attrs[i];++ _yuitest_coverline("build/attribute-core/attribute-core.js", 838);+if (!modifiedOnly || this._getStateVal(attr) != this._state.get(attr, INIT_VALUE)) {+ // Go through get, to honor cloning/normalization+ _yuitest_coverline("build/attribute-core/attribute-core.js", 840);+obj[attr] = this.get(attr);+ }+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 844);+return obj;+ },++ /**+ * Configures a group of attributes, and sets initial values.+ *+ * <p>+ * <strong>NOTE:</strong> This method does not isolate the configuration object by merging/cloning. + * The caller is responsible for merging/cloning the configuration object if required.+ * </p>+ *+ * @method addAttrs+ * @chainable+ *+ * @param {Object} cfgs An object with attribute name/configuration pairs.+ * @param {Object} values An object with attribute name/value pairs, defining the initial values to apply.+ * Values defined in the cfgs argument will be over-written by values in this argument unless defined as read only.+ * @param {boolean} lazy Whether or not to delay the intialization of these attributes until the first call to get/set.+ * Individual attributes can over-ride this behavior by defining a lazyAdd configuration property in their configuration.+ * See <a href="#method_addAttr">addAttr</a>.+ * + * @return {Object} A reference to the host object.+ */+ addAttrs : function(cfgs, values, lazy) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "addAttrs", 867);+_yuitest_coverline("build/attribute-core/attribute-core.js", 868);+var host = this; // help compression+ _yuitest_coverline("build/attribute-core/attribute-core.js", 869);+if (cfgs) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 870);+host._tCfgs = cfgs;+ _yuitest_coverline("build/attribute-core/attribute-core.js", 871);+host._tVals = host._normAttrVals(values);+ _yuitest_coverline("build/attribute-core/attribute-core.js", 872);+host._addAttrs(cfgs, host._tVals, lazy);+ _yuitest_coverline("build/attribute-core/attribute-core.js", 873);+host._tCfgs = host._tVals = null;+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 876);+return host;+ },++ /**+ * Implementation behind the public addAttrs method. + * + * This method is invoked directly by get if it encounters a scenario + * in which an attribute's valueFn attempts to obtain the + * value an attribute in the same group of attributes, which has not yet + * been added (on demand initialization).+ *+ * @method _addAttrs+ * @private+ * @param {Object} cfgs An object with attribute name/configuration pairs.+ * @param {Object} values An object with attribute name/value pairs, defining the initial values to apply.+ * Values defined in the cfgs argument will be over-written by values in this argument unless defined as read only.+ * @param {boolean} lazy Whether or not to delay the intialization of these attributes until the first call to get/set.+ * Individual attributes can over-ride this behavior by defining a lazyAdd configuration property in their configuration.+ * See <a href="#method_addAttr">addAttr</a>.+ */+ _addAttrs : function(cfgs, values, lazy) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "_addAttrs", 896);+_yuitest_coverline("build/attribute-core/attribute-core.js", 897);+var host = this, // help compression+ attr,+ attrCfg,+ value;++ _yuitest_coverline("build/attribute-core/attribute-core.js", 902);+for (attr in cfgs) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 903);+if (cfgs.hasOwnProperty(attr)) {++ // Not Merging. Caller is responsible for isolating configs+ _yuitest_coverline("build/attribute-core/attribute-core.js", 906);+attrCfg = cfgs[attr];+ _yuitest_coverline("build/attribute-core/attribute-core.js", 907);+attrCfg.defaultValue = attrCfg.value;++ // Handle simple, complex and user values, accounting for read-only+ _yuitest_coverline("build/attribute-core/attribute-core.js", 910);+value = host._getAttrInitVal(attr, attrCfg, host._tVals);++ _yuitest_coverline("build/attribute-core/attribute-core.js", 912);+if (value !== undefined) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 913);+attrCfg.value = value;+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 916);+if (host._tCfgs[attr]) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 917);+delete host._tCfgs[attr];+ }++ _yuitest_coverline("build/attribute-core/attribute-core.js", 920);+host.addAttr(attr, attrCfg, lazy);+ }+ }+ },++ /**+ * Utility method to protect an attribute configuration+ * hash, by merging the entire object and the individual + * attr config objects. + *+ * @method _protectAttrs+ * @protected+ * @param {Object} attrs A hash of attribute to configuration object pairs.+ * @return {Object} A protected version of the attrs argument.+ */+ _protectAttrs : function(attrs) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "_protectAttrs", 935);+_yuitest_coverline("build/attribute-core/attribute-core.js", 936);+if (attrs) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 937);+attrs = Y.merge(attrs);+ _yuitest_coverline("build/attribute-core/attribute-core.js", 938);+for (var attr in attrs) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 939);+if (attrs.hasOwnProperty(attr)) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 940);+attrs[attr] = Y.merge(attrs[attr]);+ }+ }+ }+ _yuitest_coverline("build/attribute-core/attribute-core.js", 944);+return attrs;+ },++ /**+ * Utility method to normalize attribute values. The base implementation + * simply merges the hash to protect the original.+ *+ * @method _normAttrVals+ * @param {Object} valueHash An object with attribute name/value pairs+ *+ * @return {Object}+ *+ * @private+ */+ _normAttrVals : function(valueHash) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "_normAttrVals", 958);+_yuitest_coverline("build/attribute-core/attribute-core.js", 959);+return (valueHash) ? Y.merge(valueHash) : null;+ },++ /**+ * Returns the initial value of the given attribute from+ * either the default configuration provided, or the + * over-ridden value if it exists in the set of initValues + * provided and the attribute is not read-only.+ *+ * @param {String} attr The name of the attribute+ * @param {Object} cfg The attribute configuration object+ * @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals+ *+ * @return {Any} The initial value of the attribute.+ *+ * @method _getAttrInitVal+ * @private+ */+ _getAttrInitVal : function(attr, cfg, initValues) {+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "_getAttrInitVal", 977);+_yuitest_coverline("build/attribute-core/attribute-core.js", 978);+var val, valFn;+ // init value is provided by the user if it exists, else, provided by the config+ _yuitest_coverline("build/attribute-core/attribute-core.js", 980);+if (!cfg.readOnly && initValues && initValues.hasOwnProperty(attr)) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 981);+val = initValues[attr];+ } else {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 983);+val = cfg.value;+ _yuitest_coverline("build/attribute-core/attribute-core.js", 984);+valFn = cfg.valueFn;+ + _yuitest_coverline("build/attribute-core/attribute-core.js", 986);+if (valFn) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 987);+if (!valFn.call) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 988);+valFn = this[valFn];+ }+ _yuitest_coverline("build/attribute-core/attribute-core.js", 990);+if (valFn) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 991);+val = valFn.call(this, attr);+ }+ }+ }+++ _yuitest_coverline("build/attribute-core/attribute-core.js", 997);+return val;+ },++ /**+ * Utility method to set up initial attributes defined during construction, either through the constructor.ATTRS property, or explicitly passed in.+ * + * @method _initAttrs+ * @protected+ * @param attrs {Object} The attributes to add during construction (passed through to <a href="#method_addAttrs">addAttrs</a>). These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor.+ * @param values {Object} The initial attribute values to apply (passed through to <a href="#method_addAttrs">addAttrs</a>). These are not merged/cloned. The caller is responsible for isolating user provided values if required.+ * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href="#method_addAttrs">addAttrs</a>).+ */+ _initAttrs : function(attrs, values, lazy) {+ // ATTRS support for Node, which is not Base based+ _yuitest_coverfunc("build/attribute-core/attribute-core.js", "_initAttrs", 1009);+_yuitest_coverline("build/attribute-core/attribute-core.js", 1011);+attrs = attrs || this.constructor.ATTRS;+ + _yuitest_coverline("build/attribute-core/attribute-core.js", 1013);+var Base = Y.Base,+ BaseCore = Y.BaseCore,+ baseInst = (Base && Y.instanceOf(this, Base)),+ baseCoreInst = (!baseInst && BaseCore && Y.instanceOf(this, BaseCore));++ _yuitest_coverline("build/attribute-core/attribute-core.js", 1018);+if ( attrs && !baseInst && !baseCoreInst) {+ _yuitest_coverline("build/attribute-core/attribute-core.js", 1019);+this.addAttrs(this._protectAttrs(attrs), values, lazy);+ }+ }+ };++ _yuitest_coverline("build/attribute-core/attribute-core.js", 1024);+Y.AttributeCore = AttributeCore;+++}, '3.7.1', {"requires": ["oop"]});
@@ -1,17 +1,17 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('attribute-core', function(Y) {+YUI.add('attribute-core', function (Y, NAME) { /**- * The State class maintains state for a collection of named items, with + * The State class maintains state for a collection of named items, with * a varying number of properties defined. *- * It avoids the need to create a separate class for the item, and separate instances - * of these classes for each item, by storing the state in a 2 level hash table, + * It avoids the need to create a separate class for the item, and separate instances+ * of these classes for each item, by storing the state in a 2 level hash table, * improving performance when the number of items is likely to be large. * * @constructor@@ -35,10 +35,14 @@ * @param key {String} The name of the property. * @param val {Any} The value of the property. */- add : function(name, key, val) {- var d = this.data;- d[name] = d[name] || {};- d[name][key] = val;+ add: function(name, key, val) {+ var item = this.data[name];++ if (!item) {+ item = this.data[name] = {};+ }++ item[key] = val; }, /**@@ -46,14 +50,19 @@ * * @method addAll * @param name {String} The name of the item.- * @param o {Object} A hash of property/value pairs.+ * @param obj {Object} A hash of property/value pairs. */- addAll: function(name, o) {- var key;+ addAll: function(name, obj) {+ var item = this.data[name],+ key; - for (key in o) {- if (o.hasOwnProperty(key)) {- this.add(name, key, o[key]);+ if (!item) {+ item = this.data[name] = {};+ }++ for (key in obj) {+ if (obj.hasOwnProperty(key)) {+ item[key] = obj[key]; } } },@@ -66,33 +75,32 @@ * @param key {String} The property to remove. */ remove: function(name, key) {- var d = this.data;- if (d[name]) {- delete d[name][key];+ var item = this.data[name];++ if (item) {+ delete item[key]; } }, /**- * Removes multiple properties from an item, or remove the item completely.+ * Removes multiple properties from an item, or removes the item completely. * * @method removeAll * @param name {String} The name of the item.- * @param o {Object|Array} Collection of properties to delete. If not provided, the entire item is removed.+ * @param obj {Object|Array} Collection of properties to delete. If not provided, the entire item is removed. */- removeAll: function(name, o) {- var d = this.data;+ removeAll: function(name, obj) {+ var data; - if (!o) {- if (d[name]) {- delete d[name];+ if (!obj) {+ data = this.data;++ if (name in data) {+ delete data[name]; } } else {- Y.each(o, function(v, k) {- if(Y.Lang.isString(k)) {- this.remove(name, k);- } else {- this.remove(name, v);- }+ Y.each(obj, function(value, key) {+ this.remove(name, typeof key === 'string' ? key : value); }, this); } },@@ -106,8 +114,11 @@ * @return {Any} The value of the supplied property. */ get: function(name, key) {- var d = this.data;- return (d[name]) ? d[name][key] : undefined;+ var item = this.data[name];++ if (item) {+ return item[key];+ } }, /**@@ -120,22 +131,26 @@ * @method getAll * @param name {String} The name of the item * @param reference {boolean} true, if you want a reference to the stored- * object + * object * @return {Object} An object with property/value pairs for the item. */ getAll : function(name, reference) {- var d = this.data, o;+ var item = this.data[name],+ key, obj; - if (!reference) {- Y.each(d[name], function(v, k) {- o = o || {};- o[k] = v;- });- } else {- o = d[name];+ if (reference) {+ obj = item;+ } else if (item) {+ obj = {};++ for (key in item) {+ if (item.hasOwnProperty(key)) {+ obj[key] = item[key];+ }+ } } - return o;+ return obj; } }; /**@@ -513,7 +528,7 @@ * the event facade passed to subscribers of the attribute's change event. * This is currently a hack. There's no real need for the AttributeCore implementation * to support this parameter, but breaking it out into AttributeEvents, results in- * additional function hops for the critical path. May change in 3.5.0 PR3.+ * additional function hops for the critical path. * @param {boolean} force If true, allows the caller to set values for * readOnly or writeOnce attributes which have already been set. *@@ -794,7 +809,8 @@ * @chainable */ _setAttrs : function(attrs) {- for (var attr in attrs) {+ var attr;+ for (attr in attrs) { if ( attrs.hasOwnProperty(attr) ) { this.set(attr, attrs[attr]); }@@ -824,25 +840,25 @@ * @return {Object} An object with attribute name/value pairs. */ _getAttrs : function(attrs) {- var host = this,- o = {}, - i, l, attr, val,+ var obj = {},+ attr, i, len, modifiedOnly = (attrs === true); // TODO - figure out how to get all "added"- attrs = (attrs && !modifiedOnly) ? attrs : O.keys(host._state.data);+ if (!attrs || modifiedOnly) {+ attrs = O.keys(this._state.data);+ } - for (i = 0, l = attrs.length; i < l; i++) {- // Go through get, to honor cloning/normalization+ for (i = 0, len = attrs.length; i < len; i++) { attr = attrs[i];- val = host.get(attr); - if (!modifiedOnly || host._getStateVal(attr) != host._state.get(attr, INIT_VALUE)) {- o[attr] = host.get(attr); + if (!modifiedOnly || this._getStateVal(attr) != this._state.get(attr, INIT_VALUE)) {+ // Go through get, to honor cloning/normalization+ obj[attr] = this.get(attr); } } - return o;+ return obj; }, /**@@ -1026,4 +1042,4 @@ Y.AttributeCore = AttributeCore; -}, '3.5.1' );+}, '3.7.1', {"requires": ["oop"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("attribute-core",function(c){c.State=function(){this.data={};};c.State.prototype={add:function(v,w,y){var x=this.data;x[v]=x[v]||{};x[v][w]=y;},addAll:function(v,x){var w;for(w in x){if(x.hasOwnProperty(w)){this.add(v,w,x[w]);}}},remove:function(v,w){var x=this.data;if(x[v]){delete x[v][w];}},removeAll:function(v,x){var w=this.data;if(!x){if(w[v]){delete w[v];}}else{c.each(x,function(z,y){if(c.Lang.isString(y)){this.remove(v,y);}else{this.remove(v,z);}},this);}},get:function(v,w){var x=this.data;return(x[v])?x[v][w]:undefined;},getAll:function(w,v){var y=this.data,x;if(!v){c.each(y[w],function(A,z){x=x||{};x[z]=A;});}else{x=y[w];}return x;}};var i=c.Object,d=c.Lang,q=".",k="getter",j="setter",l="readOnly",r="writeOnce",p="initOnly",u="validator",f="value",m="valueFn",o="lazyAdd",t="added",h="_bypassProxy",b="initializing",g="initValue",a="lazy",n="isLazyAdd",e;function s(w,v,x){this._initAttrHost(w,v,x);}s.INVALID_VALUE={};e=s.INVALID_VALUE;s._ATTR_CFG=[j,k,u,f,m,r,l,o,h];s.prototype={_initAttrHost:function(w,v,x){this._state=new c.State();this._initAttrs(w,v,x);},addAttr:function(w,v,y){var z=this,B=z._state,A,x;v=v||{};y=(o in v)?v[o]:y;if(y&&!z.attrAdded(w)){B.addAll(w,{lazy:v,added:true});}else{if(!z.attrAdded(w)||B.get(w,n)){x=(f in v);if(x){A=v.value;delete v.value;}v.added=true;v.initializing=true;B.addAll(w,v);if(x){z.set(w,A);}B.remove(w,b);}}return z;},attrAdded:function(v){return !!this._state.get(v,t);},get:function(v){return this._getAttr(v);},_isLazyAttr:function(v){return this._state.get(v,a);},_addLazyAttr:function(x,v){var y=this._state,w=y.get(x,a);y.add(x,n,true);y.remove(x,a);this.addAttr(x,w);},set:function(v,w){return this._setAttr(v,w);},_set:function(v,w){return this._setAttr(v,w,null,true);},_setAttr:function(x,A,v,y){var E=true,w=this._state,B=this._stateProxy,H,D,G,I,z,C,F;if(x.indexOf(q)!==-1){G=x;I=x.split(q);x=I.shift();}if(this._isLazyAttr(x)){this._addLazyAttr(x);}H=w.getAll(x,true)||{};D=(!(f in H));if(B&&x in B&&!H._bypassProxy){D=false;}C=H.writeOnce;F=H.initializing;if(!D&&!y){if(C){E=false;}if(H.readOnly){E=false;}}if(!F&&!y&&C===p){E=false;}if(E){if(!D){z=this.get(x);}if(I){A=i.setValue(c.clone(z),I,A);if(A===undefined){E=false;}}if(E){if(!this._fireAttrChange||F){this._setAttrVal(x,G,z,A);}else{this._fireAttrChange(x,G,z,A,v);}}}return this;},_getAttr:function(x){var y=this,C=x,z=y._state,A,v,B,w;if(x.indexOf(q)!==-1){A=x.split(q);x=A.shift();}if(y._tCfgs&&y._tCfgs[x]){w={};w[x]=y._tCfgs[x];delete y._tCfgs[x];y._addAttrs(w,y._tVals);}if(y._isLazyAttr(x)){y._addLazyAttr(x);}B=y._getStateVal(x);v=z.get(x,k);if(v&&!v.call){v=this[v];}B=(v)?v.call(y,B,C):B;B=(A)?i.getValue(B,A):B;return B;},_getStateVal:function(v){var w=this._stateProxy;return w&&(v in w)&&!this._state.get(v,h)?w[v]:this._state.get(v,f);},_setStateVal:function(v,x){var w=this._stateProxy;if(w&&(v in w)&&!this._state.get(v,h)){w[v]=x;}else{this._state.add(v,f,x);}},_setAttrVal:function(H,G,C,A){var I=this,D=true,F=this._state.getAll(H,true)||{},y=F.validator,B=F.setter,E=F.initializing,x=this._getStateVal(H),w=G||H,z,v;if(y){if(!y.call){y=this[y];}if(y){v=y.call(I,A,w);if(!v&&E){A=F.defaultValue;v=true;}}}if(!y||v){if(B){if(!B.call){B=this[B];}if(B){z=B.call(I,A,w);if(z===e){D=false;}else{if(z!==undefined){A=z;}}}}if(D){if(!G&&(A===x)&&!d.isObject(A)){D=false;}else{if(!(g in F)){F.initValue=A;}I._setStateVal(H,A);}}}else{D=false;}return D;},setAttrs:function(v){return this._setAttrs(v);},_setAttrs:function(w){for(var v in w){if(w.hasOwnProperty(v)){this.set(v,w[v]);}}return this;},getAttrs:function(v){return this._getAttrs(v);},_getAttrs:function(y){var A=this,C={},z,w,v,B,x=(y===true);y=(y&&!x)?y:i.keys(A._state.data);for(z=0,w=y.length;z<w;z++){v=y[z];B=A.get(v);if(!x||A._getStateVal(v)!=A._state.get(v,g)){C[v]=A.get(v);}}return C;},addAttrs:function(v,w,x){var y=this;if(v){y._tCfgs=v;y._tVals=y._normAttrVals(w);y._addAttrs(v,y._tVals,x);y._tCfgs=y._tVals=null;}return y;},_addAttrs:function(w,x,y){var A=this,v,z,B;for(v in w){if(w.hasOwnProperty(v)){z=w[v];z.defaultValue=z.value;B=A._getAttrInitVal(v,z,A._tVals);if(B!==undefined){z.value=B;}if(A._tCfgs[v]){delete A._tCfgs[v];}A.addAttr(v,z,y);}}},_protectAttrs:function(w){if(w){w=c.merge(w);for(var v in w){if(w.hasOwnProperty(v)){w[v]=c.merge(w[v]);}}}return w;},_normAttrVals:function(v){return(v)?c.merge(v):null;},_getAttrInitVal:function(v,w,y){var z,x;if(!w.readOnly&&y&&y.hasOwnProperty(v)){z=y[v];}else{z=w.value;x=w.valueFn;if(x){if(!x.call){x=this[x];}if(x){z=x.call(this,v);}}}return z;},_initAttrs:function(w,v,z){w=w||this.constructor.ATTRS;var y=c.Base,x=c.BaseCore,A=(y&&c.instanceOf(this,y)),B=(!A&&x&&c.instanceOf(this,x));if(w&&!A&&!B){this.addAttrs(this._protectAttrs(w),v,z);}}};c.AttributeCore=s;},"3.5.1");+YUI.add("attribute-core",function(e,t){function E(e,t,n){this._initAttrHost(e,t,n)}e.State=function(){this.data={}},e.State.prototype={add:function(e,t,n){var r=this.data[e];r||(r=this.data[e]={}),r[t]=n},addAll:function(e,t){var n=this.data[e],r;n||(n=this.data[e]={});for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r])},remove:function(e,t){var n=this.data[e];n&&delete n[t]},removeAll:function(t,n){var r;n?e.each(n,function(e,n){this.remove(t,typeof n=="string"?n:e)},this):(r=this.data,t in r&&delete r[t])},get:function(e,t){var n=this.data[e];if(n)return n[t]},getAll:function(e,t){var n=this.data[e],r,i;if(t)i=n;else if(n){i={};for(r in n)n.hasOwnProperty(r)&&(i[r]=n[r])}return i}};var n=e.Object,r=e.Lang,i=".",s="getter",o="setter",u="readOnly",a="writeOnce",f="initOnly",l="validator",c="value",h="valueFn",p="lazyAdd",d="added",v="_bypassProxy",m="initializing",g="initValue",y="lazy",b="isLazyAdd",w;E.INVALID_VALUE={},w=E.INVALID_VALUE,E._ATTR_CFG=[o,s,l,c,h,a,u,p,v],E.prototype={_initAttrHost:function(t,n,r){this._state=new e.State,this._initAttrs(t,n,r)},addAttr:function(e,t,n){var r=this,i=r._state,s,o;t=t||{},n=p in t?t[p]:n;if(n&&!r.attrAdded(e))i.addAll(e,{lazy:t,added:!0});else if(!r.attrAdded(e)||i.get(e,b))o=c in t,o&&(s=t.value,delete t.value),t.added=!0,t.initializing=!0,i.addAll(e,t),o&&r.set(e,s),i.remove(e,m);return r},attrAdded:function(e){return!!this._state.get(e,d)},get:function(e){return this._getAttr(e)},_isLazyAttr:function(e){return this._state.get(e,y)},_addLazyAttr:function(e,t){var n=this._state,r=n.get(e,y);n.add(e,b,!0),n.remove(e,y),this.addAttr(e,r)},set:function(e,t){return this._setAttr(e,t)},_set:function(e,t){return this._setAttr(e,t,null,!0)},_setAttr:function(t,r,s,o){var u=!0,a=this._state,l=this._stateProxy,h,p,d,v,m,g,y;return t.indexOf(i)!==-1&&(d=t,v=t.split(i),t=v.shift()),this._isLazyAttr(t)&&this._addLazyAttr(t),h=a.getAll(t,!0)||{},p=!(c in h),l&&t in l&&!h._bypassProxy&&(p=!1),g=h.writeOnce,y=h.initializing,!p&&!o&&(g&&(u=!1),h.readOnly&&(u=!1)),!y&&!o&&g===f&&(u=!1),u&&(p||(m=this.get(t)),v&&(r=n.setValue(e.clone(m),v,r),r===undefined&&(u=!1)),u&&(!this._fireAttrChange||y?this._setAttrVal(t,d,m,r):this._fireAttrChange(t,d,m,r,s))),this},_getAttr:function(e){var t=this,r=e,o=t._state,u,a,f,l;return e.indexOf(i)!==-1&&(u=e.split(i),e=u.shift()),t._tCfgs&&t._tCfgs[e]&&(l={},l[e]=t._tCfgs[e],delete t._tCfgs[e],t._addAttrs(l,t._tVals)),t._isLazyAttr(e)&&t._addLazyAttr(e),f=t._getStateVal(e),a=o.get(e,s),a&&!a.call&&(a=this[a]),f=a?a.call(t,f,r):f,f=u?n.getValue(f,u):f,f},_getStateVal:function(e){var t=this._stateProxy;return t&&e in t&&!this._state.get(e,v)?t[e]:this._state.get(e,c)},_setStateVal:function(e,t){var n=this._stateProxy;n&&e in n&&!this._state.get(e,v)?n[e]=t:this._state.add(e,c,t)},_setAttrVal:function(e,t,n,i){var s=this,o=!0,u=this._state.getAll(e,!0)||{},a=u.validator,f=u.setter,l=u.initializing,c=this._getStateVal(e),h=t||e,p,d;return a&&(a.call||(a=this[a]),a&&(d=a.call(s,i,h),!d&&l&&(i=u.defaultValue,d=!0))),!a||d?(f&&(f.call||(f=this[f]),f&&(p=f.call(s,i,h),p===w?o=!1:p!==undefined&&(i=p))),o&&(!t&&i===c&&!r.isObject(i)?o=!1:(g in u||(u.initValue=i),s._setStateVal(e,i)))):o=!1,o},setAttrs:function(e){return this._setAttrs(e)},_setAttrs:function(e){var t;for(t in e)e.hasOwnProperty(t)&&this.set(t,e[t]);return this},getAttrs:function(e){return this._getAttrs(e)},_getAttrs:function(e){var t={},r,i,s,o=e===!0;if(!e||o)e=n.keys(this._state.data);for(i=0,s=e.length;i<s;i++){r=e[i];if(!o||this._getStateVal(r)!=this._state.get(r,g))t[r]=this.get(r)}return t},addAttrs:function(e,t,n){var r=this;return e&&(r._tCfgs=e,r._tVals=r._normAttrVals(t),r._addAttrs(e,r._tVals,n),r._tCfgs=r._tVals=null),r},_addAttrs:function(e,t,n){var r=this,i,s,o;for(i in e)e.hasOwnProperty(i)&&(s=e[i],s.defaultValue=s.value,o=r._getAttrInitVal(i,s,r._tVals),o!==undefined&&(s.value=o),r._tCfgs[i]&&delete r._tCfgs[i],r.addAttr(i,s,n))},_protectAttrs:function(t){if(t){t=e.merge(t);for(var n in t)t.hasOwnProperty(n)&&(t[n]=e.merge(t[n]))}return t},_normAttrVals:function(t){return t?e.merge(t):null},_getAttrInitVal:function(e,t,n){var r,i;return!t.readOnly&&n&&n.hasOwnProperty(e)?r=n[e]:(r=t.value,i=t.valueFn,i&&(i.call||(i=this[i]),i&&(r=i.call(this,e)))),r},_initAttrs:function(t,n,r){t=t||this.constructor.ATTRS;var i=e.Base,s=e.BaseCore,o=i&&e.instanceOf(this,i),u=!o&&s&&e.instanceOf(this,s);t&&!o&&!u&&this.addAttrs(this._protectAttrs(t),n,r)}},e.AttributeCore=E},"3.7.1",{requires:["oop"]});
@@ -1,17 +1,17 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('attribute-core', function(Y) {+YUI.add('attribute-core', function (Y, NAME) { /**- * The State class maintains state for a collection of named items, with + * The State class maintains state for a collection of named items, with * a varying number of properties defined. *- * It avoids the need to create a separate class for the item, and separate instances - * of these classes for each item, by storing the state in a 2 level hash table, + * It avoids the need to create a separate class for the item, and separate instances+ * of these classes for each item, by storing the state in a 2 level hash table, * improving performance when the number of items is likely to be large. * * @constructor@@ -35,10 +35,14 @@ * @param key {String} The name of the property. * @param val {Any} The value of the property. */- add : function(name, key, val) {- var d = this.data;- d[name] = d[name] || {};- d[name][key] = val;+ add: function(name, key, val) {+ var item = this.data[name];++ if (!item) {+ item = this.data[name] = {};+ }++ item[key] = val; }, /**@@ -46,14 +50,19 @@ * * @method addAll * @param name {String} The name of the item.- * @param o {Object} A hash of property/value pairs.+ * @param obj {Object} A hash of property/value pairs. */- addAll: function(name, o) {- var key;+ addAll: function(name, obj) {+ var item = this.data[name],+ key; - for (key in o) {- if (o.hasOwnProperty(key)) {- this.add(name, key, o[key]);+ if (!item) {+ item = this.data[name] = {};+ }++ for (key in obj) {+ if (obj.hasOwnProperty(key)) {+ item[key] = obj[key]; } } },@@ -66,33 +75,32 @@ * @param key {String} The property to remove. */ remove: function(name, key) {- var d = this.data;- if (d[name]) {- delete d[name][key];+ var item = this.data[name];++ if (item) {+ delete item[key]; } }, /**- * Removes multiple properties from an item, or remove the item completely.+ * Removes multiple properties from an item, or removes the item completely. * * @method removeAll * @param name {String} The name of the item.- * @param o {Object|Array} Collection of properties to delete. If not provided, the entire item is removed.+ * @param obj {Object|Array} Collection of properties to delete. If not provided, the entire item is removed. */- removeAll: function(name, o) {- var d = this.data;+ removeAll: function(name, obj) {+ var data; - if (!o) {- if (d[name]) {- delete d[name];+ if (!obj) {+ data = this.data;++ if (name in data) {+ delete data[name]; } } else {- Y.each(o, function(v, k) {- if(Y.Lang.isString(k)) {- this.remove(name, k);- } else {- this.remove(name, v);- }+ Y.each(obj, function(value, key) {+ this.remove(name, typeof key === 'string' ? key : value); }, this); } },@@ -106,8 +114,11 @@ * @return {Any} The value of the supplied property. */ get: function(name, key) {- var d = this.data;- return (d[name]) ? d[name][key] : undefined;+ var item = this.data[name];++ if (item) {+ return item[key];+ } }, /**@@ -120,22 +131,26 @@ * @method getAll * @param name {String} The name of the item * @param reference {boolean} true, if you want a reference to the stored- * object + * object * @return {Object} An object with property/value pairs for the item. */ getAll : function(name, reference) {- var d = this.data, o;+ var item = this.data[name],+ key, obj; - if (!reference) {- Y.each(d[name], function(v, k) {- o = o || {};- o[k] = v;- });- } else {- o = d[name];+ if (reference) {+ obj = item;+ } else if (item) {+ obj = {};++ for (key in item) {+ if (item.hasOwnProperty(key)) {+ obj[key] = item[key];+ }+ } } - return o;+ return obj; } }; /**@@ -510,7 +525,7 @@ * the event facade passed to subscribers of the attribute's change event. * This is currently a hack. There's no real need for the AttributeCore implementation * to support this parameter, but breaking it out into AttributeEvents, results in- * additional function hops for the critical path. May change in 3.5.0 PR3.+ * additional function hops for the critical path. * @param {boolean} force If true, allows the caller to set values for * readOnly or writeOnce attributes which have already been set. *@@ -783,7 +798,8 @@ * @chainable */ _setAttrs : function(attrs) {- for (var attr in attrs) {+ var attr;+ for (attr in attrs) { if ( attrs.hasOwnProperty(attr) ) { this.set(attr, attrs[attr]); }@@ -813,25 +829,25 @@ * @return {Object} An object with attribute name/value pairs. */ _getAttrs : function(attrs) {- var host = this,- o = {}, - i, l, attr, val,+ var obj = {},+ attr, i, len, modifiedOnly = (attrs === true); // TODO - figure out how to get all "added"- attrs = (attrs && !modifiedOnly) ? attrs : O.keys(host._state.data);+ if (!attrs || modifiedOnly) {+ attrs = O.keys(this._state.data);+ } - for (i = 0, l = attrs.length; i < l; i++) {- // Go through get, to honor cloning/normalization+ for (i = 0, len = attrs.length; i < len; i++) { attr = attrs[i];- val = host.get(attr); - if (!modifiedOnly || host._getStateVal(attr) != host._state.get(attr, INIT_VALUE)) {- o[attr] = host.get(attr); + if (!modifiedOnly || this._getStateVal(attr) != this._state.get(attr, INIT_VALUE)) {+ // Go through get, to honor cloning/normalization+ obj[attr] = this.get(attr); } } - return o;+ return obj; }, /**@@ -1014,4 +1030,4 @@ Y.AttributeCore = AttributeCore; -}, '3.5.1' );+}, '3.7.1', {"requires": ["oop"]});
@@ -0,0 +1,275 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/attribute-events/attribute-events.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/attribute-events/attribute-events.js",+ code: []+};+_yuitest_coverage["build/attribute-events/attribute-events.js"].code=["YUI.add('attribute-events', function (Y, NAME) {",""," /**"," * The attribute module provides an augmentable Attribute implementation, which "," * adds configurable attributes and attribute change events to the class being "," * augmented. It also provides a State class, which is used internally by Attribute,"," * but can also be used independently to provide a name/property/value data structure to"," * store state."," *"," * @module attribute"," */",""," /**"," * The attribute-events submodule provides augmentable attribute change event support "," * for AttributeCore based implementations."," *"," * @module attribute"," * @submodule attribute-events"," */"," var EventTarget = Y.EventTarget,",""," CHANGE = \"Change\","," BROADCAST = \"broadcast\","," PUBLISHED = \"published\";",""," /**"," * Provides an augmentable implementation of attribute change events for "," * AttributeCore. "," *"," * @class AttributeEvents"," * @uses EventTarget"," */"," function AttributeEvents() {"," // Perf tweak - avoid creating event literals if not required."," this._ATTR_E_FACADE = {};"," EventTarget.call(this, {emitFacade:true});"," }",""," AttributeEvents._ATTR_CFG = [BROADCAST];",""," AttributeEvents.prototype = {",""," /**"," * Sets the value of an attribute."," *"," * @method set"," * @chainable"," *"," * @param {String} name The name of the attribute. If the "," * current value of the attribute is an Object, dot notation can be used"," * to set the value of a property within the object (e.g. <code>set(\"x.y.z\", 5)</code>)."," *"," * @param {Any} value The value to set the attribute to."," *"," * @param {Object} opts (Optional) Optional event data to be mixed into"," * the event facade passed to subscribers of the attribute's change event. This "," * can be used as a flexible way to identify the source of a call to set, allowing "," * the developer to distinguish between set called internally by the host, vs. "," * set called externally by the application developer."," *"," * @return {Object} A reference to the host object."," */"," set : function(name, val, opts) {"," return this._setAttr(name, val, opts);"," },",""," /**"," * Allows setting of readOnly/writeOnce attributes. See <a href=\"#method_set\">set</a> for argument details."," *"," * @method _set"," * @protected"," * @chainable"," * "," * @param {String} name The name of the attribute."," * @param {Any} val The value to set the attribute to."," * @param {Object} opts (Optional) Optional event data to be mixed into"," * the event facade passed to subscribers of the attribute's change event."," * @return {Object} A reference to the host object."," */"," _set : function(name, val, opts) {"," return this._setAttr(name, val, opts, true);"," },",""," /**"," * Sets multiple attribute values."," *"," * @method setAttrs"," * @param {Object} attrs An object with attributes name/value pairs."," * @param {Object} opts Properties to mix into the event payload. These are shared and mixed into each set "," * @return {Object} A reference to the host object."," * @chainable"," */"," setAttrs : function(attrs, opts) {"," return this._setAttrs(attrs, opts);"," },",""," /**"," * Implementation behind the public setAttrs method, to set multiple attribute values."," *"," * @method _setAttrs"," * @protected"," * @param {Object} attrs An object with attributes name/value pairs."," * @param {Object} opts Properties to mix into the event payload. These are shared and mixed into each set "," * @return {Object} A reference to the host object."," * @chainable"," */"," _setAttrs : function(attrs, opts) {"," var attr;"," for (attr in attrs) {"," if ( attrs.hasOwnProperty(attr) ) {"," this.set(attr, attrs[attr], opts);"," }"," }"," return this;"," },",""," /**"," * Utility method to help setup the event payload and fire the attribute change event."," * "," * @method _fireAttrChange"," * @private"," * @param {String} attrName The name of the attribute"," * @param {String} subAttrName The full path of the property being changed, "," * if this is a sub-attribute value being change. Otherwise null."," * @param {Any} currVal The current value of the attribute"," * @param {Any} newVal The new value of the attribute"," * @param {Object} opts Any additional event data to mix into the attribute change event's event facade."," */"," _fireAttrChange : function(attrName, subAttrName, currVal, newVal, opts) {"," var host = this,"," eventName = attrName + CHANGE,"," state = host._state,"," facade,"," broadcast,"," evtCfg;",""," if (!state.get(attrName, PUBLISHED)) {"," "," evtCfg = {"," queuable:false,"," defaultTargetOnly: true, "," defaultFn:host._defAttrChangeFn, "," silent:true"," };",""," broadcast = state.get(attrName, BROADCAST);"," if (broadcast !== undefined) {"," evtCfg.broadcast = broadcast;"," }",""," host.publish(eventName, evtCfg);"," "," state.add(attrName, PUBLISHED, true);"," }",""," facade = (opts) ? Y.merge(opts) : host._ATTR_E_FACADE;",""," // Not using the single object signature for fire({type:..., newVal:...}), since "," // we don't want to override type. Changed to the fire(type, {newVal:...}) signature.",""," // facade.type = eventName;"," facade.attrName = attrName;"," facade.subAttrName = subAttrName;"," facade.prevVal = currVal;"," facade.newVal = newVal;",""," // host.fire(facade);"," host.fire(eventName, facade);"," },",""," /**"," * Default function for attribute change events."," *"," * @private"," * @method _defAttrChangeFn"," * @param {EventFacade} e The event object for attribute change events."," */"," _defAttrChangeFn : function(e) {"," if (!this._setAttrVal(e.attrName, e.subAttrName, e.prevVal, e.newVal)) {"," // Prevent \"after\" listeners from being invoked since nothing changed."," e.stopImmediatePropagation();"," } else {"," e.newVal = this.get(e.attrName);"," }"," }"," };",""," // Basic prototype augment - no lazy constructor invocation."," Y.mix(AttributeEvents, EventTarget, false, null, 1);",""," Y.AttributeEvents = AttributeEvents;","","","}, '3.7.1', {\"requires\": [\"event-custom\"]});"];+_yuitest_coverage["build/attribute-events/attribute-events.js"].lines = {"1":0,"20":0,"33":0,"35":0,"36":0,"39":0,"41":0,"64":0,"81":0,"94":0,"108":0,"109":0,"110":0,"111":0,"114":0,"130":0,"137":0,"139":0,"146":0,"147":0,"148":0,"151":0,"153":0,"156":0,"162":0,"163":0,"164":0,"165":0,"168":0,"179":0,"181":0,"183":0,"189":0,"191":0};+_yuitest_coverage["build/attribute-events/attribute-events.js"].functions = {"AttributeEvents:33":0,"set:63":0,"_set:80":0,"setAttrs:93":0,"_setAttrs:107":0,"_fireAttrChange:129":0,"_defAttrChangeFn:178":0,"(anonymous 1):1":0};+_yuitest_coverage["build/attribute-events/attribute-events.js"].coveredLines = 34;+_yuitest_coverage["build/attribute-events/attribute-events.js"].coveredFunctions = 8;+_yuitest_coverline("build/attribute-events/attribute-events.js", 1);+YUI.add('attribute-events', function (Y, NAME) {++ /**+ * The attribute module provides an augmentable Attribute implementation, which + * adds configurable attributes and attribute change events to the class being + * augmented. It also provides a State class, which is used internally by Attribute,+ * but can also be used independently to provide a name/property/value data structure to+ * store state.+ *+ * @module attribute+ */++ /**+ * The attribute-events submodule provides augmentable attribute change event support + * for AttributeCore based implementations.+ *+ * @module attribute+ * @submodule attribute-events+ */+ _yuitest_coverfunc("build/attribute-events/attribute-events.js", "(anonymous 1)", 1);+_yuitest_coverline("build/attribute-events/attribute-events.js", 20);+var EventTarget = Y.EventTarget,++ CHANGE = "Change",+ BROADCAST = "broadcast",+ PUBLISHED = "published";++ /**+ * Provides an augmentable implementation of attribute change events for + * AttributeCore. + *+ * @class AttributeEvents+ * @uses EventTarget+ */+ _yuitest_coverline("build/attribute-events/attribute-events.js", 33);+function AttributeEvents() {+ // Perf tweak - avoid creating event literals if not required.+ _yuitest_coverfunc("build/attribute-events/attribute-events.js", "AttributeEvents", 33);+_yuitest_coverline("build/attribute-events/attribute-events.js", 35);+this._ATTR_E_FACADE = {};+ _yuitest_coverline("build/attribute-events/attribute-events.js", 36);+EventTarget.call(this, {emitFacade:true});+ }++ _yuitest_coverline("build/attribute-events/attribute-events.js", 39);+AttributeEvents._ATTR_CFG = [BROADCAST];++ _yuitest_coverline("build/attribute-events/attribute-events.js", 41);+AttributeEvents.prototype = {++ /**+ * Sets the value of an attribute.+ *+ * @method set+ * @chainable+ *+ * @param {String} name The name of the attribute. If the + * current value of the attribute is an Object, dot notation can be used+ * to set the value of a property within the object (e.g. <code>set("x.y.z", 5)</code>).+ *+ * @param {Any} value The value to set the attribute to.+ *+ * @param {Object} opts (Optional) Optional event data to be mixed into+ * the event facade passed to subscribers of the attribute's change event. This + * can be used as a flexible way to identify the source of a call to set, allowing + * the developer to distinguish between set called internally by the host, vs. + * set called externally by the application developer.+ *+ * @return {Object} A reference to the host object.+ */+ set : function(name, val, opts) {+ _yuitest_coverfunc("build/attribute-events/attribute-events.js", "set", 63);+_yuitest_coverline("build/attribute-events/attribute-events.js", 64);+return this._setAttr(name, val, opts);+ },++ /**+ * Allows setting of readOnly/writeOnce attributes. See <a href="#method_set">set</a> for argument details.+ *+ * @method _set+ * @protected+ * @chainable+ * + * @param {String} name The name of the attribute.+ * @param {Any} val The value to set the attribute to.+ * @param {Object} opts (Optional) Optional event data to be mixed into+ * the event facade passed to subscribers of the attribute's change event.+ * @return {Object} A reference to the host object.+ */+ _set : function(name, val, opts) {+ _yuitest_coverfunc("build/attribute-events/attribute-events.js", "_set", 80);+_yuitest_coverline("build/attribute-events/attribute-events.js", 81);+return this._setAttr(name, val, opts, true);+ },++ /**+ * Sets multiple attribute values.+ *+ * @method setAttrs+ * @param {Object} attrs An object with attributes name/value pairs.+ * @param {Object} opts Properties to mix into the event payload. These are shared and mixed into each set + * @return {Object} A reference to the host object.+ * @chainable+ */+ setAttrs : function(attrs, opts) {+ _yuitest_coverfunc("build/attribute-events/attribute-events.js", "setAttrs", 93);+_yuitest_coverline("build/attribute-events/attribute-events.js", 94);+return this._setAttrs(attrs, opts);+ },++ /**+ * Implementation behind the public setAttrs method, to set multiple attribute values.+ *+ * @method _setAttrs+ * @protected+ * @param {Object} attrs An object with attributes name/value pairs.+ * @param {Object} opts Properties to mix into the event payload. These are shared and mixed into each set + * @return {Object} A reference to the host object.+ * @chainable+ */+ _setAttrs : function(attrs, opts) {+ _yuitest_coverfunc("build/attribute-events/attribute-events.js", "_setAttrs", 107);+_yuitest_coverline("build/attribute-events/attribute-events.js", 108);+var attr;+ _yuitest_coverline("build/attribute-events/attribute-events.js", 109);+for (attr in attrs) {+ _yuitest_coverline("build/attribute-events/attribute-events.js", 110);+if ( attrs.hasOwnProperty(attr) ) {+ _yuitest_coverline("build/attribute-events/attribute-events.js", 111);+this.set(attr, attrs[attr], opts);+ }+ }+ _yuitest_coverline("build/attribute-events/attribute-events.js", 114);+return this;+ },++ /**+ * Utility method to help setup the event payload and fire the attribute change event.+ * + * @method _fireAttrChange+ * @private+ * @param {String} attrName The name of the attribute+ * @param {String} subAttrName The full path of the property being changed, + * if this is a sub-attribute value being change. Otherwise null.+ * @param {Any} currVal The current value of the attribute+ * @param {Any} newVal The new value of the attribute+ * @param {Object} opts Any additional event data to mix into the attribute change event's event facade.+ */+ _fireAttrChange : function(attrName, subAttrName, currVal, newVal, opts) {+ _yuitest_coverfunc("build/attribute-events/attribute-events.js", "_fireAttrChange", 129);+_yuitest_coverline("build/attribute-events/attribute-events.js", 130);+var host = this,+ eventName = attrName + CHANGE,+ state = host._state,+ facade,+ broadcast,+ evtCfg;++ _yuitest_coverline("build/attribute-events/attribute-events.js", 137);+if (!state.get(attrName, PUBLISHED)) {+ + _yuitest_coverline("build/attribute-events/attribute-events.js", 139);+evtCfg = {+ queuable:false,+ defaultTargetOnly: true, + defaultFn:host._defAttrChangeFn, + silent:true+ };++ _yuitest_coverline("build/attribute-events/attribute-events.js", 146);+broadcast = state.get(attrName, BROADCAST);+ _yuitest_coverline("build/attribute-events/attribute-events.js", 147);+if (broadcast !== undefined) {+ _yuitest_coverline("build/attribute-events/attribute-events.js", 148);+evtCfg.broadcast = broadcast;+ }++ _yuitest_coverline("build/attribute-events/attribute-events.js", 151);+host.publish(eventName, evtCfg);+ + _yuitest_coverline("build/attribute-events/attribute-events.js", 153);+state.add(attrName, PUBLISHED, true);+ }++ _yuitest_coverline("build/attribute-events/attribute-events.js", 156);+facade = (opts) ? Y.merge(opts) : host._ATTR_E_FACADE;++ // Not using the single object signature for fire({type:..., newVal:...}), since + // we don't want to override type. Changed to the fire(type, {newVal:...}) signature.++ // facade.type = eventName;+ _yuitest_coverline("build/attribute-events/attribute-events.js", 162);+facade.attrName = attrName;+ _yuitest_coverline("build/attribute-events/attribute-events.js", 163);+facade.subAttrName = subAttrName;+ _yuitest_coverline("build/attribute-events/attribute-events.js", 164);+facade.prevVal = currVal;+ _yuitest_coverline("build/attribute-events/attribute-events.js", 165);+facade.newVal = newVal;++ // host.fire(facade);+ _yuitest_coverline("build/attribute-events/attribute-events.js", 168);+host.fire(eventName, facade);+ },++ /**+ * Default function for attribute change events.+ *+ * @private+ * @method _defAttrChangeFn+ * @param {EventFacade} e The event object for attribute change events.+ */+ _defAttrChangeFn : function(e) {+ _yuitest_coverfunc("build/attribute-events/attribute-events.js", "_defAttrChangeFn", 178);+_yuitest_coverline("build/attribute-events/attribute-events.js", 179);+if (!this._setAttrVal(e.attrName, e.subAttrName, e.prevVal, e.newVal)) {+ // Prevent "after" listeners from being invoked since nothing changed.+ _yuitest_coverline("build/attribute-events/attribute-events.js", 181);+e.stopImmediatePropagation();+ } else {+ _yuitest_coverline("build/attribute-events/attribute-events.js", 183);+e.newVal = this.get(e.attrName);+ }+ }+ };++ // Basic prototype augment - no lazy constructor invocation.+ _yuitest_coverline("build/attribute-events/attribute-events.js", 189);+Y.mix(AttributeEvents, EventTarget, false, null, 1);++ _yuitest_coverline("build/attribute-events/attribute-events.js", 191);+Y.AttributeEvents = AttributeEvents;+++}, '3.7.1', {"requires": ["event-custom"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('attribute-events', function(Y) {+YUI.add('attribute-events', function (Y, NAME) { /** * The attribute module provides an augmentable Attribute implementation, which @@ -92,6 +92,7 @@ * * @method setAttrs * @param {Object} attrs An object with attributes name/value pairs.+ * @param {Object} opts Properties to mix into the event payload. These are shared and mixed into each set * @return {Object} A reference to the host object. * @chainable */@@ -100,6 +101,26 @@ }, /**+ * Implementation behind the public setAttrs method, to set multiple attribute values.+ *+ * @method _setAttrs+ * @protected+ * @param {Object} attrs An object with attributes name/value pairs.+ * @param {Object} opts Properties to mix into the event payload. These are shared and mixed into each set + * @return {Object} A reference to the host object.+ * @chainable+ */+ _setAttrs : function(attrs, opts) {+ var attr;+ for (attr in attrs) {+ if ( attrs.hasOwnProperty(attr) ) {+ this.set(attr, attrs[attr], opts);+ }+ }+ return this;+ },++ /** * Utility method to help setup the event payload and fire the attribute change event. * * @method _fireAttrChange@@ -177,4 +198,4 @@ Y.AttributeEvents = AttributeEvents; -}, '3.5.1' ,{requires:['event-custom']});+}, '3.7.1', {"requires": ["event-custom"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("attribute-events",function(e){var f=e.EventTarget,d="Change",a="broadcast",c="published";function b(){this._ATTR_E_FACADE={};f.call(this,{emitFacade:true});}b._ATTR_CFG=[a];b.prototype={set:function(g,i,h){return this._setAttr(g,i,h);},_set:function(g,i,h){return this._setAttr(g,i,h,true);},setAttrs:function(g,h){return this._setAttrs(g,h);},_fireAttrChange:function(o,n,k,j,g){var q=this,m=o+d,i=q._state,p,l,h;if(!i.get(o,c)){h={queuable:false,defaultTargetOnly:true,defaultFn:q._defAttrChangeFn,silent:true};l=i.get(o,a);if(l!==undefined){h.broadcast=l;}q.publish(m,h);i.add(o,c,true);}p=(g)?e.merge(g):q._ATTR_E_FACADE;p.attrName=o;p.subAttrName=n;p.prevVal=k;p.newVal=j;q.fire(m,p);},_defAttrChangeFn:function(g){if(!this._setAttrVal(g.attrName,g.subAttrName,g.prevVal,g.newVal)){g.stopImmediatePropagation();}else{g.newVal=this.get(g.attrName);}}};e.mix(b,f,false,null,1);e.AttributeEvents=b;},"3.5.1",{requires:["event-custom"]});+YUI.add("attribute-events",function(e,t){function o(){this._ATTR_E_FACADE={},n.call(this,{emitFacade:!0})}var n=e.EventTarget,r="Change",i="broadcast",s="published";o._ATTR_CFG=[i],o.prototype={set:function(e,t,n){return this._setAttr(e,t,n)},_set:function(e,t,n){return this._setAttr(e,t,n,!0)},setAttrs:function(e,t){return this._setAttrs(e,t)},_setAttrs:function(e,t){var n;for(n in e)e.hasOwnProperty(n)&&this.set(n,e[n],t);return this},_fireAttrChange:function(t,n,o,u,a){var f=this,l=t+r,c=f._state,h,p,d;c.get(t,s)||(d={queuable:!1,defaultTargetOnly:!0,defaultFn:f._defAttrChangeFn,silent:!0},p=c.get(t,i),p!==undefined&&(d.broadcast=p),f.publish(l,d),c.add(t,s,!0)),h=a?e.merge(a):f._ATTR_E_FACADE,h.attrName=t,h.subAttrName=n,h.prevVal=o,h.newVal=u,f.fire(l,h)},_defAttrChangeFn:function(e){this._setAttrVal(e.attrName,e.subAttrName,e.prevVal,e.newVal)?e.newVal=this.get(e.attrName):e.stopImmediatePropagation()}},e.mix(o,n,!1,null,1),e.AttributeEvents=o},"3.7.1",{requires:["event-custom"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('attribute-events', function(Y) {+YUI.add('attribute-events', function (Y, NAME) { /** * The attribute module provides an augmentable Attribute implementation, which @@ -92,6 +92,7 @@ * * @method setAttrs * @param {Object} attrs An object with attributes name/value pairs.+ * @param {Object} opts Properties to mix into the event payload. These are shared and mixed into each set * @return {Object} A reference to the host object. * @chainable */@@ -100,6 +101,26 @@ }, /**+ * Implementation behind the public setAttrs method, to set multiple attribute values.+ *+ * @method _setAttrs+ * @protected+ * @param {Object} attrs An object with attributes name/value pairs.+ * @param {Object} opts Properties to mix into the event payload. These are shared and mixed into each set + * @return {Object} A reference to the host object.+ * @chainable+ */+ _setAttrs : function(attrs, opts) {+ var attr;+ for (attr in attrs) {+ if ( attrs.hasOwnProperty(attr) ) {+ this.set(attr, attrs[attr], opts);+ }+ }+ return this;+ },++ /** * Utility method to help setup the event payload and fire the attribute change event. * * @method _fireAttrChange@@ -176,4 +197,4 @@ Y.AttributeEvents = AttributeEvents; -}, '3.5.1' ,{requires:['event-custom']});+}, '3.7.1', {"requires": ["event-custom"]});
@@ -0,0 +1,220 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/attribute-extras/attribute-extras.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/attribute-extras/attribute-extras.js",+ code: []+};+_yuitest_coverage["build/attribute-extras/attribute-extras.js"].code=["YUI.add('attribute-extras', function (Y, NAME) {",""," /**"," * The attribute module provides an augmentable Attribute implementation, which "," * adds configurable attributes and attribute change events to the class being "," * augmented. It also provides a State class, which is used internally by Attribute,"," * but can also be used independently to provide a name/property/value data structure to"," * store state."," *"," * @module attribute"," */",""," /**"," * The attribute-extras submodule provides less commonly used attribute methods, and can "," * be augmented/mixed into an implemention which used attribute-core."," *"," * @module attribute"," * @submodule attribute-extras"," */"," var BROADCAST = \"broadcast\","," PUBLISHED = \"published\","," INIT_VALUE = \"initValue\",",""," MODIFIABLE = {"," readOnly:1,"," writeOnce:1,"," getter:1,"," broadcast:1"," };",""," /**"," * A augmentable implementation for AttributeCore, providing less frequently used "," * methods for Attribute management such as modifyAttrs(), removeAttr and reset() "," *"," * @class AttributeExtras"," */"," function AttributeExtras() {}",""," AttributeExtras.prototype = {",""," /**"," * Updates the configuration of an attribute which has already been added."," * <p>"," * The properties which can be modified through this interface are limited"," * to the following subset of attributes, which can be safely modified"," * after a value has already been set on the attribute: readOnly, writeOnce, "," * broadcast and getter."," * </p>"," * @method modifyAttr"," * @param {String} name The name of the attribute whose configuration is to be updated."," * @param {Object} config An object with configuration property/value pairs, specifying the configuration properties to modify."," */"," modifyAttr: function(name, config) {"," var host = this, // help compression"," prop, state;",""," if (host.attrAdded(name)) {",""," if (host._isLazyAttr(name)) {"," host._addLazyAttr(name);"," }",""," state = host._state;"," for (prop in config) {"," if (MODIFIABLE[prop] && config.hasOwnProperty(prop)) {"," state.add(name, prop, config[prop]);",""," // If we reconfigured broadcast, need to republish"," if (prop === BROADCAST) {"," state.remove(name, PUBLISHED);"," }"," }"," }"," }",""," },",""," /**"," * Removes an attribute from the host object"," *"," * @method removeAttr"," * @param {String} name The name of the attribute to be removed."," */"," removeAttr: function(name) {"," this._state.removeAll(name);"," },",""," /**"," * Resets the attribute (or all attributes) to its initial value, as long as"," * the attribute is not readOnly, or writeOnce."," *"," * @method reset"," * @param {String} name Optional. The name of the attribute to reset. If omitted, all attributes are reset."," * @return {Object} A reference to the host object."," * @chainable"," */"," reset : function(name) {"," var host = this; // help compression",""," if (name) {"," if (host._isLazyAttr(name)) {"," host._addLazyAttr(name);"," }"," host.set(name, host._state.get(name, INIT_VALUE));"," } else {"," Y.each(host._state.data, function(v, n) {"," host.reset(n);"," });"," }"," return host;"," },",""," /**"," * Returns an object with the configuration properties (and value)"," * for the given attribute. If attrName is not provided, returns the"," * configuration properties for all attributes."," *"," * @method _getAttrCfg"," * @protected"," * @param {String} name Optional. The attribute name. If not provided, the method will return the configuration for all attributes."," * @return {Object} The configuration properties for the given attribute, or all attributes."," */"," _getAttrCfg : function(name) {"," var o,"," state = this._state;",""," if (name) {"," o = state.getAll(name) || {};"," } else {"," o = {};"," Y.each(state.data, function(v, n) {"," o[n] = state.getAll(n);"," }); "," }",""," return o;"," }"," };",""," Y.AttributeExtras = AttributeExtras;","","","}, '3.7.1', {\"requires\": [\"oop\"]});"];+_yuitest_coverage["build/attribute-extras/attribute-extras.js"].lines = {"1":0,"20":0,"37":0,"39":0,"54":0,"57":0,"59":0,"60":0,"63":0,"64":0,"65":0,"66":0,"69":0,"70":0,"85":0,"98":0,"100":0,"101":0,"102":0,"104":0,"106":0,"107":0,"110":0,"124":0,"127":0,"128":0,"130":0,"131":0,"132":0,"136":0,"140":0};+_yuitest_coverage["build/attribute-extras/attribute-extras.js"].functions = {"AttributeExtras:37":0,"modifyAttr:53":0,"removeAttr:84":0,"(anonymous 2):106":0,"reset:97":0,"(anonymous 3):131":0,"_getAttrCfg:123":0,"(anonymous 1):1":0};+_yuitest_coverage["build/attribute-extras/attribute-extras.js"].coveredLines = 31;+_yuitest_coverage["build/attribute-extras/attribute-extras.js"].coveredFunctions = 8;+_yuitest_coverline("build/attribute-extras/attribute-extras.js", 1);+YUI.add('attribute-extras', function (Y, NAME) {++ /**+ * The attribute module provides an augmentable Attribute implementation, which + * adds configurable attributes and attribute change events to the class being + * augmented. It also provides a State class, which is used internally by Attribute,+ * but can also be used independently to provide a name/property/value data structure to+ * store state.+ *+ * @module attribute+ */++ /**+ * The attribute-extras submodule provides less commonly used attribute methods, and can + * be augmented/mixed into an implemention which used attribute-core.+ *+ * @module attribute+ * @submodule attribute-extras+ */+ _yuitest_coverfunc("build/attribute-extras/attribute-extras.js", "(anonymous 1)", 1);+_yuitest_coverline("build/attribute-extras/attribute-extras.js", 20);+var BROADCAST = "broadcast",+ PUBLISHED = "published",+ INIT_VALUE = "initValue",++ MODIFIABLE = {+ readOnly:1,+ writeOnce:1,+ getter:1,+ broadcast:1+ };++ /**+ * A augmentable implementation for AttributeCore, providing less frequently used + * methods for Attribute management such as modifyAttrs(), removeAttr and reset() + *+ * @class AttributeExtras+ */+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 37);+function AttributeExtras() {}++ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 39);+AttributeExtras.prototype = {++ /**+ * Updates the configuration of an attribute which has already been added.+ * <p>+ * The properties which can be modified through this interface are limited+ * to the following subset of attributes, which can be safely modified+ * after a value has already been set on the attribute: readOnly, writeOnce, + * broadcast and getter.+ * </p>+ * @method modifyAttr+ * @param {String} name The name of the attribute whose configuration is to be updated.+ * @param {Object} config An object with configuration property/value pairs, specifying the configuration properties to modify.+ */+ modifyAttr: function(name, config) {+ _yuitest_coverfunc("build/attribute-extras/attribute-extras.js", "modifyAttr", 53);+_yuitest_coverline("build/attribute-extras/attribute-extras.js", 54);+var host = this, // help compression+ prop, state;++ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 57);+if (host.attrAdded(name)) {++ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 59);+if (host._isLazyAttr(name)) {+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 60);+host._addLazyAttr(name);+ }++ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 63);+state = host._state;+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 64);+for (prop in config) {+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 65);+if (MODIFIABLE[prop] && config.hasOwnProperty(prop)) {+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 66);+state.add(name, prop, config[prop]);++ // If we reconfigured broadcast, need to republish+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 69);+if (prop === BROADCAST) {+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 70);+state.remove(name, PUBLISHED);+ }+ }+ }+ }++ },++ /**+ * Removes an attribute from the host object+ *+ * @method removeAttr+ * @param {String} name The name of the attribute to be removed.+ */+ removeAttr: function(name) {+ _yuitest_coverfunc("build/attribute-extras/attribute-extras.js", "removeAttr", 84);+_yuitest_coverline("build/attribute-extras/attribute-extras.js", 85);+this._state.removeAll(name);+ },++ /**+ * Resets the attribute (or all attributes) to its initial value, as long as+ * the attribute is not readOnly, or writeOnce.+ *+ * @method reset+ * @param {String} name Optional. The name of the attribute to reset. If omitted, all attributes are reset.+ * @return {Object} A reference to the host object.+ * @chainable+ */+ reset : function(name) {+ _yuitest_coverfunc("build/attribute-extras/attribute-extras.js", "reset", 97);+_yuitest_coverline("build/attribute-extras/attribute-extras.js", 98);+var host = this; // help compression++ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 100);+if (name) {+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 101);+if (host._isLazyAttr(name)) {+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 102);+host._addLazyAttr(name);+ }+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 104);+host.set(name, host._state.get(name, INIT_VALUE));+ } else {+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 106);+Y.each(host._state.data, function(v, n) {+ _yuitest_coverfunc("build/attribute-extras/attribute-extras.js", "(anonymous 2)", 106);+_yuitest_coverline("build/attribute-extras/attribute-extras.js", 107);+host.reset(n);+ });+ }+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 110);+return host;+ },++ /**+ * Returns an object with the configuration properties (and value)+ * for the given attribute. If attrName is not provided, returns the+ * configuration properties for all attributes.+ *+ * @method _getAttrCfg+ * @protected+ * @param {String} name Optional. The attribute name. If not provided, the method will return the configuration for all attributes.+ * @return {Object} The configuration properties for the given attribute, or all attributes.+ */+ _getAttrCfg : function(name) {+ _yuitest_coverfunc("build/attribute-extras/attribute-extras.js", "_getAttrCfg", 123);+_yuitest_coverline("build/attribute-extras/attribute-extras.js", 124);+var o,+ state = this._state;++ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 127);+if (name) {+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 128);+o = state.getAll(name) || {};+ } else {+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 130);+o = {};+ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 131);+Y.each(state.data, function(v, n) {+ _yuitest_coverfunc("build/attribute-extras/attribute-extras.js", "(anonymous 3)", 131);+_yuitest_coverline("build/attribute-extras/attribute-extras.js", 132);+o[n] = state.getAll(n);+ }); + }++ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 136);+return o;+ }+ };++ _yuitest_coverline("build/attribute-extras/attribute-extras.js", 140);+Y.AttributeExtras = AttributeExtras;+++}, '3.7.1', {"requires": ["oop"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('attribute-extras', function(Y) {+YUI.add('attribute-extras', function (Y, NAME) { /** * The attribute module provides an augmentable Attribute implementation, which @@ -147,4 +147,4 @@ Y.AttributeExtras = AttributeExtras; -}, '3.5.1' );+}, '3.7.1', {"requires": ["oop"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("attribute-extras",function(f){var a="broadcast",d="published",e="initValue",c={readOnly:1,writeOnce:1,getter:1,broadcast:1};function b(){}b.prototype={modifyAttr:function(h,g){var i=this,k,j;if(i.attrAdded(h)){if(i._isLazyAttr(h)){i._addLazyAttr(h);}j=i._state;for(k in g){if(c[k]&&g.hasOwnProperty(k)){j.add(h,k,g[k]);if(k===a){j.remove(h,d);}}}}},removeAttr:function(g){this._state.removeAll(g);},reset:function(g){var h=this;if(g){if(h._isLazyAttr(g)){h._addLazyAttr(g);}h.set(g,h._state.get(g,e));}else{f.each(h._state.data,function(i,j){h.reset(j);});}return h;},_getAttrCfg:function(g){var i,h=this._state;if(g){i=h.getAll(g)||{};}else{i={};f.each(h.data,function(j,k){i[k]=h.getAll(k);});}return i;}};f.AttributeExtras=b;},"3.5.1");+YUI.add("attribute-extras",function(e,t){function o(){}var n="broadcast",r="published",i="initValue",s={readOnly:1,writeOnce:1,getter:1,broadcast:1};o.prototype={modifyAttr:function(e,t){var i=this,o,u;if(i.attrAdded(e)){i._isLazyAttr(e)&&i._addLazyAttr(e),u=i._state;for(o in t)s[o]&&t.hasOwnProperty(o)&&(u.add(e,o,t[o]),o===n&&u.remove(e,r))}},removeAttr:function(e){this._state.removeAll(e)},reset:function(t){var n=this;return t?(n._isLazyAttr(t)&&n._addLazyAttr(t),n.set(t,n._state.get(t,i))):e.each(n._state.data,function(e,t){n.reset(t)}),n},_getAttrCfg:function(t){var n,r=this._state;return t?n=r.getAll(t)||{}:(n={},e.each(r.data,function(e,t){n[t]=r.getAll(t)})),n}},e.AttributeExtras=o},"3.7.1",{requires:["oop"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('attribute-extras', function(Y) {+YUI.add('attribute-extras', function (Y, NAME) { /** * The attribute module provides an augmentable Attribute implementation, which @@ -146,4 +146,4 @@ Y.AttributeExtras = AttributeExtras; -}, '3.5.1' );+}, '3.7.1', {"requires": ["oop"]});
@@ -0,0 +1,1818 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/autocomplete-base/autocomplete-base.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/autocomplete-base/autocomplete-base.js",+ code: []+};+_yuitest_coverage["build/autocomplete-base/autocomplete-base.js"].code=["YUI.add('autocomplete-base', function (Y, NAME) {","","/**","Provides automatic input completion or suggestions for text input fields and","textareas.","","@module autocomplete","@main autocomplete","@since 3.3.0","**/","","/**","`Y.Base` extension that provides core autocomplete logic (but no UI","implementation) for a text input field or textarea. Must be mixed into a","`Y.Base`-derived class to be useful.","","@module autocomplete","@submodule autocomplete-base","**/","","/**","Extension that provides core autocomplete logic (but no UI implementation) for a","text input field or textarea.","","The `AutoCompleteBase` class provides events and attributes that abstract away","core autocomplete logic and configuration, but does not provide a widget","implementation or suggestion UI. For a prepackaged autocomplete widget, see","`AutoCompleteList`.","","This extension cannot be instantiated directly, since it doesn't provide an","actual implementation. It's intended to be mixed into a `Y.Base`-based class or","widget.","","`Y.Widget`-based example:",""," YUI().use('autocomplete-base', 'widget', function (Y) {"," var MyAC = Y.Base.create('myAC', Y.Widget, [Y.AutoCompleteBase], {"," // Custom prototype methods and properties."," }, {"," // Custom static methods and properties."," });",""," // Custom implementation code."," });","","`Y.Base`-based example:",""," YUI().use('autocomplete-base', function (Y) {"," var MyAC = Y.Base.create('myAC', Y.Base, [Y.AutoCompleteBase], {"," initializer: function () {"," this._bindUIACBase();"," this._syncUIACBase();"," },",""," // Custom prototype methods and properties."," }, {"," // Custom static methods and properties."," });",""," // Custom implementation code."," });","","@class AutoCompleteBase","**/","","var Escape = Y.Escape,"," Lang = Y.Lang,"," YArray = Y.Array,"," YObject = Y.Object,",""," isFunction = Lang.isFunction,"," isString = Lang.isString,"," trim = Lang.trim,",""," INVALID_VALUE = Y.Attribute.INVALID_VALUE,",""," _FUNCTION_VALIDATOR = '_functionValidator',"," _SOURCE_SUCCESS = '_sourceSuccess',",""," ALLOW_BROWSER_AC = 'allowBrowserAutocomplete',"," INPUT_NODE = 'inputNode',"," QUERY = 'query',"," QUERY_DELIMITER = 'queryDelimiter',"," REQUEST_TEMPLATE = 'requestTemplate',"," RESULTS = 'results',"," RESULT_LIST_LOCATOR = 'resultListLocator',"," VALUE = 'value',"," VALUE_CHANGE = 'valueChange',",""," EVT_CLEAR = 'clear',"," EVT_QUERY = QUERY,"," EVT_RESULTS = RESULTS;","","function AutoCompleteBase() {}","","AutoCompleteBase.prototype = {"," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function () {"," // AOP bindings."," Y.before(this._bindUIACBase, this, 'bindUI');"," Y.before(this._syncUIACBase, this, 'syncUI');",""," // -- Public Events ----------------------------------------------------",""," /**"," Fires after the query has been completely cleared or no longer meets the"," minimum query length requirement.",""," @event clear"," @param {String} prevVal Value of the query before it was cleared."," @param {String} src Source of the event."," @preventable _defClearFn"," **/"," this.publish(EVT_CLEAR, {"," defaultFn: this._defClearFn"," });",""," /**"," Fires when the contents of the input field have changed and the input"," value meets the criteria necessary to generate an autocomplete query.",""," @event query"," @param {String} inputValue Full contents of the text input field or"," textarea that generated the query."," @param {String} query AutoComplete query. This is the string that will"," be used to request completion results. It may or may not be the same"," as `inputValue`."," @param {String} src Source of the event."," @preventable _defQueryFn"," **/"," this.publish(EVT_QUERY, {"," defaultFn: this._defQueryFn"," });",""," /**"," Fires after query results are received from the source. If no source has"," been set, this event will not fire.",""," @event results"," @param {Array|Object} data Raw, unfiltered result data (if available)."," @param {String} query Query that generated these results."," @param {Object[]} results Array of filtered, formatted, and highlighted"," results. Each item in the array is an object with the following"," properties:",""," @param {Node|HTMLElement|String} results.display Formatted result"," HTML suitable for display to the user. If no custom formatter is"," set, this will be an HTML-escaped version of the string in the"," `text` property."," @param {String} [results.highlighted] Highlighted (but not"," formatted) result text. This property will only be set if a"," highlighter is in use."," @param {Any} results.raw Raw, unformatted result in whatever form it"," was provided by the source."," @param {String} results.text Plain text version of the result,"," suitable for being inserted into the value of a text input field"," or textarea when the result is selected by a user. This value is"," not HTML-escaped and should not be inserted into the page using"," `innerHTML` or `Node#setContent()`.",""," @preventable _defResultsFn"," **/"," this.publish(EVT_RESULTS, {"," defaultFn: this._defResultsFn"," });"," },",""," destructor: function () {"," this._acBaseEvents && this._acBaseEvents.detach();",""," delete this._acBaseEvents;"," delete this._cache;"," delete this._inputNode;"," delete this._rawSource;"," },",""," // -- Public Prototype Methods ---------------------------------------------",""," /**"," Clears the result cache.",""," @method clearCache"," @chainable"," @since 3.5.0"," **/"," clearCache: function () {"," this._cache && (this._cache = {});"," return this;"," },",""," /**"," Sends a request to the configured source. If no source is configured, this"," method won't do anything.",""," Usually there's no reason to call this method manually; it will be called"," automatically when user input causes a `query` event to be fired. The only"," time you'll need to call this method manually is if you want to force a"," request to be sent when no user input has occurred.",""," @method sendRequest"," @param {String} [query] Query to send. If specified, the `query` attribute"," will be set to this query. If not specified, the current value of the"," `query` attribute will be used."," @param {Function} [requestTemplate] Request template function. If not"," specified, the current value of the `requestTemplate` attribute will be"," used."," @chainable"," **/"," sendRequest: function (query, requestTemplate) {"," var request,"," source = this.get('source');",""," if (query || query === '') {"," this._set(QUERY, query);"," } else {"," query = this.get(QUERY) || '';"," }",""," if (source) {"," if (!requestTemplate) {"," requestTemplate = this.get(REQUEST_TEMPLATE);"," }",""," request = requestTemplate ?"," requestTemplate.call(this, query) : query;","",""," source.sendRequest({"," query : query,"," request: request,",""," callback: {"," success: Y.bind(this._onResponse, this, query)"," }"," });"," }",""," return this;"," },",""," // -- Protected Lifecycle Methods ------------------------------------------",""," /**"," Attaches event listeners and behaviors.",""," @method _bindUIACBase"," @protected"," **/"," _bindUIACBase: function () {"," var inputNode = this.get(INPUT_NODE),"," tokenInput = inputNode && inputNode.tokenInput;",""," // If the inputNode has a node-tokeninput plugin attached, bind to the"," // plugin's inputNode instead."," if (tokenInput) {"," inputNode = tokenInput.get(INPUT_NODE);"," this._set('tokenInput', tokenInput);"," }",""," if (!inputNode) {"," Y.error('No inputNode specified.');"," return;"," }",""," this._inputNode = inputNode;",""," this._acBaseEvents = new Y.EventHandle(["," // This is the valueChange event on the inputNode, provided by the"," // event-valuechange module, not our own valueChange."," inputNode.on(VALUE_CHANGE, this._onInputValueChange, this),"," inputNode.on('blur', this._onInputBlur, this),",""," this.after(ALLOW_BROWSER_AC + 'Change', this._syncBrowserAutocomplete),"," this.after('sourceTypeChange', this._afterSourceTypeChange),"," this.after(VALUE_CHANGE, this._afterValueChange)"," ]);"," },",""," /**"," Synchronizes the UI state of the `inputNode`.",""," @method _syncUIACBase"," @protected"," **/"," _syncUIACBase: function () {"," this._syncBrowserAutocomplete();"," this.set(VALUE, this.get(INPUT_NODE).get(VALUE));"," },",""," // -- Protected Prototype Methods ------------------------------------------",""," /**"," Creates a DataSource-like object that simply returns the specified array as"," a response. See the `source` attribute for more details.",""," @method _createArraySource"," @param {Array} source"," @return {Object} DataSource-like object."," @protected"," **/"," _createArraySource: function (source) {"," var that = this;",""," return {"," type: 'array',"," sendRequest: function (request) {"," that[_SOURCE_SUCCESS](source.concat(), request);"," }"," };"," },",""," /**"," Creates a DataSource-like object that passes the query to a custom-defined"," function, which is expected to call the provided callback with an array of"," results. See the `source` attribute for more details.",""," @method _createFunctionSource"," @param {Function} source Function that accepts a query and a callback as"," parameters, and calls the callback with an array of results."," @return {Object} DataSource-like object."," @protected"," **/"," _createFunctionSource: function (source) {"," var that = this;",""," return {"," type: 'function',"," sendRequest: function (request) {"," var value;",""," function afterResults(results) {"," that[_SOURCE_SUCCESS](results || [], request);"," }",""," // Allow both synchronous and asynchronous functions. If we get"," // a truthy return value, assume the function is synchronous."," if ((value = source(request.query, afterResults))) {"," afterResults(value);"," }"," }"," };"," },",""," /**"," Creates a DataSource-like object that looks up queries as properties on the"," specified object, and returns the found value (if any) as a response. See"," the `source` attribute for more details.",""," @method _createObjectSource"," @param {Object} source"," @return {Object} DataSource-like object."," @protected"," **/"," _createObjectSource: function (source) {"," var that = this;",""," return {"," type: 'object',"," sendRequest: function (request) {"," var query = request.query;",""," that[_SOURCE_SUCCESS]("," YObject.owns(source, query) ? source[query] : [],"," request"," );"," }"," };"," },",""," /**"," Returns `true` if _value_ is either a function or `null`.",""," @method _functionValidator"," @param {Function|null} value Value to validate."," @protected"," **/"," _functionValidator: function (value) {"," return value === null || isFunction(value);"," },",""," /**"," Faster and safer alternative to `Y.Object.getValue()`. Doesn't bother"," casting the path to an array (since we already know it's an array) and"," doesn't throw an error if a value in the middle of the object hierarchy is"," neither `undefined` nor an object.",""," @method _getObjectValue"," @param {Object} obj"," @param {Array} path"," @return {Any} Located value, or `undefined` if the value was"," not found at the specified path."," @protected"," **/"," _getObjectValue: function (obj, path) {"," if (!obj) {"," return;"," }",""," for (var i = 0, len = path.length; obj && i < len; i++) {"," obj = obj[path[i]];"," }",""," return obj;"," },",""," /**"," Parses result responses, performs filtering and highlighting, and fires the"," `results` event.",""," @method _parseResponse"," @param {String} query Query that generated these results."," @param {Object} response Response containing results."," @param {Object} data Raw response data."," @protected"," **/"," _parseResponse: function (query, response, data) {"," var facade = {"," data : data,"," query : query,"," results: []"," },",""," listLocator = this.get(RESULT_LIST_LOCATOR),"," results = [],"," unfiltered = response && response.results,",""," filters,"," formatted,"," formatter,"," highlighted,"," highlighter,"," i,"," len,"," maxResults,"," result,"," text,"," textLocator;",""," if (unfiltered && listLocator) {"," unfiltered = listLocator.call(this, unfiltered);"," }",""," if (unfiltered && unfiltered.length) {"," filters = this.get('resultFilters');"," textLocator = this.get('resultTextLocator');",""," // Create a lightweight result object for each result to make them"," // easier to work with. The various properties on the object"," // represent different formats of the result, and will be populated"," // as we go."," for (i = 0, len = unfiltered.length; i < len; ++i) {"," result = unfiltered[i];",""," text = textLocator ?"," textLocator.call(this, result) :"," result.toString();",""," results.push({"," display: Escape.html(text),"," raw : result,"," text : text"," });"," }",""," // Run the results through all configured result filters. Each"," // filter returns an array of (potentially fewer) result objects,"," // which is then passed to the next filter, and so on."," for (i = 0, len = filters.length; i < len; ++i) {"," results = filters[i].call(this, query, results.concat());",""," if (!results) {"," return;"," }",""," if (!results.length) {"," break;"," }"," }",""," if (results.length) {"," formatter = this.get('resultFormatter');"," highlighter = this.get('resultHighlighter');"," maxResults = this.get('maxResults');",""," // If maxResults is set and greater than 0, limit the number of"," // results."," if (maxResults && maxResults > 0 &&"," results.length > maxResults) {"," results.length = maxResults;"," }",""," // Run the results through the configured highlighter (if any)."," // The highlighter returns an array of highlighted strings (not"," // an array of result objects), and these strings are then added"," // to each result object."," if (highlighter) {"," highlighted = highlighter.call(this, query,"," results.concat());",""," if (!highlighted) {"," return;"," }",""," for (i = 0, len = highlighted.length; i < len; ++i) {"," result = results[i];"," result.highlighted = highlighted[i];"," result.display = result.highlighted;"," }"," }",""," // Run the results through the configured formatter (if any) to"," // produce the final formatted results. The formatter returns an"," // array of strings or Node instances (not an array of result"," // objects), and these strings/Nodes are then added to each"," // result object."," if (formatter) {"," formatted = formatter.call(this, query, results.concat());",""," if (!formatted) {"," return;"," }",""," for (i = 0, len = formatted.length; i < len; ++i) {"," results[i].display = formatted[i];"," }"," }"," }"," }",""," facade.results = results;"," this.fire(EVT_RESULTS, facade);"," },",""," /**"," Returns the query portion of the specified input value, or `null` if there"," is no suitable query within the input value.",""," If a query delimiter is defined, the query will be the last delimited part"," of of the string.",""," @method _parseValue"," @param {String} value Input value from which to extract the query."," @return {String|null} query"," @protected"," **/"," _parseValue: function (value) {"," var delim = this.get(QUERY_DELIMITER);",""," if (delim) {"," value = value.split(delim);"," value = value[value.length - 1];"," }",""," return Lang.trimLeft(value);"," },",""," /**"," Setter for the `enableCache` attribute.",""," @method _setEnableCache"," @param {Boolean} value"," @protected"," @since 3.5.0"," **/"," _setEnableCache: function (value) {"," // When `this._cache` is an object, result sources will store cached"," // results in it. When it's falsy, they won't. This way result sources"," // don't need to get the value of the `enableCache` attribute on every"," // request, which would be sloooow."," this._cache = value ? {} : null;"," },",""," /**"," Setter for locator attributes.",""," @method _setLocator"," @param {Function|String|null} locator"," @return {Function|null}"," @protected"," **/"," _setLocator: function (locator) {"," if (this[_FUNCTION_VALIDATOR](locator)) {"," return locator;"," }",""," var that = this;",""," locator = locator.toString().split('.');",""," return function (result) {"," return result && that._getObjectValue(result, locator);"," };"," },",""," /**"," Setter for the `requestTemplate` attribute.",""," @method _setRequestTemplate"," @param {Function|String|null} template"," @return {Function|null}"," @protected"," **/"," _setRequestTemplate: function (template) {"," if (this[_FUNCTION_VALIDATOR](template)) {"," return template;"," }",""," template = template.toString();",""," return function (query) {"," return Lang.sub(template, {query: encodeURIComponent(query)});"," };"," },",""," /**"," Setter for the `resultFilters` attribute.",""," @method _setResultFilters"," @param {Array|Function|String|null} filters `null`, a filter"," function, an array of filter functions, or a string or array of strings"," representing the names of methods on `Y.AutoCompleteFilters`."," @return {Function[]} Array of filter functions (empty if <i>filters</i> is"," `null`)."," @protected"," **/"," _setResultFilters: function (filters) {"," var acFilters, getFilterFunction;",""," if (filters === null) {"," return [];"," }",""," acFilters = Y.AutoCompleteFilters;",""," getFilterFunction = function (filter) {"," if (isFunction(filter)) {"," return filter;"," }",""," if (isString(filter) && acFilters &&"," isFunction(acFilters[filter])) {"," return acFilters[filter];"," }",""," return false;"," };",""," if (Lang.isArray(filters)) {"," filters = YArray.map(filters, getFilterFunction);"," return YArray.every(filters, function (f) { return !!f; }) ?"," filters : INVALID_VALUE;"," } else {"," filters = getFilterFunction(filters);"," return filters ? [filters] : INVALID_VALUE;"," }"," },",""," /**"," Setter for the `resultHighlighter` attribute.",""," @method _setResultHighlighter"," @param {Function|String|null} highlighter `null`, a highlighter function, or"," a string representing the name of a method on"," `Y.AutoCompleteHighlighters`."," @return {Function|null}"," @protected"," **/"," _setResultHighlighter: function (highlighter) {"," var acHighlighters;",""," if (this[_FUNCTION_VALIDATOR](highlighter)) {"," return highlighter;"," }",""," acHighlighters = Y.AutoCompleteHighlighters;",""," if (isString(highlighter) && acHighlighters &&"," isFunction(acHighlighters[highlighter])) {"," return acHighlighters[highlighter];"," }",""," return INVALID_VALUE;"," },",""," /**"," Setter for the `source` attribute. Returns a DataSource or a DataSource-like"," object depending on the type of _source_ and/or the value of the"," `sourceType` attribute.",""," @method _setSource"," @param {Any} source AutoComplete source. See the `source` attribute for"," details."," @return {DataSource|Object}"," @protected"," **/"," _setSource: function (source) {"," var sourceType = this.get('sourceType') || Lang.type(source),"," sourceSetter;",""," if ((source && isFunction(source.sendRequest))"," || source === null"," || sourceType === 'datasource') {",""," // Quacks like a DataSource instance (or null). Make it so!"," this._rawSource = source;"," return source;"," }",""," // See if there's a registered setter for this source type."," if ((sourceSetter = AutoCompleteBase.SOURCE_TYPES[sourceType])) {"," this._rawSource = source;"," return Lang.isString(sourceSetter) ?"," this[sourceSetter](source) : sourceSetter(source);"," }",""," Y.error(\"Unsupported source type '\" + sourceType + \"'. Maybe autocomplete-sources isn't loaded?\");"," return INVALID_VALUE;"," },",""," /**"," Shared success callback for non-DataSource sources.",""," @method _sourceSuccess"," @param {Any} data Response data."," @param {Object} request Request object."," @protected"," **/"," _sourceSuccess: function (data, request) {"," request.callback.success({"," data: data,"," response: {results: data}"," });"," },",""," /**"," Synchronizes the UI state of the `allowBrowserAutocomplete` attribute.",""," @method _syncBrowserAutocomplete"," @protected"," **/"," _syncBrowserAutocomplete: function () {"," var inputNode = this.get(INPUT_NODE);",""," if (inputNode.get('nodeName').toLowerCase() === 'input') {"," inputNode.setAttribute('autocomplete',"," this.get(ALLOW_BROWSER_AC) ? 'on' : 'off');"," }"," },",""," /**"," Updates the query portion of the `value` attribute.",""," If a query delimiter is defined, the last delimited portion of the input"," value will be replaced with the specified _value_.",""," @method _updateValue"," @param {String} newVal New value."," @protected"," **/"," _updateValue: function (newVal) {"," var delim = this.get(QUERY_DELIMITER),"," insertDelim,"," len,"," prevVal;",""," newVal = Lang.trimLeft(newVal);",""," if (delim) {"," insertDelim = trim(delim); // so we don't double up on spaces"," prevVal = YArray.map(trim(this.get(VALUE)).split(delim), trim);"," len = prevVal.length;",""," if (len > 1) {"," prevVal[len - 1] = newVal;"," newVal = prevVal.join(insertDelim + ' ');"," }",""," newVal = newVal + insertDelim + ' ';"," }",""," this.set(VALUE, newVal);"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Updates the current `source` based on the new `sourceType` to ensure that"," the two attributes don't get out of sync when they're changed separately.",""," @method _afterSourceTypeChange"," @param {EventFacade} e"," @protected"," **/"," _afterSourceTypeChange: function (e) {"," if (this._rawSource) {"," this.set('source', this._rawSource);"," }"," },",""," /**"," Handles change events for the `value` attribute.",""," @method _afterValueChange"," @param {EventFacade} e"," @protected"," **/"," _afterValueChange: function (e) {"," var newVal = e.newVal,"," self = this,"," uiChange = e.src === AutoCompleteBase.UI_SRC,"," delay, fire, minQueryLength, query;",""," // Update the UI if the value was changed programmatically."," if (!uiChange) {"," self._inputNode.set(VALUE, newVal);"," }","",""," minQueryLength = self.get('minQueryLength');"," query = self._parseValue(newVal) || '';",""," if (minQueryLength >= 0 && query.length >= minQueryLength) {"," // Only query on changes that originate from the UI."," if (uiChange) {"," delay = self.get('queryDelay');",""," fire = function () {"," self.fire(EVT_QUERY, {"," inputValue: newVal,"," query : query,"," src : e.src"," });"," };",""," if (delay) {"," clearTimeout(self._delay);"," self._delay = setTimeout(fire, delay);"," } else {"," fire();"," }"," } else {"," // For programmatic value changes, just update the query"," // attribute without sending a query."," self._set(QUERY, query);"," }"," } else {"," clearTimeout(self._delay);",""," self.fire(EVT_CLEAR, {"," prevVal: e.prevVal ? self._parseValue(e.prevVal) : null,"," src : e.src"," });"," }"," },",""," /**"," Handles `blur` events on the input node.",""," @method _onInputBlur"," @param {EventFacade} e"," @protected"," **/"," _onInputBlur: function (e) {"," var delim = this.get(QUERY_DELIMITER),"," delimPos,"," newVal,"," value;",""," // If a query delimiter is set and the input's value contains one or"," // more trailing delimiters, strip them."," if (delim && !this.get('allowTrailingDelimiter')) {"," delim = Lang.trimRight(delim);"," value = newVal = this._inputNode.get(VALUE);",""," if (delim) {"," while ((newVal = Lang.trimRight(newVal)) &&"," (delimPos = newVal.length - delim.length) &&"," newVal.lastIndexOf(delim) === delimPos) {",""," newVal = newVal.substring(0, delimPos);"," }"," } else {"," // Delimiter is one or more space characters, so just trim the"," // value."," newVal = Lang.trimRight(newVal);"," }",""," if (newVal !== value) {"," this.set(VALUE, newVal);"," }"," }"," },",""," /**"," Handles `valueChange` events on the input node and fires a `query` event"," when the input value meets the configured criteria.",""," @method _onInputValueChange"," @param {EventFacade} e"," @protected"," **/"," _onInputValueChange: function (e) {"," var newVal = e.newVal;",""," // Don't query if the internal value is the same as the new value"," // reported by valueChange."," if (newVal !== this.get(VALUE)) {"," this.set(VALUE, newVal, {src: AutoCompleteBase.UI_SRC});"," }"," },",""," /**"," Handles source responses and fires the `results` event.",""," @method _onResponse"," @param {EventFacade} e"," @protected"," **/"," _onResponse: function (query, e) {"," // Ignore stale responses that aren't for the current query."," if (query === (this.get(QUERY) || '')) {"," this._parseResponse(query || '', e.response, e.data);"," }"," },",""," // -- Protected Default Event Handlers -------------------------------------",""," /**"," Default `clear` event handler. Sets the `results` attribute to an empty"," array and `query` to null.",""," @method _defClearFn"," @protected"," **/"," _defClearFn: function () {"," this._set(QUERY, null);"," this._set(RESULTS, []);"," },",""," /**"," Default `query` event handler. Sets the `query` attribute and sends a"," request to the source if one is configured.",""," @method _defQueryFn"," @param {EventFacade} e"," @protected"," **/"," _defQueryFn: function (e) {"," this.sendRequest(e.query); // sendRequest will set the 'query' attribute"," },",""," /**"," Default `results` event handler. Sets the `results` attribute to the latest"," results.",""," @method _defResultsFn"," @param {EventFacade} e"," @protected"," **/"," _defResultsFn: function (e) {"," this._set(RESULTS, e[RESULTS]);"," }","};","","AutoCompleteBase.ATTRS = {"," /**"," Whether or not to enable the browser's built-in autocomplete functionality"," for input fields.",""," @attribute allowBrowserAutocomplete"," @type Boolean"," @default false"," **/"," allowBrowserAutocomplete: {"," value: false"," },",""," /**"," When a `queryDelimiter` is set, trailing delimiters will automatically be"," stripped from the input value by default when the input node loses focus."," Set this to `true` to allow trailing delimiters.",""," @attribute allowTrailingDelimiter"," @type Boolean"," @default false"," **/"," allowTrailingDelimiter: {"," value: false"," },",""," /**"," Whether or not to enable in-memory caching in result sources that support"," it.",""," @attribute enableCache"," @type Boolean"," @default true"," @since 3.5.0"," **/"," enableCache: {"," lazyAdd: false, // we need the setter to run on init"," setter: '_setEnableCache',"," value: true"," },",""," /**"," Node to monitor for changes, which will generate `query` events when"," appropriate. May be either an `<input>` or a `<textarea>`.",""," @attribute inputNode"," @type Node|HTMLElement|String"," @initOnly"," **/"," inputNode: {"," setter: Y.one,"," writeOnce: 'initOnly'"," },",""," /**"," Maximum number of results to return. A value of `0` or less will allow an"," unlimited number of results.",""," @attribute maxResults"," @type Number"," @default 0"," **/"," maxResults: {"," value: 0"," },",""," /**"," Minimum number of characters that must be entered before a `query` event"," will be fired. A value of `0` allows empty queries; a negative value will"," effectively disable all `query` events.",""," @attribute minQueryLength"," @type Number"," @default 1"," **/"," minQueryLength: {"," value: 1"," },",""," /**"," Current query, or `null` if there is no current query.",""," The query might not be the same as the current value of the input node, both"," for timing reasons (due to `queryDelay`) and because when one or more"," `queryDelimiter` separators are in use, only the last portion of the"," delimited input string will be used as the query value.",""," @attribute query"," @type String|null"," @default null"," @readonly"," **/"," query: {"," readOnly: true,"," value: null"," },",""," /**"," Number of milliseconds to delay after input before triggering a `query`"," event. If new input occurs before this delay is over, the previous input"," event will be ignored and a new delay will begin.",""," This can be useful both to throttle queries to a remote data source and to"," avoid distracting the user by showing them less relevant results before"," they've paused their typing.",""," @attribute queryDelay"," @type Number"," @default 100"," **/"," queryDelay: {"," value: 100"," },",""," /**"," Query delimiter string. When a delimiter is configured, the input value"," will be split on the delimiter, and only the last portion will be used in"," autocomplete queries and updated when the `query` attribute is"," modified.",""," @attribute queryDelimiter"," @type String|null"," @default null"," **/"," queryDelimiter: {"," value: null"," },",""," /**"," Source request template. This can be a function that accepts a query as a"," parameter and returns a request string, or it can be a string containing the"," placeholder \"{query}\", which will be replaced with the actual URI-encoded"," query. In either case, the resulting string will be appended to the request"," URL when the `source` attribute is set to a remote DataSource, JSONP URL, or"," XHR URL (it will not be appended to YQL URLs).",""," While `requestTemplate` may be set to either a function or a string, it will"," always be returned as a function that accepts a query argument and returns a"," string.",""," @attribute requestTemplate"," @type Function|String|null"," @default null"," **/"," requestTemplate: {"," setter: '_setRequestTemplate',"," value: null"," },",""," /**"," Array of local result filter functions. If provided, each filter will be"," called with two arguments when results are received: the query and an array"," of result objects. See the documentation for the `results` event for a list"," of the properties available on each result object.",""," Each filter is expected to return a filtered or modified version of the"," results array, which will then be passed on to subsequent filters, then the"," `resultHighlighter` function (if set), then the `resultFormatter` function"," (if set), and finally to subscribers to the `results` event.",""," If no `source` is set, result filters will not be called.",""," Prepackaged result filters provided by the autocomplete-filters and"," autocomplete-filters-accentfold modules can be used by specifying the filter"," name as a string, such as `'phraseMatch'` (assuming the necessary filters"," module is loaded).",""," @attribute resultFilters"," @type Array"," @default []"," **/"," resultFilters: {"," setter: '_setResultFilters',"," value: []"," },",""," /**"," Function which will be used to format results. If provided, this function"," will be called with two arguments after results have been received and"," filtered: the query and an array of result objects. The formatter is"," expected to return an array of HTML strings or Node instances containing the"," desired HTML for each result.",""," See the documentation for the `results` event for a list of the properties"," available on each result object.",""," If no `source` is set, the formatter will not be called.",""," @attribute resultFormatter"," @type Function|null"," **/"," resultFormatter: {"," validator: _FUNCTION_VALIDATOR,"," value: null"," },",""," /**"," Function which will be used to highlight results. If provided, this function"," will be called with two arguments after results have been received and"," filtered: the query and an array of filtered result objects. The highlighter"," is expected to return an array of highlighted result text in the form of"," HTML strings.",""," See the documentation for the `results` event for a list of the properties"," available on each result object.",""," If no `source` is set, the highlighter will not be called.",""," @attribute resultHighlighter"," @type Function|null"," **/"," resultHighlighter: {"," setter: '_setResultHighlighter',"," value: null"," },",""," /**"," Locator that should be used to extract an array of results from a non-array"," response.",""," By default, no locator is applied, and all responses are assumed to be"," arrays by default. If all responses are already arrays, you don't need to"," define a locator.",""," The locator may be either a function (which will receive the raw response as"," an argument and must return an array) or a string representing an object"," path, such as \"foo.bar.baz\" (which would return the value of"," `result.foo.bar.baz` if the response is an object).",""," While `resultListLocator` may be set to either a function or a string, it"," will always be returned as a function that accepts a response argument and"," returns an array.",""," @attribute resultListLocator"," @type Function|String|null"," **/"," resultListLocator: {"," setter: '_setLocator',"," value: null"," },",""," /**"," Current results, or an empty array if there are no results.",""," @attribute results"," @type Array"," @default []"," @readonly"," **/"," results: {"," readOnly: true,"," value: []"," },",""," /**"," Locator that should be used to extract a plain text string from a non-string"," result item. The resulting text value will typically be the value that ends"," up being inserted into an input field or textarea when the user of an"," autocomplete implementation selects a result.",""," By default, no locator is applied, and all results are assumed to be plain"," text strings. If all results are already plain text strings, you don't need"," to define a locator.",""," The locator may be either a function (which will receive the raw result as"," an argument and must return a string) or a string representing an object"," path, such as \"foo.bar.baz\" (which would return the value of"," `result.foo.bar.baz` if the result is an object).",""," While `resultTextLocator` may be set to either a function or a string, it"," will always be returned as a function that accepts a result argument and"," returns a string.",""," @attribute resultTextLocator"," @type Function|String|null"," **/"," resultTextLocator: {"," setter: '_setLocator',"," value: null"," },",""," /**"," Source for autocomplete results. The following source types are supported:",""," <dl>"," <dt>Array</dt>"," <dd>"," <p>"," The full array will be provided to any configured filters for each"," query. This is an easy way to create a fully client-side autocomplete"," implementation."," </p>",""," <p>"," Example: `['first result', 'second result', 'etc']`"," </p>"," </dd>",""," <dt>DataSource</dt>"," <dd>"," A `DataSource` instance or other object that provides a DataSource-like"," `sendRequest` method. See the `DataSource` documentation for details."," </dd>",""," <dt>Function</dt>"," <dd>"," <p>"," A function source will be called with the current query and a"," callback function as parameters, and should either return an array of"," results (for synchronous operation) or return nothing and pass an"," array of results to the provided callback (for asynchronous"," operation)."," </p>",""," <p>"," Example (synchronous):"," </p>",""," <pre>"," function (query) {"," return ['foo', 'bar'];"," }"," </pre>",""," <p>"," Example (async):"," </p>",""," <pre>"," function (query, callback) {"," callback(['foo', 'bar']);"," }"," </pre>"," </dd>",""," <dt>Object</dt>"," <dd>"," <p>"," An object will be treated as a query hashmap. If a property on the"," object matches the current query, the value of that property will be"," used as the response."," </p>",""," <p>"," The response is assumed to be an array of results by default. If the"," response is not an array, provide a `resultListLocator` to"," process the response and return an array."," </p>",""," <p>"," Example: `{foo: ['foo result 1', 'foo result 2'], bar: ['bar result']}`"," </p>"," </dd>"," </dl>",""," If the optional `autocomplete-sources` module is loaded, then"," the following additional source types will be supported as well:",""," <dl>"," <dt><select> Node</dt>"," <dd>"," You may provide a YUI Node instance wrapping a <select>"," element, and the options in the list will be used as results. You"," will also need to specify a `resultTextLocator` of 'text'"," or 'value', depending on what you want to use as the text of the"," result.",""," Each result will be an object with the following properties:",""," <dl>"," <dt>html (String)</dt>"," <dd>"," <p>HTML content of the <option> element.</p>"," </dd>",""," <dt>index (Number)</dt>"," <dd>"," <p>Index of the <option> element in the list.</p>"," </dd>",""," <dt>node (Y.Node)</dt>"," <dd>"," <p>Node instance referring to the original <option> element.</p>"," </dd>",""," <dt>selected (Boolean)</dt>"," <dd>"," <p>Whether or not this item is currently selected in the"," <select> list.</p>"," </dd>",""," <dt>text (String)</dt>"," <dd>"," <p>Text content of the <option> element.</p>"," </dd>",""," <dt>value (String)</dt>"," <dd>"," <p>Value of the <option> element.</p>"," </dd>"," </dl>"," </dd>",""," <dt>String (JSONP URL)</dt>"," <dd>"," <p>"," If a URL with a `{callback}` placeholder is provided, it will be used to"," make a JSONP request. The `{query}` placeholder will be replaced with"," the current query, and the `{callback}` placeholder will be replaced"," with an internally-generated JSONP callback name. Both placeholders must"," appear in the URL, or the request will fail. An optional `{maxResults}`"," placeholder may also be provided, and will be replaced with the value of"," the maxResults attribute (or 1000 if the maxResults attribute is 0 or"," less)."," </p>",""," <p>"," The response is assumed to be an array of results by default. If the"," response is not an array, provide a `resultListLocator` to process the"," response and return an array."," </p>",""," <p>"," <strong>The `jsonp` module must be loaded in order for"," JSONP URL sources to work.</strong> If the `jsonp` module"," is not already loaded, it will be loaded on demand if possible."," </p>",""," <p>"," Example: `'http://example.com/search?q={query}&callback={callback}'`"," </p>"," </dd>",""," <dt>String (XHR URL)</dt>"," <dd>"," <p>"," If a URL without a `{callback}` placeholder is provided, it will be used"," to make a same-origin XHR request. The `{query}` placeholder will be"," replaced with the current query. An optional `{maxResults}` placeholder"," may also be provided, and will be replaced with the value of the"," maxResults attribute (or 1000 if the maxResults attribute is 0 or less)."," </p>",""," <p>"," The response is assumed to be a JSON array of results by default. If the"," response is a JSON object and not an array, provide a"," `resultListLocator` to process the response and return an array. If the"," response is in some form other than JSON, you will need to use a custom"," DataSource instance as the source."," </p>",""," <p>"," <strong>The `io-base` and `json-parse` modules"," must be loaded in order for XHR URL sources to work.</strong> If"," these modules are not already loaded, they will be loaded on demand"," if possible."," </p>",""," <p>"," Example: `'http://example.com/search?q={query}'`"," </p>"," </dd>",""," <dt>String (YQL query)</dt>"," <dd>"," <p>"," If a YQL query is provided, it will be used to make a YQL request. The"," `{query}` placeholder will be replaced with the current autocomplete"," query. This placeholder must appear in the YQL query, or the request"," will fail. An optional `{maxResults}` placeholder may also be provided,"," and will be replaced with the value of the maxResults attribute (or 1000"," if the maxResults attribute is 0 or less)."," </p>",""," <p>"," <strong>The `yql` module must be loaded in order for YQL"," sources to work.</strong> If the `yql` module is not"," already loaded, it will be loaded on demand if possible."," </p>",""," <p>"," Example: `'select * from search.suggest where query=\"{query}\"'`"," </p>"," </dd>"," </dl>",""," As an alternative to providing a source, you could simply listen for `query`"," events and handle them any way you see fit. Providing a source is optional,"," but will usually be simpler.",""," @attribute source"," @type Array|DataSource|Function|Node|Object|String|null"," **/"," source: {"," setter: '_setSource',"," value: null"," },",""," /**"," May be used to force a specific source type, overriding the automatic source"," type detection. It should almost never be necessary to do this, but as they"," taught us in the Boy Scouts, one should always be prepared, so it's here if"," you need it. Be warned that if you set this attribute and something breaks,"," it's your own fault.",""," Supported `sourceType` values are: 'array', 'datasource', 'function', and"," 'object'.",""," If the `autocomplete-sources` module is loaded, the following additional"," source types are supported: 'io', 'jsonp', 'select', 'string', 'yql'",""," @attribute sourceType"," @type String"," **/"," sourceType: {"," value: null"," },",""," /**"," If the `inputNode` specified at instantiation time has a `node-tokeninput`"," plugin attached to it, this attribute will be a reference to the"," `Y.Plugin.TokenInput` instance.",""," @attribute tokenInput"," @type Plugin.TokenInput"," @readonly"," **/"," tokenInput: {"," readOnly: true"," },",""," /**"," Current value of the input node.",""," @attribute value"," @type String"," @default ''"," **/"," value: {"," // Why duplicate this._inputNode.get('value')? Because we need a"," // reliable way to track the source of value changes. We want to perform"," // completion when the user changes the value, but not when we change"," // the value."," value: ''"," }","};","","// This tells Y.Base.create() to copy these static properties to any class","// AutoCompleteBase is mixed into.","AutoCompleteBase._buildCfg = {"," aggregates: ['SOURCE_TYPES'],"," statics : ['UI_SRC']","};","","/**","Mapping of built-in source types to their setter functions. DataSource instances","and DataSource-like objects are handled natively, so are not mapped here.","","@property SOURCE_TYPES","@type {Object}","@static","**/","AutoCompleteBase.SOURCE_TYPES = {"," array : '_createArraySource',"," 'function': '_createFunctionSource',"," object : '_createObjectSource'","};","","AutoCompleteBase.UI_SRC = (Y.Widget && Y.Widget.UI_SRC) || 'ui';","","Y.AutoCompleteBase = AutoCompleteBase;","","","}, '3.7.1', {\"optional\": [\"autocomplete-sources\"], \"requires\": [\"array-extras\", \"base-build\", \"escape\", \"event-valuechange\", \"node-base\"]});"];+_yuitest_coverage["build/autocomplete-base/autocomplete-base.js"].lines = {"1":0,"66":0,"94":0,"96":0,"100":0,"101":0,"114":0,"131":0,"163":0,"169":0,"171":0,"172":0,"173":0,"174":0,"187":0,"188":0,"210":0,"213":0,"214":0,"216":0,"219":0,"220":0,"221":0,"224":0,"228":0,"238":0,"250":0,"255":0,"256":0,"257":0,"260":0,"261":0,"262":0,"265":0,"267":0,"286":0,"287":0,"302":0,"304":0,"307":0,"324":0,"326":0,"329":0,"331":0,"332":0,"337":0,"338":0,"355":0,"357":0,"360":0,"362":0,"378":0,"395":0,"396":0,"399":0,"400":0,"403":0,"417":0,"439":0,"440":0,"443":0,"444":0,"445":0,"451":0,"452":0,"454":0,"458":0,"468":0,"469":0,"471":0,"472":0,"475":0,"476":0,"480":0,"481":0,"482":0,"483":0,"487":0,"489":0,"496":0,"497":0,"500":0,"501":0,"504":0,"505":0,"506":0,"507":0,"516":0,"517":0,"519":0,"520":0,"523":0,"524":0,"530":0,"531":0,"547":0,"549":0,"550":0,"551":0,"554":0,"570":0,"582":0,"583":0,"586":0,"588":0,"590":0,"591":0,"604":0,"605":0,"608":0,"610":0,"611":0,"627":0,"629":0,"630":0,"633":0,"635":0,"636":0,"637":0,"640":0,"642":0,"645":0,"648":0,"649":0,"650":0,"653":0,"654":0,"669":0,"671":0,"672":0,"675":0,"677":0,"679":0,"682":0,"697":0,"700":0,"705":0,"706":0,"710":0,"711":0,"712":0,"716":0,"717":0,"729":0,"742":0,"744":0,"745":0,"761":0,"766":0,"768":0,"769":0,"770":0,"771":0,"773":0,"774":0,"775":0,"778":0,"781":0,"795":0,"796":0,"808":0,"814":0,"815":0,"819":0,"820":0,"822":0,"824":0,"825":0,"827":0,"828":0,"835":0,"836":0,"837":0,"839":0,"844":0,"847":0,"849":0,"864":0,"871":0,"872":0,"873":0,"875":0,"876":0,"880":0,"885":0,"888":0,"889":0,"903":0,"907":0,"908":0,"921":0,"922":0,"936":0,"937":0,"949":0,"961":0,"965":0,"1514":0,"1527":0,"1533":0,"1535":0};+_yuitest_coverage["build/autocomplete-base/autocomplete-base.js"].functions = {"AutoCompleteBase:94":0,"initializer:98":0,"destructor:168":0,"clearCache:186":0,"sendRequest:209":0,"_bindUIACBase:249":0,"_syncUIACBase:285":0,"sendRequest:306":0,"_createArraySource:301":0,"afterResults:331":0,"sendRequest:328":0,"_createFunctionSource:323":0,"sendRequest:359":0,"_createObjectSource:354":0,"_functionValidator:377":0,"_getObjectValue:394":0,"_parseResponse:416":0,"_parseValue:546":0,"_setEnableCache:565":0,"(anonymous 2):590":0,"_setLocator:581":0,"(anonymous 3):610":0,"_setRequestTemplate:603":0,"getFilterFunction:635":0,"(anonymous 4):650":0,"_setResultFilters:626":0,"_setResultHighlighter:668":0,"_setSource:696":0,"_sourceSuccess:728":0,"_syncBrowserAutocomplete:741":0,"_updateValue:760":0,"_afterSourceTypeChange:794":0,"fire:827":0,"_afterValueChange:807":0,"_onInputBlur:863":0,"_onInputValueChange:902":0,"_onResponse:919":0,"_defClearFn:935":0,"_defQueryFn:948":0,"_defResultsFn:960":0,"(anonymous 1):1":0};+_yuitest_coverage["build/autocomplete-base/autocomplete-base.js"].coveredLines = 201;+_yuitest_coverage["build/autocomplete-base/autocomplete-base.js"].coveredFunctions = 41;+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 1);+YUI.add('autocomplete-base', function (Y, NAME) {++/**+Provides automatic input completion or suggestions for text input fields and+textareas.++@module autocomplete+@main autocomplete+@since 3.3.0+**/++/**+`Y.Base` extension that provides core autocomplete logic (but no UI+implementation) for a text input field or textarea. Must be mixed into a+`Y.Base`-derived class to be useful.++@module autocomplete+@submodule autocomplete-base+**/++/**+Extension that provides core autocomplete logic (but no UI implementation) for a+text input field or textarea.++The `AutoCompleteBase` class provides events and attributes that abstract away+core autocomplete logic and configuration, but does not provide a widget+implementation or suggestion UI. For a prepackaged autocomplete widget, see+`AutoCompleteList`.++This extension cannot be instantiated directly, since it doesn't provide an+actual implementation. It's intended to be mixed into a `Y.Base`-based class or+widget.++`Y.Widget`-based example:++ YUI().use('autocomplete-base', 'widget', function (Y) {+ var MyAC = Y.Base.create('myAC', Y.Widget, [Y.AutoCompleteBase], {+ // Custom prototype methods and properties.+ }, {+ // Custom static methods and properties.+ });++ // Custom implementation code.+ });++`Y.Base`-based example:++ YUI().use('autocomplete-base', function (Y) {+ var MyAC = Y.Base.create('myAC', Y.Base, [Y.AutoCompleteBase], {+ initializer: function () {+ this._bindUIACBase();+ this._syncUIACBase();+ },++ // Custom prototype methods and properties.+ }, {+ // Custom static methods and properties.+ });++ // Custom implementation code.+ });++@class AutoCompleteBase+**/++_yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "(anonymous 1)", 1);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 66);+var Escape = Y.Escape,+ Lang = Y.Lang,+ YArray = Y.Array,+ YObject = Y.Object,++ isFunction = Lang.isFunction,+ isString = Lang.isString,+ trim = Lang.trim,++ INVALID_VALUE = Y.Attribute.INVALID_VALUE,++ _FUNCTION_VALIDATOR = '_functionValidator',+ _SOURCE_SUCCESS = '_sourceSuccess',++ ALLOW_BROWSER_AC = 'allowBrowserAutocomplete',+ INPUT_NODE = 'inputNode',+ QUERY = 'query',+ QUERY_DELIMITER = 'queryDelimiter',+ REQUEST_TEMPLATE = 'requestTemplate',+ RESULTS = 'results',+ RESULT_LIST_LOCATOR = 'resultListLocator',+ VALUE = 'value',+ VALUE_CHANGE = 'valueChange',++ EVT_CLEAR = 'clear',+ EVT_QUERY = QUERY,+ EVT_RESULTS = RESULTS;++_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 94);+function AutoCompleteBase() {}++_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 96);+AutoCompleteBase.prototype = {+ // -- Lifecycle Methods ----------------------------------------------------+ initializer: function () {+ // AOP bindings.+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "initializer", 98);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 100);+Y.before(this._bindUIACBase, this, 'bindUI');+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 101);+Y.before(this._syncUIACBase, this, 'syncUI');++ // -- Public Events ----------------------------------------------------++ /**+ Fires after the query has been completely cleared or no longer meets the+ minimum query length requirement.++ @event clear+ @param {String} prevVal Value of the query before it was cleared.+ @param {String} src Source of the event.+ @preventable _defClearFn+ **/+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 114);+this.publish(EVT_CLEAR, {+ defaultFn: this._defClearFn+ });++ /**+ Fires when the contents of the input field have changed and the input+ value meets the criteria necessary to generate an autocomplete query.++ @event query+ @param {String} inputValue Full contents of the text input field or+ textarea that generated the query.+ @param {String} query AutoComplete query. This is the string that will+ be used to request completion results. It may or may not be the same+ as `inputValue`.+ @param {String} src Source of the event.+ @preventable _defQueryFn+ **/+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 131);+this.publish(EVT_QUERY, {+ defaultFn: this._defQueryFn+ });++ /**+ Fires after query results are received from the source. If no source has+ been set, this event will not fire.++ @event results+ @param {Array|Object} data Raw, unfiltered result data (if available).+ @param {String} query Query that generated these results.+ @param {Object[]} results Array of filtered, formatted, and highlighted+ results. Each item in the array is an object with the following+ properties:++ @param {Node|HTMLElement|String} results.display Formatted result+ HTML suitable for display to the user. If no custom formatter is+ set, this will be an HTML-escaped version of the string in the+ `text` property.+ @param {String} [results.highlighted] Highlighted (but not+ formatted) result text. This property will only be set if a+ highlighter is in use.+ @param {Any} results.raw Raw, unformatted result in whatever form it+ was provided by the source.+ @param {String} results.text Plain text version of the result,+ suitable for being inserted into the value of a text input field+ or textarea when the result is selected by a user. This value is+ not HTML-escaped and should not be inserted into the page using+ `innerHTML` or `Node#setContent()`.++ @preventable _defResultsFn+ **/+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 163);+this.publish(EVT_RESULTS, {+ defaultFn: this._defResultsFn+ });+ },++ destructor: function () {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "destructor", 168);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 169);+this._acBaseEvents && this._acBaseEvents.detach();++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 171);+delete this._acBaseEvents;+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 172);+delete this._cache;+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 173);+delete this._inputNode;+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 174);+delete this._rawSource;+ },++ // -- Public Prototype Methods ---------------------------------------------++ /**+ Clears the result cache.++ @method clearCache+ @chainable+ @since 3.5.0+ **/+ clearCache: function () {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "clearCache", 186);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 187);+this._cache && (this._cache = {});+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 188);+return this;+ },++ /**+ Sends a request to the configured source. If no source is configured, this+ method won't do anything.++ Usually there's no reason to call this method manually; it will be called+ automatically when user input causes a `query` event to be fired. The only+ time you'll need to call this method manually is if you want to force a+ request to be sent when no user input has occurred.++ @method sendRequest+ @param {String} [query] Query to send. If specified, the `query` attribute+ will be set to this query. If not specified, the current value of the+ `query` attribute will be used.+ @param {Function} [requestTemplate] Request template function. If not+ specified, the current value of the `requestTemplate` attribute will be+ used.+ @chainable+ **/+ sendRequest: function (query, requestTemplate) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "sendRequest", 209);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 210);+var request,+ source = this.get('source');++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 213);+if (query || query === '') {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 214);+this._set(QUERY, query);+ } else {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 216);+query = this.get(QUERY) || '';+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 219);+if (source) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 220);+if (!requestTemplate) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 221);+requestTemplate = this.get(REQUEST_TEMPLATE);+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 224);+request = requestTemplate ?+ requestTemplate.call(this, query) : query;+++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 228);+source.sendRequest({+ query : query,+ request: request,++ callback: {+ success: Y.bind(this._onResponse, this, query)+ }+ });+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 238);+return this;+ },++ // -- Protected Lifecycle Methods ------------------------------------------++ /**+ Attaches event listeners and behaviors.++ @method _bindUIACBase+ @protected+ **/+ _bindUIACBase: function () {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_bindUIACBase", 249);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 250);+var inputNode = this.get(INPUT_NODE),+ tokenInput = inputNode && inputNode.tokenInput;++ // If the inputNode has a node-tokeninput plugin attached, bind to the+ // plugin's inputNode instead.+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 255);+if (tokenInput) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 256);+inputNode = tokenInput.get(INPUT_NODE);+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 257);+this._set('tokenInput', tokenInput);+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 260);+if (!inputNode) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 261);+Y.error('No inputNode specified.');+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 262);+return;+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 265);+this._inputNode = inputNode;++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 267);+this._acBaseEvents = new Y.EventHandle([+ // This is the valueChange event on the inputNode, provided by the+ // event-valuechange module, not our own valueChange.+ inputNode.on(VALUE_CHANGE, this._onInputValueChange, this),+ inputNode.on('blur', this._onInputBlur, this),++ this.after(ALLOW_BROWSER_AC + 'Change', this._syncBrowserAutocomplete),+ this.after('sourceTypeChange', this._afterSourceTypeChange),+ this.after(VALUE_CHANGE, this._afterValueChange)+ ]);+ },++ /**+ Synchronizes the UI state of the `inputNode`.++ @method _syncUIACBase+ @protected+ **/+ _syncUIACBase: function () {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_syncUIACBase", 285);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 286);+this._syncBrowserAutocomplete();+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 287);+this.set(VALUE, this.get(INPUT_NODE).get(VALUE));+ },++ // -- Protected Prototype Methods ------------------------------------------++ /**+ Creates a DataSource-like object that simply returns the specified array as+ a response. See the `source` attribute for more details.++ @method _createArraySource+ @param {Array} source+ @return {Object} DataSource-like object.+ @protected+ **/+ _createArraySource: function (source) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_createArraySource", 301);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 302);+var that = this;++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 304);+return {+ type: 'array',+ sendRequest: function (request) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "sendRequest", 306);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 307);+that[_SOURCE_SUCCESS](source.concat(), request);+ }+ };+ },++ /**+ Creates a DataSource-like object that passes the query to a custom-defined+ function, which is expected to call the provided callback with an array of+ results. See the `source` attribute for more details.++ @method _createFunctionSource+ @param {Function} source Function that accepts a query and a callback as+ parameters, and calls the callback with an array of results.+ @return {Object} DataSource-like object.+ @protected+ **/+ _createFunctionSource: function (source) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_createFunctionSource", 323);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 324);+var that = this;++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 326);+return {+ type: 'function',+ sendRequest: function (request) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "sendRequest", 328);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 329);+var value;++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 331);+function afterResults(results) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "afterResults", 331);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 332);+that[_SOURCE_SUCCESS](results || [], request);+ }++ // Allow both synchronous and asynchronous functions. If we get+ // a truthy return value, assume the function is synchronous.+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 337);+if ((value = source(request.query, afterResults))) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 338);+afterResults(value);+ }+ }+ };+ },++ /**+ Creates a DataSource-like object that looks up queries as properties on the+ specified object, and returns the found value (if any) as a response. See+ the `source` attribute for more details.++ @method _createObjectSource+ @param {Object} source+ @return {Object} DataSource-like object.+ @protected+ **/+ _createObjectSource: function (source) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_createObjectSource", 354);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 355);+var that = this;++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 357);+return {+ type: 'object',+ sendRequest: function (request) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "sendRequest", 359);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 360);+var query = request.query;++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 362);+that[_SOURCE_SUCCESS](+ YObject.owns(source, query) ? source[query] : [],+ request+ );+ }+ };+ },++ /**+ Returns `true` if _value_ is either a function or `null`.++ @method _functionValidator+ @param {Function|null} value Value to validate.+ @protected+ **/+ _functionValidator: function (value) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_functionValidator", 377);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 378);+return value === null || isFunction(value);+ },++ /**+ Faster and safer alternative to `Y.Object.getValue()`. Doesn't bother+ casting the path to an array (since we already know it's an array) and+ doesn't throw an error if a value in the middle of the object hierarchy is+ neither `undefined` nor an object.++ @method _getObjectValue+ @param {Object} obj+ @param {Array} path+ @return {Any} Located value, or `undefined` if the value was+ not found at the specified path.+ @protected+ **/+ _getObjectValue: function (obj, path) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_getObjectValue", 394);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 395);+if (!obj) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 396);+return;+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 399);+for (var i = 0, len = path.length; obj && i < len; i++) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 400);+obj = obj[path[i]];+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 403);+return obj;+ },++ /**+ Parses result responses, performs filtering and highlighting, and fires the+ `results` event.++ @method _parseResponse+ @param {String} query Query that generated these results.+ @param {Object} response Response containing results.+ @param {Object} data Raw response data.+ @protected+ **/+ _parseResponse: function (query, response, data) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_parseResponse", 416);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 417);+var facade = {+ data : data,+ query : query,+ results: []+ },++ listLocator = this.get(RESULT_LIST_LOCATOR),+ results = [],+ unfiltered = response && response.results,++ filters,+ formatted,+ formatter,+ highlighted,+ highlighter,+ i,+ len,+ maxResults,+ result,+ text,+ textLocator;++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 439);+if (unfiltered && listLocator) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 440);+unfiltered = listLocator.call(this, unfiltered);+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 443);+if (unfiltered && unfiltered.length) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 444);+filters = this.get('resultFilters');+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 445);+textLocator = this.get('resultTextLocator');++ // Create a lightweight result object for each result to make them+ // easier to work with. The various properties on the object+ // represent different formats of the result, and will be populated+ // as we go.+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 451);+for (i = 0, len = unfiltered.length; i < len; ++i) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 452);+result = unfiltered[i];++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 454);+text = textLocator ?+ textLocator.call(this, result) :+ result.toString();++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 458);+results.push({+ display: Escape.html(text),+ raw : result,+ text : text+ });+ }++ // Run the results through all configured result filters. Each+ // filter returns an array of (potentially fewer) result objects,+ // which is then passed to the next filter, and so on.+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 468);+for (i = 0, len = filters.length; i < len; ++i) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 469);+results = filters[i].call(this, query, results.concat());++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 471);+if (!results) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 472);+return;+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 475);+if (!results.length) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 476);+break;+ }+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 480);+if (results.length) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 481);+formatter = this.get('resultFormatter');+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 482);+highlighter = this.get('resultHighlighter');+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 483);+maxResults = this.get('maxResults');++ // If maxResults is set and greater than 0, limit the number of+ // results.+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 487);+if (maxResults && maxResults > 0 &&+ results.length > maxResults) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 489);+results.length = maxResults;+ }++ // Run the results through the configured highlighter (if any).+ // The highlighter returns an array of highlighted strings (not+ // an array of result objects), and these strings are then added+ // to each result object.+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 496);+if (highlighter) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 497);+highlighted = highlighter.call(this, query,+ results.concat());++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 500);+if (!highlighted) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 501);+return;+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 504);+for (i = 0, len = highlighted.length; i < len; ++i) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 505);+result = results[i];+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 506);+result.highlighted = highlighted[i];+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 507);+result.display = result.highlighted;+ }+ }++ // Run the results through the configured formatter (if any) to+ // produce the final formatted results. The formatter returns an+ // array of strings or Node instances (not an array of result+ // objects), and these strings/Nodes are then added to each+ // result object.+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 516);+if (formatter) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 517);+formatted = formatter.call(this, query, results.concat());++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 519);+if (!formatted) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 520);+return;+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 523);+for (i = 0, len = formatted.length; i < len; ++i) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 524);+results[i].display = formatted[i];+ }+ }+ }+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 530);+facade.results = results;+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 531);+this.fire(EVT_RESULTS, facade);+ },++ /**+ Returns the query portion of the specified input value, or `null` if there+ is no suitable query within the input value.++ If a query delimiter is defined, the query will be the last delimited part+ of of the string.++ @method _parseValue+ @param {String} value Input value from which to extract the query.+ @return {String|null} query+ @protected+ **/+ _parseValue: function (value) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_parseValue", 546);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 547);+var delim = this.get(QUERY_DELIMITER);++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 549);+if (delim) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 550);+value = value.split(delim);+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 551);+value = value[value.length - 1];+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 554);+return Lang.trimLeft(value);+ },++ /**+ Setter for the `enableCache` attribute.++ @method _setEnableCache+ @param {Boolean} value+ @protected+ @since 3.5.0+ **/+ _setEnableCache: function (value) {+ // When `this._cache` is an object, result sources will store cached+ // results in it. When it's falsy, they won't. This way result sources+ // don't need to get the value of the `enableCache` attribute on every+ // request, which would be sloooow.+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_setEnableCache", 565);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 570);+this._cache = value ? {} : null;+ },++ /**+ Setter for locator attributes.++ @method _setLocator+ @param {Function|String|null} locator+ @return {Function|null}+ @protected+ **/+ _setLocator: function (locator) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_setLocator", 581);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 582);+if (this[_FUNCTION_VALIDATOR](locator)) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 583);+return locator;+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 586);+var that = this;++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 588);+locator = locator.toString().split('.');++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 590);+return function (result) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "(anonymous 2)", 590);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 591);+return result && that._getObjectValue(result, locator);+ };+ },++ /**+ Setter for the `requestTemplate` attribute.++ @method _setRequestTemplate+ @param {Function|String|null} template+ @return {Function|null}+ @protected+ **/+ _setRequestTemplate: function (template) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_setRequestTemplate", 603);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 604);+if (this[_FUNCTION_VALIDATOR](template)) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 605);+return template;+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 608);+template = template.toString();++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 610);+return function (query) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "(anonymous 3)", 610);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 611);+return Lang.sub(template, {query: encodeURIComponent(query)});+ };+ },++ /**+ Setter for the `resultFilters` attribute.++ @method _setResultFilters+ @param {Array|Function|String|null} filters `null`, a filter+ function, an array of filter functions, or a string or array of strings+ representing the names of methods on `Y.AutoCompleteFilters`.+ @return {Function[]} Array of filter functions (empty if <i>filters</i> is+ `null`).+ @protected+ **/+ _setResultFilters: function (filters) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_setResultFilters", 626);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 627);+var acFilters, getFilterFunction;++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 629);+if (filters === null) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 630);+return [];+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 633);+acFilters = Y.AutoCompleteFilters;++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 635);+getFilterFunction = function (filter) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "getFilterFunction", 635);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 636);+if (isFunction(filter)) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 637);+return filter;+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 640);+if (isString(filter) && acFilters &&+ isFunction(acFilters[filter])) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 642);+return acFilters[filter];+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 645);+return false;+ };++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 648);+if (Lang.isArray(filters)) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 649);+filters = YArray.map(filters, getFilterFunction);+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 650);+return YArray.every(filters, function (f) { _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "(anonymous 4)", 650);+return !!f; }) ?+ filters : INVALID_VALUE;+ } else {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 653);+filters = getFilterFunction(filters);+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 654);+return filters ? [filters] : INVALID_VALUE;+ }+ },++ /**+ Setter for the `resultHighlighter` attribute.++ @method _setResultHighlighter+ @param {Function|String|null} highlighter `null`, a highlighter function, or+ a string representing the name of a method on+ `Y.AutoCompleteHighlighters`.+ @return {Function|null}+ @protected+ **/+ _setResultHighlighter: function (highlighter) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_setResultHighlighter", 668);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 669);+var acHighlighters;++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 671);+if (this[_FUNCTION_VALIDATOR](highlighter)) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 672);+return highlighter;+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 675);+acHighlighters = Y.AutoCompleteHighlighters;++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 677);+if (isString(highlighter) && acHighlighters &&+ isFunction(acHighlighters[highlighter])) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 679);+return acHighlighters[highlighter];+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 682);+return INVALID_VALUE;+ },++ /**+ Setter for the `source` attribute. Returns a DataSource or a DataSource-like+ object depending on the type of _source_ and/or the value of the+ `sourceType` attribute.++ @method _setSource+ @param {Any} source AutoComplete source. See the `source` attribute for+ details.+ @return {DataSource|Object}+ @protected+ **/+ _setSource: function (source) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_setSource", 696);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 697);+var sourceType = this.get('sourceType') || Lang.type(source),+ sourceSetter;++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 700);+if ((source && isFunction(source.sendRequest))+ || source === null+ || sourceType === 'datasource') {++ // Quacks like a DataSource instance (or null). Make it so!+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 705);+this._rawSource = source;+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 706);+return source;+ }++ // See if there's a registered setter for this source type.+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 710);+if ((sourceSetter = AutoCompleteBase.SOURCE_TYPES[sourceType])) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 711);+this._rawSource = source;+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 712);+return Lang.isString(sourceSetter) ?+ this[sourceSetter](source) : sourceSetter(source);+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 716);+Y.error("Unsupported source type '" + sourceType + "'. Maybe autocomplete-sources isn't loaded?");+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 717);+return INVALID_VALUE;+ },++ /**+ Shared success callback for non-DataSource sources.++ @method _sourceSuccess+ @param {Any} data Response data.+ @param {Object} request Request object.+ @protected+ **/+ _sourceSuccess: function (data, request) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_sourceSuccess", 728);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 729);+request.callback.success({+ data: data,+ response: {results: data}+ });+ },++ /**+ Synchronizes the UI state of the `allowBrowserAutocomplete` attribute.++ @method _syncBrowserAutocomplete+ @protected+ **/+ _syncBrowserAutocomplete: function () {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_syncBrowserAutocomplete", 741);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 742);+var inputNode = this.get(INPUT_NODE);++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 744);+if (inputNode.get('nodeName').toLowerCase() === 'input') {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 745);+inputNode.setAttribute('autocomplete',+ this.get(ALLOW_BROWSER_AC) ? 'on' : 'off');+ }+ },++ /**+ Updates the query portion of the `value` attribute.++ If a query delimiter is defined, the last delimited portion of the input+ value will be replaced with the specified _value_.++ @method _updateValue+ @param {String} newVal New value.+ @protected+ **/+ _updateValue: function (newVal) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_updateValue", 760);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 761);+var delim = this.get(QUERY_DELIMITER),+ insertDelim,+ len,+ prevVal;++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 766);+newVal = Lang.trimLeft(newVal);++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 768);+if (delim) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 769);+insertDelim = trim(delim); // so we don't double up on spaces+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 770);+prevVal = YArray.map(trim(this.get(VALUE)).split(delim), trim);+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 771);+len = prevVal.length;++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 773);+if (len > 1) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 774);+prevVal[len - 1] = newVal;+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 775);+newVal = prevVal.join(insertDelim + ' ');+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 778);+newVal = newVal + insertDelim + ' ';+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 781);+this.set(VALUE, newVal);+ },++ // -- Protected Event Handlers ---------------------------------------------++ /**+ Updates the current `source` based on the new `sourceType` to ensure that+ the two attributes don't get out of sync when they're changed separately.++ @method _afterSourceTypeChange+ @param {EventFacade} e+ @protected+ **/+ _afterSourceTypeChange: function (e) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_afterSourceTypeChange", 794);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 795);+if (this._rawSource) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 796);+this.set('source', this._rawSource);+ }+ },++ /**+ Handles change events for the `value` attribute.++ @method _afterValueChange+ @param {EventFacade} e+ @protected+ **/+ _afterValueChange: function (e) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_afterValueChange", 807);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 808);+var newVal = e.newVal,+ self = this,+ uiChange = e.src === AutoCompleteBase.UI_SRC,+ delay, fire, minQueryLength, query;++ // Update the UI if the value was changed programmatically.+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 814);+if (!uiChange) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 815);+self._inputNode.set(VALUE, newVal);+ }+++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 819);+minQueryLength = self.get('minQueryLength');+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 820);+query = self._parseValue(newVal) || '';++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 822);+if (minQueryLength >= 0 && query.length >= minQueryLength) {+ // Only query on changes that originate from the UI.+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 824);+if (uiChange) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 825);+delay = self.get('queryDelay');++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 827);+fire = function () {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "fire", 827);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 828);+self.fire(EVT_QUERY, {+ inputValue: newVal,+ query : query,+ src : e.src+ });+ };++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 835);+if (delay) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 836);+clearTimeout(self._delay);+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 837);+self._delay = setTimeout(fire, delay);+ } else {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 839);+fire();+ }+ } else {+ // For programmatic value changes, just update the query+ // attribute without sending a query.+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 844);+self._set(QUERY, query);+ }+ } else {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 847);+clearTimeout(self._delay);++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 849);+self.fire(EVT_CLEAR, {+ prevVal: e.prevVal ? self._parseValue(e.prevVal) : null,+ src : e.src+ });+ }+ },++ /**+ Handles `blur` events on the input node.++ @method _onInputBlur+ @param {EventFacade} e+ @protected+ **/+ _onInputBlur: function (e) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_onInputBlur", 863);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 864);+var delim = this.get(QUERY_DELIMITER),+ delimPos,+ newVal,+ value;++ // If a query delimiter is set and the input's value contains one or+ // more trailing delimiters, strip them.+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 871);+if (delim && !this.get('allowTrailingDelimiter')) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 872);+delim = Lang.trimRight(delim);+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 873);+value = newVal = this._inputNode.get(VALUE);++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 875);+if (delim) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 876);+while ((newVal = Lang.trimRight(newVal)) &&+ (delimPos = newVal.length - delim.length) &&+ newVal.lastIndexOf(delim) === delimPos) {++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 880);+newVal = newVal.substring(0, delimPos);+ }+ } else {+ // Delimiter is one or more space characters, so just trim the+ // value.+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 885);+newVal = Lang.trimRight(newVal);+ }++ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 888);+if (newVal !== value) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 889);+this.set(VALUE, newVal);+ }+ }+ },++ /**+ Handles `valueChange` events on the input node and fires a `query` event+ when the input value meets the configured criteria.++ @method _onInputValueChange+ @param {EventFacade} e+ @protected+ **/+ _onInputValueChange: function (e) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_onInputValueChange", 902);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 903);+var newVal = e.newVal;++ // Don't query if the internal value is the same as the new value+ // reported by valueChange.+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 907);+if (newVal !== this.get(VALUE)) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 908);+this.set(VALUE, newVal, {src: AutoCompleteBase.UI_SRC});+ }+ },++ /**+ Handles source responses and fires the `results` event.++ @method _onResponse+ @param {EventFacade} e+ @protected+ **/+ _onResponse: function (query, e) {+ // Ignore stale responses that aren't for the current query.+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_onResponse", 919);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 921);+if (query === (this.get(QUERY) || '')) {+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 922);+this._parseResponse(query || '', e.response, e.data);+ }+ },++ // -- Protected Default Event Handlers -------------------------------------++ /**+ Default `clear` event handler. Sets the `results` attribute to an empty+ array and `query` to null.++ @method _defClearFn+ @protected+ **/+ _defClearFn: function () {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_defClearFn", 935);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 936);+this._set(QUERY, null);+ _yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 937);+this._set(RESULTS, []);+ },++ /**+ Default `query` event handler. Sets the `query` attribute and sends a+ request to the source if one is configured.++ @method _defQueryFn+ @param {EventFacade} e+ @protected+ **/+ _defQueryFn: function (e) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_defQueryFn", 948);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 949);+this.sendRequest(e.query); // sendRequest will set the 'query' attribute+ },++ /**+ Default `results` event handler. Sets the `results` attribute to the latest+ results.++ @method _defResultsFn+ @param {EventFacade} e+ @protected+ **/+ _defResultsFn: function (e) {+ _yuitest_coverfunc("build/autocomplete-base/autocomplete-base.js", "_defResultsFn", 960);+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 961);+this._set(RESULTS, e[RESULTS]);+ }+};++_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 965);+AutoCompleteBase.ATTRS = {+ /**+ Whether or not to enable the browser's built-in autocomplete functionality+ for input fields.++ @attribute allowBrowserAutocomplete+ @type Boolean+ @default false+ **/+ allowBrowserAutocomplete: {+ value: false+ },++ /**+ When a `queryDelimiter` is set, trailing delimiters will automatically be+ stripped from the input value by default when the input node loses focus.+ Set this to `true` to allow trailing delimiters.++ @attribute allowTrailingDelimiter+ @type Boolean+ @default false+ **/+ allowTrailingDelimiter: {+ value: false+ },++ /**+ Whether or not to enable in-memory caching in result sources that support+ it.++ @attribute enableCache+ @type Boolean+ @default true+ @since 3.5.0+ **/+ enableCache: {+ lazyAdd: false, // we need the setter to run on init+ setter: '_setEnableCache',+ value: true+ },++ /**+ Node to monitor for changes, which will generate `query` events when+ appropriate. May be either an `<input>` or a `<textarea>`.++ @attribute inputNode+ @type Node|HTMLElement|String+ @initOnly+ **/+ inputNode: {+ setter: Y.one,+ writeOnce: 'initOnly'+ },++ /**+ Maximum number of results to return. A value of `0` or less will allow an+ unlimited number of results.++ @attribute maxResults+ @type Number+ @default 0+ **/+ maxResults: {+ value: 0+ },++ /**+ Minimum number of characters that must be entered before a `query` event+ will be fired. A value of `0` allows empty queries; a negative value will+ effectively disable all `query` events.++ @attribute minQueryLength+ @type Number+ @default 1+ **/+ minQueryLength: {+ value: 1+ },++ /**+ Current query, or `null` if there is no current query.++ The query might not be the same as the current value of the input node, both+ for timing reasons (due to `queryDelay`) and because when one or more+ `queryDelimiter` separators are in use, only the last portion of the+ delimited input string will be used as the query value.++ @attribute query+ @type String|null+ @default null+ @readonly+ **/+ query: {+ readOnly: true,+ value: null+ },++ /**+ Number of milliseconds to delay after input before triggering a `query`+ event. If new input occurs before this delay is over, the previous input+ event will be ignored and a new delay will begin.++ This can be useful both to throttle queries to a remote data source and to+ avoid distracting the user by showing them less relevant results before+ they've paused their typing.++ @attribute queryDelay+ @type Number+ @default 100+ **/+ queryDelay: {+ value: 100+ },++ /**+ Query delimiter string. When a delimiter is configured, the input value+ will be split on the delimiter, and only the last portion will be used in+ autocomplete queries and updated when the `query` attribute is+ modified.++ @attribute queryDelimiter+ @type String|null+ @default null+ **/+ queryDelimiter: {+ value: null+ },++ /**+ Source request template. This can be a function that accepts a query as a+ parameter and returns a request string, or it can be a string containing the+ placeholder "{query}", which will be replaced with the actual URI-encoded+ query. In either case, the resulting string will be appended to the request+ URL when the `source` attribute is set to a remote DataSource, JSONP URL, or+ XHR URL (it will not be appended to YQL URLs).++ While `requestTemplate` may be set to either a function or a string, it will+ always be returned as a function that accepts a query argument and returns a+ string.++ @attribute requestTemplate+ @type Function|String|null+ @default null+ **/+ requestTemplate: {+ setter: '_setRequestTemplate',+ value: null+ },++ /**+ Array of local result filter functions. If provided, each filter will be+ called with two arguments when results are received: the query and an array+ of result objects. See the documentation for the `results` event for a list+ of the properties available on each result object.++ Each filter is expected to return a filtered or modified version of the+ results array, which will then be passed on to subsequent filters, then the+ `resultHighlighter` function (if set), then the `resultFormatter` function+ (if set), and finally to subscribers to the `results` event.++ If no `source` is set, result filters will not be called.++ Prepackaged result filters provided by the autocomplete-filters and+ autocomplete-filters-accentfold modules can be used by specifying the filter+ name as a string, such as `'phraseMatch'` (assuming the necessary filters+ module is loaded).++ @attribute resultFilters+ @type Array+ @default []+ **/+ resultFilters: {+ setter: '_setResultFilters',+ value: []+ },++ /**+ Function which will be used to format results. If provided, this function+ will be called with two arguments after results have been received and+ filtered: the query and an array of result objects. The formatter is+ expected to return an array of HTML strings or Node instances containing the+ desired HTML for each result.++ See the documentation for the `results` event for a list of the properties+ available on each result object.++ If no `source` is set, the formatter will not be called.++ @attribute resultFormatter+ @type Function|null+ **/+ resultFormatter: {+ validator: _FUNCTION_VALIDATOR,+ value: null+ },++ /**+ Function which will be used to highlight results. If provided, this function+ will be called with two arguments after results have been received and+ filtered: the query and an array of filtered result objects. The highlighter+ is expected to return an array of highlighted result text in the form of+ HTML strings.++ See the documentation for the `results` event for a list of the properties+ available on each result object.++ If no `source` is set, the highlighter will not be called.++ @attribute resultHighlighter+ @type Function|null+ **/+ resultHighlighter: {+ setter: '_setResultHighlighter',+ value: null+ },++ /**+ Locator that should be used to extract an array of results from a non-array+ response.++ By default, no locator is applied, and all responses are assumed to be+ arrays by default. If all responses are already arrays, you don't need to+ define a locator.++ The locator may be either a function (which will receive the raw response as+ an argument and must return an array) or a string representing an object+ path, such as "foo.bar.baz" (which would return the value of+ `result.foo.bar.baz` if the response is an object).++ While `resultListLocator` may be set to either a function or a string, it+ will always be returned as a function that accepts a response argument and+ returns an array.++ @attribute resultListLocator+ @type Function|String|null+ **/+ resultListLocator: {+ setter: '_setLocator',+ value: null+ },++ /**+ Current results, or an empty array if there are no results.++ @attribute results+ @type Array+ @default []+ @readonly+ **/+ results: {+ readOnly: true,+ value: []+ },++ /**+ Locator that should be used to extract a plain text string from a non-string+ result item. The resulting text value will typically be the value that ends+ up being inserted into an input field or textarea when the user of an+ autocomplete implementation selects a result.++ By default, no locator is applied, and all results are assumed to be plain+ text strings. If all results are already plain text strings, you don't need+ to define a locator.++ The locator may be either a function (which will receive the raw result as+ an argument and must return a string) or a string representing an object+ path, such as "foo.bar.baz" (which would return the value of+ `result.foo.bar.baz` if the result is an object).++ While `resultTextLocator` may be set to either a function or a string, it+ will always be returned as a function that accepts a result argument and+ returns a string.++ @attribute resultTextLocator+ @type Function|String|null+ **/+ resultTextLocator: {+ setter: '_setLocator',+ value: null+ },++ /**+ Source for autocomplete results. The following source types are supported:++ <dl>+ <dt>Array</dt>+ <dd>+ <p>+ The full array will be provided to any configured filters for each+ query. This is an easy way to create a fully client-side autocomplete+ implementation.+ </p>++ <p>+ Example: `['first result', 'second result', 'etc']`+ </p>+ </dd>++ <dt>DataSource</dt>+ <dd>+ A `DataSource` instance or other object that provides a DataSource-like+ `sendRequest` method. See the `DataSource` documentation for details.+ </dd>++ <dt>Function</dt>+ <dd>+ <p>+ A function source will be called with the current query and a+ callback function as parameters, and should either return an array of+ results (for synchronous operation) or return nothing and pass an+ array of results to the provided callback (for asynchronous+ operation).+ </p>++ <p>+ Example (synchronous):+ </p>++ <pre>+ function (query) {+ return ['foo', 'bar'];+ }+ </pre>++ <p>+ Example (async):+ </p>++ <pre>+ function (query, callback) {+ callback(['foo', 'bar']);+ }+ </pre>+ </dd>++ <dt>Object</dt>+ <dd>+ <p>+ An object will be treated as a query hashmap. If a property on the+ object matches the current query, the value of that property will be+ used as the response.+ </p>++ <p>+ The response is assumed to be an array of results by default. If the+ response is not an array, provide a `resultListLocator` to+ process the response and return an array.+ </p>++ <p>+ Example: `{foo: ['foo result 1', 'foo result 2'], bar: ['bar result']}`+ </p>+ </dd>+ </dl>++ If the optional `autocomplete-sources` module is loaded, then+ the following additional source types will be supported as well:++ <dl>+ <dt><select> Node</dt>+ <dd>+ You may provide a YUI Node instance wrapping a <select>+ element, and the options in the list will be used as results. You+ will also need to specify a `resultTextLocator` of 'text'+ or 'value', depending on what you want to use as the text of the+ result.++ Each result will be an object with the following properties:++ <dl>+ <dt>html (String)</dt>+ <dd>+ <p>HTML content of the <option> element.</p>+ </dd>++ <dt>index (Number)</dt>+ <dd>+ <p>Index of the <option> element in the list.</p>+ </dd>++ <dt>node (Y.Node)</dt>+ <dd>+ <p>Node instance referring to the original <option> element.</p>+ </dd>++ <dt>selected (Boolean)</dt>+ <dd>+ <p>Whether or not this item is currently selected in the+ <select> list.</p>+ </dd>++ <dt>text (String)</dt>+ <dd>+ <p>Text content of the <option> element.</p>+ </dd>++ <dt>value (String)</dt>+ <dd>+ <p>Value of the <option> element.</p>+ </dd>+ </dl>+ </dd>++ <dt>String (JSONP URL)</dt>+ <dd>+ <p>+ If a URL with a `{callback}` placeholder is provided, it will be used to+ make a JSONP request. The `{query}` placeholder will be replaced with+ the current query, and the `{callback}` placeholder will be replaced+ with an internally-generated JSONP callback name. Both placeholders must+ appear in the URL, or the request will fail. An optional `{maxResults}`+ placeholder may also be provided, and will be replaced with the value of+ the maxResults attribute (or 1000 if the maxResults attribute is 0 or+ less).+ </p>++ <p>+ The response is assumed to be an array of results by default. If the+ response is not an array, provide a `resultListLocator` to process the+ response and return an array.+ </p>++ <p>+ <strong>The `jsonp` module must be loaded in order for+ JSONP URL sources to work.</strong> If the `jsonp` module+ is not already loaded, it will be loaded on demand if possible.+ </p>++ <p>+ Example: `'http://example.com/search?q={query}&callback={callback}'`+ </p>+ </dd>++ <dt>String (XHR URL)</dt>+ <dd>+ <p>+ If a URL without a `{callback}` placeholder is provided, it will be used+ to make a same-origin XHR request. The `{query}` placeholder will be+ replaced with the current query. An optional `{maxResults}` placeholder+ may also be provided, and will be replaced with the value of the+ maxResults attribute (or 1000 if the maxResults attribute is 0 or less).+ </p>++ <p>+ The response is assumed to be a JSON array of results by default. If the+ response is a JSON object and not an array, provide a+ `resultListLocator` to process the response and return an array. If the+ response is in some form other than JSON, you will need to use a custom+ DataSource instance as the source.+ </p>++ <p>+ <strong>The `io-base` and `json-parse` modules+ must be loaded in order for XHR URL sources to work.</strong> If+ these modules are not already loaded, they will be loaded on demand+ if possible.+ </p>++ <p>+ Example: `'http://example.com/search?q={query}'`+ </p>+ </dd>++ <dt>String (YQL query)</dt>+ <dd>+ <p>+ If a YQL query is provided, it will be used to make a YQL request. The+ `{query}` placeholder will be replaced with the current autocomplete+ query. This placeholder must appear in the YQL query, or the request+ will fail. An optional `{maxResults}` placeholder may also be provided,+ and will be replaced with the value of the maxResults attribute (or 1000+ if the maxResults attribute is 0 or less).+ </p>++ <p>+ <strong>The `yql` module must be loaded in order for YQL+ sources to work.</strong> If the `yql` module is not+ already loaded, it will be loaded on demand if possible.+ </p>++ <p>+ Example: `'select * from search.suggest where query="{query}"'`+ </p>+ </dd>+ </dl>++ As an alternative to providing a source, you could simply listen for `query`+ events and handle them any way you see fit. Providing a source is optional,+ but will usually be simpler.++ @attribute source+ @type Array|DataSource|Function|Node|Object|String|null+ **/+ source: {+ setter: '_setSource',+ value: null+ },++ /**+ May be used to force a specific source type, overriding the automatic source+ type detection. It should almost never be necessary to do this, but as they+ taught us in the Boy Scouts, one should always be prepared, so it's here if+ you need it. Be warned that if you set this attribute and something breaks,+ it's your own fault.++ Supported `sourceType` values are: 'array', 'datasource', 'function', and+ 'object'.++ If the `autocomplete-sources` module is loaded, the following additional+ source types are supported: 'io', 'jsonp', 'select', 'string', 'yql'++ @attribute sourceType+ @type String+ **/+ sourceType: {+ value: null+ },++ /**+ If the `inputNode` specified at instantiation time has a `node-tokeninput`+ plugin attached to it, this attribute will be a reference to the+ `Y.Plugin.TokenInput` instance.++ @attribute tokenInput+ @type Plugin.TokenInput+ @readonly+ **/+ tokenInput: {+ readOnly: true+ },++ /**+ Current value of the input node.++ @attribute value+ @type String+ @default ''+ **/+ value: {+ // Why duplicate this._inputNode.get('value')? Because we need a+ // reliable way to track the source of value changes. We want to perform+ // completion when the user changes the value, but not when we change+ // the value.+ value: ''+ }+};++// This tells Y.Base.create() to copy these static properties to any class+// AutoCompleteBase is mixed into.+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 1514);+AutoCompleteBase._buildCfg = {+ aggregates: ['SOURCE_TYPES'],+ statics : ['UI_SRC']+};++/**+Mapping of built-in source types to their setter functions. DataSource instances+and DataSource-like objects are handled natively, so are not mapped here.++@property SOURCE_TYPES+@type {Object}+@static+**/+_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 1527);+AutoCompleteBase.SOURCE_TYPES = {+ array : '_createArraySource',+ 'function': '_createFunctionSource',+ object : '_createObjectSource'+};++_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 1533);+AutoCompleteBase.UI_SRC = (Y.Widget && Y.Widget.UI_SRC) || 'ui';++_yuitest_coverline("build/autocomplete-base/autocomplete-base.js", 1535);+Y.AutoCompleteBase = AutoCompleteBase;+++}, '3.7.1', {"optional": ["autocomplete-sources"], "requires": ["array-extras", "base-build", "escape", "event-valuechange", "node-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('autocomplete-base', function(Y) {+YUI.add('autocomplete-base', function (Y, NAME) { /** Provides automatic input completion or suggestions for text input fields and@@ -1549,4 +1549,4 @@ Y.AutoCompleteBase = AutoCompleteBase; -}, '3.5.1' ,{optional:['autocomplete-sources'], requires:['array-extras', 'base-build', 'escape', 'event-valuechange', 'node-base']});+}, '3.7.1', {"optional": ["autocomplete-sources"], "requires": ["array-extras", "base-build", "escape", "event-valuechange", "node-base"]});
@@ -1,8 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("autocomplete-base",function(f){var g=f.Escape,j=f.Lang,q=f.Array,i=f.Object,d=j.isFunction,r=j.isString,u=j.trim,l=f.Attribute.INVALID_VALUE,o="_functionValidator",x="_sourceSuccess",c="allowBrowserAutocomplete",h="inputNode",w="query",e="queryDelimiter",b="requestTemplate",m="results",n="resultListLocator",k="value",s="valueChange",a="clear",t=w,p=m;function v(){}v.prototype={initializer:function(){f.before(this._bindUIACBase,this,"bindUI");f.before(this._syncUIACBase,this,"syncUI");this.publish(a,{defaultFn:this._defClearFn});this.publish(t,{defaultFn:this._defQueryFn});this.publish(p,{defaultFn:this._defResultsFn});},destructor:function(){this._acBaseEvents&&this._acBaseEvents.detach();delete this._acBaseEvents;delete this._cache;delete this._inputNode;delete this._rawSource;},clearCache:function(){this._cache&&(this._cache={});return this;},sendRequest:function(A,B){var y,z=this.get("source");if(A||A===""){this._set(w,A);}else{A=this.get(w)||"";}if(z){if(!B){B=this.get(b);}y=B?B.call(this,A):A;z.sendRequest({query:A,request:y,callback:{success:f.bind(this._onResponse,this,A)}});}return this;},_bindUIACBase:function(){var z=this.get(h),y=z&&z.tokenInput;if(y){z=y.get(h);this._set("tokenInput",y);}if(!z){f.error("No inputNode specified.");return;}this._inputNode=z;this._acBaseEvents=new f.EventHandle([z.on(s,this._onInputValueChange,this),z.on("blur",this._onInputBlur,this),this.after(c+"Change",this._syncBrowserAutocomplete),this.after("sourceTypeChange",this._afterSourceTypeChange),this.after(s,this._afterValueChange)]);},_syncUIACBase:function(){this._syncBrowserAutocomplete();this.set(k,this.get(h).get(k));},_createArraySource:function(z){var y=this;return{type:"array",sendRequest:function(A){y[x](z.concat(),A);}};},_createFunctionSource:function(z){var y=this;return{type:"function",sendRequest:function(A){var B;function C(D){y[x](D||[],A);}if((B=z(A.query,C))){C(B);}}};},_createObjectSource:function(z){var y=this;return{type:"object",sendRequest:function(A){var B=A.query;y[x](i.owns(z,B)?z[B]:[],A);}};},_functionValidator:function(y){return y===null||d(y);},_getObjectValue:function(B,A){if(!B){return;}for(var z=0,y=A.length;B&&z<y;z++){B=B[A[z]];}return B;},_parseResponse:function(A,y,P){var G={data:P,query:A,results:[]},I=this.get(n),H=[],F=y&&y.results,C,z,J,B,O,K,L,M,D,E,N;if(F&&I){F=I.call(this,F);}if(F&&F.length){C=this.get("resultFilters");N=this.get("resultTextLocator");for(K=0,L=F.length;K<L;++K){D=F[K];E=N?N.call(this,D):D.toString();H.push({display:g.html(E),raw:D,text:E});}for(K=0,L=C.length;K<L;++K){H=C[K].call(this,A,H.concat());if(!H){return;}if(!H.length){break;}}if(H.length){J=this.get("resultFormatter");O=this.get("resultHighlighter");M=this.get("maxResults");if(M&&M>0&&H.length>M){H.length=M;}if(O){B=O.call(this,A,H.concat());if(!B){return;}for(K=0,L=B.length;K<L;++K){D=H[K];D.highlighted=B[K];D.display=D.highlighted;}}if(J){z=J.call(this,A,H.concat());if(!z){return;}for(K=0,L=z.length;K<L;++K){H[K].display=z[K];}}}}G.results=H;this.fire(p,G);},_parseValue:function(y){var z=this.get(e);if(z){y=y.split(z);y=y[y.length-1];}return j.trimLeft(y);},_setEnableCache:function(y){this._cache=y?{}:null;},_setLocator:function(y){if(this[o](y)){return y;}var z=this;y=y.toString().split(".");return function(A){return A&&z._getObjectValue(A,y);};},_setRequestTemplate:function(y){if(this[o](y)){return y;}y=y.toString();return function(z){return j.sub(y,{query:encodeURIComponent(z)});};},_setResultFilters:function(A){var y,z;if(A===null){return[];}y=f.AutoCompleteFilters;z=function(B){if(d(B)){return B;}if(r(B)&&y&&d(y[B])){return y[B];}return false;};if(j.isArray(A)){A=q.map(A,z);return q.every(A,function(B){return !!B;})?A:l;}else{A=z(A);return A?[A]:l;}},_setResultHighlighter:function(y){var z;if(this[o](y)){return y;}z=f.AutoCompleteHighlighters;if(r(y)&&z&&d(z[y])){return z[y];}return l;},_setSource:function(A){var y=this.get("sourceType")||j.type(A),z;if((A&&d(A.sendRequest))||A===null||y==="datasource"){this._rawSource=A;return A;}if((z=v.SOURCE_TYPES[y])){this._rawSource=A;return j.isString(z)?this[z](A):z(A);}f.error("Unsupported source type '"+y+"'. Maybe autocomplete-sources isn't loaded?");return l;},_sourceSuccess:function(z,y){y.callback.success({data:z,response:{results:z}});},_syncBrowserAutocomplete:function(){var y=this.get(h);if(y.get("nodeName").toLowerCase()==="input"){y.setAttribute("autocomplete",this.get(c)?"on":"off");}},_updateValue:function(z){var B=this.get(e),A,y,C;z=j.trimLeft(z);if(B){A=u(B);C=q.map(u(this.get(k)).split(B),u);y=C.length;if(y>1){C[y-1]=z;z=C.join(A+" ");}z=z+A+" ";}this.set(k,z);},_afterSourceTypeChange:function(y){if(this._rawSource){this.set("source",this._rawSource);}},_afterValueChange:function(F){var B=F.newVal,z=this,E=F.src===v.UI_SRC,A,C,y,D;if(!E){z._inputNode.set(k,B);}y=z.get("minQueryLength");D=z._parseValue(B)||"";if(y>=0&&D.length>=y){if(E){A=z.get("queryDelay");C=function(){z.fire(t,{inputValue:B,query:D,src:F.src});};if(A){clearTimeout(z._delay);z._delay=setTimeout(C,A);}else{C();}}else{z._set(w,D);}}else{clearTimeout(z._delay);z.fire(a,{prevVal:F.prevVal?z._parseValue(F.prevVal):null,src:F.src});}},_onInputBlur:function(B){var C=this.get(e),y,z,A;if(C&&!this.get("allowTrailingDelimiter")){C=j.trimRight(C);A=z=this._inputNode.get(k);if(C){while((z=j.trimRight(z))&&(y=z.length-C.length)&&z.lastIndexOf(C)===y){z=z.substring(0,y);}}else{z=j.trimRight(z);}if(z!==A){this.set(k,z);}}},_onInputValueChange:function(z){var y=z.newVal;if(y!==this.get(k)){this.set(k,y,{src:v.UI_SRC});}},_onResponse:function(y,z){if(y===(this.get(w)||"")){this._parseResponse(y||"",z.response,z.data);}},_defClearFn:function(){this._set(w,null);this._set(m,[]);},_defQueryFn:function(y){this.sendRequest(y.query);},_defResultsFn:function(y){this._set(m,y[m]);}};v.ATTRS={allowBrowserAutocomplete:{value:false},allowTrailingDelimiter:{value:false},enableCache:{lazyAdd:false,setter:"_setEnableCache",value:true},inputNode:{setter:f.one,writeOnce:"initOnly"},maxResults:{value:0},minQueryLength:{value:1},query:{readOnly:true,value:null},queryDelay:{value:100},queryDelimiter:{value:null},requestTemplate:{setter:"_setRequestTemplate",value:null},resultFilters:{setter:"_setResultFilters",value:[]},resultFormatter:{validator:o,value:null},resultHighlighter:{setter:"_setResultHighlighter",value:null},resultListLocator:{setter:"_setLocator",value:null},results:{readOnly:true,value:[]},resultTextLocator:{setter:"_setLocator",value:null},source:{setter:"_setSource",value:null},sourceType:{value:null},tokenInput:{readOnly:true},value:{value:""}};-v._buildCfg={aggregates:["SOURCE_TYPES"],statics:["UI_SRC"]};v.SOURCE_TYPES={array:"_createArraySource","function":"_createFunctionSource",object:"_createObjectSource"};v.UI_SRC=(f.Widget&&f.Widget.UI_SRC)||"ui";f.AutoCompleteBase=v;},"3.5.1",{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]});+YUI.add("autocomplete-base",function(e,t){function T(){}var n=e.Escape,r=e.Lang,i=e.Array,s=e.Object,o=r.isFunction,u=r.isString,a=r.trim,f=e.Attribute.INVALID_VALUE,l="_functionValidator",c="_sourceSuccess",h="allowBrowserAutocomplete",p="inputNode",d="query",v="queryDelimiter",m="requestTemplate",g="results",y="resultListLocator",b="value",w="valueChange",E="clear",S=d,x=g;T.prototype={initializer:function(){e.before(this._bindUIACBase,this,"bindUI"),e.before(this._syncUIACBase,this,"syncUI"),this.publish(E,{defaultFn:this._defClearFn}),this.publish(S,{defaultFn:this._defQueryFn}),this.publish(x,{defaultFn:this._defResultsFn})},destructor:function(){this._acBaseEvents&&this._acBaseEvents.detach(),delete this._acBaseEvents,delete this._cache,delete this._inputNode,delete this._rawSource},clearCache:function(){return this._cache&&(this._cache={}),this},sendRequest:function(t,n){var r,i=this.get("source");return t||t===""?this._set(d,t):t=this.get(d)||"",i&&(n||(n=this.get(m)),r=n?n.call(this,t):t,i.sendRequest({query:t,request:r,callback:{success:e.bind(this._onResponse,this,t)}})),this},_bindUIACBase:function(){var t=this.get(p),n=t&&t.tokenInput;n&&(t=n.get(p),this._set("tokenInput",n));if(!t){e.error("No inputNode specified.");return}this._inputNode=t,this._acBaseEvents=new e.EventHandle([t.on(w,this._onInputValueChange,this),t.on("blur",this._onInputBlur,this),this.after(h+"Change",this._syncBrowserAutocomplete),this.after("sourceTypeChange",this._afterSourceTypeChange),this.after(w,this._afterValueChange)])},_syncUIACBase:function(){this._syncBrowserAutocomplete(),this.set(b,this.get(p).get(b))},_createArraySource:function(e){var t=this;return{type:"array",sendRequest:function(n){t[c](e.concat(),n)}}},_createFunctionSource:function(e){var t=this;return{type:"function",sendRequest:function(n){function i(e){t[c](e||[],n)}var r;(r=e(n.query,i))&&i(r)}}},_createObjectSource:function(e){var t=this;return{type:"object",sendRequest:function(n){var r=n.query;t[c](s.owns(e,r)?e[r]:[],n)}}},_functionValidator:function(e){return e===null||o(e)},_getObjectValue:function(e,t){if(!e)return;for(var n=0,r=t.length;e&&n<r;n++)e=e[t[n]];return e},_parseResponse:function(e,t,r){var i={data:r,query:e,results:[]},s=this.get(y),o=[],u=t&&t.results,a,f,l,c,h,p,d,v,m,g,b;u&&s&&(u=s.call(this,u));if(u&&u.length){a=this.get("resultFilters"),b=this.get("resultTextLocator");for(p=0,d=u.length;p<d;++p)m=u[p],g=b?b.call(this,m):m.toString(),o.push({display:n.html(g),raw:m,text:g});for(p=0,d=a.length;p<d;++p){o=a[p].call(this,e,o.concat());if(!o)return;if(!o.length)break}if(o.length){l=this.get("resultFormatter"),h=this.get("resultHighlighter"),v=this.get("maxResults"),v&&v>0&&o.length>v&&(o.length=v);if(h){c=h.call(this,e,o.concat());if(!c)return;for(p=0,d=c.length;p<d;++p)m=o[p],m.highlighted=c[p],m.display=m.highlighted}if(l){f=l.call(this,e,o.concat());if(!f)return;for(p=0,d=f.length;p<d;++p)o[p].display=f[p]}}}i.results=o,this.fire(x,i)},_parseValue:function(e){var t=this.get(v);return t&&(e=e.split(t),e=e[e.length-1]),r.trimLeft(e)},_setEnableCache:function(e){this._cache=e?{}:null},_setLocator:function(e){if(this[l](e))return e;var t=this;return e=e.toString().split("."),function(n){return n&&t._getObjectValue(n,e)}},_setRequestTemplate:function(e){return this[l](e)?e:(e=e.toString(),function(t){return r.sub(e,{query:encodeURIComponent(t)})})},_setResultFilters:function(t){var n,s;return t===null?[]:(n=e.AutoCompleteFilters,s=function(e){return o(e)?e:u(e)&&n&&o(n[e])?n[e]:!1},r.isArray(t)?(t=i.map(t,s),i.every(t,function(e){return!!e})?t:f):(t=s(t),t?[t]:f))},_setResultHighlighter:function(t){var n;return this[l](t)?t:(n=e.AutoCompleteHighlighters,u(t)&&n&&o(n[t])?n[t]:f)},_setSource:function(t){var n=this.get("sourceType")||r.type(t),i;return t&&o(t.sendRequest)||t===null||n==="datasource"?(this._rawSource=t,t):(i=T.SOURCE_TYPES[n])?(this._rawSource=t,r.isString(i)?this[i](t):i(t)):(e.error("Unsupported source type '"+n+"'. Maybe autocomplete-sources isn't loaded?"),f)},_sourceSuccess:function(e,t){t.callback.success({data:e,response:{results:e}})},_syncBrowserAutocomplete:function(){var e=this.get(p);e.get("nodeName").toLowerCase()==="input"&&e.setAttribute("autocomplete",this.get(h)?"on":"off")},_updateValue:function(e){var t=this.get(v),n,s,o;e=r.trimLeft(e),t&&(n=a(t),o=i.map(a(this.get(b)).split(t),a),s=o.length,s>1&&(o[s-1]=e,e=o.join(n+" ")),e=e+n+" "),this.set(b,e)},_afterSourceTypeChange:function(e){this._rawSource&&this.set("source",this._rawSource)},_afterValueChange:function(e){var t=e.newVal,n=this,r=e.src===T.UI_SRC,i,s,o,u;r||n._inputNode.set(b,t),o=n.get("minQueryLength"),u=n._parseValue(t)||"",o>=0&&u.length>=o?r?(i=n.get("queryDelay"),s=function(){n.fire(S,{inputValue:t,query:u,src:e.src})},i?(clearTimeout(n._delay),n._delay=setTimeout(s,i)):s()):n._set(d,u):(clearTimeout(n._delay),n.fire(E,{prevVal:e.prevVal?n._parseValue(e.prevVal):null,src:e.src}))},_onInputBlur:function(e){var t=this.get(v),n,i,s;if(t&&!this.get("allowTrailingDelimiter")){t=r.trimRight(t),s=i=this._inputNode.get(b);if(t)while((i=r.trimRight(i))&&(n=i.length-t.length)&&i.lastIndexOf(t)===n)i=i.substring(0,n);else i=r.trimRight(i);i!==s&&this.set(b,i)}},_onInputValueChange:function(e){var t=e.newVal;t!==this.get(b)&&this.set(b,t,{src:T.UI_SRC})},_onResponse:function(e,t){e===(this.get(d)||"")&&this._parseResponse(e||"",t.response,t.data)},_defClearFn:function(){this._set(d,null),this._set(g,[])},_defQueryFn:function(e){this.sendRequest(e.query)},_defResultsFn:function(e){this._set(g,e[g])}},T.ATTRS={allowBrowserAutocomplete:{value:!1},allowTrailingDelimiter:{value:!1},enableCache:{lazyAdd:!1,setter:"_setEnableCache",value:!0},inputNode:{setter:e.one,writeOnce:"initOnly"},maxResults:{value:0},minQueryLength:{value:1},query:{readOnly:!0,value:null},queryDelay:{value:100},queryDelimiter:{value:null},requestTemplate:{setter:"_setRequestTemplate",value:null},resultFilters:{setter:"_setResultFilters",value:[]},resultFormatter:{validator:l,value:null},resultHighlighter:{setter:"_setResultHighlighter",value:null},resultListLocator:{setter:"_setLocator",value:null},results:{readOnly:!0,value:[]},resultTextLocator:{setter:"_setLocator",value:null},source:{setter:"_setSource",value:null},sourceType:{value:null},tokenInput:{readOnly:!0},value:{value:""}},T._buildCfg={aggregates:["SOURCE_TYPES"],statics:["UI_SRC"]},T.SOURCE_TYPES={array:"_createArraySource","function":"_createFunctionSource",object:"_createObjectSource"},T.UI_SRC=e.Widget&&e.Widget.UI_SRC||"ui",e.AutoCompleteBase=T},"3.7.1",{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('autocomplete-base', function(Y) {+YUI.add('autocomplete-base', function (Y, NAME) { /** Provides automatic input completion or suggestions for text input fields and@@ -1541,4 +1541,4 @@ Y.AutoCompleteBase = AutoCompleteBase; -}, '3.5.1' ,{optional:['autocomplete-sources'], requires:['array-extras', 'base-build', 'escape', 'event-valuechange', 'node-base']});+}, '3.7.1', {"optional": ["autocomplete-sources"], "requires": ["array-extras", "base-build", "escape", "event-valuechange", "node-base"]});
@@ -0,0 +1,218 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js",+ code: []+};+_yuitest_coverage["build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js"].code=["YUI.add('autocomplete-filters-accentfold', function (Y, NAME) {","","/**","Provides pre-built accent-folding result matching filters for AutoComplete.","","These filters are similar to the ones provided by the `autocomplete-filters`","module, but use accent-aware comparisons. For example, \"resume\" and \"résumé\"","will be considered equal when using the accent-folding filters.","","@module autocomplete","@submodule autocomplete-filters-accentfold","**/","","/**","@class AutoCompleteFilters","@static","**/","","var AccentFold = Y.Text.AccentFold,"," WordBreak = Y.Text.WordBreak,"," YArray = Y.Array,"," YObject = Y.Object;","","Y.mix(Y.namespace('AutoCompleteFilters'), {"," /**"," Accent folding version of `charMatch()`.",""," @method charMatchFold"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," charMatchFold: function (query, results) {"," if (!query) { return results; }",""," var queryChars = YArray.unique(AccentFold.fold(query).split(''));",""," return YArray.filter(results, function (result) {"," var text = AccentFold.fold(result.text);",""," return YArray.every(queryChars, function (chr) {"," return text.indexOf(chr) !== -1;"," });"," });"," },",""," /**"," Accent folding version of `phraseMatch()`.",""," @method phraseMatchFold"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," phraseMatchFold: function (query, results) {"," if (!query) { return results; }",""," query = AccentFold.fold(query);",""," return YArray.filter(results, function (result) {"," return AccentFold.fold(result.text).indexOf(query) !== -1;"," });"," },",""," /**"," Accent folding version of `startsWith()`.",""," @method startsWithFold"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," startsWithFold: function (query, results) {"," if (!query) { return results; }",""," query = AccentFold.fold(query);",""," return YArray.filter(results, function (result) {"," return AccentFold.fold(result.text).indexOf(query) === 0;"," });"," },",""," /**"," Accent folding version of `subWordMatch()`.",""," @method subWordMatchFold"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," subWordMatchFold: function (query, results) {"," if (!query) { return results; }",""," var queryWords = WordBreak.getUniqueWords(AccentFold.fold(query));",""," return YArray.filter(results, function (result) {"," var resultText = AccentFold.fold(result.text);",""," return YArray.every(queryWords, function (queryWord) {"," return resultText.indexOf(queryWord) !== -1;"," });"," });"," },",""," /**"," Accent folding version of `wordMatch()`.",""," @method wordMatchFold"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," wordMatchFold: function (query, results) {"," if (!query) { return results; }",""," var queryWords = WordBreak.getUniqueWords(AccentFold.fold(query));",""," return YArray.filter(results, function (result) {"," // Convert resultWords array to a hash for fast lookup."," var resultWords = YArray.hash(WordBreak.getUniqueWords("," AccentFold.fold(result.text)));",""," return YArray.every(queryWords, function (word) {"," return YObject.owns(resultWords, word);"," });"," });"," }","});","","","}, '3.7.1', {\"requires\": [\"array-extras\", \"text-accentfold\", \"text-wordbreak\"]});"];+_yuitest_coverage["build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js"].lines = {"1":0,"19":0,"24":0,"35":0,"37":0,"39":0,"40":0,"42":0,"43":0,"58":0,"60":0,"62":0,"63":0,"77":0,"79":0,"81":0,"82":0,"96":0,"98":0,"100":0,"101":0,"103":0,"104":0,"119":0,"121":0,"123":0,"125":0,"128":0,"129":0};+_yuitest_coverage["build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js"].functions = {"(anonymous 3):42":0,"(anonymous 2):39":0,"charMatchFold:34":0,"(anonymous 4):62":0,"phraseMatchFold:57":0,"(anonymous 5):81":0,"startsWithFold:76":0,"(anonymous 7):103":0,"(anonymous 6):100":0,"subWordMatchFold:95":0,"(anonymous 9):128":0,"(anonymous 8):123":0,"wordMatchFold:118":0,"(anonymous 1):1":0};+_yuitest_coverage["build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js"].coveredLines = 29;+_yuitest_coverage["build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js"].coveredFunctions = 14;+_yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 1);+YUI.add('autocomplete-filters-accentfold', function (Y, NAME) {++/**+Provides pre-built accent-folding result matching filters for AutoComplete.++These filters are similar to the ones provided by the `autocomplete-filters`+module, but use accent-aware comparisons. For example, "resume" and "résumé"+will be considered equal when using the accent-folding filters.++@module autocomplete+@submodule autocomplete-filters-accentfold+**/++/**+@class AutoCompleteFilters+@static+**/++_yuitest_coverfunc("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", "(anonymous 1)", 1);+_yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 19);+var AccentFold = Y.Text.AccentFold,+ WordBreak = Y.Text.WordBreak,+ YArray = Y.Array,+ YObject = Y.Object;++_yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 24);+Y.mix(Y.namespace('AutoCompleteFilters'), {+ /**+ Accent folding version of `charMatch()`.++ @method charMatchFold+ @param {String} query Query to match+ @param {Array} results Results to filter+ @return {Array} Filtered results+ @static+ **/+ charMatchFold: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", "charMatchFold", 34);+_yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 35);+if (!query) { return results; }++ _yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 37);+var queryChars = YArray.unique(AccentFold.fold(query).split(''));++ _yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 39);+return YArray.filter(results, function (result) {+ _yuitest_coverfunc("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", "(anonymous 2)", 39);+_yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 40);+var text = AccentFold.fold(result.text);++ _yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 42);+return YArray.every(queryChars, function (chr) {+ _yuitest_coverfunc("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", "(anonymous 3)", 42);+_yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 43);+return text.indexOf(chr) !== -1;+ });+ });+ },++ /**+ Accent folding version of `phraseMatch()`.++ @method phraseMatchFold+ @param {String} query Query to match+ @param {Array} results Results to filter+ @return {Array} Filtered results+ @static+ **/+ phraseMatchFold: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", "phraseMatchFold", 57);+_yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 58);+if (!query) { return results; }++ _yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 60);+query = AccentFold.fold(query);++ _yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 62);+return YArray.filter(results, function (result) {+ _yuitest_coverfunc("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", "(anonymous 4)", 62);+_yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 63);+return AccentFold.fold(result.text).indexOf(query) !== -1;+ });+ },++ /**+ Accent folding version of `startsWith()`.++ @method startsWithFold+ @param {String} query Query to match+ @param {Array} results Results to filter+ @return {Array} Filtered results+ @static+ **/+ startsWithFold: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", "startsWithFold", 76);+_yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 77);+if (!query) { return results; }++ _yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 79);+query = AccentFold.fold(query);++ _yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 81);+return YArray.filter(results, function (result) {+ _yuitest_coverfunc("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", "(anonymous 5)", 81);+_yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 82);+return AccentFold.fold(result.text).indexOf(query) === 0;+ });+ },++ /**+ Accent folding version of `subWordMatch()`.++ @method subWordMatchFold+ @param {String} query Query to match+ @param {Array} results Results to filter+ @return {Array} Filtered results+ @static+ **/+ subWordMatchFold: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", "subWordMatchFold", 95);+_yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 96);+if (!query) { return results; }++ _yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 98);+var queryWords = WordBreak.getUniqueWords(AccentFold.fold(query));++ _yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 100);+return YArray.filter(results, function (result) {+ _yuitest_coverfunc("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", "(anonymous 6)", 100);+_yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 101);+var resultText = AccentFold.fold(result.text);++ _yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 103);+return YArray.every(queryWords, function (queryWord) {+ _yuitest_coverfunc("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", "(anonymous 7)", 103);+_yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 104);+return resultText.indexOf(queryWord) !== -1;+ });+ });+ },++ /**+ Accent folding version of `wordMatch()`.++ @method wordMatchFold+ @param {String} query Query to match+ @param {Array} results Results to filter+ @return {Array} Filtered results+ @static+ **/+ wordMatchFold: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", "wordMatchFold", 118);+_yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 119);+if (!query) { return results; }++ _yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 121);+var queryWords = WordBreak.getUniqueWords(AccentFold.fold(query));++ _yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 123);+return YArray.filter(results, function (result) {+ // Convert resultWords array to a hash for fast lookup.+ _yuitest_coverfunc("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", "(anonymous 8)", 123);+_yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 125);+var resultWords = YArray.hash(WordBreak.getUniqueWords(+ AccentFold.fold(result.text)));++ _yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 128);+return YArray.every(queryWords, function (word) {+ _yuitest_coverfunc("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", "(anonymous 9)", 128);+_yuitest_coverline("build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", 129);+return YObject.owns(resultWords, word);+ });+ });+ }+});+++}, '3.7.1', {"requires": ["array-extras", "text-accentfold", "text-wordbreak"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('autocomplete-filters-accentfold', function(Y) {+YUI.add('autocomplete-filters-accentfold', function (Y, NAME) { /** Provides pre-built accent-folding result matching filters for AutoComplete.@@ -139,4 +139,4 @@ }); -}, '3.5.1' ,{requires:['array-extras', 'text-accentfold', 'text-wordbreak']});+}, '3.7.1', {"requires": ["array-extras", "text-accentfold", "text-wordbreak"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("autocomplete-filters-accentfold",function(d){var c=d.Text.AccentFold,a=d.Text.WordBreak,b=d.Array,e=d.Object;d.mix(d.namespace("AutoCompleteFilters"),{charMatchFold:function(h,g){if(!h){return g;}var f=b.unique(c.fold(h).split(""));return b.filter(g,function(i){var j=c.fold(i.text);return b.every(f,function(k){return j.indexOf(k)!==-1;});});},phraseMatchFold:function(g,f){if(!g){return f;}g=c.fold(g);return b.filter(f,function(h){return c.fold(h.text).indexOf(g)!==-1;});},startsWithFold:function(g,f){if(!g){return f;}g=c.fold(g);return b.filter(f,function(h){return c.fold(h.text).indexOf(g)===0;});},subWordMatchFold:function(h,f){if(!h){return f;}var g=a.getUniqueWords(c.fold(h));return b.filter(f,function(i){var j=c.fold(i.text);return b.every(g,function(k){return j.indexOf(k)!==-1;});});},wordMatchFold:function(h,f){if(!h){return f;}var g=a.getUniqueWords(c.fold(h));return b.filter(f,function(i){var j=b.hash(a.getUniqueWords(c.fold(i.text)));return b.every(g,function(k){return e.owns(j,k);});});}});},"3.5.1",{requires:["array-extras","text-accentfold","text-wordbreak"]});+YUI.add("autocomplete-filters-accentfold",function(e,t){var n=e.Text.AccentFold,r=e.Text.WordBreak,i=e.Array,s=e.Object;e.mix(e.namespace("AutoCompleteFilters"),{charMatchFold:function(e,t){if(!e)return t;var r=i.unique(n.fold(e).split(""));return i.filter(t,function(e){var t=n.fold(e.text);return i.every(r,function(e){return t.indexOf(e)!==-1})})},phraseMatchFold:function(e,t){return e?(e=n.fold(e),i.filter(t,function(t){return n.fold(t.text).indexOf(e)!==-1})):t},startsWithFold:function(e,t){return e?(e=n.fold(e),i.filter(t,function(t){return n.fold(t.text).indexOf(e)===0})):t},subWordMatchFold:function(e,t){if(!e)return t;var s=r.getUniqueWords(n.fold(e));return i.filter(t,function(e){var t=n.fold(e.text);return i.every(s,function(e){return t.indexOf(e)!==-1})})},wordMatchFold:function(e,t){if(!e)return t;var o=r.getUniqueWords(n.fold(e));return i.filter(t,function(e){var t=i.hash(r.getUniqueWords(n.fold(e.text)));return i.every(o,function(e){return s.owns(t,e)})})}})},"3.7.1",{requires:["array-extras","text-accentfold","text-wordbreak"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('autocomplete-filters-accentfold', function(Y) {+YUI.add('autocomplete-filters-accentfold', function (Y, NAME) { /** Provides pre-built accent-folding result matching filters for AutoComplete.@@ -139,4 +139,4 @@ }); -}, '3.5.1' ,{requires:['array-extras', 'text-accentfold', 'text-wordbreak']});+}, '3.7.1', {"requires": ["array-extras", "text-accentfold", "text-wordbreak"]});
@@ -0,0 +1,334 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/autocomplete-filters/autocomplete-filters.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/autocomplete-filters/autocomplete-filters.js",+ code: []+};+_yuitest_coverage["build/autocomplete-filters/autocomplete-filters.js"].code=["YUI.add('autocomplete-filters', function (Y, NAME) {","","/**","Provides pre-built result matching filters for AutoComplete.","","@module autocomplete","@submodule autocomplete-filters","@class AutoCompleteFilters","@static","**/","","var YArray = Y.Array,"," YObject = Y.Object,"," WordBreak = Y.Text.WordBreak,","","Filters = Y.mix(Y.namespace('AutoCompleteFilters'), {"," // -- Public Methods -------------------------------------------------------",""," /**"," Returns an array of results that contain all of the characters in the query,"," in any order (not necessarily consecutive). Case-insensitive.",""," @method charMatch"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," charMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // charMatchCase(). It's intentionally undocumented.",""," if (!query) { return results; }",""," var queryChars = YArray.unique((caseSensitive ? query :"," query.toLowerCase()).split(''));",""," return YArray.filter(results, function (result) {"," result = result.text;",""," if (!caseSensitive) {"," result = result.toLowerCase();"," }",""," return YArray.every(queryChars, function (chr) {"," return result.indexOf(chr) !== -1;"," });"," });"," },",""," /**"," Case-sensitive version of `charMatch()`.",""," @method charMatchCase"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," charMatchCase: function (query, results) {"," return Filters.charMatch(query, results, true);"," },",""," /**"," Returns an array of results that contain the complete query as a phrase."," Case-insensitive.",""," @method phraseMatch"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," phraseMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // phraseMatchCase(). It's intentionally undocumented.",""," if (!query) { return results; }",""," if (!caseSensitive) {"," query = query.toLowerCase();"," }",""," return YArray.filter(results, function (result) {"," return (caseSensitive ? result.text : result.text.toLowerCase()).indexOf(query) !== -1;"," });"," },",""," /**"," Case-sensitive version of `phraseMatch()`.",""," @method phraseMatchCase"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," phraseMatchCase: function (query, results) {"," return Filters.phraseMatch(query, results, true);"," },",""," /**"," Returns an array of results that start with the complete query as a phrase."," Case-insensitive.",""," @method startsWith"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," startsWith: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // startsWithCase(). It's intentionally undocumented.",""," if (!query) { return results; }",""," if (!caseSensitive) {"," query = query.toLowerCase();"," }",""," return YArray.filter(results, function (result) {"," return (caseSensitive ? result.text : result.text.toLowerCase()).indexOf(query) === 0;"," });"," },",""," /**"," Case-sensitive version of `startsWith()`.",""," @method startsWithCase"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," startsWithCase: function (query, results) {"," return Filters.startsWith(query, results, true);"," },",""," /**"," Returns an array of results in which all the words of the query match either"," whole words or parts of words in the result. Non-word characters like"," whitespace and certain punctuation are ignored. Case-insensitive.",""," This is basically a combination of `wordMatch()` (by ignoring whitespace and"," word order) and `phraseMatch()` (by allowing partial matching instead of"," requiring the entire word to match).",""," Example use case: Trying to find personal names independently of name order"," (Western or Eastern order) and supporting immediate feedback by allowing"," partial occurences. So queries like \"J. Doe\", \"Doe, John\", and \"J. D.\" would"," all match \"John Doe\".",""," @method subWordMatch"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," subWordMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // subWordMatchCase(). It's intentionally undocumented.",""," if (!query) { return results; }",""," var queryWords = WordBreak.getUniqueWords(query, {"," ignoreCase: !caseSensitive"," });",""," return YArray.filter(results, function (result) {"," var resultText = caseSensitive ? result.text :"," result.text.toLowerCase();",""," return YArray.every(queryWords, function (queryWord) {"," return resultText.indexOf(queryWord) !== -1;"," });"," });"," },",""," /**"," Case-sensitive version of `subWordMatch()`.",""," @method subWordMatchCase"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," subWordMatchCase: function (query, results) {"," return Filters.subWordMatch(query, results, true);"," },",""," /**"," Returns an array of results that contain all of the words in the query, in"," any order. Non-word characters like whitespace and certain punctuation are"," ignored. Case-insensitive.",""," @method wordMatch"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," wordMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // wordMatchCase(). It's intentionally undocumented.",""," if (!query) { return results; }",""," var options = {ignoreCase: !caseSensitive},"," queryWords = WordBreak.getUniqueWords(query, options);",""," return YArray.filter(results, function (result) {"," // Convert resultWords array to a hash for fast lookup."," var resultWords = YArray.hash(WordBreak.getUniqueWords(result.text,"," options));",""," return YArray.every(queryWords, function (word) {"," return YObject.owns(resultWords, word);"," });"," });"," },",""," /**"," Case-sensitive version of `wordMatch()`.",""," @method wordMatchCase"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," wordMatchCase: function (query, results) {"," return Filters.wordMatch(query, results, true);"," }","});","","","}, '3.7.1', {\"requires\": [\"array-extras\", \"text-wordbreak\"]});"];+_yuitest_coverage["build/autocomplete-filters/autocomplete-filters.js"].lines = {"1":0,"12":0,"33":0,"35":0,"38":0,"39":0,"41":0,"42":0,"45":0,"46":0,"61":0,"78":0,"80":0,"81":0,"84":0,"85":0,"99":0,"116":0,"118":0,"119":0,"122":0,"123":0,"137":0,"164":0,"166":0,"170":0,"171":0,"174":0,"175":0,"190":0,"208":0,"210":0,"213":0,"215":0,"218":0,"219":0,"234":0};+_yuitest_coverage["build/autocomplete-filters/autocomplete-filters.js"].functions = {"(anonymous 3):45":0,"(anonymous 2):38":0,"charMatch:29":0,"charMatchCase:60":0,"(anonymous 4):84":0,"phraseMatch:74":0,"phraseMatchCase:98":0,"(anonymous 5):122":0,"startsWith:112":0,"startsWithCase:136":0,"(anonymous 7):174":0,"(anonymous 6):170":0,"subWordMatch:160":0,"subWordMatchCase:189":0,"(anonymous 9):218":0,"(anonymous 8):213":0,"wordMatch:204":0,"wordMatchCase:233":0,"(anonymous 1):1":0};+_yuitest_coverage["build/autocomplete-filters/autocomplete-filters.js"].coveredLines = 37;+_yuitest_coverage["build/autocomplete-filters/autocomplete-filters.js"].coveredFunctions = 19;+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 1);+YUI.add('autocomplete-filters', function (Y, NAME) {++/**+Provides pre-built result matching filters for AutoComplete.++@module autocomplete+@submodule autocomplete-filters+@class AutoCompleteFilters+@static+**/++_yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "(anonymous 1)", 1);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 12);+var YArray = Y.Array,+ YObject = Y.Object,+ WordBreak = Y.Text.WordBreak,++Filters = Y.mix(Y.namespace('AutoCompleteFilters'), {+ // -- Public Methods -------------------------------------------------------++ /**+ Returns an array of results that contain all of the characters in the query,+ in any order (not necessarily consecutive). Case-insensitive.++ @method charMatch+ @param {String} query Query to match+ @param {Array} results Results to filter+ @return {Array} Filtered results+ @static+ **/+ charMatch: function (query, results, caseSensitive) {+ // The caseSensitive parameter is only intended for use by+ // charMatchCase(). It's intentionally undocumented.++ _yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "charMatch", 29);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 33);+if (!query) { return results; }++ _yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 35);+var queryChars = YArray.unique((caseSensitive ? query :+ query.toLowerCase()).split(''));++ _yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 38);+return YArray.filter(results, function (result) {+ _yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "(anonymous 2)", 38);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 39);+result = result.text;++ _yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 41);+if (!caseSensitive) {+ _yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 42);+result = result.toLowerCase();+ }++ _yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 45);+return YArray.every(queryChars, function (chr) {+ _yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "(anonymous 3)", 45);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 46);+return result.indexOf(chr) !== -1;+ });+ });+ },++ /**+ Case-sensitive version of `charMatch()`.++ @method charMatchCase+ @param {String} query Query to match+ @param {Array} results Results to filter+ @return {Array} Filtered results+ @static+ **/+ charMatchCase: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "charMatchCase", 60);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 61);+return Filters.charMatch(query, results, true);+ },++ /**+ Returns an array of results that contain the complete query as a phrase.+ Case-insensitive.++ @method phraseMatch+ @param {String} query Query to match+ @param {Array} results Results to filter+ @return {Array} Filtered results+ @static+ **/+ phraseMatch: function (query, results, caseSensitive) {+ // The caseSensitive parameter is only intended for use by+ // phraseMatchCase(). It's intentionally undocumented.++ _yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "phraseMatch", 74);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 78);+if (!query) { return results; }++ _yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 80);+if (!caseSensitive) {+ _yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 81);+query = query.toLowerCase();+ }++ _yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 84);+return YArray.filter(results, function (result) {+ _yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "(anonymous 4)", 84);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 85);+return (caseSensitive ? result.text : result.text.toLowerCase()).indexOf(query) !== -1;+ });+ },++ /**+ Case-sensitive version of `phraseMatch()`.++ @method phraseMatchCase+ @param {String} query Query to match+ @param {Array} results Results to filter+ @return {Array} Filtered results+ @static+ **/+ phraseMatchCase: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "phraseMatchCase", 98);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 99);+return Filters.phraseMatch(query, results, true);+ },++ /**+ Returns an array of results that start with the complete query as a phrase.+ Case-insensitive.++ @method startsWith+ @param {String} query Query to match+ @param {Array} results Results to filter+ @return {Array} Filtered results+ @static+ **/+ startsWith: function (query, results, caseSensitive) {+ // The caseSensitive parameter is only intended for use by+ // startsWithCase(). It's intentionally undocumented.++ _yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "startsWith", 112);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 116);+if (!query) { return results; }++ _yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 118);+if (!caseSensitive) {+ _yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 119);+query = query.toLowerCase();+ }++ _yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 122);+return YArray.filter(results, function (result) {+ _yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "(anonymous 5)", 122);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 123);+return (caseSensitive ? result.text : result.text.toLowerCase()).indexOf(query) === 0;+ });+ },++ /**+ Case-sensitive version of `startsWith()`.++ @method startsWithCase+ @param {String} query Query to match+ @param {Array} results Results to filter+ @return {Array} Filtered results+ @static+ **/+ startsWithCase: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "startsWithCase", 136);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 137);+return Filters.startsWith(query, results, true);+ },++ /**+ Returns an array of results in which all the words of the query match either+ whole words or parts of words in the result. Non-word characters like+ whitespace and certain punctuation are ignored. Case-insensitive.++ This is basically a combination of `wordMatch()` (by ignoring whitespace and+ word order) and `phraseMatch()` (by allowing partial matching instead of+ requiring the entire word to match).++ Example use case: Trying to find personal names independently of name order+ (Western or Eastern order) and supporting immediate feedback by allowing+ partial occurences. So queries like "J. Doe", "Doe, John", and "J. D." would+ all match "John Doe".++ @method subWordMatch+ @param {String} query Query to match+ @param {Array} results Results to filter+ @return {Array} Filtered results+ @static+ **/+ subWordMatch: function (query, results, caseSensitive) {+ // The caseSensitive parameter is only intended for use by+ // subWordMatchCase(). It's intentionally undocumented.++ _yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "subWordMatch", 160);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 164);+if (!query) { return results; }++ _yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 166);+var queryWords = WordBreak.getUniqueWords(query, {+ ignoreCase: !caseSensitive+ });++ _yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 170);+return YArray.filter(results, function (result) {+ _yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "(anonymous 6)", 170);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 171);+var resultText = caseSensitive ? result.text :+ result.text.toLowerCase();++ _yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 174);+return YArray.every(queryWords, function (queryWord) {+ _yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "(anonymous 7)", 174);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 175);+return resultText.indexOf(queryWord) !== -1;+ });+ });+ },++ /**+ Case-sensitive version of `subWordMatch()`.++ @method subWordMatchCase+ @param {String} query Query to match+ @param {Array} results Results to filter+ @return {Array} Filtered results+ @static+ **/+ subWordMatchCase: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "subWordMatchCase", 189);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 190);+return Filters.subWordMatch(query, results, true);+ },++ /**+ Returns an array of results that contain all of the words in the query, in+ any order. Non-word characters like whitespace and certain punctuation are+ ignored. Case-insensitive.++ @method wordMatch+ @param {String} query Query to match+ @param {Array} results Results to filter+ @return {Array} Filtered results+ @static+ **/+ wordMatch: function (query, results, caseSensitive) {+ // The caseSensitive parameter is only intended for use by+ // wordMatchCase(). It's intentionally undocumented.++ _yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "wordMatch", 204);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 208);+if (!query) { return results; }++ _yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 210);+var options = {ignoreCase: !caseSensitive},+ queryWords = WordBreak.getUniqueWords(query, options);++ _yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 213);+return YArray.filter(results, function (result) {+ // Convert resultWords array to a hash for fast lookup.+ _yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "(anonymous 8)", 213);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 215);+var resultWords = YArray.hash(WordBreak.getUniqueWords(result.text,+ options));++ _yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 218);+return YArray.every(queryWords, function (word) {+ _yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "(anonymous 9)", 218);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 219);+return YObject.owns(resultWords, word);+ });+ });+ },++ /**+ Case-sensitive version of `wordMatch()`.++ @method wordMatchCase+ @param {String} query Query to match+ @param {Array} results Results to filter+ @return {Array} Filtered results+ @static+ **/+ wordMatchCase: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-filters/autocomplete-filters.js", "wordMatchCase", 233);+_yuitest_coverline("build/autocomplete-filters/autocomplete-filters.js", 234);+return Filters.wordMatch(query, results, true);+ }+});+++}, '3.7.1', {"requires": ["array-extras", "text-wordbreak"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('autocomplete-filters', function(Y) {+YUI.add('autocomplete-filters', function (Y, NAME) { /** Provides pre-built result matching filters for AutoComplete.@@ -242,4 +242,4 @@ }); -}, '3.5.1' ,{requires:['array-extras', 'text-wordbreak']});+}, '3.7.1', {"requires": ["array-extras", "text-wordbreak"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("autocomplete-filters",function(d){var c=d.Array,e=d.Object,a=d.Text.WordBreak,b=d.mix(d.namespace("AutoCompleteFilters"),{charMatch:function(i,h,f){if(!i){return h;}var g=c.unique((f?i:i.toLowerCase()).split(""));return c.filter(h,function(j){j=j.text;if(!f){j=j.toLowerCase();}return c.every(g,function(k){return j.indexOf(k)!==-1;});});},charMatchCase:function(g,f){return b.charMatch(g,f,true);},phraseMatch:function(h,g,f){if(!h){return g;}if(!f){h=h.toLowerCase();}return c.filter(g,function(i){return(f?i.text:i.text.toLowerCase()).indexOf(h)!==-1;});},phraseMatchCase:function(g,f){return b.phraseMatch(g,f,true);},startsWith:function(h,g,f){if(!h){return g;}if(!f){h=h.toLowerCase();}return c.filter(g,function(i){return(f?i.text:i.text.toLowerCase()).indexOf(h)===0;});},startsWithCase:function(g,f){return b.startsWith(g,f,true);},subWordMatch:function(i,g,f){if(!i){return g;}var h=a.getUniqueWords(i,{ignoreCase:!f});return c.filter(g,function(j){var k=f?j.text:j.text.toLowerCase();return c.every(h,function(l){return k.indexOf(l)!==-1;});});},subWordMatchCase:function(g,f){return b.subWordMatch(g,f,true);},wordMatch:function(j,h,f){if(!j){return h;}var g={ignoreCase:!f},i=a.getUniqueWords(j,g);return c.filter(h,function(k){var l=c.hash(a.getUniqueWords(k.text,g));return c.every(i,function(m){return e.owns(l,m);});});},wordMatchCase:function(g,f){return b.wordMatch(g,f,true);}});},"3.5.1",{requires:["array-extras","text-wordbreak"]});+YUI.add("autocomplete-filters",function(e,t){var n=e.Array,r=e.Object,i=e.Text.WordBreak,s=e.mix(e.namespace("AutoCompleteFilters"),{charMatch:function(e,t,r){if(!e)return t;var i=n.unique((r?e:e.toLowerCase()).split(""));return n.filter(t,function(e){return e=e.text,r||(e=e.toLowerCase()),n.every(i,function(t){return e.indexOf(t)!==-1})})},charMatchCase:function(e,t){return s.charMatch(e,t,!0)},phraseMatch:function(e,t,r){return e?(r||(e=e.toLowerCase()),n.filter(t,function(t){return(r?t.text:t.text.toLowerCase()).indexOf(e)!==-1})):t},phraseMatchCase:function(e,t){return s.phraseMatch(e,t,!0)},startsWith:function(e,t,r){return e?(r||(e=e.toLowerCase()),n.filter(t,function(t){return(r?t.text:t.text.toLowerCase()).indexOf(e)===0})):t},startsWithCase:function(e,t){return s.startsWith(e,t,!0)},subWordMatch:function(e,t,r){if(!e)return t;var s=i.getUniqueWords(e,{ignoreCase:!r});return n.filter(t,function(e){var t=r?e.text:e.text.toLowerCase();return n.every(s,function(e){return t.indexOf(e)!==-1})})},subWordMatchCase:function(e,t){return s.subWordMatch(e,t,!0)},wordMatch:function(e,t,s){if(!e)return t;var o={ignoreCase:!s},u=i.getUniqueWords(e,o);return n.filter(t,function(e){var t=n.hash(i.getUniqueWords(e.text,o));return n.every(u,function(e){return r.owns(t,e)})})},wordMatchCase:function(e,t){return s.wordMatch(e,t,!0)}})},"3.7.1",{requires:["array-extras","text-wordbreak"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('autocomplete-filters', function(Y) {+YUI.add('autocomplete-filters', function (Y, NAME) { /** Provides pre-built result matching filters for AutoComplete.@@ -242,4 +242,4 @@ }); -}, '3.5.1' ,{requires:['array-extras', 'text-wordbreak']});+}, '3.7.1', {"requires": ["array-extras", "text-wordbreak"]});
@@ -0,0 +1,172 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js",+ code: []+};+_yuitest_coverage["build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js"].code=["YUI.add('autocomplete-highlighters-accentfold', function (Y, NAME) {","","/**","Provides pre-built accent-folding result highlighters for AutoComplete.","","These highlighters are similar to the ones provided by the `autocomplete-","highlighters` module, but use accent-aware comparisons. For example, \"resume\"","and \"résumé\" will be considered equal when using the accent-folding","highlighters.","","@module autocomplete","@submodule autocomplete-highlighters-accentfold","**/","","/**","@class AutoCompleteHighlighters","@static","**/","","var Highlight = Y.Highlight,"," YArray = Y.Array;","","Y.mix(Y.namespace('AutoCompleteHighlighters'), {"," /**"," Accent-folding version of `charMatch()`.",""," @method charMatchFold"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," charMatchFold: function (query, results) {"," var queryChars = YArray.unique(query.split(''));",""," return YArray.map(results, function (result) {"," return Highlight.allFold(result.text, queryChars);"," });"," },",""," /**"," Accent-folding version of `phraseMatch()`.",""," @method phraseMatchFold"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," phraseMatchFold: function (query, results) {"," return YArray.map(results, function (result) {"," return Highlight.allFold(result.text, [query]);"," });"," },",""," /**"," Accent-folding version of `startsWith()`.",""," @method startsWithFold"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," startsWithFold: function (query, results) {"," return YArray.map(results, function (result) {"," return Highlight.allFold(result.text, [query], {"," startsWith: true"," });"," });"," },",""," /**"," Accent-folding version of `subWordMatch()`.",""," @method subWordMatchFold"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," subWordMatchFold: function (query, results) {"," var queryWords = Y.Text.WordBreak.getUniqueWords(query);",""," return YArray.map(results, function (result) {"," return Highlight.allFold(result.text, queryWords);"," });"," },",""," /**"," Accent-folding version of `wordMatch()`.",""," @method wordMatchFold"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," wordMatchFold: function (query, results) {"," return YArray.map(results, function (result) {"," return Highlight.wordsFold(result.text, query);"," });"," }","});","","","}, '3.7.1', {\"requires\": [\"array-extras\", \"highlight-accentfold\"]});"];+_yuitest_coverage["build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js"].lines = {"1":0,"20":0,"23":0,"34":0,"36":0,"37":0,"51":0,"52":0,"66":0,"67":0,"83":0,"85":0,"86":0,"100":0,"101":0};+_yuitest_coverage["build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js"].functions = {"(anonymous 2):36":0,"charMatchFold:33":0,"(anonymous 3):51":0,"phraseMatchFold:50":0,"(anonymous 4):66":0,"startsWithFold:65":0,"(anonymous 5):85":0,"subWordMatchFold:82":0,"(anonymous 6):100":0,"wordMatchFold:99":0,"(anonymous 1):1":0};+_yuitest_coverage["build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js"].coveredLines = 15;+_yuitest_coverage["build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js"].coveredFunctions = 11;+_yuitest_coverline("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", 1);+YUI.add('autocomplete-highlighters-accentfold', function (Y, NAME) {++/**+Provides pre-built accent-folding result highlighters for AutoComplete.++These highlighters are similar to the ones provided by the `autocomplete-+highlighters` module, but use accent-aware comparisons. For example, "resume"+and "résumé" will be considered equal when using the accent-folding+highlighters.++@module autocomplete+@submodule autocomplete-highlighters-accentfold+**/++/**+@class AutoCompleteHighlighters+@static+**/++_yuitest_coverfunc("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", "(anonymous 1)", 1);+_yuitest_coverline("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", 20);+var Highlight = Y.Highlight,+ YArray = Y.Array;++_yuitest_coverline("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", 23);+Y.mix(Y.namespace('AutoCompleteHighlighters'), {+ /**+ Accent-folding version of `charMatch()`.++ @method charMatchFold+ @param {String} query Query to match+ @param {Array} results Results to highlight+ @return {Array} Highlighted results+ @static+ **/+ charMatchFold: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", "charMatchFold", 33);+_yuitest_coverline("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", 34);+var queryChars = YArray.unique(query.split(''));++ _yuitest_coverline("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", 36);+return YArray.map(results, function (result) {+ _yuitest_coverfunc("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", "(anonymous 2)", 36);+_yuitest_coverline("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", 37);+return Highlight.allFold(result.text, queryChars);+ });+ },++ /**+ Accent-folding version of `phraseMatch()`.++ @method phraseMatchFold+ @param {String} query Query to match+ @param {Array} results Results to highlight+ @return {Array} Highlighted results+ @static+ **/+ phraseMatchFold: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", "phraseMatchFold", 50);+_yuitest_coverline("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", 51);+return YArray.map(results, function (result) {+ _yuitest_coverfunc("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", "(anonymous 3)", 51);+_yuitest_coverline("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", 52);+return Highlight.allFold(result.text, [query]);+ });+ },++ /**+ Accent-folding version of `startsWith()`.++ @method startsWithFold+ @param {String} query Query to match+ @param {Array} results Results to highlight+ @return {Array} Highlighted results+ @static+ **/+ startsWithFold: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", "startsWithFold", 65);+_yuitest_coverline("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", 66);+return YArray.map(results, function (result) {+ _yuitest_coverfunc("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", "(anonymous 4)", 66);+_yuitest_coverline("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", 67);+return Highlight.allFold(result.text, [query], {+ startsWith: true+ });+ });+ },++ /**+ Accent-folding version of `subWordMatch()`.++ @method subWordMatchFold+ @param {String} query Query to match+ @param {Array} results Results to highlight+ @return {Array} Highlighted results+ @static+ **/+ subWordMatchFold: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", "subWordMatchFold", 82);+_yuitest_coverline("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", 83);+var queryWords = Y.Text.WordBreak.getUniqueWords(query);++ _yuitest_coverline("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", 85);+return YArray.map(results, function (result) {+ _yuitest_coverfunc("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", "(anonymous 5)", 85);+_yuitest_coverline("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", 86);+return Highlight.allFold(result.text, queryWords);+ });+ },++ /**+ Accent-folding version of `wordMatch()`.++ @method wordMatchFold+ @param {String} query Query to match+ @param {Array} results Results to highlight+ @return {Array} Highlighted results+ @static+ **/+ wordMatchFold: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", "wordMatchFold", 99);+_yuitest_coverline("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", 100);+return YArray.map(results, function (result) {+ _yuitest_coverfunc("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", "(anonymous 6)", 100);+_yuitest_coverline("build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", 101);+return Highlight.wordsFold(result.text, query);+ });+ }+});+++}, '3.7.1', {"requires": ["array-extras", "highlight-accentfold"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('autocomplete-highlighters-accentfold', function(Y) {+YUI.add('autocomplete-highlighters-accentfold', function (Y, NAME) { /** Provides pre-built accent-folding result highlighters for AutoComplete.@@ -110,4 +110,4 @@ }); -}, '3.5.1' ,{requires:['array-extras', 'highlight-accentfold']});+}, '3.7.1', {"requires": ["array-extras", "highlight-accentfold"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("autocomplete-highlighters-accentfold",function(c){var a=c.Highlight,b=c.Array;c.mix(c.namespace("AutoCompleteHighlighters"),{charMatchFold:function(f,e){var d=b.unique(f.split(""));return b.map(e,function(g){return a.allFold(g.text,d);});},phraseMatchFold:function(e,d){return b.map(d,function(f){return a.allFold(f.text,[e]);});},startsWithFold:function(e,d){return b.map(d,function(f){return a.allFold(f.text,[e],{startsWith:true});});},subWordMatchFold:function(f,d){var e=c.Text.WordBreak.getUniqueWords(f);return b.map(d,function(g){return a.allFold(g.text,e);});},wordMatchFold:function(e,d){return b.map(d,function(f){return a.wordsFold(f.text,e);});}});},"3.5.1",{requires:["array-extras","highlight-accentfold"]});+YUI.add("autocomplete-highlighters-accentfold",function(e,t){var n=e.Highlight,r=e.Array;e.mix(e.namespace("AutoCompleteHighlighters"),{charMatchFold:function(e,t){var i=r.unique(e.split(""));return r.map(t,function(e){return n.allFold(e.text,i)})},phraseMatchFold:function(e,t){return r.map(t,function(t){return n.allFold(t.text,[e])})},startsWithFold:function(e,t){return r.map(t,function(t){return n.allFold(t.text,[e],{startsWith:!0})})},subWordMatchFold:function(t,i){var s=e.Text.WordBreak.getUniqueWords(t);return r.map(i,function(e){return n.allFold(e.text,s)})},wordMatchFold:function(e,t){return r.map(t,function(t){return n.wordsFold(t.text,e)})}})},"3.7.1",{requires:["array-extras","highlight-accentfold"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('autocomplete-highlighters-accentfold', function(Y) {+YUI.add('autocomplete-highlighters-accentfold', function (Y, NAME) { /** Provides pre-built accent-folding result highlighters for AutoComplete.@@ -110,4 +110,4 @@ }); -}, '3.5.1' ,{requires:['array-extras', 'highlight-accentfold']});+}, '3.7.1', {"requires": ["array-extras", "highlight-accentfold"]});
@@ -0,0 +1,273 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/autocomplete-highlighters/autocomplete-highlighters.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/autocomplete-highlighters/autocomplete-highlighters.js",+ code: []+};+_yuitest_coverage["build/autocomplete-highlighters/autocomplete-highlighters.js"].code=["YUI.add('autocomplete-highlighters', function (Y, NAME) {","","/**","Provides pre-built result highlighters for AutoComplete.","","@module autocomplete","@submodule autocomplete-highlighters","@class AutoCompleteHighlighters","@static","**/","","var YArray = Y.Array,"," Highlight = Y.Highlight,","","Highlighters = Y.mix(Y.namespace('AutoCompleteHighlighters'), {"," // -- Public Methods -------------------------------------------------------",""," /**"," Highlights any individual query character that occurs anywhere in a result."," Case-insensitive.",""," @method charMatch"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," charMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // charMatchCase(). It's intentionally undocumented.",""," var queryChars = YArray.unique((caseSensitive ? query :"," query.toLowerCase()).split(''));",""," return YArray.map(results, function (result) {"," return Highlight.all(result.text, queryChars, {"," caseSensitive: caseSensitive"," });"," });"," },",""," /**"," Case-sensitive version of `charMatch()`.",""," @method charMatchCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," charMatchCase: function (query, results) {"," return Highlighters.charMatch(query, results, true);"," },",""," /**"," Highlights the complete query as a phrase anywhere within a result. Case-"," insensitive.",""," @method phraseMatch"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," phraseMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // phraseMatchCase(). It's intentionally undocumented.",""," return YArray.map(results, function (result) {"," return Highlight.all(result.text, [query], {"," caseSensitive: caseSensitive"," });"," });"," },",""," /**"," Case-sensitive version of `phraseMatch()`.",""," @method phraseMatchCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," phraseMatchCase: function (query, results) {"," return Highlighters.phraseMatch(query, results, true);"," },",""," /**"," Highlights the complete query as a phrase at the beginning of a result."," Case-insensitive.",""," @method startsWith"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," startsWith: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // startsWithCase(). It's intentionally undocumented.",""," return YArray.map(results, function (result) {"," return Highlight.all(result.text, [query], {"," caseSensitive: caseSensitive,"," startsWith : true"," });"," });"," },",""," /**"," Case-sensitive version of `startsWith()`.",""," @method startsWithCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," startsWithCase: function (query, results) {"," return Highlighters.startsWith(query, results, true);"," },",""," /**"," Highlights portions of results in which words from the query match either"," whole words or parts of words in the result. Non-word characters like"," whitespace and certain punctuation are ignored. Case-insensitive.",""," @method subWordMatch"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," subWordMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // subWordMatchCase(). It's intentionally undocumented.",""," var queryWords = Y.Text.WordBreak.getUniqueWords(query, {"," ignoreCase: !caseSensitive"," });",""," return YArray.map(results, function (result) {"," return Highlight.all(result.text, queryWords, {"," caseSensitive: caseSensitive"," });"," });"," },",""," /**"," Case-sensitive version of `subWordMatch()`.",""," @method subWordMatchCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," subWordMatchCase: function (query, results) {"," return Highlighters.subWordMatch(query, results, true);"," },",""," /**"," Highlights individual words in results that are also in the query. Non-word"," characters like punctuation are ignored. Case-insensitive.",""," @method wordMatch"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," wordMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // wordMatchCase(). It's intentionally undocumented.",""," return YArray.map(results, function (result) {"," return Highlight.words(result.text, query, {"," caseSensitive: caseSensitive"," });"," });"," },",""," /**"," Case-sensitive version of `wordMatch()`.",""," @method wordMatchCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," wordMatchCase: function (query, results) {"," return Highlighters.wordMatch(query, results, true);"," }","});","","","}, '3.7.1', {\"requires\": [\"array-extras\", \"highlight-base\"]});"];+_yuitest_coverage["build/autocomplete-highlighters/autocomplete-highlighters.js"].lines = {"1":0,"12":0,"32":0,"35":0,"36":0,"52":0,"69":0,"70":0,"86":0,"103":0,"104":0,"121":0,"139":0,"143":0,"144":0,"160":0,"177":0,"178":0,"194":0};+_yuitest_coverage["build/autocomplete-highlighters/autocomplete-highlighters.js"].functions = {"(anonymous 2):35":0,"charMatch:28":0,"charMatchCase:51":0,"(anonymous 3):69":0,"phraseMatch:65":0,"phraseMatchCase:85":0,"(anonymous 4):103":0,"startsWith:99":0,"startsWithCase:120":0,"(anonymous 5):143":0,"subWordMatch:135":0,"subWordMatchCase:159":0,"(anonymous 6):177":0,"wordMatch:173":0,"wordMatchCase:193":0,"(anonymous 1):1":0};+_yuitest_coverage["build/autocomplete-highlighters/autocomplete-highlighters.js"].coveredLines = 19;+_yuitest_coverage["build/autocomplete-highlighters/autocomplete-highlighters.js"].coveredFunctions = 16;+_yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 1);+YUI.add('autocomplete-highlighters', function (Y, NAME) {++/**+Provides pre-built result highlighters for AutoComplete.++@module autocomplete+@submodule autocomplete-highlighters+@class AutoCompleteHighlighters+@static+**/++_yuitest_coverfunc("build/autocomplete-highlighters/autocomplete-highlighters.js", "(anonymous 1)", 1);+_yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 12);+var YArray = Y.Array,+ Highlight = Y.Highlight,++Highlighters = Y.mix(Y.namespace('AutoCompleteHighlighters'), {+ // -- Public Methods -------------------------------------------------------++ /**+ Highlights any individual query character that occurs anywhere in a result.+ Case-insensitive.++ @method charMatch+ @param {String} query Query to match+ @param {Array} results Results to highlight+ @return {Array} Highlighted results+ @static+ **/+ charMatch: function (query, results, caseSensitive) {+ // The caseSensitive parameter is only intended for use by+ // charMatchCase(). It's intentionally undocumented.++ _yuitest_coverfunc("build/autocomplete-highlighters/autocomplete-highlighters.js", "charMatch", 28);+_yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 32);+var queryChars = YArray.unique((caseSensitive ? query :+ query.toLowerCase()).split(''));++ _yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 35);+return YArray.map(results, function (result) {+ _yuitest_coverfunc("build/autocomplete-highlighters/autocomplete-highlighters.js", "(anonymous 2)", 35);+_yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 36);+return Highlight.all(result.text, queryChars, {+ caseSensitive: caseSensitive+ });+ });+ },++ /**+ Case-sensitive version of `charMatch()`.++ @method charMatchCase+ @param {String} query Query to match+ @param {Array} results Results to highlight+ @return {Array} Highlighted results+ @static+ **/+ charMatchCase: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-highlighters/autocomplete-highlighters.js", "charMatchCase", 51);+_yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 52);+return Highlighters.charMatch(query, results, true);+ },++ /**+ Highlights the complete query as a phrase anywhere within a result. Case-+ insensitive.++ @method phraseMatch+ @param {String} query Query to match+ @param {Array} results Results to highlight+ @return {Array} Highlighted results+ @static+ **/+ phraseMatch: function (query, results, caseSensitive) {+ // The caseSensitive parameter is only intended for use by+ // phraseMatchCase(). It's intentionally undocumented.++ _yuitest_coverfunc("build/autocomplete-highlighters/autocomplete-highlighters.js", "phraseMatch", 65);+_yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 69);+return YArray.map(results, function (result) {+ _yuitest_coverfunc("build/autocomplete-highlighters/autocomplete-highlighters.js", "(anonymous 3)", 69);+_yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 70);+return Highlight.all(result.text, [query], {+ caseSensitive: caseSensitive+ });+ });+ },++ /**+ Case-sensitive version of `phraseMatch()`.++ @method phraseMatchCase+ @param {String} query Query to match+ @param {Array} results Results to highlight+ @return {Array} Highlighted results+ @static+ **/+ phraseMatchCase: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-highlighters/autocomplete-highlighters.js", "phraseMatchCase", 85);+_yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 86);+return Highlighters.phraseMatch(query, results, true);+ },++ /**+ Highlights the complete query as a phrase at the beginning of a result.+ Case-insensitive.++ @method startsWith+ @param {String} query Query to match+ @param {Array} results Results to highlight+ @return {Array} Highlighted results+ @static+ **/+ startsWith: function (query, results, caseSensitive) {+ // The caseSensitive parameter is only intended for use by+ // startsWithCase(). It's intentionally undocumented.++ _yuitest_coverfunc("build/autocomplete-highlighters/autocomplete-highlighters.js", "startsWith", 99);+_yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 103);+return YArray.map(results, function (result) {+ _yuitest_coverfunc("build/autocomplete-highlighters/autocomplete-highlighters.js", "(anonymous 4)", 103);+_yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 104);+return Highlight.all(result.text, [query], {+ caseSensitive: caseSensitive,+ startsWith : true+ });+ });+ },++ /**+ Case-sensitive version of `startsWith()`.++ @method startsWithCase+ @param {String} query Query to match+ @param {Array} results Results to highlight+ @return {Array} Highlighted results+ @static+ **/+ startsWithCase: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-highlighters/autocomplete-highlighters.js", "startsWithCase", 120);+_yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 121);+return Highlighters.startsWith(query, results, true);+ },++ /**+ Highlights portions of results in which words from the query match either+ whole words or parts of words in the result. Non-word characters like+ whitespace and certain punctuation are ignored. Case-insensitive.++ @method subWordMatch+ @param {String} query Query to match+ @param {Array} results Results to highlight+ @return {Array} Highlighted results+ @static+ **/+ subWordMatch: function (query, results, caseSensitive) {+ // The caseSensitive parameter is only intended for use by+ // subWordMatchCase(). It's intentionally undocumented.++ _yuitest_coverfunc("build/autocomplete-highlighters/autocomplete-highlighters.js", "subWordMatch", 135);+_yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 139);+var queryWords = Y.Text.WordBreak.getUniqueWords(query, {+ ignoreCase: !caseSensitive+ });++ _yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 143);+return YArray.map(results, function (result) {+ _yuitest_coverfunc("build/autocomplete-highlighters/autocomplete-highlighters.js", "(anonymous 5)", 143);+_yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 144);+return Highlight.all(result.text, queryWords, {+ caseSensitive: caseSensitive+ });+ });+ },++ /**+ Case-sensitive version of `subWordMatch()`.++ @method subWordMatchCase+ @param {String} query Query to match+ @param {Array} results Results to highlight+ @return {Array} Highlighted results+ @static+ **/+ subWordMatchCase: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-highlighters/autocomplete-highlighters.js", "subWordMatchCase", 159);+_yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 160);+return Highlighters.subWordMatch(query, results, true);+ },++ /**+ Highlights individual words in results that are also in the query. Non-word+ characters like punctuation are ignored. Case-insensitive.++ @method wordMatch+ @param {String} query Query to match+ @param {Array} results Results to highlight+ @return {Array} Highlighted results+ @static+ **/+ wordMatch: function (query, results, caseSensitive) {+ // The caseSensitive parameter is only intended for use by+ // wordMatchCase(). It's intentionally undocumented.++ _yuitest_coverfunc("build/autocomplete-highlighters/autocomplete-highlighters.js", "wordMatch", 173);+_yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 177);+return YArray.map(results, function (result) {+ _yuitest_coverfunc("build/autocomplete-highlighters/autocomplete-highlighters.js", "(anonymous 6)", 177);+_yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 178);+return Highlight.words(result.text, query, {+ caseSensitive: caseSensitive+ });+ });+ },++ /**+ Case-sensitive version of `wordMatch()`.++ @method wordMatchCase+ @param {String} query Query to match+ @param {Array} results Results to highlight+ @return {Array} Highlighted results+ @static+ **/+ wordMatchCase: function (query, results) {+ _yuitest_coverfunc("build/autocomplete-highlighters/autocomplete-highlighters.js", "wordMatchCase", 193);+_yuitest_coverline("build/autocomplete-highlighters/autocomplete-highlighters.js", 194);+return Highlighters.wordMatch(query, results, true);+ }+});+++}, '3.7.1', {"requires": ["array-extras", "highlight-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('autocomplete-highlighters', function(Y) {+YUI.add('autocomplete-highlighters', function (Y, NAME) { /** Provides pre-built result highlighters for AutoComplete.@@ -202,4 +202,4 @@ }); -}, '3.5.1' ,{requires:['array-extras', 'highlight-base']});+}, '3.7.1', {"requires": ["array-extras", "highlight-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("autocomplete-highlighters",function(d){var c=d.Array,a=d.Highlight,b=d.mix(d.namespace("AutoCompleteHighlighters"),{charMatch:function(h,g,e){var f=c.unique((e?h:h.toLowerCase()).split(""));return c.map(g,function(i){return a.all(i.text,f,{caseSensitive:e});});},charMatchCase:function(f,e){return b.charMatch(f,e,true);},phraseMatch:function(g,f,e){return c.map(f,function(h){return a.all(h.text,[g],{caseSensitive:e});});},phraseMatchCase:function(f,e){return b.phraseMatch(f,e,true);},startsWith:function(g,f,e){return c.map(f,function(h){return a.all(h.text,[g],{caseSensitive:e,startsWith:true});});},startsWithCase:function(f,e){return b.startsWith(f,e,true);},subWordMatch:function(h,f,e){var g=d.Text.WordBreak.getUniqueWords(h,{ignoreCase:!e});return c.map(f,function(i){return a.all(i.text,g,{caseSensitive:e});});},subWordMatchCase:function(f,e){return b.subWordMatch(f,e,true);},wordMatch:function(g,f,e){return c.map(f,function(h){return a.words(h.text,g,{caseSensitive:e});});},wordMatchCase:function(f,e){return b.wordMatch(f,e,true);}});},"3.5.1",{requires:["array-extras","highlight-base"]});+YUI.add("autocomplete-highlighters",function(e,t){var n=e.Array,r=e.Highlight,i=e.mix(e.namespace("AutoCompleteHighlighters"),{charMatch:function(e,t,i){var s=n.unique((i?e:e.toLowerCase()).split(""));return n.map(t,function(e){return r.all(e.text,s,{caseSensitive:i})})},charMatchCase:function(e,t){return i.charMatch(e,t,!0)},phraseMatch:function(e,t,i){return n.map(t,function(t){return r.all(t.text,[e],{caseSensitive:i})})},phraseMatchCase:function(e,t){return i.phraseMatch(e,t,!0)},startsWith:function(e,t,i){return n.map(t,function(t){return r.all(t.text,[e],{caseSensitive:i,startsWith:!0})})},startsWithCase:function(e,t){return i.startsWith(e,t,!0)},subWordMatch:function(t,i,s){var o=e.Text.WordBreak.getUniqueWords(t,{ignoreCase:!s});return n.map(i,function(e){return r.all(e.text,o,{caseSensitive:s})})},subWordMatchCase:function(e,t){return i.subWordMatch(e,t,!0)},wordMatch:function(e,t,i){return n.map(t,function(t){return r.words(t.text,e,{caseSensitive:i})})},wordMatchCase:function(e,t){return i.wordMatch(e,t,!0)}})},"3.7.1",{requires:["array-extras","highlight-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('autocomplete-highlighters', function(Y) {+YUI.add('autocomplete-highlighters', function (Y, NAME) { /** Provides pre-built result highlighters for AutoComplete.@@ -202,4 +202,4 @@ }); -}, '3.5.1' ,{requires:['array-extras', 'highlight-base']});+}, '3.7.1', {"requires": ["array-extras", "highlight-base"]});
@@ -0,0 +1,281 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/autocomplete-list-keys/autocomplete-list-keys.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/autocomplete-list-keys/autocomplete-list-keys.js",+ code: []+};+_yuitest_coverage["build/autocomplete-list-keys/autocomplete-list-keys.js"].code=["YUI.add('autocomplete-list-keys', function (Y, NAME) {","","/**","Mixes keyboard support into AutoCompleteList. By default, this module is not","loaded for iOS and Android devices.","","@module autocomplete","@submodule autocomplete-list-keys","**/",""," // keyCode constants.","var KEY_DOWN = 40,"," KEY_ENTER = 13,"," KEY_ESC = 27,"," KEY_TAB = 9,"," KEY_UP = 38;","","function ListKeys() {"," Y.before(this._bindKeys, this, 'bindUI');"," this._initKeys();","}","","ListKeys.prototype = {"," // -- Lifecycle Methods ----------------------------------------------------",""," /**"," Initializes keyboard command mappings.",""," @method _initKeys"," @protected"," @for AutoCompleteList"," **/"," _initKeys: function () {"," var keys = {},"," keysVisible = {};",""," // Register keyboard command handlers. _keys contains handlers that will"," // always be called; _keysVisible contains handlers that will only be"," // called when the list is visible."," keys[KEY_DOWN] = this._keyDown;",""," keysVisible[KEY_ENTER] = this._keyEnter;"," keysVisible[KEY_ESC] = this._keyEsc;"," keysVisible[KEY_TAB] = this._keyTab;"," keysVisible[KEY_UP] = this._keyUp;",""," this._keys = keys;"," this._keysVisible = keysVisible;"," },",""," destructor: function () {"," this._unbindKeys();"," },",""," /**"," Binds keyboard events.",""," @method _bindKeys"," @protected"," **/"," _bindKeys: function () {"," this._keyEvents = this._inputNode.on('keydown', this._onInputKey, this);"," },",""," /**"," Unbinds keyboard events.",""," @method _unbindKeys"," @protected"," **/"," _unbindKeys: function () {"," this._keyEvents && this._keyEvents.detach();"," this._keyEvents = null;"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Called when the down arrow key is pressed.",""," @method _keyDown"," @protected"," **/"," _keyDown: function () {"," if (this.get('visible')) {"," this._activateNextItem();"," } else {"," this.show();"," }"," },",""," /**"," Called when the enter key is pressed.",""," @method _keyEnter"," @protected"," **/"," _keyEnter: function (e) {"," var item = this.get('activeItem');",""," if (item) {"," this.selectItem(item, e);"," } else {"," // Don't prevent form submission when there's no active item."," return false;"," }"," },",""," /**"," Called when the escape key is pressed.",""," @method _keyEsc"," @protected"," **/"," _keyEsc: function () {"," this.hide();"," },",""," /**"," Called when the tab key is pressed.",""," @method _keyTab"," @protected"," **/"," _keyTab: function (e) {"," var item;",""," if (this.get('tabSelect')) {"," item = this.get('activeItem');",""," if (item) {"," this.selectItem(item, e);"," return true;"," }"," }",""," return false;"," },",""," /**"," Called when the up arrow key is pressed.",""," @method _keyUp"," @protected"," **/"," _keyUp: function () {"," this._activatePrevItem();"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles `inputNode` key events.",""," @method _onInputKey"," @param {EventTarget} e"," @protected"," **/"," _onInputKey: function (e) {"," var handler,"," keyCode = e.keyCode;",""," this._lastInputKey = keyCode;",""," if (this.get('results').length) {"," handler = this._keys[keyCode];",""," if (!handler && this.get('visible')) {"," handler = this._keysVisible[keyCode];"," }",""," if (handler) {"," // A handler may return false to indicate that it doesn't wish"," // to prevent the default key behavior."," if (handler.call(this, e) !== false) {"," e.preventDefault();"," }"," }"," }"," }","};","","Y.Base.mix(Y.AutoCompleteList, [ListKeys]);","","","}, '3.7.1', {\"requires\": [\"autocomplete-list\", \"base-build\"]});"];+_yuitest_coverage["build/autocomplete-list-keys/autocomplete-list-keys.js"].lines = {"1":0,"12":0,"18":0,"19":0,"20":0,"23":0,"34":0,"40":0,"42":0,"43":0,"44":0,"45":0,"47":0,"48":0,"52":0,"62":0,"72":0,"73":0,"85":0,"86":0,"88":0,"99":0,"101":0,"102":0,"105":0,"116":0,"126":0,"128":0,"129":0,"131":0,"132":0,"133":0,"137":0,"147":0,"160":0,"163":0,"165":0,"166":0,"168":0,"169":0,"172":0,"175":0,"176":0,"183":0};+_yuitest_coverage["build/autocomplete-list-keys/autocomplete-list-keys.js"].functions = {"ListKeys:18":0,"_initKeys:33":0,"destructor:51":0,"_bindKeys:61":0,"_unbindKeys:71":0,"_keyDown:84":0,"_keyEnter:98":0,"_keyEsc:115":0,"_keyTab:125":0,"_keyUp:146":0,"_onInputKey:159":0,"(anonymous 1):1":0};+_yuitest_coverage["build/autocomplete-list-keys/autocomplete-list-keys.js"].coveredLines = 44;+_yuitest_coverage["build/autocomplete-list-keys/autocomplete-list-keys.js"].coveredFunctions = 12;+_yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 1);+YUI.add('autocomplete-list-keys', function (Y, NAME) {++/**+Mixes keyboard support into AutoCompleteList. By default, this module is not+loaded for iOS and Android devices.++@module autocomplete+@submodule autocomplete-list-keys+**/++ // keyCode constants.+_yuitest_coverfunc("build/autocomplete-list-keys/autocomplete-list-keys.js", "(anonymous 1)", 1);+_yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 12);+var KEY_DOWN = 40,+ KEY_ENTER = 13,+ KEY_ESC = 27,+ KEY_TAB = 9,+ KEY_UP = 38;++_yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 18);+function ListKeys() {+ _yuitest_coverfunc("build/autocomplete-list-keys/autocomplete-list-keys.js", "ListKeys", 18);+_yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 19);+Y.before(this._bindKeys, this, 'bindUI');+ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 20);+this._initKeys();+}++_yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 23);+ListKeys.prototype = {+ // -- Lifecycle Methods ----------------------------------------------------++ /**+ Initializes keyboard command mappings.++ @method _initKeys+ @protected+ @for AutoCompleteList+ **/+ _initKeys: function () {+ _yuitest_coverfunc("build/autocomplete-list-keys/autocomplete-list-keys.js", "_initKeys", 33);+_yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 34);+var keys = {},+ keysVisible = {};++ // Register keyboard command handlers. _keys contains handlers that will+ // always be called; _keysVisible contains handlers that will only be+ // called when the list is visible.+ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 40);+keys[KEY_DOWN] = this._keyDown;++ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 42);+keysVisible[KEY_ENTER] = this._keyEnter;+ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 43);+keysVisible[KEY_ESC] = this._keyEsc;+ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 44);+keysVisible[KEY_TAB] = this._keyTab;+ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 45);+keysVisible[KEY_UP] = this._keyUp;++ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 47);+this._keys = keys;+ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 48);+this._keysVisible = keysVisible;+ },++ destructor: function () {+ _yuitest_coverfunc("build/autocomplete-list-keys/autocomplete-list-keys.js", "destructor", 51);+_yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 52);+this._unbindKeys();+ },++ /**+ Binds keyboard events.++ @method _bindKeys+ @protected+ **/+ _bindKeys: function () {+ _yuitest_coverfunc("build/autocomplete-list-keys/autocomplete-list-keys.js", "_bindKeys", 61);+_yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 62);+this._keyEvents = this._inputNode.on('keydown', this._onInputKey, this);+ },++ /**+ Unbinds keyboard events.++ @method _unbindKeys+ @protected+ **/+ _unbindKeys: function () {+ _yuitest_coverfunc("build/autocomplete-list-keys/autocomplete-list-keys.js", "_unbindKeys", 71);+_yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 72);+this._keyEvents && this._keyEvents.detach();+ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 73);+this._keyEvents = null;+ },++ // -- Protected Methods ----------------------------------------------------++ /**+ Called when the down arrow key is pressed.++ @method _keyDown+ @protected+ **/+ _keyDown: function () {+ _yuitest_coverfunc("build/autocomplete-list-keys/autocomplete-list-keys.js", "_keyDown", 84);+_yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 85);+if (this.get('visible')) {+ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 86);+this._activateNextItem();+ } else {+ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 88);+this.show();+ }+ },++ /**+ Called when the enter key is pressed.++ @method _keyEnter+ @protected+ **/+ _keyEnter: function (e) {+ _yuitest_coverfunc("build/autocomplete-list-keys/autocomplete-list-keys.js", "_keyEnter", 98);+_yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 99);+var item = this.get('activeItem');++ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 101);+if (item) {+ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 102);+this.selectItem(item, e);+ } else {+ // Don't prevent form submission when there's no active item.+ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 105);+return false;+ }+ },++ /**+ Called when the escape key is pressed.++ @method _keyEsc+ @protected+ **/+ _keyEsc: function () {+ _yuitest_coverfunc("build/autocomplete-list-keys/autocomplete-list-keys.js", "_keyEsc", 115);+_yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 116);+this.hide();+ },++ /**+ Called when the tab key is pressed.++ @method _keyTab+ @protected+ **/+ _keyTab: function (e) {+ _yuitest_coverfunc("build/autocomplete-list-keys/autocomplete-list-keys.js", "_keyTab", 125);+_yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 126);+var item;++ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 128);+if (this.get('tabSelect')) {+ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 129);+item = this.get('activeItem');++ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 131);+if (item) {+ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 132);+this.selectItem(item, e);+ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 133);+return true;+ }+ }++ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 137);+return false;+ },++ /**+ Called when the up arrow key is pressed.++ @method _keyUp+ @protected+ **/+ _keyUp: function () {+ _yuitest_coverfunc("build/autocomplete-list-keys/autocomplete-list-keys.js", "_keyUp", 146);+_yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 147);+this._activatePrevItem();+ },++ // -- Protected Event Handlers ---------------------------------------------++ /**+ Handles `inputNode` key events.++ @method _onInputKey+ @param {EventTarget} e+ @protected+ **/+ _onInputKey: function (e) {+ _yuitest_coverfunc("build/autocomplete-list-keys/autocomplete-list-keys.js", "_onInputKey", 159);+_yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 160);+var handler,+ keyCode = e.keyCode;++ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 163);+this._lastInputKey = keyCode;++ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 165);+if (this.get('results').length) {+ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 166);+handler = this._keys[keyCode];++ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 168);+if (!handler && this.get('visible')) {+ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 169);+handler = this._keysVisible[keyCode];+ }++ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 172);+if (handler) {+ // A handler may return false to indicate that it doesn't wish+ // to prevent the default key behavior.+ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 175);+if (handler.call(this, e) !== false) {+ _yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 176);+e.preventDefault();+ }+ }+ }+ }+};++_yuitest_coverline("build/autocomplete-list-keys/autocomplete-list-keys.js", 183);+Y.Base.mix(Y.AutoCompleteList, [ListKeys]);+++}, '3.7.1', {"requires": ["autocomplete-list", "base-build"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('autocomplete-list-keys', function(Y) {+YUI.add('autocomplete-list-keys', function (Y, NAME) { /** Mixes keyboard support into AutoCompleteList. By default, this module is not@@ -189,4 +189,4 @@ Y.Base.mix(Y.AutoCompleteList, [ListKeys]); -}, '3.5.1' ,{requires:['autocomplete-list', 'base-build']});+}, '3.7.1', {"requires": ["autocomplete-list", "base-build"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("autocomplete-list-keys",function(g){var c=40,a=13,d=27,f=9,b=38;function e(){g.before(this._bindKeys,this,"bindUI");this._initKeys();}e.prototype={_initKeys:function(){var h={},i={};h[c]=this._keyDown;i[a]=this._keyEnter;i[d]=this._keyEsc;i[f]=this._keyTab;i[b]=this._keyUp;this._keys=h;this._keysVisible=i;},destructor:function(){this._unbindKeys();},_bindKeys:function(){this._keyEvents=this._inputNode.on("keydown",this._onInputKey,this);},_unbindKeys:function(){this._keyEvents&&this._keyEvents.detach();this._keyEvents=null;},_keyDown:function(){if(this.get("visible")){this._activateNextItem();}else{this.show();}},_keyEnter:function(i){var h=this.get("activeItem");if(h){this.selectItem(h,i);}else{return false;}},_keyEsc:function(){this.hide();},_keyTab:function(i){var h;if(this.get("tabSelect")){h=this.get("activeItem");if(h){this.selectItem(h,i);return true;}}return false;},_keyUp:function(){this._activatePrevItem();},_onInputKey:function(j){var h,i=j.keyCode;this._lastInputKey=i;if(this.get("results").length){h=this._keys[i];if(!h&&this.get("visible")){h=this._keysVisible[i];}if(h){if(h.call(this,j)!==false){j.preventDefault();}}}}};g.Base.mix(g.AutoCompleteList,[e]);},"3.5.1",{requires:["autocomplete-list","base-build"]});+YUI.add("autocomplete-list-keys",function(e,t){function u(){e.before(this._bindKeys,this,"bindUI"),this._initKeys()}var n=40,r=13,i=27,s=9,o=38;u.prototype={_initKeys:function(){var e={},t={};e[n]=this._keyDown,t[r]=this._keyEnter,t[i]=this._keyEsc,t[s]=this._keyTab,t[o]=this._keyUp,this._keys=e,this._keysVisible=t},destructor:function(){this._unbindKeys()},_bindKeys:function(){this._keyEvents=this._inputNode.on("keydown",this._onInputKey,this)},_unbindKeys:function(){this._keyEvents&&this._keyEvents.detach(),this._keyEvents=null},_keyDown:function(){this.get("visible")?this._activateNextItem():this.show()},_keyEnter:function(e){var t=this.get("activeItem");if(!t)return!1;this.selectItem(t,e)},_keyEsc:function(){this.hide()},_keyTab:function(e){var t;if(this.get("tabSelect")){t=this.get("activeItem");if(t)return this.selectItem(t,e),!0}return!1},_keyUp:function(){this._activatePrevItem()},_onInputKey:function(e){var t,n=e.keyCode;this._lastInputKey=n,this.get("results").length&&(t=this._keys[n],!t&&this.get("visible")&&(t=this._keysVisible[n]),t&&t.call(this,e)!==!1&&e.preventDefault())}},e.Base.mix(e.AutoCompleteList,[u])},"3.7.1",{requires:["autocomplete-list","base-build"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('autocomplete-list-keys', function(Y) {+YUI.add('autocomplete-list-keys', function (Y, NAME) { /** Mixes keyboard support into AutoCompleteList. By default, this module is not@@ -189,4 +189,4 @@ Y.Base.mix(Y.AutoCompleteList, [ListKeys]); -}, '3.5.1' ,{requires:['autocomplete-list', 'base-build']});+}, '3.7.1', {"requires": ["autocomplete-list", "base-build"]});
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -0,0 +1,1131 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/autocomplete-list/autocomplete-list.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/autocomplete-list/autocomplete-list.js",+ code: []+};+_yuitest_coverage["build/autocomplete-list/autocomplete-list.js"].code=["YUI.add('autocomplete-list', function (Y, NAME) {","","/**","Traditional autocomplete dropdown list widget, just like Mom used to make.","","@module autocomplete","@submodule autocomplete-list","**/","","/**","Traditional autocomplete dropdown list widget, just like Mom used to make.","","@class AutoCompleteList","@extends Widget","@uses AutoCompleteBase","@uses WidgetPosition","@uses WidgetPositionAlign","@constructor","@param {Object} config Configuration object.","**/","","var Lang = Y.Lang,"," Node = Y.Node,"," YArray = Y.Array,",""," // Whether or not we need an iframe shim."," useShim = Y.UA.ie && Y.UA.ie < 7,",""," // keyCode constants."," KEY_TAB = 9,",""," // String shorthand."," _CLASS_ITEM = '_CLASS_ITEM',"," _CLASS_ITEM_ACTIVE = '_CLASS_ITEM_ACTIVE',"," _CLASS_ITEM_HOVER = '_CLASS_ITEM_HOVER',"," _SELECTOR_ITEM = '_SELECTOR_ITEM',",""," ACTIVE_ITEM = 'activeItem',"," ALWAYS_SHOW_LIST = 'alwaysShowList',"," CIRCULAR = 'circular',"," HOVERED_ITEM = 'hoveredItem',"," ID = 'id',"," ITEM = 'item',"," LIST = 'list',"," RESULT = 'result',"," RESULTS = 'results',"," VISIBLE = 'visible',"," WIDTH = 'width',",""," // Event names."," EVT_SELECT = 'select',","","List = Y.Base.create('autocompleteList', Y.Widget, ["," Y.AutoCompleteBase,"," Y.WidgetPosition,"," Y.WidgetPositionAlign","], {"," // -- Prototype Properties -------------------------------------------------"," ARIA_TEMPLATE: '<div/>',"," ITEM_TEMPLATE: '<li/>',"," LIST_TEMPLATE: '<ul/>',",""," // Widget automatically attaches delegated event handlers to everything in"," // Y.Node.DOM_EVENTS, including synthetic events. Since Widget's event"," // delegation won't work for the synthetic valuechange event, and since"," // it creates a name collision between the backcompat \"valueChange\" synth"," // event alias and AutoCompleteList's \"valueChange\" event for the \"value\""," // attr, this hack is necessary in order to prevent Widget from attaching"," // valuechange handlers."," UI_EVENTS: (function () {"," var uiEvents = Y.merge(Y.Node.DOM_EVENTS);",""," delete uiEvents.valuechange;"," delete uiEvents.valueChange;",""," return uiEvents;"," }()),",""," // -- Lifecycle Prototype Methods ------------------------------------------"," initializer: function () {"," var inputNode = this.get('inputNode');",""," if (!inputNode) {"," Y.error('No inputNode specified.');"," return;"," }",""," this._inputNode = inputNode;"," this._listEvents = [];",""," // This ensures that the list is rendered inside the same parent as the"," // input node by default, which is necessary for proper ARIA support."," this.DEF_PARENT_NODE = inputNode.get('parentNode');",""," // Cache commonly used classnames and selectors for performance."," this[_CLASS_ITEM] = this.getClassName(ITEM);"," this[_CLASS_ITEM_ACTIVE] = this.getClassName(ITEM, 'active');"," this[_CLASS_ITEM_HOVER] = this.getClassName(ITEM, 'hover');"," this[_SELECTOR_ITEM] = '.' + this[_CLASS_ITEM];",""," /**"," Fires when an autocomplete suggestion is selected from the list,"," typically via a keyboard action or mouse click.",""," @event select"," @param {Node} itemNode List item node that was selected."," @param {Object} result AutoComplete result object."," @preventable _defSelectFn"," **/"," this.publish(EVT_SELECT, {"," defaultFn: this._defSelectFn"," });"," },",""," destructor: function () {"," while (this._listEvents.length) {"," this._listEvents.pop().detach();"," }",""," if (this._ariaNode) {"," this._ariaNode.remove().destroy(true);"," }"," },",""," bindUI: function () {"," this._bindInput();"," this._bindList();"," },",""," renderUI: function () {"," var ariaNode = this._createAriaNode(),"," boundingBox = this.get('boundingBox'),"," contentBox = this.get('contentBox'),"," inputNode = this._inputNode,"," listNode = this._createListNode(),"," parentNode = inputNode.get('parentNode');",""," inputNode.addClass(this.getClassName('input')).setAttrs({"," 'aria-autocomplete': LIST,"," 'aria-expanded' : false,"," 'aria-owns' : listNode.get('id')"," });",""," // ARIA node must be outside the widget or announcements won't be made"," // when the widget is hidden."," parentNode.append(ariaNode);",""," // Add an iframe shim for IE6."," if (useShim) {"," boundingBox.plug(Y.Plugin.Shim);"," }",""," // Force position: absolute on the boundingBox. This works around a"," // potential CSS loading race condition in Gecko that can cause the"," // boundingBox to become relatively positioned, which is all kinds of"," // no good."," boundingBox.setStyle('position', 'absolute');",""," this._ariaNode = ariaNode;"," this._boundingBox = boundingBox;"," this._contentBox = contentBox;"," this._listNode = listNode;"," this._parentNode = parentNode;"," },",""," syncUI: function () {"," // No need to call _syncPosition() here; the other _sync methods will"," // call it when necessary."," this._syncResults();"," this._syncVisibility();"," },",""," // -- Public Prototype Methods ---------------------------------------------",""," /**"," Hides the list, unless the `alwaysShowList` attribute is `true`.",""," @method hide"," @see show"," @chainable"," **/"," hide: function () {"," return this.get(ALWAYS_SHOW_LIST) ? this : this.set(VISIBLE, false);"," },",""," /**"," Selects the specified _itemNode_, or the current `activeItem` if _itemNode_"," is not specified.",""," @method selectItem"," @param {Node} [itemNode] Item node to select."," @param {EventFacade} [originEvent] Event that triggered the selection, if"," any."," @chainable"," **/"," selectItem: function (itemNode, originEvent) {"," if (itemNode) {"," if (!itemNode.hasClass(this[_CLASS_ITEM])) {"," return this;"," }"," } else {"," itemNode = this.get(ACTIVE_ITEM);",""," if (!itemNode) {"," return this;"," }"," }",""," this.fire(EVT_SELECT, {"," itemNode : itemNode,"," originEvent: originEvent || null,"," result : itemNode.getData(RESULT)"," });",""," return this;"," },",""," // -- Protected Prototype Methods ------------------------------------------",""," /**"," Activates the next item after the currently active item. If there is no next"," item and the `circular` attribute is `true`, focus will wrap back to the"," input node.",""," @method _activateNextItem"," @chainable"," @protected"," **/"," _activateNextItem: function () {"," var item = this.get(ACTIVE_ITEM),"," nextItem;",""," if (item) {"," nextItem = item.next(this[_SELECTOR_ITEM]) ||"," (this.get(CIRCULAR) ? null : item);"," } else {"," nextItem = this._getFirstItemNode();"," }",""," this.set(ACTIVE_ITEM, nextItem);",""," return this;"," },",""," /**"," Activates the item previous to the currently active item. If there is no"," previous item and the `circular` attribute is `true`, focus will wrap back"," to the input node.",""," @method _activatePrevItem"," @chainable"," @protected"," **/"," _activatePrevItem: function () {"," var item = this.get(ACTIVE_ITEM),"," prevItem = item ? item.previous(this[_SELECTOR_ITEM]) :"," this.get(CIRCULAR) && this._getLastItemNode();",""," this.set(ACTIVE_ITEM, prevItem || null);",""," return this;"," },",""," /**"," Appends the specified result _items_ to the list inside a new item node.",""," @method _add"," @param {Array|Node|HTMLElement|String} items Result item or array of"," result items."," @return {NodeList} Added nodes."," @protected"," **/"," _add: function (items) {"," var itemNodes = [];",""," YArray.each(Lang.isArray(items) ? items : [items], function (item) {"," itemNodes.push(this._createItemNode(item).setData(RESULT, item));"," }, this);",""," itemNodes = Y.all(itemNodes);"," this._listNode.append(itemNodes.toFrag());",""," return itemNodes;"," },",""," /**"," Updates the ARIA live region with the specified message.",""," @method _ariaSay"," @param {String} stringId String id (from the `strings` attribute) of the"," message to speak."," @param {Object} [subs] Substitutions for placeholders in the string."," @protected"," **/"," _ariaSay: function (stringId, subs) {"," var message = this.get('strings.' + stringId);"," this._ariaNode.set('text', subs ? Lang.sub(message, subs) : message);"," },",""," /**"," Binds `inputNode` events and behavior.",""," @method _bindInput"," @protected"," **/"," _bindInput: function () {"," var inputNode = this._inputNode,"," alignNode, alignWidth, tokenInput;",""," // Null align means we can auto-align. Set align to false to prevent"," // auto-alignment, or a valid alignment config to customize the"," // alignment."," if (this.get('align') === null) {"," // If this is a tokenInput, align with its bounding box."," // Otherwise, align with the inputNode. Bit of a cheat."," tokenInput = this.get('tokenInput');"," alignNode = (tokenInput && tokenInput.get('boundingBox')) || inputNode;",""," this.set('align', {"," node : alignNode,"," points: ['tl', 'bl']"," });",""," // If no width config is set, attempt to set the list's width to the"," // width of the alignment node. If the alignment node's width is"," // falsy, do nothing."," if (!this.get(WIDTH) && (alignWidth = alignNode.get('offsetWidth'))) {"," this.set(WIDTH, alignWidth);"," }"," }",""," // Attach inputNode events."," this._listEvents = this._listEvents.concat(["," inputNode.after('blur', this._afterListInputBlur, this),"," inputNode.after('focus', this._afterListInputFocus, this)"," ]);"," },",""," /**"," Binds list events.",""," @method _bindList"," @protected"," **/"," _bindList: function () {"," this._listEvents = this._listEvents.concat(["," Y.one('doc').after('click', this._afterDocClick, this),"," Y.one('win').after('windowresize', this._syncPosition, this),",""," this.after({"," mouseover: this._afterMouseOver,"," mouseout : this._afterMouseOut,",""," activeItemChange : this._afterActiveItemChange,"," alwaysShowListChange: this._afterAlwaysShowListChange,"," hoveredItemChange : this._afterHoveredItemChange,"," resultsChange : this._afterResultsChange,"," visibleChange : this._afterVisibleChange"," }),",""," this._listNode.delegate('click', this._onItemClick,"," this[_SELECTOR_ITEM], this)"," ]);"," },",""," /**"," Clears the contents of the tray.",""," @method _clear"," @protected"," **/"," _clear: function () {"," this.set(ACTIVE_ITEM, null);"," this._set(HOVERED_ITEM, null);",""," this._listNode.get('children').remove(true);"," },",""," /**"," Creates and returns an ARIA live region node.",""," @method _createAriaNode"," @return {Node} ARIA node."," @protected"," **/"," _createAriaNode: function () {"," var ariaNode = Node.create(this.ARIA_TEMPLATE);",""," return ariaNode.addClass(this.getClassName('aria')).setAttrs({"," 'aria-live': 'polite',"," role : 'status'"," });"," },",""," /**"," Creates and returns an item node with the specified _content_.",""," @method _createItemNode"," @param {Object} result Result object."," @return {Node} Item node."," @protected"," **/"," _createItemNode: function (result) {"," var itemNode = Node.create(this.ITEM_TEMPLATE);",""," return itemNode.addClass(this[_CLASS_ITEM]).setAttrs({"," id : Y.stamp(itemNode),"," role: 'option'"," }).setAttribute('data-text', result.text).append(result.display);"," },",""," /**"," Creates and returns a list node. If the `listNode` attribute is already set"," to an existing node, that node will be used.",""," @method _createListNode"," @return {Node} List node."," @protected"," **/"," _createListNode: function () {"," var listNode = this.get('listNode') || Node.create(this.LIST_TEMPLATE);",""," listNode.addClass(this.getClassName(LIST)).setAttrs({"," id : Y.stamp(listNode),"," role: 'listbox'"," });",""," this._set('listNode', listNode);"," this.get('contentBox').append(listNode);",""," return listNode;"," },",""," /**"," Gets the first item node in the list, or `null` if the list is empty.",""," @method _getFirstItemNode"," @return {Node|null}"," @protected"," **/"," _getFirstItemNode: function () {"," return this._listNode.one(this[_SELECTOR_ITEM]);"," },",""," /**"," Gets the last item node in the list, or `null` if the list is empty.",""," @method _getLastItemNode"," @return {Node|null}"," @protected"," **/"," _getLastItemNode: function () {"," return this._listNode.one(this[_SELECTOR_ITEM] + ':last-child');"," },",""," /**"," Synchronizes the result list's position and alignment.",""," @method _syncPosition"," @protected"," **/"," _syncPosition: function () {"," // Force WidgetPositionAlign to refresh its alignment."," this._syncUIPosAlign();",""," // Resize the IE6 iframe shim to match the list's dimensions."," this._syncShim();"," },",""," /**"," Synchronizes the results displayed in the list with those in the _results_"," argument, or with the `results` attribute if an argument is not provided.",""," @method _syncResults"," @param {Array} [results] Results."," @protected"," **/"," _syncResults: function (results) {"," if (!results) {"," results = this.get(RESULTS);"," }",""," this._clear();",""," if (results.length) {"," this._add(results);"," this._ariaSay('items_available');"," }",""," this._syncPosition();",""," if (this.get('activateFirstItem') && !this.get(ACTIVE_ITEM)) {"," this.set(ACTIVE_ITEM, this._getFirstItemNode());"," }"," },",""," /**"," Synchronizes the size of the iframe shim used for IE6 and lower. In other"," browsers, this method is a noop.",""," @method _syncShim"," @protected"," **/"," _syncShim: useShim ? function () {"," var shim = this._boundingBox.shim;",""," if (shim) {"," shim.sync();"," }"," } : function () {},",""," /**"," Synchronizes the visibility of the tray with the _visible_ argument, or with"," the `visible` attribute if an argument is not provided.",""," @method _syncVisibility"," @param {Boolean} [visible] Visibility."," @protected"," **/"," _syncVisibility: function (visible) {"," if (this.get(ALWAYS_SHOW_LIST)) {"," visible = true;"," this.set(VISIBLE, visible);"," }",""," if (typeof visible === 'undefined') {"," visible = this.get(VISIBLE);"," }",""," this._inputNode.set('aria-expanded', visible);"," this._boundingBox.set('aria-hidden', !visible);",""," if (visible) {"," this._syncPosition();"," } else {"," this.set(ACTIVE_ITEM, null);"," this._set(HOVERED_ITEM, null);",""," // Force a reflow to work around a glitch in IE6 and 7 where some of"," // the contents of the list will sometimes remain visible after the"," // container is hidden."," this._boundingBox.get('offsetWidth');"," }",""," // In some pages, IE7 fails to repaint the contents of the list after it"," // becomes visible. Toggling a bogus class on the body forces a repaint"," // that fixes the issue."," if (Y.UA.ie === 7) {"," // Note: We don't actually need to use ClassNameManager here. This"," // class isn't applying any actual styles; it's just frobbing the"," // body element to force a repaint. The actual class name doesn't"," // really matter."," Y.one('body')"," .addClass('yui3-ie7-sucks')"," .removeClass('yui3-ie7-sucks');"," }"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles `activeItemChange` events.",""," @method _afterActiveItemChange"," @param {EventFacade} e"," @protected"," **/"," _afterActiveItemChange: function (e) {"," var inputNode = this._inputNode,"," newVal = e.newVal,"," prevVal = e.prevVal,"," node;",""," // The previous item may have disappeared by the time this handler runs,"," // so we need to be careful."," if (prevVal && prevVal._node) {"," prevVal.removeClass(this[_CLASS_ITEM_ACTIVE]);"," }",""," if (newVal) {"," newVal.addClass(this[_CLASS_ITEM_ACTIVE]);"," inputNode.set('aria-activedescendant', newVal.get(ID));"," } else {"," inputNode.removeAttribute('aria-activedescendant');"," }",""," if (this.get('scrollIntoView')) {"," node = newVal || inputNode;",""," if (!node.inRegion(Y.DOM.viewportRegion(), true)"," || !node.inRegion(this._contentBox, true)) {",""," node.scrollIntoView();"," }"," }"," },",""," /**"," Handles `alwaysShowListChange` events.",""," @method _afterAlwaysShowListChange"," @param {EventFacade} e"," @protected"," **/"," _afterAlwaysShowListChange: function (e) {"," this.set(VISIBLE, e.newVal || this.get(RESULTS).length > 0);"," },",""," /**"," Handles click events on the document. If the click is outside both the"," input node and the bounding box, the list will be hidden.",""," @method _afterDocClick"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _afterDocClick: function (e) {"," var boundingBox = this._boundingBox,"," target = e.target;",""," if(target !== this._inputNode && target !== boundingBox &&"," target.ancestor('#' + boundingBox.get('id'), true)){"," this.hide();"," }"," },",""," /**"," Handles `hoveredItemChange` events.",""," @method _afterHoveredItemChange"," @param {EventFacade} e"," @protected"," **/"," _afterHoveredItemChange: function (e) {"," var newVal = e.newVal,"," prevVal = e.prevVal;",""," if (prevVal) {"," prevVal.removeClass(this[_CLASS_ITEM_HOVER]);"," }",""," if (newVal) {"," newVal.addClass(this[_CLASS_ITEM_HOVER]);"," }"," },",""," /**"," Handles `inputNode` blur events.",""," @method _afterListInputBlur"," @protected"," **/"," _afterListInputBlur: function () {"," this._listInputFocused = false;",""," if (this.get(VISIBLE) &&"," !this._mouseOverList &&"," (this._lastInputKey !== KEY_TAB ||"," !this.get('tabSelect') ||"," !this.get(ACTIVE_ITEM))) {"," this.hide();"," }"," },",""," /**"," Handles `inputNode` focus events.",""," @method _afterListInputFocus"," @protected"," **/"," _afterListInputFocus: function () {"," this._listInputFocused = true;"," },",""," /**"," Handles `mouseover` events.",""," @method _afterMouseOver"," @param {EventFacade} e"," @protected"," **/"," _afterMouseOver: function (e) {"," var itemNode = e.domEvent.target.ancestor(this[_SELECTOR_ITEM], true);",""," this._mouseOverList = true;",""," if (itemNode) {"," this._set(HOVERED_ITEM, itemNode);"," }"," },",""," /**"," Handles `mouseout` events.",""," @method _afterMouseOut"," @param {EventFacade} e"," @protected"," **/"," _afterMouseOut: function () {"," this._mouseOverList = false;"," this._set(HOVERED_ITEM, null);"," },",""," /**"," Handles `resultsChange` events.",""," @method _afterResultsChange"," @param {EventFacade} e"," @protected"," **/"," _afterResultsChange: function (e) {"," this._syncResults(e.newVal);",""," if (!this.get(ALWAYS_SHOW_LIST)) {"," this.set(VISIBLE, !!e.newVal.length);"," }"," },",""," /**"," Handles `visibleChange` events.",""," @method _afterVisibleChange"," @param {EventFacade} e"," @protected"," **/"," _afterVisibleChange: function (e) {"," this._syncVisibility(!!e.newVal);"," },",""," /**"," Delegated event handler for item `click` events.",""," @method _onItemClick"," @param {EventFacade} e"," @protected"," **/"," _onItemClick: function (e) {"," var itemNode = e.currentTarget;",""," this.set(ACTIVE_ITEM, itemNode);"," this.selectItem(itemNode, e);"," },",""," // -- Protected Default Event Handlers -------------------------------------",""," /**"," Default `select` event handler.",""," @method _defSelectFn"," @param {EventFacade} e"," @protected"," **/"," _defSelectFn: function (e) {"," var text = e.result.text;",""," // TODO: support typeahead completion, etc."," this._inputNode.focus();"," this._updateValue(text);"," this._ariaSay('item_selected', {item: text});"," this.hide();"," }","}, {"," ATTRS: {"," /**"," If `true`, the first item in the list will be activated by default when"," the list is initially displayed and when results change.",""," @attribute activateFirstItem"," @type Boolean"," @default false"," **/"," activateFirstItem: {"," value: false"," },",""," /**"," Item that's currently active, if any. When the user presses enter, this"," is the item that will be selected.",""," @attribute activeItem"," @type Node"," **/"," activeItem: {"," setter: Y.one,"," value: null"," },",""," /**"," If `true`, the list will remain visible even when there are no results"," to display.",""," @attribute alwaysShowList"," @type Boolean"," @default false"," **/"," alwaysShowList: {"," value: false"," },",""," /**"," If `true`, keyboard navigation will wrap around to the opposite end of"," the list when navigating past the first or last item.",""," @attribute circular"," @type Boolean"," @default true"," **/"," circular: {"," value: true"," },",""," /**"," Item currently being hovered over by the mouse, if any.",""," @attribute hoveredItem"," @type Node|null"," @readOnly"," **/"," hoveredItem: {"," readOnly: true,"," value: null"," },",""," /**"," Node that will contain result items.",""," @attribute listNode"," @type Node|null"," @initOnly"," **/"," listNode: {"," writeOnce: 'initOnly',"," value: null"," },",""," /**"," If `true`, the viewport will be scrolled to ensure that the active list"," item is visible when necessary.",""," @attribute scrollIntoView"," @type Boolean"," @default false"," **/"," scrollIntoView: {"," value: false"," },",""," /**"," Translatable strings used by the AutoCompleteList widget.",""," @attribute strings"," @type Object"," **/"," strings: {"," valueFn: function () {"," return Y.Intl.get('autocomplete-list');"," }"," },",""," /**"," If `true`, pressing the tab key while the list is visible will select"," the active item, if any.",""," @attribute tabSelect"," @type Boolean"," @default true"," **/"," tabSelect: {"," value: true"," },",""," // The \"visible\" attribute is documented in Widget."," visible: {"," value: false"," }"," },",""," CSS_PREFIX: Y.ClassNameManager.getClassName('aclist')","});","","Y.AutoCompleteList = List;","","/**","Alias for <a href=\"AutoCompleteList.html\">`AutoCompleteList`</a>. See that class","for API docs.","","@class AutoComplete","**/","","Y.AutoComplete = List;","","","}, '3.7.1', {\"lang\": [\"en\"], \"requires\": [\"autocomplete-base\", \"event-resize\", \"node-screen\", \"selector-css3\", \"shim-plugin\", \"widget\", \"widget-position\", \"widget-position-align\"], \"skinnable\": true});"];+_yuitest_coverage["build/autocomplete-list/autocomplete-list.js"].lines = {"1":0,"22":0,"71":0,"73":0,"74":0,"76":0,"81":0,"83":0,"84":0,"85":0,"88":0,"89":0,"93":0,"96":0,"97":0,"98":0,"99":0,"110":0,"116":0,"117":0,"120":0,"121":0,"126":0,"127":0,"131":0,"138":0,"146":0,"149":0,"150":0,"157":0,"159":0,"160":0,"161":0,"162":0,"163":0,"169":0,"170":0,"183":0,"197":0,"198":0,"199":0,"202":0,"204":0,"205":0,"209":0,"215":0,"230":0,"233":0,"234":0,"237":0,"240":0,"242":0,"255":0,"259":0,"261":0,"274":0,"276":0,"277":0,"280":0,"281":0,"283":0,"296":0,"297":0,"307":0,"313":0,"316":0,"317":0,"319":0,"327":0,"328":0,"333":0,"346":0,"373":0,"374":0,"376":0,"387":0,"389":0,"404":0,"406":0,"421":0,"423":0,"428":0,"429":0,"431":0,"442":0,"453":0,"464":0,"467":0,"479":0,"480":0,"483":0,"485":0,"486":0,"487":0,"490":0,"492":0,"493":0,"505":0,"507":0,"508":0,"521":0,"522":0,"523":0,"526":0,"527":0,"530":0,"531":0,"533":0,"534":0,"536":0,"537":0,"542":0,"548":0,"553":0,"569":0,"576":0,"577":0,"580":0,"581":0,"582":0,"584":0,"587":0,"588":0,"590":0,"593":0,"606":0,"619":0,"622":0,"624":0,"636":0,"639":0,"640":0,"643":0,"644":0,"655":0,"657":0,"662":0,"673":0,"684":0,"686":0,"688":0,"689":0,"701":0,"702":0,"713":0,"715":0,"716":0,"728":0,"739":0,"741":0,"742":0,"755":0,"758":0,"759":0,"760":0,"761":0,"857":0,"882":0,"891":0};+_yuitest_coverage["build/autocomplete-list/autocomplete-list.js"].functions = {"(anonymous 2):70":0,"initializer:80":0,"destructor:115":0,"bindUI:125":0,"renderUI:130":0,"syncUI:166":0,"hide:182":0,"selectItem:196":0,"_activateNextItem:229":0,"_activatePrevItem:254":0,"(anonymous 3):276":0,"_add:273":0,"_ariaSay:295":0,"_bindInput:306":0,"_bindList:345":0,"_clear:372":0,"_createAriaNode:386":0,"_createItemNode:403":0,"_createListNode:420":0,"_getFirstItemNode:441":0,"_getLastItemNode:452":0,"_syncPosition:462":0,"_syncResults:478":0,"(anonymous 4):504":0,"_syncVisibility:520":0,"_afterActiveItemChange:568":0,"_afterAlwaysShowListChange:605":0,"_afterDocClick:618":0,"_afterHoveredItemChange:635":0,"_afterListInputBlur:654":0,"_afterListInputFocus:672":0,"_afterMouseOver:683":0,"_afterMouseOut:700":0,"_afterResultsChange:712":0,"_afterVisibleChange:727":0,"_onItemClick:738":0,"_defSelectFn:754":0,"valueFn:856":0,"(anonymous 1):1":0};+_yuitest_coverage["build/autocomplete-list/autocomplete-list.js"].coveredLines = 159;+_yuitest_coverage["build/autocomplete-list/autocomplete-list.js"].coveredFunctions = 39;+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 1);+YUI.add('autocomplete-list', function (Y, NAME) {++/**+Traditional autocomplete dropdown list widget, just like Mom used to make.++@module autocomplete+@submodule autocomplete-list+**/++/**+Traditional autocomplete dropdown list widget, just like Mom used to make.++@class AutoCompleteList+@extends Widget+@uses AutoCompleteBase+@uses WidgetPosition+@uses WidgetPositionAlign+@constructor+@param {Object} config Configuration object.+**/++_yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "(anonymous 1)", 1);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 22);+var Lang = Y.Lang,+ Node = Y.Node,+ YArray = Y.Array,++ // Whether or not we need an iframe shim.+ useShim = Y.UA.ie && Y.UA.ie < 7,++ // keyCode constants.+ KEY_TAB = 9,++ // String shorthand.+ _CLASS_ITEM = '_CLASS_ITEM',+ _CLASS_ITEM_ACTIVE = '_CLASS_ITEM_ACTIVE',+ _CLASS_ITEM_HOVER = '_CLASS_ITEM_HOVER',+ _SELECTOR_ITEM = '_SELECTOR_ITEM',++ ACTIVE_ITEM = 'activeItem',+ ALWAYS_SHOW_LIST = 'alwaysShowList',+ CIRCULAR = 'circular',+ HOVERED_ITEM = 'hoveredItem',+ ID = 'id',+ ITEM = 'item',+ LIST = 'list',+ RESULT = 'result',+ RESULTS = 'results',+ VISIBLE = 'visible',+ WIDTH = 'width',++ // Event names.+ EVT_SELECT = 'select',++List = Y.Base.create('autocompleteList', Y.Widget, [+ Y.AutoCompleteBase,+ Y.WidgetPosition,+ Y.WidgetPositionAlign+], {+ // -- Prototype Properties -------------------------------------------------+ ARIA_TEMPLATE: '<div/>',+ ITEM_TEMPLATE: '<li/>',+ LIST_TEMPLATE: '<ul/>',++ // Widget automatically attaches delegated event handlers to everything in+ // Y.Node.DOM_EVENTS, including synthetic events. Since Widget's event+ // delegation won't work for the synthetic valuechange event, and since+ // it creates a name collision between the backcompat "valueChange" synth+ // event alias and AutoCompleteList's "valueChange" event for the "value"+ // attr, this hack is necessary in order to prevent Widget from attaching+ // valuechange handlers.+ UI_EVENTS: (function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "(anonymous 2)", 70);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 71);+var uiEvents = Y.merge(Y.Node.DOM_EVENTS);++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 73);+delete uiEvents.valuechange;+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 74);+delete uiEvents.valueChange;++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 76);+return uiEvents;+ }()),++ // -- Lifecycle Prototype Methods ------------------------------------------+ initializer: function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "initializer", 80);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 81);+var inputNode = this.get('inputNode');++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 83);+if (!inputNode) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 84);+Y.error('No inputNode specified.');+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 85);+return;+ }++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 88);+this._inputNode = inputNode;+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 89);+this._listEvents = [];++ // This ensures that the list is rendered inside the same parent as the+ // input node by default, which is necessary for proper ARIA support.+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 93);+this.DEF_PARENT_NODE = inputNode.get('parentNode');++ // Cache commonly used classnames and selectors for performance.+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 96);+this[_CLASS_ITEM] = this.getClassName(ITEM);+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 97);+this[_CLASS_ITEM_ACTIVE] = this.getClassName(ITEM, 'active');+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 98);+this[_CLASS_ITEM_HOVER] = this.getClassName(ITEM, 'hover');+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 99);+this[_SELECTOR_ITEM] = '.' + this[_CLASS_ITEM];++ /**+ Fires when an autocomplete suggestion is selected from the list,+ typically via a keyboard action or mouse click.++ @event select+ @param {Node} itemNode List item node that was selected.+ @param {Object} result AutoComplete result object.+ @preventable _defSelectFn+ **/+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 110);+this.publish(EVT_SELECT, {+ defaultFn: this._defSelectFn+ });+ },++ destructor: function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "destructor", 115);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 116);+while (this._listEvents.length) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 117);+this._listEvents.pop().detach();+ }++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 120);+if (this._ariaNode) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 121);+this._ariaNode.remove().destroy(true);+ }+ },++ bindUI: function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "bindUI", 125);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 126);+this._bindInput();+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 127);+this._bindList();+ },++ renderUI: function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "renderUI", 130);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 131);+var ariaNode = this._createAriaNode(),+ boundingBox = this.get('boundingBox'),+ contentBox = this.get('contentBox'),+ inputNode = this._inputNode,+ listNode = this._createListNode(),+ parentNode = inputNode.get('parentNode');++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 138);+inputNode.addClass(this.getClassName('input')).setAttrs({+ 'aria-autocomplete': LIST,+ 'aria-expanded' : false,+ 'aria-owns' : listNode.get('id')+ });++ // ARIA node must be outside the widget or announcements won't be made+ // when the widget is hidden.+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 146);+parentNode.append(ariaNode);++ // Add an iframe shim for IE6.+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 149);+if (useShim) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 150);+boundingBox.plug(Y.Plugin.Shim);+ }++ // Force position: absolute on the boundingBox. This works around a+ // potential CSS loading race condition in Gecko that can cause the+ // boundingBox to become relatively positioned, which is all kinds of+ // no good.+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 157);+boundingBox.setStyle('position', 'absolute');++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 159);+this._ariaNode = ariaNode;+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 160);+this._boundingBox = boundingBox;+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 161);+this._contentBox = contentBox;+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 162);+this._listNode = listNode;+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 163);+this._parentNode = parentNode;+ },++ syncUI: function () {+ // No need to call _syncPosition() here; the other _sync methods will+ // call it when necessary.+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "syncUI", 166);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 169);+this._syncResults();+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 170);+this._syncVisibility();+ },++ // -- Public Prototype Methods ---------------------------------------------++ /**+ Hides the list, unless the `alwaysShowList` attribute is `true`.++ @method hide+ @see show+ @chainable+ **/+ hide: function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "hide", 182);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 183);+return this.get(ALWAYS_SHOW_LIST) ? this : this.set(VISIBLE, false);+ },++ /**+ Selects the specified _itemNode_, or the current `activeItem` if _itemNode_+ is not specified.++ @method selectItem+ @param {Node} [itemNode] Item node to select.+ @param {EventFacade} [originEvent] Event that triggered the selection, if+ any.+ @chainable+ **/+ selectItem: function (itemNode, originEvent) {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "selectItem", 196);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 197);+if (itemNode) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 198);+if (!itemNode.hasClass(this[_CLASS_ITEM])) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 199);+return this;+ }+ } else {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 202);+itemNode = this.get(ACTIVE_ITEM);++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 204);+if (!itemNode) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 205);+return this;+ }+ }++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 209);+this.fire(EVT_SELECT, {+ itemNode : itemNode,+ originEvent: originEvent || null,+ result : itemNode.getData(RESULT)+ });++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 215);+return this;+ },++ // -- Protected Prototype Methods ------------------------------------------++ /**+ Activates the next item after the currently active item. If there is no next+ item and the `circular` attribute is `true`, focus will wrap back to the+ input node.++ @method _activateNextItem+ @chainable+ @protected+ **/+ _activateNextItem: function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_activateNextItem", 229);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 230);+var item = this.get(ACTIVE_ITEM),+ nextItem;++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 233);+if (item) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 234);+nextItem = item.next(this[_SELECTOR_ITEM]) ||+ (this.get(CIRCULAR) ? null : item);+ } else {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 237);+nextItem = this._getFirstItemNode();+ }++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 240);+this.set(ACTIVE_ITEM, nextItem);++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 242);+return this;+ },++ /**+ Activates the item previous to the currently active item. If there is no+ previous item and the `circular` attribute is `true`, focus will wrap back+ to the input node.++ @method _activatePrevItem+ @chainable+ @protected+ **/+ _activatePrevItem: function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_activatePrevItem", 254);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 255);+var item = this.get(ACTIVE_ITEM),+ prevItem = item ? item.previous(this[_SELECTOR_ITEM]) :+ this.get(CIRCULAR) && this._getLastItemNode();++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 259);+this.set(ACTIVE_ITEM, prevItem || null);++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 261);+return this;+ },++ /**+ Appends the specified result _items_ to the list inside a new item node.++ @method _add+ @param {Array|Node|HTMLElement|String} items Result item or array of+ result items.+ @return {NodeList} Added nodes.+ @protected+ **/+ _add: function (items) {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_add", 273);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 274);+var itemNodes = [];++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 276);+YArray.each(Lang.isArray(items) ? items : [items], function (item) {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "(anonymous 3)", 276);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 277);+itemNodes.push(this._createItemNode(item).setData(RESULT, item));+ }, this);++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 280);+itemNodes = Y.all(itemNodes);+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 281);+this._listNode.append(itemNodes.toFrag());++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 283);+return itemNodes;+ },++ /**+ Updates the ARIA live region with the specified message.++ @method _ariaSay+ @param {String} stringId String id (from the `strings` attribute) of the+ message to speak.+ @param {Object} [subs] Substitutions for placeholders in the string.+ @protected+ **/+ _ariaSay: function (stringId, subs) {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_ariaSay", 295);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 296);+var message = this.get('strings.' + stringId);+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 297);+this._ariaNode.set('text', subs ? Lang.sub(message, subs) : message);+ },++ /**+ Binds `inputNode` events and behavior.++ @method _bindInput+ @protected+ **/+ _bindInput: function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_bindInput", 306);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 307);+var inputNode = this._inputNode,+ alignNode, alignWidth, tokenInput;++ // Null align means we can auto-align. Set align to false to prevent+ // auto-alignment, or a valid alignment config to customize the+ // alignment.+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 313);+if (this.get('align') === null) {+ // If this is a tokenInput, align with its bounding box.+ // Otherwise, align with the inputNode. Bit of a cheat.+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 316);+tokenInput = this.get('tokenInput');+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 317);+alignNode = (tokenInput && tokenInput.get('boundingBox')) || inputNode;++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 319);+this.set('align', {+ node : alignNode,+ points: ['tl', 'bl']+ });++ // If no width config is set, attempt to set the list's width to the+ // width of the alignment node. If the alignment node's width is+ // falsy, do nothing.+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 327);+if (!this.get(WIDTH) && (alignWidth = alignNode.get('offsetWidth'))) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 328);+this.set(WIDTH, alignWidth);+ }+ }++ // Attach inputNode events.+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 333);+this._listEvents = this._listEvents.concat([+ inputNode.after('blur', this._afterListInputBlur, this),+ inputNode.after('focus', this._afterListInputFocus, this)+ ]);+ },++ /**+ Binds list events.++ @method _bindList+ @protected+ **/+ _bindList: function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_bindList", 345);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 346);+this._listEvents = this._listEvents.concat([+ Y.one('doc').after('click', this._afterDocClick, this),+ Y.one('win').after('windowresize', this._syncPosition, this),++ this.after({+ mouseover: this._afterMouseOver,+ mouseout : this._afterMouseOut,++ activeItemChange : this._afterActiveItemChange,+ alwaysShowListChange: this._afterAlwaysShowListChange,+ hoveredItemChange : this._afterHoveredItemChange,+ resultsChange : this._afterResultsChange,+ visibleChange : this._afterVisibleChange+ }),++ this._listNode.delegate('click', this._onItemClick,+ this[_SELECTOR_ITEM], this)+ ]);+ },++ /**+ Clears the contents of the tray.++ @method _clear+ @protected+ **/+ _clear: function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_clear", 372);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 373);+this.set(ACTIVE_ITEM, null);+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 374);+this._set(HOVERED_ITEM, null);++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 376);+this._listNode.get('children').remove(true);+ },++ /**+ Creates and returns an ARIA live region node.++ @method _createAriaNode+ @return {Node} ARIA node.+ @protected+ **/+ _createAriaNode: function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_createAriaNode", 386);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 387);+var ariaNode = Node.create(this.ARIA_TEMPLATE);++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 389);+return ariaNode.addClass(this.getClassName('aria')).setAttrs({+ 'aria-live': 'polite',+ role : 'status'+ });+ },++ /**+ Creates and returns an item node with the specified _content_.++ @method _createItemNode+ @param {Object} result Result object.+ @return {Node} Item node.+ @protected+ **/+ _createItemNode: function (result) {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_createItemNode", 403);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 404);+var itemNode = Node.create(this.ITEM_TEMPLATE);++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 406);+return itemNode.addClass(this[_CLASS_ITEM]).setAttrs({+ id : Y.stamp(itemNode),+ role: 'option'+ }).setAttribute('data-text', result.text).append(result.display);+ },++ /**+ Creates and returns a list node. If the `listNode` attribute is already set+ to an existing node, that node will be used.++ @method _createListNode+ @return {Node} List node.+ @protected+ **/+ _createListNode: function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_createListNode", 420);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 421);+var listNode = this.get('listNode') || Node.create(this.LIST_TEMPLATE);++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 423);+listNode.addClass(this.getClassName(LIST)).setAttrs({+ id : Y.stamp(listNode),+ role: 'listbox'+ });++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 428);+this._set('listNode', listNode);+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 429);+this.get('contentBox').append(listNode);++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 431);+return listNode;+ },++ /**+ Gets the first item node in the list, or `null` if the list is empty.++ @method _getFirstItemNode+ @return {Node|null}+ @protected+ **/+ _getFirstItemNode: function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_getFirstItemNode", 441);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 442);+return this._listNode.one(this[_SELECTOR_ITEM]);+ },++ /**+ Gets the last item node in the list, or `null` if the list is empty.++ @method _getLastItemNode+ @return {Node|null}+ @protected+ **/+ _getLastItemNode: function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_getLastItemNode", 452);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 453);+return this._listNode.one(this[_SELECTOR_ITEM] + ':last-child');+ },++ /**+ Synchronizes the result list's position and alignment.++ @method _syncPosition+ @protected+ **/+ _syncPosition: function () {+ // Force WidgetPositionAlign to refresh its alignment.+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_syncPosition", 462);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 464);+this._syncUIPosAlign();++ // Resize the IE6 iframe shim to match the list's dimensions.+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 467);+this._syncShim();+ },++ /**+ Synchronizes the results displayed in the list with those in the _results_+ argument, or with the `results` attribute if an argument is not provided.++ @method _syncResults+ @param {Array} [results] Results.+ @protected+ **/+ _syncResults: function (results) {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_syncResults", 478);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 479);+if (!results) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 480);+results = this.get(RESULTS);+ }++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 483);+this._clear();++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 485);+if (results.length) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 486);+this._add(results);+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 487);+this._ariaSay('items_available');+ }++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 490);+this._syncPosition();++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 492);+if (this.get('activateFirstItem') && !this.get(ACTIVE_ITEM)) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 493);+this.set(ACTIVE_ITEM, this._getFirstItemNode());+ }+ },++ /**+ Synchronizes the size of the iframe shim used for IE6 and lower. In other+ browsers, this method is a noop.++ @method _syncShim+ @protected+ **/+ _syncShim: useShim ? function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "(anonymous 4)", 504);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 505);+var shim = this._boundingBox.shim;++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 507);+if (shim) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 508);+shim.sync();+ }+ } : function () {},++ /**+ Synchronizes the visibility of the tray with the _visible_ argument, or with+ the `visible` attribute if an argument is not provided.++ @method _syncVisibility+ @param {Boolean} [visible] Visibility.+ @protected+ **/+ _syncVisibility: function (visible) {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_syncVisibility", 520);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 521);+if (this.get(ALWAYS_SHOW_LIST)) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 522);+visible = true;+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 523);+this.set(VISIBLE, visible);+ }++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 526);+if (typeof visible === 'undefined') {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 527);+visible = this.get(VISIBLE);+ }++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 530);+this._inputNode.set('aria-expanded', visible);+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 531);+this._boundingBox.set('aria-hidden', !visible);++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 533);+if (visible) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 534);+this._syncPosition();+ } else {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 536);+this.set(ACTIVE_ITEM, null);+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 537);+this._set(HOVERED_ITEM, null);++ // Force a reflow to work around a glitch in IE6 and 7 where some of+ // the contents of the list will sometimes remain visible after the+ // container is hidden.+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 542);+this._boundingBox.get('offsetWidth');+ }++ // In some pages, IE7 fails to repaint the contents of the list after it+ // becomes visible. Toggling a bogus class on the body forces a repaint+ // that fixes the issue.+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 548);+if (Y.UA.ie === 7) {+ // Note: We don't actually need to use ClassNameManager here. This+ // class isn't applying any actual styles; it's just frobbing the+ // body element to force a repaint. The actual class name doesn't+ // really matter.+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 553);+Y.one('body')+ .addClass('yui3-ie7-sucks')+ .removeClass('yui3-ie7-sucks');+ }+ },++ // -- Protected Event Handlers ---------------------------------------------++ /**+ Handles `activeItemChange` events.++ @method _afterActiveItemChange+ @param {EventFacade} e+ @protected+ **/+ _afterActiveItemChange: function (e) {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_afterActiveItemChange", 568);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 569);+var inputNode = this._inputNode,+ newVal = e.newVal,+ prevVal = e.prevVal,+ node;++ // The previous item may have disappeared by the time this handler runs,+ // so we need to be careful.+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 576);+if (prevVal && prevVal._node) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 577);+prevVal.removeClass(this[_CLASS_ITEM_ACTIVE]);+ }++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 580);+if (newVal) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 581);+newVal.addClass(this[_CLASS_ITEM_ACTIVE]);+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 582);+inputNode.set('aria-activedescendant', newVal.get(ID));+ } else {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 584);+inputNode.removeAttribute('aria-activedescendant');+ }++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 587);+if (this.get('scrollIntoView')) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 588);+node = newVal || inputNode;++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 590);+if (!node.inRegion(Y.DOM.viewportRegion(), true)+ || !node.inRegion(this._contentBox, true)) {++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 593);+node.scrollIntoView();+ }+ }+ },++ /**+ Handles `alwaysShowListChange` events.++ @method _afterAlwaysShowListChange+ @param {EventFacade} e+ @protected+ **/+ _afterAlwaysShowListChange: function (e) {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_afterAlwaysShowListChange", 605);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 606);+this.set(VISIBLE, e.newVal || this.get(RESULTS).length > 0);+ },++ /**+ Handles click events on the document. If the click is outside both the+ input node and the bounding box, the list will be hidden.++ @method _afterDocClick+ @param {EventFacade} e+ @protected+ @since 3.5.0+ **/+ _afterDocClick: function (e) {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_afterDocClick", 618);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 619);+var boundingBox = this._boundingBox,+ target = e.target;++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 622);+if(target !== this._inputNode && target !== boundingBox &&+ target.ancestor('#' + boundingBox.get('id'), true)){+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 624);+this.hide();+ }+ },++ /**+ Handles `hoveredItemChange` events.++ @method _afterHoveredItemChange+ @param {EventFacade} e+ @protected+ **/+ _afterHoveredItemChange: function (e) {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_afterHoveredItemChange", 635);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 636);+var newVal = e.newVal,+ prevVal = e.prevVal;++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 639);+if (prevVal) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 640);+prevVal.removeClass(this[_CLASS_ITEM_HOVER]);+ }++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 643);+if (newVal) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 644);+newVal.addClass(this[_CLASS_ITEM_HOVER]);+ }+ },++ /**+ Handles `inputNode` blur events.++ @method _afterListInputBlur+ @protected+ **/+ _afterListInputBlur: function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_afterListInputBlur", 654);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 655);+this._listInputFocused = false;++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 657);+if (this.get(VISIBLE) &&+ !this._mouseOverList &&+ (this._lastInputKey !== KEY_TAB ||+ !this.get('tabSelect') ||+ !this.get(ACTIVE_ITEM))) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 662);+this.hide();+ }+ },++ /**+ Handles `inputNode` focus events.++ @method _afterListInputFocus+ @protected+ **/+ _afterListInputFocus: function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_afterListInputFocus", 672);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 673);+this._listInputFocused = true;+ },++ /**+ Handles `mouseover` events.++ @method _afterMouseOver+ @param {EventFacade} e+ @protected+ **/+ _afterMouseOver: function (e) {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_afterMouseOver", 683);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 684);+var itemNode = e.domEvent.target.ancestor(this[_SELECTOR_ITEM], true);++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 686);+this._mouseOverList = true;++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 688);+if (itemNode) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 689);+this._set(HOVERED_ITEM, itemNode);+ }+ },++ /**+ Handles `mouseout` events.++ @method _afterMouseOut+ @param {EventFacade} e+ @protected+ **/+ _afterMouseOut: function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_afterMouseOut", 700);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 701);+this._mouseOverList = false;+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 702);+this._set(HOVERED_ITEM, null);+ },++ /**+ Handles `resultsChange` events.++ @method _afterResultsChange+ @param {EventFacade} e+ @protected+ **/+ _afterResultsChange: function (e) {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_afterResultsChange", 712);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 713);+this._syncResults(e.newVal);++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 715);+if (!this.get(ALWAYS_SHOW_LIST)) {+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 716);+this.set(VISIBLE, !!e.newVal.length);+ }+ },++ /**+ Handles `visibleChange` events.++ @method _afterVisibleChange+ @param {EventFacade} e+ @protected+ **/+ _afterVisibleChange: function (e) {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_afterVisibleChange", 727);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 728);+this._syncVisibility(!!e.newVal);+ },++ /**+ Delegated event handler for item `click` events.++ @method _onItemClick+ @param {EventFacade} e+ @protected+ **/+ _onItemClick: function (e) {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_onItemClick", 738);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 739);+var itemNode = e.currentTarget;++ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 741);+this.set(ACTIVE_ITEM, itemNode);+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 742);+this.selectItem(itemNode, e);+ },++ // -- Protected Default Event Handlers -------------------------------------++ /**+ Default `select` event handler.++ @method _defSelectFn+ @param {EventFacade} e+ @protected+ **/+ _defSelectFn: function (e) {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "_defSelectFn", 754);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 755);+var text = e.result.text;++ // TODO: support typeahead completion, etc.+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 758);+this._inputNode.focus();+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 759);+this._updateValue(text);+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 760);+this._ariaSay('item_selected', {item: text});+ _yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 761);+this.hide();+ }+}, {+ ATTRS: {+ /**+ If `true`, the first item in the list will be activated by default when+ the list is initially displayed and when results change.++ @attribute activateFirstItem+ @type Boolean+ @default false+ **/+ activateFirstItem: {+ value: false+ },++ /**+ Item that's currently active, if any. When the user presses enter, this+ is the item that will be selected.++ @attribute activeItem+ @type Node+ **/+ activeItem: {+ setter: Y.one,+ value: null+ },++ /**+ If `true`, the list will remain visible even when there are no results+ to display.++ @attribute alwaysShowList+ @type Boolean+ @default false+ **/+ alwaysShowList: {+ value: false+ },++ /**+ If `true`, keyboard navigation will wrap around to the opposite end of+ the list when navigating past the first or last item.++ @attribute circular+ @type Boolean+ @default true+ **/+ circular: {+ value: true+ },++ /**+ Item currently being hovered over by the mouse, if any.++ @attribute hoveredItem+ @type Node|null+ @readOnly+ **/+ hoveredItem: {+ readOnly: true,+ value: null+ },++ /**+ Node that will contain result items.++ @attribute listNode+ @type Node|null+ @initOnly+ **/+ listNode: {+ writeOnce: 'initOnly',+ value: null+ },++ /**+ If `true`, the viewport will be scrolled to ensure that the active list+ item is visible when necessary.++ @attribute scrollIntoView+ @type Boolean+ @default false+ **/+ scrollIntoView: {+ value: false+ },++ /**+ Translatable strings used by the AutoCompleteList widget.++ @attribute strings+ @type Object+ **/+ strings: {+ valueFn: function () {+ _yuitest_coverfunc("build/autocomplete-list/autocomplete-list.js", "valueFn", 856);+_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 857);+return Y.Intl.get('autocomplete-list');+ }+ },++ /**+ If `true`, pressing the tab key while the list is visible will select+ the active item, if any.++ @attribute tabSelect+ @type Boolean+ @default true+ **/+ tabSelect: {+ value: true+ },++ // The "visible" attribute is documented in Widget.+ visible: {+ value: false+ }+ },++ CSS_PREFIX: Y.ClassNameManager.getClassName('aclist')+});++_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 882);+Y.AutoCompleteList = List;++/**+Alias for <a href="AutoCompleteList.html">`AutoCompleteList`</a>. See that class+for API docs.++@class AutoComplete+**/++_yuitest_coverline("build/autocomplete-list/autocomplete-list.js", 891);+Y.AutoComplete = List;+++}, '3.7.1', {"lang": ["en"], "requires": ["autocomplete-base", "event-resize", "node-screen", "selector-css3", "shim-plugin", "widget", "widget-position", "widget-position-align"], "skinnable": true});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('autocomplete-list', function(Y) {+YUI.add('autocomplete-list', function (Y, NAME) { /** Traditional autocomplete dropdown list widget, just like Mom used to make.@@ -336,7 +336,7 @@ } // Attach inputNode events.- this._listEvents.concat([+ this._listEvents = this._listEvents.concat([ inputNode.after('blur', this._afterListInputBlur, this), inputNode.after('focus', this._afterListInputFocus, this) ]);@@ -349,7 +349,7 @@ @protected **/ _bindList: function () {- this._listEvents.concat([+ this._listEvents = this._listEvents.concat([ Y.one('doc').after('click', this._afterDocClick, this), Y.one('win').after('windowresize', this._syncPosition, this), @@ -508,7 +508,11 @@ @protected **/ _syncShim: useShim ? function () {- this._boundingBox.shim.sync();+ var shim = this._boundingBox.shim;++ if (shim) {+ shim.sync();+ } } : function () {}, /**@@ -548,6 +552,10 @@ // becomes visible. Toggling a bogus class on the body forces a repaint // that fixes the issue. if (Y.UA.ie === 7) {+ // Note: We don't actually need to use ClassNameManager here. This+ // class isn't applying any actual styles; it's just frobbing the+ // body element to force a repaint. The actual class name doesn't+ // really matter. Y.one('body') .addClass('yui3-ie7-sucks') .removeClass('yui3-ie7-sucks');@@ -617,9 +625,8 @@ var boundingBox = this._boundingBox, target = e.target; - if (target !== this._inputNode && target !== boundingBox &&- !boundingBox.one(target.get('id'))) {-+ if(target !== this._inputNode && target !== boundingBox &&+ target.ancestor('#' + boundingBox.get('id'), true)){ this.hide(); } },@@ -890,4 +897,4 @@ Y.AutoComplete = List; -}, '3.5.1' ,{requires:['autocomplete-base', 'event-resize', 'node-screen', 'selector-css3', 'shim-plugin', 'widget', 'widget-position', 'widget-position-align'], skinnable:true, after:['autocomplete-sources'], lang:['en']});+}, '3.7.1', {"lang": ["en"], "requires": ["autocomplete-base", "event-resize", "node-screen", "selector-css3", "shim-plugin", "widget", "widget-position", "widget-position-align"], "skinnable": true});
@@ -1,8 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("autocomplete-list",function(b){var i=b.Lang,v=b.Node,l=b.Array,h=b.UA.ie&&b.UA.ie<7,p=9,s="_CLASS_ITEM",t="_CLASS_ITEM_ACTIVE",d="_CLASS_ITEM_HOVER",u="_SELECTOR_ITEM",f="activeItem",k="alwaysShowList",o="circular",r="hoveredItem",m="id",e="item",c="list",w="result",j="results",q="visible",g="width",n="select",a=b.Base.create("autocompleteList",b.Widget,[b.AutoCompleteBase,b.WidgetPosition,b.WidgetPositionAlign],{ARIA_TEMPLATE:"<div/>",ITEM_TEMPLATE:"<li/>",LIST_TEMPLATE:"<ul/>",UI_EVENTS:(function(){var x=b.merge(b.Node.DOM_EVENTS);delete x.valuechange;delete x.valueChange;return x;}()),initializer:function(){var x=this.get("inputNode");if(!x){b.error("No inputNode specified.");return;}this._inputNode=x;this._listEvents=[];this.DEF_PARENT_NODE=x.get("parentNode");this[s]=this.getClassName(e);this[t]=this.getClassName(e,"active");this[d]=this.getClassName(e,"hover");this[u]="."+this[s];this.publish(n,{defaultFn:this._defSelectFn});},destructor:function(){while(this._listEvents.length){this._listEvents.pop().detach();}if(this._ariaNode){this._ariaNode.remove().destroy(true);}},bindUI:function(){this._bindInput();this._bindList();},renderUI:function(){var C=this._createAriaNode(),z=this.get("boundingBox"),y=this.get("contentBox"),B=this._inputNode,A=this._createListNode(),x=B.get("parentNode");B.addClass(this.getClassName("input")).setAttrs({"aria-autocomplete":c,"aria-expanded":false,"aria-owns":A.get("id")});x.append(C);if(h){z.plug(b.Plugin.Shim);}z.setStyle("position","absolute");this._ariaNode=C;this._boundingBox=z;this._contentBox=y;this._listNode=A;this._parentNode=x;},syncUI:function(){this._syncResults();this._syncVisibility();},hide:function(){return this.get(k)?this:this.set(q,false);},selectItem:function(y,x){if(y){if(!y.hasClass(this[s])){return this;}}else{y=this.get(f);if(!y){return this;}}this.fire(n,{itemNode:y,originEvent:x||null,result:y.getData(w)});return this;},_activateNextItem:function(){var y=this.get(f),x;if(y){x=y.next(this[u])||(this.get(o)?null:y);}else{x=this._getFirstItemNode();}this.set(f,x);return this;},_activatePrevItem:function(){var y=this.get(f),x=y?y.previous(this[u]):this.get(o)&&this._getLastItemNode();this.set(f,x||null);return this;},_add:function(x){var y=[];l.each(i.isArray(x)?x:[x],function(z){y.push(this._createItemNode(z).setData(w,z));},this);y=b.all(y);this._listNode.append(y.toFrag());return y;},_ariaSay:function(z,x){var y=this.get("strings."+z);this._ariaNode.set("text",x?i.sub(y,x):y);},_bindInput:function(){var A=this._inputNode,y,z,x;if(this.get("align")===null){x=this.get("tokenInput");y=(x&&x.get("boundingBox"))||A;this.set("align",{node:y,points:["tl","bl"]});if(!this.get(g)&&(z=y.get("offsetWidth"))){this.set(g,z);}}this._listEvents.concat([A.after("blur",this._afterListInputBlur,this),A.after("focus",this._afterListInputFocus,this)]);},_bindList:function(){this._listEvents.concat([b.one("doc").after("click",this._afterDocClick,this),b.one("win").after("windowresize",this._syncPosition,this),this.after({mouseover:this._afterMouseOver,mouseout:this._afterMouseOut,activeItemChange:this._afterActiveItemChange,alwaysShowListChange:this._afterAlwaysShowListChange,hoveredItemChange:this._afterHoveredItemChange,resultsChange:this._afterResultsChange,visibleChange:this._afterVisibleChange}),this._listNode.delegate("click",this._onItemClick,this[u],this)]);},_clear:function(){this.set(f,null);this._set(r,null);this._listNode.get("children").remove(true);},_createAriaNode:function(){var x=v.create(this.ARIA_TEMPLATE);return x.addClass(this.getClassName("aria")).setAttrs({"aria-live":"polite",role:"status"});},_createItemNode:function(x){var y=v.create(this.ITEM_TEMPLATE);return y.addClass(this[s]).setAttrs({id:b.stamp(y),role:"option"}).setAttribute("data-text",x.text).append(x.display);},_createListNode:function(){var x=this.get("listNode")||v.create(this.LIST_TEMPLATE);x.addClass(this.getClassName(c)).setAttrs({id:b.stamp(x),role:"listbox"});this._set("listNode",x);this.get("contentBox").append(x);return x;},_getFirstItemNode:function(){return this._listNode.one(this[u]);},_getLastItemNode:function(){return this._listNode.one(this[u]+":last-child");},_syncPosition:function(){this._syncUIPosAlign();this._syncShim();},_syncResults:function(x){if(!x){x=this.get(j);}this._clear();if(x.length){this._add(x);this._ariaSay("items_available");}this._syncPosition();if(this.get("activateFirstItem")&&!this.get(f)){this.set(f,this._getFirstItemNode());}},_syncShim:h?function(){this._boundingBox.shim.sync();}:function(){},_syncVisibility:function(x){if(this.get(k)){x=true;this.set(q,x);}if(typeof x==="undefined"){x=this.get(q);}this._inputNode.set("aria-expanded",x);this._boundingBox.set("aria-hidden",!x);if(x){this._syncPosition();}else{this.set(f,null);this._set(r,null);this._boundingBox.get("offsetWidth");}if(b.UA.ie===7){b.one("body").addClass("yui3-ie7-sucks").removeClass("yui3-ie7-sucks");}},_afterActiveItemChange:function(A){var z=this._inputNode,x=A.newVal,B=A.prevVal,y;if(B&&B._node){B.removeClass(this[t]);}if(x){x.addClass(this[t]);z.set("aria-activedescendant",x.get(m));}else{z.removeAttribute("aria-activedescendant");}if(this.get("scrollIntoView")){y=x||z;if(!y.inRegion(b.DOM.viewportRegion(),true)||!y.inRegion(this._contentBox,true)){y.scrollIntoView();}}},_afterAlwaysShowListChange:function(x){this.set(q,x.newVal||this.get(j).length>0);},_afterDocClick:function(z){var x=this._boundingBox,y=z.target;if(y!==this._inputNode&&y!==x&&!x.one(y.get("id"))){this.hide();}},_afterHoveredItemChange:function(y){var x=y.newVal,z=y.prevVal;if(z){z.removeClass(this[d]);}if(x){x.addClass(this[d]);}},_afterListInputBlur:function(){this._listInputFocused=false;if(this.get(q)&&!this._mouseOverList&&(this._lastInputKey!==p||!this.get("tabSelect")||!this.get(f))){this.hide();}},_afterListInputFocus:function(){this._listInputFocused=true;},_afterMouseOver:function(x){var y=x.domEvent.target.ancestor(this[u],true);this._mouseOverList=true;if(y){this._set(r,y);-}},_afterMouseOut:function(){this._mouseOverList=false;this._set(r,null);},_afterResultsChange:function(x){this._syncResults(x.newVal);if(!this.get(k)){this.set(q,!!x.newVal.length);}},_afterVisibleChange:function(x){this._syncVisibility(!!x.newVal);},_onItemClick:function(x){var y=x.currentTarget;this.set(f,y);this.selectItem(y,x);},_defSelectFn:function(x){var y=x.result.text;this._inputNode.focus();this._updateValue(y);this._ariaSay("item_selected",{item:y});this.hide();}},{ATTRS:{activateFirstItem:{value:false},activeItem:{setter:b.one,value:null},alwaysShowList:{value:false},circular:{value:true},hoveredItem:{readOnly:true,value:null},listNode:{writeOnce:"initOnly",value:null},scrollIntoView:{value:false},strings:{valueFn:function(){return b.Intl.get("autocomplete-list");}},tabSelect:{value:true},visible:{value:false}},CSS_PREFIX:b.ClassNameManager.getClassName("aclist")});b.AutoCompleteList=a;b.AutoComplete=a;},"3.5.1",{requires:["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],skinnable:true,after:["autocomplete-sources"],lang:["en"]});+YUI.add("autocomplete-list",function(e,t){var n=e.Lang,r=e.Node,i=e.Array,s=e.UA.ie&&e.UA.ie<7,o=9,u="_CLASS_ITEM",a="_CLASS_ITEM_ACTIVE",f="_CLASS_ITEM_HOVER",l="_SELECTOR_ITEM",c="activeItem",h="alwaysShowList",p="circular",d="hoveredItem",v="id",m="item",g="list",y="result",b="results",w="visible",E="width",S="select",x=e.Base.create("autocompleteList",e.Widget,[e.AutoCompleteBase,e.WidgetPosition,e.WidgetPositionAlign],{ARIA_TEMPLATE:"<div/>",ITEM_TEMPLATE:"<li/>",LIST_TEMPLATE:"<ul/>",UI_EVENTS:function(){var t=e.merge(e.Node.DOM_EVENTS);return delete t.valuechange,delete t.valueChange,t}(),initializer:function(){var t=this.get("inputNode");if(!t){e.error("No inputNode specified.");return}this._inputNode=t,this._listEvents=[],this.DEF_PARENT_NODE=t.get("parentNode"),this[u]=this.getClassName(m),this[a]=this.getClassName(m,"active"),this[f]=this.getClassName(m,"hover"),this[l]="."+this[u],this.publish(S,{defaultFn:this._defSelectFn})},destructor:function(){while(this._listEvents.length)this._listEvents.pop().detach();this._ariaNode&&this._ariaNode.remove().destroy(!0)},bindUI:function(){this._bindInput(),this._bindList()},renderUI:function(){var t=this._createAriaNode(),n=this.get("boundingBox"),r=this.get("contentBox"),i=this._inputNode,o=this._createListNode(),u=i.get("parentNode");i.addClass(this.getClassName("input")).setAttrs({"aria-autocomplete":g,"aria-expanded":!1,"aria-owns":o.get("id")}),u.append(t),s&&n.plug(e.Plugin.Shim),n.setStyle("position","absolute"),this._ariaNode=t,this._boundingBox=n,this._contentBox=r,this._listNode=o,this._parentNode=u},syncUI:function(){this._syncResults(),this._syncVisibility()},hide:function(){return this.get(h)?this:this.set(w,!1)},selectItem:function(e,t){if(e){if(!e.hasClass(this[u]))return this}else{e=this.get(c);if(!e)return this}return this.fire(S,{itemNode:e,originEvent:t||null,result:e.getData(y)}),this},_activateNextItem:function(){var e=this.get(c),t;return e?t=e.next(this[l])||(this.get(p)?null:e):t=this._getFirstItemNode(),this.set(c,t),this},_activatePrevItem:function(){var e=this.get(c),t=e?e.previous(this[l]):this.get(p)&&this._getLastItemNode();return this.set(c,t||null),this},_add:function(t){var r=[];return i.each(n.isArray(t)?t:[t],function(e){r.push(this._createItemNode(e).setData(y,e))},this),r=e.all(r),this._listNode.append(r.toFrag()),r},_ariaSay:function(e,t){var r=this.get("strings."+e);this._ariaNode.set("text",t?n.sub(r,t):r)},_bindInput:function(){var e=this._inputNode,t,n,r;this.get("align")===null&&(r=this.get("tokenInput"),t=r&&r.get("boundingBox")||e,this.set("align",{node:t,points:["tl","bl"]}),!this.get(E)&&(n=t.get("offsetWidth"))&&this.set(E,n)),this._listEvents=this._listEvents.concat([e.after("blur",this._afterListInputBlur,this),e.after("focus",this._afterListInputFocus,this)])},_bindList:function(){this._listEvents=this._listEvents.concat([e.one("doc").after("click",this._afterDocClick,this),e.one("win").after("windowresize",this._syncPosition,this),this.after({mouseover:this._afterMouseOver,mouseout:this._afterMouseOut,activeItemChange:this._afterActiveItemChange,alwaysShowListChange:this._afterAlwaysShowListChange,hoveredItemChange:this._afterHoveredItemChange,resultsChange:this._afterResultsChange,visibleChange:this._afterVisibleChange}),this._listNode.delegate("click",this._onItemClick,this[l],this)])},_clear:function(){this.set(c,null),this._set(d,null),this._listNode.get("children").remove(!0)},_createAriaNode:function(){var e=r.create(this.ARIA_TEMPLATE);return e.addClass(this.getClassName("aria")).setAttrs({"aria-live":"polite",role:"status"})},_createItemNode:function(t){var n=r.create(this.ITEM_TEMPLATE);return n.addClass(this[u]).setAttrs({id:e.stamp(n),role:"option"}).setAttribute("data-text",t.text).append(t.display)},_createListNode:function(){var t=this.get("listNode")||r.create(this.LIST_TEMPLATE);return t.addClass(this.getClassName(g)).setAttrs({id:e.stamp(t),role:"listbox"}),this._set("listNode",t),this.get("contentBox").append(t),t},_getFirstItemNode:function(){return this._listNode.one(this[l])},_getLastItemNode:function(){return this._listNode.one(this[l]+":last-child")},_syncPosition:function(){this._syncUIPosAlign(),this._syncShim()},_syncResults:function(e){e||(e=this.get(b)),this._clear(),e.length&&(this._add(e),this._ariaSay("items_available")),this._syncPosition(),this.get("activateFirstItem")&&!this.get(c)&&this.set(c,this._getFirstItemNode())},_syncShim:s?function(){var e=this._boundingBox.shim;e&&e.sync()}:function(){},_syncVisibility:function(t){this.get(h)&&(t=!0,this.set(w,t)),typeof t=="undefined"&&(t=this.get(w)),this._inputNode.set("aria-expanded",t),this._boundingBox.set("aria-hidden",!t),t?this._syncPosition():(this.set(c,null),this._set(d,null),this._boundingBox.get("offsetWidth")),e.UA.ie===7&&e.one("body").addClass("yui3-ie7-sucks").removeClass("yui3-ie7-sucks")},_afterActiveItemChange:function(t){var n=this._inputNode,r=t.newVal,i=t.prevVal,s;i&&i._node&&i.removeClass(this[a]),r?(r.addClass(this[a]),n.set("aria-activedescendant",r.get(v))):n.removeAttribute("aria-activedescendant"),this.get("scrollIntoView")&&(s=r||n,(!s.inRegion(e.DOM.viewportRegion(),!0)||!s.inRegion(this._contentBox,!0))&&s.scrollIntoView())},_afterAlwaysShowListChange:function(e){this.set(w,e.newVal||this.get(b).length>0)},_afterDocClick:function(e){var t=this._boundingBox,n=e.target;n!==this._inputNode&&n!==t&&n.ancestor("#"+t.get("id"),!0)&&this.hide()},_afterHoveredItemChange:function(e){var t=e.newVal,n=e.prevVal;n&&n.removeClass(this[f]),t&&t.addClass(this[f])},_afterListInputBlur:function(){this._listInputFocused=!1,this.get(w)&&!this._mouseOverList&&(this._lastInputKey!==o||!this.get("tabSelect")||!this.get(c))&&this.hide()},_afterListInputFocus:function(){this._listInputFocused=!0},_afterMouseOver:function(e){var t=e.domEvent.target.ancestor(this[l],!0);this._mouseOverList=!0,t&&this._set(d,t)},_afterMouseOut:function(){this._mouseOverList=!1,this._set(d,null)},_afterResultsChange:function(e){this._syncResults(e.newVal),this.get(h)||this.set(w,!!e.newVal.length)},_afterVisibleChange:function(e){this._syncVisibility(!!e.newVal)},_onItemClick:function(e){var t=e.currentTarget;this.set(c,t),this.selectItem(t,e)},_defSelectFn:function(e){var t=e.result.text;this._inputNode.focus(),this._updateValue(t),this._ariaSay("item_selected",{item:t}),this.hide()}},{ATTRS:{activateFirstItem:{value:!1},activeItem:{setter:e.one,value:null},alwaysShowList:{value:!1},circular:{value:!0},hoveredItem:{readOnly:!0,value:null},listNode:{writeOnce:"initOnly",value:null},scrollIntoView:{value:!1},strings:{valueFn:function(){return e.Intl.get("autocomplete-list")}},tabSelect:{value:!0},visible:{value:!1}},CSS_PREFIX:e.ClassNameManager.getClassName("aclist")});e.AutoCompleteList=x,e.AutoComplete=x},"3.7.1",{lang:["en"],requires:["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],skinnable:!0});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('autocomplete-list', function(Y) {+YUI.add('autocomplete-list', function (Y, NAME) { /** Traditional autocomplete dropdown list widget, just like Mom used to make.@@ -336,7 +336,7 @@ } // Attach inputNode events.- this._listEvents.concat([+ this._listEvents = this._listEvents.concat([ inputNode.after('blur', this._afterListInputBlur, this), inputNode.after('focus', this._afterListInputFocus, this) ]);@@ -349,7 +349,7 @@ @protected **/ _bindList: function () {- this._listEvents.concat([+ this._listEvents = this._listEvents.concat([ Y.one('doc').after('click', this._afterDocClick, this), Y.one('win').after('windowresize', this._syncPosition, this), @@ -508,7 +508,11 @@ @protected **/ _syncShim: useShim ? function () {- this._boundingBox.shim.sync();+ var shim = this._boundingBox.shim;++ if (shim) {+ shim.sync();+ } } : function () {}, /**@@ -548,6 +552,10 @@ // becomes visible. Toggling a bogus class on the body forces a repaint // that fixes the issue. if (Y.UA.ie === 7) {+ // Note: We don't actually need to use ClassNameManager here. This+ // class isn't applying any actual styles; it's just frobbing the+ // body element to force a repaint. The actual class name doesn't+ // really matter. Y.one('body') .addClass('yui3-ie7-sucks') .removeClass('yui3-ie7-sucks');@@ -617,9 +625,8 @@ var boundingBox = this._boundingBox, target = e.target; - if (target !== this._inputNode && target !== boundingBox &&- !boundingBox.one(target.get('id'))) {-+ if(target !== this._inputNode && target !== boundingBox &&+ target.ancestor('#' + boundingBox.get('id'), true)){ this.hide(); } },@@ -890,4 +897,4 @@ Y.AutoComplete = List; -}, '3.5.1' ,{requires:['autocomplete-base', 'event-resize', 'node-screen', 'selector-css3', 'shim-plugin', 'widget', 'widget-position', 'widget-position-align'], skinnable:true, after:['autocomplete-sources'], lang:['en']});+}, '3.7.1', {"lang": ["en"], "requires": ["autocomplete-base", "event-resize", "node-screen", "selector-css3", "shim-plugin", "widget", "widget-position", "widget-position-align"], "skinnable": true});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/autocomplete-list",function(a){a.Intl.add("autocomplete-list","",{item_selected:"{item} selected.",items_available:"Suggestions are available. Use the up and down arrow keys to select suggestions."});},"3.5.1");+YUI.add("lang/autocomplete-list",function(e){e.Intl.add("autocomplete-list","",{item_selected:"{item} selected.",items_available:"Suggestions are available. Use the up and down arrow keys to select suggestions."})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/autocomplete-list_en",function(a){a.Intl.add("autocomplete-list","en",{item_selected:"{item} selected.",items_available:"Suggestions are available. Use up and down arrows to select."});},"3.5.1");+YUI.add("lang/autocomplete-list_en",function(e){e.Intl.add("autocomplete-list","en",{item_selected:"{item} selected.",items_available:"Suggestions are available. Use up and down arrows to select."})},"3.7.1");
@@ -0,0 +1,99 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/autocomplete-plugin/autocomplete-plugin.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/autocomplete-plugin/autocomplete-plugin.js",+ code: []+};+_yuitest_coverage["build/autocomplete-plugin/autocomplete-plugin.js"].code=["YUI.add('autocomplete-plugin', function (Y, NAME) {","","/**","Binds an AutoCompleteList instance to a Node instance.","","@module autocomplete","@submodule autocomplete-plugin","**/","","/**","Binds an AutoCompleteList instance to a Node instance.","","@example",""," Y.one('#my-input').plug(Y.Plugin.AutoComplete, {"," source: 'select * from search.suggest where query=\"{query}\"'"," });",""," // You can now access the AutoCompleteList instance at Y.one('#my-input').ac","","@class Plugin.AutoComplete","@extends AutoCompleteList","**/","","var Plugin = Y.Plugin;","","function ACListPlugin(config) {"," config.inputNode = config.host;",""," // Render by default."," if (!config.render && config.render !== false) {"," config.render = true;"," }",""," ACListPlugin.superclass.constructor.apply(this, arguments);","}","","Y.extend(ACListPlugin, Y.AutoCompleteList, {}, {"," NAME : 'autocompleteListPlugin',"," NS : 'ac',"," CSS_PREFIX: Y.ClassNameManager.getClassName('aclist')","});","","Plugin.AutoComplete = ACListPlugin;","Plugin.AutoCompleteList = ACListPlugin;","","","}, '3.7.1', {\"requires\": [\"autocomplete-list\", \"node-pluginhost\"]});"];+_yuitest_coverage["build/autocomplete-plugin/autocomplete-plugin.js"].lines = {"1":0,"25":0,"27":0,"28":0,"31":0,"32":0,"35":0,"38":0,"44":0,"45":0};+_yuitest_coverage["build/autocomplete-plugin/autocomplete-plugin.js"].functions = {"ACListPlugin:27":0,"(anonymous 1):1":0};+_yuitest_coverage["build/autocomplete-plugin/autocomplete-plugin.js"].coveredLines = 10;+_yuitest_coverage["build/autocomplete-plugin/autocomplete-plugin.js"].coveredFunctions = 2;+_yuitest_coverline("build/autocomplete-plugin/autocomplete-plugin.js", 1);+YUI.add('autocomplete-plugin', function (Y, NAME) {++/**+Binds an AutoCompleteList instance to a Node instance.++@module autocomplete+@submodule autocomplete-plugin+**/++/**+Binds an AutoCompleteList instance to a Node instance.++@example++ Y.one('#my-input').plug(Y.Plugin.AutoComplete, {+ source: 'select * from search.suggest where query="{query}"'+ });++ // You can now access the AutoCompleteList instance at Y.one('#my-input').ac++@class Plugin.AutoComplete+@extends AutoCompleteList+**/++_yuitest_coverfunc("build/autocomplete-plugin/autocomplete-plugin.js", "(anonymous 1)", 1);+_yuitest_coverline("build/autocomplete-plugin/autocomplete-plugin.js", 25);+var Plugin = Y.Plugin;++_yuitest_coverline("build/autocomplete-plugin/autocomplete-plugin.js", 27);+function ACListPlugin(config) {+ _yuitest_coverfunc("build/autocomplete-plugin/autocomplete-plugin.js", "ACListPlugin", 27);+_yuitest_coverline("build/autocomplete-plugin/autocomplete-plugin.js", 28);+config.inputNode = config.host;++ // Render by default.+ _yuitest_coverline("build/autocomplete-plugin/autocomplete-plugin.js", 31);+if (!config.render && config.render !== false) {+ _yuitest_coverline("build/autocomplete-plugin/autocomplete-plugin.js", 32);+config.render = true;+ }++ _yuitest_coverline("build/autocomplete-plugin/autocomplete-plugin.js", 35);+ACListPlugin.superclass.constructor.apply(this, arguments);+}++_yuitest_coverline("build/autocomplete-plugin/autocomplete-plugin.js", 38);+Y.extend(ACListPlugin, Y.AutoCompleteList, {}, {+ NAME : 'autocompleteListPlugin',+ NS : 'ac',+ CSS_PREFIX: Y.ClassNameManager.getClassName('aclist')+});++_yuitest_coverline("build/autocomplete-plugin/autocomplete-plugin.js", 44);+Plugin.AutoComplete = ACListPlugin;+_yuitest_coverline("build/autocomplete-plugin/autocomplete-plugin.js", 45);+Plugin.AutoCompleteList = ACListPlugin;+++}, '3.7.1', {"requires": ["autocomplete-list", "node-pluginhost"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('autocomplete-plugin', function(Y) {+YUI.add('autocomplete-plugin', function (Y, NAME) { /** Binds an AutoCompleteList instance to a Node instance.@@ -51,4 +51,4 @@ Plugin.AutoCompleteList = ACListPlugin; -}, '3.5.1' ,{requires:['autocomplete-list', 'node-pluginhost']});+}, '3.7.1', {"requires": ["autocomplete-list", "node-pluginhost"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("autocomplete-plugin",function(b){var a=b.Plugin;function c(d){d.inputNode=d.host;if(!d.render&&d.render!==false){d.render=true;}c.superclass.constructor.apply(this,arguments);}b.extend(c,b.AutoCompleteList,{},{NAME:"autocompleteListPlugin",NS:"ac",CSS_PREFIX:b.ClassNameManager.getClassName("aclist")});a.AutoComplete=c;a.AutoCompleteList=c;},"3.5.1",{requires:["autocomplete-list","node-pluginhost"]});+YUI.add("autocomplete-plugin",function(e,t){function r(e){e.inputNode=e.host,!e.render&&e.render!==!1&&(e.render=!0),r.superclass.constructor.apply(this,arguments)}var n=e.Plugin;e.extend(r,e.AutoCompleteList,{},{NAME:"autocompleteListPlugin",NS:"ac",CSS_PREFIX:e.ClassNameManager.getClassName("aclist")}),n.AutoComplete=r,n.AutoCompleteList=r},"3.7.1",{requires:["autocomplete-list","node-pluginhost"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('autocomplete-plugin', function(Y) {+YUI.add('autocomplete-plugin', function (Y, NAME) { /** Binds an AutoCompleteList instance to a Node instance.@@ -51,4 +51,4 @@ Plugin.AutoCompleteList = ACListPlugin; -}, '3.5.1' ,{requires:['autocomplete-list', 'node-pluginhost']});+}, '3.7.1', {"requires": ["autocomplete-list", "node-pluginhost"]});
@@ -0,0 +1,648 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/autocomplete-sources/autocomplete-sources.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/autocomplete-sources/autocomplete-sources.js",+ code: []+};+_yuitest_coverage["build/autocomplete-sources/autocomplete-sources.js"].code=["YUI.add('autocomplete-sources', function (Y, NAME) {","","/**","Mixes support for JSONP and YQL result sources into AutoCompleteBase.","","@module autocomplete","@submodule autocomplete-sources","**/","","var ACBase = Y.AutoCompleteBase,"," Lang = Y.Lang,",""," _SOURCE_SUCCESS = '_sourceSuccess',",""," MAX_RESULTS = 'maxResults',"," REQUEST_TEMPLATE = 'requestTemplate',"," RESULT_LIST_LOCATOR = 'resultListLocator';","","// Add prototype properties and methods to AutoCompleteBase.","Y.mix(ACBase.prototype, {"," /**"," Regular expression used to determine whether a String source is a YQL query.",""," @property _YQL_SOURCE_REGEX"," @type RegExp"," @protected"," @for AutoCompleteBase"," **/"," _YQL_SOURCE_REGEX: /^(?:select|set|use)\\s+/i,",""," /**"," Runs before AutoCompleteBase's `_createObjectSource()` method and augments"," it to support additional object-based source types.",""," @method _beforeCreateObjectSource"," @param {String} source"," @protected"," @for AutoCompleteBase"," **/"," _beforeCreateObjectSource: function (source) {"," // If the object is a <select> node, use the options as the result"," // source."," if (source instanceof Y.Node &&"," source.get('nodeName').toLowerCase() === 'select') {",""," return this._createSelectSource(source);"," }",""," // If the object is a JSONPRequest instance, try to use it as a JSONP"," // source."," if (Y.JSONPRequest && source instanceof Y.JSONPRequest) {"," return this._createJSONPSource(source);"," }",""," // Fall back to a basic object source."," return this._createObjectSource(source);"," },",""," /**"," Creates a DataSource-like object that uses `Y.io` as a source. See the"," `source` attribute for more details.",""," @method _createIOSource"," @param {String} source URL."," @return {Object} DataSource-like object."," @protected"," @for AutoCompleteBase"," **/"," _createIOSource: function (source) {"," var ioSource = {type: 'io'},"," that = this,"," ioRequest, lastRequest, loading;",""," // Private internal _sendRequest method that will be assigned to"," // ioSource.sendRequest once io-base and json-parse are available."," function _sendRequest(request) {"," var cacheKey = request.request;",""," // Return immediately on a cached response."," if (that._cache && cacheKey in that._cache) {"," that[_SOURCE_SUCCESS](that._cache[cacheKey], request);"," return;"," }",""," // Cancel any outstanding requests."," if (ioRequest && ioRequest.isInProgress()) {"," ioRequest.abort();"," }",""," ioRequest = Y.io(that._getXHRUrl(source, request), {"," on: {"," success: function (tid, response) {"," var data;",""," try {"," data = Y.JSON.parse(response.responseText);"," } catch (ex) {"," Y.error('JSON parse error', ex);"," }",""," if (data) {"," that._cache && (that._cache[cacheKey] = data);"," that[_SOURCE_SUCCESS](data, request);"," }"," }"," }"," });"," }",""," ioSource.sendRequest = function (request) {"," // Keep track of the most recent request in case there are multiple"," // requests while we're waiting for the IO module to load. Only the"," // most recent request will be sent."," lastRequest = request;",""," if (loading) { return; }",""," loading = true;",""," // Lazy-load the io-base and json-parse modules if necessary,"," // then overwrite the sendRequest method to bypass this check in"," // the future."," Y.use('io-base', 'json-parse', function () {"," ioSource.sendRequest = _sendRequest;"," _sendRequest(lastRequest);"," });"," };",""," return ioSource;"," },",""," /**"," Creates a DataSource-like object that uses the specified JSONPRequest"," instance as a source. See the `source` attribute for more details.",""," @method _createJSONPSource"," @param {JSONPRequest|String} source URL string or JSONPRequest instance."," @return {Object} DataSource-like object."," @protected"," @for AutoCompleteBase"," **/"," _createJSONPSource: function (source) {"," var jsonpSource = {type: 'jsonp'},"," that = this,"," lastRequest, loading;",""," function _sendRequest(request) {"," var cacheKey = request.request,"," query = request.query;",""," if (that._cache && cacheKey in that._cache) {"," that[_SOURCE_SUCCESS](that._cache[cacheKey], request);"," return;"," }",""," // Hack alert: JSONPRequest currently doesn't support"," // per-request callbacks, so we're reaching into the protected"," // _config object to make it happen."," //"," // This limitation is mentioned in the following JSONP"," // enhancement ticket:"," //"," // http://yuilibrary.com/projects/yui3/ticket/2529371"," source._config.on.success = function (data) {"," that._cache && (that._cache[cacheKey] = data);"," that[_SOURCE_SUCCESS](data, request);"," };",""," source.send(query);"," }",""," jsonpSource.sendRequest = function (request) {"," // Keep track of the most recent request in case there are multiple"," // requests while we're waiting for the JSONP module to load. Only"," // the most recent request will be sent."," lastRequest = request;",""," if (loading) { return; }",""," loading = true;",""," // Lazy-load the JSONP module if necessary, then overwrite the"," // sendRequest method to bypass this check in the future."," Y.use('jsonp', function () {"," // Turn the source into a JSONPRequest instance if it isn't"," // one already."," if (!(source instanceof Y.JSONPRequest)) {"," source = new Y.JSONPRequest(source, {"," format: Y.bind(that._jsonpFormatter, that)"," });"," }",""," jsonpSource.sendRequest = _sendRequest;"," _sendRequest(lastRequest);"," });"," };",""," return jsonpSource;"," },",""," /**"," Creates a DataSource-like object that uses the specified `<select>` node as"," a source.",""," @method _createSelectSource"," @param {Node} source YUI Node instance wrapping a `<select>` node."," @return {Object} DataSource-like object."," @protected"," @for AutoCompleteBase"," **/"," _createSelectSource: function (source) {"," var that = this;",""," return {"," type: 'select',"," sendRequest: function (request) {"," var options = [];",""," source.get('options').each(function (option) {"," options.push({"," html : option.get('innerHTML'),"," index : option.get('index'),"," node : option,"," selected: option.get('selected'),"," text : option.get('text'),"," value : option.get('value')"," });"," });",""," that[_SOURCE_SUCCESS](options, request);"," }"," };"," },",""," /**"," Creates a DataSource-like object that calls the specified URL or executes"," the specified YQL query for results. If the string starts with \"select \","," \"use \", or \"set \" (case-insensitive), it's assumed to be a YQL query;"," otherwise, it's assumed to be a URL (which may be absolute or relative)."," URLs containing a \"{callback}\" placeholder are assumed to be JSONP URLs; all"," others will use XHR. See the `source` attribute for more details.",""," @method _createStringSource"," @param {String} source URL or YQL query."," @return {Object} DataSource-like object."," @protected"," @for AutoCompleteBase"," **/"," _createStringSource: function (source) {"," if (this._YQL_SOURCE_REGEX.test(source)) {"," // Looks like a YQL query."," return this._createYQLSource(source);"," } else if (source.indexOf('{callback}') !== -1) {"," // Contains a {callback} param and isn't a YQL query, so it must be"," // JSONP."," return this._createJSONPSource(source);"," } else {"," // Not a YQL query or JSONP, so we'll assume it's an XHR URL."," return this._createIOSource(source);"," }"," },",""," /**"," Creates a DataSource-like object that uses the specified YQL query string to"," create a YQL-based source. See the `source` attribute for details. If no"," `resultListLocator` is defined, this method will set a best-guess locator"," that might work for many typical YQL queries.",""," @method _createYQLSource"," @param {String} source YQL query."," @return {Object} DataSource-like object."," @protected"," @for AutoCompleteBase"," **/"," _createYQLSource: function (source) {"," var that = this,"," yqlSource = {type: 'yql'},"," lastRequest, loading, yqlRequest;",""," if (!that.get(RESULT_LIST_LOCATOR)) {"," that.set(RESULT_LIST_LOCATOR, that._defaultYQLLocator);"," }",""," function _sendRequest(request) {"," var query = request.query,"," env = that.get('yqlEnv'),"," maxResults = that.get(MAX_RESULTS),"," callback, opts, yqlQuery;",""," yqlQuery = Lang.sub(source, {"," maxResults: maxResults > 0 ? maxResults : 1000,"," request : request.request,"," query : query"," });",""," if (that._cache && yqlQuery in that._cache) {"," that[_SOURCE_SUCCESS](that._cache[yqlQuery], request);"," return;"," }",""," callback = function (data) {"," that._cache && (that._cache[yqlQuery] = data);"," that[_SOURCE_SUCCESS](data, request);"," };",""," opts = {proto: that.get('yqlProtocol')};",""," // Only create a new YQLRequest instance if this is the"," // first request. For subsequent requests, we'll reuse the"," // original instance."," if (yqlRequest) {"," yqlRequest._callback = callback;"," yqlRequest._opts = opts;"," yqlRequest._params.q = yqlQuery;",""," if (env) {"," yqlRequest._params.env = env;"," }"," } else {"," yqlRequest = new Y.YQLRequest(yqlQuery, {"," on: {success: callback},"," allowCache: false // temp workaround until JSONP has per-URL callback proxies"," }, env ? {env: env} : null, opts);"," }",""," yqlRequest.send();"," }",""," yqlSource.sendRequest = function (request) {"," // Keep track of the most recent request in case there are multiple"," // requests while we're waiting for the YQL module to load. Only the"," // most recent request will be sent."," lastRequest = request;",""," if (!loading) {"," // Lazy-load the YQL module if necessary, then overwrite the"," // sendRequest method to bypass this check in the future."," loading = true;",""," Y.use('yql', function () {"," yqlSource.sendRequest = _sendRequest;"," _sendRequest(lastRequest);"," });"," }"," };",""," return yqlSource;"," },",""," /**"," Default resultListLocator used when a string-based YQL source is set and the"," implementer hasn't already specified one.",""," @method _defaultYQLLocator"," @param {Object} response YQL response object."," @return {Array}"," @protected"," @for AutoCompleteBase"," **/"," _defaultYQLLocator: function (response) {"," var results = response && response.query && response.query.results,"," values;",""," if (results && Lang.isObject(results)) {"," // If there's only a single value on YQL's results object, that"," // value almost certainly contains the array of results we want. If"," // there are 0 or 2+ values, then the values themselves are most"," // likely the results we want."," values = Y.Object.values(results) || [];"," results = values.length === 1 ? values[0] : values;",""," if (!Lang.isArray(results)) {"," results = [results];"," }"," } else {"," results = [];"," }",""," return results;"," },",""," /**"," Returns a formatted XHR URL based on the specified base _url_, _query_, and"," the current _requestTemplate_ if any.",""," @method _getXHRUrl"," @param {String} url Base URL."," @param {Object} request Request object containing `query` and `request`"," properties."," @return {String} Formatted URL."," @protected"," @for AutoCompleteBase"," **/"," _getXHRUrl: function (url, request) {"," var maxResults = this.get(MAX_RESULTS);",""," if (request.query !== request.request) {"," // Append the request template to the URL."," url += request.request;"," }",""," return Lang.sub(url, {"," maxResults: maxResults > 0 ? maxResults : 1000,"," query : encodeURIComponent(request.query)"," });"," },",""," /**"," URL formatter passed to `JSONPRequest` instances.",""," @method _jsonpFormatter"," @param {String} url"," @param {String} proxy"," @param {String} query"," @return {String} Formatted URL"," @protected"," @for AutoCompleteBase"," **/"," _jsonpFormatter: function (url, proxy, query) {"," var maxResults = this.get(MAX_RESULTS),"," requestTemplate = this.get(REQUEST_TEMPLATE);",""," if (requestTemplate) {"," url += requestTemplate(query);"," }",""," return Lang.sub(url, {"," callback : proxy,"," maxResults: maxResults > 0 ? maxResults : 1000,"," query : encodeURIComponent(query)"," });"," }","});","","// Add attributes to AutoCompleteBase.","Y.mix(ACBase.ATTRS, {"," /**"," YQL environment file URL to load when the `source` is set to a YQL query."," Set this to `null` to use the default Open Data Tables environment file"," (http://datatables.org/alltables.env).",""," @attribute yqlEnv"," @type String"," @default null"," @for AutoCompleteBase"," **/"," yqlEnv: {"," value: null"," },",""," /**"," URL protocol to use when the `source` is set to a YQL query.",""," @attribute yqlProtocol"," @type String"," @default 'http'"," @for AutoCompleteBase"," **/"," yqlProtocol: {"," value: 'http'"," }","});","","// Tell AutoCompleteBase about the new source types it can now support.","Y.mix(ACBase.SOURCE_TYPES, {"," io : '_createIOSource',"," jsonp : '_createJSONPSource',"," object: '_beforeCreateObjectSource', // Run our version before the base version."," select: '_createSelectSource',"," string: '_createStringSource',"," yql : '_createYQLSource'","}, true);","","","}, '3.7.1', {\"optional\": [\"io-base\", \"json-parse\", \"jsonp\", \"yql\"], \"requires\": [\"autocomplete-base\"]});"];+_yuitest_coverage["build/autocomplete-sources/autocomplete-sources.js"].lines = {"1":0,"10":0,"20":0,"43":0,"46":0,"51":0,"52":0,"56":0,"70":0,"76":0,"77":0,"80":0,"81":0,"82":0,"86":0,"87":0,"90":0,"93":0,"95":0,"96":0,"98":0,"101":0,"102":0,"103":0,"110":0,"114":0,"116":0,"118":0,"123":0,"124":0,"125":0,"129":0,"143":0,"147":0,"148":0,"151":0,"152":0,"153":0,"164":0,"165":0,"166":0,"169":0,"172":0,"176":0,"178":0,"180":0,"184":0,"187":0,"188":0,"193":0,"194":0,"198":0,"212":0,"214":0,"217":0,"219":0,"220":0,"230":0,"250":0,"252":0,"253":0,"256":0,"259":0,"276":0,"280":0,"281":0,"284":0,"285":0,"290":0,"296":0,"297":0,"298":0,"301":0,"302":0,"303":0,"306":0,"311":0,"312":0,"313":0,"314":0,"316":0,"317":0,"320":0,"326":0,"329":0,"333":0,"335":0,"338":0,"340":0,"341":0,"342":0,"347":0,"361":0,"364":0,"369":0,"370":0,"372":0,"373":0,"376":0,"379":0,"395":0,"397":0,"399":0,"402":0,"420":0,"423":0,"424":0,"427":0,"436":0,"465":0};+_yuitest_coverage["build/autocomplete-sources/autocomplete-sources.js"].functions = {"_beforeCreateObjectSource:40":0,"success:92":0,"_sendRequest:76":0,"(anonymous 2):123":0,"sendRequest:110":0,"_createIOSource:69":0,"success:164":0,"_sendRequest:147":0,"(anonymous 3):184":0,"sendRequest:172":0,"_createJSONPSource:142":0,"(anonymous 4):219":0,"sendRequest:216":0,"_createSelectSource:211":0,"_createStringSource:249":0,"callback:301":0,"_sendRequest:284":0,"(anonymous 5):340":0,"sendRequest:329":0,"_createYQLSource:275":0,"_defaultYQLLocator:360":0,"_getXHRUrl:394":0,"_jsonpFormatter:419":0,"(anonymous 1):1":0};+_yuitest_coverage["build/autocomplete-sources/autocomplete-sources.js"].coveredLines = 110;+_yuitest_coverage["build/autocomplete-sources/autocomplete-sources.js"].coveredFunctions = 24;+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 1);+YUI.add('autocomplete-sources', function (Y, NAME) {++/**+Mixes support for JSONP and YQL result sources into AutoCompleteBase.++@module autocomplete+@submodule autocomplete-sources+**/++_yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "(anonymous 1)", 1);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 10);+var ACBase = Y.AutoCompleteBase,+ Lang = Y.Lang,++ _SOURCE_SUCCESS = '_sourceSuccess',++ MAX_RESULTS = 'maxResults',+ REQUEST_TEMPLATE = 'requestTemplate',+ RESULT_LIST_LOCATOR = 'resultListLocator';++// Add prototype properties and methods to AutoCompleteBase.+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 20);+Y.mix(ACBase.prototype, {+ /**+ Regular expression used to determine whether a String source is a YQL query.++ @property _YQL_SOURCE_REGEX+ @type RegExp+ @protected+ @for AutoCompleteBase+ **/+ _YQL_SOURCE_REGEX: /^(?:select|set|use)\s+/i,++ /**+ Runs before AutoCompleteBase's `_createObjectSource()` method and augments+ it to support additional object-based source types.++ @method _beforeCreateObjectSource+ @param {String} source+ @protected+ @for AutoCompleteBase+ **/+ _beforeCreateObjectSource: function (source) {+ // If the object is a <select> node, use the options as the result+ // source.+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "_beforeCreateObjectSource", 40);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 43);+if (source instanceof Y.Node &&+ source.get('nodeName').toLowerCase() === 'select') {++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 46);+return this._createSelectSource(source);+ }++ // If the object is a JSONPRequest instance, try to use it as a JSONP+ // source.+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 51);+if (Y.JSONPRequest && source instanceof Y.JSONPRequest) {+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 52);+return this._createJSONPSource(source);+ }++ // Fall back to a basic object source.+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 56);+return this._createObjectSource(source);+ },++ /**+ Creates a DataSource-like object that uses `Y.io` as a source. See the+ `source` attribute for more details.++ @method _createIOSource+ @param {String} source URL.+ @return {Object} DataSource-like object.+ @protected+ @for AutoCompleteBase+ **/+ _createIOSource: function (source) {+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "_createIOSource", 69);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 70);+var ioSource = {type: 'io'},+ that = this,+ ioRequest, lastRequest, loading;++ // Private internal _sendRequest method that will be assigned to+ // ioSource.sendRequest once io-base and json-parse are available.+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 76);+function _sendRequest(request) {+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "_sendRequest", 76);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 77);+var cacheKey = request.request;++ // Return immediately on a cached response.+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 80);+if (that._cache && cacheKey in that._cache) {+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 81);+that[_SOURCE_SUCCESS](that._cache[cacheKey], request);+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 82);+return;+ }++ // Cancel any outstanding requests.+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 86);+if (ioRequest && ioRequest.isInProgress()) {+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 87);+ioRequest.abort();+ }++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 90);+ioRequest = Y.io(that._getXHRUrl(source, request), {+ on: {+ success: function (tid, response) {+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "success", 92);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 93);+var data;++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 95);+try {+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 96);+data = Y.JSON.parse(response.responseText);+ } catch (ex) {+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 98);+Y.error('JSON parse error', ex);+ }++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 101);+if (data) {+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 102);+that._cache && (that._cache[cacheKey] = data);+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 103);+that[_SOURCE_SUCCESS](data, request);+ }+ }+ }+ });+ }++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 110);+ioSource.sendRequest = function (request) {+ // Keep track of the most recent request in case there are multiple+ // requests while we're waiting for the IO module to load. Only the+ // most recent request will be sent.+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "sendRequest", 110);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 114);+lastRequest = request;++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 116);+if (loading) { return; }++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 118);+loading = true;++ // Lazy-load the io-base and json-parse modules if necessary,+ // then overwrite the sendRequest method to bypass this check in+ // the future.+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 123);+Y.use('io-base', 'json-parse', function () {+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "(anonymous 2)", 123);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 124);+ioSource.sendRequest = _sendRequest;+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 125);+_sendRequest(lastRequest);+ });+ };++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 129);+return ioSource;+ },++ /**+ Creates a DataSource-like object that uses the specified JSONPRequest+ instance as a source. See the `source` attribute for more details.++ @method _createJSONPSource+ @param {JSONPRequest|String} source URL string or JSONPRequest instance.+ @return {Object} DataSource-like object.+ @protected+ @for AutoCompleteBase+ **/+ _createJSONPSource: function (source) {+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "_createJSONPSource", 142);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 143);+var jsonpSource = {type: 'jsonp'},+ that = this,+ lastRequest, loading;++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 147);+function _sendRequest(request) {+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "_sendRequest", 147);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 148);+var cacheKey = request.request,+ query = request.query;++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 151);+if (that._cache && cacheKey in that._cache) {+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 152);+that[_SOURCE_SUCCESS](that._cache[cacheKey], request);+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 153);+return;+ }++ // Hack alert: JSONPRequest currently doesn't support+ // per-request callbacks, so we're reaching into the protected+ // _config object to make it happen.+ //+ // This limitation is mentioned in the following JSONP+ // enhancement ticket:+ //+ // http://yuilibrary.com/projects/yui3/ticket/2529371+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 164);+source._config.on.success = function (data) {+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "success", 164);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 165);+that._cache && (that._cache[cacheKey] = data);+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 166);+that[_SOURCE_SUCCESS](data, request);+ };++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 169);+source.send(query);+ }++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 172);+jsonpSource.sendRequest = function (request) {+ // Keep track of the most recent request in case there are multiple+ // requests while we're waiting for the JSONP module to load. Only+ // the most recent request will be sent.+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "sendRequest", 172);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 176);+lastRequest = request;++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 178);+if (loading) { return; }++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 180);+loading = true;++ // Lazy-load the JSONP module if necessary, then overwrite the+ // sendRequest method to bypass this check in the future.+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 184);+Y.use('jsonp', function () {+ // Turn the source into a JSONPRequest instance if it isn't+ // one already.+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "(anonymous 3)", 184);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 187);+if (!(source instanceof Y.JSONPRequest)) {+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 188);+source = new Y.JSONPRequest(source, {+ format: Y.bind(that._jsonpFormatter, that)+ });+ }++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 193);+jsonpSource.sendRequest = _sendRequest;+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 194);+_sendRequest(lastRequest);+ });+ };++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 198);+return jsonpSource;+ },++ /**+ Creates a DataSource-like object that uses the specified `<select>` node as+ a source.++ @method _createSelectSource+ @param {Node} source YUI Node instance wrapping a `<select>` node.+ @return {Object} DataSource-like object.+ @protected+ @for AutoCompleteBase+ **/+ _createSelectSource: function (source) {+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "_createSelectSource", 211);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 212);+var that = this;++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 214);+return {+ type: 'select',+ sendRequest: function (request) {+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "sendRequest", 216);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 217);+var options = [];++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 219);+source.get('options').each(function (option) {+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "(anonymous 4)", 219);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 220);+options.push({+ html : option.get('innerHTML'),+ index : option.get('index'),+ node : option,+ selected: option.get('selected'),+ text : option.get('text'),+ value : option.get('value')+ });+ });++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 230);+that[_SOURCE_SUCCESS](options, request);+ }+ };+ },++ /**+ Creates a DataSource-like object that calls the specified URL or executes+ the specified YQL query for results. If the string starts with "select ",+ "use ", or "set " (case-insensitive), it's assumed to be a YQL query;+ otherwise, it's assumed to be a URL (which may be absolute or relative).+ URLs containing a "{callback}" placeholder are assumed to be JSONP URLs; all+ others will use XHR. See the `source` attribute for more details.++ @method _createStringSource+ @param {String} source URL or YQL query.+ @return {Object} DataSource-like object.+ @protected+ @for AutoCompleteBase+ **/+ _createStringSource: function (source) {+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "_createStringSource", 249);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 250);+if (this._YQL_SOURCE_REGEX.test(source)) {+ // Looks like a YQL query.+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 252);+return this._createYQLSource(source);+ } else {_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 253);+if (source.indexOf('{callback}') !== -1) {+ // Contains a {callback} param and isn't a YQL query, so it must be+ // JSONP.+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 256);+return this._createJSONPSource(source);+ } else {+ // Not a YQL query or JSONP, so we'll assume it's an XHR URL.+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 259);+return this._createIOSource(source);+ }}+ },++ /**+ Creates a DataSource-like object that uses the specified YQL query string to+ create a YQL-based source. See the `source` attribute for details. If no+ `resultListLocator` is defined, this method will set a best-guess locator+ that might work for many typical YQL queries.++ @method _createYQLSource+ @param {String} source YQL query.+ @return {Object} DataSource-like object.+ @protected+ @for AutoCompleteBase+ **/+ _createYQLSource: function (source) {+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "_createYQLSource", 275);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 276);+var that = this,+ yqlSource = {type: 'yql'},+ lastRequest, loading, yqlRequest;++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 280);+if (!that.get(RESULT_LIST_LOCATOR)) {+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 281);+that.set(RESULT_LIST_LOCATOR, that._defaultYQLLocator);+ }++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 284);+function _sendRequest(request) {+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "_sendRequest", 284);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 285);+var query = request.query,+ env = that.get('yqlEnv'),+ maxResults = that.get(MAX_RESULTS),+ callback, opts, yqlQuery;++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 290);+yqlQuery = Lang.sub(source, {+ maxResults: maxResults > 0 ? maxResults : 1000,+ request : request.request,+ query : query+ });++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 296);+if (that._cache && yqlQuery in that._cache) {+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 297);+that[_SOURCE_SUCCESS](that._cache[yqlQuery], request);+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 298);+return;+ }++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 301);+callback = function (data) {+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "callback", 301);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 302);+that._cache && (that._cache[yqlQuery] = data);+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 303);+that[_SOURCE_SUCCESS](data, request);+ };++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 306);+opts = {proto: that.get('yqlProtocol')};++ // Only create a new YQLRequest instance if this is the+ // first request. For subsequent requests, we'll reuse the+ // original instance.+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 311);+if (yqlRequest) {+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 312);+yqlRequest._callback = callback;+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 313);+yqlRequest._opts = opts;+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 314);+yqlRequest._params.q = yqlQuery;++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 316);+if (env) {+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 317);+yqlRequest._params.env = env;+ }+ } else {+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 320);+yqlRequest = new Y.YQLRequest(yqlQuery, {+ on: {success: callback},+ allowCache: false // temp workaround until JSONP has per-URL callback proxies+ }, env ? {env: env} : null, opts);+ }++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 326);+yqlRequest.send();+ }++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 329);+yqlSource.sendRequest = function (request) {+ // Keep track of the most recent request in case there are multiple+ // requests while we're waiting for the YQL module to load. Only the+ // most recent request will be sent.+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "sendRequest", 329);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 333);+lastRequest = request;++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 335);+if (!loading) {+ // Lazy-load the YQL module if necessary, then overwrite the+ // sendRequest method to bypass this check in the future.+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 338);+loading = true;++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 340);+Y.use('yql', function () {+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "(anonymous 5)", 340);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 341);+yqlSource.sendRequest = _sendRequest;+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 342);+_sendRequest(lastRequest);+ });+ }+ };++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 347);+return yqlSource;+ },++ /**+ Default resultListLocator used when a string-based YQL source is set and the+ implementer hasn't already specified one.++ @method _defaultYQLLocator+ @param {Object} response YQL response object.+ @return {Array}+ @protected+ @for AutoCompleteBase+ **/+ _defaultYQLLocator: function (response) {+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "_defaultYQLLocator", 360);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 361);+var results = response && response.query && response.query.results,+ values;++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 364);+if (results && Lang.isObject(results)) {+ // If there's only a single value on YQL's results object, that+ // value almost certainly contains the array of results we want. If+ // there are 0 or 2+ values, then the values themselves are most+ // likely the results we want.+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 369);+values = Y.Object.values(results) || [];+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 370);+results = values.length === 1 ? values[0] : values;++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 372);+if (!Lang.isArray(results)) {+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 373);+results = [results];+ }+ } else {+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 376);+results = [];+ }++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 379);+return results;+ },++ /**+ Returns a formatted XHR URL based on the specified base _url_, _query_, and+ the current _requestTemplate_ if any.++ @method _getXHRUrl+ @param {String} url Base URL.+ @param {Object} request Request object containing `query` and `request`+ properties.+ @return {String} Formatted URL.+ @protected+ @for AutoCompleteBase+ **/+ _getXHRUrl: function (url, request) {+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "_getXHRUrl", 394);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 395);+var maxResults = this.get(MAX_RESULTS);++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 397);+if (request.query !== request.request) {+ // Append the request template to the URL.+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 399);+url += request.request;+ }++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 402);+return Lang.sub(url, {+ maxResults: maxResults > 0 ? maxResults : 1000,+ query : encodeURIComponent(request.query)+ });+ },++ /**+ URL formatter passed to `JSONPRequest` instances.++ @method _jsonpFormatter+ @param {String} url+ @param {String} proxy+ @param {String} query+ @return {String} Formatted URL+ @protected+ @for AutoCompleteBase+ **/+ _jsonpFormatter: function (url, proxy, query) {+ _yuitest_coverfunc("build/autocomplete-sources/autocomplete-sources.js", "_jsonpFormatter", 419);+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 420);+var maxResults = this.get(MAX_RESULTS),+ requestTemplate = this.get(REQUEST_TEMPLATE);++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 423);+if (requestTemplate) {+ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 424);+url += requestTemplate(query);+ }++ _yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 427);+return Lang.sub(url, {+ callback : proxy,+ maxResults: maxResults > 0 ? maxResults : 1000,+ query : encodeURIComponent(query)+ });+ }+});++// Add attributes to AutoCompleteBase.+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 436);+Y.mix(ACBase.ATTRS, {+ /**+ YQL environment file URL to load when the `source` is set to a YQL query.+ Set this to `null` to use the default Open Data Tables environment file+ (http://datatables.org/alltables.env).++ @attribute yqlEnv+ @type String+ @default null+ @for AutoCompleteBase+ **/+ yqlEnv: {+ value: null+ },++ /**+ URL protocol to use when the `source` is set to a YQL query.++ @attribute yqlProtocol+ @type String+ @default 'http'+ @for AutoCompleteBase+ **/+ yqlProtocol: {+ value: 'http'+ }+});++// Tell AutoCompleteBase about the new source types it can now support.+_yuitest_coverline("build/autocomplete-sources/autocomplete-sources.js", 465);+Y.mix(ACBase.SOURCE_TYPES, {+ io : '_createIOSource',+ jsonp : '_createJSONPSource',+ object: '_beforeCreateObjectSource', // Run our version before the base version.+ select: '_createSelectSource',+ string: '_createStringSource',+ yql : '_createYQLSource'+}, true);+++}, '3.7.1', {"optional": ["io-base", "json-parse", "jsonp", "yql"], "requires": ["autocomplete-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('autocomplete-sources', function(Y) {+YUI.add('autocomplete-sources', function (Y, NAME) { /** Mixes support for JSONP and YQL result sources into AutoCompleteBase.@@ -80,8 +80,7 @@ // Private internal _sendRequest method that will be assigned to // ioSource.sendRequest once io-base and json-parse are available. function _sendRequest(request) {- var cacheKey = request.request,- query = request.query;+ var cacheKey = request.request; // Return immediately on a cached response. if (that._cache && cacheKey in that._cache) {@@ -479,4 +478,4 @@ }, true); -}, '3.5.1' ,{optional:['io-base', 'json-parse', 'jsonp', 'yql'], requires:['autocomplete-base']});+}, '3.7.1', {"optional": ["io-base", "json-parse", "jsonp", "yql"], "requires": ["autocomplete-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("autocomplete-sources",function(g){var a=g.AutoCompleteBase,f=g.Lang,b="_sourceSuccess",d="maxResults",e="requestTemplate",c="resultListLocator";g.mix(a.prototype,{_YQL_SOURCE_REGEX:/^(?:select|set|use)\s+/i,_beforeCreateObjectSource:function(h){if(h instanceof g.Node&&h.get("nodeName").toLowerCase()==="select"){return this._createSelectSource(h);}if(g.JSONPRequest&&h instanceof g.JSONPRequest){return this._createJSONPSource(h);}return this._createObjectSource(h);},_createIOSource:function(l){var j={type:"io"},k=this,n,i,m;function h(o){var q=o.request,p=o.query;if(k._cache&&q in k._cache){k[b](k._cache[q],o);return;}if(n&&n.isInProgress()){n.abort();}n=g.io(k._getXHRUrl(l,o),{on:{success:function(u,r){var t;try{t=g.JSON.parse(r.responseText);}catch(s){g.error("JSON parse error",s);}if(t){k._cache&&(k._cache[q]=t);k[b](t,o);}}}});}j.sendRequest=function(o){i=o;if(m){return;}m=true;g.use("io-base","json-parse",function(){j.sendRequest=h;h(i);});};return j;},_createJSONPSource:function(l){var j={type:"jsonp"},k=this,i,m;function h(n){var p=n.request,o=n.query;if(k._cache&&p in k._cache){k[b](k._cache[p],n);return;}l._config.on.success=function(q){k._cache&&(k._cache[p]=q);k[b](q,n);};l.send(o);}j.sendRequest=function(n){i=n;if(m){return;}m=true;g.use("jsonp",function(){if(!(l instanceof g.JSONPRequest)){l=new g.JSONPRequest(l,{format:g.bind(k._jsonpFormatter,k)});}j.sendRequest=h;h(i);});};return j;},_createSelectSource:function(i){var h=this;return{type:"select",sendRequest:function(k){var j=[];i.get("options").each(function(l){j.push({html:l.get("innerHTML"),index:l.get("index"),node:l,selected:l.get("selected"),text:l.get("text"),value:l.get("value")});});h[b](j,k);}};},_createStringSource:function(h){if(this._YQL_SOURCE_REGEX.test(h)){return this._createYQLSource(h);}else{if(h.indexOf("{callback}")!==-1){return this._createJSONPSource(h);}else{return this._createIOSource(h);}}},_createYQLSource:function(l){var k=this,m={type:"yql"},i,n,j;if(!k.get(c)){k.set(c,k._defaultYQLLocator);}function h(s){var t=s.query,q=k.get("yqlEnv"),o=k.get(d),u,r,p;p=f.sub(l,{maxResults:o>0?o:1000,request:s.request,query:t});if(k._cache&&p in k._cache){k[b](k._cache[p],s);return;}u=function(v){k._cache&&(k._cache[p]=v);k[b](v,s);};r={proto:k.get("yqlProtocol")};if(j){j._callback=u;j._opts=r;j._params.q=p;if(q){j._params.env=q;}}else{j=new g.YQLRequest(p,{on:{success:u},allowCache:false},q?{env:q}:null,r);}j.send();}m.sendRequest=function(o){i=o;if(!n){n=true;g.use("yql",function(){m.sendRequest=h;h(i);});}};return m;},_defaultYQLLocator:function(i){var j=i&&i.query&&i.query.results,h;if(j&&f.isObject(j)){h=g.Object.values(j)||[];j=h.length===1?h[0]:h;if(!f.isArray(j)){j=[j];}}else{j=[];}return j;},_getXHRUrl:function(i,j){var h=this.get(d);if(j.query!==j.request){i+=j.request;}return f.sub(i,{maxResults:h>0?h:1000,query:encodeURIComponent(j.query)});},_jsonpFormatter:function(i,j,k){var h=this.get(d),l=this.get(e);if(l){i+=l(k);}return f.sub(i,{callback:j,maxResults:h>0?h:1000,query:encodeURIComponent(k)});}});g.mix(a.ATTRS,{yqlEnv:{value:null},yqlProtocol:{value:"http"}});g.mix(a.SOURCE_TYPES,{io:"_createIOSource",jsonp:"_createJSONPSource",object:"_beforeCreateObjectSource",select:"_createSelectSource",string:"_createStringSource",yql:"_createYQLSource"},true);},"3.5.1",{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]});+YUI.add("autocomplete-sources",function(e,t){var n=e.AutoCompleteBase,r=e.Lang,i="_sourceSuccess",s="maxResults",o="requestTemplate",u="resultListLocator";e.mix(n.prototype,{_YQL_SOURCE_REGEX:/^(?:select|set|use)\s+/i,_beforeCreateObjectSource:function(t){return t instanceof e.Node&&t.get("nodeName").toLowerCase()==="select"?this._createSelectSource(t):e.JSONPRequest&&t instanceof e.JSONPRequest?this._createJSONPSource(t):this._createObjectSource(t)},_createIOSource:function(t){function a(n){var o=n.request;if(r._cache&&o in r._cache){r[i](r._cache[o],n);return}s&&s.isInProgress()&&s.abort(),s=e.io(r._getXHRUrl(t,n),{on:{success:function(t,s){var u;try{u=e.JSON.parse(s.responseText)}catch(a){e.error("JSON parse error",a)}u&&(r._cache&&(r._cache[o]=u),r[i](u,n))}}})}var n={type:"io"},r=this,s,o,u;return n.sendRequest=function(t){o=t;if(u)return;u=!0,e.use("io-base","json-parse",function(){n.sendRequest=a,a(o)})},n},_createJSONPSource:function(t){function u(e){var n=e.request,s=e.query;if(r._cache&&n in r._cache){r[i](r._cache[n],e);return}t._config.on.success=function(t){r._cache&&(r._cache[n]=t),r[i](t,e)},t.send(s)}var n={type:"jsonp"},r=this,s,o;return n.sendRequest=function(i){s=i;if(o)return;o=!0,e.use("jsonp",function(){t instanceof e.JSONPRequest||(t=new e.JSONPRequest(t,{format:e.bind(r._jsonpFormatter,r)})),n.sendRequest=u,u(s)})},n},_createSelectSource:function(e){var t=this;return{type:"select",sendRequest:function(n){var r=[];e.get("options").each(function(e){r.push({html:e.get("innerHTML"),index:e.get("index"),node:e,selected:e.get("selected"),text:e.get("text"),value:e.get("value")})}),t[i](r,n)}}},_createStringSource:function(e){return this._YQL_SOURCE_REGEX.test(e)?this._createYQLSource(e):e.indexOf("{callback}")!==-1?this._createJSONPSource(e):this._createIOSource(e)},_createYQLSource:function(t){function c(o){var u=o.query,a=n.get("yqlEnv"),f=n.get(s),c,h,p;p=r.sub(t,{maxResults:f>0?f:1e3,request:o.request,query:u});if(n._cache&&p in n._cache){n[i](n._cache[p],o);return}c=function(e){n._cache&&(n._cache[p]=e),n[i](e,o)},h={proto:n.get("yqlProtocol")},l?(l._callback=c,l._opts=h,l._params.q=p,a&&(l._params.env=a)):l=new e.YQLRequest(p,{on:{success:c},allowCache:!1},a?{env:a}:null,h),l.send()}var n=this,o={type:"yql"},a,f,l;return n.get(u)||n.set(u,n._defaultYQLLocator),o.sendRequest=function(t){a=t,f||(f=!0,e.use("yql",function(){o.sendRequest=c,c(a)}))},o},_defaultYQLLocator:function(t){var n=t&&t.query&&t.query.results,i;return n&&r.isObject(n)?(i=e.Object.values(n)||[],n=i.length===1?i[0]:i,r.isArray(n)||(n=[n])):n=[],n},_getXHRUrl:function(e,t){var n=this.get(s);return t.query!==t.request&&(e+=t.request),r.sub(e,{maxResults:n>0?n:1e3,query:encodeURIComponent(t.query)})},_jsonpFormatter:function(e,t,n){var i=this.get(s),u=this.get(o);return u&&(e+=u(n)),r.sub(e,{callback:t,maxResults:i>0?i:1e3,query:encodeURIComponent(n)})}}),e.mix(n.ATTRS,{yqlEnv:{value:null},yqlProtocol:{value:"http"}}),e.mix(n.SOURCE_TYPES,{io:"_createIOSource",jsonp:"_createJSONPSource",object:"_beforeCreateObjectSource",select:"_createSelectSource",string:"_createStringSource",yql:"_createYQLSource"},!0)},"3.7.1",{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('autocomplete-sources', function(Y) {+YUI.add('autocomplete-sources', function (Y, NAME) { /** Mixes support for JSONP and YQL result sources into AutoCompleteBase.@@ -80,8 +80,7 @@ // Private internal _sendRequest method that will be assigned to // ioSource.sendRequest once io-base and json-parse are available. function _sendRequest(request) {- var cacheKey = request.request,- query = request.query;+ var cacheKey = request.request; // Return immediately on a cached response. if (that._cache && cacheKey in that._cache) {@@ -479,4 +478,4 @@ }, true); -}, '3.5.1' ,{optional:['io-base', 'json-parse', 'jsonp', 'yql'], requires:['autocomplete-base']});+}, '3.7.1', {"optional": ["io-base", "json-parse", "jsonp", "yql"], "requires": ["autocomplete-base"]});
@@ -0,0 +1,437 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/base-base/base-base.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/base-base/base-base.js",+ code: []+};+_yuitest_coverage["build/base-base/base-base.js"].code=["YUI.add('base-base', function (Y, NAME) {",""," /**"," * The base module provides the Base class, which objects requiring attribute and custom event support can extend. "," * The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides "," * plugin support and also provides the BaseCore.build method which provides a way to build custom classes using extensions."," *"," * @module base"," */",""," /**"," * The base-base submodule provides the Base class without the Plugin support, provided by Plugin.Host, "," * and without the extension support provided by BaseCore.build."," *"," * @module base"," * @submodule base-base"," */",""," /**"," * The base module provides the Base class, which objects requiring attribute and custom event support can extend. "," * The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides "," * plugin support and also provides the Base.build method which provides a way to build custom classes using extensions."," *"," * @module base"," */",""," /**"," * The base-base submodule provides the Base class without the Plugin support, provided by Plugin.Host, "," * and without the extension support provided by Base.build."," *"," * @module base"," * @submodule base-base"," */"," var L = Y.Lang,",""," DESTROY = \"destroy\","," INIT = \"init\",",""," BUBBLETARGETS = \"bubbleTargets\","," _BUBBLETARGETS = \"_bubbleTargets\",",""," BaseCore = Y.BaseCore,"," AttributeCore = Y.AttributeCore,"," Attribute = Y.Attribute;",""," /**"," * <p>"," * A base class which objects requiring attributes and custom event support can "," * extend. Base also handles the chaining of initializer and destructor methods across "," * the hierarchy as part of object construction and destruction. Additionally, attributes configured "," * through the static <a href=\"#property_ATTRS\">ATTRS</a> property for each class "," * in the hierarchy will be initialized by Base."," * </p>"," *"," * <p>"," * The static <a href=\"#property_NAME\">NAME</a> property of each class extending "," * from Base will be used as the identifier for the class, and is used by Base to prefix "," * all events fired by instances of that class."," * </p>"," *"," * @class Base"," * @constructor"," * @uses BaseCore"," * @uses Attribute"," * @uses AttributeCore"," * @uses AttributeEvents"," * @uses AttributeExtras"," * @uses EventTarget"," *"," * @param {Object} config Object with configuration property name/value pairs. The object can be "," * used to provide default values for the objects published attributes."," *"," * <p>"," * The config object can also contain the following non-attribute properties, providing a convenient "," * way to configure events listeners and plugins for the instance, as part of the constructor call:"," * </p>"," *"," * <dl>"," * <dt>on</dt>"," * <dd>An event name to listener function map, to register event listeners for the \"on\" moment of the event. A constructor convenience property for the <a href=\"Base.html#method_on\">on</a> method.</dd>"," * <dt>after</dt>"," * <dd>An event name to listener function map, to register event listeners for the \"after\" moment of the event. A constructor convenience property for the <a href=\"Base.html#method_after\">after</a> method.</dd>"," * <dt>bubbleTargets</dt>"," * <dd>An object, or array of objects, to register as bubble targets for bubbled events fired by this instance. A constructor convenience property for the <a href=\"EventTarget.html#method_addTarget\">addTarget</a> method.</dd>"," * <dt>plugins</dt>"," * <dd>A plugin, or array of plugins to be plugged into the instance (see PluginHost's plug method for signature details). A constructor convenience property for the <a href=\"Plugin.Host.html#method_plug\">plug</a> method.</dd>"," * </dl>"," */"," function Base() {"," BaseCore.apply(this, arguments);"," }",""," /**"," * The list of properties which can be configured for "," * each attribute (e.g. setter, getter, writeOnce, readOnly etc.)"," *"," * @property _ATTR_CFG"," * @type Array"," * @static"," * @private"," */"," Base._ATTR_CFG = Attribute._ATTR_CFG.concat(\"cloneDefaultValue\");"," Base._ATTR_CFG_HASH = Y.Array.hash(Base._ATTR_CFG);",""," /**"," * The array of non-attribute configuration properties supported by this class. "," * "," * `Base` supports \"on\", \"after\", \"plugins\" and \"bubbleTargets\" properties, "," * which are not set up as attributes. "," *"," * This property is primarily required so that when "," * <a href=\"#property__allowAdHocAttrs\">`_allowAdHocAttrs`</a> is enabled by"," * a class, non-attribute configurations don't get added as ad-hoc attributes. "," *"," * @property _NON_ATTRS_CFG"," * @type Array"," * @static"," * @private"," */"," Base._NON_ATTRS_CFG = BaseCore._NON_ATTRS_CFG.concat([\"on\", \"after\", \"bubbleTargets\"]);",""," /**"," * <p>"," * The string to be used to identify instances of "," * this class, for example in prefixing events."," * </p>"," * <p>"," * Classes extending Base, should define their own"," * static NAME property, which should be camelCase by"," * convention (e.g. MyClass.NAME = \"myClass\";)."," * </p>"," * @property NAME"," * @type String"," * @static"," */"," Base.NAME = \"base\";",""," /**"," * The default set of attributes which will be available for instances of this class, and "," * their configuration. In addition to the configuration properties listed by "," * Attribute's <a href=\"Attribute.html#method_addAttr\">addAttr</a> method, the attribute "," * can also be configured with a \"cloneDefaultValue\" property, which defines how the statically"," * defined value field should be protected (\"shallow\", \"deep\" and false are supported values). "," *"," * By default if the value is an object literal or an array it will be \"shallow\" cloned, to "," * protect the default value."," *"," * @property ATTRS"," * @type Object"," * @static"," */"," Base.ATTRS = AttributeCore.prototype._protectAttrs(BaseCore.ATTRS);",""," Base.prototype = {",""," /**"," * Internal construction logic for Base."," *"," * @method _initBase"," * @param {Object} config The constructor configuration object"," * @private"," */"," _initBase: function(cfg) {",""," this._eventPrefix = this.constructor.EVENT_PREFIX || this.constructor.NAME;",""," Y.BaseCore.prototype._initBase.call(this, cfg);"," },",""," /**"," * Initializes Attribute "," * "," * @method _initAttribute"," * @private"," */"," _initAttribute: function(cfg) {"," Attribute.call(this);"," this._yuievt.config.prefix = this._eventPrefix;"," },",""," /**"," * Utility method to define the attribute hash used to filter/whitelist property mixes for "," * this class. "," * "," * @method _attrCfgHash"," * @private"," */"," _attrCfgHash: function() {"," return Base._ATTR_CFG_HASH;"," },",""," /**"," * Init lifecycle method, invoked during construction."," * Fires the init event prior to setting up attributes and "," * invoking initializers for the class hierarchy."," *"," * @method init"," * @chainable"," * @param {Object} config Object with configuration property name/value pairs"," * @return {Base} A reference to this object"," */"," init: function(config) {"," /**"," * <p>"," * Lifecycle event for the init phase, fired prior to initialization. "," * Invoking the preventDefault() method on the event object provided "," * to subscribers will prevent initialization from occuring."," * </p>"," * <p>"," * Subscribers to the \"after\" momemt of this event, will be notified"," * after initialization of the object is complete (and therefore"," * cannot prevent initialization)."," * </p>"," *"," * @event init"," * @preventable _defInitFn"," * @param {EventFacade} e Event object, with a cfg property which "," * refers to the configuration object passed to the constructor."," */"," this.publish(INIT, {"," queuable:false,"," fireOnce:true,"," defaultTargetOnly:true,"," defaultFn:this._defInitFn"," });",""," this._preInitEventCfg(config);",""," this.fire(INIT, {cfg: config});",""," return this;"," },",""," /**"," * Handles the special on, after and target properties which allow the user to"," * easily configure on and after listeners as well as bubble targets during "," * construction, prior to init."," *"," * @private"," * @method _preInitEventCfg"," * @param {Object} config The user configuration object"," */"," _preInitEventCfg : function(config) {"," if (config) {"," if (config.on) {"," this.on(config.on);"," }"," if (config.after) {"," this.after(config.after);"," }"," }",""," var i, l, target,"," userTargets = (config && BUBBLETARGETS in config);",""," if (userTargets || _BUBBLETARGETS in this) {"," target = userTargets ? (config && config.bubbleTargets) : this._bubbleTargets;"," if (L.isArray(target)) {"," for (i = 0, l = target.length; i < l; i++) { "," this.addTarget(target[i]);"," }"," } else if (target) {"," this.addTarget(target);"," }"," }"," },",""," /**"," * <p>"," * Destroy lifecycle method. Fires the destroy"," * event, prior to invoking destructors for the"," * class hierarchy."," * </p>"," * <p>"," * Subscribers to the destroy"," * event can invoke preventDefault on the event object, to prevent destruction"," * from proceeding."," * </p>"," * @method destroy"," * @return {Base} A reference to this object"," * @chainable"," */"," destroy: function() {",""," /**"," * <p>"," * Lifecycle event for the destroy phase, "," * fired prior to destruction. Invoking the preventDefault "," * method on the event object provided to subscribers will "," * prevent destruction from proceeding."," * </p>"," * <p>"," * Subscribers to the \"after\" moment of this event, will be notified"," * after destruction is complete (and as a result cannot prevent"," * destruction)."," * </p>"," * @event destroy"," * @preventable _defDestroyFn"," * @param {EventFacade} e Event object"," */"," this.publish(DESTROY, {"," queuable:false,"," fireOnce:true,"," defaultTargetOnly:true,"," defaultFn: this._defDestroyFn"," });"," this.fire(DESTROY);",""," this.detachAll();"," return this;"," },",""," /**"," * Default init event handler"," *"," * @method _defInitFn"," * @param {EventFacade} e Event object, with a cfg property which "," * refers to the configuration object passed to the constructor."," * @protected"," */"," _defInitFn : function(e) {"," this._baseInit(e.cfg);"," },",""," /**"," * Default destroy event handler"," *"," * @method _defDestroyFn"," * @param {EventFacade} e Event object"," * @protected"," */"," _defDestroyFn : function(e) {"," this._baseDestroy(e.cfg);"," }"," };",""," Y.mix(Base, Attribute, false, null, 1);"," Y.mix(Base, BaseCore, false, null, 1);",""," // Fix constructor"," Base.prototype.constructor = Base;",""," Y.Base = Base;","","","}, '3.7.1', {\"requires\": [\"base-core\", \"attribute-base\"]});"];+_yuitest_coverage["build/base-base/base-base.js"].lines = {"1":0,"34":0,"89":0,"90":0,"102":0,"103":0,"120":0,"136":0,"152":0,"154":0,"165":0,"167":0,"177":0,"178":0,"189":0,"220":0,"227":0,"229":0,"231":0,"244":0,"245":0,"246":0,"248":0,"249":0,"253":0,"256":0,"257":0,"258":0,"259":0,"260":0,"262":0,"263":0,"301":0,"307":0,"309":0,"310":0,"322":0,"333":0,"337":0,"338":0,"341":0,"343":0};+_yuitest_coverage["build/base-base/base-base.js"].functions = {"Base:89":0,"_initBase:163":0,"_initAttribute:176":0,"_attrCfgHash:188":0,"init:202":0,"_preInitEventCfg:243":0,"destroy:283":0,"_defInitFn:321":0,"_defDestroyFn:332":0,"(anonymous 1):1":0};+_yuitest_coverage["build/base-base/base-base.js"].coveredLines = 42;+_yuitest_coverage["build/base-base/base-base.js"].coveredFunctions = 10;+_yuitest_coverline("build/base-base/base-base.js", 1);+YUI.add('base-base', function (Y, NAME) {++ /**+ * The base module provides the Base class, which objects requiring attribute and custom event support can extend. + * The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides + * plugin support and also provides the BaseCore.build method which provides a way to build custom classes using extensions.+ *+ * @module base+ */++ /**+ * The base-base submodule provides the Base class without the Plugin support, provided by Plugin.Host, + * and without the extension support provided by BaseCore.build.+ *+ * @module base+ * @submodule base-base+ */++ /**+ * The base module provides the Base class, which objects requiring attribute and custom event support can extend. + * The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides + * plugin support and also provides the Base.build method which provides a way to build custom classes using extensions.+ *+ * @module base+ */++ /**+ * The base-base submodule provides the Base class without the Plugin support, provided by Plugin.Host, + * and without the extension support provided by Base.build.+ *+ * @module base+ * @submodule base-base+ */+ _yuitest_coverfunc("build/base-base/base-base.js", "(anonymous 1)", 1);+_yuitest_coverline("build/base-base/base-base.js", 34);+var L = Y.Lang,++ DESTROY = "destroy",+ INIT = "init",++ BUBBLETARGETS = "bubbleTargets",+ _BUBBLETARGETS = "_bubbleTargets",++ BaseCore = Y.BaseCore,+ AttributeCore = Y.AttributeCore,+ Attribute = Y.Attribute;++ /**+ * <p>+ * A base class which objects requiring attributes and custom event support can + * extend. Base also handles the chaining of initializer and destructor methods across + * the hierarchy as part of object construction and destruction. Additionally, attributes configured + * through the static <a href="#property_ATTRS">ATTRS</a> property for each class + * in the hierarchy will be initialized by Base.+ * </p>+ *+ * <p>+ * The static <a href="#property_NAME">NAME</a> property of each class extending + * from Base will be used as the identifier for the class, and is used by Base to prefix + * all events fired by instances of that class.+ * </p>+ *+ * @class Base+ * @constructor+ * @uses BaseCore+ * @uses Attribute+ * @uses AttributeCore+ * @uses AttributeEvents+ * @uses AttributeExtras+ * @uses EventTarget+ *+ * @param {Object} config Object with configuration property name/value pairs. The object can be + * used to provide default values for the objects published attributes.+ *+ * <p>+ * The config object can also contain the following non-attribute properties, providing a convenient + * way to configure events listeners and plugins for the instance, as part of the constructor call:+ * </p>+ *+ * <dl>+ * <dt>on</dt>+ * <dd>An event name to listener function map, to register event listeners for the "on" moment of the event. A constructor convenience property for the <a href="Base.html#method_on">on</a> method.</dd>+ * <dt>after</dt>+ * <dd>An event name to listener function map, to register event listeners for the "after" moment of the event. A constructor convenience property for the <a href="Base.html#method_after">after</a> method.</dd>+ * <dt>bubbleTargets</dt>+ * <dd>An object, or array of objects, to register as bubble targets for bubbled events fired by this instance. A constructor convenience property for the <a href="EventTarget.html#method_addTarget">addTarget</a> method.</dd>+ * <dt>plugins</dt>+ * <dd>A plugin, or array of plugins to be plugged into the instance (see PluginHost's plug method for signature details). A constructor convenience property for the <a href="Plugin.Host.html#method_plug">plug</a> method.</dd>+ * </dl>+ */+ _yuitest_coverline("build/base-base/base-base.js", 89);+function Base() {+ _yuitest_coverfunc("build/base-base/base-base.js", "Base", 89);+_yuitest_coverline("build/base-base/base-base.js", 90);+BaseCore.apply(this, arguments);+ }++ /**+ * The list of properties which can be configured for + * each attribute (e.g. setter, getter, writeOnce, readOnly etc.)+ *+ * @property _ATTR_CFG+ * @type Array+ * @static+ * @private+ */+ _yuitest_coverline("build/base-base/base-base.js", 102);+Base._ATTR_CFG = Attribute._ATTR_CFG.concat("cloneDefaultValue");+ _yuitest_coverline("build/base-base/base-base.js", 103);+Base._ATTR_CFG_HASH = Y.Array.hash(Base._ATTR_CFG);++ /**+ * The array of non-attribute configuration properties supported by this class. + * + * `Base` supports "on", "after", "plugins" and "bubbleTargets" properties, + * which are not set up as attributes. + *+ * This property is primarily required so that when + * <a href="#property__allowAdHocAttrs">`_allowAdHocAttrs`</a> is enabled by+ * a class, non-attribute configurations don't get added as ad-hoc attributes. + *+ * @property _NON_ATTRS_CFG+ * @type Array+ * @static+ * @private+ */+ _yuitest_coverline("build/base-base/base-base.js", 120);+Base._NON_ATTRS_CFG = BaseCore._NON_ATTRS_CFG.concat(["on", "after", "bubbleTargets"]);++ /**+ * <p>+ * The string to be used to identify instances of + * this class, for example in prefixing events.+ * </p>+ * <p>+ * Classes extending Base, should define their own+ * static NAME property, which should be camelCase by+ * convention (e.g. MyClass.NAME = "myClass";).+ * </p>+ * @property NAME+ * @type String+ * @static+ */+ _yuitest_coverline("build/base-base/base-base.js", 136);+Base.NAME = "base";++ /**+ * The default set of attributes which will be available for instances of this class, and + * their configuration. In addition to the configuration properties listed by + * Attribute's <a href="Attribute.html#method_addAttr">addAttr</a> method, the attribute + * can also be configured with a "cloneDefaultValue" property, which defines how the statically+ * defined value field should be protected ("shallow", "deep" and false are supported values). + *+ * By default if the value is an object literal or an array it will be "shallow" cloned, to + * protect the default value.+ *+ * @property ATTRS+ * @type Object+ * @static+ */+ _yuitest_coverline("build/base-base/base-base.js", 152);+Base.ATTRS = AttributeCore.prototype._protectAttrs(BaseCore.ATTRS);++ _yuitest_coverline("build/base-base/base-base.js", 154);+Base.prototype = {++ /**+ * Internal construction logic for Base.+ *+ * @method _initBase+ * @param {Object} config The constructor configuration object+ * @private+ */+ _initBase: function(cfg) {++ _yuitest_coverfunc("build/base-base/base-base.js", "_initBase", 163);+_yuitest_coverline("build/base-base/base-base.js", 165);+this._eventPrefix = this.constructor.EVENT_PREFIX || this.constructor.NAME;++ _yuitest_coverline("build/base-base/base-base.js", 167);+Y.BaseCore.prototype._initBase.call(this, cfg);+ },++ /**+ * Initializes Attribute + * + * @method _initAttribute+ * @private+ */+ _initAttribute: function(cfg) {+ _yuitest_coverfunc("build/base-base/base-base.js", "_initAttribute", 176);+_yuitest_coverline("build/base-base/base-base.js", 177);+Attribute.call(this);+ _yuitest_coverline("build/base-base/base-base.js", 178);+this._yuievt.config.prefix = this._eventPrefix;+ },++ /**+ * Utility method to define the attribute hash used to filter/whitelist property mixes for + * this class. + * + * @method _attrCfgHash+ * @private+ */+ _attrCfgHash: function() {+ _yuitest_coverfunc("build/base-base/base-base.js", "_attrCfgHash", 188);+_yuitest_coverline("build/base-base/base-base.js", 189);+return Base._ATTR_CFG_HASH;+ },++ /**+ * Init lifecycle method, invoked during construction.+ * Fires the init event prior to setting up attributes and + * invoking initializers for the class hierarchy.+ *+ * @method init+ * @chainable+ * @param {Object} config Object with configuration property name/value pairs+ * @return {Base} A reference to this object+ */+ init: function(config) {+ /**+ * <p>+ * Lifecycle event for the init phase, fired prior to initialization. + * Invoking the preventDefault() method on the event object provided + * to subscribers will prevent initialization from occuring.+ * </p>+ * <p>+ * Subscribers to the "after" momemt of this event, will be notified+ * after initialization of the object is complete (and therefore+ * cannot prevent initialization).+ * </p>+ *+ * @event init+ * @preventable _defInitFn+ * @param {EventFacade} e Event object, with a cfg property which + * refers to the configuration object passed to the constructor.+ */+ _yuitest_coverfunc("build/base-base/base-base.js", "init", 202);+_yuitest_coverline("build/base-base/base-base.js", 220);+this.publish(INIT, {+ queuable:false,+ fireOnce:true,+ defaultTargetOnly:true,+ defaultFn:this._defInitFn+ });++ _yuitest_coverline("build/base-base/base-base.js", 227);+this._preInitEventCfg(config);++ _yuitest_coverline("build/base-base/base-base.js", 229);+this.fire(INIT, {cfg: config});++ _yuitest_coverline("build/base-base/base-base.js", 231);+return this;+ },++ /**+ * Handles the special on, after and target properties which allow the user to+ * easily configure on and after listeners as well as bubble targets during + * construction, prior to init.+ *+ * @private+ * @method _preInitEventCfg+ * @param {Object} config The user configuration object+ */+ _preInitEventCfg : function(config) {+ _yuitest_coverfunc("build/base-base/base-base.js", "_preInitEventCfg", 243);+_yuitest_coverline("build/base-base/base-base.js", 244);+if (config) {+ _yuitest_coverline("build/base-base/base-base.js", 245);+if (config.on) {+ _yuitest_coverline("build/base-base/base-base.js", 246);+this.on(config.on);+ }+ _yuitest_coverline("build/base-base/base-base.js", 248);+if (config.after) {+ _yuitest_coverline("build/base-base/base-base.js", 249);+this.after(config.after);+ }+ }++ _yuitest_coverline("build/base-base/base-base.js", 253);+var i, l, target,+ userTargets = (config && BUBBLETARGETS in config);++ _yuitest_coverline("build/base-base/base-base.js", 256);+if (userTargets || _BUBBLETARGETS in this) {+ _yuitest_coverline("build/base-base/base-base.js", 257);+target = userTargets ? (config && config.bubbleTargets) : this._bubbleTargets;+ _yuitest_coverline("build/base-base/base-base.js", 258);+if (L.isArray(target)) {+ _yuitest_coverline("build/base-base/base-base.js", 259);+for (i = 0, l = target.length; i < l; i++) { + _yuitest_coverline("build/base-base/base-base.js", 260);+this.addTarget(target[i]);+ }+ } else {_yuitest_coverline("build/base-base/base-base.js", 262);+if (target) {+ _yuitest_coverline("build/base-base/base-base.js", 263);+this.addTarget(target);+ }}+ }+ },++ /**+ * <p>+ * Destroy lifecycle method. Fires the destroy+ * event, prior to invoking destructors for the+ * class hierarchy.+ * </p>+ * <p>+ * Subscribers to the destroy+ * event can invoke preventDefault on the event object, to prevent destruction+ * from proceeding.+ * </p>+ * @method destroy+ * @return {Base} A reference to this object+ * @chainable+ */+ destroy: function() {++ /**+ * <p>+ * Lifecycle event for the destroy phase, + * fired prior to destruction. Invoking the preventDefault + * method on the event object provided to subscribers will + * prevent destruction from proceeding.+ * </p>+ * <p>+ * Subscribers to the "after" moment of this event, will be notified+ * after destruction is complete (and as a result cannot prevent+ * destruction).+ * </p>+ * @event destroy+ * @preventable _defDestroyFn+ * @param {EventFacade} e Event object+ */+ _yuitest_coverfunc("build/base-base/base-base.js", "destroy", 283);+_yuitest_coverline("build/base-base/base-base.js", 301);+this.publish(DESTROY, {+ queuable:false,+ fireOnce:true,+ defaultTargetOnly:true,+ defaultFn: this._defDestroyFn+ });+ _yuitest_coverline("build/base-base/base-base.js", 307);+this.fire(DESTROY);++ _yuitest_coverline("build/base-base/base-base.js", 309);+this.detachAll();+ _yuitest_coverline("build/base-base/base-base.js", 310);+return this;+ },++ /**+ * Default init event handler+ *+ * @method _defInitFn+ * @param {EventFacade} e Event object, with a cfg property which + * refers to the configuration object passed to the constructor.+ * @protected+ */+ _defInitFn : function(e) {+ _yuitest_coverfunc("build/base-base/base-base.js", "_defInitFn", 321);+_yuitest_coverline("build/base-base/base-base.js", 322);+this._baseInit(e.cfg);+ },++ /**+ * Default destroy event handler+ *+ * @method _defDestroyFn+ * @param {EventFacade} e Event object+ * @protected+ */+ _defDestroyFn : function(e) {+ _yuitest_coverfunc("build/base-base/base-base.js", "_defDestroyFn", 332);+_yuitest_coverline("build/base-base/base-base.js", 333);+this._baseDestroy(e.cfg);+ }+ };++ _yuitest_coverline("build/base-base/base-base.js", 337);+Y.mix(Base, Attribute, false, null, 1);+ _yuitest_coverline("build/base-base/base-base.js", 338);+Y.mix(Base, BaseCore, false, null, 1);++ // Fix constructor+ _yuitest_coverline("build/base-base/base-base.js", 341);+Base.prototype.constructor = Base;++ _yuitest_coverline("build/base-base/base-base.js", 343);+Y.Base = Base;+++}, '3.7.1', {"requires": ["base-core", "attribute-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('base-base', function(Y) {+YUI.add('base-base', function (Y, NAME) { /** * The base module provides the Base class, which objects requiring attribute and custom event support can extend. @@ -54,12 +54,12 @@ * A base class which objects requiring attributes and custom event support can * extend. Base also handles the chaining of initializer and destructor methods across * the hierarchy as part of object construction and destruction. Additionally, attributes configured - * through the static <a href="#property_Base.ATTRS">ATTRS</a> property for each class + * through the static <a href="#property_ATTRS">ATTRS</a> property for each class * in the hierarchy will be initialized by Base. * </p> * * <p>- * The static <a href="#property_Base.NAME">NAME</a> property of each class extending + * The static <a href="#property_NAME">NAME</a> property of each class extending * from Base will be used as the identifier for the class, and is used by Base to prefix * all events fired by instances of that class. * </p>@@ -351,4 +351,4 @@ Y.Base = Base; -}, '3.5.1' ,{requires:['base-core', 'attribute-base']});+}, '3.7.1', {"requires": ["base-core", "attribute-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("base-base",function(b){var g=b.Lang,e="destroy",i="init",h="bubbleTargets",c="_bubbleTargets",j=b.BaseCore,f=b.AttributeCore,a=b.Attribute;function d(){j.apply(this,arguments);}d._ATTR_CFG=a._ATTR_CFG.concat("cloneDefaultValue");d._ATTR_CFG_HASH=b.Array.hash(d._ATTR_CFG);d._NON_ATTRS_CFG=j._NON_ATTRS_CFG.concat(["on","after","bubbleTargets"]);d.NAME="base";d.ATTRS=f.prototype._protectAttrs(j.ATTRS);d.prototype={_initBase:function(k){this._eventPrefix=this.constructor.EVENT_PREFIX||this.constructor.NAME;b.BaseCore.prototype._initBase.call(this,k);},_initAttribute:function(k){a.call(this);this._yuievt.config.prefix=this._eventPrefix;},_attrCfgHash:function(){return d._ATTR_CFG_HASH;},init:function(k){this.publish(i,{queuable:false,fireOnce:true,defaultTargetOnly:true,defaultFn:this._defInitFn});this._preInitEventCfg(k);this.fire(i,{cfg:k});return this;},_preInitEventCfg:function(m){if(m){if(m.on){this.on(m.on);}if(m.after){this.after(m.after);}}var n,k,p,o=(m&&h in m);if(o||c in this){p=o?(m&&m.bubbleTargets):this._bubbleTargets;if(g.isArray(p)){for(n=0,k=p.length;n<k;n++){this.addTarget(p[n]);}}else{if(p){this.addTarget(p);}}}},destroy:function(){this.publish(e,{queuable:false,fireOnce:true,defaultTargetOnly:true,defaultFn:this._defDestroyFn});this.fire(e);this.detachAll();return this;},_defInitFn:function(k){this._baseInit(k.cfg);},_defDestroyFn:function(k){this._baseDestroy(k.cfg);}};b.mix(d,a,false,null,1);b.mix(d,j,false,null,1);d.prototype.constructor=d;b.Base=d;},"3.5.1",{requires:["base-core","attribute-base"]});+YUI.add("base-base",function(e,t){function l(){u.apply(this,arguments)}var n=e.Lang,r="destroy",i="init",s="bubbleTargets",o="_bubbleTargets",u=e.BaseCore,a=e.AttributeCore,f=e.Attribute;l._ATTR_CFG=f._ATTR_CFG.concat("cloneDefaultValue"),l._ATTR_CFG_HASH=e.Array.hash(l._ATTR_CFG),l._NON_ATTRS_CFG=u._NON_ATTRS_CFG.concat(["on","after","bubbleTargets"]),l.NAME="base",l.ATTRS=a.prototype._protectAttrs(u.ATTRS),l.prototype={_initBase:function(t){this._eventPrefix=this.constructor.EVENT_PREFIX||this.constructor.NAME,e.BaseCore.prototype._initBase.call(this,t)},_initAttribute:function(e){f.call(this),this._yuievt.config.prefix=this._eventPrefix},_attrCfgHash:function(){return l._ATTR_CFG_HASH},init:function(e){return this.publish(i,{queuable:!1,fireOnce:!0,defaultTargetOnly:!0,defaultFn:this._defInitFn}),this._preInitEventCfg(e),this.fire(i,{cfg:e}),this},_preInitEventCfg:function(e){e&&(e.on&&this.on(e.on),e.after&&this.after(e.after));var t,r,i,u=e&&s in e;if(u||o in this){i=u?e&&e.bubbleTargets:this._bubbleTargets;if(n.isArray(i))for(t=0,r=i.length;t<r;t++)this.addTarget(i[t]);else i&&this.addTarget(i)}},destroy:function(){return this.publish(r,{queuable:!1,fireOnce:!0,defaultTargetOnly:!0,defaultFn:this._defDestroyFn}),this.fire(r),this.detachAll(),this},_defInitFn:function(e){this._baseInit(e.cfg)},_defDestroyFn:function(e){this._baseDestroy(e.cfg)}},e.mix(l,f,!1,null,1),e.mix(l,u,!1,null,1),l.prototype.constructor=l,e.Base=l},"3.7.1",{requires:["base-core","attribute-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('base-base', function(Y) {+YUI.add('base-base', function (Y, NAME) { /** * The base module provides the Base class, which objects requiring attribute and custom event support can extend. @@ -54,12 +54,12 @@ * A base class which objects requiring attributes and custom event support can * extend. Base also handles the chaining of initializer and destructor methods across * the hierarchy as part of object construction and destruction. Additionally, attributes configured - * through the static <a href="#property_Base.ATTRS">ATTRS</a> property for each class + * through the static <a href="#property_ATTRS">ATTRS</a> property for each class * in the hierarchy will be initialized by Base. * </p> * * <p>- * The static <a href="#property_Base.NAME">NAME</a> property of each class extending + * The static <a href="#property_NAME">NAME</a> property of each class extending * from Base will be used as the identifier for the class, and is used by Base to prefix * all events fired by instances of that class. * </p>@@ -349,4 +349,4 @@ Y.Base = Base; -}, '3.5.1' ,{requires:['base-core', 'attribute-base']});+}, '3.7.1', {"requires": ["base-core", "attribute-base"]});
@@ -0,0 +1,597 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/base-build/base-build.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/base-build/base-build.js",+ code: []+};+_yuitest_coverage["build/base-build/base-build.js"].code=["YUI.add('base-build', function (Y, NAME) {",""," /**"," * The base-build submodule provides Base.build functionality, which"," * can be used to create custom classes, by aggregating extensions onto "," * a main class."," *"," * @module base"," * @submodule base-build"," * @for Base"," */"," var Base = Y.Base,"," L = Y.Lang,"," INITIALIZER = \"initializer\","," DESTRUCTOR = \"destructor\","," build,"," arrayAggregator = function (prop, r, s) {"," if (s[prop]) {"," r[prop] = (r[prop] || []).concat(s[prop]);"," } "," };",""," Base._build = function(name, main, extensions, px, sx, cfg) {",""," var build = Base._build,",""," builtClass = build._ctor(main, cfg),"," buildCfg = build._cfg(main, cfg, extensions),",""," _mixCust = build._mixCust,",""," dynamic = builtClass._yuibuild.dynamic,",""," i, l, extClass, extProto,"," initializer,"," destructor;",""," // Augment/Aggregate"," for (i = 0, l = extensions.length; i < l; i++) {"," extClass = extensions[i];",""," extProto = extClass.prototype;"," "," initializer = extProto[INITIALIZER];"," destructor = extProto[DESTRUCTOR];"," delete extProto[INITIALIZER];"," delete extProto[DESTRUCTOR];",""," // Prototype, old non-displacing augment"," Y.mix(builtClass, extClass, true, null, 1);",""," // Custom Statics"," _mixCust(builtClass, extClass, buildCfg);",""," if (initializer) { "," extProto[INITIALIZER] = initializer;"," }",""," if (destructor) {"," extProto[DESTRUCTOR] = destructor;"," }",""," builtClass._yuibuild.exts.push(extClass);"," }",""," if (px) {"," Y.mix(builtClass.prototype, px, true);"," }",""," if (sx) {"," Y.mix(builtClass, build._clean(sx, buildCfg), true);"," _mixCust(builtClass, sx, buildCfg);"," }",""," builtClass.prototype.hasImpl = build._impl;",""," if (dynamic) {"," builtClass.NAME = name;"," builtClass.prototype.constructor = builtClass;"," }",""," return builtClass;"," };",""," build = Base._build;",""," Y.mix(build, {",""," _mixCust: function(r, s, cfg) {"," "," var aggregates, "," custom, "," statics,"," aggr,"," l,"," i;"," "," if (cfg) {"," aggregates = cfg.aggregates;"," custom = cfg.custom;"," statics = cfg.statics;"," }",""," if (statics) {"," Y.mix(r, s, true, statics);"," }",""," if (aggregates) {"," for (i = 0, l = aggregates.length; i < l; i++) {"," aggr = aggregates[i];"," if (!r.hasOwnProperty(aggr) && s.hasOwnProperty(aggr)) {"," r[aggr] = L.isArray(s[aggr]) ? [] : {};"," }"," Y.aggregate(r, s, true, [aggr]);"," }"," }",""," if (custom) {"," for (i in custom) {"," if (custom.hasOwnProperty(i)) {"," custom[i](i, r, s);"," }"," }"," }"," "," },",""," _tmpl: function(main) {",""," function BuiltClass() {"," BuiltClass.superclass.constructor.apply(this, arguments);"," }"," Y.extend(BuiltClass, main);",""," return BuiltClass;"," },",""," _impl : function(extClass) {"," var classes = this._getClasses(), i, l, cls, exts, ll, j;"," for (i = 0, l = classes.length; i < l; i++) {"," cls = classes[i];"," if (cls._yuibuild) {"," exts = cls._yuibuild.exts;"," ll = exts.length;"," "," for (j = 0; j < ll; j++) {"," if (exts[j] === extClass) {"," return true;"," }"," }"," }"," }"," return false;"," },",""," _ctor : function(main, cfg) {",""," var dynamic = (cfg && false === cfg.dynamic) ? false : true,"," builtClass = (dynamic) ? build._tmpl(main) : main,"," buildCfg = builtClass._yuibuild;",""," if (!buildCfg) {"," buildCfg = builtClass._yuibuild = {};"," }",""," buildCfg.id = buildCfg.id || null;"," buildCfg.exts = buildCfg.exts || [];"," buildCfg.dynamic = dynamic;",""," return builtClass;"," },",""," _cfg : function(main, cfg, exts) {"," var aggr = [], "," cust = {},"," statics = [],"," buildCfg,"," cfgAggr = (cfg && cfg.aggregates),"," cfgCustBuild = (cfg && cfg.custom),"," cfgStatics = (cfg && cfg.statics),"," c = main,"," i, "," l;",""," // Prototype Chain"," while (c && c.prototype) {"," buildCfg = c._buildCfg;"," if (buildCfg) {"," if (buildCfg.aggregates) {"," aggr = aggr.concat(buildCfg.aggregates);"," }"," if (buildCfg.custom) {"," Y.mix(cust, buildCfg.custom, true);"," }"," if (buildCfg.statics) {"," statics = statics.concat(buildCfg.statics);"," }"," }"," c = c.superclass ? c.superclass.constructor : null;"," }",""," // Exts"," if (exts) {"," for (i = 0, l = exts.length; i < l; i++) {"," c = exts[i];"," buildCfg = c._buildCfg;"," if (buildCfg) {"," if (buildCfg.aggregates) {"," aggr = aggr.concat(buildCfg.aggregates);"," }"," if (buildCfg.custom) {"," Y.mix(cust, buildCfg.custom, true);"," }"," if (buildCfg.statics) {"," statics = statics.concat(buildCfg.statics);"," }"," } "," }"," }",""," if (cfgAggr) {"," aggr = aggr.concat(cfgAggr);"," }",""," if (cfgCustBuild) {"," Y.mix(cust, cfg.cfgBuild, true);"," }",""," if (cfgStatics) {"," statics = statics.concat(cfgStatics);"," }",""," return {"," aggregates: aggr,"," custom: cust,"," statics: statics"," };"," },",""," _clean : function(sx, cfg) {"," var prop, i, l, sxclone = Y.merge(sx),"," aggregates = cfg.aggregates,"," custom = cfg.custom;",""," for (prop in custom) {"," if (sxclone.hasOwnProperty(prop)) {"," delete sxclone[prop];"," }"," }",""," for (i = 0, l = aggregates.length; i < l; i++) {"," prop = aggregates[i];"," if (sxclone.hasOwnProperty(prop)) {"," delete sxclone[prop];"," }"," }",""," return sxclone;"," }"," });",""," /**"," * <p>"," * Builds a custom constructor function (class) from the"," * main function, and array of extension functions (classes)"," * provided. The NAME field for the constructor function is "," * defined by the first argument passed in."," * </p>"," * <p>"," * The cfg object supports the following properties"," * </p>"," * <dl>"," * <dt>dynamic <boolean></dt>"," * <dd>"," * <p>If true (default), a completely new class"," * is created which extends the main class, and acts as the "," * host on which the extension classes are augmented.</p>"," * <p>If false, the extensions classes are augmented directly to"," * the main class, modifying the main class' prototype.</p>"," * </dd>"," * <dt>aggregates <String[]></dt>"," * <dd>An array of static property names, which will get aggregated"," * on to the built class, in addition to the default properties build "," * will always aggregate as defined by the main class' static _buildCfg"," * property."," * </dd>"," * </dl>"," *"," * @method build"," * @deprecated Use the more convenient Base.create and Base.mix methods instead"," * @static"," * @param {Function} name The name of the new class. Used to define the NAME property for the new class."," * @param {Function} main The main class on which to base the built class"," * @param {Function[]} extensions The set of extension classes which will be"," * augmented/aggregated to the built class."," * @param {Object} cfg Optional. Build configuration for the class (see description)."," * @return {Function} A custom class, created from the provided main and extension classes"," */"," Base.build = function(name, main, extensions, cfg) {"," return build(name, main, extensions, null, null, cfg);"," };",""," /**"," * Creates a new class (constructor function) which extends the base class passed in as the second argument, "," * and mixes in the array of extensions provided."," * "," * Prototype properties or methods can be added to the new class, using the px argument (similar to Y.extend)."," * "," * Static properties or methods can be added to the new class, using the sx argument (similar to Y.extend)."," * "," * **NOTE FOR COMPONENT DEVELOPERS**: Both the `base` class, and `extensions` can define static a `_buildCfg` "," * property, which acts as class creation meta-data, and drives how special static properties from the base "," * class, or extensions should be copied, aggregated or (custom) mixed into the newly created class."," * "," * The `_buildCfg` property is a hash with 3 supported properties: `statics`, `aggregates` and `custom`, e.g:"," * "," * // If the Base/Main class is the thing introducing the property:"," * "," * MyBaseClass._buildCfg = {"," * "," * // Static properties/methods to copy (Alias) to the built class."," * statics: [\"CopyThisMethod\", \"CopyThisProperty\"],"," * "," * // Static props to aggregate onto the built class."," * aggregates: [\"AggregateThisProperty\"],"," * "," * // Static properties which need custom handling (e.g. deep merge etc.)"," * custom: {"," * \"CustomProperty\" : function(property, Receiver, Supplier) {"," * ..."," * var triggers = Receiver.CustomProperty.triggers; "," Receiver.CustomProperty.triggers = triggers.concat(Supplier.CustomProperty.triggers);"," * ..."," * }"," * }"," * };"," * "," * MyBaseClass.CopyThisMethod = function() {...}; "," * MyBaseClass.CopyThisProperty = \"foo\";"," * MyBaseClass.AggregateThisProperty = {...};"," * MyBaseClass.CustomProperty = {"," * triggers: [...]"," * }"," *"," * // Or, if the Extension is the thing introducing the property:"," * "," * MyExtension._buildCfg = {"," * statics : ..."," * aggregates : ..."," * custom : ... "," * } "," * "," * This way, when users pass your base or extension class to `Y.Base.create` or `Y.Base.mix`, they don't need to"," * know which properties need special handling. `Y.Base` has a buildCfg which defines `ATTRS` for custom mix handling"," * (to protect the static config objects), and `Y.Widget` has a buildCfg which specifies `HTML_PARSER` for "," * straight up aggregation."," *"," * @method create"," * @static"," * @param {Function} name The name of the newly created class. Used to define the NAME property for the new class."," * @param {Function} main The base class which the new class should extend. This class needs to be Base or a class derived from base (e.g. Widget)."," * @param {Function[]} extensions The list of extensions which will be mixed into the built class."," * @param {Object} px The set of prototype properties/methods to add to the built class."," * @param {Object} sx The set of static properties/methods to add to the built class."," * @return {Function} The newly created class."," */"," Base.create = function(name, base, extensions, px, sx) {"," return build(name, base, extensions, px, sx);"," };",""," /**"," * <p>Mixes in a list of extensions to an existing class.</p>"," * @method mix"," * @static"," * @param {Function} main The existing class into which the extensions should be mixed. The class needs to be Base or a class derived from Base (e.g. Widget)"," * @param {Function[]} extensions The set of extension classes which will mixed into the existing main class."," * @return {Function} The modified main class, with extensions mixed in."," */"," Base.mix = function(main, extensions) {"," return build(null, main, extensions, null, null, {dynamic:false});"," };",""," /**"," * The build configuration for the Base class."," *"," * Defines the static fields which need to be aggregated"," * when the Base class is used as the main class passed to"," * the <a href=\"#method_Base.build\">Base.build</a> method."," *"," * @property _buildCfg"," * @type Object"," * @static"," * @final"," * @private"," */"," Base._buildCfg = {"," custom : {"," ATTRS : function(prop, r, s) {",""," r.ATTRS = r.ATTRS || {};",""," if (s.ATTRS) {",""," var sAttrs = s.ATTRS,"," rAttrs = r.ATTRS,"," a;",""," for (a in sAttrs) {"," if (sAttrs.hasOwnProperty(a)) {"," rAttrs[a] = rAttrs[a] || {};"," Y.mix(rAttrs[a], sAttrs[a], true);"," }"," }"," }"," },"," _NON_ATTRS_CFG : arrayAggregator"," },"," aggregates : [\"_PLUG\", \"_UNPLUG\"]"," };","","","}, '3.7.1', {\"requires\": [\"base-base\"]});"];+_yuitest_coverage["build/base-build/base-build.js"].lines = {"1":0,"12":0,"18":0,"19":0,"23":0,"25":0,"39":0,"40":0,"42":0,"44":0,"45":0,"46":0,"47":0,"50":0,"53":0,"55":0,"56":0,"59":0,"60":0,"63":0,"66":0,"67":0,"70":0,"71":0,"72":0,"75":0,"77":0,"78":0,"79":0,"82":0,"85":0,"87":0,"91":0,"98":0,"99":0,"100":0,"101":0,"104":0,"105":0,"108":0,"109":0,"110":0,"111":0,"112":0,"114":0,"118":0,"119":0,"120":0,"121":0,"130":0,"131":0,"133":0,"135":0,"139":0,"140":0,"141":0,"142":0,"143":0,"144":0,"146":0,"147":0,"148":0,"153":0,"158":0,"162":0,"163":0,"166":0,"167":0,"168":0,"170":0,"174":0,"186":0,"187":0,"188":0,"189":0,"190":0,"192":0,"193":0,"195":0,"196":0,"199":0,"203":0,"204":0,"205":0,"206":0,"207":0,"208":0,"209":0,"211":0,"212":0,"214":0,"215":0,"221":0,"222":0,"225":0,"226":0,"229":0,"230":0,"233":0,"241":0,"245":0,"246":0,"247":0,"251":0,"252":0,"253":0,"254":0,"258":0,"299":0,"300":0,"367":0,"368":0,"379":0,"380":0,"396":0,"400":0,"402":0,"404":0,"408":0,"409":0,"410":0,"411":0};+_yuitest_coverage["build/base-build/base-build.js"].functions = {"arrayAggregator:17":0,"_build:23":0,"_mixCust:89":0,"BuiltClass:130":0,"_tmpl:128":0,"_impl:138":0,"_ctor:156":0,"_cfg:173":0,"_clean:240":0,"build:299":0,"create:367":0,"mix:379":0,"ATTRS:398":0,"(anonymous 1):1":0};+_yuitest_coverage["build/base-build/base-build.js"].coveredLines = 122;+_yuitest_coverage["build/base-build/base-build.js"].coveredFunctions = 14;+_yuitest_coverline("build/base-build/base-build.js", 1);+YUI.add('base-build', function (Y, NAME) {++ /**+ * The base-build submodule provides Base.build functionality, which+ * can be used to create custom classes, by aggregating extensions onto + * a main class.+ *+ * @module base+ * @submodule base-build+ * @for Base+ */+ _yuitest_coverfunc("build/base-build/base-build.js", "(anonymous 1)", 1);+_yuitest_coverline("build/base-build/base-build.js", 12);+var Base = Y.Base,+ L = Y.Lang,+ INITIALIZER = "initializer",+ DESTRUCTOR = "destructor",+ build,+ arrayAggregator = function (prop, r, s) {+ _yuitest_coverfunc("build/base-build/base-build.js", "arrayAggregator", 17);+_yuitest_coverline("build/base-build/base-build.js", 18);+if (s[prop]) {+ _yuitest_coverline("build/base-build/base-build.js", 19);+r[prop] = (r[prop] || []).concat(s[prop]);+ } + };++ _yuitest_coverline("build/base-build/base-build.js", 23);+Base._build = function(name, main, extensions, px, sx, cfg) {++ _yuitest_coverfunc("build/base-build/base-build.js", "_build", 23);+_yuitest_coverline("build/base-build/base-build.js", 25);+var build = Base._build,++ builtClass = build._ctor(main, cfg),+ buildCfg = build._cfg(main, cfg, extensions),++ _mixCust = build._mixCust,++ dynamic = builtClass._yuibuild.dynamic,++ i, l, extClass, extProto,+ initializer,+ destructor;++ // Augment/Aggregate+ _yuitest_coverline("build/base-build/base-build.js", 39);+for (i = 0, l = extensions.length; i < l; i++) {+ _yuitest_coverline("build/base-build/base-build.js", 40);+extClass = extensions[i];++ _yuitest_coverline("build/base-build/base-build.js", 42);+extProto = extClass.prototype;+ + _yuitest_coverline("build/base-build/base-build.js", 44);+initializer = extProto[INITIALIZER];+ _yuitest_coverline("build/base-build/base-build.js", 45);+destructor = extProto[DESTRUCTOR];+ _yuitest_coverline("build/base-build/base-build.js", 46);+delete extProto[INITIALIZER];+ _yuitest_coverline("build/base-build/base-build.js", 47);+delete extProto[DESTRUCTOR];++ // Prototype, old non-displacing augment+ _yuitest_coverline("build/base-build/base-build.js", 50);+Y.mix(builtClass, extClass, true, null, 1);++ // Custom Statics+ _yuitest_coverline("build/base-build/base-build.js", 53);+_mixCust(builtClass, extClass, buildCfg);++ _yuitest_coverline("build/base-build/base-build.js", 55);+if (initializer) { + _yuitest_coverline("build/base-build/base-build.js", 56);+extProto[INITIALIZER] = initializer;+ }++ _yuitest_coverline("build/base-build/base-build.js", 59);+if (destructor) {+ _yuitest_coverline("build/base-build/base-build.js", 60);+extProto[DESTRUCTOR] = destructor;+ }++ _yuitest_coverline("build/base-build/base-build.js", 63);+builtClass._yuibuild.exts.push(extClass);+ }++ _yuitest_coverline("build/base-build/base-build.js", 66);+if (px) {+ _yuitest_coverline("build/base-build/base-build.js", 67);+Y.mix(builtClass.prototype, px, true);+ }++ _yuitest_coverline("build/base-build/base-build.js", 70);+if (sx) {+ _yuitest_coverline("build/base-build/base-build.js", 71);+Y.mix(builtClass, build._clean(sx, buildCfg), true);+ _yuitest_coverline("build/base-build/base-build.js", 72);+_mixCust(builtClass, sx, buildCfg);+ }++ _yuitest_coverline("build/base-build/base-build.js", 75);+builtClass.prototype.hasImpl = build._impl;++ _yuitest_coverline("build/base-build/base-build.js", 77);+if (dynamic) {+ _yuitest_coverline("build/base-build/base-build.js", 78);+builtClass.NAME = name;+ _yuitest_coverline("build/base-build/base-build.js", 79);+builtClass.prototype.constructor = builtClass;+ }++ _yuitest_coverline("build/base-build/base-build.js", 82);+return builtClass;+ };++ _yuitest_coverline("build/base-build/base-build.js", 85);+build = Base._build;++ _yuitest_coverline("build/base-build/base-build.js", 87);+Y.mix(build, {++ _mixCust: function(r, s, cfg) {+ + _yuitest_coverfunc("build/base-build/base-build.js", "_mixCust", 89);+_yuitest_coverline("build/base-build/base-build.js", 91);+var aggregates, + custom, + statics,+ aggr,+ l,+ i;+ + _yuitest_coverline("build/base-build/base-build.js", 98);+if (cfg) {+ _yuitest_coverline("build/base-build/base-build.js", 99);+aggregates = cfg.aggregates;+ _yuitest_coverline("build/base-build/base-build.js", 100);+custom = cfg.custom;+ _yuitest_coverline("build/base-build/base-build.js", 101);+statics = cfg.statics;+ }++ _yuitest_coverline("build/base-build/base-build.js", 104);+if (statics) {+ _yuitest_coverline("build/base-build/base-build.js", 105);+Y.mix(r, s, true, statics);+ }++ _yuitest_coverline("build/base-build/base-build.js", 108);+if (aggregates) {+ _yuitest_coverline("build/base-build/base-build.js", 109);+for (i = 0, l = aggregates.length; i < l; i++) {+ _yuitest_coverline("build/base-build/base-build.js", 110);+aggr = aggregates[i];+ _yuitest_coverline("build/base-build/base-build.js", 111);+if (!r.hasOwnProperty(aggr) && s.hasOwnProperty(aggr)) {+ _yuitest_coverline("build/base-build/base-build.js", 112);+r[aggr] = L.isArray(s[aggr]) ? [] : {};+ }+ _yuitest_coverline("build/base-build/base-build.js", 114);+Y.aggregate(r, s, true, [aggr]);+ }+ }++ _yuitest_coverline("build/base-build/base-build.js", 118);+if (custom) {+ _yuitest_coverline("build/base-build/base-build.js", 119);+for (i in custom) {+ _yuitest_coverline("build/base-build/base-build.js", 120);+if (custom.hasOwnProperty(i)) {+ _yuitest_coverline("build/base-build/base-build.js", 121);+custom[i](i, r, s);+ }+ }+ }+ + },++ _tmpl: function(main) {++ _yuitest_coverfunc("build/base-build/base-build.js", "_tmpl", 128);+_yuitest_coverline("build/base-build/base-build.js", 130);+function BuiltClass() {+ _yuitest_coverfunc("build/base-build/base-build.js", "BuiltClass", 130);+_yuitest_coverline("build/base-build/base-build.js", 131);+BuiltClass.superclass.constructor.apply(this, arguments);+ }+ _yuitest_coverline("build/base-build/base-build.js", 133);+Y.extend(BuiltClass, main);++ _yuitest_coverline("build/base-build/base-build.js", 135);+return BuiltClass;+ },++ _impl : function(extClass) {+ _yuitest_coverfunc("build/base-build/base-build.js", "_impl", 138);+_yuitest_coverline("build/base-build/base-build.js", 139);+var classes = this._getClasses(), i, l, cls, exts, ll, j;+ _yuitest_coverline("build/base-build/base-build.js", 140);+for (i = 0, l = classes.length; i < l; i++) {+ _yuitest_coverline("build/base-build/base-build.js", 141);+cls = classes[i];+ _yuitest_coverline("build/base-build/base-build.js", 142);+if (cls._yuibuild) {+ _yuitest_coverline("build/base-build/base-build.js", 143);+exts = cls._yuibuild.exts;+ _yuitest_coverline("build/base-build/base-build.js", 144);+ll = exts.length;+ + _yuitest_coverline("build/base-build/base-build.js", 146);+for (j = 0; j < ll; j++) {+ _yuitest_coverline("build/base-build/base-build.js", 147);+if (exts[j] === extClass) {+ _yuitest_coverline("build/base-build/base-build.js", 148);+return true;+ }+ }+ }+ }+ _yuitest_coverline("build/base-build/base-build.js", 153);+return false;+ },++ _ctor : function(main, cfg) {++ _yuitest_coverfunc("build/base-build/base-build.js", "_ctor", 156);+_yuitest_coverline("build/base-build/base-build.js", 158);+var dynamic = (cfg && false === cfg.dynamic) ? false : true,+ builtClass = (dynamic) ? build._tmpl(main) : main,+ buildCfg = builtClass._yuibuild;++ _yuitest_coverline("build/base-build/base-build.js", 162);+if (!buildCfg) {+ _yuitest_coverline("build/base-build/base-build.js", 163);+buildCfg = builtClass._yuibuild = {};+ }++ _yuitest_coverline("build/base-build/base-build.js", 166);+buildCfg.id = buildCfg.id || null;+ _yuitest_coverline("build/base-build/base-build.js", 167);+buildCfg.exts = buildCfg.exts || [];+ _yuitest_coverline("build/base-build/base-build.js", 168);+buildCfg.dynamic = dynamic;++ _yuitest_coverline("build/base-build/base-build.js", 170);+return builtClass;+ },++ _cfg : function(main, cfg, exts) {+ _yuitest_coverfunc("build/base-build/base-build.js", "_cfg", 173);+_yuitest_coverline("build/base-build/base-build.js", 174);+var aggr = [], + cust = {},+ statics = [],+ buildCfg,+ cfgAggr = (cfg && cfg.aggregates),+ cfgCustBuild = (cfg && cfg.custom),+ cfgStatics = (cfg && cfg.statics),+ c = main,+ i, + l;++ // Prototype Chain+ _yuitest_coverline("build/base-build/base-build.js", 186);+while (c && c.prototype) {+ _yuitest_coverline("build/base-build/base-build.js", 187);+buildCfg = c._buildCfg;+ _yuitest_coverline("build/base-build/base-build.js", 188);+if (buildCfg) {+ _yuitest_coverline("build/base-build/base-build.js", 189);+if (buildCfg.aggregates) {+ _yuitest_coverline("build/base-build/base-build.js", 190);+aggr = aggr.concat(buildCfg.aggregates);+ }+ _yuitest_coverline("build/base-build/base-build.js", 192);+if (buildCfg.custom) {+ _yuitest_coverline("build/base-build/base-build.js", 193);+Y.mix(cust, buildCfg.custom, true);+ }+ _yuitest_coverline("build/base-build/base-build.js", 195);+if (buildCfg.statics) {+ _yuitest_coverline("build/base-build/base-build.js", 196);+statics = statics.concat(buildCfg.statics);+ }+ }+ _yuitest_coverline("build/base-build/base-build.js", 199);+c = c.superclass ? c.superclass.constructor : null;+ }++ // Exts+ _yuitest_coverline("build/base-build/base-build.js", 203);+if (exts) {+ _yuitest_coverline("build/base-build/base-build.js", 204);+for (i = 0, l = exts.length; i < l; i++) {+ _yuitest_coverline("build/base-build/base-build.js", 205);+c = exts[i];+ _yuitest_coverline("build/base-build/base-build.js", 206);+buildCfg = c._buildCfg;+ _yuitest_coverline("build/base-build/base-build.js", 207);+if (buildCfg) {+ _yuitest_coverline("build/base-build/base-build.js", 208);+if (buildCfg.aggregates) {+ _yuitest_coverline("build/base-build/base-build.js", 209);+aggr = aggr.concat(buildCfg.aggregates);+ }+ _yuitest_coverline("build/base-build/base-build.js", 211);+if (buildCfg.custom) {+ _yuitest_coverline("build/base-build/base-build.js", 212);+Y.mix(cust, buildCfg.custom, true);+ }+ _yuitest_coverline("build/base-build/base-build.js", 214);+if (buildCfg.statics) {+ _yuitest_coverline("build/base-build/base-build.js", 215);+statics = statics.concat(buildCfg.statics);+ }+ } + }+ }++ _yuitest_coverline("build/base-build/base-build.js", 221);+if (cfgAggr) {+ _yuitest_coverline("build/base-build/base-build.js", 222);+aggr = aggr.concat(cfgAggr);+ }++ _yuitest_coverline("build/base-build/base-build.js", 225);+if (cfgCustBuild) {+ _yuitest_coverline("build/base-build/base-build.js", 226);+Y.mix(cust, cfg.cfgBuild, true);+ }++ _yuitest_coverline("build/base-build/base-build.js", 229);+if (cfgStatics) {+ _yuitest_coverline("build/base-build/base-build.js", 230);+statics = statics.concat(cfgStatics);+ }++ _yuitest_coverline("build/base-build/base-build.js", 233);+return {+ aggregates: aggr,+ custom: cust,+ statics: statics+ };+ },++ _clean : function(sx, cfg) {+ _yuitest_coverfunc("build/base-build/base-build.js", "_clean", 240);+_yuitest_coverline("build/base-build/base-build.js", 241);+var prop, i, l, sxclone = Y.merge(sx),+ aggregates = cfg.aggregates,+ custom = cfg.custom;++ _yuitest_coverline("build/base-build/base-build.js", 245);+for (prop in custom) {+ _yuitest_coverline("build/base-build/base-build.js", 246);+if (sxclone.hasOwnProperty(prop)) {+ _yuitest_coverline("build/base-build/base-build.js", 247);+delete sxclone[prop];+ }+ }++ _yuitest_coverline("build/base-build/base-build.js", 251);+for (i = 0, l = aggregates.length; i < l; i++) {+ _yuitest_coverline("build/base-build/base-build.js", 252);+prop = aggregates[i];+ _yuitest_coverline("build/base-build/base-build.js", 253);+if (sxclone.hasOwnProperty(prop)) {+ _yuitest_coverline("build/base-build/base-build.js", 254);+delete sxclone[prop];+ }+ }++ _yuitest_coverline("build/base-build/base-build.js", 258);+return sxclone;+ }+ });++ /**+ * <p>+ * Builds a custom constructor function (class) from the+ * main function, and array of extension functions (classes)+ * provided. The NAME field for the constructor function is + * defined by the first argument passed in.+ * </p>+ * <p>+ * The cfg object supports the following properties+ * </p>+ * <dl>+ * <dt>dynamic <boolean></dt>+ * <dd>+ * <p>If true (default), a completely new class+ * is created which extends the main class, and acts as the + * host on which the extension classes are augmented.</p>+ * <p>If false, the extensions classes are augmented directly to+ * the main class, modifying the main class' prototype.</p>+ * </dd>+ * <dt>aggregates <String[]></dt>+ * <dd>An array of static property names, which will get aggregated+ * on to the built class, in addition to the default properties build + * will always aggregate as defined by the main class' static _buildCfg+ * property.+ * </dd>+ * </dl>+ *+ * @method build+ * @deprecated Use the more convenient Base.create and Base.mix methods instead+ * @static+ * @param {Function} name The name of the new class. Used to define the NAME property for the new class.+ * @param {Function} main The main class on which to base the built class+ * @param {Function[]} extensions The set of extension classes which will be+ * augmented/aggregated to the built class.+ * @param {Object} cfg Optional. Build configuration for the class (see description).+ * @return {Function} A custom class, created from the provided main and extension classes+ */+ _yuitest_coverline("build/base-build/base-build.js", 299);+Base.build = function(name, main, extensions, cfg) {+ _yuitest_coverfunc("build/base-build/base-build.js", "build", 299);+_yuitest_coverline("build/base-build/base-build.js", 300);+return build(name, main, extensions, null, null, cfg);+ };++ /**+ * Creates a new class (constructor function) which extends the base class passed in as the second argument, + * and mixes in the array of extensions provided.+ * + * Prototype properties or methods can be added to the new class, using the px argument (similar to Y.extend).+ * + * Static properties or methods can be added to the new class, using the sx argument (similar to Y.extend).+ * + * **NOTE FOR COMPONENT DEVELOPERS**: Both the `base` class, and `extensions` can define static a `_buildCfg` + * property, which acts as class creation meta-data, and drives how special static properties from the base + * class, or extensions should be copied, aggregated or (custom) mixed into the newly created class.+ * + * The `_buildCfg` property is a hash with 3 supported properties: `statics`, `aggregates` and `custom`, e.g:+ * + * // If the Base/Main class is the thing introducing the property:+ * + * MyBaseClass._buildCfg = {+ * + * // Static properties/methods to copy (Alias) to the built class.+ * statics: ["CopyThisMethod", "CopyThisProperty"],+ * + * // Static props to aggregate onto the built class.+ * aggregates: ["AggregateThisProperty"],+ * + * // Static properties which need custom handling (e.g. deep merge etc.)+ * custom: {+ * "CustomProperty" : function(property, Receiver, Supplier) {+ * ...+ * var triggers = Receiver.CustomProperty.triggers; + Receiver.CustomProperty.triggers = triggers.concat(Supplier.CustomProperty.triggers);+ * ...+ * }+ * }+ * };+ * + * MyBaseClass.CopyThisMethod = function() {...}; + * MyBaseClass.CopyThisProperty = "foo";+ * MyBaseClass.AggregateThisProperty = {...};+ * MyBaseClass.CustomProperty = {+ * triggers: [...]+ * }+ *+ * // Or, if the Extension is the thing introducing the property:+ * + * MyExtension._buildCfg = {+ * statics : ...+ * aggregates : ...+ * custom : ... + * } + * + * This way, when users pass your base or extension class to `Y.Base.create` or `Y.Base.mix`, they don't need to+ * know which properties need special handling. `Y.Base` has a buildCfg which defines `ATTRS` for custom mix handling+ * (to protect the static config objects), and `Y.Widget` has a buildCfg which specifies `HTML_PARSER` for + * straight up aggregation.+ *+ * @method create+ * @static+ * @param {Function} name The name of the newly created class. Used to define the NAME property for the new class.+ * @param {Function} main The base class which the new class should extend. This class needs to be Base or a class derived from base (e.g. Widget).+ * @param {Function[]} extensions The list of extensions which will be mixed into the built class.+ * @param {Object} px The set of prototype properties/methods to add to the built class.+ * @param {Object} sx The set of static properties/methods to add to the built class.+ * @return {Function} The newly created class.+ */+ _yuitest_coverline("build/base-build/base-build.js", 367);+Base.create = function(name, base, extensions, px, sx) {+ _yuitest_coverfunc("build/base-build/base-build.js", "create", 367);+_yuitest_coverline("build/base-build/base-build.js", 368);+return build(name, base, extensions, px, sx);+ };++ /**+ * <p>Mixes in a list of extensions to an existing class.</p>+ * @method mix+ * @static+ * @param {Function} main The existing class into which the extensions should be mixed. The class needs to be Base or a class derived from Base (e.g. Widget)+ * @param {Function[]} extensions The set of extension classes which will mixed into the existing main class.+ * @return {Function} The modified main class, with extensions mixed in.+ */+ _yuitest_coverline("build/base-build/base-build.js", 379);+Base.mix = function(main, extensions) {+ _yuitest_coverfunc("build/base-build/base-build.js", "mix", 379);+_yuitest_coverline("build/base-build/base-build.js", 380);+return build(null, main, extensions, null, null, {dynamic:false});+ };++ /**+ * The build configuration for the Base class.+ *+ * Defines the static fields which need to be aggregated+ * when the Base class is used as the main class passed to+ * the <a href="#method_Base.build">Base.build</a> method.+ *+ * @property _buildCfg+ * @type Object+ * @static+ * @final+ * @private+ */+ _yuitest_coverline("build/base-build/base-build.js", 396);+Base._buildCfg = {+ custom : {+ ATTRS : function(prop, r, s) {++ _yuitest_coverfunc("build/base-build/base-build.js", "ATTRS", 398);+_yuitest_coverline("build/base-build/base-build.js", 400);+r.ATTRS = r.ATTRS || {};++ _yuitest_coverline("build/base-build/base-build.js", 402);+if (s.ATTRS) {++ _yuitest_coverline("build/base-build/base-build.js", 404);+var sAttrs = s.ATTRS,+ rAttrs = r.ATTRS,+ a;++ _yuitest_coverline("build/base-build/base-build.js", 408);+for (a in sAttrs) {+ _yuitest_coverline("build/base-build/base-build.js", 409);+if (sAttrs.hasOwnProperty(a)) {+ _yuitest_coverline("build/base-build/base-build.js", 410);+rAttrs[a] = rAttrs[a] || {};+ _yuitest_coverline("build/base-build/base-build.js", 411);+Y.mix(rAttrs[a], sAttrs[a], true);+ }+ }+ }+ },+ _NON_ATTRS_CFG : arrayAggregator+ },+ aggregates : ["_PLUG", "_UNPLUG"]+ };+++}, '3.7.1', {"requires": ["base-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('base-build', function(Y) {+YUI.add('base-build', function (Y, NAME) { /** * The base-build submodule provides Base.build functionality, which@@ -295,7 +295,7 @@ * @method build * @deprecated Use the more convenient Base.create and Base.mix methods instead * @static- * @param {Function} name The name of the new class. Used to defined the NAME property for the new class.+ * @param {Function} name The name of the new class. Used to define the NAME property for the new class. * @param {Function} main The main class on which to base the built class * @param {Function[]} extensions The set of extension classes which will be * augmented/aggregated to the built class.@@ -363,7 +363,7 @@ * * @method create * @static- * @param {Function} name The name of the newly created class. Used to defined the NAME property for the new class.+ * @param {Function} name The name of the newly created class. Used to define the NAME property for the new class. * @param {Function} main The base class which the new class should extend. This class needs to be Base or a class derived from base (e.g. Widget). * @param {Function[]} extensions The list of extensions which will be mixed into the built class. * @param {Object} px The set of prototype properties/methods to add to the built class.@@ -425,4 +425,4 @@ }; -}, '3.5.1' ,{requires:['base-base']});+}, '3.7.1', {"requires": ["base-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("base-build",function(g){var c=g.Base,a=g.Lang,b="initializer",e="destructor",f,d=function(j,i,h){if(h[j]){i[j]=(i[j]||[]).concat(h[j]);}};c._build=function(h,o,t,x,w,q){var y=c._build,j=y._ctor(o,q),m=y._cfg(o,q,t),v=y._mixCust,k=j._yuibuild.dynamic,p,n,u,z,s,r;for(p=0,n=t.length;p<n;p++){u=t[p];z=u.prototype;s=z[b];r=z[e];delete z[b];delete z[e];g.mix(j,u,true,null,1);v(j,u,m);if(s){z[b]=s;}if(r){z[e]=r;}j._yuibuild.exts.push(u);}if(x){g.mix(j.prototype,x,true);}if(w){g.mix(j,y._clean(w,m),true);v(j,w,m);}j.prototype.hasImpl=y._impl;if(k){j.NAME=h;j.prototype.constructor=j;}return j;};f=c._build;g.mix(f,{_mixCust:function(h,t,p){var o,j,q,k,m,n;if(p){o=p.aggregates;j=p.custom;q=p.statics;}if(q){g.mix(h,t,true,q);}if(o){for(n=0,m=o.length;n<m;n++){k=o[n];if(!h.hasOwnProperty(k)&&t.hasOwnProperty(k)){h[k]=a.isArray(t[k])?[]:{};}g.aggregate(h,t,true,[k]);}}if(j){for(n in j){if(j.hasOwnProperty(n)){j[n](n,h,t);}}}},_tmpl:function(h){function i(){i.superclass.constructor.apply(this,arguments);}g.extend(i,h);return i;},_impl:function(n){var q=this._getClasses(),p,k,h,o,r,m;for(p=0,k=q.length;p<k;p++){h=q[p];if(h._yuibuild){o=h._yuibuild.exts;r=o.length;for(m=0;m<r;m++){if(o[m]===n){return true;}}}}return false;},_ctor:function(h,i){var k=(i&&false===i.dynamic)?false:true,l=(k)?f._tmpl(h):h,j=l._yuibuild;if(!j){j=l._yuibuild={};}j.id=j.id||null;j.exts=j.exts||[];j.dynamic=k;return l;},_cfg:function(m,q,n){var k=[],p={},v=[],h,t=(q&&q.aggregates),u=(q&&q.custom),r=(q&&q.statics),s=m,o,j;while(s&&s.prototype){h=s._buildCfg;if(h){if(h.aggregates){k=k.concat(h.aggregates);}if(h.custom){g.mix(p,h.custom,true);}if(h.statics){v=v.concat(h.statics);}}s=s.superclass?s.superclass.constructor:null;}if(n){for(o=0,j=n.length;o<j;o++){s=n[o];h=s._buildCfg;if(h){if(h.aggregates){k=k.concat(h.aggregates);}if(h.custom){g.mix(p,h.custom,true);}if(h.statics){v=v.concat(h.statics);}}}}if(t){k=k.concat(t);}if(u){g.mix(p,q.cfgBuild,true);}if(r){v=v.concat(r);}return{aggregates:k,custom:p,statics:v};},_clean:function(q,j){var p,k,h,n=g.merge(q),o=j.aggregates,m=j.custom;for(p in m){if(n.hasOwnProperty(p)){delete n[p];}}for(k=0,h=o.length;k<h;k++){p=o[k];if(n.hasOwnProperty(p)){delete n[p];}}return n;}});c.build=function(j,h,k,i){return f(j,h,k,null,null,i);};c.create=function(h,k,j,i,l){return f(h,k,j,i,l);};c.mix=function(h,i){return f(null,h,i,null,null,{dynamic:false});};c._buildCfg={custom:{ATTRS:function(m,k,i){k.ATTRS=k.ATTRS||{};if(i.ATTRS){var j=i.ATTRS,l=k.ATTRS,h;for(h in j){if(j.hasOwnProperty(h)){l[h]=l[h]||{};g.mix(l[h],j[h],true);}}}},_NON_ATTRS_CFG:d},aggregates:["_PLUG","_UNPLUG"]};},"3.5.1",{requires:["base-base"]});+YUI.add("base-build",function(e,t){var n=e.Base,r=e.Lang,i="initializer",s="destructor",o,u=function(e,t,n){n[e]&&(t[e]=(t[e]||[]).concat(n[e]))};n._build=function(t,r,o,u,a,f){var l=n._build,c=l._ctor(r,f),h=l._cfg(r,f,o),p=l._mixCust,d=c._yuibuild.dynamic,v,m,g,y,b,w;for(v=0,m=o.length;v<m;v++)g=o[v],y=g.prototype,b=y[i],w=y[s],delete y[i],delete y[s],e.mix(c,g,!0,null,1),p(c,g,h),b&&(y[i]=b),w&&(y[s]=w),c._yuibuild.exts.push(g);return u&&e.mix(c.prototype,u,!0),a&&(e.mix(c,l._clean(a,h),!0),p(c,a,h)),c.prototype.hasImpl=l._impl,d&&(c.NAME=t,c.prototype.constructor=c),c},o=n._build,e.mix(o,{_mixCust:function(t,n,i){var s,o,u,a,f,l;i&&(s=i.aggregates,o=i.custom,u=i.statics),u&&e.mix(t,n,!0,u);if(s)for(l=0,f=s.length;l<f;l++)a=s[l],!t.hasOwnProperty(a)&&n.hasOwnProperty(a)&&(t[a]=r.isArray(n[a])?[]:{}),e.aggregate(t,n,!0,[a]);if(o)for(l in o)o.hasOwnProperty(l)&&o[l](l,t,n)},_tmpl:function(t){function n(){n.superclass.constructor.apply(this,arguments)}return e.extend(n,t),n},_impl:function(e){var t=this._getClasses(),n,r,i,s,o,u;for(n=0,r=t.length;n<r;n++){i=t[n];if(i._yuibuild){s=i._yuibuild.exts,o=s.length;for(u=0;u<o;u++)if(s[u]===e)return!0}}return!1},_ctor:function(e,t){var n=t&&!1===t.dynamic?!1:!0,r=n?o._tmpl(e):e,i=r._yuibuild;return i||(i=r._yuibuild={}),i.id=i.id||null,i.exts=i.exts||[],i.dynamic=n,r},_cfg:function(t,n,r){var i=[],s={},o=[],u,a=n&&n.aggregates,f=n&&n.custom,l=n&&n.statics,c=t,h,p;while(c&&c.prototype)u=c._buildCfg,u&&(u.aggregates&&(i=i.concat(u.aggregates)),u.custom&&e.mix(s,u.custom,!0),u.statics&&(o=o.concat(u.statics))),c=c.superclass?c.superclass.constructor:null;if(r)for(h=0,p=r.length;h<p;h++)c=r[h],u=c._buildCfg,u&&(u.aggregates&&(i=i.concat(u.aggregates)),u.custom&&e.mix(s,u.custom,!0),u.statics&&(o=o.concat(u.statics)));return a&&(i=i.concat(a)),f&&e.mix(s,n.cfgBuild,!0),l&&(o=o.concat(l)),{aggregates:i,custom:s,statics:o}},_clean:function(t,n){var r,i,s,o=e.merge(t),u=n.aggregates,a=n.custom;for(r in a)o.hasOwnProperty(r)&&delete o[r];for(i=0,s=u.length;i<s;i++)r=u[i],o.hasOwnProperty(r)&&delete o[r];return o}}),n.build=function(e,t,n,r){return o(e,t,n,null,null,r)},n.create=function(e,t,n,r,i){return o(e,t,n,r,i)},n.mix=function(e,t){return o(null,e,t,null,null,{dynamic:!1})},n._buildCfg={custom:{ATTRS:function(t,n,r){n.ATTRS=n.ATTRS||{};if(r.ATTRS){var i=r.ATTRS,s=n.ATTRS,o;for(o in i)i.hasOwnProperty(o)&&(s[o]=s[o]||{},e.mix(s[o],i[o],!0))}},_NON_ATTRS_CFG:u},aggregates:["_PLUG","_UNPLUG"]}},"3.7.1",{requires:["base-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('base-build', function(Y) {+YUI.add('base-build', function (Y, NAME) { /** * The base-build submodule provides Base.build functionality, which@@ -295,7 +295,7 @@ * @method build * @deprecated Use the more convenient Base.create and Base.mix methods instead * @static- * @param {Function} name The name of the new class. Used to defined the NAME property for the new class.+ * @param {Function} name The name of the new class. Used to define the NAME property for the new class. * @param {Function} main The main class on which to base the built class * @param {Function[]} extensions The set of extension classes which will be * augmented/aggregated to the built class.@@ -363,7 +363,7 @@ * * @method create * @static- * @param {Function} name The name of the newly created class. Used to defined the NAME property for the new class.+ * @param {Function} name The name of the newly created class. Used to define the NAME property for the new class. * @param {Function} main The base class which the new class should extend. This class needs to be Base or a class derived from base (e.g. Widget). * @param {Function[]} extensions The list of extensions which will be mixed into the built class. * @param {Object} px The set of prototype properties/methods to add to the built class.@@ -425,4 +425,4 @@ }; -}, '3.5.1' ,{requires:['base-base']});+}, '3.7.1', {"requires": ["base-base"]});
@@ -0,0 +1,808 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/base-core/base-core.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/base-core/base-core.js",+ code: []+};+_yuitest_coverage["build/base-core/base-core.js"].code=["YUI.add('base-core', function (Y, NAME) {",""," /**"," * The base module provides the Base class, which objects requiring attribute and custom event support can extend. "," * The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides "," * plugin support and also provides the BaseCore.build method which provides a way to build custom classes using extensions."," *"," * @module base"," */",""," /**"," * <p>The base-core module provides the BaseCore class, the lightest version of Base, "," * which provides Base's basic lifecycle management and ATTRS construction support, "," * but doesn't fire init/destroy or attribute change events.</p> "," * "," * <p>It mixes in AttributeCore, which is the lightest version of Attribute</p>"," *"," * @module base"," * @submodule base-core"," */"," var O = Y.Object,"," L = Y.Lang,"," DOT = \".\","," INITIALIZED = \"initialized\","," DESTROYED = \"destroyed\","," INITIALIZER = \"initializer\","," VALUE = \"value\","," OBJECT_CONSTRUCTOR = Object.prototype.constructor,"," DEEP = \"deep\","," SHALLOW = \"shallow\","," DESTRUCTOR = \"destructor\",",""," AttributeCore = Y.AttributeCore,",""," _wlmix = function(r, s, wlhash) {"," var p;"," for (p in s) {"," if(wlhash[p]) { "," r[p] = s[p];"," }"," }"," return r;"," };",""," /**"," * The BaseCore class, is the lightest version of Base, and provides Base's "," * basic lifecycle management and ATTRS construction support, but doesn't "," * fire init/destroy or attribute change events."," *"," * BaseCore also handles the chaining of initializer and destructor methods across "," * the hierarchy as part of object construction and destruction. Additionally, attributes "," * configured through the static <a href=\"#property_BaseCore.ATTRS\">ATTRS</a> "," * property for each class in the hierarchy will be initialized by BaseCore."," *"," * Classes which require attribute support, but don't intend to use/expose attribute "," * change events can extend BaseCore instead of Base for optimal kweight and "," * runtime performance."," * "," * @class BaseCore"," * @constructor"," * @uses AttributeCore"," * @param {Object} cfg Object with configuration property name/value pairs. "," * The object can be used to provide initial values for the objects published "," * attributes."," */"," function BaseCore(cfg) {"," if (!this._BaseInvoked) {"," this._BaseInvoked = true;",""," this._initBase(cfg);"," }"," }",""," /**"," * The list of properties which can be configured for each attribute "," * (e.g. setter, getter, writeOnce, readOnly etc.)"," *"," * @property _ATTR_CFG"," * @type Array"," * @static"," * @private"," */"," BaseCore._ATTR_CFG = AttributeCore._ATTR_CFG.concat(\"cloneDefaultValue\");"," BaseCore._ATTR_CFG_HASH = Y.Array.hash(BaseCore._ATTR_CFG);",""," /**"," * The array of non-attribute configuration properties supported by this class. "," * "," * For example `BaseCore` defines a \"plugins\" configuration property which "," * should not be set up as an attribute. This property is primarily required so "," * that when <a href=\"#property__allowAdHocAttrs\">`_allowAdHocAttrs`</a> is enabled by a class, "," * non-attribute configuration properties don't get added as ad-hoc attributes. "," *"," * @property _NON_ATTRS_CFG"," * @type Array"," * @static"," * @private"," */"," BaseCore._NON_ATTRS_CFG = [\"plugins\"];",""," /**"," * This property controls whether or not instances of this class should"," * allow users to add ad-hoc attributes through the constructor configuration "," * hash."," *"," * AdHoc attributes are attributes which are not defined by the class, and are "," * not handled by the MyClass._NON_ATTRS_CFG "," * "," * @property _allowAdHocAttrs"," * @type boolean"," * @default undefined (false)"," * @protected"," */",""," /**"," * The string to be used to identify instances of this class."," * "," * Classes extending BaseCore, should define their own"," * static NAME property, which should be camelCase by"," * convention (e.g. MyClass.NAME = \"myClass\";)."," *"," * @property NAME"," * @type String"," * @static"," */"," BaseCore.NAME = \"baseCore\";",""," /**"," * The default set of attributes which will be available for instances of this class, and "," * their configuration. In addition to the configuration properties listed by "," * AttributeCore's <a href=\"AttributeCore.html#method_addAttr\">addAttr</a> method, "," * the attribute can also be configured with a \"cloneDefaultValue\" property, which "," * defines how the statically defined value field should be protected "," * (\"shallow\", \"deep\" and false are supported values). "," *"," * By default if the value is an object literal or an array it will be \"shallow\" "," * cloned, to protect the default value."," *"," * @property ATTRS"," * @type Object"," * @static"," */"," BaseCore.ATTRS = {"," /**"," * Flag indicating whether or not this object"," * has been through the init lifecycle phase."," *"," * @attribute initialized"," * @readonly"," * @default false"," * @type boolean"," */"," initialized: {"," readOnly:true,"," value:false"," },",""," /**"," * Flag indicating whether or not this object"," * has been through the destroy lifecycle phase."," *"," * @attribute destroyed"," * @readonly"," * @default false"," * @type boolean"," */"," destroyed: {"," readOnly:true,"," value:false"," }"," };",""," BaseCore.prototype = {",""," /**"," * Internal construction logic for BaseCore."," *"," * @method _initBase"," * @param {Object} config The constructor configuration object"," * @private"," */"," _initBase : function(config) {",""," Y.stamp(this);",""," this._initAttribute(config);",""," // If Plugin.Host has been augmented [ through base-pluginhost ], setup it's"," // initial state, but don't initialize Plugins yet. That's done after initialization."," var PluginHost = Y.Plugin && Y.Plugin.Host;"," if (this._initPlugins && PluginHost) {"," PluginHost.call(this);"," }",""," if (this._lazyAddAttrs !== false) { this._lazyAddAttrs = true; }",""," /**"," * The string used to identify the class of this object."," *"," * @deprecated Use this.constructor.NAME"," * @property name"," * @type String"," */"," this.name = this.constructor.NAME;"," "," this.init.apply(this, arguments);"," },",""," /**"," * Initializes AttributeCore "," * "," * @method _initAttribute"," * @private"," */"," _initAttribute: function() {"," AttributeCore.apply(this);"," },",""," /**"," * Init lifecycle method, invoked during construction. Sets up attributes "," * and invokes initializers for the class hierarchy."," *"," * @method init"," * @chainable"," * @param {Object} cfg Object with configuration property name/value pairs"," * @return {BaseCore} A reference to this object"," */"," init: function(cfg) {",""," this._baseInit(cfg);",""," return this;"," },",""," /**"," * Internal initialization implementation for BaseCore"," *"," * @method _baseInit"," * @private"," */"," _baseInit: function(cfg) {"," this._initHierarchy(cfg);",""," if (this._initPlugins) {"," // Need to initPlugins manually, to handle constructor parsing, static Plug parsing"," this._initPlugins(cfg);"," }"," this._set(INITIALIZED, true);"," },",""," /**"," * Destroy lifecycle method. Invokes destructors for the class hierarchy."," *"," * @method destroy"," * @return {BaseCore} A reference to this object"," * @chainable"," */"," destroy: function() {"," this._baseDestroy();"," return this;"," },",""," /**"," * Internal destroy implementation for BaseCore"," *"," * @method _baseDestroy"," * @private"," */"," _baseDestroy : function() {"," if (this._destroyPlugins) {"," this._destroyPlugins();"," }"," this._destroyHierarchy();"," this._set(DESTROYED, true);"," },",""," /**"," * Returns the class hierarchy for this object, with BaseCore being the last class in the array."," *"," * @method _getClasses"," * @protected"," * @return {Function[]} An array of classes (constructor functions), making up the class hierarchy for this object."," * This value is cached the first time the method, or _getAttrCfgs, is invoked. Subsequent invocations return the "," * cached value."," */"," _getClasses : function() {"," if (!this._classes) {"," this._initHierarchyData();"," }"," return this._classes;"," },",""," /**"," * Returns an aggregated set of attribute configurations, by traversing "," * the class hierarchy."," *"," * @method _getAttrCfgs"," * @protected"," * @return {Object} The hash of attribute configurations, aggregated across classes in the hierarchy"," * This value is cached the first time the method, or _getClasses, is invoked. Subsequent invocations return"," * the cached value."," */"," _getAttrCfgs : function() {"," if (!this._attrs) {"," this._initHierarchyData();"," }"," return this._attrs;"," },",""," /**"," * A helper method used when processing ATTRS across the class hierarchy during "," * initialization. Returns a disposable object with the attributes defined for "," * the provided class, extracted from the set of all attributes passed in."," *"," * @method _filterAttrCfs"," * @private"," *"," * @param {Function} clazz The class for which the desired attributes are required."," * @param {Object} allCfgs The set of all attribute configurations for this instance. "," * Attributes will be removed from this set, if they belong to the filtered class, so"," * that by the time all classes are processed, allCfgs will be empty."," * "," * @return {Object} The set of attributes belonging to the class passed in, in the form"," * of an object with attribute name/configuration pairs."," */"," _filterAttrCfgs : function(clazz, allCfgs) {"," var cfgs = null, attr, attrs = clazz.ATTRS;",""," if (attrs) {"," for (attr in attrs) {"," if (allCfgs[attr]) {"," cfgs = cfgs || {};"," cfgs[attr] = allCfgs[attr];"," allCfgs[attr] = null;"," }"," }"," }",""," return cfgs;"," },",""," /**"," * @method _filterAdHocAttrs"," * @private"," *"," * @param {Object} allAttrs The set of all attribute configurations for this instance. "," * Attributes will be removed from this set, if they belong to the filtered class, so"," * that by the time all classes are processed, allCfgs will be empty."," * @param {Object} userVals The config object passed in by the user, from which adhoc attrs are to be filtered."," * @return {Object} The set of adhoc attributes passed in, in the form"," * of an object with attribute name/configuration pairs."," */"," _filterAdHocAttrs : function(allAttrs, userVals) {"," var adHocs,"," nonAttrs = this._nonAttrs,"," attr;",""," if (userVals) {"," adHocs = {};"," for (attr in userVals) {"," if (!allAttrs[attr] && !nonAttrs[attr] && userVals.hasOwnProperty(attr)) {"," adHocs[attr] = {"," value:userVals[attr]"," };"," }"," }"," }",""," return adHocs;"," },",""," /**"," * A helper method used by _getClasses and _getAttrCfgs, which determines both"," * the array of classes and aggregate set of attribute configurations"," * across the class hierarchy for the instance."," *"," * @method _initHierarchyData"," * @private"," */"," _initHierarchyData : function() {"," var c = this.constructor,"," i,"," l,"," nonAttrsCfg,"," nonAttrs = (this._allowAdHocAttrs) ? {} : null,"," classes = [],"," attrs = [];",""," while (c) {"," // Add to classes"," classes[classes.length] = c;",""," // Add to attributes"," if (c.ATTRS) {"," attrs[attrs.length] = c.ATTRS;"," }",""," if (this._allowAdHocAttrs) {"," nonAttrsCfg = c._NON_ATTRS_CFG; "," if (nonAttrsCfg) {"," for (i = 0, l = nonAttrsCfg.length; i < l; i++) {"," nonAttrs[nonAttrsCfg[i]] = true;"," }"," }"," }",""," c = c.superclass ? c.superclass.constructor : null;"," }",""," this._classes = classes;"," this._nonAttrs = nonAttrs;"," this._attrs = this._aggregateAttrs(attrs);"," },",""," /**"," * Utility method to define the attribute hash used to filter/whitelist property mixes for "," * this class. "," * "," * @method _attrCfgHash"," * @private"," */"," _attrCfgHash: function() {"," return BaseCore._ATTR_CFG_HASH;"," },",""," /**"," * A helper method, used by _initHierarchyData to aggregate "," * attribute configuration across the instances class hierarchy."," *"," * The method will protect the attribute configuration value to protect the statically defined "," * default value in ATTRS if required (if the value is an object literal, array or the "," * attribute configuration has cloneDefaultValue set to shallow or deep)."," *"," * @method _aggregateAttrs"," * @private"," * @param {Array} allAttrs An array of ATTRS definitions across classes in the hierarchy "," * (subclass first, Base last)"," * @return {Object} The aggregate set of ATTRS definitions for the instance"," */"," _aggregateAttrs : function(allAttrs) {"," var attr,"," attrs,"," cfg,"," val,"," path,"," i,"," clone,"," cfgPropsHash = this._attrCfgHash(),"," aggAttr,"," aggAttrs = {};",""," if (allAttrs) {"," for (i = allAttrs.length-1; i >= 0; --i) {"," attrs = allAttrs[i];",""," for (attr in attrs) {"," if (attrs.hasOwnProperty(attr)) {",""," // Protect config passed in"," cfg = _wlmix({}, attrs[attr], cfgPropsHash);",""," val = cfg.value;"," clone = cfg.cloneDefaultValue;",""," if (val) {"," if ( (clone === undefined && (OBJECT_CONSTRUCTOR === val.constructor || L.isArray(val))) || clone === DEEP || clone === true) {"," cfg.value = Y.clone(val);"," } else if (clone === SHALLOW) {"," cfg.value = Y.merge(val);"," }"," // else if (clone === false), don't clone the static default value. "," // It's intended to be used by reference."," }",""," path = null;"," if (attr.indexOf(DOT) !== -1) {"," path = attr.split(DOT);"," attr = path.shift();"," }",""," aggAttr = aggAttrs[attr];"," if (path && aggAttr && aggAttr.value) {"," O.setValue(aggAttr.value, path, val);"," } else if (!path) {"," if (!aggAttr) {"," aggAttrs[attr] = cfg;"," } else {"," if (aggAttr.valueFn && VALUE in cfg) {"," aggAttr.valueFn = null; "," }"," _wlmix(aggAttr, cfg, cfgPropsHash);"," }"," }"," }"," }"," }"," }",""," return aggAttrs;"," },",""," /**"," * Initializes the class hierarchy for the instance, which includes "," * initializing attributes for each class defined in the class's "," * static <a href=\"#property_BaseCore.ATTRS\">ATTRS</a> property and "," * invoking the initializer method on the prototype of each class in the hierarchy."," *"," * @method _initHierarchy"," * @param {Object} userVals Object with configuration property name/value pairs"," * @private"," */"," _initHierarchy : function(userVals) {"," var lazy = this._lazyAddAttrs,"," constr,"," constrProto,"," ci,"," ei,"," el,"," extProto,"," exts,"," classes = this._getClasses(),"," attrCfgs = this._getAttrCfgs(),"," cl = classes.length - 1;",""," for (ci = cl; ci >= 0; ci--) {",""," constr = classes[ci];"," constrProto = constr.prototype;"," exts = constr._yuibuild && constr._yuibuild.exts; ",""," if (exts) {"," for (ei = 0, el = exts.length; ei < el; ei++) {"," exts[ei].apply(this, arguments);"," }"," }",""," this.addAttrs(this._filterAttrCfgs(constr, attrCfgs), userVals, lazy);",""," if (this._allowAdHocAttrs && ci === cl) { "," this.addAttrs(this._filterAdHocAttrs(attrCfgs, userVals), userVals, lazy);"," }",""," // Using INITIALIZER in hasOwnProperty check, for performance reasons (helps IE6 avoid GC thresholds when"," // referencing string literals). Not using it in apply, again, for performance \".\" is faster. "," if (constrProto.hasOwnProperty(INITIALIZER)) {"," constrProto.initializer.apply(this, arguments);"," }",""," if (exts) {"," for (ei = 0; ei < el; ei++) {"," extProto = exts[ei].prototype;"," if (extProto.hasOwnProperty(INITIALIZER)) {"," extProto.initializer.apply(this, arguments);"," }"," }"," }"," }"," },",""," /**"," * Destroys the class hierarchy for this instance by invoking"," * the destructor method on the prototype of each class in the hierarchy."," *"," * @method _destroyHierarchy"," * @private"," */"," _destroyHierarchy : function() {"," var constr,"," constrProto,"," ci, cl, ei, el, exts, extProto,"," classes = this._getClasses();",""," for (ci = 0, cl = classes.length; ci < cl; ci++) {"," constr = classes[ci];"," constrProto = constr.prototype;"," exts = constr._yuibuild && constr._yuibuild.exts; ",""," if (exts) {"," for (ei = 0, el = exts.length; ei < el; ei++) {"," extProto = exts[ei].prototype;"," if (extProto.hasOwnProperty(DESTRUCTOR)) {"," extProto.destructor.apply(this, arguments);"," }"," }"," }",""," if (constrProto.hasOwnProperty(DESTRUCTOR)) {"," constrProto.destructor.apply(this, arguments);"," }"," }"," },",""," /**"," * Default toString implementation. Provides the constructor NAME"," * and the instance guid, if set."," *"," * @method toString"," * @return {String} String representation for this object"," */"," toString: function() {"," return this.name + \"[\" + Y.stamp(this, true) + \"]\";"," }"," };",""," // Straightup augment, no wrapper functions"," Y.mix(BaseCore, AttributeCore, false, null, 1);",""," // Fix constructor"," BaseCore.prototype.constructor = BaseCore;",""," Y.BaseCore = BaseCore;","","","}, '3.7.1', {\"requires\": [\"attribute-core\"]});"];+_yuitest_coverage["build/base-core/base-core.js"].lines = {"1":0,"21":0,"36":0,"37":0,"38":0,"39":0,"42":0,"66":0,"67":0,"68":0,"70":0,"83":0,"84":0,"99":0,"126":0,"143":0,"173":0,"184":0,"186":0,"190":0,"191":0,"192":0,"195":0,"204":0,"206":0,"216":0,"230":0,"232":0,"242":0,"244":0,"246":0,"248":0,"259":0,"260":0,"270":0,"271":0,"273":0,"274":0,"287":0,"288":0,"290":0,"304":0,"305":0,"307":0,"327":0,"329":0,"330":0,"331":0,"332":0,"333":0,"334":0,"339":0,"354":0,"358":0,"359":0,"360":0,"361":0,"362":0,"369":0,"381":0,"389":0,"391":0,"394":0,"395":0,"398":0,"399":0,"400":0,"401":0,"402":0,"407":0,"410":0,"411":0,"412":0,"423":0,"441":0,"452":0,"453":0,"454":0,"456":0,"457":0,"460":0,"462":0,"463":0,"465":0,"466":0,"467":0,"468":0,"469":0,"475":0,"476":0,"477":0,"478":0,"481":0,"482":0,"483":0,"484":0,"485":0,"486":0,"488":0,"489":0,"491":0,"499":0,"513":0,"525":0,"527":0,"528":0,"529":0,"531":0,"532":0,"533":0,"537":0,"539":0,"540":0,"545":0,"546":0,"549":0,"550":0,"551":0,"552":0,"553":0,"568":0,"573":0,"574":0,"575":0,"576":0,"578":0,"579":0,"580":0,"581":0,"582":0,"587":0,"588":0,"601":0,"606":0,"609":0,"611":0};+_yuitest_coverage["build/base-core/base-core.js"].functions = {"_wlmix:35":0,"BaseCore:66":0,"_initBase:182":0,"_initAttribute:215":0,"init:228":0,"_baseInit:241":0,"destroy:258":0,"_baseDestroy:269":0,"_getClasses:286":0,"_getAttrCfgs:303":0,"_filterAttrCfgs:326":0,"_filterAdHocAttrs:353":0,"_initHierarchyData:380":0,"_attrCfgHash:422":0,"_aggregateAttrs:440":0,"_initHierarchy:512":0,"_destroyHierarchy:567":0,"toString:600":0,"(anonymous 1):1":0};+_yuitest_coverage["build/base-core/base-core.js"].coveredLines = 136;+_yuitest_coverage["build/base-core/base-core.js"].coveredFunctions = 19;+_yuitest_coverline("build/base-core/base-core.js", 1);+YUI.add('base-core', function (Y, NAME) {++ /**+ * The base module provides the Base class, which objects requiring attribute and custom event support can extend. + * The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides + * plugin support and also provides the BaseCore.build method which provides a way to build custom classes using extensions.+ *+ * @module base+ */++ /**+ * <p>The base-core module provides the BaseCore class, the lightest version of Base, + * which provides Base's basic lifecycle management and ATTRS construction support, + * but doesn't fire init/destroy or attribute change events.</p> + * + * <p>It mixes in AttributeCore, which is the lightest version of Attribute</p>+ *+ * @module base+ * @submodule base-core+ */+ _yuitest_coverfunc("build/base-core/base-core.js", "(anonymous 1)", 1);+_yuitest_coverline("build/base-core/base-core.js", 21);+var O = Y.Object,+ L = Y.Lang,+ DOT = ".",+ INITIALIZED = "initialized",+ DESTROYED = "destroyed",+ INITIALIZER = "initializer",+ VALUE = "value",+ OBJECT_CONSTRUCTOR = Object.prototype.constructor,+ DEEP = "deep",+ SHALLOW = "shallow",+ DESTRUCTOR = "destructor",++ AttributeCore = Y.AttributeCore,++ _wlmix = function(r, s, wlhash) {+ _yuitest_coverfunc("build/base-core/base-core.js", "_wlmix", 35);+_yuitest_coverline("build/base-core/base-core.js", 36);+var p;+ _yuitest_coverline("build/base-core/base-core.js", 37);+for (p in s) {+ _yuitest_coverline("build/base-core/base-core.js", 38);+if(wlhash[p]) { + _yuitest_coverline("build/base-core/base-core.js", 39);+r[p] = s[p];+ }+ }+ _yuitest_coverline("build/base-core/base-core.js", 42);+return r;+ };++ /**+ * The BaseCore class, is the lightest version of Base, and provides Base's + * basic lifecycle management and ATTRS construction support, but doesn't + * fire init/destroy or attribute change events.+ *+ * BaseCore also handles the chaining of initializer and destructor methods across + * the hierarchy as part of object construction and destruction. Additionally, attributes + * configured through the static <a href="#property_BaseCore.ATTRS">ATTRS</a> + * property for each class in the hierarchy will be initialized by BaseCore.+ *+ * Classes which require attribute support, but don't intend to use/expose attribute + * change events can extend BaseCore instead of Base for optimal kweight and + * runtime performance.+ * + * @class BaseCore+ * @constructor+ * @uses AttributeCore+ * @param {Object} cfg Object with configuration property name/value pairs. + * The object can be used to provide initial values for the objects published + * attributes.+ */+ _yuitest_coverline("build/base-core/base-core.js", 66);+function BaseCore(cfg) {+ _yuitest_coverfunc("build/base-core/base-core.js", "BaseCore", 66);+_yuitest_coverline("build/base-core/base-core.js", 67);+if (!this._BaseInvoked) {+ _yuitest_coverline("build/base-core/base-core.js", 68);+this._BaseInvoked = true;++ _yuitest_coverline("build/base-core/base-core.js", 70);+this._initBase(cfg);+ }+ }++ /**+ * The list of properties which can be configured for each attribute + * (e.g. setter, getter, writeOnce, readOnly etc.)+ *+ * @property _ATTR_CFG+ * @type Array+ * @static+ * @private+ */+ _yuitest_coverline("build/base-core/base-core.js", 83);+BaseCore._ATTR_CFG = AttributeCore._ATTR_CFG.concat("cloneDefaultValue");+ _yuitest_coverline("build/base-core/base-core.js", 84);+BaseCore._ATTR_CFG_HASH = Y.Array.hash(BaseCore._ATTR_CFG);++ /**+ * The array of non-attribute configuration properties supported by this class. + * + * For example `BaseCore` defines a "plugins" configuration property which + * should not be set up as an attribute. This property is primarily required so + * that when <a href="#property__allowAdHocAttrs">`_allowAdHocAttrs`</a> is enabled by a class, + * non-attribute configuration properties don't get added as ad-hoc attributes. + *+ * @property _NON_ATTRS_CFG+ * @type Array+ * @static+ * @private+ */+ _yuitest_coverline("build/base-core/base-core.js", 99);+BaseCore._NON_ATTRS_CFG = ["plugins"];++ /**+ * This property controls whether or not instances of this class should+ * allow users to add ad-hoc attributes through the constructor configuration + * hash.+ *+ * AdHoc attributes are attributes which are not defined by the class, and are + * not handled by the MyClass._NON_ATTRS_CFG + * + * @property _allowAdHocAttrs+ * @type boolean+ * @default undefined (false)+ * @protected+ */++ /**+ * The string to be used to identify instances of this class.+ * + * Classes extending BaseCore, should define their own+ * static NAME property, which should be camelCase by+ * convention (e.g. MyClass.NAME = "myClass";).+ *+ * @property NAME+ * @type String+ * @static+ */+ _yuitest_coverline("build/base-core/base-core.js", 126);+BaseCore.NAME = "baseCore";++ /**+ * The default set of attributes which will be available for instances of this class, and + * their configuration. In addition to the configuration properties listed by + * AttributeCore's <a href="AttributeCore.html#method_addAttr">addAttr</a> method, + * the attribute can also be configured with a "cloneDefaultValue" property, which + * defines how the statically defined value field should be protected + * ("shallow", "deep" and false are supported values). + *+ * By default if the value is an object literal or an array it will be "shallow" + * cloned, to protect the default value.+ *+ * @property ATTRS+ * @type Object+ * @static+ */+ _yuitest_coverline("build/base-core/base-core.js", 143);+BaseCore.ATTRS = {+ /**+ * Flag indicating whether or not this object+ * has been through the init lifecycle phase.+ *+ * @attribute initialized+ * @readonly+ * @default false+ * @type boolean+ */+ initialized: {+ readOnly:true,+ value:false+ },++ /**+ * Flag indicating whether or not this object+ * has been through the destroy lifecycle phase.+ *+ * @attribute destroyed+ * @readonly+ * @default false+ * @type boolean+ */+ destroyed: {+ readOnly:true,+ value:false+ }+ };++ _yuitest_coverline("build/base-core/base-core.js", 173);+BaseCore.prototype = {++ /**+ * Internal construction logic for BaseCore.+ *+ * @method _initBase+ * @param {Object} config The constructor configuration object+ * @private+ */+ _initBase : function(config) {++ _yuitest_coverfunc("build/base-core/base-core.js", "_initBase", 182);+_yuitest_coverline("build/base-core/base-core.js", 184);+Y.stamp(this);++ _yuitest_coverline("build/base-core/base-core.js", 186);+this._initAttribute(config);++ // If Plugin.Host has been augmented [ through base-pluginhost ], setup it's+ // initial state, but don't initialize Plugins yet. That's done after initialization.+ _yuitest_coverline("build/base-core/base-core.js", 190);+var PluginHost = Y.Plugin && Y.Plugin.Host;+ _yuitest_coverline("build/base-core/base-core.js", 191);+if (this._initPlugins && PluginHost) {+ _yuitest_coverline("build/base-core/base-core.js", 192);+PluginHost.call(this);+ }++ _yuitest_coverline("build/base-core/base-core.js", 195);+if (this._lazyAddAttrs !== false) { this._lazyAddAttrs = true; }++ /**+ * The string used to identify the class of this object.+ *+ * @deprecated Use this.constructor.NAME+ * @property name+ * @type String+ */+ _yuitest_coverline("build/base-core/base-core.js", 204);+this.name = this.constructor.NAME;+ + _yuitest_coverline("build/base-core/base-core.js", 206);+this.init.apply(this, arguments);+ },++ /**+ * Initializes AttributeCore + * + * @method _initAttribute+ * @private+ */+ _initAttribute: function() {+ _yuitest_coverfunc("build/base-core/base-core.js", "_initAttribute", 215);+_yuitest_coverline("build/base-core/base-core.js", 216);+AttributeCore.apply(this);+ },++ /**+ * Init lifecycle method, invoked during construction. Sets up attributes + * and invokes initializers for the class hierarchy.+ *+ * @method init+ * @chainable+ * @param {Object} cfg Object with configuration property name/value pairs+ * @return {BaseCore} A reference to this object+ */+ init: function(cfg) {++ _yuitest_coverfunc("build/base-core/base-core.js", "init", 228);+_yuitest_coverline("build/base-core/base-core.js", 230);+this._baseInit(cfg);++ _yuitest_coverline("build/base-core/base-core.js", 232);+return this;+ },++ /**+ * Internal initialization implementation for BaseCore+ *+ * @method _baseInit+ * @private+ */+ _baseInit: function(cfg) {+ _yuitest_coverfunc("build/base-core/base-core.js", "_baseInit", 241);+_yuitest_coverline("build/base-core/base-core.js", 242);+this._initHierarchy(cfg);++ _yuitest_coverline("build/base-core/base-core.js", 244);+if (this._initPlugins) {+ // Need to initPlugins manually, to handle constructor parsing, static Plug parsing+ _yuitest_coverline("build/base-core/base-core.js", 246);+this._initPlugins(cfg);+ }+ _yuitest_coverline("build/base-core/base-core.js", 248);+this._set(INITIALIZED, true);+ },++ /**+ * Destroy lifecycle method. Invokes destructors for the class hierarchy.+ *+ * @method destroy+ * @return {BaseCore} A reference to this object+ * @chainable+ */+ destroy: function() {+ _yuitest_coverfunc("build/base-core/base-core.js", "destroy", 258);+_yuitest_coverline("build/base-core/base-core.js", 259);+this._baseDestroy();+ _yuitest_coverline("build/base-core/base-core.js", 260);+return this;+ },++ /**+ * Internal destroy implementation for BaseCore+ *+ * @method _baseDestroy+ * @private+ */+ _baseDestroy : function() {+ _yuitest_coverfunc("build/base-core/base-core.js", "_baseDestroy", 269);+_yuitest_coverline("build/base-core/base-core.js", 270);+if (this._destroyPlugins) {+ _yuitest_coverline("build/base-core/base-core.js", 271);+this._destroyPlugins();+ }+ _yuitest_coverline("build/base-core/base-core.js", 273);+this._destroyHierarchy();+ _yuitest_coverline("build/base-core/base-core.js", 274);+this._set(DESTROYED, true);+ },++ /**+ * Returns the class hierarchy for this object, with BaseCore being the last class in the array.+ *+ * @method _getClasses+ * @protected+ * @return {Function[]} An array of classes (constructor functions), making up the class hierarchy for this object.+ * This value is cached the first time the method, or _getAttrCfgs, is invoked. Subsequent invocations return the + * cached value.+ */+ _getClasses : function() {+ _yuitest_coverfunc("build/base-core/base-core.js", "_getClasses", 286);+_yuitest_coverline("build/base-core/base-core.js", 287);+if (!this._classes) {+ _yuitest_coverline("build/base-core/base-core.js", 288);+this._initHierarchyData();+ }+ _yuitest_coverline("build/base-core/base-core.js", 290);+return this._classes;+ },++ /**+ * Returns an aggregated set of attribute configurations, by traversing + * the class hierarchy.+ *+ * @method _getAttrCfgs+ * @protected+ * @return {Object} The hash of attribute configurations, aggregated across classes in the hierarchy+ * This value is cached the first time the method, or _getClasses, is invoked. Subsequent invocations return+ * the cached value.+ */+ _getAttrCfgs : function() {+ _yuitest_coverfunc("build/base-core/base-core.js", "_getAttrCfgs", 303);+_yuitest_coverline("build/base-core/base-core.js", 304);+if (!this._attrs) {+ _yuitest_coverline("build/base-core/base-core.js", 305);+this._initHierarchyData();+ }+ _yuitest_coverline("build/base-core/base-core.js", 307);+return this._attrs;+ },++ /**+ * A helper method used when processing ATTRS across the class hierarchy during + * initialization. Returns a disposable object with the attributes defined for + * the provided class, extracted from the set of all attributes passed in.+ *+ * @method _filterAttrCfs+ * @private+ *+ * @param {Function} clazz The class for which the desired attributes are required.+ * @param {Object} allCfgs The set of all attribute configurations for this instance. + * Attributes will be removed from this set, if they belong to the filtered class, so+ * that by the time all classes are processed, allCfgs will be empty.+ * + * @return {Object} The set of attributes belonging to the class passed in, in the form+ * of an object with attribute name/configuration pairs.+ */+ _filterAttrCfgs : function(clazz, allCfgs) {+ _yuitest_coverfunc("build/base-core/base-core.js", "_filterAttrCfgs", 326);+_yuitest_coverline("build/base-core/base-core.js", 327);+var cfgs = null, attr, attrs = clazz.ATTRS;++ _yuitest_coverline("build/base-core/base-core.js", 329);+if (attrs) {+ _yuitest_coverline("build/base-core/base-core.js", 330);+for (attr in attrs) {+ _yuitest_coverline("build/base-core/base-core.js", 331);+if (allCfgs[attr]) {+ _yuitest_coverline("build/base-core/base-core.js", 332);+cfgs = cfgs || {};+ _yuitest_coverline("build/base-core/base-core.js", 333);+cfgs[attr] = allCfgs[attr];+ _yuitest_coverline("build/base-core/base-core.js", 334);+allCfgs[attr] = null;+ }+ }+ }++ _yuitest_coverline("build/base-core/base-core.js", 339);+return cfgs;+ },++ /**+ * @method _filterAdHocAttrs+ * @private+ *+ * @param {Object} allAttrs The set of all attribute configurations for this instance. + * Attributes will be removed from this set, if they belong to the filtered class, so+ * that by the time all classes are processed, allCfgs will be empty.+ * @param {Object} userVals The config object passed in by the user, from which adhoc attrs are to be filtered.+ * @return {Object} The set of adhoc attributes passed in, in the form+ * of an object with attribute name/configuration pairs.+ */+ _filterAdHocAttrs : function(allAttrs, userVals) {+ _yuitest_coverfunc("build/base-core/base-core.js", "_filterAdHocAttrs", 353);+_yuitest_coverline("build/base-core/base-core.js", 354);+var adHocs,+ nonAttrs = this._nonAttrs,+ attr;++ _yuitest_coverline("build/base-core/base-core.js", 358);+if (userVals) {+ _yuitest_coverline("build/base-core/base-core.js", 359);+adHocs = {};+ _yuitest_coverline("build/base-core/base-core.js", 360);+for (attr in userVals) {+ _yuitest_coverline("build/base-core/base-core.js", 361);+if (!allAttrs[attr] && !nonAttrs[attr] && userVals.hasOwnProperty(attr)) {+ _yuitest_coverline("build/base-core/base-core.js", 362);+adHocs[attr] = {+ value:userVals[attr]+ };+ }+ }+ }++ _yuitest_coverline("build/base-core/base-core.js", 369);+return adHocs;+ },++ /**+ * A helper method used by _getClasses and _getAttrCfgs, which determines both+ * the array of classes and aggregate set of attribute configurations+ * across the class hierarchy for the instance.+ *+ * @method _initHierarchyData+ * @private+ */+ _initHierarchyData : function() {+ _yuitest_coverfunc("build/base-core/base-core.js", "_initHierarchyData", 380);+_yuitest_coverline("build/base-core/base-core.js", 381);+var c = this.constructor,+ i,+ l,+ nonAttrsCfg,+ nonAttrs = (this._allowAdHocAttrs) ? {} : null,+ classes = [],+ attrs = [];++ _yuitest_coverline("build/base-core/base-core.js", 389);+while (c) {+ // Add to classes+ _yuitest_coverline("build/base-core/base-core.js", 391);+classes[classes.length] = c;++ // Add to attributes+ _yuitest_coverline("build/base-core/base-core.js", 394);+if (c.ATTRS) {+ _yuitest_coverline("build/base-core/base-core.js", 395);+attrs[attrs.length] = c.ATTRS;+ }++ _yuitest_coverline("build/base-core/base-core.js", 398);+if (this._allowAdHocAttrs) {+ _yuitest_coverline("build/base-core/base-core.js", 399);+nonAttrsCfg = c._NON_ATTRS_CFG; + _yuitest_coverline("build/base-core/base-core.js", 400);+if (nonAttrsCfg) {+ _yuitest_coverline("build/base-core/base-core.js", 401);+for (i = 0, l = nonAttrsCfg.length; i < l; i++) {+ _yuitest_coverline("build/base-core/base-core.js", 402);+nonAttrs[nonAttrsCfg[i]] = true;+ }+ }+ }++ _yuitest_coverline("build/base-core/base-core.js", 407);+c = c.superclass ? c.superclass.constructor : null;+ }++ _yuitest_coverline("build/base-core/base-core.js", 410);+this._classes = classes;+ _yuitest_coverline("build/base-core/base-core.js", 411);+this._nonAttrs = nonAttrs;+ _yuitest_coverline("build/base-core/base-core.js", 412);+this._attrs = this._aggregateAttrs(attrs);+ },++ /**+ * Utility method to define the attribute hash used to filter/whitelist property mixes for + * this class. + * + * @method _attrCfgHash+ * @private+ */+ _attrCfgHash: function() {+ _yuitest_coverfunc("build/base-core/base-core.js", "_attrCfgHash", 422);+_yuitest_coverline("build/base-core/base-core.js", 423);+return BaseCore._ATTR_CFG_HASH;+ },++ /**+ * A helper method, used by _initHierarchyData to aggregate + * attribute configuration across the instances class hierarchy.+ *+ * The method will protect the attribute configuration value to protect the statically defined + * default value in ATTRS if required (if the value is an object literal, array or the + * attribute configuration has cloneDefaultValue set to shallow or deep).+ *+ * @method _aggregateAttrs+ * @private+ * @param {Array} allAttrs An array of ATTRS definitions across classes in the hierarchy + * (subclass first, Base last)+ * @return {Object} The aggregate set of ATTRS definitions for the instance+ */+ _aggregateAttrs : function(allAttrs) {+ _yuitest_coverfunc("build/base-core/base-core.js", "_aggregateAttrs", 440);+_yuitest_coverline("build/base-core/base-core.js", 441);+var attr,+ attrs,+ cfg,+ val,+ path,+ i,+ clone,+ cfgPropsHash = this._attrCfgHash(),+ aggAttr,+ aggAttrs = {};++ _yuitest_coverline("build/base-core/base-core.js", 452);+if (allAttrs) {+ _yuitest_coverline("build/base-core/base-core.js", 453);+for (i = allAttrs.length-1; i >= 0; --i) {+ _yuitest_coverline("build/base-core/base-core.js", 454);+attrs = allAttrs[i];++ _yuitest_coverline("build/base-core/base-core.js", 456);+for (attr in attrs) {+ _yuitest_coverline("build/base-core/base-core.js", 457);+if (attrs.hasOwnProperty(attr)) {++ // Protect config passed in+ _yuitest_coverline("build/base-core/base-core.js", 460);+cfg = _wlmix({}, attrs[attr], cfgPropsHash);++ _yuitest_coverline("build/base-core/base-core.js", 462);+val = cfg.value;+ _yuitest_coverline("build/base-core/base-core.js", 463);+clone = cfg.cloneDefaultValue;++ _yuitest_coverline("build/base-core/base-core.js", 465);+if (val) {+ _yuitest_coverline("build/base-core/base-core.js", 466);+if ( (clone === undefined && (OBJECT_CONSTRUCTOR === val.constructor || L.isArray(val))) || clone === DEEP || clone === true) {+ _yuitest_coverline("build/base-core/base-core.js", 467);+cfg.value = Y.clone(val);+ } else {_yuitest_coverline("build/base-core/base-core.js", 468);+if (clone === SHALLOW) {+ _yuitest_coverline("build/base-core/base-core.js", 469);+cfg.value = Y.merge(val);+ }}+ // else if (clone === false), don't clone the static default value. + // It's intended to be used by reference.+ }++ _yuitest_coverline("build/base-core/base-core.js", 475);+path = null;+ _yuitest_coverline("build/base-core/base-core.js", 476);+if (attr.indexOf(DOT) !== -1) {+ _yuitest_coverline("build/base-core/base-core.js", 477);+path = attr.split(DOT);+ _yuitest_coverline("build/base-core/base-core.js", 478);+attr = path.shift();+ }++ _yuitest_coverline("build/base-core/base-core.js", 481);+aggAttr = aggAttrs[attr];+ _yuitest_coverline("build/base-core/base-core.js", 482);+if (path && aggAttr && aggAttr.value) {+ _yuitest_coverline("build/base-core/base-core.js", 483);+O.setValue(aggAttr.value, path, val);+ } else {_yuitest_coverline("build/base-core/base-core.js", 484);+if (!path) {+ _yuitest_coverline("build/base-core/base-core.js", 485);+if (!aggAttr) {+ _yuitest_coverline("build/base-core/base-core.js", 486);+aggAttrs[attr] = cfg;+ } else {+ _yuitest_coverline("build/base-core/base-core.js", 488);+if (aggAttr.valueFn && VALUE in cfg) {+ _yuitest_coverline("build/base-core/base-core.js", 489);+aggAttr.valueFn = null; + }+ _yuitest_coverline("build/base-core/base-core.js", 491);+_wlmix(aggAttr, cfg, cfgPropsHash);+ }+ }}+ }+ }+ }+ }++ _yuitest_coverline("build/base-core/base-core.js", 499);+return aggAttrs;+ },++ /**+ * Initializes the class hierarchy for the instance, which includes + * initializing attributes for each class defined in the class's + * static <a href="#property_BaseCore.ATTRS">ATTRS</a> property and + * invoking the initializer method on the prototype of each class in the hierarchy.+ *+ * @method _initHierarchy+ * @param {Object} userVals Object with configuration property name/value pairs+ * @private+ */+ _initHierarchy : function(userVals) {+ _yuitest_coverfunc("build/base-core/base-core.js", "_initHierarchy", 512);+_yuitest_coverline("build/base-core/base-core.js", 513);+var lazy = this._lazyAddAttrs,+ constr,+ constrProto,+ ci,+ ei,+ el,+ extProto,+ exts,+ classes = this._getClasses(),+ attrCfgs = this._getAttrCfgs(),+ cl = classes.length - 1;++ _yuitest_coverline("build/base-core/base-core.js", 525);+for (ci = cl; ci >= 0; ci--) {++ _yuitest_coverline("build/base-core/base-core.js", 527);+constr = classes[ci];+ _yuitest_coverline("build/base-core/base-core.js", 528);+constrProto = constr.prototype;+ _yuitest_coverline("build/base-core/base-core.js", 529);+exts = constr._yuibuild && constr._yuibuild.exts; ++ _yuitest_coverline("build/base-core/base-core.js", 531);+if (exts) {+ _yuitest_coverline("build/base-core/base-core.js", 532);+for (ei = 0, el = exts.length; ei < el; ei++) {+ _yuitest_coverline("build/base-core/base-core.js", 533);+exts[ei].apply(this, arguments);+ }+ }++ _yuitest_coverline("build/base-core/base-core.js", 537);+this.addAttrs(this._filterAttrCfgs(constr, attrCfgs), userVals, lazy);++ _yuitest_coverline("build/base-core/base-core.js", 539);+if (this._allowAdHocAttrs && ci === cl) { + _yuitest_coverline("build/base-core/base-core.js", 540);+this.addAttrs(this._filterAdHocAttrs(attrCfgs, userVals), userVals, lazy);+ }++ // Using INITIALIZER in hasOwnProperty check, for performance reasons (helps IE6 avoid GC thresholds when+ // referencing string literals). Not using it in apply, again, for performance "." is faster. + _yuitest_coverline("build/base-core/base-core.js", 545);+if (constrProto.hasOwnProperty(INITIALIZER)) {+ _yuitest_coverline("build/base-core/base-core.js", 546);+constrProto.initializer.apply(this, arguments);+ }++ _yuitest_coverline("build/base-core/base-core.js", 549);+if (exts) {+ _yuitest_coverline("build/base-core/base-core.js", 550);+for (ei = 0; ei < el; ei++) {+ _yuitest_coverline("build/base-core/base-core.js", 551);+extProto = exts[ei].prototype;+ _yuitest_coverline("build/base-core/base-core.js", 552);+if (extProto.hasOwnProperty(INITIALIZER)) {+ _yuitest_coverline("build/base-core/base-core.js", 553);+extProto.initializer.apply(this, arguments);+ }+ }+ }+ }+ },++ /**+ * Destroys the class hierarchy for this instance by invoking+ * the destructor method on the prototype of each class in the hierarchy.+ *+ * @method _destroyHierarchy+ * @private+ */+ _destroyHierarchy : function() {+ _yuitest_coverfunc("build/base-core/base-core.js", "_destroyHierarchy", 567);+_yuitest_coverline("build/base-core/base-core.js", 568);+var constr,+ constrProto,+ ci, cl, ei, el, exts, extProto,+ classes = this._getClasses();++ _yuitest_coverline("build/base-core/base-core.js", 573);+for (ci = 0, cl = classes.length; ci < cl; ci++) {+ _yuitest_coverline("build/base-core/base-core.js", 574);+constr = classes[ci];+ _yuitest_coverline("build/base-core/base-core.js", 575);+constrProto = constr.prototype;+ _yuitest_coverline("build/base-core/base-core.js", 576);+exts = constr._yuibuild && constr._yuibuild.exts; ++ _yuitest_coverline("build/base-core/base-core.js", 578);+if (exts) {+ _yuitest_coverline("build/base-core/base-core.js", 579);+for (ei = 0, el = exts.length; ei < el; ei++) {+ _yuitest_coverline("build/base-core/base-core.js", 580);+extProto = exts[ei].prototype;+ _yuitest_coverline("build/base-core/base-core.js", 581);+if (extProto.hasOwnProperty(DESTRUCTOR)) {+ _yuitest_coverline("build/base-core/base-core.js", 582);+extProto.destructor.apply(this, arguments);+ }+ }+ }++ _yuitest_coverline("build/base-core/base-core.js", 587);+if (constrProto.hasOwnProperty(DESTRUCTOR)) {+ _yuitest_coverline("build/base-core/base-core.js", 588);+constrProto.destructor.apply(this, arguments);+ }+ }+ },++ /**+ * Default toString implementation. Provides the constructor NAME+ * and the instance guid, if set.+ *+ * @method toString+ * @return {String} String representation for this object+ */+ toString: function() {+ _yuitest_coverfunc("build/base-core/base-core.js", "toString", 600);+_yuitest_coverline("build/base-core/base-core.js", 601);+return this.name + "[" + Y.stamp(this, true) + "]";+ }+ };++ // Straightup augment, no wrapper functions+ _yuitest_coverline("build/base-core/base-core.js", 606);+Y.mix(BaseCore, AttributeCore, false, null, 1);++ // Fix constructor+ _yuitest_coverline("build/base-core/base-core.js", 609);+BaseCore.prototype.constructor = BaseCore;++ _yuitest_coverline("build/base-core/base-core.js", 611);+Y.BaseCore = BaseCore;+++}, '3.7.1', {"requires": ["attribute-core"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('base-core', function(Y) {+YUI.add('base-core', function (Y, NAME) { /** * The base module provides the Base class, which objects requiring attribute and custom event support can extend. @@ -30,6 +30,7 @@ INITIALIZED = "initialized", DESTROYED = "destroyed", INITIALIZER = "initializer",+ VALUE = "value", OBJECT_CONSTRUCTOR = Object.prototype.constructor, DEEP = "deep", SHALLOW = "shallow",@@ -454,6 +455,7 @@ i, clone, cfgPropsHash = this._attrCfgHash(),+ aggAttr, aggAttrs = {}; if (allAttrs) {@@ -464,8 +466,6 @@ if (attrs.hasOwnProperty(attr)) { // Protect config passed in- //cfg = Y.mix({}, attrs[attr], true, cfgProps);- //cfg = Y.Object(attrs[attr]); cfg = _wlmix({}, attrs[attr], cfgPropsHash); val = cfg.value;@@ -489,13 +489,17 @@ attr = path.shift(); } - if (path && aggAttrs[attr] && aggAttrs[attr].value) {- O.setValue(aggAttrs[attr].value, path, val);+ aggAttr = aggAttrs[attr];+ if (path && aggAttr && aggAttr.value) {+ O.setValue(aggAttr.value, path, val); } else if (!path) {- if (!aggAttrs[attr]) {+ if (!aggAttr) { aggAttrs[attr] = cfg; } else {- _wlmix(aggAttrs[attr], cfg, cfgPropsHash);+ if (aggAttr.valueFn && VALUE in cfg) {+ aggAttr.valueFn = null; + }+ _wlmix(aggAttr, cfg, cfgPropsHash); } } }@@ -618,4 +622,4 @@ Y.BaseCore = BaseCore; -}, '3.5.1' ,{requires:['attribute-core']});+}, '3.7.1', {"requires": ["attribute-core"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("base-core",function(a){var e=a.Object,i=a.Lang,h=".",l="initialized",d="destroyed",c="initializer",b=Object.prototype.constructor,j="deep",m="shallow",k="destructor",g=a.AttributeCore,f=function(t,q,o){var u;for(u in q){if(o[u]){t[u]=q[u];}}return t;};function n(o){if(!this._BaseInvoked){this._BaseInvoked=true;this._initBase(o);}}n._ATTR_CFG=g._ATTR_CFG.concat("cloneDefaultValue");n._ATTR_CFG_HASH=a.Array.hash(n._ATTR_CFG);n._NON_ATTRS_CFG=["plugins"];n.NAME="baseCore";n.ATTRS={initialized:{readOnly:true,value:false},destroyed:{readOnly:true,value:false}};n.prototype={_initBase:function(o){a.stamp(this);this._initAttribute(o);var p=a.Plugin&&a.Plugin.Host;if(this._initPlugins&&p){p.call(this);}if(this._lazyAddAttrs!==false){this._lazyAddAttrs=true;}this.name=this.constructor.NAME;this.init.apply(this,arguments);},_initAttribute:function(){g.apply(this);},init:function(o){this._baseInit(o);return this;},_baseInit:function(o){this._initHierarchy(o);if(this._initPlugins){this._initPlugins(o);}this._set(l,true);},destroy:function(){this._baseDestroy();return this;},_baseDestroy:function(){if(this._destroyPlugins){this._destroyPlugins();}this._destroyHierarchy();this._set(d,true);},_getClasses:function(){if(!this._classes){this._initHierarchyData();}return this._classes;},_getAttrCfgs:function(){if(!this._attrs){this._initHierarchyData();}return this._attrs;},_filterAttrCfgs:function(s,p){var q=null,o,r=s.ATTRS;if(r){for(o in r){if(p[o]){q=q||{};q[o]=p[o];p[o]=null;}}}return q;},_filterAdHocAttrs:function(r,p){var q,s=this._nonAttrs,o;if(p){q={};for(o in p){if(!r[o]&&!s[o]&&p.hasOwnProperty(o)){q[o]={value:p[o]};}}}return q;},_initHierarchyData:function(){var u=this.constructor,r,o,s,t=(this._allowAdHocAttrs)?{}:null,q=[],p=[];while(u){q[q.length]=u;if(u.ATTRS){p[p.length]=u.ATTRS;}if(this._allowAdHocAttrs){s=u._NON_ATTRS_CFG;if(s){for(r=0,o=s.length;r<o;r++){t[s[r]]=true;}}}u=u.superclass?u.superclass.constructor:null;}this._classes=q;this._nonAttrs=t;this._attrs=this._aggregateAttrs(p);},_attrCfgHash:function(){return n._ATTR_CFG_HASH;},_aggregateAttrs:function(v){var r,w,q,o,x,p,u,t=this._attrCfgHash(),s={};if(v){for(p=v.length-1;p>=0;--p){w=v[p];for(r in w){if(w.hasOwnProperty(r)){q=f({},w[r],t);o=q.value;u=q.cloneDefaultValue;if(o){if((u===undefined&&(b===o.constructor||i.isArray(o)))||u===j||u===true){q.value=a.clone(o);}else{if(u===m){q.value=a.merge(o);}}}x=null;if(r.indexOf(h)!==-1){x=r.split(h);r=x.shift();}if(x&&s[r]&&s[r].value){e.setValue(s[r].value,x,o);}else{if(!x){if(!s[r]){s[r]=q;}else{f(s[r],q,t);}}}}}}}return s;},_initHierarchy:function(u){var q=this._lazyAddAttrs,v,x,z,s,p,y,t,r=this._getClasses(),o=this._getAttrCfgs(),w=r.length-1;for(z=w;z>=0;z--){v=r[z];x=v.prototype;t=v._yuibuild&&v._yuibuild.exts;if(t){for(s=0,p=t.length;s<p;s++){t[s].apply(this,arguments);}}this.addAttrs(this._filterAttrCfgs(v,o),u,q);if(this._allowAdHocAttrs&&z===w){this.addAttrs(this._filterAdHocAttrs(o,u),u,q);}if(x.hasOwnProperty(c)){x.initializer.apply(this,arguments);}if(t){for(s=0;s<p;s++){y=t[s].prototype;if(y.hasOwnProperty(c)){y.initializer.apply(this,arguments);}}}}},_destroyHierarchy:function(){var s,t,w,u,q,o,r,v,p=this._getClasses();for(w=0,u=p.length;w<u;w++){s=p[w];t=s.prototype;r=s._yuibuild&&s._yuibuild.exts;if(r){for(q=0,o=r.length;q<o;q++){v=r[q].prototype;if(v.hasOwnProperty(k)){v.destructor.apply(this,arguments);}}}if(t.hasOwnProperty(k)){t.destructor.apply(this,arguments);}}},toString:function(){return this.name+"["+a.stamp(this,true)+"]";}};a.mix(n,g,false,null,1);n.prototype.constructor=n;a.BaseCore=n;},"3.5.1",{requires:["attribute-core"]});+YUI.add("base-core",function(e,t){function v(e){this._BaseInvoked||(this._BaseInvoked=!0,this._initBase(e))}var n=e.Object,r=e.Lang,i=".",s="initialized",o="destroyed",u="initializer",a="value",f=Object.prototype.constructor,l="deep",c="shallow",h="destructor",p=e.AttributeCore,d=function(e,t,n){var r;for(r in t)n[r]&&(e[r]=t[r]);return e};v._ATTR_CFG=p._ATTR_CFG.concat("cloneDefaultValue"),v._ATTR_CFG_HASH=e.Array.hash(v._ATTR_CFG),v._NON_ATTRS_CFG=["plugins"],v.NAME="baseCore",v.ATTRS={initialized:{readOnly:!0,value:!1},destroyed:{readOnly:!0,value:!1}},v.prototype={_initBase:function(t){e.stamp(this),this._initAttribute(t);var n=e.Plugin&&e.Plugin.Host;this._initPlugins&&n&&n.call(this),this._lazyAddAttrs!==!1&&(this._lazyAddAttrs=!0),this.name=this.constructor.NAME,this.init.apply(this,arguments)},_initAttribute:function(){p.apply(this)},init:function(e){return this._baseInit(e),this},_baseInit:function(e){this._initHierarchy(e),this._initPlugins&&this._initPlugins(e),this._set(s,!0)},destroy:function(){return this._baseDestroy(),this},_baseDestroy:function(){this._destroyPlugins&&this._destroyPlugins(),this._destroyHierarchy(),this._set(o,!0)},_getClasses:function(){return this._classes||this._initHierarchyData(),this._classes},_getAttrCfgs:function(){return this._attrs||this._initHierarchyData(),this._attrs},_filterAttrCfgs:function(e,t){var n=null,r,i=e.ATTRS;if(i)for(r in i)t[r]&&(n=n||{},n[r]=t[r],t[r]=null);return n},_filterAdHocAttrs:function(e,t){var n,r=this._nonAttrs,i;if(t){n={};for(i in t)!e[i]&&!r[i]&&t.hasOwnProperty(i)&&(n[i]={value:t[i]})}return n},_initHierarchyData:function(){var e=this.constructor,t,n,r,i=this._allowAdHocAttrs?{}:null,s=[],o=[];while(e){s[s.length]=e,e.ATTRS&&(o[o.length]=e.ATTRS);if(this._allowAdHocAttrs){r=e._NON_ATTRS_CFG;if(r)for(t=0,n=r.length;t<n;t++)i[r[t]]=!0}e=e.superclass?e.superclass.constructor:null}this._classes=s,this._nonAttrs=i,this._attrs=this._aggregateAttrs(o)},_attrCfgHash:function(){return v._ATTR_CFG_HASH},_aggregateAttrs:function(t){var s,o,u,h,p,v,m,g=this._attrCfgHash(),y,b={};if(t)for(v=t.length-1;v>=0;--v){o=t[v];for(s in o)o.hasOwnProperty(s)&&(u=d({},o[s],g),h=u.value,m=u.cloneDefaultValue,h&&(m===undefined&&(f===h.constructor||r.isArray(h))||m===l||m===!0?u.value=e.clone(h):m===c&&(u.value=e.merge(h))),p=null,s.indexOf(i)!==-1&&(p=s.split(i),s=p.shift()),y=b[s],p&&y&&y.value?n.setValue(y.value,p,h):p||(y?(y.valueFn&&a in u&&(y.valueFn=null),d(y,u,g)):b[s]=u))}return b},_initHierarchy:function(e){var t=this._lazyAddAttrs,n,r,i,s,o,a,f,l=this._getClasses(),c=this._getAttrCfgs(),h=l.length-1;for(i=h;i>=0;i--){n=l[i],r=n.prototype,f=n._yuibuild&&n._yuibuild.exts;if(f)for(s=0,o=f.length;s<o;s++)f[s].apply(this,arguments);this.addAttrs(this._filterAttrCfgs(n,c),e,t),this._allowAdHocAttrs&&i===h&&this.addAttrs(this._filterAdHocAttrs(c,e),e,t),r.hasOwnProperty(u)&&r.initializer.apply(this,arguments);if(f)for(s=0;s<o;s++)a=f[s].prototype,a.hasOwnProperty(u)&&a.initializer.apply(this,arguments)}},_destroyHierarchy:function(){var e,t,n,r,i,s,o,u,a=this._getClasses();for(n=0,r=a.length;n<r;n++){e=a[n],t=e.prototype,o=e._yuibuild&&e._yuibuild.exts;if(o)for(i=0,s=o.length;i<s;i++)u=o[i].prototype,u.hasOwnProperty(h)&&u.destructor.apply(this,arguments);t.hasOwnProperty(h)&&t.destructor.apply(this,arguments)}},toString:function(){return this.name+"["+e.stamp(this,!0)+"]"}},e.mix(v,p,!1,null,1),v.prototype.constructor=v,e.BaseCore=v},"3.7.1",{requires:["attribute-core"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('base-core', function(Y) {+YUI.add('base-core', function (Y, NAME) { /** * The base module provides the Base class, which objects requiring attribute and custom event support can extend. @@ -30,6 +30,7 @@ INITIALIZED = "initialized", DESTROYED = "destroyed", INITIALIZER = "initializer",+ VALUE = "value", OBJECT_CONSTRUCTOR = Object.prototype.constructor, DEEP = "deep", SHALLOW = "shallow",@@ -451,6 +452,7 @@ i, clone, cfgPropsHash = this._attrCfgHash(),+ aggAttr, aggAttrs = {}; if (allAttrs) {@@ -461,8 +463,6 @@ if (attrs.hasOwnProperty(attr)) { // Protect config passed in- //cfg = Y.mix({}, attrs[attr], true, cfgProps);- //cfg = Y.Object(attrs[attr]); cfg = _wlmix({}, attrs[attr], cfgPropsHash); val = cfg.value;@@ -484,13 +484,17 @@ attr = path.shift(); } - if (path && aggAttrs[attr] && aggAttrs[attr].value) {- O.setValue(aggAttrs[attr].value, path, val);+ aggAttr = aggAttrs[attr];+ if (path && aggAttr && aggAttr.value) {+ O.setValue(aggAttr.value, path, val); } else if (!path) {- if (!aggAttrs[attr]) {+ if (!aggAttr) { aggAttrs[attr] = cfg; } else {- _wlmix(aggAttrs[attr], cfg, cfgPropsHash);+ if (aggAttr.valueFn && VALUE in cfg) {+ aggAttr.valueFn = null; + }+ _wlmix(aggAttr, cfg, cfgPropsHash); } } }@@ -613,4 +617,4 @@ Y.BaseCore = BaseCore; -}, '3.5.1' ,{requires:['attribute-core']});+}, '3.7.1', {"requires": ["attribute-core"]});
@@ -0,0 +1,81 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/base-pluginhost/base-pluginhost.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/base-pluginhost/base-pluginhost.js",+ code: []+};+_yuitest_coverage["build/base-pluginhost/base-pluginhost.js"].code=["YUI.add('base-pluginhost', function (Y, NAME) {",""," /**"," * The base-pluginhost submodule adds Plugin support to Base, by augmenting Base with "," * Plugin.Host and setting up static (class level) Base.plug and Base.unplug methods."," *"," * @module base"," * @submodule base-pluginhost"," * @for Base"," */",""," var Base = Y.Base,"," PluginHost = Y.Plugin.Host;",""," Y.mix(Base, PluginHost, false, null, 1);",""," /**"," * Alias for <a href=\"Plugin.Host.html#method_Plugin.Host.plug\">Plugin.Host.plug</a>. See aliased "," * method for argument and return value details."," *"," * @method plug"," * @static"," */"," Base.plug = PluginHost.plug;",""," /**"," * Alias for <a href=\"Plugin.Host.html#method_Plugin.Host.unplug\">Plugin.Host.unplug</a>. See the "," * aliased method for argument and return value details."," *"," * @method unplug"," * @static"," */"," Base.unplug = PluginHost.unplug;","","","}, '3.7.1', {\"requires\": [\"base-base\", \"pluginhost\"]});"];+_yuitest_coverage["build/base-pluginhost/base-pluginhost.js"].lines = {"1":0,"12":0,"15":0,"24":0,"33":0};+_yuitest_coverage["build/base-pluginhost/base-pluginhost.js"].functions = {"(anonymous 1):1":0};+_yuitest_coverage["build/base-pluginhost/base-pluginhost.js"].coveredLines = 5;+_yuitest_coverage["build/base-pluginhost/base-pluginhost.js"].coveredFunctions = 1;+_yuitest_coverline("build/base-pluginhost/base-pluginhost.js", 1);+YUI.add('base-pluginhost', function (Y, NAME) {++ /**+ * The base-pluginhost submodule adds Plugin support to Base, by augmenting Base with + * Plugin.Host and setting up static (class level) Base.plug and Base.unplug methods.+ *+ * @module base+ * @submodule base-pluginhost+ * @for Base+ */++ _yuitest_coverfunc("build/base-pluginhost/base-pluginhost.js", "(anonymous 1)", 1);+_yuitest_coverline("build/base-pluginhost/base-pluginhost.js", 12);+var Base = Y.Base,+ PluginHost = Y.Plugin.Host;++ _yuitest_coverline("build/base-pluginhost/base-pluginhost.js", 15);+Y.mix(Base, PluginHost, false, null, 1);++ /**+ * Alias for <a href="Plugin.Host.html#method_Plugin.Host.plug">Plugin.Host.plug</a>. See aliased + * method for argument and return value details.+ *+ * @method plug+ * @static+ */+ _yuitest_coverline("build/base-pluginhost/base-pluginhost.js", 24);+Base.plug = PluginHost.plug;++ /**+ * Alias for <a href="Plugin.Host.html#method_Plugin.Host.unplug">Plugin.Host.unplug</a>. See the + * aliased method for argument and return value details.+ *+ * @method unplug+ * @static+ */+ _yuitest_coverline("build/base-pluginhost/base-pluginhost.js", 33);+Base.unplug = PluginHost.unplug;+++}, '3.7.1', {"requires": ["base-base", "pluginhost"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('base-pluginhost', function(Y) {+YUI.add('base-pluginhost', function (Y, NAME) { /** * The base-pluginhost submodule adds Plugin support to Base, by augmenting Base with @@ -39,4 +39,4 @@ Base.unplug = PluginHost.unplug; -}, '3.5.1' ,{requires:['base-base', 'pluginhost']});+}, '3.7.1', {"requires": ["base-base", "pluginhost"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("base-pluginhost",function(c){var a=c.Base,b=c.Plugin.Host;c.mix(a,b,false,null,1);a.plug=b.plug;a.unplug=b.unplug;},"3.5.1",{requires:["base-base","pluginhost"]});+YUI.add("base-pluginhost",function(e,t){var n=e.Base,r=e.Plugin.Host;e.mix(n,r,!1,null,1),n.plug=r.plug,n.unplug=r.unplug},"3.7.1",{requires:["base-base","pluginhost"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('base-pluginhost', function(Y) {+YUI.add('base-pluginhost', function (Y, NAME) { /** * The base-pluginhost submodule adds Plugin support to Base, by augmenting Base with @@ -39,4 +39,4 @@ Base.unplug = PluginHost.unplug; -}, '3.5.1' ,{requires:['base-base', 'pluginhost']});+}, '3.7.1', {"requires": ["base-base", "pluginhost"]});
binary file changed (15613 → absent bytes)
@@ -1,344 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-YUI.add('button-base', function(Y) {--/**-* Provides an interface for working with button-like DOM nodes-*-* @module button-* @main button-* @since 3.5.0-*/--/**-* returns a properly formed yui class name-*-* @method-* @param str {String} string to be appended at the end of class name-* @return-* @private-*/-function makeClassName(str) {- if (str) {- return Y.ClassNameManager.getClassName(Button.NAME, str);- } else {- return Y.ClassNameManager.getClassName(Button.NAME);- }-}--/**-* Creates a button-*-* @class Button-* @param config {Object} Configuration object-* @constructor-*/-function Button(config) {- this.initializer(config);-}--Button.prototype = {- TEMPLATE: '<button/>',-- constructor: Button,-- enable: function() {- this.set('disabled', false);- },-- disable: function() {- this.set('disabled', true);- },- - _initAttributes: function(config) {- config.label = config.label || config.host.getContent(); //Todo: Is this the right place?- Y.AttributeCore.call(this, Button.ATTRS, config);- },-- _initNode: function(config) {- if (config.srcNode) {- this._host = Y.one(config.srcNode);- } else {- this._host = Y.Node.create(this.TEMPLATE);- }- },-- _uiSetLabel: function(value) {- var node = this._host,- attr = (node.get('tagName').toLowerCase() === 'input') ? 'value' : 'text';-- node.set(attr, value);- return value;- },-- _uiSetDisabled: function(value) {- var node = this.getNode();- node.getDOMNode().disabled = value; // avoid rerunning setter when this === node- node.toggleClass(Button.CLASS_NAMES.DISABLED, value);- return value;- },-- _uiGetLabel: function() {- var node = this._host,- attr = (node.get('tagName').toLowerCase() === 'input') ? 'value' : 'text',- value;-- value = node.get(attr);- return value;- },-- getNode: function() {- return this._host;- },-- /**- * @method initializer- * @description Internal init() handler.- * @param config {Object} Config object.- * @private- */- initializer: function(config) {- this._initNode(config);- this._initAttributes(config);- this.renderUI(config);- },- - /**- * @method renderUI- * @description Renders any UI/DOM elements for Button instances- * @private- */- renderUI: function(config) {- var node = this._host;- - // Set some default node attributes- node.addClass(Button.CLASS_NAMES.BUTTON);- node.set('role', 'button');- }-};--/** -* Attribute configuration. -*-* @property ATTRS-* @type {Object}-* @private-* @static-*/-Button.ATTRS = {- label: {- setter: '_uiSetLabel',- getter: '_uiGetLabel',- lazyAdd: false- },-- disabled: {- value: false,- setter: '_uiSetDisabled',- lazyAdd: false- }-};--/**-* Name of this component.-*-* @property NAME-* @type String-* @static-*/-Button.NAME = "button";--/** -* Array of static constants used to identify the classnames applied to the Button DOM objects-*-* @property CLASS_NAMES-* @type {Array}-* @static-*/-Button.CLASS_NAMES = {- BUTTON : makeClassName(),- DISABLED: makeClassName('disabled')-};--Y.mix(Button.prototype, Y.AttributeCore.prototype);--// Export Button-Y.ButtonBase = Button;-function ButtonPlugin(config) {- if (!this._initNode) { // hand off to factory when called without new - return ButtonPlugin.factory(config);- }- ButtonPlugin.superclass.constructor.apply(this, arguments);-}--Y.extend(ButtonPlugin, Y.ButtonBase, {- // TODO: point to method (_uiSetLabel, etc) instead of getter/setter- _afterNodeGet: function (name) {- var ATTRS = this.constructor.ATTRS,- fn = ATTRS[name] && ATTRS[name].getter && this[ATTRS[name].getter];- if (fn) {- return new Y.Do.AlterReturn('get ' + name, fn.call(this));- }- }, -- _afterNodeSet: function (name, val) {- var ATTRS = this.constructor.ATTRS,- fn = ATTRS[name] && ATTRS[name].setter && this[ATTRS[name].setter];- if (fn) {- fn.call(this, val);- }- },-- _initNode: function(config) {- var node = config.host;- this._host = node;- Y.Do.after(this._afterNodeGet, node, 'get', this);- Y.Do.after(this._afterNodeSet, node, 'set', this);- },- destroy: function(){- // TODO: Anything?- }-}, {- ATTRS: Y.merge(Y.ButtonBase.ATTRS),- NAME: 'buttonPlugin',- NS: 'button'-});--// (node)-// (node, config)-// (config)-ButtonPlugin.factory = function(node, config) {- - if (node && !config) {- if (! (node.nodeType || node.getDOMNode || typeof node == 'string')) {- config = node;- node = config.srcNode;- }- }- node = node || config && config.srcNode || Y.DOM.create(Y.Plugin.Button.prototype.TEMPLATE);-- return Y.one(node).plug(Y.Plugin.Button, config);-};--Y.Plugin.Button = ButtonPlugin;--function ButtonWidget(config) {- ButtonWidget.superclass.constructor.apply(this, arguments);-}--Y.extend(ButtonWidget, Y.Widget, {- initializer: function(config) {- this._host = this.get('boundingBox');- },-- BOUNDING_TEMPLATE: Y.ButtonBase.prototype.TEMPLATE,- CONTENT_TEMPLATE: null,-- bindUI: function() {- var button = this;- this.after('labelChange', this._afterLabelChange);- this.after('disabledChange', this._afterDisabledChange);- this.after('selectedChange', this._afterSelectedChange);- },-- _uiSetSelected: function(value) {- this.get('contentBox').toggleClass('yui3-button-selected', value).set('aria-pressed', value); // TODO should support aria-checked (if applicable)- },- _afterLabelChange: function(e) {- this._uiSetLabel(e.newVal);- },-- _afterDisabledChange: function(e) {- this._uiSetDisabled(e.newVal);- },-- _afterSelectedChange: function(e) {- this._uiSetSelected(e.newVal);- },-- syncUI: function() {- this._uiSetLabel(this.get('label'));- this._uiSetDisabled(this.get('disabled'));- this._uiSetSelected(this.get('selected'));- },--}, {- NAME: 'button',-});--ButtonWidget.ATTRS = {- label: {- value: Y.ButtonBase.ATTRS.label.value- },-- disabled: {- value: false- },-- selected: {- value: false- }-};--ButtonWidget.HTML_PARSER = {- label: function(node) {- this._host = node; // TODO: remove- return this._uiGetLabel();- },-- disabled: function(node) {- return node.getDOMNode().disabled;- },-- selected: function(node) {- return node.hasClass('yui3-button-selected');- }-};--Y.mix(ButtonWidget.prototype, Y.ButtonBase.prototype);--Y.Button = ButtonWidget;------function ToggleButton(config) {- ButtonWidget.superclass.constructor.apply(this, arguments);-}--// TODO: move to ButtonBase subclass to enable toggle plugin, widget, etc.-Y.extend(ToggleButton, Y.Button, {- trigger: 'click',-- select: function() {- this.set('selected', true);- },-- unselect: function() {- this.set('selected', false);- },-- toggle: function() {- var button = this;- button.set('selected', !button.get('selected'));- },-- bindUI: function() {- var button = this;- ToggleButton.superclass.bindUI.call(button);- button.get('contentBox').set('role', 'toggle');- button.get('contentBox').on(button.trigger, button.toggle, button);- }-}, {- NAME: 'toggleButton'-});--Y.ToggleButton = ToggleButton;---}, '3.5.1' ,{requires:['widget', 'classnamemanager', 'node']});
@@ -1,7 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-YUI.add("button-base",function(f){function d(g){if(g){return f.ClassNameManager.getClassName(a.NAME,g);}else{return f.ClassNameManager.getClassName(a.NAME);}}function a(g){this.initializer(g);}a.prototype={TEMPLATE:"<button/>",constructor:a,enable:function(){this.set("disabled",false);},disable:function(){this.set("disabled",true);},_initAttributes:function(g){g.label=g.label||g.host.getContent();f.AttributeCore.call(this,a.ATTRS,g);},_initNode:function(g){if(g.srcNode){this._host=f.one(g.srcNode);}else{this._host=f.Node.create(this.TEMPLATE);}},_uiSetLabel:function(i){var h=this._host,g=(h.get("tagName").toLowerCase()==="input")?"value":"text";h.set(g,i);return i;},_uiSetDisabled:function(h){var g=this.getNode();g.getDOMNode().disabled=h;g.toggleClass(a.CLASS_NAMES.DISABLED,h);return h;},_uiGetLabel:function(){var h=this._host,g=(h.get("tagName").toLowerCase()==="input")?"value":"text",i;i=h.get(g);return i;},getNode:function(){return this._host;},initializer:function(g){this._initNode(g);this._initAttributes(g);this.renderUI(g);},renderUI:function(g){var h=this._host;h.addClass(a.CLASS_NAMES.BUTTON);h.set("role","button");}};a.ATTRS={label:{setter:"_uiSetLabel",getter:"_uiGetLabel",lazyAdd:false},disabled:{value:false,setter:"_uiSetDisabled",lazyAdd:false}};a.NAME="button";a.CLASS_NAMES={BUTTON:d(),DISABLED:d("disabled")};f.mix(a.prototype,f.AttributeCore.prototype);f.ButtonBase=a;function b(g){if(!this._initNode){return b.factory(g);}b.superclass.constructor.apply(this,arguments);}f.extend(b,f.ButtonBase,{_afterNodeGet:function(h){var g=this.constructor.ATTRS,i=g[h]&&g[h].getter&&this[g[h].getter];if(i){return new f.Do.AlterReturn("get "+h,i.call(this));}},_afterNodeSet:function(h,j){var g=this.constructor.ATTRS,i=g[h]&&g[h].setter&&this[g[h].setter];if(i){i.call(this,j);}},_initNode:function(g){var h=g.host;this._host=h;f.Do.after(this._afterNodeGet,h,"get",this);f.Do.after(this._afterNodeSet,h,"set",this);},destroy:function(){}},{ATTRS:f.merge(f.ButtonBase.ATTRS),NAME:"buttonPlugin",NS:"button"});b.factory=function(h,g){if(h&&!g){if(!(h.nodeType||h.getDOMNode||typeof h=="string")){g=h;h=g.srcNode;}}h=h||g&&g.srcNode||f.DOM.create(f.Plugin.Button.prototype.TEMPLATE);return f.one(h).plug(f.Plugin.Button,g);};f.Plugin.Button=b;function c(g){c.superclass.constructor.apply(this,arguments);}f.extend(c,f.Widget,{initializer:function(g){this._host=this.get("boundingBox");},BOUNDING_TEMPLATE:f.ButtonBase.prototype.TEMPLATE,CONTENT_TEMPLATE:null,bindUI:function(){var g=this;this.after("labelChange",this._afterLabelChange);this.after("disabledChange",this._afterDisabledChange);this.after("selectedChange",this._afterSelectedChange);},_uiSetSelected:function(g){this.get("contentBox").toggleClass("yui3-button-selected",g).set("aria-pressed",g);},_afterLabelChange:function(g){this._uiSetLabel(g.newVal);},_afterDisabledChange:function(g){this._uiSetDisabled(g.newVal);},_afterSelectedChange:function(g){this._uiSetSelected(g.newVal);},syncUI:function(){this._uiSetLabel(this.get("label"));this._uiSetDisabled(this.get("disabled"));this._uiSetSelected(this.get("selected"));},},{NAME:"button",});c.ATTRS={label:{value:f.ButtonBase.ATTRS.label.value},disabled:{value:false},selected:{value:false}};c.HTML_PARSER={label:function(g){this._host=g;return this._uiGetLabel();},disabled:function(g){return g.getDOMNode().disabled;},selected:function(g){return g.hasClass("yui3-button-selected");}};f.mix(c.prototype,f.ButtonBase.prototype);f.Button=c;function e(g){c.superclass.constructor.apply(this,arguments);}f.extend(e,f.Button,{trigger:"click",select:function(){this.set("selected",true);},unselect:function(){this.set("selected",false);},toggle:function(){var g=this;g.set("selected",!g.get("selected"));},bindUI:function(){var g=this;e.superclass.bindUI.call(g);g.get("contentBox").set("role","toggle");g.get("contentBox").on(g.trigger,g.toggle,g);}},{NAME:"toggleButton"});f.ToggleButton=e;},"3.5.1",{requires:["widget","classnamemanager","node"]});
@@ -1,344 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-YUI.add('button-base', function(Y) {--/**-* Provides an interface for working with button-like DOM nodes-*-* @module button-* @main button-* @since 3.5.0-*/--/**-* returns a properly formed yui class name-*-* @method-* @param str {String} string to be appended at the end of class name-* @return-* @private-*/-function makeClassName(str) {- if (str) {- return Y.ClassNameManager.getClassName(Button.NAME, str);- } else {- return Y.ClassNameManager.getClassName(Button.NAME);- }-}--/**-* Creates a button-*-* @class Button-* @param config {Object} Configuration object-* @constructor-*/-function Button(config) {- this.initializer(config);-}--Button.prototype = {- TEMPLATE: '<button/>',-- constructor: Button,-- enable: function() {- this.set('disabled', false);- },-- disable: function() {- this.set('disabled', true);- },- - _initAttributes: function(config) {- config.label = config.label || config.host.getContent(); //Todo: Is this the right place?- Y.AttributeCore.call(this, Button.ATTRS, config);- },-- _initNode: function(config) {- if (config.srcNode) {- this._host = Y.one(config.srcNode);- } else {- this._host = Y.Node.create(this.TEMPLATE);- }- },-- _uiSetLabel: function(value) {- var node = this._host,- attr = (node.get('tagName').toLowerCase() === 'input') ? 'value' : 'text';-- node.set(attr, value);- return value;- },-- _uiSetDisabled: function(value) {- var node = this.getNode();- node.getDOMNode().disabled = value; // avoid rerunning setter when this === node- node.toggleClass(Button.CLASS_NAMES.DISABLED, value);- return value;- },-- _uiGetLabel: function() {- var node = this._host,- attr = (node.get('tagName').toLowerCase() === 'input') ? 'value' : 'text',- value;-- value = node.get(attr);- return value;- },-- getNode: function() {- return this._host;- },-- /**- * @method initializer- * @description Internal init() handler.- * @param config {Object} Config object.- * @private- */- initializer: function(config) {- this._initNode(config);- this._initAttributes(config);- this.renderUI(config);- },- - /**- * @method renderUI- * @description Renders any UI/DOM elements for Button instances- * @private- */- renderUI: function(config) {- var node = this._host;- - // Set some default node attributes- node.addClass(Button.CLASS_NAMES.BUTTON);- node.set('role', 'button');- }-};--/** -* Attribute configuration. -*-* @property ATTRS-* @type {Object}-* @private-* @static-*/-Button.ATTRS = {- label: {- setter: '_uiSetLabel',- getter: '_uiGetLabel',- lazyAdd: false- },-- disabled: {- value: false,- setter: '_uiSetDisabled',- lazyAdd: false- }-};--/**-* Name of this component.-*-* @property NAME-* @type String-* @static-*/-Button.NAME = "button";--/** -* Array of static constants used to identify the classnames applied to the Button DOM objects-*-* @property CLASS_NAMES-* @type {Array}-* @static-*/-Button.CLASS_NAMES = {- BUTTON : makeClassName(),- DISABLED: makeClassName('disabled')-};--Y.mix(Button.prototype, Y.AttributeCore.prototype);--// Export Button-Y.ButtonBase = Button;-function ButtonPlugin(config) {- if (!this._initNode) { // hand off to factory when called without new - return ButtonPlugin.factory(config);- }- ButtonPlugin.superclass.constructor.apply(this, arguments);-}--Y.extend(ButtonPlugin, Y.ButtonBase, {- // TODO: point to method (_uiSetLabel, etc) instead of getter/setter- _afterNodeGet: function (name) {- var ATTRS = this.constructor.ATTRS,- fn = ATTRS[name] && ATTRS[name].getter && this[ATTRS[name].getter];- if (fn) {- return new Y.Do.AlterReturn('get ' + name, fn.call(this));- }- }, -- _afterNodeSet: function (name, val) {- var ATTRS = this.constructor.ATTRS,- fn = ATTRS[name] && ATTRS[name].setter && this[ATTRS[name].setter];- if (fn) {- fn.call(this, val);- }- },-- _initNode: function(config) {- var node = config.host;- this._host = node;- Y.Do.after(this._afterNodeGet, node, 'get', this);- Y.Do.after(this._afterNodeSet, node, 'set', this);- },- destroy: function(){- // TODO: Anything?- }-}, {- ATTRS: Y.merge(Y.ButtonBase.ATTRS),- NAME: 'buttonPlugin',- NS: 'button'-});--// (node)-// (node, config)-// (config)-ButtonPlugin.factory = function(node, config) {- - if (node && !config) {- if (! (node.nodeType || node.getDOMNode || typeof node == 'string')) {- config = node;- node = config.srcNode;- }- }- node = node || config && config.srcNode || Y.DOM.create(Y.Plugin.Button.prototype.TEMPLATE);-- return Y.one(node).plug(Y.Plugin.Button, config);-};--Y.Plugin.Button = ButtonPlugin;--function ButtonWidget(config) {- ButtonWidget.superclass.constructor.apply(this, arguments);-}--Y.extend(ButtonWidget, Y.Widget, {- initializer: function(config) {- this._host = this.get('boundingBox');- },-- BOUNDING_TEMPLATE: Y.ButtonBase.prototype.TEMPLATE,- CONTENT_TEMPLATE: null,-- bindUI: function() {- var button = this;- this.after('labelChange', this._afterLabelChange);- this.after('disabledChange', this._afterDisabledChange);- this.after('selectedChange', this._afterSelectedChange);- },-- _uiSetSelected: function(value) {- this.get('contentBox').toggleClass('yui3-button-selected', value).set('aria-pressed', value); // TODO should support aria-checked (if applicable)- },- _afterLabelChange: function(e) {- this._uiSetLabel(e.newVal);- },-- _afterDisabledChange: function(e) {- this._uiSetDisabled(e.newVal);- },-- _afterSelectedChange: function(e) {- this._uiSetSelected(e.newVal);- },-- syncUI: function() {- this._uiSetLabel(this.get('label'));- this._uiSetDisabled(this.get('disabled'));- this._uiSetSelected(this.get('selected'));- },--}, {- NAME: 'button',-});--ButtonWidget.ATTRS = {- label: {- value: Y.ButtonBase.ATTRS.label.value- },-- disabled: {- value: false- },-- selected: {- value: false- }-};--ButtonWidget.HTML_PARSER = {- label: function(node) {- this._host = node; // TODO: remove- return this._uiGetLabel();- },-- disabled: function(node) {- return node.getDOMNode().disabled;- },-- selected: function(node) {- return node.hasClass('yui3-button-selected');- }-};--Y.mix(ButtonWidget.prototype, Y.ButtonBase.prototype);--Y.Button = ButtonWidget;------function ToggleButton(config) {- ButtonWidget.superclass.constructor.apply(this, arguments);-}--// TODO: move to ButtonBase subclass to enable toggle plugin, widget, etc.-Y.extend(ToggleButton, Y.Button, {- trigger: 'click',-- select: function() {- this.set('selected', true);- },-- unselect: function() {- this.set('selected', false);- },-- toggle: function() {- var button = this;- button.set('selected', !button.get('selected'));- },-- bindUI: function() {- var button = this;- ToggleButton.superclass.bindUI.call(button);- button.get('contentBox').set('role', 'toggle');- button.get('contentBox').on(button.trigger, button.toggle, button);- }-}, {- NAME: 'toggleButton'-});--Y.ToggleButton = ToggleButton;---}, '3.5.1' ,{requires:['widget', 'classnamemanager', 'node']});
@@ -0,0 +1,340 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/button-core/button-core.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/button-core/button-core.js",+ code: []+};+_yuitest_coverage["build/button-core/button-core.js"].code=["YUI.add('button-core', function (Y, NAME) {","","/**","* Provides an interface for working with button-like DOM nodes","*","* @module button-core","* @since 3.5.0","*/","","var getClassName = Y.ClassNameManager.getClassName;","","/**","* Creates a button","*","* @class ButtonCore","* @param config {Object} Configuration object","* @constructor","*/","function Button(config) {"," this.initializer(config);","}","","Button.prototype = {"," TEMPLATE: '<button/>',",""," constructor: Button,",""," /**"," * @method initializer"," * @description Internal init() handler."," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this._initNode(config);"," this._initAttributes(config);"," this._renderUI(config);"," },",""," /**"," * @method _initNode"," * @description Node initializer"," * @param config {Object} Config object."," * @private"," */"," _initNode: function(config) {"," if (config.host) {"," this._host = Y.one(config.host);"," } else {"," this._host = Y.Node.create(this.TEMPLATE);"," }"," },",""," /**"," * @method _initAttributes"," * @description Attribute initializer"," * @param config {Object} Config object."," * @private"," */"," _initAttributes: function(config) {"," var host = this._host,"," node = host.one('.' + Button.CLASS_NAMES.LABEL) || host;"," "," config.label = config.label || this._getLabel(node);"," Y.AttributeCore.call(this, Button.ATTRS, config);"," },",""," /**"," * @method renderUI"," * @description Renders any UI/DOM elements for Button instances"," * @param config {Object} Config object."," * @private"," */"," _renderUI: function(config) {"," var node = this.getNode(),"," tagName = node.get('tagName').toLowerCase();",""," // Set some default node attributes"," node.addClass(Button.CLASS_NAMES.BUTTON);"," "," if (tagName !== 'button' && tagName !== 'input') {"," node.set('role', 'button'); "," }"," },",""," /**"," * @method enable "," * @description Sets the button's `disabled` DOM attribute to false"," * @public"," */"," enable: function() {"," this.set('disabled', false);"," },",""," /**"," * @method disable"," * @description Sets the button's `disabled` DOM attribute to true"," * @public"," */"," disable: function() {"," this.set('disabled', true);"," },",""," /**"," * @method getNode"," * @description Gets the host node for this button instance"," * @public"," */"," getNode: function() {"," return this._host;"," },"," "," /**"," * @method _getLabel"," * @description Getter for a button's 'label' ATTR"," * @private"," */"," _getLabel: function () {"," var node = this.getNode(),"," tagName = node.get('tagName').toLowerCase(),"," label;",""," if (tagName === 'input') {"," label = node.get('value');"," }"," else {"," label = (node.one('.' + Button.CLASS_NAMES.LABEL) || node).get('text');"," }"," "," return label;"," },"," "," /**"," * @method _uiSetLabel"," * @description Setter for a button's 'label' ATTR"," * @param label {string}"," * @private"," */"," _uiSetLabel: function (label) {"," var node = this.getNode(),"," tagName = node.get('tagName').toLowerCase();",""," if (tagName === 'input') {"," node.set('value', label);"," } else {"," (node.one('.' + Button.CLASS_NAMES.LABEL) || node).set('text', label);"," }",""," return label;"," },",""," /**"," * @method _uiSetDisabled"," * @description Setter for the 'disabled' ATTR"," * @param value {boolean}"," * @private"," */"," _uiSetDisabled: function(value) {"," var node = this.getNode();"," "," node.getDOMNode().disabled = value; // avoid rerunning setter when this === node"," node.toggleClass(Button.CLASS_NAMES.DISABLED, value);"," "," return value;"," }","};","","/**","* Attribute configuration.","*","* @property ATTRS","* @type {Object}","* @private","* @static","*/","Button.ATTRS = {"," label: {"," setter: '_uiSetLabel',"," getter: '_getLabel',"," lazyAdd: false"," },",""," disabled: {"," value: false,"," setter: '_uiSetDisabled',"," lazyAdd: false"," }","};","","/**","* Name of this component.","*","* @property NAME","* @type String","* @static","*/","Button.NAME = \"button\";","","/**","* Array of static constants used to identify the classnames applied to DOM nodes","*","* @property CLASS_NAMES","* @type {Object}","* @public","* @static","*/","Button.CLASS_NAMES = {"," BUTTON : getClassName('button'),"," DISABLED: getClassName('button', 'disabled'),"," SELECTED: getClassName('button', 'selected'),"," LABEL : getClassName('button', 'label')","};","","/**","* Array of static constants used to for applying ARIA states","*","* @property CLASS_NAMES","* @type {Object}","* @private","* @static","*/","Button.ARIA_STATES = {"," PRESSED : 'aria-pressed',"," CHECKED : 'aria-checked'","};","","/**","* Array of static constants used to for applying ARIA roles","*","* @property CLASS_NAMES","* @type {Object}","* @private","* @static","*/","Button.ARIA_ROLES = {"," BUTTON : 'button',"," CHECKBOX: 'checkbox',"," TOGGLE : 'toggle'","};","","Y.mix(Button.prototype, Y.AttributeCore.prototype);","","// Export Button","Y.ButtonCore = Button;","","","}, '3.7.1', {\"requires\": [\"attribute-core\", \"classnamemanager\", \"node-base\"]});"];+_yuitest_coverage["build/button-core/button-core.js"].lines = {"1":0,"10":0,"19":0,"20":0,"23":0,"35":0,"36":0,"37":0,"47":0,"48":0,"50":0,"61":0,"64":0,"65":0,"75":0,"79":0,"81":0,"82":0,"92":0,"101":0,"110":0,"119":0,"123":0,"124":0,"127":0,"130":0,"140":0,"143":0,"144":0,"146":0,"149":0,"159":0,"161":0,"162":0,"164":0,"176":0,"197":0,"207":0,"222":0,"235":0,"241":0,"244":0};+_yuitest_coverage["build/button-core/button-core.js"].functions = {"Button:19":0,"initializer:34":0,"_initNode:46":0,"_initAttributes:60":0,"_renderUI:74":0,"enable:91":0,"disable:100":0,"getNode:109":0,"_getLabel:118":0,"_uiSetLabel:139":0,"_uiSetDisabled:158":0,"(anonymous 1):1":0};+_yuitest_coverage["build/button-core/button-core.js"].coveredLines = 42;+_yuitest_coverage["build/button-core/button-core.js"].coveredFunctions = 12;+_yuitest_coverline("build/button-core/button-core.js", 1);+YUI.add('button-core', function (Y, NAME) {++/**+* Provides an interface for working with button-like DOM nodes+*+* @module button-core+* @since 3.5.0+*/++_yuitest_coverfunc("build/button-core/button-core.js", "(anonymous 1)", 1);+_yuitest_coverline("build/button-core/button-core.js", 10);+var getClassName = Y.ClassNameManager.getClassName;++/**+* Creates a button+*+* @class ButtonCore+* @param config {Object} Configuration object+* @constructor+*/+_yuitest_coverline("build/button-core/button-core.js", 19);+function Button(config) {+ _yuitest_coverfunc("build/button-core/button-core.js", "Button", 19);+_yuitest_coverline("build/button-core/button-core.js", 20);+this.initializer(config);+}++_yuitest_coverline("build/button-core/button-core.js", 23);+Button.prototype = {+ TEMPLATE: '<button/>',++ constructor: Button,++ /**+ * @method initializer+ * @description Internal init() handler.+ * @param config {Object} Config object.+ * @private+ */+ initializer: function(config) {+ _yuitest_coverfunc("build/button-core/button-core.js", "initializer", 34);+_yuitest_coverline("build/button-core/button-core.js", 35);+this._initNode(config);+ _yuitest_coverline("build/button-core/button-core.js", 36);+this._initAttributes(config);+ _yuitest_coverline("build/button-core/button-core.js", 37);+this._renderUI(config);+ },++ /**+ * @method _initNode+ * @description Node initializer+ * @param config {Object} Config object.+ * @private+ */+ _initNode: function(config) {+ _yuitest_coverfunc("build/button-core/button-core.js", "_initNode", 46);+_yuitest_coverline("build/button-core/button-core.js", 47);+if (config.host) {+ _yuitest_coverline("build/button-core/button-core.js", 48);+this._host = Y.one(config.host);+ } else {+ _yuitest_coverline("build/button-core/button-core.js", 50);+this._host = Y.Node.create(this.TEMPLATE);+ }+ },++ /**+ * @method _initAttributes+ * @description Attribute initializer+ * @param config {Object} Config object.+ * @private+ */+ _initAttributes: function(config) {+ _yuitest_coverfunc("build/button-core/button-core.js", "_initAttributes", 60);+_yuitest_coverline("build/button-core/button-core.js", 61);+var host = this._host,+ node = host.one('.' + Button.CLASS_NAMES.LABEL) || host;+ + _yuitest_coverline("build/button-core/button-core.js", 64);+config.label = config.label || this._getLabel(node);+ _yuitest_coverline("build/button-core/button-core.js", 65);+Y.AttributeCore.call(this, Button.ATTRS, config);+ },++ /**+ * @method renderUI+ * @description Renders any UI/DOM elements for Button instances+ * @param config {Object} Config object.+ * @private+ */+ _renderUI: function(config) {+ _yuitest_coverfunc("build/button-core/button-core.js", "_renderUI", 74);+_yuitest_coverline("build/button-core/button-core.js", 75);+var node = this.getNode(),+ tagName = node.get('tagName').toLowerCase();++ // Set some default node attributes+ _yuitest_coverline("build/button-core/button-core.js", 79);+node.addClass(Button.CLASS_NAMES.BUTTON);+ + _yuitest_coverline("build/button-core/button-core.js", 81);+if (tagName !== 'button' && tagName !== 'input') {+ _yuitest_coverline("build/button-core/button-core.js", 82);+node.set('role', 'button'); + }+ },++ /**+ * @method enable + * @description Sets the button's `disabled` DOM attribute to false+ * @public+ */+ enable: function() {+ _yuitest_coverfunc("build/button-core/button-core.js", "enable", 91);+_yuitest_coverline("build/button-core/button-core.js", 92);+this.set('disabled', false);+ },++ /**+ * @method disable+ * @description Sets the button's `disabled` DOM attribute to true+ * @public+ */+ disable: function() {+ _yuitest_coverfunc("build/button-core/button-core.js", "disable", 100);+_yuitest_coverline("build/button-core/button-core.js", 101);+this.set('disabled', true);+ },++ /**+ * @method getNode+ * @description Gets the host node for this button instance+ * @public+ */+ getNode: function() {+ _yuitest_coverfunc("build/button-core/button-core.js", "getNode", 109);+_yuitest_coverline("build/button-core/button-core.js", 110);+return this._host;+ },+ + /**+ * @method _getLabel+ * @description Getter for a button's 'label' ATTR+ * @private+ */+ _getLabel: function () {+ _yuitest_coverfunc("build/button-core/button-core.js", "_getLabel", 118);+_yuitest_coverline("build/button-core/button-core.js", 119);+var node = this.getNode(),+ tagName = node.get('tagName').toLowerCase(),+ label;++ _yuitest_coverline("build/button-core/button-core.js", 123);+if (tagName === 'input') {+ _yuitest_coverline("build/button-core/button-core.js", 124);+label = node.get('value');+ }+ else {+ _yuitest_coverline("build/button-core/button-core.js", 127);+label = (node.one('.' + Button.CLASS_NAMES.LABEL) || node).get('text');+ }+ + _yuitest_coverline("build/button-core/button-core.js", 130);+return label;+ },+ + /**+ * @method _uiSetLabel+ * @description Setter for a button's 'label' ATTR+ * @param label {string}+ * @private+ */+ _uiSetLabel: function (label) {+ _yuitest_coverfunc("build/button-core/button-core.js", "_uiSetLabel", 139);+_yuitest_coverline("build/button-core/button-core.js", 140);+var node = this.getNode(),+ tagName = node.get('tagName').toLowerCase();++ _yuitest_coverline("build/button-core/button-core.js", 143);+if (tagName === 'input') {+ _yuitest_coverline("build/button-core/button-core.js", 144);+node.set('value', label);+ } else {+ _yuitest_coverline("build/button-core/button-core.js", 146);+(node.one('.' + Button.CLASS_NAMES.LABEL) || node).set('text', label);+ }++ _yuitest_coverline("build/button-core/button-core.js", 149);+return label;+ },++ /**+ * @method _uiSetDisabled+ * @description Setter for the 'disabled' ATTR+ * @param value {boolean}+ * @private+ */+ _uiSetDisabled: function(value) {+ _yuitest_coverfunc("build/button-core/button-core.js", "_uiSetDisabled", 158);+_yuitest_coverline("build/button-core/button-core.js", 159);+var node = this.getNode();+ + _yuitest_coverline("build/button-core/button-core.js", 161);+node.getDOMNode().disabled = value; // avoid rerunning setter when this === node+ _yuitest_coverline("build/button-core/button-core.js", 162);+node.toggleClass(Button.CLASS_NAMES.DISABLED, value);+ + _yuitest_coverline("build/button-core/button-core.js", 164);+return value;+ }+};++/**+* Attribute configuration.+*+* @property ATTRS+* @type {Object}+* @private+* @static+*/+_yuitest_coverline("build/button-core/button-core.js", 176);+Button.ATTRS = {+ label: {+ setter: '_uiSetLabel',+ getter: '_getLabel',+ lazyAdd: false+ },++ disabled: {+ value: false,+ setter: '_uiSetDisabled',+ lazyAdd: false+ }+};++/**+* Name of this component.+*+* @property NAME+* @type String+* @static+*/+_yuitest_coverline("build/button-core/button-core.js", 197);+Button.NAME = "button";++/**+* Array of static constants used to identify the classnames applied to DOM nodes+*+* @property CLASS_NAMES+* @type {Object}+* @public+* @static+*/+_yuitest_coverline("build/button-core/button-core.js", 207);+Button.CLASS_NAMES = {+ BUTTON : getClassName('button'),+ DISABLED: getClassName('button', 'disabled'),+ SELECTED: getClassName('button', 'selected'),+ LABEL : getClassName('button', 'label')+};++/**+* Array of static constants used to for applying ARIA states+*+* @property CLASS_NAMES+* @type {Object}+* @private+* @static+*/+_yuitest_coverline("build/button-core/button-core.js", 222);+Button.ARIA_STATES = {+ PRESSED : 'aria-pressed',+ CHECKED : 'aria-checked'+};++/**+* Array of static constants used to for applying ARIA roles+*+* @property CLASS_NAMES+* @type {Object}+* @private+* @static+*/+_yuitest_coverline("build/button-core/button-core.js", 235);+Button.ARIA_ROLES = {+ BUTTON : 'button',+ CHECKBOX: 'checkbox',+ TOGGLE : 'toggle'+};++_yuitest_coverline("build/button-core/button-core.js", 241);+Y.mix(Button.prototype, Y.AttributeCore.prototype);++// Export Button+_yuitest_coverline("build/button-core/button-core.js", 244);+Y.ButtonCore = Button;+++}, '3.7.1', {"requires": ["attribute-core", "classnamemanager", "node-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('button-core', function(Y) {+YUI.add('button-core', function (Y, NAME) { /** * Provides an interface for working with button-like DOM nodes@@ -250,4 +250,4 @@ Y.ButtonCore = Button; -}, '3.5.1' ,{requires:['attribute-core', 'classnamemanager', 'node-base']});+}, '3.7.1', {"requires": ["attribute-core", "classnamemanager", "node-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("button-core",function(c){var b=c.ClassNameManager.getClassName;function a(d){this.initializer(d);}a.prototype={TEMPLATE:"<button/>",constructor:a,initializer:function(d){this._initNode(d);this._initAttributes(d);this._renderUI(d);},_initNode:function(d){if(d.host){this._host=c.one(d.host);}else{this._host=c.Node.create(this.TEMPLATE);}},_initAttributes:function(d){var f=this._host,e=f.one("."+a.CLASS_NAMES.LABEL)||f;d.label=d.label||this._getLabel(e);c.AttributeCore.call(this,a.ATTRS,d);},_renderUI:function(d){var f=this.getNode(),e=f.get("tagName").toLowerCase();f.addClass(a.CLASS_NAMES.BUTTON);if(e!=="button"&&e!=="input"){f.set("role","button");}},enable:function(){this.set("disabled",false);},disable:function(){this.set("disabled",true);},getNode:function(){return this._host;},_getLabel:function(){var f=this.getNode(),e=f.get("tagName").toLowerCase(),d;if(e==="input"){d=f.get("value");}else{d=(f.one("."+a.CLASS_NAMES.LABEL)||f).get("text");}return d;},_uiSetLabel:function(d){var f=this.getNode(),e=f.get("tagName").toLowerCase();if(e==="input"){f.set("value",d);}else{(f.one("."+a.CLASS_NAMES.LABEL)||f).set("text",d);}return d;},_uiSetDisabled:function(e){var d=this.getNode();d.getDOMNode().disabled=e;d.toggleClass(a.CLASS_NAMES.DISABLED,e);return e;}};a.ATTRS={label:{setter:"_uiSetLabel",getter:"_getLabel",lazyAdd:false},disabled:{value:false,setter:"_uiSetDisabled",lazyAdd:false}};a.NAME="button";a.CLASS_NAMES={BUTTON:b("button"),DISABLED:b("button","disabled"),SELECTED:b("button","selected"),LABEL:b("button","label")};a.ARIA_STATES={PRESSED:"aria-pressed",CHECKED:"aria-checked"};a.ARIA_ROLES={BUTTON:"button",CHECKBOX:"checkbox",TOGGLE:"toggle"};c.mix(a.prototype,c.AttributeCore.prototype);c.ButtonCore=a;},"3.5.1",{requires:["attribute-core","classnamemanager","node-base"]});+YUI.add("button-core",function(e,t){function r(e){this.initializer(e)}var n=e.ClassNameManager.getClassName;r.prototype={TEMPLATE:"<button/>",constructor:r,initializer:function(e){this._initNode(e),this._initAttributes(e),this._renderUI(e)},_initNode:function(t){t.host?this._host=e.one(t.host):this._host=e.Node.create(this.TEMPLATE)},_initAttributes:function(t){var n=this._host,i=n.one("."+r.CLASS_NAMES.LABEL)||n;t.label=t.label||this._getLabel(i),e.AttributeCore.call(this,r.ATTRS,t)},_renderUI:function(e){var t=this.getNode(),n=t.get("tagName").toLowerCase();t.addClass(r.CLASS_NAMES.BUTTON),n!=="button"&&n!=="input"&&t.set("role","button")},enable:function(){this.set("disabled",!1)},disable:function(){this.set("disabled",!0)},getNode:function(){return this._host},_getLabel:function(){var e=this.getNode(),t=e.get("tagName").toLowerCase(),n;return t==="input"?n=e.get("value"):n=(e.one("."+r.CLASS_NAMES.LABEL)||e).get("text"),n},_uiSetLabel:function(e){var t=this.getNode(),n=t.get("tagName").toLowerCase();return n==="input"?t.set("value",e):(t.one("."+r.CLASS_NAMES.LABEL)||t).set("text",e),e},_uiSetDisabled:function(e){var t=this.getNode();return t.getDOMNode().disabled=e,t.toggleClass(r.CLASS_NAMES.DISABLED,e),e}},r.ATTRS={label:{setter:"_uiSetLabel",getter:"_getLabel",lazyAdd:!1},disabled:{value:!1,setter:"_uiSetDisabled",lazyAdd:!1}},r.NAME="button",r.CLASS_NAMES={BUTTON:n("button"),DISABLED:n("button","disabled"),SELECTED:n("button","selected"),LABEL:n("button","label")},r.ARIA_STATES={PRESSED:"aria-pressed",CHECKED:"aria-checked"},r.ARIA_ROLES={BUTTON:"button",CHECKBOX:"checkbox",TOGGLE:"toggle"},e.mix(r.prototype,e.AttributeCore.prototype),e.ButtonCore=r},"3.7.1",{requires:["attribute-core","classnamemanager","node-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('button-core', function(Y) {+YUI.add('button-core', function (Y, NAME) { /** * Provides an interface for working with button-like DOM nodes@@ -250,4 +250,4 @@ Y.ButtonCore = Button; -}, '3.5.1' ,{requires:['attribute-core', 'classnamemanager', 'node-base']});+}, '3.7.1', {"requires": ["attribute-core", "classnamemanager", "node-base"]});
binary file changed (15613 → absent bytes)
@@ -0,0 +1,267 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/button-group/button-group.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/button-group/button-group.js",+ code: []+};+_yuitest_coverage["build/button-group/button-group.js"].code=["YUI.add('button-group', function (Y, NAME) {","","/**","* A Widget to create groups of buttons","*","* @module button-group","* @since 3.5.0","*/","","var CONTENT_BOX = \"contentBox\","," CLICK_EVENT = \"click\","," CLASS_NAMES = Y.ButtonCore.CLASS_NAMES;","","/**","* Creates a ButtonGroup","*","* @class ButtonGroup","* @extends Widget","* @param config {Object} Configuration object","* @constructor","*/","function ButtonGroup() {"," ButtonGroup.superclass.constructor.apply(this, arguments);","}","","/* ButtonGroup extends Widget */","Y.ButtonGroup = Y.extend(ButtonGroup, Y.Widget, {",""," /**"," * @method renderUI"," * @description Creates a visual representation of the widget based on existing parameters."," * @public"," */"," renderUI: function() {"," this.getButtons().plug(Y.Plugin.Button);"," },",""," /**"," * @method bindUI"," * @description Hooks up events for the widget"," * @public"," */"," bindUI: function() {"," var group = this,"," cb = group.get(CONTENT_BOX);",""," cb.delegate(CLICK_EVENT, group._handleClick, Y.ButtonGroup.BUTTON_SELECTOR, group);"," },",""," /**"," * @method getButtons"," * @description Returns all buttons inside this this button group"," * @public"," */"," getButtons: function() {"," var cb = this.get(CONTENT_BOX);",""," return cb.all(Y.ButtonGroup.BUTTON_SELECTOR);"," },",""," /**"," * @method getSelectedButtons"," * @description Returns all Y.Buttons instances that are selected"," * @public"," */"," getSelectedButtons: function() {"," var group = this,"," selected = [],"," buttons = group.getButtons(),"," selectedClass = ButtonGroup.CLASS_NAMES.SELECTED;",""," buttons.each(function(node){"," if (node.hasClass(selectedClass)){"," selected.push(node);"," }"," });",""," return selected;"," },",""," /**"," * @method getSelectedValues"," * @description Returns the values of all Y.Button instances that are selected"," * @public"," */"," getSelectedValues: function() {"," var group = this,"," value,"," values = [],"," selected = group.getSelectedButtons(),"," selectedClass = ButtonGroup.CLASS_NAMES.SELECTED;",""," Y.Array.each(selected, function(node){"," if (node.hasClass(selectedClass)){"," value = node.getContent();"," values.push(value);"," }"," });",""," return values;"," },",""," /**"," * @method _handleClick"," * @description A delegated click handler for when any button is clicked in the content box"," * @param e {Object} An event object"," * @private"," */"," _handleClick: function(e){"," var group = this,"," clickedNode = e.target.ancestor('.' + ButtonGroup.CLASS_NAMES.BUTTON, true),"," type = group.get('type'),"," selectedClass = ButtonGroup.CLASS_NAMES.SELECTED,"," isSelected = clickedNode.hasClass(selectedClass),"," buttons;",""," // TODO: Anything for 'push' groups?",""," if (type === 'checkbox') {"," clickedNode.toggleClass(selectedClass, !isSelected);"," /**"," * @event selectionChange"," * @description fires when any button in the group changes its checked status"," * @param {Event} the event object. It contains an \"originEvent\" property"," * linking to the original DOM event that triggered the selection change"," */"," group.fire('selectionChange', {originEvent: e});"," }"," else if (type === 'radio') {"," if (!isSelected) {"," buttons = group.getButtons(); // Todo: getSelectedButtons()? Need it to return an arraylist then."," buttons.removeClass(selectedClass);"," clickedNode.addClass(selectedClass);"," group.fire('selectionChange', {originEvent: e});"," }"," }"," }","","}, {"," // Y.ButtonGroup static properties",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type {String}"," * @default 'buttongroup'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'buttongroup',",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {"," type: {"," writeOnce: 'initOnly',"," value: 'radio'"," }"," },",""," /**"," * List of class names to use for ButtonGroups"," *"," * @property CLASS_NAMES"," * @type {Object}"," * @static"," */"," CLASS_NAMES: CLASS_NAMES,"," "," /**"," * Selector used to find buttons inside a ButtonGroup"," * @type {String}"," */"," BUTTON_SELECTOR: \"button, input[type=button], input[type=reset], input[type=submit], input[type=radio], input[type=checkbox]\"","});","","","}, '3.7.1', {\"requires\": [\"button-plugin\", \"cssbutton\", \"widget\"]});"];+_yuitest_coverage["build/button-group/button-group.js"].lines = {"1":0,"10":0,"22":0,"23":0,"27":0,"35":0,"44":0,"47":0,"56":0,"58":0,"67":0,"72":0,"73":0,"74":0,"78":0,"87":0,"93":0,"94":0,"95":0,"96":0,"100":0,"110":0,"119":0,"120":0,"127":0,"129":0,"130":0,"131":0,"132":0,"133":0,"134":0};+_yuitest_coverage["build/button-group/button-group.js"].functions = {"ButtonGroup:22":0,"renderUI:34":0,"bindUI:43":0,"getButtons:55":0,"(anonymous 2):72":0,"getSelectedButtons:66":0,"(anonymous 3):93":0,"getSelectedValues:86":0,"_handleClick:109":0,"(anonymous 1):1":0};+_yuitest_coverage["build/button-group/button-group.js"].coveredLines = 31;+_yuitest_coverage["build/button-group/button-group.js"].coveredFunctions = 10;+_yuitest_coverline("build/button-group/button-group.js", 1);+YUI.add('button-group', function (Y, NAME) {++/**+* A Widget to create groups of buttons+*+* @module button-group+* @since 3.5.0+*/++_yuitest_coverfunc("build/button-group/button-group.js", "(anonymous 1)", 1);+_yuitest_coverline("build/button-group/button-group.js", 10);+var CONTENT_BOX = "contentBox",+ CLICK_EVENT = "click",+ CLASS_NAMES = Y.ButtonCore.CLASS_NAMES;++/**+* Creates a ButtonGroup+*+* @class ButtonGroup+* @extends Widget+* @param config {Object} Configuration object+* @constructor+*/+_yuitest_coverline("build/button-group/button-group.js", 22);+function ButtonGroup() {+ _yuitest_coverfunc("build/button-group/button-group.js", "ButtonGroup", 22);+_yuitest_coverline("build/button-group/button-group.js", 23);+ButtonGroup.superclass.constructor.apply(this, arguments);+}++/* ButtonGroup extends Widget */+_yuitest_coverline("build/button-group/button-group.js", 27);+Y.ButtonGroup = Y.extend(ButtonGroup, Y.Widget, {++ /**+ * @method renderUI+ * @description Creates a visual representation of the widget based on existing parameters.+ * @public+ */+ renderUI: function() {+ _yuitest_coverfunc("build/button-group/button-group.js", "renderUI", 34);+_yuitest_coverline("build/button-group/button-group.js", 35);+this.getButtons().plug(Y.Plugin.Button);+ },++ /**+ * @method bindUI+ * @description Hooks up events for the widget+ * @public+ */+ bindUI: function() {+ _yuitest_coverfunc("build/button-group/button-group.js", "bindUI", 43);+_yuitest_coverline("build/button-group/button-group.js", 44);+var group = this,+ cb = group.get(CONTENT_BOX);++ _yuitest_coverline("build/button-group/button-group.js", 47);+cb.delegate(CLICK_EVENT, group._handleClick, Y.ButtonGroup.BUTTON_SELECTOR, group);+ },++ /**+ * @method getButtons+ * @description Returns all buttons inside this this button group+ * @public+ */+ getButtons: function() {+ _yuitest_coverfunc("build/button-group/button-group.js", "getButtons", 55);+_yuitest_coverline("build/button-group/button-group.js", 56);+var cb = this.get(CONTENT_BOX);++ _yuitest_coverline("build/button-group/button-group.js", 58);+return cb.all(Y.ButtonGroup.BUTTON_SELECTOR);+ },++ /**+ * @method getSelectedButtons+ * @description Returns all Y.Buttons instances that are selected+ * @public+ */+ getSelectedButtons: function() {+ _yuitest_coverfunc("build/button-group/button-group.js", "getSelectedButtons", 66);+_yuitest_coverline("build/button-group/button-group.js", 67);+var group = this,+ selected = [],+ buttons = group.getButtons(),+ selectedClass = ButtonGroup.CLASS_NAMES.SELECTED;++ _yuitest_coverline("build/button-group/button-group.js", 72);+buttons.each(function(node){+ _yuitest_coverfunc("build/button-group/button-group.js", "(anonymous 2)", 72);+_yuitest_coverline("build/button-group/button-group.js", 73);+if (node.hasClass(selectedClass)){+ _yuitest_coverline("build/button-group/button-group.js", 74);+selected.push(node);+ }+ });++ _yuitest_coverline("build/button-group/button-group.js", 78);+return selected;+ },++ /**+ * @method getSelectedValues+ * @description Returns the values of all Y.Button instances that are selected+ * @public+ */+ getSelectedValues: function() {+ _yuitest_coverfunc("build/button-group/button-group.js", "getSelectedValues", 86);+_yuitest_coverline("build/button-group/button-group.js", 87);+var group = this,+ value,+ values = [],+ selected = group.getSelectedButtons(),+ selectedClass = ButtonGroup.CLASS_NAMES.SELECTED;++ _yuitest_coverline("build/button-group/button-group.js", 93);+Y.Array.each(selected, function(node){+ _yuitest_coverfunc("build/button-group/button-group.js", "(anonymous 3)", 93);+_yuitest_coverline("build/button-group/button-group.js", 94);+if (node.hasClass(selectedClass)){+ _yuitest_coverline("build/button-group/button-group.js", 95);+value = node.getContent();+ _yuitest_coverline("build/button-group/button-group.js", 96);+values.push(value);+ }+ });++ _yuitest_coverline("build/button-group/button-group.js", 100);+return values;+ },++ /**+ * @method _handleClick+ * @description A delegated click handler for when any button is clicked in the content box+ * @param e {Object} An event object+ * @private+ */+ _handleClick: function(e){+ _yuitest_coverfunc("build/button-group/button-group.js", "_handleClick", 109);+_yuitest_coverline("build/button-group/button-group.js", 110);+var group = this,+ clickedNode = e.target.ancestor('.' + ButtonGroup.CLASS_NAMES.BUTTON, true),+ type = group.get('type'),+ selectedClass = ButtonGroup.CLASS_NAMES.SELECTED,+ isSelected = clickedNode.hasClass(selectedClass),+ buttons;++ // TODO: Anything for 'push' groups?++ _yuitest_coverline("build/button-group/button-group.js", 119);+if (type === 'checkbox') {+ _yuitest_coverline("build/button-group/button-group.js", 120);+clickedNode.toggleClass(selectedClass, !isSelected);+ /**+ * @event selectionChange+ * @description fires when any button in the group changes its checked status+ * @param {Event} the event object. It contains an "originEvent" property+ * linking to the original DOM event that triggered the selection change+ */+ _yuitest_coverline("build/button-group/button-group.js", 127);+group.fire('selectionChange', {originEvent: e});+ }+ else {_yuitest_coverline("build/button-group/button-group.js", 129);+if (type === 'radio') {+ _yuitest_coverline("build/button-group/button-group.js", 130);+if (!isSelected) {+ _yuitest_coverline("build/button-group/button-group.js", 131);+buttons = group.getButtons(); // Todo: getSelectedButtons()? Need it to return an arraylist then.+ _yuitest_coverline("build/button-group/button-group.js", 132);+buttons.removeClass(selectedClass);+ _yuitest_coverline("build/button-group/button-group.js", 133);+clickedNode.addClass(selectedClass);+ _yuitest_coverline("build/button-group/button-group.js", 134);+group.fire('selectionChange', {originEvent: e});+ }+ }}+ }++}, {+ // Y.ButtonGroup static properties++ /**+ * The identity of the widget.+ *+ * @property NAME+ * @type {String}+ * @default 'buttongroup'+ * @readOnly+ * @protected+ * @static+ */+ NAME: 'buttongroup',++ /**+ * Static property used to define the default attribute configuration of+ * the Widget.+ *+ * @property ATTRS+ * @type {Object}+ * @protected+ * @static+ */+ ATTRS: {+ type: {+ writeOnce: 'initOnly',+ value: 'radio'+ }+ },++ /**+ * List of class names to use for ButtonGroups+ *+ * @property CLASS_NAMES+ * @type {Object}+ * @static+ */+ CLASS_NAMES: CLASS_NAMES,+ + /**+ * Selector used to find buttons inside a ButtonGroup+ * @type {String}+ */+ BUTTON_SELECTOR: "button, input[type=button], input[type=reset], input[type=submit], input[type=radio], input[type=checkbox]"+});+++}, '3.7.1', {"requires": ["button-plugin", "cssbutton", "widget"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('button-group', function(Y) {+YUI.add('button-group', function (Y, NAME) { /** * A Widget to create groups of buttons@@ -14,7 +14,6 @@ */ var CONTENT_BOX = "contentBox",- SELECTOR = "button, input[type=button], input[type=reset], input[type=submit]", CLICK_EVENT = "click", CLASS_NAMES = Y.ButtonCore.CLASS_NAMES; @@ -51,7 +50,7 @@ var group = this, cb = group.get(CONTENT_BOX); - cb.delegate(CLICK_EVENT, group._handleClick, SELECTOR, group);+ cb.delegate(CLICK_EVENT, group._handleClick, Y.ButtonGroup.BUTTON_SELECTOR, group); }, /**@@ -62,7 +61,7 @@ getButtons: function() { var cb = this.get(CONTENT_BOX); - return cb.all(SELECTOR);+ return cb.all(Y.ButtonGroup.BUTTON_SELECTOR); }, /**@@ -114,17 +113,23 @@ * @private */ _handleClick: function(e){- var buttons,- clickedNode = e.target,- group = this,+ var group = this,+ clickedNode = e.target.ancestor('.' + ButtonGroup.CLASS_NAMES.BUTTON, true), type = group.get('type'), selectedClass = ButtonGroup.CLASS_NAMES.SELECTED,- isSelected = clickedNode.hasClass(selectedClass);+ isSelected = clickedNode.hasClass(selectedClass),+ buttons; // TODO: Anything for 'push' groups? if (type === 'checkbox') { clickedNode.toggleClass(selectedClass, !isSelected);+ /**+ * @event selectionChange+ * @description fires when any button in the group changes its checked status+ * @param {Event} the event object. It contains an "originEvent" property+ * linking to the original DOM event that triggered the selection change+ */ group.fire('selectionChange', {originEvent: e}); } else if (type === 'radio') {@@ -175,8 +180,14 @@ * @type {Object} * @static */- CLASS_NAMES: CLASS_NAMES+ CLASS_NAMES: CLASS_NAMES,+ + /**+ * Selector used to find buttons inside a ButtonGroup+ * @type {String}+ */+ BUTTON_SELECTOR: "button, input[type=button], input[type=reset], input[type=submit], input[type=radio], input[type=checkbox]" }); -}, '3.5.1' ,{requires:['button-plugin', 'cssbutton', 'widget']});+}, '3.7.1', {"requires": ["button-plugin", "cssbutton", "widget"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("button-group",function(f){var a="contentBox",e="button, input[type=button], input[type=reset], input[type=submit]",c="click",d=f.ButtonCore.CLASS_NAMES;function b(){b.superclass.constructor.apply(this,arguments);}f.ButtonGroup=f.extend(b,f.Widget,{renderUI:function(){this.getButtons().plug(f.Plugin.Button);},bindUI:function(){var h=this,g=h.get(a);g.delegate(c,h._handleClick,e,h);},getButtons:function(){var g=this.get(a);return g.all(e);},getSelectedButtons:function(){var j=this,h=[],i=j.getButtons(),g=b.CLASS_NAMES.SELECTED;i.each(function(k){if(k.hasClass(g)){h.push(k);}});return h;},getSelectedValues:function(){var k=this,j,g=[],i=k.getSelectedButtons(),h=b.CLASS_NAMES.SELECTED;f.Array.each(i,function(l){if(l.hasClass(h)){j=l.getContent();g.push(j);}});return g;},_handleClick:function(m){var k,h=m.target,l=this,j=l.get("type"),i=b.CLASS_NAMES.SELECTED,g=h.hasClass(i);if(j==="checkbox"){h.toggleClass(i,!g);l.fire("selectionChange",{originEvent:m});}else{if(j==="radio"){if(!g){k=l.getButtons();k.removeClass(i);h.addClass(i);l.fire("selectionChange",{originEvent:m});}}}}},{NAME:"buttongroup",ATTRS:{type:{writeOnce:"initOnly",value:"radio"}},CLASS_NAMES:d});},"3.5.1",{requires:["button-plugin","cssbutton","widget"]});+YUI.add("button-group",function(e,t){function s(){s.superclass.constructor.apply(this,arguments)}var n="contentBox",r="click",i=e.ButtonCore.CLASS_NAMES;e.ButtonGroup=e.extend(s,e.Widget,{renderUI:function(){this.getButtons().plug(e.Plugin.Button)},bindUI:function(){var t=this,i=t.get(n);i.delegate(r,t._handleClick,e.ButtonGroup.BUTTON_SELECTOR,t)},getButtons:function(){var t=this.get(n);return t.all(e.ButtonGroup.BUTTON_SELECTOR)},getSelectedButtons:function(){var e=this,t=[],n=e.getButtons(),r=s.CLASS_NAMES.SELECTED;return n.each(function(e){e.hasClass(r)&&t.push(e)}),t},getSelectedValues:function(){var t=this,n,r=[],i=t.getSelectedButtons(),o=s.CLASS_NAMES.SELECTED;return e.Array.each(i,function(e){e.hasClass(o)&&(n=e.getContent(),r.push(n))}),r},_handleClick:function(e){var t=this,n=e.target.ancestor("."+s.CLASS_NAMES.BUTTON,!0),r=t.get("type"),i=s.CLASS_NAMES.SELECTED,o=n.hasClass(i),u;r==="checkbox"?(n.toggleClass(i,!o),t.fire("selectionChange",{originEvent:e})):r==="radio"&&(o||(u=t.getButtons(),u.removeClass(i),n.addClass(i),t.fire("selectionChange",{originEvent:e})))}},{NAME:"buttongroup",ATTRS:{type:{writeOnce:"initOnly",value:"radio"}},CLASS_NAMES:i,BUTTON_SELECTOR:"button, input[type=button], input[type=reset], input[type=submit], input[type=radio], input[type=checkbox]"})},"3.7.1",{requires:["button-plugin","cssbutton","widget"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('button-group', function(Y) {+YUI.add('button-group', function (Y, NAME) { /** * A Widget to create groups of buttons@@ -14,7 +14,6 @@ */ var CONTENT_BOX = "contentBox",- SELECTOR = "button, input[type=button], input[type=reset], input[type=submit]", CLICK_EVENT = "click", CLASS_NAMES = Y.ButtonCore.CLASS_NAMES; @@ -51,7 +50,7 @@ var group = this, cb = group.get(CONTENT_BOX); - cb.delegate(CLICK_EVENT, group._handleClick, SELECTOR, group);+ cb.delegate(CLICK_EVENT, group._handleClick, Y.ButtonGroup.BUTTON_SELECTOR, group); }, /**@@ -62,7 +61,7 @@ getButtons: function() { var cb = this.get(CONTENT_BOX); - return cb.all(SELECTOR);+ return cb.all(Y.ButtonGroup.BUTTON_SELECTOR); }, /**@@ -114,17 +113,23 @@ * @private */ _handleClick: function(e){- var buttons,- clickedNode = e.target,- group = this,+ var group = this,+ clickedNode = e.target.ancestor('.' + ButtonGroup.CLASS_NAMES.BUTTON, true), type = group.get('type'), selectedClass = ButtonGroup.CLASS_NAMES.SELECTED,- isSelected = clickedNode.hasClass(selectedClass);+ isSelected = clickedNode.hasClass(selectedClass),+ buttons; // TODO: Anything for 'push' groups? if (type === 'checkbox') { clickedNode.toggleClass(selectedClass, !isSelected);+ /**+ * @event selectionChange+ * @description fires when any button in the group changes its checked status+ * @param {Event} the event object. It contains an "originEvent" property+ * linking to the original DOM event that triggered the selection change+ */ group.fire('selectionChange', {originEvent: e}); } else if (type === 'radio') {@@ -175,8 +180,14 @@ * @type {Object} * @static */- CLASS_NAMES: CLASS_NAMES+ CLASS_NAMES: CLASS_NAMES,+ + /**+ * Selector used to find buttons inside a ButtonGroup+ * @type {String}+ */+ BUTTON_SELECTOR: "button, input[type=button], input[type=reset], input[type=submit], input[type=radio], input[type=checkbox]" }); -}, '3.5.1' ,{requires:['button-plugin', 'cssbutton', 'widget']});+}, '3.7.1', {"requires": ["button-plugin", "cssbutton", "widget"]});
@@ -0,0 +1,202 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/button-plugin/button-plugin.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/button-plugin/button-plugin.js",+ code: []+};+_yuitest_coverage["build/button-plugin/button-plugin.js"].code=["YUI.add('button-plugin', function (Y, NAME) {","","/**","* A Button Plugin","*","* @module button-plugin","* @since 3.5.0","*/","","/**","* @class ButtonPlugin","* @param config {Object} Configuration object","* @constructor","*/","function ButtonPlugin(config) {"," ButtonPlugin.superclass.constructor.apply(this, arguments);","}","","Y.extend(ButtonPlugin, Y.ButtonCore, {"," "," /**"," * @method _afterNodeGet"," * @param name {string}"," * @private"," */"," _afterNodeGet: function (name) {"," // TODO: point to method (_uiSetLabel, etc) instead of getter/setter"," var ATTRS = this.constructor.ATTRS,"," fn = ATTRS[name] && ATTRS[name].getter && this[ATTRS[name].getter];"," "," if (fn) {"," return new Y.Do.AlterReturn('get ' + name, fn.call(this));"," }"," },",""," /**"," * @method _afterNodeSet"," * @param name {String}"," * @param val {String}"," * @private"," */"," _afterNodeSet: function (name, val) {"," var ATTRS = this.constructor.ATTRS,"," fn = ATTRS[name] && ATTRS[name].setter && this[ATTRS[name].setter];"," "," if (fn) {"," fn.call(this, val);"," }"," },",""," /**"," * @method _initNode"," * @param config {Object}"," * @private"," */"," _initNode: function(config) {"," var node = config.host;"," this._host = node;"," "," Y.Do.after(this._afterNodeGet, node, 'get', this);"," Y.Do.after(this._afterNodeSet, node, 'set', this);"," },",""," /**"," * @method destroy"," * @private"," */"," destroy: function(){"," // Nothing to do, but things are happier with it here"," }"," ","}, {"," "," /**"," * Attribute configuration."," *"," * @property ATTRS"," * @type {Object}"," * @private"," * @static"," */"," ATTRS: Y.merge(Y.ButtonCore.ATTRS),"," "," /**"," * Name of this component."," *"," * @property NAME"," * @type String"," * @static"," */"," NAME: 'buttonPlugin',"," "," /**"," * Namespace of this component."," *"," * @property NS"," * @type String"," * @static"," */"," NS: 'button'"," ","});","","/**","* @method createNode","* @description A factory that plugs a Y.Node instance with Y.Plugin.Button","* @param node {Object}","* @param config {Object}","* @returns {Object} A plugged Y.Node instance","* @public","*/","ButtonPlugin.createNode = function(node, config) {"," var template;",""," if (node && !config) {"," if (! (node.nodeType || node.getDOMNode || typeof node == 'string')) {"," config = node;"," node = config.srcNode;"," }"," }",""," config = config || {};"," template = config.template || Y.Plugin.Button.prototype.TEMPLATE;"," node = node || config.srcNode || Y.DOM.create(template);",""," return Y.one(node).plug(Y.Plugin.Button, config);","};","","Y.namespace('Plugin').Button = ButtonPlugin;","","","}, '3.7.1', {\"requires\": [\"button-core\", \"cssbutton\", \"node-pluginhost\"]});"];+_yuitest_coverage["build/button-plugin/button-plugin.js"].lines = {"1":0,"15":0,"16":0,"19":0,"28":0,"31":0,"32":0,"43":0,"46":0,"47":0,"57":0,"58":0,"60":0,"61":0,"112":0,"113":0,"115":0,"116":0,"117":0,"118":0,"122":0,"123":0,"124":0,"126":0,"129":0};+_yuitest_coverage["build/button-plugin/button-plugin.js"].functions = {"ButtonPlugin:15":0,"_afterNodeGet:26":0,"_afterNodeSet:42":0,"_initNode:56":0,"createNode:112":0,"(anonymous 1):1":0};+_yuitest_coverage["build/button-plugin/button-plugin.js"].coveredLines = 25;+_yuitest_coverage["build/button-plugin/button-plugin.js"].coveredFunctions = 6;+_yuitest_coverline("build/button-plugin/button-plugin.js", 1);+YUI.add('button-plugin', function (Y, NAME) {++/**+* A Button Plugin+*+* @module button-plugin+* @since 3.5.0+*/++/**+* @class ButtonPlugin+* @param config {Object} Configuration object+* @constructor+*/+_yuitest_coverfunc("build/button-plugin/button-plugin.js", "(anonymous 1)", 1);+_yuitest_coverline("build/button-plugin/button-plugin.js", 15);+function ButtonPlugin(config) {+ _yuitest_coverfunc("build/button-plugin/button-plugin.js", "ButtonPlugin", 15);+_yuitest_coverline("build/button-plugin/button-plugin.js", 16);+ButtonPlugin.superclass.constructor.apply(this, arguments);+}++_yuitest_coverline("build/button-plugin/button-plugin.js", 19);+Y.extend(ButtonPlugin, Y.ButtonCore, {+ + /**+ * @method _afterNodeGet+ * @param name {string}+ * @private+ */+ _afterNodeGet: function (name) {+ // TODO: point to method (_uiSetLabel, etc) instead of getter/setter+ _yuitest_coverfunc("build/button-plugin/button-plugin.js", "_afterNodeGet", 26);+_yuitest_coverline("build/button-plugin/button-plugin.js", 28);+var ATTRS = this.constructor.ATTRS,+ fn = ATTRS[name] && ATTRS[name].getter && this[ATTRS[name].getter];+ + _yuitest_coverline("build/button-plugin/button-plugin.js", 31);+if (fn) {+ _yuitest_coverline("build/button-plugin/button-plugin.js", 32);+return new Y.Do.AlterReturn('get ' + name, fn.call(this));+ }+ },++ /**+ * @method _afterNodeSet+ * @param name {String}+ * @param val {String}+ * @private+ */+ _afterNodeSet: function (name, val) {+ _yuitest_coverfunc("build/button-plugin/button-plugin.js", "_afterNodeSet", 42);+_yuitest_coverline("build/button-plugin/button-plugin.js", 43);+var ATTRS = this.constructor.ATTRS,+ fn = ATTRS[name] && ATTRS[name].setter && this[ATTRS[name].setter];+ + _yuitest_coverline("build/button-plugin/button-plugin.js", 46);+if (fn) {+ _yuitest_coverline("build/button-plugin/button-plugin.js", 47);+fn.call(this, val);+ }+ },++ /**+ * @method _initNode+ * @param config {Object}+ * @private+ */+ _initNode: function(config) {+ _yuitest_coverfunc("build/button-plugin/button-plugin.js", "_initNode", 56);+_yuitest_coverline("build/button-plugin/button-plugin.js", 57);+var node = config.host;+ _yuitest_coverline("build/button-plugin/button-plugin.js", 58);+this._host = node;+ + _yuitest_coverline("build/button-plugin/button-plugin.js", 60);+Y.Do.after(this._afterNodeGet, node, 'get', this);+ _yuitest_coverline("build/button-plugin/button-plugin.js", 61);+Y.Do.after(this._afterNodeSet, node, 'set', this);+ },++ /**+ * @method destroy+ * @private+ */+ destroy: function(){+ // Nothing to do, but things are happier with it here+ }+ +}, {+ + /**+ * Attribute configuration.+ *+ * @property ATTRS+ * @type {Object}+ * @private+ * @static+ */+ ATTRS: Y.merge(Y.ButtonCore.ATTRS),+ + /**+ * Name of this component.+ *+ * @property NAME+ * @type String+ * @static+ */+ NAME: 'buttonPlugin',+ + /**+ * Namespace of this component.+ *+ * @property NS+ * @type String+ * @static+ */+ NS: 'button'+ +});++/**+* @method createNode+* @description A factory that plugs a Y.Node instance with Y.Plugin.Button+* @param node {Object}+* @param config {Object}+* @returns {Object} A plugged Y.Node instance+* @public+*/+_yuitest_coverline("build/button-plugin/button-plugin.js", 112);+ButtonPlugin.createNode = function(node, config) {+ _yuitest_coverfunc("build/button-plugin/button-plugin.js", "createNode", 112);+_yuitest_coverline("build/button-plugin/button-plugin.js", 113);+var template;++ _yuitest_coverline("build/button-plugin/button-plugin.js", 115);+if (node && !config) {+ _yuitest_coverline("build/button-plugin/button-plugin.js", 116);+if (! (node.nodeType || node.getDOMNode || typeof node == 'string')) {+ _yuitest_coverline("build/button-plugin/button-plugin.js", 117);+config = node;+ _yuitest_coverline("build/button-plugin/button-plugin.js", 118);+node = config.srcNode;+ }+ }++ _yuitest_coverline("build/button-plugin/button-plugin.js", 122);+config = config || {};+ _yuitest_coverline("build/button-plugin/button-plugin.js", 123);+template = config.template || Y.Plugin.Button.prototype.TEMPLATE;+ _yuitest_coverline("build/button-plugin/button-plugin.js", 124);+node = node || config.srcNode || Y.DOM.create(template);++ _yuitest_coverline("build/button-plugin/button-plugin.js", 126);+return Y.one(node).plug(Y.Plugin.Button, config);+};++_yuitest_coverline("build/button-plugin/button-plugin.js", 129);+Y.namespace('Plugin').Button = ButtonPlugin;+++}, '3.7.1', {"requires": ["button-core", "cssbutton", "node-pluginhost"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('button-plugin', function(Y) {+YUI.add('button-plugin', function (Y, NAME) { /** * A Button Plugin@@ -135,4 +135,4 @@ Y.namespace('Plugin').Button = ButtonPlugin; -}, '3.5.1' ,{requires:['button-core', 'cssbutton', 'node-pluginhost']});+}, '3.7.1', {"requires": ["button-core", "cssbutton", "node-pluginhost"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("button-plugin",function(b){function a(c){a.superclass.constructor.apply(this,arguments);}b.extend(a,b.ButtonCore,{_afterNodeGet:function(d){var c=this.constructor.ATTRS,e=c[d]&&c[d].getter&&this[c[d].getter];if(e){return new b.Do.AlterReturn("get "+d,e.call(this));}},_afterNodeSet:function(d,f){var c=this.constructor.ATTRS,e=c[d]&&c[d].setter&&this[c[d].setter];if(e){e.call(this,f);}},_initNode:function(c){var d=c.host;this._host=d;b.Do.after(this._afterNodeGet,d,"get",this);b.Do.after(this._afterNodeSet,d,"set",this);},destroy:function(){}},{ATTRS:b.merge(b.ButtonCore.ATTRS),NAME:"buttonPlugin",NS:"button"});a.createNode=function(e,c){var d;if(e&&!c){if(!(e.nodeType||e.getDOMNode||typeof e=="string")){c=e;e=c.srcNode;}}c=c||{};d=c.template||b.Plugin.Button.prototype.TEMPLATE;e=e||c.srcNode||b.DOM.create(d);return b.one(e).plug(b.Plugin.Button,c);};b.namespace("Plugin").Button=a;},"3.5.1",{requires:["button-core","cssbutton","node-pluginhost"]});+YUI.add("button-plugin",function(e,t){function n(e){n.superclass.constructor.apply(this,arguments)}e.extend(n,e.ButtonCore,{_afterNodeGet:function(t){var n=this.constructor.ATTRS,r=n[t]&&n[t].getter&&this[n[t].getter];if(r)return new e.Do.AlterReturn("get "+t,r.call(this))},_afterNodeSet:function(e,t){var n=this.constructor.ATTRS,r=n[e]&&n[e].setter&&this[n[e].setter];r&&r.call(this,t)},_initNode:function(t){var n=t.host;this._host=n,e.Do.after(this._afterNodeGet,n,"get",this),e.Do.after(this._afterNodeSet,n,"set",this)},destroy:function(){}},{ATTRS:e.merge(e.ButtonCore.ATTRS),NAME:"buttonPlugin",NS:"button"}),n.createNode=function(t,n){var r;return t&&!n&&!t.nodeType&&!t.getDOMNode&&typeof t!="string"&&(n=t,t=n.srcNode),n=n||{},r=n.template||e.Plugin.Button.prototype.TEMPLATE,t=t||n.srcNode||e.DOM.create(r),e.one(t).plug(e.Plugin.Button,n)},e.namespace("Plugin").Button=n},"3.7.1",{requires:["button-core","cssbutton","node-pluginhost"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('button-plugin', function(Y) {+YUI.add('button-plugin', function (Y, NAME) { /** * A Button Plugin@@ -135,4 +135,4 @@ Y.namespace('Plugin').Button = ButtonPlugin; -}, '3.5.1' ,{requires:['button-core', 'cssbutton', 'node-pluginhost']});+}, '3.7.1', {"requires": ["button-core", "cssbutton", "node-pluginhost"]});
@@ -0,0 +1,420 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/button/button.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/button/button.js",+ code: []+};+_yuitest_coverage["build/button/button.js"].code=["YUI.add('button', function (Y, NAME) {","","/**","* A Button Widget","*","* @module button","* @since 3.5.0","*/","","var CLASS_NAMES = Y.ButtonCore.CLASS_NAMES,"," ARIA_STATES = Y.ButtonCore.ARIA_STATES,"," ARIA_ROLES = Y.ButtonCore.ARIA_ROLES;","","/**","* Creates a Button","*","* @class Button","* @extends Widget","* @param config {Object} Configuration object","* @constructor","*/","function Button(config) {"," Button.superclass.constructor.apply(this, arguments);","}","","/* Button extends Widget */","Y.extend(Button, Y.Widget, {",""," BOUNDING_TEMPLATE: Y.ButtonCore.prototype.TEMPLATE,",""," CONTENT_TEMPLATE: null,",""," /**"," * @method initializer"," * @description Internal init() handler."," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this._host = this.get('boundingBox');"," },",""," /**"," * bindUI implementation"," *"," * @description Hooks up events for the widget"," * @method bindUI"," */"," bindUI: function() {"," var button = this;"," button.after('labelChange', button._afterLabelChange);"," button.after('disabledChange', button._afterDisabledChange);"," },",""," /**"," * @method syncUI"," * @description Updates button attributes"," */"," syncUI: function() {"," var button = this;"," button._uiSetLabel(button.get('label'));"," button._uiSetDisabled(button.get('disabled'));"," },",""," /**"," * @method _afterLabelChange"," * @private"," */"," _afterLabelChange: function(e) {"," this._uiSetLabel(e.newVal);"," },",""," /**"," * @method _afterDisabledChange"," * @private"," */"," _afterDisabledChange: function(e) {"," this._uiSetDisabled(e.newVal);"," }","","}, {"," // Y.Button static properties",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'button'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'button',",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {"," label: {"," value: Y.ButtonCore.ATTRS.label.value"," },",""," disabled: {"," value: false"," }"," },",""," /**"," * @property HTML_PARSER"," * @type {Object}"," * @protected"," * @static"," */"," HTML_PARSER: {"," label: function(node) {"," this._host = node; // TODO: remove"," return this._getLabel();"," },",""," disabled: function(node) {"," return node.getDOMNode().disabled;"," }"," },",""," /**"," * List of class names used in the ButtonGroup's DOM"," *"," * @property CLASS_NAMES"," * @type Object"," * @static"," */"," CLASS_NAMES: CLASS_NAMES","});","","Y.mix(Button.prototype, Y.ButtonCore.prototype);","","/**","* Creates a ToggleButton","*","* @class ToggleButton","* @extends Button","* @param config {Object} Configuration object","* @constructor","*/","function ToggleButton(config) {"," Button.superclass.constructor.apply(this, arguments);","}","","// TODO: move to ButtonCore subclass to enable toggle plugin, widget, etc.","/* ToggleButton extends Button */","Y.extend(ToggleButton, Button, {"," "," trigger: 'click',"," selectedAttrName: '',"," "," initializer: function (config) {"," var button = this,"," type = button.get('type'),"," selectedAttrName = (type === \"checkbox\" ? 'checked' : 'pressed'),"," selectedState = config[selectedAttrName] || false;"," "," // Create the checked/pressed attribute"," button.addAttr(selectedAttrName, {"," value: selectedState"," });"," "," button.selectedAttrName = selectedAttrName;"," },"," "," destructor: function () {"," delete this.selectedAttrName;"," },"," "," /**"," * @method bindUI"," * @description Hooks up events for the widget"," */"," bindUI: function() {"," var button = this,"," cb = button.get('contentBox');"," "," ToggleButton.superclass.bindUI.call(button);"," "," cb.on(button.trigger, button.toggle, button);"," button.after(button.selectedAttrName + 'Change', button._afterSelectedChange);"," },",""," /**"," * @method syncUI"," * @description Syncs the UI for the widget"," */"," syncUI: function() {"," var button = this,"," cb = button.get('contentBox'),"," type = button.get('type'),"," ROLES = ToggleButton.ARIA_ROLES,"," role = (type === 'checkbox' ? ROLES.CHECKBOX : ROLES.TOGGLE),"," selectedAttrName = button.selectedAttrName;",""," ToggleButton.superclass.syncUI.call(button);"," "," cb.set('role', role);"," button._uiSetSelected(button.get(selectedAttrName));"," },"," "," _afterSelectedChange: function(e){"," this._uiSetSelected(e.newVal);"," },"," "," /**"," * @method _uiSetSelected"," * @private"," */"," _uiSetSelected: function(value) {"," var button = this,"," cb = button.get('contentBox'),"," STATES = ToggleButton.ARIA_STATES,"," type = button.get('type'),"," ariaState = (type === 'checkbox' ? STATES.CHECKED : STATES.PRESSED);"," "," cb.toggleClass(Button.CLASS_NAMES.SELECTED, value);"," cb.set(ariaState, value);"," },"," "," /**"," * @method toggle"," * @description Toggles the selected/pressed/checked state of a ToggleButton"," * @public"," */"," toggle: function() {"," var button = this;"," button._set(button.selectedAttrName, !button.get(button.selectedAttrName));"," }","","}, {"," "," /**"," * The identity of the widget."," *"," * @property NAME"," * @type {String}"," * @default 'buttongroup'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'toggleButton',"," "," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {"," type: {"," value: 'toggle',"," writeOnce: 'initOnly'"," }"," },"," "," /**"," * @property HTML_PARSER"," * @type {Object}"," * @protected"," * @static"," */"," HTML_PARSER: {"," checked: function(node) {"," return node.hasClass(CLASS_NAMES.SELECTED);"," },"," pressed: function(node) {"," return node.hasClass(CLASS_NAMES.SELECTED);"," }"," },"," "," /**"," * @property ARIA_STATES"," * @type {Object}"," * @protected"," * @static"," */"," ARIA_STATES: ARIA_STATES,",""," /**"," * @property ARIA_ROLES"," * @type {Object}"," * @protected"," * @static"," */"," ARIA_ROLES: ARIA_ROLES,",""," /**"," * Array of static constants used to identify the classnames applied to DOM nodes"," *"," * @property CLASS_NAMES"," * @type Object"," * @static"," */"," CLASS_NAMES: CLASS_NAMES"," ","});","","// Export","Y.Button = Button;","Y.ToggleButton = ToggleButton;","","","}, '3.7.1', {\"requires\": [\"button-core\", \"cssbutton\", \"widget\"]});"];+_yuitest_coverage["build/button/button.js"].lines = {"1":0,"10":0,"22":0,"23":0,"27":0,"40":0,"50":0,"51":0,"52":0,"60":0,"61":0,"62":0,"70":0,"78":0,"123":0,"124":0,"128":0,"142":0,"152":0,"153":0,"158":0,"164":0,"170":0,"174":0,"178":0,"186":0,"189":0,"191":0,"192":0,"200":0,"207":0,"209":0,"210":0,"214":0,"222":0,"228":0,"229":0,"238":0,"239":0,"280":0,"283":0,"315":0,"316":0};+_yuitest_coverage["build/button/button.js"].functions = {"Button:22":0,"initializer:39":0,"bindUI:49":0,"syncUI:59":0,"_afterLabelChange:69":0,"_afterDisabledChange:77":0,"label:122":0,"disabled:127":0,"ToggleButton:152":0,"initializer:163":0,"destructor:177":0,"bindUI:185":0,"syncUI:199":0,"_afterSelectedChange:213":0,"_uiSetSelected:221":0,"toggle:237":0,"checked:279":0,"pressed:282":0,"(anonymous 1):1":0};+_yuitest_coverage["build/button/button.js"].coveredLines = 43;+_yuitest_coverage["build/button/button.js"].coveredFunctions = 19;+_yuitest_coverline("build/button/button.js", 1);+YUI.add('button', function (Y, NAME) {++/**+* A Button Widget+*+* @module button+* @since 3.5.0+*/++_yuitest_coverfunc("build/button/button.js", "(anonymous 1)", 1);+_yuitest_coverline("build/button/button.js", 10);+var CLASS_NAMES = Y.ButtonCore.CLASS_NAMES,+ ARIA_STATES = Y.ButtonCore.ARIA_STATES,+ ARIA_ROLES = Y.ButtonCore.ARIA_ROLES;++/**+* Creates a Button+*+* @class Button+* @extends Widget+* @param config {Object} Configuration object+* @constructor+*/+_yuitest_coverline("build/button/button.js", 22);+function Button(config) {+ _yuitest_coverfunc("build/button/button.js", "Button", 22);+_yuitest_coverline("build/button/button.js", 23);+Button.superclass.constructor.apply(this, arguments);+}++/* Button extends Widget */+_yuitest_coverline("build/button/button.js", 27);+Y.extend(Button, Y.Widget, {++ BOUNDING_TEMPLATE: Y.ButtonCore.prototype.TEMPLATE,++ CONTENT_TEMPLATE: null,++ /**+ * @method initializer+ * @description Internal init() handler.+ * @param config {Object} Config object.+ * @private+ */+ initializer: function(config) {+ _yuitest_coverfunc("build/button/button.js", "initializer", 39);+_yuitest_coverline("build/button/button.js", 40);+this._host = this.get('boundingBox');+ },++ /**+ * bindUI implementation+ *+ * @description Hooks up events for the widget+ * @method bindUI+ */+ bindUI: function() {+ _yuitest_coverfunc("build/button/button.js", "bindUI", 49);+_yuitest_coverline("build/button/button.js", 50);+var button = this;+ _yuitest_coverline("build/button/button.js", 51);+button.after('labelChange', button._afterLabelChange);+ _yuitest_coverline("build/button/button.js", 52);+button.after('disabledChange', button._afterDisabledChange);+ },++ /**+ * @method syncUI+ * @description Updates button attributes+ */+ syncUI: function() {+ _yuitest_coverfunc("build/button/button.js", "syncUI", 59);+_yuitest_coverline("build/button/button.js", 60);+var button = this;+ _yuitest_coverline("build/button/button.js", 61);+button._uiSetLabel(button.get('label'));+ _yuitest_coverline("build/button/button.js", 62);+button._uiSetDisabled(button.get('disabled'));+ },++ /**+ * @method _afterLabelChange+ * @private+ */+ _afterLabelChange: function(e) {+ _yuitest_coverfunc("build/button/button.js", "_afterLabelChange", 69);+_yuitest_coverline("build/button/button.js", 70);+this._uiSetLabel(e.newVal);+ },++ /**+ * @method _afterDisabledChange+ * @private+ */+ _afterDisabledChange: function(e) {+ _yuitest_coverfunc("build/button/button.js", "_afterDisabledChange", 77);+_yuitest_coverline("build/button/button.js", 78);+this._uiSetDisabled(e.newVal);+ }++}, {+ // Y.Button static properties++ /**+ * The identity of the widget.+ *+ * @property NAME+ * @type String+ * @default 'button'+ * @readOnly+ * @protected+ * @static+ */+ NAME: 'button',++ /**+ * Static property used to define the default attribute configuration of+ * the Widget.+ *+ * @property ATTRS+ * @type {Object}+ * @protected+ * @static+ */+ ATTRS: {+ label: {+ value: Y.ButtonCore.ATTRS.label.value+ },++ disabled: {+ value: false+ }+ },++ /**+ * @property HTML_PARSER+ * @type {Object}+ * @protected+ * @static+ */+ HTML_PARSER: {+ label: function(node) {+ _yuitest_coverfunc("build/button/button.js", "label", 122);+_yuitest_coverline("build/button/button.js", 123);+this._host = node; // TODO: remove+ _yuitest_coverline("build/button/button.js", 124);+return this._getLabel();+ },++ disabled: function(node) {+ _yuitest_coverfunc("build/button/button.js", "disabled", 127);+_yuitest_coverline("build/button/button.js", 128);+return node.getDOMNode().disabled;+ }+ },++ /**+ * List of class names used in the ButtonGroup's DOM+ *+ * @property CLASS_NAMES+ * @type Object+ * @static+ */+ CLASS_NAMES: CLASS_NAMES+});++_yuitest_coverline("build/button/button.js", 142);+Y.mix(Button.prototype, Y.ButtonCore.prototype);++/**+* Creates a ToggleButton+*+* @class ToggleButton+* @extends Button+* @param config {Object} Configuration object+* @constructor+*/+_yuitest_coverline("build/button/button.js", 152);+function ToggleButton(config) {+ _yuitest_coverfunc("build/button/button.js", "ToggleButton", 152);+_yuitest_coverline("build/button/button.js", 153);+Button.superclass.constructor.apply(this, arguments);+}++// TODO: move to ButtonCore subclass to enable toggle plugin, widget, etc.+/* ToggleButton extends Button */+_yuitest_coverline("build/button/button.js", 158);+Y.extend(ToggleButton, Button, {+ + trigger: 'click',+ selectedAttrName: '',+ + initializer: function (config) {+ _yuitest_coverfunc("build/button/button.js", "initializer", 163);+_yuitest_coverline("build/button/button.js", 164);+var button = this,+ type = button.get('type'),+ selectedAttrName = (type === "checkbox" ? 'checked' : 'pressed'),+ selectedState = config[selectedAttrName] || false;+ + // Create the checked/pressed attribute+ _yuitest_coverline("build/button/button.js", 170);+button.addAttr(selectedAttrName, {+ value: selectedState+ });+ + _yuitest_coverline("build/button/button.js", 174);+button.selectedAttrName = selectedAttrName;+ },+ + destructor: function () {+ _yuitest_coverfunc("build/button/button.js", "destructor", 177);+_yuitest_coverline("build/button/button.js", 178);+delete this.selectedAttrName;+ },+ + /**+ * @method bindUI+ * @description Hooks up events for the widget+ */+ bindUI: function() {+ _yuitest_coverfunc("build/button/button.js", "bindUI", 185);+_yuitest_coverline("build/button/button.js", 186);+var button = this,+ cb = button.get('contentBox');+ + _yuitest_coverline("build/button/button.js", 189);+ToggleButton.superclass.bindUI.call(button);+ + _yuitest_coverline("build/button/button.js", 191);+cb.on(button.trigger, button.toggle, button);+ _yuitest_coverline("build/button/button.js", 192);+button.after(button.selectedAttrName + 'Change', button._afterSelectedChange);+ },++ /**+ * @method syncUI+ * @description Syncs the UI for the widget+ */+ syncUI: function() {+ _yuitest_coverfunc("build/button/button.js", "syncUI", 199);+_yuitest_coverline("build/button/button.js", 200);+var button = this,+ cb = button.get('contentBox'),+ type = button.get('type'),+ ROLES = ToggleButton.ARIA_ROLES,+ role = (type === 'checkbox' ? ROLES.CHECKBOX : ROLES.TOGGLE),+ selectedAttrName = button.selectedAttrName;++ _yuitest_coverline("build/button/button.js", 207);+ToggleButton.superclass.syncUI.call(button);+ + _yuitest_coverline("build/button/button.js", 209);+cb.set('role', role);+ _yuitest_coverline("build/button/button.js", 210);+button._uiSetSelected(button.get(selectedAttrName));+ },+ + _afterSelectedChange: function(e){+ _yuitest_coverfunc("build/button/button.js", "_afterSelectedChange", 213);+_yuitest_coverline("build/button/button.js", 214);+this._uiSetSelected(e.newVal);+ },+ + /**+ * @method _uiSetSelected+ * @private+ */+ _uiSetSelected: function(value) {+ _yuitest_coverfunc("build/button/button.js", "_uiSetSelected", 221);+_yuitest_coverline("build/button/button.js", 222);+var button = this,+ cb = button.get('contentBox'),+ STATES = ToggleButton.ARIA_STATES,+ type = button.get('type'),+ ariaState = (type === 'checkbox' ? STATES.CHECKED : STATES.PRESSED);+ + _yuitest_coverline("build/button/button.js", 228);+cb.toggleClass(Button.CLASS_NAMES.SELECTED, value);+ _yuitest_coverline("build/button/button.js", 229);+cb.set(ariaState, value);+ },+ + /**+ * @method toggle+ * @description Toggles the selected/pressed/checked state of a ToggleButton+ * @public+ */+ toggle: function() {+ _yuitest_coverfunc("build/button/button.js", "toggle", 237);+_yuitest_coverline("build/button/button.js", 238);+var button = this;+ _yuitest_coverline("build/button/button.js", 239);+button._set(button.selectedAttrName, !button.get(button.selectedAttrName));+ }++}, {+ + /**+ * The identity of the widget.+ *+ * @property NAME+ * @type {String}+ * @default 'buttongroup'+ * @readOnly+ * @protected+ * @static+ */+ NAME: 'toggleButton',+ + /**+ * Static property used to define the default attribute configuration of+ * the Widget.+ *+ * @property ATTRS+ * @type {Object}+ * @protected+ * @static+ */+ ATTRS: {+ type: {+ value: 'toggle',+ writeOnce: 'initOnly'+ }+ },+ + /**+ * @property HTML_PARSER+ * @type {Object}+ * @protected+ * @static+ */+ HTML_PARSER: {+ checked: function(node) {+ _yuitest_coverfunc("build/button/button.js", "checked", 279);+_yuitest_coverline("build/button/button.js", 280);+return node.hasClass(CLASS_NAMES.SELECTED);+ },+ pressed: function(node) {+ _yuitest_coverfunc("build/button/button.js", "pressed", 282);+_yuitest_coverline("build/button/button.js", 283);+return node.hasClass(CLASS_NAMES.SELECTED);+ }+ },+ + /**+ * @property ARIA_STATES+ * @type {Object}+ * @protected+ * @static+ */+ ARIA_STATES: ARIA_STATES,++ /**+ * @property ARIA_ROLES+ * @type {Object}+ * @protected+ * @static+ */+ ARIA_ROLES: ARIA_ROLES,++ /**+ * Array of static constants used to identify the classnames applied to DOM nodes+ *+ * @property CLASS_NAMES+ * @type Object+ * @static+ */+ CLASS_NAMES: CLASS_NAMES+ +});++// Export+_yuitest_coverline("build/button/button.js", 315);+Y.Button = Button;+_yuitest_coverline("build/button/button.js", 316);+Y.ToggleButton = ToggleButton;+++}, '3.7.1', {"requires": ["button-core", "cssbutton", "widget"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('button', function(Y) {+YUI.add('button', function (Y, NAME) { /** * A Button Widget@@ -322,4 +322,4 @@ Y.ToggleButton = ToggleButton; -}, '3.5.1' ,{requires:['button-core', 'cssbutton', 'widget']});+}, '3.7.1', {"requires": ["button-core", "cssbutton", "widget"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("button",function(e){var c=e.ButtonCore.CLASS_NAMES,b=e.ButtonCore.ARIA_STATES,f=e.ButtonCore.ARIA_ROLES;function a(g){a.superclass.constructor.apply(this,arguments);}e.extend(a,e.Widget,{BOUNDING_TEMPLATE:e.ButtonCore.prototype.TEMPLATE,CONTENT_TEMPLATE:null,initializer:function(g){this._host=this.get("boundingBox");},bindUI:function(){var g=this;g.after("labelChange",g._afterLabelChange);g.after("disabledChange",g._afterDisabledChange);},syncUI:function(){var g=this;g._uiSetLabel(g.get("label"));g._uiSetDisabled(g.get("disabled"));},_afterLabelChange:function(g){this._uiSetLabel(g.newVal);},_afterDisabledChange:function(g){this._uiSetDisabled(g.newVal);}},{NAME:"button",ATTRS:{label:{value:e.ButtonCore.ATTRS.label.value},disabled:{value:false}},HTML_PARSER:{label:function(g){this._host=g;return this._getLabel();},disabled:function(g){return g.getDOMNode().disabled;}},CLASS_NAMES:c});e.mix(a.prototype,e.ButtonCore.prototype);function d(g){a.superclass.constructor.apply(this,arguments);}e.extend(d,a,{trigger:"click",selectedAttrName:"",initializer:function(g){var i=this,j=i.get("type"),k=(j==="checkbox"?"checked":"pressed"),h=g[k]||false;i.addAttr(k,{value:h});i.selectedAttrName=k;},destructor:function(){delete this.selectedAttrName;},bindUI:function(){var h=this,g=h.get("contentBox");d.superclass.bindUI.call(h);g.on(h.trigger,h.toggle,h);h.after(h.selectedAttrName+"Change",h._afterSelectedChange);},syncUI:function(){var h=this,g=h.get("contentBox"),j=h.get("type"),i=d.ARIA_ROLES,l=(j==="checkbox"?i.CHECKBOX:i.TOGGLE),k=h.selectedAttrName;d.superclass.syncUI.call(h);g.set("role",l);h._uiSetSelected(h.get(k));},_afterSelectedChange:function(g){this._uiSetSelected(g.newVal);},_uiSetSelected:function(l){var i=this,g=i.get("contentBox"),h=d.ARIA_STATES,j=i.get("type"),k=(j==="checkbox"?h.CHECKED:h.PRESSED);g.toggleClass(a.CLASS_NAMES.SELECTED,l);g.set(k,l);},toggle:function(){var g=this;g._set(g.selectedAttrName,!g.get(g.selectedAttrName));}},{NAME:"toggleButton",ATTRS:{type:{value:"toggle",writeOnce:"initOnly"}},HTML_PARSER:{checked:function(g){return g.hasClass(c.SELECTED);},pressed:function(g){return g.hasClass(c.SELECTED);}},ARIA_STATES:b,ARIA_ROLES:f,CLASS_NAMES:c});e.Button=a;e.ToggleButton=d;},"3.5.1",{requires:["button-core","cssbutton","widget"]});+YUI.add("button",function(e,t){function s(e){s.superclass.constructor.apply(this,arguments)}function o(e){s.superclass.constructor.apply(this,arguments)}var n=e.ButtonCore.CLASS_NAMES,r=e.ButtonCore.ARIA_STATES,i=e.ButtonCore.ARIA_ROLES;e.extend(s,e.Widget,{BOUNDING_TEMPLATE:e.ButtonCore.prototype.TEMPLATE,CONTENT_TEMPLATE:null,initializer:function(e){this._host=this.get("boundingBox")},bindUI:function(){var e=this;e.after("labelChange",e._afterLabelChange),e.after("disabledChange",e._afterDisabledChange)},syncUI:function(){var e=this;e._uiSetLabel(e.get("label")),e._uiSetDisabled(e.get("disabled"))},_afterLabelChange:function(e){this._uiSetLabel(e.newVal)},_afterDisabledChange:function(e){this._uiSetDisabled(e.newVal)}},{NAME:"button",ATTRS:{label:{value:e.ButtonCore.ATTRS.label.value},disabled:{value:!1}},HTML_PARSER:{label:function(e){return this._host=e,this._getLabel()},disabled:function(e){return e.getDOMNode().disabled}},CLASS_NAMES:n}),e.mix(s.prototype,e.ButtonCore.prototype),e.extend(o,s,{trigger:"click",selectedAttrName:"",initializer:function(e){var t=this,n=t.get("type"),r=n==="checkbox"?"checked":"pressed",i=e[r]||!1;t.addAttr(r,{value:i}),t.selectedAttrName=r},destructor:function(){delete this.selectedAttrName},bindUI:function(){var e=this,t=e.get("contentBox");o.superclass.bindUI.call(e),t.on(e.trigger,e.toggle,e),e.after(e.selectedAttrName+"Change",e._afterSelectedChange)},syncUI:function(){var e=this,t=e.get("contentBox"),n=e.get("type"),r=o.ARIA_ROLES,i=n==="checkbox"?r.CHECKBOX:r.TOGGLE,s=e.selectedAttrName;o.superclass.syncUI.call(e),t.set("role",i),e._uiSetSelected(e.get(s))},_afterSelectedChange:function(e){this._uiSetSelected(e.newVal)},_uiSetSelected:function(e){var t=this,n=t.get("contentBox"),r=o.ARIA_STATES,i=t.get("type"),u=i==="checkbox"?r.CHECKED:r.PRESSED;n.toggleClass(s.CLASS_NAMES.SELECTED,e),n.set(u,e)},toggle:function(){var e=this;e._set(e.selectedAttrName,!e.get(e.selectedAttrName))}},{NAME:"toggleButton",ATTRS:{type:{value:"toggle",writeOnce:"initOnly"}},HTML_PARSER:{checked:function(e){return e.hasClass(n.SELECTED)},pressed:function(e){return e.hasClass(n.SELECTED)}},ARIA_STATES:r,ARIA_ROLES:i,CLASS_NAMES:n}),e.Button=s,e.ToggleButton=o},"3.7.1",{requires:["button-core","cssbutton","widget"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('button', function(Y) {+YUI.add('button', function (Y, NAME) { /** * A Button Widget@@ -322,4 +322,4 @@ Y.ToggleButton = ToggleButton; -}, '3.5.1' ,{requires:['button-core', 'cssbutton', 'widget']});+}, '3.7.1', {"requires": ["button-core", "cssbutton", "widget"]});
@@ -0,0 +1,546 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/cache-base/cache-base.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/cache-base/cache-base.js",+ code: []+};+_yuitest_coverage["build/cache-base/cache-base.js"].code=["YUI.add('cache-base', function (Y, NAME) {","","/**"," * The Cache utility provides a common configurable interface for components to"," * cache and retrieve data from a local JavaScript struct."," *"," * @module cache"," * @main"," */","","/**"," * Provides the base class for the YUI Cache utility."," *"," * @submodule cache-base"," */","var LANG = Y.Lang,"," isDate = Y.Lang.isDate,","","/**"," * Base class for the YUI Cache utility."," * @class Cache"," * @extends Base"," * @constructor"," */","Cache = function() {"," Cache.superclass.constructor.apply(this, arguments);","};",""," /////////////////////////////////////////////////////////////////////////////"," //"," // Cache static properties"," //"," /////////////////////////////////////////////////////////////////////////////","Y.mix(Cache, {"," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"cache\""," */"," NAME: \"cache\",","",""," ATTRS: {"," /////////////////////////////////////////////////////////////////////////////"," //"," // Cache Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," /**"," * @attribute max"," * @description Maximum number of entries the Cache can hold."," * Set to 0 to turn off caching."," * @type Number"," * @default 0"," */"," max: {"," value: 0,"," setter: \"_setMax\""," },",""," /**"," * @attribute size"," * @description Number of entries currently cached."," * @type Number"," */"," size: {"," readOnly: true,"," getter: \"_getSize\""," },",""," /**"," * @attribute uniqueKeys"," * @description Validate uniqueness of stored keys. Default is false and"," * is more performant."," * @type Boolean"," */"," uniqueKeys: {"," value: false"," },",""," /**"," * @attribute expires"," * @description Absolute Date when data expires or"," * relative number of milliseconds. Zero disables expiration."," * @type Date | Number"," * @default 0"," */"," expires: {"," value: 0,"," validator: function(v) {"," return Y.Lang.isDate(v) || (Y.Lang.isNumber(v) && v >= 0);"," }"," },",""," /**"," * @attribute entries"," * @description Cached entries."," * @type Array"," */"," entries: {"," readOnly: true,"," getter: \"_getEntries\""," }"," }","});","","Y.extend(Cache, Y.Base, {"," /////////////////////////////////////////////////////////////////////////////"," //"," // Cache private properties"," //"," /////////////////////////////////////////////////////////////////////////////",""," /**"," * Array of request/response objects indexed chronologically."," *"," * @property _entries"," * @type Object[]"," * @private"," */"," _entries: null,",""," /////////////////////////////////////////////////////////////////////////////"," //"," // Cache private methods"," //"," /////////////////////////////////////////////////////////////////////////////",""," /**"," * @method initializer"," * @description Internal init() handler."," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {",""," /**"," * @event add"," * @description Fired when an entry is added."," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>entry (Object)</dt> <dd>The cached entry.</dd>"," * </dl>"," * @preventable _defAddFn"," */"," this.publish(\"add\", {defaultFn: this._defAddFn});",""," /**"," * @event flush"," * @description Fired when the cache is flushed."," * @param e {Event.Facade} Event Facade object."," * @preventable _defFlushFn"," */"," this.publish(\"flush\", {defaultFn: this._defFlushFn});",""," /**"," * @event request"," * @description Fired when an entry is requested from the cache."," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>request (Object)</dt> <dd>The request object.</dd>"," * </dl>"," */",""," /**"," * @event retrieve"," * @description Fired when an entry is retrieved from the cache."," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>entry (Object)</dt> <dd>The retrieved entry.</dd>"," * </dl>"," */",""," // Initialize internal values"," this._entries = [];"," },",""," /**"," * @method destructor"," * @description Internal destroy() handler."," * @private"," */"," destructor: function() {"," this._entries = [];"," },",""," /////////////////////////////////////////////////////////////////////////////"," //"," // Cache protected methods"," //"," /////////////////////////////////////////////////////////////////////////////",""," /**"," * Sets max."," *"," * @method _setMax"," * @protected"," */"," _setMax: function(value) {"," // If the cache is full, make room by removing stalest element (index=0)"," var entries = this._entries;"," if(value > 0) {"," if(entries) {"," while(entries.length > value) {"," entries.shift();"," }"," }"," }"," else {"," value = 0;"," this._entries = [];"," }"," return value;"," },",""," /**"," * Gets size."," *"," * @method _getSize"," * @protected"," */"," _getSize: function() {"," return this._entries.length;"," },",""," /**"," * Gets all entries."," *"," * @method _getEntries"," * @protected"," */"," _getEntries: function() {"," return this._entries;"," },","",""," /**"," * Adds entry to cache."," *"," * @method _defAddFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>entry (Object)</dt> <dd>The cached entry.</dd>"," * </dl>"," * @protected"," */"," _defAddFn: function(e) {"," var entries = this._entries,"," entry = e.entry,"," max = this.get(\"max\"),"," pos;",""," // If uniqueKeys is true and item exists with this key, then remove it."," if (this.get(\"uniqueKeys\")) {"," pos = this._position(e.entry.request);"," if (LANG.isValue(pos)) {"," entries.splice(pos, 1);"," }"," }",""," // If the cache at or over capacity, make room by removing stalest"," // element(s) starting at index-0."," while (max && entries.length >= max) {"," entries.shift();"," }",""," // Add entry to cache in the newest position, at the end of the array"," entries[entries.length] = entry;"," },",""," /**"," * Flushes cache."," *"," * @method _defFlushFn"," * @param e {Event.Facade} Event Facade object."," * @protected"," */"," _defFlushFn: function(e) {"," var entries = this._entries,"," details = e.details[0],"," pos;",""," //passed an item, flush only that"," if(details && LANG.isValue(details.request)) {"," pos = this._position(details.request);",""," if(LANG.isValue(pos)) {"," entries.splice(pos,1);",""," }"," }"," //no item, flush everything"," else {"," this._entries = [];"," }"," },",""," /**"," * Default overridable method compares current request with given cache entry."," * Returns true if current request matches the cached request, otherwise"," * false. Implementers should override this method to customize the"," * cache-matching algorithm."," *"," * @method _isMatch"," * @param request {Object} Request object."," * @param entry {Object} Cached entry."," * @return {Boolean} True if current request matches given cached request, false otherwise."," * @protected"," */"," _isMatch: function(request, entry) {"," if(!entry.expires || new Date() < entry.expires) {"," return (request === entry.request);"," }"," return false;"," },",""," /**"," * Returns position of a request in the entries array, otherwise null."," *"," * @method _position"," * @param request {Object} Request object."," * @return {Number} Array position if found, null otherwise."," * @protected"," */"," _position: function(request) {"," // If cache is enabled..."," var entries = this._entries,"," length = entries.length,"," i = length-1;",""," if((this.get(\"max\") === null) || this.get(\"max\") > 0) {"," // Loop through each cached entry starting from the newest"," for(; i >= 0; i--) {"," // Execute matching function"," if(this._isMatch(request, entries[i])) {"," return i;"," }"," }"," }",""," return null;"," },",""," /////////////////////////////////////////////////////////////////////////////"," //"," // Cache public methods"," //"," /////////////////////////////////////////////////////////////////////////////",""," /**"," * Adds a new entry to the cache of the format"," * {request:request, response:response, cached:cached, expires:expires}."," * If cache is full, evicts the stalest entry before adding the new one."," *"," * @method add"," * @param request {Object} Request value."," * @param response {Object} Response value."," */"," add: function(request, response) {"," var expires = this.get(\"expires\");"," if(this.get(\"initialized\") && ((this.get(\"max\") === null) || this.get(\"max\") > 0) &&"," (LANG.isValue(request) || LANG.isNull(request) || LANG.isUndefined(request))) {"," this.fire(\"add\", {entry: {"," request:request,"," response:response,"," cached: new Date(),"," expires: isDate(expires) ? expires :"," (expires ? new Date(new Date().getTime() + this.get(\"expires\")) : null)"," }});"," }"," else {"," }"," },",""," /**"," * Flushes cache."," *"," * @method flush"," */"," flush: function(request) {"," this.fire(\"flush\", { request: (LANG.isValue(request) ? request : null) });"," },",""," /**"," * Retrieves cached object for given request, if available, and refreshes"," * entry in the cache. Returns null if there is no cache match."," *"," * @method retrieve"," * @param request {Object} Request object."," * @return {Object} Cached object with the properties request and response, or null."," */"," retrieve: function(request) {"," // If cache is enabled..."," var entries = this._entries,"," length = entries.length,"," entry = null,"," pos;",""," if((length > 0) && ((this.get(\"max\") === null) || (this.get(\"max\") > 0))) {"," this.fire(\"request\", {request: request});",""," pos = this._position(request);",""," if(LANG.isValue(pos)) {"," entry = entries[pos];",""," this.fire(\"retrieve\", {entry: entry});",""," // Refresh the position of the cache hit"," if(pos < length-1) {"," // Remove element from its original location"," entries.splice(pos,1);"," // Add as newest"," entries[entries.length] = entry;"," }",""," return entry;"," }"," }"," return null;"," }","});","","Y.Cache = Cache;","","","}, '3.7.1', {\"requires\": [\"base\"]});"];+_yuitest_coverage["build/cache-base/cache-base.js"].lines = {"1":0,"16":0,"26":0,"34":0,"96":0,"112":0,"151":0,"159":0,"180":0,"189":0,"206":0,"207":0,"208":0,"209":0,"210":0,"215":0,"216":0,"218":0,"228":0,"238":0,"253":0,"259":0,"260":0,"261":0,"262":0,"268":0,"269":0,"273":0,"284":0,"289":0,"290":0,"292":0,"293":0,"299":0,"316":0,"317":0,"319":0,"332":0,"336":0,"338":0,"340":0,"341":0,"346":0,"365":0,"366":0,"368":0,"386":0,"399":0,"404":0,"405":0,"407":0,"409":0,"410":0,"412":0,"415":0,"417":0,"419":0,"422":0,"425":0,"429":0};+_yuitest_coverage["build/cache-base/cache-base.js"].functions = {"Cache:25":0,"validator:95":0,"initializer:140":0,"destructor:188":0,"_setMax:204":0,"_getSize:227":0,"_getEntries:237":0,"_defAddFn:252":0,"_defFlushFn:283":0,"_isMatch:315":0,"_position:330":0,"add:364":0,"flush:385":0,"retrieve:397":0,"(anonymous 1):1":0};+_yuitest_coverage["build/cache-base/cache-base.js"].coveredLines = 60;+_yuitest_coverage["build/cache-base/cache-base.js"].coveredFunctions = 15;+_yuitest_coverline("build/cache-base/cache-base.js", 1);+YUI.add('cache-base', function (Y, NAME) {++/**+ * The Cache utility provides a common configurable interface for components to+ * cache and retrieve data from a local JavaScript struct.+ *+ * @module cache+ * @main+ */++/**+ * Provides the base class for the YUI Cache utility.+ *+ * @submodule cache-base+ */+_yuitest_coverfunc("build/cache-base/cache-base.js", "(anonymous 1)", 1);+_yuitest_coverline("build/cache-base/cache-base.js", 16);+var LANG = Y.Lang,+ isDate = Y.Lang.isDate,++/**+ * Base class for the YUI Cache utility.+ * @class Cache+ * @extends Base+ * @constructor+ */+Cache = function() {+ _yuitest_coverfunc("build/cache-base/cache-base.js", "Cache", 25);+_yuitest_coverline("build/cache-base/cache-base.js", 26);+Cache.superclass.constructor.apply(this, arguments);+};++ /////////////////////////////////////////////////////////////////////////////+ //+ // Cache static properties+ //+ /////////////////////////////////////////////////////////////////////////////+_yuitest_coverline("build/cache-base/cache-base.js", 34);+Y.mix(Cache, {+ /**+ * Class name.+ *+ * @property NAME+ * @type String+ * @static+ * @final+ * @value "cache"+ */+ NAME: "cache",+++ ATTRS: {+ /////////////////////////////////////////////////////////////////////////////+ //+ // Cache Attributes+ //+ /////////////////////////////////////////////////////////////////////////////++ /**+ * @attribute max+ * @description Maximum number of entries the Cache can hold.+ * Set to 0 to turn off caching.+ * @type Number+ * @default 0+ */+ max: {+ value: 0,+ setter: "_setMax"+ },++ /**+ * @attribute size+ * @description Number of entries currently cached.+ * @type Number+ */+ size: {+ readOnly: true,+ getter: "_getSize"+ },++ /**+ * @attribute uniqueKeys+ * @description Validate uniqueness of stored keys. Default is false and+ * is more performant.+ * @type Boolean+ */+ uniqueKeys: {+ value: false+ },++ /**+ * @attribute expires+ * @description Absolute Date when data expires or+ * relative number of milliseconds. Zero disables expiration.+ * @type Date | Number+ * @default 0+ */+ expires: {+ value: 0,+ validator: function(v) {+ _yuitest_coverfunc("build/cache-base/cache-base.js", "validator", 95);+_yuitest_coverline("build/cache-base/cache-base.js", 96);+return Y.Lang.isDate(v) || (Y.Lang.isNumber(v) && v >= 0);+ }+ },++ /**+ * @attribute entries+ * @description Cached entries.+ * @type Array+ */+ entries: {+ readOnly: true,+ getter: "_getEntries"+ }+ }+});++_yuitest_coverline("build/cache-base/cache-base.js", 112);+Y.extend(Cache, Y.Base, {+ /////////////////////////////////////////////////////////////////////////////+ //+ // Cache private properties+ //+ /////////////////////////////////////////////////////////////////////////////++ /**+ * Array of request/response objects indexed chronologically.+ *+ * @property _entries+ * @type Object[]+ * @private+ */+ _entries: null,++ /////////////////////////////////////////////////////////////////////////////+ //+ // Cache private methods+ //+ /////////////////////////////////////////////////////////////////////////////++ /**+ * @method initializer+ * @description Internal init() handler.+ * @param config {Object} Config object.+ * @private+ */+ initializer: function(config) {++ /**+ * @event add+ * @description Fired when an entry is added.+ * @param e {Event.Facade} Event Facade with the following properties:+ * <dl>+ * <dt>entry (Object)</dt> <dd>The cached entry.</dd>+ * </dl>+ * @preventable _defAddFn+ */+ _yuitest_coverfunc("build/cache-base/cache-base.js", "initializer", 140);+_yuitest_coverline("build/cache-base/cache-base.js", 151);+this.publish("add", {defaultFn: this._defAddFn});++ /**+ * @event flush+ * @description Fired when the cache is flushed.+ * @param e {Event.Facade} Event Facade object.+ * @preventable _defFlushFn+ */+ _yuitest_coverline("build/cache-base/cache-base.js", 159);+this.publish("flush", {defaultFn: this._defFlushFn});++ /**+ * @event request+ * @description Fired when an entry is requested from the cache.+ * @param e {Event.Facade} Event Facade with the following properties:+ * <dl>+ * <dt>request (Object)</dt> <dd>The request object.</dd>+ * </dl>+ */++ /**+ * @event retrieve+ * @description Fired when an entry is retrieved from the cache.+ * @param e {Event.Facade} Event Facade with the following properties:+ * <dl>+ * <dt>entry (Object)</dt> <dd>The retrieved entry.</dd>+ * </dl>+ */++ // Initialize internal values+ _yuitest_coverline("build/cache-base/cache-base.js", 180);+this._entries = [];+ },++ /**+ * @method destructor+ * @description Internal destroy() handler.+ * @private+ */+ destructor: function() {+ _yuitest_coverfunc("build/cache-base/cache-base.js", "destructor", 188);+_yuitest_coverline("build/cache-base/cache-base.js", 189);+this._entries = [];+ },++ /////////////////////////////////////////////////////////////////////////////+ //+ // Cache protected methods+ //+ /////////////////////////////////////////////////////////////////////////////++ /**+ * Sets max.+ *+ * @method _setMax+ * @protected+ */+ _setMax: function(value) {+ // If the cache is full, make room by removing stalest element (index=0)+ _yuitest_coverfunc("build/cache-base/cache-base.js", "_setMax", 204);+_yuitest_coverline("build/cache-base/cache-base.js", 206);+var entries = this._entries;+ _yuitest_coverline("build/cache-base/cache-base.js", 207);+if(value > 0) {+ _yuitest_coverline("build/cache-base/cache-base.js", 208);+if(entries) {+ _yuitest_coverline("build/cache-base/cache-base.js", 209);+while(entries.length > value) {+ _yuitest_coverline("build/cache-base/cache-base.js", 210);+entries.shift();+ }+ }+ }+ else {+ _yuitest_coverline("build/cache-base/cache-base.js", 215);+value = 0;+ _yuitest_coverline("build/cache-base/cache-base.js", 216);+this._entries = [];+ }+ _yuitest_coverline("build/cache-base/cache-base.js", 218);+return value;+ },++ /**+ * Gets size.+ *+ * @method _getSize+ * @protected+ */+ _getSize: function() {+ _yuitest_coverfunc("build/cache-base/cache-base.js", "_getSize", 227);+_yuitest_coverline("build/cache-base/cache-base.js", 228);+return this._entries.length;+ },++ /**+ * Gets all entries.+ *+ * @method _getEntries+ * @protected+ */+ _getEntries: function() {+ _yuitest_coverfunc("build/cache-base/cache-base.js", "_getEntries", 237);+_yuitest_coverline("build/cache-base/cache-base.js", 238);+return this._entries;+ },+++ /**+ * Adds entry to cache.+ *+ * @method _defAddFn+ * @param e {Event.Facade} Event Facade with the following properties:+ * <dl>+ * <dt>entry (Object)</dt> <dd>The cached entry.</dd>+ * </dl>+ * @protected+ */+ _defAddFn: function(e) {+ _yuitest_coverfunc("build/cache-base/cache-base.js", "_defAddFn", 252);+_yuitest_coverline("build/cache-base/cache-base.js", 253);+var entries = this._entries,+ entry = e.entry,+ max = this.get("max"),+ pos;++ // If uniqueKeys is true and item exists with this key, then remove it.+ _yuitest_coverline("build/cache-base/cache-base.js", 259);+if (this.get("uniqueKeys")) {+ _yuitest_coverline("build/cache-base/cache-base.js", 260);+pos = this._position(e.entry.request);+ _yuitest_coverline("build/cache-base/cache-base.js", 261);+if (LANG.isValue(pos)) {+ _yuitest_coverline("build/cache-base/cache-base.js", 262);+entries.splice(pos, 1);+ }+ }++ // If the cache at or over capacity, make room by removing stalest+ // element(s) starting at index-0.+ _yuitest_coverline("build/cache-base/cache-base.js", 268);+while (max && entries.length >= max) {+ _yuitest_coverline("build/cache-base/cache-base.js", 269);+entries.shift();+ }++ // Add entry to cache in the newest position, at the end of the array+ _yuitest_coverline("build/cache-base/cache-base.js", 273);+entries[entries.length] = entry;+ },++ /**+ * Flushes cache.+ *+ * @method _defFlushFn+ * @param e {Event.Facade} Event Facade object.+ * @protected+ */+ _defFlushFn: function(e) {+ _yuitest_coverfunc("build/cache-base/cache-base.js", "_defFlushFn", 283);+_yuitest_coverline("build/cache-base/cache-base.js", 284);+var entries = this._entries,+ details = e.details[0],+ pos;++ //passed an item, flush only that+ _yuitest_coverline("build/cache-base/cache-base.js", 289);+if(details && LANG.isValue(details.request)) {+ _yuitest_coverline("build/cache-base/cache-base.js", 290);+pos = this._position(details.request);++ _yuitest_coverline("build/cache-base/cache-base.js", 292);+if(LANG.isValue(pos)) {+ _yuitest_coverline("build/cache-base/cache-base.js", 293);+entries.splice(pos,1);++ }+ }+ //no item, flush everything+ else {+ _yuitest_coverline("build/cache-base/cache-base.js", 299);+this._entries = [];+ }+ },++ /**+ * Default overridable method compares current request with given cache entry.+ * Returns true if current request matches the cached request, otherwise+ * false. Implementers should override this method to customize the+ * cache-matching algorithm.+ *+ * @method _isMatch+ * @param request {Object} Request object.+ * @param entry {Object} Cached entry.+ * @return {Boolean} True if current request matches given cached request, false otherwise.+ * @protected+ */+ _isMatch: function(request, entry) {+ _yuitest_coverfunc("build/cache-base/cache-base.js", "_isMatch", 315);+_yuitest_coverline("build/cache-base/cache-base.js", 316);+if(!entry.expires || new Date() < entry.expires) {+ _yuitest_coverline("build/cache-base/cache-base.js", 317);+return (request === entry.request);+ }+ _yuitest_coverline("build/cache-base/cache-base.js", 319);+return false;+ },++ /**+ * Returns position of a request in the entries array, otherwise null.+ *+ * @method _position+ * @param request {Object} Request object.+ * @return {Number} Array position if found, null otherwise.+ * @protected+ */+ _position: function(request) {+ // If cache is enabled...+ _yuitest_coverfunc("build/cache-base/cache-base.js", "_position", 330);+_yuitest_coverline("build/cache-base/cache-base.js", 332);+var entries = this._entries,+ length = entries.length,+ i = length-1;++ _yuitest_coverline("build/cache-base/cache-base.js", 336);+if((this.get("max") === null) || this.get("max") > 0) {+ // Loop through each cached entry starting from the newest+ _yuitest_coverline("build/cache-base/cache-base.js", 338);+for(; i >= 0; i--) {+ // Execute matching function+ _yuitest_coverline("build/cache-base/cache-base.js", 340);+if(this._isMatch(request, entries[i])) {+ _yuitest_coverline("build/cache-base/cache-base.js", 341);+return i;+ }+ }+ }++ _yuitest_coverline("build/cache-base/cache-base.js", 346);+return null;+ },++ /////////////////////////////////////////////////////////////////////////////+ //+ // Cache public methods+ //+ /////////////////////////////////////////////////////////////////////////////++ /**+ * Adds a new entry to the cache of the format+ * {request:request, response:response, cached:cached, expires:expires}.+ * If cache is full, evicts the stalest entry before adding the new one.+ *+ * @method add+ * @param request {Object} Request value.+ * @param response {Object} Response value.+ */+ add: function(request, response) {+ _yuitest_coverfunc("build/cache-base/cache-base.js", "add", 364);+_yuitest_coverline("build/cache-base/cache-base.js", 365);+var expires = this.get("expires");+ _yuitest_coverline("build/cache-base/cache-base.js", 366);+if(this.get("initialized") && ((this.get("max") === null) || this.get("max") > 0) &&+ (LANG.isValue(request) || LANG.isNull(request) || LANG.isUndefined(request))) {+ _yuitest_coverline("build/cache-base/cache-base.js", 368);+this.fire("add", {entry: {+ request:request,+ response:response,+ cached: new Date(),+ expires: isDate(expires) ? expires :+ (expires ? new Date(new Date().getTime() + this.get("expires")) : null)+ }});+ }+ else {+ }+ },++ /**+ * Flushes cache.+ *+ * @method flush+ */+ flush: function(request) {+ _yuitest_coverfunc("build/cache-base/cache-base.js", "flush", 385);+_yuitest_coverline("build/cache-base/cache-base.js", 386);+this.fire("flush", { request: (LANG.isValue(request) ? request : null) });+ },++ /**+ * Retrieves cached object for given request, if available, and refreshes+ * entry in the cache. Returns null if there is no cache match.+ *+ * @method retrieve+ * @param request {Object} Request object.+ * @return {Object} Cached object with the properties request and response, or null.+ */+ retrieve: function(request) {+ // If cache is enabled...+ _yuitest_coverfunc("build/cache-base/cache-base.js", "retrieve", 397);+_yuitest_coverline("build/cache-base/cache-base.js", 399);+var entries = this._entries,+ length = entries.length,+ entry = null,+ pos;++ _yuitest_coverline("build/cache-base/cache-base.js", 404);+if((length > 0) && ((this.get("max") === null) || (this.get("max") > 0))) {+ _yuitest_coverline("build/cache-base/cache-base.js", 405);+this.fire("request", {request: request});++ _yuitest_coverline("build/cache-base/cache-base.js", 407);+pos = this._position(request);++ _yuitest_coverline("build/cache-base/cache-base.js", 409);+if(LANG.isValue(pos)) {+ _yuitest_coverline("build/cache-base/cache-base.js", 410);+entry = entries[pos];++ _yuitest_coverline("build/cache-base/cache-base.js", 412);+this.fire("retrieve", {entry: entry});++ // Refresh the position of the cache hit+ _yuitest_coverline("build/cache-base/cache-base.js", 415);+if(pos < length-1) {+ // Remove element from its original location+ _yuitest_coverline("build/cache-base/cache-base.js", 417);+entries.splice(pos,1);+ // Add as newest+ _yuitest_coverline("build/cache-base/cache-base.js", 419);+entries[entries.length] = entry;+ }++ _yuitest_coverline("build/cache-base/cache-base.js", 422);+return entry;+ }+ }+ _yuitest_coverline("build/cache-base/cache-base.js", 425);+return null;+ }+});++_yuitest_coverline("build/cache-base/cache-base.js", 429);+Y.Cache = Cache;+++}, '3.7.1', {"requires": ["base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('cache-base', function(Y) {+YUI.add('cache-base', function (Y, NAME) { /** * The Cache utility provides a common configurable interface for components to@@ -445,4 +445,4 @@ Y.Cache = Cache; -}, '3.5.1' ,{requires:['base']});+}, '3.7.1', {"requires": ["base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("cache-base",function(d){var a=d.Lang,b=d.Lang.isDate,c=function(){c.superclass.constructor.apply(this,arguments);};d.mix(c,{NAME:"cache",ATTRS:{max:{value:0,setter:"_setMax"},size:{readOnly:true,getter:"_getSize"},uniqueKeys:{value:false},expires:{value:0,validator:function(e){return d.Lang.isDate(e)||(d.Lang.isNumber(e)&&e>=0);}},entries:{readOnly:true,getter:"_getEntries"}}});d.extend(c,d.Base,{_entries:null,initializer:function(e){this.publish("add",{defaultFn:this._defAddFn});this.publish("flush",{defaultFn:this._defFlushFn});this._entries=[];},destructor:function(){this._entries=[];},_setMax:function(f){var e=this._entries;if(f>0){if(e){while(e.length>f){e.shift();}}}else{f=0;this._entries=[];}return f;},_getSize:function(){return this._entries.length;},_getEntries:function(){return this._entries;},_defAddFn:function(i){var g=this._entries,h=i.entry,f=this.get("max"),j;if(this.get("uniqueKeys")){j=this._position(i.entry.request);if(a.isValue(j)){g.splice(j,1);}}while(f&&g.length>=f){g.shift();}g[g.length]=h;},_defFlushFn:function(h){var f=this._entries,g=h.details[0],i;if(g&&a.isValue(g.request)){i=this._position(g.request);if(a.isValue(i)){f.splice(i,1);}}else{this._entries=[];}},_isMatch:function(f,e){if(!e.expires||new Date()<e.expires){return(f===e.request);}return false;},_position:function(h){var e=this._entries,g=e.length,f=g-1;if((this.get("max")===null)||this.get("max")>0){for(;f>=0;f--){if(this._isMatch(h,e[f])){return f;}}}return null;},add:function(g,f){var e=this.get("expires");if(this.get("initialized")&&((this.get("max")===null)||this.get("max")>0)&&(a.isValue(g)||a.isNull(g)||a.isUndefined(g))){this.fire("add",{entry:{request:g,response:f,cached:new Date(),expires:b(e)?e:(e?new Date(new Date().getTime()+this.get("expires")):null)}});}else{}},flush:function(e){this.fire("flush",{request:(a.isValue(e)?e:null)});},retrieve:function(h){var e=this._entries,g=e.length,f=null,i;if((g>0)&&((this.get("max")===null)||(this.get("max")>0))){this.fire("request",{request:h});i=this._position(h);if(a.isValue(i)){f=e[i];this.fire("retrieve",{entry:f});if(i<g-1){e.splice(i,1);e[e.length]=f;}return f;}}return null;}});d.Cache=c;},"3.5.1",{requires:["base"]});+YUI.add("cache-base",function(e,t){var n=e.Lang,r=e.Lang.isDate,i=function(){i.superclass.constructor.apply(this,arguments)};e.mix(i,{NAME:"cache",ATTRS:{max:{value:0,setter:"_setMax"},size:{readOnly:!0,getter:"_getSize"},uniqueKeys:{value:!1},expires:{value:0,validator:function(t){return e.Lang.isDate(t)||e.Lang.isNumber(t)&&t>=0}},entries:{readOnly:!0,getter:"_getEntries"}}}),e.extend(i,e.Base,{_entries:null,initializer:function(e){this.publish("add",{defaultFn:this._defAddFn}),this.publish("flush",{defaultFn:this._defFlushFn}),this._entries=[]},destructor:function(){this._entries=[]},_setMax:function(e){var t=this._entries;if(e>0){if(t)while(t.length>e)t.shift()}else e=0,this._entries=[];return e},_getSize:function(){return this._entries.length},_getEntries:function(){return this._entries},_defAddFn:function(e){var t=this._entries,r=e.entry,i=this.get("max"),s;this.get("uniqueKeys")&&(s=this._position(e.entry.request),n.isValue(s)&&t.splice(s,1));while(i&&t.length>=i)t.shift();t[t.length]=r},_defFlushFn:function(e){var t=this._entries,r=e.details[0],i;r&&n.isValue(r.request)?(i=this._position(r.request),n.isValue(i)&&t.splice(i,1)):this._entries=[]},_isMatch:function(e,t){return!t.expires||new Date<t.expires?e===t.request:!1},_position:function(e){var t=this._entries,n=t.length,r=n-1;if(this.get("max")===null||this.get("max")>0)for(;r>=0;r--)if(this._isMatch(e,t[r]))return r;return null},add:function(e,t){var i=this.get("expires");this.get("initialized")&&(this.get("max")===null||this.get("max")>0)&&(n.isValue(e)||n.isNull(e)||n.isUndefined(e))&&this.fire("add",{entry:{request:e,response:t,cached:new Date,expires:r(i)?i:i?new Date((new Date).getTime()+this.get("expires")):null}})},flush:function(e){this.fire("flush",{request:n.isValue(e)?e:null})},retrieve:function(e){var t=this._entries,r=t.length,i=null,s;if(r>0&&(this.get("max")===null||this.get("max")>0)){this.fire("request",{request:e}),s=this._position(e);if(n.isValue(s))return i=t[s],this.fire("retrieve",{entry:i}),s<r-1&&(t.splice(s,1),t[t.length]=i),i}return null}}),e.Cache=i},"3.7.1",{requires:["base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('cache-base', function(Y) {+YUI.add('cache-base', function (Y, NAME) { /** * The Cache utility provides a common configurable interface for components to@@ -435,4 +435,4 @@ Y.Cache = Cache; -}, '3.5.1' ,{requires:['base']});+}, '3.7.1', {"requires": ["base"]});
@@ -0,0 +1,439 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/cache-offline/cache-offline.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/cache-offline/cache-offline.js",+ code: []+};+_yuitest_coverage["build/cache-offline/cache-offline.js"].code=["YUI.add('cache-offline', function (Y, NAME) {","","/**"," * Provides a Cache subclass which uses HTML5 `localStorage` for persistence."," * "," * @module cache"," * @submodule cache-offline"," */","","/**"," * Extends Cache utility with offline functionality."," * @class CacheOffline"," * @extends Cache"," * @constructor"," */","function CacheOffline() {"," CacheOffline.superclass.constructor.apply(this, arguments);","}","","var localStorage = null,"," JSON = Y.JSON;","","// Bug 2529572","try {"," localStorage = Y.config.win.localStorage;","}","catch(e) {","}","","/////////////////////////////////////////////////////////////////////////////","//","// CacheOffline events","//","/////////////////////////////////////////////////////////////////////////////","","/**","* @event error","* @description Fired when an entry could not be added, most likely due to","* exceeded browser quota.","* <dl>","* <dt>error (Object)</dt> <dd>The error object.</dd>","* </dl>","*/","","/////////////////////////////////////////////////////////////////////////////","//","// CacheOffline static","//","/////////////////////////////////////////////////////////////////////////////","Y.mix(CacheOffline, {"," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"cacheOffline\""," */"," NAME: \"cacheOffline\",",""," ATTRS: {"," /////////////////////////////////////////////////////////////////////////////"," //"," // CacheOffline Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," /**"," * @attribute sandbox"," * @description A string that must be passed in via the constructor."," * This identifier is used to sandbox one cache instance's entries"," * from another. Calling the cache instance's flush and length methods"," * or get(\"entries\") will apply to only these sandboxed entries."," * @type String"," * @default \"default\""," * @initOnly"," */"," sandbox: {"," value: \"default\","," writeOnce: \"initOnly\""," },",""," /**"," * @attribute expires"," * @description Absolute Date when data expires or"," * relative number of milliseconds. Zero disables expiration."," * @type Date | Number"," * @default 86400000 (one day)"," */"," expires: {"," value: 86400000"," },",""," /**"," * @attribute max"," * @description Disabled."," * @readOnly"," * @default null"," */"," max: {"," value: null,"," readOnly: true"," },",""," /**"," * @attribute uniqueKeys"," * @description Always true for CacheOffline."," * @readOnly"," * @default true"," */"," uniqueKeys: {"," value: true,"," readOnly: true,"," setter: function() {"," return true;"," }"," }"," },",""," /**"," * Removes all items from all sandboxes. Useful if localStorage has"," * exceeded quota. Only supported on browsers that implement HTML 5"," * localStorage."," *"," * @method flushAll"," * @static"," */"," flushAll: function() {"," var store = localStorage, key;"," if(store) {"," if(store.clear) {"," store.clear();"," }"," // FF2.x and FF3.0.x"," else {"," for (key in store) {"," if (store.hasOwnProperty(key)) {"," store.removeItem(key);"," delete store[key];"," }"," }"," }"," }"," else {"," }"," }","});","","Y.extend(CacheOffline, Y.Cache, localStorage ? {","/////////////////////////////////////////////////////////////////////////////","//","// Offline is supported","//","/////////////////////////////////////////////////////////////////////////////",""," /////////////////////////////////////////////////////////////////////////////"," //"," // CacheOffline protected methods"," //"," /////////////////////////////////////////////////////////////////////////////"," /**"," * Always return null."," *"," * @method _setMax"," * @protected"," */"," _setMax: function(value) {"," return null;"," },",""," /**"," * Gets size."," *"," * @method _getSize"," * @protected"," */"," _getSize: function() {"," var count = 0,"," i=0,"," l=localStorage.length;"," for(; i<l; ++i) {"," // Match sandbox id"," if(localStorage.key(i).indexOf(this.get(\"sandbox\")) === 0) {"," count++;"," }"," }"," return count;"," },",""," /**"," * Gets all entries."," *"," * @method _getEntries"," * @protected"," */"," _getEntries: function() {"," var entries = [],"," i=0,"," l=localStorage.length,"," sandbox = this.get(\"sandbox\");"," for(; i<l; ++i) {"," // Match sandbox id"," if(localStorage.key(i).indexOf(sandbox) === 0) {"," entries[i] = JSON.parse(localStorage.key(i).substring(sandbox.length));"," }"," }"," return entries;"," },",""," /**"," * Adds entry to cache."," *"," * @method _defAddFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>entry (Object)</dt> <dd>The cached entry.</dd>"," * </dl>"," * @protected"," */"," _defAddFn: function(e) {"," var entry = e.entry,"," request = entry.request,"," cached = entry.cached,"," expires = entry.expires;",""," // Convert Dates to msecs on the way into localStorage"," entry.cached = cached.getTime();"," entry.expires = expires ? expires.getTime() : expires;",""," try {"," localStorage.setItem(this.get(\"sandbox\")+JSON.stringify({\"request\":request}), JSON.stringify(entry));"," }"," catch(error) {"," this.fire(\"error\", {error:error});"," }"," },",""," /**"," * Flushes cache."," *"," * @method _defFlushFn"," * @param e {Event.Facade} Event Facade object."," * @protected"," */"," _defFlushFn: function(e) {"," var key,"," i=localStorage.length-1;"," for(; i>-1; --i) {"," // Match sandbox id"," key = localStorage.key(i);"," if(key.indexOf(this.get(\"sandbox\")) === 0) {"," localStorage.removeItem(key);"," }"," }"," },",""," /////////////////////////////////////////////////////////////////////////////"," //"," // CacheOffline public methods"," //"," /////////////////////////////////////////////////////////////////////////////"," /**"," * Adds a new entry to the cache of the format"," * {request:request, response:response, cached:cached, expires: expires}."," *"," * @method add"," * @param request {Object} Request value must be a String or JSON."," * @param response {Object} Response value must be a String or JSON."," */",""," /**"," * Retrieves cached object for given request, if available."," * Returns null if there is no cache match."," *"," * @method retrieve"," * @param request {Object} Request object."," * @return {Object} Cached object with the properties request, response,"," * and expires, or null."," */"," retrieve: function(request) {"," this.fire(\"request\", {request: request});",""," var entry, expires, sandboxedrequest;",""," try {"," sandboxedrequest = this.get(\"sandbox\")+JSON.stringify({\"request\":request});"," try {"," entry = JSON.parse(localStorage.getItem(sandboxedrequest));"," }"," catch(e) {"," }"," }"," catch(e2) {"," }",""," if(entry) {"," // Convert msecs to Dates on the way out of localStorage"," entry.cached = new Date(entry.cached);"," expires = entry.expires;"," expires = !expires ? null : new Date(expires);"," entry.expires = expires;",""," if(this._isMatch(request, entry)) {"," this.fire(\"retrieve\", {entry: entry});"," return entry;"," }"," }"," return null;"," }","} :","/////////////////////////////////////////////////////////////////////////////","//","// Offline is not supported","//","/////////////////////////////////////////////////////////////////////////////","{"," /**"," * Always return null."," *"," * @method _setMax"," * @protected"," */"," _setMax: function(value) {"," return null;"," }","});","","","Y.CacheOffline = CacheOffline;","","","}, '3.7.1', {\"requires\": [\"cache-base\", \"json\"]});"];+_yuitest_coverage["build/cache-offline/cache-offline.js"].lines = {"1":0,"16":0,"17":0,"20":0,"24":0,"25":0,"50":0,"116":0,"130":0,"131":0,"132":0,"133":0,"137":0,"138":0,"139":0,"140":0,"150":0,"169":0,"179":0,"182":0,"184":0,"185":0,"188":0,"198":0,"202":0,"204":0,"205":0,"208":0,"222":0,"228":0,"229":0,"231":0,"232":0,"235":0,"247":0,"249":0,"251":0,"252":0,"253":0,"282":0,"284":0,"286":0,"287":0,"288":0,"289":0,"297":0,"299":0,"300":0,"301":0,"302":0,"304":0,"305":0,"306":0,"309":0,"325":0,"330":0};+_yuitest_coverage["build/cache-offline/cache-offline.js"].functions = {"CacheOffline:16":0,"setter:115":0,"flushAll:129":0,"_setMax:168":0,"_getSize:178":0,"_getEntries:197":0,"_defAddFn:221":0,"_defFlushFn:246":0,"retrieve:281":0,"_setMax:324":0,"(anonymous 1):1":0};+_yuitest_coverage["build/cache-offline/cache-offline.js"].coveredLines = 56;+_yuitest_coverage["build/cache-offline/cache-offline.js"].coveredFunctions = 11;+_yuitest_coverline("build/cache-offline/cache-offline.js", 1);+YUI.add('cache-offline', function (Y, NAME) {++/**+ * Provides a Cache subclass which uses HTML5 `localStorage` for persistence.+ * + * @module cache+ * @submodule cache-offline+ */++/**+ * Extends Cache utility with offline functionality.+ * @class CacheOffline+ * @extends Cache+ * @constructor+ */+_yuitest_coverfunc("build/cache-offline/cache-offline.js", "(anonymous 1)", 1);+_yuitest_coverline("build/cache-offline/cache-offline.js", 16);+function CacheOffline() {+ _yuitest_coverfunc("build/cache-offline/cache-offline.js", "CacheOffline", 16);+_yuitest_coverline("build/cache-offline/cache-offline.js", 17);+CacheOffline.superclass.constructor.apply(this, arguments);+}++_yuitest_coverline("build/cache-offline/cache-offline.js", 20);+var localStorage = null,+ JSON = Y.JSON;++// Bug 2529572+_yuitest_coverline("build/cache-offline/cache-offline.js", 24);+try {+ _yuitest_coverline("build/cache-offline/cache-offline.js", 25);+localStorage = Y.config.win.localStorage;+}+catch(e) {+}++/////////////////////////////////////////////////////////////////////////////+//+// CacheOffline events+//+/////////////////////////////////////////////////////////////////////////////++/**+* @event error+* @description Fired when an entry could not be added, most likely due to+* exceeded browser quota.+* <dl>+* <dt>error (Object)</dt> <dd>The error object.</dd>+* </dl>+*/++/////////////////////////////////////////////////////////////////////////////+//+// CacheOffline static+//+/////////////////////////////////////////////////////////////////////////////+_yuitest_coverline("build/cache-offline/cache-offline.js", 50);+Y.mix(CacheOffline, {+ /**+ * Class name.+ *+ * @property NAME+ * @type String+ * @static+ * @final+ * @value "cacheOffline"+ */+ NAME: "cacheOffline",++ ATTRS: {+ /////////////////////////////////////////////////////////////////////////////+ //+ // CacheOffline Attributes+ //+ /////////////////////////////////////////////////////////////////////////////++ /**+ * @attribute sandbox+ * @description A string that must be passed in via the constructor.+ * This identifier is used to sandbox one cache instance's entries+ * from another. Calling the cache instance's flush and length methods+ * or get("entries") will apply to only these sandboxed entries.+ * @type String+ * @default "default"+ * @initOnly+ */+ sandbox: {+ value: "default",+ writeOnce: "initOnly"+ },++ /**+ * @attribute expires+ * @description Absolute Date when data expires or+ * relative number of milliseconds. Zero disables expiration.+ * @type Date | Number+ * @default 86400000 (one day)+ */+ expires: {+ value: 86400000+ },++ /**+ * @attribute max+ * @description Disabled.+ * @readOnly+ * @default null+ */+ max: {+ value: null,+ readOnly: true+ },++ /**+ * @attribute uniqueKeys+ * @description Always true for CacheOffline.+ * @readOnly+ * @default true+ */+ uniqueKeys: {+ value: true,+ readOnly: true,+ setter: function() {+ _yuitest_coverfunc("build/cache-offline/cache-offline.js", "setter", 115);+_yuitest_coverline("build/cache-offline/cache-offline.js", 116);+return true;+ }+ }+ },++ /**+ * Removes all items from all sandboxes. Useful if localStorage has+ * exceeded quota. Only supported on browsers that implement HTML 5+ * localStorage.+ *+ * @method flushAll+ * @static+ */+ flushAll: function() {+ _yuitest_coverfunc("build/cache-offline/cache-offline.js", "flushAll", 129);+_yuitest_coverline("build/cache-offline/cache-offline.js", 130);+var store = localStorage, key;+ _yuitest_coverline("build/cache-offline/cache-offline.js", 131);+if(store) {+ _yuitest_coverline("build/cache-offline/cache-offline.js", 132);+if(store.clear) {+ _yuitest_coverline("build/cache-offline/cache-offline.js", 133);+store.clear();+ }+ // FF2.x and FF3.0.x+ else {+ _yuitest_coverline("build/cache-offline/cache-offline.js", 137);+for (key in store) {+ _yuitest_coverline("build/cache-offline/cache-offline.js", 138);+if (store.hasOwnProperty(key)) {+ _yuitest_coverline("build/cache-offline/cache-offline.js", 139);+store.removeItem(key);+ _yuitest_coverline("build/cache-offline/cache-offline.js", 140);+delete store[key];+ }+ }+ }+ }+ else {+ }+ }+});++_yuitest_coverline("build/cache-offline/cache-offline.js", 150);+Y.extend(CacheOffline, Y.Cache, localStorage ? {+/////////////////////////////////////////////////////////////////////////////+//+// Offline is supported+//+/////////////////////////////////////////////////////////////////////////////++ /////////////////////////////////////////////////////////////////////////////+ //+ // CacheOffline protected methods+ //+ /////////////////////////////////////////////////////////////////////////////+ /**+ * Always return null.+ *+ * @method _setMax+ * @protected+ */+ _setMax: function(value) {+ _yuitest_coverfunc("build/cache-offline/cache-offline.js", "_setMax", 168);+_yuitest_coverline("build/cache-offline/cache-offline.js", 169);+return null;+ },++ /**+ * Gets size.+ *+ * @method _getSize+ * @protected+ */+ _getSize: function() {+ _yuitest_coverfunc("build/cache-offline/cache-offline.js", "_getSize", 178);+_yuitest_coverline("build/cache-offline/cache-offline.js", 179);+var count = 0,+ i=0,+ l=localStorage.length;+ _yuitest_coverline("build/cache-offline/cache-offline.js", 182);+for(; i<l; ++i) {+ // Match sandbox id+ _yuitest_coverline("build/cache-offline/cache-offline.js", 184);+if(localStorage.key(i).indexOf(this.get("sandbox")) === 0) {+ _yuitest_coverline("build/cache-offline/cache-offline.js", 185);+count++;+ }+ }+ _yuitest_coverline("build/cache-offline/cache-offline.js", 188);+return count;+ },++ /**+ * Gets all entries.+ *+ * @method _getEntries+ * @protected+ */+ _getEntries: function() {+ _yuitest_coverfunc("build/cache-offline/cache-offline.js", "_getEntries", 197);+_yuitest_coverline("build/cache-offline/cache-offline.js", 198);+var entries = [],+ i=0,+ l=localStorage.length,+ sandbox = this.get("sandbox");+ _yuitest_coverline("build/cache-offline/cache-offline.js", 202);+for(; i<l; ++i) {+ // Match sandbox id+ _yuitest_coverline("build/cache-offline/cache-offline.js", 204);+if(localStorage.key(i).indexOf(sandbox) === 0) {+ _yuitest_coverline("build/cache-offline/cache-offline.js", 205);+entries[i] = JSON.parse(localStorage.key(i).substring(sandbox.length));+ }+ }+ _yuitest_coverline("build/cache-offline/cache-offline.js", 208);+return entries;+ },++ /**+ * Adds entry to cache.+ *+ * @method _defAddFn+ * @param e {Event.Facade} Event Facade with the following properties:+ * <dl>+ * <dt>entry (Object)</dt> <dd>The cached entry.</dd>+ * </dl>+ * @protected+ */+ _defAddFn: function(e) {+ _yuitest_coverfunc("build/cache-offline/cache-offline.js", "_defAddFn", 221);+_yuitest_coverline("build/cache-offline/cache-offline.js", 222);+var entry = e.entry,+ request = entry.request,+ cached = entry.cached,+ expires = entry.expires;++ // Convert Dates to msecs on the way into localStorage+ _yuitest_coverline("build/cache-offline/cache-offline.js", 228);+entry.cached = cached.getTime();+ _yuitest_coverline("build/cache-offline/cache-offline.js", 229);+entry.expires = expires ? expires.getTime() : expires;++ _yuitest_coverline("build/cache-offline/cache-offline.js", 231);+try {+ _yuitest_coverline("build/cache-offline/cache-offline.js", 232);+localStorage.setItem(this.get("sandbox")+JSON.stringify({"request":request}), JSON.stringify(entry));+ }+ catch(error) {+ _yuitest_coverline("build/cache-offline/cache-offline.js", 235);+this.fire("error", {error:error});+ }+ },++ /**+ * Flushes cache.+ *+ * @method _defFlushFn+ * @param e {Event.Facade} Event Facade object.+ * @protected+ */+ _defFlushFn: function(e) {+ _yuitest_coverfunc("build/cache-offline/cache-offline.js", "_defFlushFn", 246);+_yuitest_coverline("build/cache-offline/cache-offline.js", 247);+var key,+ i=localStorage.length-1;+ _yuitest_coverline("build/cache-offline/cache-offline.js", 249);+for(; i>-1; --i) {+ // Match sandbox id+ _yuitest_coverline("build/cache-offline/cache-offline.js", 251);+key = localStorage.key(i);+ _yuitest_coverline("build/cache-offline/cache-offline.js", 252);+if(key.indexOf(this.get("sandbox")) === 0) {+ _yuitest_coverline("build/cache-offline/cache-offline.js", 253);+localStorage.removeItem(key);+ }+ }+ },++ /////////////////////////////////////////////////////////////////////////////+ //+ // CacheOffline public methods+ //+ /////////////////////////////////////////////////////////////////////////////+ /**+ * Adds a new entry to the cache of the format+ * {request:request, response:response, cached:cached, expires: expires}.+ *+ * @method add+ * @param request {Object} Request value must be a String or JSON.+ * @param response {Object} Response value must be a String or JSON.+ */++ /**+ * Retrieves cached object for given request, if available.+ * Returns null if there is no cache match.+ *+ * @method retrieve+ * @param request {Object} Request object.+ * @return {Object} Cached object with the properties request, response,+ * and expires, or null.+ */+ retrieve: function(request) {+ _yuitest_coverfunc("build/cache-offline/cache-offline.js", "retrieve", 281);+_yuitest_coverline("build/cache-offline/cache-offline.js", 282);+this.fire("request", {request: request});++ _yuitest_coverline("build/cache-offline/cache-offline.js", 284);+var entry, expires, sandboxedrequest;++ _yuitest_coverline("build/cache-offline/cache-offline.js", 286);+try {+ _yuitest_coverline("build/cache-offline/cache-offline.js", 287);+sandboxedrequest = this.get("sandbox")+JSON.stringify({"request":request});+ _yuitest_coverline("build/cache-offline/cache-offline.js", 288);+try {+ _yuitest_coverline("build/cache-offline/cache-offline.js", 289);+entry = JSON.parse(localStorage.getItem(sandboxedrequest));+ }+ catch(e) {+ }+ }+ catch(e2) {+ }++ _yuitest_coverline("build/cache-offline/cache-offline.js", 297);+if(entry) {+ // Convert msecs to Dates on the way out of localStorage+ _yuitest_coverline("build/cache-offline/cache-offline.js", 299);+entry.cached = new Date(entry.cached);+ _yuitest_coverline("build/cache-offline/cache-offline.js", 300);+expires = entry.expires;+ _yuitest_coverline("build/cache-offline/cache-offline.js", 301);+expires = !expires ? null : new Date(expires);+ _yuitest_coverline("build/cache-offline/cache-offline.js", 302);+entry.expires = expires;++ _yuitest_coverline("build/cache-offline/cache-offline.js", 304);+if(this._isMatch(request, entry)) {+ _yuitest_coverline("build/cache-offline/cache-offline.js", 305);+this.fire("retrieve", {entry: entry});+ _yuitest_coverline("build/cache-offline/cache-offline.js", 306);+return entry;+ }+ }+ _yuitest_coverline("build/cache-offline/cache-offline.js", 309);+return null;+ }+} :+/////////////////////////////////////////////////////////////////////////////+//+// Offline is not supported+//+/////////////////////////////////////////////////////////////////////////////+{+ /**+ * Always return null.+ *+ * @method _setMax+ * @protected+ */+ _setMax: function(value) {+ _yuitest_coverfunc("build/cache-offline/cache-offline.js", "_setMax", 324);+_yuitest_coverline("build/cache-offline/cache-offline.js", 325);+return null;+ }+});+++_yuitest_coverline("build/cache-offline/cache-offline.js", 330);+Y.CacheOffline = CacheOffline;+++}, '3.7.1', {"requires": ["cache-base", "json"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('cache-offline', function(Y) {+YUI.add('cache-offline', function (Y, NAME) { /** * Provides a Cache subclass which uses HTML5 `localStorage` for persistence.@@ -344,4 +344,4 @@ Y.CacheOffline = CacheOffline; -}, '3.5.1' ,{requires:['cache-base', 'json']});+}, '3.7.1', {"requires": ["cache-base", "json"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("cache-offline",function(f){function d(){d.superclass.constructor.apply(this,arguments);}var a=null,c=f.JSON;try{a=f.config.win.localStorage;}catch(b){}f.mix(d,{NAME:"cacheOffline",ATTRS:{sandbox:{value:"default",writeOnce:"initOnly"},expires:{value:86400000},max:{value:null,readOnly:true},uniqueKeys:{value:true,readOnly:true,setter:function(){return true;}}},flushAll:function(){var e=a,g;if(e){if(e.clear){e.clear();}else{for(g in e){if(e.hasOwnProperty(g)){e.removeItem(g);delete e[g];}}}}else{}}});f.extend(d,f.Cache,a?{_setMax:function(e){return null;},_getSize:function(){var h=0,g=0,e=a.length;for(;g<e;++g){if(a.key(g).indexOf(this.get("sandbox"))===0){h++;}}return h;},_getEntries:function(){var e=[],j=0,h=a.length,g=this.get("sandbox");for(;j<h;++j){if(a.key(j).indexOf(g)===0){e[j]=c.parse(a.key(j).substring(g.length));}}return e;},_defAddFn:function(l){var k=l.entry,j=k.request,i=k.cached,g=k.expires;k.cached=i.getTime();k.expires=g?g.getTime():g;try{a.setItem(this.get("sandbox")+c.stringify({"request":j}),c.stringify(k));}catch(h){this.fire("error",{error:h});}},_defFlushFn:function(j){var h,g=a.length-1;for(;g>-1;--g){h=a.key(g);if(h.indexOf(this.get("sandbox"))===0){a.removeItem(h);}}},retrieve:function(j){this.fire("request",{request:j});var i,g,h;try{h=this.get("sandbox")+c.stringify({"request":j});try{i=c.parse(a.getItem(h));}catch(l){}}catch(k){}if(i){i.cached=new Date(i.cached);g=i.expires;g=!g?null:new Date(g);i.expires=g;if(this._isMatch(j,i)){this.fire("retrieve",{entry:i});return i;}}return null;}}:{_setMax:function(e){return null;}});f.CacheOffline=d;},"3.5.1",{requires:["cache-base","json"]});+YUI.add("cache-offline",function(e,t){function n(){n.superclass.constructor.apply(this,arguments)}var r=null,i=e.JSON;try{r=e.config.win.localStorage}catch(s){}e.mix(n,{NAME:"cacheOffline",ATTRS:{sandbox:{value:"default",writeOnce:"initOnly"},expires:{value:864e5},max:{value:null,readOnly:!0},uniqueKeys:{value:!0,readOnly:!0,setter:function(){return!0}}},flushAll:function(){var e=r,t;if(e)if(e.clear)e.clear();else for(t in e)e.hasOwnProperty(t)&&(e.removeItem(t),delete e[t])}}),e.extend(n,e.Cache,r?{_setMax:function(e){return null},_getSize:function(){var e=0,t=0,n=r.length;for(;t<n;++t)r.key(t).indexOf(this.get("sandbox"))===0&&e++;return e},_getEntries:function(){var e=[],t=0,n=r.length,s=this.get("sandbox");for(;t<n;++t)r.key(t).indexOf(s)===0&&(e[t]=i.parse(r.key(t).substring(s.length)));return e},_defAddFn:function(e){var t=e.entry,n=t.request,s=t.cached,o=t.expires;t.cached=s.getTime(),t.expires=o?o.getTime():o;try{r.setItem(this.get("sandbox")+i.stringify({request:n}),i.stringify(t))}catch(u){this.fire("error",{error:u})}},_defFlushFn:function(e){var t,n=r.length-1;for(;n>-1;--n)t=r.key(n),t.indexOf(this.get("sandbox"))===0&&r.removeItem(t)},retrieve:function(e){this.fire("request",{request:e});var t,n,s;try{s=this.get("sandbox")+i.stringify({request:e});try{t=i.parse(r.getItem(s))}catch(o){}}catch(u){}if(t){t.cached=new Date(t.cached),n=t.expires,n=n?new Date(n):null,t.expires=n;if(this._isMatch(e,t))return this.fire("retrieve",{entry:t}),t}return null}}:{_setMax:function(e){return null}}),e.CacheOffline=n},"3.7.1",{requires:["cache-base","json"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('cache-offline', function(Y) {+YUI.add('cache-offline', function (Y, NAME) { /** * Provides a Cache subclass which uses HTML5 `localStorage` for persistence.@@ -336,4 +336,4 @@ Y.CacheOffline = CacheOffline; -}, '3.5.1' ,{requires:['cache-base', 'json']});+}, '3.7.1', {"requires": ["cache-base", "json"]});
@@ -0,0 +1,101 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/cache-plugin/cache-plugin.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/cache-plugin/cache-plugin.js",+ code: []+};+_yuitest_coverage["build/cache-plugin/cache-plugin.js"].code=["YUI.add('cache-plugin', function (Y, NAME) {","","/**"," * Provides support to use Cache as a Plugin to a Base-based class."," *"," * @module cache"," * @submodule cache-plugin"," */","","/**"," * Plugin.Cache adds pluginizability to Cache."," * @class Plugin.Cache"," * @extends Cache"," * @uses Plugin.Base"," */","function CachePlugin(config) {"," var cache = config && config.cache ? config.cache : Y.Cache,"," tmpclass = Y.Base.create(\"dataSourceCache\", cache, [Y.Plugin.Base]),"," tmpinstance = new tmpclass(config);"," tmpclass.NS = \"tmpClass\";"," return tmpinstance;","}","","Y.mix(CachePlugin, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"cache\""," */"," NS: \"cache\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataSourceCache\""," */"," NAME: \"cachePlugin\"","});","","","Y.namespace(\"Plugin\").Cache = CachePlugin;","","","}, '3.7.1', {\"requires\": [\"plugin\", \"cache-base\"]});"];+_yuitest_coverage["build/cache-plugin/cache-plugin.js"].lines = {"1":0,"16":0,"17":0,"20":0,"21":0,"24":0,"50":0};+_yuitest_coverage["build/cache-plugin/cache-plugin.js"].functions = {"CachePlugin:16":0,"(anonymous 1):1":0};+_yuitest_coverage["build/cache-plugin/cache-plugin.js"].coveredLines = 7;+_yuitest_coverage["build/cache-plugin/cache-plugin.js"].coveredFunctions = 2;+_yuitest_coverline("build/cache-plugin/cache-plugin.js", 1);+YUI.add('cache-plugin', function (Y, NAME) {++/**+ * Provides support to use Cache as a Plugin to a Base-based class.+ *+ * @module cache+ * @submodule cache-plugin+ */++/**+ * Plugin.Cache adds pluginizability to Cache.+ * @class Plugin.Cache+ * @extends Cache+ * @uses Plugin.Base+ */+_yuitest_coverfunc("build/cache-plugin/cache-plugin.js", "(anonymous 1)", 1);+_yuitest_coverline("build/cache-plugin/cache-plugin.js", 16);+function CachePlugin(config) {+ _yuitest_coverfunc("build/cache-plugin/cache-plugin.js", "CachePlugin", 16);+_yuitest_coverline("build/cache-plugin/cache-plugin.js", 17);+var cache = config && config.cache ? config.cache : Y.Cache,+ tmpclass = Y.Base.create("dataSourceCache", cache, [Y.Plugin.Base]),+ tmpinstance = new tmpclass(config);+ _yuitest_coverline("build/cache-plugin/cache-plugin.js", 20);+tmpclass.NS = "tmpClass";+ _yuitest_coverline("build/cache-plugin/cache-plugin.js", 21);+return tmpinstance;+}++_yuitest_coverline("build/cache-plugin/cache-plugin.js", 24);+Y.mix(CachePlugin, {+ /**+ * The namespace for the plugin. This will be the property on the host which+ * references the plugin instance.+ *+ * @property NS+ * @type String+ * @static+ * @final+ * @value "cache"+ */+ NS: "cache",++ /**+ * Class name.+ *+ * @property NAME+ * @type String+ * @static+ * @final+ * @value "dataSourceCache"+ */+ NAME: "cachePlugin"+});+++_yuitest_coverline("build/cache-plugin/cache-plugin.js", 50);+Y.namespace("Plugin").Cache = CachePlugin;+++}, '3.7.1', {"requires": ["plugin", "cache-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('cache-plugin', function(Y) {+YUI.add('cache-plugin', function (Y, NAME) { /** * Provides support to use Cache as a Plugin to a Base-based class.@@ -56,4 +56,4 @@ Y.namespace("Plugin").Cache = CachePlugin; -}, '3.5.1' ,{requires:['plugin','cache-base']});+}, '3.7.1', {"requires": ["plugin", "cache-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("cache-plugin",function(b){function a(e){var d=e&&e.cache?e.cache:b.Cache,f=b.Base.create("dataSourceCache",d,[b.Plugin.Base]),c=new f(e);f.NS="tmpClass";return c;}b.mix(a,{NS:"cache",NAME:"cachePlugin"});b.namespace("Plugin").Cache=a;},"3.5.1",{requires:["plugin","cache-base"]});+YUI.add("cache-plugin",function(e,t){function n(t){var n=t&&t.cache?t.cache:e.Cache,r=e.Base.create("dataSourceCache",n,[e.Plugin.Base]),i=new r(t);return r.NS="tmpClass",i}e.mix(n,{NS:"cache",NAME:"cachePlugin"}),e.namespace("Plugin").Cache=n},"3.7.1",{requires:["plugin","cache-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('cache-plugin', function(Y) {+YUI.add('cache-plugin', function (Y, NAME) { /** * Provides support to use Cache as a Plugin to a Base-based class.@@ -56,4 +56,4 @@ Y.namespace("Plugin").Cache = CachePlugin; -}, '3.5.1' ,{requires:['plugin','cache-base']});+}, '3.7.1', {"requires": ["plugin", "cache-base"]});
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,37 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-calendar {-}--.yui3-calendar-content {-}--.yui3-calendar-column-hidden, .yui3-calendar-hidden {- display:none;-}--.yui3-calendar-day {- cursor: pointer;-}--.yui3-calendar-selection-disabled {- cursor: default;-}--.yui3-calendar-prevmonth-day {- cursor: default;-}--.yui3-calendar-nextmonth-day {- cursor: default;-}--.yui3-calendar-content:hover .yui3-calendar-day,-.yui3-calendar-content:hover .yui3-calendar-prevmonth-day,-.yui3-calendar-content:hover .yui3-calendar-nextmonth-day {- -moz-user-select: none;-}
@@ -1,22 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-calendar-header {- padding-left:15px;- padding-right:15px;-}--.yui3-calendar-header-label {- width:100%;-}--.yui3-calendarnav-prevmonth {- cursor: pointer;-}--.yui3-calendarnav-nextmonth {- cursor: pointer;-}
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-.yui3-calendar-pane{width:100%}.yui3-calendar-grid{width:100%}.yui3-calendar-column-hidden,.yui3-calendar-hidden{display:none}.yui3-skin-night .yui3-calendar-content{padding:10px;color:#cbcbcb;border:1px solid #303030;background:#151515;background:-moz-linear-gradient(top,#222 0,#151515 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#222),color-stop(100%,#151515));background:-webkit-linear-gradient(top,#222 0,#151515 100%);background:-o-linear-gradient(top,#222 0,#151515 100%);background:-ms-linear-gradient(top,#222 0,#151515 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#222222',endColorstr='#151515',GradientType=0);background:linear-gradient(top,#222 0,#151515 100%);-moz-border-radius:5px;border-radius:5px}.yui3-skin-night .yui3-calendar-grid{padding:5px;border-collapse:collapse}.yui3-skin-night .yui3-calendar-header{padding-bottom:10px}.yui3-skin-night .yui3-calendar-header-label{margin:0;font-size:1em;font-weight:bold}.yui3-skin-night .yui3-calendar-day,.yui3-skin-night .yui3-calendar-prevmonth-day,.yui3-skin-night .yui3-calendar-nextmonth-day{padding:5px;border:1px solid #151515;background:#262727;text-align:center}.yui3-skin-night .yui3-calendar-day:hover{background:#383939;color:#fff}.yui3-skin-night .yui3-calendar-selection-disabled,.yui3-skin-night .yui3-calendar-selection-disabled:hover{background:#151515;color:#596060}.yui3-skin-night .yui3-calendar-weekday{color:#4f4f4f;font-weight:bold;text-align:center}.yui3-skin-night .yui3-calendar-prevmonth-day,.yui3-skin-night .yui3-calendar-nextmonth-day{color:#4f4f4f}.yui3-skin-night .yui3-calendar-day{font-weight:bold}.yui3-skin-night .yui3-calendar-day-selected{background-color:#505151;color:#fff}.yui3-skin-night .yui3-calendar-header-label{text-align:center}.yui3-skin-night .yui3-calendar-left-grid{margin-right:1em}.yui3-skin-sam .yui3-calendar-right-grid{margin-left:1em}+.yui3-calendar-pane{width:100%}.yui3-calendar-grid{width:100%}.yui3-calendar-column-hidden,.yui3-calendar-hidden{display:none}.yui3-skin-night .yui3-calendar-content{padding:10px;color:#cbcbcb;border:1px solid #303030;background:#151515;background:-moz-linear-gradient(top,#222 0,#151515 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#222),color-stop(100%,#151515));background:-webkit-linear-gradient(top,#222 0,#151515 100%);background:-o-linear-gradient(top,#222 0,#151515 100%);background:-ms-linear-gradient(top,#222 0,#151515 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#222222',endColorstr='#151515',GradientType=0);background:linear-gradient(top,#222 0,#151515 100%);-moz-border-radius:5px;border-radius:5px}.yui3-skin-night .yui3-calendar-grid{padding:5px;border-collapse:collapse}.yui3-skin-night .yui3-calendar-header{padding-bottom:10px}.yui3-skin-night .yui3-calendar-header-label{margin:0;font-size:1em;font-weight:bold}.yui3-skin-night .yui3-calendar-day,.yui3-skin-night .yui3-calendar-prevmonth-day,.yui3-skin-night .yui3-calendar-nextmonth-day{padding:5px;border:1px solid #151515;background:#262727;text-align:center}.yui3-skin-night .yui3-calendar-day:hover{background:#383939;color:#fff}.yui3-skin-night .yui3-calendar-selection-disabled,.yui3-skin-night .yui3-calendar-selection-disabled:hover{background:#151515;color:#596060}.yui3-skin-night .yui3-calendar-weekday{color:#4f4f4f;font-weight:bold;text-align:center}.yui3-skin-night .yui3-calendar-prevmonth-day,.yui3-skin-night .yui3-calendar-nextmonth-day{color:#4f4f4f}.yui3-skin-night .yui3-calendar-day{font-weight:bold}.yui3-skin-night .yui3-calendar-day-selected{background-color:#505151;color:#fff}.yui3-skin-night .yui3-calendar-header-label{text-align:center}.yui3-skin-night .yui3-calendar-left-grid{margin-right:1em}.yui3-skin-sam .yui3-calendar-right-grid{margin-left:1em}#yui3-css-stamp.skin-night-calendar-base{display:none}
@@ -1,13 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-skin-night .yui3-calendar-day-highlighted {- background-color: #555555;-}--.yui3-skin-night .yui3-calendar-day-selected.yui3-calendar-day-highlighted {- background-color: #777777;-}
@@ -1,39 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-skin-night .yui3-calendarnav-prevmonth, .yui3-skin-night .yui3-calendarnav-nextmonth {- color: #FFFFFF;- width: 12px;- height: 14px;- background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALZJREFUeNpi/P//PwORQBqIu6DsMiB+SpQukAUEMCcQVwPx5/8I8BkqxklIPyHDA4H44X/c4CFUDckWGADxgf/EgwNQPQQtEALiaf/JB9OgZmBYwAzERUD84T/l4APULGaYBR5AfPU/9QHITA8maGJiY6A+YENOpmw0CCI2bJEsCsRzKDB8DtSMgUum6DiKiIwWRUlOhhUVdUD8Dcngb1AxgkUFIwmFnRwQt0PZlUD8iBhNAAEGALbfq7SGiQoPAAAAAElFTkSuQmCC);- background-repeat: no-repeat;-}--.yui3-skin-night .yui3-calendarnav-prevmonth:hover, .yui3-skin-night .yui3-calendarnav-nextmonth:hover {- background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPpJREFUeNpi/P//PwMxQD9jszSQ6oJyyy7O8H1KjD5GQhYADeYEUkVAXAHEPFDhL0DcAcR9QIu+k20B0PBAIDUBiOVwKHkExAVAS9aTZAHQYAOowfYMxIGDUIsu4LUAaLAQkGoB4kwG8sB0IK4BWvQOxQKgwcxAdj4Q1wExPwNl4CMQNwHxRKBFfxn10jd5ADm9QKzFQF1wDYiLmaAcNgbqA7CZTEBv7ADS2iDboN5joEIQgczSBpmNHsmiQKodiJPJNHwuEFcCDX49MMkUi0VRUB/hy2ggFy+jtKgohRYVnFDh79CiopuiogLNIjmobxigrn5EjD6AAAMAok9vhfHG8wQAAAAASUVORK5CYII=);- color: #0066CC;-}--.yui3-skin-night .yui3-calendarnav-month-disabled, .yui3-skin-night .yui3-calendarnav-month-disabled:hover {- background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQhJREFUeNqs0yGLAlEUhuHrKoIgCFbBJghb3F+g0WrVarEqLIhBEEFYWKNNMBktU4z6C5RNkwyCyWQSTPuOfCOCrHNnxwMPyOGe73DAiTmOYywrhy/9/sTBZujN4k0KPbioi6teKuqCmsKGSN/10+q5ehN6QQkrLJB/Mp/Xm5VmAhdkMcEGZWNfZc1MlPGwII42dmiZ/1dLGW1lXhdU8YNvZEz0yijLy6z6FyTN6yvpX7DEOzo4vSD4pCwvc+lfcMEYBUwjhE+VMVbmw7/oiCY+sA4RvNZMUxmB38EWFTSwfxK815uKZkJ/yXMU0cf5rn9Wr6g3f1bC4nwvbIAZRup1Ay671a8AAwC3OzOqxK+rkwAAAABJRU5ErkJggg==);- cursor: default;- color: #CCCCCC; -}--.yui3-skin-night .yui3-calendarnav-prevmonth, .yui3-skin-night .yui3-calendarnav-prevmonth:hover {- background-position: 0px 0px;- margin-left:-12px;-}--.yui3-skin-night .yui3-calendarnav-nextmonth, .yui3-skin-night .yui3-calendarnav-nextmonth:hover {- background-position: -12px 0px;- margin-right: -12px;-}--.yui3-skin-night .yui3-calendarnav-prevmonth span, .yui3-skin-night .yui3-calendarnav-nextmonth span {- display: none;- *display: block;-}
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-.yui3-calendar-pane{width:100%}.yui3-calendar-grid{width:100%}.yui3-calendar-column-hidden,.yui3-calendar-hidden{display:none}.yui3-skin-sam .yui3-calendar-content{padding:10px;color:#000;border:1px solid gray;background:#f2f2f2;background:-moz-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#f9f9f9),color-stop(100%,#f2f2f2));background:-webkit-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);background:-o-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);background:-ms-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9',endColorstr='#f2f2f2',GradientType=0);background:linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);-moz-border-radius:5px;border-radius:5px}.yui3-skin-sam .yui3-calendar-grid{padding:5px;border-collapse:collapse}.yui3-skin-sam .yui3-calendar-header{padding-bottom:10px}.yui3-skin-sam .yui3-calendar-header-label{margin:0;font-size:1em;font-weight:bold}.yui3-skin-sam .yui3-calendar-day,.yui3-skin-sam .yui3-calendar-prevmonth-day,.yui3-skin-sam .yui3-calendar-nextmonth-day{padding:5px;border:1px solid #ccc;background:#fff;text-align:center}.yui3-skin-sam .yui3-calendar-day:hover{background:#06c;color:#fff}.yui3-skin-sam .yui3-calendar-selection-disabled,.yui3-skin-sam .yui3-calendar-selection-disabled:hover{color:#a6a6a6;background:#ccc}.yui3-skin-sam .yui3-calendar-weekday{font-weight:bold}.yui3-skin-sam .yui3-calendar-prevmonth-day,.yui3-skin-sam .yui3-calendar-nextmonth-day{color:#a6a6a6}.yui3-skin-sam .yui3-calendar-day{font-weight:bold}.yui3-skin-sam .yui3-calendar-day-selected{background-color:#b3d4ff;color:#000}.yui3-skin-sam .yui3-calendar-header-label{text-align:center}.yui3-skin-sam .yui3-calendar-left-grid{margin-right:1em}.yui3-skin-sam .yui3-calendar-right-grid{margin-left:1em}.yui3-skin-sam .yui3-calendar-day-highlighted{background-color:#dcdef5}.yui3-skin-sam .yui3-calendar-day-selected.yui3-calendar-day-highlighted{background-color:#758fbb}+.yui3-calendar-pane{width:100%}.yui3-calendar-grid{width:100%}.yui3-calendar-column-hidden,.yui3-calendar-hidden{display:none}.yui3-skin-sam .yui3-calendar-content{padding:10px;color:#000;border:1px solid gray;background:#f2f2f2;background:-moz-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#f9f9f9),color-stop(100%,#f2f2f2));background:-webkit-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);background:-o-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);background:-ms-linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9',endColorstr='#f2f2f2',GradientType=0);background:linear-gradient(top,#f9f9f9 0,#f2f2f2 100%);-moz-border-radius:5px;border-radius:5px}.yui3-skin-sam .yui3-calendar-grid{padding:5px;border-collapse:collapse}.yui3-skin-sam .yui3-calendar-header{padding-bottom:10px}.yui3-skin-sam .yui3-calendar-header-label{margin:0;font-size:1em;font-weight:bold}.yui3-skin-sam .yui3-calendar-day,.yui3-skin-sam .yui3-calendar-prevmonth-day,.yui3-skin-sam .yui3-calendar-nextmonth-day{padding:5px;border:1px solid #ccc;background:#fff;text-align:center}.yui3-skin-sam .yui3-calendar-day:hover{background:#06c;color:#fff}.yui3-skin-sam .yui3-calendar-selection-disabled,.yui3-skin-sam .yui3-calendar-selection-disabled:hover{color:#a6a6a6;background:#ccc}.yui3-skin-sam .yui3-calendar-weekday{font-weight:bold}.yui3-skin-sam .yui3-calendar-prevmonth-day,.yui3-skin-sam .yui3-calendar-nextmonth-day{color:#a6a6a6}.yui3-skin-sam .yui3-calendar-day{font-weight:bold}.yui3-skin-sam .yui3-calendar-day-selected{background-color:#b3d4ff;color:#000}.yui3-skin-sam .yui3-calendar-header-label{text-align:center}.yui3-skin-sam .yui3-calendar-left-grid{margin-right:1em}.yui3-skin-sam .yui3-calendar-right-grid{margin-left:1em}.yui3-skin-sam .yui3-calendar-day-highlighted{background-color:#dcdef5}.yui3-skin-sam .yui3-calendar-day-selected.yui3-calendar-day-highlighted{background-color:#758fbb}#yui3-css-stamp.skin-sam-calendar-base{display:none}
@@ -1,13 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-skin-sam .yui3-calendar-day-highlighted {- background-color: #DCDEF5;-}--.yui3-skin-sam .yui3-calendar-day-selected.yui3-calendar-day-highlighted {- background-color: #758FBB;-}
@@ -1,39 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-skin-sam .yui3-calendarnav-prevmonth, .yui3-skin-sam .yui3-calendarnav-nextmonth {- color: #000000;- width: 12px;- height: 14px;- background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAKNJREFUeNpiYCAeSAPxUiiWZqAi4ATiaiD+DMT/ofgzVIyTUsMDgfghksHo+CFUDcnAAIgP4DEYHR+A6iEIhIB4GgkGo+NpUDMwADMQFwHxBwoMh+EPULOYYYZ7APFVKhiMjkFmejBBLWFjoD5gQ+dQO4iwOloUiOdQYPgcqBkDl0zRQRQRGS2KGkVFHRB/QzL4G1SMk5qpQg6psJMjVhNAgAEAH+qPqeiPEUsAAAAASUVORK5CYII=);- background-repeat: no-repeat;-}--.yui3-skin-sam .yui3-calendarnav-prevmonth:hover, .yui3-skin-sam .yui3-calendarnav-nextmonth:hover {- background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPpJREFUeNpi/P//PwMxQD9jszSQ6oJyyy7O8H1KjD5GQhYADeYEUkVAXAHEPFDhL0DcAcR9QIu+k20B0PBAIDUBiOVwKHkExAVAS9aTZAHQYAOowfYMxIGDUIsu4LUAaLAQkGoB4kwG8sB0IK4BWvQOxQKgwcxAdj4Q1wExPwNl4CMQNwHxRKBFfxn10jd5ADm9QKzFQF1wDYiLmaAcNgbqA7CZTEBv7ADS2iDboN5joEIQgczSBpmNHsmiQKodiJPJNHwuEFcCDX49MMkUi0VRUB/hy2ggFy+jtKgohRYVnFDh79CiopuiogLNIjmobxigrn5EjD6AAAMAok9vhfHG8wQAAAAASUVORK5CYII=);- color: #0066CC;-}--.yui3-skin-sam .yui3-calendarnav-month-disabled, .yui3-skin-sam .yui3-calendarnav-month-disabled:hover {- background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQhJREFUeNqs0yGLAlEUhuHrKoIgCFbBJghb3F+g0WrVarEqLIhBEEFYWKNNMBktU4z6C5RNkwyCyWQSTPuOfCOCrHNnxwMPyOGe73DAiTmOYywrhy/9/sTBZujN4k0KPbioi6teKuqCmsKGSN/10+q5ehN6QQkrLJB/Mp/Xm5VmAhdkMcEGZWNfZc1MlPGwII42dmiZ/1dLGW1lXhdU8YNvZEz0yijLy6z6FyTN6yvpX7DEOzo4vSD4pCwvc+lfcMEYBUwjhE+VMVbmw7/oiCY+sA4RvNZMUxmB38EWFTSwfxK815uKZkJ/yXMU0cf5rn9Wr6g3f1bC4nwvbIAZRup1Ay671a8AAwC3OzOqxK+rkwAAAABJRU5ErkJggg==);- cursor: default;- color: #CCCCCC; -}--.yui3-skin-sam .yui3-calendarnav-prevmonth, .yui3-skin-sam .yui3-calendarnav-prevmonth:hover {- background-position: 0px 0px;- margin-left:-12px;-}--.yui3-skin-sam .yui3-calendarnav-nextmonth, .yui3-skin-sam .yui3-calendarnav-nextmonth:hover {- background-position: -12px 0px;- margin-right: -12px;-}--.yui3-skin-sam .yui3-calendarnav-prevmonth span, .yui3-skin-sam .yui3-calendarnav-nextmonth span {- display: none;- *display: block;-}
@@ -0,0 +1,2082 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/calendar-base/calendar-base.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/calendar-base/calendar-base.js",+ code: []+};+_yuitest_coverage["build/calendar-base/calendar-base.js"].code=["YUI.add('calendar-base', function (Y, NAME) {","","/**"," * The CalendarBase submodule is a basic UI calendar view that displays"," * a range of dates in a two-dimensional month grid, with one or more"," * months visible at a single time. CalendarBase supports custom date"," * rendering, multiple calendar panes, and selection. "," * @module calendar"," * @submodule calendar-base"," */"," ","var getCN = Y.ClassNameManager.getClassName,"," CALENDAR = 'calendar',"," CAL_GRID = getCN(CALENDAR, 'grid'),"," CAL_LEFT_GRID = getCN(CALENDAR, 'left-grid'),"," CAL_RIGHT_GRID = getCN(CALENDAR, 'right-grid'),"," CAL_BODY = getCN(CALENDAR, 'body'),"," CAL_HD = getCN(CALENDAR, 'header'),"," CAL_HD_LABEL = getCN(CALENDAR, 'header-label'),"," CAL_WDAYROW = getCN(CALENDAR, 'weekdayrow'),"," CAL_WDAY = getCN(CALENDAR, 'weekday'),"," CAL_COL_HIDDEN = getCN(CALENDAR, 'column-hidden'),"," CAL_DAY_SELECTED = getCN(CALENDAR, 'day-selected'),"," SELECTION_DISABLED = getCN(CALENDAR, 'selection-disabled'),"," CAL_ROW = getCN(CALENDAR, 'row'),"," CAL_DAY = getCN(CALENDAR, 'day'),"," CAL_PREVMONTH_DAY = getCN(CALENDAR, 'prevmonth-day'),"," CAL_NEXTMONTH_DAY = getCN(CALENDAR, 'nextmonth-day'),"," CAL_ANCHOR = getCN(CALENDAR, 'anchor'),"," CAL_PANE = getCN(CALENDAR, 'pane'),"," CAL_STATUS = getCN(CALENDAR, 'status'),"," L = Y.Lang,"," node = Y.Node,"," create = node.create,"," substitute = Y.substitute,"," each = Y.each,"," hasVal = Y.Array.hasValue,"," iOf = Y.Array.indexOf,"," hasKey = Y.Object.hasKey,"," setVal = Y.Object.setValue,"," owns = Y.Object.owns,"," isEmpty = Y.Object.isEmpty,"," ydate = Y.DataType.Date;","","/** Create a calendar view to represent a single or multiple"," * month range of dates, rendered as a grid with date and"," * weekday labels."," * "," * @class CalendarBase"," * @extends Widget"," * @param config {Object} Configuration object (see Configuration "," * attributes)"," * @constructor"," */","function CalendarBase(config) {"," CalendarBase.superclass.constructor.apply ( this, arguments );","}","","","","Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {",""," /**"," * A storage for various properties of individual month"," * panes."," *"," * @property _paneProperties"," * @type Object"," * @private"," */"," _paneProperties : {},",""," /**"," * The number of month panes in the calendar, deduced"," * from the CONTENT_TEMPLATE's number of {calendar_grid}"," * tokens."," *"," * @property _paneNumber"," * @type Number"," * @private"," */"," _paneNumber : 1,",""," /**"," * The unique id used to prefix various elements of this"," * calendar instance."," *"," * @property _calendarId"," * @type String"," * @private"," */"," _calendarId : null,",""," /**"," * The hash map of selected dates, populated with"," * selectDates() and deselectDates() methods "," *"," * @property _selectedDates"," * @type Object"," * @private"," */"," _selectedDates : {},",""," /**"," * A private copy of the rules object, populated"," * by setting the customRenderer attribute."," *"," * @property _rules"," * @type Object"," * @private"," */"," _rules : {},",""," /**"," * A private copy of the filterFunction, populated"," * by setting the customRenderer attribute."," *"," * @property _filterFunction"," * @type Function"," * @private"," */"," _filterFunction : null,",""," /**"," * Storage for calendar cells modified by any custom"," * formatting. The storage is cleared, used to restore"," * cells to the original state, and repopulated accordingly"," * when the calendar is rerendered. "," *"," * @property _storedDateCells"," * @type Object"," * @private"," */"," _storedDateCells : {},",""," /**"," * Designated initializer"," * Initializes instance-level properties of"," * calendar."," *"," * @method initializer"," */ "," initializer : function () {"," this._paneProperties = {};"," this._calendarId = Y.guid('calendar');"," this._selectedDates = {};"," if (isEmpty(this._rules)) {"," this._rules = {}; "," }"," this._storedDateCells = {};"," },",""," /**"," * renderUI implementation"," *"," * Creates a visual representation of the calendar based on existing parameters. "," * @method renderUI"," */ "," renderUI : function () {",""," var contentBox = this.get('contentBox');"," contentBox.appendChild(this._initCalendarHTML(this.get('date')));"," if (this.get('showPrevMonth')) {"," this._afterShowPrevMonthChange();"," }"," if (this.get('showNextMonth')) {"," this._afterShowNextMonthChange();"," }"," this._renderCustomRules();"," this._renderSelectedDates();",""," this.get(\"boundingBox\").setAttribute(\"aria-labelledby\", this._calendarId + \"_header\");",""," },"," /**"," * bindUI implementation"," *"," * Assigns listeners to relevant events that change the state"," * of the calendar."," * @method bindUI"," */ "," bindUI : function () {"," this.after('dateChange', this._afterDateChange);"," this.after('showPrevMonthChange', this._afterShowPrevMonthChange);"," this.after('showNextMonthChange', this._afterShowNextMonthChange);"," this.after('headerRendererChange', this._afterHeaderRendererChange);"," this.after('customRendererChange', this._afterCustomRendererChange);"," this.after('enabledDatesRuleChange', this._afterCustomRendererChange);"," this.after('disabledDatesRuleChange', this._afterCustomRendererChange);"," this.after('focusedChange', this._afterFocusedChange);"," this.after('selectionChange', this._renderSelectedDates);"," this._bindCalendarEvents();"," },","",""," /**"," * An internal utility method that generates a list of selected dates "," * from the hash storage."," *"," * @method _getSelectedDatesList"," * @protected"," * @return {Array} The array of `Date`s that are currently selected."," */"," _getSelectedDatesList : function () {"," var output = [];"," each (this._selectedDates, function (year) {"," each (year, function (month) {"," each (month, function (day) {"," output.push (day);"," }, this);"," }, this);"," }, this);"," return output;"," },",""," /**"," * A utility method that returns all dates selected in a specific month."," *"," * @method _getSelectedDatesInMonth"," * @param {Date} oDate corresponding to the month for which selected dates"," * are requested."," * @protected"," * @return {Array} The array of `Date`s in a given month that are currently selected."," */"," _getSelectedDatesInMonth : function (oDate) {"," var year = oDate.getFullYear(),"," month = oDate.getMonth();"," "," if (hasKey(this._selectedDates, year) && hasKey(this._selectedDates[year], month)) {"," return Y.Object.values(this._selectedDates[year][month]); "," }"," else {"," return [];"," }"," },","",""," /**"," * An internal parsing method that receives a String list of numbers"," * and number ranges (of the form \"1,2,3,4-6,7-9,10,11\" etc.) and checks"," * whether a specific number is included in this list. Used for looking"," * up dates in the customRenderer rule set."," *"," * @method _isNumInList"," * @param {Number} num The number to look for in a list."," * @param {String} strList The list of numbers of the form \"1,2,3,4-6,7-8,9\", etc."," * @private"," * @return {boolean} Returns true if the given number is in the given list."," */"," _isNumInList : function (num, strList) {"," if (strList == \"all\") {"," return true;"," }"," else {"," var elements = strList.split(\",\"),"," i = elements.length;",""," while (i--) {"," var range = elements[i].split(\"-\");"," if (range.length == 2 && num >= parseInt(range[0], 10) && num <= parseInt(range[1], 10)) {"," return true;"," }"," else if (range.length == 1 && (parseInt(elements[i], 10) == num)) {"," return true;"," }"," }"," return false; "," }"," },",""," /**"," * Given a specific date, returns an array of rules (from the customRenderer rule set)"," * that the given date matches."," *"," * @method _getRulesForDate"," * @param {Date} oDate The date for which an array of rules is needed"," * @private"," * @return {Array} Returns an array of `String`s, each containg the name of"," * a rule that the given date matches."," */"," _getRulesForDate : function (oDate) {"," var year = oDate.getFullYear(),"," month = oDate.getMonth(),"," date = oDate.getDate(),"," wday = oDate.getDay(),"," rules = this._rules, "," outputRules = [],"," years, months, dates, days;",""," for (years in rules) {"," if (this._isNumInList(year, years)) {"," if (L.isString(rules[years])) {"," outputRules.push(rules[years]);"," }"," else {"," for (months in rules[years]) {"," if (this._isNumInList(month, months)) {"," if (L.isString(rules[years][months])) {"," outputRules.push(rules[years][months]);"," }"," else {"," for (dates in rules[years][months]) {"," if (this._isNumInList(date, dates)) {"," if (L.isString(rules[years][months][dates])) {"," outputRules.push(rules[years][months][dates]);"," }"," else {"," for (days in rules[years][months][dates]) {"," if (this._isNumInList(wday, days)) {"," if (L.isString(rules[years][months][dates][days])) {"," outputRules.push(rules[years][months][dates][days]);"," }"," }"," }"," }"," }"," }"," }"," }"," } "," }"," }"," }"," return outputRules;"," },",""," /**"," * A utility method which, given a specific date and a name of the rule,"," * checks whether the date matches the given rule."," *"," * @method _matchesRule"," * @param {Date} oDate The date to check"," * @param {String} rule The name of the rule that the date should match."," * @private"," * @return {boolean} Returns true if the date matches the given rule."," *"," */"," _matchesRule : function (oDate, rule) {"," return (iOf(this._getRulesForDate(oDate), rule) >= 0);"," },",""," /**"," * A utility method which checks whether a given date matches the `enabledDatesRule`"," * or does not match the `disabledDatesRule` and therefore whether it can be selected."," * @method _canBeSelected"," * @param {Date} oDate The date to check"," * @private"," * @return {boolean} Returns true if the date can be selected; false otherwise."," */"," _canBeSelected : function (oDate) {"," "," var enabledDatesRule = this.get(\"enabledDatesRule\"),"," disabledDatesRule = this.get(\"disabledDatesRule\");",""," if (enabledDatesRule) {"," return this._matchesRule(oDate, enabledDatesRule);"," }"," else if (disabledDatesRule) {"," return !this._matchesRule(oDate, disabledDatesRule);"," }"," else {"," return true;"," }"," },",""," /**"," * Selects a given date or array of dates."," * @method selectDates"," * @param {Date|Array} dates A `Date` or `Array` of `Date`s."," */"," selectDates : function (dates) {"," if (ydate.isValidDate(dates)) {"," this._addDateToSelection(dates);"," }"," else if (L.isArray(dates)) {"," this._addDatesToSelection(dates);"," }"," },",""," /**"," * Deselects a given date or array of dates, or deselects"," * all dates if no argument is specified."," * @method deselectDates"," * @param {Date|Array} [dates] A `Date` or `Array` of `Date`s, or no"," * argument if all dates should be deselected."," */"," deselectDates : function (dates) {"," if (!dates) {"," this._clearSelection();"," }"," else if (ydate.isValidDate(dates)) {"," this._removeDateFromSelection(dates);"," }"," else if (L.isArray(dates)) {"," this._removeDatesFromSelection(dates);"," }"," },",""," /**"," * A utility method that adds a given date to selection.."," * @method _addDateToSelection"," * @param {Date} oDate The date to add to selection."," * @param {Number} [index] An optional parameter that is used"," * to differentiate between individual date selections and multiple"," * date selections."," * @private"," */"," _addDateToSelection : function (oDate, index) {",""," if (this._canBeSelected(oDate)) {",""," var year = oDate.getFullYear(),"," month = oDate.getMonth(),"," day = oDate.getDate();"," "," if (hasKey(this._selectedDates, year)) {"," if (hasKey(this._selectedDates[year], month)) {"," this._selectedDates[year][month][day] = oDate;"," }"," else {"," this._selectedDates[year][month] = {};"," this._selectedDates[year][month][day] = oDate;"," }"," }"," else {"," this._selectedDates[year] = {};"," this._selectedDates[year][month] = {};"," this._selectedDates[year][month][day] = oDate;"," }",""," this._selectedDates = setVal(this._selectedDates, [year, month, day], oDate);",""," if (!index) {"," this._fireSelectionChange();"," }"," }"," },",""," /**"," * A utility method that adds a given list of dates to selection."," * @method _addDatesToSelection"," * @param {Array} datesArray The list of dates to add to selection."," * @private"," */"," _addDatesToSelection : function (datesArray) {"," each(datesArray, this._addDateToSelection, this);"," this._fireSelectionChange();"," },",""," /**"," * A utility method that adds a given range of dates to selection."," * @method _addDateRangeToSelection"," * @param {Date} startDate The first date of the given range."," * @param {Date} endDate The last date of the given range."," * @private"," */"," _addDateRangeToSelection : function (startDate, endDate) {",""," var timezoneDifference = (endDate.getTimezoneOffset() - startDate.getTimezoneOffset())*60000,"," startTime = startDate.getTime(),"," endTime = endDate.getTime();"," "," if (startTime > endTime) {"," var tempTime = startTime;"," startTime = endTime;"," endTime = tempTime + timezoneDifference;"," }"," else {"," endTime = endTime - timezoneDifference;"," }","",""," for (var time = startTime; time <= endTime; time += 86400000) {"," var addedDate = new Date(time);"," addedDate.setHours(12);"," this._addDateToSelection(addedDate, time);"," }"," this._fireSelectionChange();"," },",""," /**"," * A utility method that removes a given date from selection.."," * @method _removeDateFromSelection"," * @param {Date} oDate The date to remove from selection."," * @param {Number} [index] An optional parameter that is used"," * to differentiate between individual date selections and multiple"," * date selections."," * @private"," */"," _removeDateFromSelection : function (oDate, index) {"," var year = oDate.getFullYear(),"," month = oDate.getMonth(),"," day = oDate.getDate();"," if (hasKey(this._selectedDates, year) && "," hasKey(this._selectedDates[year], month) && "," hasKey(this._selectedDates[year][month], day)) {"," delete this._selectedDates[year][month][day];"," if (!index) {"," this._fireSelectionChange();"," }"," }"," },",""," /**"," * A utility method that removes a given list of dates from selection."," * @method _removeDatesFromSelection"," * @param {Array} datesArray The list of dates to remove from selection."," * @private"," */"," _removeDatesFromSelection : function (datesArray) {"," each(datesArray, this._removeDateFromSelection, this);"," this._fireSelectionChange();"," },",""," /**"," * A utility method that removes a given range of dates from selection."," * @method _removeDateRangeFromSelection"," * @param {Date} startDate The first date of the given range."," * @param {Date} endDate The last date of the given range."," * @private"," */"," _removeDateRangeFromSelection : function (startDate, endDate) {"," var startTime = startDate.getTime(),"," endTime = endDate.getTime();"," "," for (var time = startTime; time <= endTime; time += 86400000) {"," this._removeDateFromSelection(new Date(time), time);"," }",""," this._fireSelectionChange(); "," },",""," /**"," * A utility method that removes all dates from selection."," * @method _clearSelection"," * @param {boolean} noevent A Boolean specifying whether a selectionChange"," * event should be fired. If true, the event is not fired."," * @private"," */"," _clearSelection : function (noevent) {"," this._selectedDates = {};"," this.get(\"contentBox\").all(\".\" + CAL_DAY_SELECTED).removeClass(CAL_DAY_SELECTED).setAttribute(\"aria-selected\", false);"," if (!noevent) {"," this._fireSelectionChange();"," }"," },",""," /**"," * A utility method that fires a selectionChange event."," * @method _fireSelectionChange"," * @private"," */"," _fireSelectionChange : function () {",""," /**"," * Fired when the set of selected dates changes. Contains a payload with"," * a `newSelection` property with an array of selected dates."," *"," * @event selectionChange"," */"," this.fire(\"selectionChange\", {newSelection: this._getSelectedDatesList()});"," },",""," /**"," * A utility method that restores cells modified by custom formatting."," * @method _restoreModifiedCells"," * @private"," */"," _restoreModifiedCells : function () {"," var contentbox = this.get(\"contentBox\"),"," id;"," for (id in this._storedDateCells) {"," contentbox.one(\"#\" + id).replace(this._storedDateCells[id]);"," delete this._storedDateCells[id];"," }"," },",""," /**"," * A rendering assist method that renders all cells modified by the customRenderer"," * rules, as well as the enabledDatesRule and disabledDatesRule."," * @method _renderCustomRules"," * @private"," */"," _renderCustomRules : function () {",""," this.get(\"contentBox\").all(\".\" + CAL_DAY + \",.\" + CAL_NEXTMONTH_DAY).removeClass(SELECTION_DISABLED).setAttribute(\"aria-disabled\", false);",""," if (!isEmpty(this._rules)) {"," var enRule = this.get(\"enabledDatesRule\"),"," disRule = this.get(\"disabledDatesRule\");",""," for (var paneNum = 0; paneNum < this._paneNumber; paneNum++) {"," var paneDate = ydate.addMonths(this.get(\"date\"), paneNum);"," var dateArray = ydate.listOfDatesInMonth(paneDate);"," each(dateArray, function (date) {"," var matchingRules = this._getRulesForDate(date);"," if (matchingRules.length > 0) {"," var dateNode = this._dateToNode(date);"," if ((enRule && iOf(matchingRules, enRule) < 0) || (!enRule && disRule && iOf(matchingRules, disRule) >= 0)) {"," dateNode.addClass(SELECTION_DISABLED).setAttribute(\"aria-disabled\", true);"," }"," "," if (L.isFunction(this._filterFunction)) {"," this._storedDateCells[dateNode.get(\"id\")] = dateNode.cloneNode(true);"," this._filterFunction (date, dateNode, matchingRules);"," }"," }"," else if (enRule) {"," var dateNode = this._dateToNode(date);"," dateNode.addClass(SELECTION_DISABLED).setAttribute(\"aria-disabled\", true);"," }"," },"," this);"," }"," } "," },",""," /**"," * A rendering assist method that renders all cells that are currently selected."," * @method _renderSelectedDates"," * @private"," */"," _renderSelectedDates : function () {"," this.get(\"contentBox\").all(\".\" + CAL_DAY_SELECTED).removeClass(CAL_DAY_SELECTED).setAttribute(\"aria-selected\", false);"," "," for (var paneNum = 0; paneNum < this._paneNumber; paneNum++) {"," var paneDate = ydate.addMonths(this.get(\"date\"), paneNum);"," var dateArray = this._getSelectedDatesInMonth(paneDate);"," each(dateArray, function (date) {"," this._dateToNode(date).addClass(CAL_DAY_SELECTED).setAttribute(\"aria-selected\", true);"," },"," this);"," }"," },",""," /**"," * A utility method that converts a date to the node wrapping the calendar cell"," * the date corresponds to.."," * @method _dateToNode"," * @param {Date} oDate The date to convert to Node"," * @protected"," * @return {Node} The node wrapping the DOM element of the cell the date "," * corresponds to."," */"," _dateToNode : function (oDate) {"," var day = oDate.getDate(),"," col = 0,"," daymod = day%7,"," paneNum = (12 + oDate.getMonth() - this.get(\"date\").getMonth()) % 12,"," paneId = this._calendarId + \"_pane_\" + paneNum,"," cutoffCol = this._paneProperties[paneId].cutoffCol;",""," switch (daymod) {"," case (0):"," if (cutoffCol >= 6) {"," col = 12;"," }"," else {"," col = 5;"," }"," break;"," case (1):"," col = 6;"," break;"," case (2):"," if (cutoffCol > 0) {"," col = 7;"," }"," else {"," col = 0;"," }"," break;"," case (3):"," if (cutoffCol > 1) {"," col = 8;"," }"," else {"," col = 1;"," }"," break;"," case (4):"," if (cutoffCol > 2) {"," col = 9;"," }"," else {"," col = 2;"," }"," break;"," case (5):"," if (cutoffCol > 3) {"," col = 10;"," }"," else {"," col = 3;"," }"," break;"," case (6):"," if (cutoffCol > 4) {"," col = 11;"," }"," else {"," col = 4;"," }"," break;"," }"," return(this.get(\"contentBox\").one(\"#\" + this._calendarId + \"_pane_\" + paneNum + \"_\" + col + \"_\" + day)); ",""," },",""," /**"," * A utility method that converts a node corresponding to the DOM element of"," * the cell for a particular date to that date."," * @method _nodeToDate"," * @param {Node} oNode The Node wrapping the DOM element of a particular date cell."," * @protected"," * @return {Date} The date corresponding to the DOM element that the given node wraps."," */"," _nodeToDate : function (oNode) {"," "," var idParts = oNode.get(\"id\").split(\"_\").reverse(),"," paneNum = parseInt(idParts[2], 10),"," day = parseInt(idParts[0], 10);",""," var shiftedDate = ydate.addMonths(this.get(\"date\"), paneNum),"," year = shiftedDate.getFullYear(),"," month = shiftedDate.getMonth();",""," return new Date(year, month, day, 12, 0, 0, 0);"," },",""," /**"," * A placeholder method, called from bindUI, to bind the Calendar events."," * @method _bindCalendarEvents"," * @protected"," */"," _bindCalendarEvents : function () {"," "," },",""," /**"," * A utility method that normalizes a given date by converting it to the 1st"," * day of the month the date is in, with the time set to noon."," * @method _normalizeDate"," * @param {Date} oDate The date to normalize"," * @protected"," * @return {Date} The normalized date, set to the first of the month, with time"," * set to noon."," */"," _normalizeDate : function (date) {"," if (date) {"," return new Date(date.getFullYear(), date.getMonth(), 1, 12, 0, 0, 0);"," }"," else {"," return null;"," } "," },","",""," /**"," * A render assist utility method that computes the cutoff column for the calendar "," * rendering mask."," * @method _getCutoffColumn"," * @param {Date} date The date of the month grid to compute the cutoff column for."," * @param {Number} firstday The first day of the week (modified by internationalized calendars)"," * @private"," * @return {Number} The number of the cutoff column."," */"," _getCutoffColumn : function (date, firstday) {",""," var distance = this._normalizeDate(date).getDay() - firstday;"," var cutOffColumn = 6 - (distance + 7)%7;"," return cutOffColumn;",""," },",""," /**"," * A render assist method that turns on the view of the previous month's dates "," * in a given calendar pane."," * @method _turnPrevMonthOn"," * @param {Node} pane The calendar pane that needs its previous month's dates view"," * modified."," * @protected"," */"," _turnPrevMonthOn : function (pane) {"," "," var pane_id = pane.get(\"id\"),"," pane_date = this._paneProperties[pane_id].paneDate,"," daysInPrevMonth = ydate.daysInMonth(ydate.addMonths(pane_date, -1));",""," if (!this._paneProperties[pane_id].hasOwnProperty(\"daysInPrevMonth\")) {"," this._paneProperties[pane_id].daysInPrevMonth = 0;"," }",""," if (daysInPrevMonth != this._paneProperties[pane_id].daysInPrevMonth) {"," "," this._paneProperties[pane_id].daysInPrevMonth = daysInPrevMonth;",""," for (var cell = 5; cell >= 0; cell--) "," {"," pane.one(\"#\" + pane_id + \"_\" + cell + \"_\" + (cell-5)).set('text', daysInPrevMonth--);"," }",""," }","",""," },",""," /**"," * A render assist method that turns off the view of the previous month's dates "," * in a given calendar pane."," * @method _turnPrevMonthOff"," * @param {Node} pane The calendar pane that needs its previous month's dates view"," * modified."," * @protected"," */"," _turnPrevMonthOff : function (pane) {"," var pane_id = pane.get(\"id\");"," this._paneProperties[pane_id].daysInPrevMonth = 0;",""," for (var cell = 5; cell >= 0; cell--) "," {"," pane.one(\"#\" + pane_id + \"_\" + cell + \"_\" + (cell-5)).setContent(\" \");"," } "," },",""," /**"," * A render assist method that cleans up the last few cells in the month grid"," * when the number of days in the month changes."," * @method _cleanUpNextMonthCells"," * @param {Node} pane The calendar pane that needs the last date cells cleaned up."," * @private"," */"," _cleanUpNextMonthCells : function (pane) {"," var pane_id = pane.get(\"id\");"," pane.one(\"#\" + pane_id + \"_6_29\").removeClass(CAL_NEXTMONTH_DAY);"," pane.one(\"#\" + pane_id + \"_7_30\").removeClass(CAL_NEXTMONTH_DAY);"," pane.one(\"#\" + pane_id + \"_8_31\").removeClass(CAL_NEXTMONTH_DAY);"," pane.one(\"#\" + pane_id + \"_0_30\").removeClass(CAL_NEXTMONTH_DAY);"," pane.one(\"#\" + pane_id + \"_1_31\").removeClass(CAL_NEXTMONTH_DAY); "," },",""," /**"," * A render assist method that turns on the view of the next month's dates "," * in a given calendar pane."," * @method _turnNextMonthOn"," * @param {Node} pane The calendar pane that needs its next month's dates view"," * modified."," * @protected"," */"," _turnNextMonthOn : function (pane) { "," var dayCounter = 1,"," pane_id = pane.get(\"id\"),"," daysInMonth = this._paneProperties[pane_id].daysInMonth,"," cutoffCol = this._paneProperties[pane_id].cutoffCol;",""," for (var cell = daysInMonth - 22; cell < cutoffCol + 7; cell++) "," {"," pane.one(\"#\" + pane_id + \"_\" + cell + \"_\" + (cell+23)).set(\"text\", dayCounter++).addClass(CAL_NEXTMONTH_DAY);"," }",""," var startingCell = cutoffCol;"," if (daysInMonth == 31 && (cutoffCol <= 1)) {"," startingCell = 2;"," }"," else if (daysInMonth == 30 && cutoffCol === 0) {"," startingCell = 1;"," }"," "," for (var cell = startingCell ; cell < cutoffCol + 7; cell++) {"," pane.one(\"#\" + pane_id + \"_\" + cell + \"_\" + (cell+30)).set(\"text\", dayCounter++).addClass(CAL_NEXTMONTH_DAY); "," }"," },",""," /**"," * A render assist method that turns off the view of the next month's dates "," * in a given calendar pane."," * @method _turnNextMonthOff"," * @param {Node} pane The calendar pane that needs its next month's dates view"," * modified."," * @protected"," */"," _turnNextMonthOff : function (pane) {"," var pane_id = pane.get(\"id\"),"," daysInMonth = this._paneProperties[pane_id].daysInMonth,"," cutoffCol = this._paneProperties[pane_id].cutoffCol;",""," for (var cell = daysInMonth - 22; cell <= 12; cell++) "," {"," pane.one(\"#\" + pane_id + \"_\" + cell + \"_\" + (cell+23)).setContent(\" \").addClass(CAL_NEXTMONTH_DAY);"," }",""," var startingCell = 0;"," if (daysInMonth == 31 && (cutoffCol <= 1)) {"," startingCell = 2;"," }"," else if (daysInMonth == 30 && cutoffCol === 0) {"," startingCell = 1;"," }"," "," for (var cell = startingCell ; cell <= 12; cell++) {"," pane.one(\"#\" + pane_id + \"_\" + cell + \"_\" + (cell+30)).setContent(\" \").addClass(CAL_NEXTMONTH_DAY); "," } "," },",""," /**"," * The handler for the change in the showNextMonth attribute."," * @method _afterShowNextMonthChange"," * @private"," */"," _afterShowNextMonthChange : function () {"," "," var contentBox = this.get('contentBox'),"," lastPane = contentBox.one(\"#\" + this._calendarId + \"_pane_\" + (this._paneNumber - 1));"," this._cleanUpNextMonthCells(lastPane); ","",""," if (this.get('showNextMonth')) {"," this._turnNextMonthOn(lastPane);"," }",""," else {"," this._turnNextMonthOff(lastPane);"," }",""," },",""," /**"," * The handler for the change in the showPrevMonth attribute."," * @method _afterShowPrevMonthChange"," * @private"," */"," _afterShowPrevMonthChange : function () {"," var contentBox = this.get('contentBox'),"," firstPane = contentBox.one(\"#\" + this._calendarId + \"_pane_\" + 0);",""," if (this.get('showPrevMonth')) {"," this._turnPrevMonthOn(firstPane);"," }",""," else {"," this._turnPrevMonthOff(firstPane);"," }"," "," },"," "," /**"," * The handler for the change in the headerRenderer attribute."," * @method _afterHeaderRendererChange"," * @private"," */ "," _afterHeaderRendererChange : function () {"," var headerCell = this.get(\"contentBox\").one(\".\" + CAL_HD_LABEL);"," headerCell.setContent(this._updateCalendarHeader(this.get('date')));"," },",""," /**"," * The handler for the change in the customRenderer attribute."," * @method _afterCustomRendererChange"," * @private"," */ "," _afterCustomRendererChange : function () {"," this._restoreModifiedCells();"," this._renderCustomRules();"," },",""," /**"," * The handler for the change in the date attribute. Modifies the calendar"," * view by shifting the calendar grid mask and running custom rendering and"," * selection rendering as necessary."," * @method _afterDateChange"," * @private"," */ "," _afterDateChange : function () {"," "," var contentBox = this.get('contentBox'),"," headerCell = contentBox.one(\".\" + CAL_HD).one(\".\" + CAL_HD_LABEL),"," calendarPanes = contentBox.all(\".\" + CAL_GRID),"," currentDate = this.get(\"date\"),"," counter = 0;",""," contentBox.setStyle(\"visibility\", \"hidden\");"," headerCell.setContent(this._updateCalendarHeader(currentDate));"," "," this._restoreModifiedCells();",""," calendarPanes.each(function (curNode) {"," this._rerenderCalendarPane(ydate.addMonths(currentDate, counter++), "," curNode);"," }, this);",""," this._afterShowPrevMonthChange();"," this._afterShowNextMonthChange();",""," this._renderCustomRules();"," this._renderSelectedDates();"," "," contentBox.setStyle(\"visibility\", \"visible\");"," },","",""," /**"," * A rendering assist method that initializes the HTML for a single"," * calendar pane."," * @method _initCalendarPane"," * @param {Date} baseDate The date corresponding to the month of the given"," * calendar pane."," * @param {String} pane_id The id of the pane, to be used as a prefix for"," * element ids in the given pane."," * @private"," */ "," _initCalendarPane : function (baseDate, pane_id) {"," // Initialize final output HTML string"," var calString = '',"," // Get a list of short weekdays from the internationalization package, or else use default English ones."," weekdays = this.get('strings.very_short_weekdays') || [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],"," fullweekdays = this.get('strings.weekdays') || [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],"," // Get the first day of the week from the internationalization package, or else use Sunday as default."," firstday = this.get('strings.first_weekday') || 0,"," // Compute the cutoff column of the masked calendar table, based on the start date and the first day of week."," cutoffCol = this._getCutoffColumn(baseDate, firstday),"," // Compute the number of days in the month based on starting date"," daysInMonth = ydate.daysInMonth(baseDate),"," // Initialize the array of individual row HTML strings"," row_array = ['','','','','',''],"," // Initialize the partial templates object"," partials = {};"," "," // Initialize the partial template for the weekday row cells."," partials[\"weekday_row\"] = '';"," "," // Populate the partial template for the weekday row cells with weekday names"," for (var day = firstday; day <= firstday + 6; day++) {"," partials[\"weekday_row\"] += "," substitute(CalendarBase.WEEKDAY_TEMPLATE,"," {weekdayname: weekdays[day%7],"," full_weekdayname: fullweekdays[day%7]});"," }"," "," // Populate the partial template for the weekday row container with the weekday row cells"," partials[\"weekday_row_template\"] = substitute(CalendarBase.WEEKDAY_ROW_TEMPLATE, partials);",""," // Populate the array of individual row HTML strings"," for (var row = 0; row <= 5; row++) {"," "," for (var column = 0; column <= 12; column++) { "," "," // Compute the value of the date that needs to populate the cell"," var date = 7*row - 5 + column;",""," // Compose the value of the unique id of the current calendar cell"," var id_date = pane_id + \"_\" + column + \"_\" + date;",""," // Set the calendar day class to one of three possible values"," var calendar_day_class = CAL_DAY;",""," if (date < 1) {"," calendar_day_class = CAL_PREVMONTH_DAY;"," }"," else if (date > daysInMonth) {"," calendar_day_class = CAL_NEXTMONTH_DAY;"," }",""," // Cut off dates that fall before the first and after the last date of the month"," if (date < 1 || date > daysInMonth) {"," date = \" \";"," }"," "," // Decide on whether a column in the masked table is visible or not based on the value of the cutoff column."," var column_visibility = (column >= cutoffCol && column < (cutoffCol + 7)) ? '' : CAL_COL_HIDDEN;",""," // Substitute the values into the partial calendar day template and add it to the current row HTML string"," row_array[row] += substitute (CalendarBase.CALDAY_TEMPLATE, "," {day_content: date,"," calendar_col_class: \"calendar_col\" + column,"," calendar_col_visibility_class: column_visibility,"," calendar_day_class: calendar_day_class,"," calendar_day_id: id_date});"," }"," }"," "," // Instantiate the partial calendar pane body template"," partials[\"body_template\"] = '';"," "," // Populate the body template with the rows templates"," each (row_array, function (v) {"," partials[\"body_template\"] += substitute(CalendarBase.CALDAY_ROW_TEMPLATE, "," {calday_row: v});"," });",""," // Populate the calendar grid id"," partials[\"calendar_pane_id\"] = pane_id;",""," // Populate the calendar pane tabindex"," partials[\"calendar_pane_tabindex\"] = this.get(\"tabIndex\");"," partials[\"pane_arialabel\"] = ydate.format(baseDate, {format:\"%B %Y\"});","",""," // Generate final output by substituting class names."," var output = substitute(substitute (CalendarBase.CALENDAR_GRID_TEMPLATE, partials),"," CalendarBase.CALENDAR_STRINGS);",""," // Store the initialized pane information",""," this._paneProperties[pane_id] = {cutoffCol: cutoffCol, daysInMonth: daysInMonth, paneDate: baseDate};",""," return output;"," },",""," /**"," * A rendering assist method that rerenders a specified calendar pane, based"," * on a new Date. "," * @method _rerenderCalendarPane"," * @param {Date} newDate The date corresponding to the month of the given"," * calendar pane."," * @param {Node} pane The node corresponding to the calendar pane to be rerenders."," * @private"," */ "," _rerenderCalendarPane : function (newDate, pane) {",""," // Get the first day of the week from the internationalization package, or else use Sunday as default."," var firstday = this.get('strings.first_weekday') || 0,"," // Compute the cutoff column of the masked calendar table, based on the start date and the first day of week."," cutoffCol = this._getCutoffColumn(newDate, firstday),"," // Compute the number of days in the month based on starting date"," daysInMonth = ydate.daysInMonth(newDate),"," // Get pane id for easier reference"," paneId = pane.get(\"id\");"," "," // Hide the pane before making DOM changes to speed them up"," pane.setStyle(\"visibility\", \"hidden\");"," pane.setAttribute(\"aria-label\", ydate.format(newDate, {format:\"%B %Y\"}));"," "," // Go through all columns, and flip their visibility setting based on whether they are within the unmasked range."," for (var column = 0; column <= 12; column++) {"," var currentColumn = pane.all(\".\" + \"calendar_col\" + column);"," currentColumn.removeClass(CAL_COL_HIDDEN);"," "," if (column < cutoffCol || column >= (cutoffCol + 7)) {"," currentColumn.addClass(CAL_COL_HIDDEN);"," }"," else {"," // Clean up dates in visible columns to account for the correct number of days in a month"," switch(column)"," {"," case 0:"," var curCell = pane.one(\"#\" + paneId + \"_0_30\");"," if (daysInMonth >= 30) {"," curCell.set(\"text\", \"30\");"," curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);"," }"," else {"," curCell.setContent(\" \");"," curCell.addClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);"," }"," break;"," case 1:"," var curCell = pane.one(\"#\" + paneId + \"_1_31\");"," if (daysInMonth >= 31) {"," curCell.set(\"text\", \"31\");"," curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);"," }"," else {"," curCell.setContent(\" \");"," curCell.removeClass(CAL_DAY).addClass(CAL_NEXTMONTH_DAY);"," }"," break;"," case 6:"," var curCell = pane.one(\"#\" + paneId + \"_6_29\");"," if (daysInMonth >= 29) {"," curCell.set(\"text\", \"29\");"," curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);"," }"," else {"," curCell.setContent(\" \");"," curCell.removeClass(CAL_DAY).addClass(CAL_NEXTMONTH_DAY);"," }"," break;"," case 7:"," var curCell = pane.one(\"#\" + paneId + \"_7_30\");"," if (daysInMonth >= 30) {"," curCell.set(\"text\", \"30\");"," curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);"," }"," else {"," curCell.setContent(\" \");"," curCell.removeClass(CAL_DAY).addClass(CAL_NEXTMONTH_DAY);"," }"," break;"," case 8:"," var curCell = pane.one(\"#\" + paneId + \"_8_31\");"," if (daysInMonth >= 31) {"," curCell.set(\"text\", \"31\");"," curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);"," }"," else {"," curCell.setContent(\" \");"," curCell.removeClass(CAL_DAY).addClass(CAL_NEXTMONTH_DAY);"," }"," break;"," } "," }"," }"," // Update stored pane properties"," this._paneProperties[paneId].cutoffCol = cutoffCol;"," this._paneProperties[paneId].daysInMonth = daysInMonth;"," this._paneProperties[paneId].paneDate = newDate;"," "," // Bring the pane visibility back after all DOM changes are done "," pane.setStyle(\"visibility\", \"visible\");",""," },",""," /**"," * A rendering assist method that updates the calendar header based"," * on a given date and potentially the provided headerRenderer."," * @method _updateCalendarHeader"," * @param {Date} baseDate The date with which to update the calendar header."," * @private"," */ "," _updateCalendarHeader : function (baseDate) {"," var headerString = \"\","," headerRenderer = this.get(\"headerRenderer\");"," "," if (Y.Lang.isString(headerRenderer)) {"," headerString = ydate.format(baseDate, {format:headerRenderer});"," }"," else if (headerRenderer instanceof Function) {"," headerString = headerRenderer.call(this, baseDate);"," }"," "," return headerString; "," },",""," /**"," * A rendering assist method that initializes the calendar header HTML "," * based on a given date and potentially the provided headerRenderer."," * @method _updateCalendarHeader"," * @param {Date} baseDate The date with which to initialize the calendar header."," * @private"," */ "," _initCalendarHeader : function (baseDate) {"," return substitute(substitute(CalendarBase.HEADER_TEMPLATE, "," {calheader: this._updateCalendarHeader(baseDate),"," calendar_id: this._calendarId}), "," CalendarBase.CALENDAR_STRINGS);"," },",""," /**"," * A rendering assist method that initializes the calendar HTML "," * based on a given date."," * @method _initCalendarHTML"," * @param {Date} baseDate The date with which to initialize the calendar."," * @private"," */ "," _initCalendarHTML : function (baseDate) {"," // Instantiate the partials holder"," var partials = {},"," // Counter for iterative template replacement."," counter = 0;"," "," // Generate the template for the header "," partials[\"header_template\"] = this._initCalendarHeader(baseDate);"," partials[\"calendar_id\"] = this._calendarId;",""," partials[\"body_template\"] = substitute(substitute (CalendarBase.CONTENT_TEMPLATE, partials),"," CalendarBase.CALENDAR_STRINGS);"," "," // Instantiate the iterative template replacer function "," function paneReplacer () {"," var singlePane = this._initCalendarPane(ydate.addMonths(baseDate, counter), partials[\"calendar_id\"]+\"_pane_\"+counter);"," counter++;"," return singlePane;"," }"," // Go through all occurrences of the calendar_grid_template token and replace it with an appropriate calendar grid."," var output = partials[\"body_template\"].replace(/\\{calendar_grid_template\\}/g, Y.bind(paneReplacer, this));",""," // Update the paneNumber count"," this._paneNumber = counter;",""," return output;"," }","}, {"," "," /**"," * The CSS classnames for the calendar templates."," * @property CALENDAR_STRINGS"," * @type Object"," * @readOnly"," * @protected"," * @static"," */ "," CALENDAR_STRINGS: {"," calendar_grid_class : CAL_GRID,"," calendar_body_class : CAL_BODY,"," calendar_hd_class : CAL_HD,"," calendar_hd_label_class : CAL_HD_LABEL,"," calendar_weekdayrow_class : CAL_WDAYROW,"," calendar_weekday_class : CAL_WDAY,"," calendar_row_class : CAL_ROW,"," calendar_day_class : CAL_DAY,"," calendar_dayanchor_class : CAL_ANCHOR,"," calendar_pane_class : CAL_PANE,"," calendar_right_grid_class : CAL_RIGHT_GRID,"," calendar_left_grid_class : CAL_LEFT_GRID,"," calendar_status_class : CAL_STATUS"," },",""," /*",""," ARIA_STATUS_TEMPLATE: '<div role=\"status\" aria-atomic=\"true\" class=\"{calendar_status_class}\"></div>',",""," AriaStatus : null,",""," updateStatus : function (statusString) {",""," if (!CalendarBase.AriaStatus) {"," CalendarBase.AriaStatus = create("," substitute (CalendarBase.ARIA_STATUS_TEMPLATE, "," CalendarBase.CALENDAR_STRINGS));"," Y.one(\"body\").append(CalendarBase.AriaStatus);"," }",""," CalendarBase.AriaStatus.set(\"text\", statusString);"," },",""," */",""," /**"," * The main content template for calendar."," * @property CONTENT_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," CONTENT_TEMPLATE: '<div class=\"yui3-g {calendar_pane_class}\" id=\"{calendar_id}\">' + "," '{header_template}' +"," '<div class=\"yui3-u-1\">' +"," '{calendar_grid_template}' +"," '</div>' +"," '</div>',",""," /**"," * A single pane template for calendar (same as default CONTENT_TEMPLATE)"," * @property ONE_PANE_TEMPLATE"," * @type String"," * @protected"," * @readOnly"," * @static"," */ "," ONE_PANE_TEMPLATE: '<div class=\"yui3-g {calendar_pane_class}\" id=\"{calendar_id}\">' + "," '{header_template}' +"," '<div class=\"yui3-u-1\">' +"," '{calendar_grid_template}' +"," '</div>' +"," '</div>',",""," /**"," * A two pane template for calendar."," * @property TWO_PANE_TEMPLATE"," * @type String"," * @protected"," * @readOnly"," * @static"," */ "," TWO_PANE_TEMPLATE: '<div class=\"yui3-g {calendar_pane_class}\" id=\"{calendar_id}\">' + "," '{header_template}' +"," '<div class=\"yui3-u-1-2\">'+"," '<div class = \"{calendar_left_grid_class}\">' + "," '{calendar_grid_template}' +"," '</div>' +"," '</div>' +"," '<div class=\"yui3-u-1-2\">' +"," '<div class = \"{calendar_right_grid_class}\">' +"," '{calendar_grid_template}' +"," '</div>' +"," '</div>' + "," '</div>',"," /**"," * A three pane template for calendar."," * @property THREE_PANE_TEMPLATE"," * @type String"," * @protected"," * @readOnly"," * @static"," */ "," THREE_PANE_TEMPLATE: '<div class=\"yui3-g {calendar_pane_class}\" id=\"{calendar_id}\">' + "," '{header_template}' +"," '<div class=\"yui3-u-1-3\">' +"," '<div class = \"{calendar_left_grid_class}\">' +"," '{calendar_grid_template}' +"," '</div>' + "," '</div>' +"," '<div class=\"yui3-u-1-3\">' +"," '{calendar_grid_template}' +"," '</div>' + "," '<div class=\"yui3-u-1-3\">' +"," '<div class = \"{calendar_right_grid_class}\">' +"," '{calendar_grid_template}' +"," '</div>' + "," '</div>' + "," '</div>',"," /**"," * A template for the calendar grid."," * @property CALENDAR_GRID_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," CALENDAR_GRID_TEMPLATE: '<table class=\"{calendar_grid_class}\" id=\"{calendar_pane_id}\" role=\"grid\" aria-readonly=\"true\" aria-label=\"{pane_arialabel}\" tabindex=\"{calendar_pane_tabindex}\">' + "," '<thead>' +"," '{weekday_row_template}' +"," '</thead>' +"," '<tbody>' + "," '{body_template}' +"," '</tbody>' +"," '</table>',",""," /**"," * A template for the calendar header."," * @property HEADER_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," HEADER_TEMPLATE: '<div class=\"yui3-g {calendar_hd_class}\">' + "," '<div class=\"yui3-u {calendar_hd_label_class}\" id=\"{calendar_id}_header\" aria-role=\"heading\">' + "," '{calheader}' +"," '</div>' +"," '</div>',",""," /**"," * A template for the row of weekday names."," * @property WEEKDAY_ROW_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," WEEKDAY_ROW_TEMPLATE: '<tr class=\"{calendar_weekdayrow_class}\" role=\"row\">' + "," '{weekday_row}' +"," '</tr>',",""," /**"," * A template for a single row of calendar days."," * @property CALDAY_ROW_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," CALDAY_ROW_TEMPLATE: '<tr class=\"{calendar_row_class}\" role=\"row\">' + "," '{calday_row}' + "," '</tr>',",""," /**"," * A template for a single cell with a weekday name."," * @property CALDAY_ROW_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," WEEKDAY_TEMPLATE: '<th class=\"{calendar_weekday_class}\" role=\"columnheader\" aria-label=\"{full_weekdayname}\">{weekdayname}</th>',",""," /**"," * A template for a single cell with a calendar day."," * @property CALDAY_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," CALDAY_TEMPLATE: '<td class=\"{calendar_col_class} {calendar_day_class} {calendar_col_visibility_class}\" id=\"{calendar_day_id}\" role=\"gridcell\" tabindex=\"-1\">' +"," '{day_content}' + "," '</td>',",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'calendarBase'"," * @readOnly"," * @protected"," * @static"," */ "," NAME: 'calendarBase',",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */ "," ATTRS: {"," tabIndex: {"," value: 1"," },"," /**"," * The date corresponding to the current calendar view. Always"," * normalized to the first of the month that contains the date"," * at assignment time. Used as the first date visible in the"," * calendar."," *"," * @attribute date"," * @type Date"," * @default The first of the month containing today's date, as"," * set on the end user's system."," */"," date: {"," value: new Date(),"," setter: function (val) {"," var newDate = this._normalizeDate(val);"," if (ydate.areEqual(newDate, this.get('date'))) {"," return this.get('date');"," }"," else {"," return newDate;"," }"," }"," },",""," /**"," * A setting specifying whether to shows days from the previous"," * month in the visible month's grid, if there are empty preceding"," * cells available."," *"," * @attribute showPrevMonth"," * @type boolean"," * @default false"," */"," showPrevMonth: {"," value: false"," },",""," /**"," * A setting specifying whether to shows days from the next"," * month in the visible month's grid, if there are empty"," * cells available at the end."," *"," * @attribute showNextMonth"," * @type boolean"," * @default false"," */"," showNextMonth: {"," value: false"," },",""," /**"," * Strings and properties derived from the internationalization packages"," * for the calendar."," *"," * @attribute strings"," * @type Object"," * @protected"," */"," strings : {"," valueFn: function() { return Y.Intl.get(\"calendar-base\"); }"," },",""," /**"," * Custom header renderer for the calendar."," *"," * @attribute headerRenderer"," * @type String | Function"," */"," headerRenderer: {"," value: \"%B %Y\""," },",""," /**"," * The name of the rule which all enabled dates should match."," * Either disabledDatesRule or enabledDatesRule should be specified,"," * or neither, but not both."," *"," * @attribute enabledDatesRule"," * @type String"," * @default null"," */"," enabledDatesRule: {"," value: null"," },",""," /**"," * The name of the rule which all disabled dates should match."," * Either disabledDatesRule or enabledDatesRule should be specified,"," * or neither, but not both."," *"," * @attribute disabledDatesRule"," * @type String"," * @default null"," */"," disabledDatesRule: {"," value: null"," },",""," /**"," * A read-only attribute providing a list of currently selected dates."," *"," * @attribute selectedDates"," * @readOnly"," * @type Array"," */"," selectedDates : {"," readOnly: true,"," getter: function (val) {"," return (this._getSelectedDatesList());"," }"," },",""," /**"," * An object of the form {rules:Object, filterFunction:Function},"," * providing set of rules and a custom rendering function for "," * customizing specific calendar cells."," *"," * @attribute customRenderer"," * @readOnly"," * @type Object"," * @default {}"," */"," customRenderer : {"," lazyAdd: false,"," value: {},"," setter: function (val) {"," this._rules = val.rules;"," this._filterFunction = val.filterFunction;"," }"," }"," }"," ","});","","","}, '3.7.1', {\"requires\": [\"widget\", \"substitute\", \"datatype-date\", \"datatype-date-math\", \"cssgrids\"], \"lang\": [\"de\", \"en\", \"fr\", \"ja\", \"nb-NO\", \"pt-BR\", \"ru\", \"zh-HANT-TW\"], \"skinnable\": true});"];+_yuitest_coverage["build/calendar-base/calendar-base.js"].lines = {"1":0,"12":0,"55":0,"56":0,"61":0,"144":0,"145":0,"146":0,"147":0,"148":0,"150":0,"161":0,"162":0,"163":0,"164":0,"166":0,"167":0,"169":0,"170":0,"172":0,"183":0,"184":0,"185":0,"186":0,"187":0,"188":0,"189":0,"190":0,"191":0,"192":0,"205":0,"206":0,"207":0,"208":0,"209":0,"213":0,"226":0,"229":0,"230":0,"233":0,"251":0,"252":0,"255":0,"258":0,"259":0,"260":0,"261":0,"263":0,"264":0,"267":0,"282":0,"290":0,"291":0,"292":0,"293":0,"296":0,"297":0,"298":0,"299":0,"302":0,"303":0,"304":0,"305":0,"308":0,"309":0,"310":0,"311":0,"324":0,"339":0,"352":0,"355":0,"356":0,"358":0,"359":0,"362":0,"372":0,"373":0,"375":0,"376":0,"388":0,"389":0,"391":0,"392":0,"394":0,"395":0,"410":0,"412":0,"416":0,"417":0,"418":0,"421":0,"422":0,"426":0,"427":0,"428":0,"431":0,"433":0,"434":0,"446":0,"447":0,"459":0,"463":0,"464":0,"465":0,"466":0,"469":0,"473":0,"474":0,"475":0,"476":0,"478":0,"491":0,"494":0,"497":0,"498":0,"499":0,"511":0,"512":0,"523":0,"526":0,"527":0,"530":0,"541":0,"542":0,"543":0,"544":0,"561":0,"570":0,"572":0,"573":0,"574":0,"586":0,"588":0,"589":0,"592":0,"593":0,"594":0,"595":0,"596":0,"597":0,"598":0,"599":0,"600":0,"603":0,"604":0,"605":0,"608":0,"609":0,"610":0,"624":0,"626":0,"627":0,"628":0,"629":0,"630":0,"646":0,"653":0,"655":0,"656":0,"659":0,"661":0,"663":0,"664":0,"666":0,"667":0,"670":0,"672":0,"674":0,"675":0,"678":0,"680":0,"682":0,"683":0,"686":0,"688":0,"690":0,"691":0,"694":0,"696":0,"698":0,"699":0,"702":0,"704":0,"706":0,"720":0,"724":0,"728":0,"750":0,"751":0,"754":0,"770":0,"771":0,"772":0,"786":0,"790":0,"791":0,"794":0,"796":0,"798":0,"800":0,"817":0,"818":0,"820":0,"822":0,"834":0,"835":0,"836":0,"837":0,"838":0,"839":0,"851":0,"856":0,"858":0,"861":0,"862":0,"863":0,"865":0,"866":0,"869":0,"870":0,"883":0,"887":0,"889":0,"892":0,"893":0,"894":0,"896":0,"897":0,"900":0,"901":0,"912":0,"914":0,"917":0,"918":0,"922":0,"933":0,"936":0,"937":0,"941":0,"952":0,"953":0,"962":0,"963":0,"975":0,"981":0,"982":0,"984":0,"986":0,"987":0,"991":0,"992":0,"994":0,"995":0,"997":0,"1013":0,"1029":0,"1032":0,"1033":0,"1040":0,"1043":0,"1045":0,"1048":0,"1051":0,"1054":0,"1056":0,"1057":0,"1059":0,"1060":0,"1064":0,"1065":0,"1069":0,"1072":0,"1082":0,"1085":0,"1086":0,"1091":0,"1094":0,"1095":0,"1099":0,"1104":0,"1106":0,"1121":0,"1130":0,"1131":0,"1134":0,"1135":0,"1136":0,"1138":0,"1139":0,"1143":0,"1146":0,"1147":0,"1148":0,"1149":0,"1152":0,"1153":0,"1155":0,"1157":0,"1158":0,"1159":0,"1160":0,"1163":0,"1164":0,"1166":0,"1168":0,"1169":0,"1170":0,"1171":0,"1174":0,"1175":0,"1177":0,"1179":0,"1180":0,"1181":0,"1182":0,"1185":0,"1186":0,"1188":0,"1190":0,"1191":0,"1192":0,"1193":0,"1196":0,"1197":0,"1199":0,"1204":0,"1205":0,"1206":0,"1209":0,"1221":0,"1224":0,"1225":0,"1227":0,"1228":0,"1231":0,"1242":0,"1257":0,"1262":0,"1263":0,"1265":0,"1269":0,"1270":0,"1271":0,"1272":0,"1275":0,"1278":0,"1280":0,"1512":0,"1513":0,"1514":0,"1517":0,"1557":0,"1606":0,"1624":0,"1625":0};+_yuitest_coverage["build/calendar-base/calendar-base.js"].functions = {"CalendarBase:55":0,"initializer:143":0,"renderUI:159":0,"bindUI:182":0,"(anonymous 4):208":0,"(anonymous 3):207":0,"(anonymous 2):206":0,"_getSelectedDatesList:204":0,"_getSelectedDatesInMonth:225":0,"_isNumInList:250":0,"_getRulesForDate:281":0,"_matchesRule:338":0,"_canBeSelected:350":0,"selectDates:371":0,"deselectDates:387":0,"_addDateToSelection:408":0,"_addDatesToSelection:445":0,"_addDateRangeToSelection:457":0,"_removeDateFromSelection:490":0,"_removeDatesFromSelection:510":0,"_removeDateRangeFromSelection:522":0,"_clearSelection:540":0,"_fireSelectionChange:553":0,"_restoreModifiedCells:569":0,"(anonymous 5):595":0,"_renderCustomRules:584":0,"(anonymous 6):629":0,"_renderSelectedDates:623":0,"_dateToNode:645":0,"_nodeToDate:718":0,"_normalizeDate:749":0,"_getCutoffColumn:768":0,"_turnPrevMonthOn:784":0,"_turnPrevMonthOff:816":0,"_cleanUpNextMonthCells:833":0,"_turnNextMonthOn:850":0,"_turnNextMonthOff:882":0,"_afterShowNextMonthChange:910":0,"_afterShowPrevMonthChange:932":0,"_afterHeaderRendererChange:951":0,"_afterCustomRendererChange:961":0,"(anonymous 7):986":0,"_afterDateChange:973":0,"(anonymous 8):1085":0,"_initCalendarPane:1011":0,"_rerenderCalendarPane:1118":0,"_updateCalendarHeader:1220":0,"_initCalendarHeader:1241":0,"paneReplacer:1269":0,"_initCalendarHTML:1255":0,"setter:1511":0,"valueFn:1557":0,"getter:1605":0,"setter:1623":0,"(anonymous 1):1":0};+_yuitest_coverage["build/calendar-base/calendar-base.js"].coveredLines = 355;+_yuitest_coverage["build/calendar-base/calendar-base.js"].coveredFunctions = 55;+_yuitest_coverline("build/calendar-base/calendar-base.js", 1);+YUI.add('calendar-base', function (Y, NAME) {++/**+ * The CalendarBase submodule is a basic UI calendar view that displays+ * a range of dates in a two-dimensional month grid, with one or more+ * months visible at a single time. CalendarBase supports custom date+ * rendering, multiple calendar panes, and selection. + * @module calendar+ * @submodule calendar-base+ */+ +_yuitest_coverfunc("build/calendar-base/calendar-base.js", "(anonymous 1)", 1);+_yuitest_coverline("build/calendar-base/calendar-base.js", 12);+var getCN = Y.ClassNameManager.getClassName,+ CALENDAR = 'calendar',+ CAL_GRID = getCN(CALENDAR, 'grid'),+ CAL_LEFT_GRID = getCN(CALENDAR, 'left-grid'),+ CAL_RIGHT_GRID = getCN(CALENDAR, 'right-grid'),+ CAL_BODY = getCN(CALENDAR, 'body'),+ CAL_HD = getCN(CALENDAR, 'header'),+ CAL_HD_LABEL = getCN(CALENDAR, 'header-label'),+ CAL_WDAYROW = getCN(CALENDAR, 'weekdayrow'),+ CAL_WDAY = getCN(CALENDAR, 'weekday'),+ CAL_COL_HIDDEN = getCN(CALENDAR, 'column-hidden'),+ CAL_DAY_SELECTED = getCN(CALENDAR, 'day-selected'),+ SELECTION_DISABLED = getCN(CALENDAR, 'selection-disabled'),+ CAL_ROW = getCN(CALENDAR, 'row'),+ CAL_DAY = getCN(CALENDAR, 'day'),+ CAL_PREVMONTH_DAY = getCN(CALENDAR, 'prevmonth-day'),+ CAL_NEXTMONTH_DAY = getCN(CALENDAR, 'nextmonth-day'),+ CAL_ANCHOR = getCN(CALENDAR, 'anchor'),+ CAL_PANE = getCN(CALENDAR, 'pane'),+ CAL_STATUS = getCN(CALENDAR, 'status'),+ L = Y.Lang,+ node = Y.Node,+ create = node.create,+ substitute = Y.substitute,+ each = Y.each,+ hasVal = Y.Array.hasValue,+ iOf = Y.Array.indexOf,+ hasKey = Y.Object.hasKey,+ setVal = Y.Object.setValue,+ owns = Y.Object.owns,+ isEmpty = Y.Object.isEmpty,+ ydate = Y.DataType.Date;++/** Create a calendar view to represent a single or multiple+ * month range of dates, rendered as a grid with date and+ * weekday labels.+ * + * @class CalendarBase+ * @extends Widget+ * @param config {Object} Configuration object (see Configuration + * attributes)+ * @constructor+ */+_yuitest_coverline("build/calendar-base/calendar-base.js", 55);+function CalendarBase(config) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "CalendarBase", 55);+_yuitest_coverline("build/calendar-base/calendar-base.js", 56);+CalendarBase.superclass.constructor.apply ( this, arguments );+}++++_yuitest_coverline("build/calendar-base/calendar-base.js", 61);+Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {++ /**+ * A storage for various properties of individual month+ * panes.+ *+ * @property _paneProperties+ * @type Object+ * @private+ */+ _paneProperties : {},++ /**+ * The number of month panes in the calendar, deduced+ * from the CONTENT_TEMPLATE's number of {calendar_grid}+ * tokens.+ *+ * @property _paneNumber+ * @type Number+ * @private+ */+ _paneNumber : 1,++ /**+ * The unique id used to prefix various elements of this+ * calendar instance.+ *+ * @property _calendarId+ * @type String+ * @private+ */+ _calendarId : null,++ /**+ * The hash map of selected dates, populated with+ * selectDates() and deselectDates() methods + *+ * @property _selectedDates+ * @type Object+ * @private+ */+ _selectedDates : {},++ /**+ * A private copy of the rules object, populated+ * by setting the customRenderer attribute.+ *+ * @property _rules+ * @type Object+ * @private+ */+ _rules : {},++ /**+ * A private copy of the filterFunction, populated+ * by setting the customRenderer attribute.+ *+ * @property _filterFunction+ * @type Function+ * @private+ */+ _filterFunction : null,++ /**+ * Storage for calendar cells modified by any custom+ * formatting. The storage is cleared, used to restore+ * cells to the original state, and repopulated accordingly+ * when the calendar is rerendered. + *+ * @property _storedDateCells+ * @type Object+ * @private+ */+ _storedDateCells : {},++ /**+ * Designated initializer+ * Initializes instance-level properties of+ * calendar.+ *+ * @method initializer+ */ + initializer : function () {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "initializer", 143);+_yuitest_coverline("build/calendar-base/calendar-base.js", 144);+this._paneProperties = {};+ _yuitest_coverline("build/calendar-base/calendar-base.js", 145);+this._calendarId = Y.guid('calendar');+ _yuitest_coverline("build/calendar-base/calendar-base.js", 146);+this._selectedDates = {};+ _yuitest_coverline("build/calendar-base/calendar-base.js", 147);+if (isEmpty(this._rules)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 148);+this._rules = {}; + }+ _yuitest_coverline("build/calendar-base/calendar-base.js", 150);+this._storedDateCells = {};+ },++ /**+ * renderUI implementation+ *+ * Creates a visual representation of the calendar based on existing parameters. + * @method renderUI+ */ + renderUI : function () {++ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "renderUI", 159);+_yuitest_coverline("build/calendar-base/calendar-base.js", 161);+var contentBox = this.get('contentBox');+ _yuitest_coverline("build/calendar-base/calendar-base.js", 162);+contentBox.appendChild(this._initCalendarHTML(this.get('date')));+ _yuitest_coverline("build/calendar-base/calendar-base.js", 163);+if (this.get('showPrevMonth')) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 164);+this._afterShowPrevMonthChange();+ }+ _yuitest_coverline("build/calendar-base/calendar-base.js", 166);+if (this.get('showNextMonth')) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 167);+this._afterShowNextMonthChange();+ }+ _yuitest_coverline("build/calendar-base/calendar-base.js", 169);+this._renderCustomRules();+ _yuitest_coverline("build/calendar-base/calendar-base.js", 170);+this._renderSelectedDates();++ _yuitest_coverline("build/calendar-base/calendar-base.js", 172);+this.get("boundingBox").setAttribute("aria-labelledby", this._calendarId + "_header");++ },+ /**+ * bindUI implementation+ *+ * Assigns listeners to relevant events that change the state+ * of the calendar.+ * @method bindUI+ */ + bindUI : function () {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "bindUI", 182);+_yuitest_coverline("build/calendar-base/calendar-base.js", 183);+this.after('dateChange', this._afterDateChange);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 184);+this.after('showPrevMonthChange', this._afterShowPrevMonthChange);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 185);+this.after('showNextMonthChange', this._afterShowNextMonthChange);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 186);+this.after('headerRendererChange', this._afterHeaderRendererChange);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 187);+this.after('customRendererChange', this._afterCustomRendererChange);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 188);+this.after('enabledDatesRuleChange', this._afterCustomRendererChange);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 189);+this.after('disabledDatesRuleChange', this._afterCustomRendererChange);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 190);+this.after('focusedChange', this._afterFocusedChange);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 191);+this.after('selectionChange', this._renderSelectedDates);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 192);+this._bindCalendarEvents();+ },+++ /**+ * An internal utility method that generates a list of selected dates + * from the hash storage.+ *+ * @method _getSelectedDatesList+ * @protected+ * @return {Array} The array of `Date`s that are currently selected.+ */+ _getSelectedDatesList : function () {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_getSelectedDatesList", 204);+_yuitest_coverline("build/calendar-base/calendar-base.js", 205);+var output = [];+ _yuitest_coverline("build/calendar-base/calendar-base.js", 206);+each (this._selectedDates, function (year) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "(anonymous 2)", 206);+_yuitest_coverline("build/calendar-base/calendar-base.js", 207);+each (year, function (month) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "(anonymous 3)", 207);+_yuitest_coverline("build/calendar-base/calendar-base.js", 208);+each (month, function (day) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "(anonymous 4)", 208);+_yuitest_coverline("build/calendar-base/calendar-base.js", 209);+output.push (day);+ }, this);+ }, this);+ }, this);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 213);+return output;+ },++ /**+ * A utility method that returns all dates selected in a specific month.+ *+ * @method _getSelectedDatesInMonth+ * @param {Date} oDate corresponding to the month for which selected dates+ * are requested.+ * @protected+ * @return {Array} The array of `Date`s in a given month that are currently selected.+ */+ _getSelectedDatesInMonth : function (oDate) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_getSelectedDatesInMonth", 225);+_yuitest_coverline("build/calendar-base/calendar-base.js", 226);+var year = oDate.getFullYear(),+ month = oDate.getMonth();+ + _yuitest_coverline("build/calendar-base/calendar-base.js", 229);+if (hasKey(this._selectedDates, year) && hasKey(this._selectedDates[year], month)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 230);+return Y.Object.values(this._selectedDates[year][month]); + }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 233);+return [];+ }+ },+++ /**+ * An internal parsing method that receives a String list of numbers+ * and number ranges (of the form "1,2,3,4-6,7-9,10,11" etc.) and checks+ * whether a specific number is included in this list. Used for looking+ * up dates in the customRenderer rule set.+ *+ * @method _isNumInList+ * @param {Number} num The number to look for in a list.+ * @param {String} strList The list of numbers of the form "1,2,3,4-6,7-8,9", etc.+ * @private+ * @return {boolean} Returns true if the given number is in the given list.+ */+ _isNumInList : function (num, strList) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_isNumInList", 250);+_yuitest_coverline("build/calendar-base/calendar-base.js", 251);+if (strList == "all") {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 252);+return true;+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 255);+var elements = strList.split(","),+ i = elements.length;++ _yuitest_coverline("build/calendar-base/calendar-base.js", 258);+while (i--) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 259);+var range = elements[i].split("-");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 260);+if (range.length == 2 && num >= parseInt(range[0], 10) && num <= parseInt(range[1], 10)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 261);+return true;+ }+ else {_yuitest_coverline("build/calendar-base/calendar-base.js", 263);+if (range.length == 1 && (parseInt(elements[i], 10) == num)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 264);+return true;+ }}+ }+ _yuitest_coverline("build/calendar-base/calendar-base.js", 267);+return false; + }+ },++ /**+ * Given a specific date, returns an array of rules (from the customRenderer rule set)+ * that the given date matches.+ *+ * @method _getRulesForDate+ * @param {Date} oDate The date for which an array of rules is needed+ * @private+ * @return {Array} Returns an array of `String`s, each containg the name of+ * a rule that the given date matches.+ */+ _getRulesForDate : function (oDate) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_getRulesForDate", 281);+_yuitest_coverline("build/calendar-base/calendar-base.js", 282);+var year = oDate.getFullYear(),+ month = oDate.getMonth(),+ date = oDate.getDate(),+ wday = oDate.getDay(),+ rules = this._rules, + outputRules = [],+ years, months, dates, days;++ _yuitest_coverline("build/calendar-base/calendar-base.js", 290);+for (years in rules) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 291);+if (this._isNumInList(year, years)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 292);+if (L.isString(rules[years])) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 293);+outputRules.push(rules[years]);+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 296);+for (months in rules[years]) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 297);+if (this._isNumInList(month, months)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 298);+if (L.isString(rules[years][months])) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 299);+outputRules.push(rules[years][months]);+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 302);+for (dates in rules[years][months]) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 303);+if (this._isNumInList(date, dates)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 304);+if (L.isString(rules[years][months][dates])) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 305);+outputRules.push(rules[years][months][dates]);+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 308);+for (days in rules[years][months][dates]) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 309);+if (this._isNumInList(wday, days)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 310);+if (L.isString(rules[years][months][dates][days])) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 311);+outputRules.push(rules[years][months][dates][days]);+ }+ }+ }+ }+ }+ }+ }+ }+ } + }+ }+ }+ _yuitest_coverline("build/calendar-base/calendar-base.js", 324);+return outputRules;+ },++ /**+ * A utility method which, given a specific date and a name of the rule,+ * checks whether the date matches the given rule.+ *+ * @method _matchesRule+ * @param {Date} oDate The date to check+ * @param {String} rule The name of the rule that the date should match.+ * @private+ * @return {boolean} Returns true if the date matches the given rule.+ *+ */+ _matchesRule : function (oDate, rule) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_matchesRule", 338);+_yuitest_coverline("build/calendar-base/calendar-base.js", 339);+return (iOf(this._getRulesForDate(oDate), rule) >= 0);+ },++ /**+ * A utility method which checks whether a given date matches the `enabledDatesRule`+ * or does not match the `disabledDatesRule` and therefore whether it can be selected.+ * @method _canBeSelected+ * @param {Date} oDate The date to check+ * @private+ * @return {boolean} Returns true if the date can be selected; false otherwise.+ */+ _canBeSelected : function (oDate) {+ + _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_canBeSelected", 350);+_yuitest_coverline("build/calendar-base/calendar-base.js", 352);+var enabledDatesRule = this.get("enabledDatesRule"),+ disabledDatesRule = this.get("disabledDatesRule");++ _yuitest_coverline("build/calendar-base/calendar-base.js", 355);+if (enabledDatesRule) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 356);+return this._matchesRule(oDate, enabledDatesRule);+ }+ else {_yuitest_coverline("build/calendar-base/calendar-base.js", 358);+if (disabledDatesRule) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 359);+return !this._matchesRule(oDate, disabledDatesRule);+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 362);+return true;+ }}+ },++ /**+ * Selects a given date or array of dates.+ * @method selectDates+ * @param {Date|Array} dates A `Date` or `Array` of `Date`s.+ */+ selectDates : function (dates) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "selectDates", 371);+_yuitest_coverline("build/calendar-base/calendar-base.js", 372);+if (ydate.isValidDate(dates)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 373);+this._addDateToSelection(dates);+ }+ else {_yuitest_coverline("build/calendar-base/calendar-base.js", 375);+if (L.isArray(dates)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 376);+this._addDatesToSelection(dates);+ }}+ },++ /**+ * Deselects a given date or array of dates, or deselects+ * all dates if no argument is specified.+ * @method deselectDates+ * @param {Date|Array} [dates] A `Date` or `Array` of `Date`s, or no+ * argument if all dates should be deselected.+ */+ deselectDates : function (dates) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "deselectDates", 387);+_yuitest_coverline("build/calendar-base/calendar-base.js", 388);+if (!dates) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 389);+this._clearSelection();+ }+ else {_yuitest_coverline("build/calendar-base/calendar-base.js", 391);+if (ydate.isValidDate(dates)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 392);+this._removeDateFromSelection(dates);+ }+ else {_yuitest_coverline("build/calendar-base/calendar-base.js", 394);+if (L.isArray(dates)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 395);+this._removeDatesFromSelection(dates);+ }}}+ },++ /**+ * A utility method that adds a given date to selection..+ * @method _addDateToSelection+ * @param {Date} oDate The date to add to selection.+ * @param {Number} [index] An optional parameter that is used+ * to differentiate between individual date selections and multiple+ * date selections.+ * @private+ */+ _addDateToSelection : function (oDate, index) {++ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_addDateToSelection", 408);+_yuitest_coverline("build/calendar-base/calendar-base.js", 410);+if (this._canBeSelected(oDate)) {++ _yuitest_coverline("build/calendar-base/calendar-base.js", 412);+var year = oDate.getFullYear(),+ month = oDate.getMonth(),+ day = oDate.getDate();+ + _yuitest_coverline("build/calendar-base/calendar-base.js", 416);+if (hasKey(this._selectedDates, year)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 417);+if (hasKey(this._selectedDates[year], month)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 418);+this._selectedDates[year][month][day] = oDate;+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 421);+this._selectedDates[year][month] = {};+ _yuitest_coverline("build/calendar-base/calendar-base.js", 422);+this._selectedDates[year][month][day] = oDate;+ }+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 426);+this._selectedDates[year] = {};+ _yuitest_coverline("build/calendar-base/calendar-base.js", 427);+this._selectedDates[year][month] = {};+ _yuitest_coverline("build/calendar-base/calendar-base.js", 428);+this._selectedDates[year][month][day] = oDate;+ }++ _yuitest_coverline("build/calendar-base/calendar-base.js", 431);+this._selectedDates = setVal(this._selectedDates, [year, month, day], oDate);++ _yuitest_coverline("build/calendar-base/calendar-base.js", 433);+if (!index) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 434);+this._fireSelectionChange();+ }+ }+ },++ /**+ * A utility method that adds a given list of dates to selection.+ * @method _addDatesToSelection+ * @param {Array} datesArray The list of dates to add to selection.+ * @private+ */+ _addDatesToSelection : function (datesArray) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_addDatesToSelection", 445);+_yuitest_coverline("build/calendar-base/calendar-base.js", 446);+each(datesArray, this._addDateToSelection, this);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 447);+this._fireSelectionChange();+ },++ /**+ * A utility method that adds a given range of dates to selection.+ * @method _addDateRangeToSelection+ * @param {Date} startDate The first date of the given range.+ * @param {Date} endDate The last date of the given range.+ * @private+ */+ _addDateRangeToSelection : function (startDate, endDate) {++ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_addDateRangeToSelection", 457);+_yuitest_coverline("build/calendar-base/calendar-base.js", 459);+var timezoneDifference = (endDate.getTimezoneOffset() - startDate.getTimezoneOffset())*60000,+ startTime = startDate.getTime(),+ endTime = endDate.getTime();+ + _yuitest_coverline("build/calendar-base/calendar-base.js", 463);+if (startTime > endTime) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 464);+var tempTime = startTime;+ _yuitest_coverline("build/calendar-base/calendar-base.js", 465);+startTime = endTime;+ _yuitest_coverline("build/calendar-base/calendar-base.js", 466);+endTime = tempTime + timezoneDifference;+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 469);+endTime = endTime - timezoneDifference;+ }+++ _yuitest_coverline("build/calendar-base/calendar-base.js", 473);+for (var time = startTime; time <= endTime; time += 86400000) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 474);+var addedDate = new Date(time);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 475);+addedDate.setHours(12);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 476);+this._addDateToSelection(addedDate, time);+ }+ _yuitest_coverline("build/calendar-base/calendar-base.js", 478);+this._fireSelectionChange();+ },++ /**+ * A utility method that removes a given date from selection..+ * @method _removeDateFromSelection+ * @param {Date} oDate The date to remove from selection.+ * @param {Number} [index] An optional parameter that is used+ * to differentiate between individual date selections and multiple+ * date selections.+ * @private+ */+ _removeDateFromSelection : function (oDate, index) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_removeDateFromSelection", 490);+_yuitest_coverline("build/calendar-base/calendar-base.js", 491);+var year = oDate.getFullYear(),+ month = oDate.getMonth(),+ day = oDate.getDate();+ _yuitest_coverline("build/calendar-base/calendar-base.js", 494);+if (hasKey(this._selectedDates, year) && + hasKey(this._selectedDates[year], month) && + hasKey(this._selectedDates[year][month], day)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 497);+delete this._selectedDates[year][month][day];+ _yuitest_coverline("build/calendar-base/calendar-base.js", 498);+if (!index) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 499);+this._fireSelectionChange();+ }+ }+ },++ /**+ * A utility method that removes a given list of dates from selection.+ * @method _removeDatesFromSelection+ * @param {Array} datesArray The list of dates to remove from selection.+ * @private+ */+ _removeDatesFromSelection : function (datesArray) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_removeDatesFromSelection", 510);+_yuitest_coverline("build/calendar-base/calendar-base.js", 511);+each(datesArray, this._removeDateFromSelection, this);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 512);+this._fireSelectionChange();+ },++ /**+ * A utility method that removes a given range of dates from selection.+ * @method _removeDateRangeFromSelection+ * @param {Date} startDate The first date of the given range.+ * @param {Date} endDate The last date of the given range.+ * @private+ */+ _removeDateRangeFromSelection : function (startDate, endDate) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_removeDateRangeFromSelection", 522);+_yuitest_coverline("build/calendar-base/calendar-base.js", 523);+var startTime = startDate.getTime(),+ endTime = endDate.getTime();+ + _yuitest_coverline("build/calendar-base/calendar-base.js", 526);+for (var time = startTime; time <= endTime; time += 86400000) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 527);+this._removeDateFromSelection(new Date(time), time);+ }++ _yuitest_coverline("build/calendar-base/calendar-base.js", 530);+this._fireSelectionChange(); + },++ /**+ * A utility method that removes all dates from selection.+ * @method _clearSelection+ * @param {boolean} noevent A Boolean specifying whether a selectionChange+ * event should be fired. If true, the event is not fired.+ * @private+ */+ _clearSelection : function (noevent) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_clearSelection", 540);+_yuitest_coverline("build/calendar-base/calendar-base.js", 541);+this._selectedDates = {};+ _yuitest_coverline("build/calendar-base/calendar-base.js", 542);+this.get("contentBox").all("." + CAL_DAY_SELECTED).removeClass(CAL_DAY_SELECTED).setAttribute("aria-selected", false);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 543);+if (!noevent) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 544);+this._fireSelectionChange();+ }+ },++ /**+ * A utility method that fires a selectionChange event.+ * @method _fireSelectionChange+ * @private+ */+ _fireSelectionChange : function () {++ /**+ * Fired when the set of selected dates changes. Contains a payload with+ * a `newSelection` property with an array of selected dates.+ *+ * @event selectionChange+ */+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_fireSelectionChange", 553);+_yuitest_coverline("build/calendar-base/calendar-base.js", 561);+this.fire("selectionChange", {newSelection: this._getSelectedDatesList()});+ },++ /**+ * A utility method that restores cells modified by custom formatting.+ * @method _restoreModifiedCells+ * @private+ */+ _restoreModifiedCells : function () {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_restoreModifiedCells", 569);+_yuitest_coverline("build/calendar-base/calendar-base.js", 570);+var contentbox = this.get("contentBox"),+ id;+ _yuitest_coverline("build/calendar-base/calendar-base.js", 572);+for (id in this._storedDateCells) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 573);+contentbox.one("#" + id).replace(this._storedDateCells[id]);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 574);+delete this._storedDateCells[id];+ }+ },++ /**+ * A rendering assist method that renders all cells modified by the customRenderer+ * rules, as well as the enabledDatesRule and disabledDatesRule.+ * @method _renderCustomRules+ * @private+ */+ _renderCustomRules : function () {++ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_renderCustomRules", 584);+_yuitest_coverline("build/calendar-base/calendar-base.js", 586);+this.get("contentBox").all("." + CAL_DAY + ",." + CAL_NEXTMONTH_DAY).removeClass(SELECTION_DISABLED).setAttribute("aria-disabled", false);++ _yuitest_coverline("build/calendar-base/calendar-base.js", 588);+if (!isEmpty(this._rules)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 589);+var enRule = this.get("enabledDatesRule"),+ disRule = this.get("disabledDatesRule");++ _yuitest_coverline("build/calendar-base/calendar-base.js", 592);+for (var paneNum = 0; paneNum < this._paneNumber; paneNum++) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 593);+var paneDate = ydate.addMonths(this.get("date"), paneNum);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 594);+var dateArray = ydate.listOfDatesInMonth(paneDate);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 595);+each(dateArray, function (date) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "(anonymous 5)", 595);+_yuitest_coverline("build/calendar-base/calendar-base.js", 596);+var matchingRules = this._getRulesForDate(date);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 597);+if (matchingRules.length > 0) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 598);+var dateNode = this._dateToNode(date);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 599);+if ((enRule && iOf(matchingRules, enRule) < 0) || (!enRule && disRule && iOf(matchingRules, disRule) >= 0)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 600);+dateNode.addClass(SELECTION_DISABLED).setAttribute("aria-disabled", true);+ }+ + _yuitest_coverline("build/calendar-base/calendar-base.js", 603);+if (L.isFunction(this._filterFunction)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 604);+this._storedDateCells[dateNode.get("id")] = dateNode.cloneNode(true);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 605);+this._filterFunction (date, dateNode, matchingRules);+ }+ }+ else {_yuitest_coverline("build/calendar-base/calendar-base.js", 608);+if (enRule) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 609);+var dateNode = this._dateToNode(date);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 610);+dateNode.addClass(SELECTION_DISABLED).setAttribute("aria-disabled", true);+ }}+ },+ this);+ }+ } + },++ /**+ * A rendering assist method that renders all cells that are currently selected.+ * @method _renderSelectedDates+ * @private+ */+ _renderSelectedDates : function () {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_renderSelectedDates", 623);+_yuitest_coverline("build/calendar-base/calendar-base.js", 624);+this.get("contentBox").all("." + CAL_DAY_SELECTED).removeClass(CAL_DAY_SELECTED).setAttribute("aria-selected", false);+ + _yuitest_coverline("build/calendar-base/calendar-base.js", 626);+for (var paneNum = 0; paneNum < this._paneNumber; paneNum++) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 627);+var paneDate = ydate.addMonths(this.get("date"), paneNum);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 628);+var dateArray = this._getSelectedDatesInMonth(paneDate);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 629);+each(dateArray, function (date) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "(anonymous 6)", 629);+_yuitest_coverline("build/calendar-base/calendar-base.js", 630);+this._dateToNode(date).addClass(CAL_DAY_SELECTED).setAttribute("aria-selected", true);+ },+ this);+ }+ },++ /**+ * A utility method that converts a date to the node wrapping the calendar cell+ * the date corresponds to..+ * @method _dateToNode+ * @param {Date} oDate The date to convert to Node+ * @protected+ * @return {Node} The node wrapping the DOM element of the cell the date + * corresponds to.+ */+ _dateToNode : function (oDate) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_dateToNode", 645);+_yuitest_coverline("build/calendar-base/calendar-base.js", 646);+var day = oDate.getDate(),+ col = 0,+ daymod = day%7,+ paneNum = (12 + oDate.getMonth() - this.get("date").getMonth()) % 12,+ paneId = this._calendarId + "_pane_" + paneNum,+ cutoffCol = this._paneProperties[paneId].cutoffCol;++ _yuitest_coverline("build/calendar-base/calendar-base.js", 653);+switch (daymod) {+ case (0):+ _yuitest_coverline("build/calendar-base/calendar-base.js", 655);+if (cutoffCol >= 6) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 656);+col = 12;+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 659);+col = 5;+ }+ _yuitest_coverline("build/calendar-base/calendar-base.js", 661);+break;+ case (1):+ _yuitest_coverline("build/calendar-base/calendar-base.js", 663);+col = 6;+ _yuitest_coverline("build/calendar-base/calendar-base.js", 664);+break;+ case (2):+ _yuitest_coverline("build/calendar-base/calendar-base.js", 666);+if (cutoffCol > 0) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 667);+col = 7;+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 670);+col = 0;+ }+ _yuitest_coverline("build/calendar-base/calendar-base.js", 672);+break;+ case (3):+ _yuitest_coverline("build/calendar-base/calendar-base.js", 674);+if (cutoffCol > 1) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 675);+col = 8;+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 678);+col = 1;+ }+ _yuitest_coverline("build/calendar-base/calendar-base.js", 680);+break;+ case (4):+ _yuitest_coverline("build/calendar-base/calendar-base.js", 682);+if (cutoffCol > 2) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 683);+col = 9;+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 686);+col = 2;+ }+ _yuitest_coverline("build/calendar-base/calendar-base.js", 688);+break;+ case (5):+ _yuitest_coverline("build/calendar-base/calendar-base.js", 690);+if (cutoffCol > 3) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 691);+col = 10;+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 694);+col = 3;+ }+ _yuitest_coverline("build/calendar-base/calendar-base.js", 696);+break;+ case (6):+ _yuitest_coverline("build/calendar-base/calendar-base.js", 698);+if (cutoffCol > 4) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 699);+col = 11;+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 702);+col = 4;+ }+ _yuitest_coverline("build/calendar-base/calendar-base.js", 704);+break;+ }+ _yuitest_coverline("build/calendar-base/calendar-base.js", 706);+return(this.get("contentBox").one("#" + this._calendarId + "_pane_" + paneNum + "_" + col + "_" + day)); ++ },++ /**+ * A utility method that converts a node corresponding to the DOM element of+ * the cell for a particular date to that date.+ * @method _nodeToDate+ * @param {Node} oNode The Node wrapping the DOM element of a particular date cell.+ * @protected+ * @return {Date} The date corresponding to the DOM element that the given node wraps.+ */+ _nodeToDate : function (oNode) {+ + _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_nodeToDate", 718);+_yuitest_coverline("build/calendar-base/calendar-base.js", 720);+var idParts = oNode.get("id").split("_").reverse(),+ paneNum = parseInt(idParts[2], 10),+ day = parseInt(idParts[0], 10);++ _yuitest_coverline("build/calendar-base/calendar-base.js", 724);+var shiftedDate = ydate.addMonths(this.get("date"), paneNum),+ year = shiftedDate.getFullYear(),+ month = shiftedDate.getMonth();++ _yuitest_coverline("build/calendar-base/calendar-base.js", 728);+return new Date(year, month, day, 12, 0, 0, 0);+ },++ /**+ * A placeholder method, called from bindUI, to bind the Calendar events.+ * @method _bindCalendarEvents+ * @protected+ */+ _bindCalendarEvents : function () {+ + },++ /**+ * A utility method that normalizes a given date by converting it to the 1st+ * day of the month the date is in, with the time set to noon.+ * @method _normalizeDate+ * @param {Date} oDate The date to normalize+ * @protected+ * @return {Date} The normalized date, set to the first of the month, with time+ * set to noon.+ */+ _normalizeDate : function (date) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_normalizeDate", 749);+_yuitest_coverline("build/calendar-base/calendar-base.js", 750);+if (date) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 751);+return new Date(date.getFullYear(), date.getMonth(), 1, 12, 0, 0, 0);+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 754);+return null;+ } + },+++ /**+ * A render assist utility method that computes the cutoff column for the calendar + * rendering mask.+ * @method _getCutoffColumn+ * @param {Date} date The date of the month grid to compute the cutoff column for.+ * @param {Number} firstday The first day of the week (modified by internationalized calendars)+ * @private+ * @return {Number} The number of the cutoff column.+ */+ _getCutoffColumn : function (date, firstday) {++ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_getCutoffColumn", 768);+_yuitest_coverline("build/calendar-base/calendar-base.js", 770);+var distance = this._normalizeDate(date).getDay() - firstday;+ _yuitest_coverline("build/calendar-base/calendar-base.js", 771);+var cutOffColumn = 6 - (distance + 7)%7;+ _yuitest_coverline("build/calendar-base/calendar-base.js", 772);+return cutOffColumn;++ },++ /**+ * A render assist method that turns on the view of the previous month's dates + * in a given calendar pane.+ * @method _turnPrevMonthOn+ * @param {Node} pane The calendar pane that needs its previous month's dates view+ * modified.+ * @protected+ */+ _turnPrevMonthOn : function (pane) {+ + _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_turnPrevMonthOn", 784);+_yuitest_coverline("build/calendar-base/calendar-base.js", 786);+var pane_id = pane.get("id"),+ pane_date = this._paneProperties[pane_id].paneDate,+ daysInPrevMonth = ydate.daysInMonth(ydate.addMonths(pane_date, -1));++ _yuitest_coverline("build/calendar-base/calendar-base.js", 790);+if (!this._paneProperties[pane_id].hasOwnProperty("daysInPrevMonth")) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 791);+this._paneProperties[pane_id].daysInPrevMonth = 0;+ }++ _yuitest_coverline("build/calendar-base/calendar-base.js", 794);+if (daysInPrevMonth != this._paneProperties[pane_id].daysInPrevMonth) {+ + _yuitest_coverline("build/calendar-base/calendar-base.js", 796);+this._paneProperties[pane_id].daysInPrevMonth = daysInPrevMonth;++ _yuitest_coverline("build/calendar-base/calendar-base.js", 798);+for (var cell = 5; cell >= 0; cell--) + {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 800);+pane.one("#" + pane_id + "_" + cell + "_" + (cell-5)).set('text', daysInPrevMonth--);+ }++ }+++ },++ /**+ * A render assist method that turns off the view of the previous month's dates + * in a given calendar pane.+ * @method _turnPrevMonthOff+ * @param {Node} pane The calendar pane that needs its previous month's dates view+ * modified.+ * @protected+ */+ _turnPrevMonthOff : function (pane) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_turnPrevMonthOff", 816);+_yuitest_coverline("build/calendar-base/calendar-base.js", 817);+var pane_id = pane.get("id");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 818);+this._paneProperties[pane_id].daysInPrevMonth = 0;++ _yuitest_coverline("build/calendar-base/calendar-base.js", 820);+for (var cell = 5; cell >= 0; cell--) + {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 822);+pane.one("#" + pane_id + "_" + cell + "_" + (cell-5)).setContent(" ");+ } + },++ /**+ * A render assist method that cleans up the last few cells in the month grid+ * when the number of days in the month changes.+ * @method _cleanUpNextMonthCells+ * @param {Node} pane The calendar pane that needs the last date cells cleaned up.+ * @private+ */+ _cleanUpNextMonthCells : function (pane) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_cleanUpNextMonthCells", 833);+_yuitest_coverline("build/calendar-base/calendar-base.js", 834);+var pane_id = pane.get("id");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 835);+pane.one("#" + pane_id + "_6_29").removeClass(CAL_NEXTMONTH_DAY);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 836);+pane.one("#" + pane_id + "_7_30").removeClass(CAL_NEXTMONTH_DAY);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 837);+pane.one("#" + pane_id + "_8_31").removeClass(CAL_NEXTMONTH_DAY);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 838);+pane.one("#" + pane_id + "_0_30").removeClass(CAL_NEXTMONTH_DAY);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 839);+pane.one("#" + pane_id + "_1_31").removeClass(CAL_NEXTMONTH_DAY); + },++ /**+ * A render assist method that turns on the view of the next month's dates + * in a given calendar pane.+ * @method _turnNextMonthOn+ * @param {Node} pane The calendar pane that needs its next month's dates view+ * modified.+ * @protected+ */+ _turnNextMonthOn : function (pane) { + _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_turnNextMonthOn", 850);+_yuitest_coverline("build/calendar-base/calendar-base.js", 851);+var dayCounter = 1,+ pane_id = pane.get("id"),+ daysInMonth = this._paneProperties[pane_id].daysInMonth,+ cutoffCol = this._paneProperties[pane_id].cutoffCol;++ _yuitest_coverline("build/calendar-base/calendar-base.js", 856);+for (var cell = daysInMonth - 22; cell < cutoffCol + 7; cell++) + {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 858);+pane.one("#" + pane_id + "_" + cell + "_" + (cell+23)).set("text", dayCounter++).addClass(CAL_NEXTMONTH_DAY);+ }++ _yuitest_coverline("build/calendar-base/calendar-base.js", 861);+var startingCell = cutoffCol;+ _yuitest_coverline("build/calendar-base/calendar-base.js", 862);+if (daysInMonth == 31 && (cutoffCol <= 1)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 863);+startingCell = 2;+ }+ else {_yuitest_coverline("build/calendar-base/calendar-base.js", 865);+if (daysInMonth == 30 && cutoffCol === 0) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 866);+startingCell = 1;+ }}+ + _yuitest_coverline("build/calendar-base/calendar-base.js", 869);+for (var cell = startingCell ; cell < cutoffCol + 7; cell++) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 870);+pane.one("#" + pane_id + "_" + cell + "_" + (cell+30)).set("text", dayCounter++).addClass(CAL_NEXTMONTH_DAY); + }+ },++ /**+ * A render assist method that turns off the view of the next month's dates + * in a given calendar pane.+ * @method _turnNextMonthOff+ * @param {Node} pane The calendar pane that needs its next month's dates view+ * modified.+ * @protected+ */+ _turnNextMonthOff : function (pane) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_turnNextMonthOff", 882);+_yuitest_coverline("build/calendar-base/calendar-base.js", 883);+var pane_id = pane.get("id"),+ daysInMonth = this._paneProperties[pane_id].daysInMonth,+ cutoffCol = this._paneProperties[pane_id].cutoffCol;++ _yuitest_coverline("build/calendar-base/calendar-base.js", 887);+for (var cell = daysInMonth - 22; cell <= 12; cell++) + {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 889);+pane.one("#" + pane_id + "_" + cell + "_" + (cell+23)).setContent(" ").addClass(CAL_NEXTMONTH_DAY);+ }++ _yuitest_coverline("build/calendar-base/calendar-base.js", 892);+var startingCell = 0;+ _yuitest_coverline("build/calendar-base/calendar-base.js", 893);+if (daysInMonth == 31 && (cutoffCol <= 1)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 894);+startingCell = 2;+ }+ else {_yuitest_coverline("build/calendar-base/calendar-base.js", 896);+if (daysInMonth == 30 && cutoffCol === 0) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 897);+startingCell = 1;+ }}+ + _yuitest_coverline("build/calendar-base/calendar-base.js", 900);+for (var cell = startingCell ; cell <= 12; cell++) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 901);+pane.one("#" + pane_id + "_" + cell + "_" + (cell+30)).setContent(" ").addClass(CAL_NEXTMONTH_DAY); + } + },++ /**+ * The handler for the change in the showNextMonth attribute.+ * @method _afterShowNextMonthChange+ * @private+ */+ _afterShowNextMonthChange : function () {+ + _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_afterShowNextMonthChange", 910);+_yuitest_coverline("build/calendar-base/calendar-base.js", 912);+var contentBox = this.get('contentBox'),+ lastPane = contentBox.one("#" + this._calendarId + "_pane_" + (this._paneNumber - 1));+ _yuitest_coverline("build/calendar-base/calendar-base.js", 914);+this._cleanUpNextMonthCells(lastPane); +++ _yuitest_coverline("build/calendar-base/calendar-base.js", 917);+if (this.get('showNextMonth')) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 918);+this._turnNextMonthOn(lastPane);+ }++ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 922);+this._turnNextMonthOff(lastPane);+ }++ },++ /**+ * The handler for the change in the showPrevMonth attribute.+ * @method _afterShowPrevMonthChange+ * @private+ */+ _afterShowPrevMonthChange : function () {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_afterShowPrevMonthChange", 932);+_yuitest_coverline("build/calendar-base/calendar-base.js", 933);+var contentBox = this.get('contentBox'),+ firstPane = contentBox.one("#" + this._calendarId + "_pane_" + 0);++ _yuitest_coverline("build/calendar-base/calendar-base.js", 936);+if (this.get('showPrevMonth')) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 937);+this._turnPrevMonthOn(firstPane);+ }++ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 941);+this._turnPrevMonthOff(firstPane);+ }+ + },+ + /**+ * The handler for the change in the headerRenderer attribute.+ * @method _afterHeaderRendererChange+ * @private+ */ + _afterHeaderRendererChange : function () {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_afterHeaderRendererChange", 951);+_yuitest_coverline("build/calendar-base/calendar-base.js", 952);+var headerCell = this.get("contentBox").one("." + CAL_HD_LABEL);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 953);+headerCell.setContent(this._updateCalendarHeader(this.get('date')));+ },++ /**+ * The handler for the change in the customRenderer attribute.+ * @method _afterCustomRendererChange+ * @private+ */ + _afterCustomRendererChange : function () {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_afterCustomRendererChange", 961);+_yuitest_coverline("build/calendar-base/calendar-base.js", 962);+this._restoreModifiedCells();+ _yuitest_coverline("build/calendar-base/calendar-base.js", 963);+this._renderCustomRules();+ },++ /**+ * The handler for the change in the date attribute. Modifies the calendar+ * view by shifting the calendar grid mask and running custom rendering and+ * selection rendering as necessary.+ * @method _afterDateChange+ * @private+ */ + _afterDateChange : function () {+ + _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_afterDateChange", 973);+_yuitest_coverline("build/calendar-base/calendar-base.js", 975);+var contentBox = this.get('contentBox'),+ headerCell = contentBox.one("." + CAL_HD).one("." + CAL_HD_LABEL),+ calendarPanes = contentBox.all("." + CAL_GRID),+ currentDate = this.get("date"),+ counter = 0;++ _yuitest_coverline("build/calendar-base/calendar-base.js", 981);+contentBox.setStyle("visibility", "hidden");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 982);+headerCell.setContent(this._updateCalendarHeader(currentDate));+ + _yuitest_coverline("build/calendar-base/calendar-base.js", 984);+this._restoreModifiedCells();++ _yuitest_coverline("build/calendar-base/calendar-base.js", 986);+calendarPanes.each(function (curNode) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "(anonymous 7)", 986);+_yuitest_coverline("build/calendar-base/calendar-base.js", 987);+this._rerenderCalendarPane(ydate.addMonths(currentDate, counter++), + curNode);+ }, this);++ _yuitest_coverline("build/calendar-base/calendar-base.js", 991);+this._afterShowPrevMonthChange();+ _yuitest_coverline("build/calendar-base/calendar-base.js", 992);+this._afterShowNextMonthChange();++ _yuitest_coverline("build/calendar-base/calendar-base.js", 994);+this._renderCustomRules();+ _yuitest_coverline("build/calendar-base/calendar-base.js", 995);+this._renderSelectedDates();+ + _yuitest_coverline("build/calendar-base/calendar-base.js", 997);+contentBox.setStyle("visibility", "visible");+ },+++ /**+ * A rendering assist method that initializes the HTML for a single+ * calendar pane.+ * @method _initCalendarPane+ * @param {Date} baseDate The date corresponding to the month of the given+ * calendar pane.+ * @param {String} pane_id The id of the pane, to be used as a prefix for+ * element ids in the given pane.+ * @private+ */ + _initCalendarPane : function (baseDate, pane_id) {+ // Initialize final output HTML string+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_initCalendarPane", 1011);+_yuitest_coverline("build/calendar-base/calendar-base.js", 1013);+var calString = '',+ // Get a list of short weekdays from the internationalization package, or else use default English ones.+ weekdays = this.get('strings.very_short_weekdays') || ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],+ fullweekdays = this.get('strings.weekdays') || ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],+ // Get the first day of the week from the internationalization package, or else use Sunday as default.+ firstday = this.get('strings.first_weekday') || 0,+ // Compute the cutoff column of the masked calendar table, based on the start date and the first day of week.+ cutoffCol = this._getCutoffColumn(baseDate, firstday),+ // Compute the number of days in the month based on starting date+ daysInMonth = ydate.daysInMonth(baseDate),+ // Initialize the array of individual row HTML strings+ row_array = ['','','','','',''],+ // Initialize the partial templates object+ partials = {};+ + // Initialize the partial template for the weekday row cells.+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1029);+partials["weekday_row"] = '';+ + // Populate the partial template for the weekday row cells with weekday names+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1032);+for (var day = firstday; day <= firstday + 6; day++) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1033);+partials["weekday_row"] += + substitute(CalendarBase.WEEKDAY_TEMPLATE,+ {weekdayname: weekdays[day%7],+ full_weekdayname: fullweekdays[day%7]});+ }+ + // Populate the partial template for the weekday row container with the weekday row cells+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1040);+partials["weekday_row_template"] = substitute(CalendarBase.WEEKDAY_ROW_TEMPLATE, partials);++ // Populate the array of individual row HTML strings+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1043);+for (var row = 0; row <= 5; row++) {+ + _yuitest_coverline("build/calendar-base/calendar-base.js", 1045);+for (var column = 0; column <= 12; column++) { + + // Compute the value of the date that needs to populate the cell+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1048);+var date = 7*row - 5 + column;++ // Compose the value of the unique id of the current calendar cell+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1051);+var id_date = pane_id + "_" + column + "_" + date;++ // Set the calendar day class to one of three possible values+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1054);+var calendar_day_class = CAL_DAY;++ _yuitest_coverline("build/calendar-base/calendar-base.js", 1056);+if (date < 1) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1057);+calendar_day_class = CAL_PREVMONTH_DAY;+ }+ else {_yuitest_coverline("build/calendar-base/calendar-base.js", 1059);+if (date > daysInMonth) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1060);+calendar_day_class = CAL_NEXTMONTH_DAY;+ }}++ // Cut off dates that fall before the first and after the last date of the month+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1064);+if (date < 1 || date > daysInMonth) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1065);+date = " ";+ }+ + // Decide on whether a column in the masked table is visible or not based on the value of the cutoff column.+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1069);+var column_visibility = (column >= cutoffCol && column < (cutoffCol + 7)) ? '' : CAL_COL_HIDDEN;++ // Substitute the values into the partial calendar day template and add it to the current row HTML string+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1072);+row_array[row] += substitute (CalendarBase.CALDAY_TEMPLATE, + {day_content: date,+ calendar_col_class: "calendar_col" + column,+ calendar_col_visibility_class: column_visibility,+ calendar_day_class: calendar_day_class,+ calendar_day_id: id_date});+ }+ }+ + // Instantiate the partial calendar pane body template+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1082);+partials["body_template"] = '';+ + // Populate the body template with the rows templates+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1085);+each (row_array, function (v) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "(anonymous 8)", 1085);+_yuitest_coverline("build/calendar-base/calendar-base.js", 1086);+partials["body_template"] += substitute(CalendarBase.CALDAY_ROW_TEMPLATE, + {calday_row: v});+ });++ // Populate the calendar grid id+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1091);+partials["calendar_pane_id"] = pane_id;++ // Populate the calendar pane tabindex+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1094);+partials["calendar_pane_tabindex"] = this.get("tabIndex");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1095);+partials["pane_arialabel"] = ydate.format(baseDate, {format:"%B %Y"});+++ // Generate final output by substituting class names.+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1099);+var output = substitute(substitute (CalendarBase.CALENDAR_GRID_TEMPLATE, partials),+ CalendarBase.CALENDAR_STRINGS);++ // Store the initialized pane information++ _yuitest_coverline("build/calendar-base/calendar-base.js", 1104);+this._paneProperties[pane_id] = {cutoffCol: cutoffCol, daysInMonth: daysInMonth, paneDate: baseDate};++ _yuitest_coverline("build/calendar-base/calendar-base.js", 1106);+return output;+ },++ /**+ * A rendering assist method that rerenders a specified calendar pane, based+ * on a new Date. + * @method _rerenderCalendarPane+ * @param {Date} newDate The date corresponding to the month of the given+ * calendar pane.+ * @param {Node} pane The node corresponding to the calendar pane to be rerenders.+ * @private+ */ + _rerenderCalendarPane : function (newDate, pane) {++ // Get the first day of the week from the internationalization package, or else use Sunday as default.+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_rerenderCalendarPane", 1118);+_yuitest_coverline("build/calendar-base/calendar-base.js", 1121);+var firstday = this.get('strings.first_weekday') || 0,+ // Compute the cutoff column of the masked calendar table, based on the start date and the first day of week.+ cutoffCol = this._getCutoffColumn(newDate, firstday),+ // Compute the number of days in the month based on starting date+ daysInMonth = ydate.daysInMonth(newDate),+ // Get pane id for easier reference+ paneId = pane.get("id");+ + // Hide the pane before making DOM changes to speed them up+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1130);+pane.setStyle("visibility", "hidden");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1131);+pane.setAttribute("aria-label", ydate.format(newDate, {format:"%B %Y"}));+ + // Go through all columns, and flip their visibility setting based on whether they are within the unmasked range.+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1134);+for (var column = 0; column <= 12; column++) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1135);+var currentColumn = pane.all("." + "calendar_col" + column);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1136);+currentColumn.removeClass(CAL_COL_HIDDEN);+ + _yuitest_coverline("build/calendar-base/calendar-base.js", 1138);+if (column < cutoffCol || column >= (cutoffCol + 7)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1139);+currentColumn.addClass(CAL_COL_HIDDEN);+ }+ else {+ // Clean up dates in visible columns to account for the correct number of days in a month+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1143);+switch(column)+ {+ case 0:+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1146);+var curCell = pane.one("#" + paneId + "_0_30");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1147);+if (daysInMonth >= 30) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1148);+curCell.set("text", "30");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1149);+curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1152);+curCell.setContent(" ");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1153);+curCell.addClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);+ }+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1155);+break;+ case 1:+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1157);+var curCell = pane.one("#" + paneId + "_1_31");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1158);+if (daysInMonth >= 31) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1159);+curCell.set("text", "31");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1160);+curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1163);+curCell.setContent(" ");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1164);+curCell.removeClass(CAL_DAY).addClass(CAL_NEXTMONTH_DAY);+ }+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1166);+break;+ case 6:+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1168);+var curCell = pane.one("#" + paneId + "_6_29");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1169);+if (daysInMonth >= 29) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1170);+curCell.set("text", "29");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1171);+curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1174);+curCell.setContent(" ");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1175);+curCell.removeClass(CAL_DAY).addClass(CAL_NEXTMONTH_DAY);+ }+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1177);+break;+ case 7:+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1179);+var curCell = pane.one("#" + paneId + "_7_30");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1180);+if (daysInMonth >= 30) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1181);+curCell.set("text", "30");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1182);+curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1185);+curCell.setContent(" ");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1186);+curCell.removeClass(CAL_DAY).addClass(CAL_NEXTMONTH_DAY);+ }+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1188);+break;+ case 8:+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1190);+var curCell = pane.one("#" + paneId + "_8_31");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1191);+if (daysInMonth >= 31) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1192);+curCell.set("text", "31");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1193);+curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1196);+curCell.setContent(" ");+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1197);+curCell.removeClass(CAL_DAY).addClass(CAL_NEXTMONTH_DAY);+ }+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1199);+break;+ } + }+ }+ // Update stored pane properties+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1204);+this._paneProperties[paneId].cutoffCol = cutoffCol;+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1205);+this._paneProperties[paneId].daysInMonth = daysInMonth;+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1206);+this._paneProperties[paneId].paneDate = newDate;+ + // Bring the pane visibility back after all DOM changes are done + _yuitest_coverline("build/calendar-base/calendar-base.js", 1209);+pane.setStyle("visibility", "visible");++ },++ /**+ * A rendering assist method that updates the calendar header based+ * on a given date and potentially the provided headerRenderer.+ * @method _updateCalendarHeader+ * @param {Date} baseDate The date with which to update the calendar header.+ * @private+ */ + _updateCalendarHeader : function (baseDate) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_updateCalendarHeader", 1220);+_yuitest_coverline("build/calendar-base/calendar-base.js", 1221);+var headerString = "",+ headerRenderer = this.get("headerRenderer");+ + _yuitest_coverline("build/calendar-base/calendar-base.js", 1224);+if (Y.Lang.isString(headerRenderer)) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1225);+headerString = ydate.format(baseDate, {format:headerRenderer});+ }+ else {_yuitest_coverline("build/calendar-base/calendar-base.js", 1227);+if (headerRenderer instanceof Function) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1228);+headerString = headerRenderer.call(this, baseDate);+ }}+ + _yuitest_coverline("build/calendar-base/calendar-base.js", 1231);+return headerString; + },++ /**+ * A rendering assist method that initializes the calendar header HTML + * based on a given date and potentially the provided headerRenderer.+ * @method _updateCalendarHeader+ * @param {Date} baseDate The date with which to initialize the calendar header.+ * @private+ */ + _initCalendarHeader : function (baseDate) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_initCalendarHeader", 1241);+_yuitest_coverline("build/calendar-base/calendar-base.js", 1242);+return substitute(substitute(CalendarBase.HEADER_TEMPLATE, + {calheader: this._updateCalendarHeader(baseDate),+ calendar_id: this._calendarId}), + CalendarBase.CALENDAR_STRINGS);+ },++ /**+ * A rendering assist method that initializes the calendar HTML + * based on a given date.+ * @method _initCalendarHTML+ * @param {Date} baseDate The date with which to initialize the calendar.+ * @private+ */ + _initCalendarHTML : function (baseDate) {+ // Instantiate the partials holder+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "_initCalendarHTML", 1255);+_yuitest_coverline("build/calendar-base/calendar-base.js", 1257);+var partials = {},+ // Counter for iterative template replacement.+ counter = 0;+ + // Generate the template for the header + _yuitest_coverline("build/calendar-base/calendar-base.js", 1262);+partials["header_template"] = this._initCalendarHeader(baseDate);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1263);+partials["calendar_id"] = this._calendarId;++ _yuitest_coverline("build/calendar-base/calendar-base.js", 1265);+partials["body_template"] = substitute(substitute (CalendarBase.CONTENT_TEMPLATE, partials),+ CalendarBase.CALENDAR_STRINGS);+ + // Instantiate the iterative template replacer function + _yuitest_coverline("build/calendar-base/calendar-base.js", 1269);+function paneReplacer () {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "paneReplacer", 1269);+_yuitest_coverline("build/calendar-base/calendar-base.js", 1270);+var singlePane = this._initCalendarPane(ydate.addMonths(baseDate, counter), partials["calendar_id"]+"_pane_"+counter);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1271);+counter++;+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1272);+return singlePane;+ }+ // Go through all occurrences of the calendar_grid_template token and replace it with an appropriate calendar grid.+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1275);+var output = partials["body_template"].replace(/\{calendar_grid_template\}/g, Y.bind(paneReplacer, this));++ // Update the paneNumber count+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1278);+this._paneNumber = counter;++ _yuitest_coverline("build/calendar-base/calendar-base.js", 1280);+return output;+ }+}, {+ + /**+ * The CSS classnames for the calendar templates.+ * @property CALENDAR_STRINGS+ * @type Object+ * @readOnly+ * @protected+ * @static+ */ + CALENDAR_STRINGS: {+ calendar_grid_class : CAL_GRID,+ calendar_body_class : CAL_BODY,+ calendar_hd_class : CAL_HD,+ calendar_hd_label_class : CAL_HD_LABEL,+ calendar_weekdayrow_class : CAL_WDAYROW,+ calendar_weekday_class : CAL_WDAY,+ calendar_row_class : CAL_ROW,+ calendar_day_class : CAL_DAY,+ calendar_dayanchor_class : CAL_ANCHOR,+ calendar_pane_class : CAL_PANE,+ calendar_right_grid_class : CAL_RIGHT_GRID,+ calendar_left_grid_class : CAL_LEFT_GRID,+ calendar_status_class : CAL_STATUS+ },++ /*++ ARIA_STATUS_TEMPLATE: '<div role="status" aria-atomic="true" class="{calendar_status_class}"></div>',++ AriaStatus : null,++ updateStatus : function (statusString) {++ if (!CalendarBase.AriaStatus) {+ CalendarBase.AriaStatus = create(+ substitute (CalendarBase.ARIA_STATUS_TEMPLATE, + CalendarBase.CALENDAR_STRINGS));+ Y.one("body").append(CalendarBase.AriaStatus);+ }++ CalendarBase.AriaStatus.set("text", statusString);+ },++ */++ /**+ * The main content template for calendar.+ * @property CONTENT_TEMPLATE+ * @type String+ * @protected+ * @static+ */ + CONTENT_TEMPLATE: '<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">' + + '{header_template}' ++ '<div class="yui3-u-1">' ++ '{calendar_grid_template}' ++ '</div>' ++ '</div>',++ /**+ * A single pane template for calendar (same as default CONTENT_TEMPLATE)+ * @property ONE_PANE_TEMPLATE+ * @type String+ * @protected+ * @readOnly+ * @static+ */ + ONE_PANE_TEMPLATE: '<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">' + + '{header_template}' ++ '<div class="yui3-u-1">' ++ '{calendar_grid_template}' ++ '</div>' ++ '</div>',++ /**+ * A two pane template for calendar.+ * @property TWO_PANE_TEMPLATE+ * @type String+ * @protected+ * @readOnly+ * @static+ */ + TWO_PANE_TEMPLATE: '<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">' + + '{header_template}' ++ '<div class="yui3-u-1-2">'++ '<div class = "{calendar_left_grid_class}">' + + '{calendar_grid_template}' ++ '</div>' ++ '</div>' ++ '<div class="yui3-u-1-2">' ++ '<div class = "{calendar_right_grid_class}">' ++ '{calendar_grid_template}' ++ '</div>' ++ '</div>' + + '</div>',+ /**+ * A three pane template for calendar.+ * @property THREE_PANE_TEMPLATE+ * @type String+ * @protected+ * @readOnly+ * @static+ */ + THREE_PANE_TEMPLATE: '<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">' + + '{header_template}' ++ '<div class="yui3-u-1-3">' ++ '<div class = "{calendar_left_grid_class}">' ++ '{calendar_grid_template}' ++ '</div>' + + '</div>' ++ '<div class="yui3-u-1-3">' ++ '{calendar_grid_template}' ++ '</div>' + + '<div class="yui3-u-1-3">' ++ '<div class = "{calendar_right_grid_class}">' ++ '{calendar_grid_template}' ++ '</div>' + + '</div>' + + '</div>',+ /**+ * A template for the calendar grid.+ * @property CALENDAR_GRID_TEMPLATE+ * @type String+ * @protected+ * @static+ */ + CALENDAR_GRID_TEMPLATE: '<table class="{calendar_grid_class}" id="{calendar_pane_id}" role="grid" aria-readonly="true" aria-label="{pane_arialabel}" tabindex="{calendar_pane_tabindex}">' + + '<thead>' ++ '{weekday_row_template}' ++ '</thead>' ++ '<tbody>' + + '{body_template}' ++ '</tbody>' ++ '</table>',++ /**+ * A template for the calendar header.+ * @property HEADER_TEMPLATE+ * @type String+ * @protected+ * @static+ */ + HEADER_TEMPLATE: '<div class="yui3-g {calendar_hd_class}">' + + '<div class="yui3-u {calendar_hd_label_class}" id="{calendar_id}_header" aria-role="heading">' + + '{calheader}' ++ '</div>' ++ '</div>',++ /**+ * A template for the row of weekday names.+ * @property WEEKDAY_ROW_TEMPLATE+ * @type String+ * @protected+ * @static+ */ + WEEKDAY_ROW_TEMPLATE: '<tr class="{calendar_weekdayrow_class}" role="row">' + + '{weekday_row}' ++ '</tr>',++ /**+ * A template for a single row of calendar days.+ * @property CALDAY_ROW_TEMPLATE+ * @type String+ * @protected+ * @static+ */ + CALDAY_ROW_TEMPLATE: '<tr class="{calendar_row_class}" role="row">' + + '{calday_row}' + + '</tr>',++ /**+ * A template for a single cell with a weekday name.+ * @property CALDAY_ROW_TEMPLATE+ * @type String+ * @protected+ * @static+ */ + WEEKDAY_TEMPLATE: '<th class="{calendar_weekday_class}" role="columnheader" aria-label="{full_weekdayname}">{weekdayname}</th>',++ /**+ * A template for a single cell with a calendar day.+ * @property CALDAY_TEMPLATE+ * @type String+ * @protected+ * @static+ */ + CALDAY_TEMPLATE: '<td class="{calendar_col_class} {calendar_day_class} {calendar_col_visibility_class}" id="{calendar_day_id}" role="gridcell" tabindex="-1">' ++ '{day_content}' + + '</td>',++ /**+ * The identity of the widget.+ *+ * @property NAME+ * @type String+ * @default 'calendarBase'+ * @readOnly+ * @protected+ * @static+ */ + NAME: 'calendarBase',++ /**+ * Static property used to define the default attribute configuration of+ * the Widget.+ *+ * @property ATTRS+ * @type {Object}+ * @protected+ * @static+ */ + ATTRS: {+ tabIndex: {+ value: 1+ },+ /**+ * The date corresponding to the current calendar view. Always+ * normalized to the first of the month that contains the date+ * at assignment time. Used as the first date visible in the+ * calendar.+ *+ * @attribute date+ * @type Date+ * @default The first of the month containing today's date, as+ * set on the end user's system.+ */+ date: {+ value: new Date(),+ setter: function (val) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "setter", 1511);+_yuitest_coverline("build/calendar-base/calendar-base.js", 1512);+var newDate = this._normalizeDate(val);+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1513);+if (ydate.areEqual(newDate, this.get('date'))) {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1514);+return this.get('date');+ }+ else {+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1517);+return newDate;+ }+ }+ },++ /**+ * A setting specifying whether to shows days from the previous+ * month in the visible month's grid, if there are empty preceding+ * cells available.+ *+ * @attribute showPrevMonth+ * @type boolean+ * @default false+ */+ showPrevMonth: {+ value: false+ },++ /**+ * A setting specifying whether to shows days from the next+ * month in the visible month's grid, if there are empty+ * cells available at the end.+ *+ * @attribute showNextMonth+ * @type boolean+ * @default false+ */+ showNextMonth: {+ value: false+ },++ /**+ * Strings and properties derived from the internationalization packages+ * for the calendar.+ *+ * @attribute strings+ * @type Object+ * @protected+ */+ strings : {+ valueFn: function() { _yuitest_coverfunc("build/calendar-base/calendar-base.js", "valueFn", 1557);+_yuitest_coverline("build/calendar-base/calendar-base.js", 1557);+return Y.Intl.get("calendar-base"); }+ },++ /**+ * Custom header renderer for the calendar.+ *+ * @attribute headerRenderer+ * @type String | Function+ */+ headerRenderer: {+ value: "%B %Y"+ },++ /**+ * The name of the rule which all enabled dates should match.+ * Either disabledDatesRule or enabledDatesRule should be specified,+ * or neither, but not both.+ *+ * @attribute enabledDatesRule+ * @type String+ * @default null+ */+ enabledDatesRule: {+ value: null+ },++ /**+ * The name of the rule which all disabled dates should match.+ * Either disabledDatesRule or enabledDatesRule should be specified,+ * or neither, but not both.+ *+ * @attribute disabledDatesRule+ * @type String+ * @default null+ */+ disabledDatesRule: {+ value: null+ },++ /**+ * A read-only attribute providing a list of currently selected dates.+ *+ * @attribute selectedDates+ * @readOnly+ * @type Array+ */+ selectedDates : {+ readOnly: true,+ getter: function (val) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "getter", 1605);+_yuitest_coverline("build/calendar-base/calendar-base.js", 1606);+return (this._getSelectedDatesList());+ }+ },++ /**+ * An object of the form {rules:Object, filterFunction:Function},+ * providing set of rules and a custom rendering function for + * customizing specific calendar cells.+ *+ * @attribute customRenderer+ * @readOnly+ * @type Object+ * @default {}+ */+ customRenderer : {+ lazyAdd: false,+ value: {},+ setter: function (val) {+ _yuitest_coverfunc("build/calendar-base/calendar-base.js", "setter", 1623);+_yuitest_coverline("build/calendar-base/calendar-base.js", 1624);+this._rules = val.rules;+ _yuitest_coverline("build/calendar-base/calendar-base.js", 1625);+this._filterFunction = val.filterFunction;+ }+ }+ }+ +});+++}, '3.7.1', {"requires": ["widget", "substitute", "datatype-date", "datatype-date-math", "cssgrids"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('calendar-base', function(Y) {+YUI.add('calendar-base', function (Y, NAME) { /** * The CalendarBase submodule is a basic UI calendar view that displays@@ -150,7 +150,9 @@ this._paneProperties = {}; this._calendarId = Y.guid('calendar'); this._selectedDates = {};- this._rules = {};+ if (isEmpty(this._rules)) {+ this._rules = {}; + } this._storedDateCells = {}; }, @@ -192,26 +194,11 @@ this.after('enabledDatesRuleChange', this._afterCustomRendererChange); this.after('disabledDatesRuleChange', this._afterCustomRendererChange); this.after('focusedChange', this._afterFocusedChange);+ this.after('selectionChange', this._renderSelectedDates); this._bindCalendarEvents(); }, - /**- * syncUI implementation- *- * Update the scroll position, based on the current value of scrollY- * @method syncUI- */ - syncUI : function () {- if (this.get('showPrevMonth')) {- this._afterShowPrevMonthChange(); - }-- if (this.get('showNextMonth')) {- this._afterShowNextMonthChange();- }- },- /** * An internal utility method that generates a list of selected dates * from the hash storage.@@ -253,58 +240,8 @@ } }, - /**- * An internal rendering method that modifies a date cell to have the- * selected CSS class if the date cell is visible.- *- * @method _renderSelectedDate- * @param {Date} oDate The date corresponding to a specific date cell.- * @private- */- _renderSelectedDate : function (oDate) {- if (this._isDateVisible(oDate)) {- this._dateToNode(oDate).addClass(CAL_DAY_SELECTED).setAttribute("aria-selected", true);- }- }, /**- * An internal rendering method that modifies a date cell to remove the- * selected CSS class if the date cell is visible.- *- * @method _renderUnelectedDate- * @param {Date} oDate The date corresponding to a specific date cell.- * @private- */- _renderUnselectedDate : function (oDate) {- if (this._isDateVisible(oDate)) {- this._dateToNode(oDate).removeClass(CAL_DAY_SELECTED).setAttribute("aria-selected", false);- }- },-- /**- * An internal utility method that checks whether a particular date- * is in the current view of the calendar.- *- * @method _isDateVisible- * @param {Date} oDate The date corresponding to a specific date cell.- * @private- * @return {boolean} Returns true if the given date is in the current - * view of the calendar.- */- _isDateVisible : function (oDate) {- var minDate = this.get("date"),- maxDate = ydate.addMonths(minDate, this._paneNumber - 1),- oDateTime = this._normalizeDate(oDate).getTime();- - if (minDate.getTime() <= oDateTime && oDateTime <= maxDate) {- return true;- }- else {- return false;- }- },-- /** * An internal parsing method that receives a String list of numbers * and number ranges (of the form "1,2,3,4-6,7-9,10,11" etc.) and checks * whether a specific number is included in this list. Used for looking@@ -498,7 +435,6 @@ } this._selectedDates = setVal(this._selectedDates, [year, month, day], oDate);- this._renderSelectedDate(oDate); if (!index) { this._fireSelectionChange();@@ -525,6 +461,7 @@ * @private */ _addDateRangeToSelection : function (startDate, endDate) {+ var timezoneDifference = (endDate.getTimezoneOffset() - startDate.getTimezoneOffset())*60000, startTime = startDate.getTime(), endTime = endDate.getTime();@@ -564,7 +501,6 @@ hasKey(this._selectedDates[year], month) && hasKey(this._selectedDates[year][month], day)) { delete this._selectedDates[year][month][day];- this._renderUnselectedDate(oDate); if (!index) { this._fireSelectionChange(); }@@ -578,7 +514,7 @@ * @private */ _removeDatesFromSelection : function (datesArray) {- each(datesArray, this._removeDateDromSelection);+ each(datesArray, this._removeDateFromSelection, this); this._fireSelectionChange(); }, @@ -604,7 +540,7 @@ * A utility method that removes all dates from selection. * @method _clearSelection * @param {boolean} noevent A Boolean specifying whether a selectionChange- * event should be fired.+ * event should be fired. If true, the event is not fired. * @private */ _clearSelection : function (noevent) {@@ -654,7 +590,7 @@ _renderCustomRules : function () { this.get("contentBox").all("." + CAL_DAY + ",." + CAL_NEXTMONTH_DAY).removeClass(SELECTION_DISABLED).setAttribute("aria-disabled", false);- + if (!isEmpty(this._rules)) { var enRule = this.get("enabledDatesRule"), disRule = this.get("disabledDatesRule");@@ -697,7 +633,7 @@ var paneDate = ydate.addMonths(this.get("date"), paneNum); var dateArray = this._getSelectedDatesInMonth(paneDate); each(dateArray, function (date) {- this._dateToNode(date).addClass(CAL_DAY_SELECTED).setAttribute("ari-selected", true);+ this._dateToNode(date).addClass(CAL_DAY_SELECTED).setAttribute("aria-selected", true); }, this); }@@ -1688,6 +1624,7 @@ * @default {} */ customRenderer : {+ lazyAdd: false, value: {}, setter: function (val) { this._rules = val.rules;@@ -1699,4 +1636,4 @@ }); -}, '3.5.1' ,{requires:['widget', 'substitute', 'datatype-date', 'datatype-date-math', 'cssgrids'], lang:['de', 'en', 'fr', 'ja', 'nb-NO', 'pt-BR', 'ru', 'zh-HANT-TW']});+}, '3.7.1', {"requires": ["widget", "substitute", "datatype-date", "datatype-date-math", "cssgrids"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});
@@ -1,9 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("calendar-base",function(c){var E=c.ClassNameManager.getClassName,r="calendar",k=E(r,"grid"),d=E(r,"left-grid"),y=E(r,"right-grid"),A=E(r,"body"),q=E(r,"header"),n=E(r,"header-label"),s=E(r,"weekdayrow"),C=E(r,"weekday"),w=E(r,"column-hidden"),e=E(r,"day-selected"),h=E(r,"selection-disabled"),l=E(r,"row"),D=E(r,"day"),b=E(r,"prevmonth-day"),t=E(r,"nextmonth-day"),z=E(r,"anchor"),H=E(r,"pane"),g=E(r,"status"),j=c.Lang,u=c.Node,m=u.create,v=c.substitute,f=c.each,G=c.Array.hasValue,x=c.Array.indexOf,F=c.Object.hasKey,a=c.Object.setValue,i=c.Object.owns,p=c.Object.isEmpty,o=c.DataType.Date;function B(I){B.superclass.constructor.apply(this,arguments);}c.CalendarBase=c.extend(B,c.Widget,{_paneProperties:{},_paneNumber:1,_calendarId:null,_selectedDates:{},_rules:{},_filterFunction:null,_storedDateCells:{},initializer:function(){this._paneProperties={};this._calendarId=c.guid("calendar");this._selectedDates={};this._rules={};this._storedDateCells={};},renderUI:function(){var I=this.get("contentBox");I.appendChild(this._initCalendarHTML(this.get("date")));if(this.get("showPrevMonth")){this._afterShowPrevMonthChange();}if(this.get("showNextMonth")){this._afterShowNextMonthChange();}this._renderCustomRules();this._renderSelectedDates();this.get("boundingBox").setAttribute("aria-labelledby",this._calendarId+"_header");},bindUI:function(){this.after("dateChange",this._afterDateChange);this.after("showPrevMonthChange",this._afterShowPrevMonthChange);this.after("showNextMonthChange",this._afterShowNextMonthChange);this.after("headerRendererChange",this._afterHeaderRendererChange);this.after("customRendererChange",this._afterCustomRendererChange);this.after("enabledDatesRuleChange",this._afterCustomRendererChange);this.after("disabledDatesRuleChange",this._afterCustomRendererChange);this.after("focusedChange",this._afterFocusedChange);this._bindCalendarEvents();},syncUI:function(){if(this.get("showPrevMonth")){this._afterShowPrevMonthChange();}if(this.get("showNextMonth")){this._afterShowNextMonthChange();}},_getSelectedDatesList:function(){var I=[];f(this._selectedDates,function(J){f(J,function(K){f(K,function(L){I.push(L);},this);},this);},this);return I;},_getSelectedDatesInMonth:function(J){var I=J.getFullYear(),K=J.getMonth();if(F(this._selectedDates,I)&&F(this._selectedDates[I],K)){return c.Object.values(this._selectedDates[I][K]);}else{return[];}},_renderSelectedDate:function(I){if(this._isDateVisible(I)){this._dateToNode(I).addClass(e).setAttribute("aria-selected",true);}},_renderUnselectedDate:function(I){if(this._isDateVisible(I)){this._dateToNode(I).removeClass(e).setAttribute("aria-selected",false);}},_isDateVisible:function(I){var J=this.get("date"),K=o.addMonths(J,this._paneNumber-1),L=this._normalizeDate(I).getTime();if(J.getTime()<=L&&L<=K){return true;}else{return false;}},_isNumInList:function(J,M){if(M=="all"){return true;}else{var L=M.split(","),K=L.length;while(K--){var I=L[K].split("-");if(I.length==2&&J>=parseInt(I[0],10)&&J<=parseInt(I[1],10)){return true;}else{if(I.length==1&&(parseInt(L[K],10)==J)){return true;}}}return false;}},_getRulesForDate:function(S){var O=S.getFullYear(),M=S.getMonth(),K=S.getDate(),N=S.getDay(),R=this._rules,P=[],L,J,I,Q;for(L in R){if(this._isNumInList(O,L)){if(j.isString(R[L])){P.push(R[L]);}else{for(J in R[L]){if(this._isNumInList(M,J)){if(j.isString(R[L][J])){P.push(R[L][J]);}else{for(I in R[L][J]){if(this._isNumInList(K,I)){if(j.isString(R[L][J][I])){P.push(R[L][J][I]);}else{for(Q in R[L][J][I]){if(this._isNumInList(N,Q)){if(j.isString(R[L][J][I][Q])){P.push(R[L][J][I][Q]);}}}}}}}}}}}}return P;},_matchesRule:function(I,J){return(x(this._getRulesForDate(I),J)>=0);},_canBeSelected:function(K){var I=this.get("enabledDatesRule"),J=this.get("disabledDatesRule");if(I){return this._matchesRule(K,I);}else{if(J){return !this._matchesRule(K,J);}else{return true;}}},selectDates:function(I){if(o.isValidDate(I)){this._addDateToSelection(I);}else{if(j.isArray(I)){this._addDatesToSelection(I);}}},deselectDates:function(I){if(!I){this._clearSelection();}else{if(o.isValidDate(I)){this._removeDateFromSelection(I);}else{if(j.isArray(I)){this._removeDatesFromSelection(I);}}}},_addDateToSelection:function(L,J){if(this._canBeSelected(L)){var K=L.getFullYear(),M=L.getMonth(),I=L.getDate();if(F(this._selectedDates,K)){if(F(this._selectedDates[K],M)){this._selectedDates[K][M][I]=L;}else{this._selectedDates[K][M]={};this._selectedDates[K][M][I]=L;}}else{this._selectedDates[K]={};this._selectedDates[K][M]={};this._selectedDates[K][M][I]=L;}this._selectedDates=a(this._selectedDates,[K,M,I],L);this._renderSelectedDate(L);if(!J){this._fireSelectionChange();}}},_addDatesToSelection:function(I){f(I,this._addDateToSelection,this);this._fireSelectionChange();},_addDateRangeToSelection:function(I,N){var J=(N.getTimezoneOffset()-I.getTimezoneOffset())*60000,L=I.getTime(),K=N.getTime();if(L>K){var P=L;L=K;K=P+J;}else{K=K-J;}for(var M=L;M<=K;M+=86400000){var O=new Date(M);O.setHours(12);this._addDateToSelection(O,M);}this._fireSelectionChange();},_removeDateFromSelection:function(L,J){var K=L.getFullYear(),M=L.getMonth(),I=L.getDate();if(F(this._selectedDates,K)&&F(this._selectedDates[K],M)&&F(this._selectedDates[K][M],I)){delete this._selectedDates[K][M][I];this._renderUnselectedDate(L);if(!J){this._fireSelectionChange();}}},_removeDatesFromSelection:function(I){f(I,this._removeDateDromSelection);this._fireSelectionChange();},_removeDateRangeFromSelection:function(I,M){var K=I.getTime(),J=M.getTime();for(var L=K;L<=J;L+=86400000){this._removeDateFromSelection(new Date(L),L);}this._fireSelectionChange();},_clearSelection:function(I){this._selectedDates={};this.get("contentBox").all("."+e).removeClass(e).setAttribute("aria-selected",false);if(!I){this._fireSelectionChange();}},_fireSelectionChange:function(){this.fire("selectionChange",{newSelection:this._getSelectedDatesList()});},_restoreModifiedCells:function(){var I=this.get("contentBox"),J;for(J in this._storedDateCells){I.one("#"+J).replace(this._storedDateCells[J]);-delete this._storedDateCells[J];}},_renderCustomRules:function(){this.get("contentBox").all("."+D+",."+t).removeClass(h).setAttribute("aria-disabled",false);if(!p(this._rules)){var L=this.get("enabledDatesRule"),K=this.get("disabledDatesRule");for(var J=0;J<this._paneNumber;J++){var I=o.addMonths(this.get("date"),J);var M=o.listOfDatesInMonth(I);f(M,function(N){var P=this._getRulesForDate(N);if(P.length>0){var O=this._dateToNode(N);if((L&&x(P,L)<0)||(!L&&K&&x(P,K)>=0)){O.addClass(h).setAttribute("aria-disabled",true);}if(j.isFunction(this._filterFunction)){this._storedDateCells[O.get("id")]=O.cloneNode(true);this._filterFunction(N,O,P);}}else{if(L){var O=this._dateToNode(N);O.addClass(h).setAttribute("aria-disabled",true);}}},this);}}},_renderSelectedDates:function(){this.get("contentBox").all("."+e).removeClass(e).setAttribute("aria-selected",false);for(var J=0;J<this._paneNumber;J++){var I=o.addMonths(this.get("date"),J);var K=this._getSelectedDatesInMonth(I);f(K,function(L){this._dateToNode(L).addClass(e).setAttribute("ari-selected",true);},this);}},_dateToNode:function(O){var I=O.getDate(),K=0,L=I%7,M=(12+O.getMonth()-this.get("date").getMonth())%12,J=this._calendarId+"_pane_"+M,N=this._paneProperties[J].cutoffCol;switch(L){case (0):if(N>=6){K=12;}else{K=5;}break;case (1):K=6;break;case (2):if(N>0){K=7;}else{K=0;}break;case (3):if(N>1){K=8;}else{K=1;}break;case (4):if(N>2){K=9;}else{K=2;}break;case (5):if(N>3){K=10;}else{K=3;}break;case (6):if(N>4){K=11;}else{K=4;}break;}return(this.get("contentBox").one("#"+this._calendarId+"_pane_"+M+"_"+K+"_"+I));},_nodeToDate:function(O){var J=O.get("id").split("_").reverse(),L=parseInt(J[2],10),I=parseInt(J[0],10);var N=o.addMonths(this.get("date"),L),K=N.getFullYear(),M=N.getMonth();return new Date(K,M,I,12,0,0,0);},_bindCalendarEvents:function(){},_normalizeDate:function(I){if(I){return new Date(I.getFullYear(),I.getMonth(),1,12,0,0,0);}else{return null;}},_getCutoffColumn:function(J,K){var L=this._normalizeDate(J).getDay()-K;var I=6-(L+7)%7;return I;},_turnPrevMonthOn:function(M){var L=M.get("id"),J=this._paneProperties[L].paneDate,K=o.daysInMonth(o.addMonths(J,-1));if(!this._paneProperties[L].hasOwnProperty("daysInPrevMonth")){this._paneProperties[L].daysInPrevMonth=0;}if(K!=this._paneProperties[L].daysInPrevMonth){this._paneProperties[L].daysInPrevMonth=K;for(var I=5;I>=0;I--){M.one("#"+L+"_"+I+"_"+(I-5)).set("text",K--);}}},_turnPrevMonthOff:function(K){var J=K.get("id");this._paneProperties[J].daysInPrevMonth=0;for(var I=5;I>=0;I--){K.one("#"+J+"_"+I+"_"+(I-5)).setContent(" ");}},_cleanUpNextMonthCells:function(J){var I=J.get("id");J.one("#"+I+"_6_29").removeClass(t);J.one("#"+I+"_7_30").removeClass(t);J.one("#"+I+"_8_31").removeClass(t);J.one("#"+I+"_0_30").removeClass(t);J.one("#"+I+"_1_31").removeClass(t);},_turnNextMonthOn:function(O){var J=1,N=O.get("id"),K=this._paneProperties[N].daysInMonth,M=this._paneProperties[N].cutoffCol;for(var I=K-22;I<M+7;I++){O.one("#"+N+"_"+I+"_"+(I+23)).set("text",J++).addClass(t);}var L=M;if(K==31&&(M<=1)){L=2;}else{if(K==30&&M===0){L=1;}}for(var I=L;I<M+7;I++){O.one("#"+N+"_"+I+"_"+(I+30)).set("text",J++).addClass(t);}},_turnNextMonthOff:function(N){var M=N.get("id"),J=this._paneProperties[M].daysInMonth,L=this._paneProperties[M].cutoffCol;for(var I=J-22;I<=12;I++){N.one("#"+M+"_"+I+"_"+(I+23)).setContent(" ").addClass(t);}var K=0;if(J==31&&(L<=1)){K=2;}else{if(J==30&&L===0){K=1;}}for(var I=K;I<=12;I++){N.one("#"+M+"_"+I+"_"+(I+30)).setContent(" ").addClass(t);}},_afterShowNextMonthChange:function(){var I=this.get("contentBox"),J=I.one("#"+this._calendarId+"_pane_"+(this._paneNumber-1));this._cleanUpNextMonthCells(J);if(this.get("showNextMonth")){this._turnNextMonthOn(J);}else{this._turnNextMonthOff(J);}},_afterShowPrevMonthChange:function(){var J=this.get("contentBox"),I=J.one("#"+this._calendarId+"_pane_"+0);if(this.get("showPrevMonth")){this._turnPrevMonthOn(I);}else{this._turnPrevMonthOff(I);}},_afterHeaderRendererChange:function(){var I=this.get("contentBox").one("."+n);I.setContent(this._updateCalendarHeader(this.get("date")));},_afterCustomRendererChange:function(){this._restoreModifiedCells();this._renderCustomRules();},_afterDateChange:function(){var K=this.get("contentBox"),M=K.one("."+q).one("."+n),L=K.all("."+k),J=this.get("date"),I=0;K.setStyle("visibility","hidden");M.setContent(this._updateCalendarHeader(J));this._restoreModifiedCells();L.each(function(N){this._rerenderCalendarPane(o.addMonths(J,I++),N);},this);this._afterShowPrevMonthChange();this._afterShowNextMonthChange();this._renderCustomRules();this._renderSelectedDates();K.setStyle("visibility","visible");},_initCalendarPane:function(O,V){var I="",K=this.get("strings.very_short_weekdays")||["Su","Mo","Tu","We","Th","Fr","Sa"],L=this.get("strings.weekdays")||["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],N=this.get("strings.first_weekday")||0,Y=this._getCutoffColumn(O,N),J=o.daysInMonth(O),U=["","","","","",""],R={};R["weekday_row"]="";for(var X=N;X<=N+6;X++){R["weekday_row"]+=v(B.WEEKDAY_TEMPLATE,{weekdayname:K[X%7],full_weekdayname:L[X%7]});}R["weekday_row_template"]=v(B.WEEKDAY_ROW_TEMPLATE,R);for(var P=0;P<=5;P++){for(var M=0;M<=12;M++){var Z=7*P-5+M;var T=V+"_"+M+"_"+Z;var W=D;if(Z<1){W=b;}else{if(Z>J){W=t;}}if(Z<1||Z>J){Z=" ";}var Q=(M>=Y&&M<(Y+7))?"":w;U[P]+=v(B.CALDAY_TEMPLATE,{day_content:Z,calendar_col_class:"calendar_col"+M,calendar_col_visibility_class:Q,calendar_day_class:W,calendar_day_id:T});}}R["body_template"]="";f(U,function(aa){R["body_template"]+=v(B.CALDAY_ROW_TEMPLATE,{calday_row:aa});});R["calendar_pane_id"]=V;R["calendar_pane_tabindex"]=this.get("tabIndex");R["pane_arialabel"]=o.format(O,{format:"%B %Y"});var S=v(v(B.CALENDAR_GRID_TEMPLATE,R),B.CALENDAR_STRINGS);this._paneProperties[V]={cutoffCol:Y,daysInMonth:J,paneDate:O};return S;},_rerenderCalendarPane:function(P,K){var I=this.get("strings.first_weekday")||0,O=this._getCutoffColumn(P,I),J=o.daysInMonth(P),M=K.get("id");-K.setStyle("visibility","hidden");K.setAttribute("aria-label",o.format(P,{format:"%B %Y"}));for(var L=0;L<=12;L++){var N=K.all("."+"calendar_col"+L);N.removeClass(w);if(L<O||L>=(O+7)){N.addClass(w);}else{switch(L){case 0:var Q=K.one("#"+M+"_0_30");if(J>=30){Q.set("text","30");Q.removeClass(t).addClass(D);}else{Q.setContent(" ");Q.addClass(t).addClass(D);}break;case 1:var Q=K.one("#"+M+"_1_31");if(J>=31){Q.set("text","31");Q.removeClass(t).addClass(D);}else{Q.setContent(" ");Q.removeClass(D).addClass(t);}break;case 6:var Q=K.one("#"+M+"_6_29");if(J>=29){Q.set("text","29");Q.removeClass(t).addClass(D);}else{Q.setContent(" ");Q.removeClass(D).addClass(t);}break;case 7:var Q=K.one("#"+M+"_7_30");if(J>=30){Q.set("text","30");Q.removeClass(t).addClass(D);}else{Q.setContent(" ");Q.removeClass(D).addClass(t);}break;case 8:var Q=K.one("#"+M+"_8_31");if(J>=31){Q.set("text","31");Q.removeClass(t).addClass(D);}else{Q.setContent(" ");Q.removeClass(D).addClass(t);}break;}}}this._paneProperties[M].cutoffCol=O;this._paneProperties[M].daysInMonth=J;this._paneProperties[M].paneDate=P;K.setStyle("visibility","visible");},_updateCalendarHeader:function(K){var J="",I=this.get("headerRenderer");if(c.Lang.isString(I)){J=o.format(K,{format:I});}else{if(I instanceof Function){J=I.call(this,K);}}return J;},_initCalendarHeader:function(I){return v(v(B.HEADER_TEMPLATE,{calheader:this._updateCalendarHeader(I),calendar_id:this._calendarId}),B.CALENDAR_STRINGS);},_initCalendarHTML:function(L){var K={},I=0;K["header_template"]=this._initCalendarHeader(L);K["calendar_id"]=this._calendarId;K["body_template"]=v(v(B.CONTENT_TEMPLATE,K),B.CALENDAR_STRINGS);function M(){var N=this._initCalendarPane(o.addMonths(L,I),K["calendar_id"]+"_pane_"+I);I++;return N;}var J=K["body_template"].replace(/\{calendar_grid_template\}/g,c.bind(M,this));this._paneNumber=I;return J;}},{CALENDAR_STRINGS:{calendar_grid_class:k,calendar_body_class:A,calendar_hd_class:q,calendar_hd_label_class:n,calendar_weekdayrow_class:s,calendar_weekday_class:C,calendar_row_class:l,calendar_day_class:D,calendar_dayanchor_class:z,calendar_pane_class:H,calendar_right_grid_class:y,calendar_left_grid_class:d,calendar_status_class:g},CONTENT_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">'+"{header_template}"+'<div class="yui3-u-1">'+"{calendar_grid_template}"+"</div>"+"</div>",ONE_PANE_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">'+"{header_template}"+'<div class="yui3-u-1">'+"{calendar_grid_template}"+"</div>"+"</div>",TWO_PANE_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">'+"{header_template}"+'<div class="yui3-u-1-2">'+'<div class = "{calendar_left_grid_class}">'+"{calendar_grid_template}"+"</div>"+"</div>"+'<div class="yui3-u-1-2">'+'<div class = "{calendar_right_grid_class}">'+"{calendar_grid_template}"+"</div>"+"</div>"+"</div>",THREE_PANE_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">'+"{header_template}"+'<div class="yui3-u-1-3">'+'<div class = "{calendar_left_grid_class}">'+"{calendar_grid_template}"+"</div>"+"</div>"+'<div class="yui3-u-1-3">'+"{calendar_grid_template}"+"</div>"+'<div class="yui3-u-1-3">'+'<div class = "{calendar_right_grid_class}">'+"{calendar_grid_template}"+"</div>"+"</div>"+"</div>",CALENDAR_GRID_TEMPLATE:'<table class="{calendar_grid_class}" id="{calendar_pane_id}" role="grid" aria-readonly="true" aria-label="{pane_arialabel}" tabindex="{calendar_pane_tabindex}">'+"<thead>"+"{weekday_row_template}"+"</thead>"+"<tbody>"+"{body_template}"+"</tbody>"+"</table>",HEADER_TEMPLATE:'<div class="yui3-g {calendar_hd_class}">'+'<div class="yui3-u {calendar_hd_label_class}" id="{calendar_id}_header" aria-role="heading">'+"{calheader}"+"</div>"+"</div>",WEEKDAY_ROW_TEMPLATE:'<tr class="{calendar_weekdayrow_class}" role="row">'+"{weekday_row}"+"</tr>",CALDAY_ROW_TEMPLATE:'<tr class="{calendar_row_class}" role="row">'+"{calday_row}"+"</tr>",WEEKDAY_TEMPLATE:'<th class="{calendar_weekday_class}" role="columnheader" aria-label="{full_weekdayname}">{weekdayname}</th>',CALDAY_TEMPLATE:'<td class="{calendar_col_class} {calendar_day_class} {calendar_col_visibility_class}" id="{calendar_day_id}" role="gridcell" tabindex="-1">'+"{day_content}"+"</td>",NAME:"calendarBase",ATTRS:{tabIndex:{value:1},date:{value:new Date(),setter:function(J){var I=this._normalizeDate(J);if(o.areEqual(I,this.get("date"))){return this.get("date");}else{return I;}}},showPrevMonth:{value:false},showNextMonth:{value:false},strings:{valueFn:function(){return c.Intl.get("calendar-base");}},headerRenderer:{value:"%B %Y"},enabledDatesRule:{value:null},disabledDatesRule:{value:null},selectedDates:{readOnly:true,getter:function(I){return(this._getSelectedDatesList());}},customRenderer:{value:{},setter:function(I){this._rules=I.rules;this._filterFunction=I.filterFunction;}}}});},"3.5.1",{requires:["widget","substitute","datatype-date","datatype-date-math","cssgrids"],lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"]});+YUI.add("calendar-base",function(e,t){function P(e){P.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r="calendar",i=n(r,"grid"),s=n(r,"left-grid"),o=n(r,"right-grid"),u=n(r,"body"),a=n(r,"header"),f=n(r,"header-label"),l=n(r,"weekdayrow"),c=n(r,"weekday"),h=n(r,"column-hidden"),p=n(r,"day-selected"),d=n(r,"selection-disabled"),v=n(r,"row"),m=n(r,"day"),g=n(r,"prevmonth-day"),y=n(r,"nextmonth-day"),b=n(r,"anchor"),w=n(r,"pane"),E=n(r,"status"),S=e.Lang,x=e.Node,T=x.create,N=e.substitute,C=e.each,k=e.Array.hasValue,L=e.Array.indexOf,A=e.Object.hasKey,O=e.Object.setValue,M=e.Object.owns,_=e.Object.isEmpty,D=e.DataType.Date;e.CalendarBase=e.extend(P,e.Widget,{_paneProperties:{},_paneNumber:1,_calendarId:null,_selectedDates:{},_rules:{},_filterFunction:null,_storedDateCells:{},initializer:function(){this._paneProperties={},this._calendarId=e.guid("calendar"),this._selectedDates={},_(this._rules)&&(this._rules={}),this._storedDateCells={}},renderUI:function(){var e=this.get("contentBox");e.appendChild(this._initCalendarHTML(this.get("date"))),this.get("showPrevMonth")&&this._afterShowPrevMonthChange(),this.get("showNextMonth")&&this._afterShowNextMonthChange(),this._renderCustomRules(),this._renderSelectedDates(),this.get("boundingBox").setAttribute("aria-labelledby",this._calendarId+"_header")},bindUI:function(){this.after("dateChange",this._afterDateChange),this.after("showPrevMonthChange",this._afterShowPrevMonthChange),this.after("showNextMonthChange",this._afterShowNextMonthChange),this.after("headerRendererChange",this._afterHeaderRendererChange),this.after("customRendererChange",this._afterCustomRendererChange),this.after("enabledDatesRuleChange",this._afterCustomRendererChange),this.after("disabledDatesRuleChange",this._afterCustomRendererChange),this.after("focusedChange",this._afterFocusedChange),this.after("selectionChange",this._renderSelectedDates),this._bindCalendarEvents()},_getSelectedDatesList:function(){var e=[];return C(this._selectedDates,function(t){C(t,function(t){C(t,function(t){e.push(t)},this)},this)},this),e},_getSelectedDatesInMonth:function(t){var n=t.getFullYear(),r=t.getMonth();return A(this._selectedDates,n)&&A(this._selectedDates[n],r)?e.Object.values(this._selectedDates[n][r]):[]},_isNumInList:function(e,t){if(t=="all")return!0;var n=t.split(","),r=n.length;while(r--){var i=n[r].split("-");if(i.length==2&&e>=parseInt(i[0],10)&&e<=parseInt(i[1],10))return!0;if(i.length==1&&parseInt(n[r],10)==e)return!0}return!1},_getRulesForDate:function(e){var t=e.getFullYear(),n=e.getMonth(),r=e.getDate(),i=e.getDay(),s=this._rules,o=[],u,a,f,l;for(u in s)if(this._isNumInList(t,u))if(S.isString(s[u]))o.push(s[u]);else for(a in s[u])if(this._isNumInList(n,a))if(S.isString(s[u][a]))o.push(s[u][a]);else for(f in s[u][a])if(this._isNumInList(r,f))if(S.isString(s[u][a][f]))o.push(s[u][a][f]);else for(l in s[u][a][f])this._isNumInList(i,l)&&S.isString(s[u][a][f][l])&&o.push(s[u][a][f][l]);return o},_matchesRule:function(e,t){return L(this._getRulesForDate(e),t)>=0},_canBeSelected:function(e){var t=this.get("enabledDatesRule"),n=this.get("disabledDatesRule");return t?this._matchesRule(e,t):n?!this._matchesRule(e,n):!0},selectDates:function(e){D.isValidDate(e)?this._addDateToSelection(e):S.isArray(e)&&this._addDatesToSelection(e)},deselectDates:function(e){e?D.isValidDate(e)?this._removeDateFromSelection(e):S.isArray(e)&&this._removeDatesFromSelection(e):this._clearSelection()},_addDateToSelection:function(e,t){if(this._canBeSelected(e)){var n=e.getFullYear(),r=e.getMonth(),i=e.getDate();A(this._selectedDates,n)?A(this._selectedDates[n],r)?this._selectedDates[n][r][i]=e:(this._selectedDates[n][r]={},this._selectedDates[n][r][i]=e):(this._selectedDates[n]={},this._selectedDates[n][r]={},this._selectedDates[n][r][i]=e),this._selectedDates=O(this._selectedDates,[n,r,i],e),t||this._fireSelectionChange()}},_addDatesToSelection:function(e){C(e,this._addDateToSelection,this),this._fireSelectionChange()},_addDateRangeToSelection:function(e,t){var n=(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4,r=e.getTime(),i=t.getTime();if(r>i){var s=r;r=i,i=s+n}else i-=n;for(var o=r;o<=i;o+=864e5){var u=new Date(o);u.setHours(12),this._addDateToSelection(u,o)}this._fireSelectionChange()},_removeDateFromSelection:function(e,t){var n=e.getFullYear(),r=e.getMonth(),i=e.getDate();A(this._selectedDates,n)&&A(this._selectedDates[n],r)&&A(this._selectedDates[n][r],i)&&(delete this._selectedDates[n][r][i],t||this._fireSelectionChange())},_removeDatesFromSelection:function(e){C(e,this._removeDateFromSelection,this),this._fireSelectionChange()},_removeDateRangeFromSelection:function(e,t){var n=e.getTime(),r=t.getTime();for(var i=n;i<=r;i+=864e5)this._removeDateFromSelection(new Date(i),i);this._fireSelectionChange()},_clearSelection:function(e){this._selectedDates={},this.get("contentBox").all("."+p).removeClass(p).setAttribute("aria-selected",!1),e||this._fireSelectionChange()},_fireSelectionChange:function(){this.fire("selectionChange",{newSelection:this._getSelectedDatesList()})},_restoreModifiedCells:function(){var e=this.get("contentBox"),t;for(t in this._storedDateCells)e.one("#"+t).replace(this._storedDateCells[t]),delete this._storedDateCells[t]},_renderCustomRules:function(){this.get("contentBox").all("."+m+",."+y).removeClass(d).setAttribute("aria-disabled",!1);if(!_(this._rules)){var e=this.get("enabledDatesRule"),t=this.get("disabledDatesRule");for(var n=0;n<this._paneNumber;n++){var r=D.addMonths(this.get("date"),n),i=D.listOfDatesInMonth(r);C(i,function(n){var r=this._getRulesForDate(n);if(r.length>0){var i=this._dateToNode(n);(e&&L(r,e)<0||!e&&t&&L(r,t)>=0)&&i.addClass(d).setAttribute("aria-disabled",!0),S.isFunction(this._filterFunction)&&(this._storedDateCells[i.get("id")]=i.cloneNode(!0),this._filterFunction(n,i,r))}else if(e){var i=this._dateToNode(n);i.addClass(d).setAttribute("aria-disabled",!0)}},this)}}},_renderSelectedDates:function(){this.get("contentBox").all("."+p).removeClass(p).setAttribute("aria-selected",!1);for(var e=0;e<this._paneNumber;e++){var t=D.addMonths(this.get("date"),e),n=this._getSelectedDatesInMonth(t);C(n,function(e){this._dateToNode(e).addClass(p).setAttribute("aria-selected",!0)},this)}},_dateToNode:function(e){var t=e.getDate(),n=0,r=t%7,i=(12+e.getMonth()-this.get("date").getMonth())%12,s=this._calendarId+"_pane_"+i,o=this._paneProperties[s].cutoffCol;switch(r){case 0:o>=6?n=12:n=5;break;case 1:n=6;break;case 2:o>0?n=7:n=0;break;case 3:o>1?n=8:n=1;break;case 4:o>2?n=9:n=2;break;case 5:o>3?n=10:n=3;break;case 6:o>4?n=11:n=4}return this.get("contentBox").one("#"+this._calendarId+"_pane_"+i+"_"+n+"_"+t)},_nodeToDate:function(e){var t=e.get("id").split("_").reverse(),n=parseInt(t[2],10),r=parseInt(t[0],10),i=D.addMonths(this.get("date"),n),s=i.getFullYear(),o=i.getMonth();return new Date(s,o,r,12,0,0,0)},_bindCalendarEvents:function(){},_normalizeDate:function(e){return e?new Date(e.getFullYear(),e.getMonth(),1,12,0,0,0):null},_getCutoffColumn:function(e,t){var n=this._normalizeDate(e).getDay()-t,r=6-(n+7)%7;return r},_turnPrevMonthOn:function(e){var t=e.get("id"),n=this._paneProperties[t].paneDate,r=D.daysInMonth(D.addMonths(n,-1));this._paneProperties[t].hasOwnProperty("daysInPrevMonth")||(this._paneProperties[t].daysInPrevMonth=0);if(r!=this._paneProperties[t].daysInPrevMonth){this._paneProperties[t].daysInPrevMonth=r;for(var i=5;i>=0;i--)e.one("#"+t+"_"+i+"_"+(i-5)).set("text",r--)}},_turnPrevMonthOff:function(e){var t=e.get("id");this._paneProperties[t].daysInPrevMonth=0;for(var n=5;n>=0;n--)e.one("#"+t+"_"+n+"_"+(n-5)).setContent(" ")},_cleanUpNextMonthCells:function(e){var t=e.get("id");e.one("#"+t+"_6_29").removeClass(y),e.one("#"+t+"_7_30").removeClass(y),e.one("#"+t+"_8_31").removeClass(y),e.one("#"+t+"_0_30").removeClass(y),e.one("#"+t+"_1_31").removeClass(y)},_turnNextMonthOn:function(e){var t=1,n=e.get("id"),r=this._paneProperties[n].daysInMonth,i=this._paneProperties[n].cutoffCol;for(var s=r-22;s<i+7;s++)e.one("#"+n+"_"+s+"_"+(s+23)).set("text",t++).addClass(y);var o=i;r==31&&i<=1?o=2:r==30&&i===0&&(o=1);for(var s=o;s<i+7;s++)e.one("#"+n+"_"+s+"_"+(s+30)).set("text",t++).addClass(y)},_turnNextMonthOff:function(e){var t=e.get("id"),n=this._paneProperties[t].daysInMonth,r=this._paneProperties[t].cutoffCol;for(var i=n-22;i<=12;i++)e.one("#"+t+"_"+i+"_"+(i+23)).setContent(" ").addClass(y);var s=0;n==31&&r<=1?s=2:n==30&&r===0&&(s=1);for(var i=s;i<=12;i++)e.one("#"+t+"_"+i+"_"+(i+30)).setContent(" ").addClass(y)},_afterShowNextMonthChange:function(){var e=this.get("contentBox"),t=e.one("#"+this._calendarId+"_pane_"+(this._paneNumber-1));this._cleanUpNextMonthCells(t),this.get("showNextMonth")?this._turnNextMonthOn(t):this._turnNextMonthOff(t)},_afterShowPrevMonthChange:function(){var e=this.get("contentBox"),t=e.one("#"+this._calendarId+"_pane_"+0);this.get("showPrevMonth")?this._turnPrevMonthOn(t):this._turnPrevMonthOff(t)},_afterHeaderRendererChange:function(){var e=this.get("contentBox").one("."+f);e.setContent(this._updateCalendarHeader(this.get("date")))},_afterCustomRendererChange:function(){this._restoreModifiedCells(),this._renderCustomRules()},_afterDateChange:function(){var e=this.get("contentBox"),t=e.one("."+a).one("."+f),n=e.all("."+i),r=this.get("date"),s=0;e.setStyle("visibility","hidden"),t.setContent(this._updateCalendarHeader(r)),this._restoreModifiedCells(),n.each(function(e){this._rerenderCalendarPane(D.addMonths(r,s++),e)},this),this._afterShowPrevMonthChange(),this._afterShowNextMonthChange(),this._renderCustomRules(),this._renderSelectedDates(),e.setStyle("visibility","visible")},_initCalendarPane:function(e,t){var n="",r=this.get("strings.very_short_weekdays")||["Su","Mo","Tu","We","Th","Fr","Sa"],i=this.get("strings.weekdays")||["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],s=this.get("strings.first_weekday")||0,o=this._getCutoffColumn(e,s),u=D.daysInMonth(e),a=["","","","","",""],f={};f.weekday_row="";for(var l=s;l<=s+6;l++)f.weekday_row+=N(P.WEEKDAY_TEMPLATE,{weekdayname:r[l%7],full_weekdayname:i[l%7]});f.weekday_row_template=N(P.WEEKDAY_ROW_TEMPLATE,f);for(var c=0;c<=5;c++)for(var p=0;p<=12;p++){var d=7*c-5+p,v=t+"_"+p+"_"+d,b=m;d<1?b=g:d>u&&(b=y);if(d<1||d>u)d=" ";var w=p>=o&&p<o+7?"":h;a[c]+=N(P.CALDAY_TEMPLATE,{day_content:d,calendar_col_class:"calendar_col"+p,calendar_col_visibility_class:w,calendar_day_class:b,calendar_day_id:v})}f.body_template="",C(a,function(e){f.body_template+=N(P.CALDAY_ROW_TEMPLATE,{calday_row:e})}),f.calendar_pane_id=t,f.calendar_pane_tabindex=this.get("tabIndex"),f.pane_arialabel=D.format(e,{format:"%B %Y"});var E=N(N(P.CALENDAR_GRID_TEMPLATE,f),P.CALENDAR_STRINGS);return this._paneProperties[t]={cutoffCol:o,daysInMonth:u,paneDate:e},E},_rerenderCalendarPane:function(e,t){var n=this.get("strings.first_weekday")||0,r=this._getCutoffColumn(e,n),i=D.daysInMonth(e),s=t.get("id");t.setStyle("visibility","hidden"),t.setAttribute("aria-label",D.format(e,{format:"%B %Y"}));for(var o=0;o<=12;o++){var u=t.all(".calendar_col"+o);u.removeClass(h);if(o<r||o>=r+7)u.addClass(h);else switch(o){case 0:var a=t.one("#"+s+"_0_30");i>=30?(a.set("text","30"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.addClass(y).addClass(m));break;case 1:var a=t.one("#"+s+"_1_31");i>=31?(a.set("text","31"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.removeClass(m).addClass(y));break;case 6:var a=t.one("#"+s+"_6_29");i>=29?(a.set("text","29"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.removeClass(m).addClass(y));break;case 7:var a=t.one("#"+s+"_7_30");i>=30?(a.set("text","30"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.removeClass(m).addClass(y));break;case 8:var a=t.one("#"+s+"_8_31");i>=31?(a.set("text","31"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.removeClass(m).addClass(y))}}this._paneProperties[s].cutoffCol=r,this._paneProperties[s].daysInMonth=i,this._paneProperties[s].paneDate=e,t.setStyle("visibility","visible")},_updateCalendarHeader:function(t){var n="",r=this.get("headerRenderer");return e.Lang.isString(r)?n=D.format(t,{format:r}):r instanceof Function&&(n=r.call(this,t)),n},_initCalendarHeader:function(e){return N(N(P.HEADER_TEMPLATE,{calheader:this._updateCalendarHeader(e),calendar_id:this._calendarId}),P.CALENDAR_STRINGS)},_initCalendarHTML:function(t){function i(){var e=this._initCalendarPane(D.addMonths(t,r),n.calendar_id+"_pane_"+r);return r++,e}var n={},r=0;n.header_template=this._initCalendarHeader(t),n.calendar_id=this._calendarId,n.body_template=N(N(P.CONTENT_TEMPLATE,n),P.CALENDAR_STRINGS);var s=n.body_template.replace(/\{calendar_grid_template\}/g,e.bind(i,this));return this._paneNumber=r,s}},{CALENDAR_STRINGS:{calendar_grid_class:i,calendar_body_class:u,calendar_hd_class:a,calendar_hd_label_class:f,calendar_weekdayrow_class:l,calendar_weekday_class:c,calendar_row_class:v,calendar_day_class:m,calendar_dayanchor_class:b,calendar_pane_class:w,calendar_right_grid_class:o,calendar_left_grid_class:s,calendar_status_class:E},CONTENT_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1">{calendar_grid_template}</div></div>',ONE_PANE_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1">{calendar_grid_template}</div></div>',TWO_PANE_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1-2"><div class = "{calendar_left_grid_class}">{calendar_grid_template}</div></div><div class="yui3-u-1-2"><div class = "{calendar_right_grid_class}">{calendar_grid_template}</div></div></div>',THREE_PANE_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1-3"><div class = "{calendar_left_grid_class}">{calendar_grid_template}</div></div><div class="yui3-u-1-3">{calendar_grid_template}</div><div class="yui3-u-1-3"><div class = "{calendar_right_grid_class}">{calendar_grid_template}</div></div></div>',CALENDAR_GRID_TEMPLATE:'<table class="{calendar_grid_class}" id="{calendar_pane_id}" role="grid" aria-readonly="true" aria-label="{pane_arialabel}" tabindex="{calendar_pane_tabindex}"><thead>{weekday_row_template}</thead><tbody>{body_template}</tbody></table>',HEADER_TEMPLATE:'<div class="yui3-g {calendar_hd_class}"><div class="yui3-u {calendar_hd_label_class}" id="{calendar_id}_header" aria-role="heading">{calheader}</div></div>',WEEKDAY_ROW_TEMPLATE:'<tr class="{calendar_weekdayrow_class}" role="row">{weekday_row}</tr>',CALDAY_ROW_TEMPLATE:'<tr class="{calendar_row_class}" role="row">{calday_row}</tr>',WEEKDAY_TEMPLATE:'<th class="{calendar_weekday_class}" role="columnheader" aria-label="{full_weekdayname}">{weekdayname}</th>',CALDAY_TEMPLATE:'<td class="{calendar_col_class} {calendar_day_class} {calendar_col_visibility_class}" id="{calendar_day_id}" role="gridcell" tabindex="-1">{day_content}</td>',NAME:"calendarBase",ATTRS:{tabIndex:{value:1},date:{value:new Date,setter:function(e){var t=this._normalizeDate(e);return D.areEqual(t,this.get("date"))?this.get("date"):t}},showPrevMonth:{value:!1},showNextMonth:{value:!1},strings:{valueFn:function(){return e.Intl.get("calendar-base")}},headerRenderer:{value:"%B %Y"},enabledDatesRule:{value:null},disabledDatesRule:{value:null},selectedDates:{readOnly:!0,getter:function(e){return this._getSelectedDatesList()}},customRenderer:{lazyAdd:!1,value:{},setter:function(e){this._rules=e.rules,this._filterFunction=e.filterFunction}}}})},"3.7.1",{requires:["widget","substitute","datatype-date","datatype-date-math","cssgrids"],lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],skinnable:!0});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('calendar-base', function(Y) {+YUI.add('calendar-base', function (Y, NAME) { /** * The CalendarBase submodule is a basic UI calendar view that displays@@ -150,7 +150,9 @@ this._paneProperties = {}; this._calendarId = Y.guid('calendar'); this._selectedDates = {};- this._rules = {};+ if (isEmpty(this._rules)) {+ this._rules = {}; + } this._storedDateCells = {}; }, @@ -192,26 +194,11 @@ this.after('enabledDatesRuleChange', this._afterCustomRendererChange); this.after('disabledDatesRuleChange', this._afterCustomRendererChange); this.after('focusedChange', this._afterFocusedChange);+ this.after('selectionChange', this._renderSelectedDates); this._bindCalendarEvents(); }, - /**- * syncUI implementation- *- * Update the scroll position, based on the current value of scrollY- * @method syncUI- */ - syncUI : function () {- if (this.get('showPrevMonth')) {- this._afterShowPrevMonthChange(); - }-- if (this.get('showNextMonth')) {- this._afterShowNextMonthChange();- }- },- /** * An internal utility method that generates a list of selected dates * from the hash storage.@@ -253,58 +240,8 @@ } }, - /**- * An internal rendering method that modifies a date cell to have the- * selected CSS class if the date cell is visible.- *- * @method _renderSelectedDate- * @param {Date} oDate The date corresponding to a specific date cell.- * @private- */- _renderSelectedDate : function (oDate) {- if (this._isDateVisible(oDate)) {- this._dateToNode(oDate).addClass(CAL_DAY_SELECTED).setAttribute("aria-selected", true);- }- }, /**- * An internal rendering method that modifies a date cell to remove the- * selected CSS class if the date cell is visible.- *- * @method _renderUnelectedDate- * @param {Date} oDate The date corresponding to a specific date cell.- * @private- */- _renderUnselectedDate : function (oDate) {- if (this._isDateVisible(oDate)) {- this._dateToNode(oDate).removeClass(CAL_DAY_SELECTED).setAttribute("aria-selected", false);- }- },-- /**- * An internal utility method that checks whether a particular date- * is in the current view of the calendar.- *- * @method _isDateVisible- * @param {Date} oDate The date corresponding to a specific date cell.- * @private- * @return {boolean} Returns true if the given date is in the current - * view of the calendar.- */- _isDateVisible : function (oDate) {- var minDate = this.get("date"),- maxDate = ydate.addMonths(minDate, this._paneNumber - 1),- oDateTime = this._normalizeDate(oDate).getTime();- - if (minDate.getTime() <= oDateTime && oDateTime <= maxDate) {- return true;- }- else {- return false;- }- },-- /** * An internal parsing method that receives a String list of numbers * and number ranges (of the form "1,2,3,4-6,7-9,10,11" etc.) and checks * whether a specific number is included in this list. Used for looking@@ -498,7 +435,6 @@ } this._selectedDates = setVal(this._selectedDates, [year, month, day], oDate);- this._renderSelectedDate(oDate); if (!index) { this._fireSelectionChange();@@ -525,6 +461,7 @@ * @private */ _addDateRangeToSelection : function (startDate, endDate) {+ var timezoneDifference = (endDate.getTimezoneOffset() - startDate.getTimezoneOffset())*60000, startTime = startDate.getTime(), endTime = endDate.getTime();@@ -564,7 +501,6 @@ hasKey(this._selectedDates[year], month) && hasKey(this._selectedDates[year][month], day)) { delete this._selectedDates[year][month][day];- this._renderUnselectedDate(oDate); if (!index) { this._fireSelectionChange(); }@@ -578,7 +514,7 @@ * @private */ _removeDatesFromSelection : function (datesArray) {- each(datesArray, this._removeDateDromSelection);+ each(datesArray, this._removeDateFromSelection, this); this._fireSelectionChange(); }, @@ -604,7 +540,7 @@ * A utility method that removes all dates from selection. * @method _clearSelection * @param {boolean} noevent A Boolean specifying whether a selectionChange- * event should be fired.+ * event should be fired. If true, the event is not fired. * @private */ _clearSelection : function (noevent) {@@ -654,7 +590,7 @@ _renderCustomRules : function () { this.get("contentBox").all("." + CAL_DAY + ",." + CAL_NEXTMONTH_DAY).removeClass(SELECTION_DISABLED).setAttribute("aria-disabled", false);- + if (!isEmpty(this._rules)) { var enRule = this.get("enabledDatesRule"), disRule = this.get("disabledDatesRule");@@ -697,7 +633,7 @@ var paneDate = ydate.addMonths(this.get("date"), paneNum); var dateArray = this._getSelectedDatesInMonth(paneDate); each(dateArray, function (date) {- this._dateToNode(date).addClass(CAL_DAY_SELECTED).setAttribute("ari-selected", true);+ this._dateToNode(date).addClass(CAL_DAY_SELECTED).setAttribute("aria-selected", true); }, this); }@@ -1688,6 +1624,7 @@ * @default {} */ customRenderer : {+ lazyAdd: false, value: {}, setter: function (val) { this._rules = val.rules;@@ -1699,4 +1636,4 @@ }); -}, '3.5.1' ,{requires:['widget', 'substitute', 'datatype-date', 'datatype-date-math', 'cssgrids'], lang:['de', 'en', 'fr', 'ja', 'nb-NO', 'pt-BR', 'ru', 'zh-HANT-TW']});+}, '3.7.1', {"requires": ["widget", "substitute", "datatype-date", "datatype-date-math", "cssgrids"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar-base",function(a){a.Intl.add("calendar-base","",{weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short_weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],very_short_weekdays:["Su","Mo","Tu","We","Th","Fr","Sa"],first_weekday:0,weekends:[0,6]});},"3.5.1");+YUI.add("lang/calendar-base",function(e){e.Intl.add("calendar-base","",{weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short_weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],very_short_weekdays:["Su","Mo","Tu","We","Th","Fr","Sa"],first_weekday:0,weekends:[0,6]})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar-base_de",function(a){a.Intl.add("calendar-base","de",{weekdays:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],very_short_weekdays:["So","Mo","Di","Mi","Do","Fr","Sa"],first_weekday:1,weekends:[0,6]});},"3.5.1");+YUI.add("lang/calendar-base_de",function(e){e.Intl.add("calendar-base","de",{weekdays:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],very_short_weekdays:["So","Mo","Di","Mi","Do","Fr","Sa"],first_weekday:1,weekends:[0,6]})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar-base_en",function(a){a.Intl.add("calendar-base","en",{weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short_weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],very_short_weekdays:["Su","Mo","Tu","We","Th","Fr","Sa"],first_weekday:0,weekends:[0,6]});},"3.5.1");+YUI.add("lang/calendar-base_en",function(e){e.Intl.add("calendar-base","en",{weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short_weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],very_short_weekdays:["Su","Mo","Tu","We","Th","Fr","Sa"],first_weekday:0,weekends:[0,6]})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar-base_fr",function(a){a.Intl.add("calendar-base","fr",{weekdays:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],short_weekdays:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],very_short_weekdays:["Di","Lu","Ma","Me","Je","Ve","Sa"],first_weekday:1,weekends:[0,6]});},"3.5.1");+YUI.add("lang/calendar-base_fr",function(e){e.Intl.add("calendar-base","fr",{weekdays:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],short_weekdays:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],very_short_weekdays:["Di","Lu","Ma","Me","Je","Ve","Sa"],first_weekday:1,weekends:[0,6]})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar-base_ja",function(a){a.Intl.add("calendar-base","ja",{weekdays:["\u65E5\u66DC\u65E5","\u6708\u66DC\u65E5","\u706B\u66DC\u65E5","\u6C34\u66DC\u65E5","\u6728\u66DC\u65E5","\u91D1\u66DC\u65E5","\u571F\u66DC\u65E5"],short_weekdays:["\u65E5\u66DC","\u6708\u66DC","\u706B\u66DC","\u6C34\u66DC","\u6728\u66DC","\u91D1\u66DC","\u571F\u66DC"],very_short_weekdays:["\u65E5","\u6708","\u706B","\u6C34","\u6728","\u91D1","\u571F"],first_weekday:0,weekends:[0,6]});},"3.5.1");+YUI.add("lang/calendar-base_ja",function(e){e.Intl.add("calendar-base","ja",{weekdays:["\u65e5\u66dc\u65e5","\u6708\u66dc\u65e5","\u706b\u66dc\u65e5","\u6c34\u66dc\u65e5","\u6728\u66dc\u65e5","\u91d1\u66dc\u65e5","\u571f\u66dc\u65e5"],short_weekdays:["\u65e5\u66dc","\u6708\u66dc","\u706b\u66dc","\u6c34\u66dc","\u6728\u66dc","\u91d1\u66dc","\u571f\u66dc"],very_short_weekdays:["\u65e5","\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f"],first_weekday:0,weekends:[0,6]})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar-base_nb-NO",function(a){a.Intl.add("calendar-base","nb-NO",{weekdays:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],very_short_weekdays:["Sø","Ma","Ti","On","To","Fr","Lø"],first_weekday:1,weekends:[0,6]});},"3.5.1");+YUI.add("lang/calendar-base_nb-NO",function(e){e.Intl.add("calendar-base","nb-NO",{weekdays:["S\u00f8ndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","L\u00f8rdag"],very_short_weekdays:["S\u00f8","Ma","Ti","On","To","Fr","L\u00f8"],first_weekday:1,weekends:[0,6]})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar-base_pt-BR",function(a){a.Intl.add("calendar-base","pt-BR",{weekdays:["Domingo","Segunda","Ter\u00E7a","Quarta","Quinta","Sexta","S\u00E1bado"],short_weekdays:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],very_short_weekdays:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],first_weekday:0,weekends:[0,6]});},"3.5.1");+YUI.add("lang/calendar-base_pt-BR",function(e){e.Intl.add("calendar-base","pt-BR",{weekdays:["Domingo","Segunda","Ter\u00e7a","Quarta","Quinta","Sexta","S\u00e1bado"],short_weekdays:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],very_short_weekdays:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],first_weekday:0,weekends:[0,6]})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar-base_ru",function(a){a.Intl.add("calendar-base","ru",{weekdays:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],very_short_weekdays:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],first_weekday:1,weekends:[0,6]});},"3.5.1");+YUI.add("lang/calendar-base_ru",function(e){e.Intl.add("calendar-base","ru",{weekdays:["\u0412\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","\u041f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a","\u0412\u0442\u043e\u0440\u043d\u0438\u043a","\u0421\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0435\u0440\u0433","\u041f\u044f\u0442\u043d\u0438\u0446\u0430","\u0421\u0443\u0431\u0431\u043e\u0442\u0430"],very_short_weekdays:["\u0412\u0441","\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431"],first_weekday:1,weekends:[0,6]})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar-base_zh-HANT-TW",function(a){a.Intl.add("calendar-base","zh-HANT-TW",{weekdays:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],short_weekdays:["\u9031\u65E5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],very_short_weekdays:["\u65E5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"],first_weekday:0,weekends:[0,6]});},"3.5.1");+YUI.add("lang/calendar-base_zh-HANT-TW",function(e){e.Intl.add("calendar-base","zh-HANT-TW",{weekdays:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],short_weekdays:["\u9031\u65e5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],very_short_weekdays:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"],first_weekday:0,weekends:[0,6]})},"3.7.1");
@@ -1,27 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-calendar {-}--.yui3-calendar-content {-}--.yui3-calendar-pane {- width: 100%;-}--.yui3-calendar-grid {- width: 100%;-}--.yui3-calendar-column-hidden, .yui3-calendar-hidden {- display:none;-}--.yui3-calendar-day {- -}
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,22 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-calendar-header {- padding-left:15px;- padding-right:15px;-}--.yui3-calendar-header-label {- width:100%;-}--.yui3-calendarnav-prevmonth {- cursor: pointer;-}--.yui3-calendarnav-nextmonth {- cursor: pointer;-}
@@ -1,88 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-skin-night .yui3-calendar-content {- padding:10px;- color: #CBCBCB;- border: 1px solid #303030;- background: #151515; /* Old browsers */- background: -moz-linear-gradient(top, #222222 0%, #151515 100%); /* FF3.6+ */- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#222222), color-stop(100%,#151515)); /* Chrome,Safari4+ */- background: -webkit-linear-gradient(top, #222222 0%,#151515 100%); /* Chrome10+,Safari5.1+ */- background: -o-linear-gradient(top, #222222 0%,#151515 100%); /* Opera11.10+ */- background: -ms-linear-gradient(top, #222222 0%,#151515 100%); /* IE10+ */- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#222222', endColorstr='#151515',GradientType=0 ); /* IE6-9 */- background: linear-gradient(top, #222222 0%,#151515 100%); /* W3C */- -moz-border-radius: 5px;- border-radius: 5px;-}---.yui3-skin-night .yui3-calendar-grid {- padding:5px;- border-collapse: collapse;-}--.yui3-skin-night .yui3-calendar-header {- padding-bottom:10px;-}--.yui3-skin-night .yui3-calendar-header-label {- margin: 0;- font-size: 1em;- font-weight: bold;-}--.yui3-skin-night .yui3-calendar-day,-.yui3-skin-night .yui3-calendar-prevmonth-day, -.yui3-skin-night .yui3-calendar-nextmonth-day {- padding:5px;- border: 1px solid #151515;- background: #262727;- text-align:center;-}--.yui3-skin-night .yui3-calendar-day:hover {- background: #383939;- color: #FFFFFF;-}--.yui3-skin-night .yui3-calendar-selection-disabled,-.yui3-skin-night .yui3-calendar-selection-disabled:hover {- background: #151515;- color: #596060;-}--.yui3-skin-night .yui3-calendar-weekday {- color: #4F4F4F;- font-weight: bold;- text-align: center;-}--.yui3-skin-night .yui3-calendar-prevmonth-day, .yui3-skin-night .yui3-calendar-nextmonth-day {- color: #4F4F4F;-}--.yui3-skin-night .yui3-calendar-day {- font-weight: bold;-}--.yui3-skin-night .yui3-calendar-day-selected {- background-color: #505151;- color: #fff;-}--.yui3-skin-night .yui3-calendar-header-label {- text-align: center;-}--.yui3-skin-night .yui3-calendar-left-grid {- margin-right:1em;-}--.yui3-skin-sam .yui3-calendar-right-grid {- margin-left:1em;-}
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-.yui3-calendar-column-hidden,.yui3-calendar-hidden{display:none}.yui3-calendar-day{cursor:pointer}.yui3-calendar-selection-disabled{cursor:default}.yui3-calendar-prevmonth-day{cursor:default}.yui3-calendar-nextmonth-day{cursor:default}.yui3-calendar-content:hover .yui3-calendar-day,.yui3-calendar-content:hover .yui3-calendar-prevmonth-day,.yui3-calendar-content:hover .yui3-calendar-nextmonth-day{-moz-user-select:none}.yui3-skin-night .yui3-calendar-day-highlighted{background-color:#555}.yui3-skin-night .yui3-calendar-day-selected.yui3-calendar-day-highlighted{background-color:#777}+.yui3-calendar-column-hidden,.yui3-calendar-hidden{display:none}.yui3-calendar-day{cursor:pointer}.yui3-calendar-selection-disabled{cursor:default}.yui3-calendar-prevmonth-day{cursor:default}.yui3-calendar-nextmonth-day{cursor:default}.yui3-calendar-content:hover .yui3-calendar-day,.yui3-calendar-content:hover .yui3-calendar-prevmonth-day,.yui3-calendar-content:hover .yui3-calendar-nextmonth-day{-moz-user-select:none}.yui3-skin-night .yui3-calendar-day-highlighted{background-color:#555}.yui3-skin-night .yui3-calendar-day-selected.yui3-calendar-day-highlighted{background-color:#777}#yui3-css-stamp.skin-night-calendar{display:none}
@@ -1,39 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-skin-night .yui3-calendarnav-prevmonth, .yui3-skin-night .yui3-calendarnav-nextmonth {- color: #FFFFFF;- width: 12px;- height: 14px;- background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALZJREFUeNpi/P//PwORQBqIu6DsMiB+SpQukAUEMCcQVwPx5/8I8BkqxklIPyHDA4H44X/c4CFUDckWGADxgf/EgwNQPQQtEALiaf/JB9OgZmBYwAzERUD84T/l4APULGaYBR5AfPU/9QHITA8maGJiY6A+YENOpmw0CCI2bJEsCsRzKDB8DtSMgUum6DiKiIwWRUlOhhUVdUD8Dcngb1AxgkUFIwmFnRwQt0PZlUD8iBhNAAEGALbfq7SGiQoPAAAAAElFTkSuQmCC);- background-repeat: no-repeat;-}--.yui3-skin-night .yui3-calendarnav-prevmonth:hover, .yui3-skin-night .yui3-calendarnav-nextmonth:hover {- background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPpJREFUeNpi/P//PwMxQD9jszSQ6oJyyy7O8H1KjD5GQhYADeYEUkVAXAHEPFDhL0DcAcR9QIu+k20B0PBAIDUBiOVwKHkExAVAS9aTZAHQYAOowfYMxIGDUIsu4LUAaLAQkGoB4kwG8sB0IK4BWvQOxQKgwcxAdj4Q1wExPwNl4CMQNwHxRKBFfxn10jd5ADm9QKzFQF1wDYiLmaAcNgbqA7CZTEBv7ADS2iDboN5joEIQgczSBpmNHsmiQKodiJPJNHwuEFcCDX49MMkUi0VRUB/hy2ggFy+jtKgohRYVnFDh79CiopuiogLNIjmobxigrn5EjD6AAAMAok9vhfHG8wQAAAAASUVORK5CYII=);- color: #0066CC;-}--.yui3-skin-night .yui3-calendarnav-month-disabled, .yui3-skin-night .yui3-calendarnav-month-disabled:hover {- background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQhJREFUeNqs0yGLAlEUhuHrKoIgCFbBJghb3F+g0WrVarEqLIhBEEFYWKNNMBktU4z6C5RNkwyCyWQSTPuOfCOCrHNnxwMPyOGe73DAiTmOYywrhy/9/sTBZujN4k0KPbioi6teKuqCmsKGSN/10+q5ehN6QQkrLJB/Mp/Xm5VmAhdkMcEGZWNfZc1MlPGwII42dmiZ/1dLGW1lXhdU8YNvZEz0yijLy6z6FyTN6yvpX7DEOzo4vSD4pCwvc+lfcMEYBUwjhE+VMVbmw7/oiCY+sA4RvNZMUxmB38EWFTSwfxK815uKZkJ/yXMU0cf5rn9Wr6g3f1bC4nwvbIAZRup1Ay671a8AAwC3OzOqxK+rkwAAAABJRU5ErkJggg==);- cursor: default;- color: #CCCCCC; -}--.yui3-skin-night .yui3-calendarnav-prevmonth, .yui3-skin-night .yui3-calendarnav-prevmonth:hover {- background-position: 0px 0px;- margin-left:-12px;-}--.yui3-skin-night .yui3-calendarnav-nextmonth, .yui3-skin-night .yui3-calendarnav-nextmonth:hover {- background-position: -12px 0px;- margin-right: -12px;-}--.yui3-skin-night .yui3-calendarnav-prevmonth span, .yui3-skin-night .yui3-calendarnav-nextmonth span {- display: none;- *display: block;-}
@@ -1,94 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-skin-sam .yui3-calendar-content {- padding:10px;- color: #000000;- border: 1px solid gray;- background: #f2f2f2; /* Old browsers */- background: -moz-linear-gradient(top, #f9f9f9 0%, #f2f2f2 100%); /* FF3.6+ */- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9f9f9), color-stop(100%,#f2f2f2)); /* Chrome,Safari4+ */- background: -webkit-linear-gradient(top, #f9f9f9 0%,#f2f2f2 100%); /* Chrome10+,Safari5.1+ */- background: -o-linear-gradient(top, #f9f9f9 0%,#f2f2f2 100%); /* Opera11.10+ */- background: -ms-linear-gradient(top, #f9f9f9 0%,#f2f2f2 100%); /* IE10+ */- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f9f9f9', endColorstr='#f2f2f2',GradientType=0 ); /* IE6-9 */- background: linear-gradient(top, #f9f9f9 0%,#f2f2f2 100%); /* W3C */- -moz-border-radius: 5px;- border-radius: 5px;-}--.yui3-skin-sam .yui3-calendar-grid {- padding:5px;- border-collapse: collapse;-}--.yui3-skin-sam .yui3-calendar-header {- padding-bottom:10px;-}--.yui3-skin-sam .yui3-calendar-header-label {- margin: 0;- font-size: 1em;- font-weight: bold;-}--.yui3-skin-sam .yui3-calendar-day,-.yui3-skin-sam .yui3-calendar-prevmonth-day, -.yui3-skin-sam .yui3-calendar-nextmonth-day {- padding:5px;- border: 1px solid #CCCCCC;- background: #FFFFFF;- text-align:center;-}---.yui3-skin-sam .yui3-calendar-day:hover {- background: #0066CC;- color: #FFFFFF;-}--.yui3-skin-sam .yui3-calendar-selection-disabled,-.yui3-skin-sam .yui3-calendar-selection-disabled:hover {- color: #A6A6A6;- background: #CCCCCC;-}--.yui3-skin-sam .yui3-calendar-weekday {- font-weight: bold;-}--.yui3-skin-sam .yui3-calendar-prevmonth-day, .yui3-skin-sam .yui3-calendar-nextmonth-day {- color: #A6A6A6;-}--.yui3-skin-sam .yui3-calendar-day {- font-weight: bold;-}--.yui3-skin-sam .yui3-calendar-day-selected {- background-color: #B3D4FF;- color: #000000;-}--.yui3-skin-sam .yui3-calendar-header-label {- text-align: center;-}--.yui3-skin-sam .yui3-calendar-left-grid {- margin-right:1em;-}--.yui3-skin-sam .yui3-calendar-right-grid {- margin-left:1em;-}--.yui3-skin-sam .yui3-calendar-day-highlighted {- background-color: #DCDEF5;-}--.yui3-skin-sam .yui3-calendar-day-selected.yui3-calendar-day-highlighted {- background-color: #758FBB;-}
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-.yui3-calendar-column-hidden,.yui3-calendar-hidden{display:none}.yui3-calendar-day{cursor:pointer}.yui3-calendar-selection-disabled{cursor:default}.yui3-calendar-prevmonth-day{cursor:default}.yui3-calendar-nextmonth-day{cursor:default}.yui3-calendar-content:hover .yui3-calendar-day,.yui3-calendar-content:hover .yui3-calendar-prevmonth-day,.yui3-calendar-content:hover .yui3-calendar-nextmonth-day{-moz-user-select:none}.yui3-skin-sam .yui3-calendar-day-highlighted{background-color:#dcdef5}.yui3-skin-sam .yui3-calendar-day-selected.yui3-calendar-day-highlighted{background-color:#758fbb}+.yui3-calendar-column-hidden,.yui3-calendar-hidden{display:none}.yui3-calendar-day{cursor:pointer}.yui3-calendar-selection-disabled{cursor:default}.yui3-calendar-prevmonth-day{cursor:default}.yui3-calendar-nextmonth-day{cursor:default}.yui3-calendar-content:hover .yui3-calendar-day,.yui3-calendar-content:hover .yui3-calendar-prevmonth-day,.yui3-calendar-content:hover .yui3-calendar-nextmonth-day{-moz-user-select:none}.yui3-skin-sam .yui3-calendar-day-highlighted{background-color:#dcdef5}.yui3-skin-sam .yui3-calendar-day-selected.yui3-calendar-day-highlighted{background-color:#758fbb}#yui3-css-stamp.skin-sam-calendar{display:none}
@@ -1,39 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-skin-sam .yui3-calendarnav-prevmonth, .yui3-skin-sam .yui3-calendarnav-nextmonth {- color: #000000;- width: 12px;- height: 14px;- background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAKNJREFUeNpiYCAeSAPxUiiWZqAi4ATiaiD+DMT/ofgzVIyTUsMDgfghksHo+CFUDcnAAIgP4DEYHR+A6iEIhIB4GgkGo+NpUDMwADMQFwHxBwoMh+EPULOYYYZ7APFVKhiMjkFmejBBLWFjoD5gQ+dQO4iwOloUiOdQYPgcqBkDl0zRQRQRGS2KGkVFHRB/QzL4G1SMk5qpQg6psJMjVhNAgAEAH+qPqeiPEUsAAAAASUVORK5CYII=);- background-repeat: no-repeat;-}--.yui3-skin-sam .yui3-calendarnav-prevmonth:hover, .yui3-skin-sam .yui3-calendarnav-nextmonth:hover {- background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPpJREFUeNpi/P//PwMxQD9jszSQ6oJyyy7O8H1KjD5GQhYADeYEUkVAXAHEPFDhL0DcAcR9QIu+k20B0PBAIDUBiOVwKHkExAVAS9aTZAHQYAOowfYMxIGDUIsu4LUAaLAQkGoB4kwG8sB0IK4BWvQOxQKgwcxAdj4Q1wExPwNl4CMQNwHxRKBFfxn10jd5ADm9QKzFQF1wDYiLmaAcNgbqA7CZTEBv7ADS2iDboN5joEIQgczSBpmNHsmiQKodiJPJNHwuEFcCDX49MMkUi0VRUB/hy2ggFy+jtKgohRYVnFDh79CiopuiogLNIjmobxigrn5EjD6AAAMAok9vhfHG8wQAAAAASUVORK5CYII=);- color: #0066CC;-}--.yui3-skin-sam .yui3-calendarnav-month-disabled, .yui3-skin-sam .yui3-calendarnav-month-disabled:hover {- background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQhJREFUeNqs0yGLAlEUhuHrKoIgCFbBJghb3F+g0WrVarEqLIhBEEFYWKNNMBktU4z6C5RNkwyCyWQSTPuOfCOCrHNnxwMPyOGe73DAiTmOYywrhy/9/sTBZujN4k0KPbioi6teKuqCmsKGSN/10+q5ehN6QQkrLJB/Mp/Xm5VmAhdkMcEGZWNfZc1MlPGwII42dmiZ/1dLGW1lXhdU8YNvZEz0yijLy6z6FyTN6yvpX7DEOzo4vSD4pCwvc+lfcMEYBUwjhE+VMVbmw7/oiCY+sA4RvNZMUxmB38EWFTSwfxK815uKZkJ/yXMU0cf5rn9Wr6g3f1bC4nwvbIAZRup1Ay671a8AAwC3OzOqxK+rkwAAAABJRU5ErkJggg==);- cursor: default;- color: #CCCCCC; -}--.yui3-skin-sam .yui3-calendarnav-prevmonth, .yui3-skin-sam .yui3-calendarnav-prevmonth:hover {- background-position: 0px 0px;- margin-left:-12px;-}--.yui3-skin-sam .yui3-calendarnav-nextmonth, .yui3-skin-sam .yui3-calendarnav-nextmonth:hover {- background-position: -12px 0px;- margin-right: -12px;-}--.yui3-skin-sam .yui3-calendarnav-prevmonth span, .yui3-skin-sam .yui3-calendarnav-nextmonth span {- display: none;- *display: block;-}
@@ -1,183 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-YUI.add('calendar-base', function(Y) {--/**- * The Calendar component is a UI widget that allows users- * to view dates in a two-dimensional month grid, as well as- * to select one or more dates, or ranges of dates. Calendar- * is generated dynamically.- *- * @module calendar- * @submodule calendar-base- */--/** Create a calendar view to represent a single or multiple- * month range of dates, rendered as a grid with date and- * weekday labels.- * - * @class CalendarBase- * @extends Widget- * @param config {Object} Configuration object (see Configuration attributes)- * @constructor- */-- -var getCN = Y.ClassNameManager.getClassName,- CALENDAR = 'calendar',- CAL_GRID = getCN(CALENDAR, 'grid'),- CAL_BODY = getCN(CALENDAR, 'body'),- CAL_HD = getCN(CALENDAR, 'header'),- CAL_HD_WRAP = getCN(CALENDAR, 'header-wrap'),- CAL_WDAYROW = getCN(CALENDAR, 'weekdayrow'),- CAL_WDAY = getCN(CALENDAR, 'weekday'),- CAL_ROW = getCN(CALENDAR, 'row'),- CAL_DAY = getCN(CALENDAR, 'day'),- CAL_ANCHOR = getCN(CALENDAR, 'anchor'),-- L = Y.Lang,- create = Y.Node.create,- substitute = Y.substitute,- each = Y.each;---function CalendarBase() {- CalendarBase.superclass.constructor.apply ( this, arguments );-}--Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {- - initializer : function () {- },- - renderUI : function () {- var contentBox = this.get('contentBox');- contentBox.appendChild(this._initCalendarHTML(new Date("5/21/1947")));- Y.log("Rendered Calendar UI");- },- - bindUI : function () {- - },- - _getCutoffColumn : function (date) {-- var normalizedDate = new Date(date.getFullYear(), date.getMonth(), 1);- return (1-normalizedDate.getDay());-- },- - _initCalendarHTML : function (baseDate) {-- var startDate = baseDate || new Date(),- cutoffCol = this._getCutoffColumn(startDate),- headerData = {calheader: (startDate.getMonth()+1) + "/" + - startDate.getFullYear()},- calString = '',- weekdays = {wday1: 'Su',- wday2: 'Mo',- wday3: 'Tu',- wday4: 'We',- wday5: 'Th',- wday6: 'Fr',- wday7: 'Sa'};-- var partials = {};- partials["header_template"] = substitute(CalendarBase.HEADER_TEMPLATE, - headerData);- - partials["weekday_row"] = '';- - each (weekdays, function (v) {- partials["weekday_row"] += - substitute(CalendarBase.WEEKDAY_TEMPLATE,- {weekdayname: v});- }- );-- partials["wdayrow_template"] = substitute(CalendarBase.WEEKDAY_ROW_TEMPLATE, partials);--- - var row_array = [];-- for (var i = 0; i <= 5; i++) {- var calday_row = '';- for (var j = -5; j <=7; j++) {- calday_row += substitute (CalendarBase.CALDAY_TEMPLATE, {day_content: '' + (j+7*i),- day_display_status: (j >= cutoffCol && j <= (cutoffCol + 6)) ? '' : 'style="display:none;"'});- }- row_array.push(substitute(CalendarBase.CALDAY_ROW_TEMPLATE, {calday_row: calday_row} ));- }- - partials["body_template"] = row_array.join('\n');-- var header = substitute(substitute (CalendarBase.CONTENT_TEMPLATE, partials),- CalendarBase.CALENDAR_CLASSES);-- - return header;- }-}, {- // Y.CalendarBase static properties- - CALENDAR_CLASSES : {- calendar_grid_class : CAL_GRID,- calendar_body_class : CAL_BODY,- calendar_hd_class : CAL_HD,- calendar_hd_wrapper_class: CAL_HD_WRAP,- calendar_weekdayrow_class: CAL_WDAYROW,- calendar_weekday_class: CAL_WDAY,- calendar_row_class: CAL_ROW,- calendar_day_class: CAL_DAY,- calendar_dayanchor_class: CAL_ANCHOR - },- - CONTENT_TEMPLATE: '<table class="{calendar_grid_class}">' +- '<thead>' +- '{header_template}' +- '{wdayrow_template}' +- '</thead>' +- '<tbody class="{calendar_body_class}">' +- '{body_template}' +- '</tbody>' +- '</table>',-- HEADER_TEMPLATE: '<tr>' +- '<th colspan="7" class="{calendar_hd_class}">' + - '<div id="calheader" class="{calendar_hd_wrapper_class}">' +- '{calheader}' +- '</div>' + - '</th>' +- '</tr>',- - WEEKDAY_ROW_TEMPLATE: '<tr class="{calendar_weekdayrow_class}">' + - '{weekday_row}' +- '</tr>',-- CALDAY_ROW_TEMPLATE: '<tr class="{calendar_row_class}">' + - '{calday_row}' + - '</tr>',-- WEEKDAY_TEMPLATE: '<th class="{calendar_weekday_class}">{weekdayname}</th>',-- CALDAY_TEMPLATE: '<td class="{calendar_day_class}" {day_display_status}>' +- '<a href="#" class="{calendar_dayanchor_class}">' +- '{day_content}' +- '</a>' + - '</td>',- - NAME: 'calendarBase',- - ATTRS: {- - }- -});---}, '3.5.1' ,{requires:['widget', 'datatype-date']});
@@ -1,7 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-YUI.add("calendar-base",function(b){var c=b.ClassNameManager.getClassName,n="calendar",d=c(n,"grid"),l=c(n,"body"),h=c(n,"header"),i=c(n,"header-wrap"),o=c(n,"weekdayrow"),q=c(n,"weekday"),e=c(n,"row"),a=c(n,"day"),p=c(n,"anchor"),k=b.Lang,f=b.Node.create,g=b.substitute,m=b.each;function j(){j.superclass.constructor.apply(this,arguments);}b.CalendarBase=b.extend(j,b.Widget,{initializer:function(){},renderUI:function(){var r=this.get("contentBox");r.appendChild(this._initCalendarHTML(new Date("5/21/1947")));},bindUI:function(){},_getCutoffColumn:function(r){var s=new Date(r.getFullYear(),r.getMonth(),1);return(1-s.getDay());},_initCalendarHTML:function(s){var r=s||new Date(),y=this._getCutoffColumn(r),C={calheader:(r.getMonth()+1)+"/"+r.getFullYear()},z="",B={wday1:"Su",wday2:"Mo",wday3:"Tu",wday4:"We",wday5:"Th",wday6:"Fr",wday7:"Sa"};var w={};w["header_template"]=g(j.HEADER_TEMPLATE,C);w["weekday_row"]="";m(B,function(D){w["weekday_row"]+=g(j.WEEKDAY_TEMPLATE,{weekdayname:D});});w["wdayrow_template"]=g(j.WEEKDAY_ROW_TEMPLATE,w);var x=[];for(var u=0;u<=5;u++){var A="";for(var t=-5;t<=7;t++){A+=g(j.CALDAY_TEMPLATE,{day_content:""+(t+7*u),day_display_status:(t>=y&&t<=(y+6))?"":'style="display:none;"'});}x.push(g(j.CALDAY_ROW_TEMPLATE,{calday_row:A}));}w["body_template"]=x.join("\n");var v=g(g(j.CONTENT_TEMPLATE,w),j.CALENDAR_CLASSES);return v;}},{CALENDAR_CLASSES:{calendar_grid_class:d,calendar_body_class:l,calendar_hd_class:h,calendar_hd_wrapper_class:i,calendar_weekdayrow_class:o,calendar_weekday_class:q,calendar_row_class:e,calendar_day_class:a,calendar_dayanchor_class:p},CONTENT_TEMPLATE:'<table class="{calendar_grid_class}">'+"<thead>"+"{header_template}"+"{wdayrow_template}"+"</thead>"+'<tbody class="{calendar_body_class}">'+"{body_template}"+"</tbody>"+"</table>",HEADER_TEMPLATE:"<tr>"+'<th colspan="7" class="{calendar_hd_class}">'+'<div id="calheader" class="{calendar_hd_wrapper_class}">'+"{calheader}"+"</div>"+"</th>"+"</tr>",WEEKDAY_ROW_TEMPLATE:'<tr class="{calendar_weekdayrow_class}">'+"{weekday_row}"+"</tr>",CALDAY_ROW_TEMPLATE:'<tr class="{calendar_row_class}">'+"{calday_row}"+"</tr>",WEEKDAY_TEMPLATE:'<th class="{calendar_weekday_class}">{weekdayname}</th>',CALDAY_TEMPLATE:'<td class="{calendar_day_class}" {day_display_status}>'+'<a href="#" class="{calendar_dayanchor_class}">'+"{day_content}"+"</a>"+"</td>",NAME:"calendarBase",ATTRS:{}});},"3.5.1",{requires:["widget","datatype-date"]});
@@ -1,182 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-YUI.add('calendar-base', function(Y) {--/**- * The Calendar component is a UI widget that allows users- * to view dates in a two-dimensional month grid, as well as- * to select one or more dates, or ranges of dates. Calendar- * is generated dynamically.- *- * @module calendar- * @submodule calendar-base- */--/** Create a calendar view to represent a single or multiple- * month range of dates, rendered as a grid with date and- * weekday labels.- * - * @class CalendarBase- * @extends Widget- * @param config {Object} Configuration object (see Configuration attributes)- * @constructor- */-- -var getCN = Y.ClassNameManager.getClassName,- CALENDAR = 'calendar',- CAL_GRID = getCN(CALENDAR, 'grid'),- CAL_BODY = getCN(CALENDAR, 'body'),- CAL_HD = getCN(CALENDAR, 'header'),- CAL_HD_WRAP = getCN(CALENDAR, 'header-wrap'),- CAL_WDAYROW = getCN(CALENDAR, 'weekdayrow'),- CAL_WDAY = getCN(CALENDAR, 'weekday'),- CAL_ROW = getCN(CALENDAR, 'row'),- CAL_DAY = getCN(CALENDAR, 'day'),- CAL_ANCHOR = getCN(CALENDAR, 'anchor'),-- L = Y.Lang,- create = Y.Node.create,- substitute = Y.substitute,- each = Y.each;---function CalendarBase() {- CalendarBase.superclass.constructor.apply ( this, arguments );-}--Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {- - initializer : function () {- },- - renderUI : function () {- var contentBox = this.get('contentBox');- contentBox.appendChild(this._initCalendarHTML(new Date("5/21/1947")));- },- - bindUI : function () {- - },- - _getCutoffColumn : function (date) {-- var normalizedDate = new Date(date.getFullYear(), date.getMonth(), 1);- return (1-normalizedDate.getDay());-- },- - _initCalendarHTML : function (baseDate) {-- var startDate = baseDate || new Date(),- cutoffCol = this._getCutoffColumn(startDate),- headerData = {calheader: (startDate.getMonth()+1) + "/" + - startDate.getFullYear()},- calString = '',- weekdays = {wday1: 'Su',- wday2: 'Mo',- wday3: 'Tu',- wday4: 'We',- wday5: 'Th',- wday6: 'Fr',- wday7: 'Sa'};-- var partials = {};- partials["header_template"] = substitute(CalendarBase.HEADER_TEMPLATE, - headerData);- - partials["weekday_row"] = '';- - each (weekdays, function (v) {- partials["weekday_row"] += - substitute(CalendarBase.WEEKDAY_TEMPLATE,- {weekdayname: v});- }- );-- partials["wdayrow_template"] = substitute(CalendarBase.WEEKDAY_ROW_TEMPLATE, partials);--- - var row_array = [];-- for (var i = 0; i <= 5; i++) {- var calday_row = '';- for (var j = -5; j <=7; j++) {- calday_row += substitute (CalendarBase.CALDAY_TEMPLATE, {day_content: '' + (j+7*i),- day_display_status: (j >= cutoffCol && j <= (cutoffCol + 6)) ? '' : 'style="display:none;"'});- }- row_array.push(substitute(CalendarBase.CALDAY_ROW_TEMPLATE, {calday_row: calday_row} ));- }- - partials["body_template"] = row_array.join('\n');-- var header = substitute(substitute (CalendarBase.CONTENT_TEMPLATE, partials),- CalendarBase.CALENDAR_CLASSES);-- - return header;- }-}, {- // Y.CalendarBase static properties- - CALENDAR_CLASSES : {- calendar_grid_class : CAL_GRID,- calendar_body_class : CAL_BODY,- calendar_hd_class : CAL_HD,- calendar_hd_wrapper_class: CAL_HD_WRAP,- calendar_weekdayrow_class: CAL_WDAYROW,- calendar_weekday_class: CAL_WDAY,- calendar_row_class: CAL_ROW,- calendar_day_class: CAL_DAY,- calendar_dayanchor_class: CAL_ANCHOR - },- - CONTENT_TEMPLATE: '<table class="{calendar_grid_class}">' +- '<thead>' +- '{header_template}' +- '{wdayrow_template}' +- '</thead>' +- '<tbody class="{calendar_body_class}">' +- '{body_template}' +- '</tbody>' +- '</table>',-- HEADER_TEMPLATE: '<tr>' +- '<th colspan="7" class="{calendar_hd_class}">' + - '<div id="calheader" class="{calendar_hd_wrapper_class}">' +- '{calheader}' +- '</div>' + - '</th>' +- '</tr>',- - WEEKDAY_ROW_TEMPLATE: '<tr class="{calendar_weekdayrow_class}">' + - '{weekday_row}' +- '</tr>',-- CALDAY_ROW_TEMPLATE: '<tr class="{calendar_row_class}">' + - '{calday_row}' + - '</tr>',-- WEEKDAY_TEMPLATE: '<th class="{calendar_weekday_class}">{weekdayname}</th>',-- CALDAY_TEMPLATE: '<td class="{calendar_day_class}" {day_display_status}>' +- '<a href="#" class="{calendar_dayanchor_class}">' +- '{day_content}' +- '</a>' + - '</td>',- - NAME: 'calendarBase',- - ATTRS: {- - }- -});---}, '3.5.1' ,{requires:['widget', 'datatype-date']});
@@ -0,0 +1,759 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/calendar/calendar.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/calendar/calendar.js",+ code: []+};+_yuitest_coverage["build/calendar/calendar.js"].code=["YUI.add('calendar', function (Y, NAME) {","","/**"," * The Calendar component is a UI widget that allows users"," * to view dates in a two-dimensional month grid, as well as"," * to select one or more dates, or ranges of dates. Calendar"," * is generated dynamically and relies on the developer to"," * provide for a progressive enhancement alternative."," *"," *"," * @module calendar"," */","","var getCN = Y.ClassNameManager.getClassName,"," CALENDAR = 'calendar',"," KEY_DOWN = 40,"," KEY_UP = 38,"," KEY_LEFT = 37,"," KEY_RIGHT = 39,"," KEY_ENTER = 13,"," KEY_SPACE = 32,"," CAL_HD = getCN(CALENDAR, 'header'),"," CAL_DAY_SELECTED = getCN(CALENDAR, 'day-selected'),"," CAL_DAY_HILITED = getCN(CALENDAR, 'day-highlighted'),"," CAL_DAY = getCN(CALENDAR, 'day'),"," CAL_PREVMONTH_DAY = getCN(CALENDAR, 'prevmonth-day'),"," CAL_NEXTMONTH_DAY = getCN(CALENDAR, 'nextmonth-day'),"," CAL_GRID = getCN(CALENDAR, 'grid'),"," ydate = Y.DataType.Date,"," delegate = Y.delegate,"," CAL_PANE = getCN(CALENDAR, 'pane'),"," os = Y.UA.os;","","/** Create a calendar view to represent a single or multiple"," * month range of dates, rendered as a grid with date and"," * weekday labels."," * "," * @class Calendar"," * @extends CalendarBase"," * @param config {Object} Configuration object (see Configuration attributes)"," * @constructor"," */","function Calendar(config) {"," Calendar.superclass.constructor.apply ( this, arguments );","}","","Y.Calendar = Y.extend(Calendar, Y.CalendarBase, {",""," _keyEvents: [],",""," _highlightedDateNode: null,",""," /**"," * A property tracking the last selected date on the calendar, for the"," * purposes of multiple selection."," *"," * @property _lastSelectedDate"," * @type Date"," * @default null"," * @private"," */ "," _lastSelectedDate: null,",""," /**"," * Designated initializer. Activates the navigation plugin for the calendar."," *"," * @method initializer"," */ "," initializer : function () {"," this.plug(Y.Plugin.CalendarNavigator);","",""," this._keyEvents = [];"," this._highlightedDateNode = null;"," this._lastSelectedDate = null;"," },",""," /**"," * Overrides the _bindCalendarEvents placeholder in CalendarBase"," * and binds calendar events during bindUI stage."," * @method _bindCalendarEvents"," * @protected"," */ "," _bindCalendarEvents : function () {"," var contentBox = this.get('contentBox'),"," pane = contentBox.one(\".\" + CAL_PANE);"," pane.on(\"selectstart\", this._preventSelectionStart);"," pane.delegate(\"click\", this._clickCalendar, \".\" + CAL_DAY + \", .\" + CAL_PREVMONTH_DAY + \", .\" + CAL_NEXTMONTH_DAY, this);"," pane.delegate(\"keydown\", this._keydownCalendar, \".\" + CAL_GRID, this);"," pane.delegate(\"focus\", this._focusCalendarGrid, \".\" + CAL_GRID, this);"," pane.delegate(\"focus\", this._focusCalendarCell, \".\" + CAL_DAY, this);"," pane.delegate(\"blur\", this._blurCalendarGrid, \".\" + CAL_GRID + \",.\" + CAL_DAY, this);"," },",""," /**"," * Prevents text selection if it is started within the calendar pane"," * @method _preventSelectionStart"," * @param event {Event} The selectstart event"," * @protected"," */ "," _preventSelectionStart : function (event) {"," event.preventDefault();"," },",""," /**"," * Highlights a specific date node with keyboard highlight class"," * @method _highlightDateNode"," * @param oDate {Date} Date corresponding the node to be highlighted"," * @protected"," */ "," _highlightDateNode : function (oDate) {"," this._unhighlightCurrentDateNode();"," var newNode = this._dateToNode(oDate);"," newNode.focus();"," newNode.addClass(CAL_DAY_HILITED);"," },",""," /**"," * Unhighlights a specific date node currently highlighted with keyboard highlight class"," * @method _unhighlightCurrentDateNode"," * @protected"," */ "," _unhighlightCurrentDateNode : function () {"," var allHilitedNodes = this.get(\"contentBox\").all(\".\" + CAL_DAY_HILITED);"," if (allHilitedNodes) {"," allHilitedNodes.removeClass(CAL_DAY_HILITED);"," }"," },",""," /**"," * Returns the grid number for a specific calendar grid (for multi-grid templates)"," * @method _getGridNumber"," * @param gridNode {Node} Node corresponding to a specific grid"," * @protected"," */ "," _getGridNumber : function (gridNode) {"," var idParts = gridNode.get(\"id\").split(\"_\").reverse();"," return parseInt(idParts[0], 10);"," },",""," /**"," * Handler for loss of focus of calendar grid"," * @method _blurCalendarGrid"," * @protected"," */ "," _blurCalendarGrid : function (ev) {"," this._unhighlightCurrentDateNode();"," },","",""," /**"," * Handler for gain of focus of calendar cell"," * @method _focusCalendarCell"," * @protected"," */ "," _focusCalendarCell : function (ev) {"," this._highlightedDateNode = ev.target;"," ev.stopPropagation();"," },",""," /**"," * Handler for gain of focus of calendar grid"," * @method _focusCalendarGrid"," * @protected"," */ "," _focusCalendarGrid : function (ev) { "," this._unhighlightCurrentDateNode();"," this._highlightedDateNode = null;"," },",""," /**"," * Handler for keyboard press on a calendar grid"," * @method _keydownCalendar"," * @protected"," */ "," _keydownCalendar : function (ev) {"," var gridNum = this._getGridNumber(ev.target),"," curDate = !this._highlightedDateNode ? null : this._nodeToDate(this._highlightedDateNode),"," keyCode = ev.keyCode,"," dayNum = 0,"," dir = '';",""," switch(keyCode) {"," case KEY_DOWN: "," dayNum = 7;"," dir = 's';"," break;"," case KEY_UP: "," dayNum = -7;"," dir = 'n';"," break;"," case KEY_LEFT: "," dayNum = -1;"," dir = 'w';"," break;"," case KEY_RIGHT:"," dayNum = 1;"," dir = 'e';"," break;"," case KEY_SPACE: case KEY_ENTER:"," ev.preventDefault();"," if (this._highlightedDateNode) {"," var selMode = this.get(\"selectionMode\");"," if (selMode === \"single\" && !this._highlightedDateNode.hasClass(CAL_DAY_SELECTED)) {"," this._clearSelection(true);"," this._addDateToSelection(curDate);"," }"," else if (selMode === \"multiple\" || selMode === \"multiple-sticky\") {"," if (this._highlightedDateNode.hasClass(CAL_DAY_SELECTED)) {"," this._removeDateFromSelection(curDate);"," }"," else {"," this._addDateToSelection(curDate);"," }"," }"," }"," break;"," }"," ",""," if (keyCode == KEY_DOWN || keyCode == KEY_UP || keyCode == KEY_LEFT || keyCode == KEY_RIGHT) {",""," if (!curDate) {"," curDate = ydate.addMonths(this.get(\"date\"), gridNum);"," dayNum = 0;"," }"," ev.preventDefault();"," var newDate = ydate.addDays(curDate, dayNum),"," startDate = this.get(\"date\"),"," endDate = ydate.addMonths(this.get(\"date\"), this._paneNumber - 1),"," lastPaneDate = new Date(endDate);"," endDate.setDate(ydate.daysInMonth(endDate));"," "," if (ydate.isInRange(newDate, startDate, endDate)) {","/*"," var paneShift = (newDate.getMonth() - curDate.getMonth()) % 10;","",""," if (paneShift != 0) {"," var newGridNum = gridNum + paneShift,"," contentBox = this.get('contentBox'),"," newPane = contentBox.one(\"#\" + this._calendarId + \"_pane_\" + newGridNum);"," newPane.focus();"," }","*/"," this._highlightDateNode(newDate);"," }"," else if (ydate.isGreater(startDate, newDate)) {"," if (!ydate.isGreaterOrEqual(this.get(\"minimumDate\"), startDate)) {"," this.set(\"date\", ydate.addMonths(startDate, -1));"," this._highlightDateNode(newDate);"," }"," }"," else if (ydate.isGreater(newDate, endDate)) {"," if (!ydate.isGreaterOrEqual(lastPaneDate, this.get(\"maximumDate\"))) {"," this.set(\"date\", ydate.addMonths(startDate, 1));"," this._highlightDateNode(newDate);"," }"," }",""," }"," },",""," /**"," * Handles the calendar clicks based on selection mode."," * @method _clickCalendar"," * @param {Event} ev A click event"," * @private"," */ "," _clickCalendar : function (ev) {"," var clickedCell = ev.currentTarget,"," clickedCellIsDay = clickedCell.hasClass(CAL_DAY) && "," !clickedCell.hasClass(CAL_PREVMONTH_DAY) && "," !clickedCell.hasClass(CAL_NEXTMONTH_DAY),"," clickedCellIsSelected = clickedCell.hasClass(CAL_DAY_SELECTED);"," switch (this.get(\"selectionMode\")) {"," case(\"single\"):"," if (clickedCellIsDay) {"," if (!clickedCellIsSelected) {"," this._clearSelection(true); "," this._addDateToSelection(this._nodeToDate(clickedCell));"," }"," }"," break;"," case(\"multiple-sticky\"):"," if (clickedCellIsDay) {"," if (clickedCellIsSelected) {"," this._removeDateFromSelection(this._nodeToDate(clickedCell));"," }"," else {"," this._addDateToSelection(this._nodeToDate(clickedCell));"," }"," }"," break;"," case(\"multiple\"):"," if (clickedCellIsDay) {"," if (!ev.metaKey && !ev.ctrlKey && !ev.shiftKey) {"," this._clearSelection(true);"," this._lastSelectedDate = this._nodeToDate(clickedCell);"," this._addDateToSelection(this._lastSelectedDate);"," }"," else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && !ev.shiftKey) {"," if (clickedCellIsSelected) {"," this._removeDateFromSelection(this._nodeToDate(clickedCell));"," this._lastSelectedDate = null;"," }"," else {"," this._lastSelectedDate = this._nodeToDate(clickedCell);"," this._addDateToSelection(this._lastSelectedDate);"," }"," }"," else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && ev.shiftKey) {"," if (this._lastSelectedDate) {"," var selectedDate = this._nodeToDate(clickedCell);"," this._addDateRangeToSelection(selectedDate, this._lastSelectedDate);"," this._lastSelectedDate = selectedDate;"," }"," else {"," this._lastSelectedDate = this._nodeToDate(clickedCell);"," this._addDateToSelection(this._lastSelectedDate);"," }"," "," }"," else if (ev.shiftKey) {"," if (this._lastSelectedDate) {"," var selectedDate = this._nodeToDate(clickedCell);"," this._clearSelection(true);"," this._addDateRangeToSelection(selectedDate, this._lastSelectedDate);"," this._lastSelectedDate = selectedDate;"," }"," else {"," this._clearSelection(true);"," this._lastSelectedDate = this._nodeToDate(clickedCell);"," this._addDateToSelection(this._lastSelectedDate);"," }"," }"," }"," break;"," }",""," if (clickedCellIsDay) {"," /**"," * Fired when a specific date cell in the calendar is clicked. The event carries a "," * payload which includes a `cell` property corresponding to the node of the actual"," * date cell, and a `date` property, with the `Date` that was clicked."," *"," * @event dateClick"," */"," this.fire(\"dateClick\", {cell: clickedCell, date: this._nodeToDate(clickedCell)});"," }"," else if (clickedCell.hasClass(CAL_PREVMONTH_DAY)) {"," /**"," * Fired when any of the previous month's days displayed before the calendar grid"," * are clicked."," *"," * @event prevMonthClick"," */"," this.fire(\"prevMonthClick\");"," }"," else if (clickedCell.hasClass(CAL_NEXTMONTH_DAY)) {"," /**"," * Fired when any of the next month's days displayed after the calendar grid"," * are clicked."," *"," * @event nextMonthClick"," */"," this.fire(\"nextMonthClick\");"," }"," },",""," /**"," * Subtracts one month from the current calendar view."," * @method subtractMonth"," */ "," subtractMonth : function (e) {"," this.set(\"date\", ydate.addMonths(this.get(\"date\"), -1));"," if (e) {"," e.halt();"," }"," },",""," /**"," * Subtracts one year from the current calendar view."," * @method subtractYear"," */ "," subtractYear : function (e) {"," this.set(\"date\", ydate.addYears(this.get(\"date\"), -1));"," if (e) {"," e.halt();"," }"," },",""," /**"," * Adds one month to the current calendar view."," * @method addMonth"," */ "," addMonth : function (e) { "," this.set(\"date\", ydate.addMonths(this.get(\"date\"), 1));"," if (e) {"," e.halt();"," }"," },",""," /**"," * Adds one year to the current calendar view."," * @method addYear"," */ "," addYear : function (e) {"," this.set(\"date\", ydate.addYears(this.get(\"date\"), 1));"," if (e) {"," e.halt();"," }"," }","},","","{"," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'calendar'"," * @readOnly"," * @protected"," * @static"," */ "," NAME: \"calendar\",",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */ "," ATTRS: {",""," /**"," * A setting specifying the type of selection the calendar allows."," * Possible values include:"," * <ul>"," * <li>`single` - One date at a time</li>"," * <li>`multiple-sticky` - Multiple dates, selected one at a time (the dates \"stick\"). This option"," * is appropriate for mobile devices, where function keys from the keyboard are not available.</li>"," * <li>`multiple` - Multiple dates, selected with Ctrl/Meta keys for additional single"," * dates, and Shift key for date ranges.</li>"," *"," * @attribute selectionMode"," * @type String"," * @default single"," */"," selectionMode: {"," value: \"single\""," },",""," /**"," * The date corresponding to the current calendar view. Always"," * normalized to the first of the month that contains the date"," * at assignment time. Used as the first date visible in the"," * calendar."," *"," * @attribute date"," * @type Date"," * @default Today's date as set on the user's computer."," */"," date: {"," value: new Date(),"," lazyAdd: false,"," setter: function (val) {",""," var newDate = this._normalizeDate(val),"," newTopDate = ydate.addMonths(newDate, this._paneNumber - 1);"," var minDate = this.get(\"minimumDate\");"," var maxDate = this.get(\"maximumDate\");"," if ((!minDate || ydate.isGreaterOrEqual(newDate, minDate)) && "," (!maxDate || ydate.isGreaterOrEqual(maxDate, newTopDate))) {"," return newDate;"," }",""," else if (minDate && ydate.isGreater(minDate, newDate)) {"," return minDate;"," }",""," else if (maxDate && ydate.isGreater(newTopDate, maxDate)) {"," var actualMaxDate = ydate.addMonths(maxDate, -1*(this._paneNumber - 1));"," return actualMaxDate;"," }"," }"," },",""," /**"," * The minimum date that can be displayed by the calendar. The calendar will not"," * allow dates earlier than this one to be set, and will reset any earlier date to"," * this date. Should be `null` if no minimum date is needed."," *"," * @attribute minimumDate"," * @type Date"," * @default null"," */"," minimumDate: {"," value: null,"," setter: function (val) {"," if (val) {"," var curDate = this.get('date'),"," newMinDate = this._normalizeDate(val);"," if (curDate && !ydate.isGreaterOrEqual(curDate, newMinDate)) {"," this.set('date', newMinDate);"," }"," return newMinDate;"," }"," else {"," return this._normalizeDate(val);"," }"," }"," },",""," /**"," * The maximum date that can be displayed by the calendar. The calendar will not"," * allow dates later than this one to be set, and will reset any later date to"," * this date. Should be `null` if no maximum date is needed."," *"," * @attribute maximumDate"," * @type Date"," * @default null"," */"," maximumDate: {"," value: null,"," setter: function (val) {"," if (val) {"," var curDate = this.get('date'),"," newMaxDate = this._normalizeDate(val);"," if (curDate && !ydate.isGreaterOrEqual(val, ydate.addMonths(curDate, this._paneNumber - 1))) {"," this.set('date', ydate.addMonths(newMaxDate, -1*(this._paneNumber -1)));"," }"," return newMaxDate;"," }"," else {"," return val;"," }"," }"," }"," }","});","","}, '3.7.1', {\"requires\": [\"calendar-base\", \"calendarnavigator\"], \"lang\": [\"de\", \"en\", \"fr\", \"ja\", \"nb-NO\", \"pt-BR\", \"ru\", \"zh-HANT-TW\"], \"skinnable\": true});"];+_yuitest_coverage["build/calendar/calendar.js"].lines = {"1":0,"14":0,"43":0,"44":0,"47":0,"70":0,"73":0,"74":0,"75":0,"85":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"102":0,"112":0,"113":0,"114":0,"115":0,"124":0,"125":0,"126":0,"137":0,"138":0,"147":0,"157":0,"158":0,"167":0,"168":0,"177":0,"183":0,"185":0,"186":0,"187":0,"189":0,"190":0,"191":0,"193":0,"194":0,"195":0,"197":0,"198":0,"199":0,"201":0,"202":0,"203":0,"204":0,"205":0,"206":0,"208":0,"209":0,"210":0,"213":0,"217":0,"221":0,"223":0,"224":0,"225":0,"227":0,"228":0,"232":0,"234":0,"246":0,"248":0,"249":0,"250":0,"251":0,"254":0,"255":0,"256":0,"257":0,"271":0,"276":0,"278":0,"279":0,"280":0,"281":0,"284":0,"286":0,"287":0,"288":0,"291":0,"294":0,"296":0,"297":0,"298":0,"299":0,"300":0,"302":0,"303":0,"304":0,"305":0,"308":0,"309":0,"312":0,"313":0,"314":0,"315":0,"316":0,"319":0,"320":0,"324":0,"325":0,"326":0,"327":0,"328":0,"329":0,"332":0,"333":0,"334":0,"338":0,"341":0,"349":0,"351":0,"358":0,"360":0,"367":0,"376":0,"377":0,"378":0,"387":0,"388":0,"389":0,"398":0,"399":0,"400":0,"409":0,"410":0,"411":0,"473":0,"475":0,"476":0,"477":0,"479":0,"482":0,"483":0,"486":0,"487":0,"488":0,"505":0,"506":0,"508":0,"509":0,"511":0,"514":0,"531":0,"532":0,"534":0,"535":0,"537":0,"540":0};+_yuitest_coverage["build/calendar/calendar.js"].functions = {"Calendar:43":0,"initializer:69":0,"_bindCalendarEvents:84":0,"_preventSelectionStart:101":0,"_highlightDateNode:111":0,"_unhighlightCurrentDateNode:123":0,"_getGridNumber:136":0,"_blurCalendarGrid:146":0,"_focusCalendarCell:156":0,"_focusCalendarGrid:166":0,"_keydownCalendar:176":0,"_clickCalendar:270":0,"subtractMonth:375":0,"subtractYear:386":0,"addMonth:397":0,"addYear:408":0,"setter:471":0,"setter:504":0,"setter:530":0,"(anonymous 1):1":0};+_yuitest_coverage["build/calendar/calendar.js"].coveredLines = 153;+_yuitest_coverage["build/calendar/calendar.js"].coveredFunctions = 20;+_yuitest_coverline("build/calendar/calendar.js", 1);+YUI.add('calendar', function (Y, NAME) {++/**+ * The Calendar component is a UI widget that allows users+ * to view dates in a two-dimensional month grid, as well as+ * to select one or more dates, or ranges of dates. Calendar+ * is generated dynamically and relies on the developer to+ * provide for a progressive enhancement alternative.+ *+ *+ * @module calendar+ */++_yuitest_coverfunc("build/calendar/calendar.js", "(anonymous 1)", 1);+_yuitest_coverline("build/calendar/calendar.js", 14);+var getCN = Y.ClassNameManager.getClassName,+ CALENDAR = 'calendar',+ KEY_DOWN = 40,+ KEY_UP = 38,+ KEY_LEFT = 37,+ KEY_RIGHT = 39,+ KEY_ENTER = 13,+ KEY_SPACE = 32,+ CAL_HD = getCN(CALENDAR, 'header'),+ CAL_DAY_SELECTED = getCN(CALENDAR, 'day-selected'),+ CAL_DAY_HILITED = getCN(CALENDAR, 'day-highlighted'),+ CAL_DAY = getCN(CALENDAR, 'day'),+ CAL_PREVMONTH_DAY = getCN(CALENDAR, 'prevmonth-day'),+ CAL_NEXTMONTH_DAY = getCN(CALENDAR, 'nextmonth-day'),+ CAL_GRID = getCN(CALENDAR, 'grid'),+ ydate = Y.DataType.Date,+ delegate = Y.delegate,+ CAL_PANE = getCN(CALENDAR, 'pane'),+ os = Y.UA.os;++/** Create a calendar view to represent a single or multiple+ * month range of dates, rendered as a grid with date and+ * weekday labels.+ * + * @class Calendar+ * @extends CalendarBase+ * @param config {Object} Configuration object (see Configuration attributes)+ * @constructor+ */+_yuitest_coverline("build/calendar/calendar.js", 43);+function Calendar(config) {+ _yuitest_coverfunc("build/calendar/calendar.js", "Calendar", 43);+_yuitest_coverline("build/calendar/calendar.js", 44);+Calendar.superclass.constructor.apply ( this, arguments );+}++_yuitest_coverline("build/calendar/calendar.js", 47);+Y.Calendar = Y.extend(Calendar, Y.CalendarBase, {++ _keyEvents: [],++ _highlightedDateNode: null,++ /**+ * A property tracking the last selected date on the calendar, for the+ * purposes of multiple selection.+ *+ * @property _lastSelectedDate+ * @type Date+ * @default null+ * @private+ */ + _lastSelectedDate: null,++ /**+ * Designated initializer. Activates the navigation plugin for the calendar.+ *+ * @method initializer+ */ + initializer : function () {+ _yuitest_coverfunc("build/calendar/calendar.js", "initializer", 69);+_yuitest_coverline("build/calendar/calendar.js", 70);+this.plug(Y.Plugin.CalendarNavigator);+++ _yuitest_coverline("build/calendar/calendar.js", 73);+this._keyEvents = [];+ _yuitest_coverline("build/calendar/calendar.js", 74);+this._highlightedDateNode = null;+ _yuitest_coverline("build/calendar/calendar.js", 75);+this._lastSelectedDate = null;+ },++ /**+ * Overrides the _bindCalendarEvents placeholder in CalendarBase+ * and binds calendar events during bindUI stage.+ * @method _bindCalendarEvents+ * @protected+ */ + _bindCalendarEvents : function () {+ _yuitest_coverfunc("build/calendar/calendar.js", "_bindCalendarEvents", 84);+_yuitest_coverline("build/calendar/calendar.js", 85);+var contentBox = this.get('contentBox'),+ pane = contentBox.one("." + CAL_PANE);+ _yuitest_coverline("build/calendar/calendar.js", 87);+pane.on("selectstart", this._preventSelectionStart);+ _yuitest_coverline("build/calendar/calendar.js", 88);+pane.delegate("click", this._clickCalendar, "." + CAL_DAY + ", ." + CAL_PREVMONTH_DAY + ", ." + CAL_NEXTMONTH_DAY, this);+ _yuitest_coverline("build/calendar/calendar.js", 89);+pane.delegate("keydown", this._keydownCalendar, "." + CAL_GRID, this);+ _yuitest_coverline("build/calendar/calendar.js", 90);+pane.delegate("focus", this._focusCalendarGrid, "." + CAL_GRID, this);+ _yuitest_coverline("build/calendar/calendar.js", 91);+pane.delegate("focus", this._focusCalendarCell, "." + CAL_DAY, this);+ _yuitest_coverline("build/calendar/calendar.js", 92);+pane.delegate("blur", this._blurCalendarGrid, "." + CAL_GRID + ",." + CAL_DAY, this);+ },++ /**+ * Prevents text selection if it is started within the calendar pane+ * @method _preventSelectionStart+ * @param event {Event} The selectstart event+ * @protected+ */ + _preventSelectionStart : function (event) {+ _yuitest_coverfunc("build/calendar/calendar.js", "_preventSelectionStart", 101);+_yuitest_coverline("build/calendar/calendar.js", 102);+event.preventDefault();+ },++ /**+ * Highlights a specific date node with keyboard highlight class+ * @method _highlightDateNode+ * @param oDate {Date} Date corresponding the node to be highlighted+ * @protected+ */ + _highlightDateNode : function (oDate) {+ _yuitest_coverfunc("build/calendar/calendar.js", "_highlightDateNode", 111);+_yuitest_coverline("build/calendar/calendar.js", 112);+this._unhighlightCurrentDateNode();+ _yuitest_coverline("build/calendar/calendar.js", 113);+var newNode = this._dateToNode(oDate);+ _yuitest_coverline("build/calendar/calendar.js", 114);+newNode.focus();+ _yuitest_coverline("build/calendar/calendar.js", 115);+newNode.addClass(CAL_DAY_HILITED);+ },++ /**+ * Unhighlights a specific date node currently highlighted with keyboard highlight class+ * @method _unhighlightCurrentDateNode+ * @protected+ */ + _unhighlightCurrentDateNode : function () {+ _yuitest_coverfunc("build/calendar/calendar.js", "_unhighlightCurrentDateNode", 123);+_yuitest_coverline("build/calendar/calendar.js", 124);+var allHilitedNodes = this.get("contentBox").all("." + CAL_DAY_HILITED);+ _yuitest_coverline("build/calendar/calendar.js", 125);+if (allHilitedNodes) {+ _yuitest_coverline("build/calendar/calendar.js", 126);+allHilitedNodes.removeClass(CAL_DAY_HILITED);+ }+ },++ /**+ * Returns the grid number for a specific calendar grid (for multi-grid templates)+ * @method _getGridNumber+ * @param gridNode {Node} Node corresponding to a specific grid+ * @protected+ */ + _getGridNumber : function (gridNode) {+ _yuitest_coverfunc("build/calendar/calendar.js", "_getGridNumber", 136);+_yuitest_coverline("build/calendar/calendar.js", 137);+var idParts = gridNode.get("id").split("_").reverse();+ _yuitest_coverline("build/calendar/calendar.js", 138);+return parseInt(idParts[0], 10);+ },++ /**+ * Handler for loss of focus of calendar grid+ * @method _blurCalendarGrid+ * @protected+ */ + _blurCalendarGrid : function (ev) {+ _yuitest_coverfunc("build/calendar/calendar.js", "_blurCalendarGrid", 146);+_yuitest_coverline("build/calendar/calendar.js", 147);+this._unhighlightCurrentDateNode();+ },+++ /**+ * Handler for gain of focus of calendar cell+ * @method _focusCalendarCell+ * @protected+ */ + _focusCalendarCell : function (ev) {+ _yuitest_coverfunc("build/calendar/calendar.js", "_focusCalendarCell", 156);+_yuitest_coverline("build/calendar/calendar.js", 157);+this._highlightedDateNode = ev.target;+ _yuitest_coverline("build/calendar/calendar.js", 158);+ev.stopPropagation();+ },++ /**+ * Handler for gain of focus of calendar grid+ * @method _focusCalendarGrid+ * @protected+ */ + _focusCalendarGrid : function (ev) { + _yuitest_coverfunc("build/calendar/calendar.js", "_focusCalendarGrid", 166);+_yuitest_coverline("build/calendar/calendar.js", 167);+this._unhighlightCurrentDateNode();+ _yuitest_coverline("build/calendar/calendar.js", 168);+this._highlightedDateNode = null;+ },++ /**+ * Handler for keyboard press on a calendar grid+ * @method _keydownCalendar+ * @protected+ */ + _keydownCalendar : function (ev) {+ _yuitest_coverfunc("build/calendar/calendar.js", "_keydownCalendar", 176);+_yuitest_coverline("build/calendar/calendar.js", 177);+var gridNum = this._getGridNumber(ev.target),+ curDate = !this._highlightedDateNode ? null : this._nodeToDate(this._highlightedDateNode),+ keyCode = ev.keyCode,+ dayNum = 0,+ dir = '';++ _yuitest_coverline("build/calendar/calendar.js", 183);+switch(keyCode) {+ case KEY_DOWN: + _yuitest_coverline("build/calendar/calendar.js", 185);+dayNum = 7;+ _yuitest_coverline("build/calendar/calendar.js", 186);+dir = 's';+ _yuitest_coverline("build/calendar/calendar.js", 187);+break;+ case KEY_UP: + _yuitest_coverline("build/calendar/calendar.js", 189);+dayNum = -7;+ _yuitest_coverline("build/calendar/calendar.js", 190);+dir = 'n';+ _yuitest_coverline("build/calendar/calendar.js", 191);+break;+ case KEY_LEFT: + _yuitest_coverline("build/calendar/calendar.js", 193);+dayNum = -1;+ _yuitest_coverline("build/calendar/calendar.js", 194);+dir = 'w';+ _yuitest_coverline("build/calendar/calendar.js", 195);+break;+ case KEY_RIGHT:+ _yuitest_coverline("build/calendar/calendar.js", 197);+dayNum = 1;+ _yuitest_coverline("build/calendar/calendar.js", 198);+dir = 'e';+ _yuitest_coverline("build/calendar/calendar.js", 199);+break;+ case KEY_SPACE: case KEY_ENTER:+ _yuitest_coverline("build/calendar/calendar.js", 201);+ev.preventDefault();+ _yuitest_coverline("build/calendar/calendar.js", 202);+if (this._highlightedDateNode) {+ _yuitest_coverline("build/calendar/calendar.js", 203);+var selMode = this.get("selectionMode");+ _yuitest_coverline("build/calendar/calendar.js", 204);+if (selMode === "single" && !this._highlightedDateNode.hasClass(CAL_DAY_SELECTED)) {+ _yuitest_coverline("build/calendar/calendar.js", 205);+this._clearSelection(true);+ _yuitest_coverline("build/calendar/calendar.js", 206);+this._addDateToSelection(curDate);+ }+ else {_yuitest_coverline("build/calendar/calendar.js", 208);+if (selMode === "multiple" || selMode === "multiple-sticky") {+ _yuitest_coverline("build/calendar/calendar.js", 209);+if (this._highlightedDateNode.hasClass(CAL_DAY_SELECTED)) {+ _yuitest_coverline("build/calendar/calendar.js", 210);+this._removeDateFromSelection(curDate);+ }+ else {+ _yuitest_coverline("build/calendar/calendar.js", 213);+this._addDateToSelection(curDate);+ }+ }}+ }+ _yuitest_coverline("build/calendar/calendar.js", 217);+break;+ }+ ++ _yuitest_coverline("build/calendar/calendar.js", 221);+if (keyCode == KEY_DOWN || keyCode == KEY_UP || keyCode == KEY_LEFT || keyCode == KEY_RIGHT) {++ _yuitest_coverline("build/calendar/calendar.js", 223);+if (!curDate) {+ _yuitest_coverline("build/calendar/calendar.js", 224);+curDate = ydate.addMonths(this.get("date"), gridNum);+ _yuitest_coverline("build/calendar/calendar.js", 225);+dayNum = 0;+ }+ _yuitest_coverline("build/calendar/calendar.js", 227);+ev.preventDefault();+ _yuitest_coverline("build/calendar/calendar.js", 228);+var newDate = ydate.addDays(curDate, dayNum),+ startDate = this.get("date"),+ endDate = ydate.addMonths(this.get("date"), this._paneNumber - 1),+ lastPaneDate = new Date(endDate);+ _yuitest_coverline("build/calendar/calendar.js", 232);+endDate.setDate(ydate.daysInMonth(endDate));+ + _yuitest_coverline("build/calendar/calendar.js", 234);+if (ydate.isInRange(newDate, startDate, endDate)) {+/*+ var paneShift = (newDate.getMonth() - curDate.getMonth()) % 10;+++ if (paneShift != 0) {+ var newGridNum = gridNum + paneShift,+ contentBox = this.get('contentBox'),+ newPane = contentBox.one("#" + this._calendarId + "_pane_" + newGridNum);+ newPane.focus();+ }+*/+ _yuitest_coverline("build/calendar/calendar.js", 246);+this._highlightDateNode(newDate);+ }+ else {_yuitest_coverline("build/calendar/calendar.js", 248);+if (ydate.isGreater(startDate, newDate)) {+ _yuitest_coverline("build/calendar/calendar.js", 249);+if (!ydate.isGreaterOrEqual(this.get("minimumDate"), startDate)) {+ _yuitest_coverline("build/calendar/calendar.js", 250);+this.set("date", ydate.addMonths(startDate, -1));+ _yuitest_coverline("build/calendar/calendar.js", 251);+this._highlightDateNode(newDate);+ }+ }+ else {_yuitest_coverline("build/calendar/calendar.js", 254);+if (ydate.isGreater(newDate, endDate)) {+ _yuitest_coverline("build/calendar/calendar.js", 255);+if (!ydate.isGreaterOrEqual(lastPaneDate, this.get("maximumDate"))) {+ _yuitest_coverline("build/calendar/calendar.js", 256);+this.set("date", ydate.addMonths(startDate, 1));+ _yuitest_coverline("build/calendar/calendar.js", 257);+this._highlightDateNode(newDate);+ }+ }}}++ }+ },++ /**+ * Handles the calendar clicks based on selection mode.+ * @method _clickCalendar+ * @param {Event} ev A click event+ * @private+ */ + _clickCalendar : function (ev) {+ _yuitest_coverfunc("build/calendar/calendar.js", "_clickCalendar", 270);+_yuitest_coverline("build/calendar/calendar.js", 271);+var clickedCell = ev.currentTarget,+ clickedCellIsDay = clickedCell.hasClass(CAL_DAY) && + !clickedCell.hasClass(CAL_PREVMONTH_DAY) && + !clickedCell.hasClass(CAL_NEXTMONTH_DAY),+ clickedCellIsSelected = clickedCell.hasClass(CAL_DAY_SELECTED);+ _yuitest_coverline("build/calendar/calendar.js", 276);+switch (this.get("selectionMode")) {+ case("single"):+ _yuitest_coverline("build/calendar/calendar.js", 278);+if (clickedCellIsDay) {+ _yuitest_coverline("build/calendar/calendar.js", 279);+if (!clickedCellIsSelected) {+ _yuitest_coverline("build/calendar/calendar.js", 280);+this._clearSelection(true); + _yuitest_coverline("build/calendar/calendar.js", 281);+this._addDateToSelection(this._nodeToDate(clickedCell));+ }+ }+ _yuitest_coverline("build/calendar/calendar.js", 284);+break;+ case("multiple-sticky"):+ _yuitest_coverline("build/calendar/calendar.js", 286);+if (clickedCellIsDay) {+ _yuitest_coverline("build/calendar/calendar.js", 287);+if (clickedCellIsSelected) {+ _yuitest_coverline("build/calendar/calendar.js", 288);+this._removeDateFromSelection(this._nodeToDate(clickedCell));+ }+ else {+ _yuitest_coverline("build/calendar/calendar.js", 291);+this._addDateToSelection(this._nodeToDate(clickedCell));+ }+ }+ _yuitest_coverline("build/calendar/calendar.js", 294);+break;+ case("multiple"):+ _yuitest_coverline("build/calendar/calendar.js", 296);+if (clickedCellIsDay) {+ _yuitest_coverline("build/calendar/calendar.js", 297);+if (!ev.metaKey && !ev.ctrlKey && !ev.shiftKey) {+ _yuitest_coverline("build/calendar/calendar.js", 298);+this._clearSelection(true);+ _yuitest_coverline("build/calendar/calendar.js", 299);+this._lastSelectedDate = this._nodeToDate(clickedCell);+ _yuitest_coverline("build/calendar/calendar.js", 300);+this._addDateToSelection(this._lastSelectedDate);+ }+ else {_yuitest_coverline("build/calendar/calendar.js", 302);+if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && !ev.shiftKey) {+ _yuitest_coverline("build/calendar/calendar.js", 303);+if (clickedCellIsSelected) {+ _yuitest_coverline("build/calendar/calendar.js", 304);+this._removeDateFromSelection(this._nodeToDate(clickedCell));+ _yuitest_coverline("build/calendar/calendar.js", 305);+this._lastSelectedDate = null;+ }+ else {+ _yuitest_coverline("build/calendar/calendar.js", 308);+this._lastSelectedDate = this._nodeToDate(clickedCell);+ _yuitest_coverline("build/calendar/calendar.js", 309);+this._addDateToSelection(this._lastSelectedDate);+ }+ }+ else {_yuitest_coverline("build/calendar/calendar.js", 312);+if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && ev.shiftKey) {+ _yuitest_coverline("build/calendar/calendar.js", 313);+if (this._lastSelectedDate) {+ _yuitest_coverline("build/calendar/calendar.js", 314);+var selectedDate = this._nodeToDate(clickedCell);+ _yuitest_coverline("build/calendar/calendar.js", 315);+this._addDateRangeToSelection(selectedDate, this._lastSelectedDate);+ _yuitest_coverline("build/calendar/calendar.js", 316);+this._lastSelectedDate = selectedDate;+ }+ else {+ _yuitest_coverline("build/calendar/calendar.js", 319);+this._lastSelectedDate = this._nodeToDate(clickedCell);+ _yuitest_coverline("build/calendar/calendar.js", 320);+this._addDateToSelection(this._lastSelectedDate);+ }+ + }+ else {_yuitest_coverline("build/calendar/calendar.js", 324);+if (ev.shiftKey) {+ _yuitest_coverline("build/calendar/calendar.js", 325);+if (this._lastSelectedDate) {+ _yuitest_coverline("build/calendar/calendar.js", 326);+var selectedDate = this._nodeToDate(clickedCell);+ _yuitest_coverline("build/calendar/calendar.js", 327);+this._clearSelection(true);+ _yuitest_coverline("build/calendar/calendar.js", 328);+this._addDateRangeToSelection(selectedDate, this._lastSelectedDate);+ _yuitest_coverline("build/calendar/calendar.js", 329);+this._lastSelectedDate = selectedDate;+ }+ else {+ _yuitest_coverline("build/calendar/calendar.js", 332);+this._clearSelection(true);+ _yuitest_coverline("build/calendar/calendar.js", 333);+this._lastSelectedDate = this._nodeToDate(clickedCell);+ _yuitest_coverline("build/calendar/calendar.js", 334);+this._addDateToSelection(this._lastSelectedDate);+ }+ }}}}+ }+ _yuitest_coverline("build/calendar/calendar.js", 338);+break;+ }++ _yuitest_coverline("build/calendar/calendar.js", 341);+if (clickedCellIsDay) {+ /**+ * Fired when a specific date cell in the calendar is clicked. The event carries a + * payload which includes a `cell` property corresponding to the node of the actual+ * date cell, and a `date` property, with the `Date` that was clicked.+ *+ * @event dateClick+ */+ _yuitest_coverline("build/calendar/calendar.js", 349);+this.fire("dateClick", {cell: clickedCell, date: this._nodeToDate(clickedCell)});+ }+ else {_yuitest_coverline("build/calendar/calendar.js", 351);+if (clickedCell.hasClass(CAL_PREVMONTH_DAY)) {+ /**+ * Fired when any of the previous month's days displayed before the calendar grid+ * are clicked.+ *+ * @event prevMonthClick+ */+ _yuitest_coverline("build/calendar/calendar.js", 358);+this.fire("prevMonthClick");+ }+ else {_yuitest_coverline("build/calendar/calendar.js", 360);+if (clickedCell.hasClass(CAL_NEXTMONTH_DAY)) {+ /**+ * Fired when any of the next month's days displayed after the calendar grid+ * are clicked.+ *+ * @event nextMonthClick+ */+ _yuitest_coverline("build/calendar/calendar.js", 367);+this.fire("nextMonthClick");+ }}}+ },++ /**+ * Subtracts one month from the current calendar view.+ * @method subtractMonth+ */ + subtractMonth : function (e) {+ _yuitest_coverfunc("build/calendar/calendar.js", "subtractMonth", 375);+_yuitest_coverline("build/calendar/calendar.js", 376);+this.set("date", ydate.addMonths(this.get("date"), -1));+ _yuitest_coverline("build/calendar/calendar.js", 377);+if (e) {+ _yuitest_coverline("build/calendar/calendar.js", 378);+e.halt();+ }+ },++ /**+ * Subtracts one year from the current calendar view.+ * @method subtractYear+ */ + subtractYear : function (e) {+ _yuitest_coverfunc("build/calendar/calendar.js", "subtractYear", 386);+_yuitest_coverline("build/calendar/calendar.js", 387);+this.set("date", ydate.addYears(this.get("date"), -1));+ _yuitest_coverline("build/calendar/calendar.js", 388);+if (e) {+ _yuitest_coverline("build/calendar/calendar.js", 389);+e.halt();+ }+ },++ /**+ * Adds one month to the current calendar view.+ * @method addMonth+ */ + addMonth : function (e) { + _yuitest_coverfunc("build/calendar/calendar.js", "addMonth", 397);+_yuitest_coverline("build/calendar/calendar.js", 398);+this.set("date", ydate.addMonths(this.get("date"), 1));+ _yuitest_coverline("build/calendar/calendar.js", 399);+if (e) {+ _yuitest_coverline("build/calendar/calendar.js", 400);+e.halt();+ }+ },++ /**+ * Adds one year to the current calendar view.+ * @method addYear+ */ + addYear : function (e) {+ _yuitest_coverfunc("build/calendar/calendar.js", "addYear", 408);+_yuitest_coverline("build/calendar/calendar.js", 409);+this.set("date", ydate.addYears(this.get("date"), 1));+ _yuitest_coverline("build/calendar/calendar.js", 410);+if (e) {+ _yuitest_coverline("build/calendar/calendar.js", 411);+e.halt();+ }+ }+},++{+ /**+ * The identity of the widget.+ *+ * @property NAME+ * @type String+ * @default 'calendar'+ * @readOnly+ * @protected+ * @static+ */ + NAME: "calendar",++ /**+ * Static property used to define the default attribute configuration of+ * the Widget.+ *+ * @property ATTRS+ * @type {Object}+ * @protected+ * @static+ */ + ATTRS: {++ /**+ * A setting specifying the type of selection the calendar allows.+ * Possible values include:+ * <ul>+ * <li>`single` - One date at a time</li>+ * <li>`multiple-sticky` - Multiple dates, selected one at a time (the dates "stick"). This option+ * is appropriate for mobile devices, where function keys from the keyboard are not available.</li>+ * <li>`multiple` - Multiple dates, selected with Ctrl/Meta keys for additional single+ * dates, and Shift key for date ranges.</li>+ *+ * @attribute selectionMode+ * @type String+ * @default single+ */+ selectionMode: {+ value: "single"+ },++ /**+ * The date corresponding to the current calendar view. Always+ * normalized to the first of the month that contains the date+ * at assignment time. Used as the first date visible in the+ * calendar.+ *+ * @attribute date+ * @type Date+ * @default Today's date as set on the user's computer.+ */+ date: {+ value: new Date(),+ lazyAdd: false,+ setter: function (val) {++ _yuitest_coverfunc("build/calendar/calendar.js", "setter", 471);+_yuitest_coverline("build/calendar/calendar.js", 473);+var newDate = this._normalizeDate(val),+ newTopDate = ydate.addMonths(newDate, this._paneNumber - 1);+ _yuitest_coverline("build/calendar/calendar.js", 475);+var minDate = this.get("minimumDate");+ _yuitest_coverline("build/calendar/calendar.js", 476);+var maxDate = this.get("maximumDate");+ _yuitest_coverline("build/calendar/calendar.js", 477);+if ((!minDate || ydate.isGreaterOrEqual(newDate, minDate)) && + (!maxDate || ydate.isGreaterOrEqual(maxDate, newTopDate))) {+ _yuitest_coverline("build/calendar/calendar.js", 479);+return newDate;+ }++ else {_yuitest_coverline("build/calendar/calendar.js", 482);+if (minDate && ydate.isGreater(minDate, newDate)) {+ _yuitest_coverline("build/calendar/calendar.js", 483);+return minDate;+ }++ else {_yuitest_coverline("build/calendar/calendar.js", 486);+if (maxDate && ydate.isGreater(newTopDate, maxDate)) {+ _yuitest_coverline("build/calendar/calendar.js", 487);+var actualMaxDate = ydate.addMonths(maxDate, -1*(this._paneNumber - 1));+ _yuitest_coverline("build/calendar/calendar.js", 488);+return actualMaxDate;+ }}}+ }+ },++ /**+ * The minimum date that can be displayed by the calendar. The calendar will not+ * allow dates earlier than this one to be set, and will reset any earlier date to+ * this date. Should be `null` if no minimum date is needed.+ *+ * @attribute minimumDate+ * @type Date+ * @default null+ */+ minimumDate: {+ value: null,+ setter: function (val) {+ _yuitest_coverfunc("build/calendar/calendar.js", "setter", 504);+_yuitest_coverline("build/calendar/calendar.js", 505);+if (val) {+ _yuitest_coverline("build/calendar/calendar.js", 506);+var curDate = this.get('date'),+ newMinDate = this._normalizeDate(val);+ _yuitest_coverline("build/calendar/calendar.js", 508);+if (curDate && !ydate.isGreaterOrEqual(curDate, newMinDate)) {+ _yuitest_coverline("build/calendar/calendar.js", 509);+this.set('date', newMinDate);+ }+ _yuitest_coverline("build/calendar/calendar.js", 511);+return newMinDate;+ }+ else {+ _yuitest_coverline("build/calendar/calendar.js", 514);+return this._normalizeDate(val);+ }+ }+ },++ /**+ * The maximum date that can be displayed by the calendar. The calendar will not+ * allow dates later than this one to be set, and will reset any later date to+ * this date. Should be `null` if no maximum date is needed.+ *+ * @attribute maximumDate+ * @type Date+ * @default null+ */+ maximumDate: {+ value: null,+ setter: function (val) {+ _yuitest_coverfunc("build/calendar/calendar.js", "setter", 530);+_yuitest_coverline("build/calendar/calendar.js", 531);+if (val) {+ _yuitest_coverline("build/calendar/calendar.js", 532);+var curDate = this.get('date'),+ newMaxDate = this._normalizeDate(val);+ _yuitest_coverline("build/calendar/calendar.js", 534);+if (curDate && !ydate.isGreaterOrEqual(val, ydate.addMonths(curDate, this._paneNumber - 1))) {+ _yuitest_coverline("build/calendar/calendar.js", 535);+this.set('date', ydate.addMonths(newMaxDate, -1*(this._paneNumber -1)));+ }+ _yuitest_coverline("build/calendar/calendar.js", 537);+return newMaxDate;+ }+ else {+ _yuitest_coverline("build/calendar/calendar.js", 540);+return val;+ }+ }+ }+ }+});++}, '3.7.1', {"requires": ["calendar-base", "calendarnavigator"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('calendar', function(Y) {+YUI.add('calendar', function (Y, NAME) { /** * The Calendar component is a UI widget that allows users@@ -82,16 +82,6 @@ }, /**- * syncUI implementation- *- * Update the scroll position, based on the current value of scrollY- * @method syncUI- */ - syncUI : function () {-- },-- /** * Overrides the _bindCalendarEvents placeholder in CalendarBase * and binds calendar events during bindUI stage. * @method _bindCalendarEvents@@ -100,8 +90,8 @@ _bindCalendarEvents : function () { var contentBox = this.get('contentBox'), pane = contentBox.one("." + CAL_PANE);- pane.on("selectstart", function (ev) { ev.preventDefault();});- pane.delegate("click", this._clickCalendar, "." + CAL_DAY, this);+ pane.on("selectstart", this._preventSelectionStart);+ pane.delegate("click", this._clickCalendar, "." + CAL_DAY + ", ." + CAL_PREVMONTH_DAY + ", ." + CAL_NEXTMONTH_DAY, this); pane.delegate("keydown", this._keydownCalendar, "." + CAL_GRID, this); pane.delegate("focus", this._focusCalendarGrid, "." + CAL_GRID, this); pane.delegate("focus", this._focusCalendarCell, "." + CAL_DAY, this);@@ -109,6 +99,16 @@ }, /**+ * Prevents text selection if it is started within the calendar pane+ * @method _preventSelectionStart+ * @param event {Event} The selectstart event+ * @protected+ */ + _preventSelectionStart : function (event) {+ event.preventDefault();+ },++ /** * Highlights a specific date node with keyboard highlight class * @method _highlightDateNode * @param oDate {Date} Date corresponding the node to be highlighted@@ -274,7 +274,7 @@ * @private */ _clickCalendar : function (ev) {- var clickedCell = ev.target,+ var clickedCell = ev.currentTarget, clickedCellIsDay = clickedCell.hasClass(CAL_DAY) && !clickedCell.hasClass(CAL_PREVMONTH_DAY) && !clickedCell.hasClass(CAL_NEXTMONTH_DAY),@@ -299,47 +299,49 @@ } break; case("multiple"):- if (!ev.metaKey && !ev.ctrlKey && !ev.shiftKey) {- this._clearSelection(true);- this._lastSelectedDate = this._nodeToDate(clickedCell);- this._addDateToSelection(this._lastSelectedDate);- }- else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && !ev.shiftKey) {- if (clickedCellIsSelected) {- this._removeDateFromSelection(this._nodeToDate(clickedCell));- this._lastSelectedDate = null;- }- else {- this._lastSelectedDate = this._nodeToDate(clickedCell);- this._addDateToSelection(this._lastSelectedDate);- }- }- else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && ev.shiftKey) {- if (this._lastSelectedDate) {- var selectedDate = this._nodeToDate(clickedCell);- this._addDateRangeToSelection(selectedDate, this._lastSelectedDate);- this._lastSelectedDate = selectedDate;- }- else {- this._lastSelectedDate = this._nodeToDate(clickedCell);- this._addDateToSelection(this._lastSelectedDate);- }-- }- else if (ev.shiftKey) {+ if (clickedCellIsDay) {+ if (!ev.metaKey && !ev.ctrlKey && !ev.shiftKey) {+ this._clearSelection(true);+ this._lastSelectedDate = this._nodeToDate(clickedCell);+ this._addDateToSelection(this._lastSelectedDate);+ }+ else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && !ev.shiftKey) {+ if (clickedCellIsSelected) {+ this._removeDateFromSelection(this._nodeToDate(clickedCell));+ this._lastSelectedDate = null;+ }+ else {+ this._lastSelectedDate = this._nodeToDate(clickedCell);+ this._addDateToSelection(this._lastSelectedDate);+ }+ }+ else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && ev.shiftKey) { if (this._lastSelectedDate) { var selectedDate = this._nodeToDate(clickedCell);- this._clearSelection(true); this._addDateRangeToSelection(selectedDate, this._lastSelectedDate); this._lastSelectedDate = selectedDate; } else {- this._clearSelection(true); this._lastSelectedDate = this._nodeToDate(clickedCell);- this._addDateToSelection(this._lastSelectedDate);+ this._addDateToSelection(this._lastSelectedDate); }- }- break;+ + }+ else if (ev.shiftKey) {+ if (this._lastSelectedDate) {+ var selectedDate = this._nodeToDate(clickedCell);+ this._clearSelection(true);+ this._addDateRangeToSelection(selectedDate, this._lastSelectedDate);+ this._lastSelectedDate = selectedDate;+ }+ else {+ this._clearSelection(true);+ this._lastSelectedDate = this._nodeToDate(clickedCell);+ this._addDateToSelection(this._lastSelectedDate);+ }+ }+ }+ break; } if (clickedCellIsDay) {@@ -378,7 +380,9 @@ */ subtractMonth : function (e) { this.set("date", ydate.addMonths(this.get("date"), -1));- e.halt();+ if (e) {+ e.halt();+ } }, /**@@ -387,7 +391,9 @@ */ subtractYear : function (e) { this.set("date", ydate.addYears(this.get("date"), -1));- e.halt();+ if (e) {+ e.halt();+ } }, /**@@ -396,7 +402,9 @@ */ addMonth : function (e) { this.set("date", ydate.addMonths(this.get("date"), 1));- e.halt();+ if (e) {+ e.halt();+ } }, /**@@ -405,7 +413,9 @@ */ addYear : function (e) { this.set("date", ydate.addYears(this.get("date"), 1));- e.halt();+ if (e) {+ e.halt();+ } } }, @@ -540,5 +550,4 @@ } }); --}, '3.5.1' ,{requires:['calendar-base', 'calendarnavigator'], lang:['de', 'en', 'fr', 'ja', 'nb-NO', 'pt-BR', 'ru', 'zh-HANT-TW']});+}, '3.7.1', {"requires": ["calendar-base", "calendarnavigator"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("calendar",function(c){var s=c.ClassNameManager.getClassName,n="calendar",e=40,p=38,t=37,i=39,f=13,g=32,m=s(n,"header"),d=s(n,"day-selected"),b=s(n,"day-highlighted"),r=s(n,"day"),a=s(n,"prevmonth-day"),o=s(n,"nextmonth-day"),j=s(n,"grid"),k=c.DataType.Date,q=c.delegate,u=s(n,"pane"),h=c.UA.os;function l(v){l.superclass.constructor.apply(this,arguments);}c.Calendar=c.extend(l,c.CalendarBase,{_keyEvents:[],_highlightedDateNode:null,_lastSelectedDate:null,initializer:function(){this.plug(c.Plugin.CalendarNavigator);this._keyEvents=[];this._highlightedDateNode=null;this._lastSelectedDate=null;},syncUI:function(){},_bindCalendarEvents:function(){var v=this.get("contentBox"),w=v.one("."+u);w.on("selectstart",function(x){x.preventDefault();});w.delegate("click",this._clickCalendar,"."+r,this);w.delegate("keydown",this._keydownCalendar,"."+j,this);w.delegate("focus",this._focusCalendarGrid,"."+j,this);w.delegate("focus",this._focusCalendarCell,"."+r,this);w.delegate("blur",this._blurCalendarGrid,"."+j+",."+r,this);},_highlightDateNode:function(w){this._unhighlightCurrentDateNode();var v=this._dateToNode(w);v.focus();v.addClass(b);},_unhighlightCurrentDateNode:function(){var v=this.get("contentBox").all("."+b);if(v){v.removeClass(b);}},_getGridNumber:function(w){var v=w.get("id").split("_").reverse();return parseInt(v[0],10);},_blurCalendarGrid:function(v){this._unhighlightCurrentDateNode();},_focusCalendarCell:function(v){this._highlightedDateNode=v.target;v.stopPropagation();},_focusCalendarGrid:function(v){this._unhighlightCurrentDateNode();this._highlightedDateNode=null;},_keydownCalendar:function(D){var x=this._getGridNumber(D.target),z=!this._highlightedDateNode?null:this._nodeToDate(this._highlightedDateNode),F=D.keyCode,w=0,y="";switch(F){case e:w=7;y="s";break;case p:w=-7;y="n";break;case t:w=-1;y="w";break;case i:w=1;y="e";break;case g:case f:D.preventDefault();if(this._highlightedDateNode){var C=this.get("selectionMode");if(C==="single"&&!this._highlightedDateNode.hasClass(d)){this._clearSelection(true);this._addDateToSelection(z);}else{if(C==="multiple"||C==="multiple-sticky"){if(this._highlightedDateNode.hasClass(d)){this._removeDateFromSelection(z);}else{this._addDateToSelection(z);}}}}break;}if(F==e||F==p||F==t||F==i){if(!z){z=k.addMonths(this.get("date"),x);w=0;}D.preventDefault();var E=k.addDays(z,w),v=this.get("date"),B=k.addMonths(this.get("date"),this._paneNumber-1),A=new Date(B);B.setDate(k.daysInMonth(B));if(k.isInRange(E,v,B)){this._highlightDateNode(E);}else{if(k.isGreater(v,E)){if(!k.isGreaterOrEqual(this.get("minimumDate"),v)){this.set("date",k.addMonths(v,-1));this._highlightDateNode(E);}}else{if(k.isGreater(E,B)){if(!k.isGreaterOrEqual(A,this.get("maximumDate"))){this.set("date",k.addMonths(v,1));this._highlightDateNode(E);}}}}}},_clickCalendar:function(y){var z=y.target,w=z.hasClass(r)&&!z.hasClass(a)&&!z.hasClass(o),v=z.hasClass(d);switch(this.get("selectionMode")){case ("single"):if(w){if(!v){this._clearSelection(true);this._addDateToSelection(this._nodeToDate(z));}}break;case ("multiple-sticky"):if(w){if(v){this._removeDateFromSelection(this._nodeToDate(z));}else{this._addDateToSelection(this._nodeToDate(z));}}break;case ("multiple"):if(!y.metaKey&&!y.ctrlKey&&!y.shiftKey){this._clearSelection(true);this._lastSelectedDate=this._nodeToDate(z);this._addDateToSelection(this._lastSelectedDate);}else{if(((h=="macintosh"&&y.metaKey)||(h!="macintosh"&&y.ctrlKey))&&!y.shiftKey){if(v){this._removeDateFromSelection(this._nodeToDate(z));this._lastSelectedDate=null;}else{this._lastSelectedDate=this._nodeToDate(z);this._addDateToSelection(this._lastSelectedDate);}}else{if(((h=="macintosh"&&y.metaKey)||(h!="macintosh"&&y.ctrlKey))&&y.shiftKey){if(this._lastSelectedDate){var x=this._nodeToDate(z);this._addDateRangeToSelection(x,this._lastSelectedDate);this._lastSelectedDate=x;}else{this._lastSelectedDate=this._nodeToDate(z);this._addDateToSelection(this._lastSelectedDate);}}else{if(y.shiftKey){if(this._lastSelectedDate){var x=this._nodeToDate(z);this._clearSelection(true);this._addDateRangeToSelection(x,this._lastSelectedDate);this._lastSelectedDate=x;}else{this._clearSelection(true);this._lastSelectedDate=this._nodeToDate(z);this._addDateToSelection(this._lastSelectedDate);}}}}}break;}if(w){this.fire("dateClick",{cell:z,date:this._nodeToDate(z)});}else{if(z.hasClass(a)){this.fire("prevMonthClick");}else{if(z.hasClass(o)){this.fire("nextMonthClick");}}}},subtractMonth:function(v){this.set("date",k.addMonths(this.get("date"),-1));v.halt();},subtractYear:function(v){this.set("date",k.addYears(this.get("date"),-1));v.halt();},addMonth:function(v){this.set("date",k.addMonths(this.get("date"),1));v.halt();},addYear:function(v){this.set("date",k.addYears(this.get("date"),1));v.halt();}},{NAME:"calendar",ATTRS:{selectionMode:{value:"single"},date:{value:new Date(),lazyAdd:false,setter:function(A){var w=this._normalizeDate(A),x=k.addMonths(w,this._paneNumber-1);var y=this.get("minimumDate");var z=this.get("maximumDate");if((!y||k.isGreaterOrEqual(w,y))&&(!z||k.isGreaterOrEqual(z,x))){return w;}else{if(y&&k.isGreater(y,w)){return y;}else{if(z&&k.isGreater(x,z)){var v=k.addMonths(z,-1*(this._paneNumber-1));return v;}}}}},minimumDate:{value:null,setter:function(x){if(x){var w=this.get("date"),v=this._normalizeDate(x);if(w&&!k.isGreaterOrEqual(w,v)){this.set("date",v);}return v;}else{return this._normalizeDate(x);}}},maximumDate:{value:null,setter:function(x){if(x){var v=this.get("date"),w=this._normalizeDate(x);if(v&&!k.isGreaterOrEqual(x,k.addMonths(v,this._paneNumber-1))){this.set("date",k.addMonths(w,-1*(this._paneNumber-1)));}return w;}else{return x;}}}}});},"3.5.1",{requires:["calendar-base","calendarnavigator"],lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"]});+YUI.add("calendar",function(e,t){function E(e){E.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r="calendar",i=40,s=38,o=37,u=39,a=13,f=32,l=n(r,"header"),c=n(r,"day-selected"),h=n(r,"day-highlighted"),p=n(r,"day"),d=n(r,"prevmonth-day"),v=n(r,"nextmonth-day"),m=n(r,"grid"),g=e.DataType.Date,y=e.delegate,b=n(r,"pane"),w=e.UA.os;e.Calendar=e.extend(E,e.CalendarBase,{_keyEvents:[],_highlightedDateNode:null,_lastSelectedDate:null,initializer:function(){this.plug(e.Plugin.CalendarNavigator),this._keyEvents=[],this._highlightedDateNode=null,this._lastSelectedDate=null},_bindCalendarEvents:function(){var e=this.get("contentBox"),t=e.one("."+b);t.on("selectstart",this._preventSelectionStart),t.delegate("click",this._clickCalendar,"."+p+", ."+d+", ."+v,this),t.delegate("keydown",this._keydownCalendar,"."+m,this),t.delegate("focus",this._focusCalendarGrid,"."+m,this),t.delegate("focus",this._focusCalendarCell,"."+p,this),t.delegate("blur",this._blurCalendarGrid,"."+m+",."+p,this)},_preventSelectionStart:function(e){e.preventDefault()},_highlightDateNode:function(e){this._unhighlightCurrentDateNode();var t=this._dateToNode(e);t.focus(),t.addClass(h)},_unhighlightCurrentDateNode:function(){var e=this.get("contentBox").all("."+h);e&&e.removeClass(h)},_getGridNumber:function(e){var t=e.get("id").split("_").reverse();return parseInt(t[0],10)},_blurCalendarGrid:function(e){this._unhighlightCurrentDateNode()},_focusCalendarCell:function(e){this._highlightedDateNode=e.target,e.stopPropagation()},_focusCalendarGrid:function(e){this._unhighlightCurrentDateNode(),this._highlightedDateNode=null},_keydownCalendar:function(e){var t=this._getGridNumber(e.target),n=this._highlightedDateNode?this._nodeToDate(this._highlightedDateNode):null,r=e.keyCode,l=0,h="";switch(r){case i:l=7,h="s";break;case s:l=-7,h="n";break;case o:l=-1,h="w";break;case u:l=1,h="e";break;case f:case a:e.preventDefault();if(this._highlightedDateNode){var p=this.get("selectionMode");if(p==="single"&&!this._highlightedDateNode.hasClass(c))this._clearSelection(!0),this._addDateToSelection(n);else if(p==="multiple"||p==="multiple-sticky")this._highlightedDateNode.hasClass(c)?this._removeDateFromSelection(n):this._addDateToSelection(n)}}if(r==i||r==s||r==o||r==u){n||(n=g.addMonths(this.get("date"),t),l=0),e.preventDefault();var d=g.addDays(n,l),v=this.get("date"),m=g.addMonths(this.get("date"),this._paneNumber-1),y=new Date(m);m.setDate(g.daysInMonth(m)),g.isInRange(d,v,m)?this._highlightDateNode(d):g.isGreater(v,d)?g.isGreaterOrEqual(this.get("minimumDate"),v)||(this.set("date",g.addMonths(v,-1)),this._highlightDateNode(d)):g.isGreater(d,m)&&(g.isGreaterOrEqual(y,this.get("maximumDate"))||(this.set("date",g.addMonths(v,1)),this._highlightDateNode(d)))}},_clickCalendar:function(e){var t=e.currentTarget,n=t.hasClass(p)&&!t.hasClass(d)&&!t.hasClass(v),r=t.hasClass(c);switch(this.get("selectionMode")){case"single":n&&(r||(this._clearSelection(!0),this._addDateToSelection(this._nodeToDate(t))));break;case"multiple-sticky":n&&(r?this._removeDateFromSelection(this._nodeToDate(t)):this._addDateToSelection(this._nodeToDate(t)));break;case"multiple":if(n)if(!e.metaKey&&!e.ctrlKey&&!e.shiftKey)this._clearSelection(!0),this._lastSelectedDate=this._nodeToDate(t),this._addDateToSelection(this._lastSelectedDate);else if((w=="macintosh"&&e.metaKey||w!="macintosh"&&e.ctrlKey)&&!e.shiftKey)r?(this._removeDateFromSelection(this._nodeToDate(t)),this._lastSelectedDate=null):(this._lastSelectedDate=this._nodeToDate(t),this._addDateToSelection(this._lastSelectedDate));else if((w=="macintosh"&&e.metaKey||w!="macintosh"&&e.ctrlKey)&&e.shiftKey)if(this._lastSelectedDate){var i=this._nodeToDate(t);this._addDateRangeToSelection(i,this._lastSelectedDate),this._lastSelectedDate=i}else this._lastSelectedDate=this._nodeToDate(t),this._addDateToSelection(this._lastSelectedDate);else if(e.shiftKey)if(this._lastSelectedDate){var i=this._nodeToDate(t);this._clearSelection(!0),this._addDateRangeToSelection(i,this._lastSelectedDate),this._lastSelectedDate=i}else this._clearSelection(!0),this._lastSelectedDate=this._nodeToDate(t),this._addDateToSelection(this._lastSelectedDate)}n?this.fire("dateClick",{cell:t,date:this._nodeToDate(t)}):t.hasClass(d)?this.fire("prevMonthClick"):t.hasClass(v)&&this.fire("nextMonthClick")},subtractMonth:function(e){this.set("date",g.addMonths(this.get("date"),-1)),e&&e.halt()},subtractYear:function(e){this.set("date",g.addYears(this.get("date"),-1)),e&&e.halt()},addMonth:function(e){this.set("date",g.addMonths(this.get("date"),1)),e&&e.halt()},addYear:function(e){this.set("date",g.addYears(this.get("date"),1)),e&&e.halt()}},{NAME:"calendar",ATTRS:{selectionMode:{value:"single"},date:{value:new Date,lazyAdd:!1,setter:function(e){var t=this._normalizeDate(e),n=g.addMonths(t,this._paneNumber-1),r=this.get("minimumDate"),i=this.get("maximumDate");if((!r||g.isGreaterOrEqual(t,r))&&(!i||g.isGreaterOrEqual(i,n)))return t;if(r&&g.isGreater(r,t))return r;if(i&&g.isGreater(n,i)){var s=g.addMonths(i,-1*(this._paneNumber-1));return s}}},minimumDate:{value:null,setter:function(e){if(e){var t=this.get("date"),n=this._normalizeDate(e);return t&&!g.isGreaterOrEqual(t,n)&&this.set("date",n),n}return this._normalizeDate(e)}},maximumDate:{value:null,setter:function(e){if(e){var t=this.get("date"),n=this._normalizeDate(e);return t&&!g.isGreaterOrEqual(e,g.addMonths(t,this._paneNumber-1))&&this.set("date",g.addMonths(n,-1*(this._paneNumber-1))),n}return e}}}})},"3.7.1",{requires:["calendar-base","calendarnavigator"],lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],skinnable:!0});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('calendar', function(Y) {+YUI.add('calendar', function (Y, NAME) { /** * The Calendar component is a UI widget that allows users@@ -82,16 +82,6 @@ }, /**- * syncUI implementation- *- * Update the scroll position, based on the current value of scrollY- * @method syncUI- */ - syncUI : function () {-- },-- /** * Overrides the _bindCalendarEvents placeholder in CalendarBase * and binds calendar events during bindUI stage. * @method _bindCalendarEvents@@ -100,8 +90,8 @@ _bindCalendarEvents : function () { var contentBox = this.get('contentBox'), pane = contentBox.one("." + CAL_PANE);- pane.on("selectstart", function (ev) { ev.preventDefault();});- pane.delegate("click", this._clickCalendar, "." + CAL_DAY, this);+ pane.on("selectstart", this._preventSelectionStart);+ pane.delegate("click", this._clickCalendar, "." + CAL_DAY + ", ." + CAL_PREVMONTH_DAY + ", ." + CAL_NEXTMONTH_DAY, this); pane.delegate("keydown", this._keydownCalendar, "." + CAL_GRID, this); pane.delegate("focus", this._focusCalendarGrid, "." + CAL_GRID, this); pane.delegate("focus", this._focusCalendarCell, "." + CAL_DAY, this);@@ -109,6 +99,16 @@ }, /**+ * Prevents text selection if it is started within the calendar pane+ * @method _preventSelectionStart+ * @param event {Event} The selectstart event+ * @protected+ */ + _preventSelectionStart : function (event) {+ event.preventDefault();+ },++ /** * Highlights a specific date node with keyboard highlight class * @method _highlightDateNode * @param oDate {Date} Date corresponding the node to be highlighted@@ -274,7 +274,7 @@ * @private */ _clickCalendar : function (ev) {- var clickedCell = ev.target,+ var clickedCell = ev.currentTarget, clickedCellIsDay = clickedCell.hasClass(CAL_DAY) && !clickedCell.hasClass(CAL_PREVMONTH_DAY) && !clickedCell.hasClass(CAL_NEXTMONTH_DAY),@@ -299,47 +299,49 @@ } break; case("multiple"):- if (!ev.metaKey && !ev.ctrlKey && !ev.shiftKey) {- this._clearSelection(true);- this._lastSelectedDate = this._nodeToDate(clickedCell);- this._addDateToSelection(this._lastSelectedDate);- }- else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && !ev.shiftKey) {- if (clickedCellIsSelected) {- this._removeDateFromSelection(this._nodeToDate(clickedCell));- this._lastSelectedDate = null;- }- else {- this._lastSelectedDate = this._nodeToDate(clickedCell);- this._addDateToSelection(this._lastSelectedDate);- }- }- else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && ev.shiftKey) {- if (this._lastSelectedDate) {- var selectedDate = this._nodeToDate(clickedCell);- this._addDateRangeToSelection(selectedDate, this._lastSelectedDate);- this._lastSelectedDate = selectedDate;- }- else {- this._lastSelectedDate = this._nodeToDate(clickedCell);- this._addDateToSelection(this._lastSelectedDate);- }-- }- else if (ev.shiftKey) {+ if (clickedCellIsDay) {+ if (!ev.metaKey && !ev.ctrlKey && !ev.shiftKey) {+ this._clearSelection(true);+ this._lastSelectedDate = this._nodeToDate(clickedCell);+ this._addDateToSelection(this._lastSelectedDate);+ }+ else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && !ev.shiftKey) {+ if (clickedCellIsSelected) {+ this._removeDateFromSelection(this._nodeToDate(clickedCell));+ this._lastSelectedDate = null;+ }+ else {+ this._lastSelectedDate = this._nodeToDate(clickedCell);+ this._addDateToSelection(this._lastSelectedDate);+ }+ }+ else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && ev.shiftKey) { if (this._lastSelectedDate) { var selectedDate = this._nodeToDate(clickedCell);- this._clearSelection(true); this._addDateRangeToSelection(selectedDate, this._lastSelectedDate); this._lastSelectedDate = selectedDate; } else {- this._clearSelection(true); this._lastSelectedDate = this._nodeToDate(clickedCell);- this._addDateToSelection(this._lastSelectedDate);+ this._addDateToSelection(this._lastSelectedDate); }- }- break;+ + }+ else if (ev.shiftKey) {+ if (this._lastSelectedDate) {+ var selectedDate = this._nodeToDate(clickedCell);+ this._clearSelection(true);+ this._addDateRangeToSelection(selectedDate, this._lastSelectedDate);+ this._lastSelectedDate = selectedDate;+ }+ else {+ this._clearSelection(true);+ this._lastSelectedDate = this._nodeToDate(clickedCell);+ this._addDateToSelection(this._lastSelectedDate);+ }+ }+ }+ break; } if (clickedCellIsDay) {@@ -378,7 +380,9 @@ */ subtractMonth : function (e) { this.set("date", ydate.addMonths(this.get("date"), -1));- e.halt();+ if (e) {+ e.halt();+ } }, /**@@ -387,7 +391,9 @@ */ subtractYear : function (e) { this.set("date", ydate.addYears(this.get("date"), -1));- e.halt();+ if (e) {+ e.halt();+ } }, /**@@ -396,7 +402,9 @@ */ addMonth : function (e) { this.set("date", ydate.addMonths(this.get("date"), 1));- e.halt();+ if (e) {+ e.halt();+ } }, /**@@ -405,7 +413,9 @@ */ addYear : function (e) { this.set("date", ydate.addYears(this.get("date"), 1));- e.halt();+ if (e) {+ e.halt();+ } } }, @@ -540,5 +550,4 @@ } }); --}, '3.5.1' ,{requires:['calendar-base', 'calendarnavigator'], lang:['de', 'en', 'fr', 'ja', 'nb-NO', 'pt-BR', 'ru', 'zh-HANT-TW']});+}, '3.7.1', {"requires": ["calendar-base", "calendarnavigator"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar",function(a){a.Intl.add("calendar","",{weekdays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],short_weekdays:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],very_short_weekdays:["Mo","Tu","We","Th","Fr","Sa","Su"]});},"3.5.1");+YUI.add("lang/calendar",function(e){e.Intl.add("calendar","",{weekdays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],short_weekdays:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],very_short_weekdays:["Mo","Tu","We","Th","Fr","Sa","Su"]})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar_de",function(a){a.Intl.add("calendar","de",{weekdays:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],very_short_weekdays:["So","Mo","Di","Mi","Do","Fr","Sa"],first_weekday:1,weekends:[0,6]});},"3.5.1");+YUI.add("lang/calendar_de",function(e){e.Intl.add("calendar","de",{weekdays:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],very_short_weekdays:["So","Mo","Di","Mi","Do","Fr","Sa"],first_weekday:1,weekends:[0,6]})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar_en",function(a){a.Intl.add("calendar","en",{weekdays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],short_weekdays:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],very_short_weekdays:["Mo","Tu","We","Th","Fr","Sa","Su"]});},"3.5.1");+YUI.add("lang/calendar_en",function(e){e.Intl.add("calendar","en",{weekdays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],short_weekdays:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],very_short_weekdays:["Mo","Tu","We","Th","Fr","Sa","Su"]})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar_fr",function(a){a.Intl.add("calendar","fr",{weekdays:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],short_weekdays:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],very_short_weekdays:["Di","Lu","Ma","Me","Je","Ve","Sa"],first_weekday:1,weekends:[0,6]});},"3.5.1");+YUI.add("lang/calendar_fr",function(e){e.Intl.add("calendar","fr",{weekdays:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],short_weekdays:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],very_short_weekdays:["Di","Lu","Ma","Me","Je","Ve","Sa"],first_weekday:1,weekends:[0,6]})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar_ja",function(a){a.Intl.add("calendar","ja",{weekdays:["\u6708\u66DC\u65E5","\u706B\u66DC\u65E5","\u6C34\u66DC\u65E5","\u6728\u66DC\u65E5","\u91D1\u66DC\u65E5","\u571F\u66DC\u65E5","\u65E5\u66DC\u65E5"],short_weekdays:["\u6708\u66DC","\u706B\u66DC","\u6C34\u66DC","\u6728\u66DC","\u91D1\u66DC","\u571F\u66DC","\u65E5\u66DC"],very_short_weekdays:["\u6708","\u706B","\u6C34","\u6728","\u91D1","\u571F","\u65E5"]});},"3.5.1");+YUI.add("lang/calendar_ja",function(e){e.Intl.add("calendar","ja",{weekdays:["\u6708\u66dc\u65e5","\u706b\u66dc\u65e5","\u6c34\u66dc\u65e5","\u6728\u66dc\u65e5","\u91d1\u66dc\u65e5","\u571f\u66dc\u65e5","\u65e5\u66dc\u65e5"],short_weekdays:["\u6708\u66dc","\u706b\u66dc","\u6c34\u66dc","\u6728\u66dc","\u91d1\u66dc","\u571f\u66dc","\u65e5\u66dc"],very_short_weekdays:["\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f","\u65e5"]})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar_nb-NO",function(a){a.Intl.add("calendar","nb-NO",{weekdays:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"],very_short_weekdays:["Sø","Ma","Ti","On","To","Fr","Lø"],first_weekday:1,weekends:[0,6]});},"3.5.1");+YUI.add("lang/calendar_nb-NO",function(e){e.Intl.add("calendar","nb-NO",{weekdays:["S\u00f8ndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","L\u00f8rdag"],very_short_weekdays:["S\u00f8","Ma","Ti","On","To","Fr","L\u00f8"],first_weekday:1,weekends:[0,6]})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar_pt-BR",function(a){a.Intl.add("calendar","pt-BR",{weekdays:["Domingo","Segunda","Ter\u00E7a","Quarta","Quinta","Sexta","S\u00E1bado"],short_weekdays:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],very_short_weekdays:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"]});},"3.5.1");+YUI.add("lang/calendar_pt-BR",function(e){e.Intl.add("calendar","pt-BR",{weekdays:["Domingo","Segunda","Ter\u00e7a","Quarta","Quinta","Sexta","S\u00e1bado"],short_weekdays:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],very_short_weekdays:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"]})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar_ru",function(a){a.Intl.add("calendar","ru",{weekdays:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],very_short_weekdays:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],first_weekday:1,weekends:[0,6]});},"3.5.1");+YUI.add("lang/calendar_ru",function(e){e.Intl.add("calendar","ru",{weekdays:["\u0412\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","\u041f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a","\u0412\u0442\u043e\u0440\u043d\u0438\u043a","\u0421\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0435\u0440\u0433","\u041f\u044f\u0442\u043d\u0438\u0446\u0430","\u0421\u0443\u0431\u0431\u043e\u0442\u0430"],very_short_weekdays:["\u0412\u0441","\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431"],first_weekday:1,weekends:[0,6]})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar_zh-HANT-TW",function(a){a.Intl.add("calendar","zh-HANT-TW",{weekdays:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],short_weekdays:["\u9031\u65E5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],very_short_weekdays:["\u65E5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"],first_weekday:0,weekends:[0,6]});},"3.5.1");+YUI.add("lang/calendar_zh-HANT-TW",function(e){e.Intl.add("calendar","zh-HANT-TW",{weekdays:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],short_weekdays:["\u9031\u65e5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],very_short_weekdays:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"],first_weekday:0,weekends:[0,6]})},"3.7.1");
@@ -1,27 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-calendar {-}--.yui3-calendar-content {-}--.yui3-calendar-pane {- width: 100%;-}--.yui3-calendar-grid {- width: 100%;-}--.yui3-calendar-column-hidden, .yui3-calendar-hidden {- display:none;-}--.yui3-calendar-day {- -}
@@ -1,37 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-calendar {-}--.yui3-calendar-content {-}--.yui3-calendar-column-hidden, .yui3-calendar-hidden {- display:none;-}--.yui3-calendar-day {- cursor: pointer;-}--.yui3-calendar-selection-disabled {- cursor: default;-}--.yui3-calendar-prevmonth-day {- cursor: default;-}--.yui3-calendar-nextmonth-day {- cursor: default;-}--.yui3-calendar-content:hover .yui3-calendar-day,-.yui3-calendar-content:hover .yui3-calendar-prevmonth-day,-.yui3-calendar-content:hover .yui3-calendar-nextmonth-day {- -moz-user-select: none;-}
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,88 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-skin-night .yui3-calendar-content {- padding:10px;- color: #CBCBCB;- border: 1px solid #303030;- background: #151515; /* Old browsers */- background: -moz-linear-gradient(top, #222222 0%, #151515 100%); /* FF3.6+ */- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#222222), color-stop(100%,#151515)); /* Chrome,Safari4+ */- background: -webkit-linear-gradient(top, #222222 0%,#151515 100%); /* Chrome10+,Safari5.1+ */- background: -o-linear-gradient(top, #222222 0%,#151515 100%); /* Opera11.10+ */- background: -ms-linear-gradient(top, #222222 0%,#151515 100%); /* IE10+ */- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#222222', endColorstr='#151515',GradientType=0 ); /* IE6-9 */- background: linear-gradient(top, #222222 0%,#151515 100%); /* W3C */- -moz-border-radius: 5px;- border-radius: 5px;-}---.yui3-skin-night .yui3-calendar-grid {- padding:5px;- border-collapse: collapse;-}--.yui3-skin-night .yui3-calendar-header {- padding-bottom:10px;-}--.yui3-skin-night .yui3-calendar-header-label {- margin: 0;- font-size: 1em;- font-weight: bold;-}--.yui3-skin-night .yui3-calendar-day,-.yui3-skin-night .yui3-calendar-prevmonth-day, -.yui3-skin-night .yui3-calendar-nextmonth-day {- padding:5px;- border: 1px solid #151515;- background: #262727;- text-align:center;-}--.yui3-skin-night .yui3-calendar-day:hover {- background: #383939;- color: #FFFFFF;-}--.yui3-skin-night .yui3-calendar-selection-disabled,-.yui3-skin-night .yui3-calendar-selection-disabled:hover {- background: #151515;- color: #596060;-}--.yui3-skin-night .yui3-calendar-weekday {- color: #4F4F4F;- font-weight: bold;- text-align: center;-}--.yui3-skin-night .yui3-calendar-prevmonth-day, .yui3-skin-night .yui3-calendar-nextmonth-day {- color: #4F4F4F;-}--.yui3-skin-night .yui3-calendar-day {- font-weight: bold;-}--.yui3-skin-night .yui3-calendar-day-selected {- background-color: #505151;- color: #fff;-}--.yui3-skin-night .yui3-calendar-header-label {- text-align: center;-}--.yui3-skin-night .yui3-calendar-left-grid {- margin-right:1em;-}--.yui3-skin-sam .yui3-calendar-right-grid {- margin-left:1em;-}
@@ -1,13 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-skin-night .yui3-calendar-day-highlighted {- background-color: #555555;-}--.yui3-skin-night .yui3-calendar-day-selected.yui3-calendar-day-highlighted {- background-color: #777777;-}
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-.yui3-calendar-header{padding-left:15px;padding-right:15px}.yui3-calendar-header-label{width:100%}.yui3-calendarnav-prevmonth{cursor:pointer}.yui3-calendarnav-nextmonth{cursor:pointer}.yui3-skin-night .yui3-calendarnav-prevmonth,.yui3-skin-night .yui3-calendarnav-nextmonth{color:#fff;width:12px;height:14px;background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALZJREFUeNpi/P//PwORQBqIu6DsMiB+SpQukAUEMCcQVwPx5/8I8BkqxklIPyHDA4H44X/c4CFUDckWGADxgf/EgwNQPQQtEALiaf/JB9OgZmBYwAzERUD84T/l4APULGaYBR5AfPU/9QHITA8maGJiY6A+YENOpmw0CCI2bJEsCsRzKDB8DtSMgUum6DiKiIwWRUlOhhUVdUD8Dcngb1AxgkUFIwmFnRwQt0PZlUD8iBhNAAEGALbfq7SGiQoPAAAAAElFTkSuQmCC);background-repeat:no-repeat}.yui3-skin-night .yui3-calendarnav-prevmonth:hover,.yui3-skin-night .yui3-calendarnav-nextmonth:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPpJREFUeNpi/P//PwMxQD9jszSQ6oJyyy7O8H1KjD5GQhYADeYEUkVAXAHEPFDhL0DcAcR9QIu+k20B0PBAIDUBiOVwKHkExAVAS9aTZAHQYAOowfYMxIGDUIsu4LUAaLAQkGoB4kwG8sB0IK4BWvQOxQKgwcxAdj4Q1wExPwNl4CMQNwHxRKBFfxn10jd5ADm9QKzFQF1wDYiLmaAcNgbqA7CZTEBv7ADS2iDboN5joEIQgczSBpmNHsmiQKodiJPJNHwuEFcCDX49MMkUi0VRUB/hy2ggFy+jtKgohRYVnFDh79CiopuiogLNIjmobxigrn5EjD6AAAMAok9vhfHG8wQAAAAASUVORK5CYII=);color:#06c}.yui3-skin-night .yui3-calendarnav-month-disabled,.yui3-skin-night .yui3-calendarnav-month-disabled:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQhJREFUeNqs0yGLAlEUhuHrKoIgCFbBJghb3F+g0WrVarEqLIhBEEFYWKNNMBktU4z6C5RNkwyCyWQSTPuOfCOCrHNnxwMPyOGe73DAiTmOYywrhy/9/sTBZujN4k0KPbioi6teKuqCmsKGSN/10+q5ehN6QQkrLJB/Mp/Xm5VmAhdkMcEGZWNfZc1MlPGwII42dmiZ/1dLGW1lXhdU8YNvZEz0yijLy6z6FyTN6yvpX7DEOzo4vSD4pCwvc+lfcMEYBUwjhE+VMVbmw7/oiCY+sA4RvNZMUxmB38EWFTSwfxK815uKZkJ/yXMU0cf5rn9Wr6g3f1bC4nwvbIAZRup1Ay671a8AAwC3OzOqxK+rkwAAAABJRU5ErkJggg==);cursor:default;color:#ccc}.yui3-skin-night .yui3-calendarnav-prevmonth,.yui3-skin-night .yui3-calendarnav-prevmonth:hover{background-position:0 0;margin-left:-12px}.yui3-skin-night .yui3-calendarnav-nextmonth,.yui3-skin-night .yui3-calendarnav-nextmonth:hover{background-position:-12px 0;margin-right:-12px}.yui3-skin-night .yui3-calendarnav-prevmonth span,.yui3-skin-night .yui3-calendarnav-nextmonth span{display:none;*display:block}+.yui3-calendar-header{padding-left:15px;padding-right:15px}.yui3-calendar-header-label{width:100%}.yui3-calendarnav-prevmonth{cursor:pointer}.yui3-calendarnav-nextmonth{cursor:pointer}.yui3-skin-night .yui3-calendarnav-prevmonth,.yui3-skin-night .yui3-calendarnav-nextmonth{color:#fff;width:12px;height:14px;background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALZJREFUeNpi/P//PwORQBqIu6DsMiB+SpQukAUEMCcQVwPx5/8I8BkqxklIPyHDA4H44X/c4CFUDckWGADxgf/EgwNQPQQtEALiaf/JB9OgZmBYwAzERUD84T/l4APULGaYBR5AfPU/9QHITA8maGJiY6A+YENOpmw0CCI2bJEsCsRzKDB8DtSMgUum6DiKiIwWRUlOhhUVdUD8Dcngb1AxgkUFIwmFnRwQt0PZlUD8iBhNAAEGALbfq7SGiQoPAAAAAElFTkSuQmCC);background-repeat:no-repeat}.yui3-skin-night .yui3-calendarnav-prevmonth:hover,.yui3-skin-night .yui3-calendarnav-nextmonth:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPpJREFUeNpi/P//PwMxQD9jszSQ6oJyyy7O8H1KjD5GQhYADeYEUkVAXAHEPFDhL0DcAcR9QIu+k20B0PBAIDUBiOVwKHkExAVAS9aTZAHQYAOowfYMxIGDUIsu4LUAaLAQkGoB4kwG8sB0IK4BWvQOxQKgwcxAdj4Q1wExPwNl4CMQNwHxRKBFfxn10jd5ADm9QKzFQF1wDYiLmaAcNgbqA7CZTEBv7ADS2iDboN5joEIQgczSBpmNHsmiQKodiJPJNHwuEFcCDX49MMkUi0VRUB/hy2ggFy+jtKgohRYVnFDh79CiopuiogLNIjmobxigrn5EjD6AAAMAok9vhfHG8wQAAAAASUVORK5CYII=);color:#06c}.yui3-skin-night .yui3-calendarnav-month-disabled,.yui3-skin-night .yui3-calendarnav-month-disabled:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQhJREFUeNqs0yGLAlEUhuHrKoIgCFbBJghb3F+g0WrVarEqLIhBEEFYWKNNMBktU4z6C5RNkwyCyWQSTPuOfCOCrHNnxwMPyOGe73DAiTmOYywrhy/9/sTBZujN4k0KPbioi6teKuqCmsKGSN/10+q5ehN6QQkrLJB/Mp/Xm5VmAhdkMcEGZWNfZc1MlPGwII42dmiZ/1dLGW1lXhdU8YNvZEz0yijLy6z6FyTN6yvpX7DEOzo4vSD4pCwvc+lfcMEYBUwjhE+VMVbmw7/oiCY+sA4RvNZMUxmB38EWFTSwfxK815uKZkJ/yXMU0cf5rn9Wr6g3f1bC4nwvbIAZRup1Ay671a8AAwC3OzOqxK+rkwAAAABJRU5ErkJggg==);cursor:default;color:#ccc}.yui3-skin-night .yui3-calendarnav-prevmonth,.yui3-skin-night .yui3-calendarnav-prevmonth:hover{background-position:0 0;margin-left:-12px}.yui3-skin-night .yui3-calendarnav-nextmonth,.yui3-skin-night .yui3-calendarnav-nextmonth:hover{background-position:-12px 0;margin-right:-12px}.yui3-skin-night .yui3-calendarnav-prevmonth span,.yui3-skin-night .yui3-calendarnav-nextmonth span{display:none;*display:block}#yui3-css-stamp.skin-night-calendarnavigator{display:none}
@@ -1,94 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-skin-sam .yui3-calendar-content {- padding:10px;- color: #000000;- border: 1px solid gray;- background: #f2f2f2; /* Old browsers */- background: -moz-linear-gradient(top, #f9f9f9 0%, #f2f2f2 100%); /* FF3.6+ */- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f9f9f9), color-stop(100%,#f2f2f2)); /* Chrome,Safari4+ */- background: -webkit-linear-gradient(top, #f9f9f9 0%,#f2f2f2 100%); /* Chrome10+,Safari5.1+ */- background: -o-linear-gradient(top, #f9f9f9 0%,#f2f2f2 100%); /* Opera11.10+ */- background: -ms-linear-gradient(top, #f9f9f9 0%,#f2f2f2 100%); /* IE10+ */- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f9f9f9', endColorstr='#f2f2f2',GradientType=0 ); /* IE6-9 */- background: linear-gradient(top, #f9f9f9 0%,#f2f2f2 100%); /* W3C */- -moz-border-radius: 5px;- border-radius: 5px;-}--.yui3-skin-sam .yui3-calendar-grid {- padding:5px;- border-collapse: collapse;-}--.yui3-skin-sam .yui3-calendar-header {- padding-bottom:10px;-}--.yui3-skin-sam .yui3-calendar-header-label {- margin: 0;- font-size: 1em;- font-weight: bold;-}--.yui3-skin-sam .yui3-calendar-day,-.yui3-skin-sam .yui3-calendar-prevmonth-day, -.yui3-skin-sam .yui3-calendar-nextmonth-day {- padding:5px;- border: 1px solid #CCCCCC;- background: #FFFFFF;- text-align:center;-}---.yui3-skin-sam .yui3-calendar-day:hover {- background: #0066CC;- color: #FFFFFF;-}--.yui3-skin-sam .yui3-calendar-selection-disabled,-.yui3-skin-sam .yui3-calendar-selection-disabled:hover {- color: #A6A6A6;- background: #CCCCCC;-}--.yui3-skin-sam .yui3-calendar-weekday {- font-weight: bold;-}--.yui3-skin-sam .yui3-calendar-prevmonth-day, .yui3-skin-sam .yui3-calendar-nextmonth-day {- color: #A6A6A6;-}--.yui3-skin-sam .yui3-calendar-day {- font-weight: bold;-}--.yui3-skin-sam .yui3-calendar-day-selected {- background-color: #B3D4FF;- color: #000000;-}--.yui3-skin-sam .yui3-calendar-header-label {- text-align: center;-}--.yui3-skin-sam .yui3-calendar-left-grid {- margin-right:1em;-}--.yui3-skin-sam .yui3-calendar-right-grid {- margin-left:1em;-}--.yui3-skin-sam .yui3-calendar-day-highlighted {- background-color: #DCDEF5;-}--.yui3-skin-sam .yui3-calendar-day-selected.yui3-calendar-day-highlighted {- background-color: #758FBB;-}
@@ -1,13 +0,0 @@-/*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-.yui3-skin-sam .yui3-calendar-day-highlighted {- background-color: #DCDEF5;-}--.yui3-skin-sam .yui3-calendar-day-selected.yui3-calendar-day-highlighted {- background-color: #758FBB;-}
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-.yui3-calendar-header{padding-left:15px;padding-right:15px}.yui3-calendar-header-label{width:100%}.yui3-calendarnav-prevmonth{cursor:pointer}.yui3-calendarnav-nextmonth{cursor:pointer}.yui3-skin-sam .yui3-calendarnav-prevmonth,.yui3-skin-sam .yui3-calendarnav-nextmonth{color:#000;width:12px;height:14px;background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAKNJREFUeNpiYCAeSAPxUiiWZqAi4ATiaiD+DMT/ofgzVIyTUsMDgfghksHo+CFUDcnAAIgP4DEYHR+A6iEIhIB4GgkGo+NpUDMwADMQFwHxBwoMh+EPULOYYYZ7APFVKhiMjkFmejBBLWFjoD5gQ+dQO4iwOloUiOdQYPgcqBkDl0zRQRQRGS2KGkVFHRB/QzL4G1SMk5qpQg6psJMjVhNAgAEAH+qPqeiPEUsAAAAASUVORK5CYII=);background-repeat:no-repeat}.yui3-skin-sam .yui3-calendarnav-prevmonth:hover,.yui3-skin-sam .yui3-calendarnav-nextmonth:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPpJREFUeNpi/P//PwMxQD9jszSQ6oJyyy7O8H1KjD5GQhYADeYEUkVAXAHEPFDhL0DcAcR9QIu+k20B0PBAIDUBiOVwKHkExAVAS9aTZAHQYAOowfYMxIGDUIsu4LUAaLAQkGoB4kwG8sB0IK4BWvQOxQKgwcxAdj4Q1wExPwNl4CMQNwHxRKBFfxn10jd5ADm9QKzFQF1wDYiLmaAcNgbqA7CZTEBv7ADS2iDboN5joEIQgczSBpmNHsmiQKodiJPJNHwuEFcCDX49MMkUi0VRUB/hy2ggFy+jtKgohRYVnFDh79CiopuiogLNIjmobxigrn5EjD6AAAMAok9vhfHG8wQAAAAASUVORK5CYII=);color:#06c}.yui3-skin-sam .yui3-calendarnav-month-disabled,.yui3-skin-sam .yui3-calendarnav-month-disabled:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQhJREFUeNqs0yGLAlEUhuHrKoIgCFbBJghb3F+g0WrVarEqLIhBEEFYWKNNMBktU4z6C5RNkwyCyWQSTPuOfCOCrHNnxwMPyOGe73DAiTmOYywrhy/9/sTBZujN4k0KPbioi6teKuqCmsKGSN/10+q5ehN6QQkrLJB/Mp/Xm5VmAhdkMcEGZWNfZc1MlPGwII42dmiZ/1dLGW1lXhdU8YNvZEz0yijLy6z6FyTN6yvpX7DEOzo4vSD4pCwvc+lfcMEYBUwjhE+VMVbmw7/oiCY+sA4RvNZMUxmB38EWFTSwfxK815uKZkJ/yXMU0cf5rn9Wr6g3f1bC4nwvbIAZRup1Ay671a8AAwC3OzOqxK+rkwAAAABJRU5ErkJggg==);cursor:default;color:#ccc}.yui3-skin-sam .yui3-calendarnav-prevmonth,.yui3-skin-sam .yui3-calendarnav-prevmonth:hover{background-position:0 0;margin-left:-12px}.yui3-skin-sam .yui3-calendarnav-nextmonth,.yui3-skin-sam .yui3-calendarnav-nextmonth:hover{background-position:-12px 0;margin-right:-12px}.yui3-skin-sam .yui3-calendarnav-prevmonth span,.yui3-skin-sam .yui3-calendarnav-nextmonth span{display:none;*display:block}+.yui3-calendar-header{padding-left:15px;padding-right:15px}.yui3-calendar-header-label{width:100%}.yui3-calendarnav-prevmonth{cursor:pointer}.yui3-calendarnav-nextmonth{cursor:pointer}.yui3-skin-sam .yui3-calendarnav-prevmonth,.yui3-skin-sam .yui3-calendarnav-nextmonth{color:#000;width:12px;height:14px;background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAKNJREFUeNpiYCAeSAPxUiiWZqAi4ATiaiD+DMT/ofgzVIyTUsMDgfghksHo+CFUDcnAAIgP4DEYHR+A6iEIhIB4GgkGo+NpUDMwADMQFwHxBwoMh+EPULOYYYZ7APFVKhiMjkFmejBBLWFjoD5gQ+dQO4iwOloUiOdQYPgcqBkDl0zRQRQRGS2KGkVFHRB/QzL4G1SMk5qpQg6psJMjVhNAgAEAH+qPqeiPEUsAAAAASUVORK5CYII=);background-repeat:no-repeat}.yui3-skin-sam .yui3-calendarnav-prevmonth:hover,.yui3-skin-sam .yui3-calendarnav-nextmonth:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPpJREFUeNpi/P//PwMxQD9jszSQ6oJyyy7O8H1KjD5GQhYADeYEUkVAXAHEPFDhL0DcAcR9QIu+k20B0PBAIDUBiOVwKHkExAVAS9aTZAHQYAOowfYMxIGDUIsu4LUAaLAQkGoB4kwG8sB0IK4BWvQOxQKgwcxAdj4Q1wExPwNl4CMQNwHxRKBFfxn10jd5ADm9QKzFQF1wDYiLmaAcNgbqA7CZTEBv7ADS2iDboN5joEIQgczSBpmNHsmiQKodiJPJNHwuEFcCDX49MMkUi0VRUB/hy2ggFy+jtKgohRYVnFDh79CiopuiogLNIjmobxigrn5EjD6AAAMAok9vhfHG8wQAAAAASUVORK5CYII=);color:#06c}.yui3-skin-sam .yui3-calendarnav-month-disabled,.yui3-skin-sam .yui3-calendarnav-month-disabled:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAOCAYAAAA1+Nx+AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQhJREFUeNqs0yGLAlEUhuHrKoIgCFbBJghb3F+g0WrVarEqLIhBEEFYWKNNMBktU4z6C5RNkwyCyWQSTPuOfCOCrHNnxwMPyOGe73DAiTmOYywrhy/9/sTBZujN4k0KPbioi6teKuqCmsKGSN/10+q5ehN6QQkrLJB/Mp/Xm5VmAhdkMcEGZWNfZc1MlPGwII42dmiZ/1dLGW1lXhdU8YNvZEz0yijLy6z6FyTN6yvpX7DEOzo4vSD4pCwvc+lfcMEYBUwjhE+VMVbmw7/oiCY+sA4RvNZMUxmB38EWFTSwfxK815uKZkJ/yXMU0cf5rn9Wr6g3f1bC4nwvbIAZRup1Ay671a8AAwC3OzOqxK+rkwAAAABJRU5ErkJggg==);cursor:default;color:#ccc}.yui3-skin-sam .yui3-calendarnav-prevmonth,.yui3-skin-sam .yui3-calendarnav-prevmonth:hover{background-position:0 0;margin-left:-12px}.yui3-skin-sam .yui3-calendarnav-nextmonth,.yui3-skin-sam .yui3-calendarnav-nextmonth:hover{background-position:-12px 0;margin-right:-12px}.yui3-skin-sam .yui3-calendarnav-prevmonth span,.yui3-skin-sam .yui3-calendarnav-nextmonth span{display:none;*display:block}#yui3-css-stamp.skin-sam-calendarnavigator{display:none}
@@ -0,0 +1,410 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/calendarnavigator/calendarnavigator.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/calendarnavigator/calendarnavigator.js",+ code: []+};+_yuitest_coverage["build/calendarnavigator/calendarnavigator.js"].code=["YUI.add('calendarnavigator', function (Y, NAME) {","","/**"," * Provides a plugin which adds navigation controls to Calendar."," *"," * @module calendarnavigator"," */","var CONTENT_BOX = \"contentBox\","," HOST = \"host\","," RENDERED = \"rendered\","," getCN = Y.ClassNameManager.getClassName,"," substitute = Y.substitute,"," node = Y.Node,"," create = node.create,"," CALENDAR = 'calendar',"," CALENDARNAV = 'calendarnav',"," CAL_HD = getCN(CALENDAR, 'header'),"," CAL_PREV_M = getCN(CALENDARNAV, 'prevmonth'),"," CAL_NEXT_M = getCN(CALENDARNAV, 'nextmonth'),"," CAL_DIS_M = getCN(CALENDARNAV, 'month-disabled'),"," ydate = Y.DataType.Date;","/**"," * A plugin class which adds navigation controls to Calendar."," *"," * @class CalendarNavigator"," * @extends Plugin.Base"," * @namespace Plugin"," */","function CalendarNavigator(config) {"," CalendarNavigator.superclass.constructor.apply(this, arguments);","}","","/**"," * The namespace for the plugin. This will be the property on the widget, which will "," * reference the plugin instance, when it's plugged in."," *"," * @property NS"," * @static"," * @type String"," * @default \"navigator\""," */","CalendarNavigator.NS = \"navigator\";","","/**"," * The NAME of the CalendarNavigator class. Used to prefix events generated"," * by the plugin class."," *"," * @property NAME"," * @static"," * @type String"," * @default \"pluginCalendarNavigator\""," */","CalendarNavigator.NAME = \"pluginCalendarNavigator\";","","","/**"," * Static property used to define the default attribute "," * configuration for the plugin."," *"," * @property ATTRS"," * @type Object"," * @static"," */","CalendarNavigator.ATTRS = {",""," /**"," * The number of months to shift by when the control arrows are clicked."," *"," * @attribute shiftByMonths"," * @type Number"," * @default 1 (months)"," */"," shiftByMonths : {"," value: 1"," }","};",""," /**"," * The CSS classnames for the calendar navigator controls."," * @property CALENDARNAV_STRINGS"," * @type Object"," * @readOnly"," * @protected"," * @static"," */ ","CalendarNavigator.CALENDARNAV_STRINGS = {"," prev_month_class: CAL_PREV_M,"," next_month_class: CAL_NEXT_M","};",""," /**"," * The template for the calendar navigator previous month control."," * @property PREV_MONTH_CONTROL_TEMPLATE"," * @type String"," * @protected"," * @static"," */ ","CalendarNavigator.PREV_MONTH_CONTROL_TEMPLATE = '<a class=\"yui3-u {prev_month_class}\" role=\"button\" aria-label=\"{prev_month_arialabel}\" tabindex=\"{control_tabindex}\">' + "," \"<span><</span>\" +"," '</a>';"," /**"," * The template for the calendar navigator next month control."," * @property NEXT_MONTH_CONTROL_TEMPLATE"," * @type String"," * @readOnly"," * @protected"," * @static"," */ ","CalendarNavigator.NEXT_MONTH_CONTROL_TEMPLATE = '<a class=\"yui3-u {next_month_class}\" role=\"button\" aria-label=\"{next_month_arialabel}\" tabindex=\"{control_tabindex}\">' + "," \"<span>></span>\" +"," '</a>';","","","Y.extend(CalendarNavigator, Y.Plugin.Base, {",""," _eventAttachments : {},"," _controls: {},",""," /**"," * The initializer lifecycle implementation. Modifies the host widget's "," * render to add navigation controls."," *"," * @method initializer"," * @param {Object} config The user configuration for the plugin "," */"," initializer : function(config) {",""," // After the host has rendered its UI, place the navigation cotnrols"," this._controls = {};"," this._eventAttachments = {};",""," this.afterHostMethod(\"renderUI\", this._initNavigationControls);"," },",""," /**"," * The initializer destructor implementation. Responsible for destroying the initialized"," * control mechanisms."," * "," * @method destructor"," */"," destructor : function() {"," "," },",""," /**"," * Private utility method that focuses on a navigation button when it is clicked"," * or pressed with a keyboard."," * "," * @method _focusNavigation"," * @param {Event} ev Click or keydown event from the controls"," * @protected"," */"," _focusNavigation : function (ev) {"," ev.currentTarget.focus();"," },",""," /**"," * Private utility method that subtracts months from the host calendar date"," * based on the control click and the shiftByMonths property."," * "," * @method _subtractMonths"," * @param {Event} ev Click event from the controls"," * @protected"," */"," _subtractMonths : function (ev) {"," if ( (ev.type === \"click\") || (ev.type === \"keydown\" && (ev.keyCode == 13 || ev.keyCode == 32)) ) {"," var host = this.get(HOST);"," var oldDate = host.get(\"date\");"," host.set(\"date\", ydate.addMonths(oldDate, -1*this.get(\"shiftByMonths\")));"," ev.preventDefault();"," }"," },",""," /**"," * Private utility method that adds months to the host calendar date"," * based on the control click and the shiftByMonths property."," * "," * @method _addMonths"," * @param {Event} ev Click event from the controls"," * @protected"," */"," _addMonths : function (ev) {"," if ( (ev.type === \"click\") || (ev.type === \"keydown\" && (ev.keyCode == 13 || ev.keyCode == 32)) ) {"," var host = this.get(HOST);"," var oldDate = host.get(\"date\");"," host.set(\"date\", ydate.addMonths(oldDate, this.get(\"shiftByMonths\")));"," ev.preventDefault();"," }"," },","",""," _updateControlState : function () {",""," var host = this.get(HOST);"," if (ydate.areEqual(host.get(\"minimumDate\"), host.get(\"date\"))) {"," if (this._eventAttachments.prevMonth) {"," this._eventAttachments.prevMonth.detach();"," this._eventAttachments.prevMonth = false;"," }",""," if (!this._controls.prevMonth.hasClass(CAL_DIS_M)) {"," this._controls.prevMonth.addClass(CAL_DIS_M).setAttribute(\"aria-disabled\", \"true\");"," }"," }"," else {"," if (!this._eventAttachments.prevMonth) {"," this._eventAttachments.prevMonth = this._controls.prevMonth.on([\"click\", \"keydown\"], this._subtractMonths, this);"," }"," if (this._controls.prevMonth.hasClass(CAL_DIS_M)) {"," this._controls.prevMonth.removeClass(CAL_DIS_M).setAttribute(\"aria-disabled\", \"false\");"," }"," }",""," if (ydate.areEqual(host.get(\"maximumDate\"), ydate.addMonths(host.get(\"date\"), host._paneNumber - 1))) {"," if (this._eventAttachments.nextMonth) {"," this._eventAttachments.nextMonth.detach();"," this._eventAttachments.nextMonth = false;"," }",""," if (!this._controls.nextMonth.hasClass(CAL_DIS_M)) {"," this._controls.nextMonth.addClass(CAL_DIS_M).setAttribute(\"aria-disabled\", \"true\");"," }"," }"," else {"," if (!this._eventAttachments.nextMonth) {"," this._eventAttachments.nextMonth = this._controls.nextMonth.on([\"click\", \"keydown\"], this._addMonths, this);"," }"," if (this._controls.nextMonth.hasClass(CAL_DIS_M)) {"," this._controls.nextMonth.removeClass(CAL_DIS_M).setAttribute(\"aria-disabled\", \"false\");"," }"," }",""," this._controls.prevMonth.on([\"click\", \"keydown\"], this._focusNavigation, this);"," this._controls.nextMonth.on([\"click\", \"keydown\"], this._focusNavigation, this);"," },","","","",""," /**"," * Private render assist method that renders the previous month control"," * "," * @method _renderPrevControls"," * @private"," */"," _renderPrevControls : function () {"," var prevControlNode = create(substitute (CalendarNavigator.PREV_MONTH_CONTROL_TEMPLATE,"," CalendarNavigator.CALENDARNAV_STRINGS));"," prevControlNode.on(\"selectstart\", this.get(HOST)._preventSelectionStart);",""," return prevControlNode; "," },",""," /**"," * Private render assist method that renders the next month control"," * "," * @method _renderNextControls"," * @private"," */"," _renderNextControls : function () {"," var nextControlNode = create(substitute (CalendarNavigator.NEXT_MONTH_CONTROL_TEMPLATE,"," CalendarNavigator.CALENDARNAV_STRINGS));"," nextControlNode.on(\"selectstart\", this.get(HOST)._preventSelectionStart);"," "," return nextControlNode; "," },",""," /**"," * Protected render assist method that initialized and renders the navigation controls."," * @method _initNavigationControls"," * @protected"," */"," _initNavigationControls : function() {"," var host = this.get(HOST);"," CalendarNavigator.CALENDARNAV_STRINGS[\"control_tabindex\"] = host.get(\"tabIndex\");"," CalendarNavigator.CALENDARNAV_STRINGS[\"prev_month_arialabel\"] = \"Go to previous month\";"," CalendarNavigator.CALENDARNAV_STRINGS[\"next_month_arialabel\"] = \"Go to next month\";",""," var headerCell = host.get(CONTENT_BOX).one(\".\" + CAL_HD);",""," this._controls.prevMonth = this._renderPrevControls();"," this._controls.nextMonth = this._renderNextControls();",""," this._updateControlState();",""," host.after(\"dateChange\", this._updateControlState, this);",""," headerCell.prepend(this._controls.prevMonth);"," headerCell.append(this._controls.nextMonth);"," }","});","","Y.namespace(\"Plugin\").CalendarNavigator = CalendarNavigator;","","}, '3.7.1', {\"requires\": [\"plugin\", \"classnamemanager\", \"datatype-date\", \"node\", \"substitute\"], \"skinnable\": true});"];+_yuitest_coverage["build/calendarnavigator/calendarnavigator.js"].lines = {"1":0,"8":0,"29":0,"30":0,"42":0,"53":0,"64":0,"86":0,"98":0,"109":0,"114":0,"129":0,"130":0,"132":0,"154":0,"166":0,"167":0,"168":0,"169":0,"170":0,"183":0,"184":0,"185":0,"186":0,"187":0,"194":0,"195":0,"196":0,"197":0,"198":0,"201":0,"202":0,"206":0,"207":0,"209":0,"210":0,"214":0,"215":0,"216":0,"217":0,"220":0,"221":0,"225":0,"226":0,"228":0,"229":0,"233":0,"234":0,"247":0,"249":0,"251":0,"261":0,"263":0,"265":0,"274":0,"275":0,"276":0,"277":0,"279":0,"281":0,"282":0,"284":0,"286":0,"288":0,"289":0,"293":0};+_yuitest_coverage["build/calendarnavigator/calendarnavigator.js"].functions = {"CalendarNavigator:29":0,"initializer:126":0,"_focusNavigation:153":0,"_subtractMonths:165":0,"_addMonths:182":0,"_updateControlState:192":0,"_renderPrevControls:246":0,"_renderNextControls:260":0,"_initNavigationControls:273":0,"(anonymous 1):1":0};+_yuitest_coverage["build/calendarnavigator/calendarnavigator.js"].coveredLines = 66;+_yuitest_coverage["build/calendarnavigator/calendarnavigator.js"].coveredFunctions = 10;+_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 1);+YUI.add('calendarnavigator', function (Y, NAME) {++/**+ * Provides a plugin which adds navigation controls to Calendar.+ *+ * @module calendarnavigator+ */+_yuitest_coverfunc("build/calendarnavigator/calendarnavigator.js", "(anonymous 1)", 1);+_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 8);+var CONTENT_BOX = "contentBox",+ HOST = "host",+ RENDERED = "rendered",+ getCN = Y.ClassNameManager.getClassName,+ substitute = Y.substitute,+ node = Y.Node,+ create = node.create,+ CALENDAR = 'calendar',+ CALENDARNAV = 'calendarnav',+ CAL_HD = getCN(CALENDAR, 'header'),+ CAL_PREV_M = getCN(CALENDARNAV, 'prevmonth'),+ CAL_NEXT_M = getCN(CALENDARNAV, 'nextmonth'),+ CAL_DIS_M = getCN(CALENDARNAV, 'month-disabled'),+ ydate = Y.DataType.Date;+/**+ * A plugin class which adds navigation controls to Calendar.+ *+ * @class CalendarNavigator+ * @extends Plugin.Base+ * @namespace Plugin+ */+_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 29);+function CalendarNavigator(config) {+ _yuitest_coverfunc("build/calendarnavigator/calendarnavigator.js", "CalendarNavigator", 29);+_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 30);+CalendarNavigator.superclass.constructor.apply(this, arguments);+}++/**+ * The namespace for the plugin. This will be the property on the widget, which will + * reference the plugin instance, when it's plugged in.+ *+ * @property NS+ * @static+ * @type String+ * @default "navigator"+ */+_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 42);+CalendarNavigator.NS = "navigator";++/**+ * The NAME of the CalendarNavigator class. Used to prefix events generated+ * by the plugin class.+ *+ * @property NAME+ * @static+ * @type String+ * @default "pluginCalendarNavigator"+ */+_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 53);+CalendarNavigator.NAME = "pluginCalendarNavigator";+++/**+ * Static property used to define the default attribute + * configuration for the plugin.+ *+ * @property ATTRS+ * @type Object+ * @static+ */+_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 64);+CalendarNavigator.ATTRS = {++ /**+ * The number of months to shift by when the control arrows are clicked.+ *+ * @attribute shiftByMonths+ * @type Number+ * @default 1 (months)+ */+ shiftByMonths : {+ value: 1+ }+};++ /**+ * The CSS classnames for the calendar navigator controls.+ * @property CALENDARNAV_STRINGS+ * @type Object+ * @readOnly+ * @protected+ * @static+ */ +_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 86);+CalendarNavigator.CALENDARNAV_STRINGS = {+ prev_month_class: CAL_PREV_M,+ next_month_class: CAL_NEXT_M+};++ /**+ * The template for the calendar navigator previous month control.+ * @property PREV_MONTH_CONTROL_TEMPLATE+ * @type String+ * @protected+ * @static+ */ +_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 98);+CalendarNavigator.PREV_MONTH_CONTROL_TEMPLATE = '<a class="yui3-u {prev_month_class}" role="button" aria-label="{prev_month_arialabel}" tabindex="{control_tabindex}">' + + "<span><</span>" ++ '</a>';+ /**+ * The template for the calendar navigator next month control.+ * @property NEXT_MONTH_CONTROL_TEMPLATE+ * @type String+ * @readOnly+ * @protected+ * @static+ */ +_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 109);+CalendarNavigator.NEXT_MONTH_CONTROL_TEMPLATE = '<a class="yui3-u {next_month_class}" role="button" aria-label="{next_month_arialabel}" tabindex="{control_tabindex}">' + + "<span>></span>" ++ '</a>';+++_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 114);+Y.extend(CalendarNavigator, Y.Plugin.Base, {++ _eventAttachments : {},+ _controls: {},++ /**+ * The initializer lifecycle implementation. Modifies the host widget's + * render to add navigation controls.+ *+ * @method initializer+ * @param {Object} config The user configuration for the plugin + */+ initializer : function(config) {++ // After the host has rendered its UI, place the navigation cotnrols+ _yuitest_coverfunc("build/calendarnavigator/calendarnavigator.js", "initializer", 126);+_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 129);+this._controls = {};+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 130);+this._eventAttachments = {};++ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 132);+this.afterHostMethod("renderUI", this._initNavigationControls);+ },++ /**+ * The initializer destructor implementation. Responsible for destroying the initialized+ * control mechanisms.+ * + * @method destructor+ */+ destructor : function() {+ + },++ /**+ * Private utility method that focuses on a navigation button when it is clicked+ * or pressed with a keyboard.+ * + * @method _focusNavigation+ * @param {Event} ev Click or keydown event from the controls+ * @protected+ */+ _focusNavigation : function (ev) {+ _yuitest_coverfunc("build/calendarnavigator/calendarnavigator.js", "_focusNavigation", 153);+_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 154);+ev.currentTarget.focus();+ },++ /**+ * Private utility method that subtracts months from the host calendar date+ * based on the control click and the shiftByMonths property.+ * + * @method _subtractMonths+ * @param {Event} ev Click event from the controls+ * @protected+ */+ _subtractMonths : function (ev) {+ _yuitest_coverfunc("build/calendarnavigator/calendarnavigator.js", "_subtractMonths", 165);+_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 166);+if ( (ev.type === "click") || (ev.type === "keydown" && (ev.keyCode == 13 || ev.keyCode == 32)) ) {+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 167);+var host = this.get(HOST);+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 168);+var oldDate = host.get("date");+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 169);+host.set("date", ydate.addMonths(oldDate, -1*this.get("shiftByMonths")));+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 170);+ev.preventDefault();+ }+ },++ /**+ * Private utility method that adds months to the host calendar date+ * based on the control click and the shiftByMonths property.+ * + * @method _addMonths+ * @param {Event} ev Click event from the controls+ * @protected+ */+ _addMonths : function (ev) {+ _yuitest_coverfunc("build/calendarnavigator/calendarnavigator.js", "_addMonths", 182);+_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 183);+if ( (ev.type === "click") || (ev.type === "keydown" && (ev.keyCode == 13 || ev.keyCode == 32)) ) {+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 184);+var host = this.get(HOST);+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 185);+var oldDate = host.get("date");+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 186);+host.set("date", ydate.addMonths(oldDate, this.get("shiftByMonths")));+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 187);+ev.preventDefault();+ }+ },+++ _updateControlState : function () {++ _yuitest_coverfunc("build/calendarnavigator/calendarnavigator.js", "_updateControlState", 192);+_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 194);+var host = this.get(HOST);+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 195);+if (ydate.areEqual(host.get("minimumDate"), host.get("date"))) {+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 196);+if (this._eventAttachments.prevMonth) {+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 197);+this._eventAttachments.prevMonth.detach();+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 198);+this._eventAttachments.prevMonth = false;+ }++ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 201);+if (!this._controls.prevMonth.hasClass(CAL_DIS_M)) {+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 202);+this._controls.prevMonth.addClass(CAL_DIS_M).setAttribute("aria-disabled", "true");+ }+ }+ else {+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 206);+if (!this._eventAttachments.prevMonth) {+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 207);+this._eventAttachments.prevMonth = this._controls.prevMonth.on(["click", "keydown"], this._subtractMonths, this);+ }+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 209);+if (this._controls.prevMonth.hasClass(CAL_DIS_M)) {+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 210);+this._controls.prevMonth.removeClass(CAL_DIS_M).setAttribute("aria-disabled", "false");+ }+ }++ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 214);+if (ydate.areEqual(host.get("maximumDate"), ydate.addMonths(host.get("date"), host._paneNumber - 1))) {+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 215);+if (this._eventAttachments.nextMonth) {+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 216);+this._eventAttachments.nextMonth.detach();+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 217);+this._eventAttachments.nextMonth = false;+ }++ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 220);+if (!this._controls.nextMonth.hasClass(CAL_DIS_M)) {+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 221);+this._controls.nextMonth.addClass(CAL_DIS_M).setAttribute("aria-disabled", "true");+ }+ }+ else {+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 225);+if (!this._eventAttachments.nextMonth) {+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 226);+this._eventAttachments.nextMonth = this._controls.nextMonth.on(["click", "keydown"], this._addMonths, this);+ }+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 228);+if (this._controls.nextMonth.hasClass(CAL_DIS_M)) {+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 229);+this._controls.nextMonth.removeClass(CAL_DIS_M).setAttribute("aria-disabled", "false");+ }+ }++ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 233);+this._controls.prevMonth.on(["click", "keydown"], this._focusNavigation, this);+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 234);+this._controls.nextMonth.on(["click", "keydown"], this._focusNavigation, this);+ },+++++ /**+ * Private render assist method that renders the previous month control+ * + * @method _renderPrevControls+ * @private+ */+ _renderPrevControls : function () {+ _yuitest_coverfunc("build/calendarnavigator/calendarnavigator.js", "_renderPrevControls", 246);+_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 247);+var prevControlNode = create(substitute (CalendarNavigator.PREV_MONTH_CONTROL_TEMPLATE,+ CalendarNavigator.CALENDARNAV_STRINGS));+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 249);+prevControlNode.on("selectstart", this.get(HOST)._preventSelectionStart);++ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 251);+return prevControlNode; + },++ /**+ * Private render assist method that renders the next month control+ * + * @method _renderNextControls+ * @private+ */+ _renderNextControls : function () {+ _yuitest_coverfunc("build/calendarnavigator/calendarnavigator.js", "_renderNextControls", 260);+_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 261);+var nextControlNode = create(substitute (CalendarNavigator.NEXT_MONTH_CONTROL_TEMPLATE,+ CalendarNavigator.CALENDARNAV_STRINGS));+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 263);+nextControlNode.on("selectstart", this.get(HOST)._preventSelectionStart);+ + _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 265);+return nextControlNode; + },++ /**+ * Protected render assist method that initialized and renders the navigation controls.+ * @method _initNavigationControls+ * @protected+ */+ _initNavigationControls : function() {+ _yuitest_coverfunc("build/calendarnavigator/calendarnavigator.js", "_initNavigationControls", 273);+_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 274);+var host = this.get(HOST);+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 275);+CalendarNavigator.CALENDARNAV_STRINGS["control_tabindex"] = host.get("tabIndex");+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 276);+CalendarNavigator.CALENDARNAV_STRINGS["prev_month_arialabel"] = "Go to previous month";+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 277);+CalendarNavigator.CALENDARNAV_STRINGS["next_month_arialabel"] = "Go to next month";++ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 279);+var headerCell = host.get(CONTENT_BOX).one("." + CAL_HD);++ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 281);+this._controls.prevMonth = this._renderPrevControls();+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 282);+this._controls.nextMonth = this._renderNextControls();++ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 284);+this._updateControlState();++ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 286);+host.after("dateChange", this._updateControlState, this);++ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 288);+headerCell.prepend(this._controls.prevMonth);+ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 289);+headerCell.append(this._controls.nextMonth);+ }+});++_yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 293);+Y.namespace("Plugin").CalendarNavigator = CalendarNavigator;++}, '3.7.1', {"requires": ["plugin", "classnamemanager", "datatype-date", "node", "substitute"], "skinnable": true});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('calendarnavigator', function(Y) {+YUI.add('calendarnavigator', function (Y, NAME) { /** * Provides a plugin which adds navigation controls to Calendar.@@ -149,6 +149,18 @@ }, /**+ * Private utility method that focuses on a navigation button when it is clicked+ * or pressed with a keyboard.+ * + * @method _focusNavigation+ * @param {Event} ev Click or keydown event from the controls+ * @protected+ */+ _focusNavigation : function (ev) {+ ev.currentTarget.focus();+ },++ /** * Private utility method that subtracts months from the host calendar date * based on the control click and the shiftByMonths property. * @@ -184,6 +196,7 @@ _updateControlState : function () {+ var host = this.get(HOST); if (ydate.areEqual(host.get("minimumDate"), host.get("date"))) { if (this._eventAttachments.prevMonth) {@@ -222,9 +235,14 @@ this._controls.nextMonth.removeClass(CAL_DIS_M).setAttribute("aria-disabled", "false"); } }++ this._controls.prevMonth.on(["click", "keydown"], this._focusNavigation, this);+ this._controls.nextMonth.on(["click", "keydown"], this._focusNavigation, this); }, ++ /** * Private render assist method that renders the previous month control * @@ -234,7 +252,7 @@ _renderPrevControls : function () { var prevControlNode = create(substitute (CalendarNavigator.PREV_MONTH_CONTROL_TEMPLATE, CalendarNavigator.CALENDARNAV_STRINGS));- prevControlNode.on("selectstart", function (ev) {ev.preventDefault();});+ prevControlNode.on("selectstart", this.get(HOST)._preventSelectionStart); return prevControlNode; },@@ -248,7 +266,7 @@ _renderNextControls : function () { var nextControlNode = create(substitute (CalendarNavigator.NEXT_MONTH_CONTROL_TEMPLATE, CalendarNavigator.CALENDARNAV_STRINGS));- nextControlNode.on("selectstart", function (ev) {ev.preventDefault();});+ nextControlNode.on("selectstart", this.get(HOST)._preventSelectionStart); return nextControlNode; },@@ -280,5 +298,4 @@ Y.namespace("Plugin").CalendarNavigator = CalendarNavigator; --}, '3.5.1' ,{requires:['plugin', 'classnamemanager', 'datatype-date', 'node', 'substitute']});+}, '3.7.1', {"requires": ["plugin", "classnamemanager", "datatype-date", "node", "substitute"], "skinnable": true});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("calendarnavigator",function(a){var n="contentBox",p="host",l="rendered",b=a.ClassNameManager.getClassName,i=a.substitute,c=a.Node,h=c.create,o="calendar",f="calendarnav",j=b(o,"header"),d=b(f,"prevmonth"),e=b(f,"nextmonth"),g=b(f,"month-disabled"),m=a.DataType.Date;function k(q){k.superclass.constructor.apply(this,arguments);}k.NS="navigator";k.NAME="pluginCalendarNavigator";k.ATTRS={shiftByMonths:{value:1}};k.CALENDARNAV_STRINGS={prev_month_class:d,next_month_class:e};k.PREV_MONTH_CONTROL_TEMPLATE='<a class="yui3-u {prev_month_class}" role="button" aria-label="{prev_month_arialabel}" tabindex="{control_tabindex}">'+"<span><</span>"+"</a>";k.NEXT_MONTH_CONTROL_TEMPLATE='<a class="yui3-u {next_month_class}" role="button" aria-label="{next_month_arialabel}" tabindex="{control_tabindex}">'+"<span>></span>"+"</a>";a.extend(k,a.Plugin.Base,{_eventAttachments:{},_controls:{},initializer:function(q){this._controls={};this._eventAttachments={};this.afterHostMethod("renderUI",this._initNavigationControls);},destructor:function(){},_subtractMonths:function(s){if((s.type==="click")||(s.type==="keydown"&&(s.keyCode==13||s.keyCode==32))){var r=this.get(p);var q=r.get("date");r.set("date",m.addMonths(q,-1*this.get("shiftByMonths")));s.preventDefault();}},_addMonths:function(s){if((s.type==="click")||(s.type==="keydown"&&(s.keyCode==13||s.keyCode==32))){var r=this.get(p);var q=r.get("date");r.set("date",m.addMonths(q,this.get("shiftByMonths")));s.preventDefault();}},_updateControlState:function(){var q=this.get(p);if(m.areEqual(q.get("minimumDate"),q.get("date"))){if(this._eventAttachments.prevMonth){this._eventAttachments.prevMonth.detach();this._eventAttachments.prevMonth=false;}if(!this._controls.prevMonth.hasClass(g)){this._controls.prevMonth.addClass(g).setAttribute("aria-disabled","true");}}else{if(!this._eventAttachments.prevMonth){this._eventAttachments.prevMonth=this._controls.prevMonth.on(["click","keydown"],this._subtractMonths,this);}if(this._controls.prevMonth.hasClass(g)){this._controls.prevMonth.removeClass(g).setAttribute("aria-disabled","false");}}if(m.areEqual(q.get("maximumDate"),m.addMonths(q.get("date"),q._paneNumber-1))){if(this._eventAttachments.nextMonth){this._eventAttachments.nextMonth.detach();this._eventAttachments.nextMonth=false;}if(!this._controls.nextMonth.hasClass(g)){this._controls.nextMonth.addClass(g).setAttribute("aria-disabled","true");}}else{if(!this._eventAttachments.nextMonth){this._eventAttachments.nextMonth=this._controls.nextMonth.on(["click","keydown"],this._addMonths,this);}if(this._controls.nextMonth.hasClass(g)){this._controls.nextMonth.removeClass(g).setAttribute("aria-disabled","false");}}},_renderPrevControls:function(){var q=h(i(k.PREV_MONTH_CONTROL_TEMPLATE,k.CALENDARNAV_STRINGS));q.on("selectstart",function(r){r.preventDefault();});return q;},_renderNextControls:function(){var q=h(i(k.NEXT_MONTH_CONTROL_TEMPLATE,k.CALENDARNAV_STRINGS));q.on("selectstart",function(r){r.preventDefault();});return q;},_initNavigationControls:function(){var q=this.get(p);k.CALENDARNAV_STRINGS["control_tabindex"]=q.get("tabIndex");k.CALENDARNAV_STRINGS["prev_month_arialabel"]="Go to previous month";k.CALENDARNAV_STRINGS["next_month_arialabel"]="Go to next month";var r=q.get(n).one("."+j);this._controls.prevMonth=this._renderPrevControls();this._controls.nextMonth=this._renderNextControls();this._updateControlState();q.after("dateChange",this._updateControlState,this);r.prepend(this._controls.prevMonth);r.append(this._controls.nextMonth);}});a.namespace("Plugin").CalendarNavigator=k;},"3.5.1",{requires:["plugin","classnamemanager","datatype-date","node","substitute"]});+YUI.add("calendarnavigator",function(e,t){function m(e){m.superclass.constructor.apply(this,arguments)}var n="contentBox",r="host",i="rendered",s=e.ClassNameManager.getClassName,o=e.substitute,u=e.Node,a=u.create,f="calendar",l="calendarnav",c=s(f,"header"),h=s(l,"prevmonth"),p=s(l,"nextmonth"),d=s(l,"month-disabled"),v=e.DataType.Date;m.NS="navigator",m.NAME="pluginCalendarNavigator",m.ATTRS={shiftByMonths:{value:1}},m.CALENDARNAV_STRINGS={prev_month_class:h,next_month_class:p},m.PREV_MONTH_CONTROL_TEMPLATE='<a class="yui3-u {prev_month_class}" role="button" aria-label="{prev_month_arialabel}" tabindex="{control_tabindex}"><span><</span></a>',m.NEXT_MONTH_CONTROL_TEMPLATE='<a class="yui3-u {next_month_class}" role="button" aria-label="{next_month_arialabel}" tabindex="{control_tabindex}"><span>></span></a>',e.extend(m,e.Plugin.Base,{_eventAttachments:{},_controls:{},initializer:function(e){this._controls={},this._eventAttachments={},this.afterHostMethod("renderUI",this._initNavigationControls)},destructor:function(){},_focusNavigation:function(e){e.currentTarget.focus()},_subtractMonths:function(e){if(e.type==="click"||e.type==="keydown"&&(e.keyCode==13||e.keyCode==32)){var t=this.get(r),n=t.get("date");t.set("date",v.addMonths(n,-1*this.get("shiftByMonths"))),e.preventDefault()}},_addMonths:function(e){if(e.type==="click"||e.type==="keydown"&&(e.keyCode==13||e.keyCode==32)){var t=this.get(r),n=t.get("date");t.set("date",v.addMonths(n,this.get("shiftByMonths"))),e.preventDefault()}},_updateControlState:function(){var e=this.get(r);v.areEqual(e.get("minimumDate"),e.get("date"))?(this._eventAttachments.prevMonth&&(this._eventAttachments.prevMonth.detach(),this._eventAttachments.prevMonth=!1),this._controls.prevMonth.hasClass(d)||this._controls.prevMonth.addClass(d).setAttribute("aria-disabled","true")):(this._eventAttachments.prevMonth||(this._eventAttachments.prevMonth=this._controls.prevMonth.on(["click","keydown"],this._subtractMonths,this)),this._controls.prevMonth.hasClass(d)&&this._controls.prevMonth.removeClass(d).setAttribute("aria-disabled","false")),v.areEqual(e.get("maximumDate"),v.addMonths(e.get("date"),e._paneNumber-1))?(this._eventAttachments.nextMonth&&(this._eventAttachments.nextMonth.detach(),this._eventAttachments.nextMonth=!1),this._controls.nextMonth.hasClass(d)||this._controls.nextMonth.addClass(d).setAttribute("aria-disabled","true")):(this._eventAttachments.nextMonth||(this._eventAttachments.nextMonth=this._controls.nextMonth.on(["click","keydown"],this._addMonths,this)),this._controls.nextMonth.hasClass(d)&&this._controls.nextMonth.removeClass(d).setAttribute("aria-disabled","false")),this._controls.prevMonth.on(["click","keydown"],this._focusNavigation,this),this._controls.nextMonth.on(["click","keydown"],this._focusNavigation,this)},_renderPrevControls:function(){var e=a(o(m.PREV_MONTH_CONTROL_TEMPLATE,m.CALENDARNAV_STRINGS));return e.on("selectstart",this.get(r)._preventSelectionStart),e},_renderNextControls:function(){var e=a(o(m.NEXT_MONTH_CONTROL_TEMPLATE,m.CALENDARNAV_STRINGS));return e.on("selectstart",this.get(r)._preventSelectionStart),e},_initNavigationControls:function(){var e=this.get(r);m.CALENDARNAV_STRINGS.control_tabindex=e.get("tabIndex"),m.CALENDARNAV_STRINGS.prev_month_arialabel="Go to previous month",m.CALENDARNAV_STRINGS.next_month_arialabel="Go to next month";var t=e.get(n).one("."+c);this._controls.prevMonth=this._renderPrevControls(),this._controls.nextMonth=this._renderNextControls(),this._updateControlState(),e.after("dateChange",this._updateControlState,this),t.prepend(this._controls.prevMonth),t.append(this._controls.nextMonth)}}),e.namespace("Plugin").CalendarNavigator=m},"3.7.1",{requires:["plugin","classnamemanager","datatype-date","node","substitute"],skinnable:!0});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('calendarnavigator', function(Y) {+YUI.add('calendarnavigator', function (Y, NAME) { /** * Provides a plugin which adds navigation controls to Calendar.@@ -149,6 +149,18 @@ }, /**+ * Private utility method that focuses on a navigation button when it is clicked+ * or pressed with a keyboard.+ * + * @method _focusNavigation+ * @param {Event} ev Click or keydown event from the controls+ * @protected+ */+ _focusNavigation : function (ev) {+ ev.currentTarget.focus();+ },++ /** * Private utility method that subtracts months from the host calendar date * based on the control click and the shiftByMonths property. * @@ -184,6 +196,7 @@ _updateControlState : function () {+ var host = this.get(HOST); if (ydate.areEqual(host.get("minimumDate"), host.get("date"))) { if (this._eventAttachments.prevMonth) {@@ -222,9 +235,14 @@ this._controls.nextMonth.removeClass(CAL_DIS_M).setAttribute("aria-disabled", "false"); } }++ this._controls.prevMonth.on(["click", "keydown"], this._focusNavigation, this);+ this._controls.nextMonth.on(["click", "keydown"], this._focusNavigation, this); }, ++ /** * Private render assist method that renders the previous month control * @@ -234,7 +252,7 @@ _renderPrevControls : function () { var prevControlNode = create(substitute (CalendarNavigator.PREV_MONTH_CONTROL_TEMPLATE, CalendarNavigator.CALENDARNAV_STRINGS));- prevControlNode.on("selectstart", function (ev) {ev.preventDefault();});+ prevControlNode.on("selectstart", this.get(HOST)._preventSelectionStart); return prevControlNode; },@@ -248,7 +266,7 @@ _renderNextControls : function () { var nextControlNode = create(substitute (CalendarNavigator.NEXT_MONTH_CONTROL_TEMPLATE, CalendarNavigator.CALENDARNAV_STRINGS));- nextControlNode.on("selectstart", function (ev) {ev.preventDefault();});+ nextControlNode.on("selectstart", this.get(HOST)._preventSelectionStart); return nextControlNode; },@@ -280,5 +298,4 @@ Y.namespace("Plugin").CalendarNavigator = CalendarNavigator; --}, '3.5.1' ,{requires:['plugin', 'classnamemanager', 'datatype-date', 'node', 'substitute']});+}, '3.7.1', {"requires": ["plugin", "classnamemanager", "datatype-date", "node", "substitute"], "skinnable": true});
@@ -0,0 +1,20682 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/charts-base/charts-base.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/charts-base/charts-base.js",+ code: []+};+_yuitest_coverage["build/charts-base/charts-base.js"].code=["YUI.add('charts-base', function (Y, NAME) {","","/**"," * The Charts widget provides an api for displaying data"," * graphically."," *"," * @module charts"," * @main charts"," */","","/**"," * The charts-base submodule contains the core functionality for the charts module."," *"," * @module charts"," * @submodule charts-base"," */","var CONFIG = Y.config,"," WINDOW = CONFIG.win,"," DOCUMENT = CONFIG.doc,"," Y_Lang = Y.Lang,"," IS_STRING = Y_Lang.isString,"," Y_DOM = Y.DOM,"," LeftAxisLayout,"," RightAxisLayout,"," BottomAxisLayout,"," TopAxisLayout,"," _getClassName = Y.ClassNameManager.getClassName,"," SERIES_MARKER = _getClassName(\"seriesmarker\"),"," ShapeGroup,"," CircleGroup,"," RectGroup,"," EllipseGroup,"," DiamondGroup;","","/**"," * Abstract class for creating groups of shapes with the same styles and dimensions."," *"," * @class ShapeGroup"," * @constructor"," */"," ShapeGroup = function(cfg)"," {"," ShapeGroup.superclass.constructor.apply(this, arguments);"," };"," "," ShapeGroup.NAME = \"shapeGroup\";",""," Y.extend(ShapeGroup, Y.Path, { "," /**"," * Updates the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," var xvalues = this.get(\"xvalues\"),"," yvalues = this.get(\"yvalues\"),"," x,"," y,"," xRad,"," yRad,"," i = 0,"," len,"," attrs = [],"," dimensions = this.get(\"dimensions\"),"," width = dimensions.width,"," height = dimensions.height,"," radius = dimensions.radius,"," yRadius = dimensions.yRadius,"," id = this.get(\"id\"),"," className = this.node.className,"," widthIsArray = Y_Lang.isArray(width),"," heightIsArray = Y_Lang.isArray(height),"," radiusIsArray = Y_Lang.isArray(radius),"," yRadiusIsArray = Y_Lang.isArray(yRadius);"," if(xvalues && yvalues && xvalues.length > 0)"," {"," this.clear();",""," len = xvalues.length;"," for(; i < len; ++i)"," {"," x = xvalues[i];"," y = yvalues[i];"," xRad = radiusIsArray ? radius[i] : radius;"," yRad = yRadiusIsArray ? yRadius[i] : yRadius;"," if(!isNaN(x) && !isNaN(y) && !isNaN(xRad))"," {"," this.drawShape({"," x: x,"," y: y,"," width: widthIsArray ? width[i] : width,"," height: heightIsArray ? height[i] : height,"," radius: xRad,"," yRadius: yRad "," });"," this.closePath();"," attrs[i] = {"," id: id + \"_\" + i,"," className: className,"," coords: (x - this._left) + \", \" + (y - this._top) + \", \" + radius,"," shape: \"circle\""," };"," }"," }"," this._closePath();"," }"," },",""," /**"," * Parses and array of lengths into radii"," *"," * @method _getRadiusCollection"," * @param {Array} val Array of lengths"," * @return Array"," * @private"," */"," _getRadiusCollection: function(val)"," {"," var i = 0,"," len = val.length,"," radii = [];"," for(; i < len; ++i)"," { "," radii[i] = val[i] * 0.5;"," }"," return radii;"," }"," });"," ","ShapeGroup.ATTRS = Y.merge(Y.Path.ATTRS, {"," dimensions: {"," getter: function()"," {"," var dimensions = this._dimensions,"," radius,"," yRadius,"," width,"," height;"," if(dimensions.hasOwnProperty(\"radius\"))"," {"," return dimensions;"," }"," else"," {"," width = dimensions.width;"," height = dimensions.height;"," radius = Y_Lang.isArray(width) ? this._getRadiusCollection(width) : (width * 0.5);"," yRadius = Y_Lang.isArray(height) ? this._getRadiusCollection(height) : (height * 0.5);"," return {"," width: width,"," height: height,"," radius: radius,"," yRadius: yRadius"," };"," }"," },",""," setter: function(val)"," {"," this._dimensions = val;"," return val;"," }"," },"," xvalues: {"," getter: function()"," {"," return this._xvalues;"," },"," setter: function(val)"," {"," this._xvalues = val;"," }"," },"," yvalues: {"," getter: function()"," {"," return this._yvalues;"," },"," setter: function(val)"," {"," this._yvalues = val;"," }"," }","});","Y.ShapeGroup = ShapeGroup;","/**"," * Abstract class for creating groups of circles with the same styles and dimensions."," *"," * @module charts"," * @submodule charts-base"," * @class CircleGroup"," * @constructor"," */"," CircleGroup = function(cfg)"," {"," CircleGroup.superclass.constructor.apply(this, arguments);"," };"," "," CircleGroup.NAME = \"circleGroup\";",""," Y.extend(CircleGroup, Y.ShapeGroup, { "," /**"," * Algorithm for drawing shape."," *"," * @method drawShape"," * @param {Object} cfg Parameters used to draw the shape."," */"," drawShape: function(cfg)"," {"," this.drawCircle(cfg.x, cfg.y, cfg.radius);"," }"," });","","CircleGroup.ATTRS = Y.merge(Y.ShapeGroup.ATTRS, {"," dimensions: {"," getter: function()"," {"," var dimensions = this._dimensions,"," radius,"," yRadius,"," width,"," height;"," if(dimensions.hasOwnProperty(\"radius\"))"," {"," return dimensions;"," }"," else"," {"," width = dimensions.width;"," height = dimensions.height;"," radius = Y_Lang.isArray(width) ? this._getRadiusCollection(width) : (width * 0.5);"," yRadius = radius;"," return {"," width: width,"," height: height,"," radius: radius,"," yRadius: yRadius"," };"," }"," }"," }","});"," ","CircleGroup.ATTRS = Y.ShapeGroup.ATTRS;","Y.CircleGroup = CircleGroup;","/**"," * Abstract class for creating groups of rects with the same styles and dimensions."," *"," * @module charts"," * @submodule charts-base"," * @class GroupRect"," * @constructor"," */"," RectGroup = function(cfg)"," {"," RectGroup.superclass.constructor.apply(this, arguments);"," };"," "," RectGroup.NAME = \"rectGroup\";",""," Y.extend(RectGroup, Y.ShapeGroup, { "," /**"," * Updates the rect."," *"," * @method _draw"," * @private"," */"," drawShape: function(cfg)"," {"," this.drawRect(cfg.x, cfg.y, cfg.width, cfg.height);"," }"," });"," ","RectGroup.ATTRS = Y.ShapeGroup.ATTRS;","Y.RectGroup = RectGroup;","/**"," * Abstract class for creating groups of diamonds with the same styles and dimensions."," *"," * @module charts"," * @submodule charts-base"," * @class GroupDiamond"," * @constructor"," */"," DiamondGroup = function(cfg)"," {"," DiamondGroup.superclass.constructor.apply(this, arguments);"," };"," "," DiamondGroup.NAME = \"diamondGroup\";",""," Y.extend(DiamondGroup, Y.ShapeGroup, { "," /**"," * Updates the diamond."," *"," * @method _draw"," * @private"," */"," drawShape: function(cfg)"," {"," this.drawDiamond(cfg.x, cfg.y, cfg.width, cfg.height);"," }"," });"," ","DiamondGroup.ATTRS = Y.ShapeGroup.ATTRS;","Y.DiamondGroup = DiamondGroup;","/**"," * Abstract class for creating groups of diamonds with the same styles and dimensions."," *"," * @module charts"," * @submodule charts-base"," * @class EllipseGroup"," * @constructor"," */"," EllipseGroup = function(cfg)"," {"," EllipseGroup.superclass.constructor.apply(this, arguments);"," };"," "," EllipseGroup.NAME = \"diamondGroup\";",""," Y.extend(EllipseGroup, Y.ShapeGroup, { "," /**"," * Updates the diamond."," *"," * @method _draw"," * @private"," */"," drawShape: function(cfg)"," {"," this.drawEllipse(cfg.x, cfg.y, cfg.width, cfg.height);"," }"," });"," ","EllipseGroup.ATTRS = Y.ShapeGroup.ATTRS;","Y.EllipseGroup = EllipseGroup;","/**"," * The Renderer class is a base class for chart components that use the `styles`"," * attribute."," *"," * @module charts"," * @submodule charts-base"," * @class Renderer"," * @constructor"," */","function Renderer(){}","","Renderer.ATTRS = {"," /**"," * Style properties for class"," * "," * @attribute styles"," * @type Object"," */"," styles:"," {"," getter: function()"," {"," this._styles = this._styles || this._getDefaultStyles();"," return this._styles;"," },",""," setter: function(val)"," {"," this._styles = this._setStyles(val);"," }"," },"," "," /**"," * The graphic in which drawings will be rendered."," *"," * @attribute graphic"," * @type Graphic"," */"," graphic: {}","};","Renderer.NAME = \"renderer\";","","Renderer.prototype = {"," /**"," * Storage for `styles` attribute."," *"," * @property _styles"," * @type Object"," * @private"," */"," _styles: null,"," "," /**"," * Method used by `styles` setter."," *"," * @method _setStyles"," * @param {Object} newStyles Hash of properties to update."," * @return Object"," * @protected"," */"," _setStyles: function(newstyles)"," {"," var styles = this.get(\"styles\");"," return this._mergeStyles(newstyles, styles);"," },"," "," /**"," * Merges to object literals so that only specified properties are "," * overwritten."," *"," * @method _mergeStyles"," * @param {Object} a Hash of new styles"," * @param {Object} b Hash of original styles"," * @return Object"," * @protected"," */"," _mergeStyles: function(a, b)"," {"," if(!b)"," {"," b = {};"," }"," var newstyles = Y.merge(b, {});"," Y.Object.each(a, function(value, key, a)"," {"," if(b.hasOwnProperty(key) && Y_Lang.isObject(value) && !Y_Lang.isFunction(value) && !Y_Lang.isArray(value))"," {"," newstyles[key] = this._mergeStyles(value, b[key]);"," }"," else"," {"," newstyles[key] = value;"," }"," }, this);"," return newstyles;"," },",""," /**"," * Gets the default value for the `styles` attribute. "," *"," * @method _getDefaultStyles"," * @return Object"," * @protected"," */"," _getDefaultStyles: function()"," {"," return {padding:{"," top:0,"," right: 0,"," bottom: 0,"," left: 0"," }};"," }","};","","Y.augment(Renderer, Y.Attribute);","Y.Renderer = Renderer;","","/**"," * Algorithmic strategy for rendering a left axis."," *"," * @module charts"," * @submodule charts-base"," * @class LeftAxisLayout"," * @constructor"," */","LeftAxisLayout = function() {};","","LeftAxisLayout.prototype = {"," /**"," * Default margins for text fields."," *"," * @private"," * @method _getDefaultMargins"," * @return Object"," */"," _getDefaultMargins: function() "," {"," return {"," top: 0,"," left: 0,"," right: 4,"," bottom: 0"," };"," },",""," /**"," * Sets the length of the tick on either side of the axis line."," *"," * @method setTickOffset"," * @protected"," */"," setTickOffsets: function()"," {"," var host = this,"," majorTicks = host.get(\"styles\").majorTicks,"," tickLength = majorTicks.length,"," halfTick = tickLength * 0.5,"," display = majorTicks.display;"," host.set(\"topTickOffset\", 0);"," host.set(\"bottomTickOffset\", 0);"," "," switch(display)"," {"," case \"inside\" :"," host.set(\"rightTickOffset\", tickLength);"," host.set(\"leftTickOffset\", 0);"," break;"," case \"outside\" : "," host.set(\"rightTickOffset\", 0);"," host.set(\"leftTickOffset\", tickLength);"," break;"," case \"cross\":"," host.set(\"rightTickOffset\", halfTick); "," host.set(\"leftTickOffset\", halfTick);"," break;"," default:"," host.set(\"rightTickOffset\", 0);"," host.set(\"leftTickOffset\", 0);"," break;"," }"," },"," "," /**"," * Draws a tick"," *"," * @method drawTick"," * @param {Path} path reference to the path `Path` element in which to draw the tick."," * @param {Object} pt Point on the axis in which the tick will intersect."," * @param {Object} tickStyle Hash of properties to apply to the tick."," * @protected"," */"," drawTick: function(path, pt, tickStyles)"," {"," var host = this,"," style = host.get(\"styles\"),"," padding = style.padding,"," tickLength = tickStyles.length,"," start = {x:padding.left, y:pt.y},"," end = {x:tickLength + padding.left, y:pt.y};"," host.drawLine(path, start, end);"," },",""," /**"," * Calculates the coordinates for the first point on an axis."," *"," * @method getLineStart"," * @return {Object}"," * @protected"," */"," getLineStart: function()"," {"," var style = this.get(\"styles\"),"," padding = style.padding,"," majorTicks = style.majorTicks,"," tickLength = majorTicks.length,"," display = majorTicks.display,"," pt = {x:padding.left, y:0};"," if(display === \"outside\")"," {"," pt.x += tickLength;"," }"," else if(display === \"cross\")"," {"," pt.x += tickLength/2;"," }"," return pt; "," },"," "," /**"," * Calculates the point for a label."," *"," * @method getLabelPoint"," * @param {Object} point Point on the axis in which the tick will intersect."," * @return {Object} "," * @protected"," */"," getLabelPoint: function(point)"," {"," return {x:point.x - this.get(\"leftTickOffset\"), y:point.y};"," },"," "," /**"," * Updates the value for the `maxLabelSize` for use in calculating total size."," *"," * @method updateMaxLabelSize"," * @param {HTMLElement} label to measure"," * @protected"," */"," updateMaxLabelSize: function(labelWidth, labelHeight)"," {"," var host = this,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," sinRadians = props.sinRadians,"," cosRadians = props.cosRadians,"," max;"," if(rot === 0)"," {"," max = labelWidth;"," }"," else if(absRot === 90)"," {"," max = labelHeight;"," }"," else"," {"," max = (cosRadians * labelWidth) + (sinRadians * labelHeight);"," }"," host._maxLabelSize = Math.max(host._maxLabelSize, max);"," },"," "," /**"," * Determines the available label width when the axis width has been explicitly set."," *"," * @method getExplicitlySized"," * @return Boolean"," * @protected"," */"," getExplicitlySized: function(styles)"," {"," if(this._explicitWidth)"," {"," var host = this,"," w = host._explicitWidth,"," totalTitleSize = host._totalTitleSize,"," leftTickOffset = host.get(\"leftTickOffset\"),"," margin = styles.label.margin.right;"," host._maxLabelSize = w - (leftTickOffset + margin + totalTitleSize);"," return true;"," }"," return false;"," },",""," /**"," * Rotate and position title."," *"," * @method positionTitle"," * @param {HTMLElement} label to rotate position"," * @protected"," */"," positionTitle: function(label)"," {"," var host = this,"," bounds = host._titleBounds,"," margin = host.get(\"styles\").title.margin,"," props = host._titleRotationProps,"," w = bounds.right - bounds.left,"," labelWidth = label.offsetWidth,"," labelHeight = label.offsetHeight,"," x = (labelWidth * -0.5) + (w * 0.5),"," y = (host.get(\"height\") * 0.5) - (labelHeight * 0.5);"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," if(margin && margin.left)"," {"," x += margin.left;"," }"," props.x = x;"," props.y = y;"," props.transformOrigin = [0.5, 0.5];"," host._rotate(label, props);"," },",""," /**"," * Rotate and position labels."," *"," * @method positionLabel"," * @param {HTMLElement} label to rotate position"," * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned"," * against."," * @protected"," */"," positionLabel: function(label, pt, styles, i)"," {"," var host = this,"," tickOffset = host.get(\"leftTickOffset\"),"," totalTitleSize = this._totalTitleSize,"," leftOffset = pt.x + totalTitleSize - tickOffset,"," topOffset = pt.y,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," maxLabelSize = host._maxLabelSize,"," labelWidth = this._labelWidths[i],"," labelHeight = this._labelHeights[i];"," if(rot === 0)"," {"," leftOffset -= labelWidth;"," topOffset -= labelHeight * 0.5;"," }"," else if(rot === 90)"," {"," leftOffset -= labelWidth * 0.5;"," }"," else if(rot === -90)"," {"," leftOffset -= labelWidth * 0.5;"," topOffset -= labelHeight;"," }"," else"," {"," leftOffset -= labelWidth + (labelHeight * absRot/360);"," topOffset -= labelHeight * 0.5;"," }"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," props.x = Math.round(maxLabelSize + leftOffset);"," props.y = Math.round(topOffset);"," this._rotate(label, props);"," },",""," /**"," * Adjusts the coordinates of an axis label based on the rotation."," *"," * @method _setRotationCoords"," * @param {Object} props Coordinates, dimension and rotation properties of the label."," * @protected"," */"," _setRotationCoords: function(props)"," {"," var rot = props.rot,"," absRot = props.absRot,"," leftOffset,"," topOffset,"," labelWidth = props.labelWidth,"," labelHeight = props.labelHeight;"," if(rot === 0)"," {"," leftOffset = labelWidth;"," topOffset = labelHeight * 0.5;"," }"," else if(rot === 90)"," {"," topOffset = 0;"," leftOffset = labelWidth * 0.5;"," }"," else if(rot === -90)"," {"," leftOffset = labelWidth * 0.5;"," topOffset = labelHeight;"," }"," else"," {"," leftOffset = labelWidth + (labelHeight * absRot/360);"," topOffset = labelHeight * 0.5;"," }"," props.x -= leftOffset;"," props.y -= topOffset;"," },",""," /**"," * Returns the transformOrigin to use for an axis label based on the position of the axis "," * and the rotation of the label."," *"," * @method _getTransformOrigin"," * @param {Number} rot The rotation (in degrees) of the label."," * @return Array"," * @protected"," */"," _getTransformOrigin: function(rot)"," {"," var transformOrigin;"," if(rot === 0)"," {"," transformOrigin = [0, 0];"," }"," else if(rot === 90)"," {"," transformOrigin = [0.5, 0];"," }"," else if(rot === -90)"," {"," transformOrigin = [0.5, 1];"," }"," else"," {"," transformOrigin = [1, 0.5];"," }"," return transformOrigin;"," },",""," /**"," * Adjust the position of the Axis widget's content box for internal axes."," *"," * @method offsetNodeForTick"," * @param {Node} cb Content box of the Axis."," * @protected"," */"," offsetNodeForTick: function(cb)"," {"," },",""," /**"," * Sets the width of the axis based on its contents."," *"," * @method setCalculatedSize"," * @protected"," */"," setCalculatedSize: function()"," {"," var host = this,"," graphic = this.get(\"graphic\"),"," style = host.get(\"styles\"),"," label = style.label,"," tickOffset = host.get(\"leftTickOffset\"),"," max = host._maxLabelSize,"," totalTitleSize = this._totalTitleSize,"," ttl = Math.round(totalTitleSize + tickOffset + max + label.margin.right);"," if(this._explicitWidth)"," {"," ttl = this._explicitWidth;"," }"," this.set(\"calculatedWidth\", ttl);"," graphic.set(\"x\", ttl - tickOffset);"," }","};","","Y.LeftAxisLayout = LeftAxisLayout;","/**"," * RightAxisLayout contains algorithms for rendering a right axis."," *"," * @module charts"," * @submodule charts-base"," * @class RightAxisLayout"," * @constructor"," */","RightAxisLayout = function(){};","","RightAxisLayout.prototype = {"," /**"," * Default margins for text fields."," *"," * @private"," * @method _getDefaultMargins"," * @return Object"," */"," _getDefaultMargins: function() "," {"," return {"," top: 0,"," left: 4,"," right: 0,"," bottom: 0"," };"," },",""," /**"," * Sets the length of the tick on either side of the axis line."," *"," * @method setTickOffset"," * @protected"," */"," setTickOffsets: function()"," {"," var host = this,"," majorTicks = host.get(\"styles\").majorTicks,"," tickLength = majorTicks.length,"," halfTick = tickLength * 0.5,"," display = majorTicks.display;"," host.set(\"topTickOffset\", 0);"," host.set(\"bottomTickOffset\", 0);"," "," switch(display)"," {"," case \"inside\" :"," host.set(\"leftTickOffset\", tickLength);"," host.set(\"rightTickOffset\", 0);"," break;"," case \"outside\" : "," host.set(\"leftTickOffset\", 0);"," host.set(\"rightTickOffset\", tickLength);"," break;"," case \"cross\" :"," host.set(\"rightTickOffset\", halfTick);"," host.set(\"leftTickOffset\", halfTick);"," break;"," default:"," host.set(\"leftTickOffset\", 0);"," host.set(\"rightTickOffset\", 0);"," break;"," }"," },",""," /**"," * Draws a tick"," *"," * @method drawTick"," * @param {Path} path reference to the path `Path` element in which to draw the tick."," * @param {Object} pt Point on the axis in which the tick will intersect."," * @param {Object) tickStyle Hash of properties to apply to the tick."," * @protected"," */"," drawTick: function(path, pt, tickStyles)"," {"," var host = this,"," style = host.get(\"styles\"),"," padding = style.padding,"," tickLength = tickStyles.length,"," start = {x:padding.left, y:pt.y},"," end = {x:padding.left + tickLength, y:pt.y};"," host.drawLine(path, start, end);"," },"," "," /**"," * Calculates the coordinates for the first point on an axis."," *"," * @method getLineStart"," * @return {Object}"," * @protected"," */"," getLineStart: function()"," {"," var host = this,"," style = host.get(\"styles\"),"," padding = style.padding,"," majorTicks = style.majorTicks,"," tickLength = majorTicks.length,"," display = majorTicks.display,"," pt = {x:padding.left, y:padding.top};"," if(display === \"inside\")"," {"," pt.x += tickLength;"," }"," else if(display === \"cross\")"," {"," pt.x += tickLength/2;"," }"," return pt;"," },"," "," /**"," * Calculates the point for a label."," *"," * @method getLabelPoint"," * @param {Object} point Point on the axis in which the tick will intersect."," * @return {Object} "," * @protected"," */"," getLabelPoint: function(point)"," {"," return {x:point.x + this.get(\"rightTickOffset\"), y:point.y};"," },"," "," /**"," * Updates the value for the `maxLabelSize` for use in calculating total size."," *"," * @method updateMaxLabelSize"," * @param {HTMLElement} label to measure"," * @protected"," */"," updateMaxLabelSize: function(labelWidth, labelHeight)"," {"," var host = this,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," sinRadians = props.sinRadians,"," cosRadians = props.cosRadians,"," max;"," if(rot === 0)"," {"," max = labelWidth;"," }"," else if(absRot === 90)"," {"," max = labelHeight;"," }"," else"," {"," max = (cosRadians * labelWidth) + (sinRadians * labelHeight);"," }"," host._maxLabelSize = Math.max(host._maxLabelSize, max);"," },"," "," /**"," * Determines the available label width when the axis width has been explicitly set."," *"," * @method getExplicitlySized"," * @return Boolean"," * @protected"," */"," getExplicitlySized: function(styles)"," {"," if(this._explicitWidth)"," {"," var host = this,"," w = host._explicitWidth,"," totalTitleSize = this._totalTitleSize,"," rightTickOffset = host.get(\"rightTickOffset\"),"," margin = styles.label.margin.right;"," host._maxLabelSize = w - (rightTickOffset + margin + totalTitleSize);"," return true;"," }"," return false;"," },",""," /**"," * Rotate and position title."," *"," * @method positionTitle"," * @param {HTMLElement} label to rotate position"," * @protected"," */"," positionTitle: function(label)"," {"," var host = this,"," bounds = host._titleBounds,"," margin = host.get(\"styles\").title.margin,"," props = host._titleRotationProps,"," labelWidth = label.offsetWidth,"," labelHeight = label.offsetHeight,"," w = bounds.right - bounds.left,"," x = this.get(\"width\") - (labelWidth * 0.5) - (w * 0.5),"," y = (host.get(\"height\") * 0.5) - (labelHeight * 0.5);"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," if(margin && margin.right)"," {"," x -= margin.left;"," }"," props.x = x;"," props.y = y;"," props.transformOrigin = [0.5, 0.5];"," host._rotate(label, props);"," },",""," /**"," * Rotate and position labels."," *"," * @method positionLabel"," * @param {HTMLElement} label to rotate position"," * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned"," * against."," * @protected"," */"," positionLabel: function(label, pt, styles, i)"," {"," var host = this,"," tickOffset = host.get(\"rightTickOffset\"),"," labelStyles = styles.label,"," margin = 0,"," leftOffset = pt.x,"," topOffset = pt.y,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," labelWidth = this._labelWidths[i],"," labelHeight = this._labelHeights[i];"," if(labelStyles.margin && labelStyles.margin.left)"," {"," margin = labelStyles.margin.left;"," }"," if(rot === 0)"," {"," topOffset -= labelHeight * 0.5;"," }"," else if(rot === 90)"," {"," leftOffset -= labelWidth * 0.5;"," topOffset -= labelHeight;"," }"," else if(rot === -90)"," {"," leftOffset -= labelWidth * 0.5;"," }"," else"," {"," topOffset -= labelHeight * 0.5;"," leftOffset += labelHeight/2 * absRot/90;"," }"," leftOffset += margin;"," leftOffset += tickOffset;"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," props.x = Math.round(leftOffset);"," props.y = Math.round(topOffset);"," this._rotate(label, props);"," },"," "," /**"," * Adjusts the coordinates of an axis label based on the rotation."," *"," * @method _setRotationCoords"," * @param {Object} props Coordinates, dimension and rotation properties of the label."," * @protected"," */"," _setRotationCoords: function(props)"," {"," var rot = props.rot,"," absRot = props.absRot,"," leftOffset = 0,"," topOffset = 0,"," labelWidth = props.labelWidth,"," labelHeight = props.labelHeight;"," if(rot === 0)"," {"," topOffset = labelHeight * 0.5;"," }"," else if(rot === 90)"," {"," leftOffset = labelWidth * 0.5;"," topOffset = labelHeight;"," }"," else if(rot === -90)"," {"," leftOffset = labelWidth * 0.5;"," }"," else"," {"," topOffset = labelHeight * 0.5;"," leftOffset = labelHeight/2 * absRot/90;"," }"," props.x -= leftOffset;"," props.y -= topOffset;"," },"," "," /**"," * Returns the transformOrigin to use for an axis label based on the position of the axis "," * and the rotation of the label."," *"," * @method _getTransformOrigin"," * @param {Number} rot The rotation (in degrees) of the label."," * @return Array"," * @protected"," */"," _getTransformOrigin: function(rot)"," {"," var transformOrigin;"," if(rot === 0)"," {"," transformOrigin = [0, 0];"," }"," else if(rot === 90)"," {"," transformOrigin = [0.5, 1];"," }"," else if(rot === -90)"," {"," transformOrigin = [0.5, 0];"," }"," else"," {"," transformOrigin = [0, 0.5];"," }"," return transformOrigin;"," },",""," /**"," * Adjusts position for inner ticks."," *"," * @method offsetNodeForTick"," * @param {Node} cb contentBox of the axis"," * @protected"," */"," offsetNodeForTick: function(cb)"," {"," var host = this,"," tickOffset = host.get(\"leftTickOffset\"),"," offset = 0 - tickOffset;"," cb.setStyle(\"left\", offset);"," },",""," /**"," * Assigns a height based on the size of the contents."," *"," * @method setCalculatedSize"," * @protected"," */"," setCalculatedSize: function()"," {"," var host = this,"," styles = host.get(\"styles\"),"," labelStyle = styles.label,"," totalTitleSize = this._totalTitleSize,"," ttl = Math.round(host.get(\"rightTickOffset\") + host._maxLabelSize + totalTitleSize + labelStyle.margin.left);"," if(this._explicitWidth)"," {"," ttl = this._explicitWidth;"," }"," host.set(\"calculatedWidth\", ttl);"," host.get(\"contentBox\").setStyle(\"width\", ttl);"," }","};","","Y.RightAxisLayout = RightAxisLayout;","/**"," * Contains algorithms for rendering a bottom axis."," *"," * @module charts"," * @submodule charts-base"," * @class BottomAxisLayout"," * @Constructor"," */","BottomAxisLayout = function(){};","","BottomAxisLayout.prototype = {"," /**"," * Default margins for text fields."," *"," * @private"," * @method _getDefaultMargins"," * @return Object"," */"," _getDefaultMargins: function() "," {"," return {"," top: 4,"," left: 0,"," right: 0,"," bottom: 0"," };"," },",""," /**"," * Sets the length of the tick on either side of the axis line."," *"," * @method setTickOffsets"," * @protected"," */"," setTickOffsets: function()"," {"," var host = this,"," majorTicks = host.get(\"styles\").majorTicks,"," tickLength = majorTicks.length,"," halfTick = tickLength * 0.5,"," display = majorTicks.display;"," host.set(\"leftTickOffset\", 0);"," host.set(\"rightTickOffset\", 0);",""," switch(display)"," {"," case \"inside\" :"," host.set(\"topTickOffset\", tickLength);"," host.set(\"bottomTickOffset\", 0);"," break;"," case \"outside\" : "," host.set(\"topTickOffset\", 0);"," host.set(\"bottomTickOffset\", tickLength);"," break;"," case \"cross\":"," host.set(\"topTickOffset\", halfTick);"," host.set(\"bottomTickOffset\", halfTick);"," break;"," default:"," host.set(\"topTickOffset\", 0);"," host.set(\"bottomTickOffset\", 0);"," break;"," }"," },",""," /**"," * Calculates the coordinates for the first point on an axis."," *"," * @method getLineStart"," * @protected"," */"," getLineStart: function()"," {"," var style = this.get(\"styles\"),"," padding = style.padding,"," majorTicks = style.majorTicks,"," tickLength = majorTicks.length,"," display = majorTicks.display,"," pt = {x:0, y:padding.top};"," if(display === \"inside\")"," {"," pt.y += tickLength;"," }"," else if(display === \"cross\")"," {"," pt.y += tickLength/2;"," }"," return pt; "," },"," "," /**"," * Draws a tick"," *"," * @method drawTick"," * @param {Path} path reference to the path `Path` element in which to draw the tick."," * @param {Object} pt hash containing x and y coordinates"," * @param {Object} tickStyles hash of properties used to draw the tick"," * @protected"," */"," drawTick: function(path, pt, tickStyles)"," {"," var host = this,"," style = host.get(\"styles\"),"," padding = style.padding,"," tickLength = tickStyles.length,"," start = {x:pt.x, y:padding.top},"," end = {x:pt.x, y:tickLength + padding.top};"," host.drawLine(path, start, end);"," },",""," /**"," * Calculates the point for a label."," *"," * @method getLabelPoint"," * @param {Object} pt Object containing x and y coordinates"," * @return Object"," * @protected"," */"," getLabelPoint: function(point)"," {"," return {x:point.x, y:point.y + this.get(\"bottomTickOffset\")};"," },"," "," /**"," * Updates the value for the `maxLabelSize` for use in calculating total size."," *"," * @method updateMaxLabelSize"," * @param {HTMLElement} label to measure"," * @protected"," */"," updateMaxLabelSize: function(labelWidth, labelHeight)"," {"," var host = this,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," sinRadians = props.sinRadians,"," cosRadians = props.cosRadians,"," max;"," if(rot === 0)"," {"," max = labelHeight;"," }"," else if(absRot === 90)"," {"," max = labelWidth;"," }"," else"," {"," max = (sinRadians * labelWidth) + (cosRadians * labelHeight); "," }"," host._maxLabelSize = Math.max(host._maxLabelSize, max);"," },"," "," /**"," * Determines the available label height when the axis width has been explicitly set."," *"," * @method getExplicitlySized"," * @return Boolean"," * @protected"," */"," getExplicitlySized: function(styles)"," {"," if(this._explicitHeight)"," {"," var host = this,"," h = host._explicitHeight,"," totalTitleSize = host._totalTitleSize,"," bottomTickOffset = host.get(\"bottomTickOffset\"),"," margin = styles.label.margin.right;"," host._maxLabelSize = h - (bottomTickOffset + margin + totalTitleSize);"," return true;"," }"," return false;"," },",""," /**"," * Rotate and position title."," *"," * @method positionTitle"," * @param {HTMLElement} label to rotate position"," * @protected"," */"," positionTitle: function(label)"," {"," var host = this,"," bounds = host._titleBounds,"," margin = host.get(\"styles\").title.margin,"," props = host._titleRotationProps,"," h = bounds.bottom - bounds.top,"," labelWidth = label.offsetWidth,"," labelHeight = label.offsetHeight,"," x = (host.get(\"width\") * 0.5) - (labelWidth * 0.5),"," y = host.get(\"height\") - labelHeight/2 - h/2;"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," if(margin && margin.bottom)"," {"," y -= margin.bottom;"," }"," props.x = x;"," props.y = y;"," props.transformOrigin = [0.5, 0.5];"," host._rotate(label, props);"," },"," "," /**"," * Rotate and position labels."," *"," * @method positionLabel"," * @param {HTMLElement} label to rotate position"," * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned"," * against."," * @protected"," */"," positionLabel: function(label, pt, styles, i)"," {"," var host = this,"," tickOffset = host.get(\"bottomTickOffset\"),"," labelStyles = styles.label,"," margin = 0,"," props = host._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," leftOffset = Math.round(pt.x),"," topOffset = Math.round(pt.y),"," labelWidth = host._labelWidths[i],"," labelHeight = host._labelHeights[i];"," if(labelStyles.margin && labelStyles.margin.top)"," {"," margin = labelStyles.margin.top;"," }"," if(rot > 0)"," {"," topOffset -= labelHeight/2 * rot/90;"," }"," else if(rot < 0)"," {"," leftOffset -= labelWidth;"," topOffset -= labelHeight/2 * absRot/90;"," }"," else"," {"," leftOffset -= labelWidth * 0.5;"," }"," topOffset += margin;"," topOffset += tickOffset;"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," props.x = leftOffset;"," props.y = topOffset;"," host._rotate(label, props);"," },"," "," /**"," * Adjusts the coordinates of an axis label based on the rotation."," *"," * @method _setRotationCoords"," * @param {Object} props Coordinates, dimension and rotation properties of the label."," * @protected"," */"," _setRotationCoords: function(props)"," {"," var rot = props.rot,"," absRot = props.absRot,"," labelWidth = props.labelWidth,"," labelHeight = props.labelHeight,"," leftOffset,"," topOffset;",""," if(rot > 0)"," {"," leftOffset = 0;"," topOffset = labelHeight/2 * rot/90;"," }"," else if(rot < 0)"," {"," leftOffset = labelWidth;"," topOffset = labelHeight/2 * absRot/90;"," }"," else"," {"," leftOffset = labelWidth * 0.5;"," topOffset = 0;"," }"," props.x -= leftOffset;"," props.y -= topOffset;"," },",""," /**"," * Returns the transformOrigin to use for an axis label based on the position of the axis "," * and the rotation of the label."," *"," * @method _getTransformOrigin"," * @param {Number} rot The rotation (in degrees) of the label."," * @return Array"," * @protected"," */"," _getTransformOrigin: function(rot)"," {"," var transformOrigin;"," if(rot > 0)"," {"," transformOrigin = [0, 0.5];"," }"," else if(rot < 0)"," {"," transformOrigin = [1, 0.5];"," }"," else"," {"," transformOrigin = [0, 0];"," }"," return transformOrigin;"," },",""," /**"," * Adjusts position for inner ticks."," *"," * @method offsetNodeForTick"," * @param {Node} cb contentBox of the axis"," * @protected"," */"," offsetNodeForTick: function(cb)"," {"," var host = this;"," host.get(\"contentBox\").setStyle(\"top\", 0 - host.get(\"topTickOffset\"));"," },",""," /**"," * Assigns a height based on the size of the contents."," *"," * @method setCalculatedSize"," * @protected"," */"," setCalculatedSize: function()"," {"," var host = this,"," styles = host.get(\"styles\"),"," labelStyle = styles.label,"," totalTitleSize = host._totalTitleSize,"," ttl = Math.round(host.get(\"bottomTickOffset\") + host._maxLabelSize + labelStyle.margin.top + totalTitleSize);"," if(host._explicitHeight)"," {"," ttl = host._explicitHeight;"," }"," host.set(\"calculatedHeight\", ttl);"," }","};","Y.BottomAxisLayout = BottomAxisLayout;","/**"," * Contains algorithms for rendering a top axis."," *"," * @module charts"," * @submodule charts-base"," * @class TopAxisLayout"," * @constructor"," */","TopAxisLayout = function(){};","","TopAxisLayout.prototype = {"," /**"," * Default margins for text fields."," *"," * @private"," * @method _getDefaultMargins"," * @return Object"," */"," _getDefaultMargins: function() "," {"," return {"," top: 0,"," left: 0,"," right: 0,"," bottom: 4"," };"," },"," "," /**"," * Sets the length of the tick on either side of the axis line."," *"," * @method setTickOffsets"," * @protected"," */"," setTickOffsets: function()"," {"," var host = this,"," majorTicks = host.get(\"styles\").majorTicks,"," tickLength = majorTicks.length,"," halfTick = tickLength * 0.5,"," display = majorTicks.display;"," host.set(\"leftTickOffset\", 0);"," host.set(\"rightTickOffset\", 0);"," switch(display)"," {"," case \"inside\" :"," host.set(\"bottomTickOffset\", tickLength);"," host.set(\"topTickOffset\", 0);"," break;"," case \"outside\" : "," host.set(\"bottomTickOffset\", 0);"," host.set(\"topTickOffset\", tickLength);"," break;"," case \"cross\" :"," host.set(\"topTickOffset\", halfTick);"," host.set(\"bottomTickOffset\", halfTick);"," break;"," default:"," host.set(\"topTickOffset\", 0);"," host.set(\"bottomTickOffset\", 0);"," break;"," }"," },",""," /**"," * Calculates the coordinates for the first point on an axis."," *"," * @method getLineStart"," * @protected"," */"," getLineStart: function()"," {"," var host = this,"," style = host.get(\"styles\"),"," padding = style.padding,"," majorTicks = style.majorTicks,"," tickLength = majorTicks.length,"," display = majorTicks.display,"," pt = {x:0, y:padding.top};"," if(display === \"outside\")"," {"," pt.y += tickLength;"," }"," else if(display === \"cross\")"," {"," pt.y += tickLength/2;"," }"," return pt; "," },"," "," /**"," * Draws a tick"," *"," * @method drawTick"," * @param {Path} path reference to the path `Path` element in which to draw the tick."," * @param {Object} pt hash containing x and y coordinates"," * @param {Object} tickStyles hash of properties used to draw the tick"," * @protected"," */"," drawTick: function(path, pt, tickStyles)"," {"," var host = this,"," style = host.get(\"styles\"),"," padding = style.padding,"," tickLength = tickStyles.length,"," start = {x:pt.x, y:padding.top},"," end = {x:pt.x, y:tickLength + padding.top};"," host.drawLine(path, start, end);"," },"," "," /**"," * Calculates the point for a label."," *"," * @method getLabelPoint"," * @param {Object} pt hash containing x and y coordinates"," * @return Object"," * @protected"," */"," getLabelPoint: function(pt)"," {"," return {x:pt.x, y:pt.y - this.get(\"topTickOffset\")};"," },"," "," /**"," * Updates the value for the `maxLabelSize` for use in calculating total size."," *"," * @method updateMaxLabelSize"," * @param {HTMLElement} label to measure"," * @protected"," */"," updateMaxLabelSize: function(labelWidth, labelHeight)"," {"," var host = this,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," sinRadians = props.sinRadians,"," cosRadians = props.cosRadians,"," max;"," if(rot === 0)"," {"," max = labelHeight;"," }"," else if(absRot === 90)"," {"," max = labelWidth;"," }"," else"," {"," max = (sinRadians * labelWidth) + (cosRadians * labelHeight); "," }"," host._maxLabelSize = Math.max(host._maxLabelSize, max);"," },",""," /**"," * Determines the available label height when the axis width has been explicitly set."," *"," * @method getExplicitlySized"," * @return Boolean"," * @protected"," */"," getExplicitlySized: function(styles)"," {"," if(this._explicitHeight)"," {"," var host = this,"," h = host._explicitHeight,"," totalTitleSize = host._totalTitleSize,"," topTickOffset = host.get(\"topTickOffset\"),"," margin = styles.label.margin.right;"," host._maxLabelSize = h - (topTickOffset + margin + totalTitleSize);"," return true;"," }"," return false;"," },",""," /**"," * Rotate and position title."," *"," * @method positionTitle"," * @param {HTMLElement} label to rotate position"," * @protected"," */"," positionTitle: function(label)"," {"," var host = this,"," bounds = host._titleBounds,"," margin = host.get(\"styles\").title.margin,"," props = host._titleRotationProps,"," labelWidth = label.offsetWidth,"," labelHeight = label.offsetHeight,"," h = bounds.bottom - bounds.top,"," x = (host.get(\"width\") * 0.5) - (labelWidth * 0.5),"," y = h/2 - labelHeight/2;"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," if(margin && margin.top)"," {"," y += margin.top;"," }"," props.x = x;"," props.y = y;"," props.transformOrigin = [0.5, 0.5];"," host._rotate(label, props);"," },",""," /**"," * Rotate and position labels."," *"," * @method positionLabel"," * @param {HTMLElement} label to rotate position"," * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned"," * against."," * @protected"," */"," positionLabel: function(label, pt, styles, i)"," {"," var host = this,"," totalTitleSize = this._totalTitleSize,"," maxLabelSize = host._maxLabelSize,"," leftOffset = pt.x,"," topOffset = pt.y + totalTitleSize + maxLabelSize,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," labelWidth = this._labelWidths[i],"," labelHeight = this._labelHeights[i];"," if(rot === 0)"," {"," leftOffset -= labelWidth * 0.5;"," topOffset -= labelHeight;"," }"," else"," {"," if(rot === 90)"," {"," leftOffset -= labelWidth;"," topOffset -= (labelHeight * 0.5);"," }"," else if (rot === -90)"," {"," topOffset -= (labelHeight * 0.5);"," } "," else if(rot > 0)"," {"," leftOffset -= labelWidth;"," topOffset -= labelHeight - (labelHeight * rot/180);"," }"," else"," {"," topOffset -= labelHeight - (labelHeight * absRot/180);"," }"," }"," props.x = Math.round(leftOffset);"," props.y = Math.round(topOffset);"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," this._rotate(label, props);"," },",""," /**"," * Adjusts the coordinates of an axis label based on the rotation."," *"," * @method _setRotationCoords"," * @param {Object} props Coordinates, dimension and rotation properties of the label."," * @protected"," */"," _setRotationCoords: function(props)"," {"," var rot = props.rot,"," absRot = props.absRot,"," labelWidth = props.labelWidth,"," labelHeight = props.labelHeight,"," leftOffset,"," topOffset;"," if(rot === 0)"," {"," leftOffset = labelWidth * 0.5;"," topOffset = labelHeight;"," }"," else"," {"," if(rot === 90)"," {"," leftOffset = labelWidth;"," topOffset = (labelHeight * 0.5);"," }"," else if (rot === -90)"," {"," topOffset = (labelHeight * 0.5);"," } "," else if(rot > 0)"," {"," leftOffset = labelWidth;"," topOffset = labelHeight - (labelHeight * rot/180);"," }"," else"," {"," topOffset = labelHeight - (labelHeight * absRot/180);"," }"," }"," props.x -= leftOffset;"," props.y -= topOffset;"," },",""," /**"," * Returns the transformOrigin to use for an axis label based on the position of the axis "," * and the rotation of the label."," *"," * @method _getTransformOrigin"," * @param {Number} rot The rotation (in degrees) of the label."," * @return Array"," * @protected"," */"," _getTransformOrigin: function(rot)"," {"," var transformOrigin;"," if(rot === 0)"," {"," transformOrigin = [0, 0];"," }"," else"," {"," if(rot === 90)"," {"," transformOrigin = [1, 0.5];"," }"," else if (rot === -90)"," {"," transformOrigin = [0, 0.5];"," } "," else if(rot > 0)"," {"," transformOrigin = [1, 0.5];"," }"," else"," {"," transformOrigin = [0, 0.5];"," }"," }"," return transformOrigin;"," },",""," /**"," * Adjusts position for inner ticks."," *"," * @method offsetNodeForTick"," * @param {Node} cb contentBox of the axis"," * @protected"," */"," offsetNodeForTick: function(cb)"," {"," },",""," /**"," * Assigns a height based on the size of the contents."," *"," * @method setCalculatedSize"," * @protected"," */"," setCalculatedSize: function()"," {"," var host = this,"," graphic = host.get(\"graphic\"),"," styles = host.get(\"styles\"),"," labelMargin = styles.label.margin,"," totalLabelSize = labelMargin.bottom + host._maxLabelSize,"," totalTitleSize = host._totalTitleSize,"," topTickOffset = this.get(\"topTickOffset\"),"," ttl = Math.round(topTickOffset + totalLabelSize + totalTitleSize);"," if(this._explicitHeight)"," {"," ttl = this._explicitWidth; "," }"," host.set(\"calculatedHeight\", ttl);"," graphic.set(\"y\", ttl - topTickOffset);"," }","};","Y.TopAxisLayout = TopAxisLayout;","","/**"," * The Axis class. Generates axes for a chart."," *"," * @module charts"," * @submodule charts-base"," * @class Axis"," * @extends Widget"," * @uses Renderer"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Chart."," */","Y.Axis = Y.Base.create(\"axis\", Y.Widget, [Y.Renderer], {"," /**"," * Storage for calculatedWidth value."," *"," * @property _calculatedWidth"," * @type Number"," * @private"," */"," _calculatedWidth: 0,",""," /**"," * Storage for calculatedHeight value."," *"," * @property _calculatedHeight"," * @type Number"," * @private"," */"," _calculatedHeight: 0,",""," /**"," * Handles change to the dataProvider"," * "," * @method _dataChangeHandler"," * @param {Object} e Event object"," * @private"," */"," _dataChangeHandler: function(e)"," {"," if(this.get(\"rendered\"))"," {"," this._drawAxis();"," }"," },",""," /**"," * Handles change to the position attribute"," *"," * @method _positionChangeHandler"," * @param {Object} e Event object"," * @private"," */"," _positionChangeHandler: function(e)"," {"," this._updateGraphic(e.newVal);"," this._updateHandler();"," },",""," /**"," * Updates the the Graphic instance"," *"," * @method _updateGraphic"," * @param {String} position Position of axis "," * @private"," */"," _updateGraphic: function(position)"," {"," var graphic = this.get(\"graphic\");"," if(position == \"none\")"," {"," if(graphic)"," {"," graphic.destroy();"," }"," }"," else"," {"," if(!graphic)"," {"," this._setCanvas();"," }"," }"," },",""," /**"," * Handles changes to axis."," *"," * @method _updateHandler"," * @param {Object} e Event object"," * @private"," */"," _updateHandler: function(e)"," {"," if(this.get(\"rendered\"))"," {"," this._drawAxis();"," }"," },"," "," /**"," * @method renderUI"," * @private"," */"," renderUI: function()"," {"," this._updateGraphic(this.get(\"position\"));"," },",""," /**"," * @method syncUI"," * @private"," */"," syncUI: function()"," {"," var layout = this._layout,"," defaultMargins,"," styles,"," label,"," title,"," i;"," if(layout)"," {"," defaultMargins = layout._getDefaultMargins();"," styles = this.get(\"styles\");"," label = styles.label.margin;"," title =styles.title.margin;"," //need to defaultMargins method to the layout classes."," for(i in defaultMargins)"," {"," if(defaultMargins.hasOwnProperty(i))"," {"," label[i] = label[i] === undefined ? defaultMargins[i] : label[i];"," title[i] = title[i] === undefined ? defaultMargins[i] : title[i];"," }"," }"," }"," this._drawAxis();"," },",""," /**"," * Creates a graphic instance to be used for the axis line and ticks."," *"," * @method _setCanvas"," * @private"," */"," _setCanvas: function()"," {"," var cb = this.get(\"contentBox\"),"," bb = this.get(\"boundingBox\"),"," p = this.get(\"position\"),"," pn = this._parentNode,"," w = this.get(\"width\"),"," h = this.get(\"height\");"," bb.setStyle(\"position\", \"absolute\");"," bb.setStyle(\"zIndex\", 2);"," w = w ? w + \"px\" : pn.getStyle(\"width\");"," h = h ? h + \"px\" : pn.getStyle(\"height\");"," if(p === \"top\" || p === \"bottom\")"," {"," cb.setStyle(\"width\", w);"," }"," else"," {"," cb.setStyle(\"height\", h);"," }"," cb.setStyle(\"position\", \"relative\");"," cb.setStyle(\"left\", \"0px\");"," cb.setStyle(\"top\", \"0px\");"," this.set(\"graphic\", new Y.Graphic());"," this.get(\"graphic\").render(cb);"," },"," "," /**"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," * @protected"," */"," _getDefaultStyles: function()"," {"," var axisstyles = {"," majorTicks: {"," display:\"inside\","," length:4,"," color:\"#dad8c9\","," weight:1,"," alpha:1"," },"," minorTicks: {"," display:\"none\","," length:2,"," color:\"#dad8c9\","," weight:1"," },"," line: {"," weight:1,"," color:\"#dad8c9\","," alpha:1"," },"," majorUnit: {"," determinant:\"count\","," count:11,"," distance:75"," },"," top: \"0px\","," left: \"0px\","," width: \"100px\","," height: \"100px\","," label: {"," color:\"#808080\","," alpha: 1,"," fontSize:\"85%\","," rotation: 0,"," margin: {"," top: undefined,"," right: undefined,"," bottom: undefined,"," left: undefined"," }"," },"," title: {"," color:\"#808080\","," alpha: 1,"," fontSize:\"85%\","," rotation: undefined,"," margin: {"," top: undefined,"," right: undefined,"," bottom: undefined,"," left: undefined"," }"," },"," hideOverlappingLabelTicks: false"," };"," "," return Y.merge(Y.Renderer.prototype._getDefaultStyles(), axisstyles); "," },",""," /**"," * Updates the axis when the size changes."," *"," * @method _handleSizeChange"," * @param {Object} e Event object."," * @private"," */"," _handleSizeChange: function(e)"," {"," var attrName = e.attrName,"," pos = this.get(\"position\"),"," vert = pos == \"left\" || pos == \"right\","," cb = this.get(\"contentBox\"),"," hor = pos == \"bottom\" || pos == \"top\";"," cb.setStyle(\"width\", this.get(\"width\"));"," cb.setStyle(\"height\", this.get(\"height\"));"," if((hor && attrName == \"width\") || (vert && attrName == \"height\"))"," {"," this._drawAxis();"," }"," },"," "," /**"," * Maps key values to classes containing layout algorithms"," *"," * @property _layoutClasses"," * @type Object"," * @private"," */"," _layoutClasses: "," {"," top : TopAxisLayout,"," bottom: BottomAxisLayout,"," left: LeftAxisLayout,"," right : RightAxisLayout"," },"," "," /**"," * Draws a line segment between 2 points"," *"," * @method drawLine"," * @param {Object} startPoint x and y coordinates for the start point of the line segment"," * @param {Object} endPoint x and y coordinates for the for the end point of the line segment"," * @param {Object} line styles (weight, color and alpha to be applied to the line segment)"," * @private"," */"," drawLine: function(path, startPoint, endPoint)"," {"," path.moveTo(startPoint.x, startPoint.y);"," path.lineTo(endPoint.x, endPoint.y);"," },",""," /**"," * Generates the properties necessary for rotating and positioning a text field."," *"," * @method _getTextRotationProps"," * @param {Object} styles properties for the text field"," * @return Object"," * @private"," */"," _getTextRotationProps: function(styles)"," {"," if(styles.rotation === undefined)"," {"," switch(this.get(\"position\"))"," {"," case \"left\" :"," styles.rotation = -90;"," break; "," case \"right\" : "," styles.rotation = 90;"," break;"," default :"," styles.rotation = 0;"," break;"," }"," }"," var rot = Math.min(90, Math.max(-90, styles.rotation)),"," absRot = Math.abs(rot),"," radCon = Math.PI/180,"," sinRadians = parseFloat(parseFloat(Math.sin(absRot * radCon)).toFixed(8)),"," cosRadians = parseFloat(parseFloat(Math.cos(absRot * radCon)).toFixed(8));"," return {"," rot: rot,"," absRot: absRot,"," radCon: radCon,"," sinRadians: sinRadians,"," cosRadians: cosRadians,"," textAlpha: styles.alpha"," };"," },",""," /**"," * Draws an axis. "," *"," * @method _drawAxis"," * @private"," */"," _drawAxis: function ()"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," if(this._layout)"," {"," var styles = this.get(\"styles\"),"," line = styles.line,"," labelStyles = styles.label,"," majorTickStyles = styles.majorTicks,"," drawTicks = majorTickStyles.display != \"none\","," tickPoint,"," majorUnit = styles.majorUnit,"," len,"," majorUnitDistance,"," i = 0,"," layout = this._layout,"," layoutLength,"," position,"," lineStart,"," label,"," labelWidth,"," labelHeight,"," labelFunction = this.get(\"labelFunction\"),"," labelFunctionScope = this.get(\"labelFunctionScope\"),"," labelFormat = this.get(\"labelFormat\"),"," graphic = this.get(\"graphic\"),"," path = this.get(\"path\"),"," tickPath,"," explicitlySized;"," this._labelWidths = [];"," this._labelHeights = [];"," graphic.set(\"autoDraw\", false);"," path.clear();"," path.set(\"stroke\", {"," weight: line.weight, "," color: line.color, "," opacity: line.alpha"," });"," this._labelRotationProps = this._getTextRotationProps(labelStyles);"," this._labelRotationProps.transformOrigin = layout._getTransformOrigin(this._labelRotationProps.rot);"," layout.setTickOffsets.apply(this);"," layoutLength = this.getLength();"," lineStart = layout.getLineStart.apply(this);"," len = this.getTotalMajorUnits(majorUnit);"," majorUnitDistance = this.getMajorUnitDistance(len, layoutLength, majorUnit);"," this.set(\"edgeOffset\", this.getEdgeOffset(len, layoutLength) * 0.5);"," if(len < 1)"," {"," this._clearLabelCache();"," }"," else"," {"," tickPoint = this.getFirstPoint(lineStart);"," this.drawLine(path, lineStart, this.getLineEnd(tickPoint));"," if(drawTicks) "," {"," tickPath = this.get(\"tickPath\");"," tickPath.clear();"," tickPath.set(\"stroke\", {"," weight: majorTickStyles.weight,"," color: majorTickStyles.color,"," opacity: majorTickStyles.alpha"," });"," layout.drawTick.apply(this, [tickPath, tickPoint, majorTickStyles]);"," }"," this._createLabelCache();"," this._tickPoints = [];"," this._maxLabelSize = 0; "," this._totalTitleSize = 0;"," this._titleSize = 0;"," this._setTitle();"," explicitlySized = layout.getExplicitlySized.apply(this, [styles]);"," for(; i < len; ++i)"," {"," if(drawTicks) "," {"," layout.drawTick.apply(this, [tickPath, tickPoint, majorTickStyles]);"," }"," position = this.getPosition(tickPoint);"," label = this.getLabel(tickPoint, labelStyles);"," this._labels.push(label);"," this._tickPoints.push({x:tickPoint.x, y:tickPoint.y});"," this.get(\"appendLabelFunction\")(label, labelFunction.apply(labelFunctionScope, [this.getLabelByIndex(i, len), labelFormat]));"," labelWidth = Math.round(label.offsetWidth);"," labelHeight = Math.round(label.offsetHeight);"," if(!explicitlySized)"," {"," this._layout.updateMaxLabelSize.apply(this, [labelWidth, labelHeight]);"," }"," this._labelWidths.push(labelWidth);"," this._labelHeights.push(labelHeight);"," tickPoint = this.getNextPoint(tickPoint, majorUnitDistance);"," }"," this._clearLabelCache();"," if(this.get(\"overlapGraph\"))"," {"," layout.offsetNodeForTick.apply(this, [this.get(\"contentBox\")]);"," }"," layout.setCalculatedSize.apply(this);"," if(this._titleTextField)"," {"," this._layout.positionTitle.apply(this, [this._titleTextField]);"," }"," for(i = 0; i < len; ++i)"," {"," layout.positionLabel.apply(this, [this.get(\"labels\")[i], this._tickPoints[i], styles, i]);"," }"," }"," }"," this._drawing = false;"," if(this._callLater)"," {"," this._drawAxis();"," }"," else"," {"," this._updatePathElement();"," this.fire(\"axisRendered\");"," }"," },"," "," /**"," * Calculates and sets the total size of a title."," *"," * @method _setTotalTitleSize"," * @param {Object} styles Properties for the title field."," * @private"," */"," _setTotalTitleSize: function(styles)"," {"," var title = this._titleTextField,"," w = title.offsetWidth,"," h = title.offsetHeight,"," rot = this._titleRotationProps.rot,"," bounds,"," size,"," margin = styles.margin,"," position = this.get(\"position\"),"," matrix = new Y.Matrix();"," matrix.rotate(rot);"," bounds = matrix.getContentRect(w, h);"," if(position == \"left\" || position == \"right\")"," {"," size = bounds.right - bounds.left;"," if(margin)"," {"," size += margin.left + margin.right;"," }"," }"," else"," {"," size = bounds.bottom - bounds.top;"," if(margin)"," {"," size += margin.top + margin.bottom;"," }"," }"," this._titleBounds = bounds;"," this._totalTitleSize = size;"," },",""," /**"," * Updates path."," *"," * @method _updatePathElement"," * @private"," */"," _updatePathElement: function()"," {"," var path = this._path,"," tickPath = this._tickPath,"," redrawGraphic = false,"," graphic = this.get(\"graphic\");"," if(path)"," {"," redrawGraphic = true;"," path.end();"," }"," if(tickPath)"," {"," redrawGraphic = true;"," tickPath.end();"," }"," if(redrawGraphic)"," {"," graphic._redraw();"," }"," },",""," /**"," * Updates the content and style properties for a title field."," *"," * @method _updateTitle"," * @private"," */"," _setTitle: function()"," {"," var i,"," styles,"," customStyles,"," title = this.get(\"title\"),"," titleTextField = this._titleTextField,"," parentNode;"," if(title !== null && title !== undefined)"," {"," customStyles = {"," rotation: \"rotation\","," margin: \"margin\","," alpha: \"alpha\""," };"," styles = this.get(\"styles\").title;"," if(!titleTextField)"," {"," titleTextField = DOCUMENT.createElement('span');"," titleTextField.style.display = \"block\";"," titleTextField.style.whiteSpace = \"nowrap\";"," titleTextField.setAttribute(\"class\", \"axisTitle\");"," this.get(\"contentBox\").append(titleTextField);"," }"," else if(!DOCUMENT.createElementNS)"," {"," if(titleTextField.style.filter)"," {"," titleTextField.style.filter = null;"," }"," }"," titleTextField.style.position = \"absolute\";"," for(i in styles)"," {"," if(styles.hasOwnProperty(i) && !customStyles.hasOwnProperty(i))"," {"," titleTextField.style[i] = styles[i];"," }"," }"," this.get(\"appendTitleFunction\")(titleTextField, title);"," this._titleTextField = titleTextField;"," this._titleRotationProps = this._getTextRotationProps(styles);"," this._setTotalTitleSize(styles);"," }"," else if(titleTextField)"," {"," parentNode = titleTextField.parentNode;"," if(parentNode)"," {"," parentNode.removeChild(titleTextField);"," }"," this._titleTextField = null;"," this._totalTitleSize = 0;"," }"," },",""," /**"," * Creates or updates an axis label."," *"," * @method getLabel"," * @param {Object} pt x and y coordinates for the label"," * @param {Object} styles styles applied to label"," * @return HTMLElement "," * @private"," */"," getLabel: function(pt, styles)"," {"," var i,"," label,"," labelCache = this._labelCache,"," customStyles = {"," rotation: \"rotation\","," margin: \"margin\","," alpha: \"alpha\""," };"," if(labelCache && labelCache.length > 0)"," {"," label = labelCache.shift();"," }"," else"," {"," label = DOCUMENT.createElement(\"span\");"," label.className = Y.Lang.trim([label.className, \"axisLabel\"].join(' '));"," this.get(\"contentBox\").append(label);"," }"," if(!DOCUMENT.createElementNS)"," {"," if(label.style.filter)"," {"," label.style.filter = null;"," }"," }"," label.style.display = \"block\";"," label.style.whiteSpace = \"nowrap\";"," label.style.position = \"absolute\";"," for(i in styles)"," {"," if(styles.hasOwnProperty(i) && !customStyles.hasOwnProperty(i))"," {"," label.style[i] = styles[i];"," }"," }"," return label;"," },",""," /**"," * Creates a cache of labels that can be re-used when the axis redraws."," *"," * @method _createLabelCache"," * @private"," */"," _createLabelCache: function()"," {"," if(this._labels)"," {"," while(this._labels.length > 0)"," {"," this._labelCache.push(this._labels.shift());"," }"," }"," else"," {"," this._clearLabelCache();"," }"," this._labels = [];"," },"," "," /**"," * Removes axis labels from the dom and clears the label cache."," *"," * @method _clearLabelCache"," * @private"," */"," _clearLabelCache: function()"," {"," if(this._labelCache)"," {"," var len = this._labelCache.length,"," i = 0,"," label;"," for(; i < len; ++i)"," {"," label = this._labelCache[i];"," this._removeChildren(label);"," Y.Event.purgeElement(label, true);"," label.parentNode.removeChild(label);"," }"," }"," this._labelCache = [];"," },",""," /**"," * Gets the end point of an axis."," *"," * @method getLineEnd"," * @return Object"," * @private "," */"," getLineEnd: function(pt)"," {"," var w = this.get(\"width\"),"," h = this.get(\"height\"),"," pos = this.get(\"position\");"," if(pos === \"top\" || pos === \"bottom\")"," {"," return {x:w, y:pt.y};"," }"," else"," {"," return {x:pt.x, y:h};"," }"," },",""," /**"," * Calcuates the width or height of an axis depending on its direction."," *"," * @method getLength"," * @return Number"," * @private"," */"," getLength: function()"," {"," var l,"," style = this.get(\"styles\"),"," padding = style.padding,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," pos = this.get(\"position\");"," if(pos === \"top\" || pos === \"bottom\")"," {"," l = w - (padding.left + padding.right);"," }"," else"," {"," l = h - (padding.top + padding.bottom);"," }"," return l;"," },",""," /**"," * Gets the position of the first point on an axis."," *"," * @method getFirstPoint"," * @param {Object} pt Object containing x and y coordinates."," * @return Object"," * @private"," */"," getFirstPoint:function(pt)"," {"," var style = this.get(\"styles\"),"," pos = this.get(\"position\"),"," padding = style.padding,"," np = {x:pt.x, y:pt.y};"," if(pos === \"top\" || pos === \"bottom\")"," {"," np.x += padding.left + this.get(\"edgeOffset\");"," }"," else"," {"," np.y += this.get(\"height\") - (padding.top + this.get(\"edgeOffset\"));"," }"," return np;"," },",""," /**"," * Gets the position of the next point on an axis."," *"," * @method getNextPoint"," * @param {Object} point Object containing x and y coordinates."," * @param {Number} majorUnitDistance Distance in pixels between ticks."," * @return Object"," * @private"," */"," getNextPoint: function(point, majorUnitDistance)"," {"," var pos = this.get(\"position\");"," if(pos === \"top\" || pos === \"bottom\")"," {"," point.x = point.x + majorUnitDistance; "," }"," else"," {"," point.y = point.y - majorUnitDistance;"," }"," return point;"," },",""," /**"," * Calculates the placement of last tick on an axis."," *"," * @method getLastPoint"," * @return Object"," * @private "," */"," getLastPoint: function()"," {"," var style = this.get(\"styles\"),"," padding = style.padding,"," w = this.get(\"width\"),"," pos = this.get(\"position\");"," if(pos === \"top\" || pos === \"bottom\")"," {"," return {x:w - padding.right, y:padding.top};"," }"," else"," {"," return {x:padding.left, y:padding.top};"," }"," },",""," /**"," * Calculates position on the axis."," *"," * @method getPosition"," * @param {Object} point contains x and y values"," * @private "," */"," getPosition: function(point)"," {"," var p,"," h = this.get(\"height\"),"," style = this.get(\"styles\"),"," padding = style.padding,"," pos = this.get(\"position\"),"," dataType = this.get(\"dataType\");"," if(pos === \"left\" || pos === \"right\") "," {"," //Numeric data on a vertical axis is displayed from bottom to top."," //Categorical and Timeline data is displayed from top to bottom."," if(dataType === \"numeric\")"," {"," p = (h - (padding.top + padding.bottom)) - (point.y - padding.top);"," }"," else"," {"," p = point.y - padding.top;"," }"," }"," else"," {"," p = point.x - padding.left;"," }"," return p;"," },",""," /**"," * Rotates and positions a text field."," *"," * @method _rotate"," * @param {HTMLElement} label text field to rotate and position"," * @param {Object} props properties to be applied to the text field. "," * @private"," */"," _rotate: function(label, props)"," {"," var rot = props.rot,"," x = props.x,"," y = props.y,"," filterString,"," textAlpha,"," matrix = new Y.Matrix(),"," transformOrigin = props.transformOrigin || [0, 0],"," offsetRect;"," if(DOCUMENT.createElementNS)"," {"," matrix.translate(x, y);"," matrix.rotate(rot);"," Y_DOM.setStyle(label, \"transformOrigin\", (transformOrigin[0] * 100) + \"% \" + (transformOrigin[1] * 100) + \"%\");"," Y_DOM.setStyle(label, \"transform\", matrix.toCSSText());"," }"," else"," {"," textAlpha = props.textAlpha;"," if(Y_Lang.isNumber(textAlpha) && textAlpha < 1 && textAlpha > -1 && !isNaN(textAlpha))"," {"," filterString = \"progid:DXImageTransform.Microsoft.Alpha(Opacity=\" + Math.round(textAlpha * 100) + \")\";"," }"," if(rot !== 0)"," {"," //ms filters kind of, sort of uses a transformOrigin of 0, 0. "," //we'll translate the difference to create a true 0, 0 origin."," matrix.rotate(rot);"," offsetRect = matrix.getContentRect(props.labelWidth, props.labelHeight);"," matrix.init();"," matrix.translate(offsetRect.left, offsetRect.top);"," matrix.translate(x, y);"," this._simulateRotateWithTransformOrigin(matrix, rot, transformOrigin, props.labelWidth, props.labelHeight);"," if(filterString)"," {"," filterString += \" \";"," }"," else"," {"," filterString = \"\"; "," }"," filterString += matrix.toFilterText();"," label.style.left = matrix.dx + \"px\";"," label.style.top = matrix.dy + \"px\";"," }"," else"," {"," label.style.left = x + \"px\";"," label.style.top = y + \"px\";"," }"," if(filterString)"," {"," label.style.filter = filterString;"," }"," }"," },"," "," /**"," * Simulates a rotation with a specified transformOrigin. "," *"," * @method _simulateTransformOrigin"," * @param {Matrix} matrix Reference to a `Matrix` instance."," * @param {Number} rot The rotation (in degrees) that will be performed on a matrix."," * @param {Array} transformOrigin An array represeniting the origin in which to perform the transform. The first "," * index represents the x origin and the second index represents the y origin."," * @param {Number} w The width of the object that will be transformed."," * @param {Number} h The height of the object that will be transformed."," * @private"," */"," _simulateRotateWithTransformOrigin: function(matrix, rot, transformOrigin, w, h)"," {"," var transformX = transformOrigin[0] * w,"," transformY = transformOrigin[1] * h;"," transformX = !isNaN(transformX) ? transformX : 0;"," transformY = !isNaN(transformY) ? transformY : 0;"," matrix.translate(transformX, transformY);"," matrix.rotate(rot);"," matrix.translate(-transformX, -transformY);"," },",""," /**"," * Returns the coordinates (top, right, bottom, left) for the bounding box of the last label. "," *"," * @method getMaxLabelBounds"," * @return Object"," */"," getMaxLabelBounds: function()"," {"," return this._getLabelBounds(this.getMaximumValue());"," },",""," /**"," * Returns the coordinates (top, right, bottom, left) for the bounding box of the first label. "," *"," * @method getMinLabelBounds"," * @return Object"," */"," getMinLabelBounds: function()"," {"," return this._getLabelBounds(this.getMinimumValue());"," },"," "," /**"," * Returns the coordinates (top, right, bottom, left) for the bounding box of a label. "," *"," * @method _getLabelBounds"," * @param {String} Value of the label"," * @return Object"," * @private"," */"," _getLabelBounds: function(val)"," {"," var layout = this._layout,"," labelStyles = this.get(\"styles\").label,"," matrix = new Y.Matrix(),"," label,"," props = this._getTextRotationProps(labelStyles);"," props.transformOrigin = layout._getTransformOrigin(props.rot);"," label = this.getLabel({x: 0, y: 0}, labelStyles);"," this.get(\"appendLabelFunction\")(label, this.get(\"labelFunction\").apply(this, [val, this.get(\"labelFormat\")]));"," props.labelWidth = label.offsetWidth;"," props.labelHeight = label.offsetHeight;"," this._removeChildren(label);"," Y.Event.purgeElement(label, true);"," label.parentNode.removeChild(label);"," props.x = 0;"," props.y = 0;"," layout._setRotationCoords(props);"," matrix.translate(props.x, props.y);"," this._simulateRotateWithTransformOrigin(matrix, props.rot, props.transformOrigin, props.labelWidth, props.labelHeight);"," return matrix.getContentRect(props.labelWidth, props.labelHeight);"," },",""," /**"," * Removes all DOM elements from an HTML element. Used to clear out labels during detruction"," * phase."," *"," * @method _removeChildren"," * @private"," */"," _removeChildren: function(node)"," {"," if(node.hasChildNodes())"," {"," var child;"," while(node.firstChild)"," {"," child = node.firstChild;"," this._removeChildren(child);"," node.removeChild(child);"," }"," }"," },"," "," /**"," * Destructor implementation Axis class. Removes all labels and the Graphic instance from the widget."," *"," * @method destructor"," * @protected"," */"," destructor: function()"," {"," var cb = this.get(\"contentBox\").getDOMNode(),"," labels = this.get(\"labels\"),"," graphic = this.get(\"graphic\"),"," label,"," len = labels ? labels.length : 0;"," if(len > 0)"," {"," while(labels.length > 0)"," {"," label = labels.shift();"," this._removeChildren(label);"," cb.removeChild(label);"," label = null;"," }"," }"," if(graphic)"," {"," graphic.destroy();"," }"," },",""," /**"," * Length in pixels of largest text bounding box. Used to calculate the height of the axis."," *"," * @property maxLabelSize"," * @type Number"," * @protected"," */"," _maxLabelSize: 0,"," "," /**"," * Updates the content of text field. This method writes a value into a text field using "," * `appendChild`. If the value is a `String`, it is converted to a `TextNode` first. "," *"," * @method _setText"," * @param label {HTMLElement} label to be updated"," * @param val {String} value with which to update the label"," * @private"," */"," _setText: function(textField, val)"," { "," textField.innerHTML = \"\";"," if(Y_Lang.isNumber(val))"," {"," val = val + \"\";"," }"," else if(!val)"," {"," val = \"\";"," }"," if(IS_STRING(val))"," {"," val = DOCUMENT.createTextNode(val);"," }"," textField.appendChild(val);"," }","}, {"," ATTRS: "," {"," /**"," * When set, defines the width of a vertical axis instance. By default, vertical axes automatically size based on their contents. When the"," * width attribute is set, the axis will not calculate its width. When the width attribute is explicitly set, axis labels will postion themselves off of the "," * the inner edge of the axis and the title, if present, will position itself off of the outer edge. If a specified width is less than the sum of "," * the axis' contents, excess content will overflow."," *"," * @attribute width"," * @type Number"," */"," width: {"," lazyAdd: false,",""," getter: function() "," {"," if(this._explicitWidth)"," {"," return this._explicitWidth; "," }"," return this._calculatedWidth;"," },",""," setter: function(val)"," {"," this._explicitWidth = val;"," return val;"," }"," },",""," /**"," * When set, defines the height of a horizontal axis instance. By default, horizontal axes automatically size based on their contents. When the"," * height attribute is set, the axis will not calculate its height. When the height attribute is explicitly set, axis labels will postion themselves off of the "," * the inner edge of the axis and the title, if present, will position itself off of the outer edge. If a specified height is less than the sum of "," * the axis' contents, excess content will overflow."," *"," * @attribute height"," * @type Number"," */"," height: {"," lazyAdd: false,",""," getter: function() "," {"," if(this._explicitHeight)"," {"," return this._explicitHeight; "," }"," return this._calculatedHeight;"," },",""," setter: function(val)"," {"," this._explicitHeight = val;"," return val;"," }"," },",""," /**"," * Calculated value of an axis' width. By default, the value is used internally for vertical axes. If the `width` attribute is explicitly set, this value will be ignored."," *"," * @attribute calculatedWidth"," * @type Number"," * @private"," */"," calculatedWidth: {"," getter: function()"," {"," return this._calculatedWidth;"," },",""," setter: function(val)"," {"," this._calculatedWidth = val;"," return val;"," }"," },",""," /**"," * Calculated value of an axis' height. By default, the value is used internally for horizontal axes. If the `height` attribute is explicitly set, this value will be ignored."," *"," * @attribute calculatedHeight"," * @type Number"," * @private"," */"," calculatedHeight: {"," getter: function()"," {"," return this._calculatedHeight;"," },",""," setter: function(val)"," {"," this._calculatedHeight = val;"," return val;"," }"," },",""," /**"," * Difference betweend the first/last tick and edge of axis."," *"," * @attribute edgeOffset"," * @type Number"," * @protected"," */"," edgeOffset: "," {"," value: 0"," },",""," /**"," * The graphic in which the axis line and ticks will be rendered."," *"," * @attribute graphic"," * @type Graphic"," */"," graphic: {},"," "," /**"," * @attribute path"," * @type Shape"," * @readOnly"," * @private"," */"," path: {"," readOnly: true,",""," getter: function()"," {"," if(!this._path)"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," this._path = graphic.addShape({type:\"path\"});"," }"," }"," return this._path;"," }"," },",""," /**"," * @attribute tickPath"," * @type Shape"," * @readOnly"," * @private"," */"," tickPath: {"," readOnly: true,",""," getter: function()"," {"," if(!this._tickPath)"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," this._tickPath = graphic.addShape({type:\"path\"});"," }"," }"," return this._tickPath;"," }"," },"," "," /**"," * Contains the contents of the axis. "," *"," * @attribute node"," * @type HTMLElement"," */"," node: {},",""," /**"," * Direction of the axis."," *"," * @attribute position"," * @type String"," */"," position: {"," setter: function(val)"," {"," var layoutClass = this._layoutClasses[val];"," if(val && val != \"none\")"," {"," this._layout = new layoutClass();"," }"," return val;"," }"," },",""," /**"," * Distance determined by the tick styles used to calculate the distance between the axis"," * line in relation to the top of the axis."," *"," * @attribute topTickOffset"," * @type Number"," */"," topTickOffset: {"," value: 0"," },",""," /**"," * Distance determined by the tick styles used to calculate the distance between the axis"," * line in relation to the bottom of the axis."," *"," * @attribute bottomTickOffset"," * @type Number"," */"," bottomTickOffset: {"," value: 0"," },",""," /**"," * Distance determined by the tick styles used to calculate the distance between the axis"," * line in relation to the left of the axis."," *"," * @attribute leftTickOffset"," * @type Number"," */"," leftTickOffset: {"," value: 0"," },",""," /**"," * Distance determined by the tick styles used to calculate the distance between the axis"," * line in relation to the right side of the axis."," *"," * @attribute rightTickOffset"," * @type Number"," */"," rightTickOffset: {"," value: 0"," },"," "," /**"," * Collection of labels used to render the axis."," *"," * @attribute labels"," * @type Array"," */"," labels: {"," readOnly: true,"," getter: function()"," {"," return this._labels;"," }"," },",""," /**"," * Collection of points used for placement of labels and ticks along the axis."," *"," * @attribute tickPoints"," * @type Array"," */"," tickPoints: {"," readOnly: true,",""," getter: function()"," {"," if(this.get(\"position\") == \"none\")"," {"," return this.get(\"styles\").majorUnit.count;"," }"," return this._tickPoints;"," }"," },",""," /**"," * Indicates whether the axis overlaps the graph. If an axis is the inner most axis on a given"," * position and the tick position is inside or cross, the axis will need to overlap the graph."," *"," * @attribute overlapGraph"," * @type Boolean"," */"," overlapGraph: {"," value:true,",""," validator: function(val)"," {"," return Y_Lang.isBoolean(val);"," }"," },",""," /**"," * Object which should have by the labelFunction"," *"," * @attribute labelFunctionScope"," * @type Object"," */"," labelFunctionScope: {},"," "," /**"," * Length in pixels of largest text bounding box. Used to calculate the height of the axis."," *"," * @attribute maxLabelSize"," * @type Number"," * @protected"," */"," maxLabelSize: {"," getter: function()"," {"," return this._maxLabelSize;"," },",""," setter: function(val)"," {"," this._maxLabelSize = val;"," return val; "," }"," },"," "," /**"," * Title for the axis. When specified, the title will display. The position of the title is determined by the axis position. "," * <dl>"," * <dt>top</dt><dd>Appears above the axis and it labels. The default rotation is 0.</dd>"," * <dt>right</dt><dd>Appears to the right of the axis and its labels. The default rotation is 90.</dd>"," * <dt>bottom</dt><dd>Appears below the axis and its labels. The default rotation is 0.</dd>"," * <dt>left</dt><dd>Appears to the left of the axis and its labels. The default rotation is -90.</dd>"," * </dl>"," *"," * @attribute title"," * @type String"," */"," title: {"," value: null"," },"," "," /**"," * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need"," * to implement the arguments below and return a `String` or `HTMLElement`. "," * <dl>"," * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>"," * <dt>format</dt><dd>Template for formatting label. (optional)</dd>"," * </dl>"," *"," * @attribute labelFunction"," * @type Function"," */"," labelFunction: {"," value: function(val, format)"," {"," return val;"," }"," },"," "," /**"," * Function used to append an axis value to an axis label. This function has the following signature:"," * <dl>"," * <dt>textField</dt><dd>The axis label to be appended. (`HTMLElement`)</dd>"," * <dt>val</dt><dd>The value to attach to the text field. This method will accept an `HTMLELement`"," * or a `String`. This method does not use (`HTMLElement` | `String`)</dd>"," * </dl>"," * The default method appends a value to the `HTMLElement` using the `appendChild` method. If the given "," * value is a `String`, the method will convert the the value to a `textNode` before appending to the "," * `HTMLElement`. This method will not convert an `HTMLString` to an `HTMLElement`. "," *"," * @attribute appendLabelFunction"," * @type Function"," */"," appendLabelFunction: {"," valueFn: function()"," {"," return this._setText;"," }"," },"," "," /**"," * Function used to append a title value to the title object. This function has the following signature:"," * <dl>"," * <dt>textField</dt><dd>The title text field to be appended. (`HTMLElement`)</dd>"," * <dt>val</dt><dd>The value to attach to the text field. This method will accept an `HTMLELement`"," * or a `String`. This method does not use (`HTMLElement` | `String`)</dd>"," * </dl>"," * The default method appends a value to the `HTMLElement` using the `appendChild` method. If the given "," * value is a `String`, the method will convert the the value to a `textNode` before appending to the "," * `HTMLElement` element. This method will not convert an `HTMLString` to an `HTMLElement`. "," *"," * @attribute appendTitleFunction"," * @type Function"," */"," appendTitleFunction: {"," valueFn: function()"," {"," return this._setText;"," }"," }"," "," /**"," * Style properties used for drawing an axis. This attribute is inherited from `Renderer`. Below are the default values:"," * <dl>"," * <dt>majorTicks</dt><dd>Properties used for drawing ticks."," * <dl>"," * <dt>display</dt><dd>Position of the tick. Possible values are `inside`, `outside`, `cross` and `none`. The"," * default value is `inside`.</dd>"," * <dt>length</dt><dd>The length (in pixels) of the tick. The default value is 4.</dd>"," * <dt>color</dt><dd>The color of the tick. The default value is `#dad8c9`</dd>"," * <dt>weight</dt><dd>Number indicating the width of the tick. The default value is 1.</dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the tick. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>line</dt><dd>Properties used for drawing the axis line. "," * <dl>"," * <dt>weight</dt><dd>Number indicating the width of the axis line. The default value is 1.</dd>"," * <dt>color</dt><dd>The color of the axis line. The default value is `#dad8c9`.</dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the tick. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>majorUnit</dt><dd>Properties used to calculate the `majorUnit` for the axis. "," * <dl>"," * <dt>determinant</dt><dd>The algorithm used for calculating distance between ticks. The possible options are `count` and `distance`. If"," * the `determinant` is `count`, the axis ticks will spaced so that a specified number of ticks appear on the axis. If the `determinant`"," * is `distance`, the axis ticks will spaced out according to the specified distance. The default value is `count`.</dd>"," * <dt>count</dt><dd>Number of ticks to appear on the axis when the `determinant` is `count`. The default value is 11.</dd>"," * <dt>distance</dt><dd>The distance (in pixels) between ticks when the `determinant` is `distance`. The default value is 75.</dd>"," * </dl>"," * </dd>"," * <dt>label</dt><dd>Properties and styles applied to the axis labels."," * <dl>"," * <dt>color</dt><dd>The color of the labels. The default value is `#808080`.</dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 indicating the opacity of the labels. The default value is 1.</dd>"," * <dt>fontSize</dt><dd>The font-size of the labels. The default value is 85%</dd>"," * <dt>rotation</dt><dd>The rotation, in degrees (between -90 and 90) of the labels. The default value is 0.</dd>"," * <dt>margin</dt><dd>The distance between the label and the axis/tick. Depending on the position of the `Axis`, only one of the properties used."," * <dl>"," * <dt>top</dt><dd>Pixel value used for an axis with a `position` of `bottom`. The default value is 4.</dd>"," * <dt>right</dt><dd>Pixel value used for an axis with a `position` of `left`. The default value is 4.</dd>"," * <dt>bottom</dt><dd>Pixel value used for an axis with a `position` of `top`. The default value is 4.</dd>"," * <dt>left</dt><dd>Pixel value used for an axis with a `position` of `right`. The default value is 4.</dd>"," * </dl>"," * </dd>"," * </dl>"," * </dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","/**"," * AxisType is an abstract class that manages the data for an axis."," *"," * @module charts"," * @submodule charts-base"," * @class AxisType"," * @constructor"," * @extends Axis"," */","Y.AxisType = Y.Base.create(\"baseAxis\", Y.Axis, [], {"," /**"," * @method initializer"," * @private"," */"," initializer: function()"," {"," this.after(\"dataReady\", Y.bind(this._dataChangeHandler, this));"," this.after(\"dataUpdate\", Y.bind(this._dataChangeHandler, this));"," this.after(\"minimumChange\", Y.bind(this._keyChangeHandler, this));"," this.after(\"maximumChange\", Y.bind(this._keyChangeHandler, this));"," this.after(\"keysChange\", this._keyChangeHandler);"," this.after(\"dataProviderChange\", this._dataProviderChangeHandler);"," this.after(\"alwaysShowZeroChange\", this._keyChangeHandler);"," this.after(\"roundingMethodChange\", this._keyChangeHandler);"," },",""," /**"," * @method bindUI"," * @private"," */"," bindUI: function()"," {"," this.after(\"stylesChange\", this._updateHandler);"," this.after(\"overlapGraphChange\", this._updateHandler);"," this.after(\"positionChange\", this._positionChangeHandler);"," this.after(\"widthChange\", this._handleSizeChange);"," this.after(\"heightChange\", this._handleSizeChange);"," this.after(\"calculatedWidthChange\", this._handleSizeChange);"," this.after(\"calculatedHeightChange\", this._handleSizeChange);"," },",""," /**"," * Handles changes to `dataProvider`."," *"," * @method _dataProviderChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _dataProviderChangeHandler: function(e)"," {"," var keyCollection = this.get(\"keyCollection\").concat(),"," keys = this.get(\"keys\"),"," i;"," if(keys)"," {"," for(i in keys)"," {"," if(keys.hasOwnProperty(i))"," {"," delete keys[i];"," }"," }"," }"," if(keyCollection && keyCollection.length)"," {"," this.set(\"keys\", keyCollection);"," }"," },",""," /**"," * Constant used to generate unique id."," *"," * @property GUID"," * @type String"," * @private"," */"," GUID: \"yuibaseaxis\","," "," /**"," * Type of data used in `Axis`."," *"," * @property _type"," * @type String "," * @readOnly"," * @private"," */"," _type: null,"," "," /**"," * Storage for `setMaximum` attribute."," *"," * @property _setMaximum"," * @type Object"," * @private"," */"," _setMaximum: null,"," "," /**"," * Storage for `dataMaximum` attribute."," *"," * @property _dataMaximum"," * @type Object"," * @private"," */"," _dataMaximum: null,"," "," /**"," * Storage for `setMinimum` attribute."," *"," * @property _setMinimum"," * @type Object"," * @private"," */"," _setMinimum: null,"," "," /**"," * Reference to data array."," *"," * @property _data"," * @type Array"," * @private"," */"," _data: null,",""," /**"," * Indicates whether the all data is up to date."," *"," * @property _updateTotalDataFlag"," * @type Boolean"," * @private"," */"," _updateTotalDataFlag: true,",""," /**"," * Storage for `dataReady` attribute."," *"," * @property _dataReady"," * @type Boolean"," * @readOnly"," * @private"," */"," _dataReady: false,"," "," /**"," * Adds an array to the key hash."," *"," * @method addKey"," * @param value Indicates what key to use in retrieving"," * the array."," */"," addKey: function (value)"," {"," this.set(\"keys\", value);"," },",""," /**"," * Gets an array of values based on a key."," *"," * @method _getKeyArray"," * @param {String} key Value key associated with the data array."," * @param {Array} data Array in which the data resides."," * @return Array"," * @private"," */"," _getKeyArray: function(key, data)"," {"," var i = 0,"," obj,"," keyArray = [],"," len = data.length;"," for(; i < len; ++i)"," {"," obj = data[i];"," keyArray[i] = obj[key];"," }"," return keyArray;"," },",""," /**"," * Sets data by key"," *"," * @method _setDataByKey"," * @param {String} key Key value to use."," * @param {Array} data Array to use."," * @private "," */"," _setDataByKey: function(key, data)"," {"," var i,"," obj, "," arr = [], "," dv = this._dataClone.concat(), "," len = dv.length;"," for(i = 0; i < len; ++i)"," {"," obj = dv[i];"," arr[i] = obj[key];"," }"," this.get(\"keys\")[key] = arr;"," this._updateTotalDataFlag = true;"," },",""," /**"," * Updates the total data array."," *"," * @method _updateTotalData"," * @private"," */"," _updateTotalData: function()"," {"," var keys = this.get(\"keys\"),"," i;"," this._data = [];"," for(i in keys)"," {"," if(keys.hasOwnProperty(i))"," {"," this._data = this._data.concat(keys[i]);"," }"," }"," this._updateTotalDataFlag = false;"," },",""," /**"," * Removes an array from the key hash."," * "," * @method removeKey"," * @param {String} value Indicates what key to use in removing from "," * the hash."," */"," removeKey: function(value)"," {"," var keys = this.get(\"keys\");"," if(keys.hasOwnProperty(value)) "," {"," delete keys[value];"," this._keyChangeHandler();"," }"," },",""," /**"," * Returns a value based of a key value and an index."," *"," * @method getKeyValueAt"," * @param {String} key value used to look up the correct array"," * @param {Number} index within the array"," * @return Number "," */"," getKeyValueAt: function(key, index)"," {"," var value = NaN,"," keys = this.get(\"keys\");"," if(keys[key] && Y_Lang.isNumber(parseFloat(keys[key][index])))"," {"," value = keys[key][index];"," }"," return parseFloat(value);"," },",""," /**"," * Returns an array of values based on an identifier key."," *"," * @method getDataByKey"," * @param {String} value value used to identify the array"," * @return Object"," */"," getDataByKey: function (value)"," {"," var keys = this.get(\"keys\");"," if(keys[value])"," {"," return keys[value];"," }"," return null;"," },",""," /**"," * Calculates the maximum and minimum values for the `Axis`."," *"," * @method _updateMinAndMax"," * @private "," */"," _updateMinAndMax: function() "," {"," var data = this.get(\"data\"),"," max = 0,"," min = 0,"," len,"," num,"," i;"," if(data && data.length && data.length > 0)"," {"," len = data.length;"," max = min = data[0];"," if(len > 1)"," {"," for(i = 1; i < len; i++)"," { "," num = data[i];"," if(isNaN(num))"," {"," continue;"," }"," max = Math.max(num, max);"," min = Math.min(num, min);"," }"," }"," }"," this._dataMaximum = max;"," this._dataMinimum = min;"," },",""," /**"," * Returns the total number of majorUnits that will appear on an axis."," *"," * @method getTotalMajorUnits"," * @return Number"," */"," getTotalMajorUnits: function()"," {"," var units,"," majorUnit = this.get(\"styles\").majorUnit,"," len = this.get(\"length\");"," if(majorUnit.determinant === \"count\") "," {"," units = majorUnit.count;"," }"," else if(majorUnit.determinant === \"distance\") "," {"," units = (len/majorUnit.distance) + 1;"," }"," return units; "," },",""," /**"," * Returns the distance between major units on an axis."," *"," * @method getMajorUnitDistance"," * @param {Number} len Number of ticks"," * @param {Number} uiLen Size of the axis."," * @param {Object} majorUnit Hash of properties used to determine the majorUnit"," * @return Number"," */"," getMajorUnitDistance: function(len, uiLen, majorUnit)"," {"," var dist;"," if(majorUnit.determinant === \"count\")"," {"," dist = uiLen/(len - 1);"," }"," else if(majorUnit.determinant === \"distance\")"," {"," dist = majorUnit.distance;"," }"," return dist;"," },"," "," /**"," * Gets the distance that the first and last ticks are offset from there respective"," * edges."," *"," * @method getEdgeOffset"," * @param {Number} ct Number of ticks on the axis."," * @param {Number} l Length (in pixels) of the axis."," * @return Number"," */"," getEdgeOffset: function(ct, l)"," {"," return 0;"," },",""," /**"," * Calculates and returns a value based on the number of labels and the index of"," * the current label."," *"," * @method getLabelByIndex"," * @param {Number} i Index of the label."," * @param {Number} l Total number of labels."," * @return String"," */"," getLabelByIndex: function(i, l)"," {"," var min = this.get(\"minimum\"),"," max = this.get(\"maximum\"),"," increm = (max - min)/(l-1),"," label;"," l -= 1;"," label = min + (i * increm);"," return label;"," },",""," /**"," * Updates the `Axis` after a change in keys."," *"," * @method _keyChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _keyChangeHandler: function(e)"," {"," this._updateMinAndMax();"," this.fire(\"dataUpdate\");"," },",""," /**"," * Checks to see if data extends beyond the range of the axis. If so,"," * that data will need to be hidden. This method is internal, temporary and subject"," * to removal in the future."," *"," * @method _hasDataOverflow"," * @protected"," * @return Boolean"," */"," _hasDataOverflow: function()"," {"," if(this.get(\"setMin\") || this.get(\"setMax\"))"," {"," return true;"," }"," return false;"," },",""," /**"," * Returns a string corresponding to the first label on an "," * axis."," *"," * @method getMinimumValue"," * @return String"," */"," getMinimumValue: function()"," {"," return this.get(\"minimum\");"," },",""," /**"," * Returns a string corresponding to the last label on an "," * axis."," *"," * @method getMaximumValue"," * @return String"," */"," getMaximumValue: function()"," {"," return this.get(\"maximum\");"," }","}, {"," ATTRS: {"," /**"," * Hash of array identifed by a string value."," *"," * @attribute keys"," * @type Object"," */"," keys: {"," value: {},",""," setter: function(val)"," {"," var keys = {},"," i, "," len,"," data = this.get(\"dataProvider\");"," if(Y_Lang.isArray(val))"," {"," len = val.length;"," for(i = 0; i < len; ++i)"," {"," keys[val[i]] = this._getKeyArray(val[i], data); "," }"," "," }"," else if(Y_Lang.isString(val))"," {"," keys = this.get(\"keys\");"," keys[val] = this._getKeyArray(val, data);"," }"," else"," {"," for(i in val)"," {"," if(val.hasOwnProperty(i))"," {"," keys[i] = this._getKeyArray(i, data);"," }"," }"," }"," this._updateTotalDataFlag = true;"," return keys;"," }"," },",""," /**"," *Indicates how to round unit values."," * <dl>"," * <dt>niceNumber</dt><dd>Units will be smoothed based on the number of ticks and data range.</dd>"," * <dt>auto</dt><dd>If the range is greater than 1, the units will be rounded.</dd>"," * <dt>numeric value</dt><dd>Units will be equal to the numeric value.</dd>"," * <dt>null</dt><dd>No rounding will occur.</dd>"," * </dl>"," *"," * @attribute roundingMethod"," * @type String"," * @default niceNumber"," */"," roundingMethod: {"," value: \"niceNumber\""," },",""," /**"," *Returns the type of axis data"," * <dl>"," * <dt>time</dt><dd>Manages time data</dd>"," * <dt>stacked</dt><dd>Manages stacked numeric data</dd> "," * <dt>numeric</dt><dd>Manages numeric data</dd>"," * <dt>category</dt><dd>Manages categorical data</dd>"," * </dl>"," *"," * @attribute type"," * @type String"," */"," type:"," {"," readOnly: true,",""," getter: function ()"," {"," return this._type;"," }"," },",""," /**"," * Instance of `ChartDataProvider` that the class uses"," * to build its own data."," *"," * @attribute dataProvider"," * @type Array"," */"," dataProvider:{"," setter: function (value)"," {"," return value;"," }"," },",""," /**"," * The maximum value contained in the `data` array. Used for"," * `maximum` when `autoMax` is true."," *"," * @attribute dataMaximum"," * @type Number"," */"," dataMaximum: {"," getter: function ()"," {"," if(!this._dataMaximum)"," { "," this._updateMinAndMax();"," }"," return this._dataMaximum;"," }"," },",""," /**"," * The maximum value that will appear on an axis."," *"," * @attribute maximum"," * @type Number"," */"," maximum: {"," lazyAdd: false,",""," getter: function ()"," {"," var max = this.get(\"dataMaximum\"),"," min = this.get(\"minimum\");"," //If all values are zero, force a range so that the Axis and related series"," //will still render."," if(min === 0 && max === 0)"," {"," max = 10;"," }"," if(Y_Lang.isNumber(this._setMaximum))"," {"," max = this._setMaximum;"," }"," return parseFloat(max);"," },"," setter: function (value)"," {"," this._setMaximum = parseFloat(value);"," return value;"," }"," },",""," /**"," * The minimum value contained in the `data` array. Used for"," * `minimum` when `autoMin` is true."," *"," * @attribute dataMinimum"," * @type Number"," */"," dataMinimum: {"," getter: function ()"," {"," if(!this._dataMinimum)"," {"," this._updateMinAndMax();"," }"," return this._dataMinimum;"," }"," },",""," /**"," * The minimum value that will appear on an axis."," *"," * @attribute minimum"," * @type Number"," */"," minimum: {"," lazyAdd: false,",""," getter: function ()"," {"," var min = this.get(\"dataMinimum\");"," if(Y_Lang.isNumber(this._setMinimum))"," {"," min = this._setMinimum;"," }"," return parseFloat(min);"," },"," setter: function(val)"," {"," this._setMinimum = parseFloat(val);"," return val;"," }"," },",""," /**"," * Determines whether the maximum is calculated or explicitly "," * set by the user."," *"," * @attribute setMax"," * @type Boolean"," */"," setMax: {"," readOnly: true,",""," getter: function()"," {"," return Y_Lang.isNumber(this._setMaximum);"," }"," },",""," /**"," * Determines whether the minimum is calculated or explicitly"," * set by the user."," *"," * @attribute setMin"," * @type Boolean"," */"," setMin: {"," readOnly: true,",""," getter: function()"," {"," return Y_Lang.isNumber(this._setMinimum);"," }"," },",""," /**"," * Array of axis data"," *"," * @attribute data"," * @type Array"," */"," data: {"," getter: function ()"," {"," if(!this._data || this._updateTotalDataFlag)"," {"," this._updateTotalData();"," }"," return this._data;"," }"," },",""," /**"," * Array containing all the keys in the axis."," "," * @attribute keyCollection"," * @type Array"," */"," keyCollection: {"," getter: function()"," {"," var keys = this.get(\"keys\"),"," i, "," col = [];"," for(i in keys)"," {"," if(keys.hasOwnProperty(i))"," {"," col.push(i);"," }"," }"," return col;"," },"," readOnly: true"," }"," }","});","/**"," * NumericAxis manages numeric data on an axis."," *"," * @module charts"," * @submodule charts-base"," * @class NumericAxis"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Chart."," * @extends AxisType"," */","function NumericAxis(config)","{"," NumericAxis.superclass.constructor.apply(this, arguments);","}","","NumericAxis.NAME = \"numericAxis\";","","NumericAxis.ATTRS = {"," /**"," * Indicates whether 0 should always be displayed."," *"," * @attribute alwaysShowZero"," * @type Boolean"," */"," alwaysShowZero: {"," value: true "," },"," "," /**"," * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need"," * to implement the arguments below and return a `String` or an `HTMLElement`. The default implementation of the method returns a `String`. The output of this method"," * will be rendered to the DOM using `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override the Axis' "," * `appendLabelFunction` to accept html as a `String`."," * <dl>"," * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>"," * <dt>format</dt><dd>Object containing properties used to format the label. (optional)</dd>"," * </dl>"," *"," * @attribute labelFunction"," * @type Function"," */"," labelFunction: { "," value: function(val, format)"," {"," if(format)"," {"," return Y.DataType.Number.format(val, format);"," }"," return val;"," }"," },",""," /**"," * Object containing properties used by the `labelFunction` to format a"," * label."," *"," * @attribute labelFormat"," * @type Object"," */"," labelFormat: {"," value: {"," prefix: \"\","," thousandsSeparator: \"\","," decimalSeparator: \"\","," decimalPlaces: \"0\","," suffix: \"\""," }"," }","};","","Y.extend(NumericAxis, Y.AxisType,","{"," /**"," * Formats a label based on the axis type and optionally specified format."," *"," * @method formatLabel"," * @param {Object} value"," * @param {Object} format Pattern used to format the value."," * @return String"," */"," formatLabel: function(val, format)"," {"," if(format)"," {"," return Y.DataType.Number.format(val, format);"," }"," return val;"," },",""," /**"," * Returns the sum of all values per key."," *"," * @method getTotalByKey"," * @param {String} key The identifier for the array whose values will be calculated."," * @return Number"," */"," getTotalByKey: function(key)"," {"," var total = 0,"," values = this.getDataByKey(key),"," i = 0,"," val,"," len = values ? values.length : 0;"," for(; i < len; ++i)"," {"," val = parseFloat(values[i]);"," if(!isNaN(val))"," {"," total += val;"," }"," }"," return total;"," },",""," /**"," * Type of data used in `Axis`."," *"," * @property _type"," * @readOnly"," * @private"," */"," _type: \"numeric\",",""," /**"," * Helper method for getting a `roundingUnit` when calculating the minimum and maximum values."," *"," * @method _getMinimumUnit"," * @param {Number} max Maximum number"," * @param {Number} min Minimum number"," * @param {Number} units Number of units on the axis"," * @return Number"," * @private"," */"," _getMinimumUnit:function(max, min, units)"," {"," return this._getNiceNumber(Math.ceil((max - min)/units));"," },",""," /**"," * Calculates a nice rounding unit based on the range."," *"," * @method _getNiceNumber"," * @param {Number} roundingUnit The calculated rounding unit."," * @return Number"," * @private"," */"," _getNiceNumber: function(roundingUnit)"," {"," var tempMajorUnit = roundingUnit,"," order = Math.ceil(Math.log(tempMajorUnit) * 0.4342944819032518),"," roundedMajorUnit = Math.pow(10, order),"," roundedDiff;",""," if (roundedMajorUnit / 2 >= tempMajorUnit) "," {"," roundedDiff = Math.floor((roundedMajorUnit / 2 - tempMajorUnit) / (Math.pow(10,order-1)/2));"," tempMajorUnit = roundedMajorUnit/2 - roundedDiff*Math.pow(10,order-1)/2;"," }"," else "," {"," tempMajorUnit = roundedMajorUnit;"," }"," if(!isNaN(tempMajorUnit))"," {"," return tempMajorUnit;"," }"," return roundingUnit;",""," },",""," /**"," * Calculates the maximum and minimum values for the `Axis`."," *"," * @method _updateMinAndMax"," * @private "," */"," _updateMinAndMax: function()"," {"," var data = this.get(\"data\"),"," max, "," min,"," len,"," num,"," i = 0,"," key,"," setMax = this.get(\"setMax\"),"," setMin = this.get(\"setMin\");"," if(!setMax || !setMin)"," {"," if(data && data.length && data.length > 0)"," {"," len = data.length;"," for(; i < len; i++)"," { "," num = data[i];"," if(isNaN(num))"," {"," if(Y_Lang.isObject(num))"," {"," min = max = 0;"," //hloc values"," for(key in num)"," {"," if(num.hasOwnProperty(key))"," {"," max = Math.max(num[key], max);"," min = Math.min(num[key], min);"," }"," }"," }"," max = setMax ? this._setMaximum : max;"," min = setMin ? this._setMinimum : min;"," continue;"," }"," "," if(setMin)"," {"," min = this._setMinimum;"," }"," else if(min === undefined)"," {"," min = num;"," }"," else"," {"," min = Math.min(num, min); "," }"," if(setMax)"," {"," max = this._setMaximum;"," }"," else if(max === undefined)"," {"," max = num;"," }"," else"," {"," max = Math.max(num, max);"," }"," "," this._actualMaximum = max;"," this._actualMinimum = min;"," }"," }"," this._roundMinAndMax(min, max, setMin, setMax);"," }"," },",""," /**"," * Rounds the mimimum and maximum values based on the `roundingUnit` attribute."," *"," * @method _roundMinAndMax"," * @param {Number} min Minimum value"," * @param {Number} max Maximum value"," * @private"," */"," _roundMinAndMax: function(min, max, setMin, setMax)"," {"," var roundingUnit,"," minimumRange,"," minGreaterThanZero = min >= 0,"," maxGreaterThanZero = max > 0,"," dataRangeGreater,"," maxRound,"," minRound,"," topTicks,"," botTicks,"," tempMax,"," tempMin,"," units = this.getTotalMajorUnits() - 1,"," alwaysShowZero = this.get(\"alwaysShowZero\"),"," roundingMethod = this.get(\"roundingMethod\"),"," useIntegers = (max - min)/units >= 1;"," if(roundingMethod)"," {"," if(roundingMethod == \"niceNumber\")"," {"," roundingUnit = this._getMinimumUnit(max, min, units);"," if(minGreaterThanZero && maxGreaterThanZero)"," {"," if((alwaysShowZero || min < roundingUnit) && !setMin)"," {"," min = 0;"," roundingUnit = this._getMinimumUnit(max, min, units);"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," }"," if(setMax)"," {"," if(!alwaysShowZero)"," {"," min = max - (roundingUnit * units);"," }"," }"," else if(setMin)"," {"," max = min + (roundingUnit * units);"," }"," else"," {"," max = this._roundUpToNearest(max, roundingUnit);"," }"," }"," else if(maxGreaterThanZero && !minGreaterThanZero)"," {"," if(alwaysShowZero)"," {"," topTicks = Math.round(units/((-1 * min)/max + 1));"," topTicks = Math.max(Math.min(topTicks, units - 1), 1);"," botTicks = units - topTicks;"," tempMax = Math.ceil( max/topTicks );"," tempMin = Math.floor( min/botTicks ) * -1;"," "," if(setMin)"," {"," while(tempMin < tempMax && botTicks >= 0)"," {"," botTicks--;"," topTicks++;"," tempMax = Math.ceil( max/topTicks );"," tempMin = Math.floor( min/botTicks ) * -1;"," }"," //if there are any bottom ticks left calcualate the maximum by multiplying by the tempMin value"," //if not, it's impossible to ensure that a zero is shown. skip it"," if(botTicks > 0)"," {"," max = tempMin * topTicks;"," }"," else"," {"," max = min + (roundingUnit * units);"," }"," }"," else if(setMax)"," {"," while(tempMax < tempMin && topTicks >= 0)"," {"," botTicks++;"," topTicks--;"," tempMin = Math.floor( min/botTicks ) * -1;"," tempMax = Math.ceil( max/topTicks );"," }"," //if there are any top ticks left calcualate the minimum by multiplying by the tempMax value"," //if not, it's impossible to ensure that a zero is shown. skip it"," if(topTicks > 0)"," {"," min = tempMax * botTicks * -1;"," }"," else"," {"," min = max - (roundingUnit * units);"," }"," }"," else"," {"," roundingUnit = Math.max(tempMax, tempMin);"," roundingUnit = this._getNiceNumber(roundingUnit); "," max = roundingUnit * topTicks;"," min = roundingUnit * botTicks * -1;"," }"," }"," else "," {"," if(setMax)"," {"," min = max - (roundingUnit * units);"," }"," else if(setMin)"," {"," max = min + (roundingUnit * units);"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," max = this._roundUpToNearest(max, roundingUnit);"," }"," }"," }"," else"," {"," if(setMin)"," {"," if(alwaysShowZero)"," {"," max = 0;"," }"," else"," {"," max = min + (roundingUnit * units);"," }"," }"," else if(!setMax)"," {"," if(alwaysShowZero || max === 0 || max + roundingUnit > 0)"," {"," max = 0;"," roundingUnit = this._getMinimumUnit(max, min, units);"," min = max - (roundingUnit * units);"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," max = this._roundUpToNearest(max, roundingUnit);"," }"," }"," else"," {"," min = max - (roundingUnit * units);"," }"," }"," }"," else if(roundingMethod == \"auto\") "," {"," if(minGreaterThanZero && maxGreaterThanZero)"," {"," if((alwaysShowZero || min < (max-min)/units) && !setMin)"," {"," min = 0;"," }"," "," roundingUnit = (max - min)/units;"," if(useIntegers)"," {"," roundingUnit = Math.ceil(roundingUnit);"," }"," max = min + (roundingUnit * units);"," }"," else if(maxGreaterThanZero && !minGreaterThanZero)"," {"," if(alwaysShowZero)"," {"," topTicks = Math.round( units / ( (-1 * min) /max + 1) );"," topTicks = Math.max(Math.min(topTicks, units - 1), 1);"," botTicks = units - topTicks;",""," if(useIntegers)"," {"," tempMax = Math.ceil( max/topTicks );"," tempMin = Math.floor( min/botTicks ) * -1;"," }"," else"," {"," tempMax = max/topTicks;"," tempMin = min/botTicks * -1;"," }"," roundingUnit = Math.max(tempMax, tempMin);"," max = roundingUnit * topTicks;"," min = roundingUnit * botTicks * -1;"," }"," else"," {"," roundingUnit = (max - min)/units;"," if(useIntegers)"," {"," roundingUnit = Math.ceil(roundingUnit);"," }"," min = this._roundDownToNearest(min, roundingUnit);"," max = this._roundUpToNearest(max, roundingUnit);"," }"," }"," else"," {"," roundingUnit = (max - min)/units;"," if(useIntegers)"," { "," roundingUnit = Math.ceil(roundingUnit);"," }"," if(alwaysShowZero || max === 0 || max + roundingUnit > 0)"," {"," max = 0;"," roundingUnit = (max - min)/units;"," if(useIntegers)"," {"," Math.ceil(roundingUnit);"," }"," min = max - (roundingUnit * units);"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," max = this._roundUpToNearest(max, roundingUnit);"," }",""," }"," }"," else if(!isNaN(roundingMethod) && isFinite(roundingMethod))"," {"," roundingUnit = roundingMethod;"," minimumRange = roundingUnit * units;"," dataRangeGreater = (max - min) > minimumRange;"," minRound = this._roundDownToNearest(min, roundingUnit);"," maxRound = this._roundUpToNearest(max, roundingUnit);"," if(setMax)"," {"," min = max - minimumRange;"," }"," else if(setMin)"," {"," max = min + minimumRange;"," }"," else if(minGreaterThanZero && maxGreaterThanZero)"," {"," if(alwaysShowZero || minRound <= 0)"," {"," min = 0;"," }"," else"," {"," min = minRound;"," }"," max = min + minimumRange;"," }"," else if(maxGreaterThanZero && !minGreaterThanZero)"," {"," min = minRound;"," max = maxRound;"," }"," else"," {"," if(alwaysShowZero || maxRound >= 0)"," {"," max = 0;"," }"," else"," {"," max = maxRound;"," }"," min = max - minimumRange;"," }"," }"," }"," this._dataMaximum = max;"," this._dataMinimum = min;"," },",""," /**"," * Calculates and returns a value based on the number of labels and the index of"," * the current label."," *"," * @method getLabelByIndex"," * @param {Number} i Index of the label."," * @param {Number} l Total number of labels."," * @return String"," */"," getLabelByIndex: function(i, l)"," {"," var min = this.get(\"minimum\"),"," max = this.get(\"maximum\"),"," increm = (max - min)/(l-1),"," label,"," roundingMethod = this.get(\"roundingMethod\");"," l -= 1;"," //respect the min and max. calculate all other labels."," if(i === 0)"," {"," label = min;"," }"," else if(i === l)"," {"," label = max;"," }"," else"," {"," label = (i * increm);"," if(roundingMethod == \"niceNumber\")"," {"," label = this._roundToNearest(label, increm);"," }"," label += min;"," }"," return parseFloat(label);"," },",""," /**"," * Rounds a Number to the nearest multiple of an input. For example, by rounding"," * 16 to the nearest 10, you will receive 20. Similar to the built-in function Math.round()."," *"," * @method _roundToNearest"," * @param {Number} number Number to round"," * @param {Number} nearest Multiple to round towards."," * @return Number"," * @private"," */"," _roundToNearest: function(number, nearest)"," {"," nearest = nearest || 1;"," if(nearest === 0)"," {"," return number;"," }"," var roundedNumber = Math.round(this._roundToPrecision(number / nearest, 10)) * nearest;"," return this._roundToPrecision(roundedNumber, 10);"," },"," "," /**"," * Rounds a Number up to the nearest multiple of an input. For example, by rounding"," * 16 up to the nearest 10, you will receive 20. Similar to the built-in function Math.ceil()."," *"," * @method _roundUpToNearest"," * @param {Number} number Number to round"," * @param {Number} nearest Multiple to round towards."," * @return Number"," * @private"," */"," _roundUpToNearest: function(number, nearest)"," {"," nearest = nearest || 1;"," if(nearest === 0)"," {"," return number;"," }"," return Math.ceil(this._roundToPrecision(number / nearest, 10)) * nearest;"," },"," "," /**"," * Rounds a Number down to the nearest multiple of an input. For example, by rounding"," * 16 down to the nearest 10, you will receive 10. Similar to the built-in function Math.floor()."," *"," * @method _roundDownToNearest"," * @param {Number} number Number to round"," * @param {Number} nearest Multiple to round towards."," * @return Number"," * @private"," */"," _roundDownToNearest: function(number, nearest)"," {"," nearest = nearest || 1;"," if(nearest === 0)"," {"," return number;"," }"," return Math.floor(this._roundToPrecision(number / nearest, 10)) * nearest;"," },",""," /**"," * Rounds a number to a certain level of precision. Useful for limiting the number of"," * decimal places on a fractional number."," *"," * @method _roundToPrecision"," * @param {Number} number Number to round"," * @param {Number} precision Multiple to round towards."," * @return Number"," * @private"," */"," _roundToPrecision: function(number, precision)"," {"," precision = precision || 0;"," var decimalPlaces = Math.pow(10, precision);"," return Math.round(decimalPlaces * number) / decimalPlaces;"," },"," "," /**"," * Checks to see if data extends beyond the range of the axis. If so,"," * that data will need to be hidden. This method is internal, temporary and subject"," * to removal in the future."," *"," * @method _hasDataOverflow"," * @protected"," * @return Boolean"," */"," _hasDataOverflow: function()"," {"," var roundingMethod,"," min,"," max;"," if(this.get(\"setMin\") || this.get(\"setMax\"))"," {"," return true;"," }"," roundingMethod = this.get(\"roundingMethod\");"," min = this._actualMinimum;"," max = this._actualMaximum;"," if(Y_Lang.isNumber(roundingMethod) && ((Y_Lang.isNumber(max) && max > this._dataMaximum) || (Y_Lang.isNumber(min) && min < this._dataMinimum)))"," {"," return true;"," }"," return false;"," }","});","","Y.NumericAxis = NumericAxis;"," ","/**"," * StackedAxis manages stacked numeric data on an axis."," *"," * @module charts"," * @submodule charts-base"," * @class StackedAxis"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Chart."," * @extends NumericAxis"," */","function StackedAxis(config)","{"," StackedAxis.superclass.constructor.apply(this, arguments);","}","","StackedAxis.NAME = \"stackedAxis\";","","","Y.extend(StackedAxis, Y.NumericAxis,","{"," /**"," * Calculates the maximum and minimum values for the `Axis`."," *"," * @method _updateMinAndMax"," * @private "," */"," _updateMinAndMax: function()"," {"," var max = 0,"," min = 0,"," pos = 0,"," neg = 0,"," len = 0,"," i = 0,"," key,"," num,"," keys = this.get(\"keys\"),"," setMin = this.get(\"setMin\"),"," setMax = this.get(\"setMax\");",""," for(key in keys)"," {"," if(keys.hasOwnProperty(key))"," {"," len = Math.max(len, keys[key].length);"," }"," }"," for(; i < len; ++i)"," {"," pos = 0;"," neg = 0;"," for(key in keys)"," {"," if(keys.hasOwnProperty(key))"," {"," num = keys[key][i];"," if(isNaN(num))"," {"," continue;"," }"," if(num >= 0)"," {"," pos += num;"," }"," else"," {"," neg += num;"," }"," }"," }"," if(pos > 0)"," {"," max = Math.max(max, pos);"," }"," else "," {"," max = Math.max(max, neg);"," }"," if(neg < 0)"," {"," min = Math.min(min, neg);"," }"," else"," {"," min = Math.min(min, pos);"," }"," }"," this._actualMaximum = max;"," this._actualMinimum = min;"," if(setMax)"," {"," max = this._setMaximum;"," }"," if(setMin)"," {"," min = this._setMinimum;"," }"," this._roundMinAndMax(min, max, setMin, setMax);"," }","});","","Y.StackedAxis = StackedAxis;"," ","/**"," * TimeAxis manages time data on an axis."," *"," * @module charts"," * @submodule charts-base"," * @class TimeAxis"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Chart."," * @extends AxisType"," */","function TimeAxis(config)","{"," TimeAxis.superclass.constructor.apply(this, arguments);","}","","TimeAxis.NAME = \"timeAxis\";","","TimeAxis.ATTRS = ","{"," /**"," * Indicates whether the maximum is calculated or explicitly set. "," *"," * @attribute setMax"," * @readOnly"," * @type Boolean"," * @private"," */"," setMax: {"," readOnly: true,",""," getter: function()"," {"," var max = this._getNumber(this._setMaximum);"," return (Y_Lang.isNumber(max));"," }"," },",""," /**"," * Indicates whether the minimum is calculated or explicitly set. "," *"," * @attribute setMin"," * @readOnly"," * @type Boolean"," * @private"," */"," setMin: {"," readOnly: true,",""," getter: function()"," {"," var min = this._getNumber(this._setMinimum);"," return (Y_Lang.isNumber(min));"," }"," },",""," /**"," * The maximum value that will appear on an axis. Unless explicitly set, this value is calculated by the `Axis`."," *"," * @attribute maximum"," * @type Number"," */"," maximum: {"," getter: function ()"," {"," var max = this._getNumber(this._setMaximum);"," if(!Y_Lang.isNumber(max))"," {"," max = this._getNumber(this.get(\"dataMaximum\"));"," }"," return parseFloat(max);"," },"," setter: function (value)"," {"," this._setMaximum = this._getNumber(value);"," return value;"," }"," },",""," /**"," * The minimum value that will appear on an axis. Unless explicitly set, this value is calculated by the `Axis`."," *"," * @attribute minimum"," * @type Number"," */"," minimum: {"," getter: function ()"," {"," var min = this._getNumber(this._setMinimum);"," if(!Y_Lang.isNumber(min)) "," {"," min = this._getNumber(this.get(\"dataMinimum\"));"," }"," return parseFloat(min);"," },"," setter: function (value)"," {"," this._setMinimum = this._getNumber(value);"," return value;"," }"," },",""," /**"," * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need"," * to implement the arguments below and return a `String` or an `HTMLElement`. The default implementation of the method returns a `String`. The output of this method"," * will be rendered to the DOM using `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override the Axis' "," * `appendLabelFunction` to accept html as a `String`."," * <dl>"," * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>"," * <dt>format</dt><dd>STRFTime string used to format the label. (optional)</dd>"," * </dl>"," *"," * @attribute labelFunction"," * @type Function"," */"," labelFunction: {"," value: function(val, format)"," {"," val = Y.DataType.Date.parse(val);"," if(format)"," {"," return Y.DataType.Date.format(val, {format:format});"," }"," return val;"," }"," },",""," /**"," * Pattern used by the `labelFunction` to format a label."," *"," * @attribute labelFormat"," * @type String"," */"," labelFormat: {"," value: \"%b %d, %y\""," }","};","","Y.extend(TimeAxis, Y.AxisType, {"," /**"," * Formats a label based on the axis type and optionally specified format."," *"," * @method formatLabel"," * @param {Object} value"," * @param {Object} format Pattern used to format the value."," * @return String"," */"," formatLabel: function(val, format)"," {"," val = Y.DataType.Date.parse(val);"," if(format)"," {"," return Y.DataType.Date.format(val, {format:format});"," }"," return val;"," },",""," /**"," * Constant used to generate unique id."," *"," * @property GUID"," * @type String"," * @private"," */"," GUID: \"yuitimeaxis\","," "," /**"," * Type of data used in `Axis`."," *"," * @property _dataType"," * @readOnly"," * @private"," */"," _dataType: \"time\","," "," /**"," * Calculates and returns a value based on the number of labels and the index of"," * the current label."," *"," * @method getLabelByIndex"," * @param {Number} i Index of the label."," * @param {Number} l Total number of labels."," * @return String"," */"," getLabelByIndex: function(i, l)"," {"," var min = this.get(\"minimum\"),"," max = this.get(\"maximum\"),"," position = this.get(\"position\"),"," increm,"," label;"," l -= 1;"," increm = ((max - min)/l) * i;"," if(position == \"bottom\" || position == \"top\")"," {"," label = min + increm;"," }"," else"," {"," label = max - increm;"," }"," return label;"," },",""," /**"," * Gets an array of values based on a key."," *"," * @method _getKeyArray"," * @param {String} key Value key associated with the data array."," * @param {Array} data Array in which the data resides."," * @return Array"," * @private"," */"," _getKeyArray: function(key, data)"," {"," var obj,"," keyArray = [],"," i = 0,"," val,"," len = data.length;"," for(; i < len; ++i)"," {"," obj = data[i][key];"," if(Y_Lang.isDate(obj))"," { "," val = obj.valueOf();"," }"," else"," {"," val = new Date(obj);"," if(Y_Lang.isDate(val))"," {"," val = val.valueOf();"," }"," else if(!Y_Lang.isNumber(obj))"," {"," if(Y_Lang.isNumber(parseFloat(obj)))"," {"," val = parseFloat(obj);"," }"," else"," {"," if(typeof obj != \"string\")"," {"," obj = obj;"," }"," val = new Date(obj).valueOf();"," }"," }"," else"," {"," val = obj;"," }"," }"," keyArray[i] = val;"," }"," return keyArray;"," },",""," /**"," * Sets data by key"," *"," * @method _setDataByKey"," * @param {String} key Key value to use."," * @param {Array} data Array to use."," * @private "," */"," _setDataByKey: function(key, data)"," {"," var obj, "," arr = [], "," dv = this._dataClone.concat(), "," i, "," val,"," len = dv.length;"," for(i = 0; i < len; ++i)"," {"," obj = dv[i][key];"," if(Y_Lang.isDate(obj))"," { "," val = obj.valueOf();"," }"," else"," {"," val = new Date(obj);"," if(Y_Lang.isDate(val))"," {"," val = val.valueOf();"," }"," else if(!Y_Lang.isNumber(obj))"," {"," if(Y_Lang.isNumber(parseFloat(obj)))"," {"," val = parseFloat(obj);"," }"," else"," {"," if(typeof obj != \"string\")"," {"," obj = obj.toString();"," }"," val = new Date(obj).valueOf();"," }"," }"," else"," {"," val = obj;"," }"," }"," arr[i] = val;"," }"," this.get(\"keys\")[key] = arr;"," this._updateTotalDataFlag = true;"," },",""," /**"," * Parses value into a number."," *"," * @method _getNumber"," * @param val {Object} Value to parse into a number"," * @return Number"," * @private"," */"," _getNumber: function(val)"," {"," if(Y_Lang.isDate(val))"," {"," val = val.valueOf();"," }"," else if(!Y_Lang.isNumber(val) && val)"," {"," val = new Date(val).valueOf();"," }",""," return val;"," }","});","","Y.TimeAxis = TimeAxis;"," ","/**"," * CategoryAxis manages category data on an axis."," *"," * @module charts"," * @submodule charts-base"," * @class CategoryAxis"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Chart."," * @extends AxisType"," */","function CategoryAxis(config)","{"," CategoryAxis.superclass.constructor.apply(this, arguments);","}","","CategoryAxis.NAME = \"categoryAxis\";","","Y.extend(CategoryAxis, Y.AxisType,","{"," /**"," * Formats a label based on the axis type and optionally specified format."," *"," * @method formatLabel"," * @param {Object} value"," * @param {Object} format Pattern used to format the value."," * @return String"," */"," formatLabel: function(val, format)"," {"," return val;"," },",""," /**"," * Object storing key data."," *"," * @property _indices"," * @private"," */"," _indices: null,",""," /**"," * Constant used to generate unique id."," *"," * @property GUID"," * @type String"," * @private"," */"," GUID: \"yuicategoryaxis\",",""," /**"," * Type of data used in `Axis`."," *"," * @property _dataType"," * @readOnly"," * @private"," */"," _type: \"category\","," "," /**"," * Calculates the maximum and minimum values for the `Axis`."," *"," * @method _updateMinAndMax"," * @private "," */"," _updateMinAndMax: function()"," {"," this._dataMaximum = Math.max(this.get(\"data\").length - 1, 0);"," this._dataMinimum = 0;"," },",""," /**"," * Gets an array of values based on a key."," *"," * @method _getKeyArray"," * @param {String} key Value key associated with the data array."," * @param {Array} data Array in which the data resides."," * @return Array"," * @private"," */"," _getKeyArray: function(key, data)"," {"," var i = 0,"," obj,"," keyArr = [],"," labels = [],"," len = data.length;"," if(!this._indices)"," {"," this._indices = {};"," }"," for(; i < len; ++i)"," {"," obj = data[i];"," keyArr[i] = i;"," labels[i] = obj[key];"," }"," this._indices[key] = keyArr;"," return labels;"," },",""," /**"," * Sets data by key"," *"," * @method _setDataByKey"," * @param {String} key Key value to use."," * @param {Array} data Array to use."," * @private "," */"," _setDataByKey: function(key)"," {"," var i,"," obj, "," arr = [], "," labels = [], "," dv = this._dataClone.concat(), "," len = dv.length;"," if(!this._indices)"," {"," this._indices = {};"," }"," for(i = 0; i < len; ++i)"," {"," obj = dv[i];"," arr[i] = i;"," labels[i] = obj[key];"," }"," this._indices[key] = arr;"," this.get(\"keys\")[key] = labels.concat();"," this._updateTotalDataFlag = true;"," },",""," /**"," * Returns an array of values based on an identifier key."," *"," * @method getDataByKey"," * @param {String} value value used to identify the array"," * @return Array"," */"," getDataByKey: function (value)"," {"," if(!this._indices)"," {"," this.get(\"keys\");"," }"," var keys = this._indices;"," if(keys[value])"," {"," return keys[value];"," }"," return null;"," },",""," /**"," * Returns the total number of majorUnits that will appear on an axis."," *"," * @method getTotalMajorUnits"," * @param {Object} majorUnit Object containing properties related to the majorUnit."," * @param {Number} len Length of the axis."," * @return Number"," */"," getTotalMajorUnits: function(majorUnit, len)"," {"," return this.get(\"data\").length;"," },"," "," /**"," * Returns the distance between major units on an axis."," *"," * @method getMajorUnitDistance"," * @param {Number} len Number of ticks"," * @param {Number} uiLen Size of the axis."," * @param {Object} majorUnit Hash of properties used to determine the majorUnit"," * @return Number"," */"," getMajorUnitDistance: function(len, uiLen, majorUnit)"," {"," var dist;"," if(majorUnit.determinant === \"count\")"," {"," dist = uiLen/len;"," }"," else if(majorUnit.determinant === \"distance\")"," {"," dist = majorUnit.distance;"," }"," return dist;"," },"," "," /**"," * Gets the distance that the first and last ticks are offset from there respective"," * edges."," *"," * @method getEdgeOffset"," * @param {Number} ct Number of ticks on the axis."," * @param {Number} l Length (in pixels) of the axis."," * @return Number"," */"," getEdgeOffset: function(ct, l)"," {"," return l/ct;"," },",""," /**"," * Returns a value based of a key value and an index."," *"," * @method getKeyValueAt"," * @param {String} key value used to look up the correct array"," * @param {Number} index within the array"," * @return String "," */"," getKeyValueAt: function(key, index)"," {"," var value = NaN,"," keys = this.get(\"keys\");"," if(keys[key] && keys[key][index]) "," {"," value = keys[key][index];"," }"," return value;"," },"," "," /**"," * Calculates and returns a value based on the number of labels and the index of"," * the current label."," *"," * @method getLabelByIndex"," * @param {Number} i Index of the label."," * @param {Number} l Total number of labels."," * @return String"," */"," getLabelByIndex: function(i, l)"," {"," var label,"," data = this.get(\"data\"),"," position = this.get(\"position\");"," if(position == \"bottom\" || position == \"top\")"," {"," label = data[i];"," }"," else"," {"," label = data[l - (i + 1)];"," } "," return label;"," },",""," /**"," * Returns a string corresponding to the first label on an "," * axis."," *"," * @method getMinimumValue"," * @return String"," */"," getMinimumValue: function()"," {"," var data = this.get(\"data\"),"," label = data[0];"," return label;"," },",""," /**"," * Returns a string corresponding to the last label on an "," * axis."," *"," * @method getMaximumValue"," * @return String"," */"," getMaximumValue: function()"," {"," var data = this.get(\"data\"),"," len = data.length - 1,"," label = data[len];"," return label;"," }","});","","Y.CategoryAxis = CategoryAxis;"," ","/**"," * Utility class used for calculating curve points."," *"," * @module charts"," * @submodule charts-base"," * @class CurveUtil"," * @constructor"," */","function CurveUtil()","{","}","","CurveUtil.prototype = {"," /**"," * Creates an array of start, end and control points for splines."," *"," * @method getCurveControlPoints"," * @param {Array} xcoords Collection of x-coordinates used for calculate the curves"," * @param {Array} ycoords Collection of y-coordinates used for calculate the curves"," * @return Object"," * @protected"," */"," getCurveControlPoints: function(xcoords, ycoords) "," {"," var outpoints = [],"," i = 1,"," l = xcoords.length - 1,"," xvals = [],"," yvals = [];"," "," "," // Too few points, need at least two"," if (l < 1) "," {"," return null;"," } "," "," outpoints[0] = {"," startx: xcoords[0], "," starty: ycoords[0],"," endx: xcoords[1],"," endy: ycoords[1]"," };"," "," // Special case, the Bezier should be a straight line"," if (l === 1) "," {"," outpoints[0].ctrlx1 = (2.0*xcoords[0] + xcoords[1])/3.0; "," outpoints[0].ctrly2 = (2.0*ycoords[0] + ycoords[1])/3.0;"," outpoints[0].ctrlx2 = 2.0*outpoints[0].ctrlx1 - xcoords[0];"," outpoints[0].ctrly2 = 2.0*outpoints[0].ctrly1 - ycoords[0];"," return outpoints;"," }",""," for (; i < l; ++i) "," {"," outpoints.push({startx: Math.round(xcoords[i]), starty: Math.round(ycoords[i]), endx: Math.round(xcoords[i+1]), endy: Math.round(ycoords[i+1])});"," xvals[i] = 4.0 * xcoords[i] + 2*xcoords[i+1];"," yvals[i] = 4.0*ycoords[i] + 2*ycoords[i+1];"," }"," "," xvals[0] = xcoords[0] + (2.0 * xcoords[1]);"," xvals[l-1] = (8.0 * xcoords[l-1] + xcoords[l]) / 2.0;"," xvals = this.getControlPoints(xvals.concat());"," yvals[0] = ycoords[0] + (2.0 * ycoords[1]);"," yvals[l-1] = (8.0 * ycoords[l-1] + ycoords[l]) / 2.0; "," yvals = this.getControlPoints(yvals.concat());"," "," for (i = 0; i < l; ++i) "," {"," outpoints[i].ctrlx1 = Math.round(xvals[i]);"," outpoints[i].ctrly1 = Math.round(yvals[i]);"," "," if (i < l-1) "," {"," outpoints[i].ctrlx2 = Math.round(2*xcoords[i+1] - xvals[i+1]);"," outpoints[i].ctrly2 = Math.round(2*ycoords[i+1] - yvals[i+1]);"," }"," else "," {"," outpoints[i].ctrlx2 = Math.round((xcoords[l] + xvals[l-1])/2);"," outpoints[i].ctrly2 = Math.round((ycoords[l] + yvals[l-1])/2);"," }"," }"," "," return outpoints; "," },",""," /**"," * Gets the control points for the curve."," *"," * @method getControlPoints"," * @param {Array} vals Collection of values coords used to generate control points."," * @return Array"," * @private"," */"," getControlPoints: function(vals) "," {"," var l = vals.length,"," x = [],"," tmp = [],"," b = 2.0,"," i = 1;"," x[0] = vals[0] / b;"," for (; i < l; ++i) "," {"," tmp[i] = 1/b;"," b = (i < l-1 ? 4.0 : 3.5) - tmp[i];"," x[i] = (vals[i] - x[i-1]) / b;"," }"," "," for (i = 1; i < l; ++i) "," {"," x[l-i-1] -= tmp[l-i] * x[l-i];"," }"," "," return x;"," }","};","Y.CurveUtil = CurveUtil;","/**"," * Utility class used for creating stacked series."," *"," * @module charts"," * @submodule charts-base"," * @class StackingUtil"," * @constructor"," */","function StackingUtil(){}","","StackingUtil.prototype = {"," /**"," * Indicates whether the series is stacked."," *"," * @property _stacked"," * @private"," */"," _stacked: true,",""," /**"," * @protected"," *"," * Adjusts coordinate values for stacked series."," *"," * @method _stackCoordinates"," */"," _stackCoordinates: function() "," {"," if(this.get(\"direction\") == \"vertical\")"," {"," this._stackXCoords();"," }"," else"," {"," this._stackYCoords();"," }"," },",""," /**"," * Stacks coordinates for a stacked vertical series."," *"," * @method _stackXCoords"," * @protected"," */"," _stackXCoords: function()"," {"," var order = this.get(\"order\"),"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," seriesCollection = graph.seriesTypes[type],"," i = 0,"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," len,"," coord,"," prevCoord,"," prevOrder,"," stackedXCoords = xcoords.concat(),"," prevXCoords,"," prevYCoords,"," nullIndices = [],"," nullIndex;"," if(order > 0)"," {"," prevXCoords = seriesCollection[order - 1].get(\"stackedXCoords\");"," prevYCoords = seriesCollection[order - 1].get(\"stackedYCoords\");"," len = prevXCoords.length;"," }"," else"," {"," len = xcoords.length;"," }"," for(; i < len; i = i + 1)"," {"," if(Y_Lang.isNumber(xcoords[i]))"," {"," if(order > 0)"," {"," prevCoord = prevXCoords[i];"," if(!Y_Lang.isNumber(prevCoord))"," {"," prevOrder = order;"," while(prevOrder > - 1 && !Y_Lang.isNumber(prevCoord))"," {"," prevOrder = prevOrder - 1;"," if(prevOrder > -1)"," {"," prevCoord = seriesCollection[prevOrder].get(\"stackedXCoords\")[i];"," }"," else"," {"," prevCoord = this._leftOrigin;"," }"," }"," }"," xcoords[i] = xcoords[i] + prevCoord;"," }"," stackedXCoords[i] = xcoords[i];"," }"," else"," {"," nullIndices.push(i);"," }"," }"," this._cleanXNaN(stackedXCoords, ycoords);"," len = nullIndices.length;"," if(len > 0)"," {"," for(i = 0; i < len; i = i + 1)"," {"," nullIndex = nullIndices[i];"," coord = order > 0 ? prevXCoords[nullIndex] : this._leftOrigin;"," stackedXCoords[nullIndex] = Math.max(stackedXCoords[nullIndex], coord);"," }"," }"," this.set(\"stackedXCoords\", stackedXCoords);"," this.set(\"stackedYCoords\", ycoords);"," },",""," /**"," * Stacks coordinates for a stacked horizontal series."," *"," * @method _stackYCoords"," * @protected"," */"," _stackYCoords: function()"," {"," var order = this.get(\"order\"),"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," h = graph.get(\"height\"), "," seriesCollection = graph.seriesTypes[type],"," i = 0,"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," len,"," coord,"," prevCoord,"," prevOrder,"," stackedYCoords = ycoords.concat(),"," prevXCoords,"," prevYCoords,"," nullIndices = [],"," nullIndex;"," if(order > 0)"," {"," prevXCoords = seriesCollection[order - 1].get(\"stackedXCoords\");"," prevYCoords = seriesCollection[order - 1].get(\"stackedYCoords\");"," len = prevYCoords.length;"," }"," else"," {"," len = ycoords.length;"," }"," for(; i < len; i = i + 1)"," {"," if(Y_Lang.isNumber(ycoords[i]))"," {"," if(order > 0)"," {"," prevCoord = prevYCoords[i];"," if(!Y_Lang.isNumber(prevCoord))"," {"," prevOrder = order;"," while(prevOrder > - 1 && !Y_Lang.isNumber(prevCoord))"," {"," prevOrder = prevOrder - 1;"," if(prevOrder > -1)"," {"," prevCoord = seriesCollection[prevOrder].get(\"stackedYCoords\")[i];"," }"," else"," {"," prevCoord = this._bottomOrigin;"," }"," }"," }"," ycoords[i] = prevCoord - (h - ycoords[i]);"," }"," stackedYCoords[i] = ycoords[i];"," }"," else"," {"," nullIndices.push(i);"," }"," }"," this._cleanYNaN(xcoords, stackedYCoords);"," len = nullIndices.length;"," if(len > 0)"," {"," for(i = 0; i < len; i = i + 1)"," {"," nullIndex = nullIndices[i];"," coord = order > 0 ? prevYCoords[nullIndex] : h;"," stackedYCoords[nullIndex] = Math.min(stackedYCoords[nullIndex], coord);"," }"," }"," this.set(\"stackedXCoords\", xcoords);"," this.set(\"stackedYCoords\", stackedYCoords);"," },",""," /**"," * Cleans invalid x-coordinates by calculating their value based on the corresponding y-coordinate, the previous valid x-coordinate with its "," * corresponding y-coordinate and the next valid x-coordinate with its corresponding y-coordinate. If there is no previous or next valid x-coordinate,"," * the value will not be altered."," *"," * @method _cleanXNaN"," * @param {Array} xcoords An array of x-coordinate values"," * @param {Array} ycoords An arry of y-coordinate values"," * @private"," */"," _cleanXNaN: function(xcoords, ycoords)"," {"," var previousValidIndex,"," nextValidIndex,"," previousValidX,"," previousValidY,"," x,"," y,"," nextValidX,"," nextValidY,"," isNumber = Y_Lang.isNumber,"," m,"," i = 0,"," len = ycoords.length;"," for(; i < len; ++i)"," {"," x = xcoords[i];"," y = ycoords[i];"," //if x is invalid, calculate where it should be"," if(!isNumber(x) && i > 0 && i < len - 1)"," {"," previousValidY = ycoords[i - 1];"," //check to see if the previous value is valid"," previousValidX = this._getPreviousValidCoordValue(xcoords, i);"," nextValidY = ycoords[i + 1];"," nextValidX = this._getNextValidCoordValue(xcoords, i);"," //check to see if the next value is valid"," if(isNumber(previousValidX) && isNumber(nextValidX))"," {"," //calculate slope and solve for x"," m = (nextValidY - previousValidY) / (nextValidX - previousValidX);"," xcoords[i] = (y + (m * previousValidX) - previousValidY)/m;"," }"," previousValidIndex = NaN;"," nextValidIndex = NaN;"," }"," }"," },",""," /**"," * Returns the previous valid (numeric) value in an array if available."," *"," * @method _getPreviousValidCoordValue"," * @param {Array} coords Array of values"," * @param {Number} index The index in the array in which to begin searching."," * @return Number"," * @private"," */"," _getPreviousValidCoordValue: function(coords, index)"," {"," var coord,"," isNumber = Y_Lang.isNumber,"," limit = -1;"," while(!isNumber(coord) && index > limit)"," {"," index = index - 1;"," coord = coords[index];"," }"," return coord;"," },",""," /**"," * Returns the next valid (numeric) value in an array if available."," *"," * @method _getNextValidCoordValue"," * @param {Array} coords Array of values"," * @param {Number} index The index in the array in which to begin searching."," * @return Number"," * @private"," */"," _getNextValidCoordValue: function(coords, index)"," {"," var coord,"," isNumber = Y_Lang.isNumber,"," limit = coords.length;"," while(!isNumber(coord) && index < limit)"," {"," index = index + 1;"," coord = coords[index];"," }"," return coord;"," },",""," /**"," * Cleans invalid y-coordinates by calculating their value based on the corresponding x-coordinate, the previous valid y-coordinate with its "," * corresponding x-coordinate and the next valid y-coordinate with its corresponding x-coordinate. If there is no previous or next valid y-coordinate,"," * the value will not be altered."," *"," * @method _cleanYNaN"," * @param {Array} xcoords An array of x-coordinate values"," * @param {Array} ycoords An arry of y-coordinate values"," * @private"," */"," _cleanYNaN: function(xcoords, ycoords)"," {"," var previousValidIndex,"," nextValidIndex,"," previousValidX,"," previousValidY,"," x,"," y,"," nextValidX,"," nextValidY,"," isNumber = Y_Lang.isNumber,"," m,"," i = 0,"," len = xcoords.length;"," for(; i < len; ++i)"," {"," x = xcoords[i];"," y = ycoords[i];"," //if y is invalid, calculate where it should be"," if(!isNumber(y) && i > 0 && i < len - 1)"," {"," //check to see if the previous value is valid"," previousValidX = xcoords[i - 1];"," previousValidY = this._getPreviousValidCoordValue(ycoords, i);"," //check to see if the next value is valid"," nextValidX = xcoords[i + 1];"," nextValidY = this._getNextValidCoordValue(ycoords, i);"," if(isNumber(previousValidY) && isNumber(nextValidY))"," {"," //calculate slope and solve for y"," m = (nextValidY - previousValidY) / (nextValidX - previousValidX);"," ycoords[i] = previousValidY + ((m * x) - (m * previousValidX));"," }"," previousValidIndex = NaN;"," nextValidIndex = NaN;"," }"," }"," }","};","Y.StackingUtil = StackingUtil;","/**"," * Utility class used for drawing lines."," *"," * @module charts"," * @submodule charts-base"," * @class Lines"," * @constructor"," */","function Lines(){}","","Lines.prototype = {"," /**"," * @property _lineDefaults"," * @type Object"," * @private"," */"," _lineDefaults: null,"," "," /**"," * Creates a graphic in which to draw a series."," *"," * @method _getGraphic"," * @return Graphic"," * @private"," */"," _getGraphic: function()"," {"," var graphic = this.get(\"graphic\") || this.get(\"graph\").get(\"graphic\");"," if(!this._lineGraphic)"," {"," this._lineGraphic = graphic.addShape({type: \"path\"});"," }"," this._lineGraphic.clear();"," return this._lineGraphic;"," },"," "," /**"," * Toggles visibility"," *"," * @method _toggleVisible"," * @param {Boolean} visible indicates visibilitye"," * @private"," */"," _toggleVisible: function(visible)"," {"," if(this._lineGraphic)"," {"," this._lineGraphic.set(\"visible\", visible);"," }"," },",""," /**"," * Draws lines for the series."," *"," * @method drawLines"," * @protected"," */"," drawLines: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var isNumber = Y_Lang.isNumber,"," xcoords,"," ycoords,"," direction = this.get(\"direction\"),"," len,"," lastPointValid,"," pointValid,"," noPointsRendered = true,"," lastValidX,"," lastValidY,"," nextX,"," nextY,"," i,"," styles = this.get(\"styles\").line,"," lineType = styles.lineType,"," lc = styles.color || this._getDefaultColor(this.get(\"graphOrder\"), \"line\"),"," lineAlpha = styles.alpha,"," dashLength = styles.dashLength,"," gapSpace = styles.gapSpace,"," connectDiscontinuousPoints = styles.connectDiscontinuousPoints,"," discontinuousType = styles.discontinuousType,"," discontinuousDashLength = styles.discontinuousDashLength,"," discontinuousGapSpace = styles.discontinuousGapSpace,"," path = this._getGraphic();"," if(this._stacked)"," {"," xcoords = this.get(\"stackedXCoords\");"," ycoords = this.get(\"stackedYCoords\");"," }"," else"," {"," xcoords = this.get(\"xcoords\");"," ycoords = this.get(\"ycoords\");"," }"," len = direction === \"vertical\" ? ycoords.length : xcoords.length;"," path.set(\"stroke\", {"," weight: styles.weight, "," color: lc, "," opacity: lineAlpha"," });"," for(i = 0; i < len; i = ++i)"," {"," nextX = xcoords[i];"," nextY = ycoords[i];"," pointValid = isNumber(nextX) && isNumber(nextY); "," if(!pointValid)"," {"," lastPointValid = pointValid;"," continue;"," }"," if(noPointsRendered)"," {"," noPointsRendered = false;"," path.moveTo(nextX, nextY);"," }"," else if(lastPointValid)"," {"," if(lineType != \"dashed\")"," {"," path.lineTo(nextX, nextY);"," }"," else"," {"," this.drawDashedLine(path, lastValidX, lastValidY, nextX, nextY, "," dashLength, "," gapSpace);"," }"," }"," else if(!connectDiscontinuousPoints)"," {"," path.moveTo(nextX, nextY);"," }"," else"," {"," if(discontinuousType != \"solid\")"," {"," this.drawDashedLine(path, lastValidX, lastValidY, nextX, nextY, "," discontinuousDashLength, "," discontinuousGapSpace);"," }"," else"," {"," path.lineTo(nextX, nextY);"," }"," }"," lastValidX = nextX;"," lastValidY = nextY;"," lastPointValid = true;"," }"," path.end();"," },"," "," /**"," * Connects data points with a consistent curve for a series."," * "," * @method drawSpline"," * @protected"," */"," drawSpline: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," curvecoords = this.getCurveControlPoints(xcoords, ycoords),"," len = curvecoords.length,"," cx1,"," cx2,"," cy1,"," cy2,"," x,"," y,"," i = 0,"," styles = this.get(\"styles\").line,"," path = this._getGraphic(),"," lineAlpha = styles.alpha,"," color = styles.color || this._getDefaultColor(this.get(\"graphOrder\"), \"line\");"," path.set(\"stroke\", { "," weight: styles.weight, "," color: color, "," opacity: lineAlpha"," });"," path.moveTo(xcoords[0], ycoords[0]);"," for(; i < len; i = ++i)"," {"," x = curvecoords[i].endx;"," y = curvecoords[i].endy;"," cx1 = curvecoords[i].ctrlx1;"," cx2 = curvecoords[i].ctrlx2;"," cy1 = curvecoords[i].ctrly1;"," cy2 = curvecoords[i].ctrly2;"," path.curveTo(cx1, cy1, cx2, cy2, x, y);"," }"," path.end();"," },",""," /**"," * Draws a dashed line between two points."," * "," * @method drawDashedLine"," * @param {Number} xStart The x position of the start of the line"," * @param {Number} yStart The y position of the start of the line"," * @param {Number} xEnd The x position of the end of the line"," * @param {Number} yEnd The y position of the end of the line"," * @param {Number} dashSize the size of dashes, in pixels"," * @param {Number} gapSize the size of gaps between dashes, in pixels"," * @private"," */"," drawDashedLine: function(path, xStart, yStart, xEnd, yEnd, dashSize, gapSize)"," {"," dashSize = dashSize || 10;"," gapSize = gapSize || 10;"," var segmentLength = dashSize + gapSize,"," xDelta = xEnd - xStart,"," yDelta = yEnd - yStart,"," delta = Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2)),"," segmentCount = Math.floor(Math.abs(delta / segmentLength)),"," radians = Math.atan2(yDelta, xDelta),"," xCurrent = xStart,"," yCurrent = yStart,"," i;"," xDelta = Math.cos(radians) * segmentLength;"," yDelta = Math.sin(radians) * segmentLength;"," "," for(i = 0; i < segmentCount; ++i)"," {"," path.moveTo(xCurrent, yCurrent);"," path.lineTo(xCurrent + Math.cos(radians) * dashSize, yCurrent + Math.sin(radians) * dashSize);"," xCurrent += xDelta;"," yCurrent += yDelta;"," }"," "," path.moveTo(xCurrent, yCurrent);"," delta = Math.sqrt((xEnd - xCurrent) * (xEnd - xCurrent) + (yEnd - yCurrent) * (yEnd - yCurrent));"," "," if(delta > dashSize)"," {"," path.lineTo(xCurrent + Math.cos(radians) * dashSize, yCurrent + Math.sin(radians) * dashSize);"," }"," else if(delta > 0)"," {"," path.lineTo(xCurrent + Math.cos(radians) * delta, yCurrent + Math.sin(radians) * delta);"," }"," "," path.moveTo(xEnd, yEnd);"," },",""," /**"," * Default values for `styles` attribute."," *"," * @method _getLineDefaults"," * @return Object"," * @protected"," */"," _getLineDefaults: function()"," {"," return {"," alpha: 1,"," weight: 6,"," lineType:\"solid\", "," dashLength:10, "," gapSpace:10, "," connectDiscontinuousPoints:true, "," discontinuousType:\"solid\", "," discontinuousDashLength:10, "," discontinuousGapSpace:10"," };"," }","};","Y.augment(Lines, Y.Attribute);","Y.Lines = Lines;","/**"," * Utility class used for drawing area fills."," *"," * @module charts"," * @class Fills"," * @constructor"," */","function Fills(cfg)","{"," var attrs = {"," area: {"," getter: function()"," {"," return this._defaults || this._getAreaDefaults();"," },",""," setter: function(val)"," {"," var defaults = this._defaults || this._getAreaDefaults();"," this._defaults = Y.merge(defaults, val);"," }"," }"," };"," this.addAttrs(attrs, cfg);"," this.get(\"styles\");","}","","Fills.prototype = {"," /**"," * Returns a path shape used for drawing fills."," *"," * @method _getPath"," * @return Path"," * @private"," */"," _getPath: function()"," {"," var path = this._path;"," if(!path)"," {"," path = this.get(\"graph\").get(\"graphic\").addShape({type:\"path\"});"," this._path = path;"," }"," return path;"," },"," "," /**"," * Toggles visibility"," *"," * @method _toggleVisible"," * @param {Boolean} visible indicates visibilitye"," * @private"," */"," _toggleVisible: function(visible)"," { "," if(this._path)"," {"," this._path.set(\"visible\", visible);"," }"," },",""," /**"," * Draws fill"," *"," * @method drawFill"," * @param {Array} xcoords The x-coordinates for the series."," * @param {Array} ycoords The y-coordinates for the series."," * @protected"," */"," drawFill: function(xcoords, ycoords)"," {"," if(xcoords.length < 1) "," {"," return;"," }"," var isNumber = Y_Lang.isNumber,"," len = xcoords.length,"," firstX = xcoords[0],"," firstY = ycoords[0],"," lastValidX = firstX,"," lastValidY = firstY,"," nextX,"," nextY,"," pointValid,"," noPointsRendered = true,"," i = 0,"," styles = this.get(\"styles\").area,"," path = this._getPath(),"," color = styles.color || this._getDefaultColor(this.get(\"graphOrder\"), \"slice\");"," path.clear();"," path.set(\"fill\", {"," color: color, "," opacity: styles.alpha"," });"," path.set(\"stroke\", {weight: 0});"," for(; i < len; i = ++i)"," {"," nextX = xcoords[i];"," nextY = ycoords[i];"," pointValid = isNumber(nextX) && isNumber(nextY); "," if(!pointValid)"," {"," continue;"," }"," if(noPointsRendered)"," {"," this._firstValidX = nextX;"," this._firstValidY = nextY;"," noPointsRendered = false;"," path.moveTo(nextX, nextY);"," }"," else"," {"," path.lineTo(nextX, nextY);"," }"," lastValidX = nextX;"," lastValidY = nextY;"," }"," this._lastValidX = lastValidX;"," this._lastValidY = lastValidY;"," path.end();"," },"," "," /**"," * Draws a fill for a spline"," *"," * @method drawAreaSpline"," * @protected"," */"," drawAreaSpline: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," curvecoords = this.getCurveControlPoints(xcoords, ycoords),"," len = curvecoords.length,"," cx1,"," cx2,"," cy1,"," cy2,"," x,"," y,"," i = 0,"," firstX = xcoords[0],"," firstY = ycoords[0],"," styles = this.get(\"styles\").area,"," path = this._getPath(),"," color = styles.color || this._getDefaultColor(this.get(\"graphOrder\"), \"slice\");"," path.set(\"fill\", {"," color: color, "," opacity: styles.alpha"," });"," path.set(\"stroke\", {weight: 0});"," path.moveTo(firstX, firstY);"," for(; i < len; i = ++i)"," {"," x = curvecoords[i].endx;"," y = curvecoords[i].endy;"," cx1 = curvecoords[i].ctrlx1;"," cx2 = curvecoords[i].ctrlx2;"," cy1 = curvecoords[i].ctrly1;"," cy2 = curvecoords[i].ctrly2;"," path.curveTo(cx1, cy1, cx2, cy2, x, y);"," }"," if(this.get(\"direction\") === \"vertical\")"," {"," path.lineTo(this._leftOrigin, y);"," path.lineTo(this._leftOrigin, firstY);"," }"," else"," {"," path.lineTo(x, this._bottomOrigin);"," path.lineTo(firstX, this._bottomOrigin);"," }"," path.lineTo(firstX, firstY);"," path.end();"," },"," "," /**"," * Draws a a stacked area spline"," *"," * @method drawStackedAreaSpline"," * @protected"," */"," drawStackedAreaSpline: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," curvecoords,"," order = this.get(\"order\"),"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," seriesCollection = graph.seriesTypes[type],"," prevXCoords,"," prevYCoords,"," len,"," cx1,"," cx2,"," cy1,"," cy2,"," x,"," y,"," i = 0,"," firstX,"," firstY,"," styles = this.get(\"styles\").area,"," path = this._getPath(),"," color = styles.color || this._getDefaultColor(this.get(\"graphOrder\"), \"slice\");"," firstX = xcoords[0];"," firstY = ycoords[0];"," curvecoords = this.getCurveControlPoints(xcoords, ycoords);"," len = curvecoords.length;"," path.set(\"fill\", {"," color: color, "," opacity: styles.alpha"," });"," path.set(\"stroke\", {weight: 0});"," path.moveTo(firstX, firstY);"," for(; i < len; i = ++i)"," {"," x = curvecoords[i].endx;"," y = curvecoords[i].endy;"," cx1 = curvecoords[i].ctrlx1;"," cx2 = curvecoords[i].ctrlx2;"," cy1 = curvecoords[i].ctrly1;"," cy2 = curvecoords[i].ctrly2;"," path.curveTo(cx1, cy1, cx2, cy2, x, y);"," }"," if(order > 0)"," {"," prevXCoords = seriesCollection[order - 1].get(\"xcoords\").concat().reverse();"," prevYCoords = seriesCollection[order - 1].get(\"ycoords\").concat().reverse();"," curvecoords = this.getCurveControlPoints(prevXCoords, prevYCoords);"," i = 0;"," len = curvecoords.length;"," path.lineTo(prevXCoords[0], prevYCoords[0]);"," for(; i < len; i = ++i)"," {"," x = curvecoords[i].endx;"," y = curvecoords[i].endy;"," cx1 = curvecoords[i].ctrlx1;"," cx2 = curvecoords[i].ctrlx2;"," cy1 = curvecoords[i].ctrly1;"," cy2 = curvecoords[i].ctrly2;"," path.curveTo(cx1, cy1, cx2, cy2, x, y);"," }"," }"," else"," {"," if(this.get(\"direction\") === \"vertical\")"," {"," path.lineTo(this._leftOrigin, ycoords[ycoords.length-1]);"," path.lineTo(this._leftOrigin, firstY);"," }"," else"," {"," path.lineTo(xcoords[xcoords.length-1], this._bottomOrigin);"," path.lineTo(firstX, this._bottomOrigin);"," }",""," }"," path.lineTo(firstX, firstY);"," path.end();"," },"," "," /**"," * Storage for default area styles."," *"," * @property _defaults"," * @type Object"," * @private"," */"," _defaults: null,",""," /**"," * Concatenates coordinate array with correct coordinates for closing an area fill."," *"," * @method _getClosingPoints"," * @return Array"," * @protected"," */"," _getClosingPoints: function()"," {"," var xcoords = this.get(\"xcoords\").concat(),"," ycoords = this.get(\"ycoords\").concat(),"," firstValidIndex,"," lastValidIndex;"," if(this.get(\"direction\") === \"vertical\")"," {"," lastValidIndex = this._getLastValidIndex(xcoords);"," firstValidIndex = this._getFirstValidIndex(xcoords);"," ycoords.push(ycoords[lastValidIndex]);"," ycoords.push(ycoords[firstValidIndex]);"," xcoords.push(this._leftOrigin);"," xcoords.push(this._leftOrigin);"," }"," else"," {"," lastValidIndex = this._getLastValidIndex(ycoords);"," firstValidIndex = this._getFirstValidIndex(ycoords);"," xcoords.push(xcoords[lastValidIndex]);"," xcoords.push(xcoords[firstValidIndex]);"," ycoords.push(this._bottomOrigin);"," ycoords.push(this._bottomOrigin);"," }"," xcoords.push(xcoords[0]);"," ycoords.push(ycoords[0]);"," return [xcoords, ycoords];"," },",""," /**"," * Returns the order of the series closest to the current series that has a valid value for the current index."," *"," * @method _getHighestValidOrder"," * @param {Array} seriesCollection Array of series of a given type."," * @param {Number} index Index of the series item."," * @param {Number} order Index of the the series in the seriesCollection"," * @param {String} direction Indicates the direction of the series"," * @return Number"," * @private"," */"," _getHighestValidOrder: function(seriesCollection, index, order, direction)"," {"," var coords = direction == \"vertical\" ? \"stackedXCoords\" : \"stackedYCoords\","," coord;"," while(isNaN(coord) && order > -1)"," {"," order = order - 1;"," if(order > -1)"," {"," coord = seriesCollection[order].get(coords)[index];"," }"," }"," return order;"," },"," "," /**"," * Returns an array containing the x and y coordinates for a given series and index."," *"," * @method _getCoordsByOrderAndIndex"," * @param {Array} seriesCollection Array of series of a given type."," * @param {Number} index Index of the series item."," * @param {Number} order Index of the the series in the seriesCollection"," * @param {String} direction Indicates the direction of the series"," * @return Array"," * @private"," */"," _getCoordsByOrderAndIndex: function(seriesCollection, index, order, direction)"," {"," var xcoord,"," ycoord;"," if(direction == \"vertical\")"," {"," xcoord = order < 0 ? this._leftOrigin : seriesCollection[order].get(\"stackedXCoords\")[index];"," ycoord = this.get(\"stackedYCoords\")[index];"," }"," else"," {"," xcoord = this.get(\"stackedXCoords\")[index];"," ycoord = order < 0 ? this._bottomOrigin : seriesCollection[order].get(\"stackedYCoords\")[index];"," }"," return [xcoord, ycoord];"," },"," "," /**"," * Concatenates coordinate array with the correct coordinates for closing an area stack."," *"," * @method _getStackedClosingPoints"," * @return Array"," * @protected"," */"," _getStackedClosingPoints: function()"," {"," var order = this.get(\"order\"),"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," direction = this.get(\"direction\"),"," seriesCollection = graph.seriesTypes[type],"," firstValidIndex,"," lastValidIndex,"," xcoords = this.get(\"stackedXCoords\"),"," ycoords = this.get(\"stackedYCoords\"),"," limit,"," previousSeries,"," previousSeriesFirstValidIndex,"," previousSeriesLastValidIndex,"," previousXCoords,"," previousYCoords,"," coords,"," closingXCoords,"," closingYCoords,"," currentIndex,"," highestValidOrder,"," oldOrder;"," if(order < 1)"," { "," return this._getClosingPoints();"," }"," "," previousSeries = seriesCollection[order - 1];"," previousXCoords = previousSeries.get(\"stackedXCoords\").concat();"," previousYCoords = previousSeries.get(\"stackedYCoords\").concat();"," if(direction == \"vertical\")"," {"," firstValidIndex = this._getFirstValidIndex(xcoords);"," lastValidIndex = this._getLastValidIndex(xcoords);"," previousSeriesFirstValidIndex = previousSeries._getFirstValidIndex(previousXCoords);"," previousSeriesLastValidIndex = previousSeries._getLastValidIndex(previousXCoords);"," }"," else"," {"," firstValidIndex = this._getFirstValidIndex(ycoords);"," lastValidIndex = this._getLastValidIndex(ycoords);"," previousSeriesFirstValidIndex = previousSeries._getFirstValidIndex(previousYCoords);"," previousSeriesLastValidIndex = previousSeries._getLastValidIndex(previousYCoords);"," }"," if(previousSeriesLastValidIndex >= firstValidIndex && previousSeriesFirstValidIndex <= lastValidIndex)"," {"," previousSeriesFirstValidIndex = Math.max(firstValidIndex, previousSeriesFirstValidIndex);"," previousSeriesLastValidIndex = Math.min(lastValidIndex, previousSeriesLastValidIndex);"," previousXCoords = previousXCoords.slice(previousSeriesFirstValidIndex, previousSeriesLastValidIndex + 1);"," previousYCoords = previousYCoords.slice(previousSeriesFirstValidIndex, previousSeriesLastValidIndex + 1);"," limit = previousSeriesFirstValidIndex;"," }"," else"," {"," limit = lastValidIndex;"," }",""," closingXCoords = [xcoords[firstValidIndex]];"," closingYCoords = [ycoords[firstValidIndex]];"," currentIndex = firstValidIndex;"," while((isNaN(highestValidOrder) || highestValidOrder < order - 1) && currentIndex <= limit)"," {"," oldOrder = highestValidOrder;"," highestValidOrder = this._getHighestValidOrder(seriesCollection, currentIndex, order, direction);"," if(!isNaN(oldOrder) && highestValidOrder > oldOrder)"," {"," coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, oldOrder, direction);"," closingXCoords.push(coords[0]);"," closingYCoords.push(coords[1]);"," }"," coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, highestValidOrder, direction);"," closingXCoords.push(coords[0]);"," closingYCoords.push(coords[1]);"," currentIndex = currentIndex + 1;"," }"," if(previousXCoords && previousXCoords.length > 0 && previousSeriesLastValidIndex > firstValidIndex && previousSeriesFirstValidIndex < lastValidIndex)"," {"," closingXCoords = closingXCoords.concat(previousXCoords);"," closingYCoords = closingYCoords.concat(previousYCoords);"," highestValidOrder = order -1; "," }"," currentIndex = Math.max(firstValidIndex, previousSeriesLastValidIndex);"," order = order - 1;"," highestValidOrder = NaN;"," while(currentIndex <= lastValidIndex)"," {"," oldOrder = highestValidOrder;"," highestValidOrder = this._getHighestValidOrder(seriesCollection, currentIndex, order, direction);"," if(!isNaN(oldOrder))"," {"," if(highestValidOrder > oldOrder)"," {"," coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, oldOrder, direction);"," closingXCoords.push(coords[0]);"," closingYCoords.push(coords[1]);"," }"," else if(highestValidOrder < oldOrder)"," {"," coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex - 1, highestValidOrder, direction);"," closingXCoords.push(coords[0]);"," closingYCoords.push(coords[1]);"," }"," }"," coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, highestValidOrder, direction);"," closingXCoords.push(coords[0]);"," closingYCoords.push(coords[1]);"," currentIndex = currentIndex + 1;"," }",""," closingXCoords.reverse();"," closingYCoords.reverse();"," return [xcoords.concat(closingXCoords), ycoords.concat(closingYCoords)];"," },",""," /**"," * Returns default values for area styles."," *"," * @method _getAreaDefaults"," * @return Object"," * @private"," */"," _getAreaDefaults: function()"," {"," return {"," };"," }","};","Y.augment(Fills, Y.Attribute);","Y.Fills = Fills;","/**"," * Utility class used for drawing markers."," *"," * @module charts"," * @submodule charts-base"," * @class Plots"," * @constructor"," */","function Plots(cfg)","{"," var attrs = { "," markers: {"," getter: function()"," {"," return this._markers;"," }"," }"," };"," this.addAttrs(attrs, cfg);","}","","Plots.prototype = {"," /**"," * Storage for default marker styles."," *"," * @property _plotDefaults"," * @type Object"," * @private"," */"," _plotDefaults: null,",""," /**"," * Draws the markers"," *"," * @method drawPlots"," * @protected"," */"," drawPlots: function()"," {"," if(!this.get(\"xcoords\") || this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var isNumber = Y_Lang.isNumber,"," style = Y.clone(this.get(\"styles\").marker),"," w = style.width,"," h = style.height,"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," i = 0,"," len = xcoords.length,"," top = ycoords[0],"," left,"," marker,"," offsetWidth = w/2,"," offsetHeight = h/2,"," xvalues,"," yvalues,"," fillColors = null,"," borderColors = null,"," graphOrder = this.get(\"graphOrder\"),"," groupMarkers = this.get(\"groupMarkers\");"," if(groupMarkers)"," {"," xvalues = [];"," yvalues = [];"," for(; i < len; ++i)"," {"," xvalues.push(parseFloat(xcoords[i] - offsetWidth));"," yvalues.push(parseFloat(ycoords[i] - offsetHeight));"," }"," this._createGroupMarker({"," xvalues: xvalues,"," yvalues: yvalues,"," fill: style.fill,"," border: style.border,"," dimensions: {"," width: w,"," height: h"," },"," graphOrder: graphOrder,"," shape: style.shape"," });"," return;"," }"," if(Y_Lang.isArray(style.fill.color))"," {"," fillColors = style.fill.color.concat(); "," }"," if(Y_Lang.isArray(style.border.color))"," {"," borderColors = style.border.color.concat();"," }"," this._createMarkerCache();"," for(; i < len; ++i)"," {"," top = parseFloat(ycoords[i] - offsetHeight);"," left = parseFloat(xcoords[i] - offsetWidth); "," if(!isNumber(left) || !isNumber(top))"," {"," this._markers.push(null);"," continue;"," }"," if(fillColors)"," {"," style.fill.color = fillColors[i % fillColors.length];"," }"," if(borderColors)"," {"," style.border.color = borderColors[i % borderColors.length];"," }",""," style.x = left;"," style.y = top;"," marker = this.getMarker(style, graphOrder, i);"," }"," this._clearMarkerCache();"," },",""," /**"," * Pre-defined group shapes."," *"," * @property _groupShapes"," * @private"," */"," _groupShapes: {"," circle: Y.CircleGroup,"," rect: Y.RectGroup,"," ellipse: Y.EllipseGroup,"," diamond: Y.DiamondGroup"," },",""," /**"," * Returns the correct group shape class."," *"," * @method _getGroupShape"," * @param {Shape | String} shape Indicates which shape class. "," * @return Function"," * @protected"," */"," _getGroupShape: function(shape)"," {"," if(Y_Lang.isString(shape))"," {"," shape = this._groupShapes[shape];"," }"," return shape;"," },",""," /**"," * Gets the default values for series that use the utility. This method is used by"," * the class' `styles` attribute's getter to get build default values."," *"," * @method _getPlotDefaults"," * @return Object"," * @protected"," */"," _getPlotDefaults: function()"," {"," var defs = {"," fill:{"," type: \"solid\","," alpha: 1,"," colors:null,"," alphas: null,"," ratios: null"," },"," border:{"," weight: 1,"," alpha: 1"," },"," width: 10,"," height: 10,"," shape: \"circle\""," };"," defs.fill.color = this._getDefaultColor(this.get(\"graphOrder\"), \"fill\");"," defs.border.color = this._getDefaultColor(this.get(\"graphOrder\"), \"border\");"," return defs;"," },",""," /**"," * Collection of markers to be used in the series."," *"," * @property _markers"," * @type Array"," * @private"," */"," _markers: null,",""," /**"," * Collection of markers to be re-used on a series redraw."," *"," * @property _markerCache"," * @type Array"," * @private"," */"," _markerCache: null,"," "," /**"," * Gets and styles a marker. If there is a marker in cache, it will use it. Otherwise"," * it will create one."," *"," * @method getMarker"," * @param {Object} styles Hash of style properties."," * @param {Number} order Order of the series."," * @param {Number} index Index within the series associated with the marker."," * @return Shape"," * @protected"," */"," getMarker: function(styles, order, index)"," {"," var marker,"," border = styles.border;"," styles.id = this.get(\"chart\").get(\"id\") + \"_\" + order + \"_\" + index;"," //fix name differences between graphic layer"," border.opacity = border.alpha;"," styles.stroke = border;"," styles.fill.opacity = styles.fill.alpha;"," if(this._markerCache.length > 0)"," {"," while(!marker)"," {"," if(this._markerCache.length < 1)"," {"," marker = this._createMarker(styles, order, index);"," break;"," }"," marker = this._markerCache.shift();",""," }"," marker.set(styles);"," }"," else"," {"," marker = this._createMarker(styles, order, index);"," }"," this._markers.push(marker);"," return marker;"," },"," "," /**"," * Creates a shape to be used as a marker."," *"," * @method _createMarker"," * @param {Object} styles Hash of style properties."," * @param {Number} order Order of the series."," * @param {Number} index Index within the series associated with the marker."," * @return Shape"," * @private"," */"," _createMarker: function(styles, order, index)"," {"," var graphic = this.get(\"graphic\"),"," marker,"," cfg = Y.clone(styles);"," graphic.set(\"autoDraw\", false);"," cfg.type = cfg.shape;"," marker = graphic.addShape(cfg); "," marker.addClass(SERIES_MARKER);"," return marker;"," },"," "," /**"," * Creates a cache of markers for reuse."," *"," * @method _createMarkerCache"," * @private"," */"," _createMarkerCache: function()"," {"," if(this._groupMarker)"," {"," this._groupMarker.destroy();"," this._groupMarker = null;"," }"," if(this._markers && this._markers.length > 0)"," {"," this._markerCache = this._markers.concat();"," }"," else"," {"," this._markerCache = [];"," }"," this._markers = [];"," },"," "," /**"," * Draws a series of markers in a single shape instance."," *"," * @method _createGroupMarkers"," * @param {Object} styles Set of configuration properties used to create the markers."," * @protected"," */"," _createGroupMarker: function(styles)"," {"," var marker,"," markers = this.get(\"markers\"),"," border = styles.border,"," graphic,"," cfg,"," shape;"," if(markers && markers.length > 0)"," {"," while(markers.length > 0)"," {"," marker = markers.shift();"," marker.destroy();"," }"," this.set(\"markers\", []);"," }"," //fix name differences between graphic layer"," border.opacity = border.alpha;"," cfg = {"," id: this.get(\"chart\").get(\"id\") + \"_\" + styles.graphOrder,"," stroke: border,"," fill: styles.fill,"," dimensions: styles.dimensions,"," xvalues: styles.xvalues,"," yvalues: styles.yvalues"," };"," cfg.fill.opacity = styles.fill.alpha;"," shape = this._getGroupShape(styles.shape);"," if(shape)"," {"," cfg.type = shape;"," }"," if(styles.hasOwnProperty(\"radius\") && !isNaN(styles.radius))"," {"," cfg.dimensions.radius = styles.radius;"," }"," if(this._groupMarker)"," {"," this._groupMarker.destroy();"," }"," graphic = this.get(\"graphic\");"," this._groupMarker = graphic.addShape(cfg);"," graphic._redraw();"," },",""," /**"," * Toggles visibility"," *"," * @method _toggleVisible"," * @param {Boolean} visible indicates visibilitye"," * @private"," */"," _toggleVisible: function(visible)"," {"," var marker,"," markers = this.get(\"markers\"),"," i = 0,"," len;"," if(markers)"," {"," len = markers.length;"," for(; i < len; ++i)"," {"," marker = markers[i];"," if(marker)"," {"," marker.set(\"visible\", visible);"," }"," }"," }"," },",""," /**"," * Removes unused markers from the marker cache"," *"," * @method _clearMarkerCache"," * @private"," */"," _clearMarkerCache: function()"," {"," var marker;"," while(this._markerCache.length > 0)"," {"," marker = this._markerCache.shift();"," if(marker)"," {"," marker.destroy();"," }"," }"," },",""," /**"," * Resizes and positions markers based on a mouse interaction."," *"," * @method updateMarkerState"," * @param {String} type state of the marker"," * @param {Number} i index of the marker"," * @protected"," */"," updateMarkerState: function(type, i)"," {"," if(this._markers && this._markers[i])"," {"," var w,"," h,"," styles = Y.clone(this.get(\"styles\").marker),"," state = this._getState(type),"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," marker = this._markers[i],"," markerStyles = state == \"off\" || !styles[state] ? styles : styles[state]; "," markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);"," markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);"," markerStyles.stroke = markerStyles.border;"," marker.set(markerStyles);"," w = markerStyles.width;"," h = markerStyles.height;"," marker.set(\"x\", (xcoords[i] - w/2));"," marker.set(\"y\", (ycoords[i] - h/2));"," marker.set(\"visible\", this.get(\"visible\"));"," }"," },",""," /**"," * Parses a color from an array."," *"," * @method _getItemColor"," * @param {Array} val collection of colors"," * @param {Number} i index of the item"," * @return String"," * @protected"," */"," _getItemColor: function(val, i)"," {"," if(Y_Lang.isArray(val))"," {"," return val[i % val.length];"," }"," return val;"," },",""," /**"," * Method used by `styles` setter. Overrides base implementation."," *"," * @method _setStyles"," * @param {Object} newStyles Hash of properties to update."," * @return Object"," * @protected"," */"," _setStyles: function(val)"," {"," val = this._parseMarkerStyles(val);"," return Y.Renderer.prototype._setStyles.apply(this, [val]);"," },",""," /**"," * Combines new styles with existing styles."," *"," * @method _parseMarkerStyles"," * @param {Object} Object containing style properties for the marker."," * @return Object"," * @private"," */"," _parseMarkerStyles: function(val)"," {"," if(val.marker)"," {"," var defs = this._getPlotDefaults();"," val.marker = this._mergeStyles(val.marker, defs);"," if(val.marker.over)"," {"," val.marker.over = this._mergeStyles(val.marker.over, val.marker);"," }"," if(val.marker.down)"," {"," val.marker.down = this._mergeStyles(val.marker.down, val.marker);"," }"," }"," return val;"," },",""," /**"," * Returns marker state based on event type"," *"," * @method _getState"," * @param {String} type event type"," * @return String"," * @protected"," */"," _getState: function(type)"," {"," var state;"," switch(type)"," {"," case \"mouseout\" :"," state = \"off\";"," break;"," case \"mouseover\" :"," state = \"over\";"," break;"," case \"mouseup\" :"," state = \"over\";"," break;"," case \"mousedown\" :"," state = \"down\";"," break;"," }"," return state;"," },"," "," /**"," * @property _statSyles"," * @type Object"," * @private"," */"," _stateSyles: null","};","","Y.augment(Plots, Y.Attribute);","Y.Plots = Plots;","/**"," * Histogram is the base class for Column and Bar series."," *"," * @module charts"," * @submodule charts-base"," * @class Histogram"," * @constructor"," */","function Histogram(){}","","Histogram.prototype = {"," /**"," * Draws the series."," *"," * @method drawSeries"," * @protected"," */"," drawSeries: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var style = Y.clone(this.get(\"styles\").marker),"," setSize,"," calculatedSize,"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," i = 0,"," len = xcoords.length,"," top = ycoords[0],"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," seriesCollection = graph.seriesTypes[type],"," seriesLen = seriesCollection.length,"," seriesSize = 0,"," totalSize = 0,"," offset = 0,"," ratio,"," renderer,"," order = this.get(\"order\"),"," graphOrder = this.get(\"graphOrder\"),"," left,"," marker,"," setSizeKey,"," calculatedSizeKey,"," config,"," fillColors = null,"," borderColors = null,"," xMarkerPlane = [],"," yMarkerPlane = [],"," xMarkerPlaneLeft,"," xMarkerPlaneRight,"," yMarkerPlaneTop,"," yMarkerPlaneBottom,"," dimensions = {"," width: [],"," height: []"," },"," xvalues = [],"," yvalues = [],"," groupMarkers = this.get(\"groupMarkers\");"," if(Y_Lang.isArray(style.fill.color))"," {"," fillColors = style.fill.color.concat(); "," }"," if(Y_Lang.isArray(style.border.color))"," {"," borderColors = style.border.color.concat();"," }"," if(this.get(\"direction\") == \"vertical\")"," {"," setSizeKey = \"height\";"," calculatedSizeKey = \"width\";"," }"," else"," {"," setSizeKey = \"width\";"," calculatedSizeKey = \"height\";"," }"," setSize = style[setSizeKey];"," calculatedSize = style[calculatedSizeKey];"," this._createMarkerCache();"," for(; i < seriesLen; ++i)"," {"," renderer = seriesCollection[i];"," seriesSize += renderer.get(\"styles\").marker[setSizeKey];"," if(order > i) "," {"," offset = seriesSize;"," }"," }"," totalSize = len * seriesSize;"," this._maxSize = graph.get(setSizeKey);"," if(totalSize > this._maxSize)"," {"," ratio = graph.get(setSizeKey)/totalSize;"," seriesSize *= ratio;"," offset *= ratio;"," setSize *= ratio;"," setSize = Math.max(setSize, 1);"," this._maxSize = setSize;"," }"," offset -= seriesSize/2;"," for(i = 0; i < len; ++i)"," {"," xMarkerPlaneLeft = xcoords[i] - seriesSize/2;"," xMarkerPlaneRight = xMarkerPlaneLeft + seriesSize;"," yMarkerPlaneTop = ycoords[i] - seriesSize/2;"," yMarkerPlaneBottom = yMarkerPlaneTop + seriesSize;"," xMarkerPlane.push({start: xMarkerPlaneLeft, end: xMarkerPlaneRight});"," yMarkerPlane.push({start: yMarkerPlaneTop, end: yMarkerPlaneBottom});"," if(isNaN(xcoords[i]) || isNaN(ycoords[i]))"," {"," this._markers.push(null);"," continue;"," }"," config = this._getMarkerDimensions(xcoords[i], ycoords[i], calculatedSize, offset);"," if(!isNaN(config.calculatedSize) && config.calculatedSize > 0)"," {"," top = config.top;"," left = config.left;",""," if(groupMarkers)"," {"," dimensions[setSizeKey][i] = setSize;"," dimensions[calculatedSizeKey][i] = config.calculatedSize;"," xvalues.push(left);"," yvalues.push(top);"," }"," else"," {"," style[setSizeKey] = setSize;"," style[calculatedSizeKey] = config.calculatedSize;"," style.x = left;"," style.y = top;"," if(fillColors)"," {"," style.fill.color = fillColors[i % fillColors.length];"," }"," if(borderColors)"," {"," style.border.color = borderColors[i % borderColors.length];"," }"," marker = this.getMarker(style, graphOrder, i);"," }",""," }"," else if(!groupMarkers)"," {"," this._markers.push(null);"," }"," }"," this.set(\"xMarkerPlane\", xMarkerPlane);"," this.set(\"yMarkerPlane\", yMarkerPlane);"," if(groupMarkers)"," {"," this._createGroupMarker({"," fill: style.fill,"," border: style.border,"," dimensions: dimensions,"," xvalues: xvalues,"," yvalues: yvalues,"," shape: style.shape"," });"," }"," else"," {"," this._clearMarkerCache();"," }"," },"," "," /**"," * Collection of default colors used for marker fills in a series when not specified by user."," *"," * @property _defaultFillColors"," * @type Array"," * @protected"," */"," _defaultFillColors: [\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"],"," "," /**"," * Gets the default style values for the markers."," *"," * @method _getPlotDefaults"," * @return Object"," * @private"," */"," _getPlotDefaults: function()"," {"," var defs = {"," fill:{"," type: \"solid\","," alpha: 1,"," colors:null,"," alphas: null,"," ratios: null"," },"," border:{"," weight: 0,"," alpha: 1"," },"," width: 12,"," height: 12,"," shape: \"rect\",",""," padding:{"," top: 0,"," left: 0,"," right: 0,"," bottom: 0"," }"," };"," defs.fill.color = this._getDefaultColor(this.get(\"graphOrder\"), \"fill\");"," defs.border.color = this._getDefaultColor(this.get(\"graphOrder\"), \"border\");"," return defs;"," }","};","","Y.Histogram = Histogram;","/**"," * The CartesianSeries class creates a chart with horizontal and vertical axes."," *"," * @module charts"," * @submodule charts-base"," * @class CartesianSeries"," * @extends Base"," * @uses Renderer"," * @constructor"," */","Y.CartesianSeries = Y.Base.create(\"cartesianSeries\", Y.Base, [Y.Renderer], {"," /**"," * Storage for `xDisplayName` attribute."," *"," * @property _xDisplayName"," * @type String"," * @private"," */"," _xDisplayName: null,",""," /**"," * Storage for `yDisplayName` attribute."," *"," * @property _yDisplayName"," * @type String"," * @private"," */"," _yDisplayName: null,"," "," /**"," * Th x-coordinate for the left edge of the series."," *"," * @property _leftOrigin"," * @type String"," * @private"," */"," _leftOrigin: null,",""," /**"," * The y-coordinate for the bottom edge of the series."," * "," * @property _bottomOrigin"," * @type String"," * @private"," */"," _bottomOrigin: null,",""," /**"," * @method render"," * @private"," */"," render: function()"," {"," this._setCanvas();"," this.addListeners();"," this.set(\"rendered\", true);"," this.validate();"," },",""," /**"," * Adds event listeners."," *"," * @method addListeners"," * @private"," */"," addListeners: function()"," {"," var xAxis = this.get(\"xAxis\"),"," yAxis = this.get(\"yAxis\");"," if(xAxis)"," {"," this._xDataReadyHandle = xAxis.after(\"dataReady\", Y.bind(this._xDataChangeHandler, this));"," this._xDataUpdateHandle = xAxis.after(\"dataUpdate\", Y.bind(this._xDataChangeHandler, this));"," }"," if(yAxis)"," {"," this._yDataReadyHandle = yAxis.after(\"dataReady\", Y.bind(this._yDataChangeHandler, this));"," this._yDataUpdateHandle = yAxis.after(\"dataUpdate\", Y.bind(this._yDataChangeHandler, this));"," }"," this._xAxisChangeHandle = this.after(\"xAxisChange\", this._xAxisChangeHandler);"," this._yAxisChangeHandle = this.after(\"yAxisChange\", this._yAxisChangeHandler);"," this._stylesChangeHandle = this.after(\"stylesChange\", function(e) {"," var axesReady = this._updateAxisData();"," if(axesReady)"," {"," this.draw();"," }"," });"," this._widthChangeHandle = this.after(\"widthChange\", function(e) {"," var axesReady = this._updateAxisData();"," if(axesReady)"," {"," this.draw();"," }"," });"," this._heightChangeHandle = this.after(\"heightChange\", function(e) {"," var axesReady = this._updateAxisData();"," if(axesReady)"," {"," this.draw();"," }"," });"," this._visibleChangeHandle = this.after(\"visibleChange\", this._handleVisibleChange);"," },"," "," /**"," * Event handler for the xAxisChange event."," *"," * @method _xAxisChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _xAxisChangeHandler: function(e)"," {"," var xAxis = this.get(\"xAxis\");"," xAxis.after(\"dataReady\", Y.bind(this._xDataChangeHandler, this));"," xAxis.after(\"dataUpdate\", Y.bind(this._xDataChangeHandler, this));"," },"," "," /**"," * Event handler the yAxisChange event."," *"," * @method _yAxisChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _yAxisChangeHandler: function(e)"," {"," var yAxis = this.get(\"yAxis\");"," yAxis.after(\"dataReady\", Y.bind(this._yDataChangeHandler, this));"," yAxis.after(\"dataUpdate\", Y.bind(this._yDataChangeHandler, this));"," },",""," /**"," * Constant used to generate unique id."," *"," * @property GUID"," * @type String"," * @private"," */"," GUID: \"yuicartesianseries\",",""," /**"," * Event handler for xDataChange event."," *"," * @method _xDataChangeHandler"," * @param {Object} event Event object."," * @private "," */"," _xDataChangeHandler: function(event)"," {"," var axesReady = this._updateAxisData();"," if(axesReady)"," {"," this.draw();"," }"," },",""," /**"," * Event handler for yDataChange event."," *"," * @method _yDataChangeHandler"," * @param {Object} event Event object."," * @private "," */"," _yDataChangeHandler: function(event)"," {"," var axesReady = this._updateAxisData();"," if(axesReady)"," {"," this.draw();"," }"," },",""," /**"," * Checks to ensure that both xAxis and yAxis data are available. If so, set the `xData` and `yData` attributes and return `true`. Otherwise, return `false`."," *"," * @method _updateAxisData"," * @return Boolean"," * @private "," */"," _updateAxisData: function()"," {"," var xAxis = this.get(\"xAxis\"),"," yAxis = this.get(\"yAxis\"),"," xKey = this.get(\"xKey\"),"," yKey = this.get(\"yKey\"),"," yData,"," xData;"," if(!xAxis || !yAxis || !xKey || !yKey)"," {"," return false;"," }"," xData = xAxis.getDataByKey(xKey);"," yData = yAxis.getDataByKey(yKey);"," if(!xData || !yData)"," {"," return false;"," }"," this.set(\"xData\", xData.concat());"," this.set(\"yData\", yData.concat());"," return true;"," },",""," /**"," * Draws the series is the xAxis and yAxis data are both available."," *"," * @method validate"," * @private"," */"," validate: function()"," {"," if((this.get(\"xData\") && this.get(\"yData\")) || this._updateAxisData())"," {"," this.draw();"," }"," else"," {"," this.fire(\"drawingComplete\");"," }"," },",""," /**"," * Creates a `Graphic` instance."," *"," * @method _setCanvas"," * @protected"," */"," _setCanvas: function()"," {"," var graph = this.get(\"graph\"),"," graphic = graph.get(\"graphic\");"," this.set(\"graphic\", graphic);"," },",""," /**"," * Calculates the coordinates for the series."," *"," * @method setAreaData"," * @protected"," */"," setAreaData: function()"," {"," var isNumber = Y_Lang.isNumber,"," nextX, nextY,"," graph = this.get(\"graph\"),"," w = graph.get(\"width\"),"," h = graph.get(\"height\"),"," xAxis = this.get(\"xAxis\"),"," yAxis = this.get(\"yAxis\"),"," xData = this.get(\"xData\").concat(),"," yData = this.get(\"yData\").concat(),"," xValue,"," yValue,"," xOffset = xAxis.getEdgeOffset(xData.length, w),"," yOffset = yAxis.getEdgeOffset(yData.length, h),"," padding = this.get(\"styles\").padding,"," leftPadding = padding.left,"," topPadding = padding.top,"," dataWidth = w - (leftPadding + padding.right + xOffset),"," dataHeight = h - (topPadding + padding.bottom + yOffset),"," xcoords = [],"," ycoords = [],"," xMax = xAxis.get(\"maximum\"),"," xMin = xAxis.get(\"minimum\"),"," yMax = yAxis.get(\"maximum\"),"," yMin = yAxis.get(\"minimum\"),"," xScaleFactor = dataWidth / (xMax - xMin),"," yScaleFactor = dataHeight / (yMax - yMin),"," dataLength,"," direction = this.get(\"direction\"),"," i = 0,"," xMarkerPlane = [],"," yMarkerPlane = [],"," xMarkerPlaneOffset = this.get(\"xMarkerPlaneOffset\"),"," yMarkerPlaneOffset = this.get(\"yMarkerPlaneOffset\"),"," graphic = this.get(\"graphic\");"," graphic.set(\"width\", w);"," graphic.set(\"height\", h);"," dataLength = xData.length;"," xOffset *= 0.5;"," yOffset *= 0.5;"," //Assuming a vertical graph has a range/category for its vertical axis. "," if(direction === \"vertical\")"," {"," yData = yData.reverse();"," }"," this._leftOrigin = Math.round(((0 - xMin) * xScaleFactor) + leftPadding + xOffset);"," this._bottomOrigin = Math.round((dataHeight + topPadding + yOffset)); "," if(yMin < 0)"," {"," this._bottomOrigin = this._bottomOrigin - ((0 - yMin) * yScaleFactor);"," }"," for (; i < dataLength; ++i) "," {"," xValue = parseFloat(xData[i]);"," yValue = parseFloat(yData[i]);"," if(isNumber(xValue))"," {"," nextX = (((xValue - xMin) * xScaleFactor) + leftPadding + xOffset);"," }"," else"," {"," nextX = NaN;"," }"," if(isNumber(yValue))"," {"," nextY = ((dataHeight + topPadding + yOffset) - (yValue - yMin) * yScaleFactor);"," }"," else"," {"," nextY = NaN;"," }"," xcoords.push(nextX);"," ycoords.push(nextY);"," xMarkerPlane.push({start:nextX - xMarkerPlaneOffset, end: nextX + xMarkerPlaneOffset});"," yMarkerPlane.push({start:nextY - yMarkerPlaneOffset, end: nextY + yMarkerPlaneOffset});"," }"," this.set(\"xcoords\", xcoords);"," this.set(\"ycoords\", ycoords);"," this.set(\"xMarkerPlane\", xMarkerPlane);"," this.set(\"yMarkerPlane\", yMarkerPlane);"," this._dataLength = dataLength;"," },",""," /**"," * Finds the first valid index of an array coordinates."," *"," * @method _getFirstValidIndex"," * @param {Array} coords An array of x or y coordinates."," * @return Number"," * @private"," */"," _getFirstValidIndex: function(coords)"," {"," var coord,"," i = -1,"," limit = coords.length;"," while(!Y_Lang.isNumber(coord) && i < limit)"," {"," i += 1;"," coord = coords[i];"," }"," return i;"," },",""," /**"," * Finds the last valid index of an array coordinates."," *"," * @method _getLastValidIndex"," * @param {Array} coords An array of x or y coordinates."," * @return Number"," * @private"," */"," _getLastValidIndex: function(coords)"," {"," var coord,"," i = coords.length,"," limit = -1;"," while(!Y_Lang.isNumber(coord) && i > limit)"," {"," i -= 1;"," coord = coords[i];"," }"," return i;"," },",""," /**"," * Draws the series."," *"," * @method draw"," * @protected"," */"," draw: function()"," {"," var graph = this.get(\"graph\"),"," w = graph.get(\"width\"),"," h = graph.get(\"height\");"," if(this.get(\"rendered\"))"," {"," if((isFinite(w) && isFinite(h) && w > 0 && h > 0) && ((this.get(\"xData\") && this.get(\"yData\")) || this._updateAxisData()))"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," this.setAreaData();"," if(this.get(\"xcoords\") && this.get(\"ycoords\"))"," {"," this.drawSeries();"," }"," this._drawing = false;"," if(this._callLater)"," {"," this.draw();"," }"," else"," {"," this._toggleVisible(this.get(\"visible\"));"," this.fire(\"drawingComplete\");"," }"," }"," }"," },"," "," /**"," * Default value for plane offsets when the parent chart's `interactiveType` is `planar`. "," *"," * @property _defaultPlaneOffset"," * @type Number"," * @private"," */"," _defaultPlaneOffset: 4,"," "," /**"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," * @protected"," */"," _getDefaultStyles: function()"," {"," return {padding:{"," top: 0,"," left: 0,"," right: 0,"," bottom: 0"," }};"," },",""," /**"," * Collection of default colors used for lines in a series when not specified by user."," *"," * @property _defaultLineColors"," * @type Array"," * @protected"," */"," _defaultLineColors:[\"#426ab3\", \"#d09b2c\", \"#000000\", \"#b82837\", \"#b384b5\", \"#ff7200\", \"#779de3\", \"#cbc8ba\", \"#7ed7a6\", \"#007a6c\"],",""," /**"," * Collection of default colors used for marker fills in a series when not specified by user."," *"," * @property _defaultFillColors"," * @type Array"," * @protected"," */"," _defaultFillColors:[\"#6084d0\", \"#eeb647\", \"#6c6b5f\", \"#d6484f\", \"#ce9ed1\", \"#ff9f3b\", \"#93b7ff\", \"#e0ddd0\", \"#94ecba\", \"#309687\"],"," "," /**"," * Collection of default colors used for marker borders in a series when not specified by user."," *"," * @property _defaultBorderColors"," * @type Array"," * @protected"," */"," _defaultBorderColors:[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"],"," "," /**"," * Collection of default colors used for area fills, histogram fills and pie fills in a series when not specified by user."," *"," * @property _defaultSliceColors"," * @type Array"," * @protected"," */"," _defaultSliceColors: [\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"],",""," /**"," * Parses a color based on a series order and type."," *"," * @method _getDefaultColor"," * @param {Number} index Index indicating the series order."," * @param {String} type Indicates which type of object needs the color."," * @return String"," * @protected"," */"," _getDefaultColor: function(index, type)"," {"," var colors = {"," line: this._defaultLineColors,"," fill: this._defaultFillColors,"," border: this._defaultBorderColors,"," slice: this._defaultSliceColors"," },"," col = colors[type],"," l = col.length;"," index = index || 0;"," if(index >= l)"," {"," index = index % l;"," }"," type = type || \"fill\";"," return colors[type][index];"," },"," "," /**"," * Shows/hides contents of the series."," *"," * @method _handleVisibleChange"," * @param {Object} e Event object."," * @protected"," */"," _handleVisibleChange: function(e) "," {"," this._toggleVisible(this.get(\"visible\"));"," },",""," /**"," * Returns the sum of all values for the series."," *"," * @method getTotalValues"," * @return Number"," */"," getTotalValues: function()"," {"," var total = this.get(\"valueAxis\").getTotalByKey(this.get(\"valueKey\"));"," return total;"," },",""," /**"," * Destructor implementation for the CartesianSeries class. Calls destroy on all Graphic instances."," *"," * @method destructor"," * @protected"," */"," destructor: function()"," {"," var marker,"," markers = this.get(\"markers\");"," if(this.get(\"rendered\"))"," {"," if(this._xDataReadyHandle)"," {"," this._xDataReadyHandle.detach();"," }"," if(this._xDataUpdateHandle)"," {"," this._xDataUpdateHandle.detach();"," }"," if(this._yDataReadyHandle)"," {"," this._yDataReadyHandle.detach();"," }"," if(this._yDataUpdateHandle)"," {"," this._yDataUpdateHandle.detach();"," }"," this._xAxisChangeHandle.detach();"," this._yAxisChangeHandle.detach();"," this._stylesChangeHandle.detach();"," this._widthChangeHandle.detach();"," this._heightChangeHandle.detach();"," this._visibleChangeHandle.detach();"," }"," while(markers && markers.length > 0)"," {"," marker = markers.shift();"," if(marker && marker instanceof Y.Shape)"," {"," marker.destroy();"," }"," }"," if(this._path)"," {"," this._path.destroy();"," this._path = null;"," }"," if(this._lineGraphic)"," {"," this._lineGraphic.destroy();"," this._lineGraphic = null;"," }"," if(this._groupMarker)"," {"," this._groupMarker.destroy();"," this._groupMarker = null;"," }"," }"," /**"," * Event handle for the x-axis' dataReady event."," * "," * @property _xDataReadyHandle"," * @type {EventHandle}"," * @private"," */"," "," /**"," * Event handle for the x-axis dataUpdate event."," *"," * @property _xDataUpdateHandle"," * @type {EventHandle}"," * @private"," */"," "," /**"," * Event handle for the y-axis dataReady event."," *"," * @property _yDataReadyHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the y-axis dataUpdate event."," * @property _yDataUpdateHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the xAxisChange event."," * @property _xAxisChangeHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the yAxisChange event."," * @property _yAxisChangeHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the stylesChange event."," * @property _stylesChangeHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the widthChange event."," * @property _widthChangeHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the heightChange event."," * @property _heightChangeHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the visibleChange event."," * @property _visibleChangeHandle"," * @type {EventHandle}"," * @private"," */","}, {"," ATTRS: {"," /**"," * Name used for for displaying data related to the x-coordinate."," *"," * @attribute xDisplayName"," * @type String"," */"," xDisplayName: {"," getter: function()"," {"," return this._xDisplayName || this.get(\"xKey\");"," },",""," setter: function(val)"," {"," this._xDisplayName = val.toString();"," return val;"," }"," },",""," /**"," * Name used for for displaying data related to the y-coordinate."," *"," * @attribute yDisplayName"," * @type String"," */"," yDisplayName: {"," getter: function()"," {"," return this._yDisplayName || this.get(\"yKey\");"," },",""," setter: function(val)"," {"," this._yDisplayName = val.toString();"," return val;"," }"," },"," "," /**"," * Name used for for displaying category data"," *"," * @attribute categoryDisplayName"," * @type String"," * @readOnly"," */"," categoryDisplayName: {"," lazyAdd: false,",""," getter: function()"," {"," return this.get(\"direction\") == \"vertical\" ? this.get(\"yDisplayName\") : this.get(\"xDisplayName\");"," },",""," setter: function(val)"," {"," if(this.get(\"direction\") == \"vertical\")"," {"," this._yDisplayName = val;"," }"," else"," {"," this._xDisplayName = val;"," }"," return val;"," }"," },",""," /**"," * Name used for for displaying value data"," *"," * @attribute valueDisplayName"," * @type String"," * @readOnly"," */"," valueDisplayName: {"," lazyAdd: false,",""," getter: function()"," {"," return this.get(\"direction\") == \"vertical\" ? this.get(\"xDisplayName\") : this.get(\"yDisplayName\");"," },",""," setter: function(val)"," {"," if(this.get(\"direction\") == \"vertical\")"," {"," this._xDisplayName = val;"," }"," else"," {"," this._yDisplayName = val;"," }"," return val;"," }"," },"," "," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default cartesian"," */"," type: { "," value: \"cartesian\""," },",""," /**"," * Order of this instance of this `type`."," *"," * @attribute order"," * @type Number"," */"," order: {},",""," /**"," * Order of the instance"," *"," * @attribute graphOrder"," * @type Number"," */"," graphOrder: {},",""," /**"," * x coordinates for the series."," *"," * @attribute xcoords"," * @type Array"," */"," xcoords: {},"," "," /**"," * y coordinates for the series"," *"," * @attribute ycoords"," * @type Array"," */"," ycoords: {},",""," /**"," * Reference to the `Chart` application."," *"," * @attribute chart"," * @type ChartBase"," * @readOnly"," */"," chart: {"," readOnly: true,",""," getter: function()"," {"," return this.get(\"graph\").get(\"chart\");"," }"," },"," "," /**"," * Reference to the `Graph` in which the series is drawn into."," *"," * @attribute graph"," * @type Graph"," */"," graph: {},",""," /**"," * Reference to the `Axis` instance used for assigning "," * x-values to the graph."," *"," * @attribute xAxis"," * @type Axis"," */"," xAxis: {},"," "," /**"," * Reference to the `Axis` instance used for assigning "," * y-values to the graph."," *"," * @attribute yAxis"," * @type Axis"," */"," yAxis: {},"," "," /**"," * Indicates which array to from the hash of value arrays in "," * the x-axis `Axis` instance."," *"," * @attribute xKey"," * @type String"," */"," xKey: {"," setter: function(val)"," {"," return val.toString();"," }"," },",""," /**"," * Indicates which array to from the hash of value arrays in "," * the y-axis `Axis` instance."," *"," * @attribute yKey"," * @type String"," */"," yKey: {"," setter: function(val)"," {"," return val.toString();"," }"," },",""," /**"," * Array of x values for the series."," *"," * @attribute xData"," * @type Array"," */"," xData: {},",""," /**"," * Array of y values for the series."," *"," * @attribute yData"," * @type Array"," */"," yData: {},"," "," /**"," * Indicates whether the Series has been through its initial set up."," *"," * @attribute rendered"," * @type Boolean"," */"," rendered: {"," value: false"," },",""," /*"," * Returns the width of the parent graph"," *"," * @attribute width"," * @type Number"," */"," width: {"," readOnly: true,"," "," getter: function()"," {"," this.get(\"graph\").get(\"width\");"," }"," },",""," /**"," * Returns the height of the parent graph"," *"," * @attribute height"," * @type Number"," */"," height: {"," readOnly: true,"," "," getter: function()"," {"," this.get(\"graph\").get(\"height\");"," }"," },",""," /**"," * Indicates whether to show the series"," *"," * @attribute visible"," * @type Boolean"," * @default true"," */"," visible: {"," value: true"," },",""," /**"," * Collection of area maps along the xAxis. Used to determine mouseover for multiple"," * series."," *"," * @attribute xMarkerPlane"," * @type Array"," */"," xMarkerPlane: {},"," "," /**"," * Collection of area maps along the yAxis. Used to determine mouseover for multiple"," * series."," *"," * @attribute yMarkerPlane"," * @type Array"," */"," yMarkerPlane: {},",""," /**"," * Distance from a data coordinate to the left/right for setting a hotspot."," *"," * @attribute xMarkerPlaneOffset"," * @type Number"," */"," xMarkerPlaneOffset: {"," getter: function() {"," var marker = this.get(\"styles\").marker;"," if(marker && marker.width && isFinite(marker.width))"," {"," return marker.width * 0.5;"," }"," return this._defaultPlaneOffset;"," }"," },",""," /**"," * Distance from a data coordinate to the top/bottom for setting a hotspot."," *"," * @attribute yMarkerPlaneOffset"," * @type Number"," */"," yMarkerPlaneOffset: {"," getter: function() {"," var marker = this.get(\"styles\").marker;"," if(marker && marker.height && isFinite(marker.height))"," {"," return marker.height * 0.5;"," }"," return this._defaultPlaneOffset;"," }"," },",""," /**"," * Direction of the series"," *"," * @attribute direction"," * @type String"," */"," direction: {"," value: \"horizontal\""," },",""," /**"," * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance."," *"," * @attribute groupMarkers"," * @type Boolean"," */"," groupMarkers: {"," getter: function()"," {"," if(this._groupMarkers === undefined)"," {"," return this.get(\"graph\").get(\"groupMarkers\");"," }"," else"," {"," return this._groupMarkers;"," }"," },",""," setter: function(val)"," {"," this._groupMarkers = val;"," return val;"," }"," }"," }","});","/**"," * The MarkerSeries class renders quantitative data by plotting relevant data points "," * on a graph."," *"," * @module charts"," * @submodule charts-base"," * @class MarkerSeries"," * @extends CartesianSeries"," * @uses Plots"," * @constructor"," */","Y.MarkerSeries = Y.Base.create(\"markerSeries\", Y.CartesianSeries, [Y.Plots], {"," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this.drawPlots();"," },"," "," /**"," * @protected"," *"," * Method used by `styles` setter. Overrides base implementation."," *"," * @method _setStyles"," * @param {Object} newStyles Hash of properties to update."," * @return Object"," */"," _setStyles: function(val)"," {"," if(!val.marker)"," {"," val = {marker:val};"," }"," val = this._parseMarkerStyles(val);"," return Y.MarkerSeries.superclass._mergeStyles.apply(this, [val, this._getDefaultStyles()]);"," },"," "," /**"," * @protected"," *"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," */"," _getDefaultStyles: function()"," {"," var styles = this._mergeStyles({marker:this._getPlotDefaults()}, Y.MarkerSeries.superclass._getDefaultStyles());"," return styles;"," }","},{"," ATTRS : {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default marker"," */"," type: {"," value:\"marker\""," }"," "," /**"," * Style properties used for drawing markers. This attribute is inherited from `Renderer`. Below are the default values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#6084d0\", \"#eeb647\", \"#6c6b5f\", \"#d6484f\", \"#ce9ed1\", \"#ff9f3b\", \"#93b7ff\", \"#e0ddd0\", \"#94ecba\", \"#309687\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>width</dt><dd>indicates the width of the marker. The default value is 10.</dd>"," * <dt>height</dt><dd>indicates the height of the marker The default value is 10.</dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","/**"," * The LineSeries class renders quantitative data on a graph by connecting relevant data points."," *"," * @module charts"," * @submodule charts-base"," * @class LineSeries"," * @extends CartesianSeries"," * @uses Lines"," * @constructor"," */","Y.LineSeries = Y.Base.create(\"lineSeries\", Y.CartesianSeries, [Y.Lines], {"," /**"," * @protected"," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this.drawLines();"," },",""," /**"," * @protected"," *"," * Method used by `styles` setter. Overrides base implementation."," *"," * @method _setStyles"," * @param {Object} newStyles Hash of properties to update."," * @return Object"," */"," _setStyles: function(val)"," {"," if(!val.line)"," {"," val = {line:val};"," }"," return Y.LineSeries.superclass._setStyles.apply(this, [val]);"," },",""," /**"," * @protected"," *"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," */"," _getDefaultStyles: function()"," {"," var styles = this._mergeStyles({line:this._getLineDefaults()}, Y.LineSeries.superclass._getDefaultStyles());"," return styles;"," }","},","{"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default line"," */"," type: {"," value:\"line\""," }",""," /**"," * Style properties used for drawing lines. This attribute is inherited from `Renderer`. Below are the default values:"," * <dl>"," * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be"," * retrieved from the following array: "," * `[\"#426ab3\", \"#d09b2c\", \"#000000\", \"#b82837\", \"#b384b5\", \"#ff7200\", \"#779de3\", \"#cbc8ba\", \"#7ed7a6\", \"#007a6c\"]`"," * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>"," * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> "," * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>"," * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>"," * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> "," * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>"," * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>"," * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","",""," ",""," ","/**"," * SplineSeries renders a graph with data points connected by a curve."," *"," * @module charts"," * @submodule charts-base"," * @class SplineSeries"," * @constructor"," * @extends CartesianSeries"," * @uses CurveUtil"," * @uses Lines"," */","Y.SplineSeries = Y.Base.create(\"splineSeries\", Y.LineSeries, [Y.CurveUtil, Y.Lines], {"," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this.drawSpline();"," }","}, {"," ATTRS : {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default spline"," */"," type : {"," value:\"spline\""," }",""," /**"," * Style properties used for drawing lines. This attribute is inherited from `Renderer`. Below are the default values:"," * <dl>"," * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be"," * retrieved from the following array: "," * `[\"#426ab3\", \"#d09b2c\", \"#000000\", \"#b82837\", \"#b384b5\", \"#ff7200\", \"#779de3\", \"#cbc8ba\", \"#7ed7a6\", \"#007a6c\"]`"," * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>"," * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> "," * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>"," * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>"," * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> "," * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>"," * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>"," * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","",""," ",""," ","/**"," * StackedSplineSeries creates spline graphs in which the different series are stacked along a value axis"," * to indicate their contribution to a cumulative total."," *"," * @module charts"," * @submodule charts-base"," * @class StackedSplineSeries"," * @constructor"," * @extends SplineSeries"," * @extends StackingUtil"," */","Y.StackedSplineSeries = Y.Base.create(\"stackedSplineSeries\", Y.SplineSeries, [Y.StackingUtil], {"," /**"," * @protected"," *"," * Calculates the coordinates for the series. Overrides base implementation."," *"," * @method setAreaData"," */"," setAreaData: function()"," { "," Y.StackedSplineSeries.superclass.setAreaData.apply(this);"," this._stackCoordinates.apply(this);"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedSpline"," */"," type: {"," value:\"stackedSpline\""," }"," }","});","","/**"," * StackedMarkerSeries plots markers with different series stacked along the value axis to indicate each"," * series' contribution to a cumulative total."," *"," * @module charts"," * @submodule charts-base"," * @class StackedMarkerSeries"," * @constructor"," * @extends MarkerSeries"," * @extends StackingUtil"," */","Y.StackedMarkerSeries = Y.Base.create(\"stackedMarkerSeries\", Y.MarkerSeries, [Y.StackingUtil], {"," /**"," * @protected"," *"," * Calculates the coordinates for the series. Overrides base implementation."," *"," * @method setAreaData"," */"," setAreaData: function()"," { "," Y.StackedMarkerSeries.superclass.setAreaData.apply(this);"," this._stackCoordinates.apply(this);"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedMarker"," */"," type: {"," value:\"stackedMarker\""," }"," }","});","","/**"," * The ColumnSeries class renders columns positioned horizontally along a category or time axis. The columns'"," * lengths are proportional to the values they represent along a vertical axis."," * and the relevant data points."," *"," * @module charts"," * @submodule charts-base"," * @class ColumnSeries"," * @extends MarkerSeries"," * @uses Histogram"," * @constructor"," */","Y.ColumnSeries = Y.Base.create(\"columnSeries\", Y.MarkerSeries, [Y.Histogram], {"," /**"," * Helper method for calculating the size of markers. "," *"," * @method _getMarkerDimensions"," * @param {Number} xcoord The x-coordinate representing the data point for the marker."," * @param {Number} ycoord The y-coordinate representing the data point for the marker."," * @param {Number} calculatedSize The calculated size for the marker. For a `BarSeries` is it the width. For a `ColumnSeries` it is the height."," * @param {Number} offset Distance of position offset dictated by other marker series in the same graph."," * @return Object"," * @private"," */"," _getMarkerDimensions: function(xcoord, ycoord, calculatedSize, offset)"," {"," var config = {"," left: xcoord + offset"," };"," if(this._bottomOrigin >= ycoord)"," {"," config.top = ycoord;"," config.calculatedSize = this._bottomOrigin - config.top;"," }"," else"," {"," config.top = this._bottomOrigin;"," config.calculatedSize = ycoord - this._bottomOrigin;"," }"," return config;"," },",""," /**"," * Resizes and positions markers based on a mouse interaction."," *"," * @method updateMarkerState"," * @param {String} type state of the marker"," * @param {Number} i index of the marker"," * @protected"," */"," updateMarkerState: function(type, i)"," {"," if(this._markers && this._markers[i])"," {"," var styles = Y.clone(this.get(\"styles\").marker),"," markerStyles,"," state = this._getState(type),"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," marker = this._markers[i],"," markers,"," graph = this.get(\"graph\"),"," seriesStyles,"," seriesCollection = graph.seriesTypes[this.get(\"type\")],"," seriesLen = seriesCollection.length,"," seriesSize = 0,"," offset = 0,"," renderer,"," n = 0,"," xs = [],"," order = this.get(\"order\"),"," config;"," markerStyles = state == \"off\" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]); "," markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);"," markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);"," config = this._getMarkerDimensions(xcoords[i], ycoords[i], styles.width, offset);"," markerStyles.height = config.calculatedSize;"," markerStyles.width = Math.min(this._maxSize, markerStyles.width);"," marker.set(markerStyles);"," for(; n < seriesLen; ++n)"," {"," xs[n] = xcoords[i] + seriesSize;"," seriesStyles = seriesCollection[n].get(\"styles\").marker;"," seriesSize += Math.min(this._maxSize, seriesStyles.width);"," if(order > n)"," {"," offset = seriesSize;"," }"," offset -= seriesSize/2;"," }"," for(n = 0; n < seriesLen; ++n)"," {"," markers = seriesCollection[n].get(\"markers\");"," if(markers)"," {"," renderer = markers[i];"," if(renderer && renderer !== undefined)"," {"," renderer.set(\"x\", (xs[n] - seriesSize/2));"," }"," }"," }"," }"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @readOnly"," * @default column"," */"," type: {"," value: \"column\""," }"," "," /**"," * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>width</dt><dd>indicates the width of the marker. The default value is 12.</dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","/**"," * The BarSeries class renders bars positioned vertically along a category or time axis. The bars'"," * lengths are proportional to the values they represent along a horizontal axis."," * and the relevant data points."," *"," * @module charts"," * @submodule charts-base"," * @class BarSeries"," * @extends MarkerSeries"," * @uses Histogram"," * @constructor"," */","Y.BarSeries = Y.Base.create(\"barSeries\", Y.MarkerSeries, [Y.Histogram], {"," /**"," * Helper method for calculating the size of markers. "," *"," * @method _getMarkerDimensions"," * @param {Number} xcoord The x-coordinate representing the data point for the marker."," * @param {Number} ycoord The y-coordinate representing the data point for the marker."," * @param {Number} calculatedSize The calculated size for the marker. For a `BarSeries` is it the width. For a `ColumnSeries` it is the height."," * @param {Number} offset Distance of position offset dictated by other marker series in the same graph."," * @return Object"," * @private"," */"," _getMarkerDimensions: function(xcoord, ycoord, calculatedSize, offset)"," {"," var config = {"," top: ycoord + offset"," };"," if(xcoord >= this._leftOrigin)"," {"," config.left = this._leftOrigin;"," config.calculatedSize = xcoord - config.left;"," }"," else"," {"," config.left = xcoord;"," config.calculatedSize = this._leftOrigin - xcoord;"," }"," return config;"," },"," "," /**"," * Resizes and positions markers based on a mouse interaction."," *"," * @method updateMarkerState"," * @param {String} type state of the marker"," * @param {Number} i index of the marker"," * @protected"," */"," updateMarkerState: function(type, i)"," {"," if(this._markers && this._markers[i])"," {"," var styles = Y.clone(this.get(\"styles\").marker),"," markerStyles,"," state = this._getState(type),"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," marker = this._markers[i],"," markers,"," graph = this.get(\"graph\"),"," seriesCollection = graph.seriesTypes[this.get(\"type\")],"," seriesLen = seriesCollection.length,"," seriesStyles,"," seriesSize = 0,"," offset = 0,"," renderer,"," n = 0,"," ys = [],"," order = this.get(\"order\"),"," config;"," markerStyles = state == \"off\" || !styles[state] ? styles : styles[state]; "," markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);"," markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);"," config = this._getMarkerDimensions(xcoords[i], ycoords[i], styles.height, offset);"," markerStyles.width = config.calculatedSize;"," markerStyles.height = Math.min(this._maxSize, markerStyles.height);"," marker.set(markerStyles);"," for(; n < seriesLen; ++n)"," {"," ys[n] = ycoords[i] + seriesSize;"," seriesStyles = seriesCollection[n].get(\"styles\").marker;"," seriesSize += Math.min(this._maxSize, seriesStyles.height); "," if(order > n)"," {"," offset = seriesSize;"," }"," offset -= seriesSize/2;"," }"," for(n = 0; n < seriesLen; ++n)"," {"," markers = seriesCollection[n].get(\"markers\");"," if(markers)"," {"," renderer = markers[i];"," if(renderer && renderer !== undefined)"," {"," renderer.set(\"y\", (ys[n] - seriesSize/2));"," }"," }"," }"," }"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default bar"," */"," type: {"," value: \"bar\""," },",""," /**"," * Indicates the direction of the category axis that the bars are plotted against."," *"," * @attribute direction"," * @type String"," */"," direction: {"," value: \"vertical\""," }"," "," /**"," * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>height</dt><dd>indicates the width of the marker. The default value is 12.</dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","/**"," * The AreaSeries class renders quantitative data on a graph by creating a fill between 0"," * and the relevant data points."," *"," * @module charts"," * @submodule charts-base"," * @class AreaSeries"," * @extends CartesianSeries"," * @uses Fills"," * @constructor"," */","Y.AreaSeries = Y.Base.create(\"areaSeries\", Y.CartesianSeries, [Y.Fills], {"," /**"," * @protected"," *"," * Renders the series. "," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this.drawFill.apply(this, this._getClosingPoints());"," },"," "," /**"," * @protected"," *"," * Method used by `styles` setter. Overrides base implementation."," *"," * @method _setStyles"," * @param {Object} newStyles Hash of properties to update."," * @return Object"," */"," _setStyles: function(val)"," {"," if(!val.area)"," {"," val = {area:val};"," }"," return Y.AreaSeries.superclass._setStyles.apply(this, [val]);"," },",""," /**"," * @protected"," *"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," */"," _getDefaultStyles: function()"," {"," var styles = this._mergeStyles({area:this._getAreaDefaults()}, Y.AreaSeries.superclass._getDefaultStyles());"," return styles;"," }","},","{"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default area"," */"," type: {"," value:\"area\""," }"," "," /**"," * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values:"," *"," * <dl>"," * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be "," * retrieved from the following array:"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","",""," ",""," ","/**"," * AreaSplineSeries renders an area graph with data points connected by a curve."," *"," * @module charts"," * @submodule charts-base"," * @class AreaSplineSeries"," * @constructor"," * @extends CartesianSeries"," * @uses Fills"," * @uses CurveUtil"," */","Y.AreaSplineSeries = Y.Base.create(\"areaSplineSeries\", Y.AreaSeries, [Y.CurveUtil], {"," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this.drawAreaSpline();"," }","}, {"," ATTRS : {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default areaSpline"," */"," type: {"," value:\"areaSpline\""," }"," "," /**"," * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values:"," *"," * <dl>"," * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be "," * retrieved from the following array:"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","/**"," * StackedAreaSplineSeries creates a stacked area chart with points data points connected by a curve."," *"," * @module charts"," * @submodule charts-base"," * @class StackedAreaSplineSeries"," * @constructor"," * @extends AreaSeries"," * @uses CurveUtil"," * @uses StackingUtil"," */","Y.StackedAreaSplineSeries = Y.Base.create(\"stackedAreaSplineSeries\", Y.AreaSeries, [Y.CurveUtil, Y.StackingUtil], {"," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this._stackCoordinates();"," this.drawStackedAreaSpline();"," }","}, {"," ATTRS : {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedAreaSpline"," */"," type: {"," value:\"stackedAreaSpline\""," }"," }","});","","/**"," * The ComboSeries class renders a combination of lines, plots and area fills in a single series. Each"," * series type has a corresponding boolean attribute indicating if it is rendered. By default, lines and plots "," * are rendered and area is not. "," *"," * @module charts"," * @submodule charts-base"," * @class ComboSeries"," * @extends CartesianSeries "," * @uses Fills"," * @uses Lines"," * @uses Plots"," * @constructor"," */","Y.ComboSeries = Y.Base.create(\"comboSeries\", Y.CartesianSeries, [Y.Fills, Y.Lines, Y.Plots], {"," /**"," * @protected"," * "," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," if(this.get(\"showAreaFill\"))"," {"," this.drawFill.apply(this, this._getClosingPoints());"," }"," if(this.get(\"showLines\")) "," {"," this.drawLines();"," }"," if(this.get(\"showMarkers\"))"," {"," this.drawPlots();"," } "," },"," "," /**"," * Toggles visibility"," *"," * @method _toggleVisible"," * @param {Boolean} visible indicates visibilitye"," * @private"," */"," _toggleVisible: function(visible)"," {"," var markers,"," marker,"," len,"," i;"," if(this.get(\"showAreaFill\") && this._path)"," {"," this._path.set(\"visible\", visible);"," }"," if(this.get(\"showLines\") && this._lineGraphic)"," {"," this._lineGraphic.set(\"visible\", visible);"," }"," if(this.get(\"showMarkers\"))"," {"," markers = this.get(\"markers\");"," if(markers)"," {"," i = 0;"," len = markers.length;"," for(; i < len; ++i)"," {"," marker = markers[i];"," if(marker)"," {"," marker.set(\"visible\", visible);"," }"," }"," }"," }"," },",""," /**"," * @protected"," *"," * Returns the default hash for the `styles` attribute."," *"," * @method _getDefaultStyles"," * @return Object"," */"," _getDefaultStyles: function()"," {"," var styles = Y.ComboSeries.superclass._getDefaultStyles();"," styles.line = this._getLineDefaults();"," styles.marker = this._getPlotDefaults();"," styles.area = this._getAreaDefaults();"," return styles;"," }","},","{"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default combo"," */"," type: {"," value:\"combo\""," },",""," /**"," * Indicates whether a fill is displayed."," *"," * @attribute showAreaFill"," * @type Boolean"," * @default false"," */"," showAreaFill: {"," value: false"," },",""," /**"," * Indicates whether lines are displayed."," *"," * @attribute showLines"," * @type Boolean"," * @default true"," */"," showLines: {"," value: true"," },",""," /**"," * Indicates whether markers are displayed."," *"," * @attribute showMarkers"," * @type Boolean"," * @default true"," */"," showMarkers: {"," value: true"," },",""," /**"," * Reference to the styles of the markers. These styles can also"," * be accessed through the `styles` attribute. Below are default"," * values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#6084d0\", \"#eeb647\", \"#6c6b5f\", \"#d6484f\", \"#ce9ed1\", \"#ff9f3b\", \"#93b7ff\", \"#e0ddd0\", \"#94ecba\", \"#309687\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>width</dt><dd>indicates the width of the marker. The default value is 10.</dd>"," * <dt>height</dt><dd>indicates the height of the marker The default value is 10.</dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute marker"," * @type Object"," */"," marker: {"," lazyAdd: false,"," getter: function()"," {"," return this.get(\"styles\").marker;"," },"," setter: function(val)"," {"," this.set(\"styles\", {marker:val});"," }"," },"," "," /**"," * Reference to the styles of the lines. These styles can also be accessed through the `styles` attribute."," * Below are the default values:"," * <dl>"," * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be"," * retrieved from the following array: "," * `[\"#426ab3\", \"#d09b2c\", \"#000000\", \"#b82837\", \"#b384b5\", \"#ff7200\", \"#779de3\", \"#cbc8ba\", \"#7ed7a6\", \"#007a6c\"]`"," * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>"," * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> "," * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>"," * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>"," * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> "," * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>"," * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>"," * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>"," * </dl>"," *"," * @attribute line"," * @type Object"," */"," line: {"," lazyAdd: false,"," getter: function()"," {"," return this.get(\"styles\").line;"," },"," setter: function(val)"," {"," this.set(\"styles\", {line:val});"," }"," },"," "," /**"," * Reference to the styles of the area fills. These styles can also be accessed through the `styles` attribute."," * Below are the default values:"," *"," * <dl>"," * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be "," * retrieved from the following array:"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>"," * </dl>"," *"," * @attribute area"," * @type Object"," */"," area: {"," lazyAdd: false,"," getter: function()"," {"," return this.get(\"styles\").area;"," },"," setter: function(val)"," {"," this.set(\"styles\", {area:val});"," }"," }",""," /**"," * Style properties for the series. Contains a key indexed hash of the following:"," * <dl>"," * <dt>marker</dt><dd>Style properties for the markers in the series. Specific style attributes are listed"," * <a href=\"#attr_marker\">here</a>.</dd>"," * <dt>line</dt><dd>Style properties for the lines in the series. Specific"," * style attributes are listed <a href=\"#attr_line\">here</a>.</dd>"," * <dt>area</dt><dd>Style properties for the area fills in the series. Specific style attributes are listed"," * <a href=\"#attr_area\">here</a>.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","",""," ",""," ","/**"," * The StackedComboSeries class renders a combination of lines, plots and area fills in a single series. Series"," * are stacked along the value axis to indicate each series contribution to a cumulative total. Each"," * series type has a corresponding boolean attribute indicating if it is rendered. By default, all three types are"," * rendered. "," *"," * @module charts"," * @submodule charts-base"," * @class StackedComboSeries"," * @extends ComboSeries"," * @uses StackingUtil"," * @constructor"," */","Y.StackedComboSeries = Y.Base.create(\"stackedComboSeries\", Y.ComboSeries, [Y.StackingUtil], {"," /**"," * @protected"," *"," * Calculates the coordinates for the series. Overrides base implementation."," *"," * @method setAreaData"," */"," setAreaData: function()"," { "," Y.StackedComboSeries.superclass.setAreaData.apply(this);"," this._stackCoordinates.apply(this);"," },"," "," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," if(this.get(\"showAreaFill\"))"," {"," this.drawFill.apply(this, this._getStackedClosingPoints());"," }"," if(this.get(\"showLines\")) "," {"," this.drawLines();"," }"," if(this.get(\"showMarkers\"))"," {"," this.drawPlots();"," } "," }"," ","}, {"," ATTRS : {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedCombo"," */"," type: {"," value: \"stackedCombo\""," },",""," /**"," * Indicates whether a fill is displayed."," *"," * @attribute showAreaFill"," * @type Boolean"," * @default true"," */"," showAreaFill: {"," value: true"," }"," }","});","/**"," * The ComboSplineSeries class renders a combination of splines, plots and areaspline fills in a single series. Each"," * series type has a corresponding boolean attribute indicating if it is rendered. By default, splines and plots "," * are rendered and areaspline is not. "," *"," * @module charts"," * @submodule charts-base"," * @class ComboSplineSeries"," * @extends ComboSeries"," * @extends CurveUtil"," * @constructor"," */","Y.ComboSplineSeries = Y.Base.create(\"comboSplineSeries\", Y.ComboSeries, [Y.CurveUtil], {"," /**"," * @protected"," * "," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," if(this.get(\"showAreaFill\"))"," {"," this.drawAreaSpline();"," }"," if(this.get(\"showLines\")) "," {"," this.drawSpline();"," }"," if(this.get(\"showMarkers\"))"," {"," this.drawPlots();"," } "," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default comboSpline"," */"," type: {"," value : \"comboSpline\""," }"," }","});","/**"," * The StackedComboSplineSeries class renders a combination of splines, plots and areaspline fills in a single series. Series"," * are stacked along the value axis to indicate each series contribution to a cumulative total. Each"," * series type has a corresponding boolean attribute indicating if it is rendered. By default, all three types are"," * rendered. "," *"," * @module charts"," * @submodule charts-base"," * @class StackedComboSplineSeries"," * @extends StackedComboSeries"," * @uses CurveUtil"," * @constructor"," */","Y.StackedComboSplineSeries = Y.Base.create(\"stackedComboSplineSeries\", Y.StackedComboSeries, [Y.CurveUtil], {"," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," if(this.get(\"showAreaFill\"))"," {"," this.drawStackedAreaSpline();"," }"," if(this.get(\"showLines\")) "," {"," this.drawSpline();"," }"," if(this.get(\"showMarkers\"))"," {"," this.drawPlots();"," } "," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedComboSpline"," */"," type : {"," value : \"stackedComboSpline\""," },",""," /**"," * Indicates whether a fill is displayed."," *"," * @attribute showAreaFill"," * @type Boolean"," * @default true"," */"," showAreaFill: {"," value: true"," }"," }","});","/**"," * StackedLineSeries creates line graphs in which the different series are stacked along a value axis"," * to indicate their contribution to a cumulative total."," *"," * @module charts"," * @submodule charts-base"," * @class StackedLineSeries"," * @constructor"," * @extends LineSeries"," * @uses StackingUtil"," */","Y.StackedLineSeries = Y.Base.create(\"stackedLineSeries\", Y.LineSeries, [Y.StackingUtil], {"," /**"," * @protected"," *"," * Calculates the coordinates for the series. Overrides base implementation."," *"," * @method setAreaData"," */"," setAreaData: function()"," { "," Y.StackedLineSeries.superclass.setAreaData.apply(this);"," this._stackCoordinates.apply(this);"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedLine"," */"," type: {"," value:\"stackedLine\""," }"," }","});","/**"," * StackedAreaSeries area fills to display data showing its contribution to a whole."," *"," * @module charts"," * @submodule charts-base"," * @class StackedAreaSeries"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Chart."," * @extends AreaSeries"," * @uses StackingUtil"," */","Y.StackedAreaSeries = Y.Base.create(\"stackedAreaSeries\", Y.AreaSeries, [Y.StackingUtil], {"," /**"," * @protected"," *"," * Calculates the coordinates for the series. Overrides base implementation."," *"," * @method setAreaData"," */"," setAreaData: function()"," { "," Y.StackedAreaSeries.superclass.setAreaData.apply(this);"," this._stackCoordinates.apply(this);"," },",""," /**"," * @protected"," *"," * Draws the series"," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this.drawFill.apply(this, this._getStackedClosingPoints());"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedArea"," */"," type: {"," value:\"stackedArea\""," }"," }","});","/**"," * The StackedColumnSeries renders column chart in which series are stacked vertically to show"," * their contribution to the cumulative total."," *"," * @module charts"," * @submodule charts-base"," * @class StackedColumnSeries"," * @extends ColumnSeries"," * @uses StackingUtil"," * @constructor"," */","Y.StackedColumnSeries = Y.Base.create(\"stackedColumnSeries\", Y.ColumnSeries, [Y.StackingUtil], {"," /**"," * Draws the series."," *"," * @method drawSeries"," * @protected"," */"," drawSeries: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var isNumber = Y_Lang.isNumber,"," style = Y.clone(this.get(\"styles\").marker), "," w = style.width,"," h = style.height,"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," i = 0,"," len = xcoords.length,"," top = ycoords[0],"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," seriesCollection = graph.seriesTypes[type],"," ratio,"," order = this.get(\"order\"),"," graphOrder = this.get(\"graphOrder\"),"," left,"," marker,"," fillColors,"," borderColors,"," lastCollection,"," negativeBaseValues,"," positiveBaseValues,"," useOrigin = order === 0,"," totalWidth = len * w,"," dimensions = {"," width: [],"," height: []"," },"," xvalues = [],"," yvalues = [],"," groupMarkers = this.get(\"groupMarkers\");"," if(Y_Lang.isArray(style.fill.color))"," {"," fillColors = style.fill.color.concat(); "," }"," if(Y_Lang.isArray(style.border.color))"," {"," borderColors = style.border.color.concat();"," }"," this._createMarkerCache();"," if(totalWidth > this.get(\"width\"))"," {"," ratio = this.width/totalWidth;"," w *= ratio;"," w = Math.max(w, 1);"," }"," if(!useOrigin)"," {"," lastCollection = seriesCollection[order - 1];"," negativeBaseValues = lastCollection.get(\"negativeBaseValues\");"," positiveBaseValues = lastCollection.get(\"positiveBaseValues\");"," if(!negativeBaseValues || !positiveBaseValues)"," {"," useOrigin = true;"," positiveBaseValues = [];"," negativeBaseValues = [];"," }"," }"," else"," {"," negativeBaseValues = [];"," positiveBaseValues = [];"," }"," this.set(\"negativeBaseValues\", negativeBaseValues);"," this.set(\"positiveBaseValues\", positiveBaseValues);"," for(i = 0; i < len; ++i)"," {"," left = xcoords[i];"," top = ycoords[i];"," "," if(!isNumber(top) || !isNumber(left))"," {"," if(useOrigin)"," {"," negativeBaseValues[i] = this._bottomOrigin;"," positiveBaseValues[i] = this._bottomOrigin;"," }"," this._markers.push(null); "," continue;"," }"," if(useOrigin)"," {"," h = Math.abs(this._bottomOrigin - top);"," if(top < this._bottomOrigin)"," {"," positiveBaseValues[i] = top;"," negativeBaseValues[i] = this._bottomOrigin;"," }"," else if(top > this._bottomOrigin)"," {"," positiveBaseValues[i] = this._bottomOrigin;"," negativeBaseValues[i] = top;"," top -= h;"," }"," else"," {"," positiveBaseValues[i] = top;"," negativeBaseValues[i] = top;"," }"," }"," else "," {"," if(top > this._bottomOrigin)"," {"," top += (negativeBaseValues[i] - this._bottomOrigin);"," h = top - negativeBaseValues[i];"," negativeBaseValues[i] = top;"," top -= h;"," }"," else if(top <= this._bottomOrigin)"," {"," top = positiveBaseValues[i] - (this._bottomOrigin - top);"," h = positiveBaseValues[i] - top;"," positiveBaseValues[i] = top;"," }"," }"," if(!isNaN(h) && h > 0)"," {"," left -= w/2;"," if(groupMarkers)"," {"," dimensions.width[i] = w;"," dimensions.height[i] = h;"," xvalues.push(left);"," yvalues.push(top);"," }"," else"," {"," style.width = w;"," style.height = h;"," style.x = left;"," style.y = top;"," if(fillColors)"," {"," style.fill.color = fillColors[i % fillColors.length];"," }"," if(borderColors)"," {"," style.border.color = borderColors[i % borderColors.length];"," }"," marker = this.getMarker(style, graphOrder, i);"," }"," }"," else if(!groupMarkers)"," {"," this._markers.push(null);"," }"," }"," if(groupMarkers)"," {"," this._createGroupMarker({"," fill: style.fill,"," border: style.border,"," dimensions: dimensions,"," xvalues: xvalues,"," yvalues: yvalues,"," shape: style.shape"," });"," }"," else"," {"," this._clearMarkerCache();"," }"," },",""," /**"," * Resizes and positions markers based on a mouse interaction."," *"," * @method updateMarkerState"," * @param {String} type state of the marker"," * @param {Number} i index of the marker"," * @protected"," */"," updateMarkerState: function(type, i)"," {"," if(this._markers && this._markers[i])"," {"," var styles,"," markerStyles,"," state = this._getState(type),"," xcoords = this.get(\"xcoords\"),"," marker = this._markers[i],"," offset = 0,"," fillColor,"," borderColor; "," styles = this.get(\"styles\").marker;"," offset = styles.width * 0.5;"," markerStyles = state == \"off\" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]); "," markerStyles.height = marker.get(\"height\");"," markerStyles.x = (xcoords[i] - offset);"," markerStyles.y = marker.get(\"y\");"," markerStyles.id = marker.get(\"id\");"," fillColor = markerStyles.fill.color; "," borderColor = markerStyles.border.color;"," if(Y_Lang.isArray(fillColor))"," {"," markerStyles.fill.color = fillColor[i % fillColor.length];"," }"," else"," {"," markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);"," }"," if(Y_Lang.isArray(borderColor))"," {"," markerStyles.border.color = borderColor[i % borderColor.length];"," }"," else"," {"," markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);"," }"," marker.set(markerStyles);"," }"," },"," "," /**"," * Gets the default values for the markers. "," *"," * @method _getPlotDefaults"," * @return Object"," * @protected"," */"," _getPlotDefaults: function()"," {"," var defs = {"," fill:{"," type: \"solid\","," alpha: 1,"," colors:null,"," alphas: null,"," ratios: null"," },"," border:{"," weight: 0,"," alpha: 1"," },"," width: 24,"," height: 24,"," shape: \"rect\",",""," padding:{"," top: 0,"," left: 0,"," right: 0,"," bottom: 0"," }"," };"," defs.fill.color = this._getDefaultColor(this.get(\"graphOrder\"), \"fill\");"," defs.border.color = this._getDefaultColor(this.get(\"graphOrder\"), \"border\");"," return defs;"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedColumn"," */"," type: {"," value: \"stackedColumn\""," },",""," /**"," * @attribute negativeBaseValues"," * @type Array"," * @default null"," * @private"," */"," negativeBaseValues: {"," value: null"," },",""," /**"," * @attribute positiveBaseValues"," * @type Array"," * @default null"," * @private"," */"," positiveBaseValues: {"," value: null"," }"," "," /**"," * Style properties used for drawing markers. This attribute is inherited from `ColumnSeries`. Below are the default values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>width</dt><dd>indicates the width of the marker. The default value is 24.</dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","/**"," * The StackedBarSeries renders bar chart in which series are stacked horizontally to show"," * their contribution to the cumulative total."," *"," * @module charts"," * @submodule charts-base"," * @class StackedBarSeries"," * @extends BarSeries"," * @uses StackingUtil"," * @constructor"," */","Y.StackedBarSeries = Y.Base.create(\"stackedBarSeries\", Y.BarSeries, [Y.StackingUtil], {"," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }",""," var isNumber = Y_Lang.isNumber,"," style = Y.clone(this.get(\"styles\").marker),"," w = style.width,"," h = style.height,"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," i = 0,"," len = xcoords.length,"," top = ycoords[0],"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," seriesCollection = graph.seriesTypes[type],"," ratio,"," order = this.get(\"order\"),"," graphOrder = this.get(\"graphOrder\"),"," left,"," marker,"," lastCollection,"," negativeBaseValues,"," positiveBaseValues,"," fillColors,"," borderColors,"," useOrigin = order === 0,"," totalHeight = len * h,"," dimensions = {"," width: [],"," height: []"," },"," xvalues = [],"," yvalues = [],"," groupMarkers = this.get(\"groupMarkers\");"," if(Y_Lang.isArray(style.fill.color))"," {"," fillColors = style.fill.color.concat(); "," }"," if(Y_Lang.isArray(style.border.color))"," {"," borderColors = style.border.color.concat();"," }"," this._createMarkerCache();"," if(totalHeight > this.get(\"height\"))"," {"," ratio = this.height/totalHeight;"," h *= ratio;"," h = Math.max(h, 1);"," }"," if(!useOrigin)"," {"," lastCollection = seriesCollection[order - 1];"," negativeBaseValues = lastCollection.get(\"negativeBaseValues\");"," positiveBaseValues = lastCollection.get(\"positiveBaseValues\");"," if(!negativeBaseValues || !positiveBaseValues)"," {"," useOrigin = true;"," positiveBaseValues = [];"," negativeBaseValues = [];"," }"," }"," else"," {"," negativeBaseValues = [];"," positiveBaseValues = [];"," }"," this.set(\"negativeBaseValues\", negativeBaseValues);"," this.set(\"positiveBaseValues\", positiveBaseValues);"," for(i = 0; i < len; ++i)"," {"," top = ycoords[i];"," left = xcoords[i];"," if(!isNumber(top) || !isNumber(left))"," {"," if(useOrigin)"," {"," positiveBaseValues[i] = this._leftOrigin;"," negativeBaseValues[i] = this._leftOrigin;"," }"," this._markers.push(null);"," continue;"," }"," if(useOrigin)"," {"," w = Math.abs(left - this._leftOrigin);"," if(left > this._leftOrigin)"," {"," positiveBaseValues[i] = left;"," negativeBaseValues[i] = this._leftOrigin;"," left -= w;"," }"," else if(left < this._leftOrigin)"," { "," positiveBaseValues[i] = this._leftOrigin;"," negativeBaseValues[i] = left;"," }"," else"," {"," positiveBaseValues[i] = left;"," negativeBaseValues[i] = this._leftOrigin;"," }"," }"," else"," {"," if(left < this._leftOrigin)"," {"," left = negativeBaseValues[i] - (this._leftOrigin - xcoords[i]);"," w = negativeBaseValues[i] - left;"," negativeBaseValues[i] = left;"," }"," else if(left >= this._leftOrigin)"," {"," left += (positiveBaseValues[i] - this._leftOrigin);"," w = left - positiveBaseValues[i];"," positiveBaseValues[i] = left;"," left -= w;"," }"," }"," if(!isNaN(w) && w > 0)"," {"," top -= h/2;"," if(groupMarkers)"," {"," dimensions.width[i] = w;"," dimensions.height[i] = h;"," xvalues.push(left);"," yvalues.push(top);"," }"," else"," {"," style.width = w;"," style.height = h;"," style.x = left;"," style.y = top;"," if(fillColors)"," {"," style.fill.color = fillColors[i % fillColors.length];"," }"," if(borderColors)"," {"," style.border.color = borderColors[i % borderColors.length];"," }"," marker = this.getMarker(style, graphOrder, i);"," }"," }"," else if(!groupMarkers)"," {"," this._markers.push(null);"," }"," }"," if(groupMarkers)"," {"," this._createGroupMarker({"," fill: style.fill,"," border: style.border,"," dimensions: dimensions,"," xvalues: xvalues,"," yvalues: yvalues,"," shape: style.shape"," });"," }"," else"," {"," this._clearMarkerCache();"," }"," },",""," /**"," * @protected"," *"," * Resizes and positions markers based on a mouse interaction."," *"," * @method updateMarkerState"," * @param {String} type state of the marker"," * @param {Number} i index of the marker"," */"," updateMarkerState: function(type, i)"," {"," if(this._markers[i])"," {"," var state = this._getState(type),"," ycoords = this.get(\"ycoords\"),"," marker = this._markers[i],"," styles = this.get(\"styles\").marker,"," h = styles.height,"," markerStyles = state == \"off\" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]), "," fillColor,"," borderColor; "," markerStyles.y = (ycoords[i] - h/2);"," markerStyles.x = marker.get(\"x\");"," markerStyles.width = marker.get(\"width\");"," markerStyles.id = marker.get(\"id\");"," fillColor = markerStyles.fill.color; "," borderColor = markerStyles.border.color;"," if(Y_Lang.isArray(fillColor))"," {"," markerStyles.fill.color = fillColor[i % fillColor.length];"," }"," else"," {"," markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);"," }"," if(Y_Lang.isArray(borderColor))"," {"," markerStyles.border.color = borderColor[i % borderColor.length];"," }"," else"," {"," markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);"," }"," marker.set(markerStyles);"," }"," },"," "," /**"," * @protected"," *"," * Returns default values for the `styles` attribute."," * "," * @method _getPlotDefaults"," * @return Object"," */"," _getPlotDefaults: function()"," {"," var defs = {"," fill:{"," type: \"solid\","," alpha: 1,"," colors:null,"," alphas: null,"," ratios: null"," },"," border:{"," weight: 0,"," alpha: 1"," },"," width: 24,"," height: 24,"," shape: \"rect\",",""," padding:{"," top: 0,"," left: 0,"," right: 0,"," bottom: 0"," }"," };"," defs.fill.color = this._getDefaultColor(this.get(\"graphOrder\"), \"fill\");"," defs.border.color = this._getDefaultColor(this.get(\"graphOrder\"), \"border\");"," return defs;"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedBar"," */"," type: {"," value: \"stackedBar\""," },",""," /**"," * Direction of the series"," *"," * @attribute direction"," * @type String"," * @default vertical"," */"," direction: {"," value: \"vertical\""," },",""," /**"," * @private"," *"," * @attribute negativeBaseValues"," * @type Array"," * @default null"," */"," negativeBaseValues: {"," value: null"," },",""," /**"," * @private"," *"," * @attribute positiveBaseValues"," * @type Array"," * @default null"," */"," positiveBaseValues: {"," value: null"," }"," "," /**"," * Style properties used for drawing markers. This attribute is inherited from `BarSeries`. Below are the default values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>height</dt><dd>indicates the width of the marker. The default value is 24.</dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","/**"," * PieSeries visualizes data as a circular chart divided into wedges which represent data as a "," * percentage of a whole."," *"," * @module charts"," * @submodule charts-base"," * @class PieSeries"," * @constructor"," * @extends MarkerSeries"," */","Y.PieSeries = Y.Base.create(\"pieSeries\", Y.MarkerSeries, [], { "," /**"," * Image map used for interactivity when rendered with canvas."," *"," * @property _map"," * @type HTMLElement"," * @private"," */"," _map: null,",""," /**"," * Image used for image map when rendered with canvas."," *"," * @property _image"," * @type HTMLElement"," * @private"," */"," _image: null,",""," /**"," * Creates or updates the image map when rendered with canvas."," *"," * @method _setMap"," * @private"," */"," _setMap: function()"," {"," var id = \"pieHotSpotMapi_\" + Math.round(100000 * Math.random()),"," cb = this.get(\"graph\").get(\"contentBox\"),"," areaNode;"," if(this._image)"," {"," cb.removeChild(this._image);"," while(this._areaNodes && this._areaNodes.length > 0)"," {"," areaNode = this._areaNodes.shift();"," this._map.removeChild(areaNode);"," }"," cb.removeChild(this._map);"," }"," this._image = DOCUMENT.createElement(\"img\"); "," this._image.src = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==\";"," cb.appendChild(this._image);"," this._image.setAttribute(\"usemap\", \"#\" + id);"," this._image.style.zIndex = 3;"," this._image.style.opacity = 0;"," this._image.setAttribute(\"alt\", \"imagemap\");"," this._map = DOCUMENT.createElement(\"map\");"," this._map.style.zIndex = 5;"," cb.appendChild(this._map);"," this._map.setAttribute(\"name\", id);"," this._map.setAttribute(\"id\", id);"," this._areaNodes = [];"," },",""," /**"," * Storage for `categoryDisplayName` attribute."," *"," * @property _categoryDisplayName"," * @private"," */"," _categoryDisplayName: null,"," "," /**"," * Storage for `valueDisplayName` attribute."," *"," * @property _valueDisplayName"," * @private"," */"," _valueDisplayName: null,",""," /**"," * Adds event listeners."," *"," * @method addListeners"," * @private"," */"," addListeners: function()"," {"," var categoryAxis = this.get(\"categoryAxis\"),"," valueAxis = this.get(\"valueAxis\");"," if(categoryAxis)"," {"," categoryAxis.after(\"dataReady\", Y.bind(this._categoryDataChangeHandler, this));"," categoryAxis.after(\"dataUpdate\", Y.bind(this._categoryDataChangeHandler, this));"," }"," if(valueAxis)"," {"," valueAxis.after(\"dataReady\", Y.bind(this._valueDataChangeHandler, this));"," valueAxis.after(\"dataUpdate\", Y.bind(this._valueDataChangeHandler, this));"," }"," this.after(\"categoryAxisChange\", this.categoryAxisChangeHandler);"," this.after(\"valueAxisChange\", this.valueAxisChangeHandler);"," this.after(\"stylesChange\", this._updateHandler);"," },"," "," /**"," * Draws the series."," *"," * @method validate"," * @private"," */"," validate: function()"," {"," this.draw();"," this._renderered = true;"," },",""," /**"," * Event handler for the categoryAxisChange event."," *"," * @method _categoryAxisChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _categoryAxisChangeHandler: function(e)"," {"," var categoryAxis = this.get(\"categoryAxis\");"," categoryAxis.after(\"dataReady\", Y.bind(this._categoryDataChangeHandler, this));"," categoryAxis.after(\"dataUpdate\", Y.bind(this._categoryDataChangeHandler, this));"," },"," "," /**"," * Event handler for the valueAxisChange event."," *"," * @method _valueAxisChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _valueAxisChangeHandler: function(e)"," {"," var valueAxis = this.get(\"valueAxis\");"," valueAxis.after(\"dataReady\", Y.bind(this._valueDataChangeHandler, this));"," valueAxis.after(\"dataUpdate\", Y.bind(this._valueDataChangeHandler, this));"," },"," "," /**"," * Constant used to generate unique id."," *"," * @property GUID"," * @type String"," * @private"," */"," GUID: \"pieseries\","," "," /**"," * Event handler for categoryDataChange event."," *"," * @method _categoryDataChangeHandler"," * @param {Object} event Event object."," * @private "," */"," _categoryDataChangeHandler: function(event)"," {"," if(this._rendered && this.get(\"categoryKey\") && this.get(\"valueKey\"))"," {"," this.draw();"," }"," },",""," /**"," * Event handler for valueDataChange event."," *"," * @method _valueDataChangeHandler"," * @param {Object} event Event object."," * @private "," */"," _valueDataChangeHandler: function(event)"," {"," if(this._rendered && this.get(\"categoryKey\") && this.get(\"valueKey\"))"," {"," this.draw();"," }"," },"," "," /**"," * Draws the series. Overrides the base implementation."," *"," * @method draw"," * @protected"," */"," draw: function()"," {"," var graph = this.get(\"graph\"),"," w = graph.get(\"width\"),"," h = graph.get(\"height\");"," if(isFinite(w) && isFinite(h) && w > 0 && h > 0)"," { "," this._rendered = true;"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," this.drawSeries();"," this._drawing = false;"," if(this._callLater)"," {"," this.draw();"," }"," else"," {"," this.fire(\"drawingComplete\");"," }"," }"," },",""," /**"," * Draws the markers"," *"," * @method drawPlots"," * @protected"," */"," drawPlots: function()"," {"," var values = this.get(\"valueAxis\").getDataByKey(this.get(\"valueKey\")).concat(),"," catValues = this.get(\"categoryAxis\").getDataByKey(this.get(\"categoryKey\")).concat(),"," totalValue = 0,"," itemCount = values.length,"," styles = this.get(\"styles\").marker,"," fillColors = styles.fill.colors,"," fillAlphas = styles.fill.alphas || [\"1\"],"," borderColors = styles.border.colors,"," borderWeights = [styles.border.weight],"," borderAlphas = [styles.border.alpha],"," tbw = borderWeights.concat(),"," tbc = borderColors.concat(),"," tba = borderAlphas.concat(),"," tfc,"," tfa,"," padding = styles.padding,"," graph = this.get(\"graph\"),"," minDimension = Math.min(graph.get(\"width\"), graph.get(\"height\")),"," w = minDimension - (padding.left + padding.right),"," h = minDimension - (padding.top + padding.bottom),"," startAngle = -90,"," halfWidth = w / 2,"," halfHeight = h / 2,"," radius = Math.min(halfWidth, halfHeight),"," i = 0,"," value,"," angle = 0,"," lc,"," la,"," lw,"," wedgeStyle,"," marker,"," graphOrder = this.get(\"graphOrder\"),"," isCanvas = Y.Graphic.NAME == \"canvasGraphic\";"," for(; i < itemCount; ++i)"," {"," value = parseFloat(values[i]);"," "," values.push(value);"," if(!isNaN(value))"," {"," totalValue += value;"," }"," }"," "," tfc = fillColors ? fillColors.concat() : null;"," tfa = fillAlphas ? fillAlphas.concat() : null;"," this._createMarkerCache();"," if(isCanvas)"," {"," this._setMap();"," this._image.width = w;"," this._image.height = h;"," }"," for(i = 0; i < itemCount; i++)"," {"," value = values[i];"," if(totalValue === 0)"," {"," angle = 360 / values.length;"," }"," else"," {"," angle = 360 * (value / totalValue);"," }"," if(tfc && tfc.length < 1)"," {"," tfc = fillColors.concat();"," }"," if(tfa && tfa.length < 1)"," {"," tfa = fillAlphas.concat();"," }"," if(tbw && tbw.length < 1)"," {"," tbw = borderWeights.concat();"," }"," if(tbw && tbc.length < 1)"," {"," tbc = borderColors.concat();"," }"," if(tba && tba.length < 1)"," {"," tba = borderAlphas.concat();"," }"," lw = tbw ? tbw.shift() : null;"," lc = tbc ? tbc.shift() : null;"," la = tba ? tba.shift() : null;"," startAngle += angle;"," wedgeStyle = {"," border: {"," color:lc,"," weight:lw,"," alpha:la"," },"," fill: {"," color:tfc ? tfc.shift() : this._getDefaultColor(i, \"slice\"),"," alpha:tfa ? tfa.shift() : null"," },"," type: \"pieslice\","," arc: angle,"," radius: radius,"," startAngle: startAngle,"," cx: halfWidth,"," cy: halfHeight,"," width: w,"," height: h"," };"," marker = this.getMarker(wedgeStyle, graphOrder, i);"," if(isCanvas)"," {"," this._addHotspot(wedgeStyle, graphOrder, i);"," }"," }"," this._clearMarkerCache();"," },",""," /**"," * Adds an interactive map when rendering in canvas."," *"," * @method _addHotspot"," * @param {Object} cfg Object containing data used to draw the hotspot"," * @param {Number} seriesIndex Index of series in the `seriesCollection`."," * @param {Number} index Index of the marker using the hotspot."," * @private"," */"," _addHotspot: function(cfg, seriesIndex, index)"," {"," var areaNode = DOCUMENT.createElement(\"area\"),"," i = 1,"," x = cfg.cx,"," y = cfg.cy, "," arc = cfg.arc,"," startAngle = cfg.startAngle - arc, "," endAngle = cfg.startAngle,"," radius = cfg.radius, "," ax = x + Math.cos(startAngle / 180 * Math.PI) * radius,"," ay = y + Math.sin(startAngle / 180 * Math.PI) * radius,"," bx = x + Math.cos(endAngle / 180 * Math.PI) * radius,"," by = y + Math.sin(endAngle / 180 * Math.PI) * radius,"," numPoints = Math.floor(arc/10) - 1,"," divAngle = (arc/(Math.floor(arc/10)) / 180) * Math.PI,"," angleCoord = Math.atan((ay - y)/(ax - x)),"," pts = x + \", \" + y + \", \" + ax + \", \" + ay,"," cosAng,"," sinAng,"," multDivAng;"," for(i = 1; i <= numPoints; ++i)"," {"," multDivAng = divAngle * i;"," cosAng = Math.cos(angleCoord + multDivAng);"," sinAng = Math.sin(angleCoord + multDivAng);"," if(startAngle <= 90)"," {"," pts += \", \" + (x + (radius * Math.cos(angleCoord + (divAngle * i))));"," pts += \", \" + (y + (radius * Math.sin(angleCoord + (divAngle * i))));"," }"," else"," {"," pts += \", \" + (x - (radius * Math.cos(angleCoord + (divAngle * i))));"," pts += \", \" + (y - (radius * Math.sin(angleCoord + (divAngle * i))));"," }"," }"," pts += \", \" + bx + \", \" + by;"," pts += \", \" + x + \", \" + y;"," this._map.appendChild(areaNode);"," areaNode.setAttribute(\"class\", SERIES_MARKER);"," areaNode.setAttribute(\"id\", \"hotSpot_\" + seriesIndex + \"_\" + index);"," areaNode.setAttribute(\"shape\", \"polygon\");"," areaNode.setAttribute(\"coords\", pts);"," this._areaNodes.push(areaNode);",""," },",""," /**"," * Resizes and positions markers based on a mouse interaction."," *"," * @method updateMarkerState"," * @param {String} type state of the marker"," * @param {Number} i index of the marker"," * @protected"," */"," updateMarkerState: function(type, i)"," {"," if(this._markers[i])"," {"," var state = this._getState(type),"," markerStyles,"," indexStyles,"," marker = this._markers[i],"," styles = this.get(\"styles\").marker; "," markerStyles = state == \"off\" || !styles[state] ? styles : styles[state]; "," indexStyles = this._mergeStyles(markerStyles, {});"," indexStyles.fill.color = indexStyles.fill.colors[i % indexStyles.fill.colors.length];"," indexStyles.fill.alpha = indexStyles.fill.alphas[i % indexStyles.fill.alphas.length];"," marker.set(indexStyles);"," }"," },"," "," /**"," * Creates a shape to be used as a marker."," *"," * @method _createMarker"," * @param {Object} styles Hash of style properties."," * @param {Number} order Order of the series."," * @param {Number} index Index within the series associated with the marker."," * @return Shape"," * @private"," */"," _createMarker: function(styles, order, index)"," {"," var graphic = this.get(\"graphic\"),"," marker,"," cfg = Y.clone(styles);"," graphic.set(\"autoDraw\", false);"," marker = graphic.addShape(cfg); "," marker.addClass(SERIES_MARKER);"," return marker;"," },"," "," /**"," * Creates a cache of markers for reuse."," *"," * @method _createMarkerCache"," * @private"," */"," _clearMarkerCache: function()"," {"," var len = this._markerCache.length,"," i = 0,"," marker;"," for(; i < len; ++i)"," {"," marker = this._markerCache[i];"," if(marker)"," {"," marker.destroy();"," }"," }"," this._markerCache = [];"," },",""," /**"," * Gets the default style values for the markers."," *"," * @method _getPlotDefaults"," * @return Object"," * @private"," */"," _getPlotDefaults: function()"," {"," var defs = {"," padding:{"," top: 0,"," left: 0,"," right: 0,"," bottom: 0"," },"," fill:{"," alphas:[\"1\"]"," },"," border: {"," weight: 0,"," alpha: 1"," }"," };"," defs.fill.colors = this._defaultSliceColors;"," defs.border.colors = this._defaultBorderColors;"," return defs;"," },",""," /**"," * Collection of default colors used for lines in a series when not specified by user."," *"," * @property _defaultLineColors"," * @type Array"," * @protected"," */"," _defaultLineColors:[\"#426ab3\", \"#d09b2c\", \"#000000\", \"#b82837\", \"#b384b5\", \"#ff7200\", \"#779de3\", \"#cbc8ba\", \"#7ed7a6\", \"#007a6c\"],",""," /**"," * Collection of default colors used for marker fills in a series when not specified by user."," *"," * @property _defaultFillColors"," * @type Array"," * @protected"," */"," _defaultFillColors:[\"#6084d0\", \"#eeb647\", \"#6c6b5f\", \"#d6484f\", \"#ce9ed1\", \"#ff9f3b\", \"#93b7ff\", \"#e0ddd0\", \"#94ecba\", \"#309687\"],"," "," /**"," * Collection of default colors used for marker borders in a series when not specified by user."," *"," * @property _defaultBorderColors"," * @type Array"," * @protected"," */"," _defaultBorderColors:[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"],"," "," /**"," * Collection of default colors used for area fills, histogram fills and pie fills in a series when not specified by user."," *"," * @property _defaultSliceColors"," * @type Array"," * @protected"," */"," _defaultSliceColors: [\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"],",""," /**"," * Colors used if style colors are not specified"," *"," * @method _getDefaultColor"," * @param {Number} index Index indicating the series order."," * @param {String} type Indicates which type of object needs the color."," * @return String"," * @protected"," */"," _getDefaultColor: function(index, type)"," {"," var colors = {"," line: this._defaultLineColors,"," fill: this._defaultFillColors,"," border: this._defaultBorderColors,"," slice: this._defaultSliceColors"," },"," col = colors[type],"," l = col.length;"," index = index || 0;"," if(index >= l)"," {"," index = index % l;"," }"," type = type || \"fill\";"," return colors[type][index];"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default pie"," */"," type: { "," value: \"pie\""," },"," "," /**"," * Order of this instance of this `type`."," *"," * @attribute order"," * @type Number"," */"," order: {},",""," /**"," * Reference to the `Graph` in which the series is drawn into."," *"," * @attribute graph"," * @type Graph"," */"," graph: {},"," "," /**"," * Reference to the `Axis` instance used for assigning "," * category values to the graph."," *"," * @attribute categoryAxis"," * @type Axis"," */"," categoryAxis: {"," value: null,",""," validator: function(value)"," {"," return value !== this.get(\"categoryAxis\");"," }"," },"," "," /**"," * Reference to the `Axis` instance used for assigning "," * series values to the graph."," *"," * @attribute categoryAxis"," * @type Axis"," */"," valueAxis: {"," value: null,",""," validator: function(value)"," {"," return value !== this.get(\"valueAxis\");"," }"," },",""," /**"," * Indicates which array to from the hash of value arrays in "," * the category `Axis` instance."," *"," * @attribute categoryKey"," * @type String"," */"," categoryKey: {"," value: null,",""," validator: function(value)"," {"," return value !== this.get(\"categoryKey\");"," }"," },"," /**"," * Indicates which array to from the hash of value arrays in "," * the value `Axis` instance."," *"," * @attribute valueKey"," * @type String"," */"," valueKey: {"," value: null,",""," validator: function(value)"," {"," return value !== this.get(\"valueKey\");"," }"," },",""," /**"," * Name used for for displaying category data"," *"," * @attribute categoryDisplayName"," * @type String"," */"," categoryDisplayName: {"," setter: function(val)"," {"," this._categoryDisplayName = val;"," return val;"," },",""," getter: function()"," {"," return this._categoryDisplayName || this.get(\"categoryKey\");"," }"," },",""," /**"," * Name used for for displaying value data"," *"," * @attribute valueDisplayName"," * @type String"," */"," valueDisplayName: {"," setter: function(val)"," {"," this._valueDisplayName = val;"," return val;"," },",""," getter: function()"," {"," return this._valueDisplayName || this.get(\"valueKey\");"," }"," },"," "," /**"," * @attribute slices"," * @type Array"," * @private"," */"," slices: null"," "," /**"," * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>colors</dt><dd>An array of colors to be used for the marker fills. The color for each marker is retrieved from the "," * array below:<br/>"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alphas</dt><dd>An array of alpha references (Number from 0 to 1) indicating the opacity of each marker fill. The default value is [1].</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>An array of colors to be used for the marker borders. The color for each marker is retrieved from the"," * array below:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","/**"," * Gridlines draws gridlines on a Graph."," *"," * @module charts"," * @submodule charts-base"," * @class Gridlines"," * @constructor"," * @extends Base"," * @uses Renderer"," */","Y.Gridlines = Y.Base.create(\"gridlines\", Y.Base, [Y.Renderer], {"," /**"," * Reference to the `Path` element used for drawing Gridlines."," *"," * @property _path"," * @type Path"," * @private"," */"," _path: null,",""," /**"," * Removes the Gridlines."," *"," * @method remove"," * @private"," */"," remove: function()"," {"," var path = this._path;"," if(path)"," {"," path.destroy();"," }"," },",""," /**"," * Draws the gridlines"," *"," * @method draw"," * @protected"," */"," draw: function()"," {"," if(this.get(\"axis\") && this.get(\"graph\"))"," {"," this._drawGridlines();"," }"," },",""," /**"," * Algorithm for drawing gridlines"," *"," * @method _drawGridlines"," * @private"," */"," _drawGridlines: function()"," {"," var path,"," axis = this.get(\"axis\"),"," axisPosition = axis.get(\"position\"),"," points,"," i = 0,"," l,"," direction = this.get(\"direction\"),"," graph = this.get(\"graph\"),"," w = graph.get(\"width\"),"," h = graph.get(\"height\"),"," line = this.get(\"styles\").line,"," color = line.color,"," weight = line.weight,"," alpha = line.alpha,"," lineFunction = direction == \"vertical\" ? this._verticalLine : this._horizontalLine;"," if(isFinite(w) && isFinite(h) && w > 0 && h > 0)"," {"," if(axisPosition != \"none\" && axis && axis.get(\"tickPoints\"))"," {"," points = axis.get(\"tickPoints\");"," l = points.length;"," }"," else"," {"," points = [];"," l = axis.get(\"styles\").majorUnit.count;"," for(; i < l; ++i)"," {"," points[i] = {"," x: w * (i/(l-1)),"," y: h * (i/(l-1))"," };"," }"," i = 0;"," }"," path = graph.get(\"gridlines\");"," path.set(\"width\", w);"," path.set(\"height\", h);"," path.set(\"stroke\", {"," weight: weight,"," color: color,"," opacity: alpha"," });"," for(; i < l; ++i)"," {"," lineFunction(path, points[i], w, h);"," }"," path.end();"," }"," },",""," /**"," * Algorithm for horizontal lines."," *"," * @method _horizontalLine"," * @param {Path} path Reference to path element"," * @param {Object} pt Coordinates corresponding to a major unit of an axis."," * @param {Number} w Width of the Graph"," * @param {Number} h Height of the Graph"," * @private"," */"," _horizontalLine: function(path, pt, w, h)"," {"," path.moveTo(0, pt.y);"," path.lineTo(w, pt.y);"," },",""," /**"," * Algorithm for vertical lines."," *"," * @method _verticalLine"," * @param {Path} path Reference to path element"," * @param {Object} pt Coordinates corresponding to a major unit of an axis."," * @param {Number} w Width of the Graph"," * @param {Number} h Height of the Graph"," * @private"," */"," _verticalLine: function(path, pt, w, h)"," {"," path.moveTo(pt.x, 0);"," path.lineTo(pt.x, h);"," },"," "," /**"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," * @protected"," */"," _getDefaultStyles: function()"," {"," var defs = {"," line: {"," color:\"#f0efe9\","," weight: 1,"," alpha: 1"," }"," };"," return defs;"," }","","},","{"," ATTRS: {"," /**"," * Indicates the direction of the gridline."," *"," * @attribute direction"," * @type String"," */"," direction: {},"," "," /**"," * Indicate the `Axis` in which to bind"," * the gridlines."," *"," * @attribute axis"," * @type Axis"," */"," axis: {},"," "," /**"," * Indicates the `Graph` in which the gridlines "," * are drawn."," *"," * @attribute graph"," * @type Graph"," */"," graph: {}"," }","});","/**"," * Graph manages and contains series instances for a `CartesianChart`"," * instance."," *"," * @module charts"," * @submodule charts-base"," * @class Graph"," * @constructor"," * @extends Widget"," * @uses Renderer"," */","Y.Graph = Y.Base.create(\"graph\", Y.Widget, [Y.Renderer], {"," /**"," * @method bindUI"," * @private"," */"," bindUI: function()"," {"," var bb = this.get(\"boundingBox\");"," bb.setStyle(\"position\", \"absolute\");"," this.after(\"widthChange\", this._sizeChangeHandler);"," this.after(\"heightChange\", this._sizeChangeHandler);"," this.after(\"stylesChange\", this._updateStyles);"," this.after(\"groupMarkersChange\", this._drawSeries);"," },",""," /**"," * @method syncUI"," * @private"," */"," syncUI: function()"," {"," var background,"," cb,"," bg,"," sc = this.get(\"seriesCollection\"),"," series,"," i = 0,"," len = sc ? sc.length : 0,"," hgl = this.get(\"horizontalGridlines\"),"," vgl = this.get(\"verticalGridlines\");"," if(this.get(\"showBackground\"))"," {"," background = this.get(\"background\");"," cb = this.get(\"contentBox\");"," bg = this.get(\"styles\").background;"," bg.stroke = bg.border;"," bg.stroke.opacity = bg.stroke.alpha;"," bg.fill.opacity = bg.fill.alpha;"," bg.width = this.get(\"width\");"," bg.height = this.get(\"height\");"," bg.type = bg.shape;"," background.set(bg);"," }"," for(; i < len; ++i)"," {"," series = sc[i];"," if(series instanceof Y.CartesianSeries)"," {"," series.render();"," }"," }"," if(hgl && hgl instanceof Y.Gridlines)"," {"," hgl.draw();"," }"," if(vgl && vgl instanceof Y.Gridlines)"," {"," vgl.draw();"," }"," },"," "," /**"," * Object of arrays containing series mapped to a series type."," *"," * @property seriesTypes"," * @type Object"," * @private"," */"," seriesTypes: null,",""," /**"," * Returns a series instance based on an index."," * "," * @method getSeriesByIndex"," * @param {Number} val index of the series"," * @return CartesianSeries"," */"," getSeriesByIndex: function(val)"," {"," var col = this.get(\"seriesCollection\"),"," series;"," if(col && col.length > val)"," {"," series = col[val];"," }"," return series;"," },",""," /**"," * Returns a series instance based on a key value."," * "," * @method getSeriesByKey"," * @param {String} val key value of the series"," * @return CartesianSeries"," */"," getSeriesByKey: function(val)"," {"," var obj = this._seriesDictionary,"," series;"," if(obj && obj.hasOwnProperty(val))"," {"," series = obj[val];"," }"," return series;"," },",""," /**"," * Adds dispatcher to a `_dispatcher` used to"," * to ensure all series have redrawn before for firing event."," *"," * @method addDispatcher"," * @param {CartesianSeries} val series instance to add"," * @protected"," */"," addDispatcher: function(val)"," {"," if(!this._dispatchers)"," {"," this._dispatchers = [];"," }"," this._dispatchers.push(val);"," },",""," /**"," * Collection of series to be displayed in the graph."," *"," * @property _seriesCollection"," * @type Array"," * @private "," */"," _seriesCollection: null,"," "," /**"," * Object containing key value pairs of `CartesianSeries` instances."," *"," * @property _seriesDictionary"," * @type Object"," * @private"," */"," _seriesDictionary: null,",""," /**"," * Parses series instances to be displayed in the graph."," *"," * @method _parseSeriesCollection"," * @param {Array} Collection of `CartesianSeries` instances or objects container `CartesianSeries` attributes values."," * @private"," */"," _parseSeriesCollection: function(val)"," {"," if(!val)"," {"," return;"," } "," var len = val.length,"," i = 0,"," series,"," seriesKey;"," this._seriesCollection = [];"," this._seriesDictionary = {};"," this.seriesTypes = [];"," for(; i < len; ++i)"," { "," series = val[i];"," if(!(series instanceof Y.CartesianSeries) && !(series instanceof Y.PieSeries))"," {"," this._createSeries(series);"," continue;"," }"," this._addSeries(series);"," }"," len = this._seriesCollection.length;"," for(i = 0; i < len; ++i)"," {"," series = this.get(\"seriesCollection\")[i];"," seriesKey = series.get(\"direction\") == \"horizontal\" ? \"yKey\" : \"xKey\";"," this._seriesDictionary[series.get(seriesKey)] = series;"," }"," },",""," /**"," * Adds a series to the graph."," *"," * @method _addSeries"," * @param {CartesianSeries} series Series to add to the graph."," * @private"," */"," _addSeries: function(series)"," {"," var type = series.get(\"type\"),"," seriesCollection = this.get(\"seriesCollection\"),"," graphSeriesLength = seriesCollection.length,"," seriesTypes = this.seriesTypes,"," typeSeriesCollection; "," if(!series.get(\"graph\")) "," {"," series.set(\"graph\", this);"," }"," seriesCollection.push(series);"," if(!seriesTypes.hasOwnProperty(type))"," {"," this.seriesTypes[type] = [];"," }"," typeSeriesCollection = this.seriesTypes[type];"," series.set(\"graphOrder\", graphSeriesLength);"," series.set(\"order\", typeSeriesCollection.length);"," typeSeriesCollection.push(series);"," this.addDispatcher(series);"," series.after(\"drawingComplete\", Y.bind(this._drawingCompleteHandler, this));"," this.fire(\"seriesAdded\", series);"," },",""," /**"," * Creates a `CartesianSeries` instance from an object containing attribute key value pairs. The key value pairs include attributes for the specific series and a type value which defines the type of"," * series to be used. "," *"," * @method createSeries"," * @param {Object} seriesData Series attribute key value pairs."," * @private"," */"," _createSeries: function(seriesData)"," {"," var type = seriesData.type,"," seriesCollection = this.get(\"seriesCollection\"),"," seriesTypes = this.seriesTypes,"," typeSeriesCollection,"," seriesType,"," series;"," seriesData.graph = this;"," if(!seriesTypes.hasOwnProperty(type))"," {"," seriesTypes[type] = [];"," }"," typeSeriesCollection = seriesTypes[type];"," seriesData.graph = this;"," seriesData.order = typeSeriesCollection.length;"," seriesData.graphOrder = seriesCollection.length;"," seriesType = this._getSeries(seriesData.type);"," series = new seriesType(seriesData);"," this.addDispatcher(series);"," series.after(\"drawingComplete\", Y.bind(this._drawingCompleteHandler, this));"," typeSeriesCollection.push(series);"," seriesCollection.push(series);"," if(this.get(\"rendered\"))"," {"," series.render();"," }"," },"," "," /**"," * String reference for pre-defined `Series` classes."," *"," * @property _seriesMap"," * @type Object"," * @private"," */"," _seriesMap: {"," line : Y.LineSeries,"," column : Y.ColumnSeries,"," bar : Y.BarSeries,"," area : Y.AreaSeries,"," candlestick : Y.CandlestickSeries,"," ohlc : Y.OHLCSeries,"," stackedarea : Y.StackedAreaSeries,"," stackedline : Y.StackedLineSeries,"," stackedcolumn : Y.StackedColumnSeries,"," stackedbar : Y.StackedBarSeries,"," markerseries : Y.MarkerSeries,"," spline : Y.SplineSeries,"," areaspline : Y.AreaSplineSeries,"," stackedspline : Y.StackedSplineSeries,"," stackedareaspline : Y.StackedAreaSplineSeries,"," stackedmarkerseries : Y.StackedMarkerSeries,"," pie : Y.PieSeries,"," combo : Y.ComboSeries,"," stackedcombo : Y.StackedComboSeries,"," combospline : Y.ComboSplineSeries,"," stackedcombospline : Y.StackedComboSplineSeries"," },",""," /**"," * Returns a specific `CartesianSeries` class based on key value from a look up table of a direct reference to a class. When specifying a key value, the following options"," * are available:"," *"," * <table>"," * <tr><th>Key Value</th><th>Class</th></tr>"," * <tr><td>line</td><td>Y.LineSeries</td></tr> "," * <tr><td>column</td><td>Y.ColumnSeries</td></tr> "," * <tr><td>bar</td><td>Y.BarSeries</td></tr> "," * <tr><td>area</td><td>Y.AreaSeries</td></tr> "," * <tr><td>stackedarea</td><td>Y.StackedAreaSeries</td></tr> "," * <tr><td>stackedline</td><td>Y.StackedLineSeries</td></tr> "," * <tr><td>stackedcolumn</td><td>Y.StackedColumnSeries</td></tr> "," * <tr><td>stackedbar</td><td>Y.StackedBarSeries</td></tr> "," * <tr><td>markerseries</td><td>Y.MarkerSeries</td></tr> "," * <tr><td>spline</td><td>Y.SplineSeries</td></tr> "," * <tr><td>areaspline</td><td>Y.AreaSplineSeries</td></tr> "," * <tr><td>stackedspline</td><td>Y.StackedSplineSeries</td></tr>"," * <tr><td>stackedareaspline</td><td>Y.StackedAreaSplineSeries</td></tr>"," * <tr><td>stackedmarkerseries</td><td>Y.StackedMarkerSeries</td></tr>"," * <tr><td>pie</td><td>Y.PieSeries</td></tr>"," * <tr><td>combo</td><td>Y.ComboSeries</td></tr>"," * <tr><td>stackedcombo</td><td>Y.StackedComboSeries</td></tr>"," * <tr><td>combospline</td><td>Y.ComboSplineSeries</td></tr>"," * <tr><td>stackedcombospline</td><td>Y.StackedComboSplineSeries</td></tr>"," * </table>"," * "," * When referencing a class directly, you can specify any of the above classes or any custom class that extends `CartesianSeries` or `PieSeries`."," *"," * @method _getSeries"," * @param {String | Object} type Series type."," * @return CartesianSeries"," * @private"," */"," _getSeries: function(type)"," {"," var seriesClass;"," if(Y_Lang.isString(type))"," {"," seriesClass = this._seriesMap[type];"," }"," else "," {"," seriesClass = type;"," }"," return seriesClass;"," },",""," /**"," * Event handler for marker events."," *"," * @method _markerEventHandler"," * @param {Object} e Event object."," * @private"," */"," _markerEventHandler: function(e)"," {"," var type = e.type,"," markerNode = e.currentTarget,"," strArr = markerNode.getAttribute(\"id\").split(\"_\"),"," series = this.getSeriesByIndex(strArr[1]),"," index = strArr[2];"," series.updateMarkerState(type, index);"," },",""," /**"," * Collection of `CartesianSeries` instances to be redrawn."," *"," * @property _dispatchers"," * @type Array"," * @private"," */"," _dispatchers: null,",""," /**"," * Updates the `Graph` styles."," *"," * @method _updateStyles"," * @private"," */"," _updateStyles: function()"," {"," var styles = this.get(\"styles\").background,"," border = styles.border;"," border.opacity = border.alpha;"," styles.stroke = border;"," styles.fill.opacity = styles.fill.alpha;"," this.get(\"background\").set(styles);"," this._sizeChangeHandler();"," },",""," /**"," * Event handler for size changes."," *"," * @method _sizeChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _sizeChangeHandler: function(e)"," {"," var hgl = this.get(\"horizontalGridlines\"),"," vgl = this.get(\"verticalGridlines\"),"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," bg = this.get(\"styles\").background,"," weight,"," background;"," if(bg && bg.border)"," {"," weight = bg.border.weight || 0;"," }"," if(this.get(\"showBackground\"))"," {"," background = this.get(\"background\");"," if(w && h)"," {"," background.set(\"width\", w);"," background.set(\"height\", h);"," }"," }"," if(this._gridlines)"," {"," this._gridlines.clear();"," }"," if(hgl && hgl instanceof Y.Gridlines)"," {"," hgl.draw();"," }"," if(vgl && vgl instanceof Y.Gridlines)"," {"," vgl.draw();"," }"," this._drawSeries();"," },",""," /**"," * Draws each series."," *"," * @method _drawSeries"," * @private"," */"," _drawSeries: function()"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," var sc,"," i,"," len,"," graphic = this.get(\"graphic\");"," graphic.set(\"autoDraw\", false);"," this._callLater = false;"," this._drawing = true;"," sc = this.get(\"seriesCollection\");"," i = 0;"," len = sc ? sc.length : 0;"," for(; i < len; ++i)"," {"," sc[i].draw();"," if((!sc[i].get(\"xcoords\") || !sc[i].get(\"ycoords\")) && !sc[i] instanceof Y.PieSeries)"," {"," this._callLater = true;"," break;"," }"," }"," this._drawing = false;"," if(this._callLater)"," {"," this._drawSeries();"," }"," }, ",""," /**"," * Event handler for series drawingComplete event."," *"," * @method _drawingCompleteHandler"," * @param {Object} e Event object."," * @private"," */"," _drawingCompleteHandler: function(e)"," {"," var series = e.currentTarget,"," graphic,"," index = Y.Array.indexOf(this._dispatchers, series);"," if(index > -1)"," {"," this._dispatchers.splice(index, 1);"," }"," if(this._dispatchers.length < 1)"," {"," graphic = this.get(\"graphic\");"," if(!graphic.get(\"autoDraw\"))"," {"," graphic._redraw();"," }"," this.fire(\"chartRendered\");"," }"," },",""," /**"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," * @protected"," */"," _getDefaultStyles: function()"," {"," var defs = {"," background: {"," shape: \"rect\","," fill:{"," color:\"#faf9f2\""," },"," border: {"," color:\"#dad8c9\","," weight: 1"," }"," }"," };"," return defs;"," },",""," /**"," * Destructor implementation Graph class. Removes all Graphic instances from the widget."," *"," * @method destructor"," * @protected"," */"," destructor: function()"," {"," if(this._graphic)"," {"," this._graphic.destroy();"," this._graphic = null;"," }"," if(this._background)"," {"," this._background.get(\"graphic\").destroy();"," this._background = null;"," }"," if(this._gridlines)"," {"," this._gridlines.get(\"graphic\").destroy();"," this._gridlines = null;"," }"," }","}, {"," ATTRS: {"," /**"," * The x-coordinate for the graph."," *"," * @attribute x"," * @type Number"," * @protected"," */"," x: {"," setter: function(val)"," {"," this.get(\"boundingBox\").setStyle(\"left\", val + \"px\");"," return val;"," }"," },",""," /**"," * The y-coordinate for the graph."," *"," * @attribute y"," * @type Number"," * @protected"," */"," y: {"," setter: function(val)"," {"," this.get(\"boundingBox\").setStyle(\"top\", val + \"px\");"," return val;"," }"," },",""," /**"," * Reference to the chart instance using the graph."," *"," * @attribute chart"," * @type ChartBase"," * @readOnly"," */"," chart: {},",""," /**"," * Collection of series. When setting the `seriesCollection` the array can contain a combination of either"," * `CartesianSeries` instances or object literals with properties that will define a series."," *"," * @attribute seriesCollection"," * @type CartesianSeries"," */"," seriesCollection: {"," getter: function()"," {"," return this._seriesCollection;"," },",""," setter: function(val)"," {"," this._parseSeriesCollection(val);"," return this._seriesCollection;"," }"," },"," "," /**"," * Indicates whether the `Graph` has a background."," *"," * @attribute showBackground"," * @type Boolean"," * @default true"," */"," showBackground: {"," value: true"," },",""," /**"," * Read-only hash lookup for all series on in the `Graph`."," *"," * @attribute seriesDictionary"," * @type Object"," * @readOnly"," */"," seriesDictionary: {"," readOnly: true,",""," getter: function()"," {"," return this._seriesDictionary;"," }"," },",""," /**"," * Reference to the horizontal `Gridlines` instance."," *"," * @attribute horizontalGridlines"," * @type Gridlines"," * @default null"," */"," horizontalGridlines: {"," value: null,",""," setter: function(val)"," {"," var gl = this.get(\"horizontalGridlines\");"," if(gl && gl instanceof Y.Gridlines)"," {"," gl.remove();"," }"," if(val instanceof Y.Gridlines)"," {"," gl = val;"," val.set(\"graph\", this);"," return val;"," }"," else if(val && val.axis)"," {"," gl = new Y.Gridlines({direction:\"horizontal\", axis:val.axis, graph:this, styles:val.styles});"," return gl;"," }"," }"," },"," "," /**"," * Reference to the vertical `Gridlines` instance."," *"," * @attribute verticalGridlines"," * @type Gridlines"," * @default null"," */"," verticalGridlines: {"," value: null,",""," setter: function(val)"," {"," var gl = this.get(\"verticalGridlines\");"," if(gl && gl instanceof Y.Gridlines)"," {"," gl.remove();"," }"," if(val instanceof Y.Gridlines)"," {"," gl = val;"," val.set(\"graph\", this);"," return val;"," }"," else if(val && val.axis)"," {"," gl = new Y.Gridlines({direction:\"vertical\", axis:val.axis, graph:this, styles:val.styles});"," return gl;"," }"," }"," },",""," /**"," * Reference to graphic instance used for the background."," *"," * @attribute background"," * @type Graphic"," * @readOnly"," */"," background: {"," getter: function()"," {"," if(!this._background)"," {"," this._backgroundGraphic = new Y.Graphic({render:this.get(\"contentBox\")});"," this._backgroundGraphic.get(\"node\").style.zIndex = 0; "," this._background = this._backgroundGraphic.addShape({type: \"rect\"});"," }"," return this._background;"," }"," },",""," /**"," * Reference to graphic instance used for gridlines."," *"," * @attribute gridlines"," * @type Graphic"," * @readOnly"," */"," gridlines: {"," readOnly: true,",""," getter: function()"," {"," if(!this._gridlines)"," {"," this._gridlinesGraphic = new Y.Graphic({render:this.get(\"contentBox\")});"," this._gridlinesGraphic.get(\"node\").style.zIndex = 1; "," this._gridlines = this._gridlinesGraphic.addShape({type: \"path\"});"," }"," return this._gridlines;"," }"," },"," "," /**"," * Reference to graphic instance used for series."," *"," * @attribute graphic"," * @type Graphic"," * @readOnly"," */"," graphic: {"," readOnly: true,",""," getter: function() "," {"," if(!this._graphic)"," {"," this._graphic = new Y.Graphic({render:this.get(\"contentBox\")});"," this._graphic.get(\"node\").style.zIndex = 2; "," this._graphic.set(\"autoDraw\", false);"," }"," return this._graphic;"," }"," },",""," /**"," * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance."," *"," * @attribute groupMarkers"," * @type Boolean"," */"," groupMarkers: {"," value: false"," }",""," /**"," * Style properties used for drawing a background. Below are the default values:"," * <dl>"," * <dt>background</dt><dd>An object containing the following values:"," * <dl>"," * <dt>fill</dt><dd>Defines the style properties for the fill. Contains the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is #faf9f2.</dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the background fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>Defines the style properties for the border. Contains the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is #dad8c9.</dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the background border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * </dl>"," * </dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","/**"," * The ChartBase class is an abstract class used to create charts."," *"," * @module charts"," * @submodule charts-base"," * @class ChartBase"," * @constructor"," */","function ChartBase() {}","","ChartBase.ATTRS = {"," /**"," * Data used to generate the chart."," * "," * @attribute dataProvider"," * @type Array"," */"," dataProvider: {"," lazyAdd: false,",""," valueFn: function()"," {"," var defDataProvider = [];"," if(!this._seriesKeysExplicitlySet)"," {"," this._seriesKeys = this._buildSeriesKeys(defDataProvider);"," }"," return defDataProvider;"," },",""," setter: function(val)"," {"," var dataProvider = this._setDataValues(val);"," if(!this._seriesKeysExplicitlySet)"," {"," this._seriesKeys = this._buildSeriesKeys(dataProvider);"," }"," return dataProvider;"," }"," },",""," /**"," * A collection of keys that map to the series axes. If no keys are set,"," * they will be generated automatically depending on the data structure passed into "," * the chart."," *"," * @attribute seriesKeys"," * @type Array"," */"," seriesKeys: {"," getter: function()"," {"," return this._seriesKeys;"," },",""," setter: function(val)"," {"," this._seriesKeysExplicitlySet = true;"," this._seriesKeys = val;"," return val;"," }"," },",""," /**"," * Sets the `aria-label` for the chart."," *"," * @attribute ariaLabel"," * @type String"," */"," ariaLabel: {"," value: \"Chart Application\",",""," setter: function(val)"," {"," var cb = this.get(\"contentBox\");"," if(cb)"," {"," cb.setAttribute(\"aria-label\", val);"," }"," return val;"," }"," },"," "," /**"," * Sets the aria description for the chart."," *"," * @attribute ariaDescription"," * @type String"," */"," ariaDescription: {"," value: \"Use the up and down keys to navigate between series. Use the left and right keys to navigate through items in a series.\",",""," setter: function(val)"," {"," if(this._description)"," {"," this._description.setContent(\"\");"," this._description.appendChild(DOCUMENT.createTextNode(val));"," }"," return val;"," }"," },"," "," /**"," * Reference to the default tooltip available for the chart."," * <p>Contains the following properties:</p>"," * <dl>"," * <dt>node</dt><dd>Reference to the actual dom node</dd>"," * <dt>showEvent</dt><dd>Event that should trigger the tooltip</dd>"," * <dt>hideEvent</dt><dd>Event that should trigger the removal of a tooltip (can be an event or an array of events)</dd>"," * <dt>styles</dt><dd>A hash of style properties that will be applied to the tooltip node</dd>"," * <dt>show</dt><dd>Indicates whether or not to show the tooltip</dd>"," * <dt>markerEventHandler</dt><dd>Displays and hides tooltip based on marker events</dd>"," * <dt>planarEventHandler</dt><dd>Displays and hides tooltip based on planar events</dd>"," * <dt>markerLabelFunction</dt><dd>Reference to the function used to format a marker event triggered tooltip's text. The method contains "," * the following arguments:"," * <dl>"," * <dt>categoryItem</dt><dd>An object containing the following:"," * <dl>"," * <dt>axis</dt><dd>The axis to which the category is bound.</dd>"," * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided).</dd>"," * <dt>key</dt><dd>The key of the category.</dd>"," * <dt>value</dt><dd>The value of the category.</dd>"," * </dl>"," * </dd>"," * <dt>valueItem</dt><dd>An object containing the following:"," * <dl>"," * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>"," * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>"," * <dt>key</dt><dd>The key for the series.</dd>"," * <dt>value</dt><dd>The value for the series item.</dd> "," * </dl>"," * </dd>"," * <dt>itemIndex</dt><dd>The index of the item within the series.</dd>"," * <dt>series</dt><dd> The `CartesianSeries` instance of the item.</dd>"," * <dt>seriesIndex</dt><dd>The index of the series in the `seriesCollection`.</dd>"," * </dl>"," * The method returns an `HTMLElement` which is written into the DOM using `appendChild`. If you override this method and choose to return an html string, you"," * will also need to override the tooltip's `setTextFunction` method to accept an html string."," * </dd>"," * <dt>planarLabelFunction</dt><dd>Reference to the function used to format a planar event triggered tooltip's text"," * <dl>"," * <dt>categoryAxis</dt><dd> `CategoryAxis` Reference to the categoryAxis of the chart."," * <dt>valueItems</dt><dd>Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:"," * <dl>"," * <dt>axis</dt><dd>The value axis of the series.</dd>"," * <dt>key</dt><dd>The key for the series.</dd>"," * <dt>value</dt><dd>The value for the series item.</dd>"," * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>"," * </dl> "," * </dd>"," * <dt>index</dt><dd>The index of the item within its series.</dd>"," * <dt>seriesArray</dt><dd>Array of series instances for each value item.</dd>"," * <dt>seriesIndex</dt><dd>The index of the series in the `seriesCollection`.</dd>"," * </dl>"," * </dd>"," * </dl>"," * The method returns an `HTMLElement` which is written into the DOM using `appendChild`. If you override this method and choose to return an html string, you"," * will also need to override the tooltip's `setTextFunction` method to accept an html string."," * </dd>"," * <dt>setTextFunction</dt><dd>Method that writes content returned from `planarLabelFunction` or `markerLabelFunction` into the the tooltip node."," * has the following signature:"," * <dl>"," * <dt>label</dt><dd>The `HTMLElement` that the content is to be added.</dd>"," * <dt>val</dt><dd>The content to be rendered into tooltip. This can be a `String` or `HTMLElement`. If an HTML string is used, it will be rendered as a"," * string.</dd>"," * </dl>"," * </dd>"," * </dl>"," * @attribute tooltip"," * @type Object"," */ "," tooltip: {"," valueFn: \"_getTooltip\",",""," setter: function(val)"," {"," return this._updateTooltip(val);"," }"," },",""," /** "," * The key value used for the chart's category axis. "," *"," * @attribute categoryKey"," * @type String"," * @default category"," */"," categoryKey: {"," value: \"category\""," },"," "," /**"," * Indicates the type of axis to use for the category axis."," *"," * <dl>"," * <dt>category</dt><dd>Specifies a `CategoryAxis`.</dd>"," * <dt>time</dt><dd>Specifies a `TimeAxis</dd>"," * </dl>"," *"," * @attribute categoryType"," * @type String"," * @default category"," */"," categoryType:{"," value:\"category\""," },",""," /**"," * Indicates the the type of interactions that will fire events."," *"," * <dl>"," * <dt>marker</dt><dd>Events will be broadcasted when the mouse interacts with individual markers.</dd>"," * <dt>planar</dt><dd>Events will be broadcasted when the mouse intersects the plane of any markers on the chart.</dd>"," * <dt>none</dt><dd>No events will be broadcasted.</dd>"," * </dl>"," *"," * @attribute interactionType"," * @type String"," * @default marker"," */"," interactionType: {"," value: \"marker\""," },",""," /**"," * Reference to all the axes in the chart."," *"," * @attribute axesCollection"," * @type Array"," */"," axesCollection: {},",""," /**"," * Reference to graph instance."," * "," * @attribute graph"," * @type Graph "," */"," graph: {"," valueFn: \"_getGraph\""," },",""," /**"," * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance."," *"," * @attribute groupMarkers"," * @type Boolean"," */"," groupMarkers: {"," value: false"," }","};","","ChartBase.prototype = {"," /**"," * Handles groupMarkers change event."," *"," * @method _groupMarkersChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _groupMarkersChangeHandler: function(e)"," {"," var graph = this.get(\"graph\"),"," useGroupMarkers = e.newVal;"," if(graph)"," {"," graph.set(\"groupMarkers\", useGroupMarkers);"," }"," },",""," /**"," * Handler for itemRendered event."," *"," * @method _itemRendered"," * @param {Object} e Event object."," * @private"," */"," _itemRendered: function(e)"," {"," this._itemRenderQueue = this._itemRenderQueue.splice(1 + Y.Array.indexOf(this._itemRenderQueue, e.currentTarget), 1);"," if(this._itemRenderQueue.length < 1)"," {"," this._redraw();"," }"," },",""," /**"," * Default value function for the `Graph` attribute."," *"," * @method _getGraph"," * @return Graph"," * @private"," */"," _getGraph: function()"," {"," var graph = new Y.Graph({"," chart:this,"," groupMarkers: this.get(\"groupMarkers\") "," });"," graph.after(\"chartRendered\", Y.bind(function(e) {"," this.fire(\"chartRendered\");"," }, this));"," return graph; "," },",""," /**"," * Returns a series instance by index or key value."," *"," * @method getSeries"," * @param val"," * @return CartesianSeries"," */"," getSeries: function(val)"," {"," var series = null, "," graph = this.get(\"graph\");"," if(graph)"," {"," if(Y_Lang.isNumber(val))"," {"," series = graph.getSeriesByIndex(val);"," }"," else"," {"," series = graph.getSeriesByKey(val);"," }"," }"," return series;"," },",""," /**"," * Returns an `Axis` instance by key reference. If the axis was explicitly set through the `axes` attribute,"," * the key will be the same as the key used in the `axes` object. For default axes, the key for"," * the category axis is the value of the `categoryKey` (`category`). For the value axis, the default "," * key is `values`."," *"," * @method getAxisByKey"," * @param {String} val Key reference used to look up the axis."," * @return Axis"," */"," getAxisByKey: function(val)"," {"," var axis,"," axes = this.get(\"axes\");"," if(axes && axes.hasOwnProperty(val))"," {"," axis = axes[val];"," }"," return axis;"," },",""," /**"," * Returns the category axis for the chart."," *"," * @method getCategoryAxis"," * @return Axis"," */"," getCategoryAxis: function()"," {"," var axis,"," key = this.get(\"categoryKey\"),"," axes = this.get(\"axes\");"," if(axes.hasOwnProperty(key))"," {"," axis = axes[key];"," }"," return axis;"," },",""," /**"," * Default direction of the chart."," *"," * @property _direction"," * @type String"," * @default horizontal"," * @private"," */"," _direction: \"horizontal\","," "," /**"," * Storage for the `dataProvider` attribute."," *"," * @property _dataProvider"," * @type Array"," * @private"," */"," _dataProvider: null,",""," /**"," * Setter method for `dataProvider` attribute."," *"," * @method _setDataValues"," * @param {Array} val Array to be set as `dataProvider`."," * @return Array"," * @private"," */"," _setDataValues: function(val)"," {"," if(Y_Lang.isArray(val[0]))"," {"," var hash, "," dp = [], "," cats = val[0], "," i = 0, "," l = cats.length, "," n, "," sl = val.length;"," for(; i < l; ++i)"," {"," hash = {category:cats[i]};"," for(n = 1; n < sl; ++n)"," {"," hash[\"series\" + n] = val[n][i];"," }"," dp[i] = hash; "," }"," return dp;"," }"," return val;"," },",""," /**"," * Storage for `seriesCollection` attribute."," *"," * @property _seriesCollection"," * @type Array"," * @private "," */"," _seriesCollection: null,",""," /**"," * Setter method for `seriesCollection` attribute."," *"," * @property _setSeriesCollection"," * @param {Array} val Array of either `CartesianSeries` instances or objects containing series attribute key value pairs."," * @private"," */"," _setSeriesCollection: function(val)"," {"," this._seriesCollection = val;"," },"," /**"," * Helper method that returns the axis class that a key references."," *"," * @method _getAxisClass"," * @param {String} t The type of axis."," * @return Axis"," * @private"," */"," _getAxisClass: function(t)"," {"," return this._axisClass[t];"," },"," "," /**"," * Key value pairs of axis types. "," *"," * @property _axisClass"," * @type Object"," * @private"," */"," _axisClass: {"," stacked: Y.StackedAxis,"," numeric: Y.NumericAxis,"," category: Y.CategoryAxis,"," time: Y.TimeAxis"," },",""," /**"," * Collection of axes."," *"," * @property _axes"," * @type Array"," * @private"," */"," _axes: null,",""," /**"," * @method initializer"," * @private"," */"," initializer: function()"," {"," this._itemRenderQueue = [];"," this._seriesIndex = -1;"," this._itemIndex = -1;"," this.after(\"dataProviderChange\", this._dataProviderChangeHandler);"," },",""," /**"," * @method renderUI"," * @private"," */"," renderUI: function()"," {"," var tt = this.get(\"tooltip\"),"," bb = this.get(\"boundingBox\"),"," cb = this.get(\"contentBox\");"," //move the position = absolute logic to a class file"," bb.setStyle(\"position\", \"absolute\");"," cb.setStyle(\"position\", \"absolute\");"," this._addAxes();"," this._addSeries();"," if(tt && tt.show)"," {"," this._addTooltip();"," }"," this._setAriaElements(bb, cb);"," },"," "," /**"," * Creates an aria `live-region`, `aria-label` and `aria-describedby` for the Chart."," *"," * @method _setAriaElements"," * @param {Node} cb Reference to the Chart's `contentBox` attribute."," * @private"," */"," _setAriaElements: function(bb, cb)"," {"," var description = this._getAriaOffscreenNode(),"," id = this.get(\"id\") + \"_description\","," liveRegion = this._getAriaOffscreenNode();"," cb.set(\"tabIndex\", 0);"," cb.set(\"role\", \"img\");"," cb.setAttribute(\"aria-label\", this.get(\"ariaLabel\"));"," cb.setAttribute(\"aria-describedby\", id);"," description.set(\"id\", id);"," description.set(\"tabIndex\", -1);"," description.appendChild(DOCUMENT.createTextNode(this.get(\"ariaDescription\")));"," liveRegion.set(\"id\", \"live-region\");"," liveRegion.set(\"aria-live\", \"polite\");"," liveRegion.set(\"aria-atomic\", \"true\");"," liveRegion.set(\"role\", \"status\");"," bb.setAttribute(\"role\", \"application\");"," bb.appendChild(description);"," bb.appendChild(liveRegion);"," this._description = description;"," this._liveRegion = liveRegion;"," },",""," /**"," * Sets a node offscreen for use as aria-description or aria-live-regin."," *"," * @method _setOffscreen"," * @return Node "," * @private"," */"," _getAriaOffscreenNode: function() "," {"," var node = Y.Node.create(\"<div></div>\"),"," ie = Y.UA.ie,"," clipRect = (ie && ie < 8) ? \"rect(1px 1px 1px 1px)\" : \"rect(1px, 1px, 1px, 1px)\";"," node.setStyle(\"position\", \"absolute\");"," node.setStyle(\"height\", \"1px\"); "," node.setStyle(\"width\", \"1px\"); "," node.setStyle(\"overflow\", \"hidden\");"," node.setStyle(\"clip\", clipRect); "," return node;"," },"," "," /**"," * @method syncUI"," * @private"," */"," syncUI: function()"," {"," this._redraw();"," },",""," /**"," * @method bindUI"," * @private"," */"," bindUI: function()"," {"," this.after(\"tooltipChange\", Y.bind(this._tooltipChangeHandler, this));"," this.after(\"widthChange\", this._sizeChanged);"," this.after(\"heightChange\", this._sizeChanged);"," this.after(\"groupMarkersChange\", this._groupMarkersChangeHandler);"," var tt = this.get(\"tooltip\"),"," hideEvent = \"mouseout\","," showEvent = \"mouseover\","," cb = this.get(\"contentBox\"),"," interactionType = this.get(\"interactionType\"),"," i = 0,"," len,"," markerClassName = \".\" + SERIES_MARKER,"," isTouch = ((WINDOW && (\"ontouchstart\" in WINDOW)) && !(Y.UA.chrome && Y.UA.chrome < 6));"," Y.on(\"keydown\", Y.bind(function(e) {"," var key = e.keyCode,"," numKey = parseFloat(key),"," msg;"," if(numKey > 36 && numKey < 41)"," {"," e.halt();"," msg = this._getAriaMessage(numKey);"," this._liveRegion.setContent(\"\");"," this._liveRegion.appendChild(DOCUMENT.createTextNode(msg));"," }"," }, this), this.get(\"contentBox\"));"," if(interactionType == \"marker\")"," {"," //if touch capabilities, toggle tooltip on touchend. otherwise, the tooltip attribute's hideEvent/showEvent types."," hideEvent = tt.hideEvent;"," showEvent = tt.showEvent;"," if(isTouch)"," {"," Y.delegate(\"touchend\", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);"," //hide active tooltip if the chart is touched"," Y.on(\"touchend\", Y.bind(function(e) {"," e.halt(true);"," if(this._activeMarker)"," {"," this._activeMarker = null;"," this.hideTooltip(e);"," }"," }, this));"," }"," else"," {"," Y.delegate(\"mouseenter\", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);"," Y.delegate(\"mousedown\", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);"," Y.delegate(\"mouseup\", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);"," Y.delegate(\"mouseleave\", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);"," Y.delegate(\"click\", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);"," Y.delegate(\"mousemove\", Y.bind(this._positionTooltip, this), cb, markerClassName);"," }"," }"," else if(interactionType == \"planar\")"," {"," if(isTouch)"," {"," this._overlay.on(\"touchend\", Y.bind(this._planarEventDispatcher, this));"," }"," else"," {"," this._overlay.on(\"mousemove\", Y.bind(this._planarEventDispatcher, this));"," this.on(\"mouseout\", this.hideTooltip);"," }"," }"," if(tt)"," {"," this.on(\"markerEvent:touchend\", Y.bind(function(e) {"," var marker = e.series.get(\"markers\")[e.index];"," if(this._activeMarker && marker === this._activeMarker)"," {"," this._activeMarker = null;"," this.hideTooltip(e);"," }"," else"," {",""," this._activeMarker = marker;"," tt.markerEventHandler.apply(this, [e]);"," }"," }, this));"," if(hideEvent && showEvent && hideEvent == showEvent)"," {"," this.on(interactionType + \"Event:\" + hideEvent, this.toggleTooltip);"," }"," else"," {"," if(showEvent)"," {"," this.on(interactionType + \"Event:\" + showEvent, tt[interactionType + \"EventHandler\"]);"," }"," if(hideEvent)"," {"," if(Y_Lang.isArray(hideEvent))"," {"," len = hideEvent.length;"," for(; i < len; ++i)"," {"," this.on(interactionType + \"Event:\" + hideEvent[i], this.hideTooltip);"," }"," }"," this.on(interactionType + \"Event:\" + hideEvent, this.hideTooltip);"," }"," }"," }"," },"," "," /**"," * Event handler for marker events."," *"," * @method _markerEventDispatcher"," * @param {Object} e Event object."," * @private"," */"," _markerEventDispatcher: function(e)"," {"," var type = e.type,"," cb = this.get(\"contentBox\"),"," markerNode = e.currentTarget,"," strArr = markerNode.getAttribute(\"id\").split(\"_\"),"," index = strArr.pop(),"," seriesIndex = strArr.pop(),"," series = this.getSeries(parseInt(seriesIndex, 10)),"," items = this.getSeriesItems(series, index),"," isTouch = e && e.hasOwnProperty(\"changedTouches\"),"," pageX = isTouch ? e.changedTouches[0].pageX : e.pageX,"," pageY = isTouch ? e.changedTouches[0].pageY : e.pageY,"," x = pageX - cb.getX(),"," y = pageY - cb.getY();"," if(type == \"mouseenter\")"," {"," type = \"mouseover\";"," }"," else if(type == \"mouseleave\")"," {"," type = \"mouseout\";"," }"," series.updateMarkerState(type, index);"," e.halt();"," /**"," * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseover event."," * "," *"," * @event markerEvent:mouseover"," * @preventable false"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," * <dl>"," * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>"," * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>"," * <dt>node</dt><dd>The dom node of the marker.</dd>"," * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>series</dt><dd>Reference to the series of the marker.</dd>"," * <dt>index</dt><dd>Index of the marker in the series.</dd>"," * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>"," * </dl>"," */"," /**"," * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseout event."," *"," * @event markerEvent:mouseout"," * @preventable false"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," * <dl>"," * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>"," * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>"," * <dt>node</dt><dd>The dom node of the marker.</dd>"," * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>series</dt><dd>Reference to the series of the marker.</dd>"," * <dt>index</dt><dd>Index of the marker in the series.</dd>"," * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>"," * </dl>"," */"," /**"," * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mousedown event."," *"," * @event markerEvent:mousedown"," * @preventable false"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," * <dl>"," * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>"," * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>"," * <dt>node</dt><dd>The dom node of the marker.</dd>"," * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>series</dt><dd>Reference to the series of the marker.</dd>"," * <dt>index</dt><dd>Index of the marker in the series.</dd>"," * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>"," * </dl>"," */"," /**"," * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseup event."," *"," * @event markerEvent:mouseup"," * @preventable false"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," * <dl>"," * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>"," * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>"," * <dt>node</dt><dd>The dom node of the marker.</dd>"," * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>series</dt><dd>Reference to the series of the marker.</dd>"," * <dt>index</dt><dd>Index of the marker in the series.</dd>"," * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>"," * </dl>"," */"," /**"," * Broadcasts when `interactionType` is set to `marker` and a series marker has received a click event."," *"," * @event markerEvent:click"," * @preventable false"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," * <dl>"," * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>"," * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>"," * <dt>node</dt><dd>The dom node of the marker.</dd>"," * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>pageX</dt><dd>The x location of the event on the page (including scroll)</dd>"," * <dt>pageY</dt><dd>The y location of the event on the page (including scroll)</dd>"," * <dt>series</dt><dd>Reference to the series of the marker.</dd>"," * <dt>index</dt><dd>Index of the marker in the series.</dd>"," * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>"," * <dt>originEvent</dt><dd>Underlying dom event.</dd>"," * </dl>"," */"," this.fire(\"markerEvent:\" + type, {"," originEvent: e,"," pageX:pageX, "," pageY:pageY, "," categoryItem:items.category, "," valueItem:items.value, "," node:markerNode, "," x:x, "," y:y, "," series:series, "," index:index, "," seriesIndex:seriesIndex"," });"," },",""," /**"," * Event handler for dataProviderChange."," *"," * @method _dataProviderChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _dataProviderChangeHandler: function(e)"," {"," var dataProvider = e.newVal,"," axes,"," i,"," axis;"," this._seriesIndex = -1;"," this._itemIndex = -1;"," if(this instanceof Y.CartesianChart)"," {"," this.set(\"axes\", this.get(\"axes\"));"," this.set(\"seriesCollection\", this.get(\"seriesCollection\"));"," }"," axes = this.get(\"axes\");"," if(axes)"," {"," for(i in axes)"," {"," if(axes.hasOwnProperty(i))"," {"," axis = axes[i];"," if(axis instanceof Y.Axis)"," {"," if(axis.get(\"position\") != \"none\")"," {"," this._addToAxesRenderQueue(axis);"," }"," axis.set(\"dataProvider\", dataProvider);"," }"," }"," }"," }"," },"," "," /**"," * Event listener for toggling the tooltip. If a tooltip is visible, hide it. If not, it "," * will create and show a tooltip based on the event object."," * "," * @method toggleTooltip"," * @param {Object} e Event object."," */"," toggleTooltip: function(e)"," {"," var tt = this.get(\"tooltip\");"," if(tt.visible)"," {"," this.hideTooltip();"," }"," else"," {"," tt.markerEventHandler.apply(this, [e]);"," }"," },",""," /**"," * Shows a tooltip"," *"," * @method _showTooltip"," * @param {String} msg Message to dispaly in the tooltip."," * @param {Number} x x-coordinate "," * @param {Number} y y-coordinate"," * @private"," */"," _showTooltip: function(msg, x, y)"," {"," var tt = this.get(\"tooltip\"),"," node = tt.node;"," if(msg)"," {"," tt.visible = true;"," tt.setTextFunction(node, msg);"," node.setStyle(\"top\", y + \"px\");"," node.setStyle(\"left\", x + \"px\");"," node.setStyle(\"visibility\", \"visible\");"," }"," },",""," /**"," * Positions the tooltip"," *"," * @method _positionTooltip"," * @param {Object} e Event object."," * @private"," */"," _positionTooltip: function(e)"," {"," var tt = this.get(\"tooltip\"),"," node = tt.node,"," cb = this.get(\"contentBox\"),"," x = (e.pageX + 10) - cb.getX(),"," y = (e.pageY + 10) - cb.getY();"," if(node)"," {"," node.setStyle(\"left\", x + \"px\");"," node.setStyle(\"top\", y + \"px\");"," }"," },",""," /**"," * Hides the default tooltip"," *"," * @method hideTooltip"," */"," hideTooltip: function()"," {"," var tt = this.get(\"tooltip\"),"," node = tt.node;"," tt.visible = false;"," node.set(\"innerHTML\", \"\");"," node.setStyle(\"left\", -10000);"," node.setStyle(\"top\", -10000);"," node.setStyle(\"visibility\", \"hidden\");"," },",""," /**"," * Adds a tooltip to the dom."," *"," * @method _addTooltip"," * @private"," */"," _addTooltip: function()"," {"," var tt = this.get(\"tooltip\"),"," id = this.get(\"id\") + \"_tooltip\","," cb = this.get(\"contentBox\"),"," oldNode = DOCUMENT.getElementById(id);"," if(oldNode)"," {"," cb.removeChild(oldNode);"," }"," tt.node.set(\"id\", id);"," tt.node.setStyle(\"visibility\", \"hidden\");"," cb.appendChild(tt.node);"," },",""," /**"," * Updates the tooltip attribute."," *"," * @method _updateTooltip"," * @param {Object} val Object containing properties for the tooltip."," * @return Object"," * @private"," */"," _updateTooltip: function(val)"," {"," var tt = this.get(\"tooltip\") || this._getTooltip(),"," i,"," styles,"," node,"," props = {"," markerLabelFunction:\"markerLabelFunction\","," planarLabelFunction:\"planarLabelFunction\","," setTextFunction:\"setTextFunction\","," showEvent:\"showEvent\","," hideEvent:\"hideEvent\","," markerEventHandler:\"markerEventHandler\","," planarEventHandler:\"planarEventHandler\","," show:\"show\""," };"," if(Y_Lang.isObject(val))"," {"," styles = val.styles;"," node = Y.one(val.node) || tt.node;"," if(styles)"," {"," for(i in styles)"," {"," if(styles.hasOwnProperty(i))"," {"," node.setStyle(i, styles[i]);"," }"," }"," }"," for(i in props)"," {"," if(val.hasOwnProperty(i))"," {"," tt[i] = val[i];"," }"," }"," tt.node = node;"," }"," return tt;"," },",""," /**"," * Default getter for `tooltip` attribute."," *"," * @method _getTooltip"," * @return Object"," * @private"," */"," _getTooltip: function()"," {"," var node = DOCUMENT.createElement(\"div\"),"," tooltipClass = _getClassName(\"chart-tooltip\"),"," tt = {"," setTextFunction: this._setText,"," markerLabelFunction: this._tooltipLabelFunction,"," planarLabelFunction: this._planarLabelFunction,"," show: true,"," hideEvent: \"mouseout\","," showEvent: \"mouseover\","," markerEventHandler: function(e)"," {"," var tt = this.get(\"tooltip\"),"," msg = tt.markerLabelFunction.apply(this, [e.categoryItem, e.valueItem, e.index, e.series, e.seriesIndex]);"," this._showTooltip(msg, e.x + 10, e.y + 10);"," },"," planarEventHandler: function(e)"," {"," var tt = this.get(\"tooltip\"),"," msg ,"," categoryAxis = this.get(\"categoryAxis\");"," msg = tt.planarLabelFunction.apply(this, [categoryAxis, e.valueItem, e.index, e.items, e.seriesIndex]);"," this._showTooltip(msg, e.x + 10, e.y + 10);"," }"," };"," node = Y.one(node);"," node.set(\"id\", this.get(\"id\") + \"_tooltip\");"," node.setStyle(\"fontSize\", \"85%\");"," node.setStyle(\"opacity\", \"0.83\");"," node.setStyle(\"position\", \"absolute\");"," node.setStyle(\"paddingTop\", \"2px\");"," node.setStyle(\"paddingRight\", \"5px\");"," node.setStyle(\"paddingBottom\", \"4px\");"," node.setStyle(\"paddingLeft\", \"2px\");"," node.setStyle(\"backgroundColor\", \"#fff\");"," node.setStyle(\"border\", \"1px solid #dbdccc\");"," node.setStyle(\"pointerEvents\", \"none\");"," node.setStyle(\"zIndex\", 3);"," node.setStyle(\"whiteSpace\", \"noWrap\");"," node.setStyle(\"visibility\", \"hidden\");"," node.addClass(tooltipClass);"," tt.node = Y.one(node);"," return tt;"," },",""," /**"," * Formats tooltip text when `interactionType` is `planar`."," *"," * @method _planarLabelFunction"," * @param {Axis} categoryAxis Reference to the categoryAxis of the chart."," * @param {Array} valueItems Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:"," * <dl>"," * <dt>axis</dt><dd>The value axis of the series.</dd>"," * <dt>key</dt><dd>The key for the series.</dd>"," * <dt>value</dt><dd>The value for the series item.</dd>"," * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>"," * </dl> "," * @param {Number} index The index of the item within its series."," * @param {Array} seriesArray Array of series instances for each value item."," * @param {Number} seriesIndex The index of the series in the `seriesCollection`."," * @return {String | HTML} "," * @private"," */"," _planarLabelFunction: function(categoryAxis, valueItems, index, seriesArray, seriesIndex)"," {"," var msg = DOCUMENT.createElement(\"div\"),"," valueItem,"," i = 0,"," len = seriesArray.length,"," axis,"," categoryValue,"," seriesValue,"," series;"," if(categoryAxis)"," {"," categoryValue = categoryAxis.get(\"labelFunction\").apply(this, [categoryAxis.getKeyValueAt(this.get(\"categoryKey\"), index), categoryAxis.get(\"labelFormat\")]);"," if(!Y_Lang.isObject(categoryValue))"," {"," categoryValue = DOCUMENT.createTextNode(categoryValue);"," }"," msg.appendChild(categoryValue);"," }",""," for(; i < len; ++i)"," {"," series = seriesArray[i];"," if(series.get(\"visible\"))"," {"," valueItem = valueItems[i];"," axis = valueItem.axis;"," seriesValue = axis.get(\"labelFunction\").apply(this, [axis.getKeyValueAt(valueItem.key, index), axis.get(\"labelFormat\")]);"," msg.appendChild(DOCUMENT.createElement(\"br\"));"," msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName));"," msg.appendChild(DOCUMENT.createTextNode(\": \"));"," if(!Y_Lang.isObject(seriesValue))"," {"," seriesValue = DOCUMENT.createTextNode(seriesValue);"," }"," msg.appendChild(seriesValue);"," }"," }"," return msg;"," },",""," /**"," * Formats tooltip text when `interactionType` is `marker`."," *"," * @method _tooltipLabelFunction"," * @param {Object} categoryItem An object containing the following:"," * <dl>"," * <dt>axis</dt><dd>The axis to which the category is bound.</dd>"," * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided)</dd>"," * <dt>key</dt><dd>The key of the category.</dd>"," * <dt>value</dt><dd>The value of the category</dd>"," * </dl>"," * @param {Object} valueItem An object containing the following:"," * <dl>"," * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>"," * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>"," * <dt>key</dt><dd>The key for the series.</dd>"," * <dt>value</dt><dd>The value for the series item.</dd> "," * </dl>"," * @param {Number} itemIndex The index of the item within the series."," * @param {CartesianSeries} series The `CartesianSeries` instance of the item."," * @param {Number} seriesIndex The index of the series in the `seriesCollection`."," * @return {String | HTML}"," * @private"," */"," _tooltipLabelFunction: function(categoryItem, valueItem, itemIndex, series, seriesIndex)"," {"," var msg = DOCUMENT.createElement(\"div\"),"," categoryValue = categoryItem.axis.get(\"labelFunction\").apply(this, [categoryItem.value, categoryItem.axis.get(\"labelFormat\")]),"," seriesValue = valueItem.axis.get(\"labelFunction\").apply(this, [valueItem.value, valueItem.axis.get(\"labelFormat\")]);"," msg.appendChild(DOCUMENT.createTextNode(categoryItem.displayName)); "," msg.appendChild(DOCUMENT.createTextNode(\": \")); "," if(!Y_Lang.isObject(categoryValue))"," {"," categoryValue = DOCUMENT.createTextNode(categoryValue);"," }"," msg.appendChild(categoryValue);"," msg.appendChild(DOCUMENT.createElement(\"br\"));"," msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName)); "," msg.appendChild(DOCUMENT.createTextNode(\": \")); "," if(!Y_Lang.isObject(seriesValue))"," {"," seriesValue = DOCUMENT.createTextNode(seriesValue);"," }"," msg.appendChild(seriesValue);"," return msg; "," },",""," /**"," * Event handler for the tooltipChange."," *"," * @method _tooltipChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _tooltipChangeHandler: function(e)"," {"," if(this.get(\"tooltip\"))"," {"," var tt = this.get(\"tooltip\"),"," node = tt.node,"," show = tt.show,"," cb = this.get(\"contentBox\");"," if(node && show)"," {"," if(!cb.contains(node))"," {"," this._addTooltip();"," }"," }"," }"," },"," "," /**"," * Updates the content of text field. This method writes a value into a text field using "," * `appendChild`. If the value is a `String`, it is converted to a `TextNode` first. "," *"," * @method _setText"," * @param label {HTMLElement} label to be updated"," * @param val {String} value with which to update the label"," * @private"," */"," _setText: function(textField, val)"," { "," textField.setContent(\"\");"," if(Y_Lang.isNumber(val))"," {"," val = val + \"\";"," }"," else if(!val)"," {"," val = \"\";"," }"," if(IS_STRING(val))"," {"," val = DOCUMENT.createTextNode(val);"," }"," textField.appendChild(val);"," },",""," /**"," * Returns all the keys contained in a `dataProvider`."," *"," * @method _getAllKeys"," * @param {Array} dp Collection of objects to be parsed."," * @return Object"," */"," _getAllKeys: function(dp)"," {"," var i = 0,"," len = dp.length,"," item,"," key,"," keys = {};"," for(; i < len; ++i)"," {"," item = dp[i];"," for(key in item)"," {"," if(item.hasOwnProperty(key))"," {"," keys[key] = true;"," }"," }"," }"," return keys;"," },"," "," /**"," * Constructs seriesKeys if not explicitly specified."," *"," * @method _buildSeriesKeys"," * @param {Array} dataProvider The dataProvider for the chart."," * @return Array"," * @private"," */"," _buildSeriesKeys: function(dataProvider)"," {"," var allKeys,"," catKey = this.get(\"categoryKey\"),"," keys = [],"," i;"," if(this._seriesKeysExplicitlySet)"," {"," return this._seriesKeys;"," }"," allKeys = this._getAllKeys(dataProvider);"," for(i in allKeys)"," {"," if(allKeys.hasOwnProperty(i) && i != catKey)"," {"," keys.push(i);"," }"," }"," return keys;"," }","};","Y.ChartBase = ChartBase;","/**"," * The CartesianChart class creates a chart with horizontal and vertical axes."," *"," * @module charts"," * @submodule charts-base"," * @class CartesianChart"," * @extends ChartBase"," * @constructor"," */","Y.CartesianChart = Y.Base.create(\"cartesianChart\", Y.Widget, [Y.ChartBase], {"," /**"," * @method renderUI"," * @private"," */"," renderUI: function()"," {"," var bb = this.get(\"boundingBox\"),"," cb = this.get(\"contentBox\"),"," tt = this.get(\"tooltip\"),"," overlay,"," overlayClass = _getClassName(\"overlay\");"," //move the position = absolute logic to a class file"," bb.setStyle(\"position\", \"absolute\");"," cb.setStyle(\"position\", \"absolute\");"," this._addAxes();"," this._addGridlines();"," this._addSeries();"," if(tt && tt.show)"," {"," this._addTooltip();"," }"," //If there is a style definition. Force them to set."," this.get(\"styles\");"," if(this.get(\"interactionType\") == \"planar\")"," {"," overlay = DOCUMENT.createElement(\"div\");"," this.get(\"contentBox\").appendChild(overlay);"," this._overlay = Y.one(overlay); "," this._overlay.set(\"id\", this.get(\"id\") + \"_overlay\");"," this._overlay.setStyle(\"position\", \"absolute\");"," this._overlay.setStyle(\"background\", \"#fff\");"," this._overlay.setStyle(\"opacity\", 0);"," this._overlay.addClass(overlayClass);"," this._overlay.setStyle(\"zIndex\", 4);"," }"," this._setAriaElements(bb, cb);"," this._redraw();"," },",""," /**"," * When `interactionType` is set to `planar`, listens for mouse move events and fires `planarEvent:mouseover` or `planarEvent:mouseout` depending on the position of the mouse in relation to "," * data points on the `Chart`."," *"," * @method _planarEventDispatcher"," * @param {Object} e Event object."," * @private"," */"," _planarEventDispatcher: function(e)"," {"," var graph = this.get(\"graph\"),"," bb = this.get(\"boundingBox\"),"," cb = graph.get(\"contentBox\"),"," isTouch = e && e.hasOwnProperty(\"changedTouches\"),"," pageX = isTouch ? e.changedTouches[0].pageX : e.pageX,"," pageY = isTouch ? e.changedTouches[0].pageY : e.pageY,"," posX = pageX - bb.getX(),"," posY = pageY - bb.getY(),"," offset = {"," x: pageX - cb.getX(),"," y: pageY - cb.getY()"," },"," sc = graph.get(\"seriesCollection\"),"," series,"," i = 0,"," index,"," oldIndex = this._selectedIndex,"," item,"," items = [],"," categoryItems = [],"," valueItems = [],"," direction = this.get(\"direction\"),"," hasMarkers,"," catAxis,"," valAxis,"," coord,"," //data columns and area data could be created on a graph level"," markerPlane,"," len,"," coords;"," e.halt(true);"," if(direction == \"horizontal\")"," {"," catAxis = \"x\";"," valAxis = \"y\";"," }"," else"," {"," valAxis = \"x\";"," catAxis = \"y\";"," }"," coord = offset[catAxis];"," if(sc)"," {"," len = sc.length;"," while(i < len && !markerPlane)"," {"," if(sc[i])"," {"," markerPlane = sc[i].get(catAxis + \"MarkerPlane\");"," }"," i++;"," }"," }"," if(markerPlane)"," {"," len = markerPlane.length;"," for(i = 0; i < len; ++i)"," {"," if(coord <= markerPlane[i].end && coord >= markerPlane[i].start)"," {"," index = i;"," break;"," }"," }"," len = sc.length;"," for(i = 0; i < len; ++i)"," {"," series = sc[i];"," coords = series.get(valAxis + \"coords\");"," hasMarkers = series.get(\"markers\");"," if(hasMarkers && !isNaN(oldIndex) && oldIndex > -1)"," {"," series.updateMarkerState(\"mouseout\", oldIndex);"," }"," if(coords && coords[index] > -1)"," {"," if(hasMarkers && !isNaN(index) && index > -1)"," {"," series.updateMarkerState(\"mouseover\", index);"," }"," item = this.getSeriesItems(series, index);"," categoryItems.push(item.category);"," valueItems.push(item.value);"," items.push(series);"," }"," "," }"," this._selectedIndex = index;",""," /**"," * Broadcasts when `interactionType` is set to `planar` and a series' marker plane has received a mouseover event."," * "," *"," * @event planarEvent:mouseover"," * @preventable false"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," * <dl>"," * <dt>categoryItem</dt><dd>An array of hashes, each containing information about the category `Axis` of each marker whose plane has been intersected.</dd>"," * <dt>valueItem</dt><dd>An array of hashes, each containing information about the value `Axis` of each marker whose plane has been intersected.</dd>"," * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>pageX</dt><dd>The x location of the event on the page (including scroll)</dd>"," * <dt>pageY</dt><dd>The y location of the event on the page (including scroll)</dd>"," * <dt>items</dt><dd>An array including all the series which contain a marker whose plane has been intersected.</dd>"," * <dt>index</dt><dd>Index of the markers in their respective series.</dd>"," * <dt>originEvent</dt><dd>Underlying dom event.</dd>"," * </dl>"," */"," /**"," * Broadcasts when `interactionType` is set to `planar` and a series' marker plane has received a mouseout event."," *"," * @event planarEvent:mouseout"," * @preventable false"," * @param {EventFacade} e "," */"," if(index > -1)"," {"," this.fire(\"planarEvent:mouseover\", {"," categoryItem:categoryItems, "," valueItem:valueItems, "," x:posX, "," y:posY, "," pageX:pageX,"," pageY:pageY,"," items:items, "," index:index,"," originEvent:e"," });"," }"," else"," {"," this.fire(\"planarEvent:mouseout\");"," }"," }"," },",""," /**"," * Indicates the default series type for the chart."," *"," * @property _type"," * @type {String}"," * @private"," */"," _type: \"combo\",",""," /**"," * Queue of axes instances that will be updated. This method is used internally to determine when all axes have been updated."," *"," * @property _itemRenderQueue"," * @type Array"," * @private"," */"," _itemRenderQueue: null,",""," /**"," * Adds an `Axis` instance to the `_itemRenderQueue`."," *"," * @method _addToAxesRenderQueue"," * @param {Axis} axis An `Axis` instance."," * @private "," */"," _addToAxesRenderQueue: function(axis)"," {"," if(!this._itemRenderQueue)"," {"," this._itemRenderQueue = [];"," }"," if(Y.Array.indexOf(this._itemRenderQueue, axis) < 0)"," {"," this._itemRenderQueue.push(axis);"," }"," },",""," /**"," * Adds axis instance to the appropriate array based on position"," *"," * @method _addToAxesCollection"," * @param {String} position The position of the axis"," * @param {Axis} axis The `Axis` instance"," */"," _addToAxesCollection: function(position, axis)"," {"," var axesCollection = this.get(position + \"AxesCollection\");"," if(!axesCollection)"," {"," axesCollection = [];"," this.set(position + \"AxesCollection\", axesCollection);"," }"," axesCollection.push(axis);"," },",""," /**"," * Returns the default value for the `seriesCollection` attribute."," *"," * @method _getDefaultSeriesCollection"," * @param {Array} val Array containing either `CartesianSeries` instances or objects containing data to construct series instances."," * @return Array"," * @private"," */"," _getDefaultSeriesCollection: function()"," {"," var seriesCollection,"," dataProvider = this.get(\"dataProvider\");"," if(dataProvider)"," {"," seriesCollection = this._parseSeriesCollection();"," }"," return seriesCollection;"," },",""," /**"," * Parses and returns a series collection from an object and default properties."," *"," * @method _parseSeriesCollection"," * @param {Object} val Object contain properties for series being set."," * @return Object"," * @private"," */"," _parseSeriesCollection: function(val)"," {"," var dir = this.get(\"direction\"), "," sc = [], "," catAxis,"," valAxis,"," tempKeys = [],"," series,"," seriesKeys = this.get(\"seriesKeys\").concat(),"," i,"," index,"," l,"," type = this.get(\"type\"),"," key,"," catKey,"," seriesKey,"," graph,"," orphans = [],"," categoryKey = this.get(\"categoryKey\"),"," showMarkers = this.get(\"showMarkers\"),"," showAreaFill = this.get(\"showAreaFill\"),"," showLines = this.get(\"showLines\");"," val = val || []; "," if(dir == \"vertical\")"," {"," catAxis = \"yAxis\";"," catKey = \"yKey\";"," valAxis = \"xAxis\";"," seriesKey = \"xKey\";"," }"," else"," {"," catAxis = \"xAxis\";"," catKey = \"xKey\";"," valAxis = \"yAxis\";"," seriesKey = \"yKey\";"," }"," l = val.length;"," while(val && val.length > 0)"," {"," series = val.shift();"," key = this._getBaseAttribute(series, seriesKey);"," if(key)"," {"," index = Y.Array.indexOf(seriesKeys, key);"," if(index > -1)"," {"," seriesKeys.splice(index, 1);"," tempKeys.push(key);"," sc.push(series);"," }"," else"," {"," orphans.push(series);"," }"," }"," else"," {"," orphans.push(series);"," }"," }"," while(orphans.length > 0)"," {"," series = orphans.shift();"," if(seriesKeys.length > 0)"," {"," key = seriesKeys.shift();"," this._setBaseAttribute(series, seriesKey, key);"," tempKeys.push(key);"," sc.push(series);"," }"," else if(series instanceof Y.CartesianSeries)"," {"," series.destroy(true);"," }"," }"," if(seriesKeys.length > 0)"," {"," tempKeys = tempKeys.concat(seriesKeys);"," }"," l = tempKeys.length;"," for(i = 0; i < l; ++i)"," {"," series = sc[i] || {type:type};"," if(series instanceof Y.CartesianSeries)"," {"," this._parseSeriesAxes(series);"," continue;"," }",""," series[catKey] = series[catKey] || categoryKey;"," series[seriesKey] = series[seriesKey] || seriesKeys.shift();"," series[catAxis] = this._getCategoryAxis();"," series[valAxis] = this._getSeriesAxis(series[seriesKey]);"," "," series.type = series.type || type;"," series.direction = series.direction || dir;"," "," if((series.type == \"combo\" || series.type == \"stackedcombo\" || series.type == \"combospline\" || series.type == \"stackedcombospline\"))"," {"," if(showAreaFill !== null)"," {"," series.showAreaFill = (series.showAreaFill !== null && series.showAreaFill !== undefined) ? series.showAreaFill : showAreaFill;"," }"," if(showMarkers !== null)"," {"," series.showMarkers = (series.showMarkers !== null && series.showMarkers !== undefined) ? series.showMarkers : showMarkers;"," }"," if(showLines !== null)"," {"," series.showLines = (series.showLines !== null && series.showLines !== undefined) ? series.showLines : showLines;"," }"," }"," sc[i] = series;"," }"," if(sc)"," {"," graph = this.get(\"graph\");"," graph.set(\"seriesCollection\", sc);"," sc = graph.get(\"seriesCollection\");"," }"," return sc;"," },",""," /**"," * Parse and sets the axes for a series instance."," *"," * @method _parseSeriesAxes"," * @param {CartesianSeries} series A `CartesianSeries` instance."," * @private"," */"," _parseSeriesAxes: function(series)"," {"," var axes = this.get(\"axes\"),"," xAxis = series.get(\"xAxis\"),"," yAxis = series.get(\"yAxis\"),"," YAxis = Y.Axis,"," axis;"," if(xAxis && !(xAxis instanceof YAxis) && Y_Lang.isString(xAxis) && axes.hasOwnProperty(xAxis))"," {"," axis = axes[xAxis];"," if(axis instanceof YAxis)"," {"," series.set(\"xAxis\", axis);"," }"," }"," if(yAxis && !(yAxis instanceof YAxis) && Y_Lang.isString(yAxis) && axes.hasOwnProperty(yAxis))"," { "," axis = axes[yAxis];"," if(axis instanceof YAxis)"," {"," series.set(\"yAxis\", axis);"," }"," }",""," },",""," /**"," * Returns the category axis instance for the chart."," *"," * @method _getCategoryAxis"," * @return Axis"," * @private"," */"," _getCategoryAxis: function()"," {"," var axis,"," axes = this.get(\"axes\"),"," categoryAxisName = this.get(\"categoryAxisName\") || this.get(\"categoryKey\");"," axis = axes[categoryAxisName];"," return axis;"," },",""," /**"," * Returns the value axis for a series."," *"," * @method _getSeriesAxis"," * @param {String} key The key value used to determine the axis instance."," * @return Axis"," * @private"," */"," _getSeriesAxis:function(key, axisName)"," {"," var axes = this.get(\"axes\"),"," i,"," keys,"," axis;"," if(axes)"," {"," if(axisName && axes.hasOwnProperty(axisName))"," {"," axis = axes[axisName];"," }"," else"," {"," for(i in axes)"," {"," if(axes.hasOwnProperty(i))"," {"," keys = axes[i].get(\"keys\");"," if(keys && keys.hasOwnProperty(key))"," {"," axis = axes[i];"," break;"," }"," }"," }"," }"," }"," return axis;"," },",""," /**"," * Gets an attribute from an object, using a getter for Base objects and a property for object"," * literals. Used for determining attributes from series/axis references which can be an actual class instance"," * or a hash of properties that will be used to create a class instance."," *"," * @method _getBaseAttribute"," * @param {Object} item Object or instance in which the attribute resides."," * @param {String} key Attribute whose value will be returned."," * @return Object"," * @private"," */"," _getBaseAttribute: function(item, key)"," {"," if(item instanceof Y.Base)"," {"," return item.get(key);"," }"," if(item.hasOwnProperty(key))"," {"," return item[key];"," }"," return null;"," },",""," /**"," * Sets an attribute on an object, using a setter of Base objects and a property for object"," * literals. Used for setting attributes on a Base class, either directly or to be stored in an object literal"," * for use at instantiation."," *"," * @method _setBaseAttribute"," * @param {Object} item Object or instance in which the attribute resides."," * @param {String} key Attribute whose value will be assigned."," * @param {Object} value Value to be assigned to the attribute."," * @private"," */"," _setBaseAttribute: function(item, key, value)"," {"," if(item instanceof Y.Base)"," {"," item.set(key, value);"," }"," else"," {"," item[key] = value;"," }"," },",""," /**"," * Creates `Axis` instances."," *"," * @method _setAxes"," * @param {Object} val Object containing `Axis` instances or objects in which to construct `Axis` instances."," * @return Object"," * @private"," */"," _setAxes: function(val)"," {"," var hash = this._parseAxes(val),"," axes = {},"," axesAttrs = {"," edgeOffset: \"edgeOffset\", "," position: \"position\","," overlapGraph:\"overlapGraph\","," labelFunction:\"labelFunction\","," labelFunctionScope:\"labelFunctionScope\","," labelFormat:\"labelFormat\","," appendLabelFunction: \"appendLabelFunction\","," appendTitleFunction: \"appendTitleFunction\","," maximum:\"maximum\","," minimum:\"minimum\", "," roundingMethod:\"roundingMethod\","," alwaysShowZero:\"alwaysShowZero\","," title:\"title\","," width:\"width\","," height:\"height\""," },"," dp = this.get(\"dataProvider\"),"," ai,"," i, "," pos, "," axis,"," axisPosition,"," dh, "," axisClass, "," config,"," axesCollection;"," for(i in hash)"," {"," if(hash.hasOwnProperty(i))"," {"," dh = hash[i];"," if(dh instanceof Y.Axis)"," {"," axis = dh;"," }"," else"," {"," axis = null;"," config = {};"," config.dataProvider = dh.dataProvider || dp;"," config.keys = dh.keys;"," "," if(dh.hasOwnProperty(\"roundingUnit\"))"," {"," config.roundingUnit = dh.roundingUnit;"," }"," pos = dh.position;"," if(dh.styles)"," {"," config.styles = dh.styles;"," }"," config.position = dh.position;"," for(ai in axesAttrs)"," {"," if(axesAttrs.hasOwnProperty(ai) && dh.hasOwnProperty(ai))"," {"," config[ai] = dh[ai];"," }"," }"," "," //only check for existing axis if we constructed the default axes already"," if(val)"," {"," axis = this.getAxisByKey(i);"," }"," "," if(axis && axis instanceof Y.Axis)"," {"," axisPosition = axis.get(\"position\");"," if(pos != axisPosition)"," {"," if(axisPosition != \"none\")"," {"," axesCollection = this.get(axisPosition + \"AxesCollection\");"," axesCollection.splice(Y.Array.indexOf(axesCollection, axis), 1);"," }"," if(pos != \"none\")"," {"," this._addToAxesCollection(pos, axis);"," }"," }"," axis.setAttrs(config);"," }"," else"," {"," axisClass = this._getAxisClass(dh.type);"," axis = new axisClass(config);"," axis.after(\"axisRendered\", Y.bind(this._itemRendered, this));"," }"," }",""," if(axis)"," {"," axesCollection = this.get(pos + \"AxesCollection\");"," if(axesCollection && Y.Array.indexOf(axesCollection, axis) > 0)"," {"," axis.set(\"overlapGraph\", false);"," }"," axes[i] = axis;"," }"," }"," }"," return axes;"," },"," "," /**"," * Adds axes to the chart."," *"," * @method _addAxes"," * @private"," */"," _addAxes: function()"," {"," var axes = this.get(\"axes\"),"," i, "," axis, "," pos,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," node = Y.Node.one(this._parentNode);"," if(!this._axesCollection)"," { "," this._axesCollection = [];"," }"," for(i in axes)"," {"," if(axes.hasOwnProperty(i))"," {"," axis = axes[i];"," if(axis instanceof Y.Axis)"," {"," if(!w)"," {"," this.set(\"width\", node.get(\"offsetWidth\"));"," w = this.get(\"width\");"," }"," if(!h)"," {"," this.set(\"height\", node.get(\"offsetHeight\"));"," h = this.get(\"height\");"," }"," this._addToAxesRenderQueue(axis);"," pos = axis.get(\"position\");"," if(!this.get(pos + \"AxesCollection\"))"," {"," this.set(pos + \"AxesCollection\", [axis]);"," }"," else"," {"," this.get(pos + \"AxesCollection\").push(axis);"," }"," this._axesCollection.push(axis);"," if(axis.get(\"keys\").hasOwnProperty(this.get(\"categoryKey\")))"," {"," this.set(\"categoryAxis\", axis);"," }"," axis.render(this.get(\"contentBox\"));"," }"," }"," }"," },",""," /**"," * Renders the Graph."," *"," * @method _addSeries"," * @private"," */"," _addSeries: function()"," {"," var graph = this.get(\"graph\"),"," sc = this.get(\"seriesCollection\");"," graph.render(this.get(\"contentBox\"));",""," },",""," /**"," * Adds gridlines to the chart."," *"," * @method _addGridlines"," * @private"," */"," _addGridlines: function()"," {"," var graph = this.get(\"graph\"),"," hgl = this.get(\"horizontalGridlines\"),"," vgl = this.get(\"verticalGridlines\"),"," direction = this.get(\"direction\"),"," leftAxesCollection = this.get(\"leftAxesCollection\"),"," rightAxesCollection = this.get(\"rightAxesCollection\"),"," bottomAxesCollection = this.get(\"bottomAxesCollection\"),"," topAxesCollection = this.get(\"topAxesCollection\"),"," seriesAxesCollection,"," catAxis = this.get(\"categoryAxis\"),"," hAxis,"," vAxis;"," if(this._axesCollection)"," {"," seriesAxesCollection = this._axesCollection.concat();"," seriesAxesCollection.splice(Y.Array.indexOf(seriesAxesCollection, catAxis), 1);"," }"," if(hgl)"," {"," if(leftAxesCollection && leftAxesCollection[0])"," {"," hAxis = leftAxesCollection[0];"," }"," else if(rightAxesCollection && rightAxesCollection[0])"," {"," hAxis = rightAxesCollection[0];"," }"," else "," {"," hAxis = direction == \"horizontal\" ? catAxis : seriesAxesCollection[0];"," }"," if(!this._getBaseAttribute(hgl, \"axis\") && hAxis)"," {"," this._setBaseAttribute(hgl, \"axis\", hAxis);"," }"," if(this._getBaseAttribute(hgl, \"axis\"))"," {"," graph.set(\"horizontalGridlines\", hgl);"," }"," }"," if(vgl)"," {"," if(bottomAxesCollection && bottomAxesCollection[0])"," {"," vAxis = bottomAxesCollection[0];"," }"," else if (topAxesCollection && topAxesCollection[0])"," {"," vAxis = topAxesCollection[0];"," }"," else "," {"," vAxis = direction == \"vertical\" ? catAxis : seriesAxesCollection[0];"," }"," if(!this._getBaseAttribute(vgl, \"axis\") && vAxis)"," {"," this._setBaseAttribute(vgl, \"axis\", vAxis);"," }"," if(this._getBaseAttribute(vgl, \"axis\"))"," {"," graph.set(\"verticalGridlines\", vgl);"," }"," }"," },"," "," /**"," * Default Function for the axes attribute."," *"," * @method _getDefaultAxes"," * @return Object"," * @private"," */"," _getDefaultAxes: function()"," {"," var axes;"," if(this.get(\"dataProvider\"))"," {"," axes = this._parseAxes();"," }"," return axes;"," },",""," /**"," * Generates and returns a key-indexed object containing `Axis` instances or objects used to create `Axis` instances."," *"," * @method _parseAxes"," * @param {Object} axes Object containing `Axis` instances or `Axis` attributes."," * @return Object"," * @private"," */"," _parseAxes: function(axes)"," {"," var catKey = this.get(\"categoryKey\"),"," axis,"," attr,"," keys,"," newAxes = {},"," claimedKeys = [],"," categoryAxisName = this.get(\"categoryAxisName\") || this.get(\"categoryKey\"),"," valueAxisName = this.get(\"valueAxisName\"),"," seriesKeys = this.get(\"seriesKeys\").concat(),"," i, "," l,"," ii,"," ll,"," cIndex,"," direction = this.get(\"direction\"),"," seriesPosition,"," categoryPosition,"," valueAxes = [],"," seriesAxis = this.get(\"stacked\") ? \"stacked\" : \"numeric\";"," if(direction == \"vertical\")"," {"," seriesPosition = \"bottom\";"," categoryPosition = \"left\";"," }"," else"," {"," seriesPosition = \"left\";"," categoryPosition = \"bottom\";"," }"," if(axes)"," {"," for(i in axes)"," {"," if(axes.hasOwnProperty(i))"," {"," axis = axes[i];"," keys = this._getBaseAttribute(axis, \"keys\");"," attr = this._getBaseAttribute(axis, \"type\");"," if(attr == \"time\" || attr == \"category\")"," {"," categoryAxisName = i;"," this.set(\"categoryAxisName\", i);"," if(Y_Lang.isArray(keys) && keys.length > 0)"," {"," catKey = keys[0];"," this.set(\"categoryKey\", catKey);"," }"," newAxes[i] = axis;"," }"," else if(i == categoryAxisName)"," {"," newAxes[i] = axis;"," }"," else "," {"," newAxes[i] = axis;"," if(i != valueAxisName && keys && Y_Lang.isArray(keys))"," {"," ll = keys.length;"," for(ii = 0; ii < ll; ++ii)"," {"," claimedKeys.push(keys[ii]);"," }"," valueAxes.push(newAxes[i]);"," }"," if(!(this._getBaseAttribute(newAxes[i], \"type\")))"," {"," this._setBaseAttribute(newAxes[i], \"type\", seriesAxis);"," }"," if(!(this._getBaseAttribute(newAxes[i], \"position\")))"," {"," this._setBaseAttribute(newAxes[i], \"position\", this._getDefaultAxisPosition(newAxes[i], valueAxes, seriesPosition));"," }"," }"," }"," }"," }"," cIndex = Y.Array.indexOf(seriesKeys, catKey);"," if(cIndex > -1)"," {"," seriesKeys.splice(cIndex, 1);"," }"," l = claimedKeys.length;"," for(i = 0; i < l; ++i)"," {"," cIndex = Y.Array.indexOf(seriesKeys, claimedKeys[i]); "," if(cIndex > -1)"," {"," seriesKeys.splice(cIndex, 1);"," }"," }"," if(!newAxes.hasOwnProperty(categoryAxisName))"," {"," newAxes[categoryAxisName] = {};"," }"," if(!(this._getBaseAttribute(newAxes[categoryAxisName], \"keys\")))"," {"," this._setBaseAttribute(newAxes[categoryAxisName], \"keys\", [catKey]);"," }"," "," if(!(this._getBaseAttribute(newAxes[categoryAxisName], \"position\")))"," {"," this._setBaseAttribute(newAxes[categoryAxisName], \"position\", categoryPosition);"," }"," "," if(!(this._getBaseAttribute(newAxes[categoryAxisName], \"type\")))"," {"," this._setBaseAttribute(newAxes[categoryAxisName], \"type\", this.get(\"categoryType\"));"," }"," if(!newAxes.hasOwnProperty(valueAxisName) && seriesKeys && seriesKeys.length > 0)"," {"," newAxes[valueAxisName] = {keys:seriesKeys};"," valueAxes.push(newAxes[valueAxisName]);"," }"," if(claimedKeys.length > 0)"," {"," if(seriesKeys.length > 0)"," {"," seriesKeys = claimedKeys.concat(seriesKeys);"," }"," else"," {"," seriesKeys = claimedKeys;"," }"," }"," if(newAxes.hasOwnProperty(valueAxisName))"," {"," if(!(this._getBaseAttribute(newAxes[valueAxisName], \"position\")))"," {"," this._setBaseAttribute(newAxes[valueAxisName], \"position\", this._getDefaultAxisPosition(newAxes[valueAxisName], valueAxes, seriesPosition));"," }"," this._setBaseAttribute(newAxes[valueAxisName], \"type\", seriesAxis);"," this._setBaseAttribute(newAxes[valueAxisName], \"keys\", seriesKeys);"," } "," if(!this._seriesKeysExplicitlySet)"," {"," this._seriesKeys = seriesKeys;"," }"," return newAxes;"," },",""," /**"," * Determines the position of an axis when one is not specified."," *"," * @method _getDefaultAxisPosition"," * @param {Axis} axis `Axis` instance."," * @param {Array} valueAxes Array of `Axis` instances."," * @param {String} position Default position depending on the direction of the chart and type of axis."," * @return String"," * @private"," */"," _getDefaultAxisPosition: function(axis, valueAxes, position)"," {"," var direction = this.get(\"direction\"),"," i = Y.Array.indexOf(valueAxes, axis);"," "," if(valueAxes[i - 1] && valueAxes[i - 1].position)"," {"," if(direction == \"horizontal\")"," {"," if(valueAxes[i - 1].position == \"left\")"," {"," position = \"right\";"," }"," else if(valueAxes[i - 1].position == \"right\")"," {"," position = \"left\";"," }"," }"," else"," {"," if (valueAxes[i -1].position == \"bottom\")"," {"," position = \"top\";"," } "," else"," {"," position = \"bottom\";"," }"," }"," }"," return position;"," },",""," "," /**"," * Returns an object literal containing a categoryItem and a valueItem for a given series index. Below is the structure of each:"," * "," * @method getSeriesItems"," * @param {CartesianSeries} series Reference to a series."," * @param {Number} index Index of the specified item within a series."," * @return Object An object literal containing the following:"," *"," * <dl>"," * <dt>categoryItem</dt><dd>Object containing the following data related to the category axis of the series."," * <dl>"," * <dt>axis</dt><dd>Reference to the category axis of the series.</dd>"," * <dt>key</dt><dd>Category key for the series.</dd>"," * <dt>value</dt><dd>Value on the axis corresponding to the series index.</dd>"," * </dl>"," * </dd>"," * <dt>valueItem</dt><dd>Object containing the following data related to the category axis of the series."," * <dl>"," * <dt>axis</dt><dd>Reference to the value axis of the series.</dd>"," * <dt>key</dt><dd>Value key for the series.</dd>"," * <dt>value</dt><dd>Value on the axis corresponding to the series index.</dd>"," * </dl>"," * </dd>"," * </dl>"," */"," getSeriesItems: function(series, index)"," {"," var xAxis = series.get(\"xAxis\"),"," yAxis = series.get(\"yAxis\"),"," xKey = series.get(\"xKey\"),"," yKey = series.get(\"yKey\"),"," categoryItem,"," valueItem;"," if(this.get(\"direction\") == \"vertical\")"," {"," categoryItem = {"," axis:yAxis,"," key:yKey,"," value:yAxis.getKeyValueAt(yKey, index)"," };"," valueItem = {"," axis:xAxis,"," key:xKey,"," value: xAxis.getKeyValueAt(xKey, index)"," };"," }"," else"," {"," valueItem = {"," axis:yAxis,"," key:yKey,"," value:yAxis.getKeyValueAt(yKey, index)"," };"," categoryItem = {"," axis:xAxis,"," key:xKey,"," value: xAxis.getKeyValueAt(xKey, index)"," };"," }"," categoryItem.displayName = series.get(\"categoryDisplayName\");"," valueItem.displayName = series.get(\"valueDisplayName\");"," categoryItem.value = categoryItem.axis.getKeyValueAt(categoryItem.key, index);"," valueItem.value = valueItem.axis.getKeyValueAt(valueItem.key, index);"," return {category:categoryItem, value:valueItem};"," },",""," /**"," * Handler for sizeChanged event."," *"," * @method _sizeChanged"," * @param {Object} e Event object."," * @private"," */"," _sizeChanged: function(e)"," {"," if(this._axesCollection)"," {"," var ac = this._axesCollection,"," i = 0,"," l = ac.length;"," for(; i < l; ++i)"," {"," this._addToAxesRenderQueue(ac[i]);"," }"," this._redraw();"," }"," },"," "," /**"," * Returns the maximum distance in pixels that the extends outside the top bounds of all vertical axes."," *"," * @method _getTopOverflow"," * @param {Array} set1 Collection of axes to check."," * @param {Array} set2 Seconf collection of axes to check."," * @param {Number} width Width of the axes"," * @return Number"," * @private"," */"," _getTopOverflow: function(set1, set2, height)"," {"," var i = 0,"," len,"," overflow = 0,"," axis;"," if(set1)"," {"," len = set1.length;"," for(; i < len; ++i)"," {"," axis = set1[i];"," overflow = Math.max(overflow, Math.abs(axis.getMaxLabelBounds().top) - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, height) * 0.5));"," }"," }"," if(set2)"," {"," i = 0;"," len = set2.length;"," for(; i < len; ++i)"," {"," axis = set2[i];"," overflow = Math.max(overflow, Math.abs(axis.getMaxLabelBounds().top) - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, height) * 0.5));"," }"," }"," return overflow;"," },"," "," /**"," * Returns the maximum distance in pixels that the extends outside the right bounds of all horizontal axes."," *"," * @method _getRightOverflow"," * @param {Array} set1 Collection of axes to check."," * @param {Array} set2 Seconf collection of axes to check."," * @param {Number} width Width of the axes"," * @return Number"," * @private"," */"," _getRightOverflow: function(set1, set2, width)"," {"," var i = 0,"," len,"," overflow = 0,"," axis;"," if(set1)"," {"," len = set1.length;"," for(; i < len; ++i)"," {"," axis = set1[i];"," overflow = Math.max(overflow, axis.getMaxLabelBounds().right - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, width) * 0.5));"," }"," }"," if(set2)"," {"," i = 0;"," len = set2.length;"," for(; i < len; ++i)"," {"," axis = set2[i];"," overflow = Math.max(overflow, axis.getMaxLabelBounds().right - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, width) * 0.5));"," }"," }"," return overflow;"," },"," "," /**"," * Returns the maximum distance in pixels that the extends outside the left bounds of all horizontal axes."," *"," * @method _getLeftOverflow"," * @param {Array} set1 Collection of axes to check."," * @param {Array} set2 Seconf collection of axes to check."," * @param {Number} width Width of the axes"," * @return Number"," * @private"," */"," _getLeftOverflow: function(set1, set2, width)"," {"," var i = 0,"," len,"," overflow = 0,"," axis;"," if(set1)"," {"," len = set1.length;"," for(; i < len; ++i)"," {"," axis = set1[i];"," overflow = Math.max(overflow, Math.abs(axis.getMinLabelBounds().left) - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, width) * 0.5));"," }"," }"," if(set2)"," {"," i = 0;"," len = set2.length;"," for(; i < len; ++i)"," {"," axis = set2[i];"," overflow = Math.max(overflow, Math.abs(axis.getMinLabelBounds().left) - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, width) * 0.5));"," }"," }"," return overflow;"," },"," "," /**"," * Returns the maximum distance in pixels that the extends outside the bottom bounds of all vertical axes."," *"," * @method _getBottomOverflow"," * @param {Array} set1 Collection of axes to check."," * @param {Array} set2 Seconf collection of axes to check."," * @param {Number} height Height of the axes"," * @return Number"," * @private"," */"," _getBottomOverflow: function(set1, set2, height)"," {"," var i = 0,"," len,"," overflow = 0,"," axis;"," if(set1)"," {"," len = set1.length;"," for(; i < len; ++i)"," {"," axis = set1[i];"," overflow = Math.max(overflow, axis.getMinLabelBounds().bottom - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, height) * 0.5));"," }"," }"," if(set2)"," {"," i = 0;"," len = set2.length;"," for(; i < len; ++i)"," {"," axis = set2[i];"," overflow = Math.max(overflow, axis.getMinLabelBounds().bottom - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, height) * 0.5));"," }"," }"," return overflow;"," },",""," /**"," * Redraws and position all the components of the chart instance."," *"," * @method _redraw"," * @private"," */"," _redraw: function()"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," var w = this.get(\"width\"),"," h = this.get(\"height\"),"," leftPaneWidth = 0,"," rightPaneWidth = 0,"," topPaneHeight = 0,"," bottomPaneHeight = 0,"," leftAxesCollection = this.get(\"leftAxesCollection\"),"," rightAxesCollection = this.get(\"rightAxesCollection\"),"," topAxesCollection = this.get(\"topAxesCollection\"),"," bottomAxesCollection = this.get(\"bottomAxesCollection\"),"," i = 0,"," l,"," axis,"," graphOverflow = \"visible\","," graph = this.get(\"graph\"),"," topOverflow,"," bottomOverflow,"," leftOverflow,"," rightOverflow,"," graphWidth,"," graphHeight,"," graphX,"," graphY,"," allowContentOverflow = this.get(\"allowContentOverflow\"),"," diff,"," rightAxesXCoords,"," leftAxesXCoords,"," topAxesYCoords,"," bottomAxesYCoords,"," graphRect = {};"," if(leftAxesCollection)"," {"," leftAxesXCoords = [];"," l = leftAxesCollection.length;"," for(i = l - 1; i > -1; --i)"," {"," leftAxesXCoords.unshift(leftPaneWidth);"," leftPaneWidth += leftAxesCollection[i].get(\"width\");"," }"," }"," if(rightAxesCollection)"," {"," rightAxesXCoords = [];"," l = rightAxesCollection.length;"," i = 0;"," for(i = l - 1; i > -1; --i)"," {"," rightPaneWidth += rightAxesCollection[i].get(\"width\");"," rightAxesXCoords.unshift(w - rightPaneWidth);"," }"," }"," if(topAxesCollection)"," {"," topAxesYCoords = [];"," l = topAxesCollection.length;"," for(i = l - 1; i > -1; --i)"," {"," topAxesYCoords.unshift(topPaneHeight);"," topPaneHeight += topAxesCollection[i].get(\"height\");"," }"," }"," if(bottomAxesCollection)"," {"," bottomAxesYCoords = [];"," l = bottomAxesCollection.length;"," for(i = l - 1; i > -1; --i)"," {"," bottomPaneHeight += bottomAxesCollection[i].get(\"height\");"," bottomAxesYCoords.unshift(h - bottomPaneHeight);"," }"," }"," "," graphWidth = w - (leftPaneWidth + rightPaneWidth);"," graphHeight = h - (bottomPaneHeight + topPaneHeight);"," graphRect.left = leftPaneWidth;"," graphRect.top = topPaneHeight;"," graphRect.bottom = h - bottomPaneHeight;"," graphRect.right = w - rightPaneWidth;"," if(!allowContentOverflow)"," {"," topOverflow = this._getTopOverflow(leftAxesCollection, rightAxesCollection);"," bottomOverflow = this._getBottomOverflow(leftAxesCollection, rightAxesCollection);"," leftOverflow = this._getLeftOverflow(bottomAxesCollection, topAxesCollection);"," rightOverflow = this._getRightOverflow(bottomAxesCollection, topAxesCollection);"," "," diff = topOverflow - topPaneHeight;"," if(diff > 0)"," {"," graphRect.top = topOverflow;"," if(topAxesYCoords)"," {"," i = 0;"," l = topAxesYCoords.length;"," for(; i < l; ++i)"," {"," topAxesYCoords[i] += diff;"," }"," }"," }",""," diff = bottomOverflow - bottomPaneHeight;"," if(diff > 0)"," {"," graphRect.bottom = h - bottomOverflow;"," if(bottomAxesYCoords)"," {"," i = 0;"," l = bottomAxesYCoords.length;"," for(; i < l; ++i)"," {"," bottomAxesYCoords[i] -= diff;"," }"," }"," }",""," diff = leftOverflow - leftPaneWidth;"," if(diff > 0)"," {"," graphRect.left = leftOverflow;"," if(leftAxesXCoords)"," {"," i = 0;"," l = leftAxesXCoords.length;"," for(; i < l; ++i)"," {"," leftAxesXCoords[i] += diff;"," }"," }"," }",""," diff = rightOverflow - rightPaneWidth;"," if(diff > 0)"," {"," graphRect.right = w - rightOverflow;"," if(rightAxesXCoords)"," {"," i = 0;"," l = rightAxesXCoords.length;"," for(; i < l; ++i)"," {"," rightAxesXCoords[i] -= diff;"," }"," }"," }"," }"," graphWidth = graphRect.right - graphRect.left;"," graphHeight = graphRect.bottom - graphRect.top;"," graphX = graphRect.left;"," graphY = graphRect.top;"," if(topAxesCollection)"," {"," l = topAxesCollection.length;"," i = 0;"," for(; i < l; i++)"," {"," axis = topAxesCollection[i];"," if(axis.get(\"width\") !== graphWidth)"," {"," axis.set(\"width\", graphWidth);"," }"," axis.get(\"boundingBox\").setStyle(\"left\", graphX + \"px\");"," axis.get(\"boundingBox\").setStyle(\"top\", topAxesYCoords[i] + \"px\");"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," if(bottomAxesCollection)"," {"," l = bottomAxesCollection.length;"," i = 0;"," for(; i < l; i++)"," {"," axis = bottomAxesCollection[i];"," if(axis.get(\"width\") !== graphWidth)"," {"," axis.set(\"width\", graphWidth);"," }"," axis.get(\"boundingBox\").setStyle(\"left\", graphX + \"px\");"," axis.get(\"boundingBox\").setStyle(\"top\", bottomAxesYCoords[i] + \"px\");"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," if(leftAxesCollection)"," {"," l = leftAxesCollection.length;"," i = 0;"," for(; i < l; ++i)"," {"," axis = leftAxesCollection[i];"," axis.get(\"boundingBox\").setStyle(\"top\", graphY + \"px\");"," axis.get(\"boundingBox\").setStyle(\"left\", leftAxesXCoords[i] + \"px\");"," if(axis.get(\"height\") !== graphHeight)"," {"," axis.set(\"height\", graphHeight);"," }"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," if(rightAxesCollection)"," {"," l = rightAxesCollection.length;"," i = 0;"," for(; i < l; ++i)"," {"," axis = rightAxesCollection[i];"," axis.get(\"boundingBox\").setStyle(\"top\", graphY + \"px\");"," axis.get(\"boundingBox\").setStyle(\"left\", rightAxesXCoords[i] + \"px\");"," if(axis.get(\"height\") !== graphHeight)"," {"," axis.set(\"height\", graphHeight);"," }"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," this._drawing = false;"," if(this._callLater)"," {"," this._redraw();"," return;"," }"," if(graph)"," {"," graph.get(\"boundingBox\").setStyle(\"left\", graphX + \"px\");"," graph.get(\"boundingBox\").setStyle(\"top\", graphY + \"px\");"," graph.set(\"width\", graphWidth);"," graph.set(\"height\", graphHeight);"," graph.get(\"boundingBox\").setStyle(\"overflow\", graphOverflow);"," }",""," if(this._overlay)"," {"," this._overlay.setStyle(\"left\", graphX + \"px\");"," this._overlay.setStyle(\"top\", graphY + \"px\");"," this._overlay.setStyle(\"width\", graphWidth + \"px\");"," this._overlay.setStyle(\"height\", graphHeight + \"px\");"," }"," },",""," /**"," * Destructor implementation for the CartesianChart class. Calls destroy on all axes, series and the Graph instance."," * Removes the tooltip and overlay HTML elements."," *"," * @method destructor"," * @protected"," */"," destructor: function()"," {"," var graph = this.get(\"graph\"),"," i = 0,"," len,"," seriesCollection = this.get(\"seriesCollection\"),"," axesCollection = this._axesCollection,"," tooltip = this.get(\"tooltip\").node;"," if(this._description)"," {"," this._description.empty();"," this._description.remove(true);"," }"," if(this._liveRegion)"," {"," this._liveRegion.empty();"," this._liveRegion.remove(true);"," }"," len = seriesCollection ? seriesCollection.length : 0;"," for(; i < len; ++i)"," {"," if(seriesCollection[i] instanceof Y.CartesianSeries)"," {"," seriesCollection[i].destroy(true);"," }"," }"," len = axesCollection ? axesCollection.length : 0;"," for(i = 0; i < len; ++i)"," {"," if(axesCollection[i] instanceof Y.Axis)"," {"," axesCollection[i].destroy(true);"," }"," }"," if(graph)"," {"," graph.destroy(true);"," }"," if(tooltip)"," {"," tooltip.empty();"," tooltip.remove(true);"," }"," if(this._overlay)"," {"," this._overlay.empty();"," this._overlay.remove(true);"," }"," },",""," /**"," * Returns the appropriate message based on the key press."," *"," * @method _getAriaMessage"," * @param {Number} key The keycode that was pressed."," * @return String"," */"," _getAriaMessage: function(key)"," {"," var msg = \"\","," series,"," items,"," categoryItem,"," valueItem,"," seriesIndex = this._seriesIndex,"," itemIndex = this._itemIndex,"," seriesCollection = this.get(\"seriesCollection\"),"," len = seriesCollection.length,"," dataLength;"," if(key % 2 === 0)"," {"," if(len > 1)"," {"," if(key === 38)"," {"," seriesIndex = seriesIndex < 1 ? len - 1 : seriesIndex - 1;"," }"," else if(key === 40)"," {"," seriesIndex = seriesIndex >= len - 1 ? 0 : seriesIndex + 1;"," }"," this._itemIndex = -1;"," }"," else"," {"," seriesIndex = 0;"," }"," this._seriesIndex = seriesIndex;"," series = this.getSeries(parseInt(seriesIndex, 10));"," msg = series.get(\"valueDisplayName\") + \" series.\";"," }"," else"," {"," if(seriesIndex > -1)"," {"," msg = \"\";"," series = this.getSeries(parseInt(seriesIndex, 10));"," }"," else"," {"," seriesIndex = 0;"," this._seriesIndex = seriesIndex;"," series = this.getSeries(parseInt(seriesIndex, 10));"," msg = series.get(\"valueDisplayName\") + \" series.\";"," }"," dataLength = series._dataLength ? series._dataLength : 0;"," if(key === 37)"," {"," itemIndex = itemIndex > 0 ? itemIndex - 1 : dataLength - 1;"," }"," else if(key === 39)"," {"," itemIndex = itemIndex >= dataLength - 1 ? 0 : itemIndex + 1;"," }"," this._itemIndex = itemIndex;"," items = this.getSeriesItems(series, itemIndex);"," categoryItem = items.category;"," valueItem = items.value;"," if(categoryItem && valueItem && categoryItem.value && valueItem.value)"," {"," msg += categoryItem.displayName + \": \" + categoryItem.axis.formatLabel.apply(this, [categoryItem.value, categoryItem.axis.get(\"labelFormat\")]) + \", \";"," msg += valueItem.displayName + \": \" + valueItem.axis.formatLabel.apply(this, [valueItem.value, valueItem.axis.get(\"labelFormat\")]) + \", \"; "," }"," else"," {"," msg += \"No data available.\";"," }"," msg += (itemIndex + 1) + \" of \" + dataLength + \". \";"," }"," return msg;"," }","}, {"," ATTRS: {"," /**"," * Indicates whether axis labels are allowed to overflow beyond the bounds of the chart's content box."," *"," * @attribute allowContentOverflow"," * @type Boolean"," */"," allowContentOverflow: {"," value: false"," },",""," /**"," * Style object for the axes."," *"," * @attribute axesStyles"," * @type Object"," * @private"," */"," axesStyles: {"," getter: function()"," {"," var axes = this.get(\"axes\"),"," i,"," styles = this._axesStyles;"," if(axes)"," {"," for(i in axes)"," {"," if(axes.hasOwnProperty(i) && axes[i] instanceof Y.Axis)"," {"," if(!styles)"," {"," styles = {};"," }"," styles[i] = axes[i].get(\"styles\");"," }"," }"," }"," return styles;"," },"," "," setter: function(val)"," {"," var axes = this.get(\"axes\"),"," i;"," for(i in val)"," {"," if(val.hasOwnProperty(i) && axes.hasOwnProperty(i))"," {"," this._setBaseAttribute(axes[i], \"styles\", val[i]);"," }"," }"," }"," },",""," /**"," * Style object for the series"," *"," * @attribute seriesStyles"," * @type Object"," * @private"," */"," seriesStyles: {"," getter: function()"," {"," var styles = this._seriesStyles,"," graph = this.get(\"graph\"),"," dict,"," i;"," if(graph)"," {"," dict = graph.get(\"seriesDictionary\");"," if(dict)"," {"," styles = {};"," for(i in dict)"," {"," if(dict.hasOwnProperty(i))"," {"," styles[i] = dict[i].get(\"styles\");"," }"," }"," }"," }"," return styles;"," },"," "," setter: function(val)"," {"," var i,"," l,"," s;"," "," if(Y_Lang.isArray(val))"," {"," s = this.get(\"seriesCollection\");"," i = 0;"," l = val.length;",""," for(; i < l; ++i)"," {"," this._setBaseAttribute(s[i], \"styles\", val[i]);"," }"," }"," else"," {"," for(i in val)"," {"," if(val.hasOwnProperty(i))"," {"," s = this.getSeries(i);"," this._setBaseAttribute(s, \"styles\", val[i]);"," }"," }"," }"," }"," },",""," /**"," * Styles for the graph."," *"," * @attribute graphStyles"," * @type Object"," * @private"," */"," graphStyles: {"," getter: function()"," {"," var graph = this.get(\"graph\");"," if(graph)"," {"," return(graph.get(\"styles\"));"," }"," return this._graphStyles;"," },",""," setter: function(val)"," {"," var graph = this.get(\"graph\");"," this._setBaseAttribute(graph, \"styles\", val);"," }",""," },",""," /**"," * Style properties for the chart. Contains a key indexed hash of the following:"," * <dl>"," * <dt>series</dt><dd>A key indexed hash containing references to the `styles` attribute for each series in the chart."," * Specific style attributes vary depending on the series:"," * <ul>"," * <li><a href=\"AreaSeries.html#attr_styles\">AreaSeries</a></li>"," * <li><a href=\"BarSeries.html#attr_styles\">BarSeries</a></li>"," * <li><a href=\"ColumnSeries.html#attr_styles\">ColumnSeries</a></li>"," * <li><a href=\"ComboSeries.html#attr_styles\">ComboSeries</a></li>"," * <li><a href=\"LineSeries.html#attr_styles\">LineSeries</a></li>"," * <li><a href=\"MarkerSeries.html#attr_styles\">MarkerSeries</a></li>"," * <li><a href=\"SplineSeries.html#attr_styles\">SplineSeries</a></li>"," * </ul>"," * </dd>"," * <dt>axes</dt><dd>A key indexed hash containing references to the `styles` attribute for each axes in the chart. Specific"," * style attributes can be found in the <a href=\"Axis.html#attr_styles\">Axis</a> class.</dd>"," * <dt>graph</dt><dd>A reference to the `styles` attribute in the chart. Specific style attributes can be found in the"," * <a href=\"Graph.html#attr_styles\">Graph</a> class.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," styles: {"," getter: function()"," {"," var styles = { "," axes: this.get(\"axesStyles\"),"," series: this.get(\"seriesStyles\"),"," graph: this.get(\"graphStyles\")"," };"," return styles;"," },"," setter: function(val)"," {"," if(val.hasOwnProperty(\"axes\"))"," {"," if(this.get(\"axesStyles\"))"," {"," this.set(\"axesStyles\", val.axes);"," }"," else"," {"," this._axesStyles = val.axes;"," }"," }"," if(val.hasOwnProperty(\"series\"))"," {"," if(this.get(\"seriesStyles\"))"," {"," this.set(\"seriesStyles\", val.series);"," }"," else"," {"," this._seriesStyles = val.series;"," }"," }"," if(val.hasOwnProperty(\"graph\"))"," {"," this.set(\"graphStyles\", val.graph);"," }"," }"," },",""," /**"," * Axes to appear in the chart. This can be a key indexed hash of axis instances or object literals"," * used to construct the appropriate axes."," *"," * @attribute axes"," * @type Object"," */"," axes: {"," valueFn: \"_getDefaultAxes\",",""," setter: function(val)"," {"," if(this.get(\"dataProvider\"))"," {"," val = this._setAxes(val);"," }"," return val;"," }"," },",""," /**"," * Collection of series to appear on the chart. This can be an array of Series instances or object literals"," * used to construct the appropriate series."," *"," * @attribute seriesCollection"," * @type Array"," */"," seriesCollection: {"," valueFn: \"_getDefaultSeriesCollection\","," "," setter: function(val)"," {"," if(this.get(\"dataProvider\"))"," {"," val = this._parseSeriesCollection(val);"," }"," return val;"," }"," },",""," /**"," * Reference to the left-aligned axes for the chart."," *"," * @attribute leftAxesCollection"," * @type Array"," * @private"," */"," leftAxesCollection: {},",""," /**"," * Reference to the bottom-aligned axes for the chart."," *"," * @attribute bottomAxesCollection"," * @type Array"," * @private"," */"," bottomAxesCollection: {},",""," /**"," * Reference to the right-aligned axes for the chart."," *"," * @attribute rightAxesCollection"," * @type Array"," * @private"," */"," rightAxesCollection: {},",""," /**"," * Reference to the top-aligned axes for the chart."," *"," * @attribute topAxesCollection"," * @type Array"," * @private"," */"," topAxesCollection: {},"," "," /**"," * Indicates whether or not the chart is stacked."," *"," * @attribute stacked"," * @type Boolean"," */"," stacked: {"," value: false"," },",""," /**"," * Direction of chart's category axis when there is no series collection specified. Charts can"," * be horizontal or vertical. When the chart type is column, the chart is horizontal."," * When the chart type is bar, the chart is vertical. "," *"," * @attribute direction"," * @type String"," */"," direction: {"," getter: function()"," {"," var type = this.get(\"type\");"," if(type == \"bar\")"," { "," return \"vertical\";"," }"," else if(type == \"column\")"," {"," return \"horizontal\";"," }"," return this._direction;"," },",""," setter: function(val)"," {"," this._direction = val;"," return this._direction;"," }"," },",""," /**"," * Indicates whether or not an area is filled in a combo chart."," * "," * @attribute showAreaFill"," * @type Boolean"," */"," showAreaFill: {},",""," /**"," * Indicates whether to display markers in a combo chart."," *"," * @attribute showMarkers"," * @type Boolean"," */"," showMarkers:{},",""," /**"," * Indicates whether to display lines in a combo chart."," *"," * @attribute showLines"," * @type Boolean"," */"," showLines:{},",""," /**"," * Indicates the key value used to identify a category axis in the `axes` hash. If"," * not specified, the categoryKey attribute value will be used."," * "," * @attribute categoryAxisName"," * @type String"," */"," categoryAxisName: {"," },",""," /**"," * Indicates the key value used to identify a the series axis when an axis not generated."," *"," * @attribute valueAxisName"," * @type String"," */"," valueAxisName: {"," value: \"values\""," },",""," /**"," * Reference to the horizontalGridlines for the chart."," *"," * @attribute horizontalGridlines"," * @type Gridlines"," */"," horizontalGridlines: {"," getter: function()"," {"," var graph = this.get(\"graph\");"," if(graph)"," {"," return graph.get(\"horizontalGridlines\");"," }"," return this._horizontalGridlines;"," },"," setter: function(val)"," {"," var graph = this.get(\"graph\");"," if(val && !Y_Lang.isObject(val))"," {"," val = {};"," }"," if(graph)"," {"," graph.set(\"horizontalGridlines\", val);"," }"," else"," {"," this._horizontalGridlines = val;"," }"," }"," },",""," /**"," * Reference to the verticalGridlines for the chart."," *"," * @attribute verticalGridlines"," * @type Gridlines"," */"," verticalGridlines: {"," getter: function()"," {"," var graph = this.get(\"graph\");"," if(graph)"," {"," return graph.get(\"verticalGridlines\");"," }"," return this._verticalGridlines;"," },"," setter: function(val)"," {"," var graph = this.get(\"graph\");"," if(val && !Y_Lang.isObject(val))"," {"," val = {};"," }"," if(graph)"," {"," graph.set(\"verticalGridlines\", val);"," }"," else"," {"," this._verticalGridlines = val;"," }"," }"," },"," "," /**"," * Type of chart when there is no series collection specified."," *"," * @attribute type"," * @type String "," */"," type: {"," getter: function()"," {"," if(this.get(\"stacked\"))"," {"," return \"stacked\" + this._type;"," }"," return this._type;"," },",""," setter: function(val)"," {"," if(this._type == \"bar\")"," {"," if(val != \"bar\")"," {"," this.set(\"direction\", \"horizontal\");"," }"," }"," else"," {"," if(val == \"bar\")"," {"," this.set(\"direction\", \"vertical\");"," }"," }"," this._type = val;"," return this._type;"," }"," },"," "," /**"," * Reference to the category axis used by the chart."," *"," * @attribute categoryAxis"," * @type Axis"," */"," categoryAxis:{}"," }","});","/**"," * The PieChart class creates a pie chart"," *"," * @module charts"," * @submodule charts-base"," * @class PieChart"," * @extends ChartBase"," * @constructor"," */","Y.PieChart = Y.Base.create(\"pieChart\", Y.Widget, [Y.ChartBase], {"," /**"," * Calculates and returns a `seriesCollection`."," *"," * @method _getSeriesCollection"," * @return Array"," * @private"," */"," _getSeriesCollection: function()"," {"," if(this._seriesCollection)"," {"," return this._seriesCollection;"," }"," var axes = this.get(\"axes\"),"," sc = [], "," seriesKeys,"," i = 0,"," l,"," type = this.get(\"type\"),"," key,"," catAxis = \"categoryAxis\","," catKey = \"categoryKey\","," valAxis = \"valueAxis\","," seriesKey = \"valueKey\";"," if(axes)"," {"," seriesKeys = axes.values.get(\"keyCollection\");"," key = axes.category.get(\"keyCollection\")[0];"," l = seriesKeys.length;"," for(; i < l; ++i)"," {"," sc[i] = {type:type};"," sc[i][catAxis] = \"category\";"," sc[i][valAxis] = \"values\";"," sc[i][catKey] = key;"," sc[i][seriesKey] = seriesKeys[i];"," }"," }"," this._seriesCollection = sc;"," return sc;"," },",""," /**"," * Creates `Axis` instances."," *"," * @method _parseAxes"," * @param {Object} val Object containing `Axis` instances or objects in which to construct `Axis` instances."," * @return Object"," * @private"," */"," _parseAxes: function(hash)"," {"," if(!this._axes)"," {"," this._axes = {};"," }"," var i, pos, axis, dh, config, axisClass,"," type = this.get(\"type\"),"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," node = Y.Node.one(this._parentNode);"," if(!w)"," {"," this.set(\"width\", node.get(\"offsetWidth\"));"," w = this.get(\"width\");"," }"," if(!h)"," {"," this.set(\"height\", node.get(\"offsetHeight\"));"," h = this.get(\"height\");"," }"," for(i in hash)"," {"," if(hash.hasOwnProperty(i))"," {"," dh = hash[i];"," pos = type == \"pie\" ? \"none\" : dh.position;"," axisClass = this._getAxisClass(dh.type);"," config = {dataProvider:this.get(\"dataProvider\")};"," if(dh.hasOwnProperty(\"roundingUnit\"))"," {"," config.roundingUnit = dh.roundingUnit;"," }"," config.keys = dh.keys;"," config.width = w;"," config.height = h;"," config.position = pos;"," config.styles = dh.styles;"," axis = new axisClass(config);"," axis.on(\"axisRendered\", Y.bind(this._itemRendered, this));"," this._axes[i] = axis;"," }"," }"," },",""," /**"," * Adds axes to the chart."," *"," * @method _addAxes"," * @private"," */"," _addAxes: function()"," {"," var axes = this.get(\"axes\"),"," i, "," axis, "," p;"," if(!axes)"," {"," this.set(\"axes\", this._getDefaultAxes());"," axes = this.get(\"axes\");"," }"," if(!this._axesCollection)"," { "," this._axesCollection = [];"," }"," for(i in axes)"," {"," if(axes.hasOwnProperty(i))"," {"," axis = axes[i];"," p = axis.get(\"position\");"," if(!this.get(p + \"AxesCollection\"))"," {"," this.set(p + \"AxesCollection\", [axis]);"," }"," else"," {"," this.get(p + \"AxesCollection\").push(axis);"," }"," this._axesCollection.push(axis);"," }"," }"," },",""," /**"," * Renders the Graph."," *"," * @method _addSeries"," * @private"," */"," _addSeries: function()"," {"," var graph = this.get(\"graph\"),"," seriesCollection = this.get(\"seriesCollection\");"," this._parseSeriesAxes(seriesCollection);"," graph.set(\"showBackground\", false);"," graph.set(\"width\", this.get(\"width\"));"," graph.set(\"height\", this.get(\"height\"));"," graph.set(\"seriesCollection\", seriesCollection);"," this._seriesCollection = graph.get(\"seriesCollection\");"," graph.render(this.get(\"contentBox\"));"," },",""," /**"," * Parse and sets the axes for the chart."," *"," * @method _parseSeriesAxes"," * @param {Array} c A collection `PieSeries` instance."," * @private"," */"," _parseSeriesAxes: function(c)"," {"," var i = 0, "," len = c.length, "," s,"," axes = this.get(\"axes\"),"," axis;"," for(; i < len; ++i)"," {"," s = c[i];"," if(s)"," {"," //If series is an actual series instance, "," //replace axes attribute string ids with axes"," if(s instanceof Y.PieSeries)"," {"," axis = s.get(\"categoryAxis\");"," if(axis && !(axis instanceof Y.Axis))"," {"," s.set(\"categoryAxis\", axes[axis]);"," }"," axis = s.get(\"valueAxis\");"," if(axis && !(axis instanceof Y.Axis))"," {"," s.set(\"valueAxis\", axes[axis]);"," }"," continue;"," }"," s.categoryAxis = axes.category;"," s.valueAxis = axes.values;"," if(!s.type)"," {"," s.type = this.get(\"type\");"," }"," }"," }"," },",""," /**"," * Generates and returns a key-indexed object containing `Axis` instances or objects used to create `Axis` instances."," *"," * @method _getDefaultAxes"," * @return Object"," * @private"," */"," _getDefaultAxes: function()"," {"," var catKey = this.get(\"categoryKey\"),"," seriesKeys = this.get(\"seriesKeys\").concat(), "," seriesAxis = \"numeric\";"," return {"," values:{"," keys:seriesKeys,"," type:seriesAxis"," },"," category:{"," keys:[catKey],"," type:this.get(\"categoryType\")"," }"," };"," },"," "," /**"," * Returns an object literal containing a categoryItem and a valueItem for a given series index."," *"," * @method getSeriesItem"," * @param series Reference to a series."," * @param index Index of the specified item within a series."," * @return Object"," */"," getSeriesItems: function(series, index)"," {"," var categoryItem = {"," axis: series.get(\"categoryAxis\"),"," key: series.get(\"categoryKey\"),"," displayName: series.get(\"categoryDisplayName\")"," },"," valueItem = {"," axis: series.get(\"valueAxis\"),"," key: series.get(\"valueKey\"),"," displayName: series.get(\"valueDisplayName\")"," };"," categoryItem.value = categoryItem.axis.getKeyValueAt(categoryItem.key, index);"," valueItem.value = valueItem.axis.getKeyValueAt(valueItem.key, index);"," return {category:categoryItem, value:valueItem};"," },",""," /**"," * Handler for sizeChanged event."," *"," * @method _sizeChanged"," * @param {Object} e Event object."," * @private"," */"," _sizeChanged: function(e)"," {"," this._redraw();"," },",""," /**"," * Redraws the chart instance."," *"," * @method _redraw"," * @private"," */"," _redraw: function()"," {"," var graph = this.get(\"graph\"),"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," dimension;"," if(graph)"," {"," dimension = Math.min(w, h);"," graph.set(\"width\", dimension);"," graph.set(\"height\", dimension);"," }"," },"," "," /**"," * Formats tooltip text for a pie chart."," *"," * @method _tooltipLabelFunction"," * @param {Object} categoryItem An object containing the following:"," * <dl>"," * <dt>axis</dt><dd>The axis to which the category is bound.</dd>"," * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided)</dd>"," * <dt>key</dt><dd>The key of the category.</dd>"," * <dt>value</dt><dd>The value of the category</dd>"," * </dl>"," * @param {Object} valueItem An object containing the following:"," * <dl>"," * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>"," * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>"," * <dt>key</dt><dd>The key for the series.</dd>"," * <dt>value</dt><dd>The value for the series item.</dd> "," * </dl>"," * @param {Number} itemIndex The index of the item within the series."," * @param {CartesianSeries} series The `PieSeries` instance of the item."," * @param {Number} seriesIndex The index of the series in the `seriesCollection`."," * @return {HTML}"," * @private"," */"," _tooltipLabelFunction: function(categoryItem, valueItem, itemIndex, series, seriesIndex)"," {"," var msg = DOCUMENT.createElement(\"div\"),"," total = series.getTotalValues(),"," pct = Math.round((valueItem.value / total) * 10000)/100;"," msg.appendChild(DOCUMENT.createTextNode(categoryItem.displayName +"," \": \" + categoryItem.axis.get(\"labelFunction\").apply(this, [categoryItem.value, categoryItem.axis.get(\"labelFormat\")]))); "," msg.appendChild(DOCUMENT.createElement(\"br\"));"," msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName + "," \": \" + valueItem.axis.get(\"labelFunction\").apply(this, [valueItem.value, valueItem.axis.get(\"labelFormat\")])));"," msg.appendChild(DOCUMENT.createElement(\"br\"));"," msg.appendChild(DOCUMENT.createTextNode(pct + \"%\")); "," return msg; "," },",""," /**"," * Returns the appropriate message based on the key press."," *"," * @method _getAriaMessage"," * @param {Number} key The keycode that was pressed."," * @return String"," */"," _getAriaMessage: function(key)"," {"," var msg = \"\","," categoryItem,"," items,"," series,"," valueItem,"," seriesIndex = 0,"," itemIndex = this._itemIndex,"," seriesCollection = this.get(\"seriesCollection\"),"," len,"," total,"," pct,"," markers;"," series = this.getSeries(parseInt(seriesIndex, 10));"," markers = series.get(\"markers\");"," len = markers && markers.length ? markers.length : 0;"," if(key === 37)"," {"," itemIndex = itemIndex > 0 ? itemIndex - 1 : len - 1;"," }"," else if(key === 39)"," {"," itemIndex = itemIndex >= len - 1 ? 0 : itemIndex + 1;"," }"," this._itemIndex = itemIndex;"," items = this.getSeriesItems(series, itemIndex);"," categoryItem = items.category;"," valueItem = items.value;"," total = series.getTotalValues();"," pct = Math.round((valueItem.value / total) * 10000)/100;"," if(categoryItem && valueItem)"," {"," msg += categoryItem.displayName + \": \" + categoryItem.axis.formatLabel.apply(this, [categoryItem.value, categoryItem.axis.get(\"labelFormat\")]) + \", \";"," msg += valueItem.displayName + \": \" + valueItem.axis.formatLabel.apply(this, [valueItem.value, valueItem.axis.get(\"labelFormat\")]) + \", \"; "," msg += \"Percent of total \" + valueItem.displayName + \": \" + pct + \"%,\"; "," }"," else"," {"," msg += \"No data available,\";"," }"," msg += (itemIndex + 1) + \" of \" + len + \". \";"," return msg;"," }","}, {"," ATTRS: {"," /**"," * Sets the aria description for the chart."," *"," * @attribute ariaDescription"," * @type String"," */"," ariaDescription: {"," value: \"Use the left and right keys to navigate through items.\",",""," setter: function(val)"," {"," if(this._description)"," {"," this._description.setContent(\"\");"," this._description.appendChild(DOCUMENT.createTextNode(val));"," }"," return val;"," }"," },"," "," /**"," * Axes to appear in the chart. "," *"," * @attribute axes"," * @type Object"," */"," axes: {"," getter: function()"," {"," return this._axes;"," },",""," setter: function(val)"," {"," this._parseAxes(val);"," }"," },",""," /**"," * Collection of series to appear on the chart. This can be an array of Series instances or object literals"," * used to describe a Series instance."," *"," * @attribute seriesCollection"," * @type Array"," */"," seriesCollection: {"," getter: function()"," {"," return this._getSeriesCollection();"," },"," "," setter: function(val)"," {"," return this._setSeriesCollection(val);"," }"," },"," "," /**"," * Type of chart when there is no series collection specified."," *"," * @attribute type"," * @type String "," */"," type: {"," value: \"pie\""," }"," }","});","","","}, '3.7.1', {\"requires\": [\"dom\", \"datatype-number\", \"datatype-date\", \"event-custom\", \"event-mouseenter\", \"event-touch\", \"widget\", \"widget-position\", \"widget-stack\", \"graphics\"]});"];+_yuitest_coverage["build/charts-base/charts-base.js"].lines = {"1":0,"17":0,"41":0,"43":0,"46":0,"48":0,"57":0,"77":0,"79":0,"81":0,"82":0,"84":0,"85":0,"86":0,"87":0,"88":0,"90":0,"98":0,"99":0,"107":0,"121":0,"124":0,"126":0,"128":0,"132":0,"136":0,"141":0,"143":0,"147":0,"148":0,"149":0,"150":0,"151":0,"162":0,"163":0,"169":0,"173":0,"179":0,"183":0,"187":0,"196":0,"198":0,"201":0,"203":0,"212":0,"216":0,"220":0,"225":0,"227":0,"231":0,"232":0,"233":0,"234":0,"235":0,"246":0,"247":0,"256":0,"258":0,"261":0,"263":0,"272":0,"276":0,"277":0,"286":0,"288":0,"291":0,"293":0,"302":0,"306":0,"307":0,"316":0,"318":0,"321":0,"323":0,"332":0,"336":0,"337":0,"347":0,"349":0,"360":0,"361":0,"366":0,"378":0,"380":0,"400":0,"401":0,"416":0,"418":0,"420":0,"421":0,"423":0,"425":0,"429":0,"432":0,"444":0,"453":0,"454":0,"464":0,"466":0,"476":0,"492":0,"497":0,"498":0,"500":0,"503":0,"504":0,"505":0,"507":0,"508":0,"509":0,"511":0,"512":0,"513":0,"515":0,"516":0,"517":0,"532":0,"538":0,"550":0,"556":0,"558":0,"560":0,"562":0,"564":0,"577":0,"589":0,"596":0,"598":0,"600":0,"602":0,"606":0,"608":0,"620":0,"622":0,"627":0,"628":0,"630":0,"642":0,"651":0,"652":0,"653":0,"655":0,"657":0,"658":0,"659":0,"660":0,"674":0,"685":0,"687":0,"688":0,"690":0,"692":0,"694":0,"696":0,"697":0,"701":0,"702":0,"704":0,"705":0,"706":0,"707":0,"708":0,"720":0,"726":0,"728":0,"729":0,"731":0,"733":0,"734":0,"736":0,"738":0,"739":0,"743":0,"744":0,"746":0,"747":0,"761":0,"762":0,"764":0,"766":0,"768":0,"770":0,"772":0,"776":0,"778":0,"800":0,"808":0,"810":0,"812":0,"813":0,"817":0,"826":0,"828":0,"838":0,"854":0,"859":0,"860":0,"862":0,"865":0,"866":0,"867":0,"869":0,"870":0,"871":0,"873":0,"874":0,"875":0,"877":0,"878":0,"879":0,"894":0,"900":0,"912":0,"919":0,"921":0,"923":0,"925":0,"927":0,"940":0,"952":0,"959":0,"961":0,"963":0,"965":0,"969":0,"971":0,"983":0,"985":0,"990":0,"991":0,"993":0,"1005":0,"1014":0,"1015":0,"1016":0,"1018":0,"1020":0,"1021":0,"1022":0,"1023":0,"1037":0,"1048":0,"1050":0,"1052":0,"1054":0,"1056":0,"1058":0,"1059":0,"1061":0,"1063":0,"1067":0,"1068":0,"1070":0,"1071":0,"1072":0,"1073":0,"1074":0,"1075":0,"1076":0,"1088":0,"1094":0,"1096":0,"1098":0,"1100":0,"1101":0,"1103":0,"1105":0,"1109":0,"1110":0,"1112":0,"1113":0,"1127":0,"1128":0,"1130":0,"1132":0,"1134":0,"1136":0,"1138":0,"1142":0,"1144":0,"1156":0,"1159":0,"1170":0,"1175":0,"1177":0,"1179":0,"1180":0,"1184":0,"1193":0,"1195":0,"1205":0,"1221":0,"1226":0,"1227":0,"1229":0,"1232":0,"1233":0,"1234":0,"1236":0,"1237":0,"1238":0,"1240":0,"1241":0,"1242":0,"1244":0,"1245":0,"1246":0,"1258":0,"1264":0,"1266":0,"1268":0,"1270":0,"1272":0,"1286":0,"1292":0,"1305":0,"1317":0,"1324":0,"1326":0,"1328":0,"1330":0,"1334":0,"1336":0,"1348":0,"1350":0,"1355":0,"1356":0,"1358":0,"1370":0,"1379":0,"1380":0,"1381":0,"1383":0,"1385":0,"1386":0,"1387":0,"1388":0,"1402":0,"1413":0,"1415":0,"1417":0,"1419":0,"1421":0,"1423":0,"1424":0,"1428":0,"1430":0,"1431":0,"1432":0,"1433":0,"1434":0,"1435":0,"1436":0,"1448":0,"1455":0,"1457":0,"1458":0,"1460":0,"1462":0,"1463":0,"1467":0,"1468":0,"1470":0,"1471":0,"1485":0,"1486":0,"1488":0,"1490":0,"1492":0,"1496":0,"1498":0,"1510":0,"1511":0,"1522":0,"1527":0,"1529":0,"1531":0,"1534":0,"1543":0,"1545":0,"1555":0,"1571":0,"1576":0,"1577":0,"1578":0,"1581":0,"1582":0,"1583":0,"1585":0,"1586":0,"1587":0,"1589":0,"1590":0,"1591":0,"1593":0,"1594":0,"1595":0,"1607":0,"1614":0,"1616":0,"1618":0,"1620":0,"1622":0,"1636":0,"1642":0,"1655":0,"1667":0,"1674":0,"1676":0,"1678":0,"1680":0,"1684":0,"1686":0,"1698":0,"1700":0,"1705":0,"1706":0,"1708":0,"1720":0,"1729":0,"1730":0,"1731":0,"1733":0,"1735":0,"1736":0,"1737":0,"1738":0,"1752":0,"1762":0,"1764":0,"1765":0,"1769":0,"1771":0,"1772":0,"1774":0,"1776":0,"1778":0,"1780":0,"1781":0,"1785":0,"1788":0,"1789":0,"1790":0,"1791":0,"1792":0,"1804":0,"1810":0,"1812":0,"1813":0,"1817":0,"1819":0,"1820":0,"1822":0,"1824":0,"1826":0,"1828":0,"1829":0,"1833":0,"1836":0,"1837":0,"1851":0,"1852":0,"1854":0,"1858":0,"1860":0,"1862":0,"1864":0,"1866":0,"1868":0,"1872":0,"1875":0,"1897":0,"1905":0,"1907":0,"1909":0,"1910":0,"1913":0,"1926":0,"1954":0,"1956":0,"1969":0,"1970":0,"1982":0,"1983":0,"1985":0,"1987":0,"1992":0,"1994":0,"2008":0,"2010":0,"2020":0,"2029":0,"2035":0,"2037":0,"2038":0,"2039":0,"2040":0,"2042":0,"2044":0,"2046":0,"2047":0,"2051":0,"2062":0,"2068":0,"2069":0,"2070":0,"2071":0,"2072":0,"2074":0,"2078":0,"2080":0,"2081":0,"2082":0,"2083":0,"2084":0,"2097":0,"2152":0,"2164":0,"2169":0,"2170":0,"2171":0,"2173":0,"2203":0,"2204":0,"2217":0,"2219":0,"2222":0,"2223":0,"2225":0,"2226":0,"2228":0,"2229":0,"2232":0,"2237":0,"2255":0,"2257":0,"2258":0,"2260":0,"2261":0,"2262":0,"2264":0,"2288":0,"2289":0,"2290":0,"2291":0,"2292":0,"2297":0,"2298":0,"2299":0,"2300":0,"2301":0,"2302":0,"2303":0,"2304":0,"2305":0,"2307":0,"2311":0,"2312":0,"2313":0,"2315":0,"2316":0,"2317":0,"2322":0,"2324":0,"2325":0,"2326":0,"2327":0,"2328":0,"2329":0,"2330":0,"2331":0,"2333":0,"2335":0,"2337":0,"2338":0,"2339":0,"2340":0,"2341":0,"2342":0,"2343":0,"2344":0,"2346":0,"2348":0,"2349":0,"2350":0,"2352":0,"2353":0,"2355":0,"2357":0,"2358":0,"2360":0,"2362":0,"2364":0,"2368":0,"2369":0,"2371":0,"2375":0,"2376":0,"2389":0,"2398":0,"2399":0,"2400":0,"2402":0,"2403":0,"2405":0,"2410":0,"2411":0,"2413":0,"2416":0,"2417":0,"2428":0,"2432":0,"2434":0,"2435":0,"2437":0,"2439":0,"2440":0,"2442":0,"2444":0,"2456":0,"2462":0,"2464":0,"2469":0,"2470":0,"2472":0,"2473":0,"2474":0,"2475":0,"2476":0,"2478":0,"2480":0,"2482":0,"2485":0,"2486":0,"2488":0,"2490":0,"2493":0,"2494":0,"2495":0,"2496":0,"2498":0,"2500":0,"2501":0,"2503":0,"2505":0,"2506":0,"2521":0,"2529":0,"2531":0,"2535":0,"2536":0,"2537":0,"2539":0,"2541":0,"2543":0,"2546":0,"2547":0,"2548":0,"2549":0,"2551":0,"2553":0,"2556":0,"2567":0,"2569":0,"2571":0,"2576":0,"2578":0,"2589":0,"2591":0,"2594":0,"2596":0,"2597":0,"2598":0,"2599":0,"2602":0,"2614":0,"2617":0,"2619":0,"2623":0,"2636":0,"2642":0,"2644":0,"2648":0,"2650":0,"2663":0,"2667":0,"2669":0,"2673":0,"2675":0,"2689":0,"2690":0,"2692":0,"2696":0,"2698":0,"2710":0,"2714":0,"2716":0,"2720":0,"2733":0,"2739":0,"2743":0,"2745":0,"2749":0,"2754":0,"2756":0,"2769":0,"2777":0,"2779":0,"2780":0,"2781":0,"2782":0,"2786":0,"2787":0,"2789":0,"2791":0,"2795":0,"2796":0,"2797":0,"2798":0,"2799":0,"2800":0,"2801":0,"2803":0,"2807":0,"2809":0,"2810":0,"2811":0,"2815":0,"2816":0,"2818":0,"2820":0,"2839":0,"2841":0,"2842":0,"2843":0,"2844":0,"2845":0,"2856":0,"2867":0,"2880":0,"2885":0,"2886":0,"2887":0,"2888":0,"2889":0,"2890":0,"2891":0,"2892":0,"2893":0,"2894":0,"2895":0,"2896":0,"2897":0,"2898":0,"2910":0,"2912":0,"2913":0,"2915":0,"2916":0,"2917":0,"2930":0,"2935":0,"2937":0,"2939":0,"2940":0,"2941":0,"2942":0,"2945":0,"2947":0,"2971":0,"2972":0,"2974":0,"2976":0,"2978":0,"2980":0,"2982":0,"2984":0,"3003":0,"3005":0,"3007":0,"3012":0,"3013":0,"3031":0,"3033":0,"3035":0,"3040":0,"3041":0,"3055":0,"3060":0,"3061":0,"3075":0,"3080":0,"3081":0,"3116":0,"3118":0,"3119":0,"3121":0,"3124":0,"3139":0,"3141":0,"3142":0,"3144":0,"3147":0,"3168":0,"3169":0,"3171":0,"3173":0,"3231":0,"3246":0,"3248":0,"3250":0,"3266":0,"3288":0,"3293":0,"3294":0,"3328":0,"3349":0,"3370":0,"3435":0,"3442":0,"3443":0,"3444":0,"3445":0,"3446":0,"3447":0,"3448":0,"3449":0,"3458":0,"3459":0,"3460":0,"3461":0,"3462":0,"3463":0,"3464":0,"3476":0,"3479":0,"3481":0,"3483":0,"3485":0,"3489":0,"3491":0,"3578":0,"3592":0,"3596":0,"3598":0,"3599":0,"3601":0,"3614":0,"3619":0,"3621":0,"3622":0,"3624":0,"3625":0,"3636":0,"3638":0,"3639":0,"3641":0,"3643":0,"3646":0,"3658":0,"3659":0,"3661":0,"3662":0,"3676":0,"3678":0,"3680":0,"3682":0,"3694":0,"3695":0,"3697":0,"3699":0,"3710":0,"3716":0,"3718":0,"3719":0,"3720":0,"3722":0,"3724":0,"3725":0,"3727":0,"3729":0,"3730":0,"3734":0,"3735":0,"3746":0,"3749":0,"3751":0,"3753":0,"3755":0,"3757":0,"3771":0,"3772":0,"3774":0,"3776":0,"3778":0,"3780":0,"3794":0,"3808":0,"3812":0,"3813":0,"3814":0,"3826":0,"3827":0,"3841":0,"3843":0,"3845":0,"3857":0,"3869":0,"3884":0,"3888":0,"3890":0,"3891":0,"3893":0,"3897":0,"3899":0,"3900":0,"3904":0,"3906":0,"3908":0,"3912":0,"3913":0,"3952":0,"3966":0,"3980":0,"3982":0,"3984":0,"3999":0,"4003":0,"4005":0,"4007":0,"4009":0,"4011":0,"4015":0,"4016":0,"4030":0,"4032":0,"4034":0,"4049":0,"4050":0,"4052":0,"4054":0,"4058":0,"4059":0,"4075":0,"4091":0,"4104":0,"4106":0,"4108":0,"4121":0,"4124":0,"4126":0,"4128":0,"4131":0,"4147":0,"4149":0,"4152":0,"4154":0,"4181":0,"4183":0,"4185":0,"4207":0,"4219":0,"4221":0,"4223":0,"4235":0,"4240":0,"4242":0,"4243":0,"4245":0,"4248":0,"4272":0,"4285":0,"4290":0,"4292":0,"4293":0,"4297":0,"4299":0,"4301":0,"4303":0,"4315":0,"4324":0,"4326":0,"4328":0,"4329":0,"4331":0,"4332":0,"4334":0,"4336":0,"4338":0,"4340":0,"4342":0,"4343":0,"4347":0,"4348":0,"4349":0,"4352":0,"4354":0,"4356":0,"4358":0,"4362":0,"4364":0,"4366":0,"4368":0,"4370":0,"4374":0,"4377":0,"4378":0,"4381":0,"4395":0,"4410":0,"4412":0,"4414":0,"4415":0,"4417":0,"4419":0,"4420":0,"4424":0,"4426":0,"4428":0,"4430":0,"4433":0,"4435":0,"4439":0,"4442":0,"4444":0,"4446":0,"4447":0,"4448":0,"4449":0,"4450":0,"4452":0,"4454":0,"4456":0,"4457":0,"4458":0,"4459":0,"4463":0,"4465":0,"4469":0,"4472":0,"4474":0,"4476":0,"4477":0,"4478":0,"4479":0,"4483":0,"4485":0,"4489":0,"4494":0,"4495":0,"4496":0,"4497":0,"4502":0,"4504":0,"4506":0,"4508":0,"4512":0,"4513":0,"4519":0,"4521":0,"4523":0,"4527":0,"4530":0,"4532":0,"4534":0,"4535":0,"4536":0,"4540":0,"4541":0,"4546":0,"4550":0,"4552":0,"4554":0,"4556":0,"4559":0,"4560":0,"4562":0,"4564":0,"4566":0,"4568":0,"4570":0,"4571":0,"4572":0,"4574":0,"4576":0,"4577":0,"4581":0,"4582":0,"4584":0,"4585":0,"4586":0,"4590":0,"4591":0,"4593":0,"4595":0,"4596":0,"4601":0,"4602":0,"4604":0,"4606":0,"4608":0,"4609":0,"4610":0,"4612":0,"4614":0,"4618":0,"4619":0,"4624":0,"4626":0,"4627":0,"4628":0,"4629":0,"4630":0,"4631":0,"4633":0,"4635":0,"4637":0,"4639":0,"4641":0,"4643":0,"4647":0,"4649":0,"4651":0,"4653":0,"4654":0,"4658":0,"4660":0,"4664":0,"4666":0,"4670":0,"4671":0,"4685":0,"4690":0,"4692":0,"4694":0,"4696":0,"4698":0,"4702":0,"4703":0,"4705":0,"4707":0,"4709":0,"4724":0,"4725":0,"4727":0,"4729":0,"4730":0,"4745":0,"4746":0,"4748":0,"4750":0,"4765":0,"4766":0,"4768":0,"4770":0,"4785":0,"4786":0,"4787":0,"4801":0,"4804":0,"4806":0,"4808":0,"4809":0,"4810":0,"4811":0,"4813":0,"4815":0,"4819":0,"4831":0,"4833":0,"4836":0,"4839":0,"4849":0,"4861":0,"4863":0,"4865":0,"4868":0,"4870":0,"4871":0,"4872":0,"4874":0,"4876":0,"4877":0,"4879":0,"4881":0,"4883":0,"4887":0,"4891":0,"4893":0,"4897":0,"4899":0,"4901":0,"4905":0,"4908":0,"4909":0,"4910":0,"4912":0,"4914":0,"4916":0,"4918":0,"4922":0,"4934":0,"4936":0,"4939":0,"4941":0,"4956":0,"4957":0,"4974":0,"4975":0,"4988":0,"4989":0,"4991":0,"4993":0,"4997":0,"4998":0,"5011":0,"5012":0,"5014":0,"5016":0,"5020":0,"5021":0,"5041":0,"5042":0,"5044":0,"5046":0,"5061":0,"5072":0,"5073":0,"5075":0,"5077":0,"5109":0,"5114":0,"5115":0,"5116":0,"5118":0,"5122":0,"5124":0,"5138":0,"5143":0,"5145":0,"5146":0,"5148":0,"5152":0,"5153":0,"5155":0,"5157":0,"5159":0,"5161":0,"5165":0,"5167":0,"5169":0,"5174":0,"5177":0,"5179":0,"5192":0,"5198":0,"5200":0,"5201":0,"5203":0,"5207":0,"5208":0,"5210":0,"5212":0,"5214":0,"5216":0,"5220":0,"5222":0,"5224":0,"5229":0,"5232":0,"5234":0,"5235":0,"5248":0,"5250":0,"5252":0,"5254":0,"5257":0,"5261":0,"5273":0,"5275":0,"5278":0,"5280":0,"5292":0,"5329":0,"5330":0,"5344":0,"5349":0,"5351":0,"5353":0,"5355":0,"5356":0,"5357":0,"5359":0,"5360":0,"5373":0,"5379":0,"5381":0,"5383":0,"5385":0,"5386":0,"5387":0,"5389":0,"5390":0,"5391":0,"5403":0,"5405":0,"5407":0,"5408":0,"5410":0,"5412":0,"5425":0,"5439":0,"5440":0,"5442":0,"5444":0,"5446":0,"5448":0,"5462":0,"5475":0,"5477":0,"5479":0,"5481":0,"5495":0,"5498":0,"5500":0,"5504":0,"5506":0,"5518":0,"5520":0,"5532":0,"5535":0,"5539":0,"5549":0,"5553":0,"5565":0,"5573":0,"5575":0,"5578":0,"5586":0,"5588":0,"5589":0,"5590":0,"5591":0,"5592":0,"5595":0,"5597":0,"5598":0,"5599":0,"5602":0,"5603":0,"5604":0,"5605":0,"5606":0,"5607":0,"5609":0,"5611":0,"5612":0,"5614":0,"5616":0,"5617":0,"5621":0,"5622":0,"5626":0,"5639":0,"5644":0,"5645":0,"5647":0,"5648":0,"5649":0,"5652":0,"5654":0,"5657":0,"5660":0,"5669":0,"5671":0,"5689":0,"5691":0,"5695":0,"5707":0,"5723":0,"5725":0,"5726":0,"5727":0,"5731":0,"5733":0,"5735":0,"5737":0,"5739":0,"5740":0,"5742":0,"5743":0,"5745":0,"5746":0,"5748":0,"5752":0,"5756":0,"5758":0,"5762":0,"5765":0,"5766":0,"5767":0,"5769":0,"5771":0,"5772":0,"5773":0,"5776":0,"5777":0,"5788":0,"5805":0,"5807":0,"5808":0,"5809":0,"5813":0,"5815":0,"5817":0,"5819":0,"5821":0,"5822":0,"5824":0,"5825":0,"5827":0,"5828":0,"5830":0,"5834":0,"5838":0,"5840":0,"5844":0,"5847":0,"5848":0,"5849":0,"5851":0,"5853":0,"5854":0,"5855":0,"5858":0,"5859":0,"5874":0,"5886":0,"5888":0,"5889":0,"5891":0,"5893":0,"5895":0,"5896":0,"5897":0,"5899":0,"5902":0,"5903":0,"5905":0,"5906":0,"5922":0,"5925":0,"5927":0,"5928":0,"5930":0,"5944":0,"5947":0,"5949":0,"5950":0,"5952":0,"5967":0,"5979":0,"5981":0,"5982":0,"5984":0,"5987":0,"5988":0,"5990":0,"5991":0,"5992":0,"5995":0,"5996":0,"5998":0,"5999":0,"6004":0,"6013":0,"6015":0,"6032":0,"6033":0,"6035":0,"6037":0,"6038":0,"6050":0,"6052":0,"6064":0,"6066":0,"6068":0,"6092":0,"6094":0,"6095":0,"6099":0,"6100":0,"6102":0,"6103":0,"6108":0,"6110":0,"6111":0,"6112":0,"6113":0,"6115":0,"6116":0,"6118":0,"6120":0,"6121":0,"6123":0,"6125":0,"6127":0,"6131":0,"6136":0,"6138":0,"6142":0,"6144":0,"6150":0,"6153":0,"6154":0,"6155":0,"6157":0,"6168":0,"6170":0,"6172":0,"6187":0,"6192":0,"6193":0,"6195":0,"6196":0,"6197":0,"6198":0,"6199":0,"6200":0,"6201":0,"6203":0,"6220":0,"6221":0,"6222":0,"6231":0,"6232":0,"6234":0,"6236":0,"6237":0,"6238":0,"6239":0,"6242":0,"6243":0,"6245":0,"6247":0,"6249":0,"6251":0,"6254":0,"6266":0,"6279":0,"6280":0,"6288":0,"6290":0,"6294":0,"6299":0,"6300":0,"6304":0,"6305":0,"6308":0,"6318":0,"6319":0,"6321":0,"6322":0,"6324":0,"6336":0,"6338":0,"6352":0,"6354":0,"6356":0,"6370":0,"6371":0,"6375":0,"6376":0,"6378":0,"6379":0,"6380":0,"6381":0,"6383":0,"6385":0,"6387":0,"6388":0,"6389":0,"6390":0,"6394":0,"6396":0,"6397":0,"6399":0,"6400":0,"6401":0,"6412":0,"6414":0,"6416":0,"6432":0,"6436":0,"6437":0,"6438":0,"6440":0,"6441":0,"6442":0,"6443":0,"6444":0,"6445":0,"6446":0,"6448":0,"6450":0,"6451":0,"6455":0,"6456":0,"6458":0,"6459":0,"6470":0,"6472":0,"6474":0,"6496":0,"6497":0,"6498":0,"6499":0,"6500":0,"6504":0,"6505":0,"6506":0,"6508":0,"6509":0,"6510":0,"6511":0,"6512":0,"6513":0,"6514":0,"6516":0,"6518":0,"6519":0,"6520":0,"6521":0,"6522":0,"6523":0,"6524":0,"6526":0,"6527":0,"6528":0,"6529":0,"6530":0,"6531":0,"6532":0,"6537":0,"6539":0,"6540":0,"6544":0,"6545":0,"6549":0,"6550":0,"6571":0,"6575":0,"6577":0,"6578":0,"6579":0,"6580":0,"6581":0,"6582":0,"6586":0,"6587":0,"6588":0,"6589":0,"6590":0,"6591":0,"6593":0,"6594":0,"6595":0,"6611":0,"6613":0,"6615":0,"6616":0,"6618":0,"6621":0,"6637":0,"6639":0,"6641":0,"6642":0,"6646":0,"6647":0,"6649":0,"6661":0,"6682":0,"6684":0,"6687":0,"6688":0,"6689":0,"6690":0,"6692":0,"6693":0,"6694":0,"6695":0,"6699":0,"6700":0,"6701":0,"6702":0,"6704":0,"6706":0,"6707":0,"6708":0,"6709":0,"6710":0,"6714":0,"6717":0,"6718":0,"6719":0,"6720":0,"6722":0,"6723":0,"6724":0,"6726":0,"6727":0,"6728":0,"6730":0,"6731":0,"6732":0,"6733":0,"6735":0,"6737":0,"6738":0,"6739":0,"6741":0,"6742":0,"6743":0,"6744":0,"6746":0,"6747":0,"6748":0,"6750":0,"6752":0,"6753":0,"6754":0,"6756":0,"6758":0,"6759":0,"6760":0,"6763":0,"6764":0,"6765":0,"6766":0,"6769":0,"6770":0,"6771":0,"6783":0,"6787":0,"6788":0,"6797":0,"6799":0,"6803":0,"6807":0,"6810":0,"6828":0,"6830":0,"6832":0,"6851":0,"6853":0,"6854":0,"6855":0,"6857":0,"6858":0,"6860":0,"6872":0,"6874":0,"6876":0,"6878":0,"6880":0,"6882":0,"6883":0,"6885":0,"6886":0,"6887":0,"6889":0,"6890":0,"6892":0,"6894":0,"6896":0,"6898":0,"6901":0,"6902":0,"6903":0,"6905":0,"6931":0,"6933":0,"6935":0,"6948":0,"6964":0,"6965":0,"6966":0,"7000":0,"7002":0,"7004":0,"7005":0,"7006":0,"7007":0,"7009":0,"7011":0,"7013":0,"7014":0,"7016":0,"7019":0,"7023":0,"7025":0,"7026":0,"7041":0,"7044":0,"7045":0,"7046":0,"7047":0,"7048":0,"7059":0,"7061":0,"7062":0,"7064":0,"7066":0,"7070":0,"7072":0,"7084":0,"7090":0,"7092":0,"7094":0,"7095":0,"7097":0,"7100":0,"7101":0,"7109":0,"7110":0,"7111":0,"7113":0,"7115":0,"7117":0,"7119":0,"7121":0,"7123":0,"7124":0,"7125":0,"7137":0,"7141":0,"7143":0,"7144":0,"7146":0,"7147":0,"7149":0,"7163":0,"7164":0,"7166":0,"7167":0,"7169":0,"7184":0,"7186":0,"7194":0,"7195":0,"7196":0,"7197":0,"7198":0,"7199":0,"7200":0,"7201":0,"7202":0,"7217":0,"7219":0,"7221":0,"7234":0,"7235":0,"7248":0,"7250":0,"7251":0,"7252":0,"7254":0,"7256":0,"7258":0,"7261":0,"7274":0,"7275":0,"7278":0,"7279":0,"7281":0,"7282":0,"7284":0,"7285":0,"7287":0,"7288":0,"7290":0,"7301":0,"7302":0,"7311":0,"7313":0,"7322":0,"7324":0,"7326":0,"7365":0,"7367":0,"7369":0,"7371":0,"7373":0,"7375":0,"7376":0,"7380":0,"7381":0,"7383":0,"7384":0,"7385":0,"7386":0,"7388":0,"7389":0,"7390":0,"7392":0,"7395":0,"7396":0,"7397":0,"7399":0,"7400":0,"7401":0,"7402":0,"7403":0,"7404":0,"7406":0,"7407":0,"7409":0,"7410":0,"7411":0,"7412":0,"7413":0,"7414":0,"7415":0,"7417":0,"7418":0,"7420":0,"7421":0,"7423":0,"7424":0,"7426":0,"7428":0,"7429":0,"7430":0,"7431":0,"7435":0,"7436":0,"7437":0,"7438":0,"7439":0,"7441":0,"7443":0,"7445":0,"7447":0,"7451":0,"7453":0,"7456":0,"7457":0,"7458":0,"7460":0,"7471":0,"7493":0,"7516":0,"7517":0,"7518":0,"7522":0,"7533":0,"7576":0,"7577":0,"7578":0,"7579":0,"7590":0,"7592":0,"7594":0,"7595":0,"7597":0,"7599":0,"7600":0,"7602":0,"7603":0,"7604":0,"7605":0,"7606":0,"7608":0,"7611":0,"7612":0,"7613":0,"7615":0,"7618":0,"7619":0,"7620":0,"7622":0,"7625":0,"7637":0,"7638":0,"7639":0,"7651":0,"7652":0,"7653":0,"7674":0,"7675":0,"7677":0,"7690":0,"7691":0,"7693":0,"7706":0,"7712":0,"7714":0,"7716":0,"7717":0,"7718":0,"7720":0,"7722":0,"7723":0,"7724":0,"7735":0,"7737":0,"7741":0,"7753":0,"7755":0,"7766":0,"7800":0,"7801":0,"7802":0,"7803":0,"7804":0,"7806":0,"7808":0,"7810":0,"7811":0,"7812":0,"7814":0,"7816":0,"7818":0,"7819":0,"7820":0,"7822":0,"7826":0,"7828":0,"7830":0,"7834":0,"7836":0,"7837":0,"7838":0,"7839":0,"7841":0,"7842":0,"7843":0,"7844":0,"7845":0,"7858":0,"7861":0,"7863":0,"7864":0,"7866":0,"7879":0,"7882":0,"7884":0,"7885":0,"7887":0,"7898":0,"7901":0,"7903":0,"7905":0,"7907":0,"7908":0,"7910":0,"7911":0,"7912":0,"7913":0,"7915":0,"7917":0,"7918":0,"7920":0,"7924":0,"7925":0,"7950":0,"8005":0,"8013":0,"8014":0,"8016":0,"8018":0,"8019":0,"8031":0,"8042":0,"8043":0,"8054":0,"8056":0,"8058":0,"8060":0,"8062":0,"8064":0,"8066":0,"8068":0,"8070":0,"8072":0,"8074":0,"8075":0,"8076":0,"8077":0,"8078":0,"8079":0,"8081":0,"8083":0,"8084":0,"8086":0,"8089":0,"8091":0,"8092":0,"8094":0,"8096":0,"8097":0,"8099":0,"8101":0,"8102":0,"8188":0,"8193":0,"8194":0,"8207":0,"8212":0,"8213":0,"8229":0,"8234":0,"8236":0,"8240":0,"8242":0,"8258":0,"8263":0,"8265":0,"8269":0,"8271":0,"8330":0,"8370":0,"8384":0,"8425":0,"8440":0,"8481":0,"8482":0,"8484":0,"8486":0,"8498":0,"8499":0,"8501":0,"8503":0,"8526":0,"8528":0,"8532":0,"8538":0,"8539":0,"8555":0,"8565":0,"8579":0,"8581":0,"8583":0,"8584":0,"8598":0,"8599":0,"8658":0,"8666":0,"8680":0,"8682":0,"8684":0,"8698":0,"8699":0,"8754":0,"8764":0,"8818":0,"8828":0,"8829":0,"8857":0,"8867":0,"8868":0,"8897":0,"8911":0,"8914":0,"8916":0,"8917":0,"8921":0,"8922":0,"8924":0,"8937":0,"8939":0,"8957":0,"8958":0,"8959":0,"8960":0,"8961":0,"8962":0,"8963":0,"8964":0,"8966":0,"8967":0,"8968":0,"8969":0,"8971":0,"8973":0,"8975":0,"8977":0,"8978":0,"8980":0,"8981":0,"8983":0,"9047":0,"9061":0,"9064":0,"9066":0,"9067":0,"9071":0,"9072":0,"9074":0,"9087":0,"9089":0,"9107":0,"9108":0,"9109":0,"9110":0,"9111":0,"9112":0,"9113":0,"9114":0,"9116":0,"9117":0,"9118":0,"9119":0,"9121":0,"9123":0,"9125":0,"9127":0,"9128":0,"9130":0,"9131":0,"9133":0,"9205":0,"9215":0,"9229":0,"9231":0,"9233":0,"9247":0,"9248":0,"9297":0,"9307":0,"9350":0,"9360":0,"9361":0,"9392":0,"9402":0,"9404":0,"9406":0,"9408":0,"9410":0,"9412":0,"9425":0,"9429":0,"9431":0,"9433":0,"9435":0,"9437":0,"9439":0,"9440":0,"9442":0,"9443":0,"9444":0,"9446":0,"9447":0,"9449":0,"9466":0,"9467":0,"9468":0,"9469":0,"9470":0,"9556":0,"9560":0,"9589":0,"9593":0,"9616":0,"9620":0,"9659":0,"9669":0,"9670":0,"9682":0,"9684":0,"9686":0,"9688":0,"9690":0,"9692":0,"9733":0,"9743":0,"9745":0,"9747":0,"9749":0,"9751":0,"9753":0,"9783":0,"9793":0,"9795":0,"9797":0,"9799":0,"9801":0,"9803":0,"9842":0,"9852":0,"9853":0,"9880":0,"9890":0,"9891":0,"9903":0,"9930":0,"9939":0,"9941":0,"9943":0,"9974":0,"9976":0,"9978":0,"9980":0,"9982":0,"9983":0,"9985":0,"9986":0,"9987":0,"9989":0,"9991":0,"9992":0,"9993":0,"9994":0,"9996":0,"9997":0,"9998":0,"10003":0,"10004":0,"10006":0,"10007":0,"10008":0,"10010":0,"10011":0,"10013":0,"10015":0,"10017":0,"10018":0,"10020":0,"10021":0,"10023":0,"10025":0,"10026":0,"10028":0,"10029":0,"10031":0,"10033":0,"10034":0,"10035":0,"10039":0,"10040":0,"10045":0,"10047":0,"10048":0,"10049":0,"10050":0,"10052":0,"10054":0,"10055":0,"10056":0,"10059":0,"10061":0,"10062":0,"10064":0,"10065":0,"10066":0,"10067":0,"10071":0,"10072":0,"10073":0,"10074":0,"10075":0,"10077":0,"10079":0,"10081":0,"10083":0,"10086":0,"10088":0,"10091":0,"10093":0,"10104":0,"10118":0,"10120":0,"10128":0,"10129":0,"10130":0,"10131":0,"10132":0,"10133":0,"10134":0,"10135":0,"10136":0,"10137":0,"10139":0,"10143":0,"10145":0,"10147":0,"10151":0,"10153":0,"10166":0,"10189":0,"10190":0,"10191":0,"10270":0,"10280":0,"10282":0,"10285":0,"10316":0,"10318":0,"10320":0,"10322":0,"10324":0,"10325":0,"10327":0,"10328":0,"10329":0,"10331":0,"10333":0,"10334":0,"10335":0,"10336":0,"10338":0,"10339":0,"10340":0,"10345":0,"10346":0,"10348":0,"10349":0,"10350":0,"10352":0,"10353":0,"10354":0,"10356":0,"10358":0,"10359":0,"10361":0,"10362":0,"10364":0,"10366":0,"10367":0,"10369":0,"10370":0,"10371":0,"10373":0,"10375":0,"10376":0,"10380":0,"10381":0,"10386":0,"10388":0,"10389":0,"10390":0,"10392":0,"10394":0,"10395":0,"10396":0,"10397":0,"10400":0,"10402":0,"10403":0,"10405":0,"10406":0,"10407":0,"10408":0,"10412":0,"10413":0,"10414":0,"10415":0,"10416":0,"10418":0,"10420":0,"10422":0,"10424":0,"10427":0,"10429":0,"10432":0,"10434":0,"10445":0,"10460":0,"10462":0,"10470":0,"10471":0,"10472":0,"10473":0,"10474":0,"10475":0,"10476":0,"10478":0,"10482":0,"10484":0,"10486":0,"10490":0,"10492":0,"10506":0,"10529":0,"10530":0,"10531":0,"10622":0,"10649":0,"10652":0,"10654":0,"10655":0,"10657":0,"10658":0,"10660":0,"10662":0,"10663":0,"10664":0,"10665":0,"10666":0,"10667":0,"10668":0,"10669":0,"10670":0,"10671":0,"10672":0,"10673":0,"10674":0,"10701":0,"10703":0,"10705":0,"10706":0,"10708":0,"10710":0,"10711":0,"10713":0,"10714":0,"10715":0,"10726":0,"10727":0,"10739":0,"10740":0,"10741":0,"10753":0,"10754":0,"10755":0,"10776":0,"10778":0,"10791":0,"10793":0,"10805":0,"10808":0,"10810":0,"10811":0,"10813":0,"10814":0,"10816":0,"10817":0,"10818":0,"10819":0,"10820":0,"10822":0,"10826":0,"10839":0,"10873":0,"10875":0,"10877":0,"10878":0,"10880":0,"10884":0,"10885":0,"10886":0,"10887":0,"10889":0,"10890":0,"10891":0,"10893":0,"10895":0,"10896":0,"10898":0,"10902":0,"10904":0,"10906":0,"10908":0,"10910":0,"10912":0,"10914":0,"10916":0,"10918":0,"10920":0,"10922":0,"10924":0,"10925":0,"10926":0,"10927":0,"10928":0,"10947":0,"10948":0,"10950":0,"10953":0,"10967":0,"10986":0,"10988":0,"10989":0,"10990":0,"10991":0,"10993":0,"10994":0,"10998":0,"10999":0,"11002":0,"11003":0,"11004":0,"11005":0,"11006":0,"11007":0,"11008":0,"11009":0,"11023":0,"11025":0,"11030":0,"11031":0,"11032":0,"11033":0,"11034":0,"11050":0,"11053":0,"11054":0,"11055":0,"11056":0,"11067":0,"11070":0,"11072":0,"11073":0,"11075":0,"11078":0,"11090":0,"11105":0,"11106":0,"11107":0,"11157":0,"11165":0,"11166":0,"11168":0,"11170":0,"11171":0,"11214":0,"11230":0,"11246":0,"11261":0,"11274":0,"11275":0,"11280":0,"11293":0,"11294":0,"11299":0,"11351":0,"11369":0,"11370":0,"11372":0,"11384":0,"11386":0,"11398":0,"11413":0,"11415":0,"11417":0,"11418":0,"11422":0,"11423":0,"11424":0,"11426":0,"11431":0,"11433":0,"11434":0,"11435":0,"11436":0,"11441":0,"11443":0,"11445":0,"11461":0,"11462":0,"11477":0,"11478":0,"11491":0,"11498":0,"11542":0,"11549":0,"11550":0,"11551":0,"11552":0,"11553":0,"11554":0,"11563":0,"11572":0,"11574":0,"11575":0,"11576":0,"11577":0,"11578":0,"11579":0,"11580":0,"11581":0,"11582":0,"11583":0,"11585":0,"11587":0,"11588":0,"11590":0,"11593":0,"11595":0,"11597":0,"11599":0,"11621":0,"11623":0,"11625":0,"11627":0,"11639":0,"11641":0,"11643":0,"11645":0,"11658":0,"11660":0,"11662":0,"11692":0,"11694":0,"11696":0,"11700":0,"11701":0,"11702":0,"11703":0,"11705":0,"11706":0,"11708":0,"11709":0,"11711":0,"11713":0,"11714":0,"11716":0,"11717":0,"11718":0,"11731":0,"11736":0,"11738":0,"11740":0,"11741":0,"11743":0,"11745":0,"11746":0,"11747":0,"11748":0,"11749":0,"11750":0,"11751":0,"11764":0,"11770":0,"11771":0,"11773":0,"11775":0,"11776":0,"11777":0,"11778":0,"11779":0,"11780":0,"11781":0,"11782":0,"11783":0,"11784":0,"11785":0,"11787":0,"11858":0,"11859":0,"11861":0,"11865":0,"11867":0,"11879":0,"11884":0,"11904":0,"11906":0,"11907":0,"11908":0,"11909":0,"11910":0,"11922":0,"11929":0,"11931":0,"11933":0,"11935":0,"11936":0,"11938":0,"11939":0,"11942":0,"11944":0,"11946":0,"11948":0,"11950":0,"11952":0,"11954":0,"11965":0,"11967":0,"11968":0,"11970":0,"11974":0,"11975":0,"11976":0,"11977":0,"11978":0,"11979":0,"11980":0,"11982":0,"11983":0,"11985":0,"11986":0,"11989":0,"11990":0,"11992":0,"12005":0,"12008":0,"12010":0,"12012":0,"12014":0,"12015":0,"12017":0,"12019":0,"12033":0,"12045":0,"12056":0,"12058":0,"12059":0,"12061":0,"12063":0,"12064":0,"12066":0,"12068":0,"12069":0,"12084":0,"12085":0,"12099":0,"12100":0,"12123":0,"12128":0,"12129":0,"12156":0,"12172":0,"12173":0,"12175":0,"12177":0,"12179":0,"12180":0,"12181":0,"12183":0,"12185":0,"12186":0,"12203":0,"12204":0,"12206":0,"12208":0,"12210":0,"12211":0,"12212":0,"12214":0,"12216":0,"12217":0,"12232":0,"12234":0,"12235":0,"12236":0,"12238":0,"12254":0,"12256":0,"12257":0,"12258":0,"12260":0,"12276":0,"12278":0,"12279":0,"12280":0,"12282":0,"12331":0,"12333":0,"12345":0,"12346":0,"12348":0,"12350":0,"12355":0,"12356":0,"12358":0,"12360":0,"12375":0,"12380":0,"12381":0,"12382":0,"12397":0,"12398":0,"12400":0,"12402":0,"12417":0,"12419":0,"12420":0,"12422":0,"12500":0,"12577":0,"12587":0,"12589":0,"12591":0,"12604":0,"12605":0,"12607":0,"12620":0,"12624":0,"12625":0,"12627":0,"12639":0,"12641":0,"12643":0,"12645":0,"12649":0,"12652":0,"12667":0,"12669":0,"12671":0,"12673":0,"12684":0,"12687":0,"12689":0,"12691":0,"12723":0,"12725":0,"12732":0,"12734":0,"12735":0,"12737":0,"12739":0,"12741":0,"12743":0,"12764":0,"12776":0,"12808":0,"12809":0,"12810":0,"12811":0,"12820":0,"12824":0,"12825":0,"12826":0,"12827":0,"12828":0,"12830":0,"12832":0,"12844":0,"12847":0,"12848":0,"12849":0,"12850":0,"12851":0,"12852":0,"12853":0,"12854":0,"12855":0,"12856":0,"12857":0,"12858":0,"12859":0,"12860":0,"12861":0,"12862":0,"12874":0,"12877":0,"12878":0,"12879":0,"12880":0,"12881":0,"12882":0,"12891":0,"12900":0,"12901":0,"12902":0,"12903":0,"12904":0,"12913":0,"12914":0,"12917":0,"12919":0,"12920":0,"12921":0,"12922":0,"12925":0,"12928":0,"12929":0,"12930":0,"12932":0,"12934":0,"12935":0,"12936":0,"12938":0,"12939":0,"12945":0,"12946":0,"12947":0,"12948":0,"12949":0,"12950":0,"12953":0,"12955":0,"12957":0,"12961":0,"12962":0,"12965":0,"12967":0,"12968":0,"12969":0,"12971":0,"12972":0,"12977":0,"12978":0,"12981":0,"12983":0,"12987":0,"12989":0,"12991":0,"12993":0,"12995":0,"12996":0,"12998":0,"13001":0,"13016":0,"13029":0,"13031":0,"13033":0,"13035":0,"13037":0,"13038":0,"13133":0,"13157":0,"13161":0,"13162":0,"13163":0,"13165":0,"13166":0,"13168":0,"13169":0,"13171":0,"13173":0,"13175":0,"13176":0,"13178":0,"13180":0,"13182":0,"13198":0,"13199":0,"13201":0,"13205":0,"13220":0,"13222":0,"13224":0,"13225":0,"13226":0,"13227":0,"13228":0,"13241":0,"13246":0,"13248":0,"13249":0,"13260":0,"13262":0,"13263":0,"13264":0,"13265":0,"13266":0,"13277":0,"13281":0,"13283":0,"13285":0,"13286":0,"13287":0,"13300":0,"13314":0,"13316":0,"13317":0,"13318":0,"13320":0,"13322":0,"13324":0,"13328":0,"13330":0,"13332":0,"13335":0,"13337":0,"13349":0,"13360":0,"13362":0,"13366":0,"13369":0,"13370":0,"13373":0,"13374":0,"13375":0,"13376":0,"13377":0,"13378":0,"13379":0,"13380":0,"13381":0,"13382":0,"13383":0,"13384":0,"13385":0,"13386":0,"13387":0,"13388":0,"13389":0,"13390":0,"13413":0,"13421":0,"13423":0,"13424":0,"13426":0,"13428":0,"13431":0,"13433":0,"13434":0,"13436":0,"13437":0,"13438":0,"13439":0,"13440":0,"13441":0,"13442":0,"13444":0,"13446":0,"13449":0,"13478":0,"13481":0,"13482":0,"13483":0,"13485":0,"13487":0,"13488":0,"13489":0,"13490":0,"13491":0,"13493":0,"13495":0,"13496":0,"13508":0,"13510":0,"13514":0,"13516":0,"13518":0,"13535":0,"13536":0,"13538":0,"13540":0,"13542":0,"13544":0,"13546":0,"13548":0,"13560":0,"13565":0,"13567":0,"13568":0,"13570":0,"13572":0,"13576":0,"13589":0,"13593":0,"13595":0,"13597":0,"13598":0,"13600":0,"13602":0,"13605":0,"13608":0,"13618":0,"13625":0,"13631":0,"13632":0,"13633":0,"13634":0,"13635":0,"13636":0,"13638":0,"13641":0,"13642":0,"13644":0,"13645":0,"13646":0,"13647":0,"13648":0,"13649":0,"13650":0,"13651":0,"13652":0,"13654":0,"13655":0,"13668":0,"13698":0,"13699":0,"13701":0,"13702":0,"13706":0,"13707":0,"13709":0,"13710":0,"13712":0,"13713":0,"13715":0,"13717":0,"13719":0,"13722":0,"13724":0,"13725":0,"13727":0,"13729":0,"13730":0,"13733":0,"13734":0,"13736":0,"13737":0,"13738":0,"13739":0,"13741":0,"13743":0,"13745":0,"13747":0,"13749":0,"13750":0,"13751":0,"13752":0,"13756":0,"13785":0,"13787":0,"13801":0,"13833":0,"13835":0,"13837":0,"13839":0,"13852":0,"13853":0,"13855":0,"13856":0,"13858":0,"13871":0,"13873":0,"13875":0,"13877":0,"13890":0,"13910":0,"13911":0,"13913":0,"13914":0,"13915":0,"13916":0,"13920":0,"13921":0,"13922":0,"13923":0,"13925":0,"13926":0,"13928":0,"13929":0,"13930":0,"13932":0,"13933":0,"13935":0,"13936":0,"13937":0,"13941":0,"13946":0,"13949":0,"13951":0,"13952":0,"13954":0,"13955":0,"13956":0,"13957":0,"13959":0,"13961":0,"13964":0,"13966":0,"13968":0,"13969":0,"13971":0,"13972":0,"13974":0,"13975":0,"13978":0,"13979":0,"13980":0,"13981":0,"13983":0,"13984":0,"13986":0,"13988":0,"13990":0,"13992":0,"13994":0,"13996":0,"13998":0,"14001":0,"14003":0,"14005":0,"14006":0,"14007":0,"14009":0,"14021":0,"14026":0,"14028":0,"14029":0,"14031":0,"14034":0,"14036":0,"14037":0,"14039":0,"14054":0,"14057":0,"14058":0,"14071":0,"14075":0,"14077":0,"14079":0,"14083":0,"14085":0,"14087":0,"14088":0,"14090":0,"14091":0,"14097":0,"14113":0,"14115":0,"14117":0,"14119":0,"14121":0,"14137":0,"14139":0,"14143":0,"14157":0,"14186":0,"14188":0,"14190":0,"14191":0,"14193":0,"14197":0,"14198":0,"14199":0,"14200":0,"14202":0,"14204":0,"14206":0,"14207":0,"14209":0,"14211":0,"14212":0,"14214":0,"14216":0,"14221":0,"14223":0,"14226":0,"14228":0,"14229":0,"14231":0,"14233":0,"14234":0,"14236":0,"14238":0,"14241":0,"14245":0,"14246":0,"14247":0,"14251":0,"14253":0,"14254":0,"14256":0,"14258":0,"14262":0,"14273":0,"14280":0,"14282":0,"14284":0,"14286":0,"14288":0,"14289":0,"14291":0,"14293":0,"14294":0,"14296":0,"14298":0,"14299":0,"14301":0,"14302":0,"14303":0,"14305":0,"14309":0,"14311":0,"14312":0,"14314":0,"14316":0,"14330":0,"14332":0,"14344":0,"14356":0,"14358":0,"14359":0,"14361":0,"14363":0,"14365":0,"14367":0,"14369":0,"14373":0,"14375":0,"14377":0,"14379":0,"14381":0,"14384":0,"14386":0,"14388":0,"14390":0,"14392":0,"14396":0,"14398":0,"14400":0,"14402":0,"14404":0,"14418":0,"14419":0,"14421":0,"14423":0,"14436":0,"14455":0,"14457":0,"14458":0,"14462":0,"14463":0,"14465":0,"14467":0,"14469":0,"14471":0,"14472":0,"14473":0,"14474":0,"14476":0,"14477":0,"14478":0,"14480":0,"14481":0,"14483":0,"14485":0,"14487":0,"14491":0,"14492":0,"14494":0,"14495":0,"14497":0,"14499":0,"14501":0,"14503":0,"14505":0,"14507":0,"14513":0,"14514":0,"14516":0,"14518":0,"14519":0,"14521":0,"14522":0,"14524":0,"14527":0,"14529":0,"14531":0,"14533":0,"14536":0,"14538":0,"14541":0,"14543":0,"14545":0,"14547":0,"14548":0,"14550":0,"14552":0,"14554":0,"14558":0,"14561":0,"14563":0,"14565":0,"14567":0,"14568":0,"14570":0,"14572":0,"14574":0,"14589":0,"14592":0,"14594":0,"14596":0,"14598":0,"14600":0,"14602":0,"14607":0,"14609":0,"14613":0,"14617":0,"14648":0,"14654":0,"14656":0,"14661":0,"14669":0,"14674":0,"14680":0,"14681":0,"14682":0,"14683":0,"14684":0,"14696":0,"14698":0,"14701":0,"14703":0,"14705":0,"14721":0,"14725":0,"14727":0,"14728":0,"14730":0,"14731":0,"14734":0,"14736":0,"14737":0,"14738":0,"14740":0,"14741":0,"14744":0,"14759":0,"14763":0,"14765":0,"14766":0,"14768":0,"14769":0,"14772":0,"14774":0,"14775":0,"14776":0,"14778":0,"14779":0,"14782":0,"14797":0,"14801":0,"14803":0,"14804":0,"14806":0,"14807":0,"14810":0,"14812":0,"14813":0,"14814":0,"14816":0,"14817":0,"14820":0,"14835":0,"14839":0,"14841":0,"14842":0,"14844":0,"14845":0,"14848":0,"14850":0,"14851":0,"14852":0,"14854":0,"14855":0,"14858":0,"14869":0,"14871":0,"14872":0,"14874":0,"14875":0,"14876":0,"14906":0,"14908":0,"14909":0,"14910":0,"14912":0,"14913":0,"14916":0,"14918":0,"14919":0,"14920":0,"14921":0,"14923":0,"14924":0,"14927":0,"14929":0,"14930":0,"14931":0,"14933":0,"14934":0,"14937":0,"14939":0,"14940":0,"14941":0,"14943":0,"14944":0,"14948":0,"14949":0,"14950":0,"14951":0,"14952":0,"14953":0,"14954":0,"14956":0,"14957":0,"14958":0,"14959":0,"14961":0,"14962":0,"14964":0,"14965":0,"14967":0,"14968":0,"14969":0,"14971":0,"14976":0,"14977":0,"14979":0,"14980":0,"14982":0,"14983":0,"14984":0,"14986":0,"14991":0,"14992":0,"14994":0,"14995":0,"14997":0,"14998":0,"14999":0,"15001":0,"15006":0,"15007":0,"15009":0,"15010":0,"15012":0,"15013":0,"15014":0,"15016":0,"15021":0,"15022":0,"15023":0,"15024":0,"15025":0,"15027":0,"15028":0,"15029":0,"15031":0,"15032":0,"15034":0,"15036":0,"15037":0,"15039":0,"15041":0,"15044":0,"15046":0,"15047":0,"15048":0,"15050":0,"15051":0,"15053":0,"15055":0,"15056":0,"15058":0,"15060":0,"15063":0,"15065":0,"15066":0,"15067":0,"15069":0,"15070":0,"15071":0,"15072":0,"15074":0,"15077":0,"15079":0,"15082":0,"15084":0,"15085":0,"15086":0,"15088":0,"15089":0,"15090":0,"15091":0,"15093":0,"15096":0,"15098":0,"15101":0,"15102":0,"15104":0,"15105":0,"15107":0,"15109":0,"15110":0,"15111":0,"15112":0,"15113":0,"15116":0,"15118":0,"15119":0,"15120":0,"15121":0,"15134":0,"15140":0,"15142":0,"15143":0,"15145":0,"15147":0,"15148":0,"15150":0,"15151":0,"15153":0,"15155":0,"15158":0,"15159":0,"15161":0,"15163":0,"15166":0,"15168":0,"15170":0,"15172":0,"15173":0,"15175":0,"15177":0,"15178":0,"15191":0,"15201":0,"15203":0,"15205":0,"15207":0,"15209":0,"15211":0,"15213":0,"15217":0,"15219":0,"15220":0,"15221":0,"15225":0,"15227":0,"15228":0,"15232":0,"15233":0,"15234":0,"15235":0,"15237":0,"15238":0,"15240":0,"15242":0,"15244":0,"15246":0,"15247":0,"15248":0,"15249":0,"15250":0,"15252":0,"15253":0,"15257":0,"15259":0,"15261":0,"15285":0,"15288":0,"15290":0,"15292":0,"15294":0,"15296":0,"15298":0,"15302":0,"15307":0,"15309":0,"15311":0,"15313":0,"15329":0,"15333":0,"15335":0,"15336":0,"15338":0,"15339":0,"15341":0,"15343":0,"15348":0,"15353":0,"15357":0,"15359":0,"15360":0,"15361":0,"15363":0,"15365":0,"15370":0,"15372":0,"15374":0,"15375":0,"15392":0,"15393":0,"15395":0,"15397":0,"15402":0,"15403":0,"15435":0,"15440":0,"15444":0,"15446":0,"15448":0,"15452":0,"15455":0,"15457":0,"15459":0,"15463":0,"15466":0,"15468":0,"15485":0,"15487":0,"15489":0,"15505":0,"15507":0,"15509":0,"15570":0,"15571":0,"15573":0,"15575":0,"15577":0,"15579":0,"15584":0,"15585":0,"15642":0,"15643":0,"15645":0,"15647":0,"15651":0,"15652":0,"15654":0,"15656":0,"15658":0,"15662":0,"15676":0,"15677":0,"15679":0,"15681":0,"15685":0,"15686":0,"15688":0,"15690":0,"15692":0,"15696":0,"15710":0,"15712":0,"15714":0,"15719":0,"15721":0,"15723":0,"15728":0,"15730":0,"15733":0,"15734":0,"15756":0,"15766":0,"15768":0,"15770":0,"15781":0,"15783":0,"15784":0,"15785":0,"15786":0,"15788":0,"15789":0,"15790":0,"15791":0,"15792":0,"15795":0,"15796":0,"15809":0,"15811":0,"15813":0,"15818":0,"15820":0,"15821":0,"15823":0,"15825":0,"15826":0,"15828":0,"15830":0,"15832":0,"15833":0,"15834":0,"15835":0,"15836":0,"15838":0,"15840":0,"15841":0,"15842":0,"15843":0,"15844":0,"15845":0,"15846":0,"15847":0,"15860":0,"15864":0,"15866":0,"15867":0,"15869":0,"15871":0,"15873":0,"15875":0,"15877":0,"15878":0,"15879":0,"15881":0,"15885":0,"15887":0,"15900":0,"15902":0,"15903":0,"15904":0,"15905":0,"15906":0,"15907":0,"15908":0,"15920":0,"15925":0,"15927":0,"15928":0,"15932":0,"15934":0,"15935":0,"15937":0,"15939":0,"15940":0,"15942":0,"15944":0,"15946":0,"15947":0,"15948":0,"15950":0,"15965":0,"15968":0,"15990":0,"16000":0,"16001":0,"16002":0,"16014":0,"16025":0,"16029":0,"16031":0,"16032":0,"16033":0,"16063":0,"16066":0,"16068":0,"16069":0,"16071":0,"16072":0,"16073":0,"16085":0,"16097":0,"16098":0,"16099":0,"16100":0,"16102":0,"16104":0,"16106":0,"16108":0,"16109":0,"16110":0,"16111":0,"16112":0,"16113":0,"16114":0,"16116":0,"16117":0,"16118":0,"16122":0,"16124":0,"16125":0,"16140":0,"16142":0,"16143":0,"16145":0,"16158":0,"16163":0,"16177":0,"16182":0};+_yuitest_coverage["build/charts-base/charts-base.js"].functions = {"ShapeGroup:41":0,"_draw:55":0,"_getRadiusCollection:119":0,"getter:134":0,"setter:160":0,"getter:167":0,"setter:171":0,"getter:177":0,"setter:181":0,"CircleGroup:196":0,"drawShape:210":0,"getter:218":0,"RectGroup:256":0,"drawShape:270":0,"DiamondGroup:286":0,"drawShape:300":0,"EllipseGroup:316":0,"drawShape:330":0,"Renderer:347":0,"getter:358":0,"setter:364":0,"_setStyles:398":0,"(anonymous 2):421":0,"_mergeStyles:414":0,"_getDefaultStyles:442":0,"_getDefaultMargins:474":0,"setTickOffsets:490":0,"drawTick:530":0,"getLineStart:548":0,"getLabelPoint:575":0,"updateMaxLabelSize:587":0,"getExplicitlySized:618":0,"positionTitle:640":0,"positionLabel:672":0,"_setRotationCoords:718":0,"_getTransformOrigin:759":0,"setCalculatedSize:798":0,"_getDefaultMargins:836":0,"setTickOffsets:852":0,"drawTick:892":0,"getLineStart:910":0,"getLabelPoint:938":0,"updateMaxLabelSize:950":0,"getExplicitlySized:981":0,"positionTitle:1003":0,"positionLabel:1035":0,"_setRotationCoords:1086":0,"_getTransformOrigin:1125":0,"offsetNodeForTick:1154":0,"setCalculatedSize:1168":0,"_getDefaultMargins:1203":0,"setTickOffsets:1219":0,"getLineStart:1256":0,"drawTick:1284":0,"getLabelPoint:1303":0,"updateMaxLabelSize:1315":0,"getExplicitlySized:1346":0,"positionTitle:1368":0,"positionLabel:1400":0,"_setRotationCoords:1446":0,"_getTransformOrigin:1483":0,"offsetNodeForTick:1508":0,"setCalculatedSize:1520":0,"_getDefaultMargins:1553":0,"setTickOffsets:1569":0,"getLineStart:1605":0,"drawTick:1634":0,"getLabelPoint:1653":0,"updateMaxLabelSize:1665":0,"getExplicitlySized:1696":0,"positionTitle:1718":0,"positionLabel:1750":0,"_setRotationCoords:1802":0,"_getTransformOrigin:1849":0,"setCalculatedSize:1895":0,"_dataChangeHandler:1952":0,"_positionChangeHandler:1967":0,"_updateGraphic:1980":0,"_updateHandler:2006":0,"renderUI:2018":0,"syncUI:2027":0,"_setCanvas:2060":0,"_getDefaultStyles:2095":0,"_handleSizeChange:2162":0,"drawLine:2201":0,"_getTextRotationProps:2215":0,"_drawAxis:2253":0,"_setTotalTitleSize:2387":0,"_updatePathElement:2426":0,"_setTitle:2454":0,"getLabel:2519":0,"_createLabelCache:2565":0,"_clearLabelCache:2587":0,"getLineEnd:2612":0,"getLength:2634":0,"getFirstPoint:2661":0,"getNextPoint:2687":0,"getLastPoint:2708":0,"getPosition:2731":0,"_rotate:2767":0,"_simulateRotateWithTransformOrigin:2837":0,"getMaxLabelBounds:2854":0,"getMinLabelBounds:2865":0,"_getLabelBounds:2878":0,"_removeChildren:2908":0,"destructor:2928":0,"_setText:2969":0,"getter:3001":0,"setter:3010":0,"getter:3029":0,"setter:3038":0,"getter:3053":0,"setter:3058":0,"getter:3073":0,"setter:3078":0,"getter:3114":0,"getter:3137":0,"setter:3166":0,"getter:3229":0,"getter:3244":0,"validator:3264":0,"getter:3286":0,"setter:3291":0,"value:3326":0,"valueFn:3347":0,"valueFn:3368":0,"initializer:3440":0,"bindUI:3456":0,"_dataProviderChangeHandler:3474":0,"addKey:3576":0,"_getKeyArray:3590":0,"_setDataByKey:3612":0,"_updateTotalData:3634":0,"removeKey:3656":0,"getKeyValueAt:3674":0,"getDataByKey:3692":0,"_updateMinAndMax:3708":0,"getTotalMajorUnits:3744":0,"getMajorUnitDistance:3769":0,"getEdgeOffset:3792":0,"getLabelByIndex:3806":0,"_keyChangeHandler:3824":0,"_hasDataOverflow:3839":0,"getMinimumValue:3855":0,"getMaximumValue:3867":0,"setter:3882":0,"getter:3950":0,"setter:3964":0,"getter:3978":0,"getter:3997":0,"setter:4013":0,"getter:4028":0,"getter:4047":0,"setter:4056":0,"getter:4073":0,"getter:4089":0,"getter:4102":0,"getter:4119":0,"NumericAxis:4147":0,"value:4179":0,"formatLabel:4217":0,"getTotalByKey:4233":0,"_getMinimumUnit:4270":0,"_getNiceNumber:4283":0,"_updateMinAndMax:4313":0,"_roundMinAndMax:4393":0,"getLabelByIndex:4683":0,"_roundToNearest:4722":0,"_roundUpToNearest:4743":0,"_roundDownToNearest:4763":0,"_roundToPrecision:4783":0,"_hasDataOverflow:4799":0,"StackedAxis:4831":0,"_updateMinAndMax:4847":0,"TimeAxis:4934":0,"getter:4954":0,"getter:4972":0,"getter:4986":0,"setter:4995":0,"getter:5009":0,"setter:5018":0,"value:5039":0,"formatLabel:5070":0,"getLabelByIndex:5107":0,"_getKeyArray:5136":0,"_setDataByKey:5190":0,"_getNumber:5246":0,"CategoryAxis:5273":0,"formatLabel:5290":0,"_updateMinAndMax:5327":0,"_getKeyArray:5342":0,"_setDataByKey:5371":0,"getDataByKey:5401":0,"getTotalMajorUnits:5423":0,"getMajorUnitDistance:5437":0,"getEdgeOffset:5460":0,"getKeyValueAt:5473":0,"getLabelByIndex:5493":0,"getMinimumValue:5516":0,"getMaximumValue:5530":0,"CurveUtil:5549":0,"getCurveControlPoints:5563":0,"getControlPoints:5637":0,"StackingUtil:5669":0,"_stackCoordinates:5687":0,"_stackXCoords:5705":0,"_stackYCoords:5786":0,"_cleanXNaN:5872":0,"_getPreviousValidCoordValue:5920":0,"_getNextValidCoordValue:5942":0,"_cleanYNaN:5965":0,"Lines:6013":0,"_getGraphic:6030":0,"_toggleVisible:6048":0,"drawLines:6062":0,"drawSpline:6166":0,"drawDashedLine:6218":0,"_getLineDefaults:6264":0,"getter:6292":0,"setter:6297":0,"Fills:6288":0,"_getPath:6316":0,"_toggleVisible:6334":0,"drawFill:6350":0,"drawAreaSpline:6410":0,"drawStackedAreaSpline:6468":0,"_getClosingPoints:6569":0,"_getHighestValidOrder:6609":0,"_getCoordsByOrderAndIndex:6635":0,"_getStackedClosingPoints:6659":0,"_getAreaDefaults:6781":0,"getter:6801":0,"Plots:6797":0,"drawPlots:6826":0,"_getGroupShape:6929":0,"_getPlotDefaults:6946":0,"getMarker:6998":0,"_createMarker:7039":0,"_createMarkerCache:7057":0,"_createGroupMarker:7082":0,"_toggleVisible:7135":0,"_clearMarkerCache:7161":0,"updateMarkerState:7182":0,"_getItemColor:7215":0,"_setStyles:7232":0,"_parseMarkerStyles:7246":0,"_getState:7272":0,"Histogram:7311":0,"drawSeries:7320":0,"_getPlotDefaults:7491":0,"render:7574":0,"(anonymous 3):7604":0,"(anonymous 4):7611":0,"(anonymous 5):7618":0,"addListeners:7588":0,"_xAxisChangeHandler:7635":0,"_yAxisChangeHandler:7649":0,"_xDataChangeHandler:7672":0,"_yDataChangeHandler:7688":0,"_updateAxisData:7704":0,"validate:7733":0,"_setCanvas:7751":0,"setAreaData:7764":0,"_getFirstValidIndex:7856":0,"_getLastValidIndex:7877":0,"draw:7896":0,"_getDefaultStyles:7948":0,"_getDefaultColor:8003":0,"_handleVisibleChange:8029":0,"getTotalValues:8040":0,"destructor:8052":0,"getter:8186":0,"setter:8191":0,"getter:8205":0,"setter:8210":0,"getter:8227":0,"setter:8232":0,"getter:8256":0,"setter:8261":0,"getter:8328":0,"setter:8368":0,"setter:8382":0,"getter:8423":0,"getter:8438":0,"getter:8480":0,"getter:8497":0,"getter:8524":0,"setter:8536":0,"drawSeries:8563":0,"_setStyles:8577":0,"_getDefaultStyles:8596":0,"drawSeries:8664":0,"_setStyles:8678":0,"_getDefaultStyles:8696":0,"drawSeries:8762":0,"setAreaData:8826":0,"setAreaData:8865":0,"_getMarkerDimensions:8909":0,"updateMarkerState:8935":0,"_getMarkerDimensions:9059":0,"updateMarkerState:9085":0,"drawSeries:9213":0,"_setStyles:9227":0,"_getDefaultStyles:9245":0,"drawSeries:9305":0,"drawSeries:9358":0,"drawSeries:9400":0,"_toggleVisible:9423":0,"_getDefaultStyles:9464":0,"getter:9554":0,"setter:9558":0,"getter:9587":0,"setter:9591":0,"getter:9614":0,"setter:9618":0,"setAreaData:9667":0,"drawSeries:9680":0,"drawSeries:9741":0,"drawSeries:9791":0,"setAreaData:9850":0,"setAreaData:9888":0,"drawSeries:9901":0,"drawSeries:9937":0,"updateMarkerState:10116":0,"_getPlotDefaults:10164":0,"drawSeries:10278":0,"updateMarkerState:10458":0,"_getPlotDefaults:10504":0,"_setMap:10647":0,"addListeners:10699":0,"validate:10724":0,"_categoryAxisChangeHandler:10737":0,"_valueAxisChangeHandler:10751":0,"_categoryDataChangeHandler:10774":0,"_valueDataChangeHandler:10789":0,"draw:10803":0,"drawPlots:10837":0,"_addHotspot:10965":0,"updateMarkerState:11021":0,"_createMarker:11048":0,"_clearMarkerCache:11065":0,"_getPlotDefaults:11088":0,"_getDefaultColor:11155":0,"validator:11212":0,"validator:11228":0,"validator:11244":0,"validator:11259":0,"setter:11272":0,"getter:11278":0,"setter:11291":0,"getter:11297":0,"remove:11367":0,"draw:11382":0,"_drawGridlines:11396":0,"_horizontalLine:11459":0,"_verticalLine:11475":0,"_getDefaultStyles:11489":0,"bindUI:11547":0,"syncUI:11561":0,"getSeriesByIndex:11619":0,"getSeriesByKey:11637":0,"addDispatcher:11656":0,"_parseSeriesCollection:11690":0,"_addSeries:11729":0,"_createSeries:11762":0,"_getSeries:11856":0,"_markerEventHandler:11877":0,"_updateStyles:11902":0,"_sizeChangeHandler:11920":0,"_drawSeries:11963":0,"_drawingCompleteHandler:12003":0,"_getDefaultStyles:12031":0,"destructor:12054":0,"setter:12082":0,"setter:12097":0,"getter:12121":0,"setter:12126":0,"getter:12154":0,"setter:12170":0,"setter:12201":0,"getter:12230":0,"getter:12252":0,"getter:12274":0,"ChartBase:12331":0,"valueFn:12343":0,"setter:12353":0,"getter:12373":0,"setter:12378":0,"setter:12395":0,"setter:12415":0,"setter:12498":0,"_groupMarkersChangeHandler:12585":0,"_itemRendered:12602":0,"(anonymous 6):12624":0,"_getGraph:12618":0,"getSeries:12637":0,"getAxisByKey:12665":0,"getCategoryAxis:12682":0,"_setDataValues:12721":0,"_setSeriesCollection:12762":0,"_getAxisClass:12774":0,"initializer:12806":0,"renderUI:12818":0,"_setAriaElements:12842":0,"_getAriaOffscreenNode:12872":0,"syncUI:12889":0,"(anonymous 7):12913":0,"(anonymous 8):12934":0,"(anonymous 9):12967":0,"bindUI:12898":0,"_markerEventDispatcher:13014":0,"_dataProviderChangeHandler:13155":0,"toggleTooltip:13196":0,"_showTooltip:13218":0,"_positionTooltip:13239":0,"hideTooltip:13258":0,"_addTooltip:13275":0,"_updateTooltip:13298":0,"markerEventHandler:13358":0,"planarEventHandler:13364":0,"_getTooltip:13347":0,"_planarLabelFunction:13411":0,"_tooltipLabelFunction:13476":0,"_tooltipChangeHandler:13506":0,"_setText:13533":0,"_getAllKeys:13558":0,"_buildSeriesKeys:13587":0,"renderUI:13623":0,"_planarEventDispatcher:13666":0,"_addToAxesRenderQueue:13831":0,"_addToAxesCollection:13850":0,"_getDefaultSeriesCollection:13869":0,"_parseSeriesCollection:13888":0,"_parseSeriesAxes:14019":0,"_getCategoryAxis:14052":0,"_getSeriesAxis:14069":0,"_getBaseAttribute:14111":0,"_setBaseAttribute:14135":0,"_setAxes:14155":0,"_addAxes:14271":0,"_addSeries:14328":0,"_addGridlines:14342":0,"_getDefaultAxes:14416":0,"_parseAxes:14434":0,"_getDefaultAxisPosition:14587":0,"getSeriesItems:14646":0,"_sizeChanged:14694":0,"_getTopOverflow:14719":0,"_getRightOverflow:14757":0,"_getLeftOverflow:14795":0,"_getBottomOverflow:14833":0,"_redraw:14867":0,"destructor:15132":0,"_getAriaMessage:15189":0,"getter:15283":0,"setter:15305":0,"getter:15327":0,"setter:15351":0,"getter:15390":0,"setter:15400":0,"getter:15433":0,"setter:15442":0,"setter:15483":0,"setter:15503":0,"getter:15568":0,"setter:15582":0,"getter:15640":0,"setter:15649":0,"getter:15674":0,"setter:15683":0,"getter:15708":0,"setter:15717":0,"_getSeriesCollection:15764":0,"_parseAxes:15807":0,"_addAxes:15858":0,"_addSeries:15898":0,"_parseSeriesAxes:15918":0,"_getDefaultAxes:15963":0,"getSeriesItems:15988":0,"_sizeChanged:16012":0,"_redraw:16023":0,"_tooltipLabelFunction:16061":0,"_getAriaMessage:16083":0,"setter:16138":0,"getter:16156":0,"setter:16161":0,"getter:16175":0,"setter:16180":0,"(anonymous 1):1":0};+_yuitest_coverage["build/charts-base/charts-base.js"].coveredLines = 3961;+_yuitest_coverage["build/charts-base/charts-base.js"].coveredFunctions = 489;+_yuitest_coverline("build/charts-base/charts-base.js", 1);+YUI.add('charts-base', function (Y, NAME) {++/**+ * The Charts widget provides an api for displaying data+ * graphically.+ *+ * @module charts+ * @main charts+ */++/**+ * The charts-base submodule contains the core functionality for the charts module.+ *+ * @module charts+ * @submodule charts-base+ */+_yuitest_coverfunc("build/charts-base/charts-base.js", "(anonymous 1)", 1);+_yuitest_coverline("build/charts-base/charts-base.js", 17);+var CONFIG = Y.config,+ WINDOW = CONFIG.win,+ DOCUMENT = CONFIG.doc,+ Y_Lang = Y.Lang,+ IS_STRING = Y_Lang.isString,+ Y_DOM = Y.DOM,+ LeftAxisLayout,+ RightAxisLayout,+ BottomAxisLayout,+ TopAxisLayout,+ _getClassName = Y.ClassNameManager.getClassName,+ SERIES_MARKER = _getClassName("seriesmarker"),+ ShapeGroup,+ CircleGroup,+ RectGroup,+ EllipseGroup,+ DiamondGroup;++/**+ * Abstract class for creating groups of shapes with the same styles and dimensions.+ *+ * @class ShapeGroup+ * @constructor+ */+ _yuitest_coverline("build/charts-base/charts-base.js", 41);+ShapeGroup = function(cfg)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "ShapeGroup", 41);+_yuitest_coverline("build/charts-base/charts-base.js", 43);+ShapeGroup.superclass.constructor.apply(this, arguments);+ };+ + _yuitest_coverline("build/charts-base/charts-base.js", 46);+ShapeGroup.NAME = "shapeGroup";++ _yuitest_coverline("build/charts-base/charts-base.js", 48);+Y.extend(ShapeGroup, Y.Path, { + /**+ * Updates the shape.+ *+ * @method _draw+ * @private+ */+ _draw: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_draw", 55);+_yuitest_coverline("build/charts-base/charts-base.js", 57);+var xvalues = this.get("xvalues"),+ yvalues = this.get("yvalues"),+ x,+ y,+ xRad,+ yRad,+ i = 0,+ len,+ attrs = [],+ dimensions = this.get("dimensions"),+ width = dimensions.width,+ height = dimensions.height,+ radius = dimensions.radius,+ yRadius = dimensions.yRadius,+ id = this.get("id"),+ className = this.node.className,+ widthIsArray = Y_Lang.isArray(width),+ heightIsArray = Y_Lang.isArray(height),+ radiusIsArray = Y_Lang.isArray(radius),+ yRadiusIsArray = Y_Lang.isArray(yRadius);+ _yuitest_coverline("build/charts-base/charts-base.js", 77);+if(xvalues && yvalues && xvalues.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 79);+this.clear();++ _yuitest_coverline("build/charts-base/charts-base.js", 81);+len = xvalues.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 82);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 84);+x = xvalues[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 85);+y = yvalues[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 86);+xRad = radiusIsArray ? radius[i] : radius;+ _yuitest_coverline("build/charts-base/charts-base.js", 87);+yRad = yRadiusIsArray ? yRadius[i] : yRadius;+ _yuitest_coverline("build/charts-base/charts-base.js", 88);+if(!isNaN(x) && !isNaN(y) && !isNaN(xRad))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 90);+this.drawShape({+ x: x,+ y: y,+ width: widthIsArray ? width[i] : width,+ height: heightIsArray ? height[i] : height,+ radius: xRad,+ yRadius: yRad + });+ _yuitest_coverline("build/charts-base/charts-base.js", 98);+this.closePath();+ _yuitest_coverline("build/charts-base/charts-base.js", 99);+attrs[i] = {+ id: id + "_" + i,+ className: className,+ coords: (x - this._left) + ", " + (y - this._top) + ", " + radius,+ shape: "circle"+ };+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 107);+this._closePath();+ }+ },++ /**+ * Parses and array of lengths into radii+ *+ * @method _getRadiusCollection+ * @param {Array} val Array of lengths+ * @return Array+ * @private+ */+ _getRadiusCollection: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getRadiusCollection", 119);+_yuitest_coverline("build/charts-base/charts-base.js", 121);+var i = 0,+ len = val.length,+ radii = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 124);+for(; i < len; ++i)+ { + _yuitest_coverline("build/charts-base/charts-base.js", 126);+radii[i] = val[i] * 0.5;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 128);+return radii;+ }+ });+ +_yuitest_coverline("build/charts-base/charts-base.js", 132);+ShapeGroup.ATTRS = Y.merge(Y.Path.ATTRS, {+ dimensions: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 134);+_yuitest_coverline("build/charts-base/charts-base.js", 136);+var dimensions = this._dimensions,+ radius,+ yRadius,+ width,+ height;+ _yuitest_coverline("build/charts-base/charts-base.js", 141);+if(dimensions.hasOwnProperty("radius"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 143);+return dimensions;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 147);+width = dimensions.width;+ _yuitest_coverline("build/charts-base/charts-base.js", 148);+height = dimensions.height;+ _yuitest_coverline("build/charts-base/charts-base.js", 149);+radius = Y_Lang.isArray(width) ? this._getRadiusCollection(width) : (width * 0.5);+ _yuitest_coverline("build/charts-base/charts-base.js", 150);+yRadius = Y_Lang.isArray(height) ? this._getRadiusCollection(height) : (height * 0.5);+ _yuitest_coverline("build/charts-base/charts-base.js", 151);+return {+ width: width,+ height: height,+ radius: radius,+ yRadius: yRadius+ };+ }+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 160);+_yuitest_coverline("build/charts-base/charts-base.js", 162);+this._dimensions = val;+ _yuitest_coverline("build/charts-base/charts-base.js", 163);+return val;+ }+ },+ xvalues: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 167);+_yuitest_coverline("build/charts-base/charts-base.js", 169);+return this._xvalues;+ },+ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 171);+_yuitest_coverline("build/charts-base/charts-base.js", 173);+this._xvalues = val;+ }+ },+ yvalues: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 177);+_yuitest_coverline("build/charts-base/charts-base.js", 179);+return this._yvalues;+ },+ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 181);+_yuitest_coverline("build/charts-base/charts-base.js", 183);+this._yvalues = val;+ }+ }+});+_yuitest_coverline("build/charts-base/charts-base.js", 187);+Y.ShapeGroup = ShapeGroup;+/**+ * Abstract class for creating groups of circles with the same styles and dimensions.+ *+ * @module charts+ * @submodule charts-base+ * @class CircleGroup+ * @constructor+ */+ _yuitest_coverline("build/charts-base/charts-base.js", 196);+CircleGroup = function(cfg)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "CircleGroup", 196);+_yuitest_coverline("build/charts-base/charts-base.js", 198);+CircleGroup.superclass.constructor.apply(this, arguments);+ };+ + _yuitest_coverline("build/charts-base/charts-base.js", 201);+CircleGroup.NAME = "circleGroup";++ _yuitest_coverline("build/charts-base/charts-base.js", 203);+Y.extend(CircleGroup, Y.ShapeGroup, { + /**+ * Algorithm for drawing shape.+ *+ * @method drawShape+ * @param {Object} cfg Parameters used to draw the shape.+ */+ drawShape: function(cfg)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawShape", 210);+_yuitest_coverline("build/charts-base/charts-base.js", 212);+this.drawCircle(cfg.x, cfg.y, cfg.radius);+ }+ });++_yuitest_coverline("build/charts-base/charts-base.js", 216);+CircleGroup.ATTRS = Y.merge(Y.ShapeGroup.ATTRS, {+ dimensions: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 218);+_yuitest_coverline("build/charts-base/charts-base.js", 220);+var dimensions = this._dimensions,+ radius,+ yRadius,+ width,+ height;+ _yuitest_coverline("build/charts-base/charts-base.js", 225);+if(dimensions.hasOwnProperty("radius"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 227);+return dimensions;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 231);+width = dimensions.width;+ _yuitest_coverline("build/charts-base/charts-base.js", 232);+height = dimensions.height;+ _yuitest_coverline("build/charts-base/charts-base.js", 233);+radius = Y_Lang.isArray(width) ? this._getRadiusCollection(width) : (width * 0.5);+ _yuitest_coverline("build/charts-base/charts-base.js", 234);+yRadius = radius;+ _yuitest_coverline("build/charts-base/charts-base.js", 235);+return {+ width: width,+ height: height,+ radius: radius,+ yRadius: yRadius+ };+ }+ }+ }+});+ +_yuitest_coverline("build/charts-base/charts-base.js", 246);+CircleGroup.ATTRS = Y.ShapeGroup.ATTRS;+_yuitest_coverline("build/charts-base/charts-base.js", 247);+Y.CircleGroup = CircleGroup;+/**+ * Abstract class for creating groups of rects with the same styles and dimensions.+ *+ * @module charts+ * @submodule charts-base+ * @class GroupRect+ * @constructor+ */+ _yuitest_coverline("build/charts-base/charts-base.js", 256);+RectGroup = function(cfg)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "RectGroup", 256);+_yuitest_coverline("build/charts-base/charts-base.js", 258);+RectGroup.superclass.constructor.apply(this, arguments);+ };+ + _yuitest_coverline("build/charts-base/charts-base.js", 261);+RectGroup.NAME = "rectGroup";++ _yuitest_coverline("build/charts-base/charts-base.js", 263);+Y.extend(RectGroup, Y.ShapeGroup, { + /**+ * Updates the rect.+ *+ * @method _draw+ * @private+ */+ drawShape: function(cfg)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawShape", 270);+_yuitest_coverline("build/charts-base/charts-base.js", 272);+this.drawRect(cfg.x, cfg.y, cfg.width, cfg.height);+ }+ });+ +_yuitest_coverline("build/charts-base/charts-base.js", 276);+RectGroup.ATTRS = Y.ShapeGroup.ATTRS;+_yuitest_coverline("build/charts-base/charts-base.js", 277);+Y.RectGroup = RectGroup;+/**+ * Abstract class for creating groups of diamonds with the same styles and dimensions.+ *+ * @module charts+ * @submodule charts-base+ * @class GroupDiamond+ * @constructor+ */+ _yuitest_coverline("build/charts-base/charts-base.js", 286);+DiamondGroup = function(cfg)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "DiamondGroup", 286);+_yuitest_coverline("build/charts-base/charts-base.js", 288);+DiamondGroup.superclass.constructor.apply(this, arguments);+ };+ + _yuitest_coverline("build/charts-base/charts-base.js", 291);+DiamondGroup.NAME = "diamondGroup";++ _yuitest_coverline("build/charts-base/charts-base.js", 293);+Y.extend(DiamondGroup, Y.ShapeGroup, { + /**+ * Updates the diamond.+ *+ * @method _draw+ * @private+ */+ drawShape: function(cfg)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawShape", 300);+_yuitest_coverline("build/charts-base/charts-base.js", 302);+this.drawDiamond(cfg.x, cfg.y, cfg.width, cfg.height);+ }+ });+ +_yuitest_coverline("build/charts-base/charts-base.js", 306);+DiamondGroup.ATTRS = Y.ShapeGroup.ATTRS;+_yuitest_coverline("build/charts-base/charts-base.js", 307);+Y.DiamondGroup = DiamondGroup;+/**+ * Abstract class for creating groups of diamonds with the same styles and dimensions.+ *+ * @module charts+ * @submodule charts-base+ * @class EllipseGroup+ * @constructor+ */+ _yuitest_coverline("build/charts-base/charts-base.js", 316);+EllipseGroup = function(cfg)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "EllipseGroup", 316);+_yuitest_coverline("build/charts-base/charts-base.js", 318);+EllipseGroup.superclass.constructor.apply(this, arguments);+ };+ + _yuitest_coverline("build/charts-base/charts-base.js", 321);+EllipseGroup.NAME = "diamondGroup";++ _yuitest_coverline("build/charts-base/charts-base.js", 323);+Y.extend(EllipseGroup, Y.ShapeGroup, { + /**+ * Updates the diamond.+ *+ * @method _draw+ * @private+ */+ drawShape: function(cfg)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawShape", 330);+_yuitest_coverline("build/charts-base/charts-base.js", 332);+this.drawEllipse(cfg.x, cfg.y, cfg.width, cfg.height);+ }+ });+ +_yuitest_coverline("build/charts-base/charts-base.js", 336);+EllipseGroup.ATTRS = Y.ShapeGroup.ATTRS;+_yuitest_coverline("build/charts-base/charts-base.js", 337);+Y.EllipseGroup = EllipseGroup;+/**+ * The Renderer class is a base class for chart components that use the `styles`+ * attribute.+ *+ * @module charts+ * @submodule charts-base+ * @class Renderer+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 347);+function Renderer(){}++_yuitest_coverline("build/charts-base/charts-base.js", 349);+Renderer.ATTRS = {+ /**+ * Style properties for class+ * + * @attribute styles+ * @type Object+ */+ styles:+ {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 358);+_yuitest_coverline("build/charts-base/charts-base.js", 360);+this._styles = this._styles || this._getDefaultStyles();+ _yuitest_coverline("build/charts-base/charts-base.js", 361);+return this._styles;+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 364);+_yuitest_coverline("build/charts-base/charts-base.js", 366);+this._styles = this._setStyles(val);+ }+ },+ + /**+ * The graphic in which drawings will be rendered.+ *+ * @attribute graphic+ * @type Graphic+ */+ graphic: {}+};+_yuitest_coverline("build/charts-base/charts-base.js", 378);+Renderer.NAME = "renderer";++_yuitest_coverline("build/charts-base/charts-base.js", 380);+Renderer.prototype = {+ /**+ * Storage for `styles` attribute.+ *+ * @property _styles+ * @type Object+ * @private+ */+ _styles: null,+ + /**+ * Method used by `styles` setter.+ *+ * @method _setStyles+ * @param {Object} newStyles Hash of properties to update.+ * @return Object+ * @protected+ */+ _setStyles: function(newstyles)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setStyles", 398);+_yuitest_coverline("build/charts-base/charts-base.js", 400);+var styles = this.get("styles");+ _yuitest_coverline("build/charts-base/charts-base.js", 401);+return this._mergeStyles(newstyles, styles);+ },+ + /**+ * Merges to object literals so that only specified properties are + * overwritten.+ *+ * @method _mergeStyles+ * @param {Object} a Hash of new styles+ * @param {Object} b Hash of original styles+ * @return Object+ * @protected+ */+ _mergeStyles: function(a, b)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_mergeStyles", 414);+_yuitest_coverline("build/charts-base/charts-base.js", 416);+if(!b)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 418);+b = {};+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 420);+var newstyles = Y.merge(b, {});+ _yuitest_coverline("build/charts-base/charts-base.js", 421);+Y.Object.each(a, function(value, key, a)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "(anonymous 2)", 421);+_yuitest_coverline("build/charts-base/charts-base.js", 423);+if(b.hasOwnProperty(key) && Y_Lang.isObject(value) && !Y_Lang.isFunction(value) && !Y_Lang.isArray(value))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 425);+newstyles[key] = this._mergeStyles(value, b[key]);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 429);+newstyles[key] = value;+ }+ }, this);+ _yuitest_coverline("build/charts-base/charts-base.js", 432);+return newstyles;+ },++ /**+ * Gets the default value for the `styles` attribute. + *+ * @method _getDefaultStyles+ * @return Object+ * @protected+ */+ _getDefaultStyles: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultStyles", 442);+_yuitest_coverline("build/charts-base/charts-base.js", 444);+return {padding:{+ top:0,+ right: 0,+ bottom: 0,+ left: 0+ }};+ }+};++_yuitest_coverline("build/charts-base/charts-base.js", 453);+Y.augment(Renderer, Y.Attribute);+_yuitest_coverline("build/charts-base/charts-base.js", 454);+Y.Renderer = Renderer;++/**+ * Algorithmic strategy for rendering a left axis.+ *+ * @module charts+ * @submodule charts-base+ * @class LeftAxisLayout+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 464);+LeftAxisLayout = function() {};++_yuitest_coverline("build/charts-base/charts-base.js", 466);+LeftAxisLayout.prototype = {+ /**+ * Default margins for text fields.+ *+ * @private+ * @method _getDefaultMargins+ * @return Object+ */+ _getDefaultMargins: function() + {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultMargins", 474);+_yuitest_coverline("build/charts-base/charts-base.js", 476);+return {+ top: 0,+ left: 0,+ right: 4,+ bottom: 0+ };+ },++ /**+ * Sets the length of the tick on either side of the axis line.+ *+ * @method setTickOffset+ * @protected+ */+ setTickOffsets: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setTickOffsets", 490);+_yuitest_coverline("build/charts-base/charts-base.js", 492);+var host = this,+ majorTicks = host.get("styles").majorTicks,+ tickLength = majorTicks.length,+ halfTick = tickLength * 0.5,+ display = majorTicks.display;+ _yuitest_coverline("build/charts-base/charts-base.js", 497);+host.set("topTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 498);+host.set("bottomTickOffset", 0);+ + _yuitest_coverline("build/charts-base/charts-base.js", 500);+switch(display)+ {+ case "inside" :+ _yuitest_coverline("build/charts-base/charts-base.js", 503);+host.set("rightTickOffset", tickLength);+ _yuitest_coverline("build/charts-base/charts-base.js", 504);+host.set("leftTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 505);+break;+ case "outside" : + _yuitest_coverline("build/charts-base/charts-base.js", 507);+host.set("rightTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 508);+host.set("leftTickOffset", tickLength);+ _yuitest_coverline("build/charts-base/charts-base.js", 509);+break;+ case "cross":+ _yuitest_coverline("build/charts-base/charts-base.js", 511);+host.set("rightTickOffset", halfTick); + _yuitest_coverline("build/charts-base/charts-base.js", 512);+host.set("leftTickOffset", halfTick);+ _yuitest_coverline("build/charts-base/charts-base.js", 513);+break;+ default:+ _yuitest_coverline("build/charts-base/charts-base.js", 515);+host.set("rightTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 516);+host.set("leftTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 517);+break;+ }+ },+ + /**+ * Draws a tick+ *+ * @method drawTick+ * @param {Path} path reference to the path `Path` element in which to draw the tick.+ * @param {Object} pt Point on the axis in which the tick will intersect.+ * @param {Object} tickStyle Hash of properties to apply to the tick.+ * @protected+ */+ drawTick: function(path, pt, tickStyles)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawTick", 530);+_yuitest_coverline("build/charts-base/charts-base.js", 532);+var host = this,+ style = host.get("styles"),+ padding = style.padding,+ tickLength = tickStyles.length,+ start = {x:padding.left, y:pt.y},+ end = {x:tickLength + padding.left, y:pt.y};+ _yuitest_coverline("build/charts-base/charts-base.js", 538);+host.drawLine(path, start, end);+ },++ /**+ * Calculates the coordinates for the first point on an axis.+ *+ * @method getLineStart+ * @return {Object}+ * @protected+ */+ getLineStart: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getLineStart", 548);+_yuitest_coverline("build/charts-base/charts-base.js", 550);+var style = this.get("styles"),+ padding = style.padding,+ majorTicks = style.majorTicks,+ tickLength = majorTicks.length,+ display = majorTicks.display,+ pt = {x:padding.left, y:0};+ _yuitest_coverline("build/charts-base/charts-base.js", 556);+if(display === "outside")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 558);+pt.x += tickLength;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 560);+if(display === "cross")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 562);+pt.x += tickLength/2;+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 564);+return pt; + },+ + /**+ * Calculates the point for a label.+ *+ * @method getLabelPoint+ * @param {Object} point Point on the axis in which the tick will intersect.+ * @return {Object} + * @protected+ */+ getLabelPoint: function(point)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getLabelPoint", 575);+_yuitest_coverline("build/charts-base/charts-base.js", 577);+return {x:point.x - this.get("leftTickOffset"), y:point.y};+ },+ + /**+ * Updates the value for the `maxLabelSize` for use in calculating total size.+ *+ * @method updateMaxLabelSize+ * @param {HTMLElement} label to measure+ * @protected+ */+ updateMaxLabelSize: function(labelWidth, labelHeight)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "updateMaxLabelSize", 587);+_yuitest_coverline("build/charts-base/charts-base.js", 589);+var host = this,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ sinRadians = props.sinRadians,+ cosRadians = props.cosRadians,+ max;+ _yuitest_coverline("build/charts-base/charts-base.js", 596);+if(rot === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 598);+max = labelWidth;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 600);+if(absRot === 90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 602);+max = labelHeight;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 606);+max = (cosRadians * labelWidth) + (sinRadians * labelHeight);+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 608);+host._maxLabelSize = Math.max(host._maxLabelSize, max);+ },+ + /**+ * Determines the available label width when the axis width has been explicitly set.+ *+ * @method getExplicitlySized+ * @return Boolean+ * @protected+ */+ getExplicitlySized: function(styles)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getExplicitlySized", 618);+_yuitest_coverline("build/charts-base/charts-base.js", 620);+if(this._explicitWidth)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 622);+var host = this,+ w = host._explicitWidth,+ totalTitleSize = host._totalTitleSize,+ leftTickOffset = host.get("leftTickOffset"),+ margin = styles.label.margin.right;+ _yuitest_coverline("build/charts-base/charts-base.js", 627);+host._maxLabelSize = w - (leftTickOffset + margin + totalTitleSize);+ _yuitest_coverline("build/charts-base/charts-base.js", 628);+return true;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 630);+return false;+ },++ /**+ * Rotate and position title.+ *+ * @method positionTitle+ * @param {HTMLElement} label to rotate position+ * @protected+ */+ positionTitle: function(label)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "positionTitle", 640);+_yuitest_coverline("build/charts-base/charts-base.js", 642);+var host = this,+ bounds = host._titleBounds,+ margin = host.get("styles").title.margin,+ props = host._titleRotationProps,+ w = bounds.right - bounds.left,+ labelWidth = label.offsetWidth,+ labelHeight = label.offsetHeight,+ x = (labelWidth * -0.5) + (w * 0.5),+ y = (host.get("height") * 0.5) - (labelHeight * 0.5);+ _yuitest_coverline("build/charts-base/charts-base.js", 651);+props.labelWidth = labelWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 652);+props.labelHeight = labelHeight;+ _yuitest_coverline("build/charts-base/charts-base.js", 653);+if(margin && margin.left)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 655);+x += margin.left;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 657);+props.x = x;+ _yuitest_coverline("build/charts-base/charts-base.js", 658);+props.y = y;+ _yuitest_coverline("build/charts-base/charts-base.js", 659);+props.transformOrigin = [0.5, 0.5];+ _yuitest_coverline("build/charts-base/charts-base.js", 660);+host._rotate(label, props);+ },++ /**+ * Rotate and position labels.+ *+ * @method positionLabel+ * @param {HTMLElement} label to rotate position+ * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned+ * against.+ * @protected+ */+ positionLabel: function(label, pt, styles, i)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "positionLabel", 672);+_yuitest_coverline("build/charts-base/charts-base.js", 674);+var host = this,+ tickOffset = host.get("leftTickOffset"),+ totalTitleSize = this._totalTitleSize,+ leftOffset = pt.x + totalTitleSize - tickOffset,+ topOffset = pt.y,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ maxLabelSize = host._maxLabelSize,+ labelWidth = this._labelWidths[i],+ labelHeight = this._labelHeights[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 685);+if(rot === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 687);+leftOffset -= labelWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 688);+topOffset -= labelHeight * 0.5;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 690);+if(rot === 90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 692);+leftOffset -= labelWidth * 0.5;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 694);+if(rot === -90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 696);+leftOffset -= labelWidth * 0.5;+ _yuitest_coverline("build/charts-base/charts-base.js", 697);+topOffset -= labelHeight;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 701);+leftOffset -= labelWidth + (labelHeight * absRot/360);+ _yuitest_coverline("build/charts-base/charts-base.js", 702);+topOffset -= labelHeight * 0.5;+ }}}+ _yuitest_coverline("build/charts-base/charts-base.js", 704);+props.labelWidth = labelWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 705);+props.labelHeight = labelHeight;+ _yuitest_coverline("build/charts-base/charts-base.js", 706);+props.x = Math.round(maxLabelSize + leftOffset);+ _yuitest_coverline("build/charts-base/charts-base.js", 707);+props.y = Math.round(topOffset);+ _yuitest_coverline("build/charts-base/charts-base.js", 708);+this._rotate(label, props);+ },++ /**+ * Adjusts the coordinates of an axis label based on the rotation.+ *+ * @method _setRotationCoords+ * @param {Object} props Coordinates, dimension and rotation properties of the label.+ * @protected+ */+ _setRotationCoords: function(props)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setRotationCoords", 718);+_yuitest_coverline("build/charts-base/charts-base.js", 720);+var rot = props.rot,+ absRot = props.absRot,+ leftOffset,+ topOffset,+ labelWidth = props.labelWidth,+ labelHeight = props.labelHeight;+ _yuitest_coverline("build/charts-base/charts-base.js", 726);+if(rot === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 728);+leftOffset = labelWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 729);+topOffset = labelHeight * 0.5;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 731);+if(rot === 90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 733);+topOffset = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 734);+leftOffset = labelWidth * 0.5;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 736);+if(rot === -90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 738);+leftOffset = labelWidth * 0.5;+ _yuitest_coverline("build/charts-base/charts-base.js", 739);+topOffset = labelHeight;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 743);+leftOffset = labelWidth + (labelHeight * absRot/360);+ _yuitest_coverline("build/charts-base/charts-base.js", 744);+topOffset = labelHeight * 0.5;+ }}}+ _yuitest_coverline("build/charts-base/charts-base.js", 746);+props.x -= leftOffset;+ _yuitest_coverline("build/charts-base/charts-base.js", 747);+props.y -= topOffset;+ },++ /**+ * Returns the transformOrigin to use for an axis label based on the position of the axis + * and the rotation of the label.+ *+ * @method _getTransformOrigin+ * @param {Number} rot The rotation (in degrees) of the label.+ * @return Array+ * @protected+ */+ _getTransformOrigin: function(rot)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getTransformOrigin", 759);+_yuitest_coverline("build/charts-base/charts-base.js", 761);+var transformOrigin;+ _yuitest_coverline("build/charts-base/charts-base.js", 762);+if(rot === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 764);+transformOrigin = [0, 0];+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 766);+if(rot === 90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 768);+transformOrigin = [0.5, 0];+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 770);+if(rot === -90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 772);+transformOrigin = [0.5, 1];+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 776);+transformOrigin = [1, 0.5];+ }}}+ _yuitest_coverline("build/charts-base/charts-base.js", 778);+return transformOrigin;+ },++ /**+ * Adjust the position of the Axis widget's content box for internal axes.+ *+ * @method offsetNodeForTick+ * @param {Node} cb Content box of the Axis.+ * @protected+ */+ offsetNodeForTick: function(cb)+ {+ },++ /**+ * Sets the width of the axis based on its contents.+ *+ * @method setCalculatedSize+ * @protected+ */+ setCalculatedSize: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setCalculatedSize", 798);+_yuitest_coverline("build/charts-base/charts-base.js", 800);+var host = this,+ graphic = this.get("graphic"),+ style = host.get("styles"),+ label = style.label,+ tickOffset = host.get("leftTickOffset"),+ max = host._maxLabelSize,+ totalTitleSize = this._totalTitleSize,+ ttl = Math.round(totalTitleSize + tickOffset + max + label.margin.right);+ _yuitest_coverline("build/charts-base/charts-base.js", 808);+if(this._explicitWidth)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 810);+ttl = this._explicitWidth;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 812);+this.set("calculatedWidth", ttl);+ _yuitest_coverline("build/charts-base/charts-base.js", 813);+graphic.set("x", ttl - tickOffset);+ }+};++_yuitest_coverline("build/charts-base/charts-base.js", 817);+Y.LeftAxisLayout = LeftAxisLayout;+/**+ * RightAxisLayout contains algorithms for rendering a right axis.+ *+ * @module charts+ * @submodule charts-base+ * @class RightAxisLayout+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 826);+RightAxisLayout = function(){};++_yuitest_coverline("build/charts-base/charts-base.js", 828);+RightAxisLayout.prototype = {+ /**+ * Default margins for text fields.+ *+ * @private+ * @method _getDefaultMargins+ * @return Object+ */+ _getDefaultMargins: function() + {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultMargins", 836);+_yuitest_coverline("build/charts-base/charts-base.js", 838);+return {+ top: 0,+ left: 4,+ right: 0,+ bottom: 0+ };+ },++ /**+ * Sets the length of the tick on either side of the axis line.+ *+ * @method setTickOffset+ * @protected+ */+ setTickOffsets: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setTickOffsets", 852);+_yuitest_coverline("build/charts-base/charts-base.js", 854);+var host = this,+ majorTicks = host.get("styles").majorTicks,+ tickLength = majorTicks.length,+ halfTick = tickLength * 0.5,+ display = majorTicks.display;+ _yuitest_coverline("build/charts-base/charts-base.js", 859);+host.set("topTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 860);+host.set("bottomTickOffset", 0);+ + _yuitest_coverline("build/charts-base/charts-base.js", 862);+switch(display)+ {+ case "inside" :+ _yuitest_coverline("build/charts-base/charts-base.js", 865);+host.set("leftTickOffset", tickLength);+ _yuitest_coverline("build/charts-base/charts-base.js", 866);+host.set("rightTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 867);+break;+ case "outside" : + _yuitest_coverline("build/charts-base/charts-base.js", 869);+host.set("leftTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 870);+host.set("rightTickOffset", tickLength);+ _yuitest_coverline("build/charts-base/charts-base.js", 871);+break;+ case "cross" :+ _yuitest_coverline("build/charts-base/charts-base.js", 873);+host.set("rightTickOffset", halfTick);+ _yuitest_coverline("build/charts-base/charts-base.js", 874);+host.set("leftTickOffset", halfTick);+ _yuitest_coverline("build/charts-base/charts-base.js", 875);+break;+ default:+ _yuitest_coverline("build/charts-base/charts-base.js", 877);+host.set("leftTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 878);+host.set("rightTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 879);+break;+ }+ },++ /**+ * Draws a tick+ *+ * @method drawTick+ * @param {Path} path reference to the path `Path` element in which to draw the tick.+ * @param {Object} pt Point on the axis in which the tick will intersect.+ * @param {Object) tickStyle Hash of properties to apply to the tick.+ * @protected+ */+ drawTick: function(path, pt, tickStyles)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawTick", 892);+_yuitest_coverline("build/charts-base/charts-base.js", 894);+var host = this,+ style = host.get("styles"),+ padding = style.padding,+ tickLength = tickStyles.length,+ start = {x:padding.left, y:pt.y},+ end = {x:padding.left + tickLength, y:pt.y};+ _yuitest_coverline("build/charts-base/charts-base.js", 900);+host.drawLine(path, start, end);+ },+ + /**+ * Calculates the coordinates for the first point on an axis.+ *+ * @method getLineStart+ * @return {Object}+ * @protected+ */+ getLineStart: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getLineStart", 910);+_yuitest_coverline("build/charts-base/charts-base.js", 912);+var host = this,+ style = host.get("styles"),+ padding = style.padding,+ majorTicks = style.majorTicks,+ tickLength = majorTicks.length,+ display = majorTicks.display,+ pt = {x:padding.left, y:padding.top};+ _yuitest_coverline("build/charts-base/charts-base.js", 919);+if(display === "inside")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 921);+pt.x += tickLength;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 923);+if(display === "cross")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 925);+pt.x += tickLength/2;+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 927);+return pt;+ },+ + /**+ * Calculates the point for a label.+ *+ * @method getLabelPoint+ * @param {Object} point Point on the axis in which the tick will intersect.+ * @return {Object} + * @protected+ */+ getLabelPoint: function(point)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getLabelPoint", 938);+_yuitest_coverline("build/charts-base/charts-base.js", 940);+return {x:point.x + this.get("rightTickOffset"), y:point.y};+ },+ + /**+ * Updates the value for the `maxLabelSize` for use in calculating total size.+ *+ * @method updateMaxLabelSize+ * @param {HTMLElement} label to measure+ * @protected+ */+ updateMaxLabelSize: function(labelWidth, labelHeight)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "updateMaxLabelSize", 950);+_yuitest_coverline("build/charts-base/charts-base.js", 952);+var host = this,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ sinRadians = props.sinRadians,+ cosRadians = props.cosRadians,+ max;+ _yuitest_coverline("build/charts-base/charts-base.js", 959);+if(rot === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 961);+max = labelWidth;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 963);+if(absRot === 90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 965);+max = labelHeight;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 969);+max = (cosRadians * labelWidth) + (sinRadians * labelHeight);+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 971);+host._maxLabelSize = Math.max(host._maxLabelSize, max);+ },+ + /**+ * Determines the available label width when the axis width has been explicitly set.+ *+ * @method getExplicitlySized+ * @return Boolean+ * @protected+ */+ getExplicitlySized: function(styles)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getExplicitlySized", 981);+_yuitest_coverline("build/charts-base/charts-base.js", 983);+if(this._explicitWidth)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 985);+var host = this,+ w = host._explicitWidth,+ totalTitleSize = this._totalTitleSize,+ rightTickOffset = host.get("rightTickOffset"),+ margin = styles.label.margin.right;+ _yuitest_coverline("build/charts-base/charts-base.js", 990);+host._maxLabelSize = w - (rightTickOffset + margin + totalTitleSize);+ _yuitest_coverline("build/charts-base/charts-base.js", 991);+return true;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 993);+return false;+ },++ /**+ * Rotate and position title.+ *+ * @method positionTitle+ * @param {HTMLElement} label to rotate position+ * @protected+ */+ positionTitle: function(label)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "positionTitle", 1003);+_yuitest_coverline("build/charts-base/charts-base.js", 1005);+var host = this,+ bounds = host._titleBounds,+ margin = host.get("styles").title.margin,+ props = host._titleRotationProps,+ labelWidth = label.offsetWidth,+ labelHeight = label.offsetHeight,+ w = bounds.right - bounds.left,+ x = this.get("width") - (labelWidth * 0.5) - (w * 0.5),+ y = (host.get("height") * 0.5) - (labelHeight * 0.5);+ _yuitest_coverline("build/charts-base/charts-base.js", 1014);+props.labelWidth = labelWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 1015);+props.labelHeight = labelHeight;+ _yuitest_coverline("build/charts-base/charts-base.js", 1016);+if(margin && margin.right)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1018);+x -= margin.left;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 1020);+props.x = x;+ _yuitest_coverline("build/charts-base/charts-base.js", 1021);+props.y = y;+ _yuitest_coverline("build/charts-base/charts-base.js", 1022);+props.transformOrigin = [0.5, 0.5];+ _yuitest_coverline("build/charts-base/charts-base.js", 1023);+host._rotate(label, props);+ },++ /**+ * Rotate and position labels.+ *+ * @method positionLabel+ * @param {HTMLElement} label to rotate position+ * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned+ * against.+ * @protected+ */+ positionLabel: function(label, pt, styles, i)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "positionLabel", 1035);+_yuitest_coverline("build/charts-base/charts-base.js", 1037);+var host = this,+ tickOffset = host.get("rightTickOffset"),+ labelStyles = styles.label,+ margin = 0,+ leftOffset = pt.x,+ topOffset = pt.y,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ labelWidth = this._labelWidths[i],+ labelHeight = this._labelHeights[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 1048);+if(labelStyles.margin && labelStyles.margin.left)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1050);+margin = labelStyles.margin.left;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 1052);+if(rot === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1054);+topOffset -= labelHeight * 0.5;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 1056);+if(rot === 90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1058);+leftOffset -= labelWidth * 0.5;+ _yuitest_coverline("build/charts-base/charts-base.js", 1059);+topOffset -= labelHeight;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 1061);+if(rot === -90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1063);+leftOffset -= labelWidth * 0.5;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1067);+topOffset -= labelHeight * 0.5;+ _yuitest_coverline("build/charts-base/charts-base.js", 1068);+leftOffset += labelHeight/2 * absRot/90;+ }}}+ _yuitest_coverline("build/charts-base/charts-base.js", 1070);+leftOffset += margin;+ _yuitest_coverline("build/charts-base/charts-base.js", 1071);+leftOffset += tickOffset;+ _yuitest_coverline("build/charts-base/charts-base.js", 1072);+props.labelWidth = labelWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 1073);+props.labelHeight = labelHeight;+ _yuitest_coverline("build/charts-base/charts-base.js", 1074);+props.x = Math.round(leftOffset);+ _yuitest_coverline("build/charts-base/charts-base.js", 1075);+props.y = Math.round(topOffset);+ _yuitest_coverline("build/charts-base/charts-base.js", 1076);+this._rotate(label, props);+ },+ + /**+ * Adjusts the coordinates of an axis label based on the rotation.+ *+ * @method _setRotationCoords+ * @param {Object} props Coordinates, dimension and rotation properties of the label.+ * @protected+ */+ _setRotationCoords: function(props)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setRotationCoords", 1086);+_yuitest_coverline("build/charts-base/charts-base.js", 1088);+var rot = props.rot,+ absRot = props.absRot,+ leftOffset = 0,+ topOffset = 0,+ labelWidth = props.labelWidth,+ labelHeight = props.labelHeight;+ _yuitest_coverline("build/charts-base/charts-base.js", 1094);+if(rot === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1096);+topOffset = labelHeight * 0.5;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 1098);+if(rot === 90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1100);+leftOffset = labelWidth * 0.5;+ _yuitest_coverline("build/charts-base/charts-base.js", 1101);+topOffset = labelHeight;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 1103);+if(rot === -90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1105);+leftOffset = labelWidth * 0.5;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1109);+topOffset = labelHeight * 0.5;+ _yuitest_coverline("build/charts-base/charts-base.js", 1110);+leftOffset = labelHeight/2 * absRot/90;+ }}}+ _yuitest_coverline("build/charts-base/charts-base.js", 1112);+props.x -= leftOffset;+ _yuitest_coverline("build/charts-base/charts-base.js", 1113);+props.y -= topOffset;+ },+ + /**+ * Returns the transformOrigin to use for an axis label based on the position of the axis + * and the rotation of the label.+ *+ * @method _getTransformOrigin+ * @param {Number} rot The rotation (in degrees) of the label.+ * @return Array+ * @protected+ */+ _getTransformOrigin: function(rot)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getTransformOrigin", 1125);+_yuitest_coverline("build/charts-base/charts-base.js", 1127);+var transformOrigin;+ _yuitest_coverline("build/charts-base/charts-base.js", 1128);+if(rot === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1130);+transformOrigin = [0, 0];+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 1132);+if(rot === 90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1134);+transformOrigin = [0.5, 1];+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 1136);+if(rot === -90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1138);+transformOrigin = [0.5, 0];+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1142);+transformOrigin = [0, 0.5];+ }}}+ _yuitest_coverline("build/charts-base/charts-base.js", 1144);+return transformOrigin;+ },++ /**+ * Adjusts position for inner ticks.+ *+ * @method offsetNodeForTick+ * @param {Node} cb contentBox of the axis+ * @protected+ */+ offsetNodeForTick: function(cb)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "offsetNodeForTick", 1154);+_yuitest_coverline("build/charts-base/charts-base.js", 1156);+var host = this,+ tickOffset = host.get("leftTickOffset"),+ offset = 0 - tickOffset;+ _yuitest_coverline("build/charts-base/charts-base.js", 1159);+cb.setStyle("left", offset);+ },++ /**+ * Assigns a height based on the size of the contents.+ *+ * @method setCalculatedSize+ * @protected+ */+ setCalculatedSize: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setCalculatedSize", 1168);+_yuitest_coverline("build/charts-base/charts-base.js", 1170);+var host = this,+ styles = host.get("styles"),+ labelStyle = styles.label,+ totalTitleSize = this._totalTitleSize,+ ttl = Math.round(host.get("rightTickOffset") + host._maxLabelSize + totalTitleSize + labelStyle.margin.left);+ _yuitest_coverline("build/charts-base/charts-base.js", 1175);+if(this._explicitWidth)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1177);+ttl = this._explicitWidth;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 1179);+host.set("calculatedWidth", ttl);+ _yuitest_coverline("build/charts-base/charts-base.js", 1180);+host.get("contentBox").setStyle("width", ttl);+ }+};++_yuitest_coverline("build/charts-base/charts-base.js", 1184);+Y.RightAxisLayout = RightAxisLayout;+/**+ * Contains algorithms for rendering a bottom axis.+ *+ * @module charts+ * @submodule charts-base+ * @class BottomAxisLayout+ * @Constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 1193);+BottomAxisLayout = function(){};++_yuitest_coverline("build/charts-base/charts-base.js", 1195);+BottomAxisLayout.prototype = {+ /**+ * Default margins for text fields.+ *+ * @private+ * @method _getDefaultMargins+ * @return Object+ */+ _getDefaultMargins: function() + {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultMargins", 1203);+_yuitest_coverline("build/charts-base/charts-base.js", 1205);+return {+ top: 4,+ left: 0,+ right: 0,+ bottom: 0+ };+ },++ /**+ * Sets the length of the tick on either side of the axis line.+ *+ * @method setTickOffsets+ * @protected+ */+ setTickOffsets: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setTickOffsets", 1219);+_yuitest_coverline("build/charts-base/charts-base.js", 1221);+var host = this,+ majorTicks = host.get("styles").majorTicks,+ tickLength = majorTicks.length,+ halfTick = tickLength * 0.5,+ display = majorTicks.display;+ _yuitest_coverline("build/charts-base/charts-base.js", 1226);+host.set("leftTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 1227);+host.set("rightTickOffset", 0);++ _yuitest_coverline("build/charts-base/charts-base.js", 1229);+switch(display)+ {+ case "inside" :+ _yuitest_coverline("build/charts-base/charts-base.js", 1232);+host.set("topTickOffset", tickLength);+ _yuitest_coverline("build/charts-base/charts-base.js", 1233);+host.set("bottomTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 1234);+break;+ case "outside" : + _yuitest_coverline("build/charts-base/charts-base.js", 1236);+host.set("topTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 1237);+host.set("bottomTickOffset", tickLength);+ _yuitest_coverline("build/charts-base/charts-base.js", 1238);+break;+ case "cross":+ _yuitest_coverline("build/charts-base/charts-base.js", 1240);+host.set("topTickOffset", halfTick);+ _yuitest_coverline("build/charts-base/charts-base.js", 1241);+host.set("bottomTickOffset", halfTick);+ _yuitest_coverline("build/charts-base/charts-base.js", 1242);+break;+ default:+ _yuitest_coverline("build/charts-base/charts-base.js", 1244);+host.set("topTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 1245);+host.set("bottomTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 1246);+break;+ }+ },++ /**+ * Calculates the coordinates for the first point on an axis.+ *+ * @method getLineStart+ * @protected+ */+ getLineStart: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getLineStart", 1256);+_yuitest_coverline("build/charts-base/charts-base.js", 1258);+var style = this.get("styles"),+ padding = style.padding,+ majorTicks = style.majorTicks,+ tickLength = majorTicks.length,+ display = majorTicks.display,+ pt = {x:0, y:padding.top};+ _yuitest_coverline("build/charts-base/charts-base.js", 1264);+if(display === "inside")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1266);+pt.y += tickLength;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 1268);+if(display === "cross")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1270);+pt.y += tickLength/2;+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 1272);+return pt; + },+ + /**+ * Draws a tick+ *+ * @method drawTick+ * @param {Path} path reference to the path `Path` element in which to draw the tick.+ * @param {Object} pt hash containing x and y coordinates+ * @param {Object} tickStyles hash of properties used to draw the tick+ * @protected+ */+ drawTick: function(path, pt, tickStyles)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawTick", 1284);+_yuitest_coverline("build/charts-base/charts-base.js", 1286);+var host = this,+ style = host.get("styles"),+ padding = style.padding,+ tickLength = tickStyles.length,+ start = {x:pt.x, y:padding.top},+ end = {x:pt.x, y:tickLength + padding.top};+ _yuitest_coverline("build/charts-base/charts-base.js", 1292);+host.drawLine(path, start, end);+ },++ /**+ * Calculates the point for a label.+ *+ * @method getLabelPoint+ * @param {Object} pt Object containing x and y coordinates+ * @return Object+ * @protected+ */+ getLabelPoint: function(point)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getLabelPoint", 1303);+_yuitest_coverline("build/charts-base/charts-base.js", 1305);+return {x:point.x, y:point.y + this.get("bottomTickOffset")};+ },+ + /**+ * Updates the value for the `maxLabelSize` for use in calculating total size.+ *+ * @method updateMaxLabelSize+ * @param {HTMLElement} label to measure+ * @protected+ */+ updateMaxLabelSize: function(labelWidth, labelHeight)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "updateMaxLabelSize", 1315);+_yuitest_coverline("build/charts-base/charts-base.js", 1317);+var host = this,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ sinRadians = props.sinRadians,+ cosRadians = props.cosRadians,+ max;+ _yuitest_coverline("build/charts-base/charts-base.js", 1324);+if(rot === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1326);+max = labelHeight;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 1328);+if(absRot === 90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1330);+max = labelWidth;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1334);+max = (sinRadians * labelWidth) + (cosRadians * labelHeight); + }}+ _yuitest_coverline("build/charts-base/charts-base.js", 1336);+host._maxLabelSize = Math.max(host._maxLabelSize, max);+ },+ + /**+ * Determines the available label height when the axis width has been explicitly set.+ *+ * @method getExplicitlySized+ * @return Boolean+ * @protected+ */+ getExplicitlySized: function(styles)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getExplicitlySized", 1346);+_yuitest_coverline("build/charts-base/charts-base.js", 1348);+if(this._explicitHeight)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1350);+var host = this,+ h = host._explicitHeight,+ totalTitleSize = host._totalTitleSize,+ bottomTickOffset = host.get("bottomTickOffset"),+ margin = styles.label.margin.right;+ _yuitest_coverline("build/charts-base/charts-base.js", 1355);+host._maxLabelSize = h - (bottomTickOffset + margin + totalTitleSize);+ _yuitest_coverline("build/charts-base/charts-base.js", 1356);+return true;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 1358);+return false;+ },++ /**+ * Rotate and position title.+ *+ * @method positionTitle+ * @param {HTMLElement} label to rotate position+ * @protected+ */+ positionTitle: function(label)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "positionTitle", 1368);+_yuitest_coverline("build/charts-base/charts-base.js", 1370);+var host = this,+ bounds = host._titleBounds,+ margin = host.get("styles").title.margin,+ props = host._titleRotationProps,+ h = bounds.bottom - bounds.top,+ labelWidth = label.offsetWidth,+ labelHeight = label.offsetHeight,+ x = (host.get("width") * 0.5) - (labelWidth * 0.5),+ y = host.get("height") - labelHeight/2 - h/2;+ _yuitest_coverline("build/charts-base/charts-base.js", 1379);+props.labelWidth = labelWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 1380);+props.labelHeight = labelHeight;+ _yuitest_coverline("build/charts-base/charts-base.js", 1381);+if(margin && margin.bottom)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1383);+y -= margin.bottom;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 1385);+props.x = x;+ _yuitest_coverline("build/charts-base/charts-base.js", 1386);+props.y = y;+ _yuitest_coverline("build/charts-base/charts-base.js", 1387);+props.transformOrigin = [0.5, 0.5];+ _yuitest_coverline("build/charts-base/charts-base.js", 1388);+host._rotate(label, props);+ },+ + /**+ * Rotate and position labels.+ *+ * @method positionLabel+ * @param {HTMLElement} label to rotate position+ * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned+ * against.+ * @protected+ */+ positionLabel: function(label, pt, styles, i)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "positionLabel", 1400);+_yuitest_coverline("build/charts-base/charts-base.js", 1402);+var host = this,+ tickOffset = host.get("bottomTickOffset"),+ labelStyles = styles.label,+ margin = 0,+ props = host._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ leftOffset = Math.round(pt.x),+ topOffset = Math.round(pt.y),+ labelWidth = host._labelWidths[i],+ labelHeight = host._labelHeights[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 1413);+if(labelStyles.margin && labelStyles.margin.top)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1415);+margin = labelStyles.margin.top;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 1417);+if(rot > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1419);+topOffset -= labelHeight/2 * rot/90;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 1421);+if(rot < 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1423);+leftOffset -= labelWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 1424);+topOffset -= labelHeight/2 * absRot/90;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1428);+leftOffset -= labelWidth * 0.5;+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 1430);+topOffset += margin;+ _yuitest_coverline("build/charts-base/charts-base.js", 1431);+topOffset += tickOffset;+ _yuitest_coverline("build/charts-base/charts-base.js", 1432);+props.labelWidth = labelWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 1433);+props.labelHeight = labelHeight;+ _yuitest_coverline("build/charts-base/charts-base.js", 1434);+props.x = leftOffset;+ _yuitest_coverline("build/charts-base/charts-base.js", 1435);+props.y = topOffset;+ _yuitest_coverline("build/charts-base/charts-base.js", 1436);+host._rotate(label, props);+ },+ + /**+ * Adjusts the coordinates of an axis label based on the rotation.+ *+ * @method _setRotationCoords+ * @param {Object} props Coordinates, dimension and rotation properties of the label.+ * @protected+ */+ _setRotationCoords: function(props)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setRotationCoords", 1446);+_yuitest_coverline("build/charts-base/charts-base.js", 1448);+var rot = props.rot,+ absRot = props.absRot,+ labelWidth = props.labelWidth,+ labelHeight = props.labelHeight,+ leftOffset,+ topOffset;++ _yuitest_coverline("build/charts-base/charts-base.js", 1455);+if(rot > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1457);+leftOffset = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 1458);+topOffset = labelHeight/2 * rot/90;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 1460);+if(rot < 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1462);+leftOffset = labelWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 1463);+topOffset = labelHeight/2 * absRot/90;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1467);+leftOffset = labelWidth * 0.5;+ _yuitest_coverline("build/charts-base/charts-base.js", 1468);+topOffset = 0;+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 1470);+props.x -= leftOffset;+ _yuitest_coverline("build/charts-base/charts-base.js", 1471);+props.y -= topOffset;+ },++ /**+ * Returns the transformOrigin to use for an axis label based on the position of the axis + * and the rotation of the label.+ *+ * @method _getTransformOrigin+ * @param {Number} rot The rotation (in degrees) of the label.+ * @return Array+ * @protected+ */+ _getTransformOrigin: function(rot)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getTransformOrigin", 1483);+_yuitest_coverline("build/charts-base/charts-base.js", 1485);+var transformOrigin;+ _yuitest_coverline("build/charts-base/charts-base.js", 1486);+if(rot > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1488);+transformOrigin = [0, 0.5];+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 1490);+if(rot < 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1492);+transformOrigin = [1, 0.5];+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1496);+transformOrigin = [0, 0];+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 1498);+return transformOrigin;+ },++ /**+ * Adjusts position for inner ticks.+ *+ * @method offsetNodeForTick+ * @param {Node} cb contentBox of the axis+ * @protected+ */+ offsetNodeForTick: function(cb)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "offsetNodeForTick", 1508);+_yuitest_coverline("build/charts-base/charts-base.js", 1510);+var host = this;+ _yuitest_coverline("build/charts-base/charts-base.js", 1511);+host.get("contentBox").setStyle("top", 0 - host.get("topTickOffset"));+ },++ /**+ * Assigns a height based on the size of the contents.+ *+ * @method setCalculatedSize+ * @protected+ */+ setCalculatedSize: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setCalculatedSize", 1520);+_yuitest_coverline("build/charts-base/charts-base.js", 1522);+var host = this,+ styles = host.get("styles"),+ labelStyle = styles.label,+ totalTitleSize = host._totalTitleSize,+ ttl = Math.round(host.get("bottomTickOffset") + host._maxLabelSize + labelStyle.margin.top + totalTitleSize);+ _yuitest_coverline("build/charts-base/charts-base.js", 1527);+if(host._explicitHeight)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1529);+ttl = host._explicitHeight;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 1531);+host.set("calculatedHeight", ttl);+ }+};+_yuitest_coverline("build/charts-base/charts-base.js", 1534);+Y.BottomAxisLayout = BottomAxisLayout;+/**+ * Contains algorithms for rendering a top axis.+ *+ * @module charts+ * @submodule charts-base+ * @class TopAxisLayout+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 1543);+TopAxisLayout = function(){};++_yuitest_coverline("build/charts-base/charts-base.js", 1545);+TopAxisLayout.prototype = {+ /**+ * Default margins for text fields.+ *+ * @private+ * @method _getDefaultMargins+ * @return Object+ */+ _getDefaultMargins: function() + {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultMargins", 1553);+_yuitest_coverline("build/charts-base/charts-base.js", 1555);+return {+ top: 0,+ left: 0,+ right: 0,+ bottom: 4+ };+ },+ + /**+ * Sets the length of the tick on either side of the axis line.+ *+ * @method setTickOffsets+ * @protected+ */+ setTickOffsets: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setTickOffsets", 1569);+_yuitest_coverline("build/charts-base/charts-base.js", 1571);+var host = this,+ majorTicks = host.get("styles").majorTicks,+ tickLength = majorTicks.length,+ halfTick = tickLength * 0.5,+ display = majorTicks.display;+ _yuitest_coverline("build/charts-base/charts-base.js", 1576);+host.set("leftTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 1577);+host.set("rightTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 1578);+switch(display)+ {+ case "inside" :+ _yuitest_coverline("build/charts-base/charts-base.js", 1581);+host.set("bottomTickOffset", tickLength);+ _yuitest_coverline("build/charts-base/charts-base.js", 1582);+host.set("topTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 1583);+break;+ case "outside" : + _yuitest_coverline("build/charts-base/charts-base.js", 1585);+host.set("bottomTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 1586);+host.set("topTickOffset", tickLength);+ _yuitest_coverline("build/charts-base/charts-base.js", 1587);+break;+ case "cross" :+ _yuitest_coverline("build/charts-base/charts-base.js", 1589);+host.set("topTickOffset", halfTick);+ _yuitest_coverline("build/charts-base/charts-base.js", 1590);+host.set("bottomTickOffset", halfTick);+ _yuitest_coverline("build/charts-base/charts-base.js", 1591);+break;+ default:+ _yuitest_coverline("build/charts-base/charts-base.js", 1593);+host.set("topTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 1594);+host.set("bottomTickOffset", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 1595);+break;+ }+ },++ /**+ * Calculates the coordinates for the first point on an axis.+ *+ * @method getLineStart+ * @protected+ */+ getLineStart: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getLineStart", 1605);+_yuitest_coverline("build/charts-base/charts-base.js", 1607);+var host = this,+ style = host.get("styles"),+ padding = style.padding,+ majorTicks = style.majorTicks,+ tickLength = majorTicks.length,+ display = majorTicks.display,+ pt = {x:0, y:padding.top};+ _yuitest_coverline("build/charts-base/charts-base.js", 1614);+if(display === "outside")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1616);+pt.y += tickLength;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 1618);+if(display === "cross")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1620);+pt.y += tickLength/2;+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 1622);+return pt; + },+ + /**+ * Draws a tick+ *+ * @method drawTick+ * @param {Path} path reference to the path `Path` element in which to draw the tick.+ * @param {Object} pt hash containing x and y coordinates+ * @param {Object} tickStyles hash of properties used to draw the tick+ * @protected+ */+ drawTick: function(path, pt, tickStyles)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawTick", 1634);+_yuitest_coverline("build/charts-base/charts-base.js", 1636);+var host = this,+ style = host.get("styles"),+ padding = style.padding,+ tickLength = tickStyles.length,+ start = {x:pt.x, y:padding.top},+ end = {x:pt.x, y:tickLength + padding.top};+ _yuitest_coverline("build/charts-base/charts-base.js", 1642);+host.drawLine(path, start, end);+ },+ + /**+ * Calculates the point for a label.+ *+ * @method getLabelPoint+ * @param {Object} pt hash containing x and y coordinates+ * @return Object+ * @protected+ */+ getLabelPoint: function(pt)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getLabelPoint", 1653);+_yuitest_coverline("build/charts-base/charts-base.js", 1655);+return {x:pt.x, y:pt.y - this.get("topTickOffset")};+ },+ + /**+ * Updates the value for the `maxLabelSize` for use in calculating total size.+ *+ * @method updateMaxLabelSize+ * @param {HTMLElement} label to measure+ * @protected+ */+ updateMaxLabelSize: function(labelWidth, labelHeight)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "updateMaxLabelSize", 1665);+_yuitest_coverline("build/charts-base/charts-base.js", 1667);+var host = this,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ sinRadians = props.sinRadians,+ cosRadians = props.cosRadians,+ max;+ _yuitest_coverline("build/charts-base/charts-base.js", 1674);+if(rot === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1676);+max = labelHeight;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 1678);+if(absRot === 90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1680);+max = labelWidth;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1684);+max = (sinRadians * labelWidth) + (cosRadians * labelHeight); + }}+ _yuitest_coverline("build/charts-base/charts-base.js", 1686);+host._maxLabelSize = Math.max(host._maxLabelSize, max);+ },++ /**+ * Determines the available label height when the axis width has been explicitly set.+ *+ * @method getExplicitlySized+ * @return Boolean+ * @protected+ */+ getExplicitlySized: function(styles)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getExplicitlySized", 1696);+_yuitest_coverline("build/charts-base/charts-base.js", 1698);+if(this._explicitHeight)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1700);+var host = this,+ h = host._explicitHeight,+ totalTitleSize = host._totalTitleSize,+ topTickOffset = host.get("topTickOffset"),+ margin = styles.label.margin.right;+ _yuitest_coverline("build/charts-base/charts-base.js", 1705);+host._maxLabelSize = h - (topTickOffset + margin + totalTitleSize);+ _yuitest_coverline("build/charts-base/charts-base.js", 1706);+return true;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 1708);+return false;+ },++ /**+ * Rotate and position title.+ *+ * @method positionTitle+ * @param {HTMLElement} label to rotate position+ * @protected+ */+ positionTitle: function(label)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "positionTitle", 1718);+_yuitest_coverline("build/charts-base/charts-base.js", 1720);+var host = this,+ bounds = host._titleBounds,+ margin = host.get("styles").title.margin,+ props = host._titleRotationProps,+ labelWidth = label.offsetWidth,+ labelHeight = label.offsetHeight,+ h = bounds.bottom - bounds.top,+ x = (host.get("width") * 0.5) - (labelWidth * 0.5),+ y = h/2 - labelHeight/2;+ _yuitest_coverline("build/charts-base/charts-base.js", 1729);+props.labelWidth = labelWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 1730);+props.labelHeight = labelHeight;+ _yuitest_coverline("build/charts-base/charts-base.js", 1731);+if(margin && margin.top)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1733);+y += margin.top;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 1735);+props.x = x;+ _yuitest_coverline("build/charts-base/charts-base.js", 1736);+props.y = y;+ _yuitest_coverline("build/charts-base/charts-base.js", 1737);+props.transformOrigin = [0.5, 0.5];+ _yuitest_coverline("build/charts-base/charts-base.js", 1738);+host._rotate(label, props);+ },++ /**+ * Rotate and position labels.+ *+ * @method positionLabel+ * @param {HTMLElement} label to rotate position+ * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned+ * against.+ * @protected+ */+ positionLabel: function(label, pt, styles, i)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "positionLabel", 1750);+_yuitest_coverline("build/charts-base/charts-base.js", 1752);+var host = this,+ totalTitleSize = this._totalTitleSize,+ maxLabelSize = host._maxLabelSize,+ leftOffset = pt.x,+ topOffset = pt.y + totalTitleSize + maxLabelSize,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ labelWidth = this._labelWidths[i],+ labelHeight = this._labelHeights[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 1762);+if(rot === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1764);+leftOffset -= labelWidth * 0.5;+ _yuitest_coverline("build/charts-base/charts-base.js", 1765);+topOffset -= labelHeight;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1769);+if(rot === 90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1771);+leftOffset -= labelWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 1772);+topOffset -= (labelHeight * 0.5);+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 1774);+if (rot === -90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1776);+topOffset -= (labelHeight * 0.5);+ } + else {_yuitest_coverline("build/charts-base/charts-base.js", 1778);+if(rot > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1780);+leftOffset -= labelWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 1781);+topOffset -= labelHeight - (labelHeight * rot/180);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1785);+topOffset -= labelHeight - (labelHeight * absRot/180);+ }}}+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 1788);+props.x = Math.round(leftOffset);+ _yuitest_coverline("build/charts-base/charts-base.js", 1789);+props.y = Math.round(topOffset);+ _yuitest_coverline("build/charts-base/charts-base.js", 1790);+props.labelWidth = labelWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 1791);+props.labelHeight = labelHeight;+ _yuitest_coverline("build/charts-base/charts-base.js", 1792);+this._rotate(label, props);+ },++ /**+ * Adjusts the coordinates of an axis label based on the rotation.+ *+ * @method _setRotationCoords+ * @param {Object} props Coordinates, dimension and rotation properties of the label.+ * @protected+ */+ _setRotationCoords: function(props)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setRotationCoords", 1802);+_yuitest_coverline("build/charts-base/charts-base.js", 1804);+var rot = props.rot,+ absRot = props.absRot,+ labelWidth = props.labelWidth,+ labelHeight = props.labelHeight,+ leftOffset,+ topOffset;+ _yuitest_coverline("build/charts-base/charts-base.js", 1810);+if(rot === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1812);+leftOffset = labelWidth * 0.5;+ _yuitest_coverline("build/charts-base/charts-base.js", 1813);+topOffset = labelHeight;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1817);+if(rot === 90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1819);+leftOffset = labelWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 1820);+topOffset = (labelHeight * 0.5);+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 1822);+if (rot === -90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1824);+topOffset = (labelHeight * 0.5);+ } + else {_yuitest_coverline("build/charts-base/charts-base.js", 1826);+if(rot > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1828);+leftOffset = labelWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 1829);+topOffset = labelHeight - (labelHeight * rot/180);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1833);+topOffset = labelHeight - (labelHeight * absRot/180);+ }}}+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 1836);+props.x -= leftOffset;+ _yuitest_coverline("build/charts-base/charts-base.js", 1837);+props.y -= topOffset;+ },++ /**+ * Returns the transformOrigin to use for an axis label based on the position of the axis + * and the rotation of the label.+ *+ * @method _getTransformOrigin+ * @param {Number} rot The rotation (in degrees) of the label.+ * @return Array+ * @protected+ */+ _getTransformOrigin: function(rot)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getTransformOrigin", 1849);+_yuitest_coverline("build/charts-base/charts-base.js", 1851);+var transformOrigin;+ _yuitest_coverline("build/charts-base/charts-base.js", 1852);+if(rot === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1854);+transformOrigin = [0, 0];+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1858);+if(rot === 90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1860);+transformOrigin = [1, 0.5];+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 1862);+if (rot === -90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1864);+transformOrigin = [0, 0.5];+ } + else {_yuitest_coverline("build/charts-base/charts-base.js", 1866);+if(rot > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1868);+transformOrigin = [1, 0.5];+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1872);+transformOrigin = [0, 0.5];+ }}}+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 1875);+return transformOrigin;+ },++ /**+ * Adjusts position for inner ticks.+ *+ * @method offsetNodeForTick+ * @param {Node} cb contentBox of the axis+ * @protected+ */+ offsetNodeForTick: function(cb)+ {+ },++ /**+ * Assigns a height based on the size of the contents.+ *+ * @method setCalculatedSize+ * @protected+ */+ setCalculatedSize: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setCalculatedSize", 1895);+_yuitest_coverline("build/charts-base/charts-base.js", 1897);+var host = this,+ graphic = host.get("graphic"),+ styles = host.get("styles"),+ labelMargin = styles.label.margin,+ totalLabelSize = labelMargin.bottom + host._maxLabelSize,+ totalTitleSize = host._totalTitleSize,+ topTickOffset = this.get("topTickOffset"),+ ttl = Math.round(topTickOffset + totalLabelSize + totalTitleSize);+ _yuitest_coverline("build/charts-base/charts-base.js", 1905);+if(this._explicitHeight)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1907);+ttl = this._explicitWidth; + }+ _yuitest_coverline("build/charts-base/charts-base.js", 1909);+host.set("calculatedHeight", ttl);+ _yuitest_coverline("build/charts-base/charts-base.js", 1910);+graphic.set("y", ttl - topTickOffset);+ }+};+_yuitest_coverline("build/charts-base/charts-base.js", 1913);+Y.TopAxisLayout = TopAxisLayout;++/**+ * The Axis class. Generates axes for a chart.+ *+ * @module charts+ * @submodule charts-base+ * @class Axis+ * @extends Widget+ * @uses Renderer+ * @constructor+ * @param {Object} config (optional) Configuration parameters for the Chart.+ */+_yuitest_coverline("build/charts-base/charts-base.js", 1926);+Y.Axis = Y.Base.create("axis", Y.Widget, [Y.Renderer], {+ /**+ * Storage for calculatedWidth value.+ *+ * @property _calculatedWidth+ * @type Number+ * @private+ */+ _calculatedWidth: 0,++ /**+ * Storage for calculatedHeight value.+ *+ * @property _calculatedHeight+ * @type Number+ * @private+ */+ _calculatedHeight: 0,++ /**+ * Handles change to the dataProvider+ * + * @method _dataChangeHandler+ * @param {Object} e Event object+ * @private+ */+ _dataChangeHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_dataChangeHandler", 1952);+_yuitest_coverline("build/charts-base/charts-base.js", 1954);+if(this.get("rendered"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1956);+this._drawAxis();+ }+ },++ /**+ * Handles change to the position attribute+ *+ * @method _positionChangeHandler+ * @param {Object} e Event object+ * @private+ */+ _positionChangeHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_positionChangeHandler", 1967);+_yuitest_coverline("build/charts-base/charts-base.js", 1969);+this._updateGraphic(e.newVal);+ _yuitest_coverline("build/charts-base/charts-base.js", 1970);+this._updateHandler();+ },++ /**+ * Updates the the Graphic instance+ *+ * @method _updateGraphic+ * @param {String} position Position of axis + * @private+ */+ _updateGraphic: function(position)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_updateGraphic", 1980);+_yuitest_coverline("build/charts-base/charts-base.js", 1982);+var graphic = this.get("graphic");+ _yuitest_coverline("build/charts-base/charts-base.js", 1983);+if(position == "none")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1985);+if(graphic)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1987);+graphic.destroy();+ }+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1992);+if(!graphic)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 1994);+this._setCanvas();+ }+ }+ },++ /**+ * Handles changes to axis.+ *+ * @method _updateHandler+ * @param {Object} e Event object+ * @private+ */+ _updateHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_updateHandler", 2006);+_yuitest_coverline("build/charts-base/charts-base.js", 2008);+if(this.get("rendered"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2010);+this._drawAxis();+ }+ },+ + /**+ * @method renderUI+ * @private+ */+ renderUI: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "renderUI", 2018);+_yuitest_coverline("build/charts-base/charts-base.js", 2020);+this._updateGraphic(this.get("position"));+ },++ /**+ * @method syncUI+ * @private+ */+ syncUI: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "syncUI", 2027);+_yuitest_coverline("build/charts-base/charts-base.js", 2029);+var layout = this._layout,+ defaultMargins,+ styles,+ label,+ title,+ i;+ _yuitest_coverline("build/charts-base/charts-base.js", 2035);+if(layout)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2037);+defaultMargins = layout._getDefaultMargins();+ _yuitest_coverline("build/charts-base/charts-base.js", 2038);+styles = this.get("styles");+ _yuitest_coverline("build/charts-base/charts-base.js", 2039);+label = styles.label.margin;+ _yuitest_coverline("build/charts-base/charts-base.js", 2040);+title =styles.title.margin;+ //need to defaultMargins method to the layout classes.+ _yuitest_coverline("build/charts-base/charts-base.js", 2042);+for(i in defaultMargins)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2044);+if(defaultMargins.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2046);+label[i] = label[i] === undefined ? defaultMargins[i] : label[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 2047);+title[i] = title[i] === undefined ? defaultMargins[i] : title[i];+ }+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2051);+this._drawAxis();+ },++ /**+ * Creates a graphic instance to be used for the axis line and ticks.+ *+ * @method _setCanvas+ * @private+ */+ _setCanvas: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setCanvas", 2060);+_yuitest_coverline("build/charts-base/charts-base.js", 2062);+var cb = this.get("contentBox"),+ bb = this.get("boundingBox"),+ p = this.get("position"),+ pn = this._parentNode,+ w = this.get("width"),+ h = this.get("height");+ _yuitest_coverline("build/charts-base/charts-base.js", 2068);+bb.setStyle("position", "absolute");+ _yuitest_coverline("build/charts-base/charts-base.js", 2069);+bb.setStyle("zIndex", 2);+ _yuitest_coverline("build/charts-base/charts-base.js", 2070);+w = w ? w + "px" : pn.getStyle("width");+ _yuitest_coverline("build/charts-base/charts-base.js", 2071);+h = h ? h + "px" : pn.getStyle("height");+ _yuitest_coverline("build/charts-base/charts-base.js", 2072);+if(p === "top" || p === "bottom")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2074);+cb.setStyle("width", w);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2078);+cb.setStyle("height", h);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2080);+cb.setStyle("position", "relative");+ _yuitest_coverline("build/charts-base/charts-base.js", 2081);+cb.setStyle("left", "0px");+ _yuitest_coverline("build/charts-base/charts-base.js", 2082);+cb.setStyle("top", "0px");+ _yuitest_coverline("build/charts-base/charts-base.js", 2083);+this.set("graphic", new Y.Graphic());+ _yuitest_coverline("build/charts-base/charts-base.js", 2084);+this.get("graphic").render(cb);+ },+ + /**+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ * @protected+ */+ _getDefaultStyles: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultStyles", 2095);+_yuitest_coverline("build/charts-base/charts-base.js", 2097);+var axisstyles = {+ majorTicks: {+ display:"inside",+ length:4,+ color:"#dad8c9",+ weight:1,+ alpha:1+ },+ minorTicks: {+ display:"none",+ length:2,+ color:"#dad8c9",+ weight:1+ },+ line: {+ weight:1,+ color:"#dad8c9",+ alpha:1+ },+ majorUnit: {+ determinant:"count",+ count:11,+ distance:75+ },+ top: "0px",+ left: "0px",+ width: "100px",+ height: "100px",+ label: {+ color:"#808080",+ alpha: 1,+ fontSize:"85%",+ rotation: 0,+ margin: {+ top: undefined,+ right: undefined,+ bottom: undefined,+ left: undefined+ }+ },+ title: {+ color:"#808080",+ alpha: 1,+ fontSize:"85%",+ rotation: undefined,+ margin: {+ top: undefined,+ right: undefined,+ bottom: undefined,+ left: undefined+ }+ },+ hideOverlappingLabelTicks: false+ };+ + _yuitest_coverline("build/charts-base/charts-base.js", 2152);+return Y.merge(Y.Renderer.prototype._getDefaultStyles(), axisstyles); + },++ /**+ * Updates the axis when the size changes.+ *+ * @method _handleSizeChange+ * @param {Object} e Event object.+ * @private+ */+ _handleSizeChange: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_handleSizeChange", 2162);+_yuitest_coverline("build/charts-base/charts-base.js", 2164);+var attrName = e.attrName,+ pos = this.get("position"),+ vert = pos == "left" || pos == "right",+ cb = this.get("contentBox"),+ hor = pos == "bottom" || pos == "top";+ _yuitest_coverline("build/charts-base/charts-base.js", 2169);+cb.setStyle("width", this.get("width"));+ _yuitest_coverline("build/charts-base/charts-base.js", 2170);+cb.setStyle("height", this.get("height"));+ _yuitest_coverline("build/charts-base/charts-base.js", 2171);+if((hor && attrName == "width") || (vert && attrName == "height"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2173);+this._drawAxis();+ }+ },+ + /**+ * Maps key values to classes containing layout algorithms+ *+ * @property _layoutClasses+ * @type Object+ * @private+ */+ _layoutClasses: + {+ top : TopAxisLayout,+ bottom: BottomAxisLayout,+ left: LeftAxisLayout,+ right : RightAxisLayout+ },+ + /**+ * Draws a line segment between 2 points+ *+ * @method drawLine+ * @param {Object} startPoint x and y coordinates for the start point of the line segment+ * @param {Object} endPoint x and y coordinates for the for the end point of the line segment+ * @param {Object} line styles (weight, color and alpha to be applied to the line segment)+ * @private+ */+ drawLine: function(path, startPoint, endPoint)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawLine", 2201);+_yuitest_coverline("build/charts-base/charts-base.js", 2203);+path.moveTo(startPoint.x, startPoint.y);+ _yuitest_coverline("build/charts-base/charts-base.js", 2204);+path.lineTo(endPoint.x, endPoint.y);+ },++ /**+ * Generates the properties necessary for rotating and positioning a text field.+ *+ * @method _getTextRotationProps+ * @param {Object} styles properties for the text field+ * @return Object+ * @private+ */+ _getTextRotationProps: function(styles)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getTextRotationProps", 2215);+_yuitest_coverline("build/charts-base/charts-base.js", 2217);+if(styles.rotation === undefined)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2219);+switch(this.get("position"))+ {+ case "left" :+ _yuitest_coverline("build/charts-base/charts-base.js", 2222);+styles.rotation = -90;+ _yuitest_coverline("build/charts-base/charts-base.js", 2223);+break; + case "right" : + _yuitest_coverline("build/charts-base/charts-base.js", 2225);+styles.rotation = 90;+ _yuitest_coverline("build/charts-base/charts-base.js", 2226);+break;+ default :+ _yuitest_coverline("build/charts-base/charts-base.js", 2228);+styles.rotation = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 2229);+break;+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2232);+var rot = Math.min(90, Math.max(-90, styles.rotation)),+ absRot = Math.abs(rot),+ radCon = Math.PI/180,+ sinRadians = parseFloat(parseFloat(Math.sin(absRot * radCon)).toFixed(8)),+ cosRadians = parseFloat(parseFloat(Math.cos(absRot * radCon)).toFixed(8));+ _yuitest_coverline("build/charts-base/charts-base.js", 2237);+return {+ rot: rot,+ absRot: absRot,+ radCon: radCon,+ sinRadians: sinRadians,+ cosRadians: cosRadians,+ textAlpha: styles.alpha+ };+ },++ /**+ * Draws an axis. + *+ * @method _drawAxis+ * @private+ */+ _drawAxis: function ()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_drawAxis", 2253);+_yuitest_coverline("build/charts-base/charts-base.js", 2255);+if(this._drawing)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2257);+this._callLater = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 2258);+return;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2260);+this._drawing = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 2261);+this._callLater = false;+ _yuitest_coverline("build/charts-base/charts-base.js", 2262);+if(this._layout)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2264);+var styles = this.get("styles"),+ line = styles.line,+ labelStyles = styles.label,+ majorTickStyles = styles.majorTicks,+ drawTicks = majorTickStyles.display != "none",+ tickPoint,+ majorUnit = styles.majorUnit,+ len,+ majorUnitDistance,+ i = 0,+ layout = this._layout,+ layoutLength,+ position,+ lineStart,+ label,+ labelWidth,+ labelHeight,+ labelFunction = this.get("labelFunction"),+ labelFunctionScope = this.get("labelFunctionScope"),+ labelFormat = this.get("labelFormat"),+ graphic = this.get("graphic"),+ path = this.get("path"),+ tickPath,+ explicitlySized;+ _yuitest_coverline("build/charts-base/charts-base.js", 2288);+this._labelWidths = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 2289);+this._labelHeights = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 2290);+graphic.set("autoDraw", false);+ _yuitest_coverline("build/charts-base/charts-base.js", 2291);+path.clear();+ _yuitest_coverline("build/charts-base/charts-base.js", 2292);+path.set("stroke", {+ weight: line.weight, + color: line.color, + opacity: line.alpha+ });+ _yuitest_coverline("build/charts-base/charts-base.js", 2297);+this._labelRotationProps = this._getTextRotationProps(labelStyles);+ _yuitest_coverline("build/charts-base/charts-base.js", 2298);+this._labelRotationProps.transformOrigin = layout._getTransformOrigin(this._labelRotationProps.rot);+ _yuitest_coverline("build/charts-base/charts-base.js", 2299);+layout.setTickOffsets.apply(this);+ _yuitest_coverline("build/charts-base/charts-base.js", 2300);+layoutLength = this.getLength();+ _yuitest_coverline("build/charts-base/charts-base.js", 2301);+lineStart = layout.getLineStart.apply(this);+ _yuitest_coverline("build/charts-base/charts-base.js", 2302);+len = this.getTotalMajorUnits(majorUnit);+ _yuitest_coverline("build/charts-base/charts-base.js", 2303);+majorUnitDistance = this.getMajorUnitDistance(len, layoutLength, majorUnit);+ _yuitest_coverline("build/charts-base/charts-base.js", 2304);+this.set("edgeOffset", this.getEdgeOffset(len, layoutLength) * 0.5);+ _yuitest_coverline("build/charts-base/charts-base.js", 2305);+if(len < 1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2307);+this._clearLabelCache();+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2311);+tickPoint = this.getFirstPoint(lineStart);+ _yuitest_coverline("build/charts-base/charts-base.js", 2312);+this.drawLine(path, lineStart, this.getLineEnd(tickPoint));+ _yuitest_coverline("build/charts-base/charts-base.js", 2313);+if(drawTicks) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 2315);+tickPath = this.get("tickPath");+ _yuitest_coverline("build/charts-base/charts-base.js", 2316);+tickPath.clear();+ _yuitest_coverline("build/charts-base/charts-base.js", 2317);+tickPath.set("stroke", {+ weight: majorTickStyles.weight,+ color: majorTickStyles.color,+ opacity: majorTickStyles.alpha+ });+ _yuitest_coverline("build/charts-base/charts-base.js", 2322);+layout.drawTick.apply(this, [tickPath, tickPoint, majorTickStyles]);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2324);+this._createLabelCache();+ _yuitest_coverline("build/charts-base/charts-base.js", 2325);+this._tickPoints = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 2326);+this._maxLabelSize = 0; + _yuitest_coverline("build/charts-base/charts-base.js", 2327);+this._totalTitleSize = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 2328);+this._titleSize = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 2329);+this._setTitle();+ _yuitest_coverline("build/charts-base/charts-base.js", 2330);+explicitlySized = layout.getExplicitlySized.apply(this, [styles]);+ _yuitest_coverline("build/charts-base/charts-base.js", 2331);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2333);+if(drawTicks) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 2335);+layout.drawTick.apply(this, [tickPath, tickPoint, majorTickStyles]);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2337);+position = this.getPosition(tickPoint);+ _yuitest_coverline("build/charts-base/charts-base.js", 2338);+label = this.getLabel(tickPoint, labelStyles);+ _yuitest_coverline("build/charts-base/charts-base.js", 2339);+this._labels.push(label);+ _yuitest_coverline("build/charts-base/charts-base.js", 2340);+this._tickPoints.push({x:tickPoint.x, y:tickPoint.y});+ _yuitest_coverline("build/charts-base/charts-base.js", 2341);+this.get("appendLabelFunction")(label, labelFunction.apply(labelFunctionScope, [this.getLabelByIndex(i, len), labelFormat]));+ _yuitest_coverline("build/charts-base/charts-base.js", 2342);+labelWidth = Math.round(label.offsetWidth);+ _yuitest_coverline("build/charts-base/charts-base.js", 2343);+labelHeight = Math.round(label.offsetHeight);+ _yuitest_coverline("build/charts-base/charts-base.js", 2344);+if(!explicitlySized)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2346);+this._layout.updateMaxLabelSize.apply(this, [labelWidth, labelHeight]);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2348);+this._labelWidths.push(labelWidth);+ _yuitest_coverline("build/charts-base/charts-base.js", 2349);+this._labelHeights.push(labelHeight);+ _yuitest_coverline("build/charts-base/charts-base.js", 2350);+tickPoint = this.getNextPoint(tickPoint, majorUnitDistance);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2352);+this._clearLabelCache();+ _yuitest_coverline("build/charts-base/charts-base.js", 2353);+if(this.get("overlapGraph"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2355);+layout.offsetNodeForTick.apply(this, [this.get("contentBox")]);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2357);+layout.setCalculatedSize.apply(this);+ _yuitest_coverline("build/charts-base/charts-base.js", 2358);+if(this._titleTextField)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2360);+this._layout.positionTitle.apply(this, [this._titleTextField]);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2362);+for(i = 0; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2364);+layout.positionLabel.apply(this, [this.get("labels")[i], this._tickPoints[i], styles, i]);+ }+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2368);+this._drawing = false;+ _yuitest_coverline("build/charts-base/charts-base.js", 2369);+if(this._callLater)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2371);+this._drawAxis();+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2375);+this._updatePathElement();+ _yuitest_coverline("build/charts-base/charts-base.js", 2376);+this.fire("axisRendered");+ }+ },+ + /**+ * Calculates and sets the total size of a title.+ *+ * @method _setTotalTitleSize+ * @param {Object} styles Properties for the title field.+ * @private+ */+ _setTotalTitleSize: function(styles)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setTotalTitleSize", 2387);+_yuitest_coverline("build/charts-base/charts-base.js", 2389);+var title = this._titleTextField,+ w = title.offsetWidth,+ h = title.offsetHeight,+ rot = this._titleRotationProps.rot,+ bounds,+ size,+ margin = styles.margin,+ position = this.get("position"),+ matrix = new Y.Matrix();+ _yuitest_coverline("build/charts-base/charts-base.js", 2398);+matrix.rotate(rot);+ _yuitest_coverline("build/charts-base/charts-base.js", 2399);+bounds = matrix.getContentRect(w, h);+ _yuitest_coverline("build/charts-base/charts-base.js", 2400);+if(position == "left" || position == "right")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2402);+size = bounds.right - bounds.left;+ _yuitest_coverline("build/charts-base/charts-base.js", 2403);+if(margin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2405);+size += margin.left + margin.right;+ }+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2410);+size = bounds.bottom - bounds.top;+ _yuitest_coverline("build/charts-base/charts-base.js", 2411);+if(margin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2413);+size += margin.top + margin.bottom;+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2416);+this._titleBounds = bounds;+ _yuitest_coverline("build/charts-base/charts-base.js", 2417);+this._totalTitleSize = size;+ },++ /**+ * Updates path.+ *+ * @method _updatePathElement+ * @private+ */+ _updatePathElement: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_updatePathElement", 2426);+_yuitest_coverline("build/charts-base/charts-base.js", 2428);+var path = this._path,+ tickPath = this._tickPath,+ redrawGraphic = false,+ graphic = this.get("graphic");+ _yuitest_coverline("build/charts-base/charts-base.js", 2432);+if(path)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2434);+redrawGraphic = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 2435);+path.end();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2437);+if(tickPath)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2439);+redrawGraphic = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 2440);+tickPath.end();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2442);+if(redrawGraphic)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2444);+graphic._redraw();+ }+ },++ /**+ * Updates the content and style properties for a title field.+ *+ * @method _updateTitle+ * @private+ */+ _setTitle: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setTitle", 2454);+_yuitest_coverline("build/charts-base/charts-base.js", 2456);+var i,+ styles,+ customStyles,+ title = this.get("title"),+ titleTextField = this._titleTextField,+ parentNode;+ _yuitest_coverline("build/charts-base/charts-base.js", 2462);+if(title !== null && title !== undefined)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2464);+customStyles = {+ rotation: "rotation",+ margin: "margin",+ alpha: "alpha"+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 2469);+styles = this.get("styles").title;+ _yuitest_coverline("build/charts-base/charts-base.js", 2470);+if(!titleTextField)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2472);+titleTextField = DOCUMENT.createElement('span');+ _yuitest_coverline("build/charts-base/charts-base.js", 2473);+titleTextField.style.display = "block";+ _yuitest_coverline("build/charts-base/charts-base.js", 2474);+titleTextField.style.whiteSpace = "nowrap";+ _yuitest_coverline("build/charts-base/charts-base.js", 2475);+titleTextField.setAttribute("class", "axisTitle");+ _yuitest_coverline("build/charts-base/charts-base.js", 2476);+this.get("contentBox").append(titleTextField);+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 2478);+if(!DOCUMENT.createElementNS)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2480);+if(titleTextField.style.filter)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2482);+titleTextField.style.filter = null;+ }+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 2485);+titleTextField.style.position = "absolute";+ _yuitest_coverline("build/charts-base/charts-base.js", 2486);+for(i in styles)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2488);+if(styles.hasOwnProperty(i) && !customStyles.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2490);+titleTextField.style[i] = styles[i];+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2493);+this.get("appendTitleFunction")(titleTextField, title);+ _yuitest_coverline("build/charts-base/charts-base.js", 2494);+this._titleTextField = titleTextField;+ _yuitest_coverline("build/charts-base/charts-base.js", 2495);+this._titleRotationProps = this._getTextRotationProps(styles);+ _yuitest_coverline("build/charts-base/charts-base.js", 2496);+this._setTotalTitleSize(styles);+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 2498);+if(titleTextField)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2500);+parentNode = titleTextField.parentNode;+ _yuitest_coverline("build/charts-base/charts-base.js", 2501);+if(parentNode)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2503);+parentNode.removeChild(titleTextField);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2505);+this._titleTextField = null;+ _yuitest_coverline("build/charts-base/charts-base.js", 2506);+this._totalTitleSize = 0;+ }}+ },++ /**+ * Creates or updates an axis label.+ *+ * @method getLabel+ * @param {Object} pt x and y coordinates for the label+ * @param {Object} styles styles applied to label+ * @return HTMLElement + * @private+ */+ getLabel: function(pt, styles)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getLabel", 2519);+_yuitest_coverline("build/charts-base/charts-base.js", 2521);+var i,+ label,+ labelCache = this._labelCache,+ customStyles = {+ rotation: "rotation",+ margin: "margin",+ alpha: "alpha"+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 2529);+if(labelCache && labelCache.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2531);+label = labelCache.shift();+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2535);+label = DOCUMENT.createElement("span");+ _yuitest_coverline("build/charts-base/charts-base.js", 2536);+label.className = Y.Lang.trim([label.className, "axisLabel"].join(' '));+ _yuitest_coverline("build/charts-base/charts-base.js", 2537);+this.get("contentBox").append(label);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2539);+if(!DOCUMENT.createElementNS)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2541);+if(label.style.filter)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2543);+label.style.filter = null;+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2546);+label.style.display = "block";+ _yuitest_coverline("build/charts-base/charts-base.js", 2547);+label.style.whiteSpace = "nowrap";+ _yuitest_coverline("build/charts-base/charts-base.js", 2548);+label.style.position = "absolute";+ _yuitest_coverline("build/charts-base/charts-base.js", 2549);+for(i in styles)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2551);+if(styles.hasOwnProperty(i) && !customStyles.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2553);+label.style[i] = styles[i];+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2556);+return label;+ },++ /**+ * Creates a cache of labels that can be re-used when the axis redraws.+ *+ * @method _createLabelCache+ * @private+ */+ _createLabelCache: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_createLabelCache", 2565);+_yuitest_coverline("build/charts-base/charts-base.js", 2567);+if(this._labels)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2569);+while(this._labels.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2571);+this._labelCache.push(this._labels.shift());+ }+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2576);+this._clearLabelCache();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2578);+this._labels = [];+ },+ + /**+ * Removes axis labels from the dom and clears the label cache.+ *+ * @method _clearLabelCache+ * @private+ */+ _clearLabelCache: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_clearLabelCache", 2587);+_yuitest_coverline("build/charts-base/charts-base.js", 2589);+if(this._labelCache)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2591);+var len = this._labelCache.length,+ i = 0,+ label;+ _yuitest_coverline("build/charts-base/charts-base.js", 2594);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2596);+label = this._labelCache[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 2597);+this._removeChildren(label);+ _yuitest_coverline("build/charts-base/charts-base.js", 2598);+Y.Event.purgeElement(label, true);+ _yuitest_coverline("build/charts-base/charts-base.js", 2599);+label.parentNode.removeChild(label);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2602);+this._labelCache = [];+ },++ /**+ * Gets the end point of an axis.+ *+ * @method getLineEnd+ * @return Object+ * @private + */+ getLineEnd: function(pt)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getLineEnd", 2612);+_yuitest_coverline("build/charts-base/charts-base.js", 2614);+var w = this.get("width"),+ h = this.get("height"),+ pos = this.get("position");+ _yuitest_coverline("build/charts-base/charts-base.js", 2617);+if(pos === "top" || pos === "bottom")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2619);+return {x:w, y:pt.y};+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2623);+return {x:pt.x, y:h};+ }+ },++ /**+ * Calcuates the width or height of an axis depending on its direction.+ *+ * @method getLength+ * @return Number+ * @private+ */+ getLength: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getLength", 2634);+_yuitest_coverline("build/charts-base/charts-base.js", 2636);+var l,+ style = this.get("styles"),+ padding = style.padding,+ w = this.get("width"),+ h = this.get("height"),+ pos = this.get("position");+ _yuitest_coverline("build/charts-base/charts-base.js", 2642);+if(pos === "top" || pos === "bottom")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2644);+l = w - (padding.left + padding.right);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2648);+l = h - (padding.top + padding.bottom);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2650);+return l;+ },++ /**+ * Gets the position of the first point on an axis.+ *+ * @method getFirstPoint+ * @param {Object} pt Object containing x and y coordinates.+ * @return Object+ * @private+ */+ getFirstPoint:function(pt)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getFirstPoint", 2661);+_yuitest_coverline("build/charts-base/charts-base.js", 2663);+var style = this.get("styles"),+ pos = this.get("position"),+ padding = style.padding,+ np = {x:pt.x, y:pt.y};+ _yuitest_coverline("build/charts-base/charts-base.js", 2667);+if(pos === "top" || pos === "bottom")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2669);+np.x += padding.left + this.get("edgeOffset");+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2673);+np.y += this.get("height") - (padding.top + this.get("edgeOffset"));+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2675);+return np;+ },++ /**+ * Gets the position of the next point on an axis.+ *+ * @method getNextPoint+ * @param {Object} point Object containing x and y coordinates.+ * @param {Number} majorUnitDistance Distance in pixels between ticks.+ * @return Object+ * @private+ */+ getNextPoint: function(point, majorUnitDistance)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getNextPoint", 2687);+_yuitest_coverline("build/charts-base/charts-base.js", 2689);+var pos = this.get("position");+ _yuitest_coverline("build/charts-base/charts-base.js", 2690);+if(pos === "top" || pos === "bottom")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2692);+point.x = point.x + majorUnitDistance; + }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2696);+point.y = point.y - majorUnitDistance;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2698);+return point;+ },++ /**+ * Calculates the placement of last tick on an axis.+ *+ * @method getLastPoint+ * @return Object+ * @private + */+ getLastPoint: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getLastPoint", 2708);+_yuitest_coverline("build/charts-base/charts-base.js", 2710);+var style = this.get("styles"),+ padding = style.padding,+ w = this.get("width"),+ pos = this.get("position");+ _yuitest_coverline("build/charts-base/charts-base.js", 2714);+if(pos === "top" || pos === "bottom")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2716);+return {x:w - padding.right, y:padding.top};+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2720);+return {x:padding.left, y:padding.top};+ }+ },++ /**+ * Calculates position on the axis.+ *+ * @method getPosition+ * @param {Object} point contains x and y values+ * @private + */+ getPosition: function(point)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getPosition", 2731);+_yuitest_coverline("build/charts-base/charts-base.js", 2733);+var p,+ h = this.get("height"),+ style = this.get("styles"),+ padding = style.padding,+ pos = this.get("position"),+ dataType = this.get("dataType");+ _yuitest_coverline("build/charts-base/charts-base.js", 2739);+if(pos === "left" || pos === "right") + {+ //Numeric data on a vertical axis is displayed from bottom to top.+ //Categorical and Timeline data is displayed from top to bottom.+ _yuitest_coverline("build/charts-base/charts-base.js", 2743);+if(dataType === "numeric")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2745);+p = (h - (padding.top + padding.bottom)) - (point.y - padding.top);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2749);+p = point.y - padding.top;+ }+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2754);+p = point.x - padding.left;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2756);+return p;+ },++ /**+ * Rotates and positions a text field.+ *+ * @method _rotate+ * @param {HTMLElement} label text field to rotate and position+ * @param {Object} props properties to be applied to the text field. + * @private+ */+ _rotate: function(label, props)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_rotate", 2767);+_yuitest_coverline("build/charts-base/charts-base.js", 2769);+var rot = props.rot,+ x = props.x,+ y = props.y,+ filterString,+ textAlpha,+ matrix = new Y.Matrix(),+ transformOrigin = props.transformOrigin || [0, 0],+ offsetRect;+ _yuitest_coverline("build/charts-base/charts-base.js", 2777);+if(DOCUMENT.createElementNS)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2779);+matrix.translate(x, y);+ _yuitest_coverline("build/charts-base/charts-base.js", 2780);+matrix.rotate(rot);+ _yuitest_coverline("build/charts-base/charts-base.js", 2781);+Y_DOM.setStyle(label, "transformOrigin", (transformOrigin[0] * 100) + "% " + (transformOrigin[1] * 100) + "%");+ _yuitest_coverline("build/charts-base/charts-base.js", 2782);+Y_DOM.setStyle(label, "transform", matrix.toCSSText());+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2786);+textAlpha = props.textAlpha;+ _yuitest_coverline("build/charts-base/charts-base.js", 2787);+if(Y_Lang.isNumber(textAlpha) && textAlpha < 1 && textAlpha > -1 && !isNaN(textAlpha))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2789);+filterString = "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + Math.round(textAlpha * 100) + ")";+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2791);+if(rot !== 0)+ {+ //ms filters kind of, sort of uses a transformOrigin of 0, 0. + //we'll translate the difference to create a true 0, 0 origin.+ _yuitest_coverline("build/charts-base/charts-base.js", 2795);+matrix.rotate(rot);+ _yuitest_coverline("build/charts-base/charts-base.js", 2796);+offsetRect = matrix.getContentRect(props.labelWidth, props.labelHeight);+ _yuitest_coverline("build/charts-base/charts-base.js", 2797);+matrix.init();+ _yuitest_coverline("build/charts-base/charts-base.js", 2798);+matrix.translate(offsetRect.left, offsetRect.top);+ _yuitest_coverline("build/charts-base/charts-base.js", 2799);+matrix.translate(x, y);+ _yuitest_coverline("build/charts-base/charts-base.js", 2800);+this._simulateRotateWithTransformOrigin(matrix, rot, transformOrigin, props.labelWidth, props.labelHeight);+ _yuitest_coverline("build/charts-base/charts-base.js", 2801);+if(filterString)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2803);+filterString += " ";+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2807);+filterString = ""; + }+ _yuitest_coverline("build/charts-base/charts-base.js", 2809);+filterString += matrix.toFilterText();+ _yuitest_coverline("build/charts-base/charts-base.js", 2810);+label.style.left = matrix.dx + "px";+ _yuitest_coverline("build/charts-base/charts-base.js", 2811);+label.style.top = matrix.dy + "px";+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2815);+label.style.left = x + "px";+ _yuitest_coverline("build/charts-base/charts-base.js", 2816);+label.style.top = y + "px";+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2818);+if(filterString)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2820);+label.style.filter = filterString;+ }+ }+ },+ + /**+ * Simulates a rotation with a specified transformOrigin. + *+ * @method _simulateTransformOrigin+ * @param {Matrix} matrix Reference to a `Matrix` instance.+ * @param {Number} rot The rotation (in degrees) that will be performed on a matrix.+ * @param {Array} transformOrigin An array represeniting the origin in which to perform the transform. The first + * index represents the x origin and the second index represents the y origin.+ * @param {Number} w The width of the object that will be transformed.+ * @param {Number} h The height of the object that will be transformed.+ * @private+ */+ _simulateRotateWithTransformOrigin: function(matrix, rot, transformOrigin, w, h)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_simulateRotateWithTransformOrigin", 2837);+_yuitest_coverline("build/charts-base/charts-base.js", 2839);+var transformX = transformOrigin[0] * w,+ transformY = transformOrigin[1] * h;+ _yuitest_coverline("build/charts-base/charts-base.js", 2841);+transformX = !isNaN(transformX) ? transformX : 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 2842);+transformY = !isNaN(transformY) ? transformY : 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 2843);+matrix.translate(transformX, transformY);+ _yuitest_coverline("build/charts-base/charts-base.js", 2844);+matrix.rotate(rot);+ _yuitest_coverline("build/charts-base/charts-base.js", 2845);+matrix.translate(-transformX, -transformY);+ },++ /**+ * Returns the coordinates (top, right, bottom, left) for the bounding box of the last label. + *+ * @method getMaxLabelBounds+ * @return Object+ */+ getMaxLabelBounds: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getMaxLabelBounds", 2854);+_yuitest_coverline("build/charts-base/charts-base.js", 2856);+return this._getLabelBounds(this.getMaximumValue());+ },++ /**+ * Returns the coordinates (top, right, bottom, left) for the bounding box of the first label. + *+ * @method getMinLabelBounds+ * @return Object+ */+ getMinLabelBounds: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getMinLabelBounds", 2865);+_yuitest_coverline("build/charts-base/charts-base.js", 2867);+return this._getLabelBounds(this.getMinimumValue());+ },+ + /**+ * Returns the coordinates (top, right, bottom, left) for the bounding box of a label. + *+ * @method _getLabelBounds+ * @param {String} Value of the label+ * @return Object+ * @private+ */+ _getLabelBounds: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getLabelBounds", 2878);+_yuitest_coverline("build/charts-base/charts-base.js", 2880);+var layout = this._layout,+ labelStyles = this.get("styles").label,+ matrix = new Y.Matrix(),+ label,+ props = this._getTextRotationProps(labelStyles);+ _yuitest_coverline("build/charts-base/charts-base.js", 2885);+props.transformOrigin = layout._getTransformOrigin(props.rot);+ _yuitest_coverline("build/charts-base/charts-base.js", 2886);+label = this.getLabel({x: 0, y: 0}, labelStyles);+ _yuitest_coverline("build/charts-base/charts-base.js", 2887);+this.get("appendLabelFunction")(label, this.get("labelFunction").apply(this, [val, this.get("labelFormat")]));+ _yuitest_coverline("build/charts-base/charts-base.js", 2888);+props.labelWidth = label.offsetWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 2889);+props.labelHeight = label.offsetHeight;+ _yuitest_coverline("build/charts-base/charts-base.js", 2890);+this._removeChildren(label);+ _yuitest_coverline("build/charts-base/charts-base.js", 2891);+Y.Event.purgeElement(label, true);+ _yuitest_coverline("build/charts-base/charts-base.js", 2892);+label.parentNode.removeChild(label);+ _yuitest_coverline("build/charts-base/charts-base.js", 2893);+props.x = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 2894);+props.y = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 2895);+layout._setRotationCoords(props);+ _yuitest_coverline("build/charts-base/charts-base.js", 2896);+matrix.translate(props.x, props.y);+ _yuitest_coverline("build/charts-base/charts-base.js", 2897);+this._simulateRotateWithTransformOrigin(matrix, props.rot, props.transformOrigin, props.labelWidth, props.labelHeight);+ _yuitest_coverline("build/charts-base/charts-base.js", 2898);+return matrix.getContentRect(props.labelWidth, props.labelHeight);+ },++ /**+ * Removes all DOM elements from an HTML element. Used to clear out labels during detruction+ * phase.+ *+ * @method _removeChildren+ * @private+ */+ _removeChildren: function(node)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_removeChildren", 2908);+_yuitest_coverline("build/charts-base/charts-base.js", 2910);+if(node.hasChildNodes())+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2912);+var child;+ _yuitest_coverline("build/charts-base/charts-base.js", 2913);+while(node.firstChild)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2915);+child = node.firstChild;+ _yuitest_coverline("build/charts-base/charts-base.js", 2916);+this._removeChildren(child);+ _yuitest_coverline("build/charts-base/charts-base.js", 2917);+node.removeChild(child);+ }+ }+ },+ + /**+ * Destructor implementation Axis class. Removes all labels and the Graphic instance from the widget.+ *+ * @method destructor+ * @protected+ */+ destructor: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "destructor", 2928);+_yuitest_coverline("build/charts-base/charts-base.js", 2930);+var cb = this.get("contentBox").getDOMNode(),+ labels = this.get("labels"),+ graphic = this.get("graphic"),+ label,+ len = labels ? labels.length : 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 2935);+if(len > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2937);+while(labels.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2939);+label = labels.shift();+ _yuitest_coverline("build/charts-base/charts-base.js", 2940);+this._removeChildren(label);+ _yuitest_coverline("build/charts-base/charts-base.js", 2941);+cb.removeChild(label);+ _yuitest_coverline("build/charts-base/charts-base.js", 2942);+label = null;+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2945);+if(graphic)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2947);+graphic.destroy();+ }+ },++ /**+ * Length in pixels of largest text bounding box. Used to calculate the height of the axis.+ *+ * @property maxLabelSize+ * @type Number+ * @protected+ */+ _maxLabelSize: 0,+ + /**+ * Updates the content of text field. This method writes a value into a text field using + * `appendChild`. If the value is a `String`, it is converted to a `TextNode` first. + *+ * @method _setText+ * @param label {HTMLElement} label to be updated+ * @param val {String} value with which to update the label+ * @private+ */+ _setText: function(textField, val)+ { + _yuitest_coverfunc("build/charts-base/charts-base.js", "_setText", 2969);+_yuitest_coverline("build/charts-base/charts-base.js", 2971);+textField.innerHTML = "";+ _yuitest_coverline("build/charts-base/charts-base.js", 2972);+if(Y_Lang.isNumber(val))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2974);+val = val + "";+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 2976);+if(!val)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2978);+val = "";+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 2980);+if(IS_STRING(val))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 2982);+val = DOCUMENT.createTextNode(val);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 2984);+textField.appendChild(val);+ }+}, {+ ATTRS: + {+ /**+ * When set, defines the width of a vertical axis instance. By default, vertical axes automatically size based on their contents. When the+ * width attribute is set, the axis will not calculate its width. When the width attribute is explicitly set, axis labels will postion themselves off of the + * the inner edge of the axis and the title, if present, will position itself off of the outer edge. If a specified width is less than the sum of + * the axis' contents, excess content will overflow.+ *+ * @attribute width+ * @type Number+ */+ width: {+ lazyAdd: false,++ getter: function() + {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 3001);+_yuitest_coverline("build/charts-base/charts-base.js", 3003);+if(this._explicitWidth)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3005);+return this._explicitWidth; + }+ _yuitest_coverline("build/charts-base/charts-base.js", 3007);+return this._calculatedWidth;+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 3010);+_yuitest_coverline("build/charts-base/charts-base.js", 3012);+this._explicitWidth = val;+ _yuitest_coverline("build/charts-base/charts-base.js", 3013);+return val;+ }+ },++ /**+ * When set, defines the height of a horizontal axis instance. By default, horizontal axes automatically size based on their contents. When the+ * height attribute is set, the axis will not calculate its height. When the height attribute is explicitly set, axis labels will postion themselves off of the + * the inner edge of the axis and the title, if present, will position itself off of the outer edge. If a specified height is less than the sum of + * the axis' contents, excess content will overflow.+ *+ * @attribute height+ * @type Number+ */+ height: {+ lazyAdd: false,++ getter: function() + {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 3029);+_yuitest_coverline("build/charts-base/charts-base.js", 3031);+if(this._explicitHeight)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3033);+return this._explicitHeight; + }+ _yuitest_coverline("build/charts-base/charts-base.js", 3035);+return this._calculatedHeight;+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 3038);+_yuitest_coverline("build/charts-base/charts-base.js", 3040);+this._explicitHeight = val;+ _yuitest_coverline("build/charts-base/charts-base.js", 3041);+return val;+ }+ },++ /**+ * Calculated value of an axis' width. By default, the value is used internally for vertical axes. If the `width` attribute is explicitly set, this value will be ignored.+ *+ * @attribute calculatedWidth+ * @type Number+ * @private+ */+ calculatedWidth: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 3053);+_yuitest_coverline("build/charts-base/charts-base.js", 3055);+return this._calculatedWidth;+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 3058);+_yuitest_coverline("build/charts-base/charts-base.js", 3060);+this._calculatedWidth = val;+ _yuitest_coverline("build/charts-base/charts-base.js", 3061);+return val;+ }+ },++ /**+ * Calculated value of an axis' height. By default, the value is used internally for horizontal axes. If the `height` attribute is explicitly set, this value will be ignored.+ *+ * @attribute calculatedHeight+ * @type Number+ * @private+ */+ calculatedHeight: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 3073);+_yuitest_coverline("build/charts-base/charts-base.js", 3075);+return this._calculatedHeight;+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 3078);+_yuitest_coverline("build/charts-base/charts-base.js", 3080);+this._calculatedHeight = val;+ _yuitest_coverline("build/charts-base/charts-base.js", 3081);+return val;+ }+ },++ /**+ * Difference betweend the first/last tick and edge of axis.+ *+ * @attribute edgeOffset+ * @type Number+ * @protected+ */+ edgeOffset: + {+ value: 0+ },++ /**+ * The graphic in which the axis line and ticks will be rendered.+ *+ * @attribute graphic+ * @type Graphic+ */+ graphic: {},+ + /**+ * @attribute path+ * @type Shape+ * @readOnly+ * @private+ */+ path: {+ readOnly: true,++ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 3114);+_yuitest_coverline("build/charts-base/charts-base.js", 3116);+if(!this._path)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3118);+var graphic = this.get("graphic");+ _yuitest_coverline("build/charts-base/charts-base.js", 3119);+if(graphic)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3121);+this._path = graphic.addShape({type:"path"});+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 3124);+return this._path;+ }+ },++ /**+ * @attribute tickPath+ * @type Shape+ * @readOnly+ * @private+ */+ tickPath: {+ readOnly: true,++ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 3137);+_yuitest_coverline("build/charts-base/charts-base.js", 3139);+if(!this._tickPath)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3141);+var graphic = this.get("graphic");+ _yuitest_coverline("build/charts-base/charts-base.js", 3142);+if(graphic)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3144);+this._tickPath = graphic.addShape({type:"path"});+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 3147);+return this._tickPath;+ }+ },+ + /**+ * Contains the contents of the axis. + *+ * @attribute node+ * @type HTMLElement+ */+ node: {},++ /**+ * Direction of the axis.+ *+ * @attribute position+ * @type String+ */+ position: {+ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 3166);+_yuitest_coverline("build/charts-base/charts-base.js", 3168);+var layoutClass = this._layoutClasses[val];+ _yuitest_coverline("build/charts-base/charts-base.js", 3169);+if(val && val != "none")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3171);+this._layout = new layoutClass();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 3173);+return val;+ }+ },++ /**+ * Distance determined by the tick styles used to calculate the distance between the axis+ * line in relation to the top of the axis.+ *+ * @attribute topTickOffset+ * @type Number+ */+ topTickOffset: {+ value: 0+ },++ /**+ * Distance determined by the tick styles used to calculate the distance between the axis+ * line in relation to the bottom of the axis.+ *+ * @attribute bottomTickOffset+ * @type Number+ */+ bottomTickOffset: {+ value: 0+ },++ /**+ * Distance determined by the tick styles used to calculate the distance between the axis+ * line in relation to the left of the axis.+ *+ * @attribute leftTickOffset+ * @type Number+ */+ leftTickOffset: {+ value: 0+ },++ /**+ * Distance determined by the tick styles used to calculate the distance between the axis+ * line in relation to the right side of the axis.+ *+ * @attribute rightTickOffset+ * @type Number+ */+ rightTickOffset: {+ value: 0+ },+ + /**+ * Collection of labels used to render the axis.+ *+ * @attribute labels+ * @type Array+ */+ labels: {+ readOnly: true,+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 3229);+_yuitest_coverline("build/charts-base/charts-base.js", 3231);+return this._labels;+ }+ },++ /**+ * Collection of points used for placement of labels and ticks along the axis.+ *+ * @attribute tickPoints+ * @type Array+ */+ tickPoints: {+ readOnly: true,++ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 3244);+_yuitest_coverline("build/charts-base/charts-base.js", 3246);+if(this.get("position") == "none")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3248);+return this.get("styles").majorUnit.count;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 3250);+return this._tickPoints;+ }+ },++ /**+ * Indicates whether the axis overlaps the graph. If an axis is the inner most axis on a given+ * position and the tick position is inside or cross, the axis will need to overlap the graph.+ *+ * @attribute overlapGraph+ * @type Boolean+ */+ overlapGraph: {+ value:true,++ validator: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "validator", 3264);+_yuitest_coverline("build/charts-base/charts-base.js", 3266);+return Y_Lang.isBoolean(val);+ }+ },++ /**+ * Object which should have by the labelFunction+ *+ * @attribute labelFunctionScope+ * @type Object+ */+ labelFunctionScope: {},+ + /**+ * Length in pixels of largest text bounding box. Used to calculate the height of the axis.+ *+ * @attribute maxLabelSize+ * @type Number+ * @protected+ */+ maxLabelSize: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 3286);+_yuitest_coverline("build/charts-base/charts-base.js", 3288);+return this._maxLabelSize;+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 3291);+_yuitest_coverline("build/charts-base/charts-base.js", 3293);+this._maxLabelSize = val;+ _yuitest_coverline("build/charts-base/charts-base.js", 3294);+return val; + }+ },+ + /**+ * Title for the axis. When specified, the title will display. The position of the title is determined by the axis position. + * <dl>+ * <dt>top</dt><dd>Appears above the axis and it labels. The default rotation is 0.</dd>+ * <dt>right</dt><dd>Appears to the right of the axis and its labels. The default rotation is 90.</dd>+ * <dt>bottom</dt><dd>Appears below the axis and its labels. The default rotation is 0.</dd>+ * <dt>left</dt><dd>Appears to the left of the axis and its labels. The default rotation is -90.</dd>+ * </dl>+ *+ * @attribute title+ * @type String+ */+ title: {+ value: null+ },+ + /**+ * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need+ * to implement the arguments below and return a `String` or `HTMLElement`. + * <dl>+ * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>+ * <dt>format</dt><dd>Template for formatting label. (optional)</dd>+ * </dl>+ *+ * @attribute labelFunction+ * @type Function+ */+ labelFunction: {+ value: function(val, format)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "value", 3326);+_yuitest_coverline("build/charts-base/charts-base.js", 3328);+return val;+ }+ },+ + /**+ * Function used to append an axis value to an axis label. This function has the following signature:+ * <dl>+ * <dt>textField</dt><dd>The axis label to be appended. (`HTMLElement`)</dd>+ * <dt>val</dt><dd>The value to attach to the text field. This method will accept an `HTMLELement`+ * or a `String`. This method does not use (`HTMLElement` | `String`)</dd>+ * </dl>+ * The default method appends a value to the `HTMLElement` using the `appendChild` method. If the given + * value is a `String`, the method will convert the the value to a `textNode` before appending to the + * `HTMLElement`. This method will not convert an `HTMLString` to an `HTMLElement`. + *+ * @attribute appendLabelFunction+ * @type Function+ */+ appendLabelFunction: {+ valueFn: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "valueFn", 3347);+_yuitest_coverline("build/charts-base/charts-base.js", 3349);+return this._setText;+ }+ },+ + /**+ * Function used to append a title value to the title object. This function has the following signature:+ * <dl>+ * <dt>textField</dt><dd>The title text field to be appended. (`HTMLElement`)</dd>+ * <dt>val</dt><dd>The value to attach to the text field. This method will accept an `HTMLELement`+ * or a `String`. This method does not use (`HTMLElement` | `String`)</dd>+ * </dl>+ * The default method appends a value to the `HTMLElement` using the `appendChild` method. If the given + * value is a `String`, the method will convert the the value to a `textNode` before appending to the + * `HTMLElement` element. This method will not convert an `HTMLString` to an `HTMLElement`. + *+ * @attribute appendTitleFunction+ * @type Function+ */+ appendTitleFunction: {+ valueFn: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "valueFn", 3368);+_yuitest_coverline("build/charts-base/charts-base.js", 3370);+return this._setText;+ }+ }+ + /**+ * Style properties used for drawing an axis. This attribute is inherited from `Renderer`. Below are the default values:+ * <dl>+ * <dt>majorTicks</dt><dd>Properties used for drawing ticks.+ * <dl>+ * <dt>display</dt><dd>Position of the tick. Possible values are `inside`, `outside`, `cross` and `none`. The+ * default value is `inside`.</dd>+ * <dt>length</dt><dd>The length (in pixels) of the tick. The default value is 4.</dd>+ * <dt>color</dt><dd>The color of the tick. The default value is `#dad8c9`</dd>+ * <dt>weight</dt><dd>Number indicating the width of the tick. The default value is 1.</dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the tick. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>line</dt><dd>Properties used for drawing the axis line. + * <dl>+ * <dt>weight</dt><dd>Number indicating the width of the axis line. The default value is 1.</dd>+ * <dt>color</dt><dd>The color of the axis line. The default value is `#dad8c9`.</dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the tick. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>majorUnit</dt><dd>Properties used to calculate the `majorUnit` for the axis. + * <dl>+ * <dt>determinant</dt><dd>The algorithm used for calculating distance between ticks. The possible options are `count` and `distance`. If+ * the `determinant` is `count`, the axis ticks will spaced so that a specified number of ticks appear on the axis. If the `determinant`+ * is `distance`, the axis ticks will spaced out according to the specified distance. The default value is `count`.</dd>+ * <dt>count</dt><dd>Number of ticks to appear on the axis when the `determinant` is `count`. The default value is 11.</dd>+ * <dt>distance</dt><dd>The distance (in pixels) between ticks when the `determinant` is `distance`. The default value is 75.</dd>+ * </dl>+ * </dd>+ * <dt>label</dt><dd>Properties and styles applied to the axis labels.+ * <dl>+ * <dt>color</dt><dd>The color of the labels. The default value is `#808080`.</dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 indicating the opacity of the labels. The default value is 1.</dd>+ * <dt>fontSize</dt><dd>The font-size of the labels. The default value is 85%</dd>+ * <dt>rotation</dt><dd>The rotation, in degrees (between -90 and 90) of the labels. The default value is 0.</dd>+ * <dt>margin</dt><dd>The distance between the label and the axis/tick. Depending on the position of the `Axis`, only one of the properties used.+ * <dl>+ * <dt>top</dt><dd>Pixel value used for an axis with a `position` of `bottom`. The default value is 4.</dd>+ * <dt>right</dt><dd>Pixel value used for an axis with a `position` of `left`. The default value is 4.</dd>+ * <dt>bottom</dt><dd>Pixel value used for an axis with a `position` of `top`. The default value is 4.</dd>+ * <dt>left</dt><dd>Pixel value used for an axis with a `position` of `right`. The default value is 4.</dd>+ * </dl>+ * </dd>+ * </dl>+ * </dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});+/**+ * AxisType is an abstract class that manages the data for an axis.+ *+ * @module charts+ * @submodule charts-base+ * @class AxisType+ * @constructor+ * @extends Axis+ */+_yuitest_coverline("build/charts-base/charts-base.js", 3435);+Y.AxisType = Y.Base.create("baseAxis", Y.Axis, [], {+ /**+ * @method initializer+ * @private+ */+ initializer: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "initializer", 3440);+_yuitest_coverline("build/charts-base/charts-base.js", 3442);+this.after("dataReady", Y.bind(this._dataChangeHandler, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 3443);+this.after("dataUpdate", Y.bind(this._dataChangeHandler, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 3444);+this.after("minimumChange", Y.bind(this._keyChangeHandler, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 3445);+this.after("maximumChange", Y.bind(this._keyChangeHandler, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 3446);+this.after("keysChange", this._keyChangeHandler);+ _yuitest_coverline("build/charts-base/charts-base.js", 3447);+this.after("dataProviderChange", this._dataProviderChangeHandler);+ _yuitest_coverline("build/charts-base/charts-base.js", 3448);+this.after("alwaysShowZeroChange", this._keyChangeHandler);+ _yuitest_coverline("build/charts-base/charts-base.js", 3449);+this.after("roundingMethodChange", this._keyChangeHandler);+ },++ /**+ * @method bindUI+ * @private+ */+ bindUI: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "bindUI", 3456);+_yuitest_coverline("build/charts-base/charts-base.js", 3458);+this.after("stylesChange", this._updateHandler);+ _yuitest_coverline("build/charts-base/charts-base.js", 3459);+this.after("overlapGraphChange", this._updateHandler);+ _yuitest_coverline("build/charts-base/charts-base.js", 3460);+this.after("positionChange", this._positionChangeHandler);+ _yuitest_coverline("build/charts-base/charts-base.js", 3461);+this.after("widthChange", this._handleSizeChange);+ _yuitest_coverline("build/charts-base/charts-base.js", 3462);+this.after("heightChange", this._handleSizeChange);+ _yuitest_coverline("build/charts-base/charts-base.js", 3463);+this.after("calculatedWidthChange", this._handleSizeChange);+ _yuitest_coverline("build/charts-base/charts-base.js", 3464);+this.after("calculatedHeightChange", this._handleSizeChange);+ },++ /**+ * Handles changes to `dataProvider`.+ *+ * @method _dataProviderChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _dataProviderChangeHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_dataProviderChangeHandler", 3474);+_yuitest_coverline("build/charts-base/charts-base.js", 3476);+var keyCollection = this.get("keyCollection").concat(),+ keys = this.get("keys"),+ i;+ _yuitest_coverline("build/charts-base/charts-base.js", 3479);+if(keys)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3481);+for(i in keys)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3483);+if(keys.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3485);+delete keys[i];+ }+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 3489);+if(keyCollection && keyCollection.length)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3491);+this.set("keys", keyCollection);+ }+ },++ /**+ * Constant used to generate unique id.+ *+ * @property GUID+ * @type String+ * @private+ */+ GUID: "yuibaseaxis",+ + /**+ * Type of data used in `Axis`.+ *+ * @property _type+ * @type String + * @readOnly+ * @private+ */+ _type: null,+ + /**+ * Storage for `setMaximum` attribute.+ *+ * @property _setMaximum+ * @type Object+ * @private+ */+ _setMaximum: null,+ + /**+ * Storage for `dataMaximum` attribute.+ *+ * @property _dataMaximum+ * @type Object+ * @private+ */+ _dataMaximum: null,+ + /**+ * Storage for `setMinimum` attribute.+ *+ * @property _setMinimum+ * @type Object+ * @private+ */+ _setMinimum: null,+ + /**+ * Reference to data array.+ *+ * @property _data+ * @type Array+ * @private+ */+ _data: null,++ /**+ * Indicates whether the all data is up to date.+ *+ * @property _updateTotalDataFlag+ * @type Boolean+ * @private+ */+ _updateTotalDataFlag: true,++ /**+ * Storage for `dataReady` attribute.+ *+ * @property _dataReady+ * @type Boolean+ * @readOnly+ * @private+ */+ _dataReady: false,+ + /**+ * Adds an array to the key hash.+ *+ * @method addKey+ * @param value Indicates what key to use in retrieving+ * the array.+ */+ addKey: function (value)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "addKey", 3576);+_yuitest_coverline("build/charts-base/charts-base.js", 3578);+this.set("keys", value);+ },++ /**+ * Gets an array of values based on a key.+ *+ * @method _getKeyArray+ * @param {String} key Value key associated with the data array.+ * @param {Array} data Array in which the data resides.+ * @return Array+ * @private+ */+ _getKeyArray: function(key, data)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getKeyArray", 3590);+_yuitest_coverline("build/charts-base/charts-base.js", 3592);+var i = 0,+ obj,+ keyArray = [],+ len = data.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 3596);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3598);+obj = data[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 3599);+keyArray[i] = obj[key];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 3601);+return keyArray;+ },++ /**+ * Sets data by key+ *+ * @method _setDataByKey+ * @param {String} key Key value to use.+ * @param {Array} data Array to use.+ * @private + */+ _setDataByKey: function(key, data)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setDataByKey", 3612);+_yuitest_coverline("build/charts-base/charts-base.js", 3614);+var i,+ obj, + arr = [], + dv = this._dataClone.concat(), + len = dv.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 3619);+for(i = 0; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3621);+obj = dv[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 3622);+arr[i] = obj[key];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 3624);+this.get("keys")[key] = arr;+ _yuitest_coverline("build/charts-base/charts-base.js", 3625);+this._updateTotalDataFlag = true;+ },++ /**+ * Updates the total data array.+ *+ * @method _updateTotalData+ * @private+ */+ _updateTotalData: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_updateTotalData", 3634);+_yuitest_coverline("build/charts-base/charts-base.js", 3636);+var keys = this.get("keys"),+ i;+ _yuitest_coverline("build/charts-base/charts-base.js", 3638);+this._data = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 3639);+for(i in keys)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3641);+if(keys.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3643);+this._data = this._data.concat(keys[i]);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 3646);+this._updateTotalDataFlag = false;+ },++ /**+ * Removes an array from the key hash.+ * + * @method removeKey+ * @param {String} value Indicates what key to use in removing from + * the hash.+ */+ removeKey: function(value)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "removeKey", 3656);+_yuitest_coverline("build/charts-base/charts-base.js", 3658);+var keys = this.get("keys");+ _yuitest_coverline("build/charts-base/charts-base.js", 3659);+if(keys.hasOwnProperty(value)) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 3661);+delete keys[value];+ _yuitest_coverline("build/charts-base/charts-base.js", 3662);+this._keyChangeHandler();+ }+ },++ /**+ * Returns a value based of a key value and an index.+ *+ * @method getKeyValueAt+ * @param {String} key value used to look up the correct array+ * @param {Number} index within the array+ * @return Number + */+ getKeyValueAt: function(key, index)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getKeyValueAt", 3674);+_yuitest_coverline("build/charts-base/charts-base.js", 3676);+var value = NaN,+ keys = this.get("keys");+ _yuitest_coverline("build/charts-base/charts-base.js", 3678);+if(keys[key] && Y_Lang.isNumber(parseFloat(keys[key][index])))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3680);+value = keys[key][index];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 3682);+return parseFloat(value);+ },++ /**+ * Returns an array of values based on an identifier key.+ *+ * @method getDataByKey+ * @param {String} value value used to identify the array+ * @return Object+ */+ getDataByKey: function (value)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getDataByKey", 3692);+_yuitest_coverline("build/charts-base/charts-base.js", 3694);+var keys = this.get("keys");+ _yuitest_coverline("build/charts-base/charts-base.js", 3695);+if(keys[value])+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3697);+return keys[value];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 3699);+return null;+ },++ /**+ * Calculates the maximum and minimum values for the `Axis`.+ *+ * @method _updateMinAndMax+ * @private + */+ _updateMinAndMax: function() + {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_updateMinAndMax", 3708);+_yuitest_coverline("build/charts-base/charts-base.js", 3710);+var data = this.get("data"),+ max = 0,+ min = 0,+ len,+ num,+ i;+ _yuitest_coverline("build/charts-base/charts-base.js", 3716);+if(data && data.length && data.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3718);+len = data.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 3719);+max = min = data[0];+ _yuitest_coverline("build/charts-base/charts-base.js", 3720);+if(len > 1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3722);+for(i = 1; i < len; i++)+ { + _yuitest_coverline("build/charts-base/charts-base.js", 3724);+num = data[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 3725);+if(isNaN(num))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3727);+continue;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 3729);+max = Math.max(num, max);+ _yuitest_coverline("build/charts-base/charts-base.js", 3730);+min = Math.min(num, min);+ }+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 3734);+this._dataMaximum = max;+ _yuitest_coverline("build/charts-base/charts-base.js", 3735);+this._dataMinimum = min;+ },++ /**+ * Returns the total number of majorUnits that will appear on an axis.+ *+ * @method getTotalMajorUnits+ * @return Number+ */+ getTotalMajorUnits: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getTotalMajorUnits", 3744);+_yuitest_coverline("build/charts-base/charts-base.js", 3746);+var units,+ majorUnit = this.get("styles").majorUnit,+ len = this.get("length");+ _yuitest_coverline("build/charts-base/charts-base.js", 3749);+if(majorUnit.determinant === "count") + {+ _yuitest_coverline("build/charts-base/charts-base.js", 3751);+units = majorUnit.count;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 3753);+if(majorUnit.determinant === "distance") + {+ _yuitest_coverline("build/charts-base/charts-base.js", 3755);+units = (len/majorUnit.distance) + 1;+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 3757);+return units; + },++ /**+ * Returns the distance between major units on an axis.+ *+ * @method getMajorUnitDistance+ * @param {Number} len Number of ticks+ * @param {Number} uiLen Size of the axis.+ * @param {Object} majorUnit Hash of properties used to determine the majorUnit+ * @return Number+ */+ getMajorUnitDistance: function(len, uiLen, majorUnit)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getMajorUnitDistance", 3769);+_yuitest_coverline("build/charts-base/charts-base.js", 3771);+var dist;+ _yuitest_coverline("build/charts-base/charts-base.js", 3772);+if(majorUnit.determinant === "count")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3774);+dist = uiLen/(len - 1);+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 3776);+if(majorUnit.determinant === "distance")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3778);+dist = majorUnit.distance;+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 3780);+return dist;+ },+ + /**+ * Gets the distance that the first and last ticks are offset from there respective+ * edges.+ *+ * @method getEdgeOffset+ * @param {Number} ct Number of ticks on the axis.+ * @param {Number} l Length (in pixels) of the axis.+ * @return Number+ */+ getEdgeOffset: function(ct, l)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getEdgeOffset", 3792);+_yuitest_coverline("build/charts-base/charts-base.js", 3794);+return 0;+ },++ /**+ * Calculates and returns a value based on the number of labels and the index of+ * the current label.+ *+ * @method getLabelByIndex+ * @param {Number} i Index of the label.+ * @param {Number} l Total number of labels.+ * @return String+ */+ getLabelByIndex: function(i, l)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getLabelByIndex", 3806);+_yuitest_coverline("build/charts-base/charts-base.js", 3808);+var min = this.get("minimum"),+ max = this.get("maximum"),+ increm = (max - min)/(l-1),+ label;+ _yuitest_coverline("build/charts-base/charts-base.js", 3812);+l -= 1;+ _yuitest_coverline("build/charts-base/charts-base.js", 3813);+label = min + (i * increm);+ _yuitest_coverline("build/charts-base/charts-base.js", 3814);+return label;+ },++ /**+ * Updates the `Axis` after a change in keys.+ *+ * @method _keyChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _keyChangeHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_keyChangeHandler", 3824);+_yuitest_coverline("build/charts-base/charts-base.js", 3826);+this._updateMinAndMax();+ _yuitest_coverline("build/charts-base/charts-base.js", 3827);+this.fire("dataUpdate");+ },++ /**+ * Checks to see if data extends beyond the range of the axis. If so,+ * that data will need to be hidden. This method is internal, temporary and subject+ * to removal in the future.+ *+ * @method _hasDataOverflow+ * @protected+ * @return Boolean+ */+ _hasDataOverflow: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_hasDataOverflow", 3839);+_yuitest_coverline("build/charts-base/charts-base.js", 3841);+if(this.get("setMin") || this.get("setMax"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3843);+return true;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 3845);+return false;+ },++ /**+ * Returns a string corresponding to the first label on an + * axis.+ *+ * @method getMinimumValue+ * @return String+ */+ getMinimumValue: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getMinimumValue", 3855);+_yuitest_coverline("build/charts-base/charts-base.js", 3857);+return this.get("minimum");+ },++ /**+ * Returns a string corresponding to the last label on an + * axis.+ *+ * @method getMaximumValue+ * @return String+ */+ getMaximumValue: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getMaximumValue", 3867);+_yuitest_coverline("build/charts-base/charts-base.js", 3869);+return this.get("maximum");+ }+}, {+ ATTRS: {+ /**+ * Hash of array identifed by a string value.+ *+ * @attribute keys+ * @type Object+ */+ keys: {+ value: {},++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 3882);+_yuitest_coverline("build/charts-base/charts-base.js", 3884);+var keys = {},+ i, + len,+ data = this.get("dataProvider");+ _yuitest_coverline("build/charts-base/charts-base.js", 3888);+if(Y_Lang.isArray(val))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3890);+len = val.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 3891);+for(i = 0; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3893);+keys[val[i]] = this._getKeyArray(val[i], data); + }+ + }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 3897);+if(Y_Lang.isString(val))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3899);+keys = this.get("keys");+ _yuitest_coverline("build/charts-base/charts-base.js", 3900);+keys[val] = this._getKeyArray(val, data);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3904);+for(i in val)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3906);+if(val.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 3908);+keys[i] = this._getKeyArray(i, data);+ }+ }+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 3912);+this._updateTotalDataFlag = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 3913);+return keys;+ }+ },++ /**+ *Indicates how to round unit values.+ * <dl>+ * <dt>niceNumber</dt><dd>Units will be smoothed based on the number of ticks and data range.</dd>+ * <dt>auto</dt><dd>If the range is greater than 1, the units will be rounded.</dd>+ * <dt>numeric value</dt><dd>Units will be equal to the numeric value.</dd>+ * <dt>null</dt><dd>No rounding will occur.</dd>+ * </dl>+ *+ * @attribute roundingMethod+ * @type String+ * @default niceNumber+ */+ roundingMethod: {+ value: "niceNumber"+ },++ /**+ *Returns the type of axis data+ * <dl>+ * <dt>time</dt><dd>Manages time data</dd>+ * <dt>stacked</dt><dd>Manages stacked numeric data</dd> + * <dt>numeric</dt><dd>Manages numeric data</dd>+ * <dt>category</dt><dd>Manages categorical data</dd>+ * </dl>+ *+ * @attribute type+ * @type String+ */+ type:+ {+ readOnly: true,++ getter: function ()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 3950);+_yuitest_coverline("build/charts-base/charts-base.js", 3952);+return this._type;+ }+ },++ /**+ * Instance of `ChartDataProvider` that the class uses+ * to build its own data.+ *+ * @attribute dataProvider+ * @type Array+ */+ dataProvider:{+ setter: function (value)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 3964);+_yuitest_coverline("build/charts-base/charts-base.js", 3966);+return value;+ }+ },++ /**+ * The maximum value contained in the `data` array. Used for+ * `maximum` when `autoMax` is true.+ *+ * @attribute dataMaximum+ * @type Number+ */+ dataMaximum: {+ getter: function ()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 3978);+_yuitest_coverline("build/charts-base/charts-base.js", 3980);+if(!this._dataMaximum)+ { + _yuitest_coverline("build/charts-base/charts-base.js", 3982);+this._updateMinAndMax();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 3984);+return this._dataMaximum;+ }+ },++ /**+ * The maximum value that will appear on an axis.+ *+ * @attribute maximum+ * @type Number+ */+ maximum: {+ lazyAdd: false,++ getter: function ()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 3997);+_yuitest_coverline("build/charts-base/charts-base.js", 3999);+var max = this.get("dataMaximum"),+ min = this.get("minimum");+ //If all values are zero, force a range so that the Axis and related series+ //will still render.+ _yuitest_coverline("build/charts-base/charts-base.js", 4003);+if(min === 0 && max === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4005);+max = 10;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4007);+if(Y_Lang.isNumber(this._setMaximum))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4009);+max = this._setMaximum;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4011);+return parseFloat(max);+ },+ setter: function (value)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 4013);+_yuitest_coverline("build/charts-base/charts-base.js", 4015);+this._setMaximum = parseFloat(value);+ _yuitest_coverline("build/charts-base/charts-base.js", 4016);+return value;+ }+ },++ /**+ * The minimum value contained in the `data` array. Used for+ * `minimum` when `autoMin` is true.+ *+ * @attribute dataMinimum+ * @type Number+ */+ dataMinimum: {+ getter: function ()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 4028);+_yuitest_coverline("build/charts-base/charts-base.js", 4030);+if(!this._dataMinimum)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4032);+this._updateMinAndMax();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4034);+return this._dataMinimum;+ }+ },++ /**+ * The minimum value that will appear on an axis.+ *+ * @attribute minimum+ * @type Number+ */+ minimum: {+ lazyAdd: false,++ getter: function ()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 4047);+_yuitest_coverline("build/charts-base/charts-base.js", 4049);+var min = this.get("dataMinimum");+ _yuitest_coverline("build/charts-base/charts-base.js", 4050);+if(Y_Lang.isNumber(this._setMinimum))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4052);+min = this._setMinimum;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4054);+return parseFloat(min);+ },+ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 4056);+_yuitest_coverline("build/charts-base/charts-base.js", 4058);+this._setMinimum = parseFloat(val);+ _yuitest_coverline("build/charts-base/charts-base.js", 4059);+return val;+ }+ },++ /**+ * Determines whether the maximum is calculated or explicitly + * set by the user.+ *+ * @attribute setMax+ * @type Boolean+ */+ setMax: {+ readOnly: true,++ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 4073);+_yuitest_coverline("build/charts-base/charts-base.js", 4075);+return Y_Lang.isNumber(this._setMaximum);+ }+ },++ /**+ * Determines whether the minimum is calculated or explicitly+ * set by the user.+ *+ * @attribute setMin+ * @type Boolean+ */+ setMin: {+ readOnly: true,++ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 4089);+_yuitest_coverline("build/charts-base/charts-base.js", 4091);+return Y_Lang.isNumber(this._setMinimum);+ }+ },++ /**+ * Array of axis data+ *+ * @attribute data+ * @type Array+ */+ data: {+ getter: function ()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 4102);+_yuitest_coverline("build/charts-base/charts-base.js", 4104);+if(!this._data || this._updateTotalDataFlag)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4106);+this._updateTotalData();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4108);+return this._data;+ }+ },++ /**+ * Array containing all the keys in the axis.+ + * @attribute keyCollection+ * @type Array+ */+ keyCollection: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 4119);+_yuitest_coverline("build/charts-base/charts-base.js", 4121);+var keys = this.get("keys"),+ i, + col = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 4124);+for(i in keys)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4126);+if(keys.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4128);+col.push(i);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4131);+return col;+ },+ readOnly: true+ }+ }+});+/**+ * NumericAxis manages numeric data on an axis.+ *+ * @module charts+ * @submodule charts-base+ * @class NumericAxis+ * @constructor+ * @param {Object} config (optional) Configuration parameters for the Chart.+ * @extends AxisType+ */+_yuitest_coverline("build/charts-base/charts-base.js", 4147);+function NumericAxis(config)+{+ _yuitest_coverfunc("build/charts-base/charts-base.js", "NumericAxis", 4147);+_yuitest_coverline("build/charts-base/charts-base.js", 4149);+NumericAxis.superclass.constructor.apply(this, arguments);+}++_yuitest_coverline("build/charts-base/charts-base.js", 4152);+NumericAxis.NAME = "numericAxis";++_yuitest_coverline("build/charts-base/charts-base.js", 4154);+NumericAxis.ATTRS = {+ /**+ * Indicates whether 0 should always be displayed.+ *+ * @attribute alwaysShowZero+ * @type Boolean+ */+ alwaysShowZero: {+ value: true + },+ + /**+ * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need+ * to implement the arguments below and return a `String` or an `HTMLElement`. The default implementation of the method returns a `String`. The output of this method+ * will be rendered to the DOM using `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override the Axis' + * `appendLabelFunction` to accept html as a `String`.+ * <dl>+ * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>+ * <dt>format</dt><dd>Object containing properties used to format the label. (optional)</dd>+ * </dl>+ *+ * @attribute labelFunction+ * @type Function+ */+ labelFunction: { + value: function(val, format)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "value", 4179);+_yuitest_coverline("build/charts-base/charts-base.js", 4181);+if(format)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4183);+return Y.DataType.Number.format(val, format);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4185);+return val;+ }+ },++ /**+ * Object containing properties used by the `labelFunction` to format a+ * label.+ *+ * @attribute labelFormat+ * @type Object+ */+ labelFormat: {+ value: {+ prefix: "",+ thousandsSeparator: "",+ decimalSeparator: "",+ decimalPlaces: "0",+ suffix: ""+ }+ }+};++_yuitest_coverline("build/charts-base/charts-base.js", 4207);+Y.extend(NumericAxis, Y.AxisType,+{+ /**+ * Formats a label based on the axis type and optionally specified format.+ *+ * @method formatLabel+ * @param {Object} value+ * @param {Object} format Pattern used to format the value.+ * @return String+ */+ formatLabel: function(val, format)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "formatLabel", 4217);+_yuitest_coverline("build/charts-base/charts-base.js", 4219);+if(format)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4221);+return Y.DataType.Number.format(val, format);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4223);+return val;+ },++ /**+ * Returns the sum of all values per key.+ *+ * @method getTotalByKey+ * @param {String} key The identifier for the array whose values will be calculated.+ * @return Number+ */+ getTotalByKey: function(key)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getTotalByKey", 4233);+_yuitest_coverline("build/charts-base/charts-base.js", 4235);+var total = 0,+ values = this.getDataByKey(key),+ i = 0,+ val,+ len = values ? values.length : 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 4240);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4242);+val = parseFloat(values[i]);+ _yuitest_coverline("build/charts-base/charts-base.js", 4243);+if(!isNaN(val))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4245);+total += val;+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4248);+return total;+ },++ /**+ * Type of data used in `Axis`.+ *+ * @property _type+ * @readOnly+ * @private+ */+ _type: "numeric",++ /**+ * Helper method for getting a `roundingUnit` when calculating the minimum and maximum values.+ *+ * @method _getMinimumUnit+ * @param {Number} max Maximum number+ * @param {Number} min Minimum number+ * @param {Number} units Number of units on the axis+ * @return Number+ * @private+ */+ _getMinimumUnit:function(max, min, units)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getMinimumUnit", 4270);+_yuitest_coverline("build/charts-base/charts-base.js", 4272);+return this._getNiceNumber(Math.ceil((max - min)/units));+ },++ /**+ * Calculates a nice rounding unit based on the range.+ *+ * @method _getNiceNumber+ * @param {Number} roundingUnit The calculated rounding unit.+ * @return Number+ * @private+ */+ _getNiceNumber: function(roundingUnit)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getNiceNumber", 4283);+_yuitest_coverline("build/charts-base/charts-base.js", 4285);+var tempMajorUnit = roundingUnit,+ order = Math.ceil(Math.log(tempMajorUnit) * 0.4342944819032518),+ roundedMajorUnit = Math.pow(10, order),+ roundedDiff;++ _yuitest_coverline("build/charts-base/charts-base.js", 4290);+if (roundedMajorUnit / 2 >= tempMajorUnit) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 4292);+roundedDiff = Math.floor((roundedMajorUnit / 2 - tempMajorUnit) / (Math.pow(10,order-1)/2));+ _yuitest_coverline("build/charts-base/charts-base.js", 4293);+tempMajorUnit = roundedMajorUnit/2 - roundedDiff*Math.pow(10,order-1)/2;+ }+ else + {+ _yuitest_coverline("build/charts-base/charts-base.js", 4297);+tempMajorUnit = roundedMajorUnit;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4299);+if(!isNaN(tempMajorUnit))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4301);+return tempMajorUnit;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4303);+return roundingUnit;++ },++ /**+ * Calculates the maximum and minimum values for the `Axis`.+ *+ * @method _updateMinAndMax+ * @private + */+ _updateMinAndMax: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_updateMinAndMax", 4313);+_yuitest_coverline("build/charts-base/charts-base.js", 4315);+var data = this.get("data"),+ max, + min,+ len,+ num,+ i = 0,+ key,+ setMax = this.get("setMax"),+ setMin = this.get("setMin");+ _yuitest_coverline("build/charts-base/charts-base.js", 4324);+if(!setMax || !setMin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4326);+if(data && data.length && data.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4328);+len = data.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 4329);+for(; i < len; i++)+ { + _yuitest_coverline("build/charts-base/charts-base.js", 4331);+num = data[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 4332);+if(isNaN(num))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4334);+if(Y_Lang.isObject(num))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4336);+min = max = 0;+ //hloc values+ _yuitest_coverline("build/charts-base/charts-base.js", 4338);+for(key in num)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4340);+if(num.hasOwnProperty(key))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4342);+max = Math.max(num[key], max);+ _yuitest_coverline("build/charts-base/charts-base.js", 4343);+min = Math.min(num[key], min);+ }+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4347);+max = setMax ? this._setMaximum : max;+ _yuitest_coverline("build/charts-base/charts-base.js", 4348);+min = setMin ? this._setMinimum : min;+ _yuitest_coverline("build/charts-base/charts-base.js", 4349);+continue;+ }+ + _yuitest_coverline("build/charts-base/charts-base.js", 4352);+if(setMin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4354);+min = this._setMinimum;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 4356);+if(min === undefined)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4358);+min = num;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4362);+min = Math.min(num, min); + }}+ _yuitest_coverline("build/charts-base/charts-base.js", 4364);+if(setMax)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4366);+max = this._setMaximum;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 4368);+if(max === undefined)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4370);+max = num;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4374);+max = Math.max(num, max);+ }}+ + _yuitest_coverline("build/charts-base/charts-base.js", 4377);+this._actualMaximum = max;+ _yuitest_coverline("build/charts-base/charts-base.js", 4378);+this._actualMinimum = min;+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4381);+this._roundMinAndMax(min, max, setMin, setMax);+ }+ },++ /**+ * Rounds the mimimum and maximum values based on the `roundingUnit` attribute.+ *+ * @method _roundMinAndMax+ * @param {Number} min Minimum value+ * @param {Number} max Maximum value+ * @private+ */+ _roundMinAndMax: function(min, max, setMin, setMax)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_roundMinAndMax", 4393);+_yuitest_coverline("build/charts-base/charts-base.js", 4395);+var roundingUnit,+ minimumRange,+ minGreaterThanZero = min >= 0,+ maxGreaterThanZero = max > 0,+ dataRangeGreater,+ maxRound,+ minRound,+ topTicks,+ botTicks,+ tempMax,+ tempMin,+ units = this.getTotalMajorUnits() - 1,+ alwaysShowZero = this.get("alwaysShowZero"),+ roundingMethod = this.get("roundingMethod"),+ useIntegers = (max - min)/units >= 1;+ _yuitest_coverline("build/charts-base/charts-base.js", 4410);+if(roundingMethod)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4412);+if(roundingMethod == "niceNumber")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4414);+roundingUnit = this._getMinimumUnit(max, min, units);+ _yuitest_coverline("build/charts-base/charts-base.js", 4415);+if(minGreaterThanZero && maxGreaterThanZero)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4417);+if((alwaysShowZero || min < roundingUnit) && !setMin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4419);+min = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 4420);+roundingUnit = this._getMinimumUnit(max, min, units);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4424);+min = this._roundDownToNearest(min, roundingUnit);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4426);+if(setMax)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4428);+if(!alwaysShowZero)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4430);+min = max - (roundingUnit * units);+ }+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 4433);+if(setMin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4435);+max = min + (roundingUnit * units);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4439);+max = this._roundUpToNearest(max, roundingUnit);+ }}+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 4442);+if(maxGreaterThanZero && !minGreaterThanZero)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4444);+if(alwaysShowZero)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4446);+topTicks = Math.round(units/((-1 * min)/max + 1));+ _yuitest_coverline("build/charts-base/charts-base.js", 4447);+topTicks = Math.max(Math.min(topTicks, units - 1), 1);+ _yuitest_coverline("build/charts-base/charts-base.js", 4448);+botTicks = units - topTicks;+ _yuitest_coverline("build/charts-base/charts-base.js", 4449);+tempMax = Math.ceil( max/topTicks );+ _yuitest_coverline("build/charts-base/charts-base.js", 4450);+tempMin = Math.floor( min/botTicks ) * -1;+ + _yuitest_coverline("build/charts-base/charts-base.js", 4452);+if(setMin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4454);+while(tempMin < tempMax && botTicks >= 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4456);+botTicks--;+ _yuitest_coverline("build/charts-base/charts-base.js", 4457);+topTicks++;+ _yuitest_coverline("build/charts-base/charts-base.js", 4458);+tempMax = Math.ceil( max/topTicks );+ _yuitest_coverline("build/charts-base/charts-base.js", 4459);+tempMin = Math.floor( min/botTicks ) * -1;+ }+ //if there are any bottom ticks left calcualate the maximum by multiplying by the tempMin value+ //if not, it's impossible to ensure that a zero is shown. skip it+ _yuitest_coverline("build/charts-base/charts-base.js", 4463);+if(botTicks > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4465);+max = tempMin * topTicks;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4469);+max = min + (roundingUnit * units);+ }+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 4472);+if(setMax)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4474);+while(tempMax < tempMin && topTicks >= 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4476);+botTicks++;+ _yuitest_coverline("build/charts-base/charts-base.js", 4477);+topTicks--;+ _yuitest_coverline("build/charts-base/charts-base.js", 4478);+tempMin = Math.floor( min/botTicks ) * -1;+ _yuitest_coverline("build/charts-base/charts-base.js", 4479);+tempMax = Math.ceil( max/topTicks );+ }+ //if there are any top ticks left calcualate the minimum by multiplying by the tempMax value+ //if not, it's impossible to ensure that a zero is shown. skip it+ _yuitest_coverline("build/charts-base/charts-base.js", 4483);+if(topTicks > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4485);+min = tempMax * botTicks * -1;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4489);+min = max - (roundingUnit * units);+ }+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4494);+roundingUnit = Math.max(tempMax, tempMin);+ _yuitest_coverline("build/charts-base/charts-base.js", 4495);+roundingUnit = this._getNiceNumber(roundingUnit); + _yuitest_coverline("build/charts-base/charts-base.js", 4496);+max = roundingUnit * topTicks;+ _yuitest_coverline("build/charts-base/charts-base.js", 4497);+min = roundingUnit * botTicks * -1;+ }}+ }+ else + {+ _yuitest_coverline("build/charts-base/charts-base.js", 4502);+if(setMax)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4504);+min = max - (roundingUnit * units);+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 4506);+if(setMin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4508);+max = min + (roundingUnit * units);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4512);+min = this._roundDownToNearest(min, roundingUnit);+ _yuitest_coverline("build/charts-base/charts-base.js", 4513);+max = this._roundUpToNearest(max, roundingUnit);+ }}+ }+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4519);+if(setMin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4521);+if(alwaysShowZero)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4523);+max = 0;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4527);+max = min + (roundingUnit * units);+ }+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 4530);+if(!setMax)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4532);+if(alwaysShowZero || max === 0 || max + roundingUnit > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4534);+max = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 4535);+roundingUnit = this._getMinimumUnit(max, min, units);+ _yuitest_coverline("build/charts-base/charts-base.js", 4536);+min = max - (roundingUnit * units);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4540);+min = this._roundDownToNearest(min, roundingUnit);+ _yuitest_coverline("build/charts-base/charts-base.js", 4541);+max = this._roundUpToNearest(max, roundingUnit);+ }+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4546);+min = max - (roundingUnit * units);+ }}+ }}+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 4550);+if(roundingMethod == "auto") + {+ _yuitest_coverline("build/charts-base/charts-base.js", 4552);+if(minGreaterThanZero && maxGreaterThanZero)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4554);+if((alwaysShowZero || min < (max-min)/units) && !setMin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4556);+min = 0;+ }+ + _yuitest_coverline("build/charts-base/charts-base.js", 4559);+roundingUnit = (max - min)/units;+ _yuitest_coverline("build/charts-base/charts-base.js", 4560);+if(useIntegers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4562);+roundingUnit = Math.ceil(roundingUnit);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4564);+max = min + (roundingUnit * units);+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 4566);+if(maxGreaterThanZero && !minGreaterThanZero)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4568);+if(alwaysShowZero)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4570);+topTicks = Math.round( units / ( (-1 * min) /max + 1) );+ _yuitest_coverline("build/charts-base/charts-base.js", 4571);+topTicks = Math.max(Math.min(topTicks, units - 1), 1);+ _yuitest_coverline("build/charts-base/charts-base.js", 4572);+botTicks = units - topTicks;++ _yuitest_coverline("build/charts-base/charts-base.js", 4574);+if(useIntegers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4576);+tempMax = Math.ceil( max/topTicks );+ _yuitest_coverline("build/charts-base/charts-base.js", 4577);+tempMin = Math.floor( min/botTicks ) * -1;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4581);+tempMax = max/topTicks;+ _yuitest_coverline("build/charts-base/charts-base.js", 4582);+tempMin = min/botTicks * -1;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4584);+roundingUnit = Math.max(tempMax, tempMin);+ _yuitest_coverline("build/charts-base/charts-base.js", 4585);+max = roundingUnit * topTicks;+ _yuitest_coverline("build/charts-base/charts-base.js", 4586);+min = roundingUnit * botTicks * -1;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4590);+roundingUnit = (max - min)/units;+ _yuitest_coverline("build/charts-base/charts-base.js", 4591);+if(useIntegers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4593);+roundingUnit = Math.ceil(roundingUnit);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4595);+min = this._roundDownToNearest(min, roundingUnit);+ _yuitest_coverline("build/charts-base/charts-base.js", 4596);+max = this._roundUpToNearest(max, roundingUnit);+ }+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4601);+roundingUnit = (max - min)/units;+ _yuitest_coverline("build/charts-base/charts-base.js", 4602);+if(useIntegers)+ { + _yuitest_coverline("build/charts-base/charts-base.js", 4604);+roundingUnit = Math.ceil(roundingUnit);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4606);+if(alwaysShowZero || max === 0 || max + roundingUnit > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4608);+max = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 4609);+roundingUnit = (max - min)/units;+ _yuitest_coverline("build/charts-base/charts-base.js", 4610);+if(useIntegers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4612);+Math.ceil(roundingUnit);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4614);+min = max - (roundingUnit * units);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4618);+min = this._roundDownToNearest(min, roundingUnit);+ _yuitest_coverline("build/charts-base/charts-base.js", 4619);+max = this._roundUpToNearest(max, roundingUnit);+ }++ }}+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 4624);+if(!isNaN(roundingMethod) && isFinite(roundingMethod))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4626);+roundingUnit = roundingMethod;+ _yuitest_coverline("build/charts-base/charts-base.js", 4627);+minimumRange = roundingUnit * units;+ _yuitest_coverline("build/charts-base/charts-base.js", 4628);+dataRangeGreater = (max - min) > minimumRange;+ _yuitest_coverline("build/charts-base/charts-base.js", 4629);+minRound = this._roundDownToNearest(min, roundingUnit);+ _yuitest_coverline("build/charts-base/charts-base.js", 4630);+maxRound = this._roundUpToNearest(max, roundingUnit);+ _yuitest_coverline("build/charts-base/charts-base.js", 4631);+if(setMax)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4633);+min = max - minimumRange;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 4635);+if(setMin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4637);+max = min + minimumRange;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 4639);+if(minGreaterThanZero && maxGreaterThanZero)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4641);+if(alwaysShowZero || minRound <= 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4643);+min = 0;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4647);+min = minRound;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4649);+max = min + minimumRange;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 4651);+if(maxGreaterThanZero && !minGreaterThanZero)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4653);+min = minRound;+ _yuitest_coverline("build/charts-base/charts-base.js", 4654);+max = maxRound;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4658);+if(alwaysShowZero || maxRound >= 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4660);+max = 0;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4664);+max = maxRound;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4666);+min = max - minimumRange;+ }}}}+ }}}+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4670);+this._dataMaximum = max;+ _yuitest_coverline("build/charts-base/charts-base.js", 4671);+this._dataMinimum = min;+ },++ /**+ * Calculates and returns a value based on the number of labels and the index of+ * the current label.+ *+ * @method getLabelByIndex+ * @param {Number} i Index of the label.+ * @param {Number} l Total number of labels.+ * @return String+ */+ getLabelByIndex: function(i, l)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getLabelByIndex", 4683);+_yuitest_coverline("build/charts-base/charts-base.js", 4685);+var min = this.get("minimum"),+ max = this.get("maximum"),+ increm = (max - min)/(l-1),+ label,+ roundingMethod = this.get("roundingMethod");+ _yuitest_coverline("build/charts-base/charts-base.js", 4690);+l -= 1;+ //respect the min and max. calculate all other labels.+ _yuitest_coverline("build/charts-base/charts-base.js", 4692);+if(i === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4694);+label = min;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 4696);+if(i === l)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4698);+label = max;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4702);+label = (i * increm);+ _yuitest_coverline("build/charts-base/charts-base.js", 4703);+if(roundingMethod == "niceNumber")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4705);+label = this._roundToNearest(label, increm);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4707);+label += min;+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 4709);+return parseFloat(label);+ },++ /**+ * Rounds a Number to the nearest multiple of an input. For example, by rounding+ * 16 to the nearest 10, you will receive 20. Similar to the built-in function Math.round().+ *+ * @method _roundToNearest+ * @param {Number} number Number to round+ * @param {Number} nearest Multiple to round towards.+ * @return Number+ * @private+ */+ _roundToNearest: function(number, nearest)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_roundToNearest", 4722);+_yuitest_coverline("build/charts-base/charts-base.js", 4724);+nearest = nearest || 1;+ _yuitest_coverline("build/charts-base/charts-base.js", 4725);+if(nearest === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4727);+return number;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4729);+var roundedNumber = Math.round(this._roundToPrecision(number / nearest, 10)) * nearest;+ _yuitest_coverline("build/charts-base/charts-base.js", 4730);+return this._roundToPrecision(roundedNumber, 10);+ },+ + /**+ * Rounds a Number up to the nearest multiple of an input. For example, by rounding+ * 16 up to the nearest 10, you will receive 20. Similar to the built-in function Math.ceil().+ *+ * @method _roundUpToNearest+ * @param {Number} number Number to round+ * @param {Number} nearest Multiple to round towards.+ * @return Number+ * @private+ */+ _roundUpToNearest: function(number, nearest)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_roundUpToNearest", 4743);+_yuitest_coverline("build/charts-base/charts-base.js", 4745);+nearest = nearest || 1;+ _yuitest_coverline("build/charts-base/charts-base.js", 4746);+if(nearest === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4748);+return number;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4750);+return Math.ceil(this._roundToPrecision(number / nearest, 10)) * nearest;+ },+ + /**+ * Rounds a Number down to the nearest multiple of an input. For example, by rounding+ * 16 down to the nearest 10, you will receive 10. Similar to the built-in function Math.floor().+ *+ * @method _roundDownToNearest+ * @param {Number} number Number to round+ * @param {Number} nearest Multiple to round towards.+ * @return Number+ * @private+ */+ _roundDownToNearest: function(number, nearest)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_roundDownToNearest", 4763);+_yuitest_coverline("build/charts-base/charts-base.js", 4765);+nearest = nearest || 1;+ _yuitest_coverline("build/charts-base/charts-base.js", 4766);+if(nearest === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4768);+return number;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4770);+return Math.floor(this._roundToPrecision(number / nearest, 10)) * nearest;+ },++ /**+ * Rounds a number to a certain level of precision. Useful for limiting the number of+ * decimal places on a fractional number.+ *+ * @method _roundToPrecision+ * @param {Number} number Number to round+ * @param {Number} precision Multiple to round towards.+ * @return Number+ * @private+ */+ _roundToPrecision: function(number, precision)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_roundToPrecision", 4783);+_yuitest_coverline("build/charts-base/charts-base.js", 4785);+precision = precision || 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 4786);+var decimalPlaces = Math.pow(10, precision);+ _yuitest_coverline("build/charts-base/charts-base.js", 4787);+return Math.round(decimalPlaces * number) / decimalPlaces;+ },+ + /**+ * Checks to see if data extends beyond the range of the axis. If so,+ * that data will need to be hidden. This method is internal, temporary and subject+ * to removal in the future.+ *+ * @method _hasDataOverflow+ * @protected+ * @return Boolean+ */+ _hasDataOverflow: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_hasDataOverflow", 4799);+_yuitest_coverline("build/charts-base/charts-base.js", 4801);+var roundingMethod,+ min,+ max;+ _yuitest_coverline("build/charts-base/charts-base.js", 4804);+if(this.get("setMin") || this.get("setMax"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4806);+return true;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4808);+roundingMethod = this.get("roundingMethod");+ _yuitest_coverline("build/charts-base/charts-base.js", 4809);+min = this._actualMinimum;+ _yuitest_coverline("build/charts-base/charts-base.js", 4810);+max = this._actualMaximum;+ _yuitest_coverline("build/charts-base/charts-base.js", 4811);+if(Y_Lang.isNumber(roundingMethod) && ((Y_Lang.isNumber(max) && max > this._dataMaximum) || (Y_Lang.isNumber(min) && min < this._dataMinimum)))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4813);+return true;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4815);+return false;+ }+});++_yuitest_coverline("build/charts-base/charts-base.js", 4819);+Y.NumericAxis = NumericAxis;+ +/**+ * StackedAxis manages stacked numeric data on an axis.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedAxis+ * @constructor+ * @param {Object} config (optional) Configuration parameters for the Chart.+ * @extends NumericAxis+ */+_yuitest_coverline("build/charts-base/charts-base.js", 4831);+function StackedAxis(config)+{+ _yuitest_coverfunc("build/charts-base/charts-base.js", "StackedAxis", 4831);+_yuitest_coverline("build/charts-base/charts-base.js", 4833);+StackedAxis.superclass.constructor.apply(this, arguments);+}++_yuitest_coverline("build/charts-base/charts-base.js", 4836);+StackedAxis.NAME = "stackedAxis";+++_yuitest_coverline("build/charts-base/charts-base.js", 4839);+Y.extend(StackedAxis, Y.NumericAxis,+{+ /**+ * Calculates the maximum and minimum values for the `Axis`.+ *+ * @method _updateMinAndMax+ * @private + */+ _updateMinAndMax: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_updateMinAndMax", 4847);+_yuitest_coverline("build/charts-base/charts-base.js", 4849);+var max = 0,+ min = 0,+ pos = 0,+ neg = 0,+ len = 0,+ i = 0,+ key,+ num,+ keys = this.get("keys"),+ setMin = this.get("setMin"),+ setMax = this.get("setMax");++ _yuitest_coverline("build/charts-base/charts-base.js", 4861);+for(key in keys)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4863);+if(keys.hasOwnProperty(key))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4865);+len = Math.max(len, keys[key].length);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4868);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4870);+pos = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 4871);+neg = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 4872);+for(key in keys)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4874);+if(keys.hasOwnProperty(key))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4876);+num = keys[key][i];+ _yuitest_coverline("build/charts-base/charts-base.js", 4877);+if(isNaN(num))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4879);+continue;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4881);+if(num >= 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4883);+pos += num;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4887);+neg += num;+ }+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4891);+if(pos > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4893);+max = Math.max(max, pos);+ }+ else + {+ _yuitest_coverline("build/charts-base/charts-base.js", 4897);+max = Math.max(max, neg);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4899);+if(neg < 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4901);+min = Math.min(min, neg);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4905);+min = Math.min(min, pos);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4908);+this._actualMaximum = max;+ _yuitest_coverline("build/charts-base/charts-base.js", 4909);+this._actualMinimum = min;+ _yuitest_coverline("build/charts-base/charts-base.js", 4910);+if(setMax)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4912);+max = this._setMaximum;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4914);+if(setMin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4916);+min = this._setMinimum;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4918);+this._roundMinAndMax(min, max, setMin, setMax);+ }+});++_yuitest_coverline("build/charts-base/charts-base.js", 4922);+Y.StackedAxis = StackedAxis;+ +/**+ * TimeAxis manages time data on an axis.+ *+ * @module charts+ * @submodule charts-base+ * @class TimeAxis+ * @constructor+ * @param {Object} config (optional) Configuration parameters for the Chart.+ * @extends AxisType+ */+_yuitest_coverline("build/charts-base/charts-base.js", 4934);+function TimeAxis(config)+{+ _yuitest_coverfunc("build/charts-base/charts-base.js", "TimeAxis", 4934);+_yuitest_coverline("build/charts-base/charts-base.js", 4936);+TimeAxis.superclass.constructor.apply(this, arguments);+}++_yuitest_coverline("build/charts-base/charts-base.js", 4939);+TimeAxis.NAME = "timeAxis";++_yuitest_coverline("build/charts-base/charts-base.js", 4941);+TimeAxis.ATTRS = +{+ /**+ * Indicates whether the maximum is calculated or explicitly set. + *+ * @attribute setMax+ * @readOnly+ * @type Boolean+ * @private+ */+ setMax: {+ readOnly: true,++ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 4954);+_yuitest_coverline("build/charts-base/charts-base.js", 4956);+var max = this._getNumber(this._setMaximum);+ _yuitest_coverline("build/charts-base/charts-base.js", 4957);+return (Y_Lang.isNumber(max));+ }+ },++ /**+ * Indicates whether the minimum is calculated or explicitly set. + *+ * @attribute setMin+ * @readOnly+ * @type Boolean+ * @private+ */+ setMin: {+ readOnly: true,++ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 4972);+_yuitest_coverline("build/charts-base/charts-base.js", 4974);+var min = this._getNumber(this._setMinimum);+ _yuitest_coverline("build/charts-base/charts-base.js", 4975);+return (Y_Lang.isNumber(min));+ }+ },++ /**+ * The maximum value that will appear on an axis. Unless explicitly set, this value is calculated by the `Axis`.+ *+ * @attribute maximum+ * @type Number+ */+ maximum: {+ getter: function ()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 4986);+_yuitest_coverline("build/charts-base/charts-base.js", 4988);+var max = this._getNumber(this._setMaximum);+ _yuitest_coverline("build/charts-base/charts-base.js", 4989);+if(!Y_Lang.isNumber(max))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 4991);+max = this._getNumber(this.get("dataMaximum"));+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 4993);+return parseFloat(max);+ },+ setter: function (value)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 4995);+_yuitest_coverline("build/charts-base/charts-base.js", 4997);+this._setMaximum = this._getNumber(value);+ _yuitest_coverline("build/charts-base/charts-base.js", 4998);+return value;+ }+ },++ /**+ * The minimum value that will appear on an axis. Unless explicitly set, this value is calculated by the `Axis`.+ *+ * @attribute minimum+ * @type Number+ */+ minimum: {+ getter: function ()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 5009);+_yuitest_coverline("build/charts-base/charts-base.js", 5011);+var min = this._getNumber(this._setMinimum);+ _yuitest_coverline("build/charts-base/charts-base.js", 5012);+if(!Y_Lang.isNumber(min)) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 5014);+min = this._getNumber(this.get("dataMinimum"));+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5016);+return parseFloat(min);+ },+ setter: function (value)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 5018);+_yuitest_coverline("build/charts-base/charts-base.js", 5020);+this._setMinimum = this._getNumber(value);+ _yuitest_coverline("build/charts-base/charts-base.js", 5021);+return value;+ }+ },++ /**+ * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need+ * to implement the arguments below and return a `String` or an `HTMLElement`. The default implementation of the method returns a `String`. The output of this method+ * will be rendered to the DOM using `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override the Axis' + * `appendLabelFunction` to accept html as a `String`.+ * <dl>+ * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>+ * <dt>format</dt><dd>STRFTime string used to format the label. (optional)</dd>+ * </dl>+ *+ * @attribute labelFunction+ * @type Function+ */+ labelFunction: {+ value: function(val, format)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "value", 5039);+_yuitest_coverline("build/charts-base/charts-base.js", 5041);+val = Y.DataType.Date.parse(val);+ _yuitest_coverline("build/charts-base/charts-base.js", 5042);+if(format)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5044);+return Y.DataType.Date.format(val, {format:format});+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5046);+return val;+ }+ },++ /**+ * Pattern used by the `labelFunction` to format a label.+ *+ * @attribute labelFormat+ * @type String+ */+ labelFormat: {+ value: "%b %d, %y"+ }+};++_yuitest_coverline("build/charts-base/charts-base.js", 5061);+Y.extend(TimeAxis, Y.AxisType, {+ /**+ * Formats a label based on the axis type and optionally specified format.+ *+ * @method formatLabel+ * @param {Object} value+ * @param {Object} format Pattern used to format the value.+ * @return String+ */+ formatLabel: function(val, format)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "formatLabel", 5070);+_yuitest_coverline("build/charts-base/charts-base.js", 5072);+val = Y.DataType.Date.parse(val);+ _yuitest_coverline("build/charts-base/charts-base.js", 5073);+if(format)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5075);+return Y.DataType.Date.format(val, {format:format});+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5077);+return val;+ },++ /**+ * Constant used to generate unique id.+ *+ * @property GUID+ * @type String+ * @private+ */+ GUID: "yuitimeaxis",+ + /**+ * Type of data used in `Axis`.+ *+ * @property _dataType+ * @readOnly+ * @private+ */+ _dataType: "time",+ + /**+ * Calculates and returns a value based on the number of labels and the index of+ * the current label.+ *+ * @method getLabelByIndex+ * @param {Number} i Index of the label.+ * @param {Number} l Total number of labels.+ * @return String+ */+ getLabelByIndex: function(i, l)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getLabelByIndex", 5107);+_yuitest_coverline("build/charts-base/charts-base.js", 5109);+var min = this.get("minimum"),+ max = this.get("maximum"),+ position = this.get("position"),+ increm,+ label;+ _yuitest_coverline("build/charts-base/charts-base.js", 5114);+l -= 1;+ _yuitest_coverline("build/charts-base/charts-base.js", 5115);+increm = ((max - min)/l) * i;+ _yuitest_coverline("build/charts-base/charts-base.js", 5116);+if(position == "bottom" || position == "top")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5118);+label = min + increm;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5122);+label = max - increm;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5124);+return label;+ },++ /**+ * Gets an array of values based on a key.+ *+ * @method _getKeyArray+ * @param {String} key Value key associated with the data array.+ * @param {Array} data Array in which the data resides.+ * @return Array+ * @private+ */+ _getKeyArray: function(key, data)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getKeyArray", 5136);+_yuitest_coverline("build/charts-base/charts-base.js", 5138);+var obj,+ keyArray = [],+ i = 0,+ val,+ len = data.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 5143);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5145);+obj = data[i][key];+ _yuitest_coverline("build/charts-base/charts-base.js", 5146);+if(Y_Lang.isDate(obj))+ { + _yuitest_coverline("build/charts-base/charts-base.js", 5148);+val = obj.valueOf();+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5152);+val = new Date(obj);+ _yuitest_coverline("build/charts-base/charts-base.js", 5153);+if(Y_Lang.isDate(val))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5155);+val = val.valueOf();+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 5157);+if(!Y_Lang.isNumber(obj))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5159);+if(Y_Lang.isNumber(parseFloat(obj)))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5161);+val = parseFloat(obj);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5165);+if(typeof obj != "string")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5167);+obj = obj;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5169);+val = new Date(obj).valueOf();+ }+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5174);+val = obj;+ }}+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5177);+keyArray[i] = val;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5179);+return keyArray;+ },++ /**+ * Sets data by key+ *+ * @method _setDataByKey+ * @param {String} key Key value to use.+ * @param {Array} data Array to use.+ * @private + */+ _setDataByKey: function(key, data)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setDataByKey", 5190);+_yuitest_coverline("build/charts-base/charts-base.js", 5192);+var obj, + arr = [], + dv = this._dataClone.concat(), + i, + val,+ len = dv.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 5198);+for(i = 0; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5200);+obj = dv[i][key];+ _yuitest_coverline("build/charts-base/charts-base.js", 5201);+if(Y_Lang.isDate(obj))+ { + _yuitest_coverline("build/charts-base/charts-base.js", 5203);+val = obj.valueOf();+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5207);+val = new Date(obj);+ _yuitest_coverline("build/charts-base/charts-base.js", 5208);+if(Y_Lang.isDate(val))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5210);+val = val.valueOf();+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 5212);+if(!Y_Lang.isNumber(obj))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5214);+if(Y_Lang.isNumber(parseFloat(obj)))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5216);+val = parseFloat(obj);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5220);+if(typeof obj != "string")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5222);+obj = obj.toString();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5224);+val = new Date(obj).valueOf();+ }+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5229);+val = obj;+ }}+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5232);+arr[i] = val;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5234);+this.get("keys")[key] = arr;+ _yuitest_coverline("build/charts-base/charts-base.js", 5235);+this._updateTotalDataFlag = true;+ },++ /**+ * Parses value into a number.+ *+ * @method _getNumber+ * @param val {Object} Value to parse into a number+ * @return Number+ * @private+ */+ _getNumber: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getNumber", 5246);+_yuitest_coverline("build/charts-base/charts-base.js", 5248);+if(Y_Lang.isDate(val))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5250);+val = val.valueOf();+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 5252);+if(!Y_Lang.isNumber(val) && val)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5254);+val = new Date(val).valueOf();+ }}++ _yuitest_coverline("build/charts-base/charts-base.js", 5257);+return val;+ }+});++_yuitest_coverline("build/charts-base/charts-base.js", 5261);+Y.TimeAxis = TimeAxis;+ +/**+ * CategoryAxis manages category data on an axis.+ *+ * @module charts+ * @submodule charts-base+ * @class CategoryAxis+ * @constructor+ * @param {Object} config (optional) Configuration parameters for the Chart.+ * @extends AxisType+ */+_yuitest_coverline("build/charts-base/charts-base.js", 5273);+function CategoryAxis(config)+{+ _yuitest_coverfunc("build/charts-base/charts-base.js", "CategoryAxis", 5273);+_yuitest_coverline("build/charts-base/charts-base.js", 5275);+CategoryAxis.superclass.constructor.apply(this, arguments);+}++_yuitest_coverline("build/charts-base/charts-base.js", 5278);+CategoryAxis.NAME = "categoryAxis";++_yuitest_coverline("build/charts-base/charts-base.js", 5280);+Y.extend(CategoryAxis, Y.AxisType,+{+ /**+ * Formats a label based on the axis type and optionally specified format.+ *+ * @method formatLabel+ * @param {Object} value+ * @param {Object} format Pattern used to format the value.+ * @return String+ */+ formatLabel: function(val, format)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "formatLabel", 5290);+_yuitest_coverline("build/charts-base/charts-base.js", 5292);+return val;+ },++ /**+ * Object storing key data.+ *+ * @property _indices+ * @private+ */+ _indices: null,++ /**+ * Constant used to generate unique id.+ *+ * @property GUID+ * @type String+ * @private+ */+ GUID: "yuicategoryaxis",++ /**+ * Type of data used in `Axis`.+ *+ * @property _dataType+ * @readOnly+ * @private+ */+ _type: "category",+ + /**+ * Calculates the maximum and minimum values for the `Axis`.+ *+ * @method _updateMinAndMax+ * @private + */+ _updateMinAndMax: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_updateMinAndMax", 5327);+_yuitest_coverline("build/charts-base/charts-base.js", 5329);+this._dataMaximum = Math.max(this.get("data").length - 1, 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 5330);+this._dataMinimum = 0;+ },++ /**+ * Gets an array of values based on a key.+ *+ * @method _getKeyArray+ * @param {String} key Value key associated with the data array.+ * @param {Array} data Array in which the data resides.+ * @return Array+ * @private+ */+ _getKeyArray: function(key, data)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getKeyArray", 5342);+_yuitest_coverline("build/charts-base/charts-base.js", 5344);+var i = 0,+ obj,+ keyArr = [],+ labels = [],+ len = data.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 5349);+if(!this._indices)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5351);+this._indices = {};+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5353);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5355);+obj = data[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 5356);+keyArr[i] = i;+ _yuitest_coverline("build/charts-base/charts-base.js", 5357);+labels[i] = obj[key];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5359);+this._indices[key] = keyArr;+ _yuitest_coverline("build/charts-base/charts-base.js", 5360);+return labels;+ },++ /**+ * Sets data by key+ *+ * @method _setDataByKey+ * @param {String} key Key value to use.+ * @param {Array} data Array to use.+ * @private + */+ _setDataByKey: function(key)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setDataByKey", 5371);+_yuitest_coverline("build/charts-base/charts-base.js", 5373);+var i,+ obj, + arr = [], + labels = [], + dv = this._dataClone.concat(), + len = dv.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 5379);+if(!this._indices)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5381);+this._indices = {};+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5383);+for(i = 0; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5385);+obj = dv[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 5386);+arr[i] = i;+ _yuitest_coverline("build/charts-base/charts-base.js", 5387);+labels[i] = obj[key];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5389);+this._indices[key] = arr;+ _yuitest_coverline("build/charts-base/charts-base.js", 5390);+this.get("keys")[key] = labels.concat();+ _yuitest_coverline("build/charts-base/charts-base.js", 5391);+this._updateTotalDataFlag = true;+ },++ /**+ * Returns an array of values based on an identifier key.+ *+ * @method getDataByKey+ * @param {String} value value used to identify the array+ * @return Array+ */+ getDataByKey: function (value)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getDataByKey", 5401);+_yuitest_coverline("build/charts-base/charts-base.js", 5403);+if(!this._indices)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5405);+this.get("keys");+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5407);+var keys = this._indices;+ _yuitest_coverline("build/charts-base/charts-base.js", 5408);+if(keys[value])+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5410);+return keys[value];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5412);+return null;+ },++ /**+ * Returns the total number of majorUnits that will appear on an axis.+ *+ * @method getTotalMajorUnits+ * @param {Object} majorUnit Object containing properties related to the majorUnit.+ * @param {Number} len Length of the axis.+ * @return Number+ */+ getTotalMajorUnits: function(majorUnit, len)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getTotalMajorUnits", 5423);+_yuitest_coverline("build/charts-base/charts-base.js", 5425);+return this.get("data").length;+ },+ + /**+ * Returns the distance between major units on an axis.+ *+ * @method getMajorUnitDistance+ * @param {Number} len Number of ticks+ * @param {Number} uiLen Size of the axis.+ * @param {Object} majorUnit Hash of properties used to determine the majorUnit+ * @return Number+ */+ getMajorUnitDistance: function(len, uiLen, majorUnit)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getMajorUnitDistance", 5437);+_yuitest_coverline("build/charts-base/charts-base.js", 5439);+var dist;+ _yuitest_coverline("build/charts-base/charts-base.js", 5440);+if(majorUnit.determinant === "count")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5442);+dist = uiLen/len;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 5444);+if(majorUnit.determinant === "distance")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5446);+dist = majorUnit.distance;+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 5448);+return dist;+ },+ + /**+ * Gets the distance that the first and last ticks are offset from there respective+ * edges.+ *+ * @method getEdgeOffset+ * @param {Number} ct Number of ticks on the axis.+ * @param {Number} l Length (in pixels) of the axis.+ * @return Number+ */+ getEdgeOffset: function(ct, l)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getEdgeOffset", 5460);+_yuitest_coverline("build/charts-base/charts-base.js", 5462);+return l/ct;+ },++ /**+ * Returns a value based of a key value and an index.+ *+ * @method getKeyValueAt+ * @param {String} key value used to look up the correct array+ * @param {Number} index within the array+ * @return String + */+ getKeyValueAt: function(key, index)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getKeyValueAt", 5473);+_yuitest_coverline("build/charts-base/charts-base.js", 5475);+var value = NaN,+ keys = this.get("keys");+ _yuitest_coverline("build/charts-base/charts-base.js", 5477);+if(keys[key] && keys[key][index]) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 5479);+value = keys[key][index];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5481);+return value;+ },+ + /**+ * Calculates and returns a value based on the number of labels and the index of+ * the current label.+ *+ * @method getLabelByIndex+ * @param {Number} i Index of the label.+ * @param {Number} l Total number of labels.+ * @return String+ */+ getLabelByIndex: function(i, l)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getLabelByIndex", 5493);+_yuitest_coverline("build/charts-base/charts-base.js", 5495);+var label,+ data = this.get("data"),+ position = this.get("position");+ _yuitest_coverline("build/charts-base/charts-base.js", 5498);+if(position == "bottom" || position == "top")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5500);+label = data[i];+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5504);+label = data[l - (i + 1)];+ } + _yuitest_coverline("build/charts-base/charts-base.js", 5506);+return label;+ },++ /**+ * Returns a string corresponding to the first label on an + * axis.+ *+ * @method getMinimumValue+ * @return String+ */+ getMinimumValue: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getMinimumValue", 5516);+_yuitest_coverline("build/charts-base/charts-base.js", 5518);+var data = this.get("data"),+ label = data[0];+ _yuitest_coverline("build/charts-base/charts-base.js", 5520);+return label;+ },++ /**+ * Returns a string corresponding to the last label on an + * axis.+ *+ * @method getMaximumValue+ * @return String+ */+ getMaximumValue: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getMaximumValue", 5530);+_yuitest_coverline("build/charts-base/charts-base.js", 5532);+var data = this.get("data"),+ len = data.length - 1,+ label = data[len];+ _yuitest_coverline("build/charts-base/charts-base.js", 5535);+return label;+ }+});++_yuitest_coverline("build/charts-base/charts-base.js", 5539);+Y.CategoryAxis = CategoryAxis;+ +/**+ * Utility class used for calculating curve points.+ *+ * @module charts+ * @submodule charts-base+ * @class CurveUtil+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 5549);+function CurveUtil()+{+}++_yuitest_coverline("build/charts-base/charts-base.js", 5553);+CurveUtil.prototype = {+ /**+ * Creates an array of start, end and control points for splines.+ *+ * @method getCurveControlPoints+ * @param {Array} xcoords Collection of x-coordinates used for calculate the curves+ * @param {Array} ycoords Collection of y-coordinates used for calculate the curves+ * @return Object+ * @protected+ */+ getCurveControlPoints: function(xcoords, ycoords) + {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getCurveControlPoints", 5563);+_yuitest_coverline("build/charts-base/charts-base.js", 5565);+var outpoints = [],+ i = 1,+ l = xcoords.length - 1,+ xvals = [],+ yvals = [];+ + + // Too few points, need at least two+ _yuitest_coverline("build/charts-base/charts-base.js", 5573);+if (l < 1) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 5575);+return null;+ } + + _yuitest_coverline("build/charts-base/charts-base.js", 5578);+outpoints[0] = {+ startx: xcoords[0], + starty: ycoords[0],+ endx: xcoords[1],+ endy: ycoords[1]+ };+ + // Special case, the Bezier should be a straight line+ _yuitest_coverline("build/charts-base/charts-base.js", 5586);+if (l === 1) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 5588);+outpoints[0].ctrlx1 = (2.0*xcoords[0] + xcoords[1])/3.0; + _yuitest_coverline("build/charts-base/charts-base.js", 5589);+outpoints[0].ctrly2 = (2.0*ycoords[0] + ycoords[1])/3.0;+ _yuitest_coverline("build/charts-base/charts-base.js", 5590);+outpoints[0].ctrlx2 = 2.0*outpoints[0].ctrlx1 - xcoords[0];+ _yuitest_coverline("build/charts-base/charts-base.js", 5591);+outpoints[0].ctrly2 = 2.0*outpoints[0].ctrly1 - ycoords[0];+ _yuitest_coverline("build/charts-base/charts-base.js", 5592);+return outpoints;+ }++ _yuitest_coverline("build/charts-base/charts-base.js", 5595);+for (; i < l; ++i) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 5597);+outpoints.push({startx: Math.round(xcoords[i]), starty: Math.round(ycoords[i]), endx: Math.round(xcoords[i+1]), endy: Math.round(ycoords[i+1])});+ _yuitest_coverline("build/charts-base/charts-base.js", 5598);+xvals[i] = 4.0 * xcoords[i] + 2*xcoords[i+1];+ _yuitest_coverline("build/charts-base/charts-base.js", 5599);+yvals[i] = 4.0*ycoords[i] + 2*ycoords[i+1];+ }+ + _yuitest_coverline("build/charts-base/charts-base.js", 5602);+xvals[0] = xcoords[0] + (2.0 * xcoords[1]);+ _yuitest_coverline("build/charts-base/charts-base.js", 5603);+xvals[l-1] = (8.0 * xcoords[l-1] + xcoords[l]) / 2.0;+ _yuitest_coverline("build/charts-base/charts-base.js", 5604);+xvals = this.getControlPoints(xvals.concat());+ _yuitest_coverline("build/charts-base/charts-base.js", 5605);+yvals[0] = ycoords[0] + (2.0 * ycoords[1]);+ _yuitest_coverline("build/charts-base/charts-base.js", 5606);+yvals[l-1] = (8.0 * ycoords[l-1] + ycoords[l]) / 2.0; + _yuitest_coverline("build/charts-base/charts-base.js", 5607);+yvals = this.getControlPoints(yvals.concat());+ + _yuitest_coverline("build/charts-base/charts-base.js", 5609);+for (i = 0; i < l; ++i) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 5611);+outpoints[i].ctrlx1 = Math.round(xvals[i]);+ _yuitest_coverline("build/charts-base/charts-base.js", 5612);+outpoints[i].ctrly1 = Math.round(yvals[i]);+ + _yuitest_coverline("build/charts-base/charts-base.js", 5614);+if (i < l-1) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 5616);+outpoints[i].ctrlx2 = Math.round(2*xcoords[i+1] - xvals[i+1]);+ _yuitest_coverline("build/charts-base/charts-base.js", 5617);+outpoints[i].ctrly2 = Math.round(2*ycoords[i+1] - yvals[i+1]);+ }+ else + {+ _yuitest_coverline("build/charts-base/charts-base.js", 5621);+outpoints[i].ctrlx2 = Math.round((xcoords[l] + xvals[l-1])/2);+ _yuitest_coverline("build/charts-base/charts-base.js", 5622);+outpoints[i].ctrly2 = Math.round((ycoords[l] + yvals[l-1])/2);+ }+ }+ + _yuitest_coverline("build/charts-base/charts-base.js", 5626);+return outpoints; + },++ /**+ * Gets the control points for the curve.+ *+ * @method getControlPoints+ * @param {Array} vals Collection of values coords used to generate control points.+ * @return Array+ * @private+ */+ getControlPoints: function(vals) + {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getControlPoints", 5637);+_yuitest_coverline("build/charts-base/charts-base.js", 5639);+var l = vals.length,+ x = [],+ tmp = [],+ b = 2.0,+ i = 1;+ _yuitest_coverline("build/charts-base/charts-base.js", 5644);+x[0] = vals[0] / b;+ _yuitest_coverline("build/charts-base/charts-base.js", 5645);+for (; i < l; ++i) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 5647);+tmp[i] = 1/b;+ _yuitest_coverline("build/charts-base/charts-base.js", 5648);+b = (i < l-1 ? 4.0 : 3.5) - tmp[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 5649);+x[i] = (vals[i] - x[i-1]) / b;+ }+ + _yuitest_coverline("build/charts-base/charts-base.js", 5652);+for (i = 1; i < l; ++i) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 5654);+x[l-i-1] -= tmp[l-i] * x[l-i];+ }+ + _yuitest_coverline("build/charts-base/charts-base.js", 5657);+return x;+ }+};+_yuitest_coverline("build/charts-base/charts-base.js", 5660);+Y.CurveUtil = CurveUtil;+/**+ * Utility class used for creating stacked series.+ *+ * @module charts+ * @submodule charts-base+ * @class StackingUtil+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 5669);+function StackingUtil(){}++_yuitest_coverline("build/charts-base/charts-base.js", 5671);+StackingUtil.prototype = {+ /**+ * Indicates whether the series is stacked.+ *+ * @property _stacked+ * @private+ */+ _stacked: true,++ /**+ * @protected+ *+ * Adjusts coordinate values for stacked series.+ *+ * @method _stackCoordinates+ */+ _stackCoordinates: function() + {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_stackCoordinates", 5687);+_yuitest_coverline("build/charts-base/charts-base.js", 5689);+if(this.get("direction") == "vertical")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5691);+this._stackXCoords();+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5695);+this._stackYCoords();+ }+ },++ /**+ * Stacks coordinates for a stacked vertical series.+ *+ * @method _stackXCoords+ * @protected+ */+ _stackXCoords: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_stackXCoords", 5705);+_yuitest_coverline("build/charts-base/charts-base.js", 5707);+var order = this.get("order"),+ type = this.get("type"),+ graph = this.get("graph"),+ seriesCollection = graph.seriesTypes[type],+ i = 0,+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ len,+ coord,+ prevCoord,+ prevOrder,+ stackedXCoords = xcoords.concat(),+ prevXCoords,+ prevYCoords,+ nullIndices = [],+ nullIndex;+ _yuitest_coverline("build/charts-base/charts-base.js", 5723);+if(order > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5725);+prevXCoords = seriesCollection[order - 1].get("stackedXCoords");+ _yuitest_coverline("build/charts-base/charts-base.js", 5726);+prevYCoords = seriesCollection[order - 1].get("stackedYCoords");+ _yuitest_coverline("build/charts-base/charts-base.js", 5727);+len = prevXCoords.length;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5731);+len = xcoords.length;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5733);+for(; i < len; i = i + 1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5735);+if(Y_Lang.isNumber(xcoords[i]))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5737);+if(order > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5739);+prevCoord = prevXCoords[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 5740);+if(!Y_Lang.isNumber(prevCoord))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5742);+prevOrder = order;+ _yuitest_coverline("build/charts-base/charts-base.js", 5743);+while(prevOrder > - 1 && !Y_Lang.isNumber(prevCoord))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5745);+prevOrder = prevOrder - 1;+ _yuitest_coverline("build/charts-base/charts-base.js", 5746);+if(prevOrder > -1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5748);+prevCoord = seriesCollection[prevOrder].get("stackedXCoords")[i];+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5752);+prevCoord = this._leftOrigin;+ }+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5756);+xcoords[i] = xcoords[i] + prevCoord;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5758);+stackedXCoords[i] = xcoords[i];+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5762);+nullIndices.push(i);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5765);+this._cleanXNaN(stackedXCoords, ycoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 5766);+len = nullIndices.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 5767);+if(len > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5769);+for(i = 0; i < len; i = i + 1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5771);+nullIndex = nullIndices[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 5772);+coord = order > 0 ? prevXCoords[nullIndex] : this._leftOrigin;+ _yuitest_coverline("build/charts-base/charts-base.js", 5773);+stackedXCoords[nullIndex] = Math.max(stackedXCoords[nullIndex], coord);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5776);+this.set("stackedXCoords", stackedXCoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 5777);+this.set("stackedYCoords", ycoords);+ },++ /**+ * Stacks coordinates for a stacked horizontal series.+ *+ * @method _stackYCoords+ * @protected+ */+ _stackYCoords: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_stackYCoords", 5786);+_yuitest_coverline("build/charts-base/charts-base.js", 5788);+var order = this.get("order"),+ type = this.get("type"),+ graph = this.get("graph"),+ h = graph.get("height"), + seriesCollection = graph.seriesTypes[type],+ i = 0,+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ len,+ coord,+ prevCoord,+ prevOrder,+ stackedYCoords = ycoords.concat(),+ prevXCoords,+ prevYCoords,+ nullIndices = [],+ nullIndex;+ _yuitest_coverline("build/charts-base/charts-base.js", 5805);+if(order > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5807);+prevXCoords = seriesCollection[order - 1].get("stackedXCoords");+ _yuitest_coverline("build/charts-base/charts-base.js", 5808);+prevYCoords = seriesCollection[order - 1].get("stackedYCoords");+ _yuitest_coverline("build/charts-base/charts-base.js", 5809);+len = prevYCoords.length;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5813);+len = ycoords.length;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5815);+for(; i < len; i = i + 1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5817);+if(Y_Lang.isNumber(ycoords[i]))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5819);+if(order > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5821);+prevCoord = prevYCoords[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 5822);+if(!Y_Lang.isNumber(prevCoord))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5824);+prevOrder = order;+ _yuitest_coverline("build/charts-base/charts-base.js", 5825);+while(prevOrder > - 1 && !Y_Lang.isNumber(prevCoord))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5827);+prevOrder = prevOrder - 1;+ _yuitest_coverline("build/charts-base/charts-base.js", 5828);+if(prevOrder > -1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5830);+prevCoord = seriesCollection[prevOrder].get("stackedYCoords")[i];+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5834);+prevCoord = this._bottomOrigin;+ }+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5838);+ycoords[i] = prevCoord - (h - ycoords[i]);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5840);+stackedYCoords[i] = ycoords[i];+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5844);+nullIndices.push(i);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5847);+this._cleanYNaN(xcoords, stackedYCoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 5848);+len = nullIndices.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 5849);+if(len > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5851);+for(i = 0; i < len; i = i + 1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5853);+nullIndex = nullIndices[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 5854);+coord = order > 0 ? prevYCoords[nullIndex] : h;+ _yuitest_coverline("build/charts-base/charts-base.js", 5855);+stackedYCoords[nullIndex] = Math.min(stackedYCoords[nullIndex], coord);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5858);+this.set("stackedXCoords", xcoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 5859);+this.set("stackedYCoords", stackedYCoords);+ },++ /**+ * Cleans invalid x-coordinates by calculating their value based on the corresponding y-coordinate, the previous valid x-coordinate with its + * corresponding y-coordinate and the next valid x-coordinate with its corresponding y-coordinate. If there is no previous or next valid x-coordinate,+ * the value will not be altered.+ *+ * @method _cleanXNaN+ * @param {Array} xcoords An array of x-coordinate values+ * @param {Array} ycoords An arry of y-coordinate values+ * @private+ */+ _cleanXNaN: function(xcoords, ycoords)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_cleanXNaN", 5872);+_yuitest_coverline("build/charts-base/charts-base.js", 5874);+var previousValidIndex,+ nextValidIndex,+ previousValidX,+ previousValidY,+ x,+ y,+ nextValidX,+ nextValidY,+ isNumber = Y_Lang.isNumber,+ m,+ i = 0,+ len = ycoords.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 5886);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5888);+x = xcoords[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 5889);+y = ycoords[i];+ //if x is invalid, calculate where it should be+ _yuitest_coverline("build/charts-base/charts-base.js", 5891);+if(!isNumber(x) && i > 0 && i < len - 1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5893);+previousValidY = ycoords[i - 1];+ //check to see if the previous value is valid+ _yuitest_coverline("build/charts-base/charts-base.js", 5895);+previousValidX = this._getPreviousValidCoordValue(xcoords, i);+ _yuitest_coverline("build/charts-base/charts-base.js", 5896);+nextValidY = ycoords[i + 1];+ _yuitest_coverline("build/charts-base/charts-base.js", 5897);+nextValidX = this._getNextValidCoordValue(xcoords, i);+ //check to see if the next value is valid+ _yuitest_coverline("build/charts-base/charts-base.js", 5899);+if(isNumber(previousValidX) && isNumber(nextValidX))+ {+ //calculate slope and solve for x+ _yuitest_coverline("build/charts-base/charts-base.js", 5902);+m = (nextValidY - previousValidY) / (nextValidX - previousValidX);+ _yuitest_coverline("build/charts-base/charts-base.js", 5903);+xcoords[i] = (y + (m * previousValidX) - previousValidY)/m;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5905);+previousValidIndex = NaN;+ _yuitest_coverline("build/charts-base/charts-base.js", 5906);+nextValidIndex = NaN;+ }+ }+ },++ /**+ * Returns the previous valid (numeric) value in an array if available.+ *+ * @method _getPreviousValidCoordValue+ * @param {Array} coords Array of values+ * @param {Number} index The index in the array in which to begin searching.+ * @return Number+ * @private+ */+ _getPreviousValidCoordValue: function(coords, index)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getPreviousValidCoordValue", 5920);+_yuitest_coverline("build/charts-base/charts-base.js", 5922);+var coord,+ isNumber = Y_Lang.isNumber,+ limit = -1;+ _yuitest_coverline("build/charts-base/charts-base.js", 5925);+while(!isNumber(coord) && index > limit)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5927);+index = index - 1;+ _yuitest_coverline("build/charts-base/charts-base.js", 5928);+coord = coords[index];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5930);+return coord;+ },++ /**+ * Returns the next valid (numeric) value in an array if available.+ *+ * @method _getNextValidCoordValue+ * @param {Array} coords Array of values+ * @param {Number} index The index in the array in which to begin searching.+ * @return Number+ * @private+ */+ _getNextValidCoordValue: function(coords, index)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getNextValidCoordValue", 5942);+_yuitest_coverline("build/charts-base/charts-base.js", 5944);+var coord,+ isNumber = Y_Lang.isNumber,+ limit = coords.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 5947);+while(!isNumber(coord) && index < limit)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5949);+index = index + 1;+ _yuitest_coverline("build/charts-base/charts-base.js", 5950);+coord = coords[index];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5952);+return coord;+ },++ /**+ * Cleans invalid y-coordinates by calculating their value based on the corresponding x-coordinate, the previous valid y-coordinate with its + * corresponding x-coordinate and the next valid y-coordinate with its corresponding x-coordinate. If there is no previous or next valid y-coordinate,+ * the value will not be altered.+ *+ * @method _cleanYNaN+ * @param {Array} xcoords An array of x-coordinate values+ * @param {Array} ycoords An arry of y-coordinate values+ * @private+ */+ _cleanYNaN: function(xcoords, ycoords)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_cleanYNaN", 5965);+_yuitest_coverline("build/charts-base/charts-base.js", 5967);+var previousValidIndex,+ nextValidIndex,+ previousValidX,+ previousValidY,+ x,+ y,+ nextValidX,+ nextValidY,+ isNumber = Y_Lang.isNumber,+ m,+ i = 0,+ len = xcoords.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 5979);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 5981);+x = xcoords[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 5982);+y = ycoords[i];+ //if y is invalid, calculate where it should be+ _yuitest_coverline("build/charts-base/charts-base.js", 5984);+if(!isNumber(y) && i > 0 && i < len - 1)+ {+ //check to see if the previous value is valid+ _yuitest_coverline("build/charts-base/charts-base.js", 5987);+previousValidX = xcoords[i - 1];+ _yuitest_coverline("build/charts-base/charts-base.js", 5988);+previousValidY = this._getPreviousValidCoordValue(ycoords, i);+ //check to see if the next value is valid+ _yuitest_coverline("build/charts-base/charts-base.js", 5990);+nextValidX = xcoords[i + 1];+ _yuitest_coverline("build/charts-base/charts-base.js", 5991);+nextValidY = this._getNextValidCoordValue(ycoords, i);+ _yuitest_coverline("build/charts-base/charts-base.js", 5992);+if(isNumber(previousValidY) && isNumber(nextValidY))+ {+ //calculate slope and solve for y+ _yuitest_coverline("build/charts-base/charts-base.js", 5995);+m = (nextValidY - previousValidY) / (nextValidX - previousValidX);+ _yuitest_coverline("build/charts-base/charts-base.js", 5996);+ycoords[i] = previousValidY + ((m * x) - (m * previousValidX));+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 5998);+previousValidIndex = NaN;+ _yuitest_coverline("build/charts-base/charts-base.js", 5999);+nextValidIndex = NaN;+ }+ }+ }+};+_yuitest_coverline("build/charts-base/charts-base.js", 6004);+Y.StackingUtil = StackingUtil;+/**+ * Utility class used for drawing lines.+ *+ * @module charts+ * @submodule charts-base+ * @class Lines+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 6013);+function Lines(){}++_yuitest_coverline("build/charts-base/charts-base.js", 6015);+Lines.prototype = {+ /**+ * @property _lineDefaults+ * @type Object+ * @private+ */+ _lineDefaults: null,+ + /**+ * Creates a graphic in which to draw a series.+ *+ * @method _getGraphic+ * @return Graphic+ * @private+ */+ _getGraphic: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getGraphic", 6030);+_yuitest_coverline("build/charts-base/charts-base.js", 6032);+var graphic = this.get("graphic") || this.get("graph").get("graphic");+ _yuitest_coverline("build/charts-base/charts-base.js", 6033);+if(!this._lineGraphic)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6035);+this._lineGraphic = graphic.addShape({type: "path"});+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6037);+this._lineGraphic.clear();+ _yuitest_coverline("build/charts-base/charts-base.js", 6038);+return this._lineGraphic;+ },+ + /**+ * Toggles visibility+ *+ * @method _toggleVisible+ * @param {Boolean} visible indicates visibilitye+ * @private+ */+ _toggleVisible: function(visible)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_toggleVisible", 6048);+_yuitest_coverline("build/charts-base/charts-base.js", 6050);+if(this._lineGraphic)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6052);+this._lineGraphic.set("visible", visible);+ }+ },++ /**+ * Draws lines for the series.+ *+ * @method drawLines+ * @protected+ */+ drawLines: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawLines", 6062);+_yuitest_coverline("build/charts-base/charts-base.js", 6064);+if(this.get("xcoords").length < 1) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 6066);+return;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6068);+var isNumber = Y_Lang.isNumber,+ xcoords,+ ycoords,+ direction = this.get("direction"),+ len,+ lastPointValid,+ pointValid,+ noPointsRendered = true,+ lastValidX,+ lastValidY,+ nextX,+ nextY,+ i,+ styles = this.get("styles").line,+ lineType = styles.lineType,+ lc = styles.color || this._getDefaultColor(this.get("graphOrder"), "line"),+ lineAlpha = styles.alpha,+ dashLength = styles.dashLength,+ gapSpace = styles.gapSpace,+ connectDiscontinuousPoints = styles.connectDiscontinuousPoints,+ discontinuousType = styles.discontinuousType,+ discontinuousDashLength = styles.discontinuousDashLength,+ discontinuousGapSpace = styles.discontinuousGapSpace,+ path = this._getGraphic();+ _yuitest_coverline("build/charts-base/charts-base.js", 6092);+if(this._stacked)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6094);+xcoords = this.get("stackedXCoords");+ _yuitest_coverline("build/charts-base/charts-base.js", 6095);+ycoords = this.get("stackedYCoords");+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6099);+xcoords = this.get("xcoords");+ _yuitest_coverline("build/charts-base/charts-base.js", 6100);+ycoords = this.get("ycoords");+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6102);+len = direction === "vertical" ? ycoords.length : xcoords.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 6103);+path.set("stroke", {+ weight: styles.weight, + color: lc, + opacity: lineAlpha+ });+ _yuitest_coverline("build/charts-base/charts-base.js", 6108);+for(i = 0; i < len; i = ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6110);+nextX = xcoords[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 6111);+nextY = ycoords[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 6112);+pointValid = isNumber(nextX) && isNumber(nextY); + _yuitest_coverline("build/charts-base/charts-base.js", 6113);+if(!pointValid)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6115);+lastPointValid = pointValid;+ _yuitest_coverline("build/charts-base/charts-base.js", 6116);+continue;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6118);+if(noPointsRendered)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6120);+noPointsRendered = false;+ _yuitest_coverline("build/charts-base/charts-base.js", 6121);+path.moveTo(nextX, nextY);+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 6123);+if(lastPointValid)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6125);+if(lineType != "dashed")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6127);+path.lineTo(nextX, nextY);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6131);+this.drawDashedLine(path, lastValidX, lastValidY, nextX, nextY, + dashLength, + gapSpace);+ }+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 6136);+if(!connectDiscontinuousPoints)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6138);+path.moveTo(nextX, nextY);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6142);+if(discontinuousType != "solid")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6144);+this.drawDashedLine(path, lastValidX, lastValidY, nextX, nextY, + discontinuousDashLength, + discontinuousGapSpace);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6150);+path.lineTo(nextX, nextY);+ }+ }}}+ _yuitest_coverline("build/charts-base/charts-base.js", 6153);+lastValidX = nextX;+ _yuitest_coverline("build/charts-base/charts-base.js", 6154);+lastValidY = nextY;+ _yuitest_coverline("build/charts-base/charts-base.js", 6155);+lastPointValid = true;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6157);+path.end();+ },+ + /**+ * Connects data points with a consistent curve for a series.+ * + * @method drawSpline+ * @protected+ */+ drawSpline: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawSpline", 6166);+_yuitest_coverline("build/charts-base/charts-base.js", 6168);+if(this.get("xcoords").length < 1) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 6170);+return;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6172);+var xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ curvecoords = this.getCurveControlPoints(xcoords, ycoords),+ len = curvecoords.length,+ cx1,+ cx2,+ cy1,+ cy2,+ x,+ y,+ i = 0,+ styles = this.get("styles").line,+ path = this._getGraphic(),+ lineAlpha = styles.alpha,+ color = styles.color || this._getDefaultColor(this.get("graphOrder"), "line");+ _yuitest_coverline("build/charts-base/charts-base.js", 6187);+path.set("stroke", { + weight: styles.weight, + color: color, + opacity: lineAlpha+ });+ _yuitest_coverline("build/charts-base/charts-base.js", 6192);+path.moveTo(xcoords[0], ycoords[0]);+ _yuitest_coverline("build/charts-base/charts-base.js", 6193);+for(; i < len; i = ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6195);+x = curvecoords[i].endx;+ _yuitest_coverline("build/charts-base/charts-base.js", 6196);+y = curvecoords[i].endy;+ _yuitest_coverline("build/charts-base/charts-base.js", 6197);+cx1 = curvecoords[i].ctrlx1;+ _yuitest_coverline("build/charts-base/charts-base.js", 6198);+cx2 = curvecoords[i].ctrlx2;+ _yuitest_coverline("build/charts-base/charts-base.js", 6199);+cy1 = curvecoords[i].ctrly1;+ _yuitest_coverline("build/charts-base/charts-base.js", 6200);+cy2 = curvecoords[i].ctrly2;+ _yuitest_coverline("build/charts-base/charts-base.js", 6201);+path.curveTo(cx1, cy1, cx2, cy2, x, y);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6203);+path.end();+ },++ /**+ * Draws a dashed line between two points.+ * + * @method drawDashedLine+ * @param {Number} xStart The x position of the start of the line+ * @param {Number} yStart The y position of the start of the line+ * @param {Number} xEnd The x position of the end of the line+ * @param {Number} yEnd The y position of the end of the line+ * @param {Number} dashSize the size of dashes, in pixels+ * @param {Number} gapSize the size of gaps between dashes, in pixels+ * @private+ */+ drawDashedLine: function(path, xStart, yStart, xEnd, yEnd, dashSize, gapSize)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawDashedLine", 6218);+_yuitest_coverline("build/charts-base/charts-base.js", 6220);+dashSize = dashSize || 10;+ _yuitest_coverline("build/charts-base/charts-base.js", 6221);+gapSize = gapSize || 10;+ _yuitest_coverline("build/charts-base/charts-base.js", 6222);+var segmentLength = dashSize + gapSize,+ xDelta = xEnd - xStart,+ yDelta = yEnd - yStart,+ delta = Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2)),+ segmentCount = Math.floor(Math.abs(delta / segmentLength)),+ radians = Math.atan2(yDelta, xDelta),+ xCurrent = xStart,+ yCurrent = yStart,+ i;+ _yuitest_coverline("build/charts-base/charts-base.js", 6231);+xDelta = Math.cos(radians) * segmentLength;+ _yuitest_coverline("build/charts-base/charts-base.js", 6232);+yDelta = Math.sin(radians) * segmentLength;+ + _yuitest_coverline("build/charts-base/charts-base.js", 6234);+for(i = 0; i < segmentCount; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6236);+path.moveTo(xCurrent, yCurrent);+ _yuitest_coverline("build/charts-base/charts-base.js", 6237);+path.lineTo(xCurrent + Math.cos(radians) * dashSize, yCurrent + Math.sin(radians) * dashSize);+ _yuitest_coverline("build/charts-base/charts-base.js", 6238);+xCurrent += xDelta;+ _yuitest_coverline("build/charts-base/charts-base.js", 6239);+yCurrent += yDelta;+ }+ + _yuitest_coverline("build/charts-base/charts-base.js", 6242);+path.moveTo(xCurrent, yCurrent);+ _yuitest_coverline("build/charts-base/charts-base.js", 6243);+delta = Math.sqrt((xEnd - xCurrent) * (xEnd - xCurrent) + (yEnd - yCurrent) * (yEnd - yCurrent));+ + _yuitest_coverline("build/charts-base/charts-base.js", 6245);+if(delta > dashSize)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6247);+path.lineTo(xCurrent + Math.cos(radians) * dashSize, yCurrent + Math.sin(radians) * dashSize);+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 6249);+if(delta > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6251);+path.lineTo(xCurrent + Math.cos(radians) * delta, yCurrent + Math.sin(radians) * delta);+ }}+ + _yuitest_coverline("build/charts-base/charts-base.js", 6254);+path.moveTo(xEnd, yEnd);+ },++ /**+ * Default values for `styles` attribute.+ *+ * @method _getLineDefaults+ * @return Object+ * @protected+ */+ _getLineDefaults: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getLineDefaults", 6264);+_yuitest_coverline("build/charts-base/charts-base.js", 6266);+return {+ alpha: 1,+ weight: 6,+ lineType:"solid", + dashLength:10, + gapSpace:10, + connectDiscontinuousPoints:true, + discontinuousType:"solid", + discontinuousDashLength:10, + discontinuousGapSpace:10+ };+ }+};+_yuitest_coverline("build/charts-base/charts-base.js", 6279);+Y.augment(Lines, Y.Attribute);+_yuitest_coverline("build/charts-base/charts-base.js", 6280);+Y.Lines = Lines;+/**+ * Utility class used for drawing area fills.+ *+ * @module charts+ * @class Fills+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 6288);+function Fills(cfg)+{+ _yuitest_coverfunc("build/charts-base/charts-base.js", "Fills", 6288);+_yuitest_coverline("build/charts-base/charts-base.js", 6290);+var attrs = {+ area: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 6292);+_yuitest_coverline("build/charts-base/charts-base.js", 6294);+return this._defaults || this._getAreaDefaults();+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 6297);+_yuitest_coverline("build/charts-base/charts-base.js", 6299);+var defaults = this._defaults || this._getAreaDefaults();+ _yuitest_coverline("build/charts-base/charts-base.js", 6300);+this._defaults = Y.merge(defaults, val);+ }+ }+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 6304);+this.addAttrs(attrs, cfg);+ _yuitest_coverline("build/charts-base/charts-base.js", 6305);+this.get("styles");+}++_yuitest_coverline("build/charts-base/charts-base.js", 6308);+Fills.prototype = {+ /**+ * Returns a path shape used for drawing fills.+ *+ * @method _getPath+ * @return Path+ * @private+ */+ _getPath: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getPath", 6316);+_yuitest_coverline("build/charts-base/charts-base.js", 6318);+var path = this._path;+ _yuitest_coverline("build/charts-base/charts-base.js", 6319);+if(!path)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6321);+path = this.get("graph").get("graphic").addShape({type:"path"});+ _yuitest_coverline("build/charts-base/charts-base.js", 6322);+this._path = path;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6324);+return path;+ },+ + /**+ * Toggles visibility+ *+ * @method _toggleVisible+ * @param {Boolean} visible indicates visibilitye+ * @private+ */+ _toggleVisible: function(visible)+ { + _yuitest_coverfunc("build/charts-base/charts-base.js", "_toggleVisible", 6334);+_yuitest_coverline("build/charts-base/charts-base.js", 6336);+if(this._path)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6338);+this._path.set("visible", visible);+ }+ },++ /**+ * Draws fill+ *+ * @method drawFill+ * @param {Array} xcoords The x-coordinates for the series.+ * @param {Array} ycoords The y-coordinates for the series.+ * @protected+ */+ drawFill: function(xcoords, ycoords)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawFill", 6350);+_yuitest_coverline("build/charts-base/charts-base.js", 6352);+if(xcoords.length < 1) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 6354);+return;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6356);+var isNumber = Y_Lang.isNumber,+ len = xcoords.length,+ firstX = xcoords[0],+ firstY = ycoords[0],+ lastValidX = firstX,+ lastValidY = firstY,+ nextX,+ nextY,+ pointValid,+ noPointsRendered = true,+ i = 0,+ styles = this.get("styles").area,+ path = this._getPath(),+ color = styles.color || this._getDefaultColor(this.get("graphOrder"), "slice");+ _yuitest_coverline("build/charts-base/charts-base.js", 6370);+path.clear();+ _yuitest_coverline("build/charts-base/charts-base.js", 6371);+path.set("fill", {+ color: color, + opacity: styles.alpha+ });+ _yuitest_coverline("build/charts-base/charts-base.js", 6375);+path.set("stroke", {weight: 0});+ _yuitest_coverline("build/charts-base/charts-base.js", 6376);+for(; i < len; i = ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6378);+nextX = xcoords[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 6379);+nextY = ycoords[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 6380);+pointValid = isNumber(nextX) && isNumber(nextY); + _yuitest_coverline("build/charts-base/charts-base.js", 6381);+if(!pointValid)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6383);+continue;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6385);+if(noPointsRendered)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6387);+this._firstValidX = nextX;+ _yuitest_coverline("build/charts-base/charts-base.js", 6388);+this._firstValidY = nextY;+ _yuitest_coverline("build/charts-base/charts-base.js", 6389);+noPointsRendered = false;+ _yuitest_coverline("build/charts-base/charts-base.js", 6390);+path.moveTo(nextX, nextY);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6394);+path.lineTo(nextX, nextY);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6396);+lastValidX = nextX;+ _yuitest_coverline("build/charts-base/charts-base.js", 6397);+lastValidY = nextY;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6399);+this._lastValidX = lastValidX;+ _yuitest_coverline("build/charts-base/charts-base.js", 6400);+this._lastValidY = lastValidY;+ _yuitest_coverline("build/charts-base/charts-base.js", 6401);+path.end();+ },+ + /**+ * Draws a fill for a spline+ *+ * @method drawAreaSpline+ * @protected+ */+ drawAreaSpline: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawAreaSpline", 6410);+_yuitest_coverline("build/charts-base/charts-base.js", 6412);+if(this.get("xcoords").length < 1) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 6414);+return;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6416);+var xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ curvecoords = this.getCurveControlPoints(xcoords, ycoords),+ len = curvecoords.length,+ cx1,+ cx2,+ cy1,+ cy2,+ x,+ y,+ i = 0,+ firstX = xcoords[0],+ firstY = ycoords[0],+ styles = this.get("styles").area,+ path = this._getPath(),+ color = styles.color || this._getDefaultColor(this.get("graphOrder"), "slice");+ _yuitest_coverline("build/charts-base/charts-base.js", 6432);+path.set("fill", {+ color: color, + opacity: styles.alpha+ });+ _yuitest_coverline("build/charts-base/charts-base.js", 6436);+path.set("stroke", {weight: 0});+ _yuitest_coverline("build/charts-base/charts-base.js", 6437);+path.moveTo(firstX, firstY);+ _yuitest_coverline("build/charts-base/charts-base.js", 6438);+for(; i < len; i = ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6440);+x = curvecoords[i].endx;+ _yuitest_coverline("build/charts-base/charts-base.js", 6441);+y = curvecoords[i].endy;+ _yuitest_coverline("build/charts-base/charts-base.js", 6442);+cx1 = curvecoords[i].ctrlx1;+ _yuitest_coverline("build/charts-base/charts-base.js", 6443);+cx2 = curvecoords[i].ctrlx2;+ _yuitest_coverline("build/charts-base/charts-base.js", 6444);+cy1 = curvecoords[i].ctrly1;+ _yuitest_coverline("build/charts-base/charts-base.js", 6445);+cy2 = curvecoords[i].ctrly2;+ _yuitest_coverline("build/charts-base/charts-base.js", 6446);+path.curveTo(cx1, cy1, cx2, cy2, x, y);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6448);+if(this.get("direction") === "vertical")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6450);+path.lineTo(this._leftOrigin, y);+ _yuitest_coverline("build/charts-base/charts-base.js", 6451);+path.lineTo(this._leftOrigin, firstY);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6455);+path.lineTo(x, this._bottomOrigin);+ _yuitest_coverline("build/charts-base/charts-base.js", 6456);+path.lineTo(firstX, this._bottomOrigin);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6458);+path.lineTo(firstX, firstY);+ _yuitest_coverline("build/charts-base/charts-base.js", 6459);+path.end();+ },+ + /**+ * Draws a a stacked area spline+ *+ * @method drawStackedAreaSpline+ * @protected+ */+ drawStackedAreaSpline: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawStackedAreaSpline", 6468);+_yuitest_coverline("build/charts-base/charts-base.js", 6470);+if(this.get("xcoords").length < 1) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 6472);+return;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6474);+var xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ curvecoords,+ order = this.get("order"),+ type = this.get("type"),+ graph = this.get("graph"),+ seriesCollection = graph.seriesTypes[type],+ prevXCoords,+ prevYCoords,+ len,+ cx1,+ cx2,+ cy1,+ cy2,+ x,+ y,+ i = 0,+ firstX,+ firstY,+ styles = this.get("styles").area,+ path = this._getPath(),+ color = styles.color || this._getDefaultColor(this.get("graphOrder"), "slice");+ _yuitest_coverline("build/charts-base/charts-base.js", 6496);+firstX = xcoords[0];+ _yuitest_coverline("build/charts-base/charts-base.js", 6497);+firstY = ycoords[0];+ _yuitest_coverline("build/charts-base/charts-base.js", 6498);+curvecoords = this.getCurveControlPoints(xcoords, ycoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 6499);+len = curvecoords.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 6500);+path.set("fill", {+ color: color, + opacity: styles.alpha+ });+ _yuitest_coverline("build/charts-base/charts-base.js", 6504);+path.set("stroke", {weight: 0});+ _yuitest_coverline("build/charts-base/charts-base.js", 6505);+path.moveTo(firstX, firstY);+ _yuitest_coverline("build/charts-base/charts-base.js", 6506);+for(; i < len; i = ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6508);+x = curvecoords[i].endx;+ _yuitest_coverline("build/charts-base/charts-base.js", 6509);+y = curvecoords[i].endy;+ _yuitest_coverline("build/charts-base/charts-base.js", 6510);+cx1 = curvecoords[i].ctrlx1;+ _yuitest_coverline("build/charts-base/charts-base.js", 6511);+cx2 = curvecoords[i].ctrlx2;+ _yuitest_coverline("build/charts-base/charts-base.js", 6512);+cy1 = curvecoords[i].ctrly1;+ _yuitest_coverline("build/charts-base/charts-base.js", 6513);+cy2 = curvecoords[i].ctrly2;+ _yuitest_coverline("build/charts-base/charts-base.js", 6514);+path.curveTo(cx1, cy1, cx2, cy2, x, y);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6516);+if(order > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6518);+prevXCoords = seriesCollection[order - 1].get("xcoords").concat().reverse();+ _yuitest_coverline("build/charts-base/charts-base.js", 6519);+prevYCoords = seriesCollection[order - 1].get("ycoords").concat().reverse();+ _yuitest_coverline("build/charts-base/charts-base.js", 6520);+curvecoords = this.getCurveControlPoints(prevXCoords, prevYCoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 6521);+i = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 6522);+len = curvecoords.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 6523);+path.lineTo(prevXCoords[0], prevYCoords[0]);+ _yuitest_coverline("build/charts-base/charts-base.js", 6524);+for(; i < len; i = ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6526);+x = curvecoords[i].endx;+ _yuitest_coverline("build/charts-base/charts-base.js", 6527);+y = curvecoords[i].endy;+ _yuitest_coverline("build/charts-base/charts-base.js", 6528);+cx1 = curvecoords[i].ctrlx1;+ _yuitest_coverline("build/charts-base/charts-base.js", 6529);+cx2 = curvecoords[i].ctrlx2;+ _yuitest_coverline("build/charts-base/charts-base.js", 6530);+cy1 = curvecoords[i].ctrly1;+ _yuitest_coverline("build/charts-base/charts-base.js", 6531);+cy2 = curvecoords[i].ctrly2;+ _yuitest_coverline("build/charts-base/charts-base.js", 6532);+path.curveTo(cx1, cy1, cx2, cy2, x, y);+ }+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6537);+if(this.get("direction") === "vertical")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6539);+path.lineTo(this._leftOrigin, ycoords[ycoords.length-1]);+ _yuitest_coverline("build/charts-base/charts-base.js", 6540);+path.lineTo(this._leftOrigin, firstY);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6544);+path.lineTo(xcoords[xcoords.length-1], this._bottomOrigin);+ _yuitest_coverline("build/charts-base/charts-base.js", 6545);+path.lineTo(firstX, this._bottomOrigin);+ }++ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6549);+path.lineTo(firstX, firstY);+ _yuitest_coverline("build/charts-base/charts-base.js", 6550);+path.end();+ },+ + /**+ * Storage for default area styles.+ *+ * @property _defaults+ * @type Object+ * @private+ */+ _defaults: null,++ /**+ * Concatenates coordinate array with correct coordinates for closing an area fill.+ *+ * @method _getClosingPoints+ * @return Array+ * @protected+ */+ _getClosingPoints: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getClosingPoints", 6569);+_yuitest_coverline("build/charts-base/charts-base.js", 6571);+var xcoords = this.get("xcoords").concat(),+ ycoords = this.get("ycoords").concat(),+ firstValidIndex,+ lastValidIndex;+ _yuitest_coverline("build/charts-base/charts-base.js", 6575);+if(this.get("direction") === "vertical")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6577);+lastValidIndex = this._getLastValidIndex(xcoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 6578);+firstValidIndex = this._getFirstValidIndex(xcoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 6579);+ycoords.push(ycoords[lastValidIndex]);+ _yuitest_coverline("build/charts-base/charts-base.js", 6580);+ycoords.push(ycoords[firstValidIndex]);+ _yuitest_coverline("build/charts-base/charts-base.js", 6581);+xcoords.push(this._leftOrigin);+ _yuitest_coverline("build/charts-base/charts-base.js", 6582);+xcoords.push(this._leftOrigin);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6586);+lastValidIndex = this._getLastValidIndex(ycoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 6587);+firstValidIndex = this._getFirstValidIndex(ycoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 6588);+xcoords.push(xcoords[lastValidIndex]);+ _yuitest_coverline("build/charts-base/charts-base.js", 6589);+xcoords.push(xcoords[firstValidIndex]);+ _yuitest_coverline("build/charts-base/charts-base.js", 6590);+ycoords.push(this._bottomOrigin);+ _yuitest_coverline("build/charts-base/charts-base.js", 6591);+ycoords.push(this._bottomOrigin);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6593);+xcoords.push(xcoords[0]);+ _yuitest_coverline("build/charts-base/charts-base.js", 6594);+ycoords.push(ycoords[0]);+ _yuitest_coverline("build/charts-base/charts-base.js", 6595);+return [xcoords, ycoords];+ },++ /**+ * Returns the order of the series closest to the current series that has a valid value for the current index.+ *+ * @method _getHighestValidOrder+ * @param {Array} seriesCollection Array of series of a given type.+ * @param {Number} index Index of the series item.+ * @param {Number} order Index of the the series in the seriesCollection+ * @param {String} direction Indicates the direction of the series+ * @return Number+ * @private+ */+ _getHighestValidOrder: function(seriesCollection, index, order, direction)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getHighestValidOrder", 6609);+_yuitest_coverline("build/charts-base/charts-base.js", 6611);+var coords = direction == "vertical" ? "stackedXCoords" : "stackedYCoords",+ coord;+ _yuitest_coverline("build/charts-base/charts-base.js", 6613);+while(isNaN(coord) && order > -1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6615);+order = order - 1;+ _yuitest_coverline("build/charts-base/charts-base.js", 6616);+if(order > -1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6618);+coord = seriesCollection[order].get(coords)[index];+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6621);+return order;+ },+ + /**+ * Returns an array containing the x and y coordinates for a given series and index.+ *+ * @method _getCoordsByOrderAndIndex+ * @param {Array} seriesCollection Array of series of a given type.+ * @param {Number} index Index of the series item.+ * @param {Number} order Index of the the series in the seriesCollection+ * @param {String} direction Indicates the direction of the series+ * @return Array+ * @private+ */+ _getCoordsByOrderAndIndex: function(seriesCollection, index, order, direction)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getCoordsByOrderAndIndex", 6635);+_yuitest_coverline("build/charts-base/charts-base.js", 6637);+var xcoord,+ ycoord;+ _yuitest_coverline("build/charts-base/charts-base.js", 6639);+if(direction == "vertical")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6641);+xcoord = order < 0 ? this._leftOrigin : seriesCollection[order].get("stackedXCoords")[index];+ _yuitest_coverline("build/charts-base/charts-base.js", 6642);+ycoord = this.get("stackedYCoords")[index];+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6646);+xcoord = this.get("stackedXCoords")[index];+ _yuitest_coverline("build/charts-base/charts-base.js", 6647);+ycoord = order < 0 ? this._bottomOrigin : seriesCollection[order].get("stackedYCoords")[index];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6649);+return [xcoord, ycoord];+ },+ + /**+ * Concatenates coordinate array with the correct coordinates for closing an area stack.+ *+ * @method _getStackedClosingPoints+ * @return Array+ * @protected+ */+ _getStackedClosingPoints: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getStackedClosingPoints", 6659);+_yuitest_coverline("build/charts-base/charts-base.js", 6661);+var order = this.get("order"),+ type = this.get("type"),+ graph = this.get("graph"),+ direction = this.get("direction"),+ seriesCollection = graph.seriesTypes[type],+ firstValidIndex,+ lastValidIndex,+ xcoords = this.get("stackedXCoords"),+ ycoords = this.get("stackedYCoords"),+ limit,+ previousSeries,+ previousSeriesFirstValidIndex,+ previousSeriesLastValidIndex,+ previousXCoords,+ previousYCoords,+ coords,+ closingXCoords,+ closingYCoords,+ currentIndex,+ highestValidOrder,+ oldOrder;+ _yuitest_coverline("build/charts-base/charts-base.js", 6682);+if(order < 1)+ { + _yuitest_coverline("build/charts-base/charts-base.js", 6684);+return this._getClosingPoints();+ }+ + _yuitest_coverline("build/charts-base/charts-base.js", 6687);+previousSeries = seriesCollection[order - 1];+ _yuitest_coverline("build/charts-base/charts-base.js", 6688);+previousXCoords = previousSeries.get("stackedXCoords").concat();+ _yuitest_coverline("build/charts-base/charts-base.js", 6689);+previousYCoords = previousSeries.get("stackedYCoords").concat();+ _yuitest_coverline("build/charts-base/charts-base.js", 6690);+if(direction == "vertical")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6692);+firstValidIndex = this._getFirstValidIndex(xcoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 6693);+lastValidIndex = this._getLastValidIndex(xcoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 6694);+previousSeriesFirstValidIndex = previousSeries._getFirstValidIndex(previousXCoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 6695);+previousSeriesLastValidIndex = previousSeries._getLastValidIndex(previousXCoords);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6699);+firstValidIndex = this._getFirstValidIndex(ycoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 6700);+lastValidIndex = this._getLastValidIndex(ycoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 6701);+previousSeriesFirstValidIndex = previousSeries._getFirstValidIndex(previousYCoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 6702);+previousSeriesLastValidIndex = previousSeries._getLastValidIndex(previousYCoords);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6704);+if(previousSeriesLastValidIndex >= firstValidIndex && previousSeriesFirstValidIndex <= lastValidIndex)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6706);+previousSeriesFirstValidIndex = Math.max(firstValidIndex, previousSeriesFirstValidIndex);+ _yuitest_coverline("build/charts-base/charts-base.js", 6707);+previousSeriesLastValidIndex = Math.min(lastValidIndex, previousSeriesLastValidIndex);+ _yuitest_coverline("build/charts-base/charts-base.js", 6708);+previousXCoords = previousXCoords.slice(previousSeriesFirstValidIndex, previousSeriesLastValidIndex + 1);+ _yuitest_coverline("build/charts-base/charts-base.js", 6709);+previousYCoords = previousYCoords.slice(previousSeriesFirstValidIndex, previousSeriesLastValidIndex + 1);+ _yuitest_coverline("build/charts-base/charts-base.js", 6710);+limit = previousSeriesFirstValidIndex;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6714);+limit = lastValidIndex;+ }++ _yuitest_coverline("build/charts-base/charts-base.js", 6717);+closingXCoords = [xcoords[firstValidIndex]];+ _yuitest_coverline("build/charts-base/charts-base.js", 6718);+closingYCoords = [ycoords[firstValidIndex]];+ _yuitest_coverline("build/charts-base/charts-base.js", 6719);+currentIndex = firstValidIndex;+ _yuitest_coverline("build/charts-base/charts-base.js", 6720);+while((isNaN(highestValidOrder) || highestValidOrder < order - 1) && currentIndex <= limit)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6722);+oldOrder = highestValidOrder;+ _yuitest_coverline("build/charts-base/charts-base.js", 6723);+highestValidOrder = this._getHighestValidOrder(seriesCollection, currentIndex, order, direction);+ _yuitest_coverline("build/charts-base/charts-base.js", 6724);+if(!isNaN(oldOrder) && highestValidOrder > oldOrder)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6726);+coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, oldOrder, direction);+ _yuitest_coverline("build/charts-base/charts-base.js", 6727);+closingXCoords.push(coords[0]);+ _yuitest_coverline("build/charts-base/charts-base.js", 6728);+closingYCoords.push(coords[1]);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6730);+coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, highestValidOrder, direction);+ _yuitest_coverline("build/charts-base/charts-base.js", 6731);+closingXCoords.push(coords[0]);+ _yuitest_coverline("build/charts-base/charts-base.js", 6732);+closingYCoords.push(coords[1]);+ _yuitest_coverline("build/charts-base/charts-base.js", 6733);+currentIndex = currentIndex + 1;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6735);+if(previousXCoords && previousXCoords.length > 0 && previousSeriesLastValidIndex > firstValidIndex && previousSeriesFirstValidIndex < lastValidIndex)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6737);+closingXCoords = closingXCoords.concat(previousXCoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 6738);+closingYCoords = closingYCoords.concat(previousYCoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 6739);+highestValidOrder = order -1; + }+ _yuitest_coverline("build/charts-base/charts-base.js", 6741);+currentIndex = Math.max(firstValidIndex, previousSeriesLastValidIndex);+ _yuitest_coverline("build/charts-base/charts-base.js", 6742);+order = order - 1;+ _yuitest_coverline("build/charts-base/charts-base.js", 6743);+highestValidOrder = NaN;+ _yuitest_coverline("build/charts-base/charts-base.js", 6744);+while(currentIndex <= lastValidIndex)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6746);+oldOrder = highestValidOrder;+ _yuitest_coverline("build/charts-base/charts-base.js", 6747);+highestValidOrder = this._getHighestValidOrder(seriesCollection, currentIndex, order, direction);+ _yuitest_coverline("build/charts-base/charts-base.js", 6748);+if(!isNaN(oldOrder))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6750);+if(highestValidOrder > oldOrder)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6752);+coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, oldOrder, direction);+ _yuitest_coverline("build/charts-base/charts-base.js", 6753);+closingXCoords.push(coords[0]);+ _yuitest_coverline("build/charts-base/charts-base.js", 6754);+closingYCoords.push(coords[1]);+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 6756);+if(highestValidOrder < oldOrder)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6758);+coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex - 1, highestValidOrder, direction);+ _yuitest_coverline("build/charts-base/charts-base.js", 6759);+closingXCoords.push(coords[0]);+ _yuitest_coverline("build/charts-base/charts-base.js", 6760);+closingYCoords.push(coords[1]);+ }}+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6763);+coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, highestValidOrder, direction);+ _yuitest_coverline("build/charts-base/charts-base.js", 6764);+closingXCoords.push(coords[0]);+ _yuitest_coverline("build/charts-base/charts-base.js", 6765);+closingYCoords.push(coords[1]);+ _yuitest_coverline("build/charts-base/charts-base.js", 6766);+currentIndex = currentIndex + 1;+ }++ _yuitest_coverline("build/charts-base/charts-base.js", 6769);+closingXCoords.reverse();+ _yuitest_coverline("build/charts-base/charts-base.js", 6770);+closingYCoords.reverse();+ _yuitest_coverline("build/charts-base/charts-base.js", 6771);+return [xcoords.concat(closingXCoords), ycoords.concat(closingYCoords)];+ },++ /**+ * Returns default values for area styles.+ *+ * @method _getAreaDefaults+ * @return Object+ * @private+ */+ _getAreaDefaults: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getAreaDefaults", 6781);+_yuitest_coverline("build/charts-base/charts-base.js", 6783);+return {+ };+ }+};+_yuitest_coverline("build/charts-base/charts-base.js", 6787);+Y.augment(Fills, Y.Attribute);+_yuitest_coverline("build/charts-base/charts-base.js", 6788);+Y.Fills = Fills;+/**+ * Utility class used for drawing markers.+ *+ * @module charts+ * @submodule charts-base+ * @class Plots+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 6797);+function Plots(cfg)+{+ _yuitest_coverfunc("build/charts-base/charts-base.js", "Plots", 6797);+_yuitest_coverline("build/charts-base/charts-base.js", 6799);+var attrs = { + markers: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 6801);+_yuitest_coverline("build/charts-base/charts-base.js", 6803);+return this._markers;+ }+ }+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 6807);+this.addAttrs(attrs, cfg);+}++_yuitest_coverline("build/charts-base/charts-base.js", 6810);+Plots.prototype = {+ /**+ * Storage for default marker styles.+ *+ * @property _plotDefaults+ * @type Object+ * @private+ */+ _plotDefaults: null,++ /**+ * Draws the markers+ *+ * @method drawPlots+ * @protected+ */+ drawPlots: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawPlots", 6826);+_yuitest_coverline("build/charts-base/charts-base.js", 6828);+if(!this.get("xcoords") || this.get("xcoords").length < 1) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 6830);+return;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6832);+var isNumber = Y_Lang.isNumber,+ style = Y.clone(this.get("styles").marker),+ w = style.width,+ h = style.height,+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ i = 0,+ len = xcoords.length,+ top = ycoords[0],+ left,+ marker,+ offsetWidth = w/2,+ offsetHeight = h/2,+ xvalues,+ yvalues,+ fillColors = null,+ borderColors = null,+ graphOrder = this.get("graphOrder"),+ groupMarkers = this.get("groupMarkers");+ _yuitest_coverline("build/charts-base/charts-base.js", 6851);+if(groupMarkers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6853);+xvalues = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 6854);+yvalues = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 6855);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6857);+xvalues.push(parseFloat(xcoords[i] - offsetWidth));+ _yuitest_coverline("build/charts-base/charts-base.js", 6858);+yvalues.push(parseFloat(ycoords[i] - offsetHeight));+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6860);+this._createGroupMarker({+ xvalues: xvalues,+ yvalues: yvalues,+ fill: style.fill,+ border: style.border,+ dimensions: {+ width: w,+ height: h+ },+ graphOrder: graphOrder,+ shape: style.shape+ });+ _yuitest_coverline("build/charts-base/charts-base.js", 6872);+return;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6874);+if(Y_Lang.isArray(style.fill.color))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6876);+fillColors = style.fill.color.concat(); + }+ _yuitest_coverline("build/charts-base/charts-base.js", 6878);+if(Y_Lang.isArray(style.border.color))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6880);+borderColors = style.border.color.concat();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6882);+this._createMarkerCache();+ _yuitest_coverline("build/charts-base/charts-base.js", 6883);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6885);+top = parseFloat(ycoords[i] - offsetHeight);+ _yuitest_coverline("build/charts-base/charts-base.js", 6886);+left = parseFloat(xcoords[i] - offsetWidth); + _yuitest_coverline("build/charts-base/charts-base.js", 6887);+if(!isNumber(left) || !isNumber(top))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6889);+this._markers.push(null);+ _yuitest_coverline("build/charts-base/charts-base.js", 6890);+continue;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6892);+if(fillColors)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6894);+style.fill.color = fillColors[i % fillColors.length];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6896);+if(borderColors)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6898);+style.border.color = borderColors[i % borderColors.length];+ }++ _yuitest_coverline("build/charts-base/charts-base.js", 6901);+style.x = left;+ _yuitest_coverline("build/charts-base/charts-base.js", 6902);+style.y = top;+ _yuitest_coverline("build/charts-base/charts-base.js", 6903);+marker = this.getMarker(style, graphOrder, i);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6905);+this._clearMarkerCache();+ },++ /**+ * Pre-defined group shapes.+ *+ * @property _groupShapes+ * @private+ */+ _groupShapes: {+ circle: Y.CircleGroup,+ rect: Y.RectGroup,+ ellipse: Y.EllipseGroup,+ diamond: Y.DiamondGroup+ },++ /**+ * Returns the correct group shape class.+ *+ * @method _getGroupShape+ * @param {Shape | String} shape Indicates which shape class. + * @return Function+ * @protected+ */+ _getGroupShape: function(shape)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getGroupShape", 6929);+_yuitest_coverline("build/charts-base/charts-base.js", 6931);+if(Y_Lang.isString(shape))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 6933);+shape = this._groupShapes[shape];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 6935);+return shape;+ },++ /**+ * Gets the default values for series that use the utility. This method is used by+ * the class' `styles` attribute's getter to get build default values.+ *+ * @method _getPlotDefaults+ * @return Object+ * @protected+ */+ _getPlotDefaults: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getPlotDefaults", 6946);+_yuitest_coverline("build/charts-base/charts-base.js", 6948);+var defs = {+ fill:{+ type: "solid",+ alpha: 1,+ colors:null,+ alphas: null,+ ratios: null+ },+ border:{+ weight: 1,+ alpha: 1+ },+ width: 10,+ height: 10,+ shape: "circle"+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 6964);+defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");+ _yuitest_coverline("build/charts-base/charts-base.js", 6965);+defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");+ _yuitest_coverline("build/charts-base/charts-base.js", 6966);+return defs;+ },++ /**+ * Collection of markers to be used in the series.+ *+ * @property _markers+ * @type Array+ * @private+ */+ _markers: null,++ /**+ * Collection of markers to be re-used on a series redraw.+ *+ * @property _markerCache+ * @type Array+ * @private+ */+ _markerCache: null,+ + /**+ * Gets and styles a marker. If there is a marker in cache, it will use it. Otherwise+ * it will create one.+ *+ * @method getMarker+ * @param {Object} styles Hash of style properties.+ * @param {Number} order Order of the series.+ * @param {Number} index Index within the series associated with the marker.+ * @return Shape+ * @protected+ */+ getMarker: function(styles, order, index)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getMarker", 6998);+_yuitest_coverline("build/charts-base/charts-base.js", 7000);+var marker,+ border = styles.border;+ _yuitest_coverline("build/charts-base/charts-base.js", 7002);+styles.id = this.get("chart").get("id") + "_" + order + "_" + index;+ //fix name differences between graphic layer+ _yuitest_coverline("build/charts-base/charts-base.js", 7004);+border.opacity = border.alpha;+ _yuitest_coverline("build/charts-base/charts-base.js", 7005);+styles.stroke = border;+ _yuitest_coverline("build/charts-base/charts-base.js", 7006);+styles.fill.opacity = styles.fill.alpha;+ _yuitest_coverline("build/charts-base/charts-base.js", 7007);+if(this._markerCache.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7009);+while(!marker)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7011);+if(this._markerCache.length < 1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7013);+marker = this._createMarker(styles, order, index);+ _yuitest_coverline("build/charts-base/charts-base.js", 7014);+break;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7016);+marker = this._markerCache.shift();++ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7019);+marker.set(styles);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7023);+marker = this._createMarker(styles, order, index);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7025);+this._markers.push(marker);+ _yuitest_coverline("build/charts-base/charts-base.js", 7026);+return marker;+ },+ + /**+ * Creates a shape to be used as a marker.+ *+ * @method _createMarker+ * @param {Object} styles Hash of style properties.+ * @param {Number} order Order of the series.+ * @param {Number} index Index within the series associated with the marker.+ * @return Shape+ * @private+ */+ _createMarker: function(styles, order, index)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_createMarker", 7039);+_yuitest_coverline("build/charts-base/charts-base.js", 7041);+var graphic = this.get("graphic"),+ marker,+ cfg = Y.clone(styles);+ _yuitest_coverline("build/charts-base/charts-base.js", 7044);+graphic.set("autoDraw", false);+ _yuitest_coverline("build/charts-base/charts-base.js", 7045);+cfg.type = cfg.shape;+ _yuitest_coverline("build/charts-base/charts-base.js", 7046);+marker = graphic.addShape(cfg); + _yuitest_coverline("build/charts-base/charts-base.js", 7047);+marker.addClass(SERIES_MARKER);+ _yuitest_coverline("build/charts-base/charts-base.js", 7048);+return marker;+ },+ + /**+ * Creates a cache of markers for reuse.+ *+ * @method _createMarkerCache+ * @private+ */+ _createMarkerCache: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_createMarkerCache", 7057);+_yuitest_coverline("build/charts-base/charts-base.js", 7059);+if(this._groupMarker)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7061);+this._groupMarker.destroy();+ _yuitest_coverline("build/charts-base/charts-base.js", 7062);+this._groupMarker = null;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7064);+if(this._markers && this._markers.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7066);+this._markerCache = this._markers.concat();+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7070);+this._markerCache = [];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7072);+this._markers = [];+ },+ + /**+ * Draws a series of markers in a single shape instance.+ *+ * @method _createGroupMarkers+ * @param {Object} styles Set of configuration properties used to create the markers.+ * @protected+ */+ _createGroupMarker: function(styles)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_createGroupMarker", 7082);+_yuitest_coverline("build/charts-base/charts-base.js", 7084);+var marker,+ markers = this.get("markers"),+ border = styles.border,+ graphic,+ cfg,+ shape;+ _yuitest_coverline("build/charts-base/charts-base.js", 7090);+if(markers && markers.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7092);+while(markers.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7094);+marker = markers.shift();+ _yuitest_coverline("build/charts-base/charts-base.js", 7095);+marker.destroy();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7097);+this.set("markers", []);+ }+ //fix name differences between graphic layer+ _yuitest_coverline("build/charts-base/charts-base.js", 7100);+border.opacity = border.alpha;+ _yuitest_coverline("build/charts-base/charts-base.js", 7101);+cfg = {+ id: this.get("chart").get("id") + "_" + styles.graphOrder,+ stroke: border,+ fill: styles.fill,+ dimensions: styles.dimensions,+ xvalues: styles.xvalues,+ yvalues: styles.yvalues+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 7109);+cfg.fill.opacity = styles.fill.alpha;+ _yuitest_coverline("build/charts-base/charts-base.js", 7110);+shape = this._getGroupShape(styles.shape);+ _yuitest_coverline("build/charts-base/charts-base.js", 7111);+if(shape)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7113);+cfg.type = shape;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7115);+if(styles.hasOwnProperty("radius") && !isNaN(styles.radius))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7117);+cfg.dimensions.radius = styles.radius;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7119);+if(this._groupMarker)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7121);+this._groupMarker.destroy();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7123);+graphic = this.get("graphic");+ _yuitest_coverline("build/charts-base/charts-base.js", 7124);+this._groupMarker = graphic.addShape(cfg);+ _yuitest_coverline("build/charts-base/charts-base.js", 7125);+graphic._redraw();+ },++ /**+ * Toggles visibility+ *+ * @method _toggleVisible+ * @param {Boolean} visible indicates visibilitye+ * @private+ */+ _toggleVisible: function(visible)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_toggleVisible", 7135);+_yuitest_coverline("build/charts-base/charts-base.js", 7137);+var marker,+ markers = this.get("markers"),+ i = 0,+ len;+ _yuitest_coverline("build/charts-base/charts-base.js", 7141);+if(markers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7143);+len = markers.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 7144);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7146);+marker = markers[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 7147);+if(marker)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7149);+marker.set("visible", visible);+ }+ }+ }+ },++ /**+ * Removes unused markers from the marker cache+ *+ * @method _clearMarkerCache+ * @private+ */+ _clearMarkerCache: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_clearMarkerCache", 7161);+_yuitest_coverline("build/charts-base/charts-base.js", 7163);+var marker;+ _yuitest_coverline("build/charts-base/charts-base.js", 7164);+while(this._markerCache.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7166);+marker = this._markerCache.shift();+ _yuitest_coverline("build/charts-base/charts-base.js", 7167);+if(marker)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7169);+marker.destroy();+ }+ }+ },++ /**+ * Resizes and positions markers based on a mouse interaction.+ *+ * @method updateMarkerState+ * @param {String} type state of the marker+ * @param {Number} i index of the marker+ * @protected+ */+ updateMarkerState: function(type, i)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "updateMarkerState", 7182);+_yuitest_coverline("build/charts-base/charts-base.js", 7184);+if(this._markers && this._markers[i])+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7186);+var w,+ h,+ styles = Y.clone(this.get("styles").marker),+ state = this._getState(type),+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ marker = this._markers[i],+ markerStyles = state == "off" || !styles[state] ? styles : styles[state]; + _yuitest_coverline("build/charts-base/charts-base.js", 7194);+markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);+ _yuitest_coverline("build/charts-base/charts-base.js", 7195);+markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);+ _yuitest_coverline("build/charts-base/charts-base.js", 7196);+markerStyles.stroke = markerStyles.border;+ _yuitest_coverline("build/charts-base/charts-base.js", 7197);+marker.set(markerStyles);+ _yuitest_coverline("build/charts-base/charts-base.js", 7198);+w = markerStyles.width;+ _yuitest_coverline("build/charts-base/charts-base.js", 7199);+h = markerStyles.height;+ _yuitest_coverline("build/charts-base/charts-base.js", 7200);+marker.set("x", (xcoords[i] - w/2));+ _yuitest_coverline("build/charts-base/charts-base.js", 7201);+marker.set("y", (ycoords[i] - h/2));+ _yuitest_coverline("build/charts-base/charts-base.js", 7202);+marker.set("visible", this.get("visible"));+ }+ },++ /**+ * Parses a color from an array.+ *+ * @method _getItemColor+ * @param {Array} val collection of colors+ * @param {Number} i index of the item+ * @return String+ * @protected+ */+ _getItemColor: function(val, i)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getItemColor", 7215);+_yuitest_coverline("build/charts-base/charts-base.js", 7217);+if(Y_Lang.isArray(val))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7219);+return val[i % val.length];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7221);+return val;+ },++ /**+ * Method used by `styles` setter. Overrides base implementation.+ *+ * @method _setStyles+ * @param {Object} newStyles Hash of properties to update.+ * @return Object+ * @protected+ */+ _setStyles: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setStyles", 7232);+_yuitest_coverline("build/charts-base/charts-base.js", 7234);+val = this._parseMarkerStyles(val);+ _yuitest_coverline("build/charts-base/charts-base.js", 7235);+return Y.Renderer.prototype._setStyles.apply(this, [val]);+ },++ /**+ * Combines new styles with existing styles.+ *+ * @method _parseMarkerStyles+ * @param {Object} Object containing style properties for the marker.+ * @return Object+ * @private+ */+ _parseMarkerStyles: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_parseMarkerStyles", 7246);+_yuitest_coverline("build/charts-base/charts-base.js", 7248);+if(val.marker)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7250);+var defs = this._getPlotDefaults();+ _yuitest_coverline("build/charts-base/charts-base.js", 7251);+val.marker = this._mergeStyles(val.marker, defs);+ _yuitest_coverline("build/charts-base/charts-base.js", 7252);+if(val.marker.over)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7254);+val.marker.over = this._mergeStyles(val.marker.over, val.marker);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7256);+if(val.marker.down)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7258);+val.marker.down = this._mergeStyles(val.marker.down, val.marker);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7261);+return val;+ },++ /**+ * Returns marker state based on event type+ *+ * @method _getState+ * @param {String} type event type+ * @return String+ * @protected+ */+ _getState: function(type)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getState", 7272);+_yuitest_coverline("build/charts-base/charts-base.js", 7274);+var state;+ _yuitest_coverline("build/charts-base/charts-base.js", 7275);+switch(type)+ {+ case "mouseout" :+ _yuitest_coverline("build/charts-base/charts-base.js", 7278);+state = "off";+ _yuitest_coverline("build/charts-base/charts-base.js", 7279);+break;+ case "mouseover" :+ _yuitest_coverline("build/charts-base/charts-base.js", 7281);+state = "over";+ _yuitest_coverline("build/charts-base/charts-base.js", 7282);+break;+ case "mouseup" :+ _yuitest_coverline("build/charts-base/charts-base.js", 7284);+state = "over";+ _yuitest_coverline("build/charts-base/charts-base.js", 7285);+break;+ case "mousedown" :+ _yuitest_coverline("build/charts-base/charts-base.js", 7287);+state = "down";+ _yuitest_coverline("build/charts-base/charts-base.js", 7288);+break;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7290);+return state;+ },+ + /**+ * @property _statSyles+ * @type Object+ * @private+ */+ _stateSyles: null+};++_yuitest_coverline("build/charts-base/charts-base.js", 7301);+Y.augment(Plots, Y.Attribute);+_yuitest_coverline("build/charts-base/charts-base.js", 7302);+Y.Plots = Plots;+/**+ * Histogram is the base class for Column and Bar series.+ *+ * @module charts+ * @submodule charts-base+ * @class Histogram+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 7311);+function Histogram(){}++_yuitest_coverline("build/charts-base/charts-base.js", 7313);+Histogram.prototype = {+ /**+ * Draws the series.+ *+ * @method drawSeries+ * @protected+ */+ drawSeries: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawSeries", 7320);+_yuitest_coverline("build/charts-base/charts-base.js", 7322);+if(this.get("xcoords").length < 1) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 7324);+return;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7326);+var style = Y.clone(this.get("styles").marker),+ setSize,+ calculatedSize,+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ i = 0,+ len = xcoords.length,+ top = ycoords[0],+ type = this.get("type"),+ graph = this.get("graph"),+ seriesCollection = graph.seriesTypes[type],+ seriesLen = seriesCollection.length,+ seriesSize = 0,+ totalSize = 0,+ offset = 0,+ ratio,+ renderer,+ order = this.get("order"),+ graphOrder = this.get("graphOrder"),+ left,+ marker,+ setSizeKey,+ calculatedSizeKey,+ config,+ fillColors = null,+ borderColors = null,+ xMarkerPlane = [],+ yMarkerPlane = [],+ xMarkerPlaneLeft,+ xMarkerPlaneRight,+ yMarkerPlaneTop,+ yMarkerPlaneBottom,+ dimensions = {+ width: [],+ height: []+ },+ xvalues = [],+ yvalues = [],+ groupMarkers = this.get("groupMarkers");+ _yuitest_coverline("build/charts-base/charts-base.js", 7365);+if(Y_Lang.isArray(style.fill.color))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7367);+fillColors = style.fill.color.concat(); + }+ _yuitest_coverline("build/charts-base/charts-base.js", 7369);+if(Y_Lang.isArray(style.border.color))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7371);+borderColors = style.border.color.concat();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7373);+if(this.get("direction") == "vertical")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7375);+setSizeKey = "height";+ _yuitest_coverline("build/charts-base/charts-base.js", 7376);+calculatedSizeKey = "width";+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7380);+setSizeKey = "width";+ _yuitest_coverline("build/charts-base/charts-base.js", 7381);+calculatedSizeKey = "height";+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7383);+setSize = style[setSizeKey];+ _yuitest_coverline("build/charts-base/charts-base.js", 7384);+calculatedSize = style[calculatedSizeKey];+ _yuitest_coverline("build/charts-base/charts-base.js", 7385);+this._createMarkerCache();+ _yuitest_coverline("build/charts-base/charts-base.js", 7386);+for(; i < seriesLen; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7388);+renderer = seriesCollection[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 7389);+seriesSize += renderer.get("styles").marker[setSizeKey];+ _yuitest_coverline("build/charts-base/charts-base.js", 7390);+if(order > i) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 7392);+offset = seriesSize;+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7395);+totalSize = len * seriesSize;+ _yuitest_coverline("build/charts-base/charts-base.js", 7396);+this._maxSize = graph.get(setSizeKey);+ _yuitest_coverline("build/charts-base/charts-base.js", 7397);+if(totalSize > this._maxSize)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7399);+ratio = graph.get(setSizeKey)/totalSize;+ _yuitest_coverline("build/charts-base/charts-base.js", 7400);+seriesSize *= ratio;+ _yuitest_coverline("build/charts-base/charts-base.js", 7401);+offset *= ratio;+ _yuitest_coverline("build/charts-base/charts-base.js", 7402);+setSize *= ratio;+ _yuitest_coverline("build/charts-base/charts-base.js", 7403);+setSize = Math.max(setSize, 1);+ _yuitest_coverline("build/charts-base/charts-base.js", 7404);+this._maxSize = setSize;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7406);+offset -= seriesSize/2;+ _yuitest_coverline("build/charts-base/charts-base.js", 7407);+for(i = 0; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7409);+xMarkerPlaneLeft = xcoords[i] - seriesSize/2;+ _yuitest_coverline("build/charts-base/charts-base.js", 7410);+xMarkerPlaneRight = xMarkerPlaneLeft + seriesSize;+ _yuitest_coverline("build/charts-base/charts-base.js", 7411);+yMarkerPlaneTop = ycoords[i] - seriesSize/2;+ _yuitest_coverline("build/charts-base/charts-base.js", 7412);+yMarkerPlaneBottom = yMarkerPlaneTop + seriesSize;+ _yuitest_coverline("build/charts-base/charts-base.js", 7413);+xMarkerPlane.push({start: xMarkerPlaneLeft, end: xMarkerPlaneRight});+ _yuitest_coverline("build/charts-base/charts-base.js", 7414);+yMarkerPlane.push({start: yMarkerPlaneTop, end: yMarkerPlaneBottom});+ _yuitest_coverline("build/charts-base/charts-base.js", 7415);+if(isNaN(xcoords[i]) || isNaN(ycoords[i]))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7417);+this._markers.push(null);+ _yuitest_coverline("build/charts-base/charts-base.js", 7418);+continue;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7420);+config = this._getMarkerDimensions(xcoords[i], ycoords[i], calculatedSize, offset);+ _yuitest_coverline("build/charts-base/charts-base.js", 7421);+if(!isNaN(config.calculatedSize) && config.calculatedSize > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7423);+top = config.top;+ _yuitest_coverline("build/charts-base/charts-base.js", 7424);+left = config.left;++ _yuitest_coverline("build/charts-base/charts-base.js", 7426);+if(groupMarkers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7428);+dimensions[setSizeKey][i] = setSize;+ _yuitest_coverline("build/charts-base/charts-base.js", 7429);+dimensions[calculatedSizeKey][i] = config.calculatedSize;+ _yuitest_coverline("build/charts-base/charts-base.js", 7430);+xvalues.push(left);+ _yuitest_coverline("build/charts-base/charts-base.js", 7431);+yvalues.push(top);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7435);+style[setSizeKey] = setSize;+ _yuitest_coverline("build/charts-base/charts-base.js", 7436);+style[calculatedSizeKey] = config.calculatedSize;+ _yuitest_coverline("build/charts-base/charts-base.js", 7437);+style.x = left;+ _yuitest_coverline("build/charts-base/charts-base.js", 7438);+style.y = top;+ _yuitest_coverline("build/charts-base/charts-base.js", 7439);+if(fillColors)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7441);+style.fill.color = fillColors[i % fillColors.length];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7443);+if(borderColors)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7445);+style.border.color = borderColors[i % borderColors.length];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7447);+marker = this.getMarker(style, graphOrder, i);+ }++ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 7451);+if(!groupMarkers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7453);+this._markers.push(null);+ }}+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7456);+this.set("xMarkerPlane", xMarkerPlane);+ _yuitest_coverline("build/charts-base/charts-base.js", 7457);+this.set("yMarkerPlane", yMarkerPlane);+ _yuitest_coverline("build/charts-base/charts-base.js", 7458);+if(groupMarkers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7460);+this._createGroupMarker({+ fill: style.fill,+ border: style.border,+ dimensions: dimensions,+ xvalues: xvalues,+ yvalues: yvalues,+ shape: style.shape+ });+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7471);+this._clearMarkerCache();+ }+ },+ + /**+ * Collection of default colors used for marker fills in a series when not specified by user.+ *+ * @property _defaultFillColors+ * @type Array+ * @protected+ */+ _defaultFillColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],+ + /**+ * Gets the default style values for the markers.+ *+ * @method _getPlotDefaults+ * @return Object+ * @private+ */+ _getPlotDefaults: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getPlotDefaults", 7491);+_yuitest_coverline("build/charts-base/charts-base.js", 7493);+var defs = {+ fill:{+ type: "solid",+ alpha: 1,+ colors:null,+ alphas: null,+ ratios: null+ },+ border:{+ weight: 0,+ alpha: 1+ },+ width: 12,+ height: 12,+ shape: "rect",++ padding:{+ top: 0,+ left: 0,+ right: 0,+ bottom: 0+ }+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 7516);+defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");+ _yuitest_coverline("build/charts-base/charts-base.js", 7517);+defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");+ _yuitest_coverline("build/charts-base/charts-base.js", 7518);+return defs;+ }+};++_yuitest_coverline("build/charts-base/charts-base.js", 7522);+Y.Histogram = Histogram;+/**+ * The CartesianSeries class creates a chart with horizontal and vertical axes.+ *+ * @module charts+ * @submodule charts-base+ * @class CartesianSeries+ * @extends Base+ * @uses Renderer+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 7533);+Y.CartesianSeries = Y.Base.create("cartesianSeries", Y.Base, [Y.Renderer], {+ /**+ * Storage for `xDisplayName` attribute.+ *+ * @property _xDisplayName+ * @type String+ * @private+ */+ _xDisplayName: null,++ /**+ * Storage for `yDisplayName` attribute.+ *+ * @property _yDisplayName+ * @type String+ * @private+ */+ _yDisplayName: null,+ + /**+ * Th x-coordinate for the left edge of the series.+ *+ * @property _leftOrigin+ * @type String+ * @private+ */+ _leftOrigin: null,++ /**+ * The y-coordinate for the bottom edge of the series.+ * + * @property _bottomOrigin+ * @type String+ * @private+ */+ _bottomOrigin: null,++ /**+ * @method render+ * @private+ */+ render: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "render", 7574);+_yuitest_coverline("build/charts-base/charts-base.js", 7576);+this._setCanvas();+ _yuitest_coverline("build/charts-base/charts-base.js", 7577);+this.addListeners();+ _yuitest_coverline("build/charts-base/charts-base.js", 7578);+this.set("rendered", true);+ _yuitest_coverline("build/charts-base/charts-base.js", 7579);+this.validate();+ },++ /**+ * Adds event listeners.+ *+ * @method addListeners+ * @private+ */+ addListeners: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "addListeners", 7588);+_yuitest_coverline("build/charts-base/charts-base.js", 7590);+var xAxis = this.get("xAxis"),+ yAxis = this.get("yAxis");+ _yuitest_coverline("build/charts-base/charts-base.js", 7592);+if(xAxis)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7594);+this._xDataReadyHandle = xAxis.after("dataReady", Y.bind(this._xDataChangeHandler, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 7595);+this._xDataUpdateHandle = xAxis.after("dataUpdate", Y.bind(this._xDataChangeHandler, this));+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7597);+if(yAxis)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7599);+this._yDataReadyHandle = yAxis.after("dataReady", Y.bind(this._yDataChangeHandler, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 7600);+this._yDataUpdateHandle = yAxis.after("dataUpdate", Y.bind(this._yDataChangeHandler, this));+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7602);+this._xAxisChangeHandle = this.after("xAxisChange", this._xAxisChangeHandler);+ _yuitest_coverline("build/charts-base/charts-base.js", 7603);+this._yAxisChangeHandle = this.after("yAxisChange", this._yAxisChangeHandler);+ _yuitest_coverline("build/charts-base/charts-base.js", 7604);+this._stylesChangeHandle = this.after("stylesChange", function(e) {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "(anonymous 3)", 7604);+_yuitest_coverline("build/charts-base/charts-base.js", 7605);+var axesReady = this._updateAxisData();+ _yuitest_coverline("build/charts-base/charts-base.js", 7606);+if(axesReady)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7608);+this.draw();+ }+ });+ _yuitest_coverline("build/charts-base/charts-base.js", 7611);+this._widthChangeHandle = this.after("widthChange", function(e) {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "(anonymous 4)", 7611);+_yuitest_coverline("build/charts-base/charts-base.js", 7612);+var axesReady = this._updateAxisData();+ _yuitest_coverline("build/charts-base/charts-base.js", 7613);+if(axesReady)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7615);+this.draw();+ }+ });+ _yuitest_coverline("build/charts-base/charts-base.js", 7618);+this._heightChangeHandle = this.after("heightChange", function(e) {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "(anonymous 5)", 7618);+_yuitest_coverline("build/charts-base/charts-base.js", 7619);+var axesReady = this._updateAxisData();+ _yuitest_coverline("build/charts-base/charts-base.js", 7620);+if(axesReady)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7622);+this.draw();+ }+ });+ _yuitest_coverline("build/charts-base/charts-base.js", 7625);+this._visibleChangeHandle = this.after("visibleChange", this._handleVisibleChange);+ },+ + /**+ * Event handler for the xAxisChange event.+ *+ * @method _xAxisChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _xAxisChangeHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_xAxisChangeHandler", 7635);+_yuitest_coverline("build/charts-base/charts-base.js", 7637);+var xAxis = this.get("xAxis");+ _yuitest_coverline("build/charts-base/charts-base.js", 7638);+xAxis.after("dataReady", Y.bind(this._xDataChangeHandler, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 7639);+xAxis.after("dataUpdate", Y.bind(this._xDataChangeHandler, this));+ },+ + /**+ * Event handler the yAxisChange event.+ *+ * @method _yAxisChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _yAxisChangeHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_yAxisChangeHandler", 7649);+_yuitest_coverline("build/charts-base/charts-base.js", 7651);+var yAxis = this.get("yAxis");+ _yuitest_coverline("build/charts-base/charts-base.js", 7652);+yAxis.after("dataReady", Y.bind(this._yDataChangeHandler, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 7653);+yAxis.after("dataUpdate", Y.bind(this._yDataChangeHandler, this));+ },++ /**+ * Constant used to generate unique id.+ *+ * @property GUID+ * @type String+ * @private+ */+ GUID: "yuicartesianseries",++ /**+ * Event handler for xDataChange event.+ *+ * @method _xDataChangeHandler+ * @param {Object} event Event object.+ * @private + */+ _xDataChangeHandler: function(event)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_xDataChangeHandler", 7672);+_yuitest_coverline("build/charts-base/charts-base.js", 7674);+var axesReady = this._updateAxisData();+ _yuitest_coverline("build/charts-base/charts-base.js", 7675);+if(axesReady)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7677);+this.draw();+ }+ },++ /**+ * Event handler for yDataChange event.+ *+ * @method _yDataChangeHandler+ * @param {Object} event Event object.+ * @private + */+ _yDataChangeHandler: function(event)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_yDataChangeHandler", 7688);+_yuitest_coverline("build/charts-base/charts-base.js", 7690);+var axesReady = this._updateAxisData();+ _yuitest_coverline("build/charts-base/charts-base.js", 7691);+if(axesReady)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7693);+this.draw();+ }+ },++ /**+ * Checks to ensure that both xAxis and yAxis data are available. If so, set the `xData` and `yData` attributes and return `true`. Otherwise, return `false`.+ *+ * @method _updateAxisData+ * @return Boolean+ * @private + */+ _updateAxisData: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_updateAxisData", 7704);+_yuitest_coverline("build/charts-base/charts-base.js", 7706);+var xAxis = this.get("xAxis"),+ yAxis = this.get("yAxis"),+ xKey = this.get("xKey"),+ yKey = this.get("yKey"),+ yData,+ xData;+ _yuitest_coverline("build/charts-base/charts-base.js", 7712);+if(!xAxis || !yAxis || !xKey || !yKey)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7714);+return false;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7716);+xData = xAxis.getDataByKey(xKey);+ _yuitest_coverline("build/charts-base/charts-base.js", 7717);+yData = yAxis.getDataByKey(yKey);+ _yuitest_coverline("build/charts-base/charts-base.js", 7718);+if(!xData || !yData)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7720);+return false;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7722);+this.set("xData", xData.concat());+ _yuitest_coverline("build/charts-base/charts-base.js", 7723);+this.set("yData", yData.concat());+ _yuitest_coverline("build/charts-base/charts-base.js", 7724);+return true;+ },++ /**+ * Draws the series is the xAxis and yAxis data are both available.+ *+ * @method validate+ * @private+ */+ validate: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "validate", 7733);+_yuitest_coverline("build/charts-base/charts-base.js", 7735);+if((this.get("xData") && this.get("yData")) || this._updateAxisData())+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7737);+this.draw();+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7741);+this.fire("drawingComplete");+ }+ },++ /**+ * Creates a `Graphic` instance.+ *+ * @method _setCanvas+ * @protected+ */+ _setCanvas: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setCanvas", 7751);+_yuitest_coverline("build/charts-base/charts-base.js", 7753);+var graph = this.get("graph"),+ graphic = graph.get("graphic");+ _yuitest_coverline("build/charts-base/charts-base.js", 7755);+this.set("graphic", graphic);+ },++ /**+ * Calculates the coordinates for the series.+ *+ * @method setAreaData+ * @protected+ */+ setAreaData: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setAreaData", 7764);+_yuitest_coverline("build/charts-base/charts-base.js", 7766);+var isNumber = Y_Lang.isNumber,+ nextX, nextY,+ graph = this.get("graph"),+ w = graph.get("width"),+ h = graph.get("height"),+ xAxis = this.get("xAxis"),+ yAxis = this.get("yAxis"),+ xData = this.get("xData").concat(),+ yData = this.get("yData").concat(),+ xValue,+ yValue,+ xOffset = xAxis.getEdgeOffset(xData.length, w),+ yOffset = yAxis.getEdgeOffset(yData.length, h),+ padding = this.get("styles").padding,+ leftPadding = padding.left,+ topPadding = padding.top,+ dataWidth = w - (leftPadding + padding.right + xOffset),+ dataHeight = h - (topPadding + padding.bottom + yOffset),+ xcoords = [],+ ycoords = [],+ xMax = xAxis.get("maximum"),+ xMin = xAxis.get("minimum"),+ yMax = yAxis.get("maximum"),+ yMin = yAxis.get("minimum"),+ xScaleFactor = dataWidth / (xMax - xMin),+ yScaleFactor = dataHeight / (yMax - yMin),+ dataLength,+ direction = this.get("direction"),+ i = 0,+ xMarkerPlane = [],+ yMarkerPlane = [],+ xMarkerPlaneOffset = this.get("xMarkerPlaneOffset"),+ yMarkerPlaneOffset = this.get("yMarkerPlaneOffset"),+ graphic = this.get("graphic");+ _yuitest_coverline("build/charts-base/charts-base.js", 7800);+graphic.set("width", w);+ _yuitest_coverline("build/charts-base/charts-base.js", 7801);+graphic.set("height", h);+ _yuitest_coverline("build/charts-base/charts-base.js", 7802);+dataLength = xData.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 7803);+xOffset *= 0.5;+ _yuitest_coverline("build/charts-base/charts-base.js", 7804);+yOffset *= 0.5;+ //Assuming a vertical graph has a range/category for its vertical axis. + _yuitest_coverline("build/charts-base/charts-base.js", 7806);+if(direction === "vertical")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7808);+yData = yData.reverse();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7810);+this._leftOrigin = Math.round(((0 - xMin) * xScaleFactor) + leftPadding + xOffset);+ _yuitest_coverline("build/charts-base/charts-base.js", 7811);+this._bottomOrigin = Math.round((dataHeight + topPadding + yOffset)); + _yuitest_coverline("build/charts-base/charts-base.js", 7812);+if(yMin < 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7814);+this._bottomOrigin = this._bottomOrigin - ((0 - yMin) * yScaleFactor);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7816);+for (; i < dataLength; ++i) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 7818);+xValue = parseFloat(xData[i]);+ _yuitest_coverline("build/charts-base/charts-base.js", 7819);+yValue = parseFloat(yData[i]);+ _yuitest_coverline("build/charts-base/charts-base.js", 7820);+if(isNumber(xValue))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7822);+nextX = (((xValue - xMin) * xScaleFactor) + leftPadding + xOffset);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7826);+nextX = NaN;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7828);+if(isNumber(yValue))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7830);+nextY = ((dataHeight + topPadding + yOffset) - (yValue - yMin) * yScaleFactor);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7834);+nextY = NaN;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7836);+xcoords.push(nextX);+ _yuitest_coverline("build/charts-base/charts-base.js", 7837);+ycoords.push(nextY);+ _yuitest_coverline("build/charts-base/charts-base.js", 7838);+xMarkerPlane.push({start:nextX - xMarkerPlaneOffset, end: nextX + xMarkerPlaneOffset});+ _yuitest_coverline("build/charts-base/charts-base.js", 7839);+yMarkerPlane.push({start:nextY - yMarkerPlaneOffset, end: nextY + yMarkerPlaneOffset});+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7841);+this.set("xcoords", xcoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 7842);+this.set("ycoords", ycoords);+ _yuitest_coverline("build/charts-base/charts-base.js", 7843);+this.set("xMarkerPlane", xMarkerPlane);+ _yuitest_coverline("build/charts-base/charts-base.js", 7844);+this.set("yMarkerPlane", yMarkerPlane);+ _yuitest_coverline("build/charts-base/charts-base.js", 7845);+this._dataLength = dataLength;+ },++ /**+ * Finds the first valid index of an array coordinates.+ *+ * @method _getFirstValidIndex+ * @param {Array} coords An array of x or y coordinates.+ * @return Number+ * @private+ */+ _getFirstValidIndex: function(coords)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getFirstValidIndex", 7856);+_yuitest_coverline("build/charts-base/charts-base.js", 7858);+var coord,+ i = -1,+ limit = coords.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 7861);+while(!Y_Lang.isNumber(coord) && i < limit)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7863);+i += 1;+ _yuitest_coverline("build/charts-base/charts-base.js", 7864);+coord = coords[i];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7866);+return i;+ },++ /**+ * Finds the last valid index of an array coordinates.+ *+ * @method _getLastValidIndex+ * @param {Array} coords An array of x or y coordinates.+ * @return Number+ * @private+ */+ _getLastValidIndex: function(coords)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getLastValidIndex", 7877);+_yuitest_coverline("build/charts-base/charts-base.js", 7879);+var coord,+ i = coords.length,+ limit = -1;+ _yuitest_coverline("build/charts-base/charts-base.js", 7882);+while(!Y_Lang.isNumber(coord) && i > limit)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7884);+i -= 1;+ _yuitest_coverline("build/charts-base/charts-base.js", 7885);+coord = coords[i];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7887);+return i;+ },++ /**+ * Draws the series.+ *+ * @method draw+ * @protected+ */+ draw: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "draw", 7896);+_yuitest_coverline("build/charts-base/charts-base.js", 7898);+var graph = this.get("graph"),+ w = graph.get("width"),+ h = graph.get("height");+ _yuitest_coverline("build/charts-base/charts-base.js", 7901);+if(this.get("rendered"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7903);+if((isFinite(w) && isFinite(h) && w > 0 && h > 0) && ((this.get("xData") && this.get("yData")) || this._updateAxisData()))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7905);+if(this._drawing)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7907);+this._callLater = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 7908);+return;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7910);+this._drawing = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 7911);+this._callLater = false;+ _yuitest_coverline("build/charts-base/charts-base.js", 7912);+this.setAreaData();+ _yuitest_coverline("build/charts-base/charts-base.js", 7913);+if(this.get("xcoords") && this.get("ycoords"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7915);+this.drawSeries();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 7917);+this._drawing = false;+ _yuitest_coverline("build/charts-base/charts-base.js", 7918);+if(this._callLater)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7920);+this.draw();+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 7924);+this._toggleVisible(this.get("visible"));+ _yuitest_coverline("build/charts-base/charts-base.js", 7925);+this.fire("drawingComplete");+ }+ }+ }+ },+ + /**+ * Default value for plane offsets when the parent chart's `interactiveType` is `planar`. + *+ * @property _defaultPlaneOffset+ * @type Number+ * @private+ */+ _defaultPlaneOffset: 4,+ + /**+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ * @protected+ */+ _getDefaultStyles: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultStyles", 7948);+_yuitest_coverline("build/charts-base/charts-base.js", 7950);+return {padding:{+ top: 0,+ left: 0,+ right: 0,+ bottom: 0+ }};+ },++ /**+ * Collection of default colors used for lines in a series when not specified by user.+ *+ * @property _defaultLineColors+ * @type Array+ * @protected+ */+ _defaultLineColors:["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"],++ /**+ * Collection of default colors used for marker fills in a series when not specified by user.+ *+ * @property _defaultFillColors+ * @type Array+ * @protected+ */+ _defaultFillColors:["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"],+ + /**+ * Collection of default colors used for marker borders in a series when not specified by user.+ *+ * @property _defaultBorderColors+ * @type Array+ * @protected+ */+ _defaultBorderColors:["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"],+ + /**+ * Collection of default colors used for area fills, histogram fills and pie fills in a series when not specified by user.+ *+ * @property _defaultSliceColors+ * @type Array+ * @protected+ */+ _defaultSliceColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],++ /**+ * Parses a color based on a series order and type.+ *+ * @method _getDefaultColor+ * @param {Number} index Index indicating the series order.+ * @param {String} type Indicates which type of object needs the color.+ * @return String+ * @protected+ */+ _getDefaultColor: function(index, type)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultColor", 8003);+_yuitest_coverline("build/charts-base/charts-base.js", 8005);+var colors = {+ line: this._defaultLineColors,+ fill: this._defaultFillColors,+ border: this._defaultBorderColors,+ slice: this._defaultSliceColors+ },+ col = colors[type],+ l = col.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 8013);+index = index || 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 8014);+if(index >= l)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8016);+index = index % l;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 8018);+type = type || "fill";+ _yuitest_coverline("build/charts-base/charts-base.js", 8019);+return colors[type][index];+ },+ + /**+ * Shows/hides contents of the series.+ *+ * @method _handleVisibleChange+ * @param {Object} e Event object.+ * @protected+ */+ _handleVisibleChange: function(e) + {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_handleVisibleChange", 8029);+_yuitest_coverline("build/charts-base/charts-base.js", 8031);+this._toggleVisible(this.get("visible"));+ },++ /**+ * Returns the sum of all values for the series.+ *+ * @method getTotalValues+ * @return Number+ */+ getTotalValues: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getTotalValues", 8040);+_yuitest_coverline("build/charts-base/charts-base.js", 8042);+var total = this.get("valueAxis").getTotalByKey(this.get("valueKey"));+ _yuitest_coverline("build/charts-base/charts-base.js", 8043);+return total;+ },++ /**+ * Destructor implementation for the CartesianSeries class. Calls destroy on all Graphic instances.+ *+ * @method destructor+ * @protected+ */+ destructor: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "destructor", 8052);+_yuitest_coverline("build/charts-base/charts-base.js", 8054);+var marker,+ markers = this.get("markers");+ _yuitest_coverline("build/charts-base/charts-base.js", 8056);+if(this.get("rendered"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8058);+if(this._xDataReadyHandle)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8060);+this._xDataReadyHandle.detach();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 8062);+if(this._xDataUpdateHandle)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8064);+this._xDataUpdateHandle.detach();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 8066);+if(this._yDataReadyHandle)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8068);+this._yDataReadyHandle.detach();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 8070);+if(this._yDataUpdateHandle)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8072);+this._yDataUpdateHandle.detach();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 8074);+this._xAxisChangeHandle.detach();+ _yuitest_coverline("build/charts-base/charts-base.js", 8075);+this._yAxisChangeHandle.detach();+ _yuitest_coverline("build/charts-base/charts-base.js", 8076);+this._stylesChangeHandle.detach();+ _yuitest_coverline("build/charts-base/charts-base.js", 8077);+this._widthChangeHandle.detach();+ _yuitest_coverline("build/charts-base/charts-base.js", 8078);+this._heightChangeHandle.detach();+ _yuitest_coverline("build/charts-base/charts-base.js", 8079);+this._visibleChangeHandle.detach();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 8081);+while(markers && markers.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8083);+marker = markers.shift();+ _yuitest_coverline("build/charts-base/charts-base.js", 8084);+if(marker && marker instanceof Y.Shape)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8086);+marker.destroy();+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 8089);+if(this._path)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8091);+this._path.destroy();+ _yuitest_coverline("build/charts-base/charts-base.js", 8092);+this._path = null;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 8094);+if(this._lineGraphic)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8096);+this._lineGraphic.destroy();+ _yuitest_coverline("build/charts-base/charts-base.js", 8097);+this._lineGraphic = null;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 8099);+if(this._groupMarker)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8101);+this._groupMarker.destroy();+ _yuitest_coverline("build/charts-base/charts-base.js", 8102);+this._groupMarker = null;+ }+ }+ /**+ * Event handle for the x-axis' dataReady event.+ * + * @property _xDataReadyHandle+ * @type {EventHandle}+ * @private+ */+ + /**+ * Event handle for the x-axis dataUpdate event.+ *+ * @property _xDataUpdateHandle+ * @type {EventHandle}+ * @private+ */+ + /**+ * Event handle for the y-axis dataReady event.+ *+ * @property _yDataReadyHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the y-axis dataUpdate event.+ * @property _yDataUpdateHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the xAxisChange event.+ * @property _xAxisChangeHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the yAxisChange event.+ * @property _yAxisChangeHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the stylesChange event.+ * @property _stylesChangeHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the widthChange event.+ * @property _widthChangeHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the heightChange event.+ * @property _heightChangeHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the visibleChange event.+ * @property _visibleChangeHandle+ * @type {EventHandle}+ * @private+ */+}, {+ ATTRS: {+ /**+ * Name used for for displaying data related to the x-coordinate.+ *+ * @attribute xDisplayName+ * @type String+ */+ xDisplayName: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 8186);+_yuitest_coverline("build/charts-base/charts-base.js", 8188);+return this._xDisplayName || this.get("xKey");+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 8191);+_yuitest_coverline("build/charts-base/charts-base.js", 8193);+this._xDisplayName = val.toString();+ _yuitest_coverline("build/charts-base/charts-base.js", 8194);+return val;+ }+ },++ /**+ * Name used for for displaying data related to the y-coordinate.+ *+ * @attribute yDisplayName+ * @type String+ */+ yDisplayName: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 8205);+_yuitest_coverline("build/charts-base/charts-base.js", 8207);+return this._yDisplayName || this.get("yKey");+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 8210);+_yuitest_coverline("build/charts-base/charts-base.js", 8212);+this._yDisplayName = val.toString();+ _yuitest_coverline("build/charts-base/charts-base.js", 8213);+return val;+ }+ },+ + /**+ * Name used for for displaying category data+ *+ * @attribute categoryDisplayName+ * @type String+ * @readOnly+ */+ categoryDisplayName: {+ lazyAdd: false,++ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 8227);+_yuitest_coverline("build/charts-base/charts-base.js", 8229);+return this.get("direction") == "vertical" ? this.get("yDisplayName") : this.get("xDisplayName");+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 8232);+_yuitest_coverline("build/charts-base/charts-base.js", 8234);+if(this.get("direction") == "vertical")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8236);+this._yDisplayName = val;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8240);+this._xDisplayName = val;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 8242);+return val;+ }+ },++ /**+ * Name used for for displaying value data+ *+ * @attribute valueDisplayName+ * @type String+ * @readOnly+ */+ valueDisplayName: {+ lazyAdd: false,++ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 8256);+_yuitest_coverline("build/charts-base/charts-base.js", 8258);+return this.get("direction") == "vertical" ? this.get("xDisplayName") : this.get("yDisplayName");+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 8261);+_yuitest_coverline("build/charts-base/charts-base.js", 8263);+if(this.get("direction") == "vertical")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8265);+this._xDisplayName = val;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8269);+this._yDisplayName = val;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 8271);+return val;+ }+ },+ + /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default cartesian+ */+ type: { + value: "cartesian"+ },++ /**+ * Order of this instance of this `type`.+ *+ * @attribute order+ * @type Number+ */+ order: {},++ /**+ * Order of the instance+ *+ * @attribute graphOrder+ * @type Number+ */+ graphOrder: {},++ /**+ * x coordinates for the series.+ *+ * @attribute xcoords+ * @type Array+ */+ xcoords: {},+ + /**+ * y coordinates for the series+ *+ * @attribute ycoords+ * @type Array+ */+ ycoords: {},++ /**+ * Reference to the `Chart` application.+ *+ * @attribute chart+ * @type ChartBase+ * @readOnly+ */+ chart: {+ readOnly: true,++ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 8328);+_yuitest_coverline("build/charts-base/charts-base.js", 8330);+return this.get("graph").get("chart");+ }+ },+ + /**+ * Reference to the `Graph` in which the series is drawn into.+ *+ * @attribute graph+ * @type Graph+ */+ graph: {},++ /**+ * Reference to the `Axis` instance used for assigning + * x-values to the graph.+ *+ * @attribute xAxis+ * @type Axis+ */+ xAxis: {},+ + /**+ * Reference to the `Axis` instance used for assigning + * y-values to the graph.+ *+ * @attribute yAxis+ * @type Axis+ */+ yAxis: {},+ + /**+ * Indicates which array to from the hash of value arrays in + * the x-axis `Axis` instance.+ *+ * @attribute xKey+ * @type String+ */+ xKey: {+ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 8368);+_yuitest_coverline("build/charts-base/charts-base.js", 8370);+return val.toString();+ }+ },++ /**+ * Indicates which array to from the hash of value arrays in + * the y-axis `Axis` instance.+ *+ * @attribute yKey+ * @type String+ */+ yKey: {+ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 8382);+_yuitest_coverline("build/charts-base/charts-base.js", 8384);+return val.toString();+ }+ },++ /**+ * Array of x values for the series.+ *+ * @attribute xData+ * @type Array+ */+ xData: {},++ /**+ * Array of y values for the series.+ *+ * @attribute yData+ * @type Array+ */+ yData: {},+ + /**+ * Indicates whether the Series has been through its initial set up.+ *+ * @attribute rendered+ * @type Boolean+ */+ rendered: {+ value: false+ },++ /*+ * Returns the width of the parent graph+ *+ * @attribute width+ * @type Number+ */+ width: {+ readOnly: true,+ + getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 8423);+_yuitest_coverline("build/charts-base/charts-base.js", 8425);+this.get("graph").get("width");+ }+ },++ /**+ * Returns the height of the parent graph+ *+ * @attribute height+ * @type Number+ */+ height: {+ readOnly: true,+ + getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 8438);+_yuitest_coverline("build/charts-base/charts-base.js", 8440);+this.get("graph").get("height");+ }+ },++ /**+ * Indicates whether to show the series+ *+ * @attribute visible+ * @type Boolean+ * @default true+ */+ visible: {+ value: true+ },++ /**+ * Collection of area maps along the xAxis. Used to determine mouseover for multiple+ * series.+ *+ * @attribute xMarkerPlane+ * @type Array+ */+ xMarkerPlane: {},+ + /**+ * Collection of area maps along the yAxis. Used to determine mouseover for multiple+ * series.+ *+ * @attribute yMarkerPlane+ * @type Array+ */+ yMarkerPlane: {},++ /**+ * Distance from a data coordinate to the left/right for setting a hotspot.+ *+ * @attribute xMarkerPlaneOffset+ * @type Number+ */+ xMarkerPlaneOffset: {+ getter: function() {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 8480);+_yuitest_coverline("build/charts-base/charts-base.js", 8481);+var marker = this.get("styles").marker;+ _yuitest_coverline("build/charts-base/charts-base.js", 8482);+if(marker && marker.width && isFinite(marker.width))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8484);+return marker.width * 0.5;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 8486);+return this._defaultPlaneOffset;+ }+ },++ /**+ * Distance from a data coordinate to the top/bottom for setting a hotspot.+ *+ * @attribute yMarkerPlaneOffset+ * @type Number+ */+ yMarkerPlaneOffset: {+ getter: function() {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 8497);+_yuitest_coverline("build/charts-base/charts-base.js", 8498);+var marker = this.get("styles").marker;+ _yuitest_coverline("build/charts-base/charts-base.js", 8499);+if(marker && marker.height && isFinite(marker.height))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8501);+return marker.height * 0.5;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 8503);+return this._defaultPlaneOffset;+ }+ },++ /**+ * Direction of the series+ *+ * @attribute direction+ * @type String+ */+ direction: {+ value: "horizontal"+ },++ /**+ * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.+ *+ * @attribute groupMarkers+ * @type Boolean+ */+ groupMarkers: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 8524);+_yuitest_coverline("build/charts-base/charts-base.js", 8526);+if(this._groupMarkers === undefined)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8528);+return this.get("graph").get("groupMarkers");+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8532);+return this._groupMarkers;+ }+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 8536);+_yuitest_coverline("build/charts-base/charts-base.js", 8538);+this._groupMarkers = val;+ _yuitest_coverline("build/charts-base/charts-base.js", 8539);+return val;+ }+ }+ }+});+/**+ * The MarkerSeries class renders quantitative data by plotting relevant data points + * on a graph.+ *+ * @module charts+ * @submodule charts-base+ * @class MarkerSeries+ * @extends CartesianSeries+ * @uses Plots+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 8555);+Y.MarkerSeries = Y.Base.create("markerSeries", Y.CartesianSeries, [Y.Plots], {+ /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawSeries", 8563);+_yuitest_coverline("build/charts-base/charts-base.js", 8565);+this.drawPlots();+ },+ + /**+ * @protected+ *+ * Method used by `styles` setter. Overrides base implementation.+ *+ * @method _setStyles+ * @param {Object} newStyles Hash of properties to update.+ * @return Object+ */+ _setStyles: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setStyles", 8577);+_yuitest_coverline("build/charts-base/charts-base.js", 8579);+if(!val.marker)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8581);+val = {marker:val};+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 8583);+val = this._parseMarkerStyles(val);+ _yuitest_coverline("build/charts-base/charts-base.js", 8584);+return Y.MarkerSeries.superclass._mergeStyles.apply(this, [val, this._getDefaultStyles()]);+ },+ + /**+ * @protected+ *+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ */+ _getDefaultStyles: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultStyles", 8596);+_yuitest_coverline("build/charts-base/charts-base.js", 8598);+var styles = this._mergeStyles({marker:this._getPlotDefaults()}, Y.MarkerSeries.superclass._getDefaultStyles());+ _yuitest_coverline("build/charts-base/charts-base.js", 8599);+return styles;+ }+},{+ ATTRS : {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default marker+ */+ type: {+ value:"marker"+ }+ + /**+ * Style properties used for drawing markers. This attribute is inherited from `Renderer`. Below are the default values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"]`+ * </dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>width</dt><dd>indicates the width of the marker. The default value is 10.</dd>+ * <dt>height</dt><dd>indicates the height of the marker The default value is 10.</dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++/**+ * The LineSeries class renders quantitative data on a graph by connecting relevant data points.+ *+ * @module charts+ * @submodule charts-base+ * @class LineSeries+ * @extends CartesianSeries+ * @uses Lines+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 8658);+Y.LineSeries = Y.Base.create("lineSeries", Y.CartesianSeries, [Y.Lines], {+ /**+ * @protected+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawSeries", 8664);+_yuitest_coverline("build/charts-base/charts-base.js", 8666);+this.drawLines();+ },++ /**+ * @protected+ *+ * Method used by `styles` setter. Overrides base implementation.+ *+ * @method _setStyles+ * @param {Object} newStyles Hash of properties to update.+ * @return Object+ */+ _setStyles: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setStyles", 8678);+_yuitest_coverline("build/charts-base/charts-base.js", 8680);+if(!val.line)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8682);+val = {line:val};+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 8684);+return Y.LineSeries.superclass._setStyles.apply(this, [val]);+ },++ /**+ * @protected+ *+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ */+ _getDefaultStyles: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultStyles", 8696);+_yuitest_coverline("build/charts-base/charts-base.js", 8698);+var styles = this._mergeStyles({line:this._getLineDefaults()}, Y.LineSeries.superclass._getDefaultStyles());+ _yuitest_coverline("build/charts-base/charts-base.js", 8699);+return styles;+ }+},+{+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default line+ */+ type: {+ value:"line"+ }++ /**+ * Style properties used for drawing lines. This attribute is inherited from `Renderer`. Below are the default values:+ * <dl>+ * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be+ * retrieved from the following array: + * `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]`+ * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>+ * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> + * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>+ * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>+ * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> + * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>+ * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>+ * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++++ ++ +/**+ * SplineSeries renders a graph with data points connected by a curve.+ *+ * @module charts+ * @submodule charts-base+ * @class SplineSeries+ * @constructor+ * @extends CartesianSeries+ * @uses CurveUtil+ * @uses Lines+ */+_yuitest_coverline("build/charts-base/charts-base.js", 8754);+Y.SplineSeries = Y.Base.create("splineSeries", Y.LineSeries, [Y.CurveUtil, Y.Lines], {+ /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawSeries", 8762);+_yuitest_coverline("build/charts-base/charts-base.js", 8764);+this.drawSpline();+ }+}, {+ ATTRS : {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default spline+ */+ type : {+ value:"spline"+ }++ /**+ * Style properties used for drawing lines. This attribute is inherited from `Renderer`. Below are the default values:+ * <dl>+ * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be+ * retrieved from the following array: + * `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]`+ * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>+ * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> + * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>+ * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>+ * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> + * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>+ * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>+ * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++++ ++ +/**+ * StackedSplineSeries creates spline graphs in which the different series are stacked along a value axis+ * to indicate their contribution to a cumulative total.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedSplineSeries+ * @constructor+ * @extends SplineSeries+ * @extends StackingUtil+ */+_yuitest_coverline("build/charts-base/charts-base.js", 8818);+Y.StackedSplineSeries = Y.Base.create("stackedSplineSeries", Y.SplineSeries, [Y.StackingUtil], {+ /**+ * @protected+ *+ * Calculates the coordinates for the series. Overrides base implementation.+ *+ * @method setAreaData+ */+ setAreaData: function()+ { + _yuitest_coverfunc("build/charts-base/charts-base.js", "setAreaData", 8826);+_yuitest_coverline("build/charts-base/charts-base.js", 8828);+Y.StackedSplineSeries.superclass.setAreaData.apply(this);+ _yuitest_coverline("build/charts-base/charts-base.js", 8829);+this._stackCoordinates.apply(this);+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedSpline+ */+ type: {+ value:"stackedSpline"+ }+ }+});++/**+ * StackedMarkerSeries plots markers with different series stacked along the value axis to indicate each+ * series' contribution to a cumulative total.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedMarkerSeries+ * @constructor+ * @extends MarkerSeries+ * @extends StackingUtil+ */+_yuitest_coverline("build/charts-base/charts-base.js", 8857);+Y.StackedMarkerSeries = Y.Base.create("stackedMarkerSeries", Y.MarkerSeries, [Y.StackingUtil], {+ /**+ * @protected+ *+ * Calculates the coordinates for the series. Overrides base implementation.+ *+ * @method setAreaData+ */+ setAreaData: function()+ { + _yuitest_coverfunc("build/charts-base/charts-base.js", "setAreaData", 8865);+_yuitest_coverline("build/charts-base/charts-base.js", 8867);+Y.StackedMarkerSeries.superclass.setAreaData.apply(this);+ _yuitest_coverline("build/charts-base/charts-base.js", 8868);+this._stackCoordinates.apply(this);+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedMarker+ */+ type: {+ value:"stackedMarker"+ }+ }+});++/**+ * The ColumnSeries class renders columns positioned horizontally along a category or time axis. The columns'+ * lengths are proportional to the values they represent along a vertical axis.+ * and the relevant data points.+ *+ * @module charts+ * @submodule charts-base+ * @class ColumnSeries+ * @extends MarkerSeries+ * @uses Histogram+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 8897);+Y.ColumnSeries = Y.Base.create("columnSeries", Y.MarkerSeries, [Y.Histogram], {+ /**+ * Helper method for calculating the size of markers. + *+ * @method _getMarkerDimensions+ * @param {Number} xcoord The x-coordinate representing the data point for the marker.+ * @param {Number} ycoord The y-coordinate representing the data point for the marker.+ * @param {Number} calculatedSize The calculated size for the marker. For a `BarSeries` is it the width. For a `ColumnSeries` it is the height.+ * @param {Number} offset Distance of position offset dictated by other marker series in the same graph.+ * @return Object+ * @private+ */+ _getMarkerDimensions: function(xcoord, ycoord, calculatedSize, offset)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getMarkerDimensions", 8909);+_yuitest_coverline("build/charts-base/charts-base.js", 8911);+var config = {+ left: xcoord + offset+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 8914);+if(this._bottomOrigin >= ycoord)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8916);+config.top = ycoord;+ _yuitest_coverline("build/charts-base/charts-base.js", 8917);+config.calculatedSize = this._bottomOrigin - config.top;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8921);+config.top = this._bottomOrigin;+ _yuitest_coverline("build/charts-base/charts-base.js", 8922);+config.calculatedSize = ycoord - this._bottomOrigin;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 8924);+return config;+ },++ /**+ * Resizes and positions markers based on a mouse interaction.+ *+ * @method updateMarkerState+ * @param {String} type state of the marker+ * @param {Number} i index of the marker+ * @protected+ */+ updateMarkerState: function(type, i)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "updateMarkerState", 8935);+_yuitest_coverline("build/charts-base/charts-base.js", 8937);+if(this._markers && this._markers[i])+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8939);+var styles = Y.clone(this.get("styles").marker),+ markerStyles,+ state = this._getState(type),+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ marker = this._markers[i],+ markers,+ graph = this.get("graph"),+ seriesStyles,+ seriesCollection = graph.seriesTypes[this.get("type")],+ seriesLen = seriesCollection.length,+ seriesSize = 0,+ offset = 0,+ renderer,+ n = 0,+ xs = [],+ order = this.get("order"),+ config;+ _yuitest_coverline("build/charts-base/charts-base.js", 8957);+markerStyles = state == "off" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]); + _yuitest_coverline("build/charts-base/charts-base.js", 8958);+markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);+ _yuitest_coverline("build/charts-base/charts-base.js", 8959);+markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);+ _yuitest_coverline("build/charts-base/charts-base.js", 8960);+config = this._getMarkerDimensions(xcoords[i], ycoords[i], styles.width, offset);+ _yuitest_coverline("build/charts-base/charts-base.js", 8961);+markerStyles.height = config.calculatedSize;+ _yuitest_coverline("build/charts-base/charts-base.js", 8962);+markerStyles.width = Math.min(this._maxSize, markerStyles.width);+ _yuitest_coverline("build/charts-base/charts-base.js", 8963);+marker.set(markerStyles);+ _yuitest_coverline("build/charts-base/charts-base.js", 8964);+for(; n < seriesLen; ++n)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8966);+xs[n] = xcoords[i] + seriesSize;+ _yuitest_coverline("build/charts-base/charts-base.js", 8967);+seriesStyles = seriesCollection[n].get("styles").marker;+ _yuitest_coverline("build/charts-base/charts-base.js", 8968);+seriesSize += Math.min(this._maxSize, seriesStyles.width);+ _yuitest_coverline("build/charts-base/charts-base.js", 8969);+if(order > n)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8971);+offset = seriesSize;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 8973);+offset -= seriesSize/2;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 8975);+for(n = 0; n < seriesLen; ++n)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8977);+markers = seriesCollection[n].get("markers");+ _yuitest_coverline("build/charts-base/charts-base.js", 8978);+if(markers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8980);+renderer = markers[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 8981);+if(renderer && renderer !== undefined)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 8983);+renderer.set("x", (xs[n] - seriesSize/2));+ }+ }+ }+ }+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @readOnly+ * @default column+ */+ type: {+ value: "column"+ }+ + /**+ * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>width</dt><dd>indicates the width of the marker. The default value is 12.</dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});+/**+ * The BarSeries class renders bars positioned vertically along a category or time axis. The bars'+ * lengths are proportional to the values they represent along a horizontal axis.+ * and the relevant data points.+ *+ * @module charts+ * @submodule charts-base+ * @class BarSeries+ * @extends MarkerSeries+ * @uses Histogram+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 9047);+Y.BarSeries = Y.Base.create("barSeries", Y.MarkerSeries, [Y.Histogram], {+ /**+ * Helper method for calculating the size of markers. + *+ * @method _getMarkerDimensions+ * @param {Number} xcoord The x-coordinate representing the data point for the marker.+ * @param {Number} ycoord The y-coordinate representing the data point for the marker.+ * @param {Number} calculatedSize The calculated size for the marker. For a `BarSeries` is it the width. For a `ColumnSeries` it is the height.+ * @param {Number} offset Distance of position offset dictated by other marker series in the same graph.+ * @return Object+ * @private+ */+ _getMarkerDimensions: function(xcoord, ycoord, calculatedSize, offset)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getMarkerDimensions", 9059);+_yuitest_coverline("build/charts-base/charts-base.js", 9061);+var config = {+ top: ycoord + offset+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 9064);+if(xcoord >= this._leftOrigin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9066);+config.left = this._leftOrigin;+ _yuitest_coverline("build/charts-base/charts-base.js", 9067);+config.calculatedSize = xcoord - config.left;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9071);+config.left = xcoord;+ _yuitest_coverline("build/charts-base/charts-base.js", 9072);+config.calculatedSize = this._leftOrigin - xcoord;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 9074);+return config;+ },+ + /**+ * Resizes and positions markers based on a mouse interaction.+ *+ * @method updateMarkerState+ * @param {String} type state of the marker+ * @param {Number} i index of the marker+ * @protected+ */+ updateMarkerState: function(type, i)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "updateMarkerState", 9085);+_yuitest_coverline("build/charts-base/charts-base.js", 9087);+if(this._markers && this._markers[i])+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9089);+var styles = Y.clone(this.get("styles").marker),+ markerStyles,+ state = this._getState(type),+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ marker = this._markers[i],+ markers,+ graph = this.get("graph"),+ seriesCollection = graph.seriesTypes[this.get("type")],+ seriesLen = seriesCollection.length,+ seriesStyles,+ seriesSize = 0,+ offset = 0,+ renderer,+ n = 0,+ ys = [],+ order = this.get("order"),+ config;+ _yuitest_coverline("build/charts-base/charts-base.js", 9107);+markerStyles = state == "off" || !styles[state] ? styles : styles[state]; + _yuitest_coverline("build/charts-base/charts-base.js", 9108);+markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);+ _yuitest_coverline("build/charts-base/charts-base.js", 9109);+markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);+ _yuitest_coverline("build/charts-base/charts-base.js", 9110);+config = this._getMarkerDimensions(xcoords[i], ycoords[i], styles.height, offset);+ _yuitest_coverline("build/charts-base/charts-base.js", 9111);+markerStyles.width = config.calculatedSize;+ _yuitest_coverline("build/charts-base/charts-base.js", 9112);+markerStyles.height = Math.min(this._maxSize, markerStyles.height);+ _yuitest_coverline("build/charts-base/charts-base.js", 9113);+marker.set(markerStyles);+ _yuitest_coverline("build/charts-base/charts-base.js", 9114);+for(; n < seriesLen; ++n)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9116);+ys[n] = ycoords[i] + seriesSize;+ _yuitest_coverline("build/charts-base/charts-base.js", 9117);+seriesStyles = seriesCollection[n].get("styles").marker;+ _yuitest_coverline("build/charts-base/charts-base.js", 9118);+seriesSize += Math.min(this._maxSize, seriesStyles.height); + _yuitest_coverline("build/charts-base/charts-base.js", 9119);+if(order > n)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9121);+offset = seriesSize;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 9123);+offset -= seriesSize/2;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 9125);+for(n = 0; n < seriesLen; ++n)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9127);+markers = seriesCollection[n].get("markers");+ _yuitest_coverline("build/charts-base/charts-base.js", 9128);+if(markers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9130);+renderer = markers[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 9131);+if(renderer && renderer !== undefined)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9133);+renderer.set("y", (ys[n] - seriesSize/2));+ }+ }+ }+ }+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default bar+ */+ type: {+ value: "bar"+ },++ /**+ * Indicates the direction of the category axis that the bars are plotted against.+ *+ * @attribute direction+ * @type String+ */+ direction: {+ value: "vertical"+ }+ + /**+ * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>height</dt><dd>indicates the width of the marker. The default value is 12.</dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});+/**+ * The AreaSeries class renders quantitative data on a graph by creating a fill between 0+ * and the relevant data points.+ *+ * @module charts+ * @submodule charts-base+ * @class AreaSeries+ * @extends CartesianSeries+ * @uses Fills+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 9205);+Y.AreaSeries = Y.Base.create("areaSeries", Y.CartesianSeries, [Y.Fills], {+ /**+ * @protected+ *+ * Renders the series. + *+ * @method drawSeries+ */+ drawSeries: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawSeries", 9213);+_yuitest_coverline("build/charts-base/charts-base.js", 9215);+this.drawFill.apply(this, this._getClosingPoints());+ },+ + /**+ * @protected+ *+ * Method used by `styles` setter. Overrides base implementation.+ *+ * @method _setStyles+ * @param {Object} newStyles Hash of properties to update.+ * @return Object+ */+ _setStyles: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setStyles", 9227);+_yuitest_coverline("build/charts-base/charts-base.js", 9229);+if(!val.area)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9231);+val = {area:val};+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 9233);+return Y.AreaSeries.superclass._setStyles.apply(this, [val]);+ },++ /**+ * @protected+ *+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ */+ _getDefaultStyles: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultStyles", 9245);+_yuitest_coverline("build/charts-base/charts-base.js", 9247);+var styles = this._mergeStyles({area:this._getAreaDefaults()}, Y.AreaSeries.superclass._getDefaultStyles());+ _yuitest_coverline("build/charts-base/charts-base.js", 9248);+return styles;+ }+},+{+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default area+ */+ type: {+ value:"area"+ }+ + /**+ * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values:+ *+ * <dl>+ * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be + * retrieved from the following array:+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++++ ++ +/**+ * AreaSplineSeries renders an area graph with data points connected by a curve.+ *+ * @module charts+ * @submodule charts-base+ * @class AreaSplineSeries+ * @constructor+ * @extends CartesianSeries+ * @uses Fills+ * @uses CurveUtil+ */+_yuitest_coverline("build/charts-base/charts-base.js", 9297);+Y.AreaSplineSeries = Y.Base.create("areaSplineSeries", Y.AreaSeries, [Y.CurveUtil], {+ /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawSeries", 9305);+_yuitest_coverline("build/charts-base/charts-base.js", 9307);+this.drawAreaSpline();+ }+}, {+ ATTRS : {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default areaSpline+ */+ type: {+ value:"areaSpline"+ }+ + /**+ * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values:+ *+ * <dl>+ * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be + * retrieved from the following array:+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++/**+ * StackedAreaSplineSeries creates a stacked area chart with points data points connected by a curve.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedAreaSplineSeries+ * @constructor+ * @extends AreaSeries+ * @uses CurveUtil+ * @uses StackingUtil+ */+_yuitest_coverline("build/charts-base/charts-base.js", 9350);+Y.StackedAreaSplineSeries = Y.Base.create("stackedAreaSplineSeries", Y.AreaSeries, [Y.CurveUtil, Y.StackingUtil], {+ /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawSeries", 9358);+_yuitest_coverline("build/charts-base/charts-base.js", 9360);+this._stackCoordinates();+ _yuitest_coverline("build/charts-base/charts-base.js", 9361);+this.drawStackedAreaSpline();+ }+}, {+ ATTRS : {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedAreaSpline+ */+ type: {+ value:"stackedAreaSpline"+ }+ }+});++/**+ * The ComboSeries class renders a combination of lines, plots and area fills in a single series. Each+ * series type has a corresponding boolean attribute indicating if it is rendered. By default, lines and plots + * are rendered and area is not. + *+ * @module charts+ * @submodule charts-base+ * @class ComboSeries+ * @extends CartesianSeries + * @uses Fills+ * @uses Lines+ * @uses Plots+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 9392);+Y.ComboSeries = Y.Base.create("comboSeries", Y.CartesianSeries, [Y.Fills, Y.Lines, Y.Plots], {+ /**+ * @protected+ * + * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawSeries", 9400);+_yuitest_coverline("build/charts-base/charts-base.js", 9402);+if(this.get("showAreaFill"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9404);+this.drawFill.apply(this, this._getClosingPoints());+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 9406);+if(this.get("showLines")) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 9408);+this.drawLines();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 9410);+if(this.get("showMarkers"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9412);+this.drawPlots();+ } + },+ + /**+ * Toggles visibility+ *+ * @method _toggleVisible+ * @param {Boolean} visible indicates visibilitye+ * @private+ */+ _toggleVisible: function(visible)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_toggleVisible", 9423);+_yuitest_coverline("build/charts-base/charts-base.js", 9425);+var markers,+ marker,+ len,+ i;+ _yuitest_coverline("build/charts-base/charts-base.js", 9429);+if(this.get("showAreaFill") && this._path)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9431);+this._path.set("visible", visible);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 9433);+if(this.get("showLines") && this._lineGraphic)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9435);+this._lineGraphic.set("visible", visible);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 9437);+if(this.get("showMarkers"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9439);+markers = this.get("markers");+ _yuitest_coverline("build/charts-base/charts-base.js", 9440);+if(markers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9442);+i = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 9443);+len = markers.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 9444);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9446);+marker = markers[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 9447);+if(marker)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9449);+marker.set("visible", visible);+ }+ }+ }+ }+ },++ /**+ * @protected+ *+ * Returns the default hash for the `styles` attribute.+ *+ * @method _getDefaultStyles+ * @return Object+ */+ _getDefaultStyles: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultStyles", 9464);+_yuitest_coverline("build/charts-base/charts-base.js", 9466);+var styles = Y.ComboSeries.superclass._getDefaultStyles();+ _yuitest_coverline("build/charts-base/charts-base.js", 9467);+styles.line = this._getLineDefaults();+ _yuitest_coverline("build/charts-base/charts-base.js", 9468);+styles.marker = this._getPlotDefaults();+ _yuitest_coverline("build/charts-base/charts-base.js", 9469);+styles.area = this._getAreaDefaults();+ _yuitest_coverline("build/charts-base/charts-base.js", 9470);+return styles;+ }+},+{+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default combo+ */+ type: {+ value:"combo"+ },++ /**+ * Indicates whether a fill is displayed.+ *+ * @attribute showAreaFill+ * @type Boolean+ * @default false+ */+ showAreaFill: {+ value: false+ },++ /**+ * Indicates whether lines are displayed.+ *+ * @attribute showLines+ * @type Boolean+ * @default true+ */+ showLines: {+ value: true+ },++ /**+ * Indicates whether markers are displayed.+ *+ * @attribute showMarkers+ * @type Boolean+ * @default true+ */+ showMarkers: {+ value: true+ },++ /**+ * Reference to the styles of the markers. These styles can also+ * be accessed through the `styles` attribute. Below are default+ * values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"]`+ * </dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>width</dt><dd>indicates the width of the marker. The default value is 10.</dd>+ * <dt>height</dt><dd>indicates the height of the marker The default value is 10.</dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute marker+ * @type Object+ */+ marker: {+ lazyAdd: false,+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 9554);+_yuitest_coverline("build/charts-base/charts-base.js", 9556);+return this.get("styles").marker;+ },+ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 9558);+_yuitest_coverline("build/charts-base/charts-base.js", 9560);+this.set("styles", {marker:val});+ }+ },+ + /**+ * Reference to the styles of the lines. These styles can also be accessed through the `styles` attribute.+ * Below are the default values:+ * <dl>+ * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be+ * retrieved from the following array: + * `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]`+ * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>+ * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> + * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>+ * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>+ * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> + * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>+ * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>+ * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>+ * </dl>+ *+ * @attribute line+ * @type Object+ */+ line: {+ lazyAdd: false,+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 9587);+_yuitest_coverline("build/charts-base/charts-base.js", 9589);+return this.get("styles").line;+ },+ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 9591);+_yuitest_coverline("build/charts-base/charts-base.js", 9593);+this.set("styles", {line:val});+ }+ },+ + /**+ * Reference to the styles of the area fills. These styles can also be accessed through the `styles` attribute.+ * Below are the default values:+ *+ * <dl>+ * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be + * retrieved from the following array:+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>+ * </dl>+ *+ * @attribute area+ * @type Object+ */+ area: {+ lazyAdd: false,+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 9614);+_yuitest_coverline("build/charts-base/charts-base.js", 9616);+return this.get("styles").area;+ },+ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 9618);+_yuitest_coverline("build/charts-base/charts-base.js", 9620);+this.set("styles", {area:val});+ }+ }++ /**+ * Style properties for the series. Contains a key indexed hash of the following:+ * <dl>+ * <dt>marker</dt><dd>Style properties for the markers in the series. Specific style attributes are listed+ * <a href="#attr_marker">here</a>.</dd>+ * <dt>line</dt><dd>Style properties for the lines in the series. Specific+ * style attributes are listed <a href="#attr_line">here</a>.</dd>+ * <dt>area</dt><dd>Style properties for the area fills in the series. Specific style attributes are listed+ * <a href="#attr_area">here</a>.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++++ ++ +/**+ * The StackedComboSeries class renders a combination of lines, plots and area fills in a single series. Series+ * are stacked along the value axis to indicate each series contribution to a cumulative total. Each+ * series type has a corresponding boolean attribute indicating if it is rendered. By default, all three types are+ * rendered. + *+ * @module charts+ * @submodule charts-base+ * @class StackedComboSeries+ * @extends ComboSeries+ * @uses StackingUtil+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 9659);+Y.StackedComboSeries = Y.Base.create("stackedComboSeries", Y.ComboSeries, [Y.StackingUtil], {+ /**+ * @protected+ *+ * Calculates the coordinates for the series. Overrides base implementation.+ *+ * @method setAreaData+ */+ setAreaData: function()+ { + _yuitest_coverfunc("build/charts-base/charts-base.js", "setAreaData", 9667);+_yuitest_coverline("build/charts-base/charts-base.js", 9669);+Y.StackedComboSeries.superclass.setAreaData.apply(this);+ _yuitest_coverline("build/charts-base/charts-base.js", 9670);+this._stackCoordinates.apply(this);+ },+ + /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawSeries", 9680);+_yuitest_coverline("build/charts-base/charts-base.js", 9682);+if(this.get("showAreaFill"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9684);+this.drawFill.apply(this, this._getStackedClosingPoints());+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 9686);+if(this.get("showLines")) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 9688);+this.drawLines();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 9690);+if(this.get("showMarkers"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9692);+this.drawPlots();+ } + }+ +}, {+ ATTRS : {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedCombo+ */+ type: {+ value: "stackedCombo"+ },++ /**+ * Indicates whether a fill is displayed.+ *+ * @attribute showAreaFill+ * @type Boolean+ * @default true+ */+ showAreaFill: {+ value: true+ }+ }+});+/**+ * The ComboSplineSeries class renders a combination of splines, plots and areaspline fills in a single series. Each+ * series type has a corresponding boolean attribute indicating if it is rendered. By default, splines and plots + * are rendered and areaspline is not. + *+ * @module charts+ * @submodule charts-base+ * @class ComboSplineSeries+ * @extends ComboSeries+ * @extends CurveUtil+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 9733);+Y.ComboSplineSeries = Y.Base.create("comboSplineSeries", Y.ComboSeries, [Y.CurveUtil], {+ /**+ * @protected+ * + * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawSeries", 9741);+_yuitest_coverline("build/charts-base/charts-base.js", 9743);+if(this.get("showAreaFill"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9745);+this.drawAreaSpline();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 9747);+if(this.get("showLines")) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 9749);+this.drawSpline();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 9751);+if(this.get("showMarkers"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9753);+this.drawPlots();+ } + }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default comboSpline+ */+ type: {+ value : "comboSpline"+ }+ }+});+/**+ * The StackedComboSplineSeries class renders a combination of splines, plots and areaspline fills in a single series. Series+ * are stacked along the value axis to indicate each series contribution to a cumulative total. Each+ * series type has a corresponding boolean attribute indicating if it is rendered. By default, all three types are+ * rendered. + *+ * @module charts+ * @submodule charts-base+ * @class StackedComboSplineSeries+ * @extends StackedComboSeries+ * @uses CurveUtil+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 9783);+Y.StackedComboSplineSeries = Y.Base.create("stackedComboSplineSeries", Y.StackedComboSeries, [Y.CurveUtil], {+ /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawSeries", 9791);+_yuitest_coverline("build/charts-base/charts-base.js", 9793);+if(this.get("showAreaFill"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9795);+this.drawStackedAreaSpline();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 9797);+if(this.get("showLines")) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 9799);+this.drawSpline();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 9801);+if(this.get("showMarkers"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9803);+this.drawPlots();+ } + }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedComboSpline+ */+ type : {+ value : "stackedComboSpline"+ },++ /**+ * Indicates whether a fill is displayed.+ *+ * @attribute showAreaFill+ * @type Boolean+ * @default true+ */+ showAreaFill: {+ value: true+ }+ }+});+/**+ * StackedLineSeries creates line graphs in which the different series are stacked along a value axis+ * to indicate their contribution to a cumulative total.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedLineSeries+ * @constructor+ * @extends LineSeries+ * @uses StackingUtil+ */+_yuitest_coverline("build/charts-base/charts-base.js", 9842);+Y.StackedLineSeries = Y.Base.create("stackedLineSeries", Y.LineSeries, [Y.StackingUtil], {+ /**+ * @protected+ *+ * Calculates the coordinates for the series. Overrides base implementation.+ *+ * @method setAreaData+ */+ setAreaData: function()+ { + _yuitest_coverfunc("build/charts-base/charts-base.js", "setAreaData", 9850);+_yuitest_coverline("build/charts-base/charts-base.js", 9852);+Y.StackedLineSeries.superclass.setAreaData.apply(this);+ _yuitest_coverline("build/charts-base/charts-base.js", 9853);+this._stackCoordinates.apply(this);+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedLine+ */+ type: {+ value:"stackedLine"+ }+ }+});+/**+ * StackedAreaSeries area fills to display data showing its contribution to a whole.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedAreaSeries+ * @constructor+ * @param {Object} config (optional) Configuration parameters for the Chart.+ * @extends AreaSeries+ * @uses StackingUtil+ */+_yuitest_coverline("build/charts-base/charts-base.js", 9880);+Y.StackedAreaSeries = Y.Base.create("stackedAreaSeries", Y.AreaSeries, [Y.StackingUtil], {+ /**+ * @protected+ *+ * Calculates the coordinates for the series. Overrides base implementation.+ *+ * @method setAreaData+ */+ setAreaData: function()+ { + _yuitest_coverfunc("build/charts-base/charts-base.js", "setAreaData", 9888);+_yuitest_coverline("build/charts-base/charts-base.js", 9890);+Y.StackedAreaSeries.superclass.setAreaData.apply(this);+ _yuitest_coverline("build/charts-base/charts-base.js", 9891);+this._stackCoordinates.apply(this);+ },++ /**+ * @protected+ *+ * Draws the series+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawSeries", 9901);+_yuitest_coverline("build/charts-base/charts-base.js", 9903);+this.drawFill.apply(this, this._getStackedClosingPoints());+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedArea+ */+ type: {+ value:"stackedArea"+ }+ }+});+/**+ * The StackedColumnSeries renders column chart in which series are stacked vertically to show+ * their contribution to the cumulative total.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedColumnSeries+ * @extends ColumnSeries+ * @uses StackingUtil+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 9930);+Y.StackedColumnSeries = Y.Base.create("stackedColumnSeries", Y.ColumnSeries, [Y.StackingUtil], {+ /**+ * Draws the series.+ *+ * @method drawSeries+ * @protected+ */+ drawSeries: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawSeries", 9937);+_yuitest_coverline("build/charts-base/charts-base.js", 9939);+if(this.get("xcoords").length < 1) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 9941);+return;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 9943);+var isNumber = Y_Lang.isNumber,+ style = Y.clone(this.get("styles").marker), + w = style.width,+ h = style.height,+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ i = 0,+ len = xcoords.length,+ top = ycoords[0],+ type = this.get("type"),+ graph = this.get("graph"),+ seriesCollection = graph.seriesTypes[type],+ ratio,+ order = this.get("order"),+ graphOrder = this.get("graphOrder"),+ left,+ marker,+ fillColors,+ borderColors,+ lastCollection,+ negativeBaseValues,+ positiveBaseValues,+ useOrigin = order === 0,+ totalWidth = len * w,+ dimensions = {+ width: [],+ height: []+ },+ xvalues = [],+ yvalues = [],+ groupMarkers = this.get("groupMarkers");+ _yuitest_coverline("build/charts-base/charts-base.js", 9974);+if(Y_Lang.isArray(style.fill.color))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9976);+fillColors = style.fill.color.concat(); + }+ _yuitest_coverline("build/charts-base/charts-base.js", 9978);+if(Y_Lang.isArray(style.border.color))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9980);+borderColors = style.border.color.concat();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 9982);+this._createMarkerCache();+ _yuitest_coverline("build/charts-base/charts-base.js", 9983);+if(totalWidth > this.get("width"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9985);+ratio = this.width/totalWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 9986);+w *= ratio;+ _yuitest_coverline("build/charts-base/charts-base.js", 9987);+w = Math.max(w, 1);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 9989);+if(!useOrigin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9991);+lastCollection = seriesCollection[order - 1];+ _yuitest_coverline("build/charts-base/charts-base.js", 9992);+negativeBaseValues = lastCollection.get("negativeBaseValues");+ _yuitest_coverline("build/charts-base/charts-base.js", 9993);+positiveBaseValues = lastCollection.get("positiveBaseValues");+ _yuitest_coverline("build/charts-base/charts-base.js", 9994);+if(!negativeBaseValues || !positiveBaseValues)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 9996);+useOrigin = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 9997);+positiveBaseValues = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 9998);+negativeBaseValues = [];+ }+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10003);+negativeBaseValues = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 10004);+positiveBaseValues = [];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10006);+this.set("negativeBaseValues", negativeBaseValues);+ _yuitest_coverline("build/charts-base/charts-base.js", 10007);+this.set("positiveBaseValues", positiveBaseValues);+ _yuitest_coverline("build/charts-base/charts-base.js", 10008);+for(i = 0; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10010);+left = xcoords[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 10011);+top = ycoords[i];+ + _yuitest_coverline("build/charts-base/charts-base.js", 10013);+if(!isNumber(top) || !isNumber(left))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10015);+if(useOrigin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10017);+negativeBaseValues[i] = this._bottomOrigin;+ _yuitest_coverline("build/charts-base/charts-base.js", 10018);+positiveBaseValues[i] = this._bottomOrigin;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10020);+this._markers.push(null); + _yuitest_coverline("build/charts-base/charts-base.js", 10021);+continue;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10023);+if(useOrigin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10025);+h = Math.abs(this._bottomOrigin - top);+ _yuitest_coverline("build/charts-base/charts-base.js", 10026);+if(top < this._bottomOrigin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10028);+positiveBaseValues[i] = top;+ _yuitest_coverline("build/charts-base/charts-base.js", 10029);+negativeBaseValues[i] = this._bottomOrigin;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 10031);+if(top > this._bottomOrigin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10033);+positiveBaseValues[i] = this._bottomOrigin;+ _yuitest_coverline("build/charts-base/charts-base.js", 10034);+negativeBaseValues[i] = top;+ _yuitest_coverline("build/charts-base/charts-base.js", 10035);+top -= h;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10039);+positiveBaseValues[i] = top;+ _yuitest_coverline("build/charts-base/charts-base.js", 10040);+negativeBaseValues[i] = top;+ }}+ }+ else + {+ _yuitest_coverline("build/charts-base/charts-base.js", 10045);+if(top > this._bottomOrigin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10047);+top += (negativeBaseValues[i] - this._bottomOrigin);+ _yuitest_coverline("build/charts-base/charts-base.js", 10048);+h = top - negativeBaseValues[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 10049);+negativeBaseValues[i] = top;+ _yuitest_coverline("build/charts-base/charts-base.js", 10050);+top -= h;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 10052);+if(top <= this._bottomOrigin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10054);+top = positiveBaseValues[i] - (this._bottomOrigin - top);+ _yuitest_coverline("build/charts-base/charts-base.js", 10055);+h = positiveBaseValues[i] - top;+ _yuitest_coverline("build/charts-base/charts-base.js", 10056);+positiveBaseValues[i] = top;+ }}+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10059);+if(!isNaN(h) && h > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10061);+left -= w/2;+ _yuitest_coverline("build/charts-base/charts-base.js", 10062);+if(groupMarkers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10064);+dimensions.width[i] = w;+ _yuitest_coverline("build/charts-base/charts-base.js", 10065);+dimensions.height[i] = h;+ _yuitest_coverline("build/charts-base/charts-base.js", 10066);+xvalues.push(left);+ _yuitest_coverline("build/charts-base/charts-base.js", 10067);+yvalues.push(top);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10071);+style.width = w;+ _yuitest_coverline("build/charts-base/charts-base.js", 10072);+style.height = h;+ _yuitest_coverline("build/charts-base/charts-base.js", 10073);+style.x = left;+ _yuitest_coverline("build/charts-base/charts-base.js", 10074);+style.y = top;+ _yuitest_coverline("build/charts-base/charts-base.js", 10075);+if(fillColors)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10077);+style.fill.color = fillColors[i % fillColors.length];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10079);+if(borderColors)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10081);+style.border.color = borderColors[i % borderColors.length];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10083);+marker = this.getMarker(style, graphOrder, i);+ }+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 10086);+if(!groupMarkers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10088);+this._markers.push(null);+ }}+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10091);+if(groupMarkers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10093);+this._createGroupMarker({+ fill: style.fill,+ border: style.border,+ dimensions: dimensions,+ xvalues: xvalues,+ yvalues: yvalues,+ shape: style.shape+ });+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10104);+this._clearMarkerCache();+ }+ },++ /**+ * Resizes and positions markers based on a mouse interaction.+ *+ * @method updateMarkerState+ * @param {String} type state of the marker+ * @param {Number} i index of the marker+ * @protected+ */+ updateMarkerState: function(type, i)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "updateMarkerState", 10116);+_yuitest_coverline("build/charts-base/charts-base.js", 10118);+if(this._markers && this._markers[i])+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10120);+var styles,+ markerStyles,+ state = this._getState(type),+ xcoords = this.get("xcoords"),+ marker = this._markers[i],+ offset = 0,+ fillColor,+ borderColor; + _yuitest_coverline("build/charts-base/charts-base.js", 10128);+styles = this.get("styles").marker;+ _yuitest_coverline("build/charts-base/charts-base.js", 10129);+offset = styles.width * 0.5;+ _yuitest_coverline("build/charts-base/charts-base.js", 10130);+markerStyles = state == "off" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]); + _yuitest_coverline("build/charts-base/charts-base.js", 10131);+markerStyles.height = marker.get("height");+ _yuitest_coverline("build/charts-base/charts-base.js", 10132);+markerStyles.x = (xcoords[i] - offset);+ _yuitest_coverline("build/charts-base/charts-base.js", 10133);+markerStyles.y = marker.get("y");+ _yuitest_coverline("build/charts-base/charts-base.js", 10134);+markerStyles.id = marker.get("id");+ _yuitest_coverline("build/charts-base/charts-base.js", 10135);+fillColor = markerStyles.fill.color; + _yuitest_coverline("build/charts-base/charts-base.js", 10136);+borderColor = markerStyles.border.color;+ _yuitest_coverline("build/charts-base/charts-base.js", 10137);+if(Y_Lang.isArray(fillColor))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10139);+markerStyles.fill.color = fillColor[i % fillColor.length];+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10143);+markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10145);+if(Y_Lang.isArray(borderColor))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10147);+markerStyles.border.color = borderColor[i % borderColor.length];+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10151);+markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10153);+marker.set(markerStyles);+ }+ },+ + /**+ * Gets the default values for the markers. + *+ * @method _getPlotDefaults+ * @return Object+ * @protected+ */+ _getPlotDefaults: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getPlotDefaults", 10164);+_yuitest_coverline("build/charts-base/charts-base.js", 10166);+var defs = {+ fill:{+ type: "solid",+ alpha: 1,+ colors:null,+ alphas: null,+ ratios: null+ },+ border:{+ weight: 0,+ alpha: 1+ },+ width: 24,+ height: 24,+ shape: "rect",++ padding:{+ top: 0,+ left: 0,+ right: 0,+ bottom: 0+ }+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 10189);+defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");+ _yuitest_coverline("build/charts-base/charts-base.js", 10190);+defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");+ _yuitest_coverline("build/charts-base/charts-base.js", 10191);+return defs;+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedColumn+ */+ type: {+ value: "stackedColumn"+ },++ /**+ * @attribute negativeBaseValues+ * @type Array+ * @default null+ * @private+ */+ negativeBaseValues: {+ value: null+ },++ /**+ * @attribute positiveBaseValues+ * @type Array+ * @default null+ * @private+ */+ positiveBaseValues: {+ value: null+ }+ + /**+ * Style properties used for drawing markers. This attribute is inherited from `ColumnSeries`. Below are the default values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>width</dt><dd>indicates the width of the marker. The default value is 24.</dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++/**+ * The StackedBarSeries renders bar chart in which series are stacked horizontally to show+ * their contribution to the cumulative total.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedBarSeries+ * @extends BarSeries+ * @uses StackingUtil+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 10270);+Y.StackedBarSeries = Y.Base.create("stackedBarSeries", Y.BarSeries, [Y.StackingUtil], {+ /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawSeries", 10278);+_yuitest_coverline("build/charts-base/charts-base.js", 10280);+if(this.get("xcoords").length < 1) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 10282);+return;+ }++ _yuitest_coverline("build/charts-base/charts-base.js", 10285);+var isNumber = Y_Lang.isNumber,+ style = Y.clone(this.get("styles").marker),+ w = style.width,+ h = style.height,+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ i = 0,+ len = xcoords.length,+ top = ycoords[0],+ type = this.get("type"),+ graph = this.get("graph"),+ seriesCollection = graph.seriesTypes[type],+ ratio,+ order = this.get("order"),+ graphOrder = this.get("graphOrder"),+ left,+ marker,+ lastCollection,+ negativeBaseValues,+ positiveBaseValues,+ fillColors,+ borderColors,+ useOrigin = order === 0,+ totalHeight = len * h,+ dimensions = {+ width: [],+ height: []+ },+ xvalues = [],+ yvalues = [],+ groupMarkers = this.get("groupMarkers");+ _yuitest_coverline("build/charts-base/charts-base.js", 10316);+if(Y_Lang.isArray(style.fill.color))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10318);+fillColors = style.fill.color.concat(); + }+ _yuitest_coverline("build/charts-base/charts-base.js", 10320);+if(Y_Lang.isArray(style.border.color))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10322);+borderColors = style.border.color.concat();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10324);+this._createMarkerCache();+ _yuitest_coverline("build/charts-base/charts-base.js", 10325);+if(totalHeight > this.get("height"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10327);+ratio = this.height/totalHeight;+ _yuitest_coverline("build/charts-base/charts-base.js", 10328);+h *= ratio;+ _yuitest_coverline("build/charts-base/charts-base.js", 10329);+h = Math.max(h, 1);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10331);+if(!useOrigin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10333);+lastCollection = seriesCollection[order - 1];+ _yuitest_coverline("build/charts-base/charts-base.js", 10334);+negativeBaseValues = lastCollection.get("negativeBaseValues");+ _yuitest_coverline("build/charts-base/charts-base.js", 10335);+positiveBaseValues = lastCollection.get("positiveBaseValues");+ _yuitest_coverline("build/charts-base/charts-base.js", 10336);+if(!negativeBaseValues || !positiveBaseValues)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10338);+useOrigin = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 10339);+positiveBaseValues = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 10340);+negativeBaseValues = [];+ }+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10345);+negativeBaseValues = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 10346);+positiveBaseValues = [];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10348);+this.set("negativeBaseValues", negativeBaseValues);+ _yuitest_coverline("build/charts-base/charts-base.js", 10349);+this.set("positiveBaseValues", positiveBaseValues);+ _yuitest_coverline("build/charts-base/charts-base.js", 10350);+for(i = 0; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10352);+top = ycoords[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 10353);+left = xcoords[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 10354);+if(!isNumber(top) || !isNumber(left))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10356);+if(useOrigin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10358);+positiveBaseValues[i] = this._leftOrigin;+ _yuitest_coverline("build/charts-base/charts-base.js", 10359);+negativeBaseValues[i] = this._leftOrigin;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10361);+this._markers.push(null);+ _yuitest_coverline("build/charts-base/charts-base.js", 10362);+continue;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10364);+if(useOrigin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10366);+w = Math.abs(left - this._leftOrigin);+ _yuitest_coverline("build/charts-base/charts-base.js", 10367);+if(left > this._leftOrigin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10369);+positiveBaseValues[i] = left;+ _yuitest_coverline("build/charts-base/charts-base.js", 10370);+negativeBaseValues[i] = this._leftOrigin;+ _yuitest_coverline("build/charts-base/charts-base.js", 10371);+left -= w;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 10373);+if(left < this._leftOrigin)+ { + _yuitest_coverline("build/charts-base/charts-base.js", 10375);+positiveBaseValues[i] = this._leftOrigin;+ _yuitest_coverline("build/charts-base/charts-base.js", 10376);+negativeBaseValues[i] = left;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10380);+positiveBaseValues[i] = left;+ _yuitest_coverline("build/charts-base/charts-base.js", 10381);+negativeBaseValues[i] = this._leftOrigin;+ }}+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10386);+if(left < this._leftOrigin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10388);+left = negativeBaseValues[i] - (this._leftOrigin - xcoords[i]);+ _yuitest_coverline("build/charts-base/charts-base.js", 10389);+w = negativeBaseValues[i] - left;+ _yuitest_coverline("build/charts-base/charts-base.js", 10390);+negativeBaseValues[i] = left;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 10392);+if(left >= this._leftOrigin)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10394);+left += (positiveBaseValues[i] - this._leftOrigin);+ _yuitest_coverline("build/charts-base/charts-base.js", 10395);+w = left - positiveBaseValues[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 10396);+positiveBaseValues[i] = left;+ _yuitest_coverline("build/charts-base/charts-base.js", 10397);+left -= w;+ }}+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10400);+if(!isNaN(w) && w > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10402);+top -= h/2;+ _yuitest_coverline("build/charts-base/charts-base.js", 10403);+if(groupMarkers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10405);+dimensions.width[i] = w;+ _yuitest_coverline("build/charts-base/charts-base.js", 10406);+dimensions.height[i] = h;+ _yuitest_coverline("build/charts-base/charts-base.js", 10407);+xvalues.push(left);+ _yuitest_coverline("build/charts-base/charts-base.js", 10408);+yvalues.push(top);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10412);+style.width = w;+ _yuitest_coverline("build/charts-base/charts-base.js", 10413);+style.height = h;+ _yuitest_coverline("build/charts-base/charts-base.js", 10414);+style.x = left;+ _yuitest_coverline("build/charts-base/charts-base.js", 10415);+style.y = top;+ _yuitest_coverline("build/charts-base/charts-base.js", 10416);+if(fillColors)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10418);+style.fill.color = fillColors[i % fillColors.length];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10420);+if(borderColors)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10422);+style.border.color = borderColors[i % borderColors.length];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10424);+marker = this.getMarker(style, graphOrder, i);+ }+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 10427);+if(!groupMarkers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10429);+this._markers.push(null);+ }}+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10432);+if(groupMarkers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10434);+this._createGroupMarker({+ fill: style.fill,+ border: style.border,+ dimensions: dimensions,+ xvalues: xvalues,+ yvalues: yvalues,+ shape: style.shape+ });+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10445);+this._clearMarkerCache();+ }+ },++ /**+ * @protected+ *+ * Resizes and positions markers based on a mouse interaction.+ *+ * @method updateMarkerState+ * @param {String} type state of the marker+ * @param {Number} i index of the marker+ */+ updateMarkerState: function(type, i)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "updateMarkerState", 10458);+_yuitest_coverline("build/charts-base/charts-base.js", 10460);+if(this._markers[i])+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10462);+var state = this._getState(type),+ ycoords = this.get("ycoords"),+ marker = this._markers[i],+ styles = this.get("styles").marker,+ h = styles.height,+ markerStyles = state == "off" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]), + fillColor,+ borderColor; + _yuitest_coverline("build/charts-base/charts-base.js", 10470);+markerStyles.y = (ycoords[i] - h/2);+ _yuitest_coverline("build/charts-base/charts-base.js", 10471);+markerStyles.x = marker.get("x");+ _yuitest_coverline("build/charts-base/charts-base.js", 10472);+markerStyles.width = marker.get("width");+ _yuitest_coverline("build/charts-base/charts-base.js", 10473);+markerStyles.id = marker.get("id");+ _yuitest_coverline("build/charts-base/charts-base.js", 10474);+fillColor = markerStyles.fill.color; + _yuitest_coverline("build/charts-base/charts-base.js", 10475);+borderColor = markerStyles.border.color;+ _yuitest_coverline("build/charts-base/charts-base.js", 10476);+if(Y_Lang.isArray(fillColor))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10478);+markerStyles.fill.color = fillColor[i % fillColor.length];+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10482);+markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10484);+if(Y_Lang.isArray(borderColor))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10486);+markerStyles.border.color = borderColor[i % borderColor.length];+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10490);+markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10492);+marker.set(markerStyles);+ }+ },+ + /**+ * @protected+ *+ * Returns default values for the `styles` attribute.+ * + * @method _getPlotDefaults+ * @return Object+ */+ _getPlotDefaults: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getPlotDefaults", 10504);+_yuitest_coverline("build/charts-base/charts-base.js", 10506);+var defs = {+ fill:{+ type: "solid",+ alpha: 1,+ colors:null,+ alphas: null,+ ratios: null+ },+ border:{+ weight: 0,+ alpha: 1+ },+ width: 24,+ height: 24,+ shape: "rect",++ padding:{+ top: 0,+ left: 0,+ right: 0,+ bottom: 0+ }+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 10529);+defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");+ _yuitest_coverline("build/charts-base/charts-base.js", 10530);+defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");+ _yuitest_coverline("build/charts-base/charts-base.js", 10531);+return defs;+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedBar+ */+ type: {+ value: "stackedBar"+ },++ /**+ * Direction of the series+ *+ * @attribute direction+ * @type String+ * @default vertical+ */+ direction: {+ value: "vertical"+ },++ /**+ * @private+ *+ * @attribute negativeBaseValues+ * @type Array+ * @default null+ */+ negativeBaseValues: {+ value: null+ },++ /**+ * @private+ *+ * @attribute positiveBaseValues+ * @type Array+ * @default null+ */+ positiveBaseValues: {+ value: null+ }+ + /**+ * Style properties used for drawing markers. This attribute is inherited from `BarSeries`. Below are the default values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>height</dt><dd>indicates the width of the marker. The default value is 24.</dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++/**+ * PieSeries visualizes data as a circular chart divided into wedges which represent data as a + * percentage of a whole.+ *+ * @module charts+ * @submodule charts-base+ * @class PieSeries+ * @constructor+ * @extends MarkerSeries+ */+_yuitest_coverline("build/charts-base/charts-base.js", 10622);+Y.PieSeries = Y.Base.create("pieSeries", Y.MarkerSeries, [], { + /**+ * Image map used for interactivity when rendered with canvas.+ *+ * @property _map+ * @type HTMLElement+ * @private+ */+ _map: null,++ /**+ * Image used for image map when rendered with canvas.+ *+ * @property _image+ * @type HTMLElement+ * @private+ */+ _image: null,++ /**+ * Creates or updates the image map when rendered with canvas.+ *+ * @method _setMap+ * @private+ */+ _setMap: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setMap", 10647);+_yuitest_coverline("build/charts-base/charts-base.js", 10649);+var id = "pieHotSpotMapi_" + Math.round(100000 * Math.random()),+ cb = this.get("graph").get("contentBox"),+ areaNode;+ _yuitest_coverline("build/charts-base/charts-base.js", 10652);+if(this._image)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10654);+cb.removeChild(this._image);+ _yuitest_coverline("build/charts-base/charts-base.js", 10655);+while(this._areaNodes && this._areaNodes.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10657);+areaNode = this._areaNodes.shift();+ _yuitest_coverline("build/charts-base/charts-base.js", 10658);+this._map.removeChild(areaNode);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10660);+cb.removeChild(this._map);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10662);+this._image = DOCUMENT.createElement("img"); + _yuitest_coverline("build/charts-base/charts-base.js", 10663);+this._image.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==";+ _yuitest_coverline("build/charts-base/charts-base.js", 10664);+cb.appendChild(this._image);+ _yuitest_coverline("build/charts-base/charts-base.js", 10665);+this._image.setAttribute("usemap", "#" + id);+ _yuitest_coverline("build/charts-base/charts-base.js", 10666);+this._image.style.zIndex = 3;+ _yuitest_coverline("build/charts-base/charts-base.js", 10667);+this._image.style.opacity = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 10668);+this._image.setAttribute("alt", "imagemap");+ _yuitest_coverline("build/charts-base/charts-base.js", 10669);+this._map = DOCUMENT.createElement("map");+ _yuitest_coverline("build/charts-base/charts-base.js", 10670);+this._map.style.zIndex = 5;+ _yuitest_coverline("build/charts-base/charts-base.js", 10671);+cb.appendChild(this._map);+ _yuitest_coverline("build/charts-base/charts-base.js", 10672);+this._map.setAttribute("name", id);+ _yuitest_coverline("build/charts-base/charts-base.js", 10673);+this._map.setAttribute("id", id);+ _yuitest_coverline("build/charts-base/charts-base.js", 10674);+this._areaNodes = [];+ },++ /**+ * Storage for `categoryDisplayName` attribute.+ *+ * @property _categoryDisplayName+ * @private+ */+ _categoryDisplayName: null,+ + /**+ * Storage for `valueDisplayName` attribute.+ *+ * @property _valueDisplayName+ * @private+ */+ _valueDisplayName: null,++ /**+ * Adds event listeners.+ *+ * @method addListeners+ * @private+ */+ addListeners: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "addListeners", 10699);+_yuitest_coverline("build/charts-base/charts-base.js", 10701);+var categoryAxis = this.get("categoryAxis"),+ valueAxis = this.get("valueAxis");+ _yuitest_coverline("build/charts-base/charts-base.js", 10703);+if(categoryAxis)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10705);+categoryAxis.after("dataReady", Y.bind(this._categoryDataChangeHandler, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 10706);+categoryAxis.after("dataUpdate", Y.bind(this._categoryDataChangeHandler, this));+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10708);+if(valueAxis)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10710);+valueAxis.after("dataReady", Y.bind(this._valueDataChangeHandler, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 10711);+valueAxis.after("dataUpdate", Y.bind(this._valueDataChangeHandler, this));+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10713);+this.after("categoryAxisChange", this.categoryAxisChangeHandler);+ _yuitest_coverline("build/charts-base/charts-base.js", 10714);+this.after("valueAxisChange", this.valueAxisChangeHandler);+ _yuitest_coverline("build/charts-base/charts-base.js", 10715);+this.after("stylesChange", this._updateHandler);+ },+ + /**+ * Draws the series.+ *+ * @method validate+ * @private+ */+ validate: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "validate", 10724);+_yuitest_coverline("build/charts-base/charts-base.js", 10726);+this.draw();+ _yuitest_coverline("build/charts-base/charts-base.js", 10727);+this._renderered = true;+ },++ /**+ * Event handler for the categoryAxisChange event.+ *+ * @method _categoryAxisChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _categoryAxisChangeHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_categoryAxisChangeHandler", 10737);+_yuitest_coverline("build/charts-base/charts-base.js", 10739);+var categoryAxis = this.get("categoryAxis");+ _yuitest_coverline("build/charts-base/charts-base.js", 10740);+categoryAxis.after("dataReady", Y.bind(this._categoryDataChangeHandler, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 10741);+categoryAxis.after("dataUpdate", Y.bind(this._categoryDataChangeHandler, this));+ },+ + /**+ * Event handler for the valueAxisChange event.+ *+ * @method _valueAxisChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _valueAxisChangeHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_valueAxisChangeHandler", 10751);+_yuitest_coverline("build/charts-base/charts-base.js", 10753);+var valueAxis = this.get("valueAxis");+ _yuitest_coverline("build/charts-base/charts-base.js", 10754);+valueAxis.after("dataReady", Y.bind(this._valueDataChangeHandler, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 10755);+valueAxis.after("dataUpdate", Y.bind(this._valueDataChangeHandler, this));+ },+ + /**+ * Constant used to generate unique id.+ *+ * @property GUID+ * @type String+ * @private+ */+ GUID: "pieseries",+ + /**+ * Event handler for categoryDataChange event.+ *+ * @method _categoryDataChangeHandler+ * @param {Object} event Event object.+ * @private + */+ _categoryDataChangeHandler: function(event)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_categoryDataChangeHandler", 10774);+_yuitest_coverline("build/charts-base/charts-base.js", 10776);+if(this._rendered && this.get("categoryKey") && this.get("valueKey"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10778);+this.draw();+ }+ },++ /**+ * Event handler for valueDataChange event.+ *+ * @method _valueDataChangeHandler+ * @param {Object} event Event object.+ * @private + */+ _valueDataChangeHandler: function(event)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_valueDataChangeHandler", 10789);+_yuitest_coverline("build/charts-base/charts-base.js", 10791);+if(this._rendered && this.get("categoryKey") && this.get("valueKey"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10793);+this.draw();+ }+ },+ + /**+ * Draws the series. Overrides the base implementation.+ *+ * @method draw+ * @protected+ */+ draw: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "draw", 10803);+_yuitest_coverline("build/charts-base/charts-base.js", 10805);+var graph = this.get("graph"),+ w = graph.get("width"),+ h = graph.get("height");+ _yuitest_coverline("build/charts-base/charts-base.js", 10808);+if(isFinite(w) && isFinite(h) && w > 0 && h > 0)+ { + _yuitest_coverline("build/charts-base/charts-base.js", 10810);+this._rendered = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 10811);+if(this._drawing)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10813);+this._callLater = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 10814);+return;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10816);+this._drawing = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 10817);+this._callLater = false;+ _yuitest_coverline("build/charts-base/charts-base.js", 10818);+this.drawSeries();+ _yuitest_coverline("build/charts-base/charts-base.js", 10819);+this._drawing = false;+ _yuitest_coverline("build/charts-base/charts-base.js", 10820);+if(this._callLater)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10822);+this.draw();+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10826);+this.fire("drawingComplete");+ }+ }+ },++ /**+ * Draws the markers+ *+ * @method drawPlots+ * @protected+ */+ drawPlots: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "drawPlots", 10837);+_yuitest_coverline("build/charts-base/charts-base.js", 10839);+var values = this.get("valueAxis").getDataByKey(this.get("valueKey")).concat(),+ catValues = this.get("categoryAxis").getDataByKey(this.get("categoryKey")).concat(),+ totalValue = 0,+ itemCount = values.length,+ styles = this.get("styles").marker,+ fillColors = styles.fill.colors,+ fillAlphas = styles.fill.alphas || ["1"],+ borderColors = styles.border.colors,+ borderWeights = [styles.border.weight],+ borderAlphas = [styles.border.alpha],+ tbw = borderWeights.concat(),+ tbc = borderColors.concat(),+ tba = borderAlphas.concat(),+ tfc,+ tfa,+ padding = styles.padding,+ graph = this.get("graph"),+ minDimension = Math.min(graph.get("width"), graph.get("height")),+ w = minDimension - (padding.left + padding.right),+ h = minDimension - (padding.top + padding.bottom),+ startAngle = -90,+ halfWidth = w / 2,+ halfHeight = h / 2,+ radius = Math.min(halfWidth, halfHeight),+ i = 0,+ value,+ angle = 0,+ lc,+ la,+ lw,+ wedgeStyle,+ marker,+ graphOrder = this.get("graphOrder"),+ isCanvas = Y.Graphic.NAME == "canvasGraphic";+ _yuitest_coverline("build/charts-base/charts-base.js", 10873);+for(; i < itemCount; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10875);+value = parseFloat(values[i]);+ + _yuitest_coverline("build/charts-base/charts-base.js", 10877);+values.push(value);+ _yuitest_coverline("build/charts-base/charts-base.js", 10878);+if(!isNaN(value))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10880);+totalValue += value;+ }+ }+ + _yuitest_coverline("build/charts-base/charts-base.js", 10884);+tfc = fillColors ? fillColors.concat() : null;+ _yuitest_coverline("build/charts-base/charts-base.js", 10885);+tfa = fillAlphas ? fillAlphas.concat() : null;+ _yuitest_coverline("build/charts-base/charts-base.js", 10886);+this._createMarkerCache();+ _yuitest_coverline("build/charts-base/charts-base.js", 10887);+if(isCanvas)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10889);+this._setMap();+ _yuitest_coverline("build/charts-base/charts-base.js", 10890);+this._image.width = w;+ _yuitest_coverline("build/charts-base/charts-base.js", 10891);+this._image.height = h;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10893);+for(i = 0; i < itemCount; i++)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10895);+value = values[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 10896);+if(totalValue === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10898);+angle = 360 / values.length;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10902);+angle = 360 * (value / totalValue);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10904);+if(tfc && tfc.length < 1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10906);+tfc = fillColors.concat();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10908);+if(tfa && tfa.length < 1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10910);+tfa = fillAlphas.concat();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10912);+if(tbw && tbw.length < 1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10914);+tbw = borderWeights.concat();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10916);+if(tbw && tbc.length < 1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10918);+tbc = borderColors.concat();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10920);+if(tba && tba.length < 1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10922);+tba = borderAlphas.concat();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10924);+lw = tbw ? tbw.shift() : null;+ _yuitest_coverline("build/charts-base/charts-base.js", 10925);+lc = tbc ? tbc.shift() : null;+ _yuitest_coverline("build/charts-base/charts-base.js", 10926);+la = tba ? tba.shift() : null;+ _yuitest_coverline("build/charts-base/charts-base.js", 10927);+startAngle += angle;+ _yuitest_coverline("build/charts-base/charts-base.js", 10928);+wedgeStyle = {+ border: {+ color:lc,+ weight:lw,+ alpha:la+ },+ fill: {+ color:tfc ? tfc.shift() : this._getDefaultColor(i, "slice"),+ alpha:tfa ? tfa.shift() : null+ },+ type: "pieslice",+ arc: angle,+ radius: radius,+ startAngle: startAngle,+ cx: halfWidth,+ cy: halfHeight,+ width: w,+ height: h+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 10947);+marker = this.getMarker(wedgeStyle, graphOrder, i);+ _yuitest_coverline("build/charts-base/charts-base.js", 10948);+if(isCanvas)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10950);+this._addHotspot(wedgeStyle, graphOrder, i);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 10953);+this._clearMarkerCache();+ },++ /**+ * Adds an interactive map when rendering in canvas.+ *+ * @method _addHotspot+ * @param {Object} cfg Object containing data used to draw the hotspot+ * @param {Number} seriesIndex Index of series in the `seriesCollection`.+ * @param {Number} index Index of the marker using the hotspot.+ * @private+ */+ _addHotspot: function(cfg, seriesIndex, index)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_addHotspot", 10965);+_yuitest_coverline("build/charts-base/charts-base.js", 10967);+var areaNode = DOCUMENT.createElement("area"),+ i = 1,+ x = cfg.cx,+ y = cfg.cy, + arc = cfg.arc,+ startAngle = cfg.startAngle - arc, + endAngle = cfg.startAngle,+ radius = cfg.radius, + ax = x + Math.cos(startAngle / 180 * Math.PI) * radius,+ ay = y + Math.sin(startAngle / 180 * Math.PI) * radius,+ bx = x + Math.cos(endAngle / 180 * Math.PI) * radius,+ by = y + Math.sin(endAngle / 180 * Math.PI) * radius,+ numPoints = Math.floor(arc/10) - 1,+ divAngle = (arc/(Math.floor(arc/10)) / 180) * Math.PI,+ angleCoord = Math.atan((ay - y)/(ax - x)),+ pts = x + ", " + y + ", " + ax + ", " + ay,+ cosAng,+ sinAng,+ multDivAng;+ _yuitest_coverline("build/charts-base/charts-base.js", 10986);+for(i = 1; i <= numPoints; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10988);+multDivAng = divAngle * i;+ _yuitest_coverline("build/charts-base/charts-base.js", 10989);+cosAng = Math.cos(angleCoord + multDivAng);+ _yuitest_coverline("build/charts-base/charts-base.js", 10990);+sinAng = Math.sin(angleCoord + multDivAng);+ _yuitest_coverline("build/charts-base/charts-base.js", 10991);+if(startAngle <= 90)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10993);+pts += ", " + (x + (radius * Math.cos(angleCoord + (divAngle * i))));+ _yuitest_coverline("build/charts-base/charts-base.js", 10994);+pts += ", " + (y + (radius * Math.sin(angleCoord + (divAngle * i))));+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 10998);+pts += ", " + (x - (radius * Math.cos(angleCoord + (divAngle * i))));+ _yuitest_coverline("build/charts-base/charts-base.js", 10999);+pts += ", " + (y - (radius * Math.sin(angleCoord + (divAngle * i))));+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11002);+pts += ", " + bx + ", " + by;+ _yuitest_coverline("build/charts-base/charts-base.js", 11003);+pts += ", " + x + ", " + y;+ _yuitest_coverline("build/charts-base/charts-base.js", 11004);+this._map.appendChild(areaNode);+ _yuitest_coverline("build/charts-base/charts-base.js", 11005);+areaNode.setAttribute("class", SERIES_MARKER);+ _yuitest_coverline("build/charts-base/charts-base.js", 11006);+areaNode.setAttribute("id", "hotSpot_" + seriesIndex + "_" + index);+ _yuitest_coverline("build/charts-base/charts-base.js", 11007);+areaNode.setAttribute("shape", "polygon");+ _yuitest_coverline("build/charts-base/charts-base.js", 11008);+areaNode.setAttribute("coords", pts);+ _yuitest_coverline("build/charts-base/charts-base.js", 11009);+this._areaNodes.push(areaNode);++ },++ /**+ * Resizes and positions markers based on a mouse interaction.+ *+ * @method updateMarkerState+ * @param {String} type state of the marker+ * @param {Number} i index of the marker+ * @protected+ */+ updateMarkerState: function(type, i)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "updateMarkerState", 11021);+_yuitest_coverline("build/charts-base/charts-base.js", 11023);+if(this._markers[i])+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11025);+var state = this._getState(type),+ markerStyles,+ indexStyles,+ marker = this._markers[i],+ styles = this.get("styles").marker; + _yuitest_coverline("build/charts-base/charts-base.js", 11030);+markerStyles = state == "off" || !styles[state] ? styles : styles[state]; + _yuitest_coverline("build/charts-base/charts-base.js", 11031);+indexStyles = this._mergeStyles(markerStyles, {});+ _yuitest_coverline("build/charts-base/charts-base.js", 11032);+indexStyles.fill.color = indexStyles.fill.colors[i % indexStyles.fill.colors.length];+ _yuitest_coverline("build/charts-base/charts-base.js", 11033);+indexStyles.fill.alpha = indexStyles.fill.alphas[i % indexStyles.fill.alphas.length];+ _yuitest_coverline("build/charts-base/charts-base.js", 11034);+marker.set(indexStyles);+ }+ },+ + /**+ * Creates a shape to be used as a marker.+ *+ * @method _createMarker+ * @param {Object} styles Hash of style properties.+ * @param {Number} order Order of the series.+ * @param {Number} index Index within the series associated with the marker.+ * @return Shape+ * @private+ */+ _createMarker: function(styles, order, index)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_createMarker", 11048);+_yuitest_coverline("build/charts-base/charts-base.js", 11050);+var graphic = this.get("graphic"),+ marker,+ cfg = Y.clone(styles);+ _yuitest_coverline("build/charts-base/charts-base.js", 11053);+graphic.set("autoDraw", false);+ _yuitest_coverline("build/charts-base/charts-base.js", 11054);+marker = graphic.addShape(cfg); + _yuitest_coverline("build/charts-base/charts-base.js", 11055);+marker.addClass(SERIES_MARKER);+ _yuitest_coverline("build/charts-base/charts-base.js", 11056);+return marker;+ },+ + /**+ * Creates a cache of markers for reuse.+ *+ * @method _createMarkerCache+ * @private+ */+ _clearMarkerCache: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_clearMarkerCache", 11065);+_yuitest_coverline("build/charts-base/charts-base.js", 11067);+var len = this._markerCache.length,+ i = 0,+ marker;+ _yuitest_coverline("build/charts-base/charts-base.js", 11070);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11072);+marker = this._markerCache[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 11073);+if(marker)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11075);+marker.destroy();+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11078);+this._markerCache = [];+ },++ /**+ * Gets the default style values for the markers.+ *+ * @method _getPlotDefaults+ * @return Object+ * @private+ */+ _getPlotDefaults: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getPlotDefaults", 11088);+_yuitest_coverline("build/charts-base/charts-base.js", 11090);+var defs = {+ padding:{+ top: 0,+ left: 0,+ right: 0,+ bottom: 0+ },+ fill:{+ alphas:["1"]+ },+ border: {+ weight: 0,+ alpha: 1+ }+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 11105);+defs.fill.colors = this._defaultSliceColors;+ _yuitest_coverline("build/charts-base/charts-base.js", 11106);+defs.border.colors = this._defaultBorderColors;+ _yuitest_coverline("build/charts-base/charts-base.js", 11107);+return defs;+ },++ /**+ * Collection of default colors used for lines in a series when not specified by user.+ *+ * @property _defaultLineColors+ * @type Array+ * @protected+ */+ _defaultLineColors:["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"],++ /**+ * Collection of default colors used for marker fills in a series when not specified by user.+ *+ * @property _defaultFillColors+ * @type Array+ * @protected+ */+ _defaultFillColors:["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"],+ + /**+ * Collection of default colors used for marker borders in a series when not specified by user.+ *+ * @property _defaultBorderColors+ * @type Array+ * @protected+ */+ _defaultBorderColors:["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"],+ + /**+ * Collection of default colors used for area fills, histogram fills and pie fills in a series when not specified by user.+ *+ * @property _defaultSliceColors+ * @type Array+ * @protected+ */+ _defaultSliceColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],++ /**+ * Colors used if style colors are not specified+ *+ * @method _getDefaultColor+ * @param {Number} index Index indicating the series order.+ * @param {String} type Indicates which type of object needs the color.+ * @return String+ * @protected+ */+ _getDefaultColor: function(index, type)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultColor", 11155);+_yuitest_coverline("build/charts-base/charts-base.js", 11157);+var colors = {+ line: this._defaultLineColors,+ fill: this._defaultFillColors,+ border: this._defaultBorderColors,+ slice: this._defaultSliceColors+ },+ col = colors[type],+ l = col.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 11165);+index = index || 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 11166);+if(index >= l)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11168);+index = index % l;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11170);+type = type || "fill";+ _yuitest_coverline("build/charts-base/charts-base.js", 11171);+return colors[type][index];+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default pie+ */+ type: { + value: "pie"+ },+ + /**+ * Order of this instance of this `type`.+ *+ * @attribute order+ * @type Number+ */+ order: {},++ /**+ * Reference to the `Graph` in which the series is drawn into.+ *+ * @attribute graph+ * @type Graph+ */+ graph: {},+ + /**+ * Reference to the `Axis` instance used for assigning + * category values to the graph.+ *+ * @attribute categoryAxis+ * @type Axis+ */+ categoryAxis: {+ value: null,++ validator: function(value)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "validator", 11212);+_yuitest_coverline("build/charts-base/charts-base.js", 11214);+return value !== this.get("categoryAxis");+ }+ },+ + /**+ * Reference to the `Axis` instance used for assigning + * series values to the graph.+ *+ * @attribute categoryAxis+ * @type Axis+ */+ valueAxis: {+ value: null,++ validator: function(value)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "validator", 11228);+_yuitest_coverline("build/charts-base/charts-base.js", 11230);+return value !== this.get("valueAxis");+ }+ },++ /**+ * Indicates which array to from the hash of value arrays in + * the category `Axis` instance.+ *+ * @attribute categoryKey+ * @type String+ */+ categoryKey: {+ value: null,++ validator: function(value)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "validator", 11244);+_yuitest_coverline("build/charts-base/charts-base.js", 11246);+return value !== this.get("categoryKey");+ }+ },+ /**+ * Indicates which array to from the hash of value arrays in + * the value `Axis` instance.+ *+ * @attribute valueKey+ * @type String+ */+ valueKey: {+ value: null,++ validator: function(value)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "validator", 11259);+_yuitest_coverline("build/charts-base/charts-base.js", 11261);+return value !== this.get("valueKey");+ }+ },++ /**+ * Name used for for displaying category data+ *+ * @attribute categoryDisplayName+ * @type String+ */+ categoryDisplayName: {+ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 11272);+_yuitest_coverline("build/charts-base/charts-base.js", 11274);+this._categoryDisplayName = val;+ _yuitest_coverline("build/charts-base/charts-base.js", 11275);+return val;+ },++ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 11278);+_yuitest_coverline("build/charts-base/charts-base.js", 11280);+return this._categoryDisplayName || this.get("categoryKey");+ }+ },++ /**+ * Name used for for displaying value data+ *+ * @attribute valueDisplayName+ * @type String+ */+ valueDisplayName: {+ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 11291);+_yuitest_coverline("build/charts-base/charts-base.js", 11293);+this._valueDisplayName = val;+ _yuitest_coverline("build/charts-base/charts-base.js", 11294);+return val;+ },++ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 11297);+_yuitest_coverline("build/charts-base/charts-base.js", 11299);+return this._valueDisplayName || this.get("valueKey");+ }+ },+ + /**+ * @attribute slices+ * @type Array+ * @private+ */+ slices: null+ + /**+ * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>colors</dt><dd>An array of colors to be used for the marker fills. The color for each marker is retrieved from the + * array below:<br/>+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alphas</dt><dd>An array of alpha references (Number from 0 to 1) indicating the opacity of each marker fill. The default value is [1].</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>An array of colors to be used for the marker borders. The color for each marker is retrieved from the+ * array below:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});+/**+ * Gridlines draws gridlines on a Graph.+ *+ * @module charts+ * @submodule charts-base+ * @class Gridlines+ * @constructor+ * @extends Base+ * @uses Renderer+ */+_yuitest_coverline("build/charts-base/charts-base.js", 11351);+Y.Gridlines = Y.Base.create("gridlines", Y.Base, [Y.Renderer], {+ /**+ * Reference to the `Path` element used for drawing Gridlines.+ *+ * @property _path+ * @type Path+ * @private+ */+ _path: null,++ /**+ * Removes the Gridlines.+ *+ * @method remove+ * @private+ */+ remove: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "remove", 11367);+_yuitest_coverline("build/charts-base/charts-base.js", 11369);+var path = this._path;+ _yuitest_coverline("build/charts-base/charts-base.js", 11370);+if(path)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11372);+path.destroy();+ }+ },++ /**+ * Draws the gridlines+ *+ * @method draw+ * @protected+ */+ draw: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "draw", 11382);+_yuitest_coverline("build/charts-base/charts-base.js", 11384);+if(this.get("axis") && this.get("graph"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11386);+this._drawGridlines();+ }+ },++ /**+ * Algorithm for drawing gridlines+ *+ * @method _drawGridlines+ * @private+ */+ _drawGridlines: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_drawGridlines", 11396);+_yuitest_coverline("build/charts-base/charts-base.js", 11398);+var path,+ axis = this.get("axis"),+ axisPosition = axis.get("position"),+ points,+ i = 0,+ l,+ direction = this.get("direction"),+ graph = this.get("graph"),+ w = graph.get("width"),+ h = graph.get("height"),+ line = this.get("styles").line,+ color = line.color,+ weight = line.weight,+ alpha = line.alpha,+ lineFunction = direction == "vertical" ? this._verticalLine : this._horizontalLine;+ _yuitest_coverline("build/charts-base/charts-base.js", 11413);+if(isFinite(w) && isFinite(h) && w > 0 && h > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11415);+if(axisPosition != "none" && axis && axis.get("tickPoints"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11417);+points = axis.get("tickPoints");+ _yuitest_coverline("build/charts-base/charts-base.js", 11418);+l = points.length;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11422);+points = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 11423);+l = axis.get("styles").majorUnit.count;+ _yuitest_coverline("build/charts-base/charts-base.js", 11424);+for(; i < l; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11426);+points[i] = {+ x: w * (i/(l-1)),+ y: h * (i/(l-1))+ };+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11431);+i = 0;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11433);+path = graph.get("gridlines");+ _yuitest_coverline("build/charts-base/charts-base.js", 11434);+path.set("width", w);+ _yuitest_coverline("build/charts-base/charts-base.js", 11435);+path.set("height", h);+ _yuitest_coverline("build/charts-base/charts-base.js", 11436);+path.set("stroke", {+ weight: weight,+ color: color,+ opacity: alpha+ });+ _yuitest_coverline("build/charts-base/charts-base.js", 11441);+for(; i < l; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11443);+lineFunction(path, points[i], w, h);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11445);+path.end();+ }+ },++ /**+ * Algorithm for horizontal lines.+ *+ * @method _horizontalLine+ * @param {Path} path Reference to path element+ * @param {Object} pt Coordinates corresponding to a major unit of an axis.+ * @param {Number} w Width of the Graph+ * @param {Number} h Height of the Graph+ * @private+ */+ _horizontalLine: function(path, pt, w, h)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_horizontalLine", 11459);+_yuitest_coverline("build/charts-base/charts-base.js", 11461);+path.moveTo(0, pt.y);+ _yuitest_coverline("build/charts-base/charts-base.js", 11462);+path.lineTo(w, pt.y);+ },++ /**+ * Algorithm for vertical lines.+ *+ * @method _verticalLine+ * @param {Path} path Reference to path element+ * @param {Object} pt Coordinates corresponding to a major unit of an axis.+ * @param {Number} w Width of the Graph+ * @param {Number} h Height of the Graph+ * @private+ */+ _verticalLine: function(path, pt, w, h)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_verticalLine", 11475);+_yuitest_coverline("build/charts-base/charts-base.js", 11477);+path.moveTo(pt.x, 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 11478);+path.lineTo(pt.x, h);+ },+ + /**+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ * @protected+ */+ _getDefaultStyles: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultStyles", 11489);+_yuitest_coverline("build/charts-base/charts-base.js", 11491);+var defs = {+ line: {+ color:"#f0efe9",+ weight: 1,+ alpha: 1+ }+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 11498);+return defs;+ }++},+{+ ATTRS: {+ /**+ * Indicates the direction of the gridline.+ *+ * @attribute direction+ * @type String+ */+ direction: {},+ + /**+ * Indicate the `Axis` in which to bind+ * the gridlines.+ *+ * @attribute axis+ * @type Axis+ */+ axis: {},+ + /**+ * Indicates the `Graph` in which the gridlines + * are drawn.+ *+ * @attribute graph+ * @type Graph+ */+ graph: {}+ }+});+/**+ * Graph manages and contains series instances for a `CartesianChart`+ * instance.+ *+ * @module charts+ * @submodule charts-base+ * @class Graph+ * @constructor+ * @extends Widget+ * @uses Renderer+ */+_yuitest_coverline("build/charts-base/charts-base.js", 11542);+Y.Graph = Y.Base.create("graph", Y.Widget, [Y.Renderer], {+ /**+ * @method bindUI+ * @private+ */+ bindUI: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "bindUI", 11547);+_yuitest_coverline("build/charts-base/charts-base.js", 11549);+var bb = this.get("boundingBox");+ _yuitest_coverline("build/charts-base/charts-base.js", 11550);+bb.setStyle("position", "absolute");+ _yuitest_coverline("build/charts-base/charts-base.js", 11551);+this.after("widthChange", this._sizeChangeHandler);+ _yuitest_coverline("build/charts-base/charts-base.js", 11552);+this.after("heightChange", this._sizeChangeHandler);+ _yuitest_coverline("build/charts-base/charts-base.js", 11553);+this.after("stylesChange", this._updateStyles);+ _yuitest_coverline("build/charts-base/charts-base.js", 11554);+this.after("groupMarkersChange", this._drawSeries);+ },++ /**+ * @method syncUI+ * @private+ */+ syncUI: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "syncUI", 11561);+_yuitest_coverline("build/charts-base/charts-base.js", 11563);+var background,+ cb,+ bg,+ sc = this.get("seriesCollection"),+ series,+ i = 0,+ len = sc ? sc.length : 0,+ hgl = this.get("horizontalGridlines"),+ vgl = this.get("verticalGridlines");+ _yuitest_coverline("build/charts-base/charts-base.js", 11572);+if(this.get("showBackground"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11574);+background = this.get("background");+ _yuitest_coverline("build/charts-base/charts-base.js", 11575);+cb = this.get("contentBox");+ _yuitest_coverline("build/charts-base/charts-base.js", 11576);+bg = this.get("styles").background;+ _yuitest_coverline("build/charts-base/charts-base.js", 11577);+bg.stroke = bg.border;+ _yuitest_coverline("build/charts-base/charts-base.js", 11578);+bg.stroke.opacity = bg.stroke.alpha;+ _yuitest_coverline("build/charts-base/charts-base.js", 11579);+bg.fill.opacity = bg.fill.alpha;+ _yuitest_coverline("build/charts-base/charts-base.js", 11580);+bg.width = this.get("width");+ _yuitest_coverline("build/charts-base/charts-base.js", 11581);+bg.height = this.get("height");+ _yuitest_coverline("build/charts-base/charts-base.js", 11582);+bg.type = bg.shape;+ _yuitest_coverline("build/charts-base/charts-base.js", 11583);+background.set(bg);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11585);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11587);+series = sc[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 11588);+if(series instanceof Y.CartesianSeries)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11590);+series.render();+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11593);+if(hgl && hgl instanceof Y.Gridlines)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11595);+hgl.draw();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11597);+if(vgl && vgl instanceof Y.Gridlines)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11599);+vgl.draw();+ }+ },+ + /**+ * Object of arrays containing series mapped to a series type.+ *+ * @property seriesTypes+ * @type Object+ * @private+ */+ seriesTypes: null,++ /**+ * Returns a series instance based on an index.+ * + * @method getSeriesByIndex+ * @param {Number} val index of the series+ * @return CartesianSeries+ */+ getSeriesByIndex: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getSeriesByIndex", 11619);+_yuitest_coverline("build/charts-base/charts-base.js", 11621);+var col = this.get("seriesCollection"),+ series;+ _yuitest_coverline("build/charts-base/charts-base.js", 11623);+if(col && col.length > val)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11625);+series = col[val];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11627);+return series;+ },++ /**+ * Returns a series instance based on a key value.+ * + * @method getSeriesByKey+ * @param {String} val key value of the series+ * @return CartesianSeries+ */+ getSeriesByKey: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getSeriesByKey", 11637);+_yuitest_coverline("build/charts-base/charts-base.js", 11639);+var obj = this._seriesDictionary,+ series;+ _yuitest_coverline("build/charts-base/charts-base.js", 11641);+if(obj && obj.hasOwnProperty(val))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11643);+series = obj[val];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11645);+return series;+ },++ /**+ * Adds dispatcher to a `_dispatcher` used to+ * to ensure all series have redrawn before for firing event.+ *+ * @method addDispatcher+ * @param {CartesianSeries} val series instance to add+ * @protected+ */+ addDispatcher: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "addDispatcher", 11656);+_yuitest_coverline("build/charts-base/charts-base.js", 11658);+if(!this._dispatchers)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11660);+this._dispatchers = [];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11662);+this._dispatchers.push(val);+ },++ /**+ * Collection of series to be displayed in the graph.+ *+ * @property _seriesCollection+ * @type Array+ * @private + */+ _seriesCollection: null,+ + /**+ * Object containing key value pairs of `CartesianSeries` instances.+ *+ * @property _seriesDictionary+ * @type Object+ * @private+ */+ _seriesDictionary: null,++ /**+ * Parses series instances to be displayed in the graph.+ *+ * @method _parseSeriesCollection+ * @param {Array} Collection of `CartesianSeries` instances or objects container `CartesianSeries` attributes values.+ * @private+ */+ _parseSeriesCollection: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_parseSeriesCollection", 11690);+_yuitest_coverline("build/charts-base/charts-base.js", 11692);+if(!val)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11694);+return;+ } + _yuitest_coverline("build/charts-base/charts-base.js", 11696);+var len = val.length,+ i = 0,+ series,+ seriesKey;+ _yuitest_coverline("build/charts-base/charts-base.js", 11700);+this._seriesCollection = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 11701);+this._seriesDictionary = {};+ _yuitest_coverline("build/charts-base/charts-base.js", 11702);+this.seriesTypes = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 11703);+for(; i < len; ++i)+ { + _yuitest_coverline("build/charts-base/charts-base.js", 11705);+series = val[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 11706);+if(!(series instanceof Y.CartesianSeries) && !(series instanceof Y.PieSeries))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11708);+this._createSeries(series);+ _yuitest_coverline("build/charts-base/charts-base.js", 11709);+continue;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11711);+this._addSeries(series);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11713);+len = this._seriesCollection.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 11714);+for(i = 0; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11716);+series = this.get("seriesCollection")[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 11717);+seriesKey = series.get("direction") == "horizontal" ? "yKey" : "xKey";+ _yuitest_coverline("build/charts-base/charts-base.js", 11718);+this._seriesDictionary[series.get(seriesKey)] = series;+ }+ },++ /**+ * Adds a series to the graph.+ *+ * @method _addSeries+ * @param {CartesianSeries} series Series to add to the graph.+ * @private+ */+ _addSeries: function(series)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_addSeries", 11729);+_yuitest_coverline("build/charts-base/charts-base.js", 11731);+var type = series.get("type"),+ seriesCollection = this.get("seriesCollection"),+ graphSeriesLength = seriesCollection.length,+ seriesTypes = this.seriesTypes,+ typeSeriesCollection; + _yuitest_coverline("build/charts-base/charts-base.js", 11736);+if(!series.get("graph")) + {+ _yuitest_coverline("build/charts-base/charts-base.js", 11738);+series.set("graph", this);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11740);+seriesCollection.push(series);+ _yuitest_coverline("build/charts-base/charts-base.js", 11741);+if(!seriesTypes.hasOwnProperty(type))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11743);+this.seriesTypes[type] = [];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11745);+typeSeriesCollection = this.seriesTypes[type];+ _yuitest_coverline("build/charts-base/charts-base.js", 11746);+series.set("graphOrder", graphSeriesLength);+ _yuitest_coverline("build/charts-base/charts-base.js", 11747);+series.set("order", typeSeriesCollection.length);+ _yuitest_coverline("build/charts-base/charts-base.js", 11748);+typeSeriesCollection.push(series);+ _yuitest_coverline("build/charts-base/charts-base.js", 11749);+this.addDispatcher(series);+ _yuitest_coverline("build/charts-base/charts-base.js", 11750);+series.after("drawingComplete", Y.bind(this._drawingCompleteHandler, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 11751);+this.fire("seriesAdded", series);+ },++ /**+ * Creates a `CartesianSeries` instance from an object containing attribute key value pairs. The key value pairs include attributes for the specific series and a type value which defines the type of+ * series to be used. + *+ * @method createSeries+ * @param {Object} seriesData Series attribute key value pairs.+ * @private+ */+ _createSeries: function(seriesData)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_createSeries", 11762);+_yuitest_coverline("build/charts-base/charts-base.js", 11764);+var type = seriesData.type,+ seriesCollection = this.get("seriesCollection"),+ seriesTypes = this.seriesTypes,+ typeSeriesCollection,+ seriesType,+ series;+ _yuitest_coverline("build/charts-base/charts-base.js", 11770);+seriesData.graph = this;+ _yuitest_coverline("build/charts-base/charts-base.js", 11771);+if(!seriesTypes.hasOwnProperty(type))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11773);+seriesTypes[type] = [];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11775);+typeSeriesCollection = seriesTypes[type];+ _yuitest_coverline("build/charts-base/charts-base.js", 11776);+seriesData.graph = this;+ _yuitest_coverline("build/charts-base/charts-base.js", 11777);+seriesData.order = typeSeriesCollection.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 11778);+seriesData.graphOrder = seriesCollection.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 11779);+seriesType = this._getSeries(seriesData.type);+ _yuitest_coverline("build/charts-base/charts-base.js", 11780);+series = new seriesType(seriesData);+ _yuitest_coverline("build/charts-base/charts-base.js", 11781);+this.addDispatcher(series);+ _yuitest_coverline("build/charts-base/charts-base.js", 11782);+series.after("drawingComplete", Y.bind(this._drawingCompleteHandler, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 11783);+typeSeriesCollection.push(series);+ _yuitest_coverline("build/charts-base/charts-base.js", 11784);+seriesCollection.push(series);+ _yuitest_coverline("build/charts-base/charts-base.js", 11785);+if(this.get("rendered"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11787);+series.render();+ }+ },+ + /**+ * String reference for pre-defined `Series` classes.+ *+ * @property _seriesMap+ * @type Object+ * @private+ */+ _seriesMap: {+ line : Y.LineSeries,+ column : Y.ColumnSeries,+ bar : Y.BarSeries,+ area : Y.AreaSeries,+ candlestick : Y.CandlestickSeries,+ ohlc : Y.OHLCSeries,+ stackedarea : Y.StackedAreaSeries,+ stackedline : Y.StackedLineSeries,+ stackedcolumn : Y.StackedColumnSeries,+ stackedbar : Y.StackedBarSeries,+ markerseries : Y.MarkerSeries,+ spline : Y.SplineSeries,+ areaspline : Y.AreaSplineSeries,+ stackedspline : Y.StackedSplineSeries,+ stackedareaspline : Y.StackedAreaSplineSeries,+ stackedmarkerseries : Y.StackedMarkerSeries,+ pie : Y.PieSeries,+ combo : Y.ComboSeries,+ stackedcombo : Y.StackedComboSeries,+ combospline : Y.ComboSplineSeries,+ stackedcombospline : Y.StackedComboSplineSeries+ },++ /**+ * Returns a specific `CartesianSeries` class based on key value from a look up table of a direct reference to a class. When specifying a key value, the following options+ * are available:+ *+ * <table>+ * <tr><th>Key Value</th><th>Class</th></tr>+ * <tr><td>line</td><td>Y.LineSeries</td></tr> + * <tr><td>column</td><td>Y.ColumnSeries</td></tr> + * <tr><td>bar</td><td>Y.BarSeries</td></tr> + * <tr><td>area</td><td>Y.AreaSeries</td></tr> + * <tr><td>stackedarea</td><td>Y.StackedAreaSeries</td></tr> + * <tr><td>stackedline</td><td>Y.StackedLineSeries</td></tr> + * <tr><td>stackedcolumn</td><td>Y.StackedColumnSeries</td></tr> + * <tr><td>stackedbar</td><td>Y.StackedBarSeries</td></tr> + * <tr><td>markerseries</td><td>Y.MarkerSeries</td></tr> + * <tr><td>spline</td><td>Y.SplineSeries</td></tr> + * <tr><td>areaspline</td><td>Y.AreaSplineSeries</td></tr> + * <tr><td>stackedspline</td><td>Y.StackedSplineSeries</td></tr>+ * <tr><td>stackedareaspline</td><td>Y.StackedAreaSplineSeries</td></tr>+ * <tr><td>stackedmarkerseries</td><td>Y.StackedMarkerSeries</td></tr>+ * <tr><td>pie</td><td>Y.PieSeries</td></tr>+ * <tr><td>combo</td><td>Y.ComboSeries</td></tr>+ * <tr><td>stackedcombo</td><td>Y.StackedComboSeries</td></tr>+ * <tr><td>combospline</td><td>Y.ComboSplineSeries</td></tr>+ * <tr><td>stackedcombospline</td><td>Y.StackedComboSplineSeries</td></tr>+ * </table>+ * + * When referencing a class directly, you can specify any of the above classes or any custom class that extends `CartesianSeries` or `PieSeries`.+ *+ * @method _getSeries+ * @param {String | Object} type Series type.+ * @return CartesianSeries+ * @private+ */+ _getSeries: function(type)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getSeries", 11856);+_yuitest_coverline("build/charts-base/charts-base.js", 11858);+var seriesClass;+ _yuitest_coverline("build/charts-base/charts-base.js", 11859);+if(Y_Lang.isString(type))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11861);+seriesClass = this._seriesMap[type];+ }+ else + {+ _yuitest_coverline("build/charts-base/charts-base.js", 11865);+seriesClass = type;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11867);+return seriesClass;+ },++ /**+ * Event handler for marker events.+ *+ * @method _markerEventHandler+ * @param {Object} e Event object.+ * @private+ */+ _markerEventHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_markerEventHandler", 11877);+_yuitest_coverline("build/charts-base/charts-base.js", 11879);+var type = e.type,+ markerNode = e.currentTarget,+ strArr = markerNode.getAttribute("id").split("_"),+ series = this.getSeriesByIndex(strArr[1]),+ index = strArr[2];+ _yuitest_coverline("build/charts-base/charts-base.js", 11884);+series.updateMarkerState(type, index);+ },++ /**+ * Collection of `CartesianSeries` instances to be redrawn.+ *+ * @property _dispatchers+ * @type Array+ * @private+ */+ _dispatchers: null,++ /**+ * Updates the `Graph` styles.+ *+ * @method _updateStyles+ * @private+ */+ _updateStyles: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_updateStyles", 11902);+_yuitest_coverline("build/charts-base/charts-base.js", 11904);+var styles = this.get("styles").background,+ border = styles.border;+ _yuitest_coverline("build/charts-base/charts-base.js", 11906);+border.opacity = border.alpha;+ _yuitest_coverline("build/charts-base/charts-base.js", 11907);+styles.stroke = border;+ _yuitest_coverline("build/charts-base/charts-base.js", 11908);+styles.fill.opacity = styles.fill.alpha;+ _yuitest_coverline("build/charts-base/charts-base.js", 11909);+this.get("background").set(styles);+ _yuitest_coverline("build/charts-base/charts-base.js", 11910);+this._sizeChangeHandler();+ },++ /**+ * Event handler for size changes.+ *+ * @method _sizeChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _sizeChangeHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_sizeChangeHandler", 11920);+_yuitest_coverline("build/charts-base/charts-base.js", 11922);+var hgl = this.get("horizontalGridlines"),+ vgl = this.get("verticalGridlines"),+ w = this.get("width"),+ h = this.get("height"),+ bg = this.get("styles").background,+ weight,+ background;+ _yuitest_coverline("build/charts-base/charts-base.js", 11929);+if(bg && bg.border)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11931);+weight = bg.border.weight || 0;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11933);+if(this.get("showBackground"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11935);+background = this.get("background");+ _yuitest_coverline("build/charts-base/charts-base.js", 11936);+if(w && h)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11938);+background.set("width", w);+ _yuitest_coverline("build/charts-base/charts-base.js", 11939);+background.set("height", h);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11942);+if(this._gridlines)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11944);+this._gridlines.clear();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11946);+if(hgl && hgl instanceof Y.Gridlines)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11948);+hgl.draw();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11950);+if(vgl && vgl instanceof Y.Gridlines)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11952);+vgl.draw();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11954);+this._drawSeries();+ },++ /**+ * Draws each series.+ *+ * @method _drawSeries+ * @private+ */+ _drawSeries: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_drawSeries", 11963);+_yuitest_coverline("build/charts-base/charts-base.js", 11965);+if(this._drawing)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11967);+this._callLater = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 11968);+return;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11970);+var sc,+ i,+ len,+ graphic = this.get("graphic");+ _yuitest_coverline("build/charts-base/charts-base.js", 11974);+graphic.set("autoDraw", false);+ _yuitest_coverline("build/charts-base/charts-base.js", 11975);+this._callLater = false;+ _yuitest_coverline("build/charts-base/charts-base.js", 11976);+this._drawing = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 11977);+sc = this.get("seriesCollection");+ _yuitest_coverline("build/charts-base/charts-base.js", 11978);+i = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 11979);+len = sc ? sc.length : 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 11980);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11982);+sc[i].draw();+ _yuitest_coverline("build/charts-base/charts-base.js", 11983);+if((!sc[i].get("xcoords") || !sc[i].get("ycoords")) && !sc[i] instanceof Y.PieSeries)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11985);+this._callLater = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 11986);+break;+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 11989);+this._drawing = false;+ _yuitest_coverline("build/charts-base/charts-base.js", 11990);+if(this._callLater)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 11992);+this._drawSeries();+ }+ }, ++ /**+ * Event handler for series drawingComplete event.+ *+ * @method _drawingCompleteHandler+ * @param {Object} e Event object.+ * @private+ */+ _drawingCompleteHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_drawingCompleteHandler", 12003);+_yuitest_coverline("build/charts-base/charts-base.js", 12005);+var series = e.currentTarget,+ graphic,+ index = Y.Array.indexOf(this._dispatchers, series);+ _yuitest_coverline("build/charts-base/charts-base.js", 12008);+if(index > -1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12010);+this._dispatchers.splice(index, 1);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12012);+if(this._dispatchers.length < 1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12014);+graphic = this.get("graphic");+ _yuitest_coverline("build/charts-base/charts-base.js", 12015);+if(!graphic.get("autoDraw"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12017);+graphic._redraw();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12019);+this.fire("chartRendered");+ }+ },++ /**+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ * @protected+ */+ _getDefaultStyles: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultStyles", 12031);+_yuitest_coverline("build/charts-base/charts-base.js", 12033);+var defs = {+ background: {+ shape: "rect",+ fill:{+ color:"#faf9f2"+ },+ border: {+ color:"#dad8c9",+ weight: 1+ }+ }+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 12045);+return defs;+ },++ /**+ * Destructor implementation Graph class. Removes all Graphic instances from the widget.+ *+ * @method destructor+ * @protected+ */+ destructor: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "destructor", 12054);+_yuitest_coverline("build/charts-base/charts-base.js", 12056);+if(this._graphic)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12058);+this._graphic.destroy();+ _yuitest_coverline("build/charts-base/charts-base.js", 12059);+this._graphic = null;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12061);+if(this._background)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12063);+this._background.get("graphic").destroy();+ _yuitest_coverline("build/charts-base/charts-base.js", 12064);+this._background = null;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12066);+if(this._gridlines)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12068);+this._gridlines.get("graphic").destroy();+ _yuitest_coverline("build/charts-base/charts-base.js", 12069);+this._gridlines = null;+ }+ }+}, {+ ATTRS: {+ /**+ * The x-coordinate for the graph.+ *+ * @attribute x+ * @type Number+ * @protected+ */+ x: {+ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 12082);+_yuitest_coverline("build/charts-base/charts-base.js", 12084);+this.get("boundingBox").setStyle("left", val + "px");+ _yuitest_coverline("build/charts-base/charts-base.js", 12085);+return val;+ }+ },++ /**+ * The y-coordinate for the graph.+ *+ * @attribute y+ * @type Number+ * @protected+ */+ y: {+ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 12097);+_yuitest_coverline("build/charts-base/charts-base.js", 12099);+this.get("boundingBox").setStyle("top", val + "px");+ _yuitest_coverline("build/charts-base/charts-base.js", 12100);+return val;+ }+ },++ /**+ * Reference to the chart instance using the graph.+ *+ * @attribute chart+ * @type ChartBase+ * @readOnly+ */+ chart: {},++ /**+ * Collection of series. When setting the `seriesCollection` the array can contain a combination of either+ * `CartesianSeries` instances or object literals with properties that will define a series.+ *+ * @attribute seriesCollection+ * @type CartesianSeries+ */+ seriesCollection: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 12121);+_yuitest_coverline("build/charts-base/charts-base.js", 12123);+return this._seriesCollection;+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 12126);+_yuitest_coverline("build/charts-base/charts-base.js", 12128);+this._parseSeriesCollection(val);+ _yuitest_coverline("build/charts-base/charts-base.js", 12129);+return this._seriesCollection;+ }+ },+ + /**+ * Indicates whether the `Graph` has a background.+ *+ * @attribute showBackground+ * @type Boolean+ * @default true+ */+ showBackground: {+ value: true+ },++ /**+ * Read-only hash lookup for all series on in the `Graph`.+ *+ * @attribute seriesDictionary+ * @type Object+ * @readOnly+ */+ seriesDictionary: {+ readOnly: true,++ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 12154);+_yuitest_coverline("build/charts-base/charts-base.js", 12156);+return this._seriesDictionary;+ }+ },++ /**+ * Reference to the horizontal `Gridlines` instance.+ *+ * @attribute horizontalGridlines+ * @type Gridlines+ * @default null+ */+ horizontalGridlines: {+ value: null,++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 12170);+_yuitest_coverline("build/charts-base/charts-base.js", 12172);+var gl = this.get("horizontalGridlines");+ _yuitest_coverline("build/charts-base/charts-base.js", 12173);+if(gl && gl instanceof Y.Gridlines)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12175);+gl.remove();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12177);+if(val instanceof Y.Gridlines)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12179);+gl = val;+ _yuitest_coverline("build/charts-base/charts-base.js", 12180);+val.set("graph", this);+ _yuitest_coverline("build/charts-base/charts-base.js", 12181);+return val;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 12183);+if(val && val.axis)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12185);+gl = new Y.Gridlines({direction:"horizontal", axis:val.axis, graph:this, styles:val.styles});+ _yuitest_coverline("build/charts-base/charts-base.js", 12186);+return gl;+ }}+ }+ },+ + /**+ * Reference to the vertical `Gridlines` instance.+ *+ * @attribute verticalGridlines+ * @type Gridlines+ * @default null+ */+ verticalGridlines: {+ value: null,++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 12201);+_yuitest_coverline("build/charts-base/charts-base.js", 12203);+var gl = this.get("verticalGridlines");+ _yuitest_coverline("build/charts-base/charts-base.js", 12204);+if(gl && gl instanceof Y.Gridlines)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12206);+gl.remove();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12208);+if(val instanceof Y.Gridlines)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12210);+gl = val;+ _yuitest_coverline("build/charts-base/charts-base.js", 12211);+val.set("graph", this);+ _yuitest_coverline("build/charts-base/charts-base.js", 12212);+return val;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 12214);+if(val && val.axis)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12216);+gl = new Y.Gridlines({direction:"vertical", axis:val.axis, graph:this, styles:val.styles});+ _yuitest_coverline("build/charts-base/charts-base.js", 12217);+return gl;+ }}+ }+ },++ /**+ * Reference to graphic instance used for the background.+ *+ * @attribute background+ * @type Graphic+ * @readOnly+ */+ background: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 12230);+_yuitest_coverline("build/charts-base/charts-base.js", 12232);+if(!this._background)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12234);+this._backgroundGraphic = new Y.Graphic({render:this.get("contentBox")});+ _yuitest_coverline("build/charts-base/charts-base.js", 12235);+this._backgroundGraphic.get("node").style.zIndex = 0; + _yuitest_coverline("build/charts-base/charts-base.js", 12236);+this._background = this._backgroundGraphic.addShape({type: "rect"});+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12238);+return this._background;+ }+ },++ /**+ * Reference to graphic instance used for gridlines.+ *+ * @attribute gridlines+ * @type Graphic+ * @readOnly+ */+ gridlines: {+ readOnly: true,++ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 12252);+_yuitest_coverline("build/charts-base/charts-base.js", 12254);+if(!this._gridlines)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12256);+this._gridlinesGraphic = new Y.Graphic({render:this.get("contentBox")});+ _yuitest_coverline("build/charts-base/charts-base.js", 12257);+this._gridlinesGraphic.get("node").style.zIndex = 1; + _yuitest_coverline("build/charts-base/charts-base.js", 12258);+this._gridlines = this._gridlinesGraphic.addShape({type: "path"});+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12260);+return this._gridlines;+ }+ },+ + /**+ * Reference to graphic instance used for series.+ *+ * @attribute graphic+ * @type Graphic+ * @readOnly+ */+ graphic: {+ readOnly: true,++ getter: function() + {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 12274);+_yuitest_coverline("build/charts-base/charts-base.js", 12276);+if(!this._graphic)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12278);+this._graphic = new Y.Graphic({render:this.get("contentBox")});+ _yuitest_coverline("build/charts-base/charts-base.js", 12279);+this._graphic.get("node").style.zIndex = 2; + _yuitest_coverline("build/charts-base/charts-base.js", 12280);+this._graphic.set("autoDraw", false);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12282);+return this._graphic;+ }+ },++ /**+ * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.+ *+ * @attribute groupMarkers+ * @type Boolean+ */+ groupMarkers: {+ value: false+ }++ /**+ * Style properties used for drawing a background. Below are the default values:+ * <dl>+ * <dt>background</dt><dd>An object containing the following values:+ * <dl>+ * <dt>fill</dt><dd>Defines the style properties for the fill. Contains the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is #faf9f2.</dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the background fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>Defines the style properties for the border. Contains the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is #dad8c9.</dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the background border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * </dl>+ * </dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});+/**+ * The ChartBase class is an abstract class used to create charts.+ *+ * @module charts+ * @submodule charts-base+ * @class ChartBase+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 12331);+function ChartBase() {}++_yuitest_coverline("build/charts-base/charts-base.js", 12333);+ChartBase.ATTRS = {+ /**+ * Data used to generate the chart.+ * + * @attribute dataProvider+ * @type Array+ */+ dataProvider: {+ lazyAdd: false,++ valueFn: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "valueFn", 12343);+_yuitest_coverline("build/charts-base/charts-base.js", 12345);+var defDataProvider = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 12346);+if(!this._seriesKeysExplicitlySet)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12348);+this._seriesKeys = this._buildSeriesKeys(defDataProvider);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12350);+return defDataProvider;+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 12353);+_yuitest_coverline("build/charts-base/charts-base.js", 12355);+var dataProvider = this._setDataValues(val);+ _yuitest_coverline("build/charts-base/charts-base.js", 12356);+if(!this._seriesKeysExplicitlySet)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12358);+this._seriesKeys = this._buildSeriesKeys(dataProvider);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12360);+return dataProvider;+ }+ },++ /**+ * A collection of keys that map to the series axes. If no keys are set,+ * they will be generated automatically depending on the data structure passed into + * the chart.+ *+ * @attribute seriesKeys+ * @type Array+ */+ seriesKeys: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 12373);+_yuitest_coverline("build/charts-base/charts-base.js", 12375);+return this._seriesKeys;+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 12378);+_yuitest_coverline("build/charts-base/charts-base.js", 12380);+this._seriesKeysExplicitlySet = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 12381);+this._seriesKeys = val;+ _yuitest_coverline("build/charts-base/charts-base.js", 12382);+return val;+ }+ },++ /**+ * Sets the `aria-label` for the chart.+ *+ * @attribute ariaLabel+ * @type String+ */+ ariaLabel: {+ value: "Chart Application",++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 12395);+_yuitest_coverline("build/charts-base/charts-base.js", 12397);+var cb = this.get("contentBox");+ _yuitest_coverline("build/charts-base/charts-base.js", 12398);+if(cb)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12400);+cb.setAttribute("aria-label", val);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12402);+return val;+ }+ },+ + /**+ * Sets the aria description for the chart.+ *+ * @attribute ariaDescription+ * @type String+ */+ ariaDescription: {+ value: "Use the up and down keys to navigate between series. Use the left and right keys to navigate through items in a series.",++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 12415);+_yuitest_coverline("build/charts-base/charts-base.js", 12417);+if(this._description)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12419);+this._description.setContent("");+ _yuitest_coverline("build/charts-base/charts-base.js", 12420);+this._description.appendChild(DOCUMENT.createTextNode(val));+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12422);+return val;+ }+ },+ + /**+ * Reference to the default tooltip available for the chart.+ * <p>Contains the following properties:</p>+ * <dl>+ * <dt>node</dt><dd>Reference to the actual dom node</dd>+ * <dt>showEvent</dt><dd>Event that should trigger the tooltip</dd>+ * <dt>hideEvent</dt><dd>Event that should trigger the removal of a tooltip (can be an event or an array of events)</dd>+ * <dt>styles</dt><dd>A hash of style properties that will be applied to the tooltip node</dd>+ * <dt>show</dt><dd>Indicates whether or not to show the tooltip</dd>+ * <dt>markerEventHandler</dt><dd>Displays and hides tooltip based on marker events</dd>+ * <dt>planarEventHandler</dt><dd>Displays and hides tooltip based on planar events</dd>+ * <dt>markerLabelFunction</dt><dd>Reference to the function used to format a marker event triggered tooltip's text. The method contains + * the following arguments:+ * <dl>+ * <dt>categoryItem</dt><dd>An object containing the following:+ * <dl>+ * <dt>axis</dt><dd>The axis to which the category is bound.</dd>+ * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided).</dd>+ * <dt>key</dt><dd>The key of the category.</dd>+ * <dt>value</dt><dd>The value of the category.</dd>+ * </dl>+ * </dd>+ * <dt>valueItem</dt><dd>An object containing the following:+ * <dl>+ * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>+ * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>+ * <dt>key</dt><dd>The key for the series.</dd>+ * <dt>value</dt><dd>The value for the series item.</dd> + * </dl>+ * </dd>+ * <dt>itemIndex</dt><dd>The index of the item within the series.</dd>+ * <dt>series</dt><dd> The `CartesianSeries` instance of the item.</dd>+ * <dt>seriesIndex</dt><dd>The index of the series in the `seriesCollection`.</dd>+ * </dl>+ * The method returns an `HTMLElement` which is written into the DOM using `appendChild`. If you override this method and choose to return an html string, you+ * will also need to override the tooltip's `setTextFunction` method to accept an html string.+ * </dd>+ * <dt>planarLabelFunction</dt><dd>Reference to the function used to format a planar event triggered tooltip's text+ * <dl>+ * <dt>categoryAxis</dt><dd> `CategoryAxis` Reference to the categoryAxis of the chart.+ * <dt>valueItems</dt><dd>Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:+ * <dl>+ * <dt>axis</dt><dd>The value axis of the series.</dd>+ * <dt>key</dt><dd>The key for the series.</dd>+ * <dt>value</dt><dd>The value for the series item.</dd>+ * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>+ * </dl> + * </dd>+ * <dt>index</dt><dd>The index of the item within its series.</dd>+ * <dt>seriesArray</dt><dd>Array of series instances for each value item.</dd>+ * <dt>seriesIndex</dt><dd>The index of the series in the `seriesCollection`.</dd>+ * </dl>+ * </dd>+ * </dl>+ * The method returns an `HTMLElement` which is written into the DOM using `appendChild`. If you override this method and choose to return an html string, you+ * will also need to override the tooltip's `setTextFunction` method to accept an html string.+ * </dd>+ * <dt>setTextFunction</dt><dd>Method that writes content returned from `planarLabelFunction` or `markerLabelFunction` into the the tooltip node.+ * has the following signature:+ * <dl>+ * <dt>label</dt><dd>The `HTMLElement` that the content is to be added.</dd>+ * <dt>val</dt><dd>The content to be rendered into tooltip. This can be a `String` or `HTMLElement`. If an HTML string is used, it will be rendered as a+ * string.</dd>+ * </dl>+ * </dd>+ * </dl>+ * @attribute tooltip+ * @type Object+ */ + tooltip: {+ valueFn: "_getTooltip",++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 12498);+_yuitest_coverline("build/charts-base/charts-base.js", 12500);+return this._updateTooltip(val);+ }+ },++ /** + * The key value used for the chart's category axis. + *+ * @attribute categoryKey+ * @type String+ * @default category+ */+ categoryKey: {+ value: "category"+ },+ + /**+ * Indicates the type of axis to use for the category axis.+ *+ * <dl>+ * <dt>category</dt><dd>Specifies a `CategoryAxis`.</dd>+ * <dt>time</dt><dd>Specifies a `TimeAxis</dd>+ * </dl>+ *+ * @attribute categoryType+ * @type String+ * @default category+ */+ categoryType:{+ value:"category"+ },++ /**+ * Indicates the the type of interactions that will fire events.+ *+ * <dl>+ * <dt>marker</dt><dd>Events will be broadcasted when the mouse interacts with individual markers.</dd>+ * <dt>planar</dt><dd>Events will be broadcasted when the mouse intersects the plane of any markers on the chart.</dd>+ * <dt>none</dt><dd>No events will be broadcasted.</dd>+ * </dl>+ *+ * @attribute interactionType+ * @type String+ * @default marker+ */+ interactionType: {+ value: "marker"+ },++ /**+ * Reference to all the axes in the chart.+ *+ * @attribute axesCollection+ * @type Array+ */+ axesCollection: {},++ /**+ * Reference to graph instance.+ * + * @attribute graph+ * @type Graph + */+ graph: {+ valueFn: "_getGraph"+ },++ /**+ * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.+ *+ * @attribute groupMarkers+ * @type Boolean+ */+ groupMarkers: {+ value: false+ }+};++_yuitest_coverline("build/charts-base/charts-base.js", 12577);+ChartBase.prototype = {+ /**+ * Handles groupMarkers change event.+ *+ * @method _groupMarkersChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _groupMarkersChangeHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_groupMarkersChangeHandler", 12585);+_yuitest_coverline("build/charts-base/charts-base.js", 12587);+var graph = this.get("graph"),+ useGroupMarkers = e.newVal;+ _yuitest_coverline("build/charts-base/charts-base.js", 12589);+if(graph)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12591);+graph.set("groupMarkers", useGroupMarkers);+ }+ },++ /**+ * Handler for itemRendered event.+ *+ * @method _itemRendered+ * @param {Object} e Event object.+ * @private+ */+ _itemRendered: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_itemRendered", 12602);+_yuitest_coverline("build/charts-base/charts-base.js", 12604);+this._itemRenderQueue = this._itemRenderQueue.splice(1 + Y.Array.indexOf(this._itemRenderQueue, e.currentTarget), 1);+ _yuitest_coverline("build/charts-base/charts-base.js", 12605);+if(this._itemRenderQueue.length < 1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12607);+this._redraw();+ }+ },++ /**+ * Default value function for the `Graph` attribute.+ *+ * @method _getGraph+ * @return Graph+ * @private+ */+ _getGraph: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getGraph", 12618);+_yuitest_coverline("build/charts-base/charts-base.js", 12620);+var graph = new Y.Graph({+ chart:this,+ groupMarkers: this.get("groupMarkers") + });+ _yuitest_coverline("build/charts-base/charts-base.js", 12624);+graph.after("chartRendered", Y.bind(function(e) {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "(anonymous 6)", 12624);+_yuitest_coverline("build/charts-base/charts-base.js", 12625);+this.fire("chartRendered");+ }, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 12627);+return graph; + },++ /**+ * Returns a series instance by index or key value.+ *+ * @method getSeries+ * @param val+ * @return CartesianSeries+ */+ getSeries: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getSeries", 12637);+_yuitest_coverline("build/charts-base/charts-base.js", 12639);+var series = null, + graph = this.get("graph");+ _yuitest_coverline("build/charts-base/charts-base.js", 12641);+if(graph)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12643);+if(Y_Lang.isNumber(val))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12645);+series = graph.getSeriesByIndex(val);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12649);+series = graph.getSeriesByKey(val);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12652);+return series;+ },++ /**+ * Returns an `Axis` instance by key reference. If the axis was explicitly set through the `axes` attribute,+ * the key will be the same as the key used in the `axes` object. For default axes, the key for+ * the category axis is the value of the `categoryKey` (`category`). For the value axis, the default + * key is `values`.+ *+ * @method getAxisByKey+ * @param {String} val Key reference used to look up the axis.+ * @return Axis+ */+ getAxisByKey: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getAxisByKey", 12665);+_yuitest_coverline("build/charts-base/charts-base.js", 12667);+var axis,+ axes = this.get("axes");+ _yuitest_coverline("build/charts-base/charts-base.js", 12669);+if(axes && axes.hasOwnProperty(val))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12671);+axis = axes[val];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12673);+return axis;+ },++ /**+ * Returns the category axis for the chart.+ *+ * @method getCategoryAxis+ * @return Axis+ */+ getCategoryAxis: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getCategoryAxis", 12682);+_yuitest_coverline("build/charts-base/charts-base.js", 12684);+var axis,+ key = this.get("categoryKey"),+ axes = this.get("axes");+ _yuitest_coverline("build/charts-base/charts-base.js", 12687);+if(axes.hasOwnProperty(key))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12689);+axis = axes[key];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12691);+return axis;+ },++ /**+ * Default direction of the chart.+ *+ * @property _direction+ * @type String+ * @default horizontal+ * @private+ */+ _direction: "horizontal",+ + /**+ * Storage for the `dataProvider` attribute.+ *+ * @property _dataProvider+ * @type Array+ * @private+ */+ _dataProvider: null,++ /**+ * Setter method for `dataProvider` attribute.+ *+ * @method _setDataValues+ * @param {Array} val Array to be set as `dataProvider`.+ * @return Array+ * @private+ */+ _setDataValues: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setDataValues", 12721);+_yuitest_coverline("build/charts-base/charts-base.js", 12723);+if(Y_Lang.isArray(val[0]))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12725);+var hash, + dp = [], + cats = val[0], + i = 0, + l = cats.length, + n, + sl = val.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 12732);+for(; i < l; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12734);+hash = {category:cats[i]};+ _yuitest_coverline("build/charts-base/charts-base.js", 12735);+for(n = 1; n < sl; ++n)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12737);+hash["series" + n] = val[n][i];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12739);+dp[i] = hash; + }+ _yuitest_coverline("build/charts-base/charts-base.js", 12741);+return dp;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12743);+return val;+ },++ /**+ * Storage for `seriesCollection` attribute.+ *+ * @property _seriesCollection+ * @type Array+ * @private + */+ _seriesCollection: null,++ /**+ * Setter method for `seriesCollection` attribute.+ *+ * @property _setSeriesCollection+ * @param {Array} val Array of either `CartesianSeries` instances or objects containing series attribute key value pairs.+ * @private+ */+ _setSeriesCollection: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setSeriesCollection", 12762);+_yuitest_coverline("build/charts-base/charts-base.js", 12764);+this._seriesCollection = val;+ },+ /**+ * Helper method that returns the axis class that a key references.+ *+ * @method _getAxisClass+ * @param {String} t The type of axis.+ * @return Axis+ * @private+ */+ _getAxisClass: function(t)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getAxisClass", 12774);+_yuitest_coverline("build/charts-base/charts-base.js", 12776);+return this._axisClass[t];+ },+ + /**+ * Key value pairs of axis types. + *+ * @property _axisClass+ * @type Object+ * @private+ */+ _axisClass: {+ stacked: Y.StackedAxis,+ numeric: Y.NumericAxis,+ category: Y.CategoryAxis,+ time: Y.TimeAxis+ },++ /**+ * Collection of axes.+ *+ * @property _axes+ * @type Array+ * @private+ */+ _axes: null,++ /**+ * @method initializer+ * @private+ */+ initializer: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "initializer", 12806);+_yuitest_coverline("build/charts-base/charts-base.js", 12808);+this._itemRenderQueue = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 12809);+this._seriesIndex = -1;+ _yuitest_coverline("build/charts-base/charts-base.js", 12810);+this._itemIndex = -1;+ _yuitest_coverline("build/charts-base/charts-base.js", 12811);+this.after("dataProviderChange", this._dataProviderChangeHandler);+ },++ /**+ * @method renderUI+ * @private+ */+ renderUI: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "renderUI", 12818);+_yuitest_coverline("build/charts-base/charts-base.js", 12820);+var tt = this.get("tooltip"),+ bb = this.get("boundingBox"),+ cb = this.get("contentBox");+ //move the position = absolute logic to a class file+ _yuitest_coverline("build/charts-base/charts-base.js", 12824);+bb.setStyle("position", "absolute");+ _yuitest_coverline("build/charts-base/charts-base.js", 12825);+cb.setStyle("position", "absolute");+ _yuitest_coverline("build/charts-base/charts-base.js", 12826);+this._addAxes();+ _yuitest_coverline("build/charts-base/charts-base.js", 12827);+this._addSeries();+ _yuitest_coverline("build/charts-base/charts-base.js", 12828);+if(tt && tt.show)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12830);+this._addTooltip();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12832);+this._setAriaElements(bb, cb);+ },+ + /**+ * Creates an aria `live-region`, `aria-label` and `aria-describedby` for the Chart.+ *+ * @method _setAriaElements+ * @param {Node} cb Reference to the Chart's `contentBox` attribute.+ * @private+ */+ _setAriaElements: function(bb, cb)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setAriaElements", 12842);+_yuitest_coverline("build/charts-base/charts-base.js", 12844);+var description = this._getAriaOffscreenNode(),+ id = this.get("id") + "_description",+ liveRegion = this._getAriaOffscreenNode();+ _yuitest_coverline("build/charts-base/charts-base.js", 12847);+cb.set("tabIndex", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 12848);+cb.set("role", "img");+ _yuitest_coverline("build/charts-base/charts-base.js", 12849);+cb.setAttribute("aria-label", this.get("ariaLabel"));+ _yuitest_coverline("build/charts-base/charts-base.js", 12850);+cb.setAttribute("aria-describedby", id);+ _yuitest_coverline("build/charts-base/charts-base.js", 12851);+description.set("id", id);+ _yuitest_coverline("build/charts-base/charts-base.js", 12852);+description.set("tabIndex", -1);+ _yuitest_coverline("build/charts-base/charts-base.js", 12853);+description.appendChild(DOCUMENT.createTextNode(this.get("ariaDescription")));+ _yuitest_coverline("build/charts-base/charts-base.js", 12854);+liveRegion.set("id", "live-region");+ _yuitest_coverline("build/charts-base/charts-base.js", 12855);+liveRegion.set("aria-live", "polite");+ _yuitest_coverline("build/charts-base/charts-base.js", 12856);+liveRegion.set("aria-atomic", "true");+ _yuitest_coverline("build/charts-base/charts-base.js", 12857);+liveRegion.set("role", "status");+ _yuitest_coverline("build/charts-base/charts-base.js", 12858);+bb.setAttribute("role", "application");+ _yuitest_coverline("build/charts-base/charts-base.js", 12859);+bb.appendChild(description);+ _yuitest_coverline("build/charts-base/charts-base.js", 12860);+bb.appendChild(liveRegion);+ _yuitest_coverline("build/charts-base/charts-base.js", 12861);+this._description = description;+ _yuitest_coverline("build/charts-base/charts-base.js", 12862);+this._liveRegion = liveRegion;+ },++ /**+ * Sets a node offscreen for use as aria-description or aria-live-regin.+ *+ * @method _setOffscreen+ * @return Node + * @private+ */+ _getAriaOffscreenNode: function() + {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getAriaOffscreenNode", 12872);+_yuitest_coverline("build/charts-base/charts-base.js", 12874);+var node = Y.Node.create("<div></div>"),+ ie = Y.UA.ie,+ clipRect = (ie && ie < 8) ? "rect(1px 1px 1px 1px)" : "rect(1px, 1px, 1px, 1px)";+ _yuitest_coverline("build/charts-base/charts-base.js", 12877);+node.setStyle("position", "absolute");+ _yuitest_coverline("build/charts-base/charts-base.js", 12878);+node.setStyle("height", "1px"); + _yuitest_coverline("build/charts-base/charts-base.js", 12879);+node.setStyle("width", "1px"); + _yuitest_coverline("build/charts-base/charts-base.js", 12880);+node.setStyle("overflow", "hidden");+ _yuitest_coverline("build/charts-base/charts-base.js", 12881);+node.setStyle("clip", clipRect); + _yuitest_coverline("build/charts-base/charts-base.js", 12882);+return node;+ },+ + /**+ * @method syncUI+ * @private+ */+ syncUI: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "syncUI", 12889);+_yuitest_coverline("build/charts-base/charts-base.js", 12891);+this._redraw();+ },++ /**+ * @method bindUI+ * @private+ */+ bindUI: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "bindUI", 12898);+_yuitest_coverline("build/charts-base/charts-base.js", 12900);+this.after("tooltipChange", Y.bind(this._tooltipChangeHandler, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 12901);+this.after("widthChange", this._sizeChanged);+ _yuitest_coverline("build/charts-base/charts-base.js", 12902);+this.after("heightChange", this._sizeChanged);+ _yuitest_coverline("build/charts-base/charts-base.js", 12903);+this.after("groupMarkersChange", this._groupMarkersChangeHandler);+ _yuitest_coverline("build/charts-base/charts-base.js", 12904);+var tt = this.get("tooltip"),+ hideEvent = "mouseout",+ showEvent = "mouseover",+ cb = this.get("contentBox"),+ interactionType = this.get("interactionType"),+ i = 0,+ len,+ markerClassName = "." + SERIES_MARKER,+ isTouch = ((WINDOW && ("ontouchstart" in WINDOW)) && !(Y.UA.chrome && Y.UA.chrome < 6));+ _yuitest_coverline("build/charts-base/charts-base.js", 12913);+Y.on("keydown", Y.bind(function(e) {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "(anonymous 7)", 12913);+_yuitest_coverline("build/charts-base/charts-base.js", 12914);+var key = e.keyCode,+ numKey = parseFloat(key),+ msg;+ _yuitest_coverline("build/charts-base/charts-base.js", 12917);+if(numKey > 36 && numKey < 41)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12919);+e.halt();+ _yuitest_coverline("build/charts-base/charts-base.js", 12920);+msg = this._getAriaMessage(numKey);+ _yuitest_coverline("build/charts-base/charts-base.js", 12921);+this._liveRegion.setContent("");+ _yuitest_coverline("build/charts-base/charts-base.js", 12922);+this._liveRegion.appendChild(DOCUMENT.createTextNode(msg));+ }+ }, this), this.get("contentBox"));+ _yuitest_coverline("build/charts-base/charts-base.js", 12925);+if(interactionType == "marker")+ {+ //if touch capabilities, toggle tooltip on touchend. otherwise, the tooltip attribute's hideEvent/showEvent types.+ _yuitest_coverline("build/charts-base/charts-base.js", 12928);+hideEvent = tt.hideEvent;+ _yuitest_coverline("build/charts-base/charts-base.js", 12929);+showEvent = tt.showEvent;+ _yuitest_coverline("build/charts-base/charts-base.js", 12930);+if(isTouch)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12932);+Y.delegate("touchend", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);+ //hide active tooltip if the chart is touched+ _yuitest_coverline("build/charts-base/charts-base.js", 12934);+Y.on("touchend", Y.bind(function(e) {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "(anonymous 8)", 12934);+_yuitest_coverline("build/charts-base/charts-base.js", 12935);+e.halt(true);+ _yuitest_coverline("build/charts-base/charts-base.js", 12936);+if(this._activeMarker)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12938);+this._activeMarker = null;+ _yuitest_coverline("build/charts-base/charts-base.js", 12939);+this.hideTooltip(e);+ }+ }, this));+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12945);+Y.delegate("mouseenter", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);+ _yuitest_coverline("build/charts-base/charts-base.js", 12946);+Y.delegate("mousedown", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);+ _yuitest_coverline("build/charts-base/charts-base.js", 12947);+Y.delegate("mouseup", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);+ _yuitest_coverline("build/charts-base/charts-base.js", 12948);+Y.delegate("mouseleave", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);+ _yuitest_coverline("build/charts-base/charts-base.js", 12949);+Y.delegate("click", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);+ _yuitest_coverline("build/charts-base/charts-base.js", 12950);+Y.delegate("mousemove", Y.bind(this._positionTooltip, this), cb, markerClassName);+ }+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 12953);+if(interactionType == "planar")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12955);+if(isTouch)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12957);+this._overlay.on("touchend", Y.bind(this._planarEventDispatcher, this));+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12961);+this._overlay.on("mousemove", Y.bind(this._planarEventDispatcher, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 12962);+this.on("mouseout", this.hideTooltip);+ }+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 12965);+if(tt)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12967);+this.on("markerEvent:touchend", Y.bind(function(e) {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "(anonymous 9)", 12967);+_yuitest_coverline("build/charts-base/charts-base.js", 12968);+var marker = e.series.get("markers")[e.index];+ _yuitest_coverline("build/charts-base/charts-base.js", 12969);+if(this._activeMarker && marker === this._activeMarker)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12971);+this._activeMarker = null;+ _yuitest_coverline("build/charts-base/charts-base.js", 12972);+this.hideTooltip(e);+ }+ else+ {++ _yuitest_coverline("build/charts-base/charts-base.js", 12977);+this._activeMarker = marker;+ _yuitest_coverline("build/charts-base/charts-base.js", 12978);+tt.markerEventHandler.apply(this, [e]);+ }+ }, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 12981);+if(hideEvent && showEvent && hideEvent == showEvent)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12983);+this.on(interactionType + "Event:" + hideEvent, this.toggleTooltip);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12987);+if(showEvent)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12989);+this.on(interactionType + "Event:" + showEvent, tt[interactionType + "EventHandler"]);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 12991);+if(hideEvent)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12993);+if(Y_Lang.isArray(hideEvent))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12995);+len = hideEvent.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 12996);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 12998);+this.on(interactionType + "Event:" + hideEvent[i], this.hideTooltip);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13001);+this.on(interactionType + "Event:" + hideEvent, this.hideTooltip);+ }+ }+ }+ },+ + /**+ * Event handler for marker events.+ *+ * @method _markerEventDispatcher+ * @param {Object} e Event object.+ * @private+ */+ _markerEventDispatcher: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_markerEventDispatcher", 13014);+_yuitest_coverline("build/charts-base/charts-base.js", 13016);+var type = e.type,+ cb = this.get("contentBox"),+ markerNode = e.currentTarget,+ strArr = markerNode.getAttribute("id").split("_"),+ index = strArr.pop(),+ seriesIndex = strArr.pop(),+ series = this.getSeries(parseInt(seriesIndex, 10)),+ items = this.getSeriesItems(series, index),+ isTouch = e && e.hasOwnProperty("changedTouches"),+ pageX = isTouch ? e.changedTouches[0].pageX : e.pageX,+ pageY = isTouch ? e.changedTouches[0].pageY : e.pageY,+ x = pageX - cb.getX(),+ y = pageY - cb.getY();+ _yuitest_coverline("build/charts-base/charts-base.js", 13029);+if(type == "mouseenter")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13031);+type = "mouseover";+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 13033);+if(type == "mouseleave")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13035);+type = "mouseout";+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 13037);+series.updateMarkerState(type, index);+ _yuitest_coverline("build/charts-base/charts-base.js", 13038);+e.halt();+ /**+ * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseover event.+ * + *+ * @event markerEvent:mouseover+ * @preventable false+ * @param {EventFacade} e Event facade with the following additional+ * properties:+ * <dl>+ * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>+ * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>+ * <dt>node</dt><dd>The dom node of the marker.</dd>+ * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>series</dt><dd>Reference to the series of the marker.</dd>+ * <dt>index</dt><dd>Index of the marker in the series.</dd>+ * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>+ * </dl>+ */+ /**+ * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseout event.+ *+ * @event markerEvent:mouseout+ * @preventable false+ * @param {EventFacade} e Event facade with the following additional+ * properties:+ * <dl>+ * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>+ * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>+ * <dt>node</dt><dd>The dom node of the marker.</dd>+ * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>series</dt><dd>Reference to the series of the marker.</dd>+ * <dt>index</dt><dd>Index of the marker in the series.</dd>+ * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>+ * </dl>+ */+ /**+ * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mousedown event.+ *+ * @event markerEvent:mousedown+ * @preventable false+ * @param {EventFacade} e Event facade with the following additional+ * properties:+ * <dl>+ * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>+ * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>+ * <dt>node</dt><dd>The dom node of the marker.</dd>+ * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>series</dt><dd>Reference to the series of the marker.</dd>+ * <dt>index</dt><dd>Index of the marker in the series.</dd>+ * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>+ * </dl>+ */+ /**+ * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseup event.+ *+ * @event markerEvent:mouseup+ * @preventable false+ * @param {EventFacade} e Event facade with the following additional+ * properties:+ * <dl>+ * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>+ * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>+ * <dt>node</dt><dd>The dom node of the marker.</dd>+ * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>series</dt><dd>Reference to the series of the marker.</dd>+ * <dt>index</dt><dd>Index of the marker in the series.</dd>+ * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>+ * </dl>+ */+ /**+ * Broadcasts when `interactionType` is set to `marker` and a series marker has received a click event.+ *+ * @event markerEvent:click+ * @preventable false+ * @param {EventFacade} e Event facade with the following additional+ * properties:+ * <dl>+ * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>+ * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>+ * <dt>node</dt><dd>The dom node of the marker.</dd>+ * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>pageX</dt><dd>The x location of the event on the page (including scroll)</dd>+ * <dt>pageY</dt><dd>The y location of the event on the page (including scroll)</dd>+ * <dt>series</dt><dd>Reference to the series of the marker.</dd>+ * <dt>index</dt><dd>Index of the marker in the series.</dd>+ * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>+ * <dt>originEvent</dt><dd>Underlying dom event.</dd>+ * </dl>+ */+ _yuitest_coverline("build/charts-base/charts-base.js", 13133);+this.fire("markerEvent:" + type, {+ originEvent: e,+ pageX:pageX, + pageY:pageY, + categoryItem:items.category, + valueItem:items.value, + node:markerNode, + x:x, + y:y, + series:series, + index:index, + seriesIndex:seriesIndex+ });+ },++ /**+ * Event handler for dataProviderChange.+ *+ * @method _dataProviderChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _dataProviderChangeHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_dataProviderChangeHandler", 13155);+_yuitest_coverline("build/charts-base/charts-base.js", 13157);+var dataProvider = e.newVal,+ axes,+ i,+ axis;+ _yuitest_coverline("build/charts-base/charts-base.js", 13161);+this._seriesIndex = -1;+ _yuitest_coverline("build/charts-base/charts-base.js", 13162);+this._itemIndex = -1;+ _yuitest_coverline("build/charts-base/charts-base.js", 13163);+if(this instanceof Y.CartesianChart)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13165);+this.set("axes", this.get("axes"));+ _yuitest_coverline("build/charts-base/charts-base.js", 13166);+this.set("seriesCollection", this.get("seriesCollection"));+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13168);+axes = this.get("axes");+ _yuitest_coverline("build/charts-base/charts-base.js", 13169);+if(axes)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13171);+for(i in axes)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13173);+if(axes.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13175);+axis = axes[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 13176);+if(axis instanceof Y.Axis)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13178);+if(axis.get("position") != "none")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13180);+this._addToAxesRenderQueue(axis);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13182);+axis.set("dataProvider", dataProvider);+ }+ }+ }+ }+ },+ + /**+ * Event listener for toggling the tooltip. If a tooltip is visible, hide it. If not, it + * will create and show a tooltip based on the event object.+ * + * @method toggleTooltip+ * @param {Object} e Event object.+ */+ toggleTooltip: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "toggleTooltip", 13196);+_yuitest_coverline("build/charts-base/charts-base.js", 13198);+var tt = this.get("tooltip");+ _yuitest_coverline("build/charts-base/charts-base.js", 13199);+if(tt.visible)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13201);+this.hideTooltip();+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13205);+tt.markerEventHandler.apply(this, [e]);+ }+ },++ /**+ * Shows a tooltip+ *+ * @method _showTooltip+ * @param {String} msg Message to dispaly in the tooltip.+ * @param {Number} x x-coordinate + * @param {Number} y y-coordinate+ * @private+ */+ _showTooltip: function(msg, x, y)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_showTooltip", 13218);+_yuitest_coverline("build/charts-base/charts-base.js", 13220);+var tt = this.get("tooltip"),+ node = tt.node;+ _yuitest_coverline("build/charts-base/charts-base.js", 13222);+if(msg)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13224);+tt.visible = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 13225);+tt.setTextFunction(node, msg);+ _yuitest_coverline("build/charts-base/charts-base.js", 13226);+node.setStyle("top", y + "px");+ _yuitest_coverline("build/charts-base/charts-base.js", 13227);+node.setStyle("left", x + "px");+ _yuitest_coverline("build/charts-base/charts-base.js", 13228);+node.setStyle("visibility", "visible");+ }+ },++ /**+ * Positions the tooltip+ *+ * @method _positionTooltip+ * @param {Object} e Event object.+ * @private+ */+ _positionTooltip: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_positionTooltip", 13239);+_yuitest_coverline("build/charts-base/charts-base.js", 13241);+var tt = this.get("tooltip"),+ node = tt.node,+ cb = this.get("contentBox"),+ x = (e.pageX + 10) - cb.getX(),+ y = (e.pageY + 10) - cb.getY();+ _yuitest_coverline("build/charts-base/charts-base.js", 13246);+if(node)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13248);+node.setStyle("left", x + "px");+ _yuitest_coverline("build/charts-base/charts-base.js", 13249);+node.setStyle("top", y + "px");+ }+ },++ /**+ * Hides the default tooltip+ *+ * @method hideTooltip+ */+ hideTooltip: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "hideTooltip", 13258);+_yuitest_coverline("build/charts-base/charts-base.js", 13260);+var tt = this.get("tooltip"),+ node = tt.node;+ _yuitest_coverline("build/charts-base/charts-base.js", 13262);+tt.visible = false;+ _yuitest_coverline("build/charts-base/charts-base.js", 13263);+node.set("innerHTML", "");+ _yuitest_coverline("build/charts-base/charts-base.js", 13264);+node.setStyle("left", -10000);+ _yuitest_coverline("build/charts-base/charts-base.js", 13265);+node.setStyle("top", -10000);+ _yuitest_coverline("build/charts-base/charts-base.js", 13266);+node.setStyle("visibility", "hidden");+ },++ /**+ * Adds a tooltip to the dom.+ *+ * @method _addTooltip+ * @private+ */+ _addTooltip: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_addTooltip", 13275);+_yuitest_coverline("build/charts-base/charts-base.js", 13277);+var tt = this.get("tooltip"),+ id = this.get("id") + "_tooltip",+ cb = this.get("contentBox"),+ oldNode = DOCUMENT.getElementById(id);+ _yuitest_coverline("build/charts-base/charts-base.js", 13281);+if(oldNode)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13283);+cb.removeChild(oldNode);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13285);+tt.node.set("id", id);+ _yuitest_coverline("build/charts-base/charts-base.js", 13286);+tt.node.setStyle("visibility", "hidden");+ _yuitest_coverline("build/charts-base/charts-base.js", 13287);+cb.appendChild(tt.node);+ },++ /**+ * Updates the tooltip attribute.+ *+ * @method _updateTooltip+ * @param {Object} val Object containing properties for the tooltip.+ * @return Object+ * @private+ */+ _updateTooltip: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_updateTooltip", 13298);+_yuitest_coverline("build/charts-base/charts-base.js", 13300);+var tt = this.get("tooltip") || this._getTooltip(),+ i,+ styles,+ node,+ props = {+ markerLabelFunction:"markerLabelFunction",+ planarLabelFunction:"planarLabelFunction",+ setTextFunction:"setTextFunction",+ showEvent:"showEvent",+ hideEvent:"hideEvent",+ markerEventHandler:"markerEventHandler",+ planarEventHandler:"planarEventHandler",+ show:"show"+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 13314);+if(Y_Lang.isObject(val))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13316);+styles = val.styles;+ _yuitest_coverline("build/charts-base/charts-base.js", 13317);+node = Y.one(val.node) || tt.node;+ _yuitest_coverline("build/charts-base/charts-base.js", 13318);+if(styles)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13320);+for(i in styles)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13322);+if(styles.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13324);+node.setStyle(i, styles[i]);+ }+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13328);+for(i in props)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13330);+if(val.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13332);+tt[i] = val[i];+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13335);+tt.node = node;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13337);+return tt;+ },++ /**+ * Default getter for `tooltip` attribute.+ *+ * @method _getTooltip+ * @return Object+ * @private+ */+ _getTooltip: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getTooltip", 13347);+_yuitest_coverline("build/charts-base/charts-base.js", 13349);+var node = DOCUMENT.createElement("div"),+ tooltipClass = _getClassName("chart-tooltip"),+ tt = {+ setTextFunction: this._setText,+ markerLabelFunction: this._tooltipLabelFunction,+ planarLabelFunction: this._planarLabelFunction,+ show: true,+ hideEvent: "mouseout",+ showEvent: "mouseover",+ markerEventHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "markerEventHandler", 13358);+_yuitest_coverline("build/charts-base/charts-base.js", 13360);+var tt = this.get("tooltip"),+ msg = tt.markerLabelFunction.apply(this, [e.categoryItem, e.valueItem, e.index, e.series, e.seriesIndex]);+ _yuitest_coverline("build/charts-base/charts-base.js", 13362);+this._showTooltip(msg, e.x + 10, e.y + 10);+ },+ planarEventHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "planarEventHandler", 13364);+_yuitest_coverline("build/charts-base/charts-base.js", 13366);+var tt = this.get("tooltip"),+ msg ,+ categoryAxis = this.get("categoryAxis");+ _yuitest_coverline("build/charts-base/charts-base.js", 13369);+msg = tt.planarLabelFunction.apply(this, [categoryAxis, e.valueItem, e.index, e.items, e.seriesIndex]);+ _yuitest_coverline("build/charts-base/charts-base.js", 13370);+this._showTooltip(msg, e.x + 10, e.y + 10);+ }+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 13373);+node = Y.one(node);+ _yuitest_coverline("build/charts-base/charts-base.js", 13374);+node.set("id", this.get("id") + "_tooltip");+ _yuitest_coverline("build/charts-base/charts-base.js", 13375);+node.setStyle("fontSize", "85%");+ _yuitest_coverline("build/charts-base/charts-base.js", 13376);+node.setStyle("opacity", "0.83");+ _yuitest_coverline("build/charts-base/charts-base.js", 13377);+node.setStyle("position", "absolute");+ _yuitest_coverline("build/charts-base/charts-base.js", 13378);+node.setStyle("paddingTop", "2px");+ _yuitest_coverline("build/charts-base/charts-base.js", 13379);+node.setStyle("paddingRight", "5px");+ _yuitest_coverline("build/charts-base/charts-base.js", 13380);+node.setStyle("paddingBottom", "4px");+ _yuitest_coverline("build/charts-base/charts-base.js", 13381);+node.setStyle("paddingLeft", "2px");+ _yuitest_coverline("build/charts-base/charts-base.js", 13382);+node.setStyle("backgroundColor", "#fff");+ _yuitest_coverline("build/charts-base/charts-base.js", 13383);+node.setStyle("border", "1px solid #dbdccc");+ _yuitest_coverline("build/charts-base/charts-base.js", 13384);+node.setStyle("pointerEvents", "none");+ _yuitest_coverline("build/charts-base/charts-base.js", 13385);+node.setStyle("zIndex", 3);+ _yuitest_coverline("build/charts-base/charts-base.js", 13386);+node.setStyle("whiteSpace", "noWrap");+ _yuitest_coverline("build/charts-base/charts-base.js", 13387);+node.setStyle("visibility", "hidden");+ _yuitest_coverline("build/charts-base/charts-base.js", 13388);+node.addClass(tooltipClass);+ _yuitest_coverline("build/charts-base/charts-base.js", 13389);+tt.node = Y.one(node);+ _yuitest_coverline("build/charts-base/charts-base.js", 13390);+return tt;+ },++ /**+ * Formats tooltip text when `interactionType` is `planar`.+ *+ * @method _planarLabelFunction+ * @param {Axis} categoryAxis Reference to the categoryAxis of the chart.+ * @param {Array} valueItems Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:+ * <dl>+ * <dt>axis</dt><dd>The value axis of the series.</dd>+ * <dt>key</dt><dd>The key for the series.</dd>+ * <dt>value</dt><dd>The value for the series item.</dd>+ * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>+ * </dl> + * @param {Number} index The index of the item within its series.+ * @param {Array} seriesArray Array of series instances for each value item.+ * @param {Number} seriesIndex The index of the series in the `seriesCollection`.+ * @return {String | HTML} + * @private+ */+ _planarLabelFunction: function(categoryAxis, valueItems, index, seriesArray, seriesIndex)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_planarLabelFunction", 13411);+_yuitest_coverline("build/charts-base/charts-base.js", 13413);+var msg = DOCUMENT.createElement("div"),+ valueItem,+ i = 0,+ len = seriesArray.length,+ axis,+ categoryValue,+ seriesValue,+ series;+ _yuitest_coverline("build/charts-base/charts-base.js", 13421);+if(categoryAxis)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13423);+categoryValue = categoryAxis.get("labelFunction").apply(this, [categoryAxis.getKeyValueAt(this.get("categoryKey"), index), categoryAxis.get("labelFormat")]);+ _yuitest_coverline("build/charts-base/charts-base.js", 13424);+if(!Y_Lang.isObject(categoryValue))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13426);+categoryValue = DOCUMENT.createTextNode(categoryValue);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13428);+msg.appendChild(categoryValue);+ }++ _yuitest_coverline("build/charts-base/charts-base.js", 13431);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13433);+series = seriesArray[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 13434);+if(series.get("visible"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13436);+valueItem = valueItems[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 13437);+axis = valueItem.axis;+ _yuitest_coverline("build/charts-base/charts-base.js", 13438);+seriesValue = axis.get("labelFunction").apply(this, [axis.getKeyValueAt(valueItem.key, index), axis.get("labelFormat")]);+ _yuitest_coverline("build/charts-base/charts-base.js", 13439);+msg.appendChild(DOCUMENT.createElement("br"));+ _yuitest_coverline("build/charts-base/charts-base.js", 13440);+msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName));+ _yuitest_coverline("build/charts-base/charts-base.js", 13441);+msg.appendChild(DOCUMENT.createTextNode(": "));+ _yuitest_coverline("build/charts-base/charts-base.js", 13442);+if(!Y_Lang.isObject(seriesValue))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13444);+seriesValue = DOCUMENT.createTextNode(seriesValue);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13446);+msg.appendChild(seriesValue);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13449);+return msg;+ },++ /**+ * Formats tooltip text when `interactionType` is `marker`.+ *+ * @method _tooltipLabelFunction+ * @param {Object} categoryItem An object containing the following:+ * <dl>+ * <dt>axis</dt><dd>The axis to which the category is bound.</dd>+ * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided)</dd>+ * <dt>key</dt><dd>The key of the category.</dd>+ * <dt>value</dt><dd>The value of the category</dd>+ * </dl>+ * @param {Object} valueItem An object containing the following:+ * <dl>+ * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>+ * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>+ * <dt>key</dt><dd>The key for the series.</dd>+ * <dt>value</dt><dd>The value for the series item.</dd> + * </dl>+ * @param {Number} itemIndex The index of the item within the series.+ * @param {CartesianSeries} series The `CartesianSeries` instance of the item.+ * @param {Number} seriesIndex The index of the series in the `seriesCollection`.+ * @return {String | HTML}+ * @private+ */+ _tooltipLabelFunction: function(categoryItem, valueItem, itemIndex, series, seriesIndex)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_tooltipLabelFunction", 13476);+_yuitest_coverline("build/charts-base/charts-base.js", 13478);+var msg = DOCUMENT.createElement("div"),+ categoryValue = categoryItem.axis.get("labelFunction").apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]),+ seriesValue = valueItem.axis.get("labelFunction").apply(this, [valueItem.value, valueItem.axis.get("labelFormat")]);+ _yuitest_coverline("build/charts-base/charts-base.js", 13481);+msg.appendChild(DOCUMENT.createTextNode(categoryItem.displayName)); + _yuitest_coverline("build/charts-base/charts-base.js", 13482);+msg.appendChild(DOCUMENT.createTextNode(": ")); + _yuitest_coverline("build/charts-base/charts-base.js", 13483);+if(!Y_Lang.isObject(categoryValue))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13485);+categoryValue = DOCUMENT.createTextNode(categoryValue);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13487);+msg.appendChild(categoryValue);+ _yuitest_coverline("build/charts-base/charts-base.js", 13488);+msg.appendChild(DOCUMENT.createElement("br"));+ _yuitest_coverline("build/charts-base/charts-base.js", 13489);+msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName)); + _yuitest_coverline("build/charts-base/charts-base.js", 13490);+msg.appendChild(DOCUMENT.createTextNode(": ")); + _yuitest_coverline("build/charts-base/charts-base.js", 13491);+if(!Y_Lang.isObject(seriesValue))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13493);+seriesValue = DOCUMENT.createTextNode(seriesValue);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13495);+msg.appendChild(seriesValue);+ _yuitest_coverline("build/charts-base/charts-base.js", 13496);+return msg; + },++ /**+ * Event handler for the tooltipChange.+ *+ * @method _tooltipChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _tooltipChangeHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_tooltipChangeHandler", 13506);+_yuitest_coverline("build/charts-base/charts-base.js", 13508);+if(this.get("tooltip"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13510);+var tt = this.get("tooltip"),+ node = tt.node,+ show = tt.show,+ cb = this.get("contentBox");+ _yuitest_coverline("build/charts-base/charts-base.js", 13514);+if(node && show)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13516);+if(!cb.contains(node))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13518);+this._addTooltip();+ }+ }+ }+ },+ + /**+ * Updates the content of text field. This method writes a value into a text field using + * `appendChild`. If the value is a `String`, it is converted to a `TextNode` first. + *+ * @method _setText+ * @param label {HTMLElement} label to be updated+ * @param val {String} value with which to update the label+ * @private+ */+ _setText: function(textField, val)+ { + _yuitest_coverfunc("build/charts-base/charts-base.js", "_setText", 13533);+_yuitest_coverline("build/charts-base/charts-base.js", 13535);+textField.setContent("");+ _yuitest_coverline("build/charts-base/charts-base.js", 13536);+if(Y_Lang.isNumber(val))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13538);+val = val + "";+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 13540);+if(!val)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13542);+val = "";+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 13544);+if(IS_STRING(val))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13546);+val = DOCUMENT.createTextNode(val);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13548);+textField.appendChild(val);+ },++ /**+ * Returns all the keys contained in a `dataProvider`.+ *+ * @method _getAllKeys+ * @param {Array} dp Collection of objects to be parsed.+ * @return Object+ */+ _getAllKeys: function(dp)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getAllKeys", 13558);+_yuitest_coverline("build/charts-base/charts-base.js", 13560);+var i = 0,+ len = dp.length,+ item,+ key,+ keys = {};+ _yuitest_coverline("build/charts-base/charts-base.js", 13565);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13567);+item = dp[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 13568);+for(key in item)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13570);+if(item.hasOwnProperty(key))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13572);+keys[key] = true;+ }+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13576);+return keys;+ },+ + /**+ * Constructs seriesKeys if not explicitly specified.+ *+ * @method _buildSeriesKeys+ * @param {Array} dataProvider The dataProvider for the chart.+ * @return Array+ * @private+ */+ _buildSeriesKeys: function(dataProvider)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_buildSeriesKeys", 13587);+_yuitest_coverline("build/charts-base/charts-base.js", 13589);+var allKeys,+ catKey = this.get("categoryKey"),+ keys = [],+ i;+ _yuitest_coverline("build/charts-base/charts-base.js", 13593);+if(this._seriesKeysExplicitlySet)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13595);+return this._seriesKeys;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13597);+allKeys = this._getAllKeys(dataProvider);+ _yuitest_coverline("build/charts-base/charts-base.js", 13598);+for(i in allKeys)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13600);+if(allKeys.hasOwnProperty(i) && i != catKey)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13602);+keys.push(i);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13605);+return keys;+ }+};+_yuitest_coverline("build/charts-base/charts-base.js", 13608);+Y.ChartBase = ChartBase;+/**+ * The CartesianChart class creates a chart with horizontal and vertical axes.+ *+ * @module charts+ * @submodule charts-base+ * @class CartesianChart+ * @extends ChartBase+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 13618);+Y.CartesianChart = Y.Base.create("cartesianChart", Y.Widget, [Y.ChartBase], {+ /**+ * @method renderUI+ * @private+ */+ renderUI: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "renderUI", 13623);+_yuitest_coverline("build/charts-base/charts-base.js", 13625);+var bb = this.get("boundingBox"),+ cb = this.get("contentBox"),+ tt = this.get("tooltip"),+ overlay,+ overlayClass = _getClassName("overlay");+ //move the position = absolute logic to a class file+ _yuitest_coverline("build/charts-base/charts-base.js", 13631);+bb.setStyle("position", "absolute");+ _yuitest_coverline("build/charts-base/charts-base.js", 13632);+cb.setStyle("position", "absolute");+ _yuitest_coverline("build/charts-base/charts-base.js", 13633);+this._addAxes();+ _yuitest_coverline("build/charts-base/charts-base.js", 13634);+this._addGridlines();+ _yuitest_coverline("build/charts-base/charts-base.js", 13635);+this._addSeries();+ _yuitest_coverline("build/charts-base/charts-base.js", 13636);+if(tt && tt.show)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13638);+this._addTooltip();+ }+ //If there is a style definition. Force them to set.+ _yuitest_coverline("build/charts-base/charts-base.js", 13641);+this.get("styles");+ _yuitest_coverline("build/charts-base/charts-base.js", 13642);+if(this.get("interactionType") == "planar")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13644);+overlay = DOCUMENT.createElement("div");+ _yuitest_coverline("build/charts-base/charts-base.js", 13645);+this.get("contentBox").appendChild(overlay);+ _yuitest_coverline("build/charts-base/charts-base.js", 13646);+this._overlay = Y.one(overlay); + _yuitest_coverline("build/charts-base/charts-base.js", 13647);+this._overlay.set("id", this.get("id") + "_overlay");+ _yuitest_coverline("build/charts-base/charts-base.js", 13648);+this._overlay.setStyle("position", "absolute");+ _yuitest_coverline("build/charts-base/charts-base.js", 13649);+this._overlay.setStyle("background", "#fff");+ _yuitest_coverline("build/charts-base/charts-base.js", 13650);+this._overlay.setStyle("opacity", 0);+ _yuitest_coverline("build/charts-base/charts-base.js", 13651);+this._overlay.addClass(overlayClass);+ _yuitest_coverline("build/charts-base/charts-base.js", 13652);+this._overlay.setStyle("zIndex", 4);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13654);+this._setAriaElements(bb, cb);+ _yuitest_coverline("build/charts-base/charts-base.js", 13655);+this._redraw();+ },++ /**+ * When `interactionType` is set to `planar`, listens for mouse move events and fires `planarEvent:mouseover` or `planarEvent:mouseout` depending on the position of the mouse in relation to + * data points on the `Chart`.+ *+ * @method _planarEventDispatcher+ * @param {Object} e Event object.+ * @private+ */+ _planarEventDispatcher: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_planarEventDispatcher", 13666);+_yuitest_coverline("build/charts-base/charts-base.js", 13668);+var graph = this.get("graph"),+ bb = this.get("boundingBox"),+ cb = graph.get("contentBox"),+ isTouch = e && e.hasOwnProperty("changedTouches"),+ pageX = isTouch ? e.changedTouches[0].pageX : e.pageX,+ pageY = isTouch ? e.changedTouches[0].pageY : e.pageY,+ posX = pageX - bb.getX(),+ posY = pageY - bb.getY(),+ offset = {+ x: pageX - cb.getX(),+ y: pageY - cb.getY()+ },+ sc = graph.get("seriesCollection"),+ series,+ i = 0,+ index,+ oldIndex = this._selectedIndex,+ item,+ items = [],+ categoryItems = [],+ valueItems = [],+ direction = this.get("direction"),+ hasMarkers,+ catAxis,+ valAxis,+ coord,+ //data columns and area data could be created on a graph level+ markerPlane,+ len,+ coords;+ _yuitest_coverline("build/charts-base/charts-base.js", 13698);+e.halt(true);+ _yuitest_coverline("build/charts-base/charts-base.js", 13699);+if(direction == "horizontal")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13701);+catAxis = "x";+ _yuitest_coverline("build/charts-base/charts-base.js", 13702);+valAxis = "y";+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13706);+valAxis = "x";+ _yuitest_coverline("build/charts-base/charts-base.js", 13707);+catAxis = "y";+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13709);+coord = offset[catAxis];+ _yuitest_coverline("build/charts-base/charts-base.js", 13710);+if(sc)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13712);+len = sc.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 13713);+while(i < len && !markerPlane)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13715);+if(sc[i])+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13717);+markerPlane = sc[i].get(catAxis + "MarkerPlane");+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13719);+i++;+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13722);+if(markerPlane)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13724);+len = markerPlane.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 13725);+for(i = 0; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13727);+if(coord <= markerPlane[i].end && coord >= markerPlane[i].start)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13729);+index = i;+ _yuitest_coverline("build/charts-base/charts-base.js", 13730);+break;+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13733);+len = sc.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 13734);+for(i = 0; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13736);+series = sc[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 13737);+coords = series.get(valAxis + "coords");+ _yuitest_coverline("build/charts-base/charts-base.js", 13738);+hasMarkers = series.get("markers");+ _yuitest_coverline("build/charts-base/charts-base.js", 13739);+if(hasMarkers && !isNaN(oldIndex) && oldIndex > -1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13741);+series.updateMarkerState("mouseout", oldIndex);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13743);+if(coords && coords[index] > -1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13745);+if(hasMarkers && !isNaN(index) && index > -1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13747);+series.updateMarkerState("mouseover", index);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13749);+item = this.getSeriesItems(series, index);+ _yuitest_coverline("build/charts-base/charts-base.js", 13750);+categoryItems.push(item.category);+ _yuitest_coverline("build/charts-base/charts-base.js", 13751);+valueItems.push(item.value);+ _yuitest_coverline("build/charts-base/charts-base.js", 13752);+items.push(series);+ }+ + }+ _yuitest_coverline("build/charts-base/charts-base.js", 13756);+this._selectedIndex = index;++ /**+ * Broadcasts when `interactionType` is set to `planar` and a series' marker plane has received a mouseover event.+ * + *+ * @event planarEvent:mouseover+ * @preventable false+ * @param {EventFacade} e Event facade with the following additional+ * properties:+ * <dl>+ * <dt>categoryItem</dt><dd>An array of hashes, each containing information about the category `Axis` of each marker whose plane has been intersected.</dd>+ * <dt>valueItem</dt><dd>An array of hashes, each containing information about the value `Axis` of each marker whose plane has been intersected.</dd>+ * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>pageX</dt><dd>The x location of the event on the page (including scroll)</dd>+ * <dt>pageY</dt><dd>The y location of the event on the page (including scroll)</dd>+ * <dt>items</dt><dd>An array including all the series which contain a marker whose plane has been intersected.</dd>+ * <dt>index</dt><dd>Index of the markers in their respective series.</dd>+ * <dt>originEvent</dt><dd>Underlying dom event.</dd>+ * </dl>+ */+ /**+ * Broadcasts when `interactionType` is set to `planar` and a series' marker plane has received a mouseout event.+ *+ * @event planarEvent:mouseout+ * @preventable false+ * @param {EventFacade} e + */+ _yuitest_coverline("build/charts-base/charts-base.js", 13785);+if(index > -1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13787);+this.fire("planarEvent:mouseover", {+ categoryItem:categoryItems, + valueItem:valueItems, + x:posX, + y:posY, + pageX:pageX,+ pageY:pageY,+ items:items, + index:index,+ originEvent:e+ });+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13801);+this.fire("planarEvent:mouseout");+ }+ }+ },++ /**+ * Indicates the default series type for the chart.+ *+ * @property _type+ * @type {String}+ * @private+ */+ _type: "combo",++ /**+ * Queue of axes instances that will be updated. This method is used internally to determine when all axes have been updated.+ *+ * @property _itemRenderQueue+ * @type Array+ * @private+ */+ _itemRenderQueue: null,++ /**+ * Adds an `Axis` instance to the `_itemRenderQueue`.+ *+ * @method _addToAxesRenderQueue+ * @param {Axis} axis An `Axis` instance.+ * @private + */+ _addToAxesRenderQueue: function(axis)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_addToAxesRenderQueue", 13831);+_yuitest_coverline("build/charts-base/charts-base.js", 13833);+if(!this._itemRenderQueue)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13835);+this._itemRenderQueue = [];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13837);+if(Y.Array.indexOf(this._itemRenderQueue, axis) < 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13839);+this._itemRenderQueue.push(axis);+ }+ },++ /**+ * Adds axis instance to the appropriate array based on position+ *+ * @method _addToAxesCollection+ * @param {String} position The position of the axis+ * @param {Axis} axis The `Axis` instance+ */+ _addToAxesCollection: function(position, axis)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_addToAxesCollection", 13850);+_yuitest_coverline("build/charts-base/charts-base.js", 13852);+var axesCollection = this.get(position + "AxesCollection");+ _yuitest_coverline("build/charts-base/charts-base.js", 13853);+if(!axesCollection)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13855);+axesCollection = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 13856);+this.set(position + "AxesCollection", axesCollection);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13858);+axesCollection.push(axis);+ },++ /**+ * Returns the default value for the `seriesCollection` attribute.+ *+ * @method _getDefaultSeriesCollection+ * @param {Array} val Array containing either `CartesianSeries` instances or objects containing data to construct series instances.+ * @return Array+ * @private+ */+ _getDefaultSeriesCollection: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultSeriesCollection", 13869);+_yuitest_coverline("build/charts-base/charts-base.js", 13871);+var seriesCollection,+ dataProvider = this.get("dataProvider");+ _yuitest_coverline("build/charts-base/charts-base.js", 13873);+if(dataProvider)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13875);+seriesCollection = this._parseSeriesCollection();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13877);+return seriesCollection;+ },++ /**+ * Parses and returns a series collection from an object and default properties.+ *+ * @method _parseSeriesCollection+ * @param {Object} val Object contain properties for series being set.+ * @return Object+ * @private+ */+ _parseSeriesCollection: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_parseSeriesCollection", 13888);+_yuitest_coverline("build/charts-base/charts-base.js", 13890);+var dir = this.get("direction"), + sc = [], + catAxis,+ valAxis,+ tempKeys = [],+ series,+ seriesKeys = this.get("seriesKeys").concat(),+ i,+ index,+ l,+ type = this.get("type"),+ key,+ catKey,+ seriesKey,+ graph,+ orphans = [],+ categoryKey = this.get("categoryKey"),+ showMarkers = this.get("showMarkers"),+ showAreaFill = this.get("showAreaFill"),+ showLines = this.get("showLines");+ _yuitest_coverline("build/charts-base/charts-base.js", 13910);+val = val || []; + _yuitest_coverline("build/charts-base/charts-base.js", 13911);+if(dir == "vertical")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13913);+catAxis = "yAxis";+ _yuitest_coverline("build/charts-base/charts-base.js", 13914);+catKey = "yKey";+ _yuitest_coverline("build/charts-base/charts-base.js", 13915);+valAxis = "xAxis";+ _yuitest_coverline("build/charts-base/charts-base.js", 13916);+seriesKey = "xKey";+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13920);+catAxis = "xAxis";+ _yuitest_coverline("build/charts-base/charts-base.js", 13921);+catKey = "xKey";+ _yuitest_coverline("build/charts-base/charts-base.js", 13922);+valAxis = "yAxis";+ _yuitest_coverline("build/charts-base/charts-base.js", 13923);+seriesKey = "yKey";+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13925);+l = val.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 13926);+while(val && val.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13928);+series = val.shift();+ _yuitest_coverline("build/charts-base/charts-base.js", 13929);+key = this._getBaseAttribute(series, seriesKey);+ _yuitest_coverline("build/charts-base/charts-base.js", 13930);+if(key)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13932);+index = Y.Array.indexOf(seriesKeys, key);+ _yuitest_coverline("build/charts-base/charts-base.js", 13933);+if(index > -1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13935);+seriesKeys.splice(index, 1);+ _yuitest_coverline("build/charts-base/charts-base.js", 13936);+tempKeys.push(key);+ _yuitest_coverline("build/charts-base/charts-base.js", 13937);+sc.push(series);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13941);+orphans.push(series);+ }+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13946);+orphans.push(series);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13949);+while(orphans.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13951);+series = orphans.shift();+ _yuitest_coverline("build/charts-base/charts-base.js", 13952);+if(seriesKeys.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13954);+key = seriesKeys.shift();+ _yuitest_coverline("build/charts-base/charts-base.js", 13955);+this._setBaseAttribute(series, seriesKey, key);+ _yuitest_coverline("build/charts-base/charts-base.js", 13956);+tempKeys.push(key);+ _yuitest_coverline("build/charts-base/charts-base.js", 13957);+sc.push(series);+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 13959);+if(series instanceof Y.CartesianSeries)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13961);+series.destroy(true);+ }}+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13964);+if(seriesKeys.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13966);+tempKeys = tempKeys.concat(seriesKeys);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13968);+l = tempKeys.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 13969);+for(i = 0; i < l; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13971);+series = sc[i] || {type:type};+ _yuitest_coverline("build/charts-base/charts-base.js", 13972);+if(series instanceof Y.CartesianSeries)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13974);+this._parseSeriesAxes(series);+ _yuitest_coverline("build/charts-base/charts-base.js", 13975);+continue;+ }++ _yuitest_coverline("build/charts-base/charts-base.js", 13978);+series[catKey] = series[catKey] || categoryKey;+ _yuitest_coverline("build/charts-base/charts-base.js", 13979);+series[seriesKey] = series[seriesKey] || seriesKeys.shift();+ _yuitest_coverline("build/charts-base/charts-base.js", 13980);+series[catAxis] = this._getCategoryAxis();+ _yuitest_coverline("build/charts-base/charts-base.js", 13981);+series[valAxis] = this._getSeriesAxis(series[seriesKey]);+ + _yuitest_coverline("build/charts-base/charts-base.js", 13983);+series.type = series.type || type;+ _yuitest_coverline("build/charts-base/charts-base.js", 13984);+series.direction = series.direction || dir;+ + _yuitest_coverline("build/charts-base/charts-base.js", 13986);+if((series.type == "combo" || series.type == "stackedcombo" || series.type == "combospline" || series.type == "stackedcombospline"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13988);+if(showAreaFill !== null)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13990);+series.showAreaFill = (series.showAreaFill !== null && series.showAreaFill !== undefined) ? series.showAreaFill : showAreaFill;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13992);+if(showMarkers !== null)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13994);+series.showMarkers = (series.showMarkers !== null && series.showMarkers !== undefined) ? series.showMarkers : showMarkers;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 13996);+if(showLines !== null)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 13998);+series.showLines = (series.showLines !== null && series.showLines !== undefined) ? series.showLines : showLines;+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14001);+sc[i] = series;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14003);+if(sc)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14005);+graph = this.get("graph");+ _yuitest_coverline("build/charts-base/charts-base.js", 14006);+graph.set("seriesCollection", sc);+ _yuitest_coverline("build/charts-base/charts-base.js", 14007);+sc = graph.get("seriesCollection");+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14009);+return sc;+ },++ /**+ * Parse and sets the axes for a series instance.+ *+ * @method _parseSeriesAxes+ * @param {CartesianSeries} series A `CartesianSeries` instance.+ * @private+ */+ _parseSeriesAxes: function(series)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_parseSeriesAxes", 14019);+_yuitest_coverline("build/charts-base/charts-base.js", 14021);+var axes = this.get("axes"),+ xAxis = series.get("xAxis"),+ yAxis = series.get("yAxis"),+ YAxis = Y.Axis,+ axis;+ _yuitest_coverline("build/charts-base/charts-base.js", 14026);+if(xAxis && !(xAxis instanceof YAxis) && Y_Lang.isString(xAxis) && axes.hasOwnProperty(xAxis))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14028);+axis = axes[xAxis];+ _yuitest_coverline("build/charts-base/charts-base.js", 14029);+if(axis instanceof YAxis)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14031);+series.set("xAxis", axis);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14034);+if(yAxis && !(yAxis instanceof YAxis) && Y_Lang.isString(yAxis) && axes.hasOwnProperty(yAxis))+ { + _yuitest_coverline("build/charts-base/charts-base.js", 14036);+axis = axes[yAxis];+ _yuitest_coverline("build/charts-base/charts-base.js", 14037);+if(axis instanceof YAxis)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14039);+series.set("yAxis", axis);+ }+ }++ },++ /**+ * Returns the category axis instance for the chart.+ *+ * @method _getCategoryAxis+ * @return Axis+ * @private+ */+ _getCategoryAxis: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getCategoryAxis", 14052);+_yuitest_coverline("build/charts-base/charts-base.js", 14054);+var axis,+ axes = this.get("axes"),+ categoryAxisName = this.get("categoryAxisName") || this.get("categoryKey");+ _yuitest_coverline("build/charts-base/charts-base.js", 14057);+axis = axes[categoryAxisName];+ _yuitest_coverline("build/charts-base/charts-base.js", 14058);+return axis;+ },++ /**+ * Returns the value axis for a series.+ *+ * @method _getSeriesAxis+ * @param {String} key The key value used to determine the axis instance.+ * @return Axis+ * @private+ */+ _getSeriesAxis:function(key, axisName)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getSeriesAxis", 14069);+_yuitest_coverline("build/charts-base/charts-base.js", 14071);+var axes = this.get("axes"),+ i,+ keys,+ axis;+ _yuitest_coverline("build/charts-base/charts-base.js", 14075);+if(axes)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14077);+if(axisName && axes.hasOwnProperty(axisName))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14079);+axis = axes[axisName];+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14083);+for(i in axes)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14085);+if(axes.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14087);+keys = axes[i].get("keys");+ _yuitest_coverline("build/charts-base/charts-base.js", 14088);+if(keys && keys.hasOwnProperty(key))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14090);+axis = axes[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 14091);+break;+ }+ }+ }+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14097);+return axis;+ },++ /**+ * Gets an attribute from an object, using a getter for Base objects and a property for object+ * literals. Used for determining attributes from series/axis references which can be an actual class instance+ * or a hash of properties that will be used to create a class instance.+ *+ * @method _getBaseAttribute+ * @param {Object} item Object or instance in which the attribute resides.+ * @param {String} key Attribute whose value will be returned.+ * @return Object+ * @private+ */+ _getBaseAttribute: function(item, key)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getBaseAttribute", 14111);+_yuitest_coverline("build/charts-base/charts-base.js", 14113);+if(item instanceof Y.Base)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14115);+return item.get(key);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14117);+if(item.hasOwnProperty(key))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14119);+return item[key];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14121);+return null;+ },++ /**+ * Sets an attribute on an object, using a setter of Base objects and a property for object+ * literals. Used for setting attributes on a Base class, either directly or to be stored in an object literal+ * for use at instantiation.+ *+ * @method _setBaseAttribute+ * @param {Object} item Object or instance in which the attribute resides.+ * @param {String} key Attribute whose value will be assigned.+ * @param {Object} value Value to be assigned to the attribute.+ * @private+ */+ _setBaseAttribute: function(item, key, value)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setBaseAttribute", 14135);+_yuitest_coverline("build/charts-base/charts-base.js", 14137);+if(item instanceof Y.Base)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14139);+item.set(key, value);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14143);+item[key] = value;+ }+ },++ /**+ * Creates `Axis` instances.+ *+ * @method _setAxes+ * @param {Object} val Object containing `Axis` instances or objects in which to construct `Axis` instances.+ * @return Object+ * @private+ */+ _setAxes: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_setAxes", 14155);+_yuitest_coverline("build/charts-base/charts-base.js", 14157);+var hash = this._parseAxes(val),+ axes = {},+ axesAttrs = {+ edgeOffset: "edgeOffset", + position: "position",+ overlapGraph:"overlapGraph",+ labelFunction:"labelFunction",+ labelFunctionScope:"labelFunctionScope",+ labelFormat:"labelFormat",+ appendLabelFunction: "appendLabelFunction",+ appendTitleFunction: "appendTitleFunction",+ maximum:"maximum",+ minimum:"minimum", + roundingMethod:"roundingMethod",+ alwaysShowZero:"alwaysShowZero",+ title:"title",+ width:"width",+ height:"height"+ },+ dp = this.get("dataProvider"),+ ai,+ i, + pos, + axis,+ axisPosition,+ dh, + axisClass, + config,+ axesCollection;+ _yuitest_coverline("build/charts-base/charts-base.js", 14186);+for(i in hash)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14188);+if(hash.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14190);+dh = hash[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 14191);+if(dh instanceof Y.Axis)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14193);+axis = dh;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14197);+axis = null;+ _yuitest_coverline("build/charts-base/charts-base.js", 14198);+config = {};+ _yuitest_coverline("build/charts-base/charts-base.js", 14199);+config.dataProvider = dh.dataProvider || dp;+ _yuitest_coverline("build/charts-base/charts-base.js", 14200);+config.keys = dh.keys;+ + _yuitest_coverline("build/charts-base/charts-base.js", 14202);+if(dh.hasOwnProperty("roundingUnit"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14204);+config.roundingUnit = dh.roundingUnit;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14206);+pos = dh.position;+ _yuitest_coverline("build/charts-base/charts-base.js", 14207);+if(dh.styles)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14209);+config.styles = dh.styles;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14211);+config.position = dh.position;+ _yuitest_coverline("build/charts-base/charts-base.js", 14212);+for(ai in axesAttrs)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14214);+if(axesAttrs.hasOwnProperty(ai) && dh.hasOwnProperty(ai))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14216);+config[ai] = dh[ai];+ }+ }+ + //only check for existing axis if we constructed the default axes already+ _yuitest_coverline("build/charts-base/charts-base.js", 14221);+if(val)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14223);+axis = this.getAxisByKey(i);+ }+ + _yuitest_coverline("build/charts-base/charts-base.js", 14226);+if(axis && axis instanceof Y.Axis)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14228);+axisPosition = axis.get("position");+ _yuitest_coverline("build/charts-base/charts-base.js", 14229);+if(pos != axisPosition)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14231);+if(axisPosition != "none")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14233);+axesCollection = this.get(axisPosition + "AxesCollection");+ _yuitest_coverline("build/charts-base/charts-base.js", 14234);+axesCollection.splice(Y.Array.indexOf(axesCollection, axis), 1);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14236);+if(pos != "none")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14238);+this._addToAxesCollection(pos, axis);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14241);+axis.setAttrs(config);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14245);+axisClass = this._getAxisClass(dh.type);+ _yuitest_coverline("build/charts-base/charts-base.js", 14246);+axis = new axisClass(config);+ _yuitest_coverline("build/charts-base/charts-base.js", 14247);+axis.after("axisRendered", Y.bind(this._itemRendered, this));+ }+ }++ _yuitest_coverline("build/charts-base/charts-base.js", 14251);+if(axis)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14253);+axesCollection = this.get(pos + "AxesCollection");+ _yuitest_coverline("build/charts-base/charts-base.js", 14254);+if(axesCollection && Y.Array.indexOf(axesCollection, axis) > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14256);+axis.set("overlapGraph", false);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14258);+axes[i] = axis;+ }+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14262);+return axes;+ },+ + /**+ * Adds axes to the chart.+ *+ * @method _addAxes+ * @private+ */+ _addAxes: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_addAxes", 14271);+_yuitest_coverline("build/charts-base/charts-base.js", 14273);+var axes = this.get("axes"),+ i, + axis, + pos,+ w = this.get("width"),+ h = this.get("height"),+ node = Y.Node.one(this._parentNode);+ _yuitest_coverline("build/charts-base/charts-base.js", 14280);+if(!this._axesCollection)+ { + _yuitest_coverline("build/charts-base/charts-base.js", 14282);+this._axesCollection = [];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14284);+for(i in axes)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14286);+if(axes.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14288);+axis = axes[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 14289);+if(axis instanceof Y.Axis)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14291);+if(!w)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14293);+this.set("width", node.get("offsetWidth"));+ _yuitest_coverline("build/charts-base/charts-base.js", 14294);+w = this.get("width");+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14296);+if(!h)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14298);+this.set("height", node.get("offsetHeight"));+ _yuitest_coverline("build/charts-base/charts-base.js", 14299);+h = this.get("height");+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14301);+this._addToAxesRenderQueue(axis);+ _yuitest_coverline("build/charts-base/charts-base.js", 14302);+pos = axis.get("position");+ _yuitest_coverline("build/charts-base/charts-base.js", 14303);+if(!this.get(pos + "AxesCollection"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14305);+this.set(pos + "AxesCollection", [axis]);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14309);+this.get(pos + "AxesCollection").push(axis);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14311);+this._axesCollection.push(axis);+ _yuitest_coverline("build/charts-base/charts-base.js", 14312);+if(axis.get("keys").hasOwnProperty(this.get("categoryKey")))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14314);+this.set("categoryAxis", axis);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14316);+axis.render(this.get("contentBox"));+ }+ }+ }+ },++ /**+ * Renders the Graph.+ *+ * @method _addSeries+ * @private+ */+ _addSeries: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_addSeries", 14328);+_yuitest_coverline("build/charts-base/charts-base.js", 14330);+var graph = this.get("graph"),+ sc = this.get("seriesCollection");+ _yuitest_coverline("build/charts-base/charts-base.js", 14332);+graph.render(this.get("contentBox"));++ },++ /**+ * Adds gridlines to the chart.+ *+ * @method _addGridlines+ * @private+ */+ _addGridlines: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_addGridlines", 14342);+_yuitest_coverline("build/charts-base/charts-base.js", 14344);+var graph = this.get("graph"),+ hgl = this.get("horizontalGridlines"),+ vgl = this.get("verticalGridlines"),+ direction = this.get("direction"),+ leftAxesCollection = this.get("leftAxesCollection"),+ rightAxesCollection = this.get("rightAxesCollection"),+ bottomAxesCollection = this.get("bottomAxesCollection"),+ topAxesCollection = this.get("topAxesCollection"),+ seriesAxesCollection,+ catAxis = this.get("categoryAxis"),+ hAxis,+ vAxis;+ _yuitest_coverline("build/charts-base/charts-base.js", 14356);+if(this._axesCollection)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14358);+seriesAxesCollection = this._axesCollection.concat();+ _yuitest_coverline("build/charts-base/charts-base.js", 14359);+seriesAxesCollection.splice(Y.Array.indexOf(seriesAxesCollection, catAxis), 1);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14361);+if(hgl)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14363);+if(leftAxesCollection && leftAxesCollection[0])+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14365);+hAxis = leftAxesCollection[0];+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 14367);+if(rightAxesCollection && rightAxesCollection[0])+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14369);+hAxis = rightAxesCollection[0];+ }+ else + {+ _yuitest_coverline("build/charts-base/charts-base.js", 14373);+hAxis = direction == "horizontal" ? catAxis : seriesAxesCollection[0];+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 14375);+if(!this._getBaseAttribute(hgl, "axis") && hAxis)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14377);+this._setBaseAttribute(hgl, "axis", hAxis);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14379);+if(this._getBaseAttribute(hgl, "axis"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14381);+graph.set("horizontalGridlines", hgl);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14384);+if(vgl)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14386);+if(bottomAxesCollection && bottomAxesCollection[0])+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14388);+vAxis = bottomAxesCollection[0];+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 14390);+if (topAxesCollection && topAxesCollection[0])+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14392);+vAxis = topAxesCollection[0];+ }+ else + {+ _yuitest_coverline("build/charts-base/charts-base.js", 14396);+vAxis = direction == "vertical" ? catAxis : seriesAxesCollection[0];+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 14398);+if(!this._getBaseAttribute(vgl, "axis") && vAxis)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14400);+this._setBaseAttribute(vgl, "axis", vAxis);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14402);+if(this._getBaseAttribute(vgl, "axis"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14404);+graph.set("verticalGridlines", vgl);+ }+ }+ },+ + /**+ * Default Function for the axes attribute.+ *+ * @method _getDefaultAxes+ * @return Object+ * @private+ */+ _getDefaultAxes: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultAxes", 14416);+_yuitest_coverline("build/charts-base/charts-base.js", 14418);+var axes;+ _yuitest_coverline("build/charts-base/charts-base.js", 14419);+if(this.get("dataProvider"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14421);+axes = this._parseAxes();+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14423);+return axes;+ },++ /**+ * Generates and returns a key-indexed object containing `Axis` instances or objects used to create `Axis` instances.+ *+ * @method _parseAxes+ * @param {Object} axes Object containing `Axis` instances or `Axis` attributes.+ * @return Object+ * @private+ */+ _parseAxes: function(axes)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_parseAxes", 14434);+_yuitest_coverline("build/charts-base/charts-base.js", 14436);+var catKey = this.get("categoryKey"),+ axis,+ attr,+ keys,+ newAxes = {},+ claimedKeys = [],+ categoryAxisName = this.get("categoryAxisName") || this.get("categoryKey"),+ valueAxisName = this.get("valueAxisName"),+ seriesKeys = this.get("seriesKeys").concat(),+ i, + l,+ ii,+ ll,+ cIndex,+ direction = this.get("direction"),+ seriesPosition,+ categoryPosition,+ valueAxes = [],+ seriesAxis = this.get("stacked") ? "stacked" : "numeric";+ _yuitest_coverline("build/charts-base/charts-base.js", 14455);+if(direction == "vertical")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14457);+seriesPosition = "bottom";+ _yuitest_coverline("build/charts-base/charts-base.js", 14458);+categoryPosition = "left";+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14462);+seriesPosition = "left";+ _yuitest_coverline("build/charts-base/charts-base.js", 14463);+categoryPosition = "bottom";+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14465);+if(axes)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14467);+for(i in axes)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14469);+if(axes.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14471);+axis = axes[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 14472);+keys = this._getBaseAttribute(axis, "keys");+ _yuitest_coverline("build/charts-base/charts-base.js", 14473);+attr = this._getBaseAttribute(axis, "type");+ _yuitest_coverline("build/charts-base/charts-base.js", 14474);+if(attr == "time" || attr == "category")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14476);+categoryAxisName = i;+ _yuitest_coverline("build/charts-base/charts-base.js", 14477);+this.set("categoryAxisName", i);+ _yuitest_coverline("build/charts-base/charts-base.js", 14478);+if(Y_Lang.isArray(keys) && keys.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14480);+catKey = keys[0];+ _yuitest_coverline("build/charts-base/charts-base.js", 14481);+this.set("categoryKey", catKey);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14483);+newAxes[i] = axis;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 14485);+if(i == categoryAxisName)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14487);+newAxes[i] = axis;+ }+ else + {+ _yuitest_coverline("build/charts-base/charts-base.js", 14491);+newAxes[i] = axis;+ _yuitest_coverline("build/charts-base/charts-base.js", 14492);+if(i != valueAxisName && keys && Y_Lang.isArray(keys))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14494);+ll = keys.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 14495);+for(ii = 0; ii < ll; ++ii)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14497);+claimedKeys.push(keys[ii]);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14499);+valueAxes.push(newAxes[i]);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14501);+if(!(this._getBaseAttribute(newAxes[i], "type")))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14503);+this._setBaseAttribute(newAxes[i], "type", seriesAxis);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14505);+if(!(this._getBaseAttribute(newAxes[i], "position")))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14507);+this._setBaseAttribute(newAxes[i], "position", this._getDefaultAxisPosition(newAxes[i], valueAxes, seriesPosition));+ }+ }}+ }+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14513);+cIndex = Y.Array.indexOf(seriesKeys, catKey);+ _yuitest_coverline("build/charts-base/charts-base.js", 14514);+if(cIndex > -1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14516);+seriesKeys.splice(cIndex, 1);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14518);+l = claimedKeys.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 14519);+for(i = 0; i < l; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14521);+cIndex = Y.Array.indexOf(seriesKeys, claimedKeys[i]); + _yuitest_coverline("build/charts-base/charts-base.js", 14522);+if(cIndex > -1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14524);+seriesKeys.splice(cIndex, 1);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14527);+if(!newAxes.hasOwnProperty(categoryAxisName))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14529);+newAxes[categoryAxisName] = {};+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14531);+if(!(this._getBaseAttribute(newAxes[categoryAxisName], "keys")))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14533);+this._setBaseAttribute(newAxes[categoryAxisName], "keys", [catKey]);+ }+ + _yuitest_coverline("build/charts-base/charts-base.js", 14536);+if(!(this._getBaseAttribute(newAxes[categoryAxisName], "position")))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14538);+this._setBaseAttribute(newAxes[categoryAxisName], "position", categoryPosition);+ }+ + _yuitest_coverline("build/charts-base/charts-base.js", 14541);+if(!(this._getBaseAttribute(newAxes[categoryAxisName], "type")))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14543);+this._setBaseAttribute(newAxes[categoryAxisName], "type", this.get("categoryType"));+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14545);+if(!newAxes.hasOwnProperty(valueAxisName) && seriesKeys && seriesKeys.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14547);+newAxes[valueAxisName] = {keys:seriesKeys};+ _yuitest_coverline("build/charts-base/charts-base.js", 14548);+valueAxes.push(newAxes[valueAxisName]);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14550);+if(claimedKeys.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14552);+if(seriesKeys.length > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14554);+seriesKeys = claimedKeys.concat(seriesKeys);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14558);+seriesKeys = claimedKeys;+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14561);+if(newAxes.hasOwnProperty(valueAxisName))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14563);+if(!(this._getBaseAttribute(newAxes[valueAxisName], "position")))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14565);+this._setBaseAttribute(newAxes[valueAxisName], "position", this._getDefaultAxisPosition(newAxes[valueAxisName], valueAxes, seriesPosition));+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14567);+this._setBaseAttribute(newAxes[valueAxisName], "type", seriesAxis);+ _yuitest_coverline("build/charts-base/charts-base.js", 14568);+this._setBaseAttribute(newAxes[valueAxisName], "keys", seriesKeys);+ } + _yuitest_coverline("build/charts-base/charts-base.js", 14570);+if(!this._seriesKeysExplicitlySet)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14572);+this._seriesKeys = seriesKeys;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14574);+return newAxes;+ },++ /**+ * Determines the position of an axis when one is not specified.+ *+ * @method _getDefaultAxisPosition+ * @param {Axis} axis `Axis` instance.+ * @param {Array} valueAxes Array of `Axis` instances.+ * @param {String} position Default position depending on the direction of the chart and type of axis.+ * @return String+ * @private+ */+ _getDefaultAxisPosition: function(axis, valueAxes, position)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultAxisPosition", 14587);+_yuitest_coverline("build/charts-base/charts-base.js", 14589);+var direction = this.get("direction"),+ i = Y.Array.indexOf(valueAxes, axis);+ + _yuitest_coverline("build/charts-base/charts-base.js", 14592);+if(valueAxes[i - 1] && valueAxes[i - 1].position)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14594);+if(direction == "horizontal")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14596);+if(valueAxes[i - 1].position == "left")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14598);+position = "right";+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 14600);+if(valueAxes[i - 1].position == "right")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14602);+position = "left";+ }}+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14607);+if (valueAxes[i -1].position == "bottom")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14609);+position = "top";+ } + else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14613);+position = "bottom";+ }+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14617);+return position;+ },++ + /**+ * Returns an object literal containing a categoryItem and a valueItem for a given series index. Below is the structure of each:+ * + * @method getSeriesItems+ * @param {CartesianSeries} series Reference to a series.+ * @param {Number} index Index of the specified item within a series.+ * @return Object An object literal containing the following:+ *+ * <dl>+ * <dt>categoryItem</dt><dd>Object containing the following data related to the category axis of the series.+ * <dl>+ * <dt>axis</dt><dd>Reference to the category axis of the series.</dd>+ * <dt>key</dt><dd>Category key for the series.</dd>+ * <dt>value</dt><dd>Value on the axis corresponding to the series index.</dd>+ * </dl>+ * </dd>+ * <dt>valueItem</dt><dd>Object containing the following data related to the category axis of the series.+ * <dl>+ * <dt>axis</dt><dd>Reference to the value axis of the series.</dd>+ * <dt>key</dt><dd>Value key for the series.</dd>+ * <dt>value</dt><dd>Value on the axis corresponding to the series index.</dd>+ * </dl>+ * </dd>+ * </dl>+ */+ getSeriesItems: function(series, index)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getSeriesItems", 14646);+_yuitest_coverline("build/charts-base/charts-base.js", 14648);+var xAxis = series.get("xAxis"),+ yAxis = series.get("yAxis"),+ xKey = series.get("xKey"),+ yKey = series.get("yKey"),+ categoryItem,+ valueItem;+ _yuitest_coverline("build/charts-base/charts-base.js", 14654);+if(this.get("direction") == "vertical")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14656);+categoryItem = {+ axis:yAxis,+ key:yKey,+ value:yAxis.getKeyValueAt(yKey, index)+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 14661);+valueItem = {+ axis:xAxis,+ key:xKey,+ value: xAxis.getKeyValueAt(xKey, index)+ };+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14669);+valueItem = {+ axis:yAxis,+ key:yKey,+ value:yAxis.getKeyValueAt(yKey, index)+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 14674);+categoryItem = {+ axis:xAxis,+ key:xKey,+ value: xAxis.getKeyValueAt(xKey, index)+ };+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14680);+categoryItem.displayName = series.get("categoryDisplayName");+ _yuitest_coverline("build/charts-base/charts-base.js", 14681);+valueItem.displayName = series.get("valueDisplayName");+ _yuitest_coverline("build/charts-base/charts-base.js", 14682);+categoryItem.value = categoryItem.axis.getKeyValueAt(categoryItem.key, index);+ _yuitest_coverline("build/charts-base/charts-base.js", 14683);+valueItem.value = valueItem.axis.getKeyValueAt(valueItem.key, index);+ _yuitest_coverline("build/charts-base/charts-base.js", 14684);+return {category:categoryItem, value:valueItem};+ },++ /**+ * Handler for sizeChanged event.+ *+ * @method _sizeChanged+ * @param {Object} e Event object.+ * @private+ */+ _sizeChanged: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_sizeChanged", 14694);+_yuitest_coverline("build/charts-base/charts-base.js", 14696);+if(this._axesCollection)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14698);+var ac = this._axesCollection,+ i = 0,+ l = ac.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 14701);+for(; i < l; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14703);+this._addToAxesRenderQueue(ac[i]);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14705);+this._redraw();+ }+ },+ + /**+ * Returns the maximum distance in pixels that the extends outside the top bounds of all vertical axes.+ *+ * @method _getTopOverflow+ * @param {Array} set1 Collection of axes to check.+ * @param {Array} set2 Seconf collection of axes to check.+ * @param {Number} width Width of the axes+ * @return Number+ * @private+ */+ _getTopOverflow: function(set1, set2, height)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getTopOverflow", 14719);+_yuitest_coverline("build/charts-base/charts-base.js", 14721);+var i = 0,+ len,+ overflow = 0,+ axis;+ _yuitest_coverline("build/charts-base/charts-base.js", 14725);+if(set1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14727);+len = set1.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 14728);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14730);+axis = set1[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 14731);+overflow = Math.max(overflow, Math.abs(axis.getMaxLabelBounds().top) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14734);+if(set2)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14736);+i = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 14737);+len = set2.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 14738);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14740);+axis = set2[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 14741);+overflow = Math.max(overflow, Math.abs(axis.getMaxLabelBounds().top) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14744);+return overflow;+ },+ + /**+ * Returns the maximum distance in pixels that the extends outside the right bounds of all horizontal axes.+ *+ * @method _getRightOverflow+ * @param {Array} set1 Collection of axes to check.+ * @param {Array} set2 Seconf collection of axes to check.+ * @param {Number} width Width of the axes+ * @return Number+ * @private+ */+ _getRightOverflow: function(set1, set2, width)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getRightOverflow", 14757);+_yuitest_coverline("build/charts-base/charts-base.js", 14759);+var i = 0,+ len,+ overflow = 0,+ axis;+ _yuitest_coverline("build/charts-base/charts-base.js", 14763);+if(set1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14765);+len = set1.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 14766);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14768);+axis = set1[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 14769);+overflow = Math.max(overflow, axis.getMaxLabelBounds().right - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14772);+if(set2)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14774);+i = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 14775);+len = set2.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 14776);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14778);+axis = set2[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 14779);+overflow = Math.max(overflow, axis.getMaxLabelBounds().right - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14782);+return overflow;+ },+ + /**+ * Returns the maximum distance in pixels that the extends outside the left bounds of all horizontal axes.+ *+ * @method _getLeftOverflow+ * @param {Array} set1 Collection of axes to check.+ * @param {Array} set2 Seconf collection of axes to check.+ * @param {Number} width Width of the axes+ * @return Number+ * @private+ */+ _getLeftOverflow: function(set1, set2, width)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getLeftOverflow", 14795);+_yuitest_coverline("build/charts-base/charts-base.js", 14797);+var i = 0,+ len,+ overflow = 0,+ axis;+ _yuitest_coverline("build/charts-base/charts-base.js", 14801);+if(set1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14803);+len = set1.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 14804);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14806);+axis = set1[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 14807);+overflow = Math.max(overflow, Math.abs(axis.getMinLabelBounds().left) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14810);+if(set2)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14812);+i = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 14813);+len = set2.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 14814);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14816);+axis = set2[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 14817);+overflow = Math.max(overflow, Math.abs(axis.getMinLabelBounds().left) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14820);+return overflow;+ },+ + /**+ * Returns the maximum distance in pixels that the extends outside the bottom bounds of all vertical axes.+ *+ * @method _getBottomOverflow+ * @param {Array} set1 Collection of axes to check.+ * @param {Array} set2 Seconf collection of axes to check.+ * @param {Number} height Height of the axes+ * @return Number+ * @private+ */+ _getBottomOverflow: function(set1, set2, height)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getBottomOverflow", 14833);+_yuitest_coverline("build/charts-base/charts-base.js", 14835);+var i = 0,+ len,+ overflow = 0,+ axis;+ _yuitest_coverline("build/charts-base/charts-base.js", 14839);+if(set1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14841);+len = set1.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 14842);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14844);+axis = set1[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 14845);+overflow = Math.max(overflow, axis.getMinLabelBounds().bottom - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14848);+if(set2)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14850);+i = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 14851);+len = set2.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 14852);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14854);+axis = set2[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 14855);+overflow = Math.max(overflow, axis.getMinLabelBounds().bottom - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14858);+return overflow;+ },++ /**+ * Redraws and position all the components of the chart instance.+ *+ * @method _redraw+ * @private+ */+ _redraw: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_redraw", 14867);+_yuitest_coverline("build/charts-base/charts-base.js", 14869);+if(this._drawing)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14871);+this._callLater = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 14872);+return;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14874);+this._drawing = true;+ _yuitest_coverline("build/charts-base/charts-base.js", 14875);+this._callLater = false;+ _yuitest_coverline("build/charts-base/charts-base.js", 14876);+var w = this.get("width"),+ h = this.get("height"),+ leftPaneWidth = 0,+ rightPaneWidth = 0,+ topPaneHeight = 0,+ bottomPaneHeight = 0,+ leftAxesCollection = this.get("leftAxesCollection"),+ rightAxesCollection = this.get("rightAxesCollection"),+ topAxesCollection = this.get("topAxesCollection"),+ bottomAxesCollection = this.get("bottomAxesCollection"),+ i = 0,+ l,+ axis,+ graphOverflow = "visible",+ graph = this.get("graph"),+ topOverflow,+ bottomOverflow,+ leftOverflow,+ rightOverflow,+ graphWidth,+ graphHeight,+ graphX,+ graphY,+ allowContentOverflow = this.get("allowContentOverflow"),+ diff,+ rightAxesXCoords,+ leftAxesXCoords,+ topAxesYCoords,+ bottomAxesYCoords,+ graphRect = {};+ _yuitest_coverline("build/charts-base/charts-base.js", 14906);+if(leftAxesCollection)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14908);+leftAxesXCoords = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 14909);+l = leftAxesCollection.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 14910);+for(i = l - 1; i > -1; --i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14912);+leftAxesXCoords.unshift(leftPaneWidth);+ _yuitest_coverline("build/charts-base/charts-base.js", 14913);+leftPaneWidth += leftAxesCollection[i].get("width");+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14916);+if(rightAxesCollection)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14918);+rightAxesXCoords = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 14919);+l = rightAxesCollection.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 14920);+i = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 14921);+for(i = l - 1; i > -1; --i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14923);+rightPaneWidth += rightAxesCollection[i].get("width");+ _yuitest_coverline("build/charts-base/charts-base.js", 14924);+rightAxesXCoords.unshift(w - rightPaneWidth);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14927);+if(topAxesCollection)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14929);+topAxesYCoords = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 14930);+l = topAxesCollection.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 14931);+for(i = l - 1; i > -1; --i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14933);+topAxesYCoords.unshift(topPaneHeight);+ _yuitest_coverline("build/charts-base/charts-base.js", 14934);+topPaneHeight += topAxesCollection[i].get("height");+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 14937);+if(bottomAxesCollection)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14939);+bottomAxesYCoords = [];+ _yuitest_coverline("build/charts-base/charts-base.js", 14940);+l = bottomAxesCollection.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 14941);+for(i = l - 1; i > -1; --i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14943);+bottomPaneHeight += bottomAxesCollection[i].get("height");+ _yuitest_coverline("build/charts-base/charts-base.js", 14944);+bottomAxesYCoords.unshift(h - bottomPaneHeight);+ }+ }+ + _yuitest_coverline("build/charts-base/charts-base.js", 14948);+graphWidth = w - (leftPaneWidth + rightPaneWidth);+ _yuitest_coverline("build/charts-base/charts-base.js", 14949);+graphHeight = h - (bottomPaneHeight + topPaneHeight);+ _yuitest_coverline("build/charts-base/charts-base.js", 14950);+graphRect.left = leftPaneWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 14951);+graphRect.top = topPaneHeight;+ _yuitest_coverline("build/charts-base/charts-base.js", 14952);+graphRect.bottom = h - bottomPaneHeight;+ _yuitest_coverline("build/charts-base/charts-base.js", 14953);+graphRect.right = w - rightPaneWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 14954);+if(!allowContentOverflow)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14956);+topOverflow = this._getTopOverflow(leftAxesCollection, rightAxesCollection);+ _yuitest_coverline("build/charts-base/charts-base.js", 14957);+bottomOverflow = this._getBottomOverflow(leftAxesCollection, rightAxesCollection);+ _yuitest_coverline("build/charts-base/charts-base.js", 14958);+leftOverflow = this._getLeftOverflow(bottomAxesCollection, topAxesCollection);+ _yuitest_coverline("build/charts-base/charts-base.js", 14959);+rightOverflow = this._getRightOverflow(bottomAxesCollection, topAxesCollection);+ + _yuitest_coverline("build/charts-base/charts-base.js", 14961);+diff = topOverflow - topPaneHeight;+ _yuitest_coverline("build/charts-base/charts-base.js", 14962);+if(diff > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14964);+graphRect.top = topOverflow;+ _yuitest_coverline("build/charts-base/charts-base.js", 14965);+if(topAxesYCoords)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14967);+i = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 14968);+l = topAxesYCoords.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 14969);+for(; i < l; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14971);+topAxesYCoords[i] += diff;+ }+ }+ }++ _yuitest_coverline("build/charts-base/charts-base.js", 14976);+diff = bottomOverflow - bottomPaneHeight;+ _yuitest_coverline("build/charts-base/charts-base.js", 14977);+if(diff > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14979);+graphRect.bottom = h - bottomOverflow;+ _yuitest_coverline("build/charts-base/charts-base.js", 14980);+if(bottomAxesYCoords)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14982);+i = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 14983);+l = bottomAxesYCoords.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 14984);+for(; i < l; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14986);+bottomAxesYCoords[i] -= diff;+ }+ }+ }++ _yuitest_coverline("build/charts-base/charts-base.js", 14991);+diff = leftOverflow - leftPaneWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 14992);+if(diff > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14994);+graphRect.left = leftOverflow;+ _yuitest_coverline("build/charts-base/charts-base.js", 14995);+if(leftAxesXCoords)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 14997);+i = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 14998);+l = leftAxesXCoords.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 14999);+for(; i < l; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15001);+leftAxesXCoords[i] += diff;+ }+ }+ }++ _yuitest_coverline("build/charts-base/charts-base.js", 15006);+diff = rightOverflow - rightPaneWidth;+ _yuitest_coverline("build/charts-base/charts-base.js", 15007);+if(diff > 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15009);+graphRect.right = w - rightOverflow;+ _yuitest_coverline("build/charts-base/charts-base.js", 15010);+if(rightAxesXCoords)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15012);+i = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 15013);+l = rightAxesXCoords.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 15014);+for(; i < l; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15016);+rightAxesXCoords[i] -= diff;+ }+ }+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15021);+graphWidth = graphRect.right - graphRect.left;+ _yuitest_coverline("build/charts-base/charts-base.js", 15022);+graphHeight = graphRect.bottom - graphRect.top;+ _yuitest_coverline("build/charts-base/charts-base.js", 15023);+graphX = graphRect.left;+ _yuitest_coverline("build/charts-base/charts-base.js", 15024);+graphY = graphRect.top;+ _yuitest_coverline("build/charts-base/charts-base.js", 15025);+if(topAxesCollection)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15027);+l = topAxesCollection.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 15028);+i = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 15029);+for(; i < l; i++)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15031);+axis = topAxesCollection[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 15032);+if(axis.get("width") !== graphWidth)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15034);+axis.set("width", graphWidth);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15036);+axis.get("boundingBox").setStyle("left", graphX + "px");+ _yuitest_coverline("build/charts-base/charts-base.js", 15037);+axis.get("boundingBox").setStyle("top", topAxesYCoords[i] + "px");+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15039);+if(axis._hasDataOverflow())+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15041);+graphOverflow = "hidden";+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15044);+if(bottomAxesCollection)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15046);+l = bottomAxesCollection.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 15047);+i = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 15048);+for(; i < l; i++)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15050);+axis = bottomAxesCollection[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 15051);+if(axis.get("width") !== graphWidth)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15053);+axis.set("width", graphWidth);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15055);+axis.get("boundingBox").setStyle("left", graphX + "px");+ _yuitest_coverline("build/charts-base/charts-base.js", 15056);+axis.get("boundingBox").setStyle("top", bottomAxesYCoords[i] + "px");+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15058);+if(axis._hasDataOverflow())+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15060);+graphOverflow = "hidden";+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15063);+if(leftAxesCollection)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15065);+l = leftAxesCollection.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 15066);+i = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 15067);+for(; i < l; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15069);+axis = leftAxesCollection[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 15070);+axis.get("boundingBox").setStyle("top", graphY + "px");+ _yuitest_coverline("build/charts-base/charts-base.js", 15071);+axis.get("boundingBox").setStyle("left", leftAxesXCoords[i] + "px");+ _yuitest_coverline("build/charts-base/charts-base.js", 15072);+if(axis.get("height") !== graphHeight)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15074);+axis.set("height", graphHeight);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15077);+if(axis._hasDataOverflow())+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15079);+graphOverflow = "hidden";+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15082);+if(rightAxesCollection)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15084);+l = rightAxesCollection.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 15085);+i = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 15086);+for(; i < l; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15088);+axis = rightAxesCollection[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 15089);+axis.get("boundingBox").setStyle("top", graphY + "px");+ _yuitest_coverline("build/charts-base/charts-base.js", 15090);+axis.get("boundingBox").setStyle("left", rightAxesXCoords[i] + "px");+ _yuitest_coverline("build/charts-base/charts-base.js", 15091);+if(axis.get("height") !== graphHeight)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15093);+axis.set("height", graphHeight);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15096);+if(axis._hasDataOverflow())+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15098);+graphOverflow = "hidden";+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15101);+this._drawing = false;+ _yuitest_coverline("build/charts-base/charts-base.js", 15102);+if(this._callLater)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15104);+this._redraw();+ _yuitest_coverline("build/charts-base/charts-base.js", 15105);+return;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15107);+if(graph)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15109);+graph.get("boundingBox").setStyle("left", graphX + "px");+ _yuitest_coverline("build/charts-base/charts-base.js", 15110);+graph.get("boundingBox").setStyle("top", graphY + "px");+ _yuitest_coverline("build/charts-base/charts-base.js", 15111);+graph.set("width", graphWidth);+ _yuitest_coverline("build/charts-base/charts-base.js", 15112);+graph.set("height", graphHeight);+ _yuitest_coverline("build/charts-base/charts-base.js", 15113);+graph.get("boundingBox").setStyle("overflow", graphOverflow);+ }++ _yuitest_coverline("build/charts-base/charts-base.js", 15116);+if(this._overlay)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15118);+this._overlay.setStyle("left", graphX + "px");+ _yuitest_coverline("build/charts-base/charts-base.js", 15119);+this._overlay.setStyle("top", graphY + "px");+ _yuitest_coverline("build/charts-base/charts-base.js", 15120);+this._overlay.setStyle("width", graphWidth + "px");+ _yuitest_coverline("build/charts-base/charts-base.js", 15121);+this._overlay.setStyle("height", graphHeight + "px");+ }+ },++ /**+ * Destructor implementation for the CartesianChart class. Calls destroy on all axes, series and the Graph instance.+ * Removes the tooltip and overlay HTML elements.+ *+ * @method destructor+ * @protected+ */+ destructor: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "destructor", 15132);+_yuitest_coverline("build/charts-base/charts-base.js", 15134);+var graph = this.get("graph"),+ i = 0,+ len,+ seriesCollection = this.get("seriesCollection"),+ axesCollection = this._axesCollection,+ tooltip = this.get("tooltip").node;+ _yuitest_coverline("build/charts-base/charts-base.js", 15140);+if(this._description)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15142);+this._description.empty();+ _yuitest_coverline("build/charts-base/charts-base.js", 15143);+this._description.remove(true);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15145);+if(this._liveRegion)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15147);+this._liveRegion.empty();+ _yuitest_coverline("build/charts-base/charts-base.js", 15148);+this._liveRegion.remove(true);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15150);+len = seriesCollection ? seriesCollection.length : 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 15151);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15153);+if(seriesCollection[i] instanceof Y.CartesianSeries)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15155);+seriesCollection[i].destroy(true);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15158);+len = axesCollection ? axesCollection.length : 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 15159);+for(i = 0; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15161);+if(axesCollection[i] instanceof Y.Axis)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15163);+axesCollection[i].destroy(true);+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15166);+if(graph)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15168);+graph.destroy(true);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15170);+if(tooltip)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15172);+tooltip.empty();+ _yuitest_coverline("build/charts-base/charts-base.js", 15173);+tooltip.remove(true);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15175);+if(this._overlay)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15177);+this._overlay.empty();+ _yuitest_coverline("build/charts-base/charts-base.js", 15178);+this._overlay.remove(true);+ }+ },++ /**+ * Returns the appropriate message based on the key press.+ *+ * @method _getAriaMessage+ * @param {Number} key The keycode that was pressed.+ * @return String+ */+ _getAriaMessage: function(key)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getAriaMessage", 15189);+_yuitest_coverline("build/charts-base/charts-base.js", 15191);+var msg = "",+ series,+ items,+ categoryItem,+ valueItem,+ seriesIndex = this._seriesIndex,+ itemIndex = this._itemIndex,+ seriesCollection = this.get("seriesCollection"),+ len = seriesCollection.length,+ dataLength;+ _yuitest_coverline("build/charts-base/charts-base.js", 15201);+if(key % 2 === 0)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15203);+if(len > 1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15205);+if(key === 38)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15207);+seriesIndex = seriesIndex < 1 ? len - 1 : seriesIndex - 1;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 15209);+if(key === 40)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15211);+seriesIndex = seriesIndex >= len - 1 ? 0 : seriesIndex + 1;+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 15213);+this._itemIndex = -1;+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15217);+seriesIndex = 0;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15219);+this._seriesIndex = seriesIndex;+ _yuitest_coverline("build/charts-base/charts-base.js", 15220);+series = this.getSeries(parseInt(seriesIndex, 10));+ _yuitest_coverline("build/charts-base/charts-base.js", 15221);+msg = series.get("valueDisplayName") + " series.";+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15225);+if(seriesIndex > -1)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15227);+msg = "";+ _yuitest_coverline("build/charts-base/charts-base.js", 15228);+series = this.getSeries(parseInt(seriesIndex, 10));+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15232);+seriesIndex = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 15233);+this._seriesIndex = seriesIndex;+ _yuitest_coverline("build/charts-base/charts-base.js", 15234);+series = this.getSeries(parseInt(seriesIndex, 10));+ _yuitest_coverline("build/charts-base/charts-base.js", 15235);+msg = series.get("valueDisplayName") + " series.";+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15237);+dataLength = series._dataLength ? series._dataLength : 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 15238);+if(key === 37)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15240);+itemIndex = itemIndex > 0 ? itemIndex - 1 : dataLength - 1;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 15242);+if(key === 39)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15244);+itemIndex = itemIndex >= dataLength - 1 ? 0 : itemIndex + 1;+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 15246);+this._itemIndex = itemIndex;+ _yuitest_coverline("build/charts-base/charts-base.js", 15247);+items = this.getSeriesItems(series, itemIndex);+ _yuitest_coverline("build/charts-base/charts-base.js", 15248);+categoryItem = items.category;+ _yuitest_coverline("build/charts-base/charts-base.js", 15249);+valueItem = items.value;+ _yuitest_coverline("build/charts-base/charts-base.js", 15250);+if(categoryItem && valueItem && categoryItem.value && valueItem.value)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15252);+msg += categoryItem.displayName + ": " + categoryItem.axis.formatLabel.apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]) + ", ";+ _yuitest_coverline("build/charts-base/charts-base.js", 15253);+msg += valueItem.displayName + ": " + valueItem.axis.formatLabel.apply(this, [valueItem.value, valueItem.axis.get("labelFormat")]) + ", "; + }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15257);+msg += "No data available.";+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15259);+msg += (itemIndex + 1) + " of " + dataLength + ". ";+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15261);+return msg;+ }+}, {+ ATTRS: {+ /**+ * Indicates whether axis labels are allowed to overflow beyond the bounds of the chart's content box.+ *+ * @attribute allowContentOverflow+ * @type Boolean+ */+ allowContentOverflow: {+ value: false+ },++ /**+ * Style object for the axes.+ *+ * @attribute axesStyles+ * @type Object+ * @private+ */+ axesStyles: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 15283);+_yuitest_coverline("build/charts-base/charts-base.js", 15285);+var axes = this.get("axes"),+ i,+ styles = this._axesStyles;+ _yuitest_coverline("build/charts-base/charts-base.js", 15288);+if(axes)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15290);+for(i in axes)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15292);+if(axes.hasOwnProperty(i) && axes[i] instanceof Y.Axis)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15294);+if(!styles)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15296);+styles = {};+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15298);+styles[i] = axes[i].get("styles");+ }+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15302);+return styles;+ },+ + setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 15305);+_yuitest_coverline("build/charts-base/charts-base.js", 15307);+var axes = this.get("axes"),+ i;+ _yuitest_coverline("build/charts-base/charts-base.js", 15309);+for(i in val)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15311);+if(val.hasOwnProperty(i) && axes.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15313);+this._setBaseAttribute(axes[i], "styles", val[i]);+ }+ }+ }+ },++ /**+ * Style object for the series+ *+ * @attribute seriesStyles+ * @type Object+ * @private+ */+ seriesStyles: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 15327);+_yuitest_coverline("build/charts-base/charts-base.js", 15329);+var styles = this._seriesStyles,+ graph = this.get("graph"),+ dict,+ i;+ _yuitest_coverline("build/charts-base/charts-base.js", 15333);+if(graph)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15335);+dict = graph.get("seriesDictionary");+ _yuitest_coverline("build/charts-base/charts-base.js", 15336);+if(dict)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15338);+styles = {};+ _yuitest_coverline("build/charts-base/charts-base.js", 15339);+for(i in dict)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15341);+if(dict.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15343);+styles[i] = dict[i].get("styles");+ }+ }+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15348);+return styles;+ },+ + setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 15351);+_yuitest_coverline("build/charts-base/charts-base.js", 15353);+var i,+ l,+ s;+ + _yuitest_coverline("build/charts-base/charts-base.js", 15357);+if(Y_Lang.isArray(val))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15359);+s = this.get("seriesCollection");+ _yuitest_coverline("build/charts-base/charts-base.js", 15360);+i = 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 15361);+l = val.length;++ _yuitest_coverline("build/charts-base/charts-base.js", 15363);+for(; i < l; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15365);+this._setBaseAttribute(s[i], "styles", val[i]);+ }+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15370);+for(i in val)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15372);+if(val.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15374);+s = this.getSeries(i);+ _yuitest_coverline("build/charts-base/charts-base.js", 15375);+this._setBaseAttribute(s, "styles", val[i]);+ }+ }+ }+ }+ },++ /**+ * Styles for the graph.+ *+ * @attribute graphStyles+ * @type Object+ * @private+ */+ graphStyles: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 15390);+_yuitest_coverline("build/charts-base/charts-base.js", 15392);+var graph = this.get("graph");+ _yuitest_coverline("build/charts-base/charts-base.js", 15393);+if(graph)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15395);+return(graph.get("styles"));+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15397);+return this._graphStyles;+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 15400);+_yuitest_coverline("build/charts-base/charts-base.js", 15402);+var graph = this.get("graph");+ _yuitest_coverline("build/charts-base/charts-base.js", 15403);+this._setBaseAttribute(graph, "styles", val);+ }++ },++ /**+ * Style properties for the chart. Contains a key indexed hash of the following:+ * <dl>+ * <dt>series</dt><dd>A key indexed hash containing references to the `styles` attribute for each series in the chart.+ * Specific style attributes vary depending on the series:+ * <ul>+ * <li><a href="AreaSeries.html#attr_styles">AreaSeries</a></li>+ * <li><a href="BarSeries.html#attr_styles">BarSeries</a></li>+ * <li><a href="ColumnSeries.html#attr_styles">ColumnSeries</a></li>+ * <li><a href="ComboSeries.html#attr_styles">ComboSeries</a></li>+ * <li><a href="LineSeries.html#attr_styles">LineSeries</a></li>+ * <li><a href="MarkerSeries.html#attr_styles">MarkerSeries</a></li>+ * <li><a href="SplineSeries.html#attr_styles">SplineSeries</a></li>+ * </ul>+ * </dd>+ * <dt>axes</dt><dd>A key indexed hash containing references to the `styles` attribute for each axes in the chart. Specific+ * style attributes can be found in the <a href="Axis.html#attr_styles">Axis</a> class.</dd>+ * <dt>graph</dt><dd>A reference to the `styles` attribute in the chart. Specific style attributes can be found in the+ * <a href="Graph.html#attr_styles">Graph</a> class.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ styles: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 15433);+_yuitest_coverline("build/charts-base/charts-base.js", 15435);+var styles = { + axes: this.get("axesStyles"),+ series: this.get("seriesStyles"),+ graph: this.get("graphStyles")+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 15440);+return styles;+ },+ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 15442);+_yuitest_coverline("build/charts-base/charts-base.js", 15444);+if(val.hasOwnProperty("axes"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15446);+if(this.get("axesStyles"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15448);+this.set("axesStyles", val.axes);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15452);+this._axesStyles = val.axes;+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15455);+if(val.hasOwnProperty("series"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15457);+if(this.get("seriesStyles"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15459);+this.set("seriesStyles", val.series);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15463);+this._seriesStyles = val.series;+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15466);+if(val.hasOwnProperty("graph"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15468);+this.set("graphStyles", val.graph);+ }+ }+ },++ /**+ * Axes to appear in the chart. This can be a key indexed hash of axis instances or object literals+ * used to construct the appropriate axes.+ *+ * @attribute axes+ * @type Object+ */+ axes: {+ valueFn: "_getDefaultAxes",++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 15483);+_yuitest_coverline("build/charts-base/charts-base.js", 15485);+if(this.get("dataProvider"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15487);+val = this._setAxes(val);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15489);+return val;+ }+ },++ /**+ * Collection of series to appear on the chart. This can be an array of Series instances or object literals+ * used to construct the appropriate series.+ *+ * @attribute seriesCollection+ * @type Array+ */+ seriesCollection: {+ valueFn: "_getDefaultSeriesCollection",+ + setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 15503);+_yuitest_coverline("build/charts-base/charts-base.js", 15505);+if(this.get("dataProvider"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15507);+val = this._parseSeriesCollection(val);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15509);+return val;+ }+ },++ /**+ * Reference to the left-aligned axes for the chart.+ *+ * @attribute leftAxesCollection+ * @type Array+ * @private+ */+ leftAxesCollection: {},++ /**+ * Reference to the bottom-aligned axes for the chart.+ *+ * @attribute bottomAxesCollection+ * @type Array+ * @private+ */+ bottomAxesCollection: {},++ /**+ * Reference to the right-aligned axes for the chart.+ *+ * @attribute rightAxesCollection+ * @type Array+ * @private+ */+ rightAxesCollection: {},++ /**+ * Reference to the top-aligned axes for the chart.+ *+ * @attribute topAxesCollection+ * @type Array+ * @private+ */+ topAxesCollection: {},+ + /**+ * Indicates whether or not the chart is stacked.+ *+ * @attribute stacked+ * @type Boolean+ */+ stacked: {+ value: false+ },++ /**+ * Direction of chart's category axis when there is no series collection specified. Charts can+ * be horizontal or vertical. When the chart type is column, the chart is horizontal.+ * When the chart type is bar, the chart is vertical. + *+ * @attribute direction+ * @type String+ */+ direction: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 15568);+_yuitest_coverline("build/charts-base/charts-base.js", 15570);+var type = this.get("type");+ _yuitest_coverline("build/charts-base/charts-base.js", 15571);+if(type == "bar")+ { + _yuitest_coverline("build/charts-base/charts-base.js", 15573);+return "vertical";+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 15575);+if(type == "column")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15577);+return "horizontal";+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 15579);+return this._direction;+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 15582);+_yuitest_coverline("build/charts-base/charts-base.js", 15584);+this._direction = val;+ _yuitest_coverline("build/charts-base/charts-base.js", 15585);+return this._direction;+ }+ },++ /**+ * Indicates whether or not an area is filled in a combo chart.+ * + * @attribute showAreaFill+ * @type Boolean+ */+ showAreaFill: {},++ /**+ * Indicates whether to display markers in a combo chart.+ *+ * @attribute showMarkers+ * @type Boolean+ */+ showMarkers:{},++ /**+ * Indicates whether to display lines in a combo chart.+ *+ * @attribute showLines+ * @type Boolean+ */+ showLines:{},++ /**+ * Indicates the key value used to identify a category axis in the `axes` hash. If+ * not specified, the categoryKey attribute value will be used.+ * + * @attribute categoryAxisName+ * @type String+ */+ categoryAxisName: {+ },++ /**+ * Indicates the key value used to identify a the series axis when an axis not generated.+ *+ * @attribute valueAxisName+ * @type String+ */+ valueAxisName: {+ value: "values"+ },++ /**+ * Reference to the horizontalGridlines for the chart.+ *+ * @attribute horizontalGridlines+ * @type Gridlines+ */+ horizontalGridlines: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 15640);+_yuitest_coverline("build/charts-base/charts-base.js", 15642);+var graph = this.get("graph");+ _yuitest_coverline("build/charts-base/charts-base.js", 15643);+if(graph)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15645);+return graph.get("horizontalGridlines");+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15647);+return this._horizontalGridlines;+ },+ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 15649);+_yuitest_coverline("build/charts-base/charts-base.js", 15651);+var graph = this.get("graph");+ _yuitest_coverline("build/charts-base/charts-base.js", 15652);+if(val && !Y_Lang.isObject(val))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15654);+val = {};+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15656);+if(graph)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15658);+graph.set("horizontalGridlines", val);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15662);+this._horizontalGridlines = val;+ }+ }+ },++ /**+ * Reference to the verticalGridlines for the chart.+ *+ * @attribute verticalGridlines+ * @type Gridlines+ */+ verticalGridlines: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 15674);+_yuitest_coverline("build/charts-base/charts-base.js", 15676);+var graph = this.get("graph");+ _yuitest_coverline("build/charts-base/charts-base.js", 15677);+if(graph)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15679);+return graph.get("verticalGridlines");+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15681);+return this._verticalGridlines;+ },+ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 15683);+_yuitest_coverline("build/charts-base/charts-base.js", 15685);+var graph = this.get("graph");+ _yuitest_coverline("build/charts-base/charts-base.js", 15686);+if(val && !Y_Lang.isObject(val))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15688);+val = {};+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15690);+if(graph)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15692);+graph.set("verticalGridlines", val);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15696);+this._verticalGridlines = val;+ }+ }+ },+ + /**+ * Type of chart when there is no series collection specified.+ *+ * @attribute type+ * @type String + */+ type: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 15708);+_yuitest_coverline("build/charts-base/charts-base.js", 15710);+if(this.get("stacked"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15712);+return "stacked" + this._type;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15714);+return this._type;+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 15717);+_yuitest_coverline("build/charts-base/charts-base.js", 15719);+if(this._type == "bar")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15721);+if(val != "bar")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15723);+this.set("direction", "horizontal");+ }+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15728);+if(val == "bar")+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15730);+this.set("direction", "vertical");+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15733);+this._type = val;+ _yuitest_coverline("build/charts-base/charts-base.js", 15734);+return this._type;+ }+ },+ + /**+ * Reference to the category axis used by the chart.+ *+ * @attribute categoryAxis+ * @type Axis+ */+ categoryAxis:{}+ }+});+/**+ * The PieChart class creates a pie chart+ *+ * @module charts+ * @submodule charts-base+ * @class PieChart+ * @extends ChartBase+ * @constructor+ */+_yuitest_coverline("build/charts-base/charts-base.js", 15756);+Y.PieChart = Y.Base.create("pieChart", Y.Widget, [Y.ChartBase], {+ /**+ * Calculates and returns a `seriesCollection`.+ *+ * @method _getSeriesCollection+ * @return Array+ * @private+ */+ _getSeriesCollection: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getSeriesCollection", 15764);+_yuitest_coverline("build/charts-base/charts-base.js", 15766);+if(this._seriesCollection)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15768);+return this._seriesCollection;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15770);+var axes = this.get("axes"),+ sc = [], + seriesKeys,+ i = 0,+ l,+ type = this.get("type"),+ key,+ catAxis = "categoryAxis",+ catKey = "categoryKey",+ valAxis = "valueAxis",+ seriesKey = "valueKey";+ _yuitest_coverline("build/charts-base/charts-base.js", 15781);+if(axes)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15783);+seriesKeys = axes.values.get("keyCollection");+ _yuitest_coverline("build/charts-base/charts-base.js", 15784);+key = axes.category.get("keyCollection")[0];+ _yuitest_coverline("build/charts-base/charts-base.js", 15785);+l = seriesKeys.length;+ _yuitest_coverline("build/charts-base/charts-base.js", 15786);+for(; i < l; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15788);+sc[i] = {type:type};+ _yuitest_coverline("build/charts-base/charts-base.js", 15789);+sc[i][catAxis] = "category";+ _yuitest_coverline("build/charts-base/charts-base.js", 15790);+sc[i][valAxis] = "values";+ _yuitest_coverline("build/charts-base/charts-base.js", 15791);+sc[i][catKey] = key;+ _yuitest_coverline("build/charts-base/charts-base.js", 15792);+sc[i][seriesKey] = seriesKeys[i];+ }+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15795);+this._seriesCollection = sc;+ _yuitest_coverline("build/charts-base/charts-base.js", 15796);+return sc;+ },++ /**+ * Creates `Axis` instances.+ *+ * @method _parseAxes+ * @param {Object} val Object containing `Axis` instances or objects in which to construct `Axis` instances.+ * @return Object+ * @private+ */+ _parseAxes: function(hash)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_parseAxes", 15807);+_yuitest_coverline("build/charts-base/charts-base.js", 15809);+if(!this._axes)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15811);+this._axes = {};+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15813);+var i, pos, axis, dh, config, axisClass,+ type = this.get("type"),+ w = this.get("width"),+ h = this.get("height"),+ node = Y.Node.one(this._parentNode);+ _yuitest_coverline("build/charts-base/charts-base.js", 15818);+if(!w)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15820);+this.set("width", node.get("offsetWidth"));+ _yuitest_coverline("build/charts-base/charts-base.js", 15821);+w = this.get("width");+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15823);+if(!h)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15825);+this.set("height", node.get("offsetHeight"));+ _yuitest_coverline("build/charts-base/charts-base.js", 15826);+h = this.get("height");+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15828);+for(i in hash)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15830);+if(hash.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15832);+dh = hash[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 15833);+pos = type == "pie" ? "none" : dh.position;+ _yuitest_coverline("build/charts-base/charts-base.js", 15834);+axisClass = this._getAxisClass(dh.type);+ _yuitest_coverline("build/charts-base/charts-base.js", 15835);+config = {dataProvider:this.get("dataProvider")};+ _yuitest_coverline("build/charts-base/charts-base.js", 15836);+if(dh.hasOwnProperty("roundingUnit"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15838);+config.roundingUnit = dh.roundingUnit;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15840);+config.keys = dh.keys;+ _yuitest_coverline("build/charts-base/charts-base.js", 15841);+config.width = w;+ _yuitest_coverline("build/charts-base/charts-base.js", 15842);+config.height = h;+ _yuitest_coverline("build/charts-base/charts-base.js", 15843);+config.position = pos;+ _yuitest_coverline("build/charts-base/charts-base.js", 15844);+config.styles = dh.styles;+ _yuitest_coverline("build/charts-base/charts-base.js", 15845);+axis = new axisClass(config);+ _yuitest_coverline("build/charts-base/charts-base.js", 15846);+axis.on("axisRendered", Y.bind(this._itemRendered, this));+ _yuitest_coverline("build/charts-base/charts-base.js", 15847);+this._axes[i] = axis;+ }+ }+ },++ /**+ * Adds axes to the chart.+ *+ * @method _addAxes+ * @private+ */+ _addAxes: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_addAxes", 15858);+_yuitest_coverline("build/charts-base/charts-base.js", 15860);+var axes = this.get("axes"),+ i, + axis, + p;+ _yuitest_coverline("build/charts-base/charts-base.js", 15864);+if(!axes)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15866);+this.set("axes", this._getDefaultAxes());+ _yuitest_coverline("build/charts-base/charts-base.js", 15867);+axes = this.get("axes");+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15869);+if(!this._axesCollection)+ { + _yuitest_coverline("build/charts-base/charts-base.js", 15871);+this._axesCollection = [];+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15873);+for(i in axes)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15875);+if(axes.hasOwnProperty(i))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15877);+axis = axes[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 15878);+p = axis.get("position");+ _yuitest_coverline("build/charts-base/charts-base.js", 15879);+if(!this.get(p + "AxesCollection"))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15881);+this.set(p + "AxesCollection", [axis]);+ }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15885);+this.get(p + "AxesCollection").push(axis);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15887);+this._axesCollection.push(axis);+ }+ }+ },++ /**+ * Renders the Graph.+ *+ * @method _addSeries+ * @private+ */+ _addSeries: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_addSeries", 15898);+_yuitest_coverline("build/charts-base/charts-base.js", 15900);+var graph = this.get("graph"),+ seriesCollection = this.get("seriesCollection");+ _yuitest_coverline("build/charts-base/charts-base.js", 15902);+this._parseSeriesAxes(seriesCollection);+ _yuitest_coverline("build/charts-base/charts-base.js", 15903);+graph.set("showBackground", false);+ _yuitest_coverline("build/charts-base/charts-base.js", 15904);+graph.set("width", this.get("width"));+ _yuitest_coverline("build/charts-base/charts-base.js", 15905);+graph.set("height", this.get("height"));+ _yuitest_coverline("build/charts-base/charts-base.js", 15906);+graph.set("seriesCollection", seriesCollection);+ _yuitest_coverline("build/charts-base/charts-base.js", 15907);+this._seriesCollection = graph.get("seriesCollection");+ _yuitest_coverline("build/charts-base/charts-base.js", 15908);+graph.render(this.get("contentBox"));+ },++ /**+ * Parse and sets the axes for the chart.+ *+ * @method _parseSeriesAxes+ * @param {Array} c A collection `PieSeries` instance.+ * @private+ */+ _parseSeriesAxes: function(c)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_parseSeriesAxes", 15918);+_yuitest_coverline("build/charts-base/charts-base.js", 15920);+var i = 0, + len = c.length, + s,+ axes = this.get("axes"),+ axis;+ _yuitest_coverline("build/charts-base/charts-base.js", 15925);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15927);+s = c[i];+ _yuitest_coverline("build/charts-base/charts-base.js", 15928);+if(s)+ {+ //If series is an actual series instance, + //replace axes attribute string ids with axes+ _yuitest_coverline("build/charts-base/charts-base.js", 15932);+if(s instanceof Y.PieSeries)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15934);+axis = s.get("categoryAxis");+ _yuitest_coverline("build/charts-base/charts-base.js", 15935);+if(axis && !(axis instanceof Y.Axis))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15937);+s.set("categoryAxis", axes[axis]);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15939);+axis = s.get("valueAxis");+ _yuitest_coverline("build/charts-base/charts-base.js", 15940);+if(axis && !(axis instanceof Y.Axis))+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15942);+s.set("valueAxis", axes[axis]);+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15944);+continue;+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 15946);+s.categoryAxis = axes.category;+ _yuitest_coverline("build/charts-base/charts-base.js", 15947);+s.valueAxis = axes.values;+ _yuitest_coverline("build/charts-base/charts-base.js", 15948);+if(!s.type)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 15950);+s.type = this.get("type");+ }+ }+ }+ },++ /**+ * Generates and returns a key-indexed object containing `Axis` instances or objects used to create `Axis` instances.+ *+ * @method _getDefaultAxes+ * @return Object+ * @private+ */+ _getDefaultAxes: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getDefaultAxes", 15963);+_yuitest_coverline("build/charts-base/charts-base.js", 15965);+var catKey = this.get("categoryKey"),+ seriesKeys = this.get("seriesKeys").concat(), + seriesAxis = "numeric";+ _yuitest_coverline("build/charts-base/charts-base.js", 15968);+return {+ values:{+ keys:seriesKeys,+ type:seriesAxis+ },+ category:{+ keys:[catKey],+ type:this.get("categoryType")+ }+ };+ },+ + /**+ * Returns an object literal containing a categoryItem and a valueItem for a given series index.+ *+ * @method getSeriesItem+ * @param series Reference to a series.+ * @param index Index of the specified item within a series.+ * @return Object+ */+ getSeriesItems: function(series, index)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getSeriesItems", 15988);+_yuitest_coverline("build/charts-base/charts-base.js", 15990);+var categoryItem = {+ axis: series.get("categoryAxis"),+ key: series.get("categoryKey"),+ displayName: series.get("categoryDisplayName")+ },+ valueItem = {+ axis: series.get("valueAxis"),+ key: series.get("valueKey"),+ displayName: series.get("valueDisplayName")+ };+ _yuitest_coverline("build/charts-base/charts-base.js", 16000);+categoryItem.value = categoryItem.axis.getKeyValueAt(categoryItem.key, index);+ _yuitest_coverline("build/charts-base/charts-base.js", 16001);+valueItem.value = valueItem.axis.getKeyValueAt(valueItem.key, index);+ _yuitest_coverline("build/charts-base/charts-base.js", 16002);+return {category:categoryItem, value:valueItem};+ },++ /**+ * Handler for sizeChanged event.+ *+ * @method _sizeChanged+ * @param {Object} e Event object.+ * @private+ */+ _sizeChanged: function(e)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_sizeChanged", 16012);+_yuitest_coverline("build/charts-base/charts-base.js", 16014);+this._redraw();+ },++ /**+ * Redraws the chart instance.+ *+ * @method _redraw+ * @private+ */+ _redraw: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_redraw", 16023);+_yuitest_coverline("build/charts-base/charts-base.js", 16025);+var graph = this.get("graph"),+ w = this.get("width"),+ h = this.get("height"),+ dimension;+ _yuitest_coverline("build/charts-base/charts-base.js", 16029);+if(graph)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 16031);+dimension = Math.min(w, h);+ _yuitest_coverline("build/charts-base/charts-base.js", 16032);+graph.set("width", dimension);+ _yuitest_coverline("build/charts-base/charts-base.js", 16033);+graph.set("height", dimension);+ }+ },+ + /**+ * Formats tooltip text for a pie chart.+ *+ * @method _tooltipLabelFunction+ * @param {Object} categoryItem An object containing the following:+ * <dl>+ * <dt>axis</dt><dd>The axis to which the category is bound.</dd>+ * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided)</dd>+ * <dt>key</dt><dd>The key of the category.</dd>+ * <dt>value</dt><dd>The value of the category</dd>+ * </dl>+ * @param {Object} valueItem An object containing the following:+ * <dl>+ * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>+ * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>+ * <dt>key</dt><dd>The key for the series.</dd>+ * <dt>value</dt><dd>The value for the series item.</dd> + * </dl>+ * @param {Number} itemIndex The index of the item within the series.+ * @param {CartesianSeries} series The `PieSeries` instance of the item.+ * @param {Number} seriesIndex The index of the series in the `seriesCollection`.+ * @return {HTML}+ * @private+ */+ _tooltipLabelFunction: function(categoryItem, valueItem, itemIndex, series, seriesIndex)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_tooltipLabelFunction", 16061);+_yuitest_coverline("build/charts-base/charts-base.js", 16063);+var msg = DOCUMENT.createElement("div"),+ total = series.getTotalValues(),+ pct = Math.round((valueItem.value / total) * 10000)/100;+ _yuitest_coverline("build/charts-base/charts-base.js", 16066);+msg.appendChild(DOCUMENT.createTextNode(categoryItem.displayName ++ ": " + categoryItem.axis.get("labelFunction").apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]))); + _yuitest_coverline("build/charts-base/charts-base.js", 16068);+msg.appendChild(DOCUMENT.createElement("br"));+ _yuitest_coverline("build/charts-base/charts-base.js", 16069);+msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName + + ": " + valueItem.axis.get("labelFunction").apply(this, [valueItem.value, valueItem.axis.get("labelFormat")])));+ _yuitest_coverline("build/charts-base/charts-base.js", 16071);+msg.appendChild(DOCUMENT.createElement("br"));+ _yuitest_coverline("build/charts-base/charts-base.js", 16072);+msg.appendChild(DOCUMENT.createTextNode(pct + "%")); + _yuitest_coverline("build/charts-base/charts-base.js", 16073);+return msg; + },++ /**+ * Returns the appropriate message based on the key press.+ *+ * @method _getAriaMessage+ * @param {Number} key The keycode that was pressed.+ * @return String+ */+ _getAriaMessage: function(key)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "_getAriaMessage", 16083);+_yuitest_coverline("build/charts-base/charts-base.js", 16085);+var msg = "",+ categoryItem,+ items,+ series,+ valueItem,+ seriesIndex = 0,+ itemIndex = this._itemIndex,+ seriesCollection = this.get("seriesCollection"),+ len,+ total,+ pct,+ markers;+ _yuitest_coverline("build/charts-base/charts-base.js", 16097);+series = this.getSeries(parseInt(seriesIndex, 10));+ _yuitest_coverline("build/charts-base/charts-base.js", 16098);+markers = series.get("markers");+ _yuitest_coverline("build/charts-base/charts-base.js", 16099);+len = markers && markers.length ? markers.length : 0;+ _yuitest_coverline("build/charts-base/charts-base.js", 16100);+if(key === 37)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 16102);+itemIndex = itemIndex > 0 ? itemIndex - 1 : len - 1;+ }+ else {_yuitest_coverline("build/charts-base/charts-base.js", 16104);+if(key === 39)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 16106);+itemIndex = itemIndex >= len - 1 ? 0 : itemIndex + 1;+ }}+ _yuitest_coverline("build/charts-base/charts-base.js", 16108);+this._itemIndex = itemIndex;+ _yuitest_coverline("build/charts-base/charts-base.js", 16109);+items = this.getSeriesItems(series, itemIndex);+ _yuitest_coverline("build/charts-base/charts-base.js", 16110);+categoryItem = items.category;+ _yuitest_coverline("build/charts-base/charts-base.js", 16111);+valueItem = items.value;+ _yuitest_coverline("build/charts-base/charts-base.js", 16112);+total = series.getTotalValues();+ _yuitest_coverline("build/charts-base/charts-base.js", 16113);+pct = Math.round((valueItem.value / total) * 10000)/100;+ _yuitest_coverline("build/charts-base/charts-base.js", 16114);+if(categoryItem && valueItem)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 16116);+msg += categoryItem.displayName + ": " + categoryItem.axis.formatLabel.apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]) + ", ";+ _yuitest_coverline("build/charts-base/charts-base.js", 16117);+msg += valueItem.displayName + ": " + valueItem.axis.formatLabel.apply(this, [valueItem.value, valueItem.axis.get("labelFormat")]) + ", "; + _yuitest_coverline("build/charts-base/charts-base.js", 16118);+msg += "Percent of total " + valueItem.displayName + ": " + pct + "%,"; + }+ else+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 16122);+msg += "No data available,";+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 16124);+msg += (itemIndex + 1) + " of " + len + ". ";+ _yuitest_coverline("build/charts-base/charts-base.js", 16125);+return msg;+ }+}, {+ ATTRS: {+ /**+ * Sets the aria description for the chart.+ *+ * @attribute ariaDescription+ * @type String+ */+ ariaDescription: {+ value: "Use the left and right keys to navigate through items.",++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 16138);+_yuitest_coverline("build/charts-base/charts-base.js", 16140);+if(this._description)+ {+ _yuitest_coverline("build/charts-base/charts-base.js", 16142);+this._description.setContent("");+ _yuitest_coverline("build/charts-base/charts-base.js", 16143);+this._description.appendChild(DOCUMENT.createTextNode(val));+ }+ _yuitest_coverline("build/charts-base/charts-base.js", 16145);+return val;+ }+ },+ + /**+ * Axes to appear in the chart. + *+ * @attribute axes+ * @type Object+ */+ axes: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 16156);+_yuitest_coverline("build/charts-base/charts-base.js", 16158);+return this._axes;+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 16161);+_yuitest_coverline("build/charts-base/charts-base.js", 16163);+this._parseAxes(val);+ }+ },++ /**+ * Collection of series to appear on the chart. This can be an array of Series instances or object literals+ * used to describe a Series instance.+ *+ * @attribute seriesCollection+ * @type Array+ */+ seriesCollection: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "getter", 16175);+_yuitest_coverline("build/charts-base/charts-base.js", 16177);+return this._getSeriesCollection();+ },+ + setter: function(val)+ {+ _yuitest_coverfunc("build/charts-base/charts-base.js", "setter", 16180);+_yuitest_coverline("build/charts-base/charts-base.js", 16182);+return this._setSeriesCollection(val);+ }+ },+ + /**+ * Type of chart when there is no series collection specified.+ *+ * @attribute type+ * @type String + */+ type: {+ value: "pie"+ }+ }+});+++}, '3.7.1', {"requires": ["dom", "datatype-number", "datatype-date", "event-custom", "event-mouseenter", "event-touch", "widget", "widget-position", "widget-stack", "graphics"]});
@@ -1,15451 +1,16205 @@ /*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-YUI.add('charts-base', function(Y) {--/**- * The Charts widget provides an api for displaying data- * graphically.- *- * @module charts- * @main charts- */-var CONFIG = Y.config,- WINDOW = CONFIG.win,- DOCUMENT = CONFIG.doc,- Y_Lang = Y.Lang,- IS_STRING = Y_Lang.isString,- LeftAxisLayout,- RightAxisLayout,- BottomAxisLayout,- TopAxisLayout,- _getClassName = Y.ClassNameManager.getClassName,- SERIES_MARKER = _getClassName("seriesmarker"),- ShapeGroup,- CircleGroup,- RectGroup,- EllipseGroup,- DiamondGroup;--/**- * Abstract class for creating groups of shapes with the same styles and dimensions.- *- * @module graphics- * @class ShapeGroup- * @constructor- */- ShapeGroup = function(cfg)- {- ShapeGroup.superclass.constructor.apply(this, arguments);- };- - ShapeGroup.NAME = "shapeGroup";-- Y.extend(ShapeGroup, Y.Path, { - /**- * Updates the shape.- *- * @method _draw- * @private- */- _draw: function()- {- var xvalues = this.get("xvalues"),- yvalues = this.get("yvalues"),- x,- y,- xRad,- yRad,- i = 0,- len,- attrs = [],- dimensions = this.get("dimensions"),- width = dimensions.width,- height = dimensions.height,- radius = dimensions.radius,- yRadius = dimensions.yRadius,- id = this.get("id"),- className = this.node.className,- widthIsArray = Y_Lang.isArray(width),- heightIsArray = Y_Lang.isArray(height),- radiusIsArray = Y_Lang.isArray(radius),- yRadiusIsArray = Y_Lang.isArray(yRadius);- if(xvalues && yvalues && xvalues.length > 0)- {- this.clear();-- len = xvalues.length;- for(; i < len; ++i)- {- x = xvalues[i];- y = yvalues[i];- xRad = radiusIsArray ? radius[i] : radius;- yRad = yRadiusIsArray ? yRadius[i] : yRadius;- if(!isNaN(x) && !isNaN(y) && !isNaN(xRad))- {- this.drawShape({- x: x,- y: y,- width: widthIsArray ? width[i] : width,- height: heightIsArray ? height[i] : height,- radius: xRad,- yRadius: yRad - });- this.closePath();- attrs[i] = {- id: id + "_" + i,- className: className,- coords: (x - this._left) + ", " + (y - this._top) + ", " + radius,- shape: "circle"- };- }- }- this._closePath();- }- },-- /**- * Parses and array of lengths into radii- *- * @method _getRadiusCollection- * @param {Array} val Array of lengths- * @return Array- * @private- */- _getRadiusCollection: function(val)- {- var i = 0,- len = val.length,- radii = [];- for(; i < len; ++i)- { - radii[i] = val[i] * 0.5;- }- return radii;- }- });- -ShapeGroup.ATTRS = Y.merge(Y.Path.ATTRS, {- dimensions: {- getter: function()- {- var dimensions = this._dimensions,- radius,- yRadius,- width,- height;- if(dimensions.hasOwnProperty("radius"))- {- return dimensions;- }- else- {- width = dimensions.width;- height = dimensions.height;- radius = Y_Lang.isArray(width) ? this._getRadiusCollection(width) : (width * 0.5);- yRadius = Y_Lang.isArray(height) ? this._getRadiusCollection(height) : (height * 0.5);- return {- width: width,- height: height,- radius: radius,- yRadius: yRadius- };- }- },-- setter: function(val)- {- this._dimensions = val;- return val;- }- },- xvalues: {- getter: function()- {- return this._xvalues;- },- setter: function(val)- {- this._xvalues = val;- }- },- yvalues: {- getter: function()- {- return this._yvalues;- },- setter: function(val)- {- this._yvalues = val;- }- }-});-Y.ShapeGroup = ShapeGroup;-/**- * Abstract class for creating groups of circles with the same styles and dimensions.- *- * @module graphics- * @class GroupCircle- * @constructor- */- CircleGroup = function(cfg)- {- CircleGroup.superclass.constructor.apply(this, arguments);- };- - CircleGroup.NAME = "circleGroup";-- Y.extend(CircleGroup, Y.ShapeGroup, { - /**- * Algorithm for drawing shape.- *- * @method drawShape- * @param {Object} cfg Parameters used to draw the shape.- */- drawShape: function(cfg)- {- this.drawCircle(cfg.x, cfg.y, cfg.radius);- }- });--CircleGroup.ATTRS = Y.merge(Y.ShapeGroup.ATTRS, {- dimensions: {- getter: function()- {- var dimensions = this._dimensions,- radius,- yRadius,- width,- height;- if(dimensions.hasOwnProperty("radius"))- {- return dimensions;- }- else- {- width = dimensions.width;- height = dimensions.height;- radius = Y_Lang.isArray(width) ? this._getRadiusCollection(width) : (width * 0.5);- yRadius = radius;- return {- width: width,- height: height,- radius: radius,- yRadius: yRadius- };- }- }- }-});- -CircleGroup.ATTRS = Y.ShapeGroup.ATTRS;-Y.CircleGroup = CircleGroup;-/**- * Abstract class for creating groups of rects with the same styles and dimensions.- *- * @module graphics- * @class GroupRect- * @constructor- */- RectGroup = function(cfg)- {- RectGroup.superclass.constructor.apply(this, arguments);- };- - RectGroup.NAME = "rectGroup";-- Y.extend(RectGroup, Y.ShapeGroup, { - /**- * Updates the rect.- *- * @method _draw- * @private- */- drawShape: function(cfg)- {- this.drawRect(cfg.x, cfg.y, cfg.width, cfg.height);- }- });- -RectGroup.ATTRS = Y.ShapeGroup.ATTRS;-Y.RectGroup = RectGroup;-/**- * Abstract class for creating groups of diamonds with the same styles and dimensions.- *- * @module graphics- * @class GroupDiamond- * @constructor- */- DiamondGroup = function(cfg)- {- DiamondGroup.superclass.constructor.apply(this, arguments);- };- - DiamondGroup.NAME = "diamondGroup";-- Y.extend(DiamondGroup, Y.ShapeGroup, { - /**- * Updates the diamond.- *- * @method _draw- * @private- */- drawShape: function(cfg)- {- this.drawDiamond(cfg.x, cfg.y, cfg.width, cfg.height);- }- });- -DiamondGroup.ATTRS = Y.ShapeGroup.ATTRS;-Y.DiamondGroup = DiamondGroup;-/**- * Abstract class for creating groups of diamonds with the same styles and dimensions.- *- * @module graphics- * @class EllipseGroup- * @constructor- */- EllipseGroup = function(cfg)- {- EllipseGroup.superclass.constructor.apply(this, arguments);- };- - EllipseGroup.NAME = "diamondGroup";-- Y.extend(EllipseGroup, Y.ShapeGroup, { - /**- * Updates the diamond.- *- * @method _draw- * @private- */- drawShape: function(cfg)- {- this.drawEllipse(cfg.x, cfg.y, cfg.width, cfg.height);- }- });- -EllipseGroup.ATTRS = Y.ShapeGroup.ATTRS;-Y.EllipseGroup = EllipseGroup;-/**- * The Renderer class is a base class for chart components that use the `styles`- * attribute.- *- * @module charts- * @class Renderer- * @constructor- */-function Renderer(){}--Renderer.ATTRS = {- /**- * Style properties for class- * - * @attribute styles- * @type Object- */- styles:- {- getter: function()- {- this._styles = this._styles || this._getDefaultStyles();- return this._styles;- },-- setter: function(val)- {- this._styles = this._setStyles(val);- }- },- - /**- * The graphic in which drawings will be rendered.- *- * @attribute graphic- * @type Graphic- */- graphic: {}-};-Renderer.NAME = "renderer";--Renderer.prototype = {- /**- * Storage for `styles` attribute.- *- * @property _styles- * @type Object- * @private- */- _styles: null,- - /**- * Method used by `styles` setter.- *- * @method _setStyles- * @param {Object} newStyles Hash of properties to update.- * @return Object- * @protected- */- _setStyles: function(newstyles)- {- var styles = this.get("styles");- return this._mergeStyles(newstyles, styles);- },- - /**- * Merges to object literals so that only specified properties are - * overwritten.- *- * @method _mergeStyles- * @param {Object} a Hash of new styles- * @param {Object} b Hash of original styles- * @return Object- * @protected- */- _mergeStyles: function(a, b)- {- if(!b)- {- b = {};- }- var newstyles = Y.merge(b, {});- Y.Object.each(a, function(value, key, a)- {- if(b.hasOwnProperty(key) && Y_Lang.isObject(value) && !Y_Lang.isFunction(value) && !Y_Lang.isArray(value))- {- newstyles[key] = this._mergeStyles(value, b[key]);- }- else- {- newstyles[key] = value;- }- }, this);- return newstyles;- },-- /**- * Gets the default value for the `styles` attribute. - *- * @method _getDefaultStyles- * @return Object- * @protected- */- _getDefaultStyles: function()- {- return {padding:{- top:0,- right: 0,- bottom: 0,- left: 0- }};- }-};--Y.augment(Renderer, Y.Attribute);-Y.Renderer = Renderer;--/**- * Algorithmic strategy for rendering a left axis.- *- * @module charts- * @class LeftAxisLayout- * @constructor- */-LeftAxisLayout = function() {};--LeftAxisLayout.prototype = {- /**- * Default margins for text fields.- *- * @private- * @method _getDefaultMargins- * @return Object- */- _getDefaultMargins: function() - {- return {- top: 0,- left: 0,- right: 4,- bottom: 0- };- },-- /**- * Sets the length of the tick on either side of the axis line.- *- * @method setTickOffset- * @protected- */- setTickOffsets: function()- {- var host = this,- majorTicks = host.get("styles").majorTicks,- tickLength = majorTicks.length,- halfTick = tickLength * 0.5,- display = majorTicks.display;- host.set("topTickOffset", 0);- host.set("bottomTickOffset", 0);- - switch(display)- {- case "inside" :- host.set("rightTickOffset", tickLength);- host.set("leftTickOffset", 0);- break;- case "outside" : - host.set("rightTickOffset", 0);- host.set("leftTickOffset", tickLength);- break;- case "cross":- host.set("rightTickOffset", halfTick); - host.set("leftTickOffset", halfTick);- break;- default:- host.set("rightTickOffset", 0);- host.set("leftTickOffset", 0);- break;- }- },- - /**- * Draws a tick- *- * @method drawTick- * @param {Path} path reference to the path `Path` element in which to draw the tick.- * @param {Object} pt Point on the axis in which the tick will intersect.- * @param {Object} tickStyle Hash of properties to apply to the tick.- * @protected- */- drawTick: function(path, pt, tickStyles)- {- var host = this,- style = host.get("styles"),- padding = style.padding,- tickLength = tickStyles.length,- start = {x:padding.left, y:pt.y},- end = {x:tickLength + padding.left, y:pt.y};- host.drawLine(path, start, end);- },-- /**- * Calculates the coordinates for the first point on an axis.- *- * @method getLineStart- * @return {Object}- * @protected- */- getLineStart: function()- {- var style = this.get("styles"),- padding = style.padding,- majorTicks = style.majorTicks,- tickLength = majorTicks.length,- display = majorTicks.display,- pt = {x:padding.left, y:0};- if(display === "outside")- {- pt.x += tickLength;- }- else if(display === "cross")- {- pt.x += tickLength/2;- }- return pt; - },- - /**- * Calculates the point for a label.- *- * @method getLabelPoint- * @param {Object} point Point on the axis in which the tick will intersect.- * @return {Object} - * @protected- */- getLabelPoint: function(point)- {- return {x:point.x - this.get("leftTickOffset"), y:point.y};- },- - /**- * Updates the value for the `maxLabelSize` for use in calculating total size.- *- * @method updateMaxLabelSize- * @param {HTMLElement} label to measure- * @protected- */- updateMaxLabelSize: function(labelWidth, labelHeight)- {- var host = this,- props = this._labelRotationProps,- rot = props.rot,- absRot = props.absRot,- sinRadians = props.sinRadians,- cosRadians = props.cosRadians,- max;- if(rot === 0)- {- max = labelWidth;- }- else if(absRot === 90)- {- max = labelHeight;- }- else- {- max = (cosRadians * labelWidth) + (sinRadians * labelHeight);- }- host._maxLabelSize = Math.max(host._maxLabelSize, max);- },- - /**- * Determines the available label width when the axis width has been explicitly set.- *- * @method getExplicitlySized- * @return Boolean- * @protected- */- getExplicitlySized: function(styles)- {- if(this._explicitWidth)- {- var host = this,- w = host._explicitWidth,- totalTitleSize = host._totalTitleSize,- leftTickOffset = host.get("leftTickOffset"),- margin = styles.label.margin.right;- host._maxLabelSize = w - (leftTickOffset + margin + totalTitleSize);- return true;- }- return false;- },-- /**- * Rotate and position title.- *- * @method positionTitle- * @param {HTMLElement} label to rotate position- * @protected- */- positionTitle: function(label)- {- var host = this,- bounds = host._titleBounds,- margin = host.get("styles").title.margin,- props = host._titleRotationProps,- w = bounds.right - bounds.left,- labelWidth = label.offsetWidth,- labelHeight = label.offsetHeight,- x = (labelWidth * -0.5) + (w * 0.5),- y = (host.get("height") * 0.5) - (labelHeight * 0.5);- props.labelWidth = labelWidth;- props.labelHeight = labelHeight;- if(margin && margin.left)- {- x += margin.left;- }- props.x = x;- props.y = y;- props.transformOrigin = [0.5, 0.5];- host._rotate(label, props);- },-- /**- * Rotate and position labels.- *- * @method positionLabel- * @param {HTMLElement} label to rotate position- * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned- * against.- * @protected- */- positionLabel: function(label, pt, styles, i)- {- var host = this,- tickOffset = host.get("leftTickOffset"),- totalTitleSize = this._totalTitleSize,- leftOffset = pt.x + totalTitleSize - tickOffset,- topOffset = pt.y,- props = this._labelRotationProps,- rot = props.rot,- absRot = props.absRot,- maxLabelSize = host._maxLabelSize,- labelWidth = this._labelWidths[i],- labelHeight = this._labelHeights[i];- if(rot === 0)- {- leftOffset -= labelWidth;- topOffset -= labelHeight * 0.5;- }- else if(rot === 90)- {- leftOffset -= labelWidth * 0.5;- }- else if(rot === -90)- {- leftOffset -= labelWidth * 0.5;- topOffset -= labelHeight;- }- else- {- leftOffset -= labelWidth + (labelHeight * absRot/360);- topOffset -= labelHeight * 0.5;- }- props.labelWidth = labelWidth;- props.labelHeight = labelHeight;- props.x = Math.round(maxLabelSize + leftOffset);- props.y = Math.round(topOffset);- this._rotate(label, props);- },-- /**- * Adjusts the coordinates of an axis label based on the rotation.- *- * @method _setRotationCoords- * @param {Object} props Coordinates, dimension and rotation properties of the label.- * @protected- */- _setRotationCoords: function(props)- {- var rot = props.rot,- absRot = props.absRot,- leftOffset,- topOffset,- labelWidth = props.labelWidth,- labelHeight = props.labelHeight;- if(rot === 0)- {- leftOffset = labelWidth;- topOffset = labelHeight * 0.5;- }- else if(rot === 90)- {- topOffset = 0;- leftOffset = labelWidth * 0.5;- }- else if(rot === -90)- {- leftOffset = labelWidth * 0.5;- topOffset = labelHeight;- }- else- {- leftOffset = labelWidth + (labelHeight * absRot/360);- topOffset = labelHeight * 0.5;- }- props.x -= leftOffset;- props.y -= topOffset;- },-- /**- * Returns the transformOrigin to use for an axis label based on the position of the axis - * and the rotation of the label.- *- * @method _getTransformOrigin- * @param {Number} rot The rotation (in degrees) of the label.- * @return Array- * @protected- */- _getTransformOrigin: function(rot)- {- var transformOrigin;- if(rot === 0)- {- transformOrigin = [0, 0];- }- else if(rot === 90)- {- transformOrigin = [0.5, 0];- }- else if(rot === -90)- {- transformOrigin = [0.5, 1];- }- else- {- transformOrigin = [1, 0.5];- }- return transformOrigin;- },-- /**- * Adjust the position of the Axis widget's content box for internal axes.- *- * @method offsetNodeForTick- * @param {Node} cb Content box of the Axis.- * @protected- */- offsetNodeForTick: function(cb)- {- },-- /**- * Sets the width of the axis based on its contents.- *- * @method setCalculatedSize- * @protected- */- setCalculatedSize: function()- {- var host = this,- graphic = this.get("graphic"),- style = host.get("styles"),- label = style.label,- tickOffset = host.get("leftTickOffset"),- max = host._maxLabelSize,- totalTitleSize = this._totalTitleSize,- ttl = Math.round(totalTitleSize + tickOffset + max + label.margin.right);- if(this._explicitWidth)- {- ttl = this._explicitWidth;- }- this.set("calculatedWidth", ttl);- graphic.set("x", ttl - tickOffset);- }-};--Y.LeftAxisLayout = LeftAxisLayout;-/**- * RightAxisLayout contains algorithms for rendering a right axis.- *- * @module charts- * @class RightAxisLayout- * @constructor- */-RightAxisLayout = function(){};--RightAxisLayout.prototype = {- /**- * Default margins for text fields.- *- * @private- * @method _getDefaultMargins- * @return Object- */- _getDefaultMargins: function() - {- return {- top: 0,- left: 4,- right: 0,- bottom: 0- };- },-- /**- * Sets the length of the tick on either side of the axis line.- *- * @method setTickOffset- * @protected- */- setTickOffsets: function()- {- var host = this,- majorTicks = host.get("styles").majorTicks,- tickLength = majorTicks.length,- halfTick = tickLength * 0.5,- display = majorTicks.display;- host.set("topTickOffset", 0);- host.set("bottomTickOffset", 0);- - switch(display)- {- case "inside" :- host.set("leftTickOffset", tickLength);- host.set("rightTickOffset", 0);- break;- case "outside" : - host.set("leftTickOffset", 0);- host.set("rightTickOffset", tickLength);- break;- case "cross" :- host.set("rightTickOffset", halfTick);- host.set("leftTickOffset", halfTick);- break;- default:- host.set("leftTickOffset", 0);- host.set("rightTickOffset", 0);- break;- }- },-- /**- * Draws a tick- *- * @method drawTick- * @param {Path} path reference to the path `Path` element in which to draw the tick.- * @param {Object} pt Point on the axis in which the tick will intersect.- * @param {Object) tickStyle Hash of properties to apply to the tick.- * @protected- */- drawTick: function(path, pt, tickStyles)- {- var host = this,- style = host.get("styles"),- padding = style.padding,- tickLength = tickStyles.length,- start = {x:padding.left, y:pt.y},- end = {x:padding.left + tickLength, y:pt.y};- host.drawLine(path, start, end);- },- - /**- * Calculates the coordinates for the first point on an axis.- *- * @method getLineStart- * @return {Object}- * @protected- */- getLineStart: function()- {- var host = this,- style = host.get("styles"),- padding = style.padding,- majorTicks = style.majorTicks,- tickLength = majorTicks.length,- display = majorTicks.display,- pt = {x:padding.left, y:padding.top};- if(display === "inside")- {- pt.x += tickLength;- }- else if(display === "cross")- {- pt.x += tickLength/2;- }- return pt;- },- - /**- * Calculates the point for a label.- *- * @method getLabelPoint- * @param {Object} point Point on the axis in which the tick will intersect.- * @return {Object} - * @protected- */- getLabelPoint: function(point)- {- return {x:point.x + this.get("rightTickOffset"), y:point.y};- },- - /**- * Updates the value for the `maxLabelSize` for use in calculating total size.- *- * @method updateMaxLabelSize- * @param {HTMLElement} label to measure- * @protected- */- updateMaxLabelSize: function(labelWidth, labelHeight)- {- var host = this,- props = this._labelRotationProps,- rot = props.rot,- absRot = props.absRot,- sinRadians = props.sinRadians,- cosRadians = props.cosRadians,- max;- if(rot === 0)- {- max = labelWidth;- }- else if(absRot === 90)- {- max = labelHeight;- }- else- {- max = (cosRadians * labelWidth) + (sinRadians * labelHeight);- }- host._maxLabelSize = Math.max(host._maxLabelSize, max);- },- - /**- * Determines the available label width when the axis width has been explicitly set.- *- * @method getExplicitlySized- * @return Boolean- * @protected- */- getExplicitlySized: function(styles)- {- if(this._explicitWidth)- {- var host = this,- w = host._explicitWidth,- totalTitleSize = this._totalTitleSize,- rightTickOffset = host.get("rightTickOffset"),- margin = styles.label.margin.right;- host._maxLabelSize = w - (rightTickOffset + margin + totalTitleSize);- return true;- }- return false;- },-- /**- * Rotate and position title.- *- * @method positionTitle- * @param {HTMLElement} label to rotate position- * @protected- */- positionTitle: function(label)- {- var host = this,- bounds = host._titleBounds,- margin = host.get("styles").title.margin,- props = host._titleRotationProps,- labelWidth = label.offsetWidth,- labelHeight = label.offsetHeight,- w = bounds.right - bounds.left,- x = this.get("width") - (labelWidth * 0.5) - (w * 0.5),- y = (host.get("height") * 0.5) - (labelHeight * 0.5);- props.labelWidth = labelWidth;- props.labelHeight = labelHeight;- if(margin && margin.right)- {- x -= margin.left;- }- props.x = x;- props.y = y;- props.transformOrigin = [0.5, 0.5];- host._rotate(label, props);- },-- /**- * Rotate and position labels.- *- * @method positionLabel- * @param {HTMLElement} label to rotate position- * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned- * against.- * @protected- */- positionLabel: function(label, pt, styles, i)- {- var host = this,- tickOffset = host.get("rightTickOffset"),- labelStyles = styles.label,- margin = 0,- leftOffset = pt.x,- topOffset = pt.y,- props = this._labelRotationProps,- rot = props.rot,- absRot = props.absRot,- labelWidth = this._labelWidths[i],- labelHeight = this._labelHeights[i];- if(labelStyles.margin && labelStyles.margin.left)- {- margin = labelStyles.margin.left;- }- if(rot === 0)- {- topOffset -= labelHeight * 0.5;- }- else if(rot === 90)- {- leftOffset -= labelWidth * 0.5;- topOffset -= labelHeight;- }- else if(rot === -90)- {- leftOffset -= labelWidth * 0.5;- }- else- {- topOffset -= labelHeight * 0.5;- leftOffset += labelHeight/2 * absRot/90;- }- leftOffset += margin;- leftOffset += tickOffset;- props.labelWidth = labelWidth;- props.labelHeight = labelHeight;- props.x = Math.round(leftOffset);- props.y = Math.round(topOffset);- this._rotate(label, props);- },- - /**- * Adjusts the coordinates of an axis label based on the rotation.- *- * @method _setRotationCoords- * @param {Object} props Coordinates, dimension and rotation properties of the label.- * @protected- */- _setRotationCoords: function(props)- {- var rot = props.rot,- absRot = props.absRot,- leftOffset = 0,- topOffset = 0,- labelWidth = props.labelWidth,- labelHeight = props.labelHeight;- if(rot === 0)- {- topOffset = labelHeight * 0.5;- }- else if(rot === 90)- {- leftOffset = labelWidth * 0.5;- topOffset = labelHeight;- }- else if(rot === -90)- {- leftOffset = labelWidth * 0.5;- }- else- {- topOffset = labelHeight * 0.5;- leftOffset = labelHeight/2 * absRot/90;- }- props.x -= leftOffset;- props.y -= topOffset;- },- - /**- * Returns the transformOrigin to use for an axis label based on the position of the axis - * and the rotation of the label.- *- * @method _getTransformOrigin- * @param {Number} rot The rotation (in degrees) of the label.- * @return Array- * @protected- */- _getTransformOrigin: function(rot)- {- var transformOrigin;- if(rot === 0)- {- transformOrigin = [0, 0];- }- else if(rot === 90)- {- transformOrigin = [0.5, 1];- }- else if(rot === -90)- {- transformOrigin = [0.5, 0];- }- else- {- transformOrigin = [0, 0.5];- }- return transformOrigin;- },-- /**- * Adjusts position for inner ticks.- *- * @method offsetNodeForTick- * @param {Node} cb contentBox of the axis- * @protected- */- offsetNodeForTick: function(cb)- {- var host = this,- tickOffset = host.get("leftTickOffset"),- offset = 0 - tickOffset;- cb.setStyle("left", offset);- },-- /**- * Assigns a height based on the size of the contents.- *- * @method setCalculatedSize- * @protected- */- setCalculatedSize: function()- {- var host = this,- styles = host.get("styles"),- labelStyle = styles.label,- totalTitleSize = this._totalTitleSize,- ttl = Math.round(host.get("rightTickOffset") + host._maxLabelSize + totalTitleSize + labelStyle.margin.left);- if(this._explicitWidth)- {- ttl = this._explicitWidth;- }- host.set("calculatedWidth", ttl);- host.get("contentBox").setStyle("width", ttl);- }-};--Y.RightAxisLayout = RightAxisLayout;-/**- * Contains algorithms for rendering a bottom axis.- *- * @module charts- * @class BottomAxisLayout- * @Constructor- */-BottomAxisLayout = function(){};--BottomAxisLayout.prototype = {- /**- * Default margins for text fields.- *- * @private- * @method _getDefaultMargins- * @return Object- */- _getDefaultMargins: function() - {- return {- top: 4,- left: 0,- right: 0,- bottom: 0- };- },-- /**- * Sets the length of the tick on either side of the axis line.- *- * @method setTickOffsets- * @protected- */- setTickOffsets: function()- {- var host = this,- majorTicks = host.get("styles").majorTicks,- tickLength = majorTicks.length,- halfTick = tickLength * 0.5,- display = majorTicks.display;- host.set("leftTickOffset", 0);- host.set("rightTickOffset", 0);-- switch(display)- {- case "inside" :- host.set("topTickOffset", tickLength);- host.set("bottomTickOffset", 0);- break;- case "outside" : - host.set("topTickOffset", 0);- host.set("bottomTickOffset", tickLength);- break;- case "cross":- host.set("topTickOffset", halfTick);- host.set("bottomTickOffset", halfTick);- break;- default:- host.set("topTickOffset", 0);- host.set("bottomTickOffset", 0);- break;- }- },-- /**- * Calculates the coordinates for the first point on an axis.- *- * @method getLineStart- * @protected- */- getLineStart: function()- {- var style = this.get("styles"),- padding = style.padding,- majorTicks = style.majorTicks,- tickLength = majorTicks.length,- display = majorTicks.display,- pt = {x:0, y:padding.top};- if(display === "inside")- {- pt.y += tickLength;- }- else if(display === "cross")- {- pt.y += tickLength/2;- }- return pt; - },- - /**- * Draws a tick- *- * @method drawTick- * @param {Path} path reference to the path `Path` element in which to draw the tick.- * @param {Object} pt hash containing x and y coordinates- * @param {Object} tickStyles hash of properties used to draw the tick- * @protected- */- drawTick: function(path, pt, tickStyles)- {- var host = this,- style = host.get("styles"),- padding = style.padding,- tickLength = tickStyles.length,- start = {x:pt.x, y:padding.top},- end = {x:pt.x, y:tickLength + padding.top};- host.drawLine(path, start, end);- },-- /**- * Calculates the point for a label.- *- * @method getLabelPoint- * @param {Object} pt Object containing x and y coordinates- * @return Object- * @protected- */- getLabelPoint: function(point)- {- return {x:point.x, y:point.y + this.get("bottomTickOffset")};- },- - /**- * Updates the value for the `maxLabelSize` for use in calculating total size.- *- * @method updateMaxLabelSize- * @param {HTMLElement} label to measure- * @protected- */- updateMaxLabelSize: function(labelWidth, labelHeight)- {- var host = this,- props = this._labelRotationProps,- rot = props.rot,- absRot = props.absRot,- sinRadians = props.sinRadians,- cosRadians = props.cosRadians,- max;- if(rot === 0)- {- max = labelHeight;- }- else if(absRot === 90)- {- max = labelWidth;- }- else- {- max = (sinRadians * labelWidth) + (cosRadians * labelHeight); - }- host._maxLabelSize = Math.max(host._maxLabelSize, max);- },- - /**- * Determines the available label height when the axis width has been explicitly set.- *- * @method getExplicitlySized- * @return Boolean- * @protected- */- getExplicitlySized: function(styles)- {- if(this._explicitHeight)- {- var host = this,- h = host._explicitHeight,- totalTitleSize = host._totalTitleSize,- bottomTickOffset = host.get("bottomTickOffset"),- margin = styles.label.margin.right;- host._maxLabelSize = h - (bottomTickOffset + margin + totalTitleSize);- return true;- }- return false;- },-- /**- * Rotate and position title.- *- * @method positionTitle- * @param {HTMLElement} label to rotate position- * @protected- */- positionTitle: function(label)- {- var host = this,- bounds = host._titleBounds,- margin = host.get("styles").title.margin,- props = host._titleRotationProps,- h = bounds.bottom - bounds.top,- labelWidth = label.offsetWidth,- labelHeight = label.offsetHeight,- x = (host.get("width") * 0.5) - (labelWidth * 0.5),- y = host.get("height") - labelHeight/2 - h/2;- props.labelWidth = labelWidth;- props.labelHeight = labelHeight;- if(margin && margin.bottom)- {- y -= margin.bottom;- }- props.x = x;- props.y = y;- props.transformOrigin = [0.5, 0.5];- host._rotate(label, props);- },- - /**- * Rotate and position labels.- *- * @method positionLabel- * @param {HTMLElement} label to rotate position- * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned- * against.- * @protected- */- positionLabel: function(label, pt, styles, i)- {- var host = this,- tickOffset = host.get("bottomTickOffset"),- labelStyles = styles.label,- margin = 0,- props = host._labelRotationProps,- rot = props.rot,- absRot = props.absRot,- leftOffset = Math.round(pt.x),- topOffset = Math.round(pt.y),- labelWidth = host._labelWidths[i],- labelHeight = host._labelHeights[i];- if(labelStyles.margin && labelStyles.margin.top)- {- margin = labelStyles.margin.top;- }- if(rot > 0)- {- topOffset -= labelHeight/2 * rot/90;- }- else if(rot < 0)- {- leftOffset -= labelWidth;- topOffset -= labelHeight/2 * absRot/90;- }- else- {- leftOffset -= labelWidth * 0.5;- }- topOffset += margin;- topOffset += tickOffset;- props.labelWidth = labelWidth;- props.labelHeight = labelHeight;- props.x = leftOffset;- props.y = topOffset;- host._rotate(label, props);- },- - /**- * Adjusts the coordinates of an axis label based on the rotation.- *- * @method _setRotationCoords- * @param {Object} props Coordinates, dimension and rotation properties of the label.- * @protected- */- _setRotationCoords: function(props)- {- var rot = props.rot,- absRot = props.absRot,- labelWidth = props.labelWidth,- labelHeight = props.labelHeight,- leftOffset,- topOffset;-- if(rot > 0)- {- leftOffset = 0;- topOffset = labelHeight/2 * rot/90;- }- else if(rot < 0)- {- leftOffset = labelWidth;- topOffset = labelHeight/2 * absRot/90;- }- else- {- leftOffset = labelWidth * 0.5;- topOffset = 0;- }- props.x -= leftOffset;- props.y -= topOffset;- },-- /**- * Returns the transformOrigin to use for an axis label based on the position of the axis - * and the rotation of the label.- *- * @method _getTransformOrigin- * @param {Number} rot The rotation (in degrees) of the label.- * @return Array- * @protected- */- _getTransformOrigin: function(rot)- {- var transformOrigin;- if(rot > 0)- {- transformOrigin = [0, 0.5];- }- else if(rot < 0)- {- transformOrigin = [1, 0.5];- }- else- {- transformOrigin = [0, 0];- }- return transformOrigin;- },-- /**- * Adjusts position for inner ticks.- *- * @method offsetNodeForTick- * @param {Node} cb contentBox of the axis- * @protected- */- offsetNodeForTick: function(cb)- {- var host = this;- host.get("contentBox").setStyle("top", 0 - host.get("topTickOffset"));- },-- /**- * Assigns a height based on the size of the contents.- *- * @method setCalculatedSize- * @protected- */- setCalculatedSize: function()- {- var host = this,- styles = host.get("styles"),- labelStyle = styles.label,- totalTitleSize = host._totalTitleSize,- ttl = Math.round(host.get("bottomTickOffset") + host._maxLabelSize + labelStyle.margin.top + totalTitleSize);- if(host._explicitHeight)- {- ttl = host._explicitHeight;- }- host.set("calculatedHeight", ttl);- }-};-Y.BottomAxisLayout = BottomAxisLayout;-/**- * Contains algorithms for rendering a top axis.- *- * @module charts- * @class TopAxisLayout- * @constructor- */-TopAxisLayout = function(){};--TopAxisLayout.prototype = {- /**- * Default margins for text fields.- *- * @private- * @method _getDefaultMargins- * @return Object- */- _getDefaultMargins: function() - {- return {- top: 0,- left: 0,- right: 0,- bottom: 4- };- },- - /**- * Sets the length of the tick on either side of the axis line.- *- * @method setTickOffsets- * @protected- */- setTickOffsets: function()- {- var host = this,- majorTicks = host.get("styles").majorTicks,- tickLength = majorTicks.length,- halfTick = tickLength * 0.5,- display = majorTicks.display;- host.set("leftTickOffset", 0);- host.set("rightTickOffset", 0);- switch(display)- {- case "inside" :- host.set("bottomTickOffset", tickLength);- host.set("topTickOffset", 0);- break;- case "outside" : - host.set("bottomTickOffset", 0);- host.set("topTickOffset", tickLength);- break;- case "cross" :- host.set("topTickOffset", halfTick);- host.set("bottomTickOffset", halfTick);- break;- default:- host.set("topTickOffset", 0);- host.set("bottomTickOffset", 0);- break;- }- },-- /**- * Calculates the coordinates for the first point on an axis.- *- * @method getLineStart- * @protected- */- getLineStart: function()- {- var host = this,- style = host.get("styles"),- padding = style.padding,- majorTicks = style.majorTicks,- tickLength = majorTicks.length,- display = majorTicks.display,- pt = {x:0, y:padding.top};- if(display === "outside")- {- pt.y += tickLength;- }- else if(display === "cross")- {- pt.y += tickLength/2;- }- return pt; - },- - /**- * Draws a tick- *- * @method drawTick- * @param {Path} path reference to the path `Path` element in which to draw the tick.- * @param {Object} pt hash containing x and y coordinates- * @param {Object} tickStyles hash of properties used to draw the tick- * @protected- */- drawTick: function(path, pt, tickStyles)- {- var host = this,- style = host.get("styles"),- padding = style.padding,- tickLength = tickStyles.length,- start = {x:pt.x, y:padding.top},- end = {x:pt.x, y:tickLength + padding.top};- host.drawLine(path, start, end);- },- - /**- * Calculates the point for a label.- *- * @method getLabelPoint- * @param {Object} pt hash containing x and y coordinates- * @return Object- * @protected- */- getLabelPoint: function(pt)- {- return {x:pt.x, y:pt.y - this.get("topTickOffset")};- },- - /**- * Updates the value for the `maxLabelSize` for use in calculating total size.- *- * @method updateMaxLabelSize- * @param {HTMLElement} label to measure- * @protected- */- updateMaxLabelSize: function(labelWidth, labelHeight)- {- var host = this,- props = this._labelRotationProps,- rot = props.rot,- absRot = props.absRot,- sinRadians = props.sinRadians,- cosRadians = props.cosRadians,- max;- if(rot === 0)- {- max = labelHeight;- }- else if(absRot === 90)- {- max = labelWidth;- }- else- {- max = (sinRadians * labelWidth) + (cosRadians * labelHeight); - }- host._maxLabelSize = Math.max(host._maxLabelSize, max);- },-- /**- * Determines the available label height when the axis width has been explicitly set.- *- * @method getExplicitlySized- * @return Boolean- * @protected- */- getExplicitlySized: function(styles)- {- if(this._explicitHeight)- {- var host = this,- h = host._explicitHeight,- totalTitleSize = host._totalTitleSize,- topTickOffset = host.get("topTickOffset"),- margin = styles.label.margin.right;- host._maxLabelSize = h - (topTickOffset + margin + totalTitleSize);- return true;- }- return false;- },-- /**- * Rotate and position title.- *- * @method positionTitle- * @param {HTMLElement} label to rotate position- * @protected- */- positionTitle: function(label)- {- var host = this,- bounds = host._titleBounds,- margin = host.get("styles").title.margin,- props = host._titleRotationProps,- labelWidth = label.offsetWidth,- labelHeight = label.offsetHeight,- h = bounds.bottom - bounds.top,- x = (host.get("width") * 0.5) - (labelWidth * 0.5),- y = h/2 - labelHeight/2;- props.labelWidth = labelWidth;- props.labelHeight = labelHeight;- if(margin && margin.top)- {- y += margin.top;- }- props.x = x;- props.y = y;- props.transformOrigin = [0.5, 0.5];- host._rotate(label, props);- },-- /**- * Rotate and position labels.- *- * @method positionLabel- * @param {HTMLElement} label to rotate position- * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned- * against.- * @protected- */- positionLabel: function(label, pt, styles, i)- {- var host = this,- totalTitleSize = this._totalTitleSize,- maxLabelSize = host._maxLabelSize,- leftOffset = pt.x,- topOffset = pt.y + totalTitleSize + maxLabelSize,- props = this._labelRotationProps,- rot = props.rot,- absRot = props.absRot,- labelWidth = this._labelWidths[i],- labelHeight = this._labelHeights[i];- if(rot === 0)- {- leftOffset -= labelWidth * 0.5;- topOffset -= labelHeight;- }- else- {- if(rot === 90)- {- leftOffset -= labelWidth;- topOffset -= (labelHeight * 0.5);- }- else if (rot === -90)- {- topOffset -= (labelHeight * 0.5);- } - else if(rot > 0)- {- leftOffset -= labelWidth;- topOffset -= labelHeight - (labelHeight * rot/180);- }- else- {- topOffset -= labelHeight - (labelHeight * absRot/180);- }- }- props.x = Math.round(leftOffset);- props.y = Math.round(topOffset);- props.labelWidth = labelWidth;- props.labelHeight = labelHeight;- this._rotate(label, props);- },-- /**- * Adjusts the coordinates of an axis label based on the rotation.- *- * @method _setRotationCoords- * @param {Object} props Coordinates, dimension and rotation properties of the label.- * @protected- */- _setRotationCoords: function(props)- {- var rot = props.rot,- absRot = props.absRot,- labelWidth = props.labelWidth,- labelHeight = props.labelHeight,- leftOffset,- topOffset;- if(rot === 0)- {- leftOffset = labelWidth * 0.5;- topOffset = labelHeight;- }- else- {- if(rot === 90)- {- leftOffset = labelWidth;- topOffset = (labelHeight * 0.5);- }- else if (rot === -90)- {- topOffset = (labelHeight * 0.5);- } - else if(rot > 0)- {- leftOffset = labelWidth;- topOffset = labelHeight - (labelHeight * rot/180);- }- else- {- topOffset = labelHeight - (labelHeight * absRot/180);- }- }- props.x -= leftOffset;- props.y -= topOffset;- },-- /**- * Returns the transformOrigin to use for an axis label based on the position of the axis - * and the rotation of the label.- *- * @method _getTransformOrigin- * @param {Number} rot The rotation (in degrees) of the label.- * @return Array- * @protected- */- _getTransformOrigin: function(rot)- {- var transformOrigin;- if(rot === 0)- {- transformOrigin = [0, 0];- }- else- {- if(rot === 90)- {- transformOrigin = [1, 0.5];- }- else if (rot === -90)- {- transformOrigin = [0, 0.5];- } - else if(rot > 0)- {- transformOrigin = [1, 0.5];- }- else- {- transformOrigin = [0, 0.5];- }- }- return transformOrigin;- },-- /**- * Adjusts position for inner ticks.- *- * @method offsetNodeForTick- * @param {Node} cb contentBox of the axis- * @protected- */- offsetNodeForTick: function(cb)- {- },-- /**- * Assigns a height based on the size of the contents.- *- * @method setCalculatedSize- * @protected- */- setCalculatedSize: function()- {- var host = this,- graphic = host.get("graphic"),- styles = host.get("styles"),- labelMargin = styles.label.margin,- totalLabelSize = labelMargin.bottom + host._maxLabelSize,- totalTitleSize = host._totalTitleSize,- topTickOffset = this.get("topTickOffset"),- ttl = Math.round(topTickOffset + totalLabelSize + totalTitleSize);- if(this._explicitHeight)- {- ttl = this._explicitWidth; - }- host.set("calculatedHeight", ttl);- graphic.set("y", ttl - topTickOffset);- }-};-Y.TopAxisLayout = TopAxisLayout;--/**- * The Axis class. Generates axes for a chart.- *- * @module charts- * @class Axis- * @extends Widget- * @uses Renderer- * @constructor- * @param {Object} config (optional) Configuration parameters for the Chart.- */-Y.Axis = Y.Base.create("axis", Y.Widget, [Y.Renderer], {- /**- * Storage for calculatedWidth value.- *- * @property _calculatedWidth- * @type Number- * @private- */- _calculatedWidth: 0,-- /**- * Storage for calculatedHeight value.- *- * @property _calculatedHeight- * @type Number- * @private- */- _calculatedHeight: 0,-- /**- * Handles change to the dataProvider- * - * @method _dataChangeHandler- * @param {Object} e Event object- * @private- */- _dataChangeHandler: function(e)- {- if(this.get("rendered"))- {- this._drawAxis();- }- },-- /**- * Handles change to the position attribute- *- * @method _positionChangeHandler- * @param {Object} e Event object- * @private- */- _positionChangeHandler: function(e)- {- this._updateGraphic(e.newVal);- this._updateHandler();- },-- /**- * Updates the the Graphic instance- *- * @method _updateGraphic- * @param {String} position Position of axis - * @private- */- _updateGraphic: function(position)- {- var graphic = this.get("graphic");- if(position == "none")- {- if(graphic)- {- graphic.destroy();- }- }- else- {- if(!graphic)- {- this._setCanvas();- }- }- },-- /**- * Handles changes to axis.- *- * @method _updateHandler- * @param {Object} e Event object- * @private- */- _updateHandler: function(e)- {- if(this.get("rendered"))- {- this._drawAxis();- }- },- - /**- * @method renderUI- * @private- */- renderUI: function()- {- this._updateGraphic(this.get("position"));- },-- /**- * @method syncUI- * @private- */- syncUI: function()- {- var layout = this._layout,- defaultMargins,- styles,- label,- title,- i;- if(layout)- {- defaultMargins = layout._getDefaultMargins();- styles = this.get("styles");- label = styles.label.margin;- title =styles.title.margin;- //need to defaultMargins method to the layout classes.- for(i in defaultMargins)- {- if(defaultMargins.hasOwnProperty(i))- {- label[i] = label[i] === undefined ? defaultMargins[i] : label[i];- title[i] = title[i] === undefined ? defaultMargins[i] : title[i];- }- }- }- this._drawAxis();- },-- /**- * Creates a graphic instance to be used for the axis line and ticks.- *- * @method _setCanvas- * @private- */- _setCanvas: function()- {- var cb = this.get("contentBox"),- bb = this.get("boundingBox"),- p = this.get("position"),- pn = this._parentNode,- w = this.get("width"),- h = this.get("height");- bb.setStyle("position", "absolute");- bb.setStyle("zIndex", 2);- w = w ? w + "px" : pn.getStyle("width");- h = h ? h + "px" : pn.getStyle("height");- if(p === "top" || p === "bottom")- {- cb.setStyle("width", w);- }- else- {- cb.setStyle("height", h);- }- cb.setStyle("position", "relative");- cb.setStyle("left", "0px");- cb.setStyle("top", "0px");- this.set("graphic", new Y.Graphic());- this.get("graphic").render(cb);- },- - /**- * Gets the default value for the `styles` attribute. Overrides- * base implementation.- *- * @method _getDefaultStyles- * @return Object- * @protected- */- _getDefaultStyles: function()- {- var axisstyles = {- majorTicks: {- display:"inside",- length:4,- color:"#dad8c9",- weight:1,- alpha:1- },- minorTicks: {- display:"none",- length:2,- color:"#dad8c9",- weight:1- },- line: {- weight:1,- color:"#dad8c9",- alpha:1- },- majorUnit: {- determinant:"count",- count:11,- distance:75- },- top: "0px",- left: "0px",- width: "100px",- height: "100px",- label: {- color:"#808080",- alpha: 1,- fontSize:"85%",- rotation: 0,- margin: {- top: undefined,- right: undefined,- bottom: undefined,- left: undefined- }- },- title: {- color:"#808080",- alpha: 1,- fontSize:"85%",- rotation: undefined,- margin: {- top: undefined,- right: undefined,- bottom: undefined,- left: undefined- }- },- hideOverlappingLabelTicks: false- };- - return Y.merge(Y.Renderer.prototype._getDefaultStyles(), axisstyles); - },-- /**- * Updates the axis when the size changes.- *- * @method _handleSizeChange- * @param {Object} e Event object.- * @private- */- _handleSizeChange: function(e)- {- var attrName = e.attrName,- pos = this.get("position"),- vert = pos == "left" || pos == "right",- cb = this.get("contentBox"),- hor = pos == "bottom" || pos == "top";- cb.setStyle("width", this.get("width"));- cb.setStyle("height", this.get("height"));- if((hor && attrName == "width") || (vert && attrName == "height"))- {- this._drawAxis();- }- },- - /**- * Maps key values to classes containing layout algorithms- *- * @property _layoutClasses- * @type Object- * @private- */- _layoutClasses: - {- top : TopAxisLayout,- bottom: BottomAxisLayout,- left: LeftAxisLayout,- right : RightAxisLayout- },- - /**- * Draws a line segment between 2 points- *- * @method drawLine- * @param {Object} startPoint x and y coordinates for the start point of the line segment- * @param {Object} endPoint x and y coordinates for the for the end point of the line segment- * @param {Object} line styles (weight, color and alpha to be applied to the line segment)- * @private- */- drawLine: function(path, startPoint, endPoint)- {- path.moveTo(startPoint.x, startPoint.y);- path.lineTo(endPoint.x, endPoint.y);- },-- /**- * Generates the properties necessary for rotating and positioning a text field.- *- * @method _getTextRotationProps- * @param {Object} styles properties for the text field- * @return Object- * @private- */- _getTextRotationProps: function(styles)- {- if(styles.rotation === undefined)- {- switch(this.get("position"))- {- case "left" :- styles.rotation = -90;- break; - case "right" : - styles.rotation = 90;- break;- default :- styles.rotation = 0;- break;- }- }- var rot = Math.min(90, Math.max(-90, styles.rotation)),- absRot = Math.abs(rot),- radCon = Math.PI/180,- sinRadians = parseFloat(parseFloat(Math.sin(absRot * radCon)).toFixed(8)),- cosRadians = parseFloat(parseFloat(Math.cos(absRot * radCon)).toFixed(8));- return {- rot: rot,- absRot: absRot,- radCon: radCon,- sinRadians: sinRadians,- cosRadians: cosRadians,- textAlpha: styles.alpha- };- },-- /**- * Draws an axis. - *- * @method _drawAxis- * @private- */- _drawAxis: function ()- {- if(this._drawing)- {- this._callLater = true;- return;- }- this._drawing = true;- this._callLater = false;- if(this._layout)- {- var styles = this.get("styles"),- line = styles.line,- labelStyles = styles.label,- majorTickStyles = styles.majorTicks,- drawTicks = majorTickStyles.display != "none",- tickPoint,- majorUnit = styles.majorUnit,- len,- majorUnitDistance,- i = 0,- layout = this._layout,- layoutLength,- position,- lineStart,- label,- labelWidth,- labelHeight,- labelFunction = this.get("labelFunction"),- labelFunctionScope = this.get("labelFunctionScope"),- labelFormat = this.get("labelFormat"),- graphic = this.get("graphic"),- path = this.get("path"),- tickPath,- explicitlySized;- this._labelWidths = [];- this._labelHeights = [];- graphic.set("autoDraw", false);- path.clear();- path.set("stroke", {- weight: line.weight, - color: line.color, - opacity: line.alpha- });- this._labelRotationProps = this._getTextRotationProps(labelStyles);- this._labelRotationProps.transformOrigin = layout._getTransformOrigin(this._labelRotationProps.rot);- layout.setTickOffsets.apply(this);- layoutLength = this.getLength();- lineStart = layout.getLineStart.apply(this);- len = this.getTotalMajorUnits(majorUnit);- majorUnitDistance = this.getMajorUnitDistance(len, layoutLength, majorUnit);- this.set("edgeOffset", this.getEdgeOffset(len, layoutLength) * 0.5);- if(len < 1)- {- this._clearLabelCache();- }- else- {- tickPoint = this.getFirstPoint(lineStart);- this.drawLine(path, lineStart, this.getLineEnd(tickPoint));- if(drawTicks) - {- tickPath = this.get("tickPath");- tickPath.clear();- tickPath.set("stroke", {- weight: majorTickStyles.weight,- color: majorTickStyles.color,- opacity: majorTickStyles.alpha- });- layout.drawTick.apply(this, [tickPath, tickPoint, majorTickStyles]);- }- this._createLabelCache();- this._tickPoints = [];- this._maxLabelSize = 0; - this._totalTitleSize = 0;- this._titleSize = 0;- this._setTitle();- explicitlySized = layout.getExplicitlySized.apply(this, [styles]);- for(; i < len; ++i)- {- if(drawTicks) - {- layout.drawTick.apply(this, [tickPath, tickPoint, majorTickStyles]);- }- position = this.getPosition(tickPoint);- label = this.getLabel(tickPoint, labelStyles);- this._labels.push(label);- this._tickPoints.push({x:tickPoint.x, y:tickPoint.y});- this.get("appendLabelFunction")(label, labelFunction.apply(labelFunctionScope, [this.getLabelByIndex(i, len), labelFormat]));- labelWidth = Math.round(label.offsetWidth);- labelHeight = Math.round(label.offsetHeight);- if(!explicitlySized)- {- this._layout.updateMaxLabelSize.apply(this, [labelWidth, labelHeight]);- }- this._labelWidths.push(labelWidth);- this._labelHeights.push(labelHeight);- tickPoint = this.getNextPoint(tickPoint, majorUnitDistance);- }- this._clearLabelCache();- if(this.get("overlapGraph"))- {- layout.offsetNodeForTick.apply(this, [this.get("contentBox")]);- }- layout.setCalculatedSize.apply(this);- if(this._titleTextField)- {- this._layout.positionTitle.apply(this, [this._titleTextField]);- }- for(i = 0; i < len; ++i)- {- layout.positionLabel.apply(this, [this.get("labels")[i], this._tickPoints[i], styles, i]);- }- }- }- this._drawing = false;- if(this._callLater)- {- this._drawAxis();- }- else- {- this._updatePathElement();- this.fire("axisRendered");- }- },- - /**- * Calculates and sets the total size of a title.- *- * @method _setTotalTitleSize- * @param {Object} styles Properties for the title field.- * @private- */- _setTotalTitleSize: function(styles)- {- var title = this._titleTextField,- w = title.offsetWidth,- h = title.offsetHeight,- rot = this._titleRotationProps.rot,- bounds,- size,- margin = styles.margin,- position = this.get("position"),- matrix = new Y.Matrix();- matrix.rotate(rot);- bounds = matrix.getContentRect(w, h);- if(position == "left" || position == "right")- {- size = bounds.right - bounds.left;- if(margin)- {- size += margin.left + margin.right;- }- }- else- {- size = bounds.bottom - bounds.top;- if(margin)- {- size += margin.top + margin.bottom;- }- }- this._titleBounds = bounds;- this._totalTitleSize = size;- },-- /**- * Updates path.- *- * @method _updatePathElement- * @private- */- _updatePathElement: function()- {- var path = this._path,- tickPath = this._tickPath,- redrawGraphic = false,- graphic = this.get("graphic");- if(path)- {- redrawGraphic = true;- path.end();- }- if(tickPath)- {- redrawGraphic = true;- tickPath.end();- }- if(redrawGraphic)- {- graphic._redraw();- }- },-- /**- * Updates the content and style properties for a title field.- *- * @method _updateTitle- * @private- */- _setTitle: function()- {- var i,- styles,- customStyles,- title = this.get("title"),- titleTextField = this._titleTextField,- parentNode;- if(title !== null && title !== undefined)- {- customStyles = {- rotation: "rotation",- margin: "margin",- alpha: "alpha"- };- styles = this.get("styles").title;- if(!titleTextField)- {- titleTextField = DOCUMENT.createElement('span');- titleTextField.style.display = "block";- titleTextField.style.whiteSpace = "nowrap";- titleTextField.setAttribute("class", "axisTitle");- this.get("contentBox").append(titleTextField);- }- else if(!DOCUMENT.createElementNS)- {- if(titleTextField.style.filter)- {- titleTextField.style.filter = null;- }- }- titleTextField.style.position = "absolute";- for(i in styles)- {- if(styles.hasOwnProperty(i) && !customStyles.hasOwnProperty(i))- {- titleTextField.style[i] = styles[i];- }- }- this.get("appendTitleFunction")(titleTextField, title);- this._titleTextField = titleTextField;- this._titleRotationProps = this._getTextRotationProps(styles);- this._setTotalTitleSize(styles);- }- else if(titleTextField)- {- parentNode = titleTextField.parentNode;- if(parentNode)- {- parentNode.removeChild(titleTextField);- }- this._titleTextField = null;- this._totalTitleSize = 0;- }- },-- /**- * Creates or updates an axis label.- *- * @method getLabel- * @param {Object} pt x and y coordinates for the label- * @param {Object} styles styles applied to label- * @return HTMLElement - * @private- */- getLabel: function(pt, styles)- {- var i,- label,- labelCache = this._labelCache,- customStyles = {- rotation: "rotation",- margin: "margin",- alpha: "alpha"- };- if(labelCache && labelCache.length > 0)- {- label = labelCache.shift();- }- else- {- label = DOCUMENT.createElement("span");- label.className = Y.Lang.trim([label.className, "axisLabel"].join(' '));- this.get("contentBox").append(label);- }- if(!DOCUMENT.createElementNS)- {- if(label.style.filter)- {- label.style.filter = null;- }- }- label.style.display = "block";- label.style.whiteSpace = "nowrap";- label.style.position = "absolute";- for(i in styles)- {- if(styles.hasOwnProperty(i) && !customStyles.hasOwnProperty(i))- {- label.style[i] = styles[i];- }- }- return label;- },-- /**- * Creates a cache of labels that can be re-used when the axis redraws.- *- * @method _createLabelCache- * @private- */- _createLabelCache: function()- {- if(this._labels)- {- while(this._labels.length > 0)- {- this._labelCache.push(this._labels.shift());- }- }- else- {- this._clearLabelCache();- }- this._labels = [];- },- - /**- * Removes axis labels from the dom and clears the label cache.- *- * @method _clearLabelCache- * @private- */- _clearLabelCache: function()- {- if(this._labelCache)- {- var len = this._labelCache.length,- i = 0,- label;- for(; i < len; ++i)- {- label = this._labelCache[i];- this._removeChildren(label);- Y.Event.purgeElement(label, true);- label.parentNode.removeChild(label);- }- }- this._labelCache = [];- },-- /**- * Gets the end point of an axis.- *- * @method getLineEnd- * @return Object- * @private - */- getLineEnd: function(pt)- {- var w = this.get("width"),- h = this.get("height"),- pos = this.get("position");- if(pos === "top" || pos === "bottom")- {- return {x:w, y:pt.y};- }- else- {- return {x:pt.x, y:h};- }- },-- /**- * Calcuates the width or height of an axis depending on its direction.- *- * @method getLength- * @return Number- * @private- */- getLength: function()- {- var l,- style = this.get("styles"),- padding = style.padding,- w = this.get("width"),- h = this.get("height"),- pos = this.get("position");- if(pos === "top" || pos === "bottom")- {- l = w - (padding.left + padding.right);- }- else- {- l = h - (padding.top + padding.bottom);- }- return l;- },-- /**- * Gets the position of the first point on an axis.- *- * @method getFirstPoint- * @param {Object} pt Object containing x and y coordinates.- * @return Object- * @private- */- getFirstPoint:function(pt)- {- var style = this.get("styles"),- pos = this.get("position"),- padding = style.padding,- np = {x:pt.x, y:pt.y};- if(pos === "top" || pos === "bottom")- {- np.x += padding.left + this.get("edgeOffset");- }- else- {- np.y += this.get("height") - (padding.top + this.get("edgeOffset"));- }- return np;- },-- /**- * Gets the position of the next point on an axis.- *- * @method getNextPoint- * @param {Object} point Object containing x and y coordinates.- * @param {Number} majorUnitDistance Distance in pixels between ticks.- * @return Object- * @private- */- getNextPoint: function(point, majorUnitDistance)- {- var pos = this.get("position");- if(pos === "top" || pos === "bottom")- {- point.x = point.x + majorUnitDistance; - }- else- {- point.y = point.y - majorUnitDistance;- }- return point;- },-- /**- * Calculates the placement of last tick on an axis.- *- * @method getLastPoint- * @return Object- * @private - */- getLastPoint: function()- {- var style = this.get("styles"),- padding = style.padding,- w = this.get("width"),- pos = this.get("position");- if(pos === "top" || pos === "bottom")- {- return {x:w - padding.right, y:padding.top};- }- else- {- return {x:padding.left, y:padding.top};- }- },-- /**- * Calculates position on the axis.- *- * @method getPosition- * @param {Object} point contains x and y values- * @private - */- getPosition: function(point)- {- var p,- h = this.get("height"),- style = this.get("styles"),- padding = style.padding,- pos = this.get("position"),- dataType = this.get("dataType");- if(pos === "left" || pos === "right") - {- //Numeric data on a vertical axis is displayed from bottom to top.- //Categorical and Timeline data is displayed from top to bottom.- if(dataType === "numeric")- {- p = (h - (padding.top + padding.bottom)) - (point.y - padding.top);- }- else- {- p = point.y - padding.top;- }- }- else- {- p = point.x - padding.left;- }- return p;- },-- /**- * Rotates and positions a text field.- *- * @method _rotate- * @param {HTMLElement} label text field to rotate and position- * @param {Object} props properties to be applied to the text field. - * @private- */- _rotate: function(label, props)- {- var rot = props.rot,- x = props.x,- y = props.y,- filterString,- textAlpha,- matrix = new Y.Matrix(),- transformOrigin = props.transformOrigin || [0, 0],- offsetRect;- if(DOCUMENT.createElementNS)- {- matrix.translate(x, y);- matrix.rotate(rot);- label.style.MozTransformOrigin = (transformOrigin[0] * 100) + "% " + (transformOrigin[1] * 100) + "%";- label.style.MozTransform = matrix.toCSSText();- label.style.webkitTransformOrigin = (transformOrigin[0] * 100) + "% " + (transformOrigin[1] * 100) + "%";- label.style.webkitTransform = matrix.toCSSText();- label.style.msTransformOrigin = (transformOrigin[0] * 100) + "% " + (transformOrigin[1] * 100) + "%";- label.style.msTransform = matrix.toCSSText();- label.style.OTransformOrigin = (transformOrigin[0] * 100) + "% " + (transformOrigin[1] * 100) + "%";- label.style.OTransform = matrix.toCSSText();- }- else- {- textAlpha = props.textAlpha;- if(Y_Lang.isNumber(textAlpha) && textAlpha < 1 && textAlpha > -1 && !isNaN(textAlpha))- {- filterString = "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + Math.round(textAlpha * 100) + ")";- }- if(rot !== 0)- {- //ms filters kind of, sort of uses a transformOrigin of 0, 0. - //we'll translate the difference to create a true 0, 0 origin.- matrix.rotate(rot);- offsetRect = matrix.getContentRect(props.labelWidth, props.labelHeight);- matrix.init();- matrix.translate(offsetRect.left, offsetRect.top);- matrix.translate(x, y);- this._simulateRotateWithTransformOrigin(matrix, rot, transformOrigin, props.labelWidth, props.labelHeight);- if(filterString)- {- filterString += " ";- }- else- {- filterString = ""; - }- filterString += matrix.toFilterText();- label.style.left = matrix.dx + "px";- label.style.top = matrix.dy + "px";- }- else- {- label.style.left = x + "px";- label.style.top = y + "px";- }- if(filterString)- {- label.style.filter = filterString;- }- }- },- - /**- * Simulates a rotation with a specified transformOrigin. - *- * @method _simulateTransformOrigin- * @param {Matrix} matrix Reference to a `Matrix` instance.- * @param {Number} rot The rotation (in degrees) that will be performed on a matrix.- * @param {Array} transformOrigin An array represeniting the origin in which to perform the transform. The first - * index represents the x origin and the second index represents the y origin.- * @param {Number} w The width of the object that will be transformed.- * @param {Number} h The height of the object that will be transformed.- * @private- */- _simulateRotateWithTransformOrigin: function(matrix, rot, transformOrigin, w, h)- {- var transformX = transformOrigin[0] * w,- transformY = transformOrigin[1] * h;- transformX = !isNaN(transformX) ? transformX : 0;- transformY = !isNaN(transformY) ? transformY : 0;- matrix.translate(transformX, transformY);- matrix.rotate(rot);- matrix.translate(-transformX, -transformY);- },-- /**- * Returns the coordinates (top, right, bottom, left) for the bounding box of the last label. - *- * @method getMaxLabelBounds- * @return Object- */- getMaxLabelBounds: function()- {- return this._getLabelBounds(this.getMaximumValue());- },-- /**- * Returns the coordinates (top, right, bottom, left) for the bounding box of the first label. - *- * @method getMinLabelBounds- * @return Object- */- getMinLabelBounds: function()- {- return this._getLabelBounds(this.getMinimumValue());- },- - /**- * Returns the coordinates (top, right, bottom, left) for the bounding box of a label. - *- * @method _getLabelBounds- * @param {String} Value of the label- * @return Object- * @private- */- _getLabelBounds: function(val)- {- var layout = this._layout,- labelStyles = this.get("styles").label,- matrix = new Y.Matrix(),- label,- props = this._getTextRotationProps(labelStyles);- props.transformOrigin = layout._getTransformOrigin(props.rot);- label = this.getLabel({x: 0, y: 0}, labelStyles);- this.get("appendLabelFunction")(label, this.get("labelFunction").apply(this, [val, this.get("labelFormat")]));- props.labelWidth = label.offsetWidth;- props.labelHeight = label.offsetHeight;- this._removeChildren(label);- Y.Event.purgeElement(label, true);- label.parentNode.removeChild(label);- props.x = 0;- props.y = 0;- layout._setRotationCoords(props);- matrix.translate(props.x, props.y);- this._simulateRotateWithTransformOrigin(matrix, props.rot, props.transformOrigin, props.labelWidth, props.labelHeight);- return matrix.getContentRect(props.labelWidth, props.labelHeight);- },-- /**- * Removes all DOM elements from an HTML element. Used to clear out labels during detruction- * phase.- *- * @method _removeChildren- * @private- */- _removeChildren: function(node)- {- if(node.hasChildNodes())- {- var child;- while(node.firstChild)- {- child = node.firstChild;- this._removeChildren(child);- node.removeChild(child);- }- }- },- - /**- * Destructor implementation Axis class. Removes all labels and the Graphic instance from the widget.- *- * @method destructor- * @protected- */- destructor: function()- {- var cb = this.get("contentBox").getDOMNode(),- labels = this.get("labels"),- graphic = this.get("graphic"),- label,- len = labels ? labels.length : 0;- if(len > 0)- {- while(labels.length > 0)- {- label = labels.shift();- this._removeChildren(label);- cb.removeChild(label);- label = null;- }- }- if(graphic)- {- graphic.destroy();- }- },-- /**- * Length in pixels of largest text bounding box. Used to calculate the height of the axis.- *- * @property maxLabelSize- * @type Number- * @protected- */- _maxLabelSize: 0,- - /**- * Updates the content of text field. This method writes a value into a text field using - * `appendChild`. If the value is a `String`, it is converted to a `TextNode` first. - *- * @method _setText- * @param label {HTMLElement} label to be updated- * @param val {String} value with which to update the label- * @private- */- _setText: function(textField, val)- { - textField.innerHTML = "";- if(Y_Lang.isNumber(val))- {- val = val + "";- }- else if(!val)- {- val = "";- }- if(IS_STRING(val))- {- val = DOCUMENT.createTextNode(val);- }- textField.appendChild(val);- }-}, {- ATTRS: - {- /**- * When set, defines the width of a vertical axis instance. By default, vertical axes automatically size based on their contents. When the- * width attribute is set, the axis will not calculate its width. When the width attribute is explicitly set, axis labels will postion themselves off of the - * the inner edge of the axis and the title, if present, will position itself off of the outer edge. If a specified width is less than the sum of - * the axis' contents, excess content will overflow.- *- * @attribute width- * @type Number- */- width: {- lazyAdd: false,-- getter: function() - {- if(this._explicitWidth)- {- return this._explicitWidth; - }- return this._calculatedWidth;- },-- setter: function(val)- {- this._explicitWidth = val;- return val;- }- },-- /**- * When set, defines the height of a horizontal axis instance. By default, horizontal axes automatically size based on their contents. When the- * height attribute is set, the axis will not calculate its height. When the height attribute is explicitly set, axis labels will postion themselves off of the - * the inner edge of the axis and the title, if present, will position itself off of the outer edge. If a specified height is less than the sum of - * the axis' contents, excess content will overflow.- *- * @attribute height- * @type Number- */- height: {- lazyAdd: false,-- getter: function() - {- if(this._explicitHeight)- {- return this._explicitHeight; - }- return this._calculatedHeight;- },-- setter: function(val)- {- this._explicitHeight = val;- return val;- }- },-- /**- * Calculated value of an axis' width. By default, the value is used internally for vertical axes. If the `width` attribute is explicitly set, this value will be ignored.- *- * @attribute calculatedWidth- * @type Number- * @private- */- calculatedWidth: {- getter: function()- {- return this._calculatedWidth;- },-- setter: function(val)- {- this._calculatedWidth = val;- return val;- }- },-- /**- * Calculated value of an axis' height. By default, the value is used internally for horizontal axes. If the `height` attribute is explicitly set, this value will be ignored.- *- * @attribute calculatedHeight- * @type Number- * @private- */- calculatedHeight: {- getter: function()- {- return this._calculatedHeight;- },-- setter: function(val)- {- this._calculatedHeight = val;- return val;- }- },-- /**- * Difference betweend the first/last tick and edge of axis.- *- * @attribute edgeOffset- * @type Number- * @protected- */- edgeOffset: - {- value: 0- },-- /**- * The graphic in which the axis line and ticks will be rendered.- *- * @attribute graphic- * @type Graphic- */- graphic: {},- - /**- * @attribute path- * @type Shape- * @readOnly- * @private- */- path: {- readOnly: true,-- getter: function()- {- if(!this._path)- {- var graphic = this.get("graphic");- if(graphic)- {- this._path = graphic.addShape({type:"path"});- }- }- return this._path;- }- },-- /**- * @attribute tickPath- * @type Shape- * @readOnly- * @private- */- tickPath: {- readOnly: true,-- getter: function()- {- if(!this._tickPath)- {- var graphic = this.get("graphic");- if(graphic)- {- this._tickPath = graphic.addShape({type:"path"});- }- }- return this._tickPath;- }- },- - /**- * Contains the contents of the axis. - *- * @attribute node- * @type HTMLElement- */- node: {},-- /**- * Direction of the axis.- *- * @attribute position- * @type String- */- position: {- setter: function(val)- {- var layoutClass = this._layoutClasses[val];- if(val && val != "none")- {- this._layout = new layoutClass();- }- return val;- }- },-- /**- * Distance determined by the tick styles used to calculate the distance between the axis- * line in relation to the top of the axis.- *- * @attribute topTickOffset- * @type Number- */- topTickOffset: {- value: 0- },-- /**- * Distance determined by the tick styles used to calculate the distance between the axis- * line in relation to the bottom of the axis.- *- * @attribute bottomTickOffset- * @type Number- */- bottomTickOffset: {- value: 0- },-- /**- * Distance determined by the tick styles used to calculate the distance between the axis- * line in relation to the left of the axis.- *- * @attribute leftTickOffset- * @type Number- */- leftTickOffset: {- value: 0- },-- /**- * Distance determined by the tick styles used to calculate the distance between the axis- * line in relation to the right side of the axis.- *- * @attribute rightTickOffset- * @type Number- */- rightTickOffset: {- value: 0- },- - /**- * Collection of labels used to render the axis.- *- * @attribute labels- * @type Array- */- labels: {- readOnly: true,- getter: function()- {- return this._labels;- }- },-- /**- * Collection of points used for placement of labels and ticks along the axis.- *- * @attribute tickPoints- * @type Array- */- tickPoints: {- readOnly: true,-- getter: function()- {- if(this.get("position") == "none")- {- return this.get("styles").majorUnit.count;- }- return this._tickPoints;- }- },-- /**- * Indicates whether the axis overlaps the graph. If an axis is the inner most axis on a given- * position and the tick position is inside or cross, the axis will need to overlap the graph.- *- * @attribute overlapGraph- * @type Boolean- */- overlapGraph: {- value:true,-- validator: function(val)- {- return Y_Lang.isBoolean(val);- }- },-- /**- * Object which should have by the labelFunction- *- * @attribute labelFunctionScope- * @type Object- */- labelFunctionScope: {},- - /**- * Length in pixels of largest text bounding box. Used to calculate the height of the axis.- *- * @attribute maxLabelSize- * @type Number- * @protected- */- maxLabelSize: {- getter: function()- {- return this._maxLabelSize;- },-- setter: function(val)- {- this._maxLabelSize = val;- return val; - }- },- - /**- * Title for the axis. When specified, the title will display. The position of the title is determined by the axis position. - * <dl>- * <dt>top</dt><dd>Appears above the axis and it labels. The default rotation is 0.</dd>- * <dt>right</dt><dd>Appears to the right of the axis and its labels. The default rotation is 90.</dd>- * <dt>bottom</dt><dd>Appears below the axis and its labels. The default rotation is 0.</dd>- * <dt>left</dt><dd>Appears to the left of the axis and its labels. The default rotation is -90.</dd>- * </dl>- *- * @attribute title- * @type String- */- title: {- value: null- },- - /**- * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need- * to implement the arguments below and return a `String` or `HTMLElement`. - * <dl>- * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>- * <dt>format</dt><dd>Template for formatting label. (optional)</dd>- * </dl>- *- * @attribute labelFunction- * @type Function- */- labelFunction: {- value: function(val, format)- {- return val;- }- },- - /**- * Function used to append an axis value to an axis label. This function has the following signature:- * <dl>- * <dt>textField</dt><dd>The axis label to be appended. (`HTMLElement`)</dd>- * <dt>val</dt><dd>The value to attach to the text field. This method will accept an `HTMLELement`- * or a `String`. This method does not use (`HTMLElement` | `String`)</dd>- * </dl>- * The default method appends a value to the `HTMLElement` using the `appendChild` method. If the given - * value is a `String`, the method will convert the the value to a `textNode` before appending to the - * `HTMLElement`. This method will not convert an `HTMLString` to an `HTMLElement`. - *- * @attribute appendLabelFunction- * @type Function- */- appendLabelFunction: {- getter: function()- {- return this._setText;- }- },- - /**- * Function used to append a title value to the title object. This function has the following signature:- * <dl>- * <dt>textField</dt><dd>The title text field to be appended. (`HTMLElement`)</dd>- * <dt>val</dt><dd>The value to attach to the text field. This method will accept an `HTMLELement`- * or a `String`. This method does not use (`HTMLElement` | `String`)</dd>- * </dl>- * The default method appends a value to the `HTMLElement` using the `appendChild` method. If the given - * value is a `String`, the method will convert the the value to a `textNode` before appending to the - * `HTMLElement` element. This method will not convert an `HTMLString` to an `HTMLElement`. - *- * @attribute appendTitleFunction- * @type Function- */- appendTitleFunction: {- getter: function()- {- return this._setText;- }- }- - /**- * Style properties used for drawing an axis. This attribute is inherited from `Renderer`. Below are the default values:- * <dl>- * <dt>majorTicks</dt><dd>Properties used for drawing ticks.- * <dl>- * <dt>display</dt><dd>Position of the tick. Possible values are `inside`, `outside`, `cross` and `none`. The- * default value is `inside`.</dd>- * <dt>length</dt><dd>The length (in pixels) of the tick. The default value is 4.</dd>- * <dt>color</dt><dd>The color of the tick. The default value is `#dad8c9`</dd>- * <dt>weight</dt><dd>Number indicating the width of the tick. The default value is 1.</dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the tick. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>line</dt><dd>Properties used for drawing the axis line. - * <dl>- * <dt>weight</dt><dd>Number indicating the width of the axis line. The default value is 1.</dd>- * <dt>color</dt><dd>The color of the axis line. The default value is `#dad8c9`.</dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the tick. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>majorUnit</dt><dd>Properties used to calculate the `majorUnit` for the axis. - * <dl>- * <dt>determinant</dt><dd>The algorithm used for calculating distance between ticks. The possible options are `count` and `distance`. If- * the `determinant` is `count`, the axis ticks will spaced so that a specified number of ticks appear on the axis. If the `determinant`- * is `distance`, the axis ticks will spaced out according to the specified distance. The default value is `count`.</dd>- * <dt>count</dt><dd>Number of ticks to appear on the axis when the `determinant` is `count`. The default value is 11.</dd>- * <dt>distance</dt><dd>The distance (in pixels) between ticks when the `determinant` is `distance`. The default value is 75.</dd>- * </dl>- * </dd>- * <dt>label</dt><dd>Properties and styles applied to the axis labels.- * <dl>- * <dt>color</dt><dd>The color of the labels. The default value is `#808080`.</dd>- * <dt>alpha</dt><dd>Number between 0 and 1 indicating the opacity of the labels. The default value is 1.</dd>- * <dt>fontSize</dt><dd>The font-size of the labels. The default value is 85%</dd>- * <dt>rotation</dt><dd>The rotation, in degrees (between -90 and 90) of the labels. The default value is 0.</dd>- * <dt>margin</dt><dd>The distance between the label and the axis/tick. Depending on the position of the `Axis`, only one of the properties used.- * <dl>- * <dt>top</dt><dd>Pixel value used for an axis with a `position` of `bottom`. The default value is 4.</dd>- * <dt>right</dt><dd>Pixel value used for an axis with a `position` of `left`. The default value is 4.</dd>- * <dt>bottom</dt><dd>Pixel value used for an axis with a `position` of `top`. The default value is 4.</dd>- * <dt>left</dt><dd>Pixel value used for an axis with a `position` of `right`. The default value is 4.</dd>- * </dl>- * </dd>- * </dl>- * </dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});-/**- * AxisType is an abstract class that manages the data for an axis.- *- * @module charts- * @class AxisType- * @constructor- * @extends Axis- */-Y.AxisType = Y.Base.create("baseAxis", Y.Axis, [], {- /**- * @method initializer- * @private- */- initializer: function()- {- this.after("dataReady", Y.bind(this._dataChangeHandler, this));- this.after("dataUpdate", Y.bind(this._dataChangeHandler, this));- this.after("minimumChange", Y.bind(this._keyChangeHandler, this));- this.after("maximumChange", Y.bind(this._keyChangeHandler, this));- this.after("keysChange", this._keyChangeHandler);- this.after("dataProviderChange", this._dataProviderChangeHandler);- this.after("alwaysShowZeroChange", this._keyChangeHandler);- this.after("roundingMethodChange", this._keyChangeHandler);- },-- /**- * @method bindUI- * @private- */- bindUI: function()- {- this.after("stylesChange", this._updateHandler);- this.after("overlapGraphChange", this._updateHandler);- this.after("positionChange", this._positionChangeHandler);- this.after("widthChange", this._handleSizeChange);- this.after("heightChange", this._handleSizeChange);- this.after("calculatedWidthChange", this._handleSizeChange);- this.after("calculatedHeightChange", this._handleSizeChange);- },-- /**- * Handles changes to `dataProvider`.- *- * @method _dataProviderChangeHandler- * @param {Object} e Event object.- * @private- */- _dataProviderChangeHandler: function(e)- {- var keyCollection = this.get("keyCollection").concat(),- keys = this.get("keys"),- i;- if(keys)- {- for(i in keys)- {- if(keys.hasOwnProperty(i))- {- delete keys[i];- }- }- }- if(keyCollection && keyCollection.length)- {- this.set("keys", keyCollection);- }- },-- /**- * Constant used to generate unique id.- *- * @property GUID- * @type String- * @private- */- GUID: "yuibaseaxis",- - /**- * Type of data used in `Axis`.- *- * @property _type- * @type String - * @readOnly- * @private- */- _type: null,- - /**- * Storage for `setMaximum` attribute.- *- * @property _setMaximum- * @type Object- * @private- */- _setMaximum: null,- - /**- * Storage for `dataMaximum` attribute.- *- * @property _dataMaximum- * @type Object- * @private- */- _dataMaximum: null,- - /**- * Storage for `setMinimum` attribute.- *- * @property _setMinimum- * @type Object- * @private- */- _setMinimum: null,- - /**- * Reference to data array.- *- * @property _data- * @type Array- * @private- */- _data: null,-- /**- * Indicates whether the all data is up to date.- *- * @property _updateTotalDataFlag- * @type Boolean- * @private- */- _updateTotalDataFlag: true,-- /**- * Storage for `dataReady` attribute.- *- * @property _dataReady- * @type Boolean- * @readOnly- * @private- */- _dataReady: false,- - /**- * Adds an array to the key hash.- *- * @method addKey- * @param value Indicates what key to use in retrieving- * the array.- */- addKey: function (value)- {- this.set("keys", value);- },-- /**- * Gets an array of values based on a key.- *- * @method _getKeyArray- * @param {String} key Value key associated with the data array.- * @param {Array} data Array in which the data resides.- * @return Array- * @private- */- _getKeyArray: function(key, data)- {- var i = 0,- obj,- keyArray = [],- len = data.length;- for(; i < len; ++i)- {- obj = data[i];- keyArray[i] = obj[key];- }- return keyArray;- },-- /**- * Sets data by key- *- * @method _setDataByKey- * @param {String} key Key value to use.- * @param {Array} data Array to use.- * @private - */- _setDataByKey: function(key, data)- {- var i,- obj, - arr = [], - dv = this._dataClone.concat(), - len = dv.length;- for(i = 0; i < len; ++i)- {- obj = dv[i];- arr[i] = obj[key];- }- this.get("keys")[key] = arr;- this._updateTotalDataFlag = true;- },-- /**- * Updates the total data array.- *- * @method _updateTotalData- * @private- */- _updateTotalData: function()- {- var keys = this.get("keys"),- i;- this._data = [];- for(i in keys)- {- if(keys.hasOwnProperty(i))- {- this._data = this._data.concat(keys[i]);- }- }- this._updateTotalDataFlag = false;- },-- /**- * Removes an array from the key hash.- * - * @method removeKey- * @param {String} value Indicates what key to use in removing from - * the hash.- */- removeKey: function(value)- {- var keys = this.get("keys");- if(keys.hasOwnProperty(value)) - {- delete keys[value];- this._keyChangeHandler();- }- },-- /**- * Returns a value based of a key value and an index.- *- * @method getKeyValueAt- * @param {String} key value used to look up the correct array- * @param {Number} index within the array- * @return Number - */- getKeyValueAt: function(key, index)- {- var value = NaN,- keys = this.get("keys");- if(keys[key] && Y_Lang.isNumber(parseFloat(keys[key][index])))- {- value = keys[key][index];- }- return parseFloat(value);- },-- /**- * Returns an array of values based on an identifier key.- *- * @method getDataByKey- * @param {String} value value used to identify the array- * @return Object- */- getDataByKey: function (value)- {- var keys = this.get("keys");- if(keys[value])- {- return keys[value];- }- return null;- },-- /**- * Calculates the maximum and minimum values for the `Axis`.- *- * @method _updateMinAndMax- * @private - */- _updateMinAndMax: function() - {- var data = this.get("data"),- max = 0,- min = 0,- len,- num,- i;- if(data && data.length && data.length > 0)- {- len = data.length;- max = min = data[0];- if(len > 1)- {- for(i = 1; i < len; i++)- { - num = data[i];- if(isNaN(num))- {- continue;- }- max = Math.max(num, max);- min = Math.min(num, min);- }- }- }- this._dataMaximum = max;- this._dataMinimum = min;- },-- /**- * Returns the total number of majorUnits that will appear on an axis.- *- * @method getTotalMajorUnits- * @return Number- */- getTotalMajorUnits: function()- {- var units,- majorUnit = this.get("styles").majorUnit,- len = this.get("length");- if(majorUnit.determinant === "count") - {- units = majorUnit.count;- }- else if(majorUnit.determinant === "distance") - {- units = (len/majorUnit.distance) + 1;- }- return units; - },-- /**- * Returns the distance between major units on an axis.- *- * @method getMajorUnitDistance- * @param {Number} len Number of ticks- * @param {Number} uiLen Size of the axis.- * @param {Object} majorUnit Hash of properties used to determine the majorUnit- * @return Number- */- getMajorUnitDistance: function(len, uiLen, majorUnit)- {- var dist;- if(majorUnit.determinant === "count")- {- dist = uiLen/(len - 1);- }- else if(majorUnit.determinant === "distance")- {- dist = majorUnit.distance;- }- return dist;- },- - /**- * Gets the distance that the first and last ticks are offset from there respective- * edges.- *- * @method getEdgeOffset- * @param {Number} ct Number of ticks on the axis.- * @param {Number} l Length (in pixels) of the axis.- * @return Number- */- getEdgeOffset: function(ct, l)- {- return 0;- },-- /**- * Calculates and returns a value based on the number of labels and the index of- * the current label.- *- * @method getLabelByIndex- * @param {Number} i Index of the label.- * @param {Number} l Total number of labels.- * @return String- */- getLabelByIndex: function(i, l)- {- var min = this.get("minimum"),- max = this.get("maximum"),- increm = (max - min)/(l-1),- label;- l -= 1;- label = min + (i * increm);- return label;- },-- /**- * Updates the `Axis` after a change in keys.- *- * @method _keyChangeHandler- * @param {Object} e Event object.- * @private- */- _keyChangeHandler: function(e)- {- this._updateMinAndMax();- this.fire("dataUpdate");- },-- /**- * Checks to see if data extends beyond the range of the axis. If so,- * that data will need to be hidden. This method is internal, temporary and subject- * to removal in the future.- *- * @method _hasDataOverflow- * @protected- * @return Boolean- */- _hasDataOverflow: function()- {- if(this.get("setMin") || this.get("setMax"))- {- return true;- }- return false;- },-- /**- * Returns a string corresponding to the first label on an - * axis.- *- * @method getMinimumValue- * @return String- */- getMinimumValue: function()- {- return this.get("minimum");- },-- /**- * Returns a string corresponding to the last label on an - * axis.- *- * @method getMaximumValue- * @return String- */- getMaximumValue: function()- {- return this.get("maximum");- }-}, {- ATTRS: {- /**- * Hash of array identifed by a string value.- *- * @attribute keys- * @type Object- */- keys: {- value: {},-- setter: function(val)- {- var keys = {},- i, - len,- data = this.get("dataProvider");- if(Y_Lang.isArray(val))- {- len = val.length;- for(i = 0; i < len; ++i)- {- keys[val[i]] = this._getKeyArray(val[i], data); - }- - }- else if(Y_Lang.isString(val))- {- keys = this.get("keys");- keys[val] = this._getKeyArray(val, data);- }- else- {- for(i in val)- {- if(val.hasOwnProperty(i))- {- keys[i] = this._getKeyArray(i, data);- }- }- }- this._updateTotalDataFlag = true;- return keys;- }- },-- /**- *Indicates how to round unit values.- * <dl>- * <dt>niceNumber</dt><dd>Units will be smoothed based on the number of ticks and data range.</dd>- * <dt>auto</dt><dd>If the range is greater than 1, the units will be rounded.</dd>- * <dt>numeric value</dt><dd>Units will be equal to the numeric value.</dd>- * <dt>null</dt><dd>No rounding will occur.</dd>- * </dl>- *- * @attribute roundingMethod- * @type String- * @default niceNumber- */- roundingMethod: {- value: "niceNumber"- },-- /**- *Returns the type of axis data- * <dl>- * <dt>time</dt><dd>Manages time data</dd>- * <dt>stacked</dt><dd>Manages stacked numeric data</dd> - * <dt>numeric</dt><dd>Manages numeric data</dd>- * <dt>category</dt><dd>Manages categorical data</dd>- * </dl>- *- * @attribute type- * @type String- */- type:- {- readOnly: true,-- getter: function ()- {- return this._type;- }- },-- /**- * Instance of `ChartDataProvider` that the class uses- * to build its own data.- *- * @attribute dataProvider- * @type Array- */- dataProvider:{- setter: function (value)- {- return value;- }- },-- /**- * The maximum value contained in the `data` array. Used for- * `maximum` when `autoMax` is true.- *- * @attribute dataMaximum- * @type Number- */- dataMaximum: {- getter: function ()- {- if(!this._dataMaximum)- { - this._updateMinAndMax();- }- return this._dataMaximum;- }- },-- /**- * The maximum value that will appear on an axis.- *- * @attribute maximum- * @type Number- */- maximum: {- lazyAdd: false,-- getter: function ()- {- var max = this.get("dataMaximum"),- min = this.get("minimum");- //If all values are zero, force a range so that the Axis and related series- //will still render.- if(min === 0 && max === 0)- {- max = 10;- }- if(Y_Lang.isNumber(this._setMaximum))- {- max = this._setMaximum;- }- return parseFloat(max);- },- setter: function (value)- {- this._setMaximum = parseFloat(value);- return value;- }- },-- /**- * The minimum value contained in the `data` array. Used for- * `minimum` when `autoMin` is true.- *- * @attribute dataMinimum- * @type Number- */- dataMinimum: {- getter: function ()- {- if(!this._dataMinimum)- {- this._updateMinAndMax();- }- return this._dataMinimum;- }- },-- /**- * The minimum value that will appear on an axis.- *- * @attribute minimum- * @type Number- */- minimum: {- lazyAdd: false,-- getter: function ()- {- var min = this.get("dataMinimum");- if(Y_Lang.isNumber(this._setMinimum))- {- min = this._setMinimum;- }- return parseFloat(min);- },- setter: function(val)- {- this._setMinimum = parseFloat(val);- return val;- }- },-- /**- * Determines whether the maximum is calculated or explicitly - * set by the user.- *- * @attribute setMax- * @type Boolean- */- setMax: {- readOnly: true,-- getter: function()- {- return Y_Lang.isNumber(this._setMaximum);- }- },-- /**- * Determines whether the minimum is calculated or explicitly- * set by the user.- *- * @attribute setMin- * @type Boolean- */- setMin: {- readOnly: true,-- getter: function()- {- return Y_Lang.isNumber(this._setMinimum);- }- },-- /**- * Array of axis data- *- * @attribute data- * @type Array- */- data: {- getter: function ()- {- if(!this._data || this._updateTotalDataFlag)- {- this._updateTotalData();- }- return this._data;- }- },-- /**- * Array containing all the keys in the axis.- - * @attribute keyCollection- * @type Array- */- keyCollection: {- getter: function()- {- var keys = this.get("keys"),- i, - col = [];- for(i in keys)- {- if(keys.hasOwnProperty(i))- {- col.push(i);- }- }- return col;- },- readOnly: true- }- }-});-/**- * NumericAxis manages numeric data on an axis.- *- * @module charts- * @class NumericAxis- * @constructor- * @param {Object} config (optional) Configuration parameters for the Chart.- * @extends AxisType- */-function NumericAxis(config)-{- NumericAxis.superclass.constructor.apply(this, arguments);-}--NumericAxis.NAME = "numericAxis";--NumericAxis.ATTRS = {- /**- * Indicates whether 0 should always be displayed.- *- * @attribute alwaysShowZero- * @type Boolean- */- alwaysShowZero: {- value: true - },- - /**- * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need- * to implement the arguments below and return a `String` or an `HTMLElement`. The default implementation of the method returns a `String`. The output of this method- * will be rendered to the DOM using `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override the Axis' - * `appendLabelFunction` to accept html as a `String`.- * <dl>- * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>- * <dt>format</dt><dd>Object containing properties used to format the label. (optional)</dd>- * </dl>- *- * @attribute labelFunction- * @type Function- */- labelFunction: { - value: function(val, format)- {- if(format)- {- return Y.DataType.Number.format(val, format);- }- return val;- }- },-- /**- * Object containing properties used by the `labelFunction` to format a- * label.- *- * @attribute labelFormat- * @type Object- */- labelFormat: {- value: {- prefix: "",- thousandsSeparator: "",- decimalSeparator: "",- decimalPlaces: "0",- suffix: ""- }- }-};--Y.extend(NumericAxis, Y.AxisType,-{- /**- * Formats a label based on the axis type and optionally specified format.- *- * @method formatLabel- * @param {Object} value- * @param {Object} format Pattern used to format the value.- * @return String- */- formatLabel: function(val, format)- {- if(format)- {- return Y.DataType.Number.format(val, format);- }- return val;- },-- /**- * Returns the sum of all values per key.- *- * @method getTotalByKey- * @param {String} key The identifier for the array whose values will be calculated.- * @return Number- */- getTotalByKey: function(key)- {- var total = 0,- values = this.getDataByKey(key),- i = 0,- val,- len = values ? values.length : 0;- for(; i < len; ++i)- {- val = parseFloat(values[i]);- if(!isNaN(val))- {- total += val;- }- }- return total;- },-- /**- * Type of data used in `Axis`.- *- * @property _type- * @readOnly- * @private- */- _type: "numeric",-- /**- * Helper method for getting a `roundingUnit` when calculating the minimum and maximum values.- *- * @method _getMinimumUnit- * @param {Number} max Maximum number- * @param {Number} min Minimum number- * @param {Number} units Number of units on the axis- * @return Number- * @private- */- _getMinimumUnit:function(max, min, units)- {- return this._getNiceNumber(Math.ceil((max - min)/units));- },-- /**- * Calculates a nice rounding unit based on the range.- *- * @method _getNiceNumber- * @param {Number} roundingUnit The calculated rounding unit.- * @return Number- * @private- */- _getNiceNumber: function(roundingUnit)- {- var tempMajorUnit = roundingUnit,- order = Math.ceil(Math.log(tempMajorUnit) * 0.4342944819032518),- roundedMajorUnit = Math.pow(10, order),- roundedDiff;-- if (roundedMajorUnit / 2 >= tempMajorUnit) - {- roundedDiff = Math.floor((roundedMajorUnit / 2 - tempMajorUnit) / (Math.pow(10,order-1)/2));- tempMajorUnit = roundedMajorUnit/2 - roundedDiff*Math.pow(10,order-1)/2;- }- else - {- tempMajorUnit = roundedMajorUnit;- }- if(!isNaN(tempMajorUnit))- {- return tempMajorUnit;- }- return roundingUnit;-- },-- /**- * Calculates the maximum and minimum values for the `Axis`.- *- * @method _updateMinAndMax- * @private - */- _updateMinAndMax: function()- {- var data = this.get("data"),- max, - min,- len,- num,- i = 0,- key,- setMax = this.get("setMax"),- setMin = this.get("setMin");- if(!setMax || !setMin)- {- if(data && data.length && data.length > 0)- {- len = data.length;- for(; i < len; i++)- { - num = data[i];- if(isNaN(num))- {- if(Y_Lang.isObject(num))- {- min = max = 0;- //hloc values- for(key in num)- {- if(num.hasOwnProperty(key))- {- max = Math.max(num[key], max);- min = Math.min(num[key], min);- }- }- }- max = setMax ? this._setMaximum : max;- min = setMin ? this._setMinimum : min;- continue;- }- - if(setMin)- {- min = this._setMinimum;- }- else if(min === undefined)- {- min = num;- }- else- {- min = Math.min(num, min); - }- if(setMax)- {- max = this._setMaximum;- }- else if(max === undefined)- {- max = num;- }- else- {- max = Math.max(num, max);- }- - this._actualMaximum = max;- this._actualMinimum = min;- }- }- this._roundMinAndMax(min, max, setMin, setMax);- }- },-- /**- * Rounds the mimimum and maximum values based on the `roundingUnit` attribute.- *- * @method _roundMinAndMax- * @param {Number} min Minimum value- * @param {Number} max Maximum value- * @private- */- _roundMinAndMax: function(min, max, setMin, setMax)- {- var roundingUnit,- minimumRange,- minGreaterThanZero = min >= 0,- maxGreaterThanZero = max > 0,- dataRangeGreater,- maxRound,- minRound,- topTicks,- botTicks,- tempMax,- tempMin,- units = this.getTotalMajorUnits() - 1,- alwaysShowZero = this.get("alwaysShowZero"),- roundingMethod = this.get("roundingMethod"),- useIntegers = (max - min)/units >= 1;- if(roundingMethod)- {- if(roundingMethod == "niceNumber")- {- roundingUnit = this._getMinimumUnit(max, min, units);- if(minGreaterThanZero && maxGreaterThanZero)- {- if((alwaysShowZero || min < roundingUnit) && !setMin)- {- min = 0;- roundingUnit = this._getMinimumUnit(max, min, units);- }- else- {- min = this._roundDownToNearest(min, roundingUnit);- }- if(setMax)- {- if(!alwaysShowZero)- {- min = max - (roundingUnit * units);- }- }- else if(setMin)- {- max = min + (roundingUnit * units);- }- else- {- max = this._roundUpToNearest(max, roundingUnit);- }- }- else if(maxGreaterThanZero && !minGreaterThanZero)- {- if(alwaysShowZero)- {- topTicks = Math.round(units/((-1 * min)/max + 1));- topTicks = Math.max(Math.min(topTicks, units - 1), 1);- botTicks = units - topTicks;- tempMax = Math.ceil( max/topTicks );- tempMin = Math.floor( min/botTicks ) * -1;- - if(setMin)- {- while(tempMin < tempMax && botTicks >= 0)- {- botTicks--;- topTicks++;- tempMax = Math.ceil( max/topTicks );- tempMin = Math.floor( min/botTicks ) * -1;- }- //if there are any bottom ticks left calcualate the maximum by multiplying by the tempMin value- //if not, it's impossible to ensure that a zero is shown. skip it- if(botTicks > 0)- {- max = tempMin * topTicks;- }- else- {- max = min + (roundingUnit * units);- }- }- else if(setMax)- {- while(tempMax < tempMin && topTicks >= 0)- {- botTicks++;- topTicks--;- tempMin = Math.floor( min/botTicks ) * -1;- tempMax = Math.ceil( max/topTicks );- }- //if there are any top ticks left calcualate the minimum by multiplying by the tempMax value- //if not, it's impossible to ensure that a zero is shown. skip it- if(topTicks > 0)- {- min = tempMax * botTicks * -1;- }- else- {- min = max - (roundingUnit * units);- }- }- else- {- roundingUnit = Math.max(tempMax, tempMin);- roundingUnit = this._getNiceNumber(roundingUnit); - max = roundingUnit * topTicks;- min = roundingUnit * botTicks * -1;- }- }- else - {- if(setMax)- {- min = max - (roundingUnit * units);- }- else if(setMin)- {- max = min + (roundingUnit * units);- }- else- {- min = this._roundDownToNearest(min, roundingUnit);- max = this._roundUpToNearest(max, roundingUnit);- }- }- }- else- {- if(setMin)- {- if(alwaysShowZero)- {- max = 0;- }- else- {- max = min + (roundingUnit * units);- }- }- else if(!setMax)- {- if(alwaysShowZero || max === 0 || max + roundingUnit > 0)- {- max = 0;- roundingUnit = this._getMinimumUnit(max, min, units);- min = max - (roundingUnit * units);- }- else- {- min = this._roundDownToNearest(min, roundingUnit);- max = this._roundUpToNearest(max, roundingUnit);- }- }- else- {- min = max - (roundingUnit * units);- }- }- }- else if(roundingMethod == "auto") - {- if(minGreaterThanZero && maxGreaterThanZero)- {- if((alwaysShowZero || min < (max-min)/units) && !setMin)- {- min = 0;- }- - roundingUnit = (max - min)/units;- if(useIntegers)- {- roundingUnit = Math.ceil(roundingUnit);- }- max = min + (roundingUnit * units);- }- else if(maxGreaterThanZero && !minGreaterThanZero)- {- if(alwaysShowZero)- {- topTicks = Math.round( units / ( (-1 * min) /max + 1) );- topTicks = Math.max(Math.min(topTicks, units - 1), 1);- botTicks = units - topTicks;-- if(useIntegers)- {- tempMax = Math.ceil( max/topTicks );- tempMin = Math.floor( min/botTicks ) * -1;- }- else- {- tempMax = max/topTicks;- tempMin = min/botTicks * -1;- }- roundingUnit = Math.max(tempMax, tempMin);- max = roundingUnit * topTicks;- min = roundingUnit * botTicks * -1;- }- else- {- roundingUnit = (max - min)/units;- if(useIntegers)- {- roundingUnit = Math.ceil(roundingUnit);- }- min = this._roundDownToNearest(min, roundingUnit);- max = this._roundUpToNearest(max, roundingUnit);- }- }- else- {- roundingUnit = (max - min)/units;- if(useIntegers)- { - roundingUnit = Math.ceil(roundingUnit);- }- if(alwaysShowZero || max === 0 || max + roundingUnit > 0)- {- max = 0;- roundingUnit = (max - min)/units;- if(useIntegers)- {- Math.ceil(roundingUnit);- }- min = max - (roundingUnit * units);- }- else- {- min = this._roundDownToNearest(min, roundingUnit);- max = this._roundUpToNearest(max, roundingUnit);- }-- }- }- else if(!isNaN(roundingMethod) && isFinite(roundingMethod))- {- roundingUnit = roundingMethod;- minimumRange = roundingUnit * units;- dataRangeGreater = (max - min) > minimumRange;- minRound = this._roundDownToNearest(min, roundingUnit);- maxRound = this._roundUpToNearest(max, roundingUnit);- if(setMax)- {- min = max - minimumRange;- }- else if(setMin)- {- max = min + minimumRange;- }- else if(minGreaterThanZero && maxGreaterThanZero)- {- if(alwaysShowZero || minRound <= 0)- {- min = 0;- }- else- {- min = minRound;- }- max = min + minimumRange;- }- else if(maxGreaterThanZero && !minGreaterThanZero)- {- min = minRound;- max = maxRound;- }- else- {- if(alwaysShowZero || maxRound >= 0)- {- max = 0;- }- else- {- max = maxRound;- }- min = max - minimumRange;- }- }- }- this._dataMaximum = max;- this._dataMinimum = min;- },-- /**- * Calculates and returns a value based on the number of labels and the index of- * the current label.- *- * @method getLabelByIndex- * @param {Number} i Index of the label.- * @param {Number} l Total number of labels.- * @return String- */- getLabelByIndex: function(i, l)- {- var min = this.get("minimum"),- max = this.get("maximum"),- increm = (max - min)/(l-1),- label,- roundingMethod = this.get("roundingMethod");- l -= 1;- //respect the min and max. calculate all other labels.- if(i === 0)- {- label = min;- }- else if(i === l)- {- label = max;- }- else- {- label = (i * increm);- if(roundingMethod == "niceNumber")- {- label = this._roundToNearest(label, increm);- }- label += min;- }- return parseFloat(label);- },-- /**- * Rounds a Number to the nearest multiple of an input. For example, by rounding- * 16 to the nearest 10, you will receive 20. Similar to the built-in function Math.round().- *- * @method _roundToNearest- * @param {Number} number Number to round- * @param {Number} nearest Multiple to round towards.- * @return Number- * @private- */- _roundToNearest: function(number, nearest)- {- nearest = nearest || 1;- if(nearest === 0)- {- return number;- }- var roundedNumber = Math.round(this._roundToPrecision(number / nearest, 10)) * nearest;- return this._roundToPrecision(roundedNumber, 10);- },- - /**- * Rounds a Number up to the nearest multiple of an input. For example, by rounding- * 16 up to the nearest 10, you will receive 20. Similar to the built-in function Math.ceil().- *- * @method _roundUpToNearest- * @param {Number} number Number to round- * @param {Number} nearest Multiple to round towards.- * @return Number- * @private- */- _roundUpToNearest: function(number, nearest)- {- nearest = nearest || 1;- if(nearest === 0)- {- return number;- }- return Math.ceil(this._roundToPrecision(number / nearest, 10)) * nearest;- },- - /**- * Rounds a Number down to the nearest multiple of an input. For example, by rounding- * 16 down to the nearest 10, you will receive 10. Similar to the built-in function Math.floor().- *- * @method _roundDownToNearest- * @param {Number} number Number to round- * @param {Number} nearest Multiple to round towards.- * @return Number- * @private- */- _roundDownToNearest: function(number, nearest)- {- nearest = nearest || 1;- if(nearest === 0)- {- return number;- }- return Math.floor(this._roundToPrecision(number / nearest, 10)) * nearest;- },-- /**- * Rounds a number to a certain level of precision. Useful for limiting the number of- * decimal places on a fractional number.- *- * @method _roundToPrecision- * @param {Number} number Number to round- * @param {Number} precision Multiple to round towards.- * @return Number- * @private- */- _roundToPrecision: function(number, precision)- {- precision = precision || 0;- var decimalPlaces = Math.pow(10, precision);- return Math.round(decimalPlaces * number) / decimalPlaces;- },- - /**- * Checks to see if data extends beyond the range of the axis. If so,- * that data will need to be hidden. This method is internal, temporary and subject- * to removal in the future.- *- * @method _hasDataOverflow- * @protected- * @return Boolean- */- _hasDataOverflow: function()- {- var roundingMethod,- min,- max;- if(this.get("setMin") || this.get("setMax"))- {- return true;- }- roundingMethod = this.get("roundingMethod");- min = this._actualMinimum;- max = this._actualMaximum;- if(Y_Lang.isNumber(roundingMethod) && ((Y_Lang.isNumber(max) && max > this._dataMaximum) || (Y_Lang.isNumber(min) && min < this._dataMinimum)))- {- return true;- }- return false;- }-});--Y.NumericAxis = NumericAxis;- -/**- * StackedAxis manages stacked numeric data on an axis.- *- * @module charts- * @class StackedAxis- * @constructor- * @param {Object} config (optional) Configuration parameters for the Chart.- * @extends NumericAxis- */-function StackedAxis(config)-{- StackedAxis.superclass.constructor.apply(this, arguments);-}--StackedAxis.NAME = "stackedAxis";---Y.extend(StackedAxis, Y.NumericAxis,-{- /**- * Calculates the maximum and minimum values for the `Axis`.- *- * @method _updateMinAndMax- * @private - */- _updateMinAndMax: function()- {- var max = 0,- min = 0,- pos = 0,- neg = 0,- len = 0,- i = 0,- key,- num,- keys = this.get("keys"),- setMin = this.get("setMin"),- setMax = this.get("setMax");-- for(key in keys)- {- if(keys.hasOwnProperty(key))- {- len = Math.max(len, keys[key].length);- }- }- for(; i < len; ++i)- {- pos = 0;- neg = 0;- for(key in keys)- {- if(keys.hasOwnProperty(key))- {- num = keys[key][i];- if(isNaN(num))- {- continue;- }- if(num >= 0)- {- pos += num;- }- else- {- neg += num;- }- }- }- if(pos > 0)- {- max = Math.max(max, pos);- }- else - {- max = Math.max(max, neg);- }- if(neg < 0)- {- min = Math.min(min, neg);- }- else- {- min = Math.min(min, pos);- }- }- this._actualMaximum = max;- this._actualMinimum = min;- if(setMax)- {- max = this._setMaximum;- }- if(setMin)- {- min = this._setMinimum;- }- this._roundMinAndMax(min, max, setMin, setMax);- }-});--Y.StackedAxis = StackedAxis;- -/**- * TimeAxis manages time data on an axis.- *- * @module charts- * @class TimeAxis- * @constructor- * @param {Object} config (optional) Configuration parameters for the Chart.- * @extends AxisType- */-function TimeAxis(config)-{- TimeAxis.superclass.constructor.apply(this, arguments);-}--TimeAxis.NAME = "timeAxis";--TimeAxis.ATTRS = -{- /**- * Indicates whether the maximum is calculated or explicitly set. - *- * @attribute setMax- * @readOnly- * @type Boolean- * @private- */- setMax: {- readOnly: true,-- getter: function()- {- var max = this._getNumber(this._setMaximum);- return (Y_Lang.isNumber(max));- }- },-- /**- * Indicates whether the minimum is calculated or explicitly set. - *- * @attribute setMin- * @readOnly- * @type Boolean- * @private- */- setMin: {- readOnly: true,-- getter: function()- {- var min = this._getNumber(this._setMinimum);- return (Y_Lang.isNumber(min));- }- },-- /**- * The maximum value that will appear on an axis. Unless explicitly set, this value is calculated by the `Axis`.- *- * @attribute maximum- * @type Number- */- maximum: {- getter: function ()- {- var max = this._getNumber(this._setMaximum);- if(!Y_Lang.isNumber(max))- {- max = this._getNumber(this.get("dataMaximum"));- }- return parseFloat(max);- },- setter: function (value)- {- this._setMaximum = this._getNumber(value);- return value;- }- },-- /**- * The minimum value that will appear on an axis. Unless explicitly set, this value is calculated by the `Axis`.- *- * @attribute minimum- * @type Number- */- minimum: {- getter: function ()- {- var min = this._getNumber(this._setMinimum);- if(!Y_Lang.isNumber(min)) - {- min = this._getNumber(this.get("dataMinimum"));- }- return parseFloat(min);- },- setter: function (value)- {- this._setMinimum = this._getNumber(value);- return value;- }- },-- /**- * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need- * to implement the arguments below and return a `String` or an `HTMLElement`. The default implementation of the method returns a `String`. The output of this method- * will be rendered to the DOM using `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override the Axis' - * `appendLabelFunction` to accept html as a `String`.- * <dl>- * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>- * <dt>format</dt><dd>STRFTime string used to format the label. (optional)</dd>- * </dl>- *- * @attribute labelFunction- * @type Function- */- labelFunction: {- value: function(val, format)- {- val = Y.DataType.Date.parse(val);- if(format)- {- return Y.DataType.Date.format(val, {format:format});- }- return val;- }- },-- /**- * Pattern used by the `labelFunction` to format a label.- *- * @attribute labelFormat- * @type String- */- labelFormat: {- value: "%b %d, %y"- }-};--Y.extend(TimeAxis, Y.AxisType, {- /**- * Formats a label based on the axis type and optionally specified format.- *- * @method formatLabel- * @param {Object} value- * @param {Object} format Pattern used to format the value.- * @return String- */- formatLabel: function(val, format)- {- val = Y.DataType.Date.parse(val);- if(format)- {- return Y.DataType.Date.format(val, {format:format});- }- return val;- },-- /**- * Constant used to generate unique id.- *- * @property GUID- * @type String- * @private- */- GUID: "yuitimeaxis",- - /**- * Type of data used in `Axis`.- *- * @property _dataType- * @readOnly- * @private- */- _dataType: "time",- - /**- * Calculates and returns a value based on the number of labels and the index of- * the current label.- *- * @method getLabelByIndex- * @param {Number} i Index of the label.- * @param {Number} l Total number of labels.- * @return String- */- getLabelByIndex: function(i, l)- {- var min = this.get("minimum"),- max = this.get("maximum"),- position = this.get("position"),- increm,- label;- l -= 1;- increm = ((max - min)/l) * i;- if(position == "bottom" || position == "top")- {- label = min + increm;- }- else- {- label = max - increm;- }- return label;- },-- /**- * Gets an array of values based on a key.- *- * @method _getKeyArray- * @param {String} key Value key associated with the data array.- * @param {Array} data Array in which the data resides.- * @return Array- * @private- */- _getKeyArray: function(key, data)- {- var obj,- keyArray = [],- i = 0,- val,- len = data.length;- for(; i < len; ++i)- {- obj = data[i][key];- if(Y_Lang.isDate(obj))- { - val = obj.valueOf();- }- else- {- val = new Date(obj);- if(Y_Lang.isDate(val))- {- val = val.valueOf();- }- else if(!Y_Lang.isNumber(obj))- {- if(Y_Lang.isNumber(parseFloat(obj)))- {- val = parseFloat(obj);- }- else- {- if(typeof obj != "string")- {- obj = obj;- }- val = new Date(obj).valueOf();- }- }- else- {- val = obj;- }- }- keyArray[i] = val;- }- return keyArray;- },-- /**- * Sets data by key- *- * @method _setDataByKey- * @param {String} key Key value to use.- * @param {Array} data Array to use.- * @private - */- _setDataByKey: function(key, data)- {- var obj, - arr = [], - dv = this._dataClone.concat(), - i, - val,- len = dv.length;- for(i = 0; i < len; ++i)- {- obj = dv[i][key];- if(Y_Lang.isDate(obj))- { - val = obj.valueOf();- }- else- {- val = new Date(obj);- if(Y_Lang.isDate(val))- {- val = val.valueOf();- }- else if(!Y_Lang.isNumber(obj))- {- if(Y_Lang.isNumber(parseFloat(obj)))- {- val = parseFloat(obj);- }- else- {- if(typeof obj != "string")- {- obj = obj.toString();- }- val = new Date(obj).valueOf();- }- }- else- {- val = obj;- }- }- arr[i] = val;- }- this.get("keys")[key] = arr;- this._updateTotalDataFlag = true;- },-- /**- * Parses value into a number.- *- * @method _getNumber- * @param val {Object} Value to parse into a number- * @return Number- * @private- */- _getNumber: function(val)- {- if(Y_Lang.isDate(val))- {- val = val.valueOf();- }- else if(!Y_Lang.isNumber(val) && val)- {- val = new Date(val).valueOf();- }-- return val;- }-});--Y.TimeAxis = TimeAxis;- -/**- * CategoryAxis manages category data on an axis.- *- * @module charts- * @class CategoryAxis- * @constructor- * @param {Object} config (optional) Configuration parameters for the Chart.- * @extends AxisType- */-function CategoryAxis(config)-{- CategoryAxis.superclass.constructor.apply(this, arguments);-}--CategoryAxis.NAME = "categoryAxis";--Y.extend(CategoryAxis, Y.AxisType,-{- /**- * Formats a label based on the axis type and optionally specified format.- *- * @method formatLabel- * @param {Object} value- * @param {Object} format Pattern used to format the value.- * @return String- */- formatLabel: function(val, format)- {- return val;- },-- /**- * Object storing key data.- *- * @property _indices- * @private- */- _indices: null,-- /**- * Constant used to generate unique id.- *- * @property GUID- * @type String- * @private- */- GUID: "yuicategoryaxis",-- /**- * Type of data used in `Axis`.- *- * @property _dataType- * @readOnly- * @private- */- _type: "category",- - /**- * Calculates the maximum and minimum values for the `Axis`.- *- * @method _updateMinAndMax- * @private - */- _updateMinAndMax: function()- {- this._dataMaximum = Math.max(this.get("data").length - 1, 0);- this._dataMinimum = 0;- },-- /**- * Gets an array of values based on a key.- *- * @method _getKeyArray- * @param {String} key Value key associated with the data array.- * @param {Array} data Array in which the data resides.- * @return Array- * @private- */- _getKeyArray: function(key, data)- {- var i = 0,- obj,- keyArr = [],- labels = [],- len = data.length;- if(!this._indices)- {- this._indices = {};- }- for(; i < len; ++i)- {- obj = data[i];- keyArr[i] = i;- labels[i] = obj[key];- }- this._indices[key] = keyArr;- return labels;- },-- /**- * Sets data by key- *- * @method _setDataByKey- * @param {String} key Key value to use.- * @param {Array} data Array to use.- * @private - */- _setDataByKey: function(key)- {- var i,- obj, - arr = [], - labels = [], - dv = this._dataClone.concat(), - len = dv.length;- if(!this._indices)- {- this._indices = {};- }- for(i = 0; i < len; ++i)- {- obj = dv[i];- arr[i] = i;- labels[i] = obj[key];- }- this._indices[key] = arr;- this.get("keys")[key] = labels.concat();- this._updateTotalDataFlag = true;- },-- /**- * Returns an array of values based on an identifier key.- *- * @method getDataByKey- * @param {String} value value used to identify the array- * @return Array- */- getDataByKey: function (value)- {- if(!this._indices)- {- this.get("keys");- }- var keys = this._indices;- if(keys[value])- {- return keys[value];- }- return null;- },-- /**- * Returns the total number of majorUnits that will appear on an axis.- *- * @method getTotalMajorUnits- * @param {Object} majorUnit Object containing properties related to the majorUnit.- * @param {Number} len Length of the axis.- * @return Number- */- getTotalMajorUnits: function(majorUnit, len)- {- return this.get("data").length;- },- - /**- * Returns the distance between major units on an axis.- *- * @method getMajorUnitDistance- * @param {Number} len Number of ticks- * @param {Number} uiLen Size of the axis.- * @param {Object} majorUnit Hash of properties used to determine the majorUnit- * @return Number- */- getMajorUnitDistance: function(len, uiLen, majorUnit)- {- var dist;- if(majorUnit.determinant === "count")- {- dist = uiLen/len;- }- else if(majorUnit.determinant === "distance")- {- dist = majorUnit.distance;- }- return dist;- },- - /**- * Gets the distance that the first and last ticks are offset from there respective- * edges.- *- * @method getEdgeOffset- * @param {Number} ct Number of ticks on the axis.- * @param {Number} l Length (in pixels) of the axis.- * @return Number- */- getEdgeOffset: function(ct, l)- {- return l/ct;- },-- /**- * Returns a value based of a key value and an index.- *- * @method getKeyValueAt- * @param {String} key value used to look up the correct array- * @param {Number} index within the array- * @return String - */- getKeyValueAt: function(key, index)- {- var value = NaN,- keys = this.get("keys");- if(keys[key] && keys[key][index]) - {- value = keys[key][index];- }- return value;- },- - /**- * Calculates and returns a value based on the number of labels and the index of- * the current label.- *- * @method getLabelByIndex- * @param {Number} i Index of the label.- * @param {Number} l Total number of labels.- * @return String- */- getLabelByIndex: function(i, l)- {- var label,- data = this.get("data"),- position = this.get("position");- if(position == "bottom" || position == "top")- {- label = data[i];- }- else- {- label = data[l - (i + 1)];- } - return label;- },-- /**- * Returns a string corresponding to the first label on an - * axis.- *- * @method getMinimumValue- * @return String- */- getMinimumValue: function()- {- var data = this.get("data"),- label = data[0];- return label;- },-- /**- * Returns a string corresponding to the last label on an - * axis.- *- * @method getMaximumValue- * @return String- */- getMaximumValue: function()- {- var data = this.get("data"),- len = data.length - 1,- label = data[len];- return label;- }-});--Y.CategoryAxis = CategoryAxis;- -/**- * Utility class used for calculating curve points.- *- * @module charts- * @class CurveUtil- * @constructor- */-function CurveUtil()-{-}--CurveUtil.prototype = {- /**- * Creates an array of start, end and control points for splines.- *- * @method getCurveControlPoints- * @param {Array} xcoords Collection of x-coordinates used for calculate the curves- * @param {Array} ycoords Collection of y-coordinates used for calculate the curves- * @return Object- * @protected- */- getCurveControlPoints: function(xcoords, ycoords) - {- var outpoints = [],- i = 1,- l = xcoords.length - 1,- xvals = [],- yvals = [];- - - // Too few points, need at least two- if (l < 1) - {- return null;- } - - outpoints[0] = {- startx: xcoords[0], - starty: ycoords[0],- endx: xcoords[1],- endy: ycoords[1]- };- - // Special case, the Bezier should be a straight line- if (l === 1) - {- outpoints[0].ctrlx1 = (2.0*xcoords[0] + xcoords[1])/3.0; - outpoints[0].ctrly2 = (2.0*ycoords[0] + ycoords[1])/3.0;- outpoints[0].ctrlx2 = 2.0*outpoints[0].ctrlx1 - xcoords[0];- outpoints[0].ctrly2 = 2.0*outpoints[0].ctrly1 - ycoords[0];- return outpoints;- }-- for (; i < l; ++i) - {- outpoints.push({startx: Math.round(xcoords[i]), starty: Math.round(ycoords[i]), endx: Math.round(xcoords[i+1]), endy: Math.round(ycoords[i+1])});- xvals[i] = 4.0 * xcoords[i] + 2*xcoords[i+1];- yvals[i] = 4.0*ycoords[i] + 2*ycoords[i+1];- }- - xvals[0] = xcoords[0] + (2.0 * xcoords[1]);- xvals[l-1] = (8.0 * xcoords[l-1] + xcoords[l]) / 2.0;- xvals = this.getControlPoints(xvals.concat());- yvals[0] = ycoords[0] + (2.0 * ycoords[1]);- yvals[l-1] = (8.0 * ycoords[l-1] + ycoords[l]) / 2.0; - yvals = this.getControlPoints(yvals.concat());- - for (i = 0; i < l; ++i) - {- outpoints[i].ctrlx1 = Math.round(xvals[i]);- outpoints[i].ctrly1 = Math.round(yvals[i]);- - if (i < l-1) - {- outpoints[i].ctrlx2 = Math.round(2*xcoords[i+1] - xvals[i+1]);- outpoints[i].ctrly2 = Math.round(2*ycoords[i+1] - yvals[i+1]);- }- else - {- outpoints[i].ctrlx2 = Math.round((xcoords[l] + xvals[l-1])/2);- outpoints[i].ctrly2 = Math.round((ycoords[l] + yvals[l-1])/2);- }- }- - return outpoints; - },-- /**- * Gets the control points for the curve.- *- * @method getControlPoints- * @param {Array} vals Collection of values coords used to generate control points.- * @return Array- * @private- */- getControlPoints: function(vals) - {- var l = vals.length,- x = [],- tmp = [],- b = 2.0,- i = 1;- x[0] = vals[0] / b;- for (; i < l; ++i) - {- tmp[i] = 1/b;- b = (i < l-1 ? 4.0 : 3.5) - tmp[i];- x[i] = (vals[i] - x[i-1]) / b;- }- - for (i = 1; i < l; ++i) - {- x[l-i-1] -= tmp[l-i] * x[l-i];- }- - return x;- }-};-Y.CurveUtil = CurveUtil;-/**- * Utility class used for creating stacked series.- *- * @module charts- * @class StackingUtil- * @constructor- */-function StackingUtil(){}--StackingUtil.prototype = {- /**- * @protected- *- * Adjusts coordinate values for stacked series.- *- * @method _stackCoordinates- */- _stackCoordinates: function() - {- var direction = this.get("direction"),- order = this.get("order"),- type = this.get("type"),- graph = this.get("graph"),- h = graph.get("height"), - seriesCollection = graph.seriesTypes[type],- i = 0,- len,- xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- prevXCoords,- prevYCoords;- if(order === 0)- {- return;- }- prevXCoords = seriesCollection[order - 1].get("xcoords").concat();- prevYCoords = seriesCollection[order - 1].get("ycoords").concat();- if(direction === "vertical")- {- len = prevXCoords.length;- for(; i < len; ++i)- {- if(!isNaN(prevXCoords[i]) && !isNaN(xcoords[i]))- {- xcoords[i] += prevXCoords[i];- }- }- }- else- {- len = prevYCoords.length;- for(; i < len; ++i)- {- if(!isNaN(prevYCoords[i]) && !isNaN(ycoords[i]))- {- ycoords[i] = prevYCoords[i] - (h - ycoords[i]);- }- }- }- }-};-Y.StackingUtil = StackingUtil;-/**- * Utility class used for drawing lines.- *- * @module charts- * @class Lines- * @constructor- */-function Lines(){}--Lines.prototype = {- /**- * @property _lineDefaults- * @type Object- * @private- */- _lineDefaults: null,- - /**- * Creates a graphic in which to draw a series.- *- * @method _getGraphic- * @return Graphic- * @private- */- _getGraphic: function()- {- var graphic = this.get("graphic") || this.get("graph").get("graphic");- if(!this._lineGraphic)- {- this._lineGraphic = graphic.addShape({type: "path"});- }- this._lineGraphic.clear();- return this._lineGraphic;- },- - /**- * Toggles visibility- *- * @method _toggleVisible- * @param {Boolean} visible indicates visibilitye- * @private- */- _toggleVisible: function(visible)- {- if(this._lineGraphic)- {- this._lineGraphic.set("visible", visible);- }- },-- /**- * Draws lines for the series.- *- * @method drawLines- * @protected- */- drawLines: function()- {- if(this.get("xcoords").length < 1) - {- return;- }- var isNumber = Y_Lang.isNumber,- xcoords = this.get("xcoords").concat(),- ycoords = this.get("ycoords").concat(),- direction = this.get("direction"),- len = direction === "vertical" ? ycoords.length : xcoords.length,- lastPointValid,- pointValid,- noPointsRendered = true,- lastValidX,- lastValidY,- nextX,- nextY,- i,- styles = this.get("styles").line,- lineType = styles.lineType,- lc = styles.color || this._getDefaultColor(this.get("graphOrder"), "line"),- lineAlpha = styles.alpha,- dashLength = styles.dashLength,- gapSpace = styles.gapSpace,- connectDiscontinuousPoints = styles.connectDiscontinuousPoints,- discontinuousType = styles.discontinuousType,- discontinuousDashLength = styles.discontinuousDashLength,- discontinuousGapSpace = styles.discontinuousGapSpace,- path = this._getGraphic();- path.set("stroke", {- weight: styles.weight, - color: lc, - opacity: lineAlpha- });- for(i = 0; i < len; i = ++i)- {- nextX = xcoords[i];- nextY = ycoords[i];- pointValid = isNumber(nextX) && isNumber(nextY); - if(!pointValid)- {- lastPointValid = pointValid;- continue;- }- if(noPointsRendered)- {- noPointsRendered = false;- path.moveTo(nextX, nextY);- }- else if(lastPointValid)- {- if(lineType != "dashed")- {- path.lineTo(nextX, nextY);- }- else- {- this.drawDashedLine(path, lastValidX, lastValidY, nextX, nextY, - dashLength, - gapSpace);- }- }- else if(!connectDiscontinuousPoints)- {- path.moveTo(nextX, nextY);- }- else- {- if(discontinuousType != "solid")- {- this.drawDashedLine(path, lastValidX, lastValidY, nextX, nextY, - discontinuousDashLength, - discontinuousGapSpace);- }- else- {- path.lineTo(nextX, nextY);- }- }- lastValidX = nextX;- lastValidY = nextY;- lastPointValid = true;- }- path.end();- },- - /**- * Connects data points with a consistent curve for a series.- * - * @method drawSpline- * @protected- */- drawSpline: function()- {- if(this.get("xcoords").length < 1) - {- return;- }- var xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- curvecoords = this.getCurveControlPoints(xcoords, ycoords),- len = curvecoords.length,- cx1,- cx2,- cy1,- cy2,- x,- y,- i = 0,- styles = this.get("styles").line,- path = this._getGraphic(),- lineAlpha = styles.alpha,- color = styles.color || this._getDefaultColor(this.get("graphOrder"), "line");- path.set("stroke", { - weight: styles.weight, - color: color, - opacity: lineAlpha- });- path.moveTo(xcoords[0], ycoords[0]);- for(; i < len; i = ++i)- {- x = curvecoords[i].endx;- y = curvecoords[i].endy;- cx1 = curvecoords[i].ctrlx1;- cx2 = curvecoords[i].ctrlx2;- cy1 = curvecoords[i].ctrly1;- cy2 = curvecoords[i].ctrly2;- path.curveTo(cx1, cy1, cx2, cy2, x, y);- }- path.end();- },-- /**- * Draws a dashed line between two points.- * - * @method drawDashedLine- * @param {Number} xStart The x position of the start of the line- * @param {Number} yStart The y position of the start of the line- * @param {Number} xEnd The x position of the end of the line- * @param {Number} yEnd The y position of the end of the line- * @param {Number} dashSize the size of dashes, in pixels- * @param {Number} gapSize the size of gaps between dashes, in pixels- * @private- */- drawDashedLine: function(path, xStart, yStart, xEnd, yEnd, dashSize, gapSize)- {- dashSize = dashSize || 10;- gapSize = gapSize || 10;- var segmentLength = dashSize + gapSize,- xDelta = xEnd - xStart,- yDelta = yEnd - yStart,- delta = Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2)),- segmentCount = Math.floor(Math.abs(delta / segmentLength)),- radians = Math.atan2(yDelta, xDelta),- xCurrent = xStart,- yCurrent = yStart,- i;- xDelta = Math.cos(radians) * segmentLength;- yDelta = Math.sin(radians) * segmentLength;- - for(i = 0; i < segmentCount; ++i)- {- path.moveTo(xCurrent, yCurrent);- path.lineTo(xCurrent + Math.cos(radians) * dashSize, yCurrent + Math.sin(radians) * dashSize);- xCurrent += xDelta;- yCurrent += yDelta;- }- - path.moveTo(xCurrent, yCurrent);- delta = Math.sqrt((xEnd - xCurrent) * (xEnd - xCurrent) + (yEnd - yCurrent) * (yEnd - yCurrent));- - if(delta > dashSize)- {- path.lineTo(xCurrent + Math.cos(radians) * dashSize, yCurrent + Math.sin(radians) * dashSize);- }- else if(delta > 0)- {- path.lineTo(xCurrent + Math.cos(radians) * delta, yCurrent + Math.sin(radians) * delta);- }- - path.moveTo(xEnd, yEnd);- },-- /**- * Default values for `styles` attribute.- *- * @method _getLineDefaults- * @return Object- * @protected- */- _getLineDefaults: function()- {- return {- alpha: 1,- weight: 6,- lineType:"solid", - dashLength:10, - gapSpace:10, - connectDiscontinuousPoints:true, - discontinuousType:"solid", - discontinuousDashLength:10, - discontinuousGapSpace:10- };- }-};-Y.augment(Lines, Y.Attribute);-Y.Lines = Lines;-/**- * Utility class used for drawing area fills.- *- * @module charts- * @class Fills- * @constructor- */-function Fills(cfg)-{- var attrs = {- area: {- getter: function()- {- return this._defaults || this._getAreaDefaults();- },-- setter: function(val)- {- var defaults = this._defaults || this._getAreaDefaults();- this._defaults = Y.merge(defaults, val);- }- }- };- this.addAttrs(attrs, cfg);- this.get("styles");-}--Fills.prototype = {- /**- * Returns a path shape used for drawing fills.- *- * @method _getPath- * @return Path- * @private- */- _getPath: function()- {- var path = this._path;- if(!path)- {- path = this.get("graph").get("graphic").addShape({type:"path"});- this._path = path;- }- return path;- },- - /**- * Toggles visibility- *- * @method _toggleVisible- * @param {Boolean} visible indicates visibilitye- * @private- */- _toggleVisible: function(visible)- { - if(this._path)- {- this._path.set("visible", visible);- }- },-- /**- * Draws fill- *- * @method drawFill- * @param {Array} xcoords The x-coordinates for the series.- * @param {Array} ycoords The y-coordinates for the series.- * @protected- */- drawFill: function(xcoords, ycoords)- {- if(xcoords.length < 1) - {- return;- }- var len = xcoords.length,- firstX = xcoords[0],- firstY = ycoords[0],- lastValidX = firstX,- lastValidY = firstY,- nextX,- nextY,- i = 1,- styles = this.get("styles").area,- path = this._getPath(),- color = styles.color || this._getDefaultColor(this.get("graphOrder"), "slice");- path.clear();- path.set("fill", {- color: color, - opacity: styles.alpha- });- path.set("stroke", {weight: 0});- path.moveTo(firstX, firstY);- for(; i < len; i = ++i)- {- nextX = xcoords[i];- nextY = ycoords[i];- if(isNaN(nextY))- {- lastValidX = nextX;- lastValidY = nextY;- continue;- }- path.lineTo(nextX, nextY);- lastValidX = nextX;- lastValidY = nextY;- }- path.end();- },- - /**- * Draws a fill for a spline- *- * @method drawAreaSpline- * @protected- */- drawAreaSpline: function()- {- if(this.get("xcoords").length < 1) - {- return;- }- var xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- curvecoords = this.getCurveControlPoints(xcoords, ycoords),- len = curvecoords.length,- cx1,- cx2,- cy1,- cy2,- x,- y,- i = 0,- firstX = xcoords[0],- firstY = ycoords[0],- styles = this.get("styles").area,- path = this._getPath(),- color = styles.color || this._getDefaultColor(this.get("graphOrder"), "slice");- path.set("fill", {- color: color, - opacity: styles.alpha- });- path.set("stroke", {weight: 0});- path.moveTo(firstX, firstY);- for(; i < len; i = ++i)- {- x = curvecoords[i].endx;- y = curvecoords[i].endy;- cx1 = curvecoords[i].ctrlx1;- cx2 = curvecoords[i].ctrlx2;- cy1 = curvecoords[i].ctrly1;- cy2 = curvecoords[i].ctrly2;- path.curveTo(cx1, cy1, cx2, cy2, x, y);- }- if(this.get("direction") === "vertical")- {- path.lineTo(this._leftOrigin, y);- path.lineTo(this._leftOrigin, firstY);- }- else- {- path.lineTo(x, this._bottomOrigin);- path.lineTo(firstX, this._bottomOrigin);- }- path.lineTo(firstX, firstY);- path.end();- },- - /**- * Draws a a stacked area spline- *- * @method drawStackedAreaSpline- * @protected- */- drawStackedAreaSpline: function()- {- if(this.get("xcoords").length < 1) - {- return;- }- var xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- curvecoords,- order = this.get("order"),- type = this.get("type"),- graph = this.get("graph"),- seriesCollection = graph.seriesTypes[type],- prevXCoords,- prevYCoords,- len,- cx1,- cx2,- cy1,- cy2,- x,- y,- i = 0,- firstX,- firstY,- styles = this.get("styles").area,- path = this._getPath(),- color = styles.color || this._getDefaultColor(this.get("graphOrder"), "slice");- firstX = xcoords[0];- firstY = ycoords[0];- curvecoords = this.getCurveControlPoints(xcoords, ycoords);- len = curvecoords.length;- path.set("fill", {- color: color, - opacity: styles.alpha- });- path.set("stroke", {weight: 0});- path.moveTo(firstX, firstY);- for(; i < len; i = ++i)- {- x = curvecoords[i].endx;- y = curvecoords[i].endy;- cx1 = curvecoords[i].ctrlx1;- cx2 = curvecoords[i].ctrlx2;- cy1 = curvecoords[i].ctrly1;- cy2 = curvecoords[i].ctrly2;- path.curveTo(cx1, cy1, cx2, cy2, x, y);- }- if(order > 0)- {- prevXCoords = seriesCollection[order - 1].get("xcoords").concat().reverse();- prevYCoords = seriesCollection[order - 1].get("ycoords").concat().reverse();- curvecoords = this.getCurveControlPoints(prevXCoords, prevYCoords);- i = 0;- len = curvecoords.length;- path.lineTo(prevXCoords[0], prevYCoords[0]);- for(; i < len; i = ++i)- {- x = curvecoords[i].endx;- y = curvecoords[i].endy;- cx1 = curvecoords[i].ctrlx1;- cx2 = curvecoords[i].ctrlx2;- cy1 = curvecoords[i].ctrly1;- cy2 = curvecoords[i].ctrly2;- path.curveTo(cx1, cy1, cx2, cy2, x, y);- }- }- else- {- if(this.get("direction") === "vertical")- {- path.lineTo(this._leftOrigin, ycoords[ycoords.length-1]);- path.lineTo(this._leftOrigin, firstY);- }- else- {- path.lineTo(xcoords[xcoords.length-1], this._bottomOrigin);- path.lineTo(firstX, this._bottomOrigin);- }-- }- path.lineTo(firstX, firstY);- path.end();- },- - /**- * Storage for default area styles.- *- * @property _defaults- * @type Object- * @private- */- _defaults: null,-- /**- * Concatenates coordinate array with correct coordinates for closing an area fill.- *- * @method _getClosingPoints- * @return Array- * @protected- */- _getClosingPoints: function()- {- var xcoords = this.get("xcoords").concat(),- ycoords = this.get("ycoords").concat();- if(this.get("direction") === "vertical")- {- xcoords.push(this._leftOrigin);- xcoords.push(this._leftOrigin);- ycoords.push(ycoords[ycoords.length - 1]);- ycoords.push(ycoords[0]);- }- else- {- xcoords.push(xcoords[xcoords.length - 1]);- xcoords.push(xcoords[0]);- ycoords.push(this._bottomOrigin);- ycoords.push(this._bottomOrigin);- }- xcoords.push(xcoords[0]);- ycoords.push(ycoords[0]);- return [xcoords, ycoords];- },-- /**- * Concatenates coordinate array with the correct coordinates for closing an area stack.- *- * @method _getStackedClosingPoints- * @return Array- * @protected- */- _getStackedClosingPoints: function()- {- var order = this.get("order"),- type = this.get("type"),- graph = this.get("graph"),- direction = this.get("direction"),- seriesCollection = graph.seriesTypes[type],- prevXCoords,- prevYCoords,- allXCoords = this.get("xcoords").concat(),- allYCoords = this.get("ycoords").concat(),- firstX = allXCoords[0],- firstY = allYCoords[0];- - if(order > 0)- {- prevXCoords = seriesCollection[order - 1].get("xcoords").concat();- prevYCoords = seriesCollection[order - 1].get("ycoords").concat();- allXCoords = allXCoords.concat(prevXCoords.concat().reverse());- allYCoords = allYCoords.concat(prevYCoords.concat().reverse());- allXCoords.push(allXCoords[0]);- allYCoords.push(allYCoords[0]);- }- else- {- if(direction === "vertical")- {- allXCoords.push(this._leftOrigin);- allXCoords.push(this._leftOrigin);- allYCoords.push(allYCoords[allYCoords.length-1]);- allYCoords.push(firstY);- }- else- {- allXCoords.push(allXCoords[allXCoords.length-1]);- allXCoords.push(firstX);- allYCoords.push(this._bottomOrigin);- allYCoords.push(this._bottomOrigin);- }- }- return [allXCoords, allYCoords];- },-- /**- * Returns default values for area styles.- *- * @method _getAreaDefaults- * @return Object- * @private- */- _getAreaDefaults: function()- {- return {- };- }-};-Y.augment(Fills, Y.Attribute);-Y.Fills = Fills;-/**- * Utility class used for drawing markers.- *- * @module charts- * @class Plots- * @constructor- */-function Plots(cfg)-{- var attrs = { - markers: {- getter: function()- {- return this._markers;- }- }- };- this.addAttrs(attrs, cfg);-}--Plots.prototype = {- /**- * Storage for default marker styles.- *- * @property _plotDefaults- * @type Object- * @private- */- _plotDefaults: null,-- /**- * Draws the markers- *- * @method drawPlots- * @protected- */- drawPlots: function()- {- if(!this.get("xcoords") || this.get("xcoords").length < 1) - {- return;- }- var isNumber = Y_Lang.isNumber,- style = Y.clone(this.get("styles").marker),- w = style.width,- h = style.height,- xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- i = 0,- len = xcoords.length,- top = ycoords[0],- left,- marker,- offsetWidth = w/2,- offsetHeight = h/2,- xvalues,- yvalues,- fillColors = null,- borderColors = null,- graphOrder = this.get("graphOrder"),- groupMarkers = this.get("groupMarkers");- if(groupMarkers)- {- xvalues = [];- yvalues = [];- for(; i < len; ++i)- {- xvalues.push(parseFloat(xcoords[i] - offsetWidth));- yvalues.push(parseFloat(ycoords[i] - offsetHeight));- }- this._createGroupMarker({- xvalues: xvalues,- yvalues: yvalues,- fill: style.fill,- border: style.border,- dimensions: {- width: w,- height: h- },- graphOrder: graphOrder,- shape: style.shape- });- return;- }- if(Y_Lang.isArray(style.fill.color))- {- fillColors = style.fill.color.concat(); - }- if(Y_Lang.isArray(style.border.color))- {- borderColors = style.border.color.concat();- }- this._createMarkerCache();- for(; i < len; ++i)- {- top = parseFloat(ycoords[i] - offsetHeight);- left = parseFloat(xcoords[i] - offsetWidth); - if(!isNumber(left) || !isNumber(top))- {- this._markers.push(null);- continue;- }- if(fillColors)- {- style.fill.color = fillColors[i % fillColors.length];- }- if(borderColors)- {- style.border.color = borderColors[i % borderColors.length];- }-- style.x = left;- style.y = top;- marker = this.getMarker(style, graphOrder, i);- }- this._clearMarkerCache();- },-- /**- * Pre-defined group shapes.- *- * @property _groupShapes- * @private- */- _groupShapes: {- circle: Y.CircleGroup,- rect: Y.RectGroup,- ellipse: Y.EllipseGroup,- diamond: Y.DiamondGroup- },-- /**- * Returns the correct group shape class.- *- * @method _getGroupShape- * @param {Shape | String} shape Indicates which shape class. - * @return Function- * @protected- */- _getGroupShape: function(shape)- {- if(Y_Lang.isString(shape))- {- shape = this._groupShapes[shape];- }- return shape;- },-- /**- * Gets the default values for series that use the utility. This method is used by- * the class' `styles` attribute's getter to get build default values.- *- * @method _getPlotDefaults- * @return Object- * @protected- */- _getPlotDefaults: function()- {- var defs = {- fill:{- type: "solid",- alpha: 1,- colors:null,- alphas: null,- ratios: null- },- border:{- weight: 1,- alpha: 1- },- width: 10,- height: 10,- shape: "circle"- };- defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");- defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");- return defs;- },-- /**- * Collection of markers to be used in the series.- *- * @property _markers- * @type Array- * @private- */- _markers: null,-- /**- * Collection of markers to be re-used on a series redraw.- *- * @property _markerCache- * @type Array- * @private- */- _markerCache: null,- - /**- * Gets and styles a marker. If there is a marker in cache, it will use it. Otherwise- * it will create one.- *- * @method getMarker- * @param {Object} styles Hash of style properties.- * @param {Number} order Order of the series.- * @param {Number} index Index within the series associated with the marker.- * @return Shape- * @protected- */- getMarker: function(styles, order, index)- {- var marker,- border = styles.border;- styles.id = this.get("chart").get("id") + "_" + order + "_" + index;- //fix name differences between graphic layer- border.opacity = border.alpha;- styles.stroke = border;- styles.fill.opacity = styles.fill.alpha;- if(this._markerCache.length > 0)- {- while(!marker)- {- if(this._markerCache.length < 1)- {- marker = this._createMarker(styles, order, index);- break;- }- marker = this._markerCache.shift();-- }- marker.set(styles);- }- else- {- marker = this._createMarker(styles, order, index);- }- this._markers.push(marker);- return marker;- },- - /**- * Creates a shape to be used as a marker.- *- * @method _createMarker- * @param {Object} styles Hash of style properties.- * @param {Number} order Order of the series.- * @param {Number} index Index within the series associated with the marker.- * @return Shape- * @private- */- _createMarker: function(styles, order, index)- {- var graphic = this.get("graphic"),- marker,- cfg = Y.clone(styles);- graphic.set("autoDraw", false);- cfg.type = cfg.shape;- marker = graphic.addShape(cfg); - marker.addClass(SERIES_MARKER);- return marker;- },- - /**- * Creates a cache of markers for reuse.- *- * @method _createMarkerCache- * @private- */- _createMarkerCache: function()- {- if(this._groupMarker)- {- this._groupMarker.destroy();- this._groupMarker = null;- }- if(this._markers && this._markers.length > 0)- {- this._markerCache = this._markers.concat();- }- else- {- this._markerCache = [];- }- this._markers = [];- },- - /**- * Draws a series of markers in a single shape instance.- *- * @method _createGroupMarkers- * @param {Object} styles Set of configuration properties used to create the markers.- * @protected- */- _createGroupMarker: function(styles)- {- var marker,- markers = this.get("markers"),- border = styles.border,- graphic,- cfg,- shape;- if(markers && markers.length > 0)- {- while(markers.length > 0)- {- marker = markers.shift();- marker.destroy();- }- this.set("markers", []);- }- //fix name differences between graphic layer- border.opacity = border.alpha;- cfg = {- id: this.get("chart").get("id") + "_" + styles.graphOrder,- stroke: border,- fill: styles.fill,- dimensions: styles.dimensions,- xvalues: styles.xvalues,- yvalues: styles.yvalues- };- cfg.fill.opacity = styles.fill.alpha;- shape = this._getGroupShape(styles.shape);- if(shape)- {- cfg.type = shape;- }- if(styles.hasOwnProperty("radius") && !isNaN(styles.radius))- {- cfg.dimensions.radius = styles.radius;- }- if(this._groupMarker)- {- this._groupMarker.destroy();- }- graphic = this.get("graphic");- graphic.set("autoDraw", true);- this._groupMarker = graphic.addShape(cfg);- },-- /**- * Toggles visibility- *- * @method _toggleVisible- * @param {Boolean} visible indicates visibilitye- * @private- */- _toggleVisible: function(visible)- {- var marker,- markers = this.get("markers"),- i = 0,- len;- if(markers)- {- len = markers.length;- for(; i < len; ++i)- {- marker = markers[i];- if(marker)- {- marker.set("visible", visible);- }- }- }- },-- /**- * Removes unused markers from the marker cache- *- * @method _clearMarkerCache- * @private- */- _clearMarkerCache: function()- {- var marker;- while(this._markerCache.length > 0)- {- marker = this._markerCache.shift();- if(marker)- {- marker.destroy();- }- }- },-- /**- * Resizes and positions markers based on a mouse interaction.- *- * @method updateMarkerState- * @param {String} type state of the marker- * @param {Number} i index of the marker- * @protected- */- updateMarkerState: function(type, i)- {- if(this._markers && this._markers[i])- {- var w,- h,- styles = Y.clone(this.get("styles").marker),- state = this._getState(type),- xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- marker = this._markers[i],- markerStyles = state == "off" || !styles[state] ? styles : styles[state]; - markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);- markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);- markerStyles.stroke = markerStyles.border;- marker.set(markerStyles);- w = markerStyles.width;- h = markerStyles.height;- marker.set("x", (xcoords[i] - w/2));- marker.set("y", (ycoords[i] - h/2));- marker.set("visible", this.get("visible"));- }- },-- /**- * Parses a color from an array.- *- * @method _getItemColor- * @param {Array} val collection of colors- * @param {Number} i index of the item- * @return String- * @protected- */- _getItemColor: function(val, i)- {- if(Y_Lang.isArray(val))- {- return val[i % val.length];- }- return val;- },-- /**- * Method used by `styles` setter. Overrides base implementation.- *- * @method _setStyles- * @param {Object} newStyles Hash of properties to update.- * @return Object- * @protected- */- _setStyles: function(val)- {- val = this._parseMarkerStyles(val);- return Y.Renderer.prototype._setStyles.apply(this, [val]);- },-- /**- * Combines new styles with existing styles.- *- * @method _parseMarkerStyles- * @param {Object} Object containing style properties for the marker.- * @return Object- * @private- */- _parseMarkerStyles: function(val)- {- if(val.marker)- {- var defs = this._getPlotDefaults();- val.marker = this._mergeStyles(val.marker, defs);- if(val.marker.over)- {- val.marker.over = this._mergeStyles(val.marker.over, val.marker);- }- if(val.marker.down)- {- val.marker.down = this._mergeStyles(val.marker.down, val.marker);- }- }- return val;- },-- /**- * Returns marker state based on event type- *- * @method _getState- * @param {String} type event type- * @return String- * @protected- */- _getState: function(type)- {- var state;- switch(type)- {- case "mouseout" :- state = "off";- break;- case "mouseover" :- state = "over";- break;- case "mouseup" :- state = "over";- break;- case "mousedown" :- state = "down";- break;- }- return state;- },- - /**- * @property _statSyles- * @type Object- * @private- */- _stateSyles: null-};--Y.augment(Plots, Y.Attribute);-Y.Plots = Plots;-/**- * Histogram is the base class for Column and Bar series.- *- * @module charts- * @class Histogram- * @constructor- */-function Histogram(){}--Histogram.prototype = {- /**- * Draws the series.- *- * @method drawSeries- * @protected- */- drawSeries: function()- {- if(this.get("xcoords").length < 1) - {- return;- }- var style = Y.clone(this.get("styles").marker),- setSize,- calculatedSize,- xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- i = 0,- len = xcoords.length,- top = ycoords[0],- type = this.get("type"),- graph = this.get("graph"),- seriesCollection = graph.seriesTypes[type],- seriesLen = seriesCollection.length,- seriesSize = 0,- totalSize = 0,- offset = 0,- ratio,- renderer,- order = this.get("order"),- graphOrder = this.get("graphOrder"),- left,- marker,- setSizeKey,- calculatedSizeKey,- config,- fillColors = null,- borderColors = null,- xMarkerPlane = [],- yMarkerPlane = [],- xMarkerPlaneLeft,- xMarkerPlaneRight,- yMarkerPlaneTop,- yMarkerPlaneBottom,- dimensions = {- width: [],- height: []- },- xvalues = [],- yvalues = [],- groupMarkers = this.get("groupMarkers");- if(Y_Lang.isArray(style.fill.color))- {- fillColors = style.fill.color.concat(); - }- if(Y_Lang.isArray(style.border.color))- {- borderColors = style.border.color.concat();- }- if(this.get("direction") == "vertical")- {- setSizeKey = "height";- calculatedSizeKey = "width";- }- else- {- setSizeKey = "width";- calculatedSizeKey = "height";- }- setSize = style[setSizeKey];- calculatedSize = style[calculatedSizeKey];- this._createMarkerCache();- for(; i < seriesLen; ++i)- {- renderer = seriesCollection[i];- seriesSize += renderer.get("styles").marker[setSizeKey];- if(order > i) - {- offset = seriesSize;- }- }- totalSize = len * seriesSize;- this._maxSize = graph.get(setSizeKey);- if(totalSize > this._maxSize)- {- ratio = graph.get(setSizeKey)/totalSize;- seriesSize *= ratio;- offset *= ratio;- setSize *= ratio;- setSize = Math.max(setSize, 1);- this._maxSize = setSize;- }- offset -= seriesSize/2;- for(i = 0; i < len; ++i)- {- xMarkerPlaneLeft = xcoords[i] - seriesSize/2;- xMarkerPlaneRight = xMarkerPlaneLeft + seriesSize;- yMarkerPlaneTop = ycoords[i] - seriesSize/2;- yMarkerPlaneBottom = yMarkerPlaneTop + seriesSize;- xMarkerPlane.push({start: xMarkerPlaneLeft, end: xMarkerPlaneRight});- yMarkerPlane.push({start: yMarkerPlaneTop, end: yMarkerPlaneBottom});- if(isNaN(xcoords[i]) || isNaN(ycoords[i]))- {- this._markers.push(null);- continue;- }- config = this._getMarkerDimensions(xcoords[i], ycoords[i], calculatedSize, offset);- if(!isNaN(config.calculatedSize) && config.calculatedSize > 0)- {- top = config.top;- left = config.left;-- if(groupMarkers)- {- dimensions[setSizeKey][i] = setSize;- dimensions[calculatedSizeKey][i] = config.calculatedSize;- xvalues.push(left);- yvalues.push(top);- }- else- {- style[setSizeKey] = setSize;- style[calculatedSizeKey] = config.calculatedSize;- style.x = left;- style.y = top;- if(fillColors)- {- style.fill.color = fillColors[i % fillColors.length];- }- if(borderColors)- {- style.border.color = borderColors[i % borderColors.length];- }- marker = this.getMarker(style, graphOrder, i);- }-- }- else if(!groupMarkers)- {- this._markers.push(null);- }- }- this.set("xMarkerPlane", xMarkerPlane);- this.set("yMarkerPlane", yMarkerPlane);- if(groupMarkers)- {- this._createGroupMarker({- fill: style.fill,- border: style.border,- dimensions: dimensions,- xvalues: xvalues,- yvalues: yvalues,- shape: style.shape- });- }- else- {- this._clearMarkerCache();- }- },- - /**- * Collection of default colors used for marker fills in a series when not specified by user.- *- * @property _defaultFillColors- * @type Array- * @protected- */- _defaultFillColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],- - /**- * Gets the default style values for the markers.- *- * @method _getPlotDefaults- * @return Object- * @private- */- _getPlotDefaults: function()- {- var defs = {- fill:{- type: "solid",- alpha: 1,- colors:null,- alphas: null,- ratios: null- },- border:{- weight: 0,- alpha: 1- },- width: 12,- height: 12,- shape: "rect",-- padding:{- top: 0,- left: 0,- right: 0,- bottom: 0- }- };- defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");- defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");- return defs;- }-};--Y.Histogram = Histogram;-/**- * The CartesianSeries class creates a chart with horizontal and vertical axes.- *- * @module charts- * @class CartesianSeries- * @extends Base- * @uses Renderer- * @constructor- */-Y.CartesianSeries = Y.Base.create("cartesianSeries", Y.Base, [Y.Renderer], {- /**- * Storage for `xDisplayName` attribute.- *- * @property _xDisplayName- * @type String- * @private- */- _xDisplayName: null,-- /**- * Storage for `yDisplayName` attribute.- *- * @property _yDisplayName- * @type String- * @private- */- _yDisplayName: null,- - /**- * Th x-coordinate for the left edge of the series.- *- * @property _leftOrigin- * @type String- * @private- */- _leftOrigin: null,-- /**- * The y-coordinate for the bottom edge of the series.- * - * @property _bottomOrigin- * @type String- * @private- */- _bottomOrigin: null,-- /**- * @method render- * @private- */- render: function()- {- this._setCanvas();- this.addListeners();- this.set("rendered", true);- this.validate();- },-- /**- * Adds event listeners.- *- * @method addListeners- * @private- */- addListeners: function()- {- var xAxis = this.get("xAxis"),- yAxis = this.get("yAxis");- if(xAxis)- {- xAxis.after("dataReady", Y.bind(this._xDataChangeHandler, this));- xAxis.after("dataUpdate", Y.bind(this._xDataChangeHandler, this));- }- if(yAxis)- {- yAxis.after("dataReady", Y.bind(this._yDataChangeHandler, this));- yAxis.after("dataUpdate", Y.bind(this._yDataChangeHandler, this));- }- this.after("xAxisChange", this._xAxisChangeHandler);- this.after("yAxisChange", this._yAxisChangeHandler);- this.after("stylesChange", function(e) {- var axesReady = this._updateAxisData();- if(axesReady)- {- this.draw();- }- });- this.after("widthChange", function(e) {- var axesReady = this._updateAxisData();- if(axesReady)- {- this.draw();- }- });- this.after("heightChange", function(e) {- var axesReady = this._updateAxisData();- if(axesReady)- {- this.draw();- }- });- this.after("visibleChange", this._handleVisibleChange);- },- - /**- * Event handler for the xAxisChange event.- *- * @method _xAxisChangeHandler- * @param {Object} e Event object.- * @private- */- _xAxisChangeHandler: function(e)- {- var xAxis = this.get("xAxis");- xAxis.after("dataReady", Y.bind(this._xDataChangeHandler, this));- xAxis.after("dataUpdate", Y.bind(this._xDataChangeHandler, this));- },- - /**- * Event handler the yAxisChange event.- *- * @method _yAxisChangeHandler- * @param {Object} e Event object.- * @private- */- _yAxisChangeHandler: function(e)- {- var yAxis = this.get("yAxis");- yAxis.after("dataReady", Y.bind(this._yDataChangeHandler, this));- yAxis.after("dataUpdate", Y.bind(this._yDataChangeHandler, this));- },-- /**- * Constant used to generate unique id.- *- * @property GUID- * @type String- * @private- */- GUID: "yuicartesianseries",-- /**- * Event handler for xDataChange event.- *- * @method _xDataChangeHandler- * @param {Object} event Event object.- * @private - */- _xDataChangeHandler: function(event)- {- var axesReady = this._updateAxisData();- if(axesReady)- {- this.draw();- }- },-- /**- * Event handler for yDataChange event.- *- * @method _yDataChangeHandler- * @param {Object} event Event object.- * @private - */- _yDataChangeHandler: function(event)- {- var axesReady = this._updateAxisData();- if(axesReady)- {- this.draw();- }- },-- /**- * Checks to ensure that both xAxis and yAxis data are available. If so, set the `xData` and `yData` attributes and return `true`. Otherwise, return `false`.- *- * @method _updateAxisData- * @return Boolean- * @private - */- _updateAxisData: function()- {- var xAxis = this.get("xAxis"),- yAxis = this.get("yAxis"),- xKey = this.get("xKey"),- yKey = this.get("yKey"),- yData,- xData;- if(!xAxis || !yAxis || !xKey || !yKey)- {- return false;- }- xData = xAxis.getDataByKey(xKey);- yData = yAxis.getDataByKey(yKey);- if(!xData || !yData)- {- return false;- }- this.set("xData", xData.concat());- this.set("yData", yData.concat());- return true;- },-- /**- * Draws the series is the xAxis and yAxis data are both available.- *- * @method validate- * @private- */- validate: function()- {- if((this.get("xData") && this.get("yData")) || this._updateAxisData())- {- this.draw();- }- else- {- this.fire("drawingComplete");- }- },-- /**- * Creates a `Graphic` instance.- *- * @method _setCanvas- * @protected- */- _setCanvas: function()- {- var graph = this.get("graph"),- graphic = graph.get("graphic");- this.set("graphic", graphic);- },-- /**- * Calculates the coordinates for the series.- *- * @method setAreaData- * @protected- */- setAreaData: function()- {- var isNumber = Y_Lang.isNumber,- nextX, nextY,- graph = this.get("graph"),- w = graph.get("width"),- h = graph.get("height"),- xAxis = this.get("xAxis"),- yAxis = this.get("yAxis"),- xData = this.get("xData").concat(),- yData = this.get("yData").concat(),- xValue,- yValue,- xOffset = xAxis.getEdgeOffset(xData.length, w),- yOffset = yAxis.getEdgeOffset(yData.length, h),- padding = this.get("styles").padding,- leftPadding = padding.left,- topPadding = padding.top,- dataWidth = w - (leftPadding + padding.right + xOffset),- dataHeight = h - (topPadding + padding.bottom + yOffset),- xcoords = [],- ycoords = [],- xMax = xAxis.get("maximum"),- xMin = xAxis.get("minimum"),- yMax = yAxis.get("maximum"),- yMin = yAxis.get("minimum"),- xScaleFactor = dataWidth / (xMax - xMin),- yScaleFactor = dataHeight / (yMax - yMin),- dataLength,- direction = this.get("direction"),- i = 0,- xMarkerPlane = [],- yMarkerPlane = [],- xMarkerPlaneOffset = this.get("xMarkerPlaneOffset"),- yMarkerPlaneOffset = this.get("yMarkerPlaneOffset"),- graphic = this.get("graphic");- graphic.set("width", w);- graphic.set("height", h);- dataLength = xData.length;- xOffset *= 0.5;- yOffset *= 0.5;- //Assuming a vertical graph has a range/category for its vertical axis. - if(direction === "vertical")- {- yData = yData.reverse();- }- this._leftOrigin = Math.round(((0 - xMin) * xScaleFactor) + leftPadding + xOffset);- this._bottomOrigin = Math.round((dataHeight + topPadding + yOffset)); - for (; i < dataLength; ++i) - {- xValue = parseFloat(xData[i]);- yValue = parseFloat(yData[i]);- if(isNumber(xValue))- {- nextX = Math.round((((xValue - xMin) * xScaleFactor) + leftPadding + xOffset));- }- else- {- nextX = NaN;- }- if(isNumber(yValue))- {- nextY = Math.round(((dataHeight + topPadding + yOffset) - (yValue - yMin) * yScaleFactor));- }- else- {- nextY = NaN;- }- xcoords.push(nextX);- ycoords.push(nextY);- xMarkerPlane.push({start:nextX - xMarkerPlaneOffset, end: nextX + xMarkerPlaneOffset});- yMarkerPlane.push({start:nextY - yMarkerPlaneOffset, end: nextY + yMarkerPlaneOffset});- }- this.set("xcoords", xcoords);- this.set("ycoords", ycoords);- this.set("xMarkerPlane", xMarkerPlane);- this.set("yMarkerPlane", yMarkerPlane);- this._dataLength = dataLength;- },-- /**- * Draws the series.- *- * @method draw- * @protected- */- draw: function()- {- var graph = this.get("graph"),- w = graph.get("width"),- h = graph.get("height");- if(this.get("rendered"))- {- if((isFinite(w) && isFinite(h) && w > 0 && h > 0) && ((this.get("xData") && this.get("yData")) || this._updateAxisData()))- {- if(this._drawing)- {- this._callLater = true;- return;- }- this._drawing = true;- this._callLater = false;- this.setAreaData();- if(this.get("xcoords") && this.get("ycoords"))- {- this.drawSeries();- }- this._drawing = false;- if(this._callLater)- {- this.draw();- }- else- {- this._toggleVisible(this.get("visible"));- this.fire("drawingComplete");- }- }- }- },- - /**- * Default value for plane offsets when the parent chart's `interactiveType` is `planar`. - *- * @property _defaultPlaneOffset- * @type Number- * @private- */- _defaultPlaneOffset: 4,- - /**- * Gets the default value for the `styles` attribute. Overrides- * base implementation.- *- * @method _getDefaultStyles- * @return Object- * @protected- */- _getDefaultStyles: function()- {- return {padding:{- top: 0,- left: 0,- right: 0,- bottom: 0- }};- },-- /**- * Collection of default colors used for lines in a series when not specified by user.- *- * @property _defaultLineColors- * @type Array- * @protected- */- _defaultLineColors:["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"],-- /**- * Collection of default colors used for marker fills in a series when not specified by user.- *- * @property _defaultFillColors- * @type Array- * @protected- */- _defaultFillColors:["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"],- - /**- * Collection of default colors used for marker borders in a series when not specified by user.- *- * @property _defaultBorderColors- * @type Array- * @protected- */- _defaultBorderColors:["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"],- - /**- * Collection of default colors used for area fills, histogram fills and pie fills in a series when not specified by user.- *- * @property _defaultSliceColors- * @type Array- * @protected- */- _defaultSliceColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],-- /**- * Parses a color based on a series order and type.- *- * @method _getDefaultColor- * @param {Number} index Index indicating the series order.- * @param {String} type Indicates which type of object needs the color.- * @return String- * @protected- */- _getDefaultColor: function(index, type)- {- var colors = {- line: this._defaultLineColors,- fill: this._defaultFillColors,- border: this._defaultBorderColors,- slice: this._defaultSliceColors- },- col = colors[type],- l = col.length;- index = index || 0;- if(index >= l)- {- index = index % l;- }- type = type || "fill";- return colors[type][index];- },- - /**- * Shows/hides contents of the series.- *- * @method _handleVisibleChange- * @param {Object} e Event object.- * @protected- */- _handleVisibleChange: function(e) - {- this._toggleVisible(this.get("visible"));- },-- /**- * Returns the sum of all values for the series.- *- * @method getTotalValues- * @return Number- */- getTotalValues: function()- {- var total = this.get("valueAxis").getTotalByKey(this.get("valueKey"));- return total;- },-- /**- * Destructor implementation for the CartesianSeries class. Calls destroy on all Graphic instances.- *- * @method destructor- * @protected- */- destructor: function()- {- if(this._path)- {- this._path.destroy();- }- if(this._lineGraphic)- {- this._lineGraphic.destroy();- this._lineGraphic = null;- }- if(this.get("graphic"))- {- this.get("graphic").destroy();- } - }-}, {- ATTRS: {- /**- * Name used for for displaying data related to the x-coordinate.- *- * @attribute xDisplayName- * @type String- */- xDisplayName: {- getter: function()- {- return this._xDisplayName || this.get("xKey");- },-- setter: function(val)- {- this._xDisplayName = val.toString();- return val;- }- },-- /**- * Name used for for displaying data related to the y-coordinate.- *- * @attribute yDisplayName- * @type String- */- yDisplayName: {- getter: function()- {- return this._yDisplayName || this.get("yKey");- },-- setter: function(val)- {- this._yDisplayName = val.toString();- return val;- }- },- - /**- * Name used for for displaying category data- *- * @attribute categoryDisplayName- * @type String- * @readOnly- */- categoryDisplayName: {- readOnly: true,-- getter: function()- {- return this.get("direction") == "vertical" ? this.get("yDisplayName") : this.get("xDisplayName");- }- },-- /**- * Name used for for displaying value data- *- * @attribute valueDisplayName- * @type String- * @readOnly- */- valueDisplayName: {- readOnly: true,-- getter: function()- {- return this.get("direction") == "vertical" ? this.get("xDisplayName") : this.get("yDisplayName");- }- },- - /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default cartesian- */- type: { - value: "cartesian"- },-- /**- * Order of this instance of this `type`.- *- * @attribute order- * @type Number- */- order: {},-- /**- * Order of the instance- *- * @attribute graphOrder- * @type Number- */- graphOrder: {},-- /**- * x coordinates for the series.- *- * @attribute xcoords- * @type Array- */- xcoords: {},- - /**- * y coordinates for the series- *- * @attribute ycoords- * @type Array- */- ycoords: {},-- /**- * Reference to the `Chart` application.- *- * @attribute chart- * @type ChartBase- * @readOnly- */- chart: {- readOnly: true,-- getter: function()- {- return this.get("graph").get("chart");- }- },- - /**- * Reference to the `Graph` in which the series is drawn into.- *- * @attribute graph- * @type Graph- */- graph: {},-- /**- * Reference to the `Axis` instance used for assigning - * x-values to the graph.- *- * @attribute xAxis- * @type Axis- */- xAxis: {},- - /**- * Reference to the `Axis` instance used for assigning - * y-values to the graph.- *- * @attribute yAxis- * @type Axis- */- yAxis: {},- - /**- * Indicates which array to from the hash of value arrays in - * the x-axis `Axis` instance.- *- * @attribute xKey- * @type String- */- xKey: {- setter: function(val)- {- return val.toString();- }- },-- /**- * Indicates which array to from the hash of value arrays in - * the y-axis `Axis` instance.- *- * @attribute yKey- * @type String- */- yKey: {- setter: function(val)- {- return val.toString();- }- },-- /**- * Array of x values for the series.- *- * @attribute xData- * @type Array- */- xData: {},-- /**- * Array of y values for the series.- *- * @attribute yData- * @type Array- */- yData: {},- - /**- * Indicates whether the Series has been through its initial set up.- *- * @attribute rendered- * @type Boolean- */- rendered: {- value: false- },-- /*- * Returns the width of the parent graph- *- * @attribute width- * @type Number- */- width: {- readOnly: true,- - getter: function()- {- this.get("graph").get("width");- }- },-- /**- * Returns the height of the parent graph- *- * @attribute height- * @type Number- */- height: {- readOnly: true,- - getter: function()- {- this.get("graph").get("height");- }- },-- /**- * Indicates whether to show the series- *- * @attribute visible- * @type Boolean- * @default true- */- visible: {- value: true- },-- /**- * Collection of area maps along the xAxis. Used to determine mouseover for multiple- * series.- *- * @attribute xMarkerPlane- * @type Array- */- xMarkerPlane: {},- - /**- * Collection of area maps along the yAxis. Used to determine mouseover for multiple- * series.- *- * @attribute yMarkerPlane- * @type Array- */- yMarkerPlane: {},-- /**- * Distance from a data coordinate to the left/right for setting a hotspot.- *- * @attribute xMarkerPlaneOffset- * @type Number- */- xMarkerPlaneOffset: {- getter: function() {- var marker = this.get("styles").marker;- if(marker && marker.width && isFinite(marker.width))- {- return marker.width * 0.5;- }- return this._defaultPlaneOffset;- }- },-- /**- * Distance from a data coordinate to the top/bottom for setting a hotspot.- *- * @attribute yMarkerPlaneOffset- * @type Number- */- yMarkerPlaneOffset: {- getter: function() {- var marker = this.get("styles").marker;- if(marker && marker.height && isFinite(marker.height))- {- return marker.height * 0.5;- }- return this._defaultPlaneOffset;- }- },-- /**- * Direction of the series- *- * @attribute direction- * @type String- */- direction: {- value: "horizontal"- },-- /**- * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.- *- * @attribute groupMarkers- * @type Boolean- */- groupMarkers: {- getter: function()- {- if(this._groupMarkers === undefined)- {- return this.get("graph").get("groupMarkers");- }- else- {- return this._groupMarkers;- }- },-- setter: function(val)- {- this._groupMarkers = val;- return val;- }- }- }-});-/**- * The MarkerSeries class renders quantitative data by plotting relevant data points - * on a graph.- *- * @module charts- * @class MarkerSeries- * @extends CartesianSeries- * @uses Plots- * @constructor- */-Y.MarkerSeries = Y.Base.create("markerSeries", Y.CartesianSeries, [Y.Plots], {- /**- * @protected- *- * Draws the series.- *- * @method drawSeries- */- drawSeries: function()- {- this.drawPlots();- },- - /**- * @protected- *- * Method used by `styles` setter. Overrides base implementation.- *- * @method _setStyles- * @param {Object} newStyles Hash of properties to update.- * @return Object- */- _setStyles: function(val)- {- if(!val.marker)- {- val = {marker:val};- }- val = this._parseMarkerStyles(val);- return Y.MarkerSeries.superclass._mergeStyles.apply(this, [val, this._getDefaultStyles()]);- },- - /**- * @protected- *- * Gets the default value for the `styles` attribute. Overrides- * base implementation.- *- * @method _getDefaultStyles- * @return Object- */- _getDefaultStyles: function()- {- var styles = this._mergeStyles({marker:this._getPlotDefaults()}, Y.MarkerSeries.superclass._getDefaultStyles());- return styles;- }-},{- ATTRS : {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default marker- */- type: {- value:"marker"- }- - /**- * Style properties used for drawing markers. This attribute is inherited from `Renderer`. Below are the default values:- * <dl>- * <dt>fill</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"]`- * </dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>border</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>- * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>width</dt><dd>indicates the width of the marker. The default value is 10.</dd>- * <dt>height</dt><dd>indicates the height of the marker The default value is 10.</dd>- * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default - * values for each style is null. When an over style is not set, the non-over value will be used. For example,- * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});--/**- * The LineSeries class renders quantitative data on a graph by connecting relevant data points.- *- * @module charts- * @class LineSeries- * @extends CartesianSeries- * @uses Lines- * @constructor- */-Y.LineSeries = Y.Base.create("lineSeries", Y.CartesianSeries, [Y.Lines], {- /**- * @protected- *- * @method drawSeries- */- drawSeries: function()- {- this.drawLines();- },-- /**- * @protected- *- * Method used by `styles` setter. Overrides base implementation.- *- * @method _setStyles- * @param {Object} newStyles Hash of properties to update.- * @return Object- */- _setStyles: function(val)- {- if(!val.line)- {- val = {line:val};- }- return Y.LineSeries.superclass._setStyles.apply(this, [val]);- },-- /**- * @protected- *- * Gets the default value for the `styles` attribute. Overrides- * base implementation.- *- * @method _getDefaultStyles- * @return Object- */- _getDefaultStyles: function()- {- var styles = this._mergeStyles({line:this._getLineDefaults()}, Y.LineSeries.superclass._getDefaultStyles());- return styles;- }-},-{- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default line- */- type: {- value:"line"- }-- /**- * Style properties used for drawing lines. This attribute is inherited from `Renderer`. Below are the default values:- * <dl>- * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be- * retrieved from the following array: - * `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]`- * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>- * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>- * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> - * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>- * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>- * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> - * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>- * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>- * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});---- -- -/**- * SplineSeries renders a graph with data points connected by a curve.- *- * @module charts- * @class SplineSeries- * @constructor- * @extends CartesianSeries- * @uses CurveUtil- * @uses Lines- */-Y.SplineSeries = Y.Base.create("splineSeries", Y.LineSeries, [Y.CurveUtil, Y.Lines], {- /**- * @protected- *- * Draws the series.- *- * @method drawSeries- */- drawSeries: function()- {- this.drawSpline();- }-}, {- ATTRS : {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default spline- */- type : {- value:"spline"- }-- /**- * Style properties used for drawing lines. This attribute is inherited from `Renderer`. Below are the default values:- * <dl>- * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be- * retrieved from the following array: - * `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]`- * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>- * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>- * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> - * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>- * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>- * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> - * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>- * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>- * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});---- -- -/**- * AreaSplineSeries renders an area graph with data points connected by a curve.- *- * @module charts- * @class AreaSplineSeries- * @constructor- * @extends CartesianSeries- * @uses Fills- * @uses CurveUtil- */-Y.AreaSplineSeries = Y.Base.create("areaSplineSeries", Y.CartesianSeries, [Y.Fills, Y.CurveUtil], {- /**- * @protected- *- * Draws the series.- *- * @method drawSeries- */- drawSeries: function()- {- this.drawAreaSpline();- }-}, {- ATTRS : {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default areaSpline- */- type: {- value:"areaSpline"- }- - /**- * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values:- *- * <dl>- * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be - * retrieved from the following array:- * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`- * </dd>- * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});--/**- * StackedSplineSeries creates spline graphs in which the different series are stacked along a value axis- * to indicate their contribution to a cumulative total.- *- * @module charts- * @class StackedSplineSeries- * @constructor- * @extends SplineSeries- * @extends StackingUtil- */-Y.StackedSplineSeries = Y.Base.create("stackedSplineSeries", Y.SplineSeries, [Y.StackingUtil], {- /**- * @protected- *- * Calculates the coordinates for the series. Overrides base implementation.- *- * @method setAreaData- */- setAreaData: function()- { - Y.StackedSplineSeries.superclass.setAreaData.apply(this);- this._stackCoordinates.apply(this);- }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default stackedSpline- */- type: {- value:"stackedSpline"- }- }-});--/**- * StackedMarkerSeries plots markers with different series stacked along the value axis to indicate each- * series' contribution to a cumulative total.- *- * @module charts- * @class StackedMarkerSeries- * @constructor- * @extends MarkerSeries- * @extends StackingUtil- */-Y.StackedMarkerSeries = Y.Base.create("stackedMarkerSeries", Y.MarkerSeries, [Y.StackingUtil], {- /**- * @protected- *- * Calculates the coordinates for the series. Overrides base implementation.- *- * @method setAreaData- */- setAreaData: function()- { - Y.StackedMarkerSeries.superclass.setAreaData.apply(this);- this._stackCoordinates.apply(this);- }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default stackedMarker- */- type: {- value:"stackedMarker"- }- }-});--/**- * The ColumnSeries class renders columns positioned horizontally along a category or time axis. The columns'- * lengths are proportional to the values they represent along a vertical axis.- * and the relevant data points.- *- * @module charts- * @class ColumnSeries- * @extends MarkerSeries- * @uses Histogram- * @constructor- */-Y.ColumnSeries = Y.Base.create("columnSeries", Y.MarkerSeries, [Y.Histogram], {- /**- * Helper method for calculating the size of markers. - *- * @method _getMarkerDimensions- * @param {Number} xcoord The x-coordinate representing the data point for the marker.- * @param {Number} ycoord The y-coordinate representing the data point for the marker.- * @param {Number} calculatedSize The calculated size for the marker. For a `BarSeries` is it the width. For a `ColumnSeries` it is the height.- * @param {Number} offset Distance of position offset dictated by other marker series in the same graph.- * @return Object- * @private- */- _getMarkerDimensions: function(xcoord, ycoord, calculatedSize, offset)- {- var config = {- left: xcoord + offset- };- if(this._bottomOrigin >= ycoord)- {- config.top = ycoord;- config.calculatedSize = this._bottomOrigin - config.top;- }- else- {- config.top = this._bottomOrigin;- config.calculatedSize = ycoord - this._bottomOrigin;- }- return config;- },-- /**- * Resizes and positions markers based on a mouse interaction.- *- * @method updateMarkerState- * @param {String} type state of the marker- * @param {Number} i index of the marker- * @protected- */- updateMarkerState: function(type, i)- {- if(this._markers && this._markers[i])- {- var styles = Y.clone(this.get("styles").marker),- markerStyles,- state = this._getState(type),- xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- marker = this._markers[i],- markers,- graph = this.get("graph"),- seriesStyles,- seriesCollection = graph.seriesTypes[this.get("type")],- seriesLen = seriesCollection.length,- seriesSize = 0,- offset = 0,- renderer,- n = 0,- xs = [],- order = this.get("order"),- config;- markerStyles = state == "off" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]); - markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);- markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);- config = this._getMarkerDimensions(xcoords[i], ycoords[i], styles.width, offset);- markerStyles.height = config.calculatedSize;- markerStyles.width = Math.min(this._maxSize, markerStyles.width);- marker.set(markerStyles);- for(; n < seriesLen; ++n)- {- xs[n] = xcoords[i] + seriesSize;- seriesStyles = seriesCollection[n].get("styles").marker;- seriesSize += Math.min(this._maxSize, seriesStyles.width);- if(order > n)- {- offset = seriesSize;- }- offset -= seriesSize/2;- }- for(n = 0; n < seriesLen; ++n)- {- markers = seriesCollection[n].get("markers");- if(markers)- {- renderer = markers[i];- if(renderer && renderer !== undefined)- {- renderer.set("x", (xs[n] - seriesSize/2));- }- }- }- }- }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @readOnly- * @default column- */- type: {- value: "column"- }- - /**- * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:- * <dl>- * <dt>fill</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`- * </dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>border</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>- * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>width</dt><dd>indicates the width of the marker. The default value is 12.</dd>- * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default - * values for each style is null. When an over style is not set, the non-over value will be used. For example,- * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});-/**- * The BarSeries class renders bars positioned vertically along a category or time axis. The bars'- * lengths are proportional to the values they represent along a horizontal axis.- * and the relevant data points.- *- * @module charts- * @class BarSeries- * @extends MarkerSeries- * @uses Histogram- * @constructor- */-Y.BarSeries = Y.Base.create("barSeries", Y.MarkerSeries, [Y.Histogram], {- /**- * Helper method for calculating the size of markers. - *- * @method _getMarkerDimensions- * @param {Number} xcoord The x-coordinate representing the data point for the marker.- * @param {Number} ycoord The y-coordinate representing the data point for the marker.- * @param {Number} calculatedSize The calculated size for the marker. For a `BarSeries` is it the width. For a `ColumnSeries` it is the height.- * @param {Number} offset Distance of position offset dictated by other marker series in the same graph.- * @return Object- * @private- */- _getMarkerDimensions: function(xcoord, ycoord, calculatedSize, offset)- {- var config = {- top: ycoord + offset- };- if(xcoord >= this._leftOrigin)- {- config.left = this._leftOrigin;- config.calculatedSize = xcoord - config.left;- }- else- {- config.left = xcoord;- config.calculatedSize = this._leftOrigin - xcoord;- }- return config;- },- - /**- * Resizes and positions markers based on a mouse interaction.- *- * @method updateMarkerState- * @param {String} type state of the marker- * @param {Number} i index of the marker- * @protected- */- updateMarkerState: function(type, i)- {- if(this._markers && this._markers[i])- {- var styles = Y.clone(this.get("styles").marker),- markerStyles,- state = this._getState(type),- xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- marker = this._markers[i],- markers,- graph = this.get("graph"),- seriesCollection = graph.seriesTypes[this.get("type")],- seriesLen = seriesCollection.length,- seriesStyles,- seriesSize = 0,- offset = 0,- renderer,- n = 0,- ys = [],- order = this.get("order"),- config;- markerStyles = state == "off" || !styles[state] ? styles : styles[state]; - markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);- markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);- config = this._getMarkerDimensions(xcoords[i], ycoords[i], styles.height, offset);- markerStyles.width = config.calculatedSize;- markerStyles.height = Math.min(this._maxSize, markerStyles.height);- marker.set(markerStyles);- for(; n < seriesLen; ++n)- {- ys[n] = ycoords[i] + seriesSize;- seriesStyles = seriesCollection[n].get("styles").marker;- seriesSize += Math.min(this._maxSize, seriesStyles.height); - if(order > n)- {- offset = seriesSize;- }- offset -= seriesSize/2;- }- for(n = 0; n < seriesLen; ++n)- {- markers = seriesCollection[n].get("markers");- if(markers)- {- renderer = markers[i];- if(renderer && renderer !== undefined)- {- renderer.set("y", (ys[n] - seriesSize/2));- }- }- }- }- }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default bar- */- type: {- value: "bar"- },-- /**- * Indicates the direction of the category axis that the bars are plotted against.- *- * @attribute direction- * @type String- */- direction: {- value: "vertical"- }- - /**- * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:- * <dl>- * <dt>fill</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`- * </dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>border</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>- * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>height</dt><dd>indicates the width of the marker. The default value is 12.</dd>- * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default - * values for each style is null. When an over style is not set, the non-over value will be used. For example,- * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});-/**- * The AreaSeries class renders quantitative data on a graph by creating a fill between 0- * and the relevant data points.- *- * @module charts- * @class AreaSeries- * @extends CartesianSeries- * @uses Fills- * @constructor- */-Y.AreaSeries = Y.Base.create("areaSeries", Y.CartesianSeries, [Y.Fills], {- /**- * @protected- *- * Renders the series. - *- * @method drawSeries- */- drawSeries: function()- {- this.drawFill.apply(this, this._getClosingPoints());- },- - /**- * @protected- *- * Method used by `styles` setter. Overrides base implementation.- *- * @method _setStyles- * @param {Object} newStyles Hash of properties to update.- * @return Object- */- _setStyles: function(val)- {- if(!val.area)- {- val = {area:val};- }- return Y.AreaSeries.superclass._setStyles.apply(this, [val]);- },-- /**- * @protected- *- * Gets the default value for the `styles` attribute. Overrides- * base implementation.- *- * @method _getDefaultStyles- * @return Object- */- _getDefaultStyles: function()- {- var styles = this._mergeStyles({area:this._getAreaDefaults()}, Y.AreaSeries.superclass._getDefaultStyles());- return styles;- }-},-{- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default area- */- type: {- value:"area"- }- - /**- * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values:- *- * <dl>- * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be - * retrieved from the following array:- * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`- * </dd>- * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});---- -- -/**- * StackedAreaSplineSeries creates a stacked area chart with points data points connected by a curve.- *- * @module charts- * @class StackedAreaSplineSeries- * @constructor- * @extends AreaSeries- * @uses CurveUtil- * @uses StackingUtil- */-Y.StackedAreaSplineSeries = Y.Base.create("stackedAreaSplineSeries", Y.AreaSeries, [Y.CurveUtil, Y.StackingUtil], {- /**- * @protected- *- * Draws the series.- *- * @method drawSeries- */- drawSeries: function()- {- this._stackCoordinates();- this.drawStackedAreaSpline();- }-}, {- ATTRS : {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default stackedAreaSpline- */- type: {- value:"stackedAreaSpline"- }- }-});--/**- * The ComboSeries class renders a combination of lines, plots and area fills in a single series. Each- * series type has a corresponding boolean attribute indicating if it is rendered. By default, lines and plots - * are rendered and area is not. - *- * @module charts- * @class ComboSeries- * @extends CartesianSeries - * @uses Fills- * @uses Lines- * @uses Plots- * @constructor- */-Y.ComboSeries = Y.Base.create("comboSeries", Y.CartesianSeries, [Y.Fills, Y.Lines, Y.Plots], {- /**- * @protected- * - * Draws the series.- *- * @method drawSeries- */- drawSeries: function()- {- if(this.get("showAreaFill"))- {- this.drawFill.apply(this, this._getClosingPoints());- }- if(this.get("showLines")) - {- this.drawLines();- }- if(this.get("showMarkers"))- {- this.drawPlots();- } - },- - /**- * Toggles visibility- *- * @method _toggleVisible- * @param {Boolean} visible indicates visibilitye- * @private- */- _toggleVisible: function(visible)- {- var markers,- marker,- len,- i;- if(this.get("showAreaFill") && this._path)- {- this._path.set("visible", visible);- }- if(this.get("showLines") && this._lineGraphic)- {- this._lineGraphic.set("visible", visible);- }- if(this.get("showMarkers"))- {- markers = this.get("markers");- if(markers)- {- i = 0;- len = markers.length;- for(; i < len; ++i)- {- marker = markers[i];- if(marker)- {- marker.set("visible", visible);- }- }- }- }- },-- /**- * @protected- *- * Returns the default hash for the `styles` attribute.- *- * @method _getDefaultStyles- * @return Object- */- _getDefaultStyles: function()- {- var styles = Y.ComboSeries.superclass._getDefaultStyles();- styles.line = this._getLineDefaults();- styles.marker = this._getPlotDefaults();- styles.area = this._getAreaDefaults();- return styles;- }-},-{- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default combo- */- type: {- value:"combo"- },-- /**- * Indicates whether a fill is displayed.- *- * @attribute showAreaFill- * @type Boolean- * @default false- */- showAreaFill: {- value: false- },-- /**- * Indicates whether lines are displayed.- *- * @attribute showLines- * @type Boolean- * @default true- */- showLines: {- value: true- },-- /**- * Indicates whether markers are displayed.- *- * @attribute showMarkers- * @type Boolean- * @default true- */- showMarkers: {- value: true- },-- /**- * Reference to the styles of the markers. These styles can also- * be accessed through the `styles` attribute. Below are default- * values:- * <dl>- * <dt>fill</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"]`- * </dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>border</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>- * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>width</dt><dd>indicates the width of the marker. The default value is 10.</dd>- * <dt>height</dt><dd>indicates the height of the marker The default value is 10.</dd>- * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default - * values for each style is null. When an over style is not set, the non-over value will be used. For example,- * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>- * </dl>- *- * @attribute marker- * @type Object- */- marker: {- lazyAdd: false,- getter: function()- {- return this.get("styles").marker;- },- setter: function(val)- {- this.set("styles", {marker:val});- }- },- - /**- * Reference to the styles of the lines. These styles can also be accessed through the `styles` attribute.- * Below are the default values:- * <dl>- * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be- * retrieved from the following array: - * `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]`- * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>- * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>- * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> - * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>- * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>- * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> - * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>- * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>- * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>- * </dl>- *- * @attribute line- * @type Object- */- line: {- lazyAdd: false,- getter: function()- {- return this.get("styles").line;- },- setter: function(val)- {- this.set("styles", {line:val});- }- },- - /**- * Reference to the styles of the area fills. These styles can also be accessed through the `styles` attribute.- * Below are the default values:- *- * <dl>- * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be - * retrieved from the following array:- * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`- * </dd>- * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>- * </dl>- *- * @attribute area- * @type Object- */- area: {- lazyAdd: false,- getter: function()- {- return this.get("styles").area;- },- setter: function(val)- {- this.set("styles", {area:val});- }- }-- /**- * Style properties for the series. Contains a key indexed hash of the following:- * <dl>- * <dt>marker</dt><dd>Style properties for the markers in the series. Specific style attributes are listed- * <a href="#attr_marker">here</a>.</dd>- * <dt>line</dt><dd>Style properties for the lines in the series. Specific- * style attributes are listed <a href="#attr_line">here</a>.</dd>- * <dt>area</dt><dd>Style properties for the area fills in the series. Specific style attributes are listed- * <a href="#attr_area">here</a>.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});---- -- -/**- * The StackedComboSeries class renders a combination of lines, plots and area fills in a single series. Series- * are stacked along the value axis to indicate each series contribution to a cumulative total. Each- * series type has a corresponding boolean attribute indicating if it is rendered. By default, all three types are- * rendered. - *- * @module charts- * @class StackedComboSeries- * @extends ComboSeries- * @uses StackingUtil- * @constructor- */-Y.StackedComboSeries = Y.Base.create("stackedComboSeries", Y.ComboSeries, [Y.StackingUtil], {- /**- * @protected- *- * Calculates the coordinates for the series. Overrides base implementation.- *- * @method setAreaData- */- setAreaData: function()- { - Y.StackedComboSeries.superclass.setAreaData.apply(this);- this._stackCoordinates.apply(this);- },- - /**- * @protected- *- * Draws the series.- *- * @method drawSeries- */- drawSeries: function()- {- if(this.get("showAreaFill"))- {- this.drawFill.apply(this, this._getStackedClosingPoints());- }- if(this.get("showLines")) - {- this.drawLines();- }- if(this.get("showMarkers"))- {- this.drawPlots();- } - }- -}, {- ATTRS : {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default stackedCombo- */- type: {- value: "stackedCombo"- },-- /**- * Indicates whether a fill is displayed.- *- * @attribute showAreaFill- * @type Boolean- * @default true- */- showAreaFill: {- value: true- }- }-});-/**- * The ComboSplineSeries class renders a combination of splines, plots and areaspline fills in a single series. Each- * series type has a corresponding boolean attribute indicating if it is rendered. By default, splines and plots - * are rendered and areaspline is not. - *- * @module charts- * @class ComboSplineSeries- * @extends ComboSeries- * @extends CurveUtil- * @constructor- */-Y.ComboSplineSeries = Y.Base.create("comboSplineSeries", Y.ComboSeries, [Y.CurveUtil], {- /**- * @protected- * - * Draws the series.- *- * @method drawSeries- */- drawSeries: function()- {- if(this.get("showAreaFill"))- {- this.drawAreaSpline();- }- if(this.get("showLines")) - {- this.drawSpline();- }- if(this.get("showMarkers"))- {- this.drawPlots();- } - }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default comboSpline- */- type: {- value : "comboSpline"- }- }-});-/**- * The StackedComboSplineSeries class renders a combination of splines, plots and areaspline fills in a single series. Series- * are stacked along the value axis to indicate each series contribution to a cumulative total. Each- * series type has a corresponding boolean attribute indicating if it is rendered. By default, all three types are- * rendered. - *- * @module charts- * @class StackedComboSplineSeries- * @extends StackedComboSeries- * @uses CurveUtil- * @constructor- */-Y.StackedComboSplineSeries = Y.Base.create("stackedComboSplineSeries", Y.StackedComboSeries, [Y.CurveUtil], {- /**- * @protected- *- * Draws the series.- *- * @method drawSeries- */- drawSeries: function()- {- if(this.get("showAreaFill"))- {- this.drawStackedAreaSpline();- }- if(this.get("showLines")) - {- this.drawSpline();- }- if(this.get("showMarkers"))- {- this.drawPlots();- } - }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default stackedComboSpline- */- type : {- value : "stackedComboSpline"- },-- /**- * Indicates whether a fill is displayed.- *- * @attribute showAreaFill- * @type Boolean- * @default true- */- showAreaFill: {- value: true- }- }-});-/**- * StackedLineSeries creates line graphs in which the different series are stacked along a value axis- * to indicate their contribution to a cumulative total.- *- * @module charts- * @class StackedLineSeries- * @constructor- * @extends LineSeries- * @uses StackingUtil- */-Y.StackedLineSeries = Y.Base.create("stackedLineSeries", Y.LineSeries, [Y.StackingUtil], {- /**- * @protected- *- * Calculates the coordinates for the series. Overrides base implementation.- *- * @method setAreaData- */- setAreaData: function()- { - Y.StackedLineSeries.superclass.setAreaData.apply(this);- this._stackCoordinates.apply(this);- }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default stackedLine- */- type: {- value:"stackedLine"- }- }-});-/**- * StackedAreaSeries area fills to display data showing its contribution to a whole.- *- * @module charts- * @class StackedAreaSeries- * @constructor- * @param {Object} config (optional) Configuration parameters for the Chart.- * @extends AreaSeries- * @uses StackingUtil- */-Y.StackedAreaSeries = Y.Base.create("stackedAreaSeries", Y.AreaSeries, [Y.StackingUtil], {- /**- * @protected- *- * Calculates the coordinates for the series. Overrides base implementation.- *- * @method setAreaData- */- setAreaData: function()- { - Y.StackedAreaSeries.superclass.setAreaData.apply(this);- this._stackCoordinates.apply(this);- },-- /**- * @protected- *- * Draws the series- *- * @method drawSeries- */- drawSeries: function()- {- this.drawFill.apply(this, this._getStackedClosingPoints());- }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default stackedArea- */- type: {- value:"stackedArea"- }- }-});-/**- * The StackedColumnSeries renders column chart in which series are stacked vertically to show- * their contribution to the cumulative total.- *- * @module charts- * @class StackedColumnSeries- * @extends ColumnSeries- * @uses StackingUtil- * @constructor- */-Y.StackedColumnSeries = Y.Base.create("stackedColumnSeries", Y.ColumnSeries, [Y.StackingUtil], {- /**- * Draws the series.- *- * @method drawSeries- * @protected- */- drawSeries: function()- {- if(this.get("xcoords").length < 1) - {- return;- }- var isNumber = Y_Lang.isNumber,- style = Y.clone(this.get("styles").marker), - w = style.width,- h = style.height,- xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- i = 0,- len = xcoords.length,- top = ycoords[0],- type = this.get("type"),- graph = this.get("graph"),- seriesCollection = graph.seriesTypes[type],- ratio,- order = this.get("order"),- graphOrder = this.get("graphOrder"),- left,- marker,- fillColors,- borderColors,- lastCollection,- negativeBaseValues,- positiveBaseValues,- useOrigin = order === 0,- totalWidth = len * w,- dimensions = {- width: [],- height: []- },- xvalues = [],- yvalues = [],- groupMarkers = this.get("groupMarkers");- if(Y_Lang.isArray(style.fill.color))- {- fillColors = style.fill.color.concat(); - }- if(Y_Lang.isArray(style.border.color))- {- borderColors = style.border.color.concat();- }- this._createMarkerCache();- if(totalWidth > this.get("width"))- {- ratio = this.width/totalWidth;- w *= ratio;- w = Math.max(w, 1);- }- if(!useOrigin)- {- lastCollection = seriesCollection[order - 1];- negativeBaseValues = lastCollection.get("negativeBaseValues");- positiveBaseValues = lastCollection.get("positiveBaseValues");- if(!negativeBaseValues || !positiveBaseValues)- {- useOrigin = true;- positiveBaseValues = [];- negativeBaseValues = [];- }- }- else- {- negativeBaseValues = [];- positiveBaseValues = [];- }- this.set("negativeBaseValues", negativeBaseValues);- this.set("positiveBaseValues", positiveBaseValues);- for(i = 0; i < len; ++i)- {- left = xcoords[i];- top = ycoords[i];- - if(!isNumber(top) || !isNumber(left))- {- if(useOrigin)- {- negativeBaseValues[i] = this._bottomOrigin;- positiveBaseValues[i] = this._bottomOrigin;- }- this._markers.push(null); - continue;- }- if(useOrigin)- {- h = Math.abs(this._bottomOrigin - top);- if(top < this._bottomOrigin)- {- positiveBaseValues[i] = top;- negativeBaseValues[i] = this._bottomOrigin;- }- else if(top > this._bottomOrigin)- {- positiveBaseValues[i] = this._bottomOrigin;- negativeBaseValues[i] = top;- top -= h;- }- else- {- positiveBaseValues[i] = top;- negativeBaseValues[i] = top;- }- }- else - {- if(top > this._bottomOrigin)- {- top += (negativeBaseValues[i] - this._bottomOrigin);- h = top - negativeBaseValues[i];- negativeBaseValues[i] = top;- top -= h;- }- else if(top <= this._bottomOrigin)- {- top = positiveBaseValues[i] - (this._bottomOrigin - top);- h = positiveBaseValues[i] - top;- positiveBaseValues[i] = top;- }- }- if(!isNaN(h) && h > 0)- {- left -= w/2;- if(groupMarkers)- {- dimensions.width[i] = w;- dimensions.height[i] = h;- xvalues.push(left);- yvalues.push(top);- }- else- {- style.width = w;- style.height = h;- style.x = left;- style.y = top;- if(fillColors)- {- style.fill.color = fillColors[i % fillColors.length];- }- if(borderColors)- {- style.border.color = borderColors[i % borderColors.length];- }- marker = this.getMarker(style, graphOrder, i);- }- }- else if(!groupMarkers)- {- this._markers.push(null);- }- }- if(groupMarkers)- {- this._createGroupMarker({- fill: style.fill,- border: style.border,- dimensions: dimensions,- xvalues: xvalues,- yvalues: yvalues,- shape: style.shape- });- }- else- {- this._clearMarkerCache();- }- },-- /**- * Resizes and positions markers based on a mouse interaction.- *- * @method updateMarkerState- * @param {String} type state of the marker- * @param {Number} i index of the marker- * @protected- */- updateMarkerState: function(type, i)- {- if(this._markers && this._markers[i])- {- var styles,- markerStyles,- state = this._getState(type),- xcoords = this.get("xcoords"),- marker = this._markers[i],- offset = 0,- fillColor,- borderColor; - styles = this.get("styles").marker;- offset = styles.width * 0.5;- markerStyles = state == "off" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]); - markerStyles.height = marker.get("height");- markerStyles.x = (xcoords[i] - offset);- markerStyles.y = marker.get("y");- markerStyles.id = marker.get("id");- fillColor = markerStyles.fill.color; - borderColor = markerStyles.border.color;- if(Y_Lang.isArray(fillColor))- {- markerStyles.fill.color = fillColor[i % fillColor.length];- }- else- {- markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);- }- if(Y_Lang.isArray(borderColor))- {- markerStyles.border.color = borderColor[i % borderColor.length];- }- else- {- markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);- }- marker.set(markerStyles);- }- },- - /**- * Gets the default values for the markers. - *- * @method _getPlotDefaults- * @return Object- * @protected- */- _getPlotDefaults: function()- {- var defs = {- fill:{- type: "solid",- alpha: 1,- colors:null,- alphas: null,- ratios: null- },- border:{- weight: 0,- alpha: 1- },- width: 24,- height: 24,- shape: "rect",-- padding:{- top: 0,- left: 0,- right: 0,- bottom: 0- }- };- defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");- defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");- return defs;- }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default stackedColumn- */- type: {- value: "stackedColumn"- },-- /**- * @attribute negativeBaseValues- * @type Array- * @default null- * @private- */- negativeBaseValues: {- value: null- },-- /**- * @attribute positiveBaseValues- * @type Array- * @default null- * @private- */- positiveBaseValues: {- value: null- }- - /**- * Style properties used for drawing markers. This attribute is inherited from `ColumnSeries`. Below are the default values:- * <dl>- * <dt>fill</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`- * </dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>border</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>- * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>width</dt><dd>indicates the width of the marker. The default value is 24.</dd>- * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default - * values for each style is null. When an over style is not set, the non-over value will be used. For example,- * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});--/**- * The StackedBarSeries renders bar chart in which series are stacked horizontally to show- * their contribution to the cumulative total.- *- * @module charts- * @class StackedBarSeries- * @extends BarSeries- * @uses StackingUtil- * @constructor- */-Y.StackedBarSeries = Y.Base.create("stackedBarSeries", Y.BarSeries, [Y.StackingUtil], {- /**- * @protected- *- * Draws the series.- *- * @method drawSeries- */- drawSeries: function()- {- if(this.get("xcoords").length < 1) - {- return;- }-- var isNumber = Y_Lang.isNumber,- style = Y.clone(this.get("styles").marker),- w = style.width,- h = style.height,- xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- i = 0,- len = xcoords.length,- top = ycoords[0],- type = this.get("type"),- graph = this.get("graph"),- seriesCollection = graph.seriesTypes[type],- ratio,- order = this.get("order"),- graphOrder = this.get("graphOrder"),- left,- marker,- lastCollection,- negativeBaseValues,- positiveBaseValues,- fillColors,- borderColors,- useOrigin = order === 0,- totalHeight = len * h,- dimensions = {- width: [],- height: []- },- xvalues = [],- yvalues = [],- groupMarkers = this.get("groupMarkers");- if(Y_Lang.isArray(style.fill.color))- {- fillColors = style.fill.color.concat(); - }- if(Y_Lang.isArray(style.border.color))- {- borderColors = style.border.color.concat();- }- this._createMarkerCache();- if(totalHeight > this.get("height"))- {- ratio = this.height/totalHeight;- h *= ratio;- h = Math.max(h, 1);- }- if(!useOrigin)- {- lastCollection = seriesCollection[order - 1];- negativeBaseValues = lastCollection.get("negativeBaseValues");- positiveBaseValues = lastCollection.get("positiveBaseValues");- if(!negativeBaseValues || !positiveBaseValues)- {- useOrigin = true;- positiveBaseValues = [];- negativeBaseValues = [];- }- }- else- {- negativeBaseValues = [];- positiveBaseValues = [];- }- this.set("negativeBaseValues", negativeBaseValues);- this.set("positiveBaseValues", positiveBaseValues);- for(i = 0; i < len; ++i)- {- top = ycoords[i];- left = xcoords[i];- if(!isNumber(top) || !isNumber(left))- {- if(useOrigin)- {- positiveBaseValues[i] = this._leftOrigin;- negativeBaseValues[i] = this._leftOrigin;- }- this._markers.push(null);- continue;- }- if(useOrigin)- {- w = Math.abs(left - this._leftOrigin);- if(left > this._leftOrigin)- {- positiveBaseValues[i] = left;- negativeBaseValues[i] = this._leftOrigin;- left -= w;- }- else if(left < this._leftOrigin)- { - positiveBaseValues[i] = this._leftOrigin;- negativeBaseValues[i] = left;- }- else- {- positiveBaseValues[i] = left;- negativeBaseValues[i] = this._leftOrigin;- }- }- else- {- if(left < this._leftOrigin)- {- left = negativeBaseValues[i] - (this._leftOrigin - xcoords[i]);- w = negativeBaseValues[i] - left;- negativeBaseValues[i] = left;- }- else if(left >= this._leftOrigin)- {- left += (positiveBaseValues[i] - this._leftOrigin);- w = left - positiveBaseValues[i];- positiveBaseValues[i] = left;- left -= w;- }- }- if(!isNaN(w) && w > 0)- {- top -= h/2;- if(groupMarkers)- {- dimensions.width[i] = w;- dimensions.height[i] = h;- xvalues.push(left);- yvalues.push(top);- }- else- {- style.width = w;- style.height = h;- style.x = left;- style.y = top;- if(fillColors)- {- style.fill.color = fillColors[i % fillColors.length];- }- if(borderColors)- {- style.border.color = borderColors[i % borderColors.length];- }- marker = this.getMarker(style, graphOrder, i);- }- }- else if(!groupMarkers)- {- this._markers.push(null);- }- }- if(groupMarkers)- {- this._createGroupMarker({- fill: style.fill,- border: style.border,- dimensions: dimensions,- xvalues: xvalues,- yvalues: yvalues,- shape: style.shape- });- }- else- {- this._clearMarkerCache();- }- },-- /**- * @protected- *- * Resizes and positions markers based on a mouse interaction.- *- * @method updateMarkerState- * @param {String} type state of the marker- * @param {Number} i index of the marker- */- updateMarkerState: function(type, i)- {- if(this._markers[i])- {- var state = this._getState(type),- ycoords = this.get("ycoords"),- marker = this._markers[i],- styles = this.get("styles").marker,- h = styles.height,- markerStyles = state == "off" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]), - fillColor,- borderColor; - markerStyles.y = (ycoords[i] - h/2);- markerStyles.x = marker.get("x");- markerStyles.width = marker.get("width");- markerStyles.id = marker.get("id");- fillColor = markerStyles.fill.color; - borderColor = markerStyles.border.color;- if(Y_Lang.isArray(fillColor))- {- markerStyles.fill.color = fillColor[i % fillColor.length];- }- else- {- markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);- }- if(Y_Lang.isArray(borderColor))- {- markerStyles.border.color = borderColor[i % borderColor.length];- }- else- {- markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);- }- marker.set(markerStyles);- }- },- - /**- * @protected- *- * Returns default values for the `styles` attribute.- * - * @method _getPlotDefaults- * @return Object- */- _getPlotDefaults: function()- {- var defs = {- fill:{- type: "solid",- alpha: 1,- colors:null,- alphas: null,- ratios: null- },- border:{- weight: 0,- alpha: 1- },- width: 24,- height: 24,- shape: "rect",-- padding:{- top: 0,- left: 0,- right: 0,- bottom: 0- }- };- defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");- defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");- return defs;- }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default stackedBar- */- type: {- value: "stackedBar"- },-- /**- * Direction of the series- *- * @attribute direction- * @type String- * @default vertical- */- direction: {- value: "vertical"- },-- /**- * @private- *- * @attribute negativeBaseValues- * @type Array- * @default null- */- negativeBaseValues: {- value: null- },-- /**- * @private- *- * @attribute positiveBaseValues- * @type Array- * @default null- */- positiveBaseValues: {- value: null- }- - /**- * Style properties used for drawing markers. This attribute is inherited from `BarSeries`. Below are the default values:- * <dl>- * <dt>fill</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`- * </dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>border</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>- * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>height</dt><dd>indicates the width of the marker. The default value is 24.</dd>- * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default - * values for each style is null. When an over style is not set, the non-over value will be used. For example,- * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});--/**- * PieSeries visualizes data as a circular chart divided into wedges which represent data as a - * percentage of a whole.- *- * @module charts- * @class PieSeries- * @constructor- * @extends MarkerSeries- */-Y.PieSeries = Y.Base.create("pieSeries", Y.MarkerSeries, [], { - /**- * Image map used for interactivity when rendered with canvas.- *- * @property _map- * @type HTMLElement- * @private- */- _map: null,-- /**- * Image used for image map when rendered with canvas.- *- * @property _image- * @type HTMLElement- * @private- */- _image: null,-- /**- * Creates or updates the image map when rendered with canvas.- *- * @method _setMap- * @private- */- _setMap: function()- {- var id = "pieHotSpotMapi_" + Math.round(100000 * Math.random()),- cb = this.get("graph").get("contentBox"),- areaNode;- if(this._image)- {- cb.removeChild(this._image);- while(this._areaNodes && this._areaNodes.length > 0)- {- areaNode = this._areaNodes.shift();- this._map.removeChild(areaNode);- }- cb.removeChild(this._map);- }- this._image = DOCUMENT.createElement("img"); - this._image.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==";- cb.appendChild(this._image);- this._image.setAttribute("usemap", "#" + id);- this._image.style.zIndex = 3;- this._image.style.opacity = 0;- this._image.setAttribute("alt", "imagemap");- this._map = DOCUMENT.createElement("map");- this._map.style.zIndex = 5;- cb.appendChild(this._map);- this._map.setAttribute("name", id);- this._map.setAttribute("id", id);- this._areaNodes = [];- },-- /**- * Storage for `categoryDisplayName` attribute.- *- * @property _categoryDisplayName- * @private- */- _categoryDisplayName: null,- - /**- * Storage for `valueDisplayName` attribute.- *- * @property _valueDisplayName- * @private- */- _valueDisplayName: null,-- /**- * Adds event listeners.- *- * @method addListeners- * @private- */- addListeners: function()- {- var categoryAxis = this.get("categoryAxis"),- valueAxis = this.get("valueAxis");- if(categoryAxis)- {- categoryAxis.after("dataReady", Y.bind(this._categoryDataChangeHandler, this));- categoryAxis.after("dataUpdate", Y.bind(this._categoryDataChangeHandler, this));- }- if(valueAxis)- {- valueAxis.after("dataReady", Y.bind(this._valueDataChangeHandler, this));- valueAxis.after("dataUpdate", Y.bind(this._valueDataChangeHandler, this));- }- this.after("categoryAxisChange", this.categoryAxisChangeHandler);- this.after("valueAxisChange", this.valueAxisChangeHandler);- this.after("stylesChange", this._updateHandler);- },- - /**- * Draws the series.- *- * @method validate- * @private- */- validate: function()- {- this.draw();- this._renderered = true;- },-- /**- * Event handler for the categoryAxisChange event.- *- * @method _categoryAxisChangeHandler- * @param {Object} e Event object.- * @private- */- _categoryAxisChangeHandler: function(e)- {- var categoryAxis = this.get("categoryAxis");- categoryAxis.after("dataReady", Y.bind(this._categoryDataChangeHandler, this));- categoryAxis.after("dataUpdate", Y.bind(this._categoryDataChangeHandler, this));- },- - /**- * Event handler for the valueAxisChange event.- *- * @method _valueAxisChangeHandler- * @param {Object} e Event object.- * @private- */- _valueAxisChangeHandler: function(e)- {- var valueAxis = this.get("valueAxis");- valueAxis.after("dataReady", Y.bind(this._valueDataChangeHandler, this));- valueAxis.after("dataUpdate", Y.bind(this._valueDataChangeHandler, this));- },- - /**- * Constant used to generate unique id.- *- * @property GUID- * @type String- * @private- */- GUID: "pieseries",- - /**- * Event handler for categoryDataChange event.- *- * @method _categoryDataChangeHandler- * @param {Object} event Event object.- * @private - */- _categoryDataChangeHandler: function(event)- {- if(this._rendered && this.get("categoryKey") && this.get("valueKey"))- {- this.draw();- }- },-- /**- * Event handler for valueDataChange event.- *- * @method _valueDataChangeHandler- * @param {Object} event Event object.- * @private - */- _valueDataChangeHandler: function(event)- {- if(this._rendered && this.get("categoryKey") && this.get("valueKey"))- {- this.draw();- }- },- - /**- * Draws the series. Overrides the base implementation.- *- * @method draw- * @protected- */- draw: function()- {- var graph = this.get("graph"),- w = graph.get("width"),- h = graph.get("height");- if(isFinite(w) && isFinite(h) && w > 0 && h > 0)- { - this._rendered = true;- if(this._drawing)- {- this._callLater = true;- return;- }- this._drawing = true;- this._callLater = false;- this.drawSeries();- this._drawing = false;- if(this._callLater)- {- this.draw();- }- else- {- this.fire("drawingComplete");- }- }- },-- /**- * Draws the markers- *- * @method drawPlots- * @protected- */- drawPlots: function()- {- var values = this.get("valueAxis").getDataByKey(this.get("valueKey")).concat(),- catValues = this.get("categoryAxis").getDataByKey(this.get("categoryKey")).concat(),- totalValue = 0,- itemCount = values.length,- styles = this.get("styles").marker,- fillColors = styles.fill.colors,- fillAlphas = styles.fill.alphas || ["1"],- borderColors = styles.border.colors,- borderWeights = [styles.border.weight],- borderAlphas = [styles.border.alpha],- tbw = borderWeights.concat(),- tbc = borderColors.concat(),- tba = borderAlphas.concat(),- tfc,- tfa,- padding = styles.padding,- graph = this.get("graph"),- minDimension = Math.min(graph.get("width"), graph.get("height")),- w = minDimension - (padding.left + padding.right),- h = minDimension - (padding.top + padding.bottom),- startAngle = -90,- halfWidth = w / 2,- halfHeight = h / 2,- radius = Math.min(halfWidth, halfHeight),- i = 0,- value,- angle = 0,- lc,- la,- lw,- wedgeStyle,- marker,- graphOrder = this.get("graphOrder"),- isCanvas = Y.Graphic.NAME == "canvasGraphic";- for(; i < itemCount; ++i)- {- value = parseFloat(values[i]);- - values.push(value);- if(!isNaN(value))- {- totalValue += value;- }- }- - tfc = fillColors ? fillColors.concat() : null;- tfa = fillAlphas ? fillAlphas.concat() : null;- this._createMarkerCache();- if(isCanvas)- {- this._setMap();- this._image.width = w;- this._image.height = h;- }- for(i = 0; i < itemCount; i++)- {- value = values[i];- if(totalValue === 0)- {- angle = 360 / values.length;- }- else- {- angle = 360 * (value / totalValue);- }- angle = Math.round(angle);- if(tfc && tfc.length < 1)- {- tfc = fillColors.concat();- }- if(tfa && tfa.length < 1)- {- tfa = fillAlphas.concat();- }- if(tbw && tbw.length < 1)- {- tbw = borderWeights.concat();- }- if(tbw && tbc.length < 1)- {- tbc = borderColors.concat();- }- if(tba && tba.length < 1)- {- tba = borderAlphas.concat();- }- lw = tbw ? tbw.shift() : null;- lc = tbc ? tbc.shift() : null;- la = tba ? tba.shift() : null;- startAngle += angle;- wedgeStyle = {- border: {- color:lc,- weight:lw,- alpha:la- },- fill: {- color:tfc ? tfc.shift() : this._getDefaultColor(i, "slice"),- alpha:tfa ? tfa.shift() : null- },- type: "pieslice",- arc: angle,- radius: radius,- startAngle: startAngle,- cx: halfWidth,- cy: halfHeight,- width: w,- height: h- };- marker = this.getMarker(wedgeStyle, graphOrder, i);- if(isCanvas)- {- this._addHotspot(wedgeStyle, graphOrder, i);- }- }- this._clearMarkerCache();- },-- /**- * Adds an interactive map when rendering in canvas.- *- * @method _addHotspot- * @param {Object} cfg Object containing data used to draw the hotspot- * @param {Number} seriesIndex Index of series in the `seriesCollection`.- * @param {Number} index Index of the marker using the hotspot.- * @private- */- _addHotspot: function(cfg, seriesIndex, index)- {- var areaNode = DOCUMENT.createElement("area"),- i = 1,- x = cfg.cx,- y = cfg.cy, - arc = cfg.arc,- startAngle = cfg.startAngle - arc, - endAngle = cfg.startAngle,- radius = cfg.radius, - ax = x + Math.cos(startAngle / 180 * Math.PI) * radius,- ay = y + Math.sin(startAngle / 180 * Math.PI) * radius,- bx = x + Math.cos(endAngle / 180 * Math.PI) * radius,- by = y + Math.sin(endAngle / 180 * Math.PI) * radius,- numPoints = Math.floor(arc/10) - 1,- divAngle = (arc/(Math.floor(arc/10)) / 180) * Math.PI,- angleCoord = Math.atan((ay - y)/(ax - x)),- pts = x + ", " + y + ", " + ax + ", " + ay,- cosAng,- sinAng,- multDivAng;- for(i = 1; i <= numPoints; ++i)- {- multDivAng = divAngle * i;- cosAng = Math.cos(angleCoord + multDivAng);- sinAng = Math.sin(angleCoord + multDivAng);- if(startAngle <= 90)- {- pts += ", " + (x + (radius * Math.cos(angleCoord + (divAngle * i))));- pts += ", " + (y + (radius * Math.sin(angleCoord + (divAngle * i))));- }- else- {- pts += ", " + (x - (radius * Math.cos(angleCoord + (divAngle * i))));- pts += ", " + (y - (radius * Math.sin(angleCoord + (divAngle * i))));- }- }- pts += ", " + bx + ", " + by;- pts += ", " + x + ", " + y;- this._map.appendChild(areaNode);- areaNode.setAttribute("class", SERIES_MARKER);- areaNode.setAttribute("id", "hotSpot_" + seriesIndex + "_" + index);- areaNode.setAttribute("shape", "polygon");- areaNode.setAttribute("coords", pts);- this._areaNodes.push(areaNode);-- },-- /**- * Resizes and positions markers based on a mouse interaction.- *- * @method updateMarkerState- * @param {String} type state of the marker- * @param {Number} i index of the marker- * @protected- */- updateMarkerState: function(type, i)- {- if(this._markers[i])- {- var state = this._getState(type),- markerStyles,- indexStyles,- marker = this._markers[i],- styles = this.get("styles").marker; - markerStyles = state == "off" || !styles[state] ? styles : styles[state]; - indexStyles = this._mergeStyles(markerStyles, {});- indexStyles.fill.color = indexStyles.fill.colors[i % indexStyles.fill.colors.length];- indexStyles.fill.alpha = indexStyles.fill.alphas[i % indexStyles.fill.alphas.length];- marker.set(indexStyles);- }- },- - /**- * Creates a shape to be used as a marker.- *- * @method _createMarker- * @param {Object} styles Hash of style properties.- * @param {Number} order Order of the series.- * @param {Number} index Index within the series associated with the marker.- * @return Shape- * @private- */- _createMarker: function(styles, order, index)- {- var graphic = this.get("graphic"),- marker,- cfg = Y.clone(styles);- graphic.set("autoDraw", false);- marker = graphic.addShape(cfg); - marker.addClass(SERIES_MARKER);- return marker;- },- - /**- * Creates a cache of markers for reuse.- *- * @method _createMarkerCache- * @private- */- _clearMarkerCache: function()- {- var len = this._markerCache.length,- i = 0,- marker;- for(; i < len; ++i)- {- marker = this._markerCache[i];- if(marker)- {- marker.destroy();- }- }- this._markerCache = [];- },-- /**- * Gets the default style values for the markers.- *- * @method _getPlotDefaults- * @return Object- * @private- */- _getPlotDefaults: function()- {- var defs = {- padding:{- top: 0,- left: 0,- right: 0,- bottom: 0- },- fill:{- alphas:["1"]- },- border: {- weight: 0,- alpha: 1- }- };- defs.fill.colors = this._defaultSliceColors;- defs.border.colors = this._defaultBorderColors;- return defs;- },-- /**- * Collection of default colors used for lines in a series when not specified by user.- *- * @property _defaultLineColors- * @type Array- * @protected- */- _defaultLineColors:["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"],-- /**- * Collection of default colors used for marker fills in a series when not specified by user.- *- * @property _defaultFillColors- * @type Array- * @protected- */- _defaultFillColors:["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"],- - /**- * Collection of default colors used for marker borders in a series when not specified by user.- *- * @property _defaultBorderColors- * @type Array- * @protected- */- _defaultBorderColors:["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"],- - /**- * Collection of default colors used for area fills, histogram fills and pie fills in a series when not specified by user.- *- * @property _defaultSliceColors- * @type Array- * @protected- */- _defaultSliceColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],-- /**- * Colors used if style colors are not specified- *- * @method _getDefaultColor- * @param {Number} index Index indicating the series order.- * @param {String} type Indicates which type of object needs the color.- * @return String- * @protected- */- _getDefaultColor: function(index, type)- {- var colors = {- line: this._defaultLineColors,- fill: this._defaultFillColors,- border: this._defaultBorderColors,- slice: this._defaultSliceColors- },- col = colors[type],- l = col.length;- index = index || 0;- if(index >= l)- {- index = index % l;- }- type = type || "fill";- return colors[type][index];- }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default pie- */- type: { - value: "pie"- },- - /**- * Order of this instance of this `type`.- *- * @attribute order- * @type Number- */- order: {},-- /**- * Reference to the `Graph` in which the series is drawn into.- *- * @attribute graph- * @type Graph- */- graph: {},- - /**- * Reference to the `Axis` instance used for assigning - * category values to the graph.- *- * @attribute categoryAxis- * @type Axis- */- categoryAxis: {- value: null,-- validator: function(value)- {- return value !== this.get("categoryAxis");- }- },- - /**- * Reference to the `Axis` instance used for assigning - * series values to the graph.- *- * @attribute categoryAxis- * @type Axis- */- valueAxis: {- value: null,-- validator: function(value)- {- return value !== this.get("valueAxis");- }- },-- /**- * Indicates which array to from the hash of value arrays in - * the category `Axis` instance.- *- * @attribute categoryKey- * @type String- */- categoryKey: {- value: null,-- validator: function(value)- {- return value !== this.get("categoryKey");- }- },- /**- * Indicates which array to from the hash of value arrays in - * the value `Axis` instance.- *- * @attribute valueKey- * @type String- */- valueKey: {- value: null,-- validator: function(value)- {- return value !== this.get("valueKey");- }- },-- /**- * Name used for for displaying category data- *- * @attribute categoryDisplayName- * @type String- */- categoryDisplayName: {- setter: function(val)- {- this._categoryDisplayName = val;- return val;- },-- getter: function()- {- return this._categoryDisplayName || this.get("categoryKey");- }- },-- /**- * Name used for for displaying value data- *- * @attribute valueDisplayName- * @type String- */- valueDisplayName: {- setter: function(val)- {- this._valueDisplayName = val;- return val;- },-- getter: function()- {- return this._valueDisplayName || this.get("valueKey");- }- },- - /**- * @attribute slices- * @type Array- * @private- */- slices: null- - /**- * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:- * <dl>- * <dt>fill</dt><dd>A hash containing the following values:- * <dl>- * <dt>colors</dt><dd>An array of colors to be used for the marker fills. The color for each marker is retrieved from the - * array below:<br/>- * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`- * </dd>- * <dt>alphas</dt><dd>An array of alpha references (Number from 0 to 1) indicating the opacity of each marker fill. The default value is [1].</dd>- * </dl>- * </dd>- * <dt>border</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>An array of colors to be used for the marker borders. The color for each marker is retrieved from the- * array below:<br/>- * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>- * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default - * values for each style is null. When an over style is not set, the non-over value will be used. For example,- * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});-/**- * Gridlines draws gridlines on a Graph.- *- * @module charts- * @class Gridlines- * @constructor- * @extends Base- * @uses Renderer- */-Y.Gridlines = Y.Base.create("gridlines", Y.Base, [Y.Renderer], {- /**- * Reference to the `Path` element used for drawing Gridlines.- *- * @property _path- * @type Path- * @private- */- _path: null,-- /**- * Removes the Gridlines.- *- * @method remove- * @private- */- remove: function()- {- var path = this._path;- if(path)- {- path.destroy();- }- },-- /**- * Draws the gridlines- *- * @method draw- * @protected- */- draw: function()- {- if(this.get("axis") && this.get("graph"))- {- this._drawGridlines();- }- },-- /**- * Algorithm for drawing gridlines- *- * @method _drawGridlines- * @private- */- _drawGridlines: function()- {- var path,- axis = this.get("axis"),- axisPosition = axis.get("position"),- points,- i = 0,- l,- direction = this.get("direction"),- graph = this.get("graph"),- w = graph.get("width"),- h = graph.get("height"),- line = this.get("styles").line,- color = line.color,- weight = line.weight,- alpha = line.alpha,- lineFunction = direction == "vertical" ? this._verticalLine : this._horizontalLine;- if(isFinite(w) && isFinite(h) && w > 0 && h > 0)- {- if(axisPosition != "none" && axis && axis.get("tickPoints"))- {- points = axis.get("tickPoints");- l = points.length;- }- else- {- points = [];- l = axis.get("styles").majorUnit.count;- for(; i < l; ++i)- {- points[i] = {- x: w * (i/(l-1)),- y: h * (i/(l-1))- };- }- i = 0;- }- path = graph.get("gridlines");- path.set("width", w);- path.set("height", h);- path.set("stroke", {- weight: weight,- color: color,- opacity: alpha- });- for(; i < l; ++i)- {- lineFunction(path, points[i], w, h);- }- path.end();- }- },-- /**- * Algorithm for horizontal lines.- *- * @method _horizontalLine- * @param {Path} path Reference to path element- * @param {Object} pt Coordinates corresponding to a major unit of an axis.- * @param {Number} w Width of the Graph- * @param {Number} h Height of the Graph- * @private- */- _horizontalLine: function(path, pt, w, h)- {- path.moveTo(0, pt.y);- path.lineTo(w, pt.y);- },-- /**- * Algorithm for vertical lines.- *- * @method _verticalLine- * @param {Path} path Reference to path element- * @param {Object} pt Coordinates corresponding to a major unit of an axis.- * @param {Number} w Width of the Graph- * @param {Number} h Height of the Graph- * @private- */- _verticalLine: function(path, pt, w, h)- {- path.moveTo(pt.x, 0);- path.lineTo(pt.x, h);- },- - /**- * Gets the default value for the `styles` attribute. Overrides- * base implementation.- *- * @method _getDefaultStyles- * @return Object- * @protected- */- _getDefaultStyles: function()- {- var defs = {- line: {- color:"#f0efe9",- weight: 1,- alpha: 1- }- };- return defs;- }--},-{- ATTRS: {- /**- * Indicates the direction of the gridline.- *- * @attribute direction- * @type String- */- direction: {},- - /**- * Indicate the `Axis` in which to bind- * the gridlines.- *- * @attribute axis- * @type Axis- */- axis: {},- - /**- * Indicates the `Graph` in which the gridlines - * are drawn.- *- * @attribute graph- * @type Graph- */- graph: {}- }-});-/**- * Graph manages and contains series instances for a `CartesianChart`- * instance.- *- * @module charts- * @class Graph- * @constructor- * @extends Widget- * @uses Renderer- */-Y.Graph = Y.Base.create("graph", Y.Widget, [Y.Renderer], {- /**- * @method bindUI- * @private- */- bindUI: function()- {- var bb = this.get("boundingBox");- bb.setStyle("position", "absolute");- this.after("widthChange", this._sizeChangeHandler);- this.after("heightChange", this._sizeChangeHandler);- this.after("stylesChange", this._updateStyles);- },-- /**- * @method syncUI- * @private- */- syncUI: function()- {- var background,- cb,- bg,- sc = this.get("seriesCollection"),- series,- i = 0,- len = sc.length,- hgl = this.get("horizontalGridlines"),- vgl = this.get("verticalGridlines");- if(this.get("showBackground"))- {- background = this.get("background");- cb = this.get("contentBox");- bg = this.get("styles").background;- bg.stroke = bg.border;- bg.stroke.opacity = bg.stroke.alpha;- bg.fill.opacity = bg.fill.alpha;- bg.width = this.get("width");- bg.height = this.get("height");- bg.type = bg.shape;- background.set(bg);- }- for(; i < len; ++i)- {- series = sc[i];- if(series instanceof Y.CartesianSeries)- {- series.render();- }- }- if(hgl && hgl instanceof Y.Gridlines)- {- hgl.draw();- }- if(vgl && vgl instanceof Y.Gridlines)- {- vgl.draw();- }- },- - /**- * Object of arrays containing series mapped to a series type.- *- * @property seriesTypes- * @type Object- * @private- */- seriesTypes: null,-- /**- * Returns a series instance based on an index.- * - * @method getSeriesByIndex- * @param {Number} val index of the series- * @return CartesianSeries- */- getSeriesByIndex: function(val)- {- var col = this.get("seriesCollection"),- series;- if(col && col.length > val)- {- series = col[val];- }- return series;- },-- /**- * Returns a series instance based on a key value.- * - * @method getSeriesByKey- * @param {String} val key value of the series- * @return CartesianSeries- */- getSeriesByKey: function(val)- {- var obj = this._seriesDictionary,- series;- if(obj && obj.hasOwnProperty(val))- {- series = obj[val];- }- return series;- },-- /**- * Adds dispatcher to a `_dispatcher` used to- * to ensure all series have redrawn before for firing event.- *- * @method addDispatcher- * @param {CartesianSeries} val series instance to add- * @protected- */- addDispatcher: function(val)- {- if(!this._dispatchers)- {- this._dispatchers = [];- }- this._dispatchers.push(val);- },-- /**- * Collection of series to be displayed in the graph.- *- * @property _seriesCollection- * @type Array- * @private - */- _seriesCollection: null,- - /**- * Object containing key value pairs of `CartesianSeries` instances.- *- * @property _seriesDictionary- * @type Object- * @private- */- _seriesDictionary: null,-- /**- * Parses series instances to be displayed in the graph.- *- * @method _parseSeriesCollection- * @param {Array} Collection of `CartesianSeries` instances or objects container `CartesianSeries` attributes values.- * @private- */- _parseSeriesCollection: function(val)- {- if(!val)- {- return;- } - var len = val.length,- i = 0,- series,- seriesKey;- if(!this.get("seriesCollection"))- {- this._seriesCollection = [];- }- if(!this._seriesDictionary)- {- this._seriesDictionary = {};- }- if(!this.seriesTypes)- {- this.seriesTypes = [];- }- for(; i < len; ++i)- { - series = val[i];- if(!(series instanceof Y.CartesianSeries) && !(series instanceof Y.PieSeries))- {- this._createSeries(series);- continue;- }- this._addSeries(series);- }- len = this.get("seriesCollection").length;- for(i = 0; i < len; ++i)- {- series = this.get("seriesCollection")[i];- seriesKey = series.get("direction") == "horizontal" ? "yKey" : "xKey";- this._seriesDictionary[series.get(seriesKey)] = series;- }- },-- /**- * Adds a series to the graph.- *- * @method _addSeries- * @param {CartesianSeries} series Series to add to the graph.- * @private- */- _addSeries: function(series)- {- var type = series.get("type"),- seriesCollection = this.get("seriesCollection"),- graphSeriesLength = seriesCollection.length,- seriesTypes = this.seriesTypes,- typeSeriesCollection; - if(!series.get("graph")) - {- series.set("graph", this);- }- seriesCollection.push(series);- if(!seriesTypes.hasOwnProperty(type))- {- this.seriesTypes[type] = [];- }- typeSeriesCollection = this.seriesTypes[type];- series.set("graphOrder", graphSeriesLength);- series.set("order", typeSeriesCollection.length);- typeSeriesCollection.push(series);- this.addDispatcher(series);- series.after("drawingComplete", Y.bind(this._drawingCompleteHandler, this));- this.fire("seriesAdded", series);- },-- /**- * Creates a `CartesianSeries` instance from an object containing attribute key value pairs. The key value pairs include attributes for the specific series and a type value which defines the type of- * series to be used. - *- * @method createSeries- * @param {Object} seriesData Series attribute key value pairs.- * @private- */- _createSeries: function(seriesData)- {- var type = seriesData.type,- seriesCollection = this.get("seriesCollection"),- seriesTypes = this.seriesTypes,- typeSeriesCollection,- seriesType,- series;- seriesData.graph = this;- if(!seriesTypes.hasOwnProperty(type))- {- seriesTypes[type] = [];- }- typeSeriesCollection = seriesTypes[type];- seriesData.graph = this;- seriesData.order = typeSeriesCollection.length;- seriesData.graphOrder = seriesCollection.length;- seriesType = this._getSeries(seriesData.type);- series = new seriesType(seriesData);- this.addDispatcher(series);- series.after("drawingComplete", Y.bind(this._drawingCompleteHandler, this));- typeSeriesCollection.push(series);- seriesCollection.push(series);- },- - /**- * String reference for pre-defined `Series` classes.- *- * @property _seriesMap- * @type Object- * @private- */- _seriesMap: {- line : Y.LineSeries,- column : Y.ColumnSeries,- bar : Y.BarSeries,- area : Y.AreaSeries,- candlestick : Y.CandlestickSeries,- ohlc : Y.OHLCSeries,- stackedarea : Y.StackedAreaSeries,- stackedline : Y.StackedLineSeries,- stackedcolumn : Y.StackedColumnSeries,- stackedbar : Y.StackedBarSeries,- markerseries : Y.MarkerSeries,- spline : Y.SplineSeries,- areaspline : Y.AreaSplineSeries,- stackedspline : Y.StackedSplineSeries,- stackedareaspline : Y.StackedAreaSplineSeries,- stackedmarkerseries : Y.StackedMarkerSeries,- pie : Y.PieSeries,- combo : Y.ComboSeries,- stackedcombo : Y.StackedComboSeries,- combospline : Y.ComboSplineSeries,- stackedcombospline : Y.StackedComboSplineSeries- },-- /**- * Returns a specific `CartesianSeries` class based on key value from a look up table of a direct reference to a class. When specifying a key value, the following options- * are available:- *- * <table>- * <tr><th>Key Value</th><th>Class</th></tr>- * <tr><td>line</td><td>Y.LineSeries</td></tr> - * <tr><td>column</td><td>Y.ColumnSeries</td></tr> - * <tr><td>bar</td><td>Y.BarSeries</td></tr> - * <tr><td>area</td><td>Y.AreaSeries</td></tr> - * <tr><td>stackedarea</td><td>Y.StackedAreaSeries</td></tr> - * <tr><td>stackedline</td><td>Y.StackedLineSeries</td></tr> - * <tr><td>stackedcolumn</td><td>Y.StackedColumnSeries</td></tr> - * <tr><td>stackedbar</td><td>Y.StackedBarSeries</td></tr> - * <tr><td>markerseries</td><td>Y.MarkerSeries</td></tr> - * <tr><td>spline</td><td>Y.SplineSeries</td></tr> - * <tr><td>areaspline</td><td>Y.AreaSplineSeries</td></tr> - * <tr><td>stackedspline</td><td>Y.StackedSplineSeries</td></tr>- * <tr><td>stackedareaspline</td><td>Y.StackedAreaSplineSeries</td></tr>- * <tr><td>stackedmarkerseries</td><td>Y.StackedMarkerSeries</td></tr>- * <tr><td>pie</td><td>Y.PieSeries</td></tr>- * <tr><td>combo</td><td>Y.ComboSeries</td></tr>- * <tr><td>stackedcombo</td><td>Y.StackedComboSeries</td></tr>- * <tr><td>combospline</td><td>Y.ComboSplineSeries</td></tr>- * <tr><td>stackedcombospline</td><td>Y.StackedComboSplineSeries</td></tr>- * </table>- * - * When referencing a class directly, you can specify any of the above classes or any custom class that extends `CartesianSeries` or `PieSeries`.- *- * @method _getSeries- * @param {String | Object} type Series type.- * @return CartesianSeries- * @private- */- _getSeries: function(type)- {- var seriesClass;- if(Y_Lang.isString(type))- {- seriesClass = this._seriesMap[type];- }- else - {- seriesClass = type;- }- return seriesClass;- },-- /**- * Event handler for marker events.- *- * @method _markerEventHandler- * @param {Object} e Event object.- * @private- */- _markerEventHandler: function(e)- {- var type = e.type,- markerNode = e.currentTarget,- strArr = markerNode.getAttribute("id").split("_"),- series = this.getSeriesByIndex(strArr[1]),- index = strArr[2];- series.updateMarkerState(type, index);- },-- /**- * Collection of `CartesianSeries` instances to be redrawn.- *- * @property _dispatchers- * @type Array- * @private- */- _dispatchers: null,-- /**- * Updates the `Graph` styles.- *- * @method _updateStyles- * @private- */- _updateStyles: function()- {- var styles = this.get("styles").background,- border = styles.border;- border.opacity = border.alpha;- styles.stroke = border;- styles.fill.opacity = styles.fill.alpha;- this.get("background").set(styles);- this._sizeChangeHandler();- },-- /**- * Event handler for size changes.- *- * @method _sizeChangeHandler- * @param {Object} e Event object.- * @private- */- _sizeChangeHandler: function(e)- {- var hgl = this.get("horizontalGridlines"),- vgl = this.get("verticalGridlines"),- w = this.get("width"),- h = this.get("height"),- bg = this.get("styles").background,- weight,- background;- if(bg && bg.border)- {- weight = bg.border.weight || 0;- }- if(this.get("showBackground"))- {- background = this.get("background");- if(w && h)- {- background.set("width", w);- background.set("height", h);- }- }- if(this._gridlines)- {- this._gridlines.clear();- }- if(hgl && hgl instanceof Y.Gridlines)- {- hgl.draw();- }- if(vgl && vgl instanceof Y.Gridlines)- {- vgl.draw();- }- this._drawSeries();- },-- /**- * Draws each series.- *- * @method _drawSeries- * @private- */- _drawSeries: function()- {- if(this._drawing)- {- this._callLater = true;- return;- }- var sc,- i,- len,- graphic = this.get("graphic");- graphic.set("autoDraw", false);- this._callLater = false;- this._drawing = true;- sc = this.get("seriesCollection");- i = 0;- len = sc.length;- for(; i < len; ++i)- {- sc[i].draw();- if((!sc[i].get("xcoords") || !sc[i].get("ycoords")) && !sc[i] instanceof Y.PieSeries)- {- this._callLater = true;- break;- }- }- this._drawing = false;- if(this._callLater)- {- this._drawSeries();- }- }, -- /**- * Event handler for series drawingComplete event.- *- * @method _drawingCompleteHandler- * @param {Object} e Event object.- * @private- */- _drawingCompleteHandler: function(e)- {- var series = e.currentTarget,- graphic,- index = Y.Array.indexOf(this._dispatchers, series);- if(index > -1)- {- this._dispatchers.splice(index, 1);- }- if(this._dispatchers.length < 1)- {- graphic = this.get("graphic");- if(!graphic.get("autoDraw"))- {- graphic._redraw();- }- this.fire("chartRendered");- }- },-- /**- * Gets the default value for the `styles` attribute. Overrides- * base implementation.- *- * @method _getDefaultStyles- * @return Object- * @protected- */- _getDefaultStyles: function()- {- var defs = {- background: {- shape: "rect",- fill:{- color:"#faf9f2"- },- border: {- color:"#dad8c9",- weight: 1- }- }- };- return defs;- },-- /**- * Destructor implementation Graph class. Removes all Graphic instances from the widget.- *- * @method destructor- * @protected- */- destructor: function()- {- if(this._graphic)- {- this._graphic.destroy();- }- if(this._background)- {- this._background.get("graphic").destroy();- }- if(this._gridlines)- {- this._gridlines.get("graphic").destroy();- }- }-}, {- ATTRS: {- /**- * The x-coordinate for the graph.- *- * @attribute x- * @type Number- * @protected- */- x: {- setter: function(val)- {- this.get("boundingBox").setStyle("left", val + "px");- return val;- }- },-- /**- * The y-coordinate for the graph.- *- * @attribute y- * @type Number- * @protected- */- y: {- setter: function(val)- {- this.get("boundingBox").setStyle("top", val + "px");- return val;- }- },-- /**- * Reference to the chart instance using the graph.- *- * @attribute chart- * @type ChartBase- * @readOnly- */- chart: {},-- /**- * Collection of series. When setting the `seriesCollection` the array can contain a combination of either- * `CartesianSeries` instances or object literals with properties that will define a series.- *- * @attribute seriesCollection- * @type CartesianSeries- */- seriesCollection: {- getter: function()- {- return this._seriesCollection;- },-- setter: function(val)- {- this._parseSeriesCollection(val);- return this._seriesCollection;- }- },- - /**- * Indicates whether the `Graph` has a background.- *- * @attribute showBackground- * @type Boolean- * @default true- */- showBackground: {- value: true- },-- /**- * Read-only hash lookup for all series on in the `Graph`.- *- * @attribute seriesDictionary- * @type Object- * @readOnly- */- seriesDictionary: {- readOnly: true,-- getter: function()- {- return this._seriesDictionary;- }- },-- /**- * Reference to the horizontal `Gridlines` instance.- *- * @attribute horizontalGridlines- * @type Gridlines- * @default null- */- horizontalGridlines: {- value: null,-- setter: function(val)- {- var gl = this.get("horizontalGridlines");- if(gl && gl instanceof Y.Gridlines)- {- gl.remove();- }- if(val instanceof Y.Gridlines)- {- gl = val;- val.set("graph", this);- return val;- }- else if(val && val.axis)- {- gl = new Y.Gridlines({direction:"horizontal", axis:val.axis, graph:this, styles:val.styles});- return gl;- }- }- },- - /**- * Reference to the vertical `Gridlines` instance.- *- * @attribute verticalGridlines- * @type Gridlines- * @default null- */- verticalGridlines: {- value: null,-- setter: function(val)- {- var gl = this.get("verticalGridlines");- if(gl && gl instanceof Y.Gridlines)- {- gl.remove();- }- if(val instanceof Y.Gridlines)- {- gl = val;- val.set("graph", this);- return val;- }- else if(val && val.axis)- {- gl = new Y.Gridlines({direction:"vertical", axis:val.axis, graph:this, styles:val.styles});- return gl;- }- }- },-- /**- * Reference to graphic instance used for the background.- *- * @attribute background- * @type Graphic- * @readOnly- */- background: {- getter: function()- {- if(!this._background)- {- this._backgroundGraphic = new Y.Graphic({render:this.get("contentBox")});- this._backgroundGraphic.get("node").style.zIndex = 0; - this._background = this._backgroundGraphic.addShape({type: "rect"});- }- return this._background;- }- },-- /**- * Reference to graphic instance used for gridlines.- *- * @attribute gridlines- * @type Graphic- * @readOnly- */- gridlines: {- readOnly: true,-- getter: function()- {- if(!this._gridlines)- {- this._gridlinesGraphic = new Y.Graphic({render:this.get("contentBox")});- this._gridlinesGraphic.get("node").style.zIndex = 1; - this._gridlines = this._gridlinesGraphic.addShape({type: "path"});- }- return this._gridlines;- }- },- - /**- * Reference to graphic instance used for series.- *- * @attribute graphic- * @type Graphic- * @readOnly- */- graphic: {- readOnly: true,-- getter: function() - {- if(!this._graphic)- {- this._graphic = new Y.Graphic({render:this.get("contentBox")});- this._graphic.get("node").style.zIndex = 2; - this._graphic.set("autoDraw", false);- }- return this._graphic;- }- },-- /**- * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.- *- * @attribute groupMarkers- * @type Boolean- */- groupMarkers: {- value: false- }-- /**- * Style properties used for drawing a background. Below are the default values:- * <dl>- * <dt>background</dt><dd>An object containing the following values:- * <dl>- * <dt>fill</dt><dd>Defines the style properties for the fill. Contains the following values:- * <dl>- * <dt>color</dt><dd>Color of the fill. The default value is #faf9f2.</dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the background fill. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>border</dt><dd>Defines the style properties for the border. Contains the following values:- * <dl>- * <dt>color</dt><dd>Color of the border. The default value is #dad8c9.</dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the background border. The default value is 1.</dd>- * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>- * </dl>- * </dd>- * </dl>- * </dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});-/**- * The ChartBase class is an abstract class used to create charts.- *- * @module charts- * @class ChartBase- * @constructor- */-function ChartBase() {}--ChartBase.ATTRS = {- /**- * Sets the `aria-label` for the chart.- *- * @attribute ariaLabel- * @type String- */- ariaLabel: {- value: "Chart Application",-- setter: function(val)- {- var cb = this.get("contentBox");- if(cb)- {- cb.setAttribute("aria-label", val);- }- return val;- }- },- - /**- * Sets the aria description for the chart.- *- * @attribute ariaDescription- * @type String- */- ariaDescription: {- value: "Use the up and down keys to navigate between series. Use the left and right keys to navigate through items in a series.",-- setter: function(val)- {- if(this._description)- {- this._description.setContent("");- this._description.appendChild(DOCUMENT.createTextNode(val));- }- return val;- }- },- - /**- * Reference to the default tooltip available for the chart.- * <p>Contains the following properties:</p>- * <dl>- * <dt>node</dt><dd>Reference to the actual dom node</dd>- * <dt>showEvent</dt><dd>Event that should trigger the tooltip</dd>- * <dt>hideEvent</dt><dd>Event that should trigger the removal of a tooltip (can be an event or an array of events)</dd>- * <dt>styles</dt><dd>A hash of style properties that will be applied to the tooltip node</dd>- * <dt>show</dt><dd>Indicates whether or not to show the tooltip</dd>- * <dt>markerEventHandler</dt><dd>Displays and hides tooltip based on marker events</dd>- * <dt>planarEventHandler</dt><dd>Displays and hides tooltip based on planar events</dd>- * <dt>markerLabelFunction</dt><dd>Reference to the function used to format a marker event triggered tooltip's text. The method contains - * the following arguments:- * <dl>- * <dt>categoryItem</dt><dd>An object containing the following:- * <dl>- * <dt>axis</dt><dd>The axis to which the category is bound.</dd>- * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided).</dd>- * <dt>key</dt><dd>The key of the category.</dd>- * <dt>value</dt><dd>The value of the category.</dd>- * </dl>- * </dd>- * <dt>valueItem</dt><dd>An object containing the following:- * <dl>- * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>- * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>- * <dt>key</dt><dd>The key for the series.</dd>- * <dt>value</dt><dd>The value for the series item.</dd> - * </dl>- * </dd>- * <dt>itemIndex</dt><dd>The index of the item within the series.</dd>- * <dt>series</dt><dd> The `CartesianSeries` instance of the item.</dd>- * <dt>seriesIndex</dt><dd>The index of the series in the `seriesCollection`.</dd>- * </dl>- * The method returns an `HTMLElement` which is written into the DOM using `appendChild`. If you override this method and choose to return an html string, you- * will also need to override the tooltip's `setTextFunction` method to accept an html string.- * </dd>- * <dt>planarLabelFunction</dt><dd>Reference to the function used to format a planar event triggered tooltip's text- * <dl>- * <dt>categoryAxis</dt><dd> `CategoryAxis` Reference to the categoryAxis of the chart.- * <dt>valueItems</dt><dd>Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:- * <dl>- * <dt>axis</dt><dd>The value axis of the series.</dd>- * <dt>key</dt><dd>The key for the series.</dd>- * <dt>value</dt><dd>The value for the series item.</dd>- * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>- * </dl> - * </dd>- * <dt>index</dt><dd>The index of the item within its series.</dd>- * <dt>seriesArray</dt><dd>Array of series instances for each value item.</dd>- * <dt>seriesIndex</dt><dd>The index of the series in the `seriesCollection`.</dd>- * </dl>- * </dd>- * </dl>- * The method returns an `HTMLElement` which is written into the DOM using `appendChild`. If you override this method and choose to return an html string, you- * will also need to override the tooltip's `setTextFunction` method to accept an html string.- * </dd>- * <dt>setTextFunction</dt><dd>Method that writes content returned from `planarLabelFunction` or `markerLabelFunction` into the the tooltip node.- * has the following signature:- * <dl>- * <dt>label</dt><dd>The `HTMLElement` that the content is to be added.</dd>- * <dt>val</dt><dd>The content to be rendered into tooltip. This can be a `String` or `HTMLElement`. If an HTML string is used, it will be rendered as a- * string.</dd>- * </dl>- * </dd>- * </dl>- * @attribute tooltip- * @type Object- */ - tooltip: {- valueFn: "_getTooltip",-- setter: function(val)- {- return this._updateTooltip(val);- }- },-- /** - * The key value used for the chart's category axis. - *- * @attribute categoryKey- * @type String- * @default category- */- categoryKey: {- value: "category"- },- - /**- * Indicates the type of axis to use for the category axis.- *- * <dl>- * <dt>category</dt><dd>Specifies a `CategoryAxis`.</dd>- * <dt>time</dt><dd>Specifies a `TimeAxis</dd>- * </dl>- *- * @attribute categoryType- * @type String- * @default category- */- categoryType:{- value:"category"- },-- /**- * Indicates the the type of interactions that will fire events.- *- * <dl>- * <dt>marker</dt><dd>Events will be broadcasted when the mouse interacts with individual markers.</dd>- * <dt>planar</dt><dd>Events will be broadcasted when the mouse intersects the plane of any markers on the chart.</dd>- * <dt>none</dt><dd>No events will be broadcasted.</dd>- * </dl>- *- * @attribute interactionType- * @type String- * @default marker- */- interactionType: {- value: "marker"- },-- /**- * Data used to generate the chart.- * - * @attribute dataProvider- * @type Array- */- dataProvider: {- setter: function(val)- {- return this._setDataValues(val);- }- },- - /**- * A collection of keys that map to the series axes. If no keys are set,- * they will be generated automatically depending on the data structure passed into - * the chart.- *- * @attribute seriesKeys- * @type Array- */- seriesKeys: {},-- /**- * Reference to all the axes in the chart.- *- * @attribute axesCollection- * @type Array- */- axesCollection: {},-- /**- * Reference to graph instance.- * - * @attribute graph- * @type Graph - */- graph: {- valueFn: "_getGraph"- },-- /**- * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.- *- * @attribute groupMarkers- * @type Boolean- */- groupMarkers: {- value: false,-- setter: function(val)- {- if(this.get("graph"))- {- this.get("graph").set("groupMarkers", val);- }- return val;- }- }-};--ChartBase.prototype = {- /**- * Handler for itemRendered event.- *- * @method _itemRendered- * @param {Object} e Event object.- * @private- */- _itemRendered: function(e)- {- this._itemRenderQueue = this._itemRenderQueue.splice(1 + Y.Array.indexOf(this._itemRenderQueue, e.currentTarget), 1);- if(this._itemRenderQueue.length < 1)- {- this._redraw();- }- },-- /**- * Default value function for the `Graph` attribute.- *- * @method _getGraph- * @return Graph- * @private- */- _getGraph: function()- {- var graph = new Y.Graph({- chart:this,- groupMarkers: this.get("groupMarkers") - });- graph.after("chartRendered", Y.bind(function(e) {- this.fire("chartRendered");- }, this));- return graph; - },-- /**- * Returns a series instance by index or key value.- *- * @method getSeries- * @param val- * @return CartesianSeries- */- getSeries: function(val)- {- var series = null, - graph = this.get("graph");- if(graph)- {- if(Y_Lang.isNumber(val))- {- series = graph.getSeriesByIndex(val);- }- else- {- series = graph.getSeriesByKey(val);- }- }- return series;- },-- /**- * Returns an `Axis` instance by key reference. If the axis was explicitly set through the `axes` attribute,- * the key will be the same as the key used in the `axes` object. For default axes, the key for- * the category axis is the value of the `categoryKey` (`category`). For the value axis, the default - * key is `values`.- *- * @method getAxisByKey- * @param {String} val Key reference used to look up the axis.- * @return Axis- */- getAxisByKey: function(val)- {- var axis,- axes = this.get("axes");- if(axes && axes.hasOwnProperty(val))- {- axis = axes[val];- }- return axis;- },-- /**- * Returns the category axis for the chart.- *- * @method getCategoryAxis- * @return Axis- */- getCategoryAxis: function()- {- var axis,- key = this.get("categoryKey"),- axes = this.get("axes");- if(axes.hasOwnProperty(key))- {- axis = axes[key];- }- return axis;- },-- /**- * Default direction of the chart.- *- * @property _direction- * @type String- * @default horizontal- * @private- */- _direction: "horizontal",- - /**- * Storage for the `dataProvider` attribute.- *- * @property _dataProvider- * @type Array- * @private- */- _dataProvider: null,-- /**- * Setter method for `dataProvider` attribute.- *- * @method _setDataValues- * @param {Array} val Array to be set as `dataProvider`.- * @return Array- * @private- */- _setDataValues: function(val)- {- if(Y_Lang.isArray(val[0]))- {- var hash, - dp = [], - cats = val[0], - i = 0, - l = cats.length, - n, - sl = val.length;- for(; i < l; ++i)- {- hash = {category:cats[i]};- for(n = 1; n < sl; ++n)- {- hash["series" + n] = val[n][i];- }- dp[i] = hash; - }- return dp;- }- return val;- },-- /**- * Storage for `seriesCollection` attribute.- *- * @property _seriesCollection- * @type Array- * @private - */- _seriesCollection: null,-- /**- * Setter method for `seriesCollection` attribute.- *- * @property _setSeriesCollection- * @param {Array} val Array of either `CartesianSeries` instances or objects containing series attribute key value pairs.- * @private- */- _setSeriesCollection: function(val)- {- this._seriesCollection = val;- },- /**- * Helper method that returns the axis class that a key references.- *- * @method _getAxisClass- * @param {String} t The type of axis.- * @return Axis- * @private- */- _getAxisClass: function(t)- {- return this._axisClass[t];- },- - /**- * Key value pairs of axis types. - *- * @property _axisClass- * @type Object- * @private- */- _axisClass: {- stacked: Y.StackedAxis,- numeric: Y.NumericAxis,- category: Y.CategoryAxis,- time: Y.TimeAxis- },-- /**- * Collection of axes.- *- * @property _axes- * @type Array- * @private- */- _axes: null,-- /**- * @method initializer- * @private- */- initializer: function()- {- this._itemRenderQueue = [];- this._seriesIndex = -1;- this._itemIndex = -1;- this.after("dataProviderChange", this._dataProviderChangeHandler);- },-- /**- * @method renderUI- * @private- */- renderUI: function()- {- var tt = this.get("tooltip"),- bb = this.get("boundingBox"),- cb = this.get("contentBox");- //move the position = absolute logic to a class file- bb.setStyle("position", "absolute");- cb.setStyle("position", "absolute");- this._addAxes();- this._addSeries();- if(tt && tt.show)- {- this._addTooltip();- }- this._setAriaElements(bb, cb);- },- - /**- * Creates an aria `live-region`, `aria-label` and `aria-describedby` for the Chart.- *- * @method _setAriaElements- * @param {Node} cb Reference to the Chart's `contentBox` attribute.- * @private- */- _setAriaElements: function(bb, cb)- {- var description = this._getAriaOffscreenNode(),- id = this.get("id") + "_description",- liveRegion = this._getAriaOffscreenNode();- cb.set("tabIndex", 0);- cb.set("role", "img");- cb.setAttribute("aria-label", this.get("ariaLabel"));- cb.setAttribute("aria-describedby", id);- description.set("id", id);- description.set("tabIndex", -1);- description.appendChild(DOCUMENT.createTextNode(this.get("ariaDescription")));- liveRegion.set("id", "live-region");- liveRegion.set("aria-live", "polite");- liveRegion.set("aria-atomic", "true");- liveRegion.set("role", "status");- bb.setAttribute("role", "application");- bb.appendChild(description);- bb.appendChild(liveRegion);- this._description = description;- this._liveRegion = liveRegion;- },-- /**- * Sets a node offscreen for use as aria-description or aria-live-regin.- *- * @method _setOffscreen- * @return Node - * @private- */- _getAriaOffscreenNode: function() - {- var node = Y.Node.create("<div></div>"),- ie = Y.UA.ie,- clipRect = (ie && ie < 8) ? "rect(1px 1px 1px 1px)" : "rect(1px, 1px, 1px, 1px)";- node.setStyle("position", "absolute");- node.setStyle("height", "1px"); - node.setStyle("width", "1px"); - node.setStyle("overflow", "hidden");- node.setStyle("clip", clipRect); - return node;- },- - /**- * @method syncUI- * @private- */- syncUI: function()- {- this._redraw();- },-- /**- * @method bindUI- * @private- */- bindUI: function()- {- this.after("tooltipChange", Y.bind(this._tooltipChangeHandler, this));- this.after("widthChange", this._sizeChanged);- this.after("heightChange", this._sizeChanged);- var tt = this.get("tooltip"),- hideEvent = "mouseout",- showEvent = "mouseover",- cb = this.get("contentBox"),- interactionType = this.get("interactionType"),- i = 0,- len,- markerClassName = "." + SERIES_MARKER,- isTouch = ((WINDOW && ("ontouchstart" in WINDOW)) && !(Y.UA.chrome && Y.UA.chrome < 6));- Y.on("keydown", Y.bind(function(e) {- var key = e.keyCode,- numKey = parseFloat(key),- msg;- if(numKey > 36 && numKey < 41)- {- e.halt();- msg = this._getAriaMessage(numKey);- this._liveRegion.setContent("");- this._liveRegion.appendChild(DOCUMENT.createTextNode(msg));- }- }, this), this.get("contentBox"));- if(interactionType == "marker")- {- //if touch capabilities, toggle tooltip on touchend. otherwise, the tooltip attribute's hideEvent/showEvent types.- hideEvent = tt.hideEvent;- showEvent = tt.showEvent;- if(isTouch)- {- Y.delegate("touchend", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);- //hide active tooltip if the chart is touched- Y.on("touchend", Y.bind(function(e) {- e.halt(true);- if(this._activeMarker)- {- this._activeMarker = null;- this.hideTooltip(e);- }- }, this));- }- else- {- Y.delegate("mouseenter", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);- Y.delegate("mousedown", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);- Y.delegate("mouseup", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);- Y.delegate("mouseleave", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);- Y.delegate("click", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);- Y.delegate("mousemove", Y.bind(this._positionTooltip, this), cb, markerClassName);- }- }- else if(interactionType == "planar")- {- if(isTouch)- {- this._overlay.on("touchend", Y.bind(this._planarEventDispatcher, this));- }- else- {- this._overlay.on("mousemove", Y.bind(this._planarEventDispatcher, this));- this.on("mouseout", this.hideTooltip);- }- }- if(tt)- {- this.on("markerEvent:touchend", Y.bind(function(e) {- var marker = e.series.get("markers")[e.index];- if(this._activeMarker && marker === this._activeMarker)- {- this._activeMarker = null;- this.hideTooltip(e);- }- else- {-- this._activeMarker = marker;- tt.markerEventHandler.apply(this, [e]);- }- }, this));- if(hideEvent && showEvent && hideEvent == showEvent)- {- this.on(interactionType + "Event:" + hideEvent, this.toggleTooltip);- }- else- {- if(showEvent)- {- this.on(interactionType + "Event:" + showEvent, tt[interactionType + "EventHandler"]);- }- if(hideEvent)- {- if(Y_Lang.isArray(hideEvent))- {- len = hideEvent.length;- for(; i < len; ++i)- {- this.on(interactionType + "Event:" + hideEvent[i], this.hideTooltip);- }- }- this.on(interactionType + "Event:" + hideEvent, this.hideTooltip);- }- }- }- },- - /**- * Event handler for marker events.- *- * @method _markerEventDispatcher- * @param {Object} e Event object.- * @private- */- _markerEventDispatcher: function(e)- {- var type = e.type,- cb = this.get("contentBox"),- markerNode = e.currentTarget,- strArr = markerNode.getAttribute("id").split("_"),- index = strArr.pop(),- seriesIndex = strArr.pop(),- series = this.getSeries(parseInt(seriesIndex, 10)),- items = this.getSeriesItems(series, index),- isTouch = e && e.hasOwnProperty("changedTouches"),- pageX = isTouch ? e.changedTouches[0].pageX : e.pageX,- pageY = isTouch ? e.changedTouches[0].pageY : e.pageY,- x = pageX - cb.getX(),- y = pageY - cb.getY();- if(type == "mouseenter")- {- type = "mouseover";- }- else if(type == "mouseleave")- {- type = "mouseout";- }- series.updateMarkerState(type, index);- e.halt();- /**- * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseover event.- * - *- * @event markerEvent:mouseover- * @preventable false- * @param {EventFacade} e Event facade with the following additional- * properties:- * <dl>- * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>- * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>- * <dt>node</dt><dd>The dom node of the marker.</dd>- * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>- * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>- * <dt>series</dt><dd>Reference to the series of the marker.</dd>- * <dt>index</dt><dd>Index of the marker in the series.</dd>- * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>- * </dl>- */- /**- * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseout event.- *- * @event markerEvent:mouseout- * @preventable false- * @param {EventFacade} e Event facade with the following additional- * properties:- * <dl>- * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>- * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>- * <dt>node</dt><dd>The dom node of the marker.</dd>- * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>- * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>- * <dt>series</dt><dd>Reference to the series of the marker.</dd>- * <dt>index</dt><dd>Index of the marker in the series.</dd>- * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>- * </dl>- */- /**- * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mousedown event.- *- * @event markerEvent:mousedown- * @preventable false- * @param {EventFacade} e Event facade with the following additional- * properties:- * <dl>- * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>- * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>- * <dt>node</dt><dd>The dom node of the marker.</dd>- * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>- * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>- * <dt>series</dt><dd>Reference to the series of the marker.</dd>- * <dt>index</dt><dd>Index of the marker in the series.</dd>- * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>- * </dl>- */- /**- * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseup event.- *- * @event markerEvent:mouseup- * @preventable false- * @param {EventFacade} e Event facade with the following additional- * properties:- * <dl>- * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>- * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>- * <dt>node</dt><dd>The dom node of the marker.</dd>- * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>- * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>- * <dt>series</dt><dd>Reference to the series of the marker.</dd>- * <dt>index</dt><dd>Index of the marker in the series.</dd>- * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>- * </dl>- */- /**- * Broadcasts when `interactionType` is set to `marker` and a series marker has received a click event.- *- * @event markerEvent:click- * @preventable false- * @param {EventFacade} e Event facade with the following additional- * properties:- * <dl>- * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>- * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>- * <dt>node</dt><dd>The dom node of the marker.</dd>- * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>- * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>- * <dt>pageX</dt><dd>The x location of the event on the page (including scroll)</dd>- * <dt>pageY</dt><dd>The y location of the event on the page (including scroll)</dd>- * <dt>series</dt><dd>Reference to the series of the marker.</dd>- * <dt>index</dt><dd>Index of the marker in the series.</dd>- * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>- * <dt>originEvent</dt><dd>Underlying dom event.</dd>- * </dl>- */- this.fire("markerEvent:" + type, {- originEvent: e,- pageX:pageX, - pageY:pageY, - categoryItem:items.category, - valueItem:items.value, - node:markerNode, - x:x, - y:y, - series:series, - index:index, - seriesIndex:seriesIndex- });- },-- /**- * Event handler for dataProviderChange.- *- * @method _dataProviderChangeHandler- * @param {Object} e Event object.- * @private- */- _dataProviderChangeHandler: function(e)- {- var dataProvider = this.get("dataProvider"),- axes = this.get("axes"),- i,- axis;- this._seriesIndex = -1;- this._itemIndex = -1;- if(axes)- {- for(i in axes)- {- if(axes.hasOwnProperty(i))- {- axis = axes[i];- if(axis instanceof Y.Axis)- {- if(axis.get("position") != "none")- {- this._addToAxesRenderQueue(axis);- }- axis.set("dataProvider", dataProvider);- }- }- }- }- },- - /**- * Event listener for toggling the tooltip. If a tooltip is visible, hide it. If not, it - * will create and show a tooltip based on the event object.- * - * @method toggleTooltip- * @param {Object} e Event object.- */- toggleTooltip: function(e)- {- var tt = this.get("tooltip");- if(tt.visible)- {- this.hideTooltip();- }- else- {- tt.markerEventHandler.apply(this, [e]);- }- },-- /**- * Shows a tooltip- *- * @method _showTooltip- * @param {String} msg Message to dispaly in the tooltip.- * @param {Number} x x-coordinate - * @param {Number} y y-coordinate- * @private- */- _showTooltip: function(msg, x, y)- {- var tt = this.get("tooltip"),- node = tt.node;- if(msg)- {- tt.visible = true;- tt.setTextFunction(node, msg);- node.setStyle("top", y + "px");- node.setStyle("left", x + "px");- node.setStyle("visibility", "visible");- }- },-- /**- * Positions the tooltip- *- * @method _positionTooltip- * @param {Object} e Event object.- * @private- */- _positionTooltip: function(e)- {- var tt = this.get("tooltip"),- node = tt.node,- cb = this.get("contentBox"),- x = (e.pageX + 10) - cb.getX(),- y = (e.pageY + 10) - cb.getY();- if(node)- {- node.setStyle("left", x + "px");- node.setStyle("top", y + "px");- }- },-- /**- * Hides the default tooltip- *- * @method hideTooltip- */- hideTooltip: function()- {- var tt = this.get("tooltip"),- node = tt.node;- tt.visible = false;- node.set("innerHTML", "");- node.setStyle("left", -10000);- node.setStyle("top", -10000);- node.setStyle("visibility", "hidden");- },-- /**- * Adds a tooltip to the dom.- *- * @method _addTooltip- * @private- */- _addTooltip: function()- {- var tt = this.get("tooltip"),- id = this.get("id") + "_tooltip",- cb = this.get("contentBox"),- oldNode = DOCUMENT.getElementById(id);- if(oldNode)- {- cb.removeChild(oldNode);- }- tt.node.set("id", id);- tt.node.setStyle("visibility", "hidden");- cb.appendChild(tt.node);- },-- /**- * Updates the tooltip attribute.- *- * @method _updateTooltip- * @param {Object} val Object containing properties for the tooltip.- * @return Object- * @private- */- _updateTooltip: function(val)- {- var tt = this._tooltip,- i,- styles,- node,- props = {- markerLabelFunction:"markerLabelFunction",- planarLabelFunction:"planarLabelFunction",- setTextFunction:"setTextFunction",- showEvent:"showEvent",- hideEvent:"hideEvent",- markerEventHandler:"markerEventHandler",- planarEventHandler:"planarEventHandler",- show:"show"- };- if(Y_Lang.isObject(val))- {- styles = val.styles;- node = Y.one(val.node) || tt.node;- if(styles)- {- for(i in styles)- {- if(styles.hasOwnProperty(i))- {- node.setStyle(i, styles[i]);- }- }- }- for(i in props)- {- if(val.hasOwnProperty(i))- {- tt[i] = val[i];- }- }- tt.node = node;- }- return tt;- },-- /**- * Default getter for `tooltip` attribute.- *- * @method _getTooltip- * @return Object- * @private- */- _getTooltip: function()- {- var node = DOCUMENT.createElement("div"),- tt = {- setTextFunction: this._setText,- markerLabelFunction: this._tooltipLabelFunction,- planarLabelFunction: this._planarLabelFunction,- show: true,- hideEvent: "mouseout",- showEvent: "mouseover",- markerEventHandler: function(e)- {- var tt = this.get("tooltip"),- msg = tt.markerLabelFunction.apply(this, [e.categoryItem, e.valueItem, e.index, e.series, e.seriesIndex]);- this._showTooltip(msg, e.x + 10, e.y + 10);- },- planarEventHandler: function(e)- {- var tt = this.get("tooltip"),- msg ,- categoryAxis = this.get("categoryAxis");- msg = tt.planarLabelFunction.apply(this, [categoryAxis, e.valueItem, e.index, e.items, e.seriesIndex]);- this._showTooltip(msg, e.x + 10, e.y + 10);- }- };- node = Y.one(node);- node.set("id", this.get("id") + "_tooltip");- node.setStyle("fontSize", "85%");- node.setStyle("opacity", "0.83");- node.setStyle("position", "absolute");- node.setStyle("paddingTop", "2px");- node.setStyle("paddingRight", "5px");- node.setStyle("paddingBottom", "4px");- node.setStyle("paddingLeft", "2px");- node.setStyle("backgroundColor", "#fff");- node.setStyle("border", "1px solid #dbdccc");- node.setStyle("pointerEvents", "none");- node.setStyle("zIndex", 3);- node.setStyle("whiteSpace", "noWrap");- node.setStyle("visibility", "hidden");- tt.node = Y.one(node);- this._tooltip = tt;- return tt;- },-- /**- * Formats tooltip text when `interactionType` is `planar`.- *- * @method _planarLabelFunction- * @param {Axis} categoryAxis Reference to the categoryAxis of the chart.- * @param {Array} valueItems Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:- * <dl>- * <dt>axis</dt><dd>The value axis of the series.</dd>- * <dt>key</dt><dd>The key for the series.</dd>- * <dt>value</dt><dd>The value for the series item.</dd>- * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>- * </dl> - * @param {Number} index The index of the item within its series.- * @param {Array} seriesArray Array of series instances for each value item.- * @param {Number} seriesIndex The index of the series in the `seriesCollection`.- * @return {String | HTML} - * @private- */- _planarLabelFunction: function(categoryAxis, valueItems, index, seriesArray, seriesIndex)- {- var msg = DOCUMENT.createElement("div"),- valueItem,- i = 0,- len = seriesArray.length,- axis,- categoryValue,- seriesValue,- series;- if(categoryAxis)- {- categoryValue = categoryAxis.get("labelFunction").apply(this, [categoryAxis.getKeyValueAt(this.get("categoryKey"), index), categoryAxis.get("labelFormat")]);- if(!Y_Lang.isObject(categoryValue))- {- categoryValue = DOCUMENT.createTextNode(categoryValue);- }- msg.appendChild(categoryValue);- }-- for(; i < len; ++i)- {- series = seriesArray[i];- if(series.get("visible"))- {- valueItem = valueItems[i];- axis = valueItem.axis;- seriesValue = axis.get("labelFunction").apply(this, [axis.getKeyValueAt(valueItem.key, index), axis.get("labelFormat")]);- msg.appendChild(DOCUMENT.createElement("br"));- msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName));- msg.appendChild(DOCUMENT.createTextNode(": "));- if(!Y_Lang.isObject(seriesValue))- {- seriesValue = DOCUMENT.createTextNode(seriesValue);- }- msg.appendChild(seriesValue);- }- }- return msg;- },-- /**- * Formats tooltip text when `interactionType` is `marker`.- *- * @method _tooltipLabelFunction- * @param {Object} categoryItem An object containing the following:- * <dl>- * <dt>axis</dt><dd>The axis to which the category is bound.</dd>- * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided)</dd>- * <dt>key</dt><dd>The key of the category.</dd>- * <dt>value</dt><dd>The value of the category</dd>- * </dl>- * @param {Object} valueItem An object containing the following:- * <dl>- * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>- * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>- * <dt>key</dt><dd>The key for the series.</dd>- * <dt>value</dt><dd>The value for the series item.</dd> - * </dl>- * @param {Number} itemIndex The index of the item within the series.- * @param {CartesianSeries} series The `CartesianSeries` instance of the item.- * @param {Number} seriesIndex The index of the series in the `seriesCollection`.- * @return {String | HTML}- * @private- */- _tooltipLabelFunction: function(categoryItem, valueItem, itemIndex, series, seriesIndex)- {- var msg = DOCUMENT.createElement("div"),- categoryValue = categoryItem.axis.get("labelFunction").apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]),- seriesValue = valueItem.axis.get("labelFunction").apply(this, [valueItem.value, valueItem.axis.get("labelFormat")]);- msg.appendChild(DOCUMENT.createTextNode(categoryItem.displayName)); - msg.appendChild(DOCUMENT.createTextNode(": ")); - if(!Y_Lang.isObject(categoryValue))- {- categoryValue = DOCUMENT.createTextNode(categoryValue);- }- msg.appendChild(categoryValue);- msg.appendChild(DOCUMENT.createElement("br"));- msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName)); - msg.appendChild(DOCUMENT.createTextNode(": ")); - if(!Y_Lang.isObject(seriesValue))- {- seriesValue = DOCUMENT.createTextNode(seriesValue);- }- msg.appendChild(seriesValue);- return msg; - },-- /**- * Event handler for the tooltipChange.- *- * @method _tooltipChangeHandler- * @param {Object} e Event object.- * @private- */- _tooltipChangeHandler: function(e)- {- if(this.get("tooltip"))- {- var tt = this.get("tooltip"),- node = tt.node,- show = tt.show,- cb = this.get("contentBox");- if(node && show)- {- if(!cb.contains(node))- {- this._addTooltip();- }- }- }- },- - /**- * Updates the content of text field. This method writes a value into a text field using - * `appendChild`. If the value is a `String`, it is converted to a `TextNode` first. - *- * @method _setText- * @param label {HTMLElement} label to be updated- * @param val {String} value with which to update the label- * @private- */- _setText: function(textField, val)- { - textField.setContent("");- if(Y_Lang.isNumber(val))- {- val = val + "";- }- else if(!val)- {- val = "";- }- if(IS_STRING(val))- {- val = DOCUMENT.createTextNode(val);- }- textField.appendChild(val);- }-};-Y.ChartBase = ChartBase;-/**- * The CartesianChart class creates a chart with horizontal and vertical axes.- *- * @module charts- * @class CartesianChart- * @extends ChartBase- * @constructor- */-Y.CartesianChart = Y.Base.create("cartesianChart", Y.Widget, [Y.ChartBase], {- /**- * @method renderUI- * @private- */- renderUI: function()- {- var bb = this.get("boundingBox"),- cb = this.get("contentBox"),- tt = this.get("tooltip"),- overlay,- overlayClass = _getClassName("overlay");- //move the position = absolute logic to a class file- bb.setStyle("position", "absolute");- cb.setStyle("position", "absolute");- this._addAxes();- this._addGridlines();- this._addSeries();- if(tt && tt.show)- {- this._addTooltip();- }- //If there is a style definition. Force them to set.- this.get("styles");- if(this.get("interactionType") == "planar")- {- overlay = DOCUMENT.createElement("div");- this.get("contentBox").appendChild(overlay);- this._overlay = Y.one(overlay); - this._overlay.setStyle("position", "absolute");- this._overlay.setStyle("background", "#fff");- this._overlay.setStyle("opacity", 0);- this._overlay.addClass(overlayClass);- this._overlay.setStyle("zIndex", 4);- }- this._setAriaElements(bb, cb);- this._redraw();- },-- /**- * When `interactionType` is set to `planar`, listens for mouse move events and fires `planarEvent:mouseover` or `planarEvent:mouseout` depending on the position of the mouse in relation to - * data points on the `Chart`.- *- * @method _planarEventDispatcher- * @param {Object} e Event object.- * @private- */- _planarEventDispatcher: function(e)- {- var graph = this.get("graph"),- bb = this.get("boundingBox"),- cb = graph.get("contentBox"),- isTouch = e && e.hasOwnProperty("changedTouches"),- pageX = isTouch ? e.changedTouches[0].pageX : e.pageX,- pageY = isTouch ? e.changedTouches[0].pageY : e.pageY,- posX = pageX - bb.getX(),- posY = pageY - bb.getY(),- offset = {- x: pageX - cb.getX(),- y: pageY - cb.getY()- },- sc = graph.get("seriesCollection"),- series,- i = 0,- index,- oldIndex = this._selectedIndex,- item,- items = [],- categoryItems = [],- valueItems = [],- direction = this.get("direction"),- hasMarkers,- catAxis,- valAxis,- coord,- //data columns and area data could be created on a graph level- markerPlane,- len,- coords;- e.halt(true);- if(direction == "horizontal")- {- catAxis = "x";- valAxis = "y";- }- else- {- valAxis = "x";- catAxis = "y";- }- coord = offset[catAxis];- if(sc)- {- len = sc.length;- while(i < len && !markerPlane)- {- if(sc[i])- {- markerPlane = sc[i].get(catAxis + "MarkerPlane");- }- i++;- }- }- if(markerPlane)- {- len = markerPlane.length;- for(i = 0; i < len; ++i)- {- if(coord <= markerPlane[i].end && coord >= markerPlane[i].start)- {- index = i;- break;- }- }- len = sc.length;- for(i = 0; i < len; ++i)- {- series = sc[i];- coords = series.get(valAxis + "coords");- hasMarkers = series.get("markers");- if(hasMarkers && !isNaN(oldIndex) && oldIndex > -1)- {- series.updateMarkerState("mouseout", oldIndex);- }- if(coords && coords[index] > -1)- {- if(hasMarkers && !isNaN(index) && index > -1)- {- series.updateMarkerState("mouseover", index);- }- item = this.getSeriesItems(series, index);- categoryItems.push(item.category);- valueItems.push(item.value);- items.push(series);- }- - }- this._selectedIndex = index;-- /**- * Broadcasts when `interactionType` is set to `planar` and a series' marker plane has received a mouseover event.- * - *- * @event planarEvent:mouseover- * @preventable false- * @param {EventFacade} e Event facade with the following additional- * properties:- * <dl>- * <dt>categoryItem</dt><dd>An array of hashes, each containing information about the category `Axis` of each marker whose plane has been intersected.</dd>- * <dt>valueItem</dt><dd>An array of hashes, each containing information about the value `Axis` of each marker whose plane has been intersected.</dd>- * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>- * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>- * <dt>pageX</dt><dd>The x location of the event on the page (including scroll)</dd>- * <dt>pageY</dt><dd>The y location of the event on the page (including scroll)</dd>- * <dt>items</dt><dd>An array including all the series which contain a marker whose plane has been intersected.</dd>- * <dt>index</dt><dd>Index of the markers in their respective series.</dd>- * <dt>originEvent</dt><dd>Underlying dom event.</dd>- * </dl>- */- /**- * Broadcasts when `interactionType` is set to `planar` and a series' marker plane has received a mouseout event.- *- * @event planarEvent:mouseout- * @preventable false- * @param {EventFacade} e - */- if(index > -1)- {- this.fire("planarEvent:mouseover", {- categoryItem:categoryItems, - valueItem:valueItems, - x:posX, - y:posY, - pageX:pageX,- pageY:pageY,- items:items, - index:index,- originEvent:e- });- }- else- {- this.fire("planarEvent:mouseout");- }- }- },-- /**- * Indicates the default series type for the chart.- *- * @property _type- * @type {String}- * @private- */- _type: "combo",-- /**- * Queue of axes instances that will be updated. This method is used internally to determine when all axes have been updated.- *- * @property _itemRenderQueue- * @type Array- * @private- */- _itemRenderQueue: null,-- /**- * Adds an `Axis` instance to the `_itemRenderQueue`.- *- * @method _addToAxesRenderQueue- * @param {Axis} axis An `Axis` instance.- * @private - */- _addToAxesRenderQueue: function(axis)- {- if(!this._itemRenderQueue)- {- this._itemRenderQueue = [];- }- if(Y.Array.indexOf(this._itemRenderQueue, axis) < 0)- {- this._itemRenderQueue.push(axis);- }- },-- /**- * Adds axis instance to the appropriate array based on position- *- * @method _addToAxesCollection- * @param {String} position The position of the axis- * @param {Axis} axis The `Axis` instance- */- _addToAxesCollection: function(position, axis)- {- var axesCollection = this.get(position + "AxesCollection");- if(!axesCollection)- {- axesCollection = [];- this.set(position + "AxesCollection", axesCollection);- }- axesCollection.push(axis);- },-- /**- * Returns the default value for the `seriesCollection` attribute.- *- * @method _getDefaultSeriesCollection- * @param {Array} val Array containing either `CartesianSeries` instances or objects containing data to construct series instances.- * @return Array- * @private- */- _getDefaultSeriesCollection: function()- {- return this._parseSeriesCollection();- },-- /**- * Parses and returns a series collection from an object and default properties.- *- * @method _parseSeriesCollection- * @param {Object} val Object contain properties for series being set.- * @return Object- * @private- */- _parseSeriesCollection: function(val)- {- var dir = this.get("direction"), - sc = val || [], - catAxis,- valAxis,- tempKeys = [],- series,- seriesKeys = this.get("seriesKeys").concat(),- i,- index,- l,- type = this.get("type"),- key,- catKey,- seriesKey,- graph,- categoryKey = this.get("categoryKey"),- showMarkers = this.get("showMarkers"),- showAreaFill = this.get("showAreaFill"),- showLines = this.get("showLines");- if(dir == "vertical")- {- catAxis = "yAxis";- catKey = "yKey";- valAxis = "xAxis";- seriesKey = "xKey";- }- else- {- catAxis = "xAxis";- catKey = "xKey";- valAxis = "yAxis";- seriesKey = "yKey";- }- l = sc.length;- for(i = 0; i < l; ++i)- {- key = this._getBaseAttribute(sc[i], seriesKey);- if(key)- {- index = Y.Array.indexOf(seriesKeys, key);- if(index > -1)- {- seriesKeys.splice(index, 1);- }- tempKeys.push(key);- }- }- if(seriesKeys.length > 0)- {- tempKeys = tempKeys.concat(seriesKeys);- }- l = tempKeys.length;- for(i = 0; i < l; ++i)- {- series = sc[i] || {type:type};- if(series instanceof Y.CartesianSeries)- {- this._parseSeriesAxes(series);- continue;- }- - series[catKey] = series[catKey] || categoryKey;- series[seriesKey] = series[seriesKey] || seriesKeys.shift();- series[catAxis] = this._getCategoryAxis();- series[valAxis] = this._getSeriesAxis(series[seriesKey]);- - series.type = series.type || type;- - if((series.type == "combo" || series.type == "stackedcombo" || series.type == "combospline" || series.type == "stackedcombospline"))- {- if(showAreaFill !== null)- {- series.showAreaFill = (series.showAreaFill !== null && series.showAreaFill !== undefined) ? series.showAreaFill : showAreaFill;- }- if(showMarkers !== null)- {- series.showMarkers = (series.showMarkers !== null && series.showMarkers !== undefined) ? series.showMarkers : showMarkers;- }- if(showLines !== null)- {- series.showLines = (series.showLines !== null && series.showLines !== undefined) ? series.showLines : showLines;- }- }- sc[i] = series;- }- if(val)- {- graph = this.get("graph");- graph.set("seriesCollection", sc);- sc = graph.get("seriesCollection");- }- return sc;- },-- /**- * Parse and sets the axes for a series instance.- *- * @method _parseSeriesAxes- * @param {CartesianSeries} series A `CartesianSeries` instance.- * @private- */- _parseSeriesAxes: function(series)- {- var axes = this.get("axes"),- xAxis = series.get("xAxis"),- yAxis = series.get("yAxis"),- YAxis = Y.Axis,- axis;- if(xAxis && !(xAxis instanceof YAxis) && Y_Lang.isString(xAxis) && axes.hasOwnProperty(xAxis))- {- axis = axes[xAxis];- if(axis instanceof YAxis)- {- series.set("xAxis", axis);- }- }- if(yAxis && !(yAxis instanceof YAxis) && Y_Lang.isString(yAxis) && axes.hasOwnProperty(yAxis))- { - axis = axes[yAxis];- if(axis instanceof YAxis)- {- series.set("yAxis", axis);- }- }-- },-- /**- * Returns the category axis instance for the chart.- *- * @method _getCategoryAxis- * @return Axis- * @private- */- _getCategoryAxis: function()- {- var axis,- axes = this.get("axes"),- categoryAxisName = this.get("categoryAxisName") || this.get("categoryKey");- axis = axes[categoryAxisName];- return axis;- },-- /**- * Returns the value axis for a series.- *- * @method _getSeriesAxis- * @param {String} key The key value used to determine the axis instance.- * @return Axis- * @private- */- _getSeriesAxis:function(key, axisName)- {- var axes = this.get("axes"),- i,- keys,- axis;- if(axes)- {- if(axisName && axes.hasOwnProperty(axisName))- {- axis = axes[axisName];- }- else- {- for(i in axes)- {- if(axes.hasOwnProperty(i))- {- keys = axes[i].get("keys");- if(keys && keys.hasOwnProperty(key))- {- axis = axes[i];- break;- }- }- }- }- }- return axis;- },-- /**- * Gets an attribute from an object, using a getter for Base objects and a property for object- * literals. Used for determining attributes from series/axis references which can be an actual class instance- * or a hash of properties that will be used to create a class instance.- *- * @method _getBaseAttribute- * @param {Object} item Object or instance in which the attribute resides.- * @param {String} key Attribute whose value will be returned.- * @return Object- * @private- */- _getBaseAttribute: function(item, key)- {- if(item instanceof Y.Base)- {- return item.get(key);- }- if(item.hasOwnProperty(key))- {- return item[key];- }- return null;- },-- /**- * Sets an attribute on an object, using a setter of Base objects and a property for object- * literals. Used for setting attributes on a Base class, either directly or to be stored in an object literal- * for use at instantiation.- *- * @method _setBaseAttribute- * @param {Object} item Object or instance in which the attribute resides.- * @param {String} key Attribute whose value will be assigned.- * @param {Object} value Value to be assigned to the attribute.- * @private- */- _setBaseAttribute: function(item, key, value)- {- if(item instanceof Y.Base)- {- item.set(key, value);- }- else- {- item[key] = value;- }- },-- /**- * Creates `Axis` instances.- *- * @method _setAxes- * @param {Object} val Object containing `Axis` instances or objects in which to construct `Axis` instances.- * @return Object- * @private- */- _setAxes: function(val)- {- var hash = this._parseAxes(val),- axes = {},- axesAttrs = {- edgeOffset: "edgeOffset", - position: "position",- overlapGraph:"overlapGraph",- labelFunction:"labelFunction",- labelFunctionScope:"labelFunctionScope",- labelFormat:"labelFormat",- maximum:"maximum",- minimum:"minimum", - roundingMethod:"roundingMethod",- alwaysShowZero:"alwaysShowZero",- title:"title",- width:"width",- height:"height"- },- dp = this.get("dataProvider"),- ai,- i, - pos, - axis,- axisPosition,- dh, - axisClass, - config,- axesCollection;- for(i in hash)- {- if(hash.hasOwnProperty(i))- {- dh = hash[i];- if(dh instanceof Y.Axis)- {- axis = dh;- }- else- {- axis = null;- config = {};- config.dataProvider = dh.dataProvider || dp;- config.keys = dh.keys;- - if(dh.hasOwnProperty("roundingUnit"))- {- config.roundingUnit = dh.roundingUnit;- }- pos = dh.position;- if(dh.styles)- {- config.styles = dh.styles;- }- config.position = dh.position;- for(ai in axesAttrs)- {- if(axesAttrs.hasOwnProperty(ai) && dh.hasOwnProperty(ai))- {- config[ai] = dh[ai];- }- }- - //only check for existing axis if we constructed the default axes already- if(val)- {- axis = this.getAxisByKey(i);- }- - if(axis && axis instanceof Y.Axis)- {- axisPosition = axis.get("position");- if(pos != axisPosition)- {- if(axisPosition != "none")- {- axesCollection = this.get(axisPosition + "AxesCollection");- axesCollection.splice(Y.Array.indexOf(axesCollection, axis), 1);- }- if(pos != "none")- {- this._addToAxesCollection(pos, axis);- }- }- axis.setAttrs(config);- }- else- {- axisClass = this._getAxisClass(dh.type);- axis = new axisClass(config);- axis.after("axisRendered", Y.bind(this._itemRendered, this));- }- }-- if(axis)- {- axesCollection = this.get(pos + "AxesCollection");- if(axesCollection && Y.Array.indexOf(axesCollection, axis) > 0)- {- axis.set("overlapGraph", false);- }- axes[i] = axis;- }- }- }- return axes;- },- - /**- * Adds axes to the chart.- *- * @method _addAxes- * @private- */- _addAxes: function()- {- var axes = this.get("axes"),- i, - axis, - pos,- w = this.get("width"),- h = this.get("height"),- node = Y.Node.one(this._parentNode);- if(!this._axesCollection)- { - this._axesCollection = [];- }- for(i in axes)- {- if(axes.hasOwnProperty(i))- {- axis = axes[i];- if(axis instanceof Y.Axis)- {- if(!w)- {- this.set("width", node.get("offsetWidth"));- w = this.get("width");- }- if(!h)- {- this.set("height", node.get("offsetHeight"));- h = this.get("height");- }- this._addToAxesRenderQueue(axis);- pos = axis.get("position");- if(!this.get(pos + "AxesCollection"))- {- this.set(pos + "AxesCollection", [axis]);- }- else- {- this.get(pos + "AxesCollection").push(axis);- }- this._axesCollection.push(axis);- if(axis.get("keys").hasOwnProperty(this.get("categoryKey")))- {- this.set("categoryAxis", axis);- }- axis.render(this.get("contentBox"));- }- }- }- },-- /**- * Renders the Graph.- *- * @method _addSeries- * @private- */- _addSeries: function()- {- var graph = this.get("graph"),- sc = this.get("seriesCollection");- graph.render(this.get("contentBox"));-- },-- /**- * Adds gridlines to the chart.- *- * @method _addGridlines- * @private- */- _addGridlines: function()- {- var graph = this.get("graph"),- hgl = this.get("horizontalGridlines"),- vgl = this.get("verticalGridlines"),- direction = this.get("direction"),- leftAxesCollection = this.get("leftAxesCollection"),- rightAxesCollection = this.get("rightAxesCollection"),- bottomAxesCollection = this.get("bottomAxesCollection"),- topAxesCollection = this.get("topAxesCollection"),- seriesAxesCollection,- catAxis = this.get("categoryAxis"),- hAxis,- vAxis;- if(this._axesCollection)- {- seriesAxesCollection = this._axesCollection.concat();- seriesAxesCollection.splice(Y.Array.indexOf(seriesAxesCollection, catAxis), 1);- }- if(hgl)- {- if(leftAxesCollection && leftAxesCollection[0])- {- hAxis = leftAxesCollection[0];- }- else if(rightAxesCollection && rightAxesCollection[0])- {- hAxis = rightAxesCollection[0];- }- else - {- hAxis = direction == "horizontal" ? catAxis : seriesAxesCollection[0];- }- if(!this._getBaseAttribute(hgl, "axis") && hAxis)- {- this._setBaseAttribute(hgl, "axis", hAxis);- }- if(this._getBaseAttribute(hgl, "axis"))- {- graph.set("horizontalGridlines", hgl);- }- }- if(vgl)- {- if(bottomAxesCollection && bottomAxesCollection[0])- {- vAxis = bottomAxesCollection[0];- }- else if (topAxesCollection && topAxesCollection[0])- {- vAxis = topAxesCollection[0];- }- else - {- vAxis = direction == "vertical" ? catAxis : seriesAxesCollection[0];- }- if(!this._getBaseAttribute(vgl, "axis") && vAxis)- {- this._setBaseAttribute(vgl, "axis", vAxis);- }- if(this._getBaseAttribute(vgl, "axis"))- {- graph.set("verticalGridlines", vgl);- }- }- },- - /**- * Returns all the keys contained in a `dataProvider`.- *- * @method _getAllKeys- * @param {Array} dp Collection of objects to be parsed.- * @return Object- */- _getAllKeys: function(dp)- {- var i = 0,- len = dp.length,- item,- key,- keys = {};- for(; i < len; ++i)- {- item = dp[i];- for(key in item)- {- if(item.hasOwnProperty(key))- {- keys[key] = true;- }- }- }- return keys;- },- - /**- * Default Function for the axes attribute.- *- * @method _getDefaultAxes- * @return Object- * @private- */- _getDefaultAxes: function()- {- return this._parseAxes();- },-- /**- * Generates and returns a key-indexed object containing `Axis` instances or objects used to create `Axis` instances.- *- * @method _parseAxes- * @param {Object} axes Object containing `Axis` instances or `Axis` attributes.- * @return Object- * @private- */- _parseAxes: function(axes)- {- var catKey = this.get("categoryKey"),- axis,- attr,- keys,- newAxes = {},- claimedKeys = [],- categoryAxisName = this.get("categoryAxisName") || this.get("categoryKey"),- valueAxisName = this.get("valueAxisName"),- seriesKeys = this.get("seriesKeys") || [], - i, - l,- ii,- ll,- cIndex,- dv,- dp = this.get("dataProvider"),- direction = this.get("direction"),- seriesPosition,- categoryPosition,- valueAxes = [],- seriesAxis = this.get("stacked") ? "stacked" : "numeric";- if(direction == "vertical")- {- seriesPosition = "bottom";- categoryPosition = "left";- }- else- {- seriesPosition = "left";- categoryPosition = "bottom";- }- if(axes)- {- for(i in axes)- {- if(axes.hasOwnProperty(i))- {- axis = axes[i];- keys = this._getBaseAttribute(axis, "keys");- attr = this._getBaseAttribute(axis, "type");- if(attr == "time" || attr == "category")- {- categoryAxisName = i;- this.set("categoryAxisName", i);- if(Y_Lang.isArray(keys) && keys.length > 0)- {- catKey = keys[0];- this.set("categoryKey", catKey);- }- newAxes[i] = axis;- }- else if(i == categoryAxisName)- {- newAxes[i] = axis;- }- else - {- newAxes[i] = axis;- if(i != valueAxisName && keys && Y_Lang.isArray(keys))- {- ll = keys.length;- for(ii = 0; ii < ll; ++ii)- {- claimedKeys.push(keys[ii]);- }- valueAxes.push(newAxes[i]);- }- if(!(this._getBaseAttribute(newAxes[i], "type")))- {- this._setBaseAttribute(newAxes[i], "type", seriesAxis);- }- if(!(this._getBaseAttribute(newAxes[i], "position")))- {- this._setBaseAttribute(newAxes[i], "position", this._getDefaultAxisPosition(newAxes[i], valueAxes, seriesPosition));- }- }- }- }- }- if(seriesKeys.length < 1)- {- dv = this._getAllKeys(dp);- for(i in dv)- {- if(dv.hasOwnProperty(i) && i != catKey && Y.Array.indexOf(claimedKeys, i) == -1)- {- seriesKeys.push(i);- }- }- }- cIndex = Y.Array.indexOf(seriesKeys, catKey);- if(cIndex > -1)- {- seriesKeys.splice(cIndex, 1);- }- l = claimedKeys.length;- for(i = 0; i < l; ++i)- {- cIndex = Y.Array.indexOf(seriesKeys, claimedKeys[i]); - if(cIndex > -1)- {- seriesKeys.splice(cIndex, 1);- }- }- if(!newAxes.hasOwnProperty(categoryAxisName))- {- newAxes[categoryAxisName] = {};- }- if(!(this._getBaseAttribute(newAxes[categoryAxisName], "keys")))- {- this._setBaseAttribute(newAxes[categoryAxisName], "keys", [catKey]);- }- - if(!(this._getBaseAttribute(newAxes[categoryAxisName], "position")))- {- this._setBaseAttribute(newAxes[categoryAxisName], "position", categoryPosition);- }- - if(!(this._getBaseAttribute(newAxes[categoryAxisName], "type")))- {- this._setBaseAttribute(newAxes[categoryAxisName], "type", this.get("categoryType"));- }- if(!newAxes.hasOwnProperty(valueAxisName) && seriesKeys && seriesKeys.length > 0)- {- newAxes[valueAxisName] = {keys:seriesKeys};- valueAxes.push(newAxes[valueAxisName]);- }- if(claimedKeys.length > 0)- {- if(seriesKeys.length > 0)- {- seriesKeys = claimedKeys.concat(seriesKeys);- }- else- {- seriesKeys = claimedKeys;- }- }- if(newAxes.hasOwnProperty(valueAxisName))- {- if(!(this._getBaseAttribute(newAxes[valueAxisName], "position")))- {- this._setBaseAttribute(newAxes[valueAxisName], "position", this._getDefaultAxisPosition(newAxes[valueAxisName], valueAxes, seriesPosition));- }- if(!(this._getBaseAttribute(newAxes[valueAxisName], "type")))- {- this._setBaseAttribute(newAxes[valueAxisName], "type", seriesAxis);- }- if(!(this._getBaseAttribute(newAxes[valueAxisName], "keys")))- {- this._setBaseAttribute(newAxes[valueAxisName], "keys", seriesKeys);- }- } - this.set("seriesKeys", seriesKeys);- return newAxes;- },-- /**- * Determines the position of an axis when one is not specified.- *- * @method _getDefaultAxisPosition- * @param {Axis} axis `Axis` instance.- * @param {Array} valueAxes Array of `Axis` instances.- * @param {String} position Default position depending on the direction of the chart and type of axis.- * @return String- * @private- */- _getDefaultAxisPosition: function(axis, valueAxes, position)- {- var direction = this.get("direction"),- i = Y.Array.indexOf(valueAxes, axis);- - if(valueAxes[i - 1] && valueAxes[i - 1].position)- {- if(direction == "horizontal")- {- if(valueAxes[i - 1].position == "left")- {- position = "right";- }- else if(valueAxes[i - 1].position == "right")- {- position = "left";- }- }- else- {- if (valueAxes[i -1].position == "bottom")- {- position = "top";- } - else- {- position = "bottom";- }- }- }- return position;- },-- - /**- * Returns an object literal containing a categoryItem and a valueItem for a given series index. Below is the structure of each:- * - * @method getSeriesItems- * @param {CartesianSeries} series Reference to a series.- * @param {Number} index Index of the specified item within a series.- * @return Object An object literal containing the following:- *- * <dl>- * <dt>categoryItem</dt><dd>Object containing the following data related to the category axis of the series.- * <dl>- * <dt>axis</dt><dd>Reference to the category axis of the series.</dd>- * <dt>key</dt><dd>Category key for the series.</dd>- * <dt>value</dt><dd>Value on the axis corresponding to the series index.</dd>- * </dl>- * </dd>- * <dt>valueItem</dt><dd>Object containing the following data related to the category axis of the series.- * <dl>- * <dt>axis</dt><dd>Reference to the value axis of the series.</dd>- * <dt>key</dt><dd>Value key for the series.</dd>- * <dt>value</dt><dd>Value on the axis corresponding to the series index.</dd>- * </dl>- * </dd>- * </dl>- */- getSeriesItems: function(series, index)- {- var xAxis = series.get("xAxis"),- yAxis = series.get("yAxis"),- xKey = series.get("xKey"),- yKey = series.get("yKey"),- categoryItem,- valueItem;- if(this.get("direction") == "vertical")- {- categoryItem = {- axis:yAxis,- key:yKey,- value:yAxis.getKeyValueAt(yKey, index)- };- valueItem = {- axis:xAxis,- key:xKey,- value: xAxis.getKeyValueAt(xKey, index)- };- }- else- {- valueItem = {- axis:yAxis,- key:yKey,- value:yAxis.getKeyValueAt(yKey, index)- };- categoryItem = {- axis:xAxis,- key:xKey,- value: xAxis.getKeyValueAt(xKey, index)- };- }- categoryItem.displayName = series.get("categoryDisplayName");- valueItem.displayName = series.get("valueDisplayName");- categoryItem.value = categoryItem.axis.getKeyValueAt(categoryItem.key, index);- valueItem.value = valueItem.axis.getKeyValueAt(valueItem.key, index);- return {category:categoryItem, value:valueItem};- },-- /**- * Handler for sizeChanged event.- *- * @method _sizeChanged- * @param {Object} e Event object.- * @private- */- _sizeChanged: function(e)- {- if(this._axesCollection)- {- var ac = this._axesCollection,- i = 0,- l = ac.length;- for(; i < l; ++i)- {- this._addToAxesRenderQueue(ac[i]);- }- this._redraw();- }- },- - /**- * Returns the maximum distance in pixels that the extends outside the top bounds of all vertical axes.- *- * @method _getTopOverflow- * @param {Array} set1 Collection of axes to check.- * @param {Array} set2 Seconf collection of axes to check.- * @param {Number} width Width of the axes- * @return Number- * @private- */- _getTopOverflow: function(set1, set2, height)- {- var i = 0,- len,- overflow = 0,- axis;- if(set1)- {- len = set1.length;- for(; i < len; ++i)- {- axis = set1[i];- overflow = Math.max(overflow, Math.abs(axis.getMaxLabelBounds().top) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));- }- }- if(set2)- {- i = 0;- len = set2.length;- for(; i < len; ++i)- {- axis = set2[i];- overflow = Math.max(overflow, Math.abs(axis.getMaxLabelBounds().top) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));- }- }- return overflow;- },- - /**- * Returns the maximum distance in pixels that the extends outside the right bounds of all horizontal axes.- *- * @method _getRightOverflow- * @param {Array} set1 Collection of axes to check.- * @param {Array} set2 Seconf collection of axes to check.- * @param {Number} width Width of the axes- * @return Number- * @private- */- _getRightOverflow: function(set1, set2, width)- {- var i = 0,- len,- overflow = 0,- axis;- if(set1)- {- len = set1.length;- for(; i < len; ++i)- {- axis = set1[i];- overflow = Math.max(overflow, axis.getMaxLabelBounds().right - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));- }- }- if(set2)- {- i = 0;- len = set2.length;- for(; i < len; ++i)- {- axis = set2[i];- overflow = Math.max(overflow, axis.getMaxLabelBounds().right - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));- }- }- return overflow;- },- - /**- * Returns the maximum distance in pixels that the extends outside the left bounds of all horizontal axes.- *- * @method _getLeftOverflow- * @param {Array} set1 Collection of axes to check.- * @param {Array} set2 Seconf collection of axes to check.- * @param {Number} width Width of the axes- * @return Number- * @private- */- _getLeftOverflow: function(set1, set2, width)- {- var i = 0,- len,- overflow = 0,- axis;- if(set1)- {- len = set1.length;- for(; i < len; ++i)- {- axis = set1[i];- overflow = Math.max(overflow, Math.abs(axis.getMinLabelBounds().left) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));- }- }- if(set2)- {- i = 0;- len = set2.length;- for(; i < len; ++i)- {- axis = set2[i];- overflow = Math.max(overflow, Math.abs(axis.getMinLabelBounds().left) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));- }- }- return overflow;- },- - /**- * Returns the maximum distance in pixels that the extends outside the bottom bounds of all vertical axes.- *- * @method _getBottomOverflow- * @param {Array} set1 Collection of axes to check.- * @param {Array} set2 Seconf collection of axes to check.- * @param {Number} height Height of the axes- * @return Number- * @private- */- _getBottomOverflow: function(set1, set2, height)- {- var i = 0,- len,- overflow = 0,- axis;- if(set1)- {- len = set1.length;- for(; i < len; ++i)- {- axis = set1[i];- overflow = Math.max(overflow, axis.getMinLabelBounds().bottom - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));- }- }- if(set2)- {- i = 0;- len = set2.length;- for(; i < len; ++i)- {- axis = set2[i];- overflow = Math.max(overflow, axis.getMinLabelBounds().bottom - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));- }- }- return overflow;- },-- /**- * Redraws and position all the components of the chart instance.- *- * @method _redraw- * @private- */- _redraw: function()- {- if(this._drawing)- {- this._callLater = true;- return;- }- this._drawing = true;- this._callLater = false;- var w = this.get("width"),- h = this.get("height"),- leftPaneWidth = 0,- rightPaneWidth = 0,- topPaneHeight = 0,- bottomPaneHeight = 0,- leftAxesCollection = this.get("leftAxesCollection"),- rightAxesCollection = this.get("rightAxesCollection"),- topAxesCollection = this.get("topAxesCollection"),- bottomAxesCollection = this.get("bottomAxesCollection"),- i = 0,- l,- axis,- graphOverflow = "visible",- graph = this.get("graph"),- topOverflow,- bottomOverflow,- leftOverflow,- rightOverflow,- graphWidth,- graphHeight,- graphX,- graphY,- allowContentOverflow = this.get("allowContentOverflow"),- diff,- rightAxesXCoords,- leftAxesXCoords,- topAxesYCoords,- bottomAxesYCoords,- graphRect = {};- if(leftAxesCollection)- {- leftAxesXCoords = [];- l = leftAxesCollection.length;- for(i = l - 1; i > -1; --i)- {- leftAxesXCoords.unshift(leftPaneWidth);- leftPaneWidth += leftAxesCollection[i].get("width");- }- }- if(rightAxesCollection)- {- rightAxesXCoords = [];- l = rightAxesCollection.length;- i = 0;- for(i = l - 1; i > -1; --i)- {- rightPaneWidth += rightAxesCollection[i].get("width");- rightAxesXCoords.unshift(w - rightPaneWidth);- }- }- if(topAxesCollection)- {- topAxesYCoords = [];- l = topAxesCollection.length;- for(i = l - 1; i > -1; --i)- {- topAxesYCoords.unshift(topPaneHeight);- topPaneHeight += topAxesCollection[i].get("height");- }- }- if(bottomAxesCollection)- {- bottomAxesYCoords = [];- l = bottomAxesCollection.length;- for(i = l - 1; i > -1; --i)- {- bottomPaneHeight += bottomAxesCollection[i].get("height");- bottomAxesYCoords.unshift(h - bottomPaneHeight);- }- }- - graphWidth = w - (leftPaneWidth + rightPaneWidth);- graphHeight = h - (bottomPaneHeight + topPaneHeight);- graphRect.left = leftPaneWidth;- graphRect.top = topPaneHeight;- graphRect.bottom = h - bottomPaneHeight;- graphRect.right = w - rightPaneWidth;- if(!allowContentOverflow)- {- topOverflow = this._getTopOverflow(leftAxesCollection, rightAxesCollection);- bottomOverflow = this._getBottomOverflow(leftAxesCollection, rightAxesCollection);- leftOverflow = this._getLeftOverflow(bottomAxesCollection, topAxesCollection);- rightOverflow = this._getRightOverflow(bottomAxesCollection, topAxesCollection);- - diff = topOverflow - topPaneHeight;- if(diff > 0)- {- graphRect.top = topOverflow;- if(topAxesYCoords)- {- i = 0;- l = topAxesYCoords.length;- for(; i < l; ++i)- {- topAxesYCoords[i] += diff;- }- }- }-- diff = bottomOverflow - bottomPaneHeight;- if(diff > 0)- {- graphRect.bottom = h - bottomOverflow;- if(bottomAxesYCoords)- {- i = 0;- l = bottomAxesYCoords.length;- for(; i < l; ++i)- {- bottomAxesYCoords[i] -= diff;- }- }- }-- diff = leftOverflow - leftPaneWidth;- if(diff > 0)- {- graphRect.left = leftOverflow;- if(leftAxesXCoords)- {- i = 0;- l = leftAxesXCoords.length;- for(; i < l; ++i)- {- leftAxesXCoords[i] += diff;- }- }- }-- diff = rightOverflow - rightPaneWidth;- if(diff > 0)- {- graphRect.right = w - rightOverflow;- if(rightAxesXCoords)- {- i = 0;- l = rightAxesXCoords.length;- for(; i < l; ++i)- {- rightAxesXCoords[i] -= diff;- }- }- }- }- graphWidth = graphRect.right - graphRect.left;- graphHeight = graphRect.bottom - graphRect.top;- graphX = graphRect.left;- graphY = graphRect.top;- if(topAxesCollection)- {- l = topAxesCollection.length;- i = 0;- for(; i < l; i++)- {- axis = topAxesCollection[i];- if(axis.get("width") !== graphWidth)- {- axis.set("width", graphWidth);- }- axis.get("boundingBox").setStyle("left", graphX + "px");- axis.get("boundingBox").setStyle("top", topAxesYCoords[i] + "px");- }- if(axis._hasDataOverflow())- {- graphOverflow = "hidden";- }- }- if(bottomAxesCollection)- {- l = bottomAxesCollection.length;- i = 0;- for(; i < l; i++)- {- axis = bottomAxesCollection[i];- if(axis.get("width") !== graphWidth)- {- axis.set("width", graphWidth);- }- axis.get("boundingBox").setStyle("left", graphX + "px");- axis.get("boundingBox").setStyle("top", bottomAxesYCoords[i] + "px");- }- if(axis._hasDataOverflow())- {- graphOverflow = "hidden";- }- }- if(leftAxesCollection)- {- l = leftAxesCollection.length;- i = 0;- for(; i < l; ++i)- {- axis = leftAxesCollection[i];- axis.get("boundingBox").setStyle("top", graphY + "px");- axis.get("boundingBox").setStyle("left", leftAxesXCoords[i] + "px");- if(axis.get("height") !== graphHeight)- {- axis.set("height", graphHeight);- }- }- if(axis._hasDataOverflow())- {- graphOverflow = "hidden";- }- }- if(rightAxesCollection)- {- l = rightAxesCollection.length;- i = 0;- for(; i < l; ++i)- {- axis = rightAxesCollection[i];- axis.get("boundingBox").setStyle("top", graphY + "px");- axis.get("boundingBox").setStyle("left", rightAxesXCoords[i] + "px");- if(axis.get("height") !== graphHeight)- {- axis.set("height", graphHeight);- }- }- if(axis._hasDataOverflow())- {- graphOverflow = "hidden";- }- }- this._drawing = false;- if(this._callLater)- {- this._redraw();- return;- }- if(graph)- {- graph.get("boundingBox").setStyle("left", graphX + "px");- graph.get("boundingBox").setStyle("top", graphY + "px");- graph.set("width", graphWidth);- graph.set("height", graphHeight);- graph.get("boundingBox").setStyle("overflow", graphOverflow);- }-- if(this._overlay)- {- this._overlay.setStyle("left", graphX + "px");- this._overlay.setStyle("top", graphY + "px");- this._overlay.setStyle("width", graphWidth + "px");- this._overlay.setStyle("height", graphHeight + "px");- }- },-- /**- * Destructor implementation for the CartesianChart class. Calls destroy on all axes, series and the Graph instance.- * Removes the tooltip and overlay HTML elements.- *- * @method destructor- * @protected- */- destructor: function()- {- var graph = this.get("graph"),- i = 0,- len,- seriesCollection = this.get("seriesCollection"),- axesCollection = this._axesCollection,- tooltip = this.get("tooltip").node;- if(this._description)- {- this._description.empty();- this._description.remove(true);- }- if(this._liveRegion)- {- this._liveRegion.empty();- this._liveRegion.remove(true);- }- len = seriesCollection ? seriesCollection.length : 0;- for(; i < len; ++i)- {- if(seriesCollection[i] instanceof Y.CartesianSeries)- {- seriesCollection[i].destroy(true);- }- }- len = axesCollection ? axesCollection.length : 0;- for(i = 0; i < len; ++i)- {- if(axesCollection[i] instanceof Y.Axis)- {- axesCollection[i].destroy(true);- }- }- if(graph)- {- graph.destroy(true);- }- if(tooltip)- {- tooltip.empty();- tooltip.remove(true);- }- if(this._overlay)- {- this._overlay.empty();- this._overlay.remove(true);- }- },-- /**- * Returns the appropriate message based on the key press.- *- * @method _getAriaMessage- * @param {Number} key The keycode that was pressed.- * @return String- */- _getAriaMessage: function(key)- {- var msg = "",- series,- items,- categoryItem,- valueItem,- seriesIndex = this._seriesIndex,- itemIndex = this._itemIndex,- seriesCollection = this.get("seriesCollection"),- len = seriesCollection.length,- dataLength;- if(key % 2 === 0)- {- if(len > 1)- {- if(key === 38)- {- seriesIndex = seriesIndex < 1 ? len - 1 : seriesIndex - 1;- }- else if(key === 40)- {- seriesIndex = seriesIndex >= len - 1 ? 0 : seriesIndex + 1;- }- this._itemIndex = -1;- }- else- {- seriesIndex = 0;- }- this._seriesIndex = seriesIndex;- series = this.getSeries(parseInt(seriesIndex, 10));- msg = series.get("valueDisplayName") + " series.";- }- else- {- if(seriesIndex > -1)- {- msg = "";- series = this.getSeries(parseInt(seriesIndex, 10));- }- else- {- seriesIndex = 0;- this._seriesIndex = seriesIndex;- series = this.getSeries(parseInt(seriesIndex, 10));- msg = series.get("valueDisplayName") + " series.";- }- dataLength = series._dataLength ? series._dataLength : 0;- if(key === 37)- {- itemIndex = itemIndex > 0 ? itemIndex - 1 : dataLength - 1;- }- else if(key === 39)- {- itemIndex = itemIndex >= dataLength - 1 ? 0 : itemIndex + 1;- }- this._itemIndex = itemIndex;- items = this.getSeriesItems(series, itemIndex);- categoryItem = items.category;- valueItem = items.value;- if(categoryItem && valueItem && categoryItem.value && valueItem.value)- {- msg += categoryItem.displayName + ": " + categoryItem.axis.formatLabel.apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]) + ", ";- msg += valueItem.displayName + ": " + valueItem.axis.formatLabel.apply(this, [valueItem.value, valueItem.axis.get("labelFormat")]) + ", "; - }- else- {- msg += "No data available.";- }- msg += (itemIndex + 1) + " of " + dataLength + ". ";- }- return msg;- }-}, {- ATTRS: {- /**- * Indicates whether axis labels are allowed to overflow beyond the bounds of the chart's content box.- *- * @attribute allowContentOverflow- * @type Boolean- */- allowContentOverflow: {- value: false- },-- /**- * Style object for the axes.- *- * @attribute axesStyles- * @type Object- * @private- */- axesStyles: {- getter: function()- {- var axes = this.get("axes"),- i,- styles = this._axesStyles;- if(axes)- {- for(i in axes)- {- if(axes.hasOwnProperty(i) && axes[i] instanceof Y.Axis)- {- if(!styles)- {- styles = {};- }- styles[i] = axes[i].get("styles");- }- }- }- return styles;- },- - setter: function(val)- {- var axes = this.get("axes"),- i;- for(i in val)- {- if(val.hasOwnProperty(i) && axes.hasOwnProperty(i))- {- this._setBaseAttribute(axes[i], "styles", val[i]);- }- }- }- },-- /**- * Style object for the series- *- * @attribute seriesStyles- * @type Object- * @private- */- seriesStyles: {- getter: function()- {- var styles = this._seriesStyles,- graph = this.get("graph"),- dict,- i;- if(graph)- {- dict = graph.get("seriesDictionary");- if(dict)- {- styles = {};- for(i in dict)- {- if(dict.hasOwnProperty(i))- {- styles[i] = dict[i].get("styles");- }- }- }- }- return styles;- },- - setter: function(val)- {- var i,- l,- s;- - if(Y_Lang.isArray(val))- {- s = this.get("seriesCollection");- i = 0;- l = val.length;-- for(; i < l; ++i)- {- this._setBaseAttribute(s[i], "styles", val[i]);- }- }- else- {- for(i in val)- {- if(val.hasOwnProperty(i))- {- s = this.getSeries(i);- this._setBaseAttribute(s, "styles", val[i]);- }- }- }- }- },-- /**- * Styles for the graph.- *- * @attribute graphStyles- * @type Object- * @private- */- graphStyles: {- getter: function()- {- var graph = this.get("graph");- if(graph)- {- return(graph.get("styles"));- }- return this._graphStyles;- },-- setter: function(val)- {- var graph = this.get("graph");- this._setBaseAttribute(graph, "styles", val);- }-- },-- /**- * Style properties for the chart. Contains a key indexed hash of the following:- * <dl>- * <dt>series</dt><dd>A key indexed hash containing references to the `styles` attribute for each series in the chart.- * Specific style attributes vary depending on the series:- * <ul>- * <li><a href="AreaSeries.html#attr_styles">AreaSeries</a></li>- * <li><a href="BarSeries.html#attr_styles">BarSeries</a></li>- * <li><a href="ColumnSeries.html#attr_styles">ColumnSeries</a></li>- * <li><a href="ComboSeries.html#attr_styles">ComboSeries</a></li>- * <li><a href="LineSeries.html#attr_styles">LineSeries</a></li>- * <li><a href="MarkerSeries.html#attr_styles">MarkerSeries</a></li>- * <li><a href="SplineSeries.html#attr_styles">SplineSeries</a></li>- * </ul>- * </dd>- * <dt>axes</dt><dd>A key indexed hash containing references to the `styles` attribute for each axes in the chart. Specific- * style attributes can be found in the <a href="Axis.html#attr_styles">Axis</a> class.</dd>- * <dt>graph</dt><dd>A reference to the `styles` attribute in the chart. Specific style attributes can be found in the- * <a href="Graph.html#attr_styles">Graph</a> class.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- styles: {- getter: function()- {- var styles = { - axes: this.get("axesStyles"),- series: this.get("seriesStyles"),- graph: this.get("graphStyles")- };- return styles;- },- setter: function(val)- {- if(val.hasOwnProperty("axes"))- {- if(this.get("axesStyles"))- {- this.set("axesStyles", val.axes);- }- else- {- this._axesStyles = val.axes;- }- }- if(val.hasOwnProperty("series"))- {- if(this.get("seriesStyles"))- {- this.set("seriesStyles", val.series);- }- else- {- this._seriesStyles = val.series;- }- }- if(val.hasOwnProperty("graph"))- {- this.set("graphStyles", val.graph);- }- }- },-- /**- * Axes to appear in the chart. This can be a key indexed hash of axis instances or object literals- * used to construct the appropriate axes.- *- * @attribute axes- * @type Object- */- axes: {- valueFn: "_getDefaultAxes",-- setter: function(val)- {- return this._setAxes(val);- }- },-- /**- * Collection of series to appear on the chart. This can be an array of Series instances or object literals- * used to construct the appropriate series.- *- * @attribute seriesCollection- * @type Array- */- seriesCollection: {- valueFn: "_getDefaultSeriesCollection",- - setter: function(val)- {- return this._parseSeriesCollection(val);- }- },-- /**- * Reference to the left-aligned axes for the chart.- *- * @attribute leftAxesCollection- * @type Array- * @private- */- leftAxesCollection: {},-- /**- * Reference to the bottom-aligned axes for the chart.- *- * @attribute bottomAxesCollection- * @type Array- * @private- */- bottomAxesCollection: {},-- /**- * Reference to the right-aligned axes for the chart.- *- * @attribute rightAxesCollection- * @type Array- * @private- */- rightAxesCollection: {},-- /**- * Reference to the top-aligned axes for the chart.- *- * @attribute topAxesCollection- * @type Array- * @private- */- topAxesCollection: {},- - /**- * Indicates whether or not the chart is stacked.- *- * @attribute stacked- * @type Boolean- */- stacked: {- value: false- },-- /**- * Direction of chart's category axis when there is no series collection specified. Charts can- * be horizontal or vertical. When the chart type is column, the chart is horizontal.- * When the chart type is bar, the chart is vertical. - *- * @attribute direction- * @type String- */- direction: {- getter: function()- {- var type = this.get("type");- if(type == "bar")- { - return "vertical";- }- else if(type == "column")- {- return "horizontal";- }- return this._direction;- },-- setter: function(val)- {- this._direction = val;- return this._direction;- }- },-- /**- * Indicates whether or not an area is filled in a combo chart.- * - * @attribute showAreaFill- * @type Boolean- */- showAreaFill: {},-- /**- * Indicates whether to display markers in a combo chart.- *- * @attribute showMarkers- * @type Boolean- */- showMarkers:{},-- /**- * Indicates whether to display lines in a combo chart.- *- * @attribute showLines- * @type Boolean- */- showLines:{},-- /**- * Indicates the key value used to identify a category axis in the `axes` hash. If- * not specified, the categoryKey attribute value will be used.- * - * @attribute categoryAxisName- * @type String- */- categoryAxisName: {- },-- /**- * Indicates the key value used to identify a the series axis when an axis not generated.- *- * @attribute valueAxisName- * @type String- */- valueAxisName: {- value: "values"- },-- /**- * Reference to the horizontalGridlines for the chart.- *- * @attribute horizontalGridlines- * @type Gridlines- */- horizontalGridlines: {- getter: function()- {- var graph = this.get("graph");- if(graph)- {- return graph.get("horizontalGridlines");- }- return this._horizontalGridlines;- },- setter: function(val)- {- var graph = this.get("graph");- if(val && !Y_Lang.isObject(val))- {- val = {};- }- if(graph)- {- graph.set("horizontalGridlines", val);- }- else- {- this._horizontalGridlines = val;- }- }- },-- /**- * Reference to the verticalGridlines for the chart.- *- * @attribute verticalGridlines- * @type Gridlines- */- verticalGridlines: {- getter: function()- {- var graph = this.get("graph");- if(graph)- {- return graph.get("verticalGridlines");- }- return this._verticalGridlines;- },- setter: function(val)- {- var graph = this.get("graph");- if(val && !Y_Lang.isObject(val))- {- val = {};- }- if(graph)- {- graph.set("verticalGridlines", val);- }- else- {- this._verticalGridlines = val;- }- }- },- - /**- * Type of chart when there is no series collection specified.- *- * @attribute type- * @type String - */- type: {- getter: function()- {- if(this.get("stacked"))- {- return "stacked" + this._type;- }- return this._type;- },-- setter: function(val)- {- if(this._type == "bar")- {- if(val != "bar")- {- this.set("direction", "horizontal");- }- }- else- {- if(val == "bar")- {- this.set("direction", "vertical");- }- }- this._type = val;- return this._type;- }- },- - /**- * Reference to the category axis used by the chart.- *- * @attribute categoryAxis- * @type Axis- */- categoryAxis:{}- }-});-/**- * The PieChart class creates a pie chart- *- * @module charts- * @class PieChart- * @extends ChartBase- * @constructor- */-Y.PieChart = Y.Base.create("pieChart", Y.Widget, [Y.ChartBase], {- /**- * Calculates and returns a `seriesCollection`.- *- * @method _getSeriesCollection- * @return Array- * @private- */- _getSeriesCollection: function()- {- if(this._seriesCollection)- {- return this._seriesCollection;- }- var axes = this.get("axes"),- sc = [], - seriesKeys,- i = 0,- l,- type = this.get("type"),- key,- catAxis = "categoryAxis",- catKey = "categoryKey",- valAxis = "valueAxis",- seriesKey = "valueKey";- if(axes)- {- seriesKeys = axes.values.get("keyCollection");- key = axes.category.get("keyCollection")[0];- l = seriesKeys.length;- for(; i < l; ++i)- {- sc[i] = {type:type};- sc[i][catAxis] = "category";- sc[i][valAxis] = "values";- sc[i][catKey] = key;- sc[i][seriesKey] = seriesKeys[i];- }- }- this._seriesCollection = sc;- return sc;- },-- /**- * Creates `Axis` instances.- *- * @method _parseAxes- * @param {Object} val Object containing `Axis` instances or objects in which to construct `Axis` instances.- * @return Object- * @private- */- _parseAxes: function(hash)- {- if(!this._axes)- {- this._axes = {};- }- var i, pos, axis, dh, config, axisClass,- type = this.get("type"),- w = this.get("width"),- h = this.get("height"),- node = Y.Node.one(this._parentNode);- if(!w)- {- this.set("width", node.get("offsetWidth"));- w = this.get("width");- }- if(!h)- {- this.set("height", node.get("offsetHeight"));- h = this.get("height");- }- for(i in hash)- {- if(hash.hasOwnProperty(i))- {- dh = hash[i];- pos = type == "pie" ? "none" : dh.position;- axisClass = this._getAxisClass(dh.type);- config = {dataProvider:this.get("dataProvider")};- if(dh.hasOwnProperty("roundingUnit"))- {- config.roundingUnit = dh.roundingUnit;- }- config.keys = dh.keys;- config.width = w;- config.height = h;- config.position = pos;- config.styles = dh.styles;- axis = new axisClass(config);- axis.on("axisRendered", Y.bind(this._itemRendered, this));- this._axes[i] = axis;- }- }- },-- /**- * Adds axes to the chart.- *- * @method _addAxes- * @private- */- _addAxes: function()- {- var axes = this.get("axes"),- i, - axis, - p;- if(!axes)- {- this.set("axes", this._getDefaultAxes());- axes = this.get("axes");- }- if(!this._axesCollection)- { - this._axesCollection = [];- }- for(i in axes)- {- if(axes.hasOwnProperty(i))- {- axis = axes[i];- p = axis.get("position");- if(!this.get(p + "AxesCollection"))- {- this.set(p + "AxesCollection", [axis]);- }- else- {- this.get(p + "AxesCollection").push(axis);- }- this._axesCollection.push(axis);- }- }- },-- /**- * Renders the Graph.- *- * @method _addSeries- * @private- */- _addSeries: function()- {- var graph = this.get("graph"),- seriesCollection = this.get("seriesCollection");- this._parseSeriesAxes(seriesCollection);- graph.set("showBackground", false);- graph.set("width", this.get("width"));- graph.set("height", this.get("height"));- graph.set("seriesCollection", seriesCollection);- this._seriesCollection = graph.get("seriesCollection");- graph.render(this.get("contentBox"));- },-- /**- * Parse and sets the axes for the chart.- *- * @method _parseSeriesAxes- * @param {Array} c A collection `PieSeries` instance.- * @private- */- _parseSeriesAxes: function(c)- {- var i = 0, - len = c.length, - s,- axes = this.get("axes"),- axis;- for(; i < len; ++i)- {- s = c[i];- if(s)- {- //If series is an actual series instance, - //replace axes attribute string ids with axes- if(s instanceof Y.PieSeries)- {- axis = s.get("categoryAxis");- if(axis && !(axis instanceof Y.Axis))- {- s.set("categoryAxis", axes[axis]);- }- axis = s.get("valueAxis");- if(axis && !(axis instanceof Y.Axis))- {- s.set("valueAxis", axes[axis]);- }- continue;- }- s.categoryAxis = axes.category;- s.valueAxis = axes.values;- if(!s.type)- {- s.type = this.get("type");- }- }- }- },-- /**- * Generates and returns a key-indexed object containing `Axis` instances or objects used to create `Axis` instances.- *- * @method _getDefaultAxes- * @return Object- * @private- */- _getDefaultAxes: function()- {- var catKey = this.get("categoryKey"),- seriesKeys = this.get("seriesKeys") || [], - seriesAxis = "numeric",- i, - dv = this.get("dataProvider")[0];- if(seriesKeys.length < 1)- {- for(i in dv)- {- if(i != catKey)- {- seriesKeys.push(i);- }- }- if(seriesKeys.length > 0)- {- this.set("seriesKeys", seriesKeys);- }- }- return {- values:{- keys:seriesKeys,- type:seriesAxis- },- category:{- keys:[catKey],- type:this.get("categoryType")- }- };- },- - /**- * Returns an object literal containing a categoryItem and a valueItem for a given series index.- *- * @method getSeriesItem- * @param series Reference to a series.- * @param index Index of the specified item within a series.- * @return Object- */- getSeriesItems: function(series, index)- {- var categoryItem = {- axis: series.get("categoryAxis"),- key: series.get("categoryKey"),- displayName: series.get("categoryDisplayName")- },- valueItem = {- axis: series.get("valueAxis"),- key: series.get("valueKey"),- displayName: series.get("valueDisplayName")- };- categoryItem.value = categoryItem.axis.getKeyValueAt(categoryItem.key, index);- valueItem.value = valueItem.axis.getKeyValueAt(valueItem.key, index);- return {category:categoryItem, value:valueItem};- },-- /**- * Handler for sizeChanged event.- *- * @method _sizeChanged- * @param {Object} e Event object.- * @private- */- _sizeChanged: function(e)- {- this._redraw();- },-- /**- * Redraws the chart instance.- *- * @method _redraw- * @private- */- _redraw: function()- {- var graph = this.get("graph"),- w = this.get("width"),- h = this.get("height"),- dimension;- if(graph)- {- dimension = Math.min(w, h);- graph.set("width", dimension);- graph.set("height", dimension);- }- },- - /**- * Formats tooltip text for a pie chart.- *- * @method _tooltipLabelFunction- * @param {Object} categoryItem An object containing the following:- * <dl>- * <dt>axis</dt><dd>The axis to which the category is bound.</dd>- * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided)</dd>- * <dt>key</dt><dd>The key of the category.</dd>- * <dt>value</dt><dd>The value of the category</dd>- * </dl>- * @param {Object} valueItem An object containing the following:- * <dl>- * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>- * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>- * <dt>key</dt><dd>The key for the series.</dd>- * <dt>value</dt><dd>The value for the series item.</dd> - * </dl>- * @param {Number} itemIndex The index of the item within the series.- * @param {CartesianSeries} series The `PieSeries` instance of the item.- * @param {Number} seriesIndex The index of the series in the `seriesCollection`.- * @return {HTML}- * @private- */- _tooltipLabelFunction: function(categoryItem, valueItem, itemIndex, series, seriesIndex)- {- var msg = DOCUMENT.createElement("div"),- total = series.getTotalValues(),- pct = Math.round((valueItem.value / total) * 10000)/100;- msg.appendChild(DOCUMENT.createTextNode(categoryItem.displayName +- ": " + categoryItem.axis.get("labelFunction").apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]))); - msg.appendChild(DOCUMENT.createElement("br"));- msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName + - ": " + valueItem.axis.get("labelFunction").apply(this, [valueItem.value, valueItem.axis.get("labelFormat")])));- msg.appendChild(DOCUMENT.createElement("br"));- msg.appendChild(DOCUMENT.createTextNode(pct + "%")); - return msg; - },-- /**- * Returns the appropriate message based on the key press.- *- * @method _getAriaMessage- * @param {Number} key The keycode that was pressed.- * @return String- */- _getAriaMessage: function(key)- {- var msg = "",- categoryItem,- items,- series,- valueItem,- seriesIndex = 0,- itemIndex = this._itemIndex,- seriesCollection = this.get("seriesCollection"),- len,- total,- pct,- markers;- series = this.getSeries(parseInt(seriesIndex, 10));- markers = series.get("markers");- len = markers && markers.length ? markers.length : 0;- if(key === 37)- {- itemIndex = itemIndex > 0 ? itemIndex - 1 : len - 1;- }- else if(key === 39)- {- itemIndex = itemIndex >= len - 1 ? 0 : itemIndex + 1;- }- this._itemIndex = itemIndex;- items = this.getSeriesItems(series, itemIndex);- categoryItem = items.category;- valueItem = items.value;- total = series.getTotalValues();- pct = Math.round((valueItem.value / total) * 10000)/100;- if(categoryItem && valueItem)- {- msg += categoryItem.displayName + ": " + categoryItem.axis.formatLabel.apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]) + ", ";- msg += valueItem.displayName + ": " + valueItem.axis.formatLabel.apply(this, [valueItem.value, valueItem.axis.get("labelFormat")]) + ", "; - msg += "Percent of total " + valueItem.displayName + ": " + pct + "%,"; - }- else- {- msg += "No data available,";- }- msg += (itemIndex + 1) + " of " + len + ". ";- return msg;- }-}, {- ATTRS: {- /**- * Sets the aria description for the chart.- *- * @attribute ariaDescription- * @type String- */- ariaDescription: {- value: "Use the left and right keys to navigate through items.",-- setter: function(val)- {- if(this._description)- {- this._description.setContent("");- this._description.appendChild(DOCUMENT.createTextNode(val));- }- return val;- }- },- - /**- * Axes to appear in the chart. - *- * @attribute axes- * @type Object- */- axes: {- getter: function()- {- return this._axes;- },-- setter: function(val)- {- this._parseAxes(val);- }- },-- /**- * Collection of series to appear on the chart. This can be an array of Series instances or object literals- * used to describe a Series instance.- *- * @attribute seriesCollection- * @type Array- */- seriesCollection: {- getter: function()- {- return this._getSeriesCollection();- },- - setter: function(val)- {- return this._setSeriesCollection(val);- }- },- - /**- * Type of chart when there is no series collection specified.- *- * @attribute type- * @type String - */- type: {- value: "pie"- }- }-});---}, '3.5.1' ,{requires:['dom', 'datatype-number', 'datatype-date', 'event-custom', 'event-mouseenter', 'event-touch', 'widget', 'widget-position', 'widget-stack', 'graphics']});+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+YUI.add('charts-base', function (Y, NAME) {++/**+ * The Charts widget provides an api for displaying data+ * graphically.+ *+ * @module charts+ * @main charts+ */++/**+ * The charts-base submodule contains the core functionality for the charts module.+ *+ * @module charts+ * @submodule charts-base+ */+var CONFIG = Y.config,+ WINDOW = CONFIG.win,+ DOCUMENT = CONFIG.doc,+ Y_Lang = Y.Lang,+ IS_STRING = Y_Lang.isString,+ Y_DOM = Y.DOM,+ LeftAxisLayout,+ RightAxisLayout,+ BottomAxisLayout,+ TopAxisLayout,+ _getClassName = Y.ClassNameManager.getClassName,+ SERIES_MARKER = _getClassName("seriesmarker"),+ ShapeGroup,+ CircleGroup,+ RectGroup,+ EllipseGroup,+ DiamondGroup;++/**+ * Abstract class for creating groups of shapes with the same styles and dimensions.+ *+ * @class ShapeGroup+ * @constructor+ */+ ShapeGroup = function(cfg)+ {+ ShapeGroup.superclass.constructor.apply(this, arguments);+ };+ + ShapeGroup.NAME = "shapeGroup";++ Y.extend(ShapeGroup, Y.Path, { + /**+ * Updates the shape.+ *+ * @method _draw+ * @private+ */+ _draw: function()+ {+ var xvalues = this.get("xvalues"),+ yvalues = this.get("yvalues"),+ x,+ y,+ xRad,+ yRad,+ i = 0,+ len,+ attrs = [],+ dimensions = this.get("dimensions"),+ width = dimensions.width,+ height = dimensions.height,+ radius = dimensions.radius,+ yRadius = dimensions.yRadius,+ id = this.get("id"),+ className = this.node.className,+ widthIsArray = Y_Lang.isArray(width),+ heightIsArray = Y_Lang.isArray(height),+ radiusIsArray = Y_Lang.isArray(radius),+ yRadiusIsArray = Y_Lang.isArray(yRadius);+ if(xvalues && yvalues && xvalues.length > 0)+ {+ this.clear();++ len = xvalues.length;+ for(; i < len; ++i)+ {+ x = xvalues[i];+ y = yvalues[i];+ xRad = radiusIsArray ? radius[i] : radius;+ yRad = yRadiusIsArray ? yRadius[i] : yRadius;+ if(!isNaN(x) && !isNaN(y) && !isNaN(xRad))+ {+ this.drawShape({+ x: x,+ y: y,+ width: widthIsArray ? width[i] : width,+ height: heightIsArray ? height[i] : height,+ radius: xRad,+ yRadius: yRad + });+ this.closePath();+ attrs[i] = {+ id: id + "_" + i,+ className: className,+ coords: (x - this._left) + ", " + (y - this._top) + ", " + radius,+ shape: "circle"+ };+ }+ }+ this._closePath();+ }+ },++ /**+ * Parses and array of lengths into radii+ *+ * @method _getRadiusCollection+ * @param {Array} val Array of lengths+ * @return Array+ * @private+ */+ _getRadiusCollection: function(val)+ {+ var i = 0,+ len = val.length,+ radii = [];+ for(; i < len; ++i)+ { + radii[i] = val[i] * 0.5;+ }+ return radii;+ }+ });+ +ShapeGroup.ATTRS = Y.merge(Y.Path.ATTRS, {+ dimensions: {+ getter: function()+ {+ var dimensions = this._dimensions,+ radius,+ yRadius,+ width,+ height;+ if(dimensions.hasOwnProperty("radius"))+ {+ return dimensions;+ }+ else+ {+ width = dimensions.width;+ height = dimensions.height;+ radius = Y_Lang.isArray(width) ? this._getRadiusCollection(width) : (width * 0.5);+ yRadius = Y_Lang.isArray(height) ? this._getRadiusCollection(height) : (height * 0.5);+ return {+ width: width,+ height: height,+ radius: radius,+ yRadius: yRadius+ };+ }+ },++ setter: function(val)+ {+ this._dimensions = val;+ return val;+ }+ },+ xvalues: {+ getter: function()+ {+ return this._xvalues;+ },+ setter: function(val)+ {+ this._xvalues = val;+ }+ },+ yvalues: {+ getter: function()+ {+ return this._yvalues;+ },+ setter: function(val)+ {+ this._yvalues = val;+ }+ }+});+Y.ShapeGroup = ShapeGroup;+/**+ * Abstract class for creating groups of circles with the same styles and dimensions.+ *+ * @module charts+ * @submodule charts-base+ * @class CircleGroup+ * @constructor+ */+ CircleGroup = function(cfg)+ {+ CircleGroup.superclass.constructor.apply(this, arguments);+ };+ + CircleGroup.NAME = "circleGroup";++ Y.extend(CircleGroup, Y.ShapeGroup, { + /**+ * Algorithm for drawing shape.+ *+ * @method drawShape+ * @param {Object} cfg Parameters used to draw the shape.+ */+ drawShape: function(cfg)+ {+ this.drawCircle(cfg.x, cfg.y, cfg.radius);+ }+ });++CircleGroup.ATTRS = Y.merge(Y.ShapeGroup.ATTRS, {+ dimensions: {+ getter: function()+ {+ var dimensions = this._dimensions,+ radius,+ yRadius,+ width,+ height;+ if(dimensions.hasOwnProperty("radius"))+ {+ return dimensions;+ }+ else+ {+ width = dimensions.width;+ height = dimensions.height;+ radius = Y_Lang.isArray(width) ? this._getRadiusCollection(width) : (width * 0.5);+ yRadius = radius;+ return {+ width: width,+ height: height,+ radius: radius,+ yRadius: yRadius+ };+ }+ }+ }+});+ +CircleGroup.ATTRS = Y.ShapeGroup.ATTRS;+Y.CircleGroup = CircleGroup;+/**+ * Abstract class for creating groups of rects with the same styles and dimensions.+ *+ * @module charts+ * @submodule charts-base+ * @class GroupRect+ * @constructor+ */+ RectGroup = function(cfg)+ {+ RectGroup.superclass.constructor.apply(this, arguments);+ };+ + RectGroup.NAME = "rectGroup";++ Y.extend(RectGroup, Y.ShapeGroup, { + /**+ * Updates the rect.+ *+ * @method _draw+ * @private+ */+ drawShape: function(cfg)+ {+ this.drawRect(cfg.x, cfg.y, cfg.width, cfg.height);+ }+ });+ +RectGroup.ATTRS = Y.ShapeGroup.ATTRS;+Y.RectGroup = RectGroup;+/**+ * Abstract class for creating groups of diamonds with the same styles and dimensions.+ *+ * @module charts+ * @submodule charts-base+ * @class GroupDiamond+ * @constructor+ */+ DiamondGroup = function(cfg)+ {+ DiamondGroup.superclass.constructor.apply(this, arguments);+ };+ + DiamondGroup.NAME = "diamondGroup";++ Y.extend(DiamondGroup, Y.ShapeGroup, { + /**+ * Updates the diamond.+ *+ * @method _draw+ * @private+ */+ drawShape: function(cfg)+ {+ this.drawDiamond(cfg.x, cfg.y, cfg.width, cfg.height);+ }+ });+ +DiamondGroup.ATTRS = Y.ShapeGroup.ATTRS;+Y.DiamondGroup = DiamondGroup;+/**+ * Abstract class for creating groups of diamonds with the same styles and dimensions.+ *+ * @module charts+ * @submodule charts-base+ * @class EllipseGroup+ * @constructor+ */+ EllipseGroup = function(cfg)+ {+ EllipseGroup.superclass.constructor.apply(this, arguments);+ };+ + EllipseGroup.NAME = "diamondGroup";++ Y.extend(EllipseGroup, Y.ShapeGroup, { + /**+ * Updates the diamond.+ *+ * @method _draw+ * @private+ */+ drawShape: function(cfg)+ {+ this.drawEllipse(cfg.x, cfg.y, cfg.width, cfg.height);+ }+ });+ +EllipseGroup.ATTRS = Y.ShapeGroup.ATTRS;+Y.EllipseGroup = EllipseGroup;+/**+ * The Renderer class is a base class for chart components that use the `styles`+ * attribute.+ *+ * @module charts+ * @submodule charts-base+ * @class Renderer+ * @constructor+ */+function Renderer(){}++Renderer.ATTRS = {+ /**+ * Style properties for class+ * + * @attribute styles+ * @type Object+ */+ styles:+ {+ getter: function()+ {+ this._styles = this._styles || this._getDefaultStyles();+ return this._styles;+ },++ setter: function(val)+ {+ this._styles = this._setStyles(val);+ }+ },+ + /**+ * The graphic in which drawings will be rendered.+ *+ * @attribute graphic+ * @type Graphic+ */+ graphic: {}+};+Renderer.NAME = "renderer";++Renderer.prototype = {+ /**+ * Storage for `styles` attribute.+ *+ * @property _styles+ * @type Object+ * @private+ */+ _styles: null,+ + /**+ * Method used by `styles` setter.+ *+ * @method _setStyles+ * @param {Object} newStyles Hash of properties to update.+ * @return Object+ * @protected+ */+ _setStyles: function(newstyles)+ {+ var styles = this.get("styles");+ return this._mergeStyles(newstyles, styles);+ },+ + /**+ * Merges to object literals so that only specified properties are + * overwritten.+ *+ * @method _mergeStyles+ * @param {Object} a Hash of new styles+ * @param {Object} b Hash of original styles+ * @return Object+ * @protected+ */+ _mergeStyles: function(a, b)+ {+ if(!b)+ {+ b = {};+ }+ var newstyles = Y.merge(b, {});+ Y.Object.each(a, function(value, key, a)+ {+ if(b.hasOwnProperty(key) && Y_Lang.isObject(value) && !Y_Lang.isFunction(value) && !Y_Lang.isArray(value))+ {+ newstyles[key] = this._mergeStyles(value, b[key]);+ }+ else+ {+ newstyles[key] = value;+ }+ }, this);+ return newstyles;+ },++ /**+ * Gets the default value for the `styles` attribute. + *+ * @method _getDefaultStyles+ * @return Object+ * @protected+ */+ _getDefaultStyles: function()+ {+ return {padding:{+ top:0,+ right: 0,+ bottom: 0,+ left: 0+ }};+ }+};++Y.augment(Renderer, Y.Attribute);+Y.Renderer = Renderer;++/**+ * Algorithmic strategy for rendering a left axis.+ *+ * @module charts+ * @submodule charts-base+ * @class LeftAxisLayout+ * @constructor+ */+LeftAxisLayout = function() {};++LeftAxisLayout.prototype = {+ /**+ * Default margins for text fields.+ *+ * @private+ * @method _getDefaultMargins+ * @return Object+ */+ _getDefaultMargins: function() + {+ return {+ top: 0,+ left: 0,+ right: 4,+ bottom: 0+ };+ },++ /**+ * Sets the length of the tick on either side of the axis line.+ *+ * @method setTickOffset+ * @protected+ */+ setTickOffsets: function()+ {+ var host = this,+ majorTicks = host.get("styles").majorTicks,+ tickLength = majorTicks.length,+ halfTick = tickLength * 0.5,+ display = majorTicks.display;+ host.set("topTickOffset", 0);+ host.set("bottomTickOffset", 0);+ + switch(display)+ {+ case "inside" :+ host.set("rightTickOffset", tickLength);+ host.set("leftTickOffset", 0);+ break;+ case "outside" : + host.set("rightTickOffset", 0);+ host.set("leftTickOffset", tickLength);+ break;+ case "cross":+ host.set("rightTickOffset", halfTick); + host.set("leftTickOffset", halfTick);+ break;+ default:+ host.set("rightTickOffset", 0);+ host.set("leftTickOffset", 0);+ break;+ }+ },+ + /**+ * Draws a tick+ *+ * @method drawTick+ * @param {Path} path reference to the path `Path` element in which to draw the tick.+ * @param {Object} pt Point on the axis in which the tick will intersect.+ * @param {Object} tickStyle Hash of properties to apply to the tick.+ * @protected+ */+ drawTick: function(path, pt, tickStyles)+ {+ var host = this,+ style = host.get("styles"),+ padding = style.padding,+ tickLength = tickStyles.length,+ start = {x:padding.left, y:pt.y},+ end = {x:tickLength + padding.left, y:pt.y};+ host.drawLine(path, start, end);+ },++ /**+ * Calculates the coordinates for the first point on an axis.+ *+ * @method getLineStart+ * @return {Object}+ * @protected+ */+ getLineStart: function()+ {+ var style = this.get("styles"),+ padding = style.padding,+ majorTicks = style.majorTicks,+ tickLength = majorTicks.length,+ display = majorTicks.display,+ pt = {x:padding.left, y:0};+ if(display === "outside")+ {+ pt.x += tickLength;+ }+ else if(display === "cross")+ {+ pt.x += tickLength/2;+ }+ return pt; + },+ + /**+ * Calculates the point for a label.+ *+ * @method getLabelPoint+ * @param {Object} point Point on the axis in which the tick will intersect.+ * @return {Object} + * @protected+ */+ getLabelPoint: function(point)+ {+ return {x:point.x - this.get("leftTickOffset"), y:point.y};+ },+ + /**+ * Updates the value for the `maxLabelSize` for use in calculating total size.+ *+ * @method updateMaxLabelSize+ * @param {HTMLElement} label to measure+ * @protected+ */+ updateMaxLabelSize: function(labelWidth, labelHeight)+ {+ var host = this,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ sinRadians = props.sinRadians,+ cosRadians = props.cosRadians,+ max;+ if(rot === 0)+ {+ max = labelWidth;+ }+ else if(absRot === 90)+ {+ max = labelHeight;+ }+ else+ {+ max = (cosRadians * labelWidth) + (sinRadians * labelHeight);+ }+ host._maxLabelSize = Math.max(host._maxLabelSize, max);+ },+ + /**+ * Determines the available label width when the axis width has been explicitly set.+ *+ * @method getExplicitlySized+ * @return Boolean+ * @protected+ */+ getExplicitlySized: function(styles)+ {+ if(this._explicitWidth)+ {+ var host = this,+ w = host._explicitWidth,+ totalTitleSize = host._totalTitleSize,+ leftTickOffset = host.get("leftTickOffset"),+ margin = styles.label.margin.right;+ host._maxLabelSize = w - (leftTickOffset + margin + totalTitleSize);+ return true;+ }+ return false;+ },++ /**+ * Rotate and position title.+ *+ * @method positionTitle+ * @param {HTMLElement} label to rotate position+ * @protected+ */+ positionTitle: function(label)+ {+ var host = this,+ bounds = host._titleBounds,+ margin = host.get("styles").title.margin,+ props = host._titleRotationProps,+ w = bounds.right - bounds.left,+ labelWidth = label.offsetWidth,+ labelHeight = label.offsetHeight,+ x = (labelWidth * -0.5) + (w * 0.5),+ y = (host.get("height") * 0.5) - (labelHeight * 0.5);+ props.labelWidth = labelWidth;+ props.labelHeight = labelHeight;+ if(margin && margin.left)+ {+ x += margin.left;+ }+ props.x = x;+ props.y = y;+ props.transformOrigin = [0.5, 0.5];+ host._rotate(label, props);+ },++ /**+ * Rotate and position labels.+ *+ * @method positionLabel+ * @param {HTMLElement} label to rotate position+ * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned+ * against.+ * @protected+ */+ positionLabel: function(label, pt, styles, i)+ {+ var host = this,+ tickOffset = host.get("leftTickOffset"),+ totalTitleSize = this._totalTitleSize,+ leftOffset = pt.x + totalTitleSize - tickOffset,+ topOffset = pt.y,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ maxLabelSize = host._maxLabelSize,+ labelWidth = this._labelWidths[i],+ labelHeight = this._labelHeights[i];+ if(rot === 0)+ {+ leftOffset -= labelWidth;+ topOffset -= labelHeight * 0.5;+ }+ else if(rot === 90)+ {+ leftOffset -= labelWidth * 0.5;+ }+ else if(rot === -90)+ {+ leftOffset -= labelWidth * 0.5;+ topOffset -= labelHeight;+ }+ else+ {+ leftOffset -= labelWidth + (labelHeight * absRot/360);+ topOffset -= labelHeight * 0.5;+ }+ props.labelWidth = labelWidth;+ props.labelHeight = labelHeight;+ props.x = Math.round(maxLabelSize + leftOffset);+ props.y = Math.round(topOffset);+ this._rotate(label, props);+ },++ /**+ * Adjusts the coordinates of an axis label based on the rotation.+ *+ * @method _setRotationCoords+ * @param {Object} props Coordinates, dimension and rotation properties of the label.+ * @protected+ */+ _setRotationCoords: function(props)+ {+ var rot = props.rot,+ absRot = props.absRot,+ leftOffset,+ topOffset,+ labelWidth = props.labelWidth,+ labelHeight = props.labelHeight;+ if(rot === 0)+ {+ leftOffset = labelWidth;+ topOffset = labelHeight * 0.5;+ }+ else if(rot === 90)+ {+ topOffset = 0;+ leftOffset = labelWidth * 0.5;+ }+ else if(rot === -90)+ {+ leftOffset = labelWidth * 0.5;+ topOffset = labelHeight;+ }+ else+ {+ leftOffset = labelWidth + (labelHeight * absRot/360);+ topOffset = labelHeight * 0.5;+ }+ props.x -= leftOffset;+ props.y -= topOffset;+ },++ /**+ * Returns the transformOrigin to use for an axis label based on the position of the axis + * and the rotation of the label.+ *+ * @method _getTransformOrigin+ * @param {Number} rot The rotation (in degrees) of the label.+ * @return Array+ * @protected+ */+ _getTransformOrigin: function(rot)+ {+ var transformOrigin;+ if(rot === 0)+ {+ transformOrigin = [0, 0];+ }+ else if(rot === 90)+ {+ transformOrigin = [0.5, 0];+ }+ else if(rot === -90)+ {+ transformOrigin = [0.5, 1];+ }+ else+ {+ transformOrigin = [1, 0.5];+ }+ return transformOrigin;+ },++ /**+ * Adjust the position of the Axis widget's content box for internal axes.+ *+ * @method offsetNodeForTick+ * @param {Node} cb Content box of the Axis.+ * @protected+ */+ offsetNodeForTick: function(cb)+ {+ },++ /**+ * Sets the width of the axis based on its contents.+ *+ * @method setCalculatedSize+ * @protected+ */+ setCalculatedSize: function()+ {+ var host = this,+ graphic = this.get("graphic"),+ style = host.get("styles"),+ label = style.label,+ tickOffset = host.get("leftTickOffset"),+ max = host._maxLabelSize,+ totalTitleSize = this._totalTitleSize,+ ttl = Math.round(totalTitleSize + tickOffset + max + label.margin.right);+ if(this._explicitWidth)+ {+ ttl = this._explicitWidth;+ }+ this.set("calculatedWidth", ttl);+ graphic.set("x", ttl - tickOffset);+ }+};++Y.LeftAxisLayout = LeftAxisLayout;+/**+ * RightAxisLayout contains algorithms for rendering a right axis.+ *+ * @module charts+ * @submodule charts-base+ * @class RightAxisLayout+ * @constructor+ */+RightAxisLayout = function(){};++RightAxisLayout.prototype = {+ /**+ * Default margins for text fields.+ *+ * @private+ * @method _getDefaultMargins+ * @return Object+ */+ _getDefaultMargins: function() + {+ return {+ top: 0,+ left: 4,+ right: 0,+ bottom: 0+ };+ },++ /**+ * Sets the length of the tick on either side of the axis line.+ *+ * @method setTickOffset+ * @protected+ */+ setTickOffsets: function()+ {+ var host = this,+ majorTicks = host.get("styles").majorTicks,+ tickLength = majorTicks.length,+ halfTick = tickLength * 0.5,+ display = majorTicks.display;+ host.set("topTickOffset", 0);+ host.set("bottomTickOffset", 0);+ + switch(display)+ {+ case "inside" :+ host.set("leftTickOffset", tickLength);+ host.set("rightTickOffset", 0);+ break;+ case "outside" : + host.set("leftTickOffset", 0);+ host.set("rightTickOffset", tickLength);+ break;+ case "cross" :+ host.set("rightTickOffset", halfTick);+ host.set("leftTickOffset", halfTick);+ break;+ default:+ host.set("leftTickOffset", 0);+ host.set("rightTickOffset", 0);+ break;+ }+ },++ /**+ * Draws a tick+ *+ * @method drawTick+ * @param {Path} path reference to the path `Path` element in which to draw the tick.+ * @param {Object} pt Point on the axis in which the tick will intersect.+ * @param {Object) tickStyle Hash of properties to apply to the tick.+ * @protected+ */+ drawTick: function(path, pt, tickStyles)+ {+ var host = this,+ style = host.get("styles"),+ padding = style.padding,+ tickLength = tickStyles.length,+ start = {x:padding.left, y:pt.y},+ end = {x:padding.left + tickLength, y:pt.y};+ host.drawLine(path, start, end);+ },+ + /**+ * Calculates the coordinates for the first point on an axis.+ *+ * @method getLineStart+ * @return {Object}+ * @protected+ */+ getLineStart: function()+ {+ var host = this,+ style = host.get("styles"),+ padding = style.padding,+ majorTicks = style.majorTicks,+ tickLength = majorTicks.length,+ display = majorTicks.display,+ pt = {x:padding.left, y:padding.top};+ if(display === "inside")+ {+ pt.x += tickLength;+ }+ else if(display === "cross")+ {+ pt.x += tickLength/2;+ }+ return pt;+ },+ + /**+ * Calculates the point for a label.+ *+ * @method getLabelPoint+ * @param {Object} point Point on the axis in which the tick will intersect.+ * @return {Object} + * @protected+ */+ getLabelPoint: function(point)+ {+ return {x:point.x + this.get("rightTickOffset"), y:point.y};+ },+ + /**+ * Updates the value for the `maxLabelSize` for use in calculating total size.+ *+ * @method updateMaxLabelSize+ * @param {HTMLElement} label to measure+ * @protected+ */+ updateMaxLabelSize: function(labelWidth, labelHeight)+ {+ var host = this,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ sinRadians = props.sinRadians,+ cosRadians = props.cosRadians,+ max;+ if(rot === 0)+ {+ max = labelWidth;+ }+ else if(absRot === 90)+ {+ max = labelHeight;+ }+ else+ {+ max = (cosRadians * labelWidth) + (sinRadians * labelHeight);+ }+ host._maxLabelSize = Math.max(host._maxLabelSize, max);+ },+ + /**+ * Determines the available label width when the axis width has been explicitly set.+ *+ * @method getExplicitlySized+ * @return Boolean+ * @protected+ */+ getExplicitlySized: function(styles)+ {+ if(this._explicitWidth)+ {+ var host = this,+ w = host._explicitWidth,+ totalTitleSize = this._totalTitleSize,+ rightTickOffset = host.get("rightTickOffset"),+ margin = styles.label.margin.right;+ host._maxLabelSize = w - (rightTickOffset + margin + totalTitleSize);+ return true;+ }+ return false;+ },++ /**+ * Rotate and position title.+ *+ * @method positionTitle+ * @param {HTMLElement} label to rotate position+ * @protected+ */+ positionTitle: function(label)+ {+ var host = this,+ bounds = host._titleBounds,+ margin = host.get("styles").title.margin,+ props = host._titleRotationProps,+ labelWidth = label.offsetWidth,+ labelHeight = label.offsetHeight,+ w = bounds.right - bounds.left,+ x = this.get("width") - (labelWidth * 0.5) - (w * 0.5),+ y = (host.get("height") * 0.5) - (labelHeight * 0.5);+ props.labelWidth = labelWidth;+ props.labelHeight = labelHeight;+ if(margin && margin.right)+ {+ x -= margin.left;+ }+ props.x = x;+ props.y = y;+ props.transformOrigin = [0.5, 0.5];+ host._rotate(label, props);+ },++ /**+ * Rotate and position labels.+ *+ * @method positionLabel+ * @param {HTMLElement} label to rotate position+ * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned+ * against.+ * @protected+ */+ positionLabel: function(label, pt, styles, i)+ {+ var host = this,+ tickOffset = host.get("rightTickOffset"),+ labelStyles = styles.label,+ margin = 0,+ leftOffset = pt.x,+ topOffset = pt.y,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ labelWidth = this._labelWidths[i],+ labelHeight = this._labelHeights[i];+ if(labelStyles.margin && labelStyles.margin.left)+ {+ margin = labelStyles.margin.left;+ }+ if(rot === 0)+ {+ topOffset -= labelHeight * 0.5;+ }+ else if(rot === 90)+ {+ leftOffset -= labelWidth * 0.5;+ topOffset -= labelHeight;+ }+ else if(rot === -90)+ {+ leftOffset -= labelWidth * 0.5;+ }+ else+ {+ topOffset -= labelHeight * 0.5;+ leftOffset += labelHeight/2 * absRot/90;+ }+ leftOffset += margin;+ leftOffset += tickOffset;+ props.labelWidth = labelWidth;+ props.labelHeight = labelHeight;+ props.x = Math.round(leftOffset);+ props.y = Math.round(topOffset);+ this._rotate(label, props);+ },+ + /**+ * Adjusts the coordinates of an axis label based on the rotation.+ *+ * @method _setRotationCoords+ * @param {Object} props Coordinates, dimension and rotation properties of the label.+ * @protected+ */+ _setRotationCoords: function(props)+ {+ var rot = props.rot,+ absRot = props.absRot,+ leftOffset = 0,+ topOffset = 0,+ labelWidth = props.labelWidth,+ labelHeight = props.labelHeight;+ if(rot === 0)+ {+ topOffset = labelHeight * 0.5;+ }+ else if(rot === 90)+ {+ leftOffset = labelWidth * 0.5;+ topOffset = labelHeight;+ }+ else if(rot === -90)+ {+ leftOffset = labelWidth * 0.5;+ }+ else+ {+ topOffset = labelHeight * 0.5;+ leftOffset = labelHeight/2 * absRot/90;+ }+ props.x -= leftOffset;+ props.y -= topOffset;+ },+ + /**+ * Returns the transformOrigin to use for an axis label based on the position of the axis + * and the rotation of the label.+ *+ * @method _getTransformOrigin+ * @param {Number} rot The rotation (in degrees) of the label.+ * @return Array+ * @protected+ */+ _getTransformOrigin: function(rot)+ {+ var transformOrigin;+ if(rot === 0)+ {+ transformOrigin = [0, 0];+ }+ else if(rot === 90)+ {+ transformOrigin = [0.5, 1];+ }+ else if(rot === -90)+ {+ transformOrigin = [0.5, 0];+ }+ else+ {+ transformOrigin = [0, 0.5];+ }+ return transformOrigin;+ },++ /**+ * Adjusts position for inner ticks.+ *+ * @method offsetNodeForTick+ * @param {Node} cb contentBox of the axis+ * @protected+ */+ offsetNodeForTick: function(cb)+ {+ var host = this,+ tickOffset = host.get("leftTickOffset"),+ offset = 0 - tickOffset;+ cb.setStyle("left", offset);+ },++ /**+ * Assigns a height based on the size of the contents.+ *+ * @method setCalculatedSize+ * @protected+ */+ setCalculatedSize: function()+ {+ var host = this,+ styles = host.get("styles"),+ labelStyle = styles.label,+ totalTitleSize = this._totalTitleSize,+ ttl = Math.round(host.get("rightTickOffset") + host._maxLabelSize + totalTitleSize + labelStyle.margin.left);+ if(this._explicitWidth)+ {+ ttl = this._explicitWidth;+ }+ host.set("calculatedWidth", ttl);+ host.get("contentBox").setStyle("width", ttl);+ }+};++Y.RightAxisLayout = RightAxisLayout;+/**+ * Contains algorithms for rendering a bottom axis.+ *+ * @module charts+ * @submodule charts-base+ * @class BottomAxisLayout+ * @Constructor+ */+BottomAxisLayout = function(){};++BottomAxisLayout.prototype = {+ /**+ * Default margins for text fields.+ *+ * @private+ * @method _getDefaultMargins+ * @return Object+ */+ _getDefaultMargins: function() + {+ return {+ top: 4,+ left: 0,+ right: 0,+ bottom: 0+ };+ },++ /**+ * Sets the length of the tick on either side of the axis line.+ *+ * @method setTickOffsets+ * @protected+ */+ setTickOffsets: function()+ {+ var host = this,+ majorTicks = host.get("styles").majorTicks,+ tickLength = majorTicks.length,+ halfTick = tickLength * 0.5,+ display = majorTicks.display;+ host.set("leftTickOffset", 0);+ host.set("rightTickOffset", 0);++ switch(display)+ {+ case "inside" :+ host.set("topTickOffset", tickLength);+ host.set("bottomTickOffset", 0);+ break;+ case "outside" : + host.set("topTickOffset", 0);+ host.set("bottomTickOffset", tickLength);+ break;+ case "cross":+ host.set("topTickOffset", halfTick);+ host.set("bottomTickOffset", halfTick);+ break;+ default:+ host.set("topTickOffset", 0);+ host.set("bottomTickOffset", 0);+ break;+ }+ },++ /**+ * Calculates the coordinates for the first point on an axis.+ *+ * @method getLineStart+ * @protected+ */+ getLineStart: function()+ {+ var style = this.get("styles"),+ padding = style.padding,+ majorTicks = style.majorTicks,+ tickLength = majorTicks.length,+ display = majorTicks.display,+ pt = {x:0, y:padding.top};+ if(display === "inside")+ {+ pt.y += tickLength;+ }+ else if(display === "cross")+ {+ pt.y += tickLength/2;+ }+ return pt; + },+ + /**+ * Draws a tick+ *+ * @method drawTick+ * @param {Path} path reference to the path `Path` element in which to draw the tick.+ * @param {Object} pt hash containing x and y coordinates+ * @param {Object} tickStyles hash of properties used to draw the tick+ * @protected+ */+ drawTick: function(path, pt, tickStyles)+ {+ var host = this,+ style = host.get("styles"),+ padding = style.padding,+ tickLength = tickStyles.length,+ start = {x:pt.x, y:padding.top},+ end = {x:pt.x, y:tickLength + padding.top};+ host.drawLine(path, start, end);+ },++ /**+ * Calculates the point for a label.+ *+ * @method getLabelPoint+ * @param {Object} pt Object containing x and y coordinates+ * @return Object+ * @protected+ */+ getLabelPoint: function(point)+ {+ return {x:point.x, y:point.y + this.get("bottomTickOffset")};+ },+ + /**+ * Updates the value for the `maxLabelSize` for use in calculating total size.+ *+ * @method updateMaxLabelSize+ * @param {HTMLElement} label to measure+ * @protected+ */+ updateMaxLabelSize: function(labelWidth, labelHeight)+ {+ var host = this,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ sinRadians = props.sinRadians,+ cosRadians = props.cosRadians,+ max;+ if(rot === 0)+ {+ max = labelHeight;+ }+ else if(absRot === 90)+ {+ max = labelWidth;+ }+ else+ {+ max = (sinRadians * labelWidth) + (cosRadians * labelHeight); + }+ host._maxLabelSize = Math.max(host._maxLabelSize, max);+ },+ + /**+ * Determines the available label height when the axis width has been explicitly set.+ *+ * @method getExplicitlySized+ * @return Boolean+ * @protected+ */+ getExplicitlySized: function(styles)+ {+ if(this._explicitHeight)+ {+ var host = this,+ h = host._explicitHeight,+ totalTitleSize = host._totalTitleSize,+ bottomTickOffset = host.get("bottomTickOffset"),+ margin = styles.label.margin.right;+ host._maxLabelSize = h - (bottomTickOffset + margin + totalTitleSize);+ return true;+ }+ return false;+ },++ /**+ * Rotate and position title.+ *+ * @method positionTitle+ * @param {HTMLElement} label to rotate position+ * @protected+ */+ positionTitle: function(label)+ {+ var host = this,+ bounds = host._titleBounds,+ margin = host.get("styles").title.margin,+ props = host._titleRotationProps,+ h = bounds.bottom - bounds.top,+ labelWidth = label.offsetWidth,+ labelHeight = label.offsetHeight,+ x = (host.get("width") * 0.5) - (labelWidth * 0.5),+ y = host.get("height") - labelHeight/2 - h/2;+ props.labelWidth = labelWidth;+ props.labelHeight = labelHeight;+ if(margin && margin.bottom)+ {+ y -= margin.bottom;+ }+ props.x = x;+ props.y = y;+ props.transformOrigin = [0.5, 0.5];+ host._rotate(label, props);+ },+ + /**+ * Rotate and position labels.+ *+ * @method positionLabel+ * @param {HTMLElement} label to rotate position+ * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned+ * against.+ * @protected+ */+ positionLabel: function(label, pt, styles, i)+ {+ var host = this,+ tickOffset = host.get("bottomTickOffset"),+ labelStyles = styles.label,+ margin = 0,+ props = host._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ leftOffset = Math.round(pt.x),+ topOffset = Math.round(pt.y),+ labelWidth = host._labelWidths[i],+ labelHeight = host._labelHeights[i];+ if(labelStyles.margin && labelStyles.margin.top)+ {+ margin = labelStyles.margin.top;+ }+ if(rot > 0)+ {+ topOffset -= labelHeight/2 * rot/90;+ }+ else if(rot < 0)+ {+ leftOffset -= labelWidth;+ topOffset -= labelHeight/2 * absRot/90;+ }+ else+ {+ leftOffset -= labelWidth * 0.5;+ }+ topOffset += margin;+ topOffset += tickOffset;+ props.labelWidth = labelWidth;+ props.labelHeight = labelHeight;+ props.x = leftOffset;+ props.y = topOffset;+ host._rotate(label, props);+ },+ + /**+ * Adjusts the coordinates of an axis label based on the rotation.+ *+ * @method _setRotationCoords+ * @param {Object} props Coordinates, dimension and rotation properties of the label.+ * @protected+ */+ _setRotationCoords: function(props)+ {+ var rot = props.rot,+ absRot = props.absRot,+ labelWidth = props.labelWidth,+ labelHeight = props.labelHeight,+ leftOffset,+ topOffset;++ if(rot > 0)+ {+ leftOffset = 0;+ topOffset = labelHeight/2 * rot/90;+ }+ else if(rot < 0)+ {+ leftOffset = labelWidth;+ topOffset = labelHeight/2 * absRot/90;+ }+ else+ {+ leftOffset = labelWidth * 0.5;+ topOffset = 0;+ }+ props.x -= leftOffset;+ props.y -= topOffset;+ },++ /**+ * Returns the transformOrigin to use for an axis label based on the position of the axis + * and the rotation of the label.+ *+ * @method _getTransformOrigin+ * @param {Number} rot The rotation (in degrees) of the label.+ * @return Array+ * @protected+ */+ _getTransformOrigin: function(rot)+ {+ var transformOrigin;+ if(rot > 0)+ {+ transformOrigin = [0, 0.5];+ }+ else if(rot < 0)+ {+ transformOrigin = [1, 0.5];+ }+ else+ {+ transformOrigin = [0, 0];+ }+ return transformOrigin;+ },++ /**+ * Adjusts position for inner ticks.+ *+ * @method offsetNodeForTick+ * @param {Node} cb contentBox of the axis+ * @protected+ */+ offsetNodeForTick: function(cb)+ {+ var host = this;+ host.get("contentBox").setStyle("top", 0 - host.get("topTickOffset"));+ },++ /**+ * Assigns a height based on the size of the contents.+ *+ * @method setCalculatedSize+ * @protected+ */+ setCalculatedSize: function()+ {+ var host = this,+ styles = host.get("styles"),+ labelStyle = styles.label,+ totalTitleSize = host._totalTitleSize,+ ttl = Math.round(host.get("bottomTickOffset") + host._maxLabelSize + labelStyle.margin.top + totalTitleSize);+ if(host._explicitHeight)+ {+ ttl = host._explicitHeight;+ }+ host.set("calculatedHeight", ttl);+ }+};+Y.BottomAxisLayout = BottomAxisLayout;+/**+ * Contains algorithms for rendering a top axis.+ *+ * @module charts+ * @submodule charts-base+ * @class TopAxisLayout+ * @constructor+ */+TopAxisLayout = function(){};++TopAxisLayout.prototype = {+ /**+ * Default margins for text fields.+ *+ * @private+ * @method _getDefaultMargins+ * @return Object+ */+ _getDefaultMargins: function() + {+ return {+ top: 0,+ left: 0,+ right: 0,+ bottom: 4+ };+ },+ + /**+ * Sets the length of the tick on either side of the axis line.+ *+ * @method setTickOffsets+ * @protected+ */+ setTickOffsets: function()+ {+ var host = this,+ majorTicks = host.get("styles").majorTicks,+ tickLength = majorTicks.length,+ halfTick = tickLength * 0.5,+ display = majorTicks.display;+ host.set("leftTickOffset", 0);+ host.set("rightTickOffset", 0);+ switch(display)+ {+ case "inside" :+ host.set("bottomTickOffset", tickLength);+ host.set("topTickOffset", 0);+ break;+ case "outside" : + host.set("bottomTickOffset", 0);+ host.set("topTickOffset", tickLength);+ break;+ case "cross" :+ host.set("topTickOffset", halfTick);+ host.set("bottomTickOffset", halfTick);+ break;+ default:+ host.set("topTickOffset", 0);+ host.set("bottomTickOffset", 0);+ break;+ }+ },++ /**+ * Calculates the coordinates for the first point on an axis.+ *+ * @method getLineStart+ * @protected+ */+ getLineStart: function()+ {+ var host = this,+ style = host.get("styles"),+ padding = style.padding,+ majorTicks = style.majorTicks,+ tickLength = majorTicks.length,+ display = majorTicks.display,+ pt = {x:0, y:padding.top};+ if(display === "outside")+ {+ pt.y += tickLength;+ }+ else if(display === "cross")+ {+ pt.y += tickLength/2;+ }+ return pt; + },+ + /**+ * Draws a tick+ *+ * @method drawTick+ * @param {Path} path reference to the path `Path` element in which to draw the tick.+ * @param {Object} pt hash containing x and y coordinates+ * @param {Object} tickStyles hash of properties used to draw the tick+ * @protected+ */+ drawTick: function(path, pt, tickStyles)+ {+ var host = this,+ style = host.get("styles"),+ padding = style.padding,+ tickLength = tickStyles.length,+ start = {x:pt.x, y:padding.top},+ end = {x:pt.x, y:tickLength + padding.top};+ host.drawLine(path, start, end);+ },+ + /**+ * Calculates the point for a label.+ *+ * @method getLabelPoint+ * @param {Object} pt hash containing x and y coordinates+ * @return Object+ * @protected+ */+ getLabelPoint: function(pt)+ {+ return {x:pt.x, y:pt.y - this.get("topTickOffset")};+ },+ + /**+ * Updates the value for the `maxLabelSize` for use in calculating total size.+ *+ * @method updateMaxLabelSize+ * @param {HTMLElement} label to measure+ * @protected+ */+ updateMaxLabelSize: function(labelWidth, labelHeight)+ {+ var host = this,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ sinRadians = props.sinRadians,+ cosRadians = props.cosRadians,+ max;+ if(rot === 0)+ {+ max = labelHeight;+ }+ else if(absRot === 90)+ {+ max = labelWidth;+ }+ else+ {+ max = (sinRadians * labelWidth) + (cosRadians * labelHeight); + }+ host._maxLabelSize = Math.max(host._maxLabelSize, max);+ },++ /**+ * Determines the available label height when the axis width has been explicitly set.+ *+ * @method getExplicitlySized+ * @return Boolean+ * @protected+ */+ getExplicitlySized: function(styles)+ {+ if(this._explicitHeight)+ {+ var host = this,+ h = host._explicitHeight,+ totalTitleSize = host._totalTitleSize,+ topTickOffset = host.get("topTickOffset"),+ margin = styles.label.margin.right;+ host._maxLabelSize = h - (topTickOffset + margin + totalTitleSize);+ return true;+ }+ return false;+ },++ /**+ * Rotate and position title.+ *+ * @method positionTitle+ * @param {HTMLElement} label to rotate position+ * @protected+ */+ positionTitle: function(label)+ {+ var host = this,+ bounds = host._titleBounds,+ margin = host.get("styles").title.margin,+ props = host._titleRotationProps,+ labelWidth = label.offsetWidth,+ labelHeight = label.offsetHeight,+ h = bounds.bottom - bounds.top,+ x = (host.get("width") * 0.5) - (labelWidth * 0.5),+ y = h/2 - labelHeight/2;+ props.labelWidth = labelWidth;+ props.labelHeight = labelHeight;+ if(margin && margin.top)+ {+ y += margin.top;+ }+ props.x = x;+ props.y = y;+ props.transformOrigin = [0.5, 0.5];+ host._rotate(label, props);+ },++ /**+ * Rotate and position labels.+ *+ * @method positionLabel+ * @param {HTMLElement} label to rotate position+ * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned+ * against.+ * @protected+ */+ positionLabel: function(label, pt, styles, i)+ {+ var host = this,+ totalTitleSize = this._totalTitleSize,+ maxLabelSize = host._maxLabelSize,+ leftOffset = pt.x,+ topOffset = pt.y + totalTitleSize + maxLabelSize,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ labelWidth = this._labelWidths[i],+ labelHeight = this._labelHeights[i];+ if(rot === 0)+ {+ leftOffset -= labelWidth * 0.5;+ topOffset -= labelHeight;+ }+ else+ {+ if(rot === 90)+ {+ leftOffset -= labelWidth;+ topOffset -= (labelHeight * 0.5);+ }+ else if (rot === -90)+ {+ topOffset -= (labelHeight * 0.5);+ } + else if(rot > 0)+ {+ leftOffset -= labelWidth;+ topOffset -= labelHeight - (labelHeight * rot/180);+ }+ else+ {+ topOffset -= labelHeight - (labelHeight * absRot/180);+ }+ }+ props.x = Math.round(leftOffset);+ props.y = Math.round(topOffset);+ props.labelWidth = labelWidth;+ props.labelHeight = labelHeight;+ this._rotate(label, props);+ },++ /**+ * Adjusts the coordinates of an axis label based on the rotation.+ *+ * @method _setRotationCoords+ * @param {Object} props Coordinates, dimension and rotation properties of the label.+ * @protected+ */+ _setRotationCoords: function(props)+ {+ var rot = props.rot,+ absRot = props.absRot,+ labelWidth = props.labelWidth,+ labelHeight = props.labelHeight,+ leftOffset,+ topOffset;+ if(rot === 0)+ {+ leftOffset = labelWidth * 0.5;+ topOffset = labelHeight;+ }+ else+ {+ if(rot === 90)+ {+ leftOffset = labelWidth;+ topOffset = (labelHeight * 0.5);+ }+ else if (rot === -90)+ {+ topOffset = (labelHeight * 0.5);+ } + else if(rot > 0)+ {+ leftOffset = labelWidth;+ topOffset = labelHeight - (labelHeight * rot/180);+ }+ else+ {+ topOffset = labelHeight - (labelHeight * absRot/180);+ }+ }+ props.x -= leftOffset;+ props.y -= topOffset;+ },++ /**+ * Returns the transformOrigin to use for an axis label based on the position of the axis + * and the rotation of the label.+ *+ * @method _getTransformOrigin+ * @param {Number} rot The rotation (in degrees) of the label.+ * @return Array+ * @protected+ */+ _getTransformOrigin: function(rot)+ {+ var transformOrigin;+ if(rot === 0)+ {+ transformOrigin = [0, 0];+ }+ else+ {+ if(rot === 90)+ {+ transformOrigin = [1, 0.5];+ }+ else if (rot === -90)+ {+ transformOrigin = [0, 0.5];+ } + else if(rot > 0)+ {+ transformOrigin = [1, 0.5];+ }+ else+ {+ transformOrigin = [0, 0.5];+ }+ }+ return transformOrigin;+ },++ /**+ * Adjusts position for inner ticks.+ *+ * @method offsetNodeForTick+ * @param {Node} cb contentBox of the axis+ * @protected+ */+ offsetNodeForTick: function(cb)+ {+ },++ /**+ * Assigns a height based on the size of the contents.+ *+ * @method setCalculatedSize+ * @protected+ */+ setCalculatedSize: function()+ {+ var host = this,+ graphic = host.get("graphic"),+ styles = host.get("styles"),+ labelMargin = styles.label.margin,+ totalLabelSize = labelMargin.bottom + host._maxLabelSize,+ totalTitleSize = host._totalTitleSize,+ topTickOffset = this.get("topTickOffset"),+ ttl = Math.round(topTickOffset + totalLabelSize + totalTitleSize);+ if(this._explicitHeight)+ {+ ttl = this._explicitWidth; + }+ host.set("calculatedHeight", ttl);+ graphic.set("y", ttl - topTickOffset);+ }+};+Y.TopAxisLayout = TopAxisLayout;++/**+ * The Axis class. Generates axes for a chart.+ *+ * @module charts+ * @submodule charts-base+ * @class Axis+ * @extends Widget+ * @uses Renderer+ * @constructor+ * @param {Object} config (optional) Configuration parameters for the Chart.+ */+Y.Axis = Y.Base.create("axis", Y.Widget, [Y.Renderer], {+ /**+ * Storage for calculatedWidth value.+ *+ * @property _calculatedWidth+ * @type Number+ * @private+ */+ _calculatedWidth: 0,++ /**+ * Storage for calculatedHeight value.+ *+ * @property _calculatedHeight+ * @type Number+ * @private+ */+ _calculatedHeight: 0,++ /**+ * Handles change to the dataProvider+ * + * @method _dataChangeHandler+ * @param {Object} e Event object+ * @private+ */+ _dataChangeHandler: function(e)+ {+ if(this.get("rendered"))+ {+ this._drawAxis();+ }+ },++ /**+ * Handles change to the position attribute+ *+ * @method _positionChangeHandler+ * @param {Object} e Event object+ * @private+ */+ _positionChangeHandler: function(e)+ {+ this._updateGraphic(e.newVal);+ this._updateHandler();+ },++ /**+ * Updates the the Graphic instance+ *+ * @method _updateGraphic+ * @param {String} position Position of axis + * @private+ */+ _updateGraphic: function(position)+ {+ var graphic = this.get("graphic");+ if(position == "none")+ {+ if(graphic)+ {+ graphic.destroy();+ }+ }+ else+ {+ if(!graphic)+ {+ this._setCanvas();+ }+ }+ },++ /**+ * Handles changes to axis.+ *+ * @method _updateHandler+ * @param {Object} e Event object+ * @private+ */+ _updateHandler: function(e)+ {+ if(this.get("rendered"))+ {+ this._drawAxis();+ }+ },+ + /**+ * @method renderUI+ * @private+ */+ renderUI: function()+ {+ this._updateGraphic(this.get("position"));+ },++ /**+ * @method syncUI+ * @private+ */+ syncUI: function()+ {+ var layout = this._layout,+ defaultMargins,+ styles,+ label,+ title,+ i;+ if(layout)+ {+ defaultMargins = layout._getDefaultMargins();+ styles = this.get("styles");+ label = styles.label.margin;+ title =styles.title.margin;+ //need to defaultMargins method to the layout classes.+ for(i in defaultMargins)+ {+ if(defaultMargins.hasOwnProperty(i))+ {+ label[i] = label[i] === undefined ? defaultMargins[i] : label[i];+ title[i] = title[i] === undefined ? defaultMargins[i] : title[i];+ }+ }+ }+ this._drawAxis();+ },++ /**+ * Creates a graphic instance to be used for the axis line and ticks.+ *+ * @method _setCanvas+ * @private+ */+ _setCanvas: function()+ {+ var cb = this.get("contentBox"),+ bb = this.get("boundingBox"),+ p = this.get("position"),+ pn = this._parentNode,+ w = this.get("width"),+ h = this.get("height");+ bb.setStyle("position", "absolute");+ bb.setStyle("zIndex", 2);+ w = w ? w + "px" : pn.getStyle("width");+ h = h ? h + "px" : pn.getStyle("height");+ if(p === "top" || p === "bottom")+ {+ cb.setStyle("width", w);+ }+ else+ {+ cb.setStyle("height", h);+ }+ cb.setStyle("position", "relative");+ cb.setStyle("left", "0px");+ cb.setStyle("top", "0px");+ this.set("graphic", new Y.Graphic());+ this.get("graphic").render(cb);+ },+ + /**+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ * @protected+ */+ _getDefaultStyles: function()+ {+ var axisstyles = {+ majorTicks: {+ display:"inside",+ length:4,+ color:"#dad8c9",+ weight:1,+ alpha:1+ },+ minorTicks: {+ display:"none",+ length:2,+ color:"#dad8c9",+ weight:1+ },+ line: {+ weight:1,+ color:"#dad8c9",+ alpha:1+ },+ majorUnit: {+ determinant:"count",+ count:11,+ distance:75+ },+ top: "0px",+ left: "0px",+ width: "100px",+ height: "100px",+ label: {+ color:"#808080",+ alpha: 1,+ fontSize:"85%",+ rotation: 0,+ margin: {+ top: undefined,+ right: undefined,+ bottom: undefined,+ left: undefined+ }+ },+ title: {+ color:"#808080",+ alpha: 1,+ fontSize:"85%",+ rotation: undefined,+ margin: {+ top: undefined,+ right: undefined,+ bottom: undefined,+ left: undefined+ }+ },+ hideOverlappingLabelTicks: false+ };+ + return Y.merge(Y.Renderer.prototype._getDefaultStyles(), axisstyles); + },++ /**+ * Updates the axis when the size changes.+ *+ * @method _handleSizeChange+ * @param {Object} e Event object.+ * @private+ */+ _handleSizeChange: function(e)+ {+ var attrName = e.attrName,+ pos = this.get("position"),+ vert = pos == "left" || pos == "right",+ cb = this.get("contentBox"),+ hor = pos == "bottom" || pos == "top";+ cb.setStyle("width", this.get("width"));+ cb.setStyle("height", this.get("height"));+ if((hor && attrName == "width") || (vert && attrName == "height"))+ {+ this._drawAxis();+ }+ },+ + /**+ * Maps key values to classes containing layout algorithms+ *+ * @property _layoutClasses+ * @type Object+ * @private+ */+ _layoutClasses: + {+ top : TopAxisLayout,+ bottom: BottomAxisLayout,+ left: LeftAxisLayout,+ right : RightAxisLayout+ },+ + /**+ * Draws a line segment between 2 points+ *+ * @method drawLine+ * @param {Object} startPoint x and y coordinates for the start point of the line segment+ * @param {Object} endPoint x and y coordinates for the for the end point of the line segment+ * @param {Object} line styles (weight, color and alpha to be applied to the line segment)+ * @private+ */+ drawLine: function(path, startPoint, endPoint)+ {+ path.moveTo(startPoint.x, startPoint.y);+ path.lineTo(endPoint.x, endPoint.y);+ },++ /**+ * Generates the properties necessary for rotating and positioning a text field.+ *+ * @method _getTextRotationProps+ * @param {Object} styles properties for the text field+ * @return Object+ * @private+ */+ _getTextRotationProps: function(styles)+ {+ if(styles.rotation === undefined)+ {+ switch(this.get("position"))+ {+ case "left" :+ styles.rotation = -90;+ break; + case "right" : + styles.rotation = 90;+ break;+ default :+ styles.rotation = 0;+ break;+ }+ }+ var rot = Math.min(90, Math.max(-90, styles.rotation)),+ absRot = Math.abs(rot),+ radCon = Math.PI/180,+ sinRadians = parseFloat(parseFloat(Math.sin(absRot * radCon)).toFixed(8)),+ cosRadians = parseFloat(parseFloat(Math.cos(absRot * radCon)).toFixed(8));+ return {+ rot: rot,+ absRot: absRot,+ radCon: radCon,+ sinRadians: sinRadians,+ cosRadians: cosRadians,+ textAlpha: styles.alpha+ };+ },++ /**+ * Draws an axis. + *+ * @method _drawAxis+ * @private+ */+ _drawAxis: function ()+ {+ if(this._drawing)+ {+ this._callLater = true;+ return;+ }+ this._drawing = true;+ this._callLater = false;+ if(this._layout)+ {+ var styles = this.get("styles"),+ line = styles.line,+ labelStyles = styles.label,+ majorTickStyles = styles.majorTicks,+ drawTicks = majorTickStyles.display != "none",+ tickPoint,+ majorUnit = styles.majorUnit,+ len,+ majorUnitDistance,+ i = 0,+ layout = this._layout,+ layoutLength,+ position,+ lineStart,+ label,+ labelWidth,+ labelHeight,+ labelFunction = this.get("labelFunction"),+ labelFunctionScope = this.get("labelFunctionScope"),+ labelFormat = this.get("labelFormat"),+ graphic = this.get("graphic"),+ path = this.get("path"),+ tickPath,+ explicitlySized;+ this._labelWidths = [];+ this._labelHeights = [];+ graphic.set("autoDraw", false);+ path.clear();+ path.set("stroke", {+ weight: line.weight, + color: line.color, + opacity: line.alpha+ });+ this._labelRotationProps = this._getTextRotationProps(labelStyles);+ this._labelRotationProps.transformOrigin = layout._getTransformOrigin(this._labelRotationProps.rot);+ layout.setTickOffsets.apply(this);+ layoutLength = this.getLength();+ lineStart = layout.getLineStart.apply(this);+ len = this.getTotalMajorUnits(majorUnit);+ majorUnitDistance = this.getMajorUnitDistance(len, layoutLength, majorUnit);+ this.set("edgeOffset", this.getEdgeOffset(len, layoutLength) * 0.5);+ if(len < 1)+ {+ this._clearLabelCache();+ }+ else+ {+ tickPoint = this.getFirstPoint(lineStart);+ this.drawLine(path, lineStart, this.getLineEnd(tickPoint));+ if(drawTicks) + {+ tickPath = this.get("tickPath");+ tickPath.clear();+ tickPath.set("stroke", {+ weight: majorTickStyles.weight,+ color: majorTickStyles.color,+ opacity: majorTickStyles.alpha+ });+ layout.drawTick.apply(this, [tickPath, tickPoint, majorTickStyles]);+ }+ this._createLabelCache();+ this._tickPoints = [];+ this._maxLabelSize = 0; + this._totalTitleSize = 0;+ this._titleSize = 0;+ this._setTitle();+ explicitlySized = layout.getExplicitlySized.apply(this, [styles]);+ for(; i < len; ++i)+ {+ if(drawTicks) + {+ layout.drawTick.apply(this, [tickPath, tickPoint, majorTickStyles]);+ }+ position = this.getPosition(tickPoint);+ label = this.getLabel(tickPoint, labelStyles);+ this._labels.push(label);+ this._tickPoints.push({x:tickPoint.x, y:tickPoint.y});+ this.get("appendLabelFunction")(label, labelFunction.apply(labelFunctionScope, [this.getLabelByIndex(i, len), labelFormat]));+ labelWidth = Math.round(label.offsetWidth);+ labelHeight = Math.round(label.offsetHeight);+ if(!explicitlySized)+ {+ this._layout.updateMaxLabelSize.apply(this, [labelWidth, labelHeight]);+ }+ this._labelWidths.push(labelWidth);+ this._labelHeights.push(labelHeight);+ tickPoint = this.getNextPoint(tickPoint, majorUnitDistance);+ }+ this._clearLabelCache();+ if(this.get("overlapGraph"))+ {+ layout.offsetNodeForTick.apply(this, [this.get("contentBox")]);+ }+ layout.setCalculatedSize.apply(this);+ if(this._titleTextField)+ {+ this._layout.positionTitle.apply(this, [this._titleTextField]);+ }+ for(i = 0; i < len; ++i)+ {+ layout.positionLabel.apply(this, [this.get("labels")[i], this._tickPoints[i], styles, i]);+ }+ }+ }+ this._drawing = false;+ if(this._callLater)+ {+ this._drawAxis();+ }+ else+ {+ this._updatePathElement();+ this.fire("axisRendered");+ }+ },+ + /**+ * Calculates and sets the total size of a title.+ *+ * @method _setTotalTitleSize+ * @param {Object} styles Properties for the title field.+ * @private+ */+ _setTotalTitleSize: function(styles)+ {+ var title = this._titleTextField,+ w = title.offsetWidth,+ h = title.offsetHeight,+ rot = this._titleRotationProps.rot,+ bounds,+ size,+ margin = styles.margin,+ position = this.get("position"),+ matrix = new Y.Matrix();+ matrix.rotate(rot);+ bounds = matrix.getContentRect(w, h);+ if(position == "left" || position == "right")+ {+ size = bounds.right - bounds.left;+ if(margin)+ {+ size += margin.left + margin.right;+ }+ }+ else+ {+ size = bounds.bottom - bounds.top;+ if(margin)+ {+ size += margin.top + margin.bottom;+ }+ }+ this._titleBounds = bounds;+ this._totalTitleSize = size;+ },++ /**+ * Updates path.+ *+ * @method _updatePathElement+ * @private+ */+ _updatePathElement: function()+ {+ var path = this._path,+ tickPath = this._tickPath,+ redrawGraphic = false,+ graphic = this.get("graphic");+ if(path)+ {+ redrawGraphic = true;+ path.end();+ }+ if(tickPath)+ {+ redrawGraphic = true;+ tickPath.end();+ }+ if(redrawGraphic)+ {+ graphic._redraw();+ }+ },++ /**+ * Updates the content and style properties for a title field.+ *+ * @method _updateTitle+ * @private+ */+ _setTitle: function()+ {+ var i,+ styles,+ customStyles,+ title = this.get("title"),+ titleTextField = this._titleTextField,+ parentNode;+ if(title !== null && title !== undefined)+ {+ customStyles = {+ rotation: "rotation",+ margin: "margin",+ alpha: "alpha"+ };+ styles = this.get("styles").title;+ if(!titleTextField)+ {+ titleTextField = DOCUMENT.createElement('span');+ titleTextField.style.display = "block";+ titleTextField.style.whiteSpace = "nowrap";+ titleTextField.setAttribute("class", "axisTitle");+ this.get("contentBox").append(titleTextField);+ }+ else if(!DOCUMENT.createElementNS)+ {+ if(titleTextField.style.filter)+ {+ titleTextField.style.filter = null;+ }+ }+ titleTextField.style.position = "absolute";+ for(i in styles)+ {+ if(styles.hasOwnProperty(i) && !customStyles.hasOwnProperty(i))+ {+ titleTextField.style[i] = styles[i];+ }+ }+ this.get("appendTitleFunction")(titleTextField, title);+ this._titleTextField = titleTextField;+ this._titleRotationProps = this._getTextRotationProps(styles);+ this._setTotalTitleSize(styles);+ }+ else if(titleTextField)+ {+ parentNode = titleTextField.parentNode;+ if(parentNode)+ {+ parentNode.removeChild(titleTextField);+ }+ this._titleTextField = null;+ this._totalTitleSize = 0;+ }+ },++ /**+ * Creates or updates an axis label.+ *+ * @method getLabel+ * @param {Object} pt x and y coordinates for the label+ * @param {Object} styles styles applied to label+ * @return HTMLElement + * @private+ */+ getLabel: function(pt, styles)+ {+ var i,+ label,+ labelCache = this._labelCache,+ customStyles = {+ rotation: "rotation",+ margin: "margin",+ alpha: "alpha"+ };+ if(labelCache && labelCache.length > 0)+ {+ label = labelCache.shift();+ }+ else+ {+ label = DOCUMENT.createElement("span");+ label.className = Y.Lang.trim([label.className, "axisLabel"].join(' '));+ this.get("contentBox").append(label);+ }+ if(!DOCUMENT.createElementNS)+ {+ if(label.style.filter)+ {+ label.style.filter = null;+ }+ }+ label.style.display = "block";+ label.style.whiteSpace = "nowrap";+ label.style.position = "absolute";+ for(i in styles)+ {+ if(styles.hasOwnProperty(i) && !customStyles.hasOwnProperty(i))+ {+ label.style[i] = styles[i];+ }+ }+ return label;+ },++ /**+ * Creates a cache of labels that can be re-used when the axis redraws.+ *+ * @method _createLabelCache+ * @private+ */+ _createLabelCache: function()+ {+ if(this._labels)+ {+ while(this._labels.length > 0)+ {+ this._labelCache.push(this._labels.shift());+ }+ }+ else+ {+ this._clearLabelCache();+ }+ this._labels = [];+ },+ + /**+ * Removes axis labels from the dom and clears the label cache.+ *+ * @method _clearLabelCache+ * @private+ */+ _clearLabelCache: function()+ {+ if(this._labelCache)+ {+ var len = this._labelCache.length,+ i = 0,+ label;+ for(; i < len; ++i)+ {+ label = this._labelCache[i];+ this._removeChildren(label);+ Y.Event.purgeElement(label, true);+ label.parentNode.removeChild(label);+ }+ }+ this._labelCache = [];+ },++ /**+ * Gets the end point of an axis.+ *+ * @method getLineEnd+ * @return Object+ * @private + */+ getLineEnd: function(pt)+ {+ var w = this.get("width"),+ h = this.get("height"),+ pos = this.get("position");+ if(pos === "top" || pos === "bottom")+ {+ return {x:w, y:pt.y};+ }+ else+ {+ return {x:pt.x, y:h};+ }+ },++ /**+ * Calcuates the width or height of an axis depending on its direction.+ *+ * @method getLength+ * @return Number+ * @private+ */+ getLength: function()+ {+ var l,+ style = this.get("styles"),+ padding = style.padding,+ w = this.get("width"),+ h = this.get("height"),+ pos = this.get("position");+ if(pos === "top" || pos === "bottom")+ {+ l = w - (padding.left + padding.right);+ }+ else+ {+ l = h - (padding.top + padding.bottom);+ }+ return l;+ },++ /**+ * Gets the position of the first point on an axis.+ *+ * @method getFirstPoint+ * @param {Object} pt Object containing x and y coordinates.+ * @return Object+ * @private+ */+ getFirstPoint:function(pt)+ {+ var style = this.get("styles"),+ pos = this.get("position"),+ padding = style.padding,+ np = {x:pt.x, y:pt.y};+ if(pos === "top" || pos === "bottom")+ {+ np.x += padding.left + this.get("edgeOffset");+ }+ else+ {+ np.y += this.get("height") - (padding.top + this.get("edgeOffset"));+ }+ return np;+ },++ /**+ * Gets the position of the next point on an axis.+ *+ * @method getNextPoint+ * @param {Object} point Object containing x and y coordinates.+ * @param {Number} majorUnitDistance Distance in pixels between ticks.+ * @return Object+ * @private+ */+ getNextPoint: function(point, majorUnitDistance)+ {+ var pos = this.get("position");+ if(pos === "top" || pos === "bottom")+ {+ point.x = point.x + majorUnitDistance; + }+ else+ {+ point.y = point.y - majorUnitDistance;+ }+ return point;+ },++ /**+ * Calculates the placement of last tick on an axis.+ *+ * @method getLastPoint+ * @return Object+ * @private + */+ getLastPoint: function()+ {+ var style = this.get("styles"),+ padding = style.padding,+ w = this.get("width"),+ pos = this.get("position");+ if(pos === "top" || pos === "bottom")+ {+ return {x:w - padding.right, y:padding.top};+ }+ else+ {+ return {x:padding.left, y:padding.top};+ }+ },++ /**+ * Calculates position on the axis.+ *+ * @method getPosition+ * @param {Object} point contains x and y values+ * @private + */+ getPosition: function(point)+ {+ var p,+ h = this.get("height"),+ style = this.get("styles"),+ padding = style.padding,+ pos = this.get("position"),+ dataType = this.get("dataType");+ if(pos === "left" || pos === "right") + {+ //Numeric data on a vertical axis is displayed from bottom to top.+ //Categorical and Timeline data is displayed from top to bottom.+ if(dataType === "numeric")+ {+ p = (h - (padding.top + padding.bottom)) - (point.y - padding.top);+ }+ else+ {+ p = point.y - padding.top;+ }+ }+ else+ {+ p = point.x - padding.left;+ }+ return p;+ },++ /**+ * Rotates and positions a text field.+ *+ * @method _rotate+ * @param {HTMLElement} label text field to rotate and position+ * @param {Object} props properties to be applied to the text field. + * @private+ */+ _rotate: function(label, props)+ {+ var rot = props.rot,+ x = props.x,+ y = props.y,+ filterString,+ textAlpha,+ matrix = new Y.Matrix(),+ transformOrigin = props.transformOrigin || [0, 0],+ offsetRect;+ if(DOCUMENT.createElementNS)+ {+ matrix.translate(x, y);+ matrix.rotate(rot);+ Y_DOM.setStyle(label, "transformOrigin", (transformOrigin[0] * 100) + "% " + (transformOrigin[1] * 100) + "%");+ Y_DOM.setStyle(label, "transform", matrix.toCSSText());+ }+ else+ {+ textAlpha = props.textAlpha;+ if(Y_Lang.isNumber(textAlpha) && textAlpha < 1 && textAlpha > -1 && !isNaN(textAlpha))+ {+ filterString = "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + Math.round(textAlpha * 100) + ")";+ }+ if(rot !== 0)+ {+ //ms filters kind of, sort of uses a transformOrigin of 0, 0. + //we'll translate the difference to create a true 0, 0 origin.+ matrix.rotate(rot);+ offsetRect = matrix.getContentRect(props.labelWidth, props.labelHeight);+ matrix.init();+ matrix.translate(offsetRect.left, offsetRect.top);+ matrix.translate(x, y);+ this._simulateRotateWithTransformOrigin(matrix, rot, transformOrigin, props.labelWidth, props.labelHeight);+ if(filterString)+ {+ filterString += " ";+ }+ else+ {+ filterString = ""; + }+ filterString += matrix.toFilterText();+ label.style.left = matrix.dx + "px";+ label.style.top = matrix.dy + "px";+ }+ else+ {+ label.style.left = x + "px";+ label.style.top = y + "px";+ }+ if(filterString)+ {+ label.style.filter = filterString;+ }+ }+ },+ + /**+ * Simulates a rotation with a specified transformOrigin. + *+ * @method _simulateTransformOrigin+ * @param {Matrix} matrix Reference to a `Matrix` instance.+ * @param {Number} rot The rotation (in degrees) that will be performed on a matrix.+ * @param {Array} transformOrigin An array represeniting the origin in which to perform the transform. The first + * index represents the x origin and the second index represents the y origin.+ * @param {Number} w The width of the object that will be transformed.+ * @param {Number} h The height of the object that will be transformed.+ * @private+ */+ _simulateRotateWithTransformOrigin: function(matrix, rot, transformOrigin, w, h)+ {+ var transformX = transformOrigin[0] * w,+ transformY = transformOrigin[1] * h;+ transformX = !isNaN(transformX) ? transformX : 0;+ transformY = !isNaN(transformY) ? transformY : 0;+ matrix.translate(transformX, transformY);+ matrix.rotate(rot);+ matrix.translate(-transformX, -transformY);+ },++ /**+ * Returns the coordinates (top, right, bottom, left) for the bounding box of the last label. + *+ * @method getMaxLabelBounds+ * @return Object+ */+ getMaxLabelBounds: function()+ {+ return this._getLabelBounds(this.getMaximumValue());+ },++ /**+ * Returns the coordinates (top, right, bottom, left) for the bounding box of the first label. + *+ * @method getMinLabelBounds+ * @return Object+ */+ getMinLabelBounds: function()+ {+ return this._getLabelBounds(this.getMinimumValue());+ },+ + /**+ * Returns the coordinates (top, right, bottom, left) for the bounding box of a label. + *+ * @method _getLabelBounds+ * @param {String} Value of the label+ * @return Object+ * @private+ */+ _getLabelBounds: function(val)+ {+ var layout = this._layout,+ labelStyles = this.get("styles").label,+ matrix = new Y.Matrix(),+ label,+ props = this._getTextRotationProps(labelStyles);+ props.transformOrigin = layout._getTransformOrigin(props.rot);+ label = this.getLabel({x: 0, y: 0}, labelStyles);+ this.get("appendLabelFunction")(label, this.get("labelFunction").apply(this, [val, this.get("labelFormat")]));+ props.labelWidth = label.offsetWidth;+ props.labelHeight = label.offsetHeight;+ this._removeChildren(label);+ Y.Event.purgeElement(label, true);+ label.parentNode.removeChild(label);+ props.x = 0;+ props.y = 0;+ layout._setRotationCoords(props);+ matrix.translate(props.x, props.y);+ this._simulateRotateWithTransformOrigin(matrix, props.rot, props.transformOrigin, props.labelWidth, props.labelHeight);+ return matrix.getContentRect(props.labelWidth, props.labelHeight);+ },++ /**+ * Removes all DOM elements from an HTML element. Used to clear out labels during detruction+ * phase.+ *+ * @method _removeChildren+ * @private+ */+ _removeChildren: function(node)+ {+ if(node.hasChildNodes())+ {+ var child;+ while(node.firstChild)+ {+ child = node.firstChild;+ this._removeChildren(child);+ node.removeChild(child);+ }+ }+ },+ + /**+ * Destructor implementation Axis class. Removes all labels and the Graphic instance from the widget.+ *+ * @method destructor+ * @protected+ */+ destructor: function()+ {+ var cb = this.get("contentBox").getDOMNode(),+ labels = this.get("labels"),+ graphic = this.get("graphic"),+ label,+ len = labels ? labels.length : 0;+ if(len > 0)+ {+ while(labels.length > 0)+ {+ label = labels.shift();+ this._removeChildren(label);+ cb.removeChild(label);+ label = null;+ }+ }+ if(graphic)+ {+ graphic.destroy();+ }+ },++ /**+ * Length in pixels of largest text bounding box. Used to calculate the height of the axis.+ *+ * @property maxLabelSize+ * @type Number+ * @protected+ */+ _maxLabelSize: 0,+ + /**+ * Updates the content of text field. This method writes a value into a text field using + * `appendChild`. If the value is a `String`, it is converted to a `TextNode` first. + *+ * @method _setText+ * @param label {HTMLElement} label to be updated+ * @param val {String} value with which to update the label+ * @private+ */+ _setText: function(textField, val)+ { + textField.innerHTML = "";+ if(Y_Lang.isNumber(val))+ {+ val = val + "";+ }+ else if(!val)+ {+ val = "";+ }+ if(IS_STRING(val))+ {+ val = DOCUMENT.createTextNode(val);+ }+ textField.appendChild(val);+ }+}, {+ ATTRS: + {+ /**+ * When set, defines the width of a vertical axis instance. By default, vertical axes automatically size based on their contents. When the+ * width attribute is set, the axis will not calculate its width. When the width attribute is explicitly set, axis labels will postion themselves off of the + * the inner edge of the axis and the title, if present, will position itself off of the outer edge. If a specified width is less than the sum of + * the axis' contents, excess content will overflow.+ *+ * @attribute width+ * @type Number+ */+ width: {+ lazyAdd: false,++ getter: function() + {+ if(this._explicitWidth)+ {+ return this._explicitWidth; + }+ return this._calculatedWidth;+ },++ setter: function(val)+ {+ this._explicitWidth = val;+ return val;+ }+ },++ /**+ * When set, defines the height of a horizontal axis instance. By default, horizontal axes automatically size based on their contents. When the+ * height attribute is set, the axis will not calculate its height. When the height attribute is explicitly set, axis labels will postion themselves off of the + * the inner edge of the axis and the title, if present, will position itself off of the outer edge. If a specified height is less than the sum of + * the axis' contents, excess content will overflow.+ *+ * @attribute height+ * @type Number+ */+ height: {+ lazyAdd: false,++ getter: function() + {+ if(this._explicitHeight)+ {+ return this._explicitHeight; + }+ return this._calculatedHeight;+ },++ setter: function(val)+ {+ this._explicitHeight = val;+ return val;+ }+ },++ /**+ * Calculated value of an axis' width. By default, the value is used internally for vertical axes. If the `width` attribute is explicitly set, this value will be ignored.+ *+ * @attribute calculatedWidth+ * @type Number+ * @private+ */+ calculatedWidth: {+ getter: function()+ {+ return this._calculatedWidth;+ },++ setter: function(val)+ {+ this._calculatedWidth = val;+ return val;+ }+ },++ /**+ * Calculated value of an axis' height. By default, the value is used internally for horizontal axes. If the `height` attribute is explicitly set, this value will be ignored.+ *+ * @attribute calculatedHeight+ * @type Number+ * @private+ */+ calculatedHeight: {+ getter: function()+ {+ return this._calculatedHeight;+ },++ setter: function(val)+ {+ this._calculatedHeight = val;+ return val;+ }+ },++ /**+ * Difference betweend the first/last tick and edge of axis.+ *+ * @attribute edgeOffset+ * @type Number+ * @protected+ */+ edgeOffset: + {+ value: 0+ },++ /**+ * The graphic in which the axis line and ticks will be rendered.+ *+ * @attribute graphic+ * @type Graphic+ */+ graphic: {},+ + /**+ * @attribute path+ * @type Shape+ * @readOnly+ * @private+ */+ path: {+ readOnly: true,++ getter: function()+ {+ if(!this._path)+ {+ var graphic = this.get("graphic");+ if(graphic)+ {+ this._path = graphic.addShape({type:"path"});+ }+ }+ return this._path;+ }+ },++ /**+ * @attribute tickPath+ * @type Shape+ * @readOnly+ * @private+ */+ tickPath: {+ readOnly: true,++ getter: function()+ {+ if(!this._tickPath)+ {+ var graphic = this.get("graphic");+ if(graphic)+ {+ this._tickPath = graphic.addShape({type:"path"});+ }+ }+ return this._tickPath;+ }+ },+ + /**+ * Contains the contents of the axis. + *+ * @attribute node+ * @type HTMLElement+ */+ node: {},++ /**+ * Direction of the axis.+ *+ * @attribute position+ * @type String+ */+ position: {+ setter: function(val)+ {+ var layoutClass = this._layoutClasses[val];+ if(val && val != "none")+ {+ this._layout = new layoutClass();+ }+ return val;+ }+ },++ /**+ * Distance determined by the tick styles used to calculate the distance between the axis+ * line in relation to the top of the axis.+ *+ * @attribute topTickOffset+ * @type Number+ */+ topTickOffset: {+ value: 0+ },++ /**+ * Distance determined by the tick styles used to calculate the distance between the axis+ * line in relation to the bottom of the axis.+ *+ * @attribute bottomTickOffset+ * @type Number+ */+ bottomTickOffset: {+ value: 0+ },++ /**+ * Distance determined by the tick styles used to calculate the distance between the axis+ * line in relation to the left of the axis.+ *+ * @attribute leftTickOffset+ * @type Number+ */+ leftTickOffset: {+ value: 0+ },++ /**+ * Distance determined by the tick styles used to calculate the distance between the axis+ * line in relation to the right side of the axis.+ *+ * @attribute rightTickOffset+ * @type Number+ */+ rightTickOffset: {+ value: 0+ },+ + /**+ * Collection of labels used to render the axis.+ *+ * @attribute labels+ * @type Array+ */+ labels: {+ readOnly: true,+ getter: function()+ {+ return this._labels;+ }+ },++ /**+ * Collection of points used for placement of labels and ticks along the axis.+ *+ * @attribute tickPoints+ * @type Array+ */+ tickPoints: {+ readOnly: true,++ getter: function()+ {+ if(this.get("position") == "none")+ {+ return this.get("styles").majorUnit.count;+ }+ return this._tickPoints;+ }+ },++ /**+ * Indicates whether the axis overlaps the graph. If an axis is the inner most axis on a given+ * position and the tick position is inside or cross, the axis will need to overlap the graph.+ *+ * @attribute overlapGraph+ * @type Boolean+ */+ overlapGraph: {+ value:true,++ validator: function(val)+ {+ return Y_Lang.isBoolean(val);+ }+ },++ /**+ * Object which should have by the labelFunction+ *+ * @attribute labelFunctionScope+ * @type Object+ */+ labelFunctionScope: {},+ + /**+ * Length in pixels of largest text bounding box. Used to calculate the height of the axis.+ *+ * @attribute maxLabelSize+ * @type Number+ * @protected+ */+ maxLabelSize: {+ getter: function()+ {+ return this._maxLabelSize;+ },++ setter: function(val)+ {+ this._maxLabelSize = val;+ return val; + }+ },+ + /**+ * Title for the axis. When specified, the title will display. The position of the title is determined by the axis position. + * <dl>+ * <dt>top</dt><dd>Appears above the axis and it labels. The default rotation is 0.</dd>+ * <dt>right</dt><dd>Appears to the right of the axis and its labels. The default rotation is 90.</dd>+ * <dt>bottom</dt><dd>Appears below the axis and its labels. The default rotation is 0.</dd>+ * <dt>left</dt><dd>Appears to the left of the axis and its labels. The default rotation is -90.</dd>+ * </dl>+ *+ * @attribute title+ * @type String+ */+ title: {+ value: null+ },+ + /**+ * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need+ * to implement the arguments below and return a `String` or `HTMLElement`. + * <dl>+ * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>+ * <dt>format</dt><dd>Template for formatting label. (optional)</dd>+ * </dl>+ *+ * @attribute labelFunction+ * @type Function+ */+ labelFunction: {+ value: function(val, format)+ {+ return val;+ }+ },+ + /**+ * Function used to append an axis value to an axis label. This function has the following signature:+ * <dl>+ * <dt>textField</dt><dd>The axis label to be appended. (`HTMLElement`)</dd>+ * <dt>val</dt><dd>The value to attach to the text field. This method will accept an `HTMLELement`+ * or a `String`. This method does not use (`HTMLElement` | `String`)</dd>+ * </dl>+ * The default method appends a value to the `HTMLElement` using the `appendChild` method. If the given + * value is a `String`, the method will convert the the value to a `textNode` before appending to the + * `HTMLElement`. This method will not convert an `HTMLString` to an `HTMLElement`. + *+ * @attribute appendLabelFunction+ * @type Function+ */+ appendLabelFunction: {+ valueFn: function()+ {+ return this._setText;+ }+ },+ + /**+ * Function used to append a title value to the title object. This function has the following signature:+ * <dl>+ * <dt>textField</dt><dd>The title text field to be appended. (`HTMLElement`)</dd>+ * <dt>val</dt><dd>The value to attach to the text field. This method will accept an `HTMLELement`+ * or a `String`. This method does not use (`HTMLElement` | `String`)</dd>+ * </dl>+ * The default method appends a value to the `HTMLElement` using the `appendChild` method. If the given + * value is a `String`, the method will convert the the value to a `textNode` before appending to the + * `HTMLElement` element. This method will not convert an `HTMLString` to an `HTMLElement`. + *+ * @attribute appendTitleFunction+ * @type Function+ */+ appendTitleFunction: {+ valueFn: function()+ {+ return this._setText;+ }+ }+ + /**+ * Style properties used for drawing an axis. This attribute is inherited from `Renderer`. Below are the default values:+ * <dl>+ * <dt>majorTicks</dt><dd>Properties used for drawing ticks.+ * <dl>+ * <dt>display</dt><dd>Position of the tick. Possible values are `inside`, `outside`, `cross` and `none`. The+ * default value is `inside`.</dd>+ * <dt>length</dt><dd>The length (in pixels) of the tick. The default value is 4.</dd>+ * <dt>color</dt><dd>The color of the tick. The default value is `#dad8c9`</dd>+ * <dt>weight</dt><dd>Number indicating the width of the tick. The default value is 1.</dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the tick. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>line</dt><dd>Properties used for drawing the axis line. + * <dl>+ * <dt>weight</dt><dd>Number indicating the width of the axis line. The default value is 1.</dd>+ * <dt>color</dt><dd>The color of the axis line. The default value is `#dad8c9`.</dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the tick. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>majorUnit</dt><dd>Properties used to calculate the `majorUnit` for the axis. + * <dl>+ * <dt>determinant</dt><dd>The algorithm used for calculating distance between ticks. The possible options are `count` and `distance`. If+ * the `determinant` is `count`, the axis ticks will spaced so that a specified number of ticks appear on the axis. If the `determinant`+ * is `distance`, the axis ticks will spaced out according to the specified distance. The default value is `count`.</dd>+ * <dt>count</dt><dd>Number of ticks to appear on the axis when the `determinant` is `count`. The default value is 11.</dd>+ * <dt>distance</dt><dd>The distance (in pixels) between ticks when the `determinant` is `distance`. The default value is 75.</dd>+ * </dl>+ * </dd>+ * <dt>label</dt><dd>Properties and styles applied to the axis labels.+ * <dl>+ * <dt>color</dt><dd>The color of the labels. The default value is `#808080`.</dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 indicating the opacity of the labels. The default value is 1.</dd>+ * <dt>fontSize</dt><dd>The font-size of the labels. The default value is 85%</dd>+ * <dt>rotation</dt><dd>The rotation, in degrees (between -90 and 90) of the labels. The default value is 0.</dd>+ * <dt>margin</dt><dd>The distance between the label and the axis/tick. Depending on the position of the `Axis`, only one of the properties used.+ * <dl>+ * <dt>top</dt><dd>Pixel value used for an axis with a `position` of `bottom`. The default value is 4.</dd>+ * <dt>right</dt><dd>Pixel value used for an axis with a `position` of `left`. The default value is 4.</dd>+ * <dt>bottom</dt><dd>Pixel value used for an axis with a `position` of `top`. The default value is 4.</dd>+ * <dt>left</dt><dd>Pixel value used for an axis with a `position` of `right`. The default value is 4.</dd>+ * </dl>+ * </dd>+ * </dl>+ * </dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});+/**+ * AxisType is an abstract class that manages the data for an axis.+ *+ * @module charts+ * @submodule charts-base+ * @class AxisType+ * @constructor+ * @extends Axis+ */+Y.AxisType = Y.Base.create("baseAxis", Y.Axis, [], {+ /**+ * @method initializer+ * @private+ */+ initializer: function()+ {+ this.after("dataReady", Y.bind(this._dataChangeHandler, this));+ this.after("dataUpdate", Y.bind(this._dataChangeHandler, this));+ this.after("minimumChange", Y.bind(this._keyChangeHandler, this));+ this.after("maximumChange", Y.bind(this._keyChangeHandler, this));+ this.after("keysChange", this._keyChangeHandler);+ this.after("dataProviderChange", this._dataProviderChangeHandler);+ this.after("alwaysShowZeroChange", this._keyChangeHandler);+ this.after("roundingMethodChange", this._keyChangeHandler);+ },++ /**+ * @method bindUI+ * @private+ */+ bindUI: function()+ {+ this.after("stylesChange", this._updateHandler);+ this.after("overlapGraphChange", this._updateHandler);+ this.after("positionChange", this._positionChangeHandler);+ this.after("widthChange", this._handleSizeChange);+ this.after("heightChange", this._handleSizeChange);+ this.after("calculatedWidthChange", this._handleSizeChange);+ this.after("calculatedHeightChange", this._handleSizeChange);+ },++ /**+ * Handles changes to `dataProvider`.+ *+ * @method _dataProviderChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _dataProviderChangeHandler: function(e)+ {+ var keyCollection = this.get("keyCollection").concat(),+ keys = this.get("keys"),+ i;+ if(keys)+ {+ for(i in keys)+ {+ if(keys.hasOwnProperty(i))+ {+ delete keys[i];+ }+ }+ }+ if(keyCollection && keyCollection.length)+ {+ this.set("keys", keyCollection);+ }+ },++ /**+ * Constant used to generate unique id.+ *+ * @property GUID+ * @type String+ * @private+ */+ GUID: "yuibaseaxis",+ + /**+ * Type of data used in `Axis`.+ *+ * @property _type+ * @type String + * @readOnly+ * @private+ */+ _type: null,+ + /**+ * Storage for `setMaximum` attribute.+ *+ * @property _setMaximum+ * @type Object+ * @private+ */+ _setMaximum: null,+ + /**+ * Storage for `dataMaximum` attribute.+ *+ * @property _dataMaximum+ * @type Object+ * @private+ */+ _dataMaximum: null,+ + /**+ * Storage for `setMinimum` attribute.+ *+ * @property _setMinimum+ * @type Object+ * @private+ */+ _setMinimum: null,+ + /**+ * Reference to data array.+ *+ * @property _data+ * @type Array+ * @private+ */+ _data: null,++ /**+ * Indicates whether the all data is up to date.+ *+ * @property _updateTotalDataFlag+ * @type Boolean+ * @private+ */+ _updateTotalDataFlag: true,++ /**+ * Storage for `dataReady` attribute.+ *+ * @property _dataReady+ * @type Boolean+ * @readOnly+ * @private+ */+ _dataReady: false,+ + /**+ * Adds an array to the key hash.+ *+ * @method addKey+ * @param value Indicates what key to use in retrieving+ * the array.+ */+ addKey: function (value)+ {+ this.set("keys", value);+ },++ /**+ * Gets an array of values based on a key.+ *+ * @method _getKeyArray+ * @param {String} key Value key associated with the data array.+ * @param {Array} data Array in which the data resides.+ * @return Array+ * @private+ */+ _getKeyArray: function(key, data)+ {+ var i = 0,+ obj,+ keyArray = [],+ len = data.length;+ for(; i < len; ++i)+ {+ obj = data[i];+ keyArray[i] = obj[key];+ }+ return keyArray;+ },++ /**+ * Sets data by key+ *+ * @method _setDataByKey+ * @param {String} key Key value to use.+ * @param {Array} data Array to use.+ * @private + */+ _setDataByKey: function(key, data)+ {+ var i,+ obj, + arr = [], + dv = this._dataClone.concat(), + len = dv.length;+ for(i = 0; i < len; ++i)+ {+ obj = dv[i];+ arr[i] = obj[key];+ }+ this.get("keys")[key] = arr;+ this._updateTotalDataFlag = true;+ },++ /**+ * Updates the total data array.+ *+ * @method _updateTotalData+ * @private+ */+ _updateTotalData: function()+ {+ var keys = this.get("keys"),+ i;+ this._data = [];+ for(i in keys)+ {+ if(keys.hasOwnProperty(i))+ {+ this._data = this._data.concat(keys[i]);+ }+ }+ this._updateTotalDataFlag = false;+ },++ /**+ * Removes an array from the key hash.+ * + * @method removeKey+ * @param {String} value Indicates what key to use in removing from + * the hash.+ */+ removeKey: function(value)+ {+ var keys = this.get("keys");+ if(keys.hasOwnProperty(value)) + {+ delete keys[value];+ this._keyChangeHandler();+ }+ },++ /**+ * Returns a value based of a key value and an index.+ *+ * @method getKeyValueAt+ * @param {String} key value used to look up the correct array+ * @param {Number} index within the array+ * @return Number + */+ getKeyValueAt: function(key, index)+ {+ var value = NaN,+ keys = this.get("keys");+ if(keys[key] && Y_Lang.isNumber(parseFloat(keys[key][index])))+ {+ value = keys[key][index];+ }+ return parseFloat(value);+ },++ /**+ * Returns an array of values based on an identifier key.+ *+ * @method getDataByKey+ * @param {String} value value used to identify the array+ * @return Object+ */+ getDataByKey: function (value)+ {+ var keys = this.get("keys");+ if(keys[value])+ {+ return keys[value];+ }+ return null;+ },++ /**+ * Calculates the maximum and minimum values for the `Axis`.+ *+ * @method _updateMinAndMax+ * @private + */+ _updateMinAndMax: function() + {+ var data = this.get("data"),+ max = 0,+ min = 0,+ len,+ num,+ i;+ if(data && data.length && data.length > 0)+ {+ len = data.length;+ max = min = data[0];+ if(len > 1)+ {+ for(i = 1; i < len; i++)+ { + num = data[i];+ if(isNaN(num))+ {+ continue;+ }+ max = Math.max(num, max);+ min = Math.min(num, min);+ }+ }+ }+ this._dataMaximum = max;+ this._dataMinimum = min;+ },++ /**+ * Returns the total number of majorUnits that will appear on an axis.+ *+ * @method getTotalMajorUnits+ * @return Number+ */+ getTotalMajorUnits: function()+ {+ var units,+ majorUnit = this.get("styles").majorUnit,+ len = this.get("length");+ if(majorUnit.determinant === "count") + {+ units = majorUnit.count;+ }+ else if(majorUnit.determinant === "distance") + {+ units = (len/majorUnit.distance) + 1;+ }+ return units; + },++ /**+ * Returns the distance between major units on an axis.+ *+ * @method getMajorUnitDistance+ * @param {Number} len Number of ticks+ * @param {Number} uiLen Size of the axis.+ * @param {Object} majorUnit Hash of properties used to determine the majorUnit+ * @return Number+ */+ getMajorUnitDistance: function(len, uiLen, majorUnit)+ {+ var dist;+ if(majorUnit.determinant === "count")+ {+ dist = uiLen/(len - 1);+ }+ else if(majorUnit.determinant === "distance")+ {+ dist = majorUnit.distance;+ }+ return dist;+ },+ + /**+ * Gets the distance that the first and last ticks are offset from there respective+ * edges.+ *+ * @method getEdgeOffset+ * @param {Number} ct Number of ticks on the axis.+ * @param {Number} l Length (in pixels) of the axis.+ * @return Number+ */+ getEdgeOffset: function(ct, l)+ {+ return 0;+ },++ /**+ * Calculates and returns a value based on the number of labels and the index of+ * the current label.+ *+ * @method getLabelByIndex+ * @param {Number} i Index of the label.+ * @param {Number} l Total number of labels.+ * @return String+ */+ getLabelByIndex: function(i, l)+ {+ var min = this.get("minimum"),+ max = this.get("maximum"),+ increm = (max - min)/(l-1),+ label;+ l -= 1;+ label = min + (i * increm);+ return label;+ },++ /**+ * Updates the `Axis` after a change in keys.+ *+ * @method _keyChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _keyChangeHandler: function(e)+ {+ this._updateMinAndMax();+ this.fire("dataUpdate");+ },++ /**+ * Checks to see if data extends beyond the range of the axis. If so,+ * that data will need to be hidden. This method is internal, temporary and subject+ * to removal in the future.+ *+ * @method _hasDataOverflow+ * @protected+ * @return Boolean+ */+ _hasDataOverflow: function()+ {+ if(this.get("setMin") || this.get("setMax"))+ {+ return true;+ }+ return false;+ },++ /**+ * Returns a string corresponding to the first label on an + * axis.+ *+ * @method getMinimumValue+ * @return String+ */+ getMinimumValue: function()+ {+ return this.get("minimum");+ },++ /**+ * Returns a string corresponding to the last label on an + * axis.+ *+ * @method getMaximumValue+ * @return String+ */+ getMaximumValue: function()+ {+ return this.get("maximum");+ }+}, {+ ATTRS: {+ /**+ * Hash of array identifed by a string value.+ *+ * @attribute keys+ * @type Object+ */+ keys: {+ value: {},++ setter: function(val)+ {+ var keys = {},+ i, + len,+ data = this.get("dataProvider");+ if(Y_Lang.isArray(val))+ {+ len = val.length;+ for(i = 0; i < len; ++i)+ {+ keys[val[i]] = this._getKeyArray(val[i], data); + }+ + }+ else if(Y_Lang.isString(val))+ {+ keys = this.get("keys");+ keys[val] = this._getKeyArray(val, data);+ }+ else+ {+ for(i in val)+ {+ if(val.hasOwnProperty(i))+ {+ keys[i] = this._getKeyArray(i, data);+ }+ }+ }+ this._updateTotalDataFlag = true;+ return keys;+ }+ },++ /**+ *Indicates how to round unit values.+ * <dl>+ * <dt>niceNumber</dt><dd>Units will be smoothed based on the number of ticks and data range.</dd>+ * <dt>auto</dt><dd>If the range is greater than 1, the units will be rounded.</dd>+ * <dt>numeric value</dt><dd>Units will be equal to the numeric value.</dd>+ * <dt>null</dt><dd>No rounding will occur.</dd>+ * </dl>+ *+ * @attribute roundingMethod+ * @type String+ * @default niceNumber+ */+ roundingMethod: {+ value: "niceNumber"+ },++ /**+ *Returns the type of axis data+ * <dl>+ * <dt>time</dt><dd>Manages time data</dd>+ * <dt>stacked</dt><dd>Manages stacked numeric data</dd> + * <dt>numeric</dt><dd>Manages numeric data</dd>+ * <dt>category</dt><dd>Manages categorical data</dd>+ * </dl>+ *+ * @attribute type+ * @type String+ */+ type:+ {+ readOnly: true,++ getter: function ()+ {+ return this._type;+ }+ },++ /**+ * Instance of `ChartDataProvider` that the class uses+ * to build its own data.+ *+ * @attribute dataProvider+ * @type Array+ */+ dataProvider:{+ setter: function (value)+ {+ return value;+ }+ },++ /**+ * The maximum value contained in the `data` array. Used for+ * `maximum` when `autoMax` is true.+ *+ * @attribute dataMaximum+ * @type Number+ */+ dataMaximum: {+ getter: function ()+ {+ if(!this._dataMaximum)+ { + this._updateMinAndMax();+ }+ return this._dataMaximum;+ }+ },++ /**+ * The maximum value that will appear on an axis.+ *+ * @attribute maximum+ * @type Number+ */+ maximum: {+ lazyAdd: false,++ getter: function ()+ {+ var max = this.get("dataMaximum"),+ min = this.get("minimum");+ //If all values are zero, force a range so that the Axis and related series+ //will still render.+ if(min === 0 && max === 0)+ {+ max = 10;+ }+ if(Y_Lang.isNumber(this._setMaximum))+ {+ max = this._setMaximum;+ }+ return parseFloat(max);+ },+ setter: function (value)+ {+ this._setMaximum = parseFloat(value);+ return value;+ }+ },++ /**+ * The minimum value contained in the `data` array. Used for+ * `minimum` when `autoMin` is true.+ *+ * @attribute dataMinimum+ * @type Number+ */+ dataMinimum: {+ getter: function ()+ {+ if(!this._dataMinimum)+ {+ this._updateMinAndMax();+ }+ return this._dataMinimum;+ }+ },++ /**+ * The minimum value that will appear on an axis.+ *+ * @attribute minimum+ * @type Number+ */+ minimum: {+ lazyAdd: false,++ getter: function ()+ {+ var min = this.get("dataMinimum");+ if(Y_Lang.isNumber(this._setMinimum))+ {+ min = this._setMinimum;+ }+ return parseFloat(min);+ },+ setter: function(val)+ {+ this._setMinimum = parseFloat(val);+ return val;+ }+ },++ /**+ * Determines whether the maximum is calculated or explicitly + * set by the user.+ *+ * @attribute setMax+ * @type Boolean+ */+ setMax: {+ readOnly: true,++ getter: function()+ {+ return Y_Lang.isNumber(this._setMaximum);+ }+ },++ /**+ * Determines whether the minimum is calculated or explicitly+ * set by the user.+ *+ * @attribute setMin+ * @type Boolean+ */+ setMin: {+ readOnly: true,++ getter: function()+ {+ return Y_Lang.isNumber(this._setMinimum);+ }+ },++ /**+ * Array of axis data+ *+ * @attribute data+ * @type Array+ */+ data: {+ getter: function ()+ {+ if(!this._data || this._updateTotalDataFlag)+ {+ this._updateTotalData();+ }+ return this._data;+ }+ },++ /**+ * Array containing all the keys in the axis.+ + * @attribute keyCollection+ * @type Array+ */+ keyCollection: {+ getter: function()+ {+ var keys = this.get("keys"),+ i, + col = [];+ for(i in keys)+ {+ if(keys.hasOwnProperty(i))+ {+ col.push(i);+ }+ }+ return col;+ },+ readOnly: true+ }+ }+});+/**+ * NumericAxis manages numeric data on an axis.+ *+ * @module charts+ * @submodule charts-base+ * @class NumericAxis+ * @constructor+ * @param {Object} config (optional) Configuration parameters for the Chart.+ * @extends AxisType+ */+function NumericAxis(config)+{+ NumericAxis.superclass.constructor.apply(this, arguments);+}++NumericAxis.NAME = "numericAxis";++NumericAxis.ATTRS = {+ /**+ * Indicates whether 0 should always be displayed.+ *+ * @attribute alwaysShowZero+ * @type Boolean+ */+ alwaysShowZero: {+ value: true + },+ + /**+ * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need+ * to implement the arguments below and return a `String` or an `HTMLElement`. The default implementation of the method returns a `String`. The output of this method+ * will be rendered to the DOM using `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override the Axis' + * `appendLabelFunction` to accept html as a `String`.+ * <dl>+ * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>+ * <dt>format</dt><dd>Object containing properties used to format the label. (optional)</dd>+ * </dl>+ *+ * @attribute labelFunction+ * @type Function+ */+ labelFunction: { + value: function(val, format)+ {+ if(format)+ {+ return Y.DataType.Number.format(val, format);+ }+ return val;+ }+ },++ /**+ * Object containing properties used by the `labelFunction` to format a+ * label.+ *+ * @attribute labelFormat+ * @type Object+ */+ labelFormat: {+ value: {+ prefix: "",+ thousandsSeparator: "",+ decimalSeparator: "",+ decimalPlaces: "0",+ suffix: ""+ }+ }+};++Y.extend(NumericAxis, Y.AxisType,+{+ /**+ * Formats a label based on the axis type and optionally specified format.+ *+ * @method formatLabel+ * @param {Object} value+ * @param {Object} format Pattern used to format the value.+ * @return String+ */+ formatLabel: function(val, format)+ {+ if(format)+ {+ return Y.DataType.Number.format(val, format);+ }+ return val;+ },++ /**+ * Returns the sum of all values per key.+ *+ * @method getTotalByKey+ * @param {String} key The identifier for the array whose values will be calculated.+ * @return Number+ */+ getTotalByKey: function(key)+ {+ var total = 0,+ values = this.getDataByKey(key),+ i = 0,+ val,+ len = values ? values.length : 0;+ for(; i < len; ++i)+ {+ val = parseFloat(values[i]);+ if(!isNaN(val))+ {+ total += val;+ }+ }+ return total;+ },++ /**+ * Type of data used in `Axis`.+ *+ * @property _type+ * @readOnly+ * @private+ */+ _type: "numeric",++ /**+ * Helper method for getting a `roundingUnit` when calculating the minimum and maximum values.+ *+ * @method _getMinimumUnit+ * @param {Number} max Maximum number+ * @param {Number} min Minimum number+ * @param {Number} units Number of units on the axis+ * @return Number+ * @private+ */+ _getMinimumUnit:function(max, min, units)+ {+ return this._getNiceNumber(Math.ceil((max - min)/units));+ },++ /**+ * Calculates a nice rounding unit based on the range.+ *+ * @method _getNiceNumber+ * @param {Number} roundingUnit The calculated rounding unit.+ * @return Number+ * @private+ */+ _getNiceNumber: function(roundingUnit)+ {+ var tempMajorUnit = roundingUnit,+ order = Math.ceil(Math.log(tempMajorUnit) * 0.4342944819032518),+ roundedMajorUnit = Math.pow(10, order),+ roundedDiff;++ if (roundedMajorUnit / 2 >= tempMajorUnit) + {+ roundedDiff = Math.floor((roundedMajorUnit / 2 - tempMajorUnit) / (Math.pow(10,order-1)/2));+ tempMajorUnit = roundedMajorUnit/2 - roundedDiff*Math.pow(10,order-1)/2;+ }+ else + {+ tempMajorUnit = roundedMajorUnit;+ }+ if(!isNaN(tempMajorUnit))+ {+ return tempMajorUnit;+ }+ return roundingUnit;++ },++ /**+ * Calculates the maximum and minimum values for the `Axis`.+ *+ * @method _updateMinAndMax+ * @private + */+ _updateMinAndMax: function()+ {+ var data = this.get("data"),+ max, + min,+ len,+ num,+ i = 0,+ key,+ setMax = this.get("setMax"),+ setMin = this.get("setMin");+ if(!setMax || !setMin)+ {+ if(data && data.length && data.length > 0)+ {+ len = data.length;+ for(; i < len; i++)+ { + num = data[i];+ if(isNaN(num))+ {+ if(Y_Lang.isObject(num))+ {+ min = max = 0;+ //hloc values+ for(key in num)+ {+ if(num.hasOwnProperty(key))+ {+ max = Math.max(num[key], max);+ min = Math.min(num[key], min);+ }+ }+ }+ max = setMax ? this._setMaximum : max;+ min = setMin ? this._setMinimum : min;+ continue;+ }+ + if(setMin)+ {+ min = this._setMinimum;+ }+ else if(min === undefined)+ {+ min = num;+ }+ else+ {+ min = Math.min(num, min); + }+ if(setMax)+ {+ max = this._setMaximum;+ }+ else if(max === undefined)+ {+ max = num;+ }+ else+ {+ max = Math.max(num, max);+ }+ + this._actualMaximum = max;+ this._actualMinimum = min;+ }+ }+ this._roundMinAndMax(min, max, setMin, setMax);+ }+ },++ /**+ * Rounds the mimimum and maximum values based on the `roundingUnit` attribute.+ *+ * @method _roundMinAndMax+ * @param {Number} min Minimum value+ * @param {Number} max Maximum value+ * @private+ */+ _roundMinAndMax: function(min, max, setMin, setMax)+ {+ var roundingUnit,+ minimumRange,+ minGreaterThanZero = min >= 0,+ maxGreaterThanZero = max > 0,+ dataRangeGreater,+ maxRound,+ minRound,+ topTicks,+ botTicks,+ tempMax,+ tempMin,+ units = this.getTotalMajorUnits() - 1,+ alwaysShowZero = this.get("alwaysShowZero"),+ roundingMethod = this.get("roundingMethod"),+ useIntegers = (max - min)/units >= 1;+ if(roundingMethod)+ {+ if(roundingMethod == "niceNumber")+ {+ roundingUnit = this._getMinimumUnit(max, min, units);+ if(minGreaterThanZero && maxGreaterThanZero)+ {+ if((alwaysShowZero || min < roundingUnit) && !setMin)+ {+ min = 0;+ roundingUnit = this._getMinimumUnit(max, min, units);+ }+ else+ {+ min = this._roundDownToNearest(min, roundingUnit);+ }+ if(setMax)+ {+ if(!alwaysShowZero)+ {+ min = max - (roundingUnit * units);+ }+ }+ else if(setMin)+ {+ max = min + (roundingUnit * units);+ }+ else+ {+ max = this._roundUpToNearest(max, roundingUnit);+ }+ }+ else if(maxGreaterThanZero && !minGreaterThanZero)+ {+ if(alwaysShowZero)+ {+ topTicks = Math.round(units/((-1 * min)/max + 1));+ topTicks = Math.max(Math.min(topTicks, units - 1), 1);+ botTicks = units - topTicks;+ tempMax = Math.ceil( max/topTicks );+ tempMin = Math.floor( min/botTicks ) * -1;+ + if(setMin)+ {+ while(tempMin < tempMax && botTicks >= 0)+ {+ botTicks--;+ topTicks++;+ tempMax = Math.ceil( max/topTicks );+ tempMin = Math.floor( min/botTicks ) * -1;+ }+ //if there are any bottom ticks left calcualate the maximum by multiplying by the tempMin value+ //if not, it's impossible to ensure that a zero is shown. skip it+ if(botTicks > 0)+ {+ max = tempMin * topTicks;+ }+ else+ {+ max = min + (roundingUnit * units);+ }+ }+ else if(setMax)+ {+ while(tempMax < tempMin && topTicks >= 0)+ {+ botTicks++;+ topTicks--;+ tempMin = Math.floor( min/botTicks ) * -1;+ tempMax = Math.ceil( max/topTicks );+ }+ //if there are any top ticks left calcualate the minimum by multiplying by the tempMax value+ //if not, it's impossible to ensure that a zero is shown. skip it+ if(topTicks > 0)+ {+ min = tempMax * botTicks * -1;+ }+ else+ {+ min = max - (roundingUnit * units);+ }+ }+ else+ {+ roundingUnit = Math.max(tempMax, tempMin);+ roundingUnit = this._getNiceNumber(roundingUnit); + max = roundingUnit * topTicks;+ min = roundingUnit * botTicks * -1;+ }+ }+ else + {+ if(setMax)+ {+ min = max - (roundingUnit * units);+ }+ else if(setMin)+ {+ max = min + (roundingUnit * units);+ }+ else+ {+ min = this._roundDownToNearest(min, roundingUnit);+ max = this._roundUpToNearest(max, roundingUnit);+ }+ }+ }+ else+ {+ if(setMin)+ {+ if(alwaysShowZero)+ {+ max = 0;+ }+ else+ {+ max = min + (roundingUnit * units);+ }+ }+ else if(!setMax)+ {+ if(alwaysShowZero || max === 0 || max + roundingUnit > 0)+ {+ max = 0;+ roundingUnit = this._getMinimumUnit(max, min, units);+ min = max - (roundingUnit * units);+ }+ else+ {+ min = this._roundDownToNearest(min, roundingUnit);+ max = this._roundUpToNearest(max, roundingUnit);+ }+ }+ else+ {+ min = max - (roundingUnit * units);+ }+ }+ }+ else if(roundingMethod == "auto") + {+ if(minGreaterThanZero && maxGreaterThanZero)+ {+ if((alwaysShowZero || min < (max-min)/units) && !setMin)+ {+ min = 0;+ }+ + roundingUnit = (max - min)/units;+ if(useIntegers)+ {+ roundingUnit = Math.ceil(roundingUnit);+ }+ max = min + (roundingUnit * units);+ }+ else if(maxGreaterThanZero && !minGreaterThanZero)+ {+ if(alwaysShowZero)+ {+ topTicks = Math.round( units / ( (-1 * min) /max + 1) );+ topTicks = Math.max(Math.min(topTicks, units - 1), 1);+ botTicks = units - topTicks;++ if(useIntegers)+ {+ tempMax = Math.ceil( max/topTicks );+ tempMin = Math.floor( min/botTicks ) * -1;+ }+ else+ {+ tempMax = max/topTicks;+ tempMin = min/botTicks * -1;+ }+ roundingUnit = Math.max(tempMax, tempMin);+ max = roundingUnit * topTicks;+ min = roundingUnit * botTicks * -1;+ }+ else+ {+ roundingUnit = (max - min)/units;+ if(useIntegers)+ {+ roundingUnit = Math.ceil(roundingUnit);+ }+ min = this._roundDownToNearest(min, roundingUnit);+ max = this._roundUpToNearest(max, roundingUnit);+ }+ }+ else+ {+ roundingUnit = (max - min)/units;+ if(useIntegers)+ { + roundingUnit = Math.ceil(roundingUnit);+ }+ if(alwaysShowZero || max === 0 || max + roundingUnit > 0)+ {+ max = 0;+ roundingUnit = (max - min)/units;+ if(useIntegers)+ {+ Math.ceil(roundingUnit);+ }+ min = max - (roundingUnit * units);+ }+ else+ {+ min = this._roundDownToNearest(min, roundingUnit);+ max = this._roundUpToNearest(max, roundingUnit);+ }++ }+ }+ else if(!isNaN(roundingMethod) && isFinite(roundingMethod))+ {+ roundingUnit = roundingMethod;+ minimumRange = roundingUnit * units;+ dataRangeGreater = (max - min) > minimumRange;+ minRound = this._roundDownToNearest(min, roundingUnit);+ maxRound = this._roundUpToNearest(max, roundingUnit);+ if(setMax)+ {+ min = max - minimumRange;+ }+ else if(setMin)+ {+ max = min + minimumRange;+ }+ else if(minGreaterThanZero && maxGreaterThanZero)+ {+ if(alwaysShowZero || minRound <= 0)+ {+ min = 0;+ }+ else+ {+ min = minRound;+ }+ max = min + minimumRange;+ }+ else if(maxGreaterThanZero && !minGreaterThanZero)+ {+ min = minRound;+ max = maxRound;+ }+ else+ {+ if(alwaysShowZero || maxRound >= 0)+ {+ max = 0;+ }+ else+ {+ max = maxRound;+ }+ min = max - minimumRange;+ }+ }+ }+ this._dataMaximum = max;+ this._dataMinimum = min;+ },++ /**+ * Calculates and returns a value based on the number of labels and the index of+ * the current label.+ *+ * @method getLabelByIndex+ * @param {Number} i Index of the label.+ * @param {Number} l Total number of labels.+ * @return String+ */+ getLabelByIndex: function(i, l)+ {+ var min = this.get("minimum"),+ max = this.get("maximum"),+ increm = (max - min)/(l-1),+ label,+ roundingMethod = this.get("roundingMethod");+ l -= 1;+ //respect the min and max. calculate all other labels.+ if(i === 0)+ {+ label = min;+ }+ else if(i === l)+ {+ label = max;+ }+ else+ {+ label = (i * increm);+ if(roundingMethod == "niceNumber")+ {+ label = this._roundToNearest(label, increm);+ }+ label += min;+ }+ return parseFloat(label);+ },++ /**+ * Rounds a Number to the nearest multiple of an input. For example, by rounding+ * 16 to the nearest 10, you will receive 20. Similar to the built-in function Math.round().+ *+ * @method _roundToNearest+ * @param {Number} number Number to round+ * @param {Number} nearest Multiple to round towards.+ * @return Number+ * @private+ */+ _roundToNearest: function(number, nearest)+ {+ nearest = nearest || 1;+ if(nearest === 0)+ {+ return number;+ }+ var roundedNumber = Math.round(this._roundToPrecision(number / nearest, 10)) * nearest;+ return this._roundToPrecision(roundedNumber, 10);+ },+ + /**+ * Rounds a Number up to the nearest multiple of an input. For example, by rounding+ * 16 up to the nearest 10, you will receive 20. Similar to the built-in function Math.ceil().+ *+ * @method _roundUpToNearest+ * @param {Number} number Number to round+ * @param {Number} nearest Multiple to round towards.+ * @return Number+ * @private+ */+ _roundUpToNearest: function(number, nearest)+ {+ nearest = nearest || 1;+ if(nearest === 0)+ {+ return number;+ }+ return Math.ceil(this._roundToPrecision(number / nearest, 10)) * nearest;+ },+ + /**+ * Rounds a Number down to the nearest multiple of an input. For example, by rounding+ * 16 down to the nearest 10, you will receive 10. Similar to the built-in function Math.floor().+ *+ * @method _roundDownToNearest+ * @param {Number} number Number to round+ * @param {Number} nearest Multiple to round towards.+ * @return Number+ * @private+ */+ _roundDownToNearest: function(number, nearest)+ {+ nearest = nearest || 1;+ if(nearest === 0)+ {+ return number;+ }+ return Math.floor(this._roundToPrecision(number / nearest, 10)) * nearest;+ },++ /**+ * Rounds a number to a certain level of precision. Useful for limiting the number of+ * decimal places on a fractional number.+ *+ * @method _roundToPrecision+ * @param {Number} number Number to round+ * @param {Number} precision Multiple to round towards.+ * @return Number+ * @private+ */+ _roundToPrecision: function(number, precision)+ {+ precision = precision || 0;+ var decimalPlaces = Math.pow(10, precision);+ return Math.round(decimalPlaces * number) / decimalPlaces;+ },+ + /**+ * Checks to see if data extends beyond the range of the axis. If so,+ * that data will need to be hidden. This method is internal, temporary and subject+ * to removal in the future.+ *+ * @method _hasDataOverflow+ * @protected+ * @return Boolean+ */+ _hasDataOverflow: function()+ {+ var roundingMethod,+ min,+ max;+ if(this.get("setMin") || this.get("setMax"))+ {+ return true;+ }+ roundingMethod = this.get("roundingMethod");+ min = this._actualMinimum;+ max = this._actualMaximum;+ if(Y_Lang.isNumber(roundingMethod) && ((Y_Lang.isNumber(max) && max > this._dataMaximum) || (Y_Lang.isNumber(min) && min < this._dataMinimum)))+ {+ return true;+ }+ return false;+ }+});++Y.NumericAxis = NumericAxis;+ +/**+ * StackedAxis manages stacked numeric data on an axis.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedAxis+ * @constructor+ * @param {Object} config (optional) Configuration parameters for the Chart.+ * @extends NumericAxis+ */+function StackedAxis(config)+{+ StackedAxis.superclass.constructor.apply(this, arguments);+}++StackedAxis.NAME = "stackedAxis";+++Y.extend(StackedAxis, Y.NumericAxis,+{+ /**+ * Calculates the maximum and minimum values for the `Axis`.+ *+ * @method _updateMinAndMax+ * @private + */+ _updateMinAndMax: function()+ {+ var max = 0,+ min = 0,+ pos = 0,+ neg = 0,+ len = 0,+ i = 0,+ key,+ num,+ keys = this.get("keys"),+ setMin = this.get("setMin"),+ setMax = this.get("setMax");++ for(key in keys)+ {+ if(keys.hasOwnProperty(key))+ {+ len = Math.max(len, keys[key].length);+ }+ }+ for(; i < len; ++i)+ {+ pos = 0;+ neg = 0;+ for(key in keys)+ {+ if(keys.hasOwnProperty(key))+ {+ num = keys[key][i];+ if(isNaN(num))+ {+ continue;+ }+ if(num >= 0)+ {+ pos += num;+ }+ else+ {+ neg += num;+ }+ }+ }+ if(pos > 0)+ {+ max = Math.max(max, pos);+ }+ else + {+ max = Math.max(max, neg);+ }+ if(neg < 0)+ {+ min = Math.min(min, neg);+ }+ else+ {+ min = Math.min(min, pos);+ }+ }+ this._actualMaximum = max;+ this._actualMinimum = min;+ if(setMax)+ {+ max = this._setMaximum;+ }+ if(setMin)+ {+ min = this._setMinimum;+ }+ this._roundMinAndMax(min, max, setMin, setMax);+ }+});++Y.StackedAxis = StackedAxis;+ +/**+ * TimeAxis manages time data on an axis.+ *+ * @module charts+ * @submodule charts-base+ * @class TimeAxis+ * @constructor+ * @param {Object} config (optional) Configuration parameters for the Chart.+ * @extends AxisType+ */+function TimeAxis(config)+{+ TimeAxis.superclass.constructor.apply(this, arguments);+}++TimeAxis.NAME = "timeAxis";++TimeAxis.ATTRS = +{+ /**+ * Indicates whether the maximum is calculated or explicitly set. + *+ * @attribute setMax+ * @readOnly+ * @type Boolean+ * @private+ */+ setMax: {+ readOnly: true,++ getter: function()+ {+ var max = this._getNumber(this._setMaximum);+ return (Y_Lang.isNumber(max));+ }+ },++ /**+ * Indicates whether the minimum is calculated or explicitly set. + *+ * @attribute setMin+ * @readOnly+ * @type Boolean+ * @private+ */+ setMin: {+ readOnly: true,++ getter: function()+ {+ var min = this._getNumber(this._setMinimum);+ return (Y_Lang.isNumber(min));+ }+ },++ /**+ * The maximum value that will appear on an axis. Unless explicitly set, this value is calculated by the `Axis`.+ *+ * @attribute maximum+ * @type Number+ */+ maximum: {+ getter: function ()+ {+ var max = this._getNumber(this._setMaximum);+ if(!Y_Lang.isNumber(max))+ {+ max = this._getNumber(this.get("dataMaximum"));+ }+ return parseFloat(max);+ },+ setter: function (value)+ {+ this._setMaximum = this._getNumber(value);+ return value;+ }+ },++ /**+ * The minimum value that will appear on an axis. Unless explicitly set, this value is calculated by the `Axis`.+ *+ * @attribute minimum+ * @type Number+ */+ minimum: {+ getter: function ()+ {+ var min = this._getNumber(this._setMinimum);+ if(!Y_Lang.isNumber(min)) + {+ min = this._getNumber(this.get("dataMinimum"));+ }+ return parseFloat(min);+ },+ setter: function (value)+ {+ this._setMinimum = this._getNumber(value);+ return value;+ }+ },++ /**+ * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need+ * to implement the arguments below and return a `String` or an `HTMLElement`. The default implementation of the method returns a `String`. The output of this method+ * will be rendered to the DOM using `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override the Axis' + * `appendLabelFunction` to accept html as a `String`.+ * <dl>+ * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>+ * <dt>format</dt><dd>STRFTime string used to format the label. (optional)</dd>+ * </dl>+ *+ * @attribute labelFunction+ * @type Function+ */+ labelFunction: {+ value: function(val, format)+ {+ val = Y.DataType.Date.parse(val);+ if(format)+ {+ return Y.DataType.Date.format(val, {format:format});+ }+ return val;+ }+ },++ /**+ * Pattern used by the `labelFunction` to format a label.+ *+ * @attribute labelFormat+ * @type String+ */+ labelFormat: {+ value: "%b %d, %y"+ }+};++Y.extend(TimeAxis, Y.AxisType, {+ /**+ * Formats a label based on the axis type and optionally specified format.+ *+ * @method formatLabel+ * @param {Object} value+ * @param {Object} format Pattern used to format the value.+ * @return String+ */+ formatLabel: function(val, format)+ {+ val = Y.DataType.Date.parse(val);+ if(format)+ {+ return Y.DataType.Date.format(val, {format:format});+ }+ return val;+ },++ /**+ * Constant used to generate unique id.+ *+ * @property GUID+ * @type String+ * @private+ */+ GUID: "yuitimeaxis",+ + /**+ * Type of data used in `Axis`.+ *+ * @property _dataType+ * @readOnly+ * @private+ */+ _dataType: "time",+ + /**+ * Calculates and returns a value based on the number of labels and the index of+ * the current label.+ *+ * @method getLabelByIndex+ * @param {Number} i Index of the label.+ * @param {Number} l Total number of labels.+ * @return String+ */+ getLabelByIndex: function(i, l)+ {+ var min = this.get("minimum"),+ max = this.get("maximum"),+ position = this.get("position"),+ increm,+ label;+ l -= 1;+ increm = ((max - min)/l) * i;+ if(position == "bottom" || position == "top")+ {+ label = min + increm;+ }+ else+ {+ label = max - increm;+ }+ return label;+ },++ /**+ * Gets an array of values based on a key.+ *+ * @method _getKeyArray+ * @param {String} key Value key associated with the data array.+ * @param {Array} data Array in which the data resides.+ * @return Array+ * @private+ */+ _getKeyArray: function(key, data)+ {+ var obj,+ keyArray = [],+ i = 0,+ val,+ len = data.length;+ for(; i < len; ++i)+ {+ obj = data[i][key];+ if(Y_Lang.isDate(obj))+ { + val = obj.valueOf();+ }+ else+ {+ val = new Date(obj);+ if(Y_Lang.isDate(val))+ {+ val = val.valueOf();+ }+ else if(!Y_Lang.isNumber(obj))+ {+ if(Y_Lang.isNumber(parseFloat(obj)))+ {+ val = parseFloat(obj);+ }+ else+ {+ if(typeof obj != "string")+ {+ obj = obj;+ }+ val = new Date(obj).valueOf();+ }+ }+ else+ {+ val = obj;+ }+ }+ keyArray[i] = val;+ }+ return keyArray;+ },++ /**+ * Sets data by key+ *+ * @method _setDataByKey+ * @param {String} key Key value to use.+ * @param {Array} data Array to use.+ * @private + */+ _setDataByKey: function(key, data)+ {+ var obj, + arr = [], + dv = this._dataClone.concat(), + i, + val,+ len = dv.length;+ for(i = 0; i < len; ++i)+ {+ obj = dv[i][key];+ if(Y_Lang.isDate(obj))+ { + val = obj.valueOf();+ }+ else+ {+ val = new Date(obj);+ if(Y_Lang.isDate(val))+ {+ val = val.valueOf();+ }+ else if(!Y_Lang.isNumber(obj))+ {+ if(Y_Lang.isNumber(parseFloat(obj)))+ {+ val = parseFloat(obj);+ }+ else+ {+ if(typeof obj != "string")+ {+ obj = obj.toString();+ }+ val = new Date(obj).valueOf();+ }+ }+ else+ {+ val = obj;+ }+ }+ arr[i] = val;+ }+ this.get("keys")[key] = arr;+ this._updateTotalDataFlag = true;+ },++ /**+ * Parses value into a number.+ *+ * @method _getNumber+ * @param val {Object} Value to parse into a number+ * @return Number+ * @private+ */+ _getNumber: function(val)+ {+ if(Y_Lang.isDate(val))+ {+ val = val.valueOf();+ }+ else if(!Y_Lang.isNumber(val) && val)+ {+ val = new Date(val).valueOf();+ }++ return val;+ }+});++Y.TimeAxis = TimeAxis;+ +/**+ * CategoryAxis manages category data on an axis.+ *+ * @module charts+ * @submodule charts-base+ * @class CategoryAxis+ * @constructor+ * @param {Object} config (optional) Configuration parameters for the Chart.+ * @extends AxisType+ */+function CategoryAxis(config)+{+ CategoryAxis.superclass.constructor.apply(this, arguments);+}++CategoryAxis.NAME = "categoryAxis";++Y.extend(CategoryAxis, Y.AxisType,+{+ /**+ * Formats a label based on the axis type and optionally specified format.+ *+ * @method formatLabel+ * @param {Object} value+ * @param {Object} format Pattern used to format the value.+ * @return String+ */+ formatLabel: function(val, format)+ {+ return val;+ },++ /**+ * Object storing key data.+ *+ * @property _indices+ * @private+ */+ _indices: null,++ /**+ * Constant used to generate unique id.+ *+ * @property GUID+ * @type String+ * @private+ */+ GUID: "yuicategoryaxis",++ /**+ * Type of data used in `Axis`.+ *+ * @property _dataType+ * @readOnly+ * @private+ */+ _type: "category",+ + /**+ * Calculates the maximum and minimum values for the `Axis`.+ *+ * @method _updateMinAndMax+ * @private + */+ _updateMinAndMax: function()+ {+ this._dataMaximum = Math.max(this.get("data").length - 1, 0);+ this._dataMinimum = 0;+ },++ /**+ * Gets an array of values based on a key.+ *+ * @method _getKeyArray+ * @param {String} key Value key associated with the data array.+ * @param {Array} data Array in which the data resides.+ * @return Array+ * @private+ */+ _getKeyArray: function(key, data)+ {+ var i = 0,+ obj,+ keyArr = [],+ labels = [],+ len = data.length;+ if(!this._indices)+ {+ this._indices = {};+ }+ for(; i < len; ++i)+ {+ obj = data[i];+ keyArr[i] = i;+ labels[i] = obj[key];+ }+ this._indices[key] = keyArr;+ return labels;+ },++ /**+ * Sets data by key+ *+ * @method _setDataByKey+ * @param {String} key Key value to use.+ * @param {Array} data Array to use.+ * @private + */+ _setDataByKey: function(key)+ {+ var i,+ obj, + arr = [], + labels = [], + dv = this._dataClone.concat(), + len = dv.length;+ if(!this._indices)+ {+ this._indices = {};+ }+ for(i = 0; i < len; ++i)+ {+ obj = dv[i];+ arr[i] = i;+ labels[i] = obj[key];+ }+ this._indices[key] = arr;+ this.get("keys")[key] = labels.concat();+ this._updateTotalDataFlag = true;+ },++ /**+ * Returns an array of values based on an identifier key.+ *+ * @method getDataByKey+ * @param {String} value value used to identify the array+ * @return Array+ */+ getDataByKey: function (value)+ {+ if(!this._indices)+ {+ this.get("keys");+ }+ var keys = this._indices;+ if(keys[value])+ {+ return keys[value];+ }+ return null;+ },++ /**+ * Returns the total number of majorUnits that will appear on an axis.+ *+ * @method getTotalMajorUnits+ * @param {Object} majorUnit Object containing properties related to the majorUnit.+ * @param {Number} len Length of the axis.+ * @return Number+ */+ getTotalMajorUnits: function(majorUnit, len)+ {+ return this.get("data").length;+ },+ + /**+ * Returns the distance between major units on an axis.+ *+ * @method getMajorUnitDistance+ * @param {Number} len Number of ticks+ * @param {Number} uiLen Size of the axis.+ * @param {Object} majorUnit Hash of properties used to determine the majorUnit+ * @return Number+ */+ getMajorUnitDistance: function(len, uiLen, majorUnit)+ {+ var dist;+ if(majorUnit.determinant === "count")+ {+ dist = uiLen/len;+ }+ else if(majorUnit.determinant === "distance")+ {+ dist = majorUnit.distance;+ }+ return dist;+ },+ + /**+ * Gets the distance that the first and last ticks are offset from there respective+ * edges.+ *+ * @method getEdgeOffset+ * @param {Number} ct Number of ticks on the axis.+ * @param {Number} l Length (in pixels) of the axis.+ * @return Number+ */+ getEdgeOffset: function(ct, l)+ {+ return l/ct;+ },++ /**+ * Returns a value based of a key value and an index.+ *+ * @method getKeyValueAt+ * @param {String} key value used to look up the correct array+ * @param {Number} index within the array+ * @return String + */+ getKeyValueAt: function(key, index)+ {+ var value = NaN,+ keys = this.get("keys");+ if(keys[key] && keys[key][index]) + {+ value = keys[key][index];+ }+ return value;+ },+ + /**+ * Calculates and returns a value based on the number of labels and the index of+ * the current label.+ *+ * @method getLabelByIndex+ * @param {Number} i Index of the label.+ * @param {Number} l Total number of labels.+ * @return String+ */+ getLabelByIndex: function(i, l)+ {+ var label,+ data = this.get("data"),+ position = this.get("position");+ if(position == "bottom" || position == "top")+ {+ label = data[i];+ }+ else+ {+ label = data[l - (i + 1)];+ } + return label;+ },++ /**+ * Returns a string corresponding to the first label on an + * axis.+ *+ * @method getMinimumValue+ * @return String+ */+ getMinimumValue: function()+ {+ var data = this.get("data"),+ label = data[0];+ return label;+ },++ /**+ * Returns a string corresponding to the last label on an + * axis.+ *+ * @method getMaximumValue+ * @return String+ */+ getMaximumValue: function()+ {+ var data = this.get("data"),+ len = data.length - 1,+ label = data[len];+ return label;+ }+});++Y.CategoryAxis = CategoryAxis;+ +/**+ * Utility class used for calculating curve points.+ *+ * @module charts+ * @submodule charts-base+ * @class CurveUtil+ * @constructor+ */+function CurveUtil()+{+}++CurveUtil.prototype = {+ /**+ * Creates an array of start, end and control points for splines.+ *+ * @method getCurveControlPoints+ * @param {Array} xcoords Collection of x-coordinates used for calculate the curves+ * @param {Array} ycoords Collection of y-coordinates used for calculate the curves+ * @return Object+ * @protected+ */+ getCurveControlPoints: function(xcoords, ycoords) + {+ var outpoints = [],+ i = 1,+ l = xcoords.length - 1,+ xvals = [],+ yvals = [];+ + + // Too few points, need at least two+ if (l < 1) + {+ return null;+ } + + outpoints[0] = {+ startx: xcoords[0], + starty: ycoords[0],+ endx: xcoords[1],+ endy: ycoords[1]+ };+ + // Special case, the Bezier should be a straight line+ if (l === 1) + {+ outpoints[0].ctrlx1 = (2.0*xcoords[0] + xcoords[1])/3.0; + outpoints[0].ctrly2 = (2.0*ycoords[0] + ycoords[1])/3.0;+ outpoints[0].ctrlx2 = 2.0*outpoints[0].ctrlx1 - xcoords[0];+ outpoints[0].ctrly2 = 2.0*outpoints[0].ctrly1 - ycoords[0];+ return outpoints;+ }++ for (; i < l; ++i) + {+ outpoints.push({startx: Math.round(xcoords[i]), starty: Math.round(ycoords[i]), endx: Math.round(xcoords[i+1]), endy: Math.round(ycoords[i+1])});+ xvals[i] = 4.0 * xcoords[i] + 2*xcoords[i+1];+ yvals[i] = 4.0*ycoords[i] + 2*ycoords[i+1];+ }+ + xvals[0] = xcoords[0] + (2.0 * xcoords[1]);+ xvals[l-1] = (8.0 * xcoords[l-1] + xcoords[l]) / 2.0;+ xvals = this.getControlPoints(xvals.concat());+ yvals[0] = ycoords[0] + (2.0 * ycoords[1]);+ yvals[l-1] = (8.0 * ycoords[l-1] + ycoords[l]) / 2.0; + yvals = this.getControlPoints(yvals.concat());+ + for (i = 0; i < l; ++i) + {+ outpoints[i].ctrlx1 = Math.round(xvals[i]);+ outpoints[i].ctrly1 = Math.round(yvals[i]);+ + if (i < l-1) + {+ outpoints[i].ctrlx2 = Math.round(2*xcoords[i+1] - xvals[i+1]);+ outpoints[i].ctrly2 = Math.round(2*ycoords[i+1] - yvals[i+1]);+ }+ else + {+ outpoints[i].ctrlx2 = Math.round((xcoords[l] + xvals[l-1])/2);+ outpoints[i].ctrly2 = Math.round((ycoords[l] + yvals[l-1])/2);+ }+ }+ + return outpoints; + },++ /**+ * Gets the control points for the curve.+ *+ * @method getControlPoints+ * @param {Array} vals Collection of values coords used to generate control points.+ * @return Array+ * @private+ */+ getControlPoints: function(vals) + {+ var l = vals.length,+ x = [],+ tmp = [],+ b = 2.0,+ i = 1;+ x[0] = vals[0] / b;+ for (; i < l; ++i) + {+ tmp[i] = 1/b;+ b = (i < l-1 ? 4.0 : 3.5) - tmp[i];+ x[i] = (vals[i] - x[i-1]) / b;+ }+ + for (i = 1; i < l; ++i) + {+ x[l-i-1] -= tmp[l-i] * x[l-i];+ }+ + return x;+ }+};+Y.CurveUtil = CurveUtil;+/**+ * Utility class used for creating stacked series.+ *+ * @module charts+ * @submodule charts-base+ * @class StackingUtil+ * @constructor+ */+function StackingUtil(){}++StackingUtil.prototype = {+ /**+ * Indicates whether the series is stacked.+ *+ * @property _stacked+ * @private+ */+ _stacked: true,++ /**+ * @protected+ *+ * Adjusts coordinate values for stacked series.+ *+ * @method _stackCoordinates+ */+ _stackCoordinates: function() + {+ if(this.get("direction") == "vertical")+ {+ this._stackXCoords();+ }+ else+ {+ this._stackYCoords();+ }+ },++ /**+ * Stacks coordinates for a stacked vertical series.+ *+ * @method _stackXCoords+ * @protected+ */+ _stackXCoords: function()+ {+ var order = this.get("order"),+ type = this.get("type"),+ graph = this.get("graph"),+ seriesCollection = graph.seriesTypes[type],+ i = 0,+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ len,+ coord,+ prevCoord,+ prevOrder,+ stackedXCoords = xcoords.concat(),+ prevXCoords,+ prevYCoords,+ nullIndices = [],+ nullIndex;+ if(order > 0)+ {+ prevXCoords = seriesCollection[order - 1].get("stackedXCoords");+ prevYCoords = seriesCollection[order - 1].get("stackedYCoords");+ len = prevXCoords.length;+ }+ else+ {+ len = xcoords.length;+ }+ for(; i < len; i = i + 1)+ {+ if(Y_Lang.isNumber(xcoords[i]))+ {+ if(order > 0)+ {+ prevCoord = prevXCoords[i];+ if(!Y_Lang.isNumber(prevCoord))+ {+ prevOrder = order;+ while(prevOrder > - 1 && !Y_Lang.isNumber(prevCoord))+ {+ prevOrder = prevOrder - 1;+ if(prevOrder > -1)+ {+ prevCoord = seriesCollection[prevOrder].get("stackedXCoords")[i];+ }+ else+ {+ prevCoord = this._leftOrigin;+ }+ }+ }+ xcoords[i] = xcoords[i] + prevCoord;+ }+ stackedXCoords[i] = xcoords[i];+ }+ else+ {+ nullIndices.push(i);+ }+ }+ this._cleanXNaN(stackedXCoords, ycoords);+ len = nullIndices.length;+ if(len > 0)+ {+ for(i = 0; i < len; i = i + 1)+ {+ nullIndex = nullIndices[i];+ coord = order > 0 ? prevXCoords[nullIndex] : this._leftOrigin;+ stackedXCoords[nullIndex] = Math.max(stackedXCoords[nullIndex], coord);+ }+ }+ this.set("stackedXCoords", stackedXCoords);+ this.set("stackedYCoords", ycoords);+ },++ /**+ * Stacks coordinates for a stacked horizontal series.+ *+ * @method _stackYCoords+ * @protected+ */+ _stackYCoords: function()+ {+ var order = this.get("order"),+ type = this.get("type"),+ graph = this.get("graph"),+ h = graph.get("height"), + seriesCollection = graph.seriesTypes[type],+ i = 0,+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ len,+ coord,+ prevCoord,+ prevOrder,+ stackedYCoords = ycoords.concat(),+ prevXCoords,+ prevYCoords,+ nullIndices = [],+ nullIndex;+ if(order > 0)+ {+ prevXCoords = seriesCollection[order - 1].get("stackedXCoords");+ prevYCoords = seriesCollection[order - 1].get("stackedYCoords");+ len = prevYCoords.length;+ }+ else+ {+ len = ycoords.length;+ }+ for(; i < len; i = i + 1)+ {+ if(Y_Lang.isNumber(ycoords[i]))+ {+ if(order > 0)+ {+ prevCoord = prevYCoords[i];+ if(!Y_Lang.isNumber(prevCoord))+ {+ prevOrder = order;+ while(prevOrder > - 1 && !Y_Lang.isNumber(prevCoord))+ {+ prevOrder = prevOrder - 1;+ if(prevOrder > -1)+ {+ prevCoord = seriesCollection[prevOrder].get("stackedYCoords")[i];+ }+ else+ {+ prevCoord = this._bottomOrigin;+ }+ }+ }+ ycoords[i] = prevCoord - (h - ycoords[i]);+ }+ stackedYCoords[i] = ycoords[i];+ }+ else+ {+ nullIndices.push(i);+ }+ }+ this._cleanYNaN(xcoords, stackedYCoords);+ len = nullIndices.length;+ if(len > 0)+ {+ for(i = 0; i < len; i = i + 1)+ {+ nullIndex = nullIndices[i];+ coord = order > 0 ? prevYCoords[nullIndex] : h;+ stackedYCoords[nullIndex] = Math.min(stackedYCoords[nullIndex], coord);+ }+ }+ this.set("stackedXCoords", xcoords);+ this.set("stackedYCoords", stackedYCoords);+ },++ /**+ * Cleans invalid x-coordinates by calculating their value based on the corresponding y-coordinate, the previous valid x-coordinate with its + * corresponding y-coordinate and the next valid x-coordinate with its corresponding y-coordinate. If there is no previous or next valid x-coordinate,+ * the value will not be altered.+ *+ * @method _cleanXNaN+ * @param {Array} xcoords An array of x-coordinate values+ * @param {Array} ycoords An arry of y-coordinate values+ * @private+ */+ _cleanXNaN: function(xcoords, ycoords)+ {+ var previousValidIndex,+ nextValidIndex,+ previousValidX,+ previousValidY,+ x,+ y,+ nextValidX,+ nextValidY,+ isNumber = Y_Lang.isNumber,+ m,+ i = 0,+ len = ycoords.length;+ for(; i < len; ++i)+ {+ x = xcoords[i];+ y = ycoords[i];+ //if x is invalid, calculate where it should be+ if(!isNumber(x) && i > 0 && i < len - 1)+ {+ previousValidY = ycoords[i - 1];+ //check to see if the previous value is valid+ previousValidX = this._getPreviousValidCoordValue(xcoords, i);+ nextValidY = ycoords[i + 1];+ nextValidX = this._getNextValidCoordValue(xcoords, i);+ //check to see if the next value is valid+ if(isNumber(previousValidX) && isNumber(nextValidX))+ {+ //calculate slope and solve for x+ m = (nextValidY - previousValidY) / (nextValidX - previousValidX);+ xcoords[i] = (y + (m * previousValidX) - previousValidY)/m;+ }+ previousValidIndex = NaN;+ nextValidIndex = NaN;+ }+ }+ },++ /**+ * Returns the previous valid (numeric) value in an array if available.+ *+ * @method _getPreviousValidCoordValue+ * @param {Array} coords Array of values+ * @param {Number} index The index in the array in which to begin searching.+ * @return Number+ * @private+ */+ _getPreviousValidCoordValue: function(coords, index)+ {+ var coord,+ isNumber = Y_Lang.isNumber,+ limit = -1;+ while(!isNumber(coord) && index > limit)+ {+ index = index - 1;+ coord = coords[index];+ }+ return coord;+ },++ /**+ * Returns the next valid (numeric) value in an array if available.+ *+ * @method _getNextValidCoordValue+ * @param {Array} coords Array of values+ * @param {Number} index The index in the array in which to begin searching.+ * @return Number+ * @private+ */+ _getNextValidCoordValue: function(coords, index)+ {+ var coord,+ isNumber = Y_Lang.isNumber,+ limit = coords.length;+ while(!isNumber(coord) && index < limit)+ {+ index = index + 1;+ coord = coords[index];+ }+ return coord;+ },++ /**+ * Cleans invalid y-coordinates by calculating their value based on the corresponding x-coordinate, the previous valid y-coordinate with its + * corresponding x-coordinate and the next valid y-coordinate with its corresponding x-coordinate. If there is no previous or next valid y-coordinate,+ * the value will not be altered.+ *+ * @method _cleanYNaN+ * @param {Array} xcoords An array of x-coordinate values+ * @param {Array} ycoords An arry of y-coordinate values+ * @private+ */+ _cleanYNaN: function(xcoords, ycoords)+ {+ var previousValidIndex,+ nextValidIndex,+ previousValidX,+ previousValidY,+ x,+ y,+ nextValidX,+ nextValidY,+ isNumber = Y_Lang.isNumber,+ m,+ i = 0,+ len = xcoords.length;+ for(; i < len; ++i)+ {+ x = xcoords[i];+ y = ycoords[i];+ //if y is invalid, calculate where it should be+ if(!isNumber(y) && i > 0 && i < len - 1)+ {+ //check to see if the previous value is valid+ previousValidX = xcoords[i - 1];+ previousValidY = this._getPreviousValidCoordValue(ycoords, i);+ //check to see if the next value is valid+ nextValidX = xcoords[i + 1];+ nextValidY = this._getNextValidCoordValue(ycoords, i);+ if(isNumber(previousValidY) && isNumber(nextValidY))+ {+ //calculate slope and solve for y+ m = (nextValidY - previousValidY) / (nextValidX - previousValidX);+ ycoords[i] = previousValidY + ((m * x) - (m * previousValidX));+ }+ previousValidIndex = NaN;+ nextValidIndex = NaN;+ }+ }+ }+};+Y.StackingUtil = StackingUtil;+/**+ * Utility class used for drawing lines.+ *+ * @module charts+ * @submodule charts-base+ * @class Lines+ * @constructor+ */+function Lines(){}++Lines.prototype = {+ /**+ * @property _lineDefaults+ * @type Object+ * @private+ */+ _lineDefaults: null,+ + /**+ * Creates a graphic in which to draw a series.+ *+ * @method _getGraphic+ * @return Graphic+ * @private+ */+ _getGraphic: function()+ {+ var graphic = this.get("graphic") || this.get("graph").get("graphic");+ if(!this._lineGraphic)+ {+ this._lineGraphic = graphic.addShape({type: "path"});+ }+ this._lineGraphic.clear();+ return this._lineGraphic;+ },+ + /**+ * Toggles visibility+ *+ * @method _toggleVisible+ * @param {Boolean} visible indicates visibilitye+ * @private+ */+ _toggleVisible: function(visible)+ {+ if(this._lineGraphic)+ {+ this._lineGraphic.set("visible", visible);+ }+ },++ /**+ * Draws lines for the series.+ *+ * @method drawLines+ * @protected+ */+ drawLines: function()+ {+ if(this.get("xcoords").length < 1) + {+ return;+ }+ var isNumber = Y_Lang.isNumber,+ xcoords,+ ycoords,+ direction = this.get("direction"),+ len,+ lastPointValid,+ pointValid,+ noPointsRendered = true,+ lastValidX,+ lastValidY,+ nextX,+ nextY,+ i,+ styles = this.get("styles").line,+ lineType = styles.lineType,+ lc = styles.color || this._getDefaultColor(this.get("graphOrder"), "line"),+ lineAlpha = styles.alpha,+ dashLength = styles.dashLength,+ gapSpace = styles.gapSpace,+ connectDiscontinuousPoints = styles.connectDiscontinuousPoints,+ discontinuousType = styles.discontinuousType,+ discontinuousDashLength = styles.discontinuousDashLength,+ discontinuousGapSpace = styles.discontinuousGapSpace,+ path = this._getGraphic();+ if(this._stacked)+ {+ xcoords = this.get("stackedXCoords");+ ycoords = this.get("stackedYCoords");+ }+ else+ {+ xcoords = this.get("xcoords");+ ycoords = this.get("ycoords");+ }+ len = direction === "vertical" ? ycoords.length : xcoords.length;+ path.set("stroke", {+ weight: styles.weight, + color: lc, + opacity: lineAlpha+ });+ for(i = 0; i < len; i = ++i)+ {+ nextX = xcoords[i];+ nextY = ycoords[i];+ pointValid = isNumber(nextX) && isNumber(nextY); + if(!pointValid)+ {+ lastPointValid = pointValid;+ continue;+ }+ if(noPointsRendered)+ {+ noPointsRendered = false;+ path.moveTo(nextX, nextY);+ }+ else if(lastPointValid)+ {+ if(lineType != "dashed")+ {+ path.lineTo(nextX, nextY);+ }+ else+ {+ this.drawDashedLine(path, lastValidX, lastValidY, nextX, nextY, + dashLength, + gapSpace);+ }+ }+ else if(!connectDiscontinuousPoints)+ {+ path.moveTo(nextX, nextY);+ }+ else+ {+ if(discontinuousType != "solid")+ {+ this.drawDashedLine(path, lastValidX, lastValidY, nextX, nextY, + discontinuousDashLength, + discontinuousGapSpace);+ }+ else+ {+ path.lineTo(nextX, nextY);+ }+ }+ lastValidX = nextX;+ lastValidY = nextY;+ lastPointValid = true;+ }+ path.end();+ },+ + /**+ * Connects data points with a consistent curve for a series.+ * + * @method drawSpline+ * @protected+ */+ drawSpline: function()+ {+ if(this.get("xcoords").length < 1) + {+ return;+ }+ var xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ curvecoords = this.getCurveControlPoints(xcoords, ycoords),+ len = curvecoords.length,+ cx1,+ cx2,+ cy1,+ cy2,+ x,+ y,+ i = 0,+ styles = this.get("styles").line,+ path = this._getGraphic(),+ lineAlpha = styles.alpha,+ color = styles.color || this._getDefaultColor(this.get("graphOrder"), "line");+ path.set("stroke", { + weight: styles.weight, + color: color, + opacity: lineAlpha+ });+ path.moveTo(xcoords[0], ycoords[0]);+ for(; i < len; i = ++i)+ {+ x = curvecoords[i].endx;+ y = curvecoords[i].endy;+ cx1 = curvecoords[i].ctrlx1;+ cx2 = curvecoords[i].ctrlx2;+ cy1 = curvecoords[i].ctrly1;+ cy2 = curvecoords[i].ctrly2;+ path.curveTo(cx1, cy1, cx2, cy2, x, y);+ }+ path.end();+ },++ /**+ * Draws a dashed line between two points.+ * + * @method drawDashedLine+ * @param {Number} xStart The x position of the start of the line+ * @param {Number} yStart The y position of the start of the line+ * @param {Number} xEnd The x position of the end of the line+ * @param {Number} yEnd The y position of the end of the line+ * @param {Number} dashSize the size of dashes, in pixels+ * @param {Number} gapSize the size of gaps between dashes, in pixels+ * @private+ */+ drawDashedLine: function(path, xStart, yStart, xEnd, yEnd, dashSize, gapSize)+ {+ dashSize = dashSize || 10;+ gapSize = gapSize || 10;+ var segmentLength = dashSize + gapSize,+ xDelta = xEnd - xStart,+ yDelta = yEnd - yStart,+ delta = Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2)),+ segmentCount = Math.floor(Math.abs(delta / segmentLength)),+ radians = Math.atan2(yDelta, xDelta),+ xCurrent = xStart,+ yCurrent = yStart,+ i;+ xDelta = Math.cos(radians) * segmentLength;+ yDelta = Math.sin(radians) * segmentLength;+ + for(i = 0; i < segmentCount; ++i)+ {+ path.moveTo(xCurrent, yCurrent);+ path.lineTo(xCurrent + Math.cos(radians) * dashSize, yCurrent + Math.sin(radians) * dashSize);+ xCurrent += xDelta;+ yCurrent += yDelta;+ }+ + path.moveTo(xCurrent, yCurrent);+ delta = Math.sqrt((xEnd - xCurrent) * (xEnd - xCurrent) + (yEnd - yCurrent) * (yEnd - yCurrent));+ + if(delta > dashSize)+ {+ path.lineTo(xCurrent + Math.cos(radians) * dashSize, yCurrent + Math.sin(radians) * dashSize);+ }+ else if(delta > 0)+ {+ path.lineTo(xCurrent + Math.cos(radians) * delta, yCurrent + Math.sin(radians) * delta);+ }+ + path.moveTo(xEnd, yEnd);+ },++ /**+ * Default values for `styles` attribute.+ *+ * @method _getLineDefaults+ * @return Object+ * @protected+ */+ _getLineDefaults: function()+ {+ return {+ alpha: 1,+ weight: 6,+ lineType:"solid", + dashLength:10, + gapSpace:10, + connectDiscontinuousPoints:true, + discontinuousType:"solid", + discontinuousDashLength:10, + discontinuousGapSpace:10+ };+ }+};+Y.augment(Lines, Y.Attribute);+Y.Lines = Lines;+/**+ * Utility class used for drawing area fills.+ *+ * @module charts+ * @class Fills+ * @constructor+ */+function Fills(cfg)+{+ var attrs = {+ area: {+ getter: function()+ {+ return this._defaults || this._getAreaDefaults();+ },++ setter: function(val)+ {+ var defaults = this._defaults || this._getAreaDefaults();+ this._defaults = Y.merge(defaults, val);+ }+ }+ };+ this.addAttrs(attrs, cfg);+ this.get("styles");+}++Fills.prototype = {+ /**+ * Returns a path shape used for drawing fills.+ *+ * @method _getPath+ * @return Path+ * @private+ */+ _getPath: function()+ {+ var path = this._path;+ if(!path)+ {+ path = this.get("graph").get("graphic").addShape({type:"path"});+ this._path = path;+ }+ return path;+ },+ + /**+ * Toggles visibility+ *+ * @method _toggleVisible+ * @param {Boolean} visible indicates visibilitye+ * @private+ */+ _toggleVisible: function(visible)+ { + if(this._path)+ {+ this._path.set("visible", visible);+ }+ },++ /**+ * Draws fill+ *+ * @method drawFill+ * @param {Array} xcoords The x-coordinates for the series.+ * @param {Array} ycoords The y-coordinates for the series.+ * @protected+ */+ drawFill: function(xcoords, ycoords)+ {+ if(xcoords.length < 1) + {+ return;+ }+ var isNumber = Y_Lang.isNumber,+ len = xcoords.length,+ firstX = xcoords[0],+ firstY = ycoords[0],+ lastValidX = firstX,+ lastValidY = firstY,+ nextX,+ nextY,+ pointValid,+ noPointsRendered = true,+ i = 0,+ styles = this.get("styles").area,+ path = this._getPath(),+ color = styles.color || this._getDefaultColor(this.get("graphOrder"), "slice");+ path.clear();+ path.set("fill", {+ color: color, + opacity: styles.alpha+ });+ path.set("stroke", {weight: 0});+ for(; i < len; i = ++i)+ {+ nextX = xcoords[i];+ nextY = ycoords[i];+ pointValid = isNumber(nextX) && isNumber(nextY); + if(!pointValid)+ {+ continue;+ }+ if(noPointsRendered)+ {+ this._firstValidX = nextX;+ this._firstValidY = nextY;+ noPointsRendered = false;+ path.moveTo(nextX, nextY);+ }+ else+ {+ path.lineTo(nextX, nextY);+ }+ lastValidX = nextX;+ lastValidY = nextY;+ }+ this._lastValidX = lastValidX;+ this._lastValidY = lastValidY;+ path.end();+ },+ + /**+ * Draws a fill for a spline+ *+ * @method drawAreaSpline+ * @protected+ */+ drawAreaSpline: function()+ {+ if(this.get("xcoords").length < 1) + {+ return;+ }+ var xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ curvecoords = this.getCurveControlPoints(xcoords, ycoords),+ len = curvecoords.length,+ cx1,+ cx2,+ cy1,+ cy2,+ x,+ y,+ i = 0,+ firstX = xcoords[0],+ firstY = ycoords[0],+ styles = this.get("styles").area,+ path = this._getPath(),+ color = styles.color || this._getDefaultColor(this.get("graphOrder"), "slice");+ path.set("fill", {+ color: color, + opacity: styles.alpha+ });+ path.set("stroke", {weight: 0});+ path.moveTo(firstX, firstY);+ for(; i < len; i = ++i)+ {+ x = curvecoords[i].endx;+ y = curvecoords[i].endy;+ cx1 = curvecoords[i].ctrlx1;+ cx2 = curvecoords[i].ctrlx2;+ cy1 = curvecoords[i].ctrly1;+ cy2 = curvecoords[i].ctrly2;+ path.curveTo(cx1, cy1, cx2, cy2, x, y);+ }+ if(this.get("direction") === "vertical")+ {+ path.lineTo(this._leftOrigin, y);+ path.lineTo(this._leftOrigin, firstY);+ }+ else+ {+ path.lineTo(x, this._bottomOrigin);+ path.lineTo(firstX, this._bottomOrigin);+ }+ path.lineTo(firstX, firstY);+ path.end();+ },+ + /**+ * Draws a a stacked area spline+ *+ * @method drawStackedAreaSpline+ * @protected+ */+ drawStackedAreaSpline: function()+ {+ if(this.get("xcoords").length < 1) + {+ return;+ }+ var xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ curvecoords,+ order = this.get("order"),+ type = this.get("type"),+ graph = this.get("graph"),+ seriesCollection = graph.seriesTypes[type],+ prevXCoords,+ prevYCoords,+ len,+ cx1,+ cx2,+ cy1,+ cy2,+ x,+ y,+ i = 0,+ firstX,+ firstY,+ styles = this.get("styles").area,+ path = this._getPath(),+ color = styles.color || this._getDefaultColor(this.get("graphOrder"), "slice");+ firstX = xcoords[0];+ firstY = ycoords[0];+ curvecoords = this.getCurveControlPoints(xcoords, ycoords);+ len = curvecoords.length;+ path.set("fill", {+ color: color, + opacity: styles.alpha+ });+ path.set("stroke", {weight: 0});+ path.moveTo(firstX, firstY);+ for(; i < len; i = ++i)+ {+ x = curvecoords[i].endx;+ y = curvecoords[i].endy;+ cx1 = curvecoords[i].ctrlx1;+ cx2 = curvecoords[i].ctrlx2;+ cy1 = curvecoords[i].ctrly1;+ cy2 = curvecoords[i].ctrly2;+ path.curveTo(cx1, cy1, cx2, cy2, x, y);+ }+ if(order > 0)+ {+ prevXCoords = seriesCollection[order - 1].get("xcoords").concat().reverse();+ prevYCoords = seriesCollection[order - 1].get("ycoords").concat().reverse();+ curvecoords = this.getCurveControlPoints(prevXCoords, prevYCoords);+ i = 0;+ len = curvecoords.length;+ path.lineTo(prevXCoords[0], prevYCoords[0]);+ for(; i < len; i = ++i)+ {+ x = curvecoords[i].endx;+ y = curvecoords[i].endy;+ cx1 = curvecoords[i].ctrlx1;+ cx2 = curvecoords[i].ctrlx2;+ cy1 = curvecoords[i].ctrly1;+ cy2 = curvecoords[i].ctrly2;+ path.curveTo(cx1, cy1, cx2, cy2, x, y);+ }+ }+ else+ {+ if(this.get("direction") === "vertical")+ {+ path.lineTo(this._leftOrigin, ycoords[ycoords.length-1]);+ path.lineTo(this._leftOrigin, firstY);+ }+ else+ {+ path.lineTo(xcoords[xcoords.length-1], this._bottomOrigin);+ path.lineTo(firstX, this._bottomOrigin);+ }++ }+ path.lineTo(firstX, firstY);+ path.end();+ },+ + /**+ * Storage for default area styles.+ *+ * @property _defaults+ * @type Object+ * @private+ */+ _defaults: null,++ /**+ * Concatenates coordinate array with correct coordinates for closing an area fill.+ *+ * @method _getClosingPoints+ * @return Array+ * @protected+ */+ _getClosingPoints: function()+ {+ var xcoords = this.get("xcoords").concat(),+ ycoords = this.get("ycoords").concat(),+ firstValidIndex,+ lastValidIndex;+ if(this.get("direction") === "vertical")+ {+ lastValidIndex = this._getLastValidIndex(xcoords);+ firstValidIndex = this._getFirstValidIndex(xcoords);+ ycoords.push(ycoords[lastValidIndex]);+ ycoords.push(ycoords[firstValidIndex]);+ xcoords.push(this._leftOrigin);+ xcoords.push(this._leftOrigin);+ }+ else+ {+ lastValidIndex = this._getLastValidIndex(ycoords);+ firstValidIndex = this._getFirstValidIndex(ycoords);+ xcoords.push(xcoords[lastValidIndex]);+ xcoords.push(xcoords[firstValidIndex]);+ ycoords.push(this._bottomOrigin);+ ycoords.push(this._bottomOrigin);+ }+ xcoords.push(xcoords[0]);+ ycoords.push(ycoords[0]);+ return [xcoords, ycoords];+ },++ /**+ * Returns the order of the series closest to the current series that has a valid value for the current index.+ *+ * @method _getHighestValidOrder+ * @param {Array} seriesCollection Array of series of a given type.+ * @param {Number} index Index of the series item.+ * @param {Number} order Index of the the series in the seriesCollection+ * @param {String} direction Indicates the direction of the series+ * @return Number+ * @private+ */+ _getHighestValidOrder: function(seriesCollection, index, order, direction)+ {+ var coords = direction == "vertical" ? "stackedXCoords" : "stackedYCoords",+ coord;+ while(isNaN(coord) && order > -1)+ {+ order = order - 1;+ if(order > -1)+ {+ coord = seriesCollection[order].get(coords)[index];+ }+ }+ return order;+ },+ + /**+ * Returns an array containing the x and y coordinates for a given series and index.+ *+ * @method _getCoordsByOrderAndIndex+ * @param {Array} seriesCollection Array of series of a given type.+ * @param {Number} index Index of the series item.+ * @param {Number} order Index of the the series in the seriesCollection+ * @param {String} direction Indicates the direction of the series+ * @return Array+ * @private+ */+ _getCoordsByOrderAndIndex: function(seriesCollection, index, order, direction)+ {+ var xcoord,+ ycoord;+ if(direction == "vertical")+ {+ xcoord = order < 0 ? this._leftOrigin : seriesCollection[order].get("stackedXCoords")[index];+ ycoord = this.get("stackedYCoords")[index];+ }+ else+ {+ xcoord = this.get("stackedXCoords")[index];+ ycoord = order < 0 ? this._bottomOrigin : seriesCollection[order].get("stackedYCoords")[index];+ }+ return [xcoord, ycoord];+ },+ + /**+ * Concatenates coordinate array with the correct coordinates for closing an area stack.+ *+ * @method _getStackedClosingPoints+ * @return Array+ * @protected+ */+ _getStackedClosingPoints: function()+ {+ var order = this.get("order"),+ type = this.get("type"),+ graph = this.get("graph"),+ direction = this.get("direction"),+ seriesCollection = graph.seriesTypes[type],+ firstValidIndex,+ lastValidIndex,+ xcoords = this.get("stackedXCoords"),+ ycoords = this.get("stackedYCoords"),+ limit,+ previousSeries,+ previousSeriesFirstValidIndex,+ previousSeriesLastValidIndex,+ previousXCoords,+ previousYCoords,+ coords,+ closingXCoords,+ closingYCoords,+ currentIndex,+ highestValidOrder,+ oldOrder;+ if(order < 1)+ { + return this._getClosingPoints();+ }+ + previousSeries = seriesCollection[order - 1];+ previousXCoords = previousSeries.get("stackedXCoords").concat();+ previousYCoords = previousSeries.get("stackedYCoords").concat();+ if(direction == "vertical")+ {+ firstValidIndex = this._getFirstValidIndex(xcoords);+ lastValidIndex = this._getLastValidIndex(xcoords);+ previousSeriesFirstValidIndex = previousSeries._getFirstValidIndex(previousXCoords);+ previousSeriesLastValidIndex = previousSeries._getLastValidIndex(previousXCoords);+ }+ else+ {+ firstValidIndex = this._getFirstValidIndex(ycoords);+ lastValidIndex = this._getLastValidIndex(ycoords);+ previousSeriesFirstValidIndex = previousSeries._getFirstValidIndex(previousYCoords);+ previousSeriesLastValidIndex = previousSeries._getLastValidIndex(previousYCoords);+ }+ if(previousSeriesLastValidIndex >= firstValidIndex && previousSeriesFirstValidIndex <= lastValidIndex)+ {+ previousSeriesFirstValidIndex = Math.max(firstValidIndex, previousSeriesFirstValidIndex);+ previousSeriesLastValidIndex = Math.min(lastValidIndex, previousSeriesLastValidIndex);+ previousXCoords = previousXCoords.slice(previousSeriesFirstValidIndex, previousSeriesLastValidIndex + 1);+ previousYCoords = previousYCoords.slice(previousSeriesFirstValidIndex, previousSeriesLastValidIndex + 1);+ limit = previousSeriesFirstValidIndex;+ }+ else+ {+ limit = lastValidIndex;+ }++ closingXCoords = [xcoords[firstValidIndex]];+ closingYCoords = [ycoords[firstValidIndex]];+ currentIndex = firstValidIndex;+ while((isNaN(highestValidOrder) || highestValidOrder < order - 1) && currentIndex <= limit)+ {+ oldOrder = highestValidOrder;+ highestValidOrder = this._getHighestValidOrder(seriesCollection, currentIndex, order, direction);+ if(!isNaN(oldOrder) && highestValidOrder > oldOrder)+ {+ coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, oldOrder, direction);+ closingXCoords.push(coords[0]);+ closingYCoords.push(coords[1]);+ }+ coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, highestValidOrder, direction);+ closingXCoords.push(coords[0]);+ closingYCoords.push(coords[1]);+ currentIndex = currentIndex + 1;+ }+ if(previousXCoords && previousXCoords.length > 0 && previousSeriesLastValidIndex > firstValidIndex && previousSeriesFirstValidIndex < lastValidIndex)+ {+ closingXCoords = closingXCoords.concat(previousXCoords);+ closingYCoords = closingYCoords.concat(previousYCoords);+ highestValidOrder = order -1; + }+ currentIndex = Math.max(firstValidIndex, previousSeriesLastValidIndex);+ order = order - 1;+ highestValidOrder = NaN;+ while(currentIndex <= lastValidIndex)+ {+ oldOrder = highestValidOrder;+ highestValidOrder = this._getHighestValidOrder(seriesCollection, currentIndex, order, direction);+ if(!isNaN(oldOrder))+ {+ if(highestValidOrder > oldOrder)+ {+ coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, oldOrder, direction);+ closingXCoords.push(coords[0]);+ closingYCoords.push(coords[1]);+ }+ else if(highestValidOrder < oldOrder)+ {+ coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex - 1, highestValidOrder, direction);+ closingXCoords.push(coords[0]);+ closingYCoords.push(coords[1]);+ }+ }+ coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, highestValidOrder, direction);+ closingXCoords.push(coords[0]);+ closingYCoords.push(coords[1]);+ currentIndex = currentIndex + 1;+ }++ closingXCoords.reverse();+ closingYCoords.reverse();+ return [xcoords.concat(closingXCoords), ycoords.concat(closingYCoords)];+ },++ /**+ * Returns default values for area styles.+ *+ * @method _getAreaDefaults+ * @return Object+ * @private+ */+ _getAreaDefaults: function()+ {+ return {+ };+ }+};+Y.augment(Fills, Y.Attribute);+Y.Fills = Fills;+/**+ * Utility class used for drawing markers.+ *+ * @module charts+ * @submodule charts-base+ * @class Plots+ * @constructor+ */+function Plots(cfg)+{+ var attrs = { + markers: {+ getter: function()+ {+ return this._markers;+ }+ }+ };+ this.addAttrs(attrs, cfg);+}++Plots.prototype = {+ /**+ * Storage for default marker styles.+ *+ * @property _plotDefaults+ * @type Object+ * @private+ */+ _plotDefaults: null,++ /**+ * Draws the markers+ *+ * @method drawPlots+ * @protected+ */+ drawPlots: function()+ {+ if(!this.get("xcoords") || this.get("xcoords").length < 1) + {+ return;+ }+ var isNumber = Y_Lang.isNumber,+ style = Y.clone(this.get("styles").marker),+ w = style.width,+ h = style.height,+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ i = 0,+ len = xcoords.length,+ top = ycoords[0],+ left,+ marker,+ offsetWidth = w/2,+ offsetHeight = h/2,+ xvalues,+ yvalues,+ fillColors = null,+ borderColors = null,+ graphOrder = this.get("graphOrder"),+ groupMarkers = this.get("groupMarkers");+ if(groupMarkers)+ {+ xvalues = [];+ yvalues = [];+ for(; i < len; ++i)+ {+ xvalues.push(parseFloat(xcoords[i] - offsetWidth));+ yvalues.push(parseFloat(ycoords[i] - offsetHeight));+ }+ this._createGroupMarker({+ xvalues: xvalues,+ yvalues: yvalues,+ fill: style.fill,+ border: style.border,+ dimensions: {+ width: w,+ height: h+ },+ graphOrder: graphOrder,+ shape: style.shape+ });+ return;+ }+ if(Y_Lang.isArray(style.fill.color))+ {+ fillColors = style.fill.color.concat(); + }+ if(Y_Lang.isArray(style.border.color))+ {+ borderColors = style.border.color.concat();+ }+ this._createMarkerCache();+ for(; i < len; ++i)+ {+ top = parseFloat(ycoords[i] - offsetHeight);+ left = parseFloat(xcoords[i] - offsetWidth); + if(!isNumber(left) || !isNumber(top))+ {+ this._markers.push(null);+ continue;+ }+ if(fillColors)+ {+ style.fill.color = fillColors[i % fillColors.length];+ }+ if(borderColors)+ {+ style.border.color = borderColors[i % borderColors.length];+ }++ style.x = left;+ style.y = top;+ marker = this.getMarker(style, graphOrder, i);+ }+ this._clearMarkerCache();+ },++ /**+ * Pre-defined group shapes.+ *+ * @property _groupShapes+ * @private+ */+ _groupShapes: {+ circle: Y.CircleGroup,+ rect: Y.RectGroup,+ ellipse: Y.EllipseGroup,+ diamond: Y.DiamondGroup+ },++ /**+ * Returns the correct group shape class.+ *+ * @method _getGroupShape+ * @param {Shape | String} shape Indicates which shape class. + * @return Function+ * @protected+ */+ _getGroupShape: function(shape)+ {+ if(Y_Lang.isString(shape))+ {+ shape = this._groupShapes[shape];+ }+ return shape;+ },++ /**+ * Gets the default values for series that use the utility. This method is used by+ * the class' `styles` attribute's getter to get build default values.+ *+ * @method _getPlotDefaults+ * @return Object+ * @protected+ */+ _getPlotDefaults: function()+ {+ var defs = {+ fill:{+ type: "solid",+ alpha: 1,+ colors:null,+ alphas: null,+ ratios: null+ },+ border:{+ weight: 1,+ alpha: 1+ },+ width: 10,+ height: 10,+ shape: "circle"+ };+ defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");+ defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");+ return defs;+ },++ /**+ * Collection of markers to be used in the series.+ *+ * @property _markers+ * @type Array+ * @private+ */+ _markers: null,++ /**+ * Collection of markers to be re-used on a series redraw.+ *+ * @property _markerCache+ * @type Array+ * @private+ */+ _markerCache: null,+ + /**+ * Gets and styles a marker. If there is a marker in cache, it will use it. Otherwise+ * it will create one.+ *+ * @method getMarker+ * @param {Object} styles Hash of style properties.+ * @param {Number} order Order of the series.+ * @param {Number} index Index within the series associated with the marker.+ * @return Shape+ * @protected+ */+ getMarker: function(styles, order, index)+ {+ var marker,+ border = styles.border;+ styles.id = this.get("chart").get("id") + "_" + order + "_" + index;+ //fix name differences between graphic layer+ border.opacity = border.alpha;+ styles.stroke = border;+ styles.fill.opacity = styles.fill.alpha;+ if(this._markerCache.length > 0)+ {+ while(!marker)+ {+ if(this._markerCache.length < 1)+ {+ marker = this._createMarker(styles, order, index);+ break;+ }+ marker = this._markerCache.shift();++ }+ marker.set(styles);+ }+ else+ {+ marker = this._createMarker(styles, order, index);+ }+ this._markers.push(marker);+ return marker;+ },+ + /**+ * Creates a shape to be used as a marker.+ *+ * @method _createMarker+ * @param {Object} styles Hash of style properties.+ * @param {Number} order Order of the series.+ * @param {Number} index Index within the series associated with the marker.+ * @return Shape+ * @private+ */+ _createMarker: function(styles, order, index)+ {+ var graphic = this.get("graphic"),+ marker,+ cfg = Y.clone(styles);+ graphic.set("autoDraw", false);+ cfg.type = cfg.shape;+ marker = graphic.addShape(cfg); + marker.addClass(SERIES_MARKER);+ return marker;+ },+ + /**+ * Creates a cache of markers for reuse.+ *+ * @method _createMarkerCache+ * @private+ */+ _createMarkerCache: function()+ {+ if(this._groupMarker)+ {+ this._groupMarker.destroy();+ this._groupMarker = null;+ }+ if(this._markers && this._markers.length > 0)+ {+ this._markerCache = this._markers.concat();+ }+ else+ {+ this._markerCache = [];+ }+ this._markers = [];+ },+ + /**+ * Draws a series of markers in a single shape instance.+ *+ * @method _createGroupMarkers+ * @param {Object} styles Set of configuration properties used to create the markers.+ * @protected+ */+ _createGroupMarker: function(styles)+ {+ var marker,+ markers = this.get("markers"),+ border = styles.border,+ graphic,+ cfg,+ shape;+ if(markers && markers.length > 0)+ {+ while(markers.length > 0)+ {+ marker = markers.shift();+ marker.destroy();+ }+ this.set("markers", []);+ }+ //fix name differences between graphic layer+ border.opacity = border.alpha;+ cfg = {+ id: this.get("chart").get("id") + "_" + styles.graphOrder,+ stroke: border,+ fill: styles.fill,+ dimensions: styles.dimensions,+ xvalues: styles.xvalues,+ yvalues: styles.yvalues+ };+ cfg.fill.opacity = styles.fill.alpha;+ shape = this._getGroupShape(styles.shape);+ if(shape)+ {+ cfg.type = shape;+ }+ if(styles.hasOwnProperty("radius") && !isNaN(styles.radius))+ {+ cfg.dimensions.radius = styles.radius;+ }+ if(this._groupMarker)+ {+ this._groupMarker.destroy();+ }+ graphic = this.get("graphic");+ this._groupMarker = graphic.addShape(cfg);+ graphic._redraw();+ },++ /**+ * Toggles visibility+ *+ * @method _toggleVisible+ * @param {Boolean} visible indicates visibilitye+ * @private+ */+ _toggleVisible: function(visible)+ {+ var marker,+ markers = this.get("markers"),+ i = 0,+ len;+ if(markers)+ {+ len = markers.length;+ for(; i < len; ++i)+ {+ marker = markers[i];+ if(marker)+ {+ marker.set("visible", visible);+ }+ }+ }+ },++ /**+ * Removes unused markers from the marker cache+ *+ * @method _clearMarkerCache+ * @private+ */+ _clearMarkerCache: function()+ {+ var marker;+ while(this._markerCache.length > 0)+ {+ marker = this._markerCache.shift();+ if(marker)+ {+ marker.destroy();+ }+ }+ },++ /**+ * Resizes and positions markers based on a mouse interaction.+ *+ * @method updateMarkerState+ * @param {String} type state of the marker+ * @param {Number} i index of the marker+ * @protected+ */+ updateMarkerState: function(type, i)+ {+ if(this._markers && this._markers[i])+ {+ var w,+ h,+ styles = Y.clone(this.get("styles").marker),+ state = this._getState(type),+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ marker = this._markers[i],+ markerStyles = state == "off" || !styles[state] ? styles : styles[state]; + markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);+ markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);+ markerStyles.stroke = markerStyles.border;+ marker.set(markerStyles);+ w = markerStyles.width;+ h = markerStyles.height;+ marker.set("x", (xcoords[i] - w/2));+ marker.set("y", (ycoords[i] - h/2));+ marker.set("visible", this.get("visible"));+ }+ },++ /**+ * Parses a color from an array.+ *+ * @method _getItemColor+ * @param {Array} val collection of colors+ * @param {Number} i index of the item+ * @return String+ * @protected+ */+ _getItemColor: function(val, i)+ {+ if(Y_Lang.isArray(val))+ {+ return val[i % val.length];+ }+ return val;+ },++ /**+ * Method used by `styles` setter. Overrides base implementation.+ *+ * @method _setStyles+ * @param {Object} newStyles Hash of properties to update.+ * @return Object+ * @protected+ */+ _setStyles: function(val)+ {+ val = this._parseMarkerStyles(val);+ return Y.Renderer.prototype._setStyles.apply(this, [val]);+ },++ /**+ * Combines new styles with existing styles.+ *+ * @method _parseMarkerStyles+ * @param {Object} Object containing style properties for the marker.+ * @return Object+ * @private+ */+ _parseMarkerStyles: function(val)+ {+ if(val.marker)+ {+ var defs = this._getPlotDefaults();+ val.marker = this._mergeStyles(val.marker, defs);+ if(val.marker.over)+ {+ val.marker.over = this._mergeStyles(val.marker.over, val.marker);+ }+ if(val.marker.down)+ {+ val.marker.down = this._mergeStyles(val.marker.down, val.marker);+ }+ }+ return val;+ },++ /**+ * Returns marker state based on event type+ *+ * @method _getState+ * @param {String} type event type+ * @return String+ * @protected+ */+ _getState: function(type)+ {+ var state;+ switch(type)+ {+ case "mouseout" :+ state = "off";+ break;+ case "mouseover" :+ state = "over";+ break;+ case "mouseup" :+ state = "over";+ break;+ case "mousedown" :+ state = "down";+ break;+ }+ return state;+ },+ + /**+ * @property _statSyles+ * @type Object+ * @private+ */+ _stateSyles: null+};++Y.augment(Plots, Y.Attribute);+Y.Plots = Plots;+/**+ * Histogram is the base class for Column and Bar series.+ *+ * @module charts+ * @submodule charts-base+ * @class Histogram+ * @constructor+ */+function Histogram(){}++Histogram.prototype = {+ /**+ * Draws the series.+ *+ * @method drawSeries+ * @protected+ */+ drawSeries: function()+ {+ if(this.get("xcoords").length < 1) + {+ return;+ }+ var style = Y.clone(this.get("styles").marker),+ setSize,+ calculatedSize,+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ i = 0,+ len = xcoords.length,+ top = ycoords[0],+ type = this.get("type"),+ graph = this.get("graph"),+ seriesCollection = graph.seriesTypes[type],+ seriesLen = seriesCollection.length,+ seriesSize = 0,+ totalSize = 0,+ offset = 0,+ ratio,+ renderer,+ order = this.get("order"),+ graphOrder = this.get("graphOrder"),+ left,+ marker,+ setSizeKey,+ calculatedSizeKey,+ config,+ fillColors = null,+ borderColors = null,+ xMarkerPlane = [],+ yMarkerPlane = [],+ xMarkerPlaneLeft,+ xMarkerPlaneRight,+ yMarkerPlaneTop,+ yMarkerPlaneBottom,+ dimensions = {+ width: [],+ height: []+ },+ xvalues = [],+ yvalues = [],+ groupMarkers = this.get("groupMarkers");+ if(Y_Lang.isArray(style.fill.color))+ {+ fillColors = style.fill.color.concat(); + }+ if(Y_Lang.isArray(style.border.color))+ {+ borderColors = style.border.color.concat();+ }+ if(this.get("direction") == "vertical")+ {+ setSizeKey = "height";+ calculatedSizeKey = "width";+ }+ else+ {+ setSizeKey = "width";+ calculatedSizeKey = "height";+ }+ setSize = style[setSizeKey];+ calculatedSize = style[calculatedSizeKey];+ this._createMarkerCache();+ for(; i < seriesLen; ++i)+ {+ renderer = seriesCollection[i];+ seriesSize += renderer.get("styles").marker[setSizeKey];+ if(order > i) + {+ offset = seriesSize;+ }+ }+ totalSize = len * seriesSize;+ this._maxSize = graph.get(setSizeKey);+ if(totalSize > this._maxSize)+ {+ ratio = graph.get(setSizeKey)/totalSize;+ seriesSize *= ratio;+ offset *= ratio;+ setSize *= ratio;+ setSize = Math.max(setSize, 1);+ this._maxSize = setSize;+ }+ offset -= seriesSize/2;+ for(i = 0; i < len; ++i)+ {+ xMarkerPlaneLeft = xcoords[i] - seriesSize/2;+ xMarkerPlaneRight = xMarkerPlaneLeft + seriesSize;+ yMarkerPlaneTop = ycoords[i] - seriesSize/2;+ yMarkerPlaneBottom = yMarkerPlaneTop + seriesSize;+ xMarkerPlane.push({start: xMarkerPlaneLeft, end: xMarkerPlaneRight});+ yMarkerPlane.push({start: yMarkerPlaneTop, end: yMarkerPlaneBottom});+ if(isNaN(xcoords[i]) || isNaN(ycoords[i]))+ {+ this._markers.push(null);+ continue;+ }+ config = this._getMarkerDimensions(xcoords[i], ycoords[i], calculatedSize, offset);+ if(!isNaN(config.calculatedSize) && config.calculatedSize > 0)+ {+ top = config.top;+ left = config.left;++ if(groupMarkers)+ {+ dimensions[setSizeKey][i] = setSize;+ dimensions[calculatedSizeKey][i] = config.calculatedSize;+ xvalues.push(left);+ yvalues.push(top);+ }+ else+ {+ style[setSizeKey] = setSize;+ style[calculatedSizeKey] = config.calculatedSize;+ style.x = left;+ style.y = top;+ if(fillColors)+ {+ style.fill.color = fillColors[i % fillColors.length];+ }+ if(borderColors)+ {+ style.border.color = borderColors[i % borderColors.length];+ }+ marker = this.getMarker(style, graphOrder, i);+ }++ }+ else if(!groupMarkers)+ {+ this._markers.push(null);+ }+ }+ this.set("xMarkerPlane", xMarkerPlane);+ this.set("yMarkerPlane", yMarkerPlane);+ if(groupMarkers)+ {+ this._createGroupMarker({+ fill: style.fill,+ border: style.border,+ dimensions: dimensions,+ xvalues: xvalues,+ yvalues: yvalues,+ shape: style.shape+ });+ }+ else+ {+ this._clearMarkerCache();+ }+ },+ + /**+ * Collection of default colors used for marker fills in a series when not specified by user.+ *+ * @property _defaultFillColors+ * @type Array+ * @protected+ */+ _defaultFillColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],+ + /**+ * Gets the default style values for the markers.+ *+ * @method _getPlotDefaults+ * @return Object+ * @private+ */+ _getPlotDefaults: function()+ {+ var defs = {+ fill:{+ type: "solid",+ alpha: 1,+ colors:null,+ alphas: null,+ ratios: null+ },+ border:{+ weight: 0,+ alpha: 1+ },+ width: 12,+ height: 12,+ shape: "rect",++ padding:{+ top: 0,+ left: 0,+ right: 0,+ bottom: 0+ }+ };+ defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");+ defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");+ return defs;+ }+};++Y.Histogram = Histogram;+/**+ * The CartesianSeries class creates a chart with horizontal and vertical axes.+ *+ * @module charts+ * @submodule charts-base+ * @class CartesianSeries+ * @extends Base+ * @uses Renderer+ * @constructor+ */+Y.CartesianSeries = Y.Base.create("cartesianSeries", Y.Base, [Y.Renderer], {+ /**+ * Storage for `xDisplayName` attribute.+ *+ * @property _xDisplayName+ * @type String+ * @private+ */+ _xDisplayName: null,++ /**+ * Storage for `yDisplayName` attribute.+ *+ * @property _yDisplayName+ * @type String+ * @private+ */+ _yDisplayName: null,+ + /**+ * Th x-coordinate for the left edge of the series.+ *+ * @property _leftOrigin+ * @type String+ * @private+ */+ _leftOrigin: null,++ /**+ * The y-coordinate for the bottom edge of the series.+ * + * @property _bottomOrigin+ * @type String+ * @private+ */+ _bottomOrigin: null,++ /**+ * @method render+ * @private+ */+ render: function()+ {+ this._setCanvas();+ this.addListeners();+ this.set("rendered", true);+ this.validate();+ },++ /**+ * Adds event listeners.+ *+ * @method addListeners+ * @private+ */+ addListeners: function()+ {+ var xAxis = this.get("xAxis"),+ yAxis = this.get("yAxis");+ if(xAxis)+ {+ this._xDataReadyHandle = xAxis.after("dataReady", Y.bind(this._xDataChangeHandler, this));+ this._xDataUpdateHandle = xAxis.after("dataUpdate", Y.bind(this._xDataChangeHandler, this));+ }+ if(yAxis)+ {+ this._yDataReadyHandle = yAxis.after("dataReady", Y.bind(this._yDataChangeHandler, this));+ this._yDataUpdateHandle = yAxis.after("dataUpdate", Y.bind(this._yDataChangeHandler, this));+ }+ this._xAxisChangeHandle = this.after("xAxisChange", this._xAxisChangeHandler);+ this._yAxisChangeHandle = this.after("yAxisChange", this._yAxisChangeHandler);+ this._stylesChangeHandle = this.after("stylesChange", function(e) {+ var axesReady = this._updateAxisData();+ if(axesReady)+ {+ this.draw();+ }+ });+ this._widthChangeHandle = this.after("widthChange", function(e) {+ var axesReady = this._updateAxisData();+ if(axesReady)+ {+ this.draw();+ }+ });+ this._heightChangeHandle = this.after("heightChange", function(e) {+ var axesReady = this._updateAxisData();+ if(axesReady)+ {+ this.draw();+ }+ });+ this._visibleChangeHandle = this.after("visibleChange", this._handleVisibleChange);+ },+ + /**+ * Event handler for the xAxisChange event.+ *+ * @method _xAxisChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _xAxisChangeHandler: function(e)+ {+ var xAxis = this.get("xAxis");+ xAxis.after("dataReady", Y.bind(this._xDataChangeHandler, this));+ xAxis.after("dataUpdate", Y.bind(this._xDataChangeHandler, this));+ },+ + /**+ * Event handler the yAxisChange event.+ *+ * @method _yAxisChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _yAxisChangeHandler: function(e)+ {+ var yAxis = this.get("yAxis");+ yAxis.after("dataReady", Y.bind(this._yDataChangeHandler, this));+ yAxis.after("dataUpdate", Y.bind(this._yDataChangeHandler, this));+ },++ /**+ * Constant used to generate unique id.+ *+ * @property GUID+ * @type String+ * @private+ */+ GUID: "yuicartesianseries",++ /**+ * Event handler for xDataChange event.+ *+ * @method _xDataChangeHandler+ * @param {Object} event Event object.+ * @private + */+ _xDataChangeHandler: function(event)+ {+ var axesReady = this._updateAxisData();+ if(axesReady)+ {+ this.draw();+ }+ },++ /**+ * Event handler for yDataChange event.+ *+ * @method _yDataChangeHandler+ * @param {Object} event Event object.+ * @private + */+ _yDataChangeHandler: function(event)+ {+ var axesReady = this._updateAxisData();+ if(axesReady)+ {+ this.draw();+ }+ },++ /**+ * Checks to ensure that both xAxis and yAxis data are available. If so, set the `xData` and `yData` attributes and return `true`. Otherwise, return `false`.+ *+ * @method _updateAxisData+ * @return Boolean+ * @private + */+ _updateAxisData: function()+ {+ var xAxis = this.get("xAxis"),+ yAxis = this.get("yAxis"),+ xKey = this.get("xKey"),+ yKey = this.get("yKey"),+ yData,+ xData;+ if(!xAxis || !yAxis || !xKey || !yKey)+ {+ return false;+ }+ xData = xAxis.getDataByKey(xKey);+ yData = yAxis.getDataByKey(yKey);+ if(!xData || !yData)+ {+ return false;+ }+ this.set("xData", xData.concat());+ this.set("yData", yData.concat());+ return true;+ },++ /**+ * Draws the series is the xAxis and yAxis data are both available.+ *+ * @method validate+ * @private+ */+ validate: function()+ {+ if((this.get("xData") && this.get("yData")) || this._updateAxisData())+ {+ this.draw();+ }+ else+ {+ this.fire("drawingComplete");+ }+ },++ /**+ * Creates a `Graphic` instance.+ *+ * @method _setCanvas+ * @protected+ */+ _setCanvas: function()+ {+ var graph = this.get("graph"),+ graphic = graph.get("graphic");+ this.set("graphic", graphic);+ },++ /**+ * Calculates the coordinates for the series.+ *+ * @method setAreaData+ * @protected+ */+ setAreaData: function()+ {+ var isNumber = Y_Lang.isNumber,+ nextX, nextY,+ graph = this.get("graph"),+ w = graph.get("width"),+ h = graph.get("height"),+ xAxis = this.get("xAxis"),+ yAxis = this.get("yAxis"),+ xData = this.get("xData").concat(),+ yData = this.get("yData").concat(),+ xValue,+ yValue,+ xOffset = xAxis.getEdgeOffset(xData.length, w),+ yOffset = yAxis.getEdgeOffset(yData.length, h),+ padding = this.get("styles").padding,+ leftPadding = padding.left,+ topPadding = padding.top,+ dataWidth = w - (leftPadding + padding.right + xOffset),+ dataHeight = h - (topPadding + padding.bottom + yOffset),+ xcoords = [],+ ycoords = [],+ xMax = xAxis.get("maximum"),+ xMin = xAxis.get("minimum"),+ yMax = yAxis.get("maximum"),+ yMin = yAxis.get("minimum"),+ xScaleFactor = dataWidth / (xMax - xMin),+ yScaleFactor = dataHeight / (yMax - yMin),+ dataLength,+ direction = this.get("direction"),+ i = 0,+ xMarkerPlane = [],+ yMarkerPlane = [],+ xMarkerPlaneOffset = this.get("xMarkerPlaneOffset"),+ yMarkerPlaneOffset = this.get("yMarkerPlaneOffset"),+ graphic = this.get("graphic");+ graphic.set("width", w);+ graphic.set("height", h);+ dataLength = xData.length;+ xOffset *= 0.5;+ yOffset *= 0.5;+ //Assuming a vertical graph has a range/category for its vertical axis. + if(direction === "vertical")+ {+ yData = yData.reverse();+ }+ this._leftOrigin = Math.round(((0 - xMin) * xScaleFactor) + leftPadding + xOffset);+ this._bottomOrigin = Math.round((dataHeight + topPadding + yOffset)); + if(yMin < 0)+ {+ this._bottomOrigin = this._bottomOrigin - ((0 - yMin) * yScaleFactor);+ }+ for (; i < dataLength; ++i) + {+ xValue = parseFloat(xData[i]);+ yValue = parseFloat(yData[i]);+ if(isNumber(xValue))+ {+ nextX = (((xValue - xMin) * xScaleFactor) + leftPadding + xOffset);+ }+ else+ {+ nextX = NaN;+ }+ if(isNumber(yValue))+ {+ nextY = ((dataHeight + topPadding + yOffset) - (yValue - yMin) * yScaleFactor);+ }+ else+ {+ nextY = NaN;+ }+ xcoords.push(nextX);+ ycoords.push(nextY);+ xMarkerPlane.push({start:nextX - xMarkerPlaneOffset, end: nextX + xMarkerPlaneOffset});+ yMarkerPlane.push({start:nextY - yMarkerPlaneOffset, end: nextY + yMarkerPlaneOffset});+ }+ this.set("xcoords", xcoords);+ this.set("ycoords", ycoords);+ this.set("xMarkerPlane", xMarkerPlane);+ this.set("yMarkerPlane", yMarkerPlane);+ this._dataLength = dataLength;+ },++ /**+ * Finds the first valid index of an array coordinates.+ *+ * @method _getFirstValidIndex+ * @param {Array} coords An array of x or y coordinates.+ * @return Number+ * @private+ */+ _getFirstValidIndex: function(coords)+ {+ var coord,+ i = -1,+ limit = coords.length;+ while(!Y_Lang.isNumber(coord) && i < limit)+ {+ i += 1;+ coord = coords[i];+ }+ return i;+ },++ /**+ * Finds the last valid index of an array coordinates.+ *+ * @method _getLastValidIndex+ * @param {Array} coords An array of x or y coordinates.+ * @return Number+ * @private+ */+ _getLastValidIndex: function(coords)+ {+ var coord,+ i = coords.length,+ limit = -1;+ while(!Y_Lang.isNumber(coord) && i > limit)+ {+ i -= 1;+ coord = coords[i];+ }+ return i;+ },++ /**+ * Draws the series.+ *+ * @method draw+ * @protected+ */+ draw: function()+ {+ var graph = this.get("graph"),+ w = graph.get("width"),+ h = graph.get("height");+ if(this.get("rendered"))+ {+ if((isFinite(w) && isFinite(h) && w > 0 && h > 0) && ((this.get("xData") && this.get("yData")) || this._updateAxisData()))+ {+ if(this._drawing)+ {+ this._callLater = true;+ return;+ }+ this._drawing = true;+ this._callLater = false;+ this.setAreaData();+ if(this.get("xcoords") && this.get("ycoords"))+ {+ this.drawSeries();+ }+ this._drawing = false;+ if(this._callLater)+ {+ this.draw();+ }+ else+ {+ this._toggleVisible(this.get("visible"));+ this.fire("drawingComplete");+ }+ }+ }+ },+ + /**+ * Default value for plane offsets when the parent chart's `interactiveType` is `planar`. + *+ * @property _defaultPlaneOffset+ * @type Number+ * @private+ */+ _defaultPlaneOffset: 4,+ + /**+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ * @protected+ */+ _getDefaultStyles: function()+ {+ return {padding:{+ top: 0,+ left: 0,+ right: 0,+ bottom: 0+ }};+ },++ /**+ * Collection of default colors used for lines in a series when not specified by user.+ *+ * @property _defaultLineColors+ * @type Array+ * @protected+ */+ _defaultLineColors:["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"],++ /**+ * Collection of default colors used for marker fills in a series when not specified by user.+ *+ * @property _defaultFillColors+ * @type Array+ * @protected+ */+ _defaultFillColors:["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"],+ + /**+ * Collection of default colors used for marker borders in a series when not specified by user.+ *+ * @property _defaultBorderColors+ * @type Array+ * @protected+ */+ _defaultBorderColors:["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"],+ + /**+ * Collection of default colors used for area fills, histogram fills and pie fills in a series when not specified by user.+ *+ * @property _defaultSliceColors+ * @type Array+ * @protected+ */+ _defaultSliceColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],++ /**+ * Parses a color based on a series order and type.+ *+ * @method _getDefaultColor+ * @param {Number} index Index indicating the series order.+ * @param {String} type Indicates which type of object needs the color.+ * @return String+ * @protected+ */+ _getDefaultColor: function(index, type)+ {+ var colors = {+ line: this._defaultLineColors,+ fill: this._defaultFillColors,+ border: this._defaultBorderColors,+ slice: this._defaultSliceColors+ },+ col = colors[type],+ l = col.length;+ index = index || 0;+ if(index >= l)+ {+ index = index % l;+ }+ type = type || "fill";+ return colors[type][index];+ },+ + /**+ * Shows/hides contents of the series.+ *+ * @method _handleVisibleChange+ * @param {Object} e Event object.+ * @protected+ */+ _handleVisibleChange: function(e) + {+ this._toggleVisible(this.get("visible"));+ },++ /**+ * Returns the sum of all values for the series.+ *+ * @method getTotalValues+ * @return Number+ */+ getTotalValues: function()+ {+ var total = this.get("valueAxis").getTotalByKey(this.get("valueKey"));+ return total;+ },++ /**+ * Destructor implementation for the CartesianSeries class. Calls destroy on all Graphic instances.+ *+ * @method destructor+ * @protected+ */+ destructor: function()+ {+ var marker,+ markers = this.get("markers");+ if(this.get("rendered"))+ {+ if(this._xDataReadyHandle)+ {+ this._xDataReadyHandle.detach();+ }+ if(this._xDataUpdateHandle)+ {+ this._xDataUpdateHandle.detach();+ }+ if(this._yDataReadyHandle)+ {+ this._yDataReadyHandle.detach();+ }+ if(this._yDataUpdateHandle)+ {+ this._yDataUpdateHandle.detach();+ }+ this._xAxisChangeHandle.detach();+ this._yAxisChangeHandle.detach();+ this._stylesChangeHandle.detach();+ this._widthChangeHandle.detach();+ this._heightChangeHandle.detach();+ this._visibleChangeHandle.detach();+ }+ while(markers && markers.length > 0)+ {+ marker = markers.shift();+ if(marker && marker instanceof Y.Shape)+ {+ marker.destroy();+ }+ }+ if(this._path)+ {+ this._path.destroy();+ this._path = null;+ }+ if(this._lineGraphic)+ {+ this._lineGraphic.destroy();+ this._lineGraphic = null;+ }+ if(this._groupMarker)+ {+ this._groupMarker.destroy();+ this._groupMarker = null;+ }+ }+ /**+ * Event handle for the x-axis' dataReady event.+ * + * @property _xDataReadyHandle+ * @type {EventHandle}+ * @private+ */+ + /**+ * Event handle for the x-axis dataUpdate event.+ *+ * @property _xDataUpdateHandle+ * @type {EventHandle}+ * @private+ */+ + /**+ * Event handle for the y-axis dataReady event.+ *+ * @property _yDataReadyHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the y-axis dataUpdate event.+ * @property _yDataUpdateHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the xAxisChange event.+ * @property _xAxisChangeHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the yAxisChange event.+ * @property _yAxisChangeHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the stylesChange event.+ * @property _stylesChangeHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the widthChange event.+ * @property _widthChangeHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the heightChange event.+ * @property _heightChangeHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the visibleChange event.+ * @property _visibleChangeHandle+ * @type {EventHandle}+ * @private+ */+}, {+ ATTRS: {+ /**+ * Name used for for displaying data related to the x-coordinate.+ *+ * @attribute xDisplayName+ * @type String+ */+ xDisplayName: {+ getter: function()+ {+ return this._xDisplayName || this.get("xKey");+ },++ setter: function(val)+ {+ this._xDisplayName = val.toString();+ return val;+ }+ },++ /**+ * Name used for for displaying data related to the y-coordinate.+ *+ * @attribute yDisplayName+ * @type String+ */+ yDisplayName: {+ getter: function()+ {+ return this._yDisplayName || this.get("yKey");+ },++ setter: function(val)+ {+ this._yDisplayName = val.toString();+ return val;+ }+ },+ + /**+ * Name used for for displaying category data+ *+ * @attribute categoryDisplayName+ * @type String+ * @readOnly+ */+ categoryDisplayName: {+ lazyAdd: false,++ getter: function()+ {+ return this.get("direction") == "vertical" ? this.get("yDisplayName") : this.get("xDisplayName");+ },++ setter: function(val)+ {+ if(this.get("direction") == "vertical")+ {+ this._yDisplayName = val;+ }+ else+ {+ this._xDisplayName = val;+ }+ return val;+ }+ },++ /**+ * Name used for for displaying value data+ *+ * @attribute valueDisplayName+ * @type String+ * @readOnly+ */+ valueDisplayName: {+ lazyAdd: false,++ getter: function()+ {+ return this.get("direction") == "vertical" ? this.get("xDisplayName") : this.get("yDisplayName");+ },++ setter: function(val)+ {+ if(this.get("direction") == "vertical")+ {+ this._xDisplayName = val;+ }+ else+ {+ this._yDisplayName = val;+ }+ return val;+ }+ },+ + /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default cartesian+ */+ type: { + value: "cartesian"+ },++ /**+ * Order of this instance of this `type`.+ *+ * @attribute order+ * @type Number+ */+ order: {},++ /**+ * Order of the instance+ *+ * @attribute graphOrder+ * @type Number+ */+ graphOrder: {},++ /**+ * x coordinates for the series.+ *+ * @attribute xcoords+ * @type Array+ */+ xcoords: {},+ + /**+ * y coordinates for the series+ *+ * @attribute ycoords+ * @type Array+ */+ ycoords: {},++ /**+ * Reference to the `Chart` application.+ *+ * @attribute chart+ * @type ChartBase+ * @readOnly+ */+ chart: {+ readOnly: true,++ getter: function()+ {+ return this.get("graph").get("chart");+ }+ },+ + /**+ * Reference to the `Graph` in which the series is drawn into.+ *+ * @attribute graph+ * @type Graph+ */+ graph: {},++ /**+ * Reference to the `Axis` instance used for assigning + * x-values to the graph.+ *+ * @attribute xAxis+ * @type Axis+ */+ xAxis: {},+ + /**+ * Reference to the `Axis` instance used for assigning + * y-values to the graph.+ *+ * @attribute yAxis+ * @type Axis+ */+ yAxis: {},+ + /**+ * Indicates which array to from the hash of value arrays in + * the x-axis `Axis` instance.+ *+ * @attribute xKey+ * @type String+ */+ xKey: {+ setter: function(val)+ {+ return val.toString();+ }+ },++ /**+ * Indicates which array to from the hash of value arrays in + * the y-axis `Axis` instance.+ *+ * @attribute yKey+ * @type String+ */+ yKey: {+ setter: function(val)+ {+ return val.toString();+ }+ },++ /**+ * Array of x values for the series.+ *+ * @attribute xData+ * @type Array+ */+ xData: {},++ /**+ * Array of y values for the series.+ *+ * @attribute yData+ * @type Array+ */+ yData: {},+ + /**+ * Indicates whether the Series has been through its initial set up.+ *+ * @attribute rendered+ * @type Boolean+ */+ rendered: {+ value: false+ },++ /*+ * Returns the width of the parent graph+ *+ * @attribute width+ * @type Number+ */+ width: {+ readOnly: true,+ + getter: function()+ {+ this.get("graph").get("width");+ }+ },++ /**+ * Returns the height of the parent graph+ *+ * @attribute height+ * @type Number+ */+ height: {+ readOnly: true,+ + getter: function()+ {+ this.get("graph").get("height");+ }+ },++ /**+ * Indicates whether to show the series+ *+ * @attribute visible+ * @type Boolean+ * @default true+ */+ visible: {+ value: true+ },++ /**+ * Collection of area maps along the xAxis. Used to determine mouseover for multiple+ * series.+ *+ * @attribute xMarkerPlane+ * @type Array+ */+ xMarkerPlane: {},+ + /**+ * Collection of area maps along the yAxis. Used to determine mouseover for multiple+ * series.+ *+ * @attribute yMarkerPlane+ * @type Array+ */+ yMarkerPlane: {},++ /**+ * Distance from a data coordinate to the left/right for setting a hotspot.+ *+ * @attribute xMarkerPlaneOffset+ * @type Number+ */+ xMarkerPlaneOffset: {+ getter: function() {+ var marker = this.get("styles").marker;+ if(marker && marker.width && isFinite(marker.width))+ {+ return marker.width * 0.5;+ }+ return this._defaultPlaneOffset;+ }+ },++ /**+ * Distance from a data coordinate to the top/bottom for setting a hotspot.+ *+ * @attribute yMarkerPlaneOffset+ * @type Number+ */+ yMarkerPlaneOffset: {+ getter: function() {+ var marker = this.get("styles").marker;+ if(marker && marker.height && isFinite(marker.height))+ {+ return marker.height * 0.5;+ }+ return this._defaultPlaneOffset;+ }+ },++ /**+ * Direction of the series+ *+ * @attribute direction+ * @type String+ */+ direction: {+ value: "horizontal"+ },++ /**+ * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.+ *+ * @attribute groupMarkers+ * @type Boolean+ */+ groupMarkers: {+ getter: function()+ {+ if(this._groupMarkers === undefined)+ {+ return this.get("graph").get("groupMarkers");+ }+ else+ {+ return this._groupMarkers;+ }+ },++ setter: function(val)+ {+ this._groupMarkers = val;+ return val;+ }+ }+ }+});+/**+ * The MarkerSeries class renders quantitative data by plotting relevant data points + * on a graph.+ *+ * @module charts+ * @submodule charts-base+ * @class MarkerSeries+ * @extends CartesianSeries+ * @uses Plots+ * @constructor+ */+Y.MarkerSeries = Y.Base.create("markerSeries", Y.CartesianSeries, [Y.Plots], {+ /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ this.drawPlots();+ },+ + /**+ * @protected+ *+ * Method used by `styles` setter. Overrides base implementation.+ *+ * @method _setStyles+ * @param {Object} newStyles Hash of properties to update.+ * @return Object+ */+ _setStyles: function(val)+ {+ if(!val.marker)+ {+ val = {marker:val};+ }+ val = this._parseMarkerStyles(val);+ return Y.MarkerSeries.superclass._mergeStyles.apply(this, [val, this._getDefaultStyles()]);+ },+ + /**+ * @protected+ *+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ */+ _getDefaultStyles: function()+ {+ var styles = this._mergeStyles({marker:this._getPlotDefaults()}, Y.MarkerSeries.superclass._getDefaultStyles());+ return styles;+ }+},{+ ATTRS : {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default marker+ */+ type: {+ value:"marker"+ }+ + /**+ * Style properties used for drawing markers. This attribute is inherited from `Renderer`. Below are the default values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"]`+ * </dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>width</dt><dd>indicates the width of the marker. The default value is 10.</dd>+ * <dt>height</dt><dd>indicates the height of the marker The default value is 10.</dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++/**+ * The LineSeries class renders quantitative data on a graph by connecting relevant data points.+ *+ * @module charts+ * @submodule charts-base+ * @class LineSeries+ * @extends CartesianSeries+ * @uses Lines+ * @constructor+ */+Y.LineSeries = Y.Base.create("lineSeries", Y.CartesianSeries, [Y.Lines], {+ /**+ * @protected+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ this.drawLines();+ },++ /**+ * @protected+ *+ * Method used by `styles` setter. Overrides base implementation.+ *+ * @method _setStyles+ * @param {Object} newStyles Hash of properties to update.+ * @return Object+ */+ _setStyles: function(val)+ {+ if(!val.line)+ {+ val = {line:val};+ }+ return Y.LineSeries.superclass._setStyles.apply(this, [val]);+ },++ /**+ * @protected+ *+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ */+ _getDefaultStyles: function()+ {+ var styles = this._mergeStyles({line:this._getLineDefaults()}, Y.LineSeries.superclass._getDefaultStyles());+ return styles;+ }+},+{+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default line+ */+ type: {+ value:"line"+ }++ /**+ * Style properties used for drawing lines. This attribute is inherited from `Renderer`. Below are the default values:+ * <dl>+ * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be+ * retrieved from the following array: + * `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]`+ * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>+ * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> + * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>+ * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>+ * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> + * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>+ * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>+ * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++++ ++ +/**+ * SplineSeries renders a graph with data points connected by a curve.+ *+ * @module charts+ * @submodule charts-base+ * @class SplineSeries+ * @constructor+ * @extends CartesianSeries+ * @uses CurveUtil+ * @uses Lines+ */+Y.SplineSeries = Y.Base.create("splineSeries", Y.LineSeries, [Y.CurveUtil, Y.Lines], {+ /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ this.drawSpline();+ }+}, {+ ATTRS : {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default spline+ */+ type : {+ value:"spline"+ }++ /**+ * Style properties used for drawing lines. This attribute is inherited from `Renderer`. Below are the default values:+ * <dl>+ * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be+ * retrieved from the following array: + * `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]`+ * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>+ * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> + * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>+ * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>+ * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> + * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>+ * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>+ * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++++ ++ +/**+ * StackedSplineSeries creates spline graphs in which the different series are stacked along a value axis+ * to indicate their contribution to a cumulative total.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedSplineSeries+ * @constructor+ * @extends SplineSeries+ * @extends StackingUtil+ */+Y.StackedSplineSeries = Y.Base.create("stackedSplineSeries", Y.SplineSeries, [Y.StackingUtil], {+ /**+ * @protected+ *+ * Calculates the coordinates for the series. Overrides base implementation.+ *+ * @method setAreaData+ */+ setAreaData: function()+ { + Y.StackedSplineSeries.superclass.setAreaData.apply(this);+ this._stackCoordinates.apply(this);+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedSpline+ */+ type: {+ value:"stackedSpline"+ }+ }+});++/**+ * StackedMarkerSeries plots markers with different series stacked along the value axis to indicate each+ * series' contribution to a cumulative total.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedMarkerSeries+ * @constructor+ * @extends MarkerSeries+ * @extends StackingUtil+ */+Y.StackedMarkerSeries = Y.Base.create("stackedMarkerSeries", Y.MarkerSeries, [Y.StackingUtil], {+ /**+ * @protected+ *+ * Calculates the coordinates for the series. Overrides base implementation.+ *+ * @method setAreaData+ */+ setAreaData: function()+ { + Y.StackedMarkerSeries.superclass.setAreaData.apply(this);+ this._stackCoordinates.apply(this);+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedMarker+ */+ type: {+ value:"stackedMarker"+ }+ }+});++/**+ * The ColumnSeries class renders columns positioned horizontally along a category or time axis. The columns'+ * lengths are proportional to the values they represent along a vertical axis.+ * and the relevant data points.+ *+ * @module charts+ * @submodule charts-base+ * @class ColumnSeries+ * @extends MarkerSeries+ * @uses Histogram+ * @constructor+ */+Y.ColumnSeries = Y.Base.create("columnSeries", Y.MarkerSeries, [Y.Histogram], {+ /**+ * Helper method for calculating the size of markers. + *+ * @method _getMarkerDimensions+ * @param {Number} xcoord The x-coordinate representing the data point for the marker.+ * @param {Number} ycoord The y-coordinate representing the data point for the marker.+ * @param {Number} calculatedSize The calculated size for the marker. For a `BarSeries` is it the width. For a `ColumnSeries` it is the height.+ * @param {Number} offset Distance of position offset dictated by other marker series in the same graph.+ * @return Object+ * @private+ */+ _getMarkerDimensions: function(xcoord, ycoord, calculatedSize, offset)+ {+ var config = {+ left: xcoord + offset+ };+ if(this._bottomOrigin >= ycoord)+ {+ config.top = ycoord;+ config.calculatedSize = this._bottomOrigin - config.top;+ }+ else+ {+ config.top = this._bottomOrigin;+ config.calculatedSize = ycoord - this._bottomOrigin;+ }+ return config;+ },++ /**+ * Resizes and positions markers based on a mouse interaction.+ *+ * @method updateMarkerState+ * @param {String} type state of the marker+ * @param {Number} i index of the marker+ * @protected+ */+ updateMarkerState: function(type, i)+ {+ if(this._markers && this._markers[i])+ {+ var styles = Y.clone(this.get("styles").marker),+ markerStyles,+ state = this._getState(type),+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ marker = this._markers[i],+ markers,+ graph = this.get("graph"),+ seriesStyles,+ seriesCollection = graph.seriesTypes[this.get("type")],+ seriesLen = seriesCollection.length,+ seriesSize = 0,+ offset = 0,+ renderer,+ n = 0,+ xs = [],+ order = this.get("order"),+ config;+ markerStyles = state == "off" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]); + markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);+ markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);+ config = this._getMarkerDimensions(xcoords[i], ycoords[i], styles.width, offset);+ markerStyles.height = config.calculatedSize;+ markerStyles.width = Math.min(this._maxSize, markerStyles.width);+ marker.set(markerStyles);+ for(; n < seriesLen; ++n)+ {+ xs[n] = xcoords[i] + seriesSize;+ seriesStyles = seriesCollection[n].get("styles").marker;+ seriesSize += Math.min(this._maxSize, seriesStyles.width);+ if(order > n)+ {+ offset = seriesSize;+ }+ offset -= seriesSize/2;+ }+ for(n = 0; n < seriesLen; ++n)+ {+ markers = seriesCollection[n].get("markers");+ if(markers)+ {+ renderer = markers[i];+ if(renderer && renderer !== undefined)+ {+ renderer.set("x", (xs[n] - seriesSize/2));+ }+ }+ }+ }+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @readOnly+ * @default column+ */+ type: {+ value: "column"+ }+ + /**+ * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>width</dt><dd>indicates the width of the marker. The default value is 12.</dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});+/**+ * The BarSeries class renders bars positioned vertically along a category or time axis. The bars'+ * lengths are proportional to the values they represent along a horizontal axis.+ * and the relevant data points.+ *+ * @module charts+ * @submodule charts-base+ * @class BarSeries+ * @extends MarkerSeries+ * @uses Histogram+ * @constructor+ */+Y.BarSeries = Y.Base.create("barSeries", Y.MarkerSeries, [Y.Histogram], {+ /**+ * Helper method for calculating the size of markers. + *+ * @method _getMarkerDimensions+ * @param {Number} xcoord The x-coordinate representing the data point for the marker.+ * @param {Number} ycoord The y-coordinate representing the data point for the marker.+ * @param {Number} calculatedSize The calculated size for the marker. For a `BarSeries` is it the width. For a `ColumnSeries` it is the height.+ * @param {Number} offset Distance of position offset dictated by other marker series in the same graph.+ * @return Object+ * @private+ */+ _getMarkerDimensions: function(xcoord, ycoord, calculatedSize, offset)+ {+ var config = {+ top: ycoord + offset+ };+ if(xcoord >= this._leftOrigin)+ {+ config.left = this._leftOrigin;+ config.calculatedSize = xcoord - config.left;+ }+ else+ {+ config.left = xcoord;+ config.calculatedSize = this._leftOrigin - xcoord;+ }+ return config;+ },+ + /**+ * Resizes and positions markers based on a mouse interaction.+ *+ * @method updateMarkerState+ * @param {String} type state of the marker+ * @param {Number} i index of the marker+ * @protected+ */+ updateMarkerState: function(type, i)+ {+ if(this._markers && this._markers[i])+ {+ var styles = Y.clone(this.get("styles").marker),+ markerStyles,+ state = this._getState(type),+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ marker = this._markers[i],+ markers,+ graph = this.get("graph"),+ seriesCollection = graph.seriesTypes[this.get("type")],+ seriesLen = seriesCollection.length,+ seriesStyles,+ seriesSize = 0,+ offset = 0,+ renderer,+ n = 0,+ ys = [],+ order = this.get("order"),+ config;+ markerStyles = state == "off" || !styles[state] ? styles : styles[state]; + markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);+ markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);+ config = this._getMarkerDimensions(xcoords[i], ycoords[i], styles.height, offset);+ markerStyles.width = config.calculatedSize;+ markerStyles.height = Math.min(this._maxSize, markerStyles.height);+ marker.set(markerStyles);+ for(; n < seriesLen; ++n)+ {+ ys[n] = ycoords[i] + seriesSize;+ seriesStyles = seriesCollection[n].get("styles").marker;+ seriesSize += Math.min(this._maxSize, seriesStyles.height); + if(order > n)+ {+ offset = seriesSize;+ }+ offset -= seriesSize/2;+ }+ for(n = 0; n < seriesLen; ++n)+ {+ markers = seriesCollection[n].get("markers");+ if(markers)+ {+ renderer = markers[i];+ if(renderer && renderer !== undefined)+ {+ renderer.set("y", (ys[n] - seriesSize/2));+ }+ }+ }+ }+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default bar+ */+ type: {+ value: "bar"+ },++ /**+ * Indicates the direction of the category axis that the bars are plotted against.+ *+ * @attribute direction+ * @type String+ */+ direction: {+ value: "vertical"+ }+ + /**+ * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>height</dt><dd>indicates the width of the marker. The default value is 12.</dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});+/**+ * The AreaSeries class renders quantitative data on a graph by creating a fill between 0+ * and the relevant data points.+ *+ * @module charts+ * @submodule charts-base+ * @class AreaSeries+ * @extends CartesianSeries+ * @uses Fills+ * @constructor+ */+Y.AreaSeries = Y.Base.create("areaSeries", Y.CartesianSeries, [Y.Fills], {+ /**+ * @protected+ *+ * Renders the series. + *+ * @method drawSeries+ */+ drawSeries: function()+ {+ this.drawFill.apply(this, this._getClosingPoints());+ },+ + /**+ * @protected+ *+ * Method used by `styles` setter. Overrides base implementation.+ *+ * @method _setStyles+ * @param {Object} newStyles Hash of properties to update.+ * @return Object+ */+ _setStyles: function(val)+ {+ if(!val.area)+ {+ val = {area:val};+ }+ return Y.AreaSeries.superclass._setStyles.apply(this, [val]);+ },++ /**+ * @protected+ *+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ */+ _getDefaultStyles: function()+ {+ var styles = this._mergeStyles({area:this._getAreaDefaults()}, Y.AreaSeries.superclass._getDefaultStyles());+ return styles;+ }+},+{+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default area+ */+ type: {+ value:"area"+ }+ + /**+ * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values:+ *+ * <dl>+ * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be + * retrieved from the following array:+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++++ ++ +/**+ * AreaSplineSeries renders an area graph with data points connected by a curve.+ *+ * @module charts+ * @submodule charts-base+ * @class AreaSplineSeries+ * @constructor+ * @extends CartesianSeries+ * @uses Fills+ * @uses CurveUtil+ */+Y.AreaSplineSeries = Y.Base.create("areaSplineSeries", Y.AreaSeries, [Y.CurveUtil], {+ /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ this.drawAreaSpline();+ }+}, {+ ATTRS : {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default areaSpline+ */+ type: {+ value:"areaSpline"+ }+ + /**+ * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values:+ *+ * <dl>+ * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be + * retrieved from the following array:+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++/**+ * StackedAreaSplineSeries creates a stacked area chart with points data points connected by a curve.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedAreaSplineSeries+ * @constructor+ * @extends AreaSeries+ * @uses CurveUtil+ * @uses StackingUtil+ */+Y.StackedAreaSplineSeries = Y.Base.create("stackedAreaSplineSeries", Y.AreaSeries, [Y.CurveUtil, Y.StackingUtil], {+ /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ this._stackCoordinates();+ this.drawStackedAreaSpline();+ }+}, {+ ATTRS : {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedAreaSpline+ */+ type: {+ value:"stackedAreaSpline"+ }+ }+});++/**+ * The ComboSeries class renders a combination of lines, plots and area fills in a single series. Each+ * series type has a corresponding boolean attribute indicating if it is rendered. By default, lines and plots + * are rendered and area is not. + *+ * @module charts+ * @submodule charts-base+ * @class ComboSeries+ * @extends CartesianSeries + * @uses Fills+ * @uses Lines+ * @uses Plots+ * @constructor+ */+Y.ComboSeries = Y.Base.create("comboSeries", Y.CartesianSeries, [Y.Fills, Y.Lines, Y.Plots], {+ /**+ * @protected+ * + * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ if(this.get("showAreaFill"))+ {+ this.drawFill.apply(this, this._getClosingPoints());+ }+ if(this.get("showLines")) + {+ this.drawLines();+ }+ if(this.get("showMarkers"))+ {+ this.drawPlots();+ } + },+ + /**+ * Toggles visibility+ *+ * @method _toggleVisible+ * @param {Boolean} visible indicates visibilitye+ * @private+ */+ _toggleVisible: function(visible)+ {+ var markers,+ marker,+ len,+ i;+ if(this.get("showAreaFill") && this._path)+ {+ this._path.set("visible", visible);+ }+ if(this.get("showLines") && this._lineGraphic)+ {+ this._lineGraphic.set("visible", visible);+ }+ if(this.get("showMarkers"))+ {+ markers = this.get("markers");+ if(markers)+ {+ i = 0;+ len = markers.length;+ for(; i < len; ++i)+ {+ marker = markers[i];+ if(marker)+ {+ marker.set("visible", visible);+ }+ }+ }+ }+ },++ /**+ * @protected+ *+ * Returns the default hash for the `styles` attribute.+ *+ * @method _getDefaultStyles+ * @return Object+ */+ _getDefaultStyles: function()+ {+ var styles = Y.ComboSeries.superclass._getDefaultStyles();+ styles.line = this._getLineDefaults();+ styles.marker = this._getPlotDefaults();+ styles.area = this._getAreaDefaults();+ return styles;+ }+},+{+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default combo+ */+ type: {+ value:"combo"+ },++ /**+ * Indicates whether a fill is displayed.+ *+ * @attribute showAreaFill+ * @type Boolean+ * @default false+ */+ showAreaFill: {+ value: false+ },++ /**+ * Indicates whether lines are displayed.+ *+ * @attribute showLines+ * @type Boolean+ * @default true+ */+ showLines: {+ value: true+ },++ /**+ * Indicates whether markers are displayed.+ *+ * @attribute showMarkers+ * @type Boolean+ * @default true+ */+ showMarkers: {+ value: true+ },++ /**+ * Reference to the styles of the markers. These styles can also+ * be accessed through the `styles` attribute. Below are default+ * values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"]`+ * </dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>width</dt><dd>indicates the width of the marker. The default value is 10.</dd>+ * <dt>height</dt><dd>indicates the height of the marker The default value is 10.</dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute marker+ * @type Object+ */+ marker: {+ lazyAdd: false,+ getter: function()+ {+ return this.get("styles").marker;+ },+ setter: function(val)+ {+ this.set("styles", {marker:val});+ }+ },+ + /**+ * Reference to the styles of the lines. These styles can also be accessed through the `styles` attribute.+ * Below are the default values:+ * <dl>+ * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be+ * retrieved from the following array: + * `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]`+ * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>+ * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> + * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>+ * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>+ * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> + * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>+ * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>+ * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>+ * </dl>+ *+ * @attribute line+ * @type Object+ */+ line: {+ lazyAdd: false,+ getter: function()+ {+ return this.get("styles").line;+ },+ setter: function(val)+ {+ this.set("styles", {line:val});+ }+ },+ + /**+ * Reference to the styles of the area fills. These styles can also be accessed through the `styles` attribute.+ * Below are the default values:+ *+ * <dl>+ * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be + * retrieved from the following array:+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>+ * </dl>+ *+ * @attribute area+ * @type Object+ */+ area: {+ lazyAdd: false,+ getter: function()+ {+ return this.get("styles").area;+ },+ setter: function(val)+ {+ this.set("styles", {area:val});+ }+ }++ /**+ * Style properties for the series. Contains a key indexed hash of the following:+ * <dl>+ * <dt>marker</dt><dd>Style properties for the markers in the series. Specific style attributes are listed+ * <a href="#attr_marker">here</a>.</dd>+ * <dt>line</dt><dd>Style properties for the lines in the series. Specific+ * style attributes are listed <a href="#attr_line">here</a>.</dd>+ * <dt>area</dt><dd>Style properties for the area fills in the series. Specific style attributes are listed+ * <a href="#attr_area">here</a>.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++++ ++ +/**+ * The StackedComboSeries class renders a combination of lines, plots and area fills in a single series. Series+ * are stacked along the value axis to indicate each series contribution to a cumulative total. Each+ * series type has a corresponding boolean attribute indicating if it is rendered. By default, all three types are+ * rendered. + *+ * @module charts+ * @submodule charts-base+ * @class StackedComboSeries+ * @extends ComboSeries+ * @uses StackingUtil+ * @constructor+ */+Y.StackedComboSeries = Y.Base.create("stackedComboSeries", Y.ComboSeries, [Y.StackingUtil], {+ /**+ * @protected+ *+ * Calculates the coordinates for the series. Overrides base implementation.+ *+ * @method setAreaData+ */+ setAreaData: function()+ { + Y.StackedComboSeries.superclass.setAreaData.apply(this);+ this._stackCoordinates.apply(this);+ },+ + /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ if(this.get("showAreaFill"))+ {+ this.drawFill.apply(this, this._getStackedClosingPoints());+ }+ if(this.get("showLines")) + {+ this.drawLines();+ }+ if(this.get("showMarkers"))+ {+ this.drawPlots();+ } + }+ +}, {+ ATTRS : {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedCombo+ */+ type: {+ value: "stackedCombo"+ },++ /**+ * Indicates whether a fill is displayed.+ *+ * @attribute showAreaFill+ * @type Boolean+ * @default true+ */+ showAreaFill: {+ value: true+ }+ }+});+/**+ * The ComboSplineSeries class renders a combination of splines, plots and areaspline fills in a single series. Each+ * series type has a corresponding boolean attribute indicating if it is rendered. By default, splines and plots + * are rendered and areaspline is not. + *+ * @module charts+ * @submodule charts-base+ * @class ComboSplineSeries+ * @extends ComboSeries+ * @extends CurveUtil+ * @constructor+ */+Y.ComboSplineSeries = Y.Base.create("comboSplineSeries", Y.ComboSeries, [Y.CurveUtil], {+ /**+ * @protected+ * + * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ if(this.get("showAreaFill"))+ {+ this.drawAreaSpline();+ }+ if(this.get("showLines")) + {+ this.drawSpline();+ }+ if(this.get("showMarkers"))+ {+ this.drawPlots();+ } + }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default comboSpline+ */+ type: {+ value : "comboSpline"+ }+ }+});+/**+ * The StackedComboSplineSeries class renders a combination of splines, plots and areaspline fills in a single series. Series+ * are stacked along the value axis to indicate each series contribution to a cumulative total. Each+ * series type has a corresponding boolean attribute indicating if it is rendered. By default, all three types are+ * rendered. + *+ * @module charts+ * @submodule charts-base+ * @class StackedComboSplineSeries+ * @extends StackedComboSeries+ * @uses CurveUtil+ * @constructor+ */+Y.StackedComboSplineSeries = Y.Base.create("stackedComboSplineSeries", Y.StackedComboSeries, [Y.CurveUtil], {+ /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ if(this.get("showAreaFill"))+ {+ this.drawStackedAreaSpline();+ }+ if(this.get("showLines")) + {+ this.drawSpline();+ }+ if(this.get("showMarkers"))+ {+ this.drawPlots();+ } + }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedComboSpline+ */+ type : {+ value : "stackedComboSpline"+ },++ /**+ * Indicates whether a fill is displayed.+ *+ * @attribute showAreaFill+ * @type Boolean+ * @default true+ */+ showAreaFill: {+ value: true+ }+ }+});+/**+ * StackedLineSeries creates line graphs in which the different series are stacked along a value axis+ * to indicate their contribution to a cumulative total.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedLineSeries+ * @constructor+ * @extends LineSeries+ * @uses StackingUtil+ */+Y.StackedLineSeries = Y.Base.create("stackedLineSeries", Y.LineSeries, [Y.StackingUtil], {+ /**+ * @protected+ *+ * Calculates the coordinates for the series. Overrides base implementation.+ *+ * @method setAreaData+ */+ setAreaData: function()+ { + Y.StackedLineSeries.superclass.setAreaData.apply(this);+ this._stackCoordinates.apply(this);+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedLine+ */+ type: {+ value:"stackedLine"+ }+ }+});+/**+ * StackedAreaSeries area fills to display data showing its contribution to a whole.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedAreaSeries+ * @constructor+ * @param {Object} config (optional) Configuration parameters for the Chart.+ * @extends AreaSeries+ * @uses StackingUtil+ */+Y.StackedAreaSeries = Y.Base.create("stackedAreaSeries", Y.AreaSeries, [Y.StackingUtil], {+ /**+ * @protected+ *+ * Calculates the coordinates for the series. Overrides base implementation.+ *+ * @method setAreaData+ */+ setAreaData: function()+ { + Y.StackedAreaSeries.superclass.setAreaData.apply(this);+ this._stackCoordinates.apply(this);+ },++ /**+ * @protected+ *+ * Draws the series+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ this.drawFill.apply(this, this._getStackedClosingPoints());+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedArea+ */+ type: {+ value:"stackedArea"+ }+ }+});+/**+ * The StackedColumnSeries renders column chart in which series are stacked vertically to show+ * their contribution to the cumulative total.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedColumnSeries+ * @extends ColumnSeries+ * @uses StackingUtil+ * @constructor+ */+Y.StackedColumnSeries = Y.Base.create("stackedColumnSeries", Y.ColumnSeries, [Y.StackingUtil], {+ /**+ * Draws the series.+ *+ * @method drawSeries+ * @protected+ */+ drawSeries: function()+ {+ if(this.get("xcoords").length < 1) + {+ return;+ }+ var isNumber = Y_Lang.isNumber,+ style = Y.clone(this.get("styles").marker), + w = style.width,+ h = style.height,+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ i = 0,+ len = xcoords.length,+ top = ycoords[0],+ type = this.get("type"),+ graph = this.get("graph"),+ seriesCollection = graph.seriesTypes[type],+ ratio,+ order = this.get("order"),+ graphOrder = this.get("graphOrder"),+ left,+ marker,+ fillColors,+ borderColors,+ lastCollection,+ negativeBaseValues,+ positiveBaseValues,+ useOrigin = order === 0,+ totalWidth = len * w,+ dimensions = {+ width: [],+ height: []+ },+ xvalues = [],+ yvalues = [],+ groupMarkers = this.get("groupMarkers");+ if(Y_Lang.isArray(style.fill.color))+ {+ fillColors = style.fill.color.concat(); + }+ if(Y_Lang.isArray(style.border.color))+ {+ borderColors = style.border.color.concat();+ }+ this._createMarkerCache();+ if(totalWidth > this.get("width"))+ {+ ratio = this.width/totalWidth;+ w *= ratio;+ w = Math.max(w, 1);+ }+ if(!useOrigin)+ {+ lastCollection = seriesCollection[order - 1];+ negativeBaseValues = lastCollection.get("negativeBaseValues");+ positiveBaseValues = lastCollection.get("positiveBaseValues");+ if(!negativeBaseValues || !positiveBaseValues)+ {+ useOrigin = true;+ positiveBaseValues = [];+ negativeBaseValues = [];+ }+ }+ else+ {+ negativeBaseValues = [];+ positiveBaseValues = [];+ }+ this.set("negativeBaseValues", negativeBaseValues);+ this.set("positiveBaseValues", positiveBaseValues);+ for(i = 0; i < len; ++i)+ {+ left = xcoords[i];+ top = ycoords[i];+ + if(!isNumber(top) || !isNumber(left))+ {+ if(useOrigin)+ {+ negativeBaseValues[i] = this._bottomOrigin;+ positiveBaseValues[i] = this._bottomOrigin;+ }+ this._markers.push(null); + continue;+ }+ if(useOrigin)+ {+ h = Math.abs(this._bottomOrigin - top);+ if(top < this._bottomOrigin)+ {+ positiveBaseValues[i] = top;+ negativeBaseValues[i] = this._bottomOrigin;+ }+ else if(top > this._bottomOrigin)+ {+ positiveBaseValues[i] = this._bottomOrigin;+ negativeBaseValues[i] = top;+ top -= h;+ }+ else+ {+ positiveBaseValues[i] = top;+ negativeBaseValues[i] = top;+ }+ }+ else + {+ if(top > this._bottomOrigin)+ {+ top += (negativeBaseValues[i] - this._bottomOrigin);+ h = top - negativeBaseValues[i];+ negativeBaseValues[i] = top;+ top -= h;+ }+ else if(top <= this._bottomOrigin)+ {+ top = positiveBaseValues[i] - (this._bottomOrigin - top);+ h = positiveBaseValues[i] - top;+ positiveBaseValues[i] = top;+ }+ }+ if(!isNaN(h) && h > 0)+ {+ left -= w/2;+ if(groupMarkers)+ {+ dimensions.width[i] = w;+ dimensions.height[i] = h;+ xvalues.push(left);+ yvalues.push(top);+ }+ else+ {+ style.width = w;+ style.height = h;+ style.x = left;+ style.y = top;+ if(fillColors)+ {+ style.fill.color = fillColors[i % fillColors.length];+ }+ if(borderColors)+ {+ style.border.color = borderColors[i % borderColors.length];+ }+ marker = this.getMarker(style, graphOrder, i);+ }+ }+ else if(!groupMarkers)+ {+ this._markers.push(null);+ }+ }+ if(groupMarkers)+ {+ this._createGroupMarker({+ fill: style.fill,+ border: style.border,+ dimensions: dimensions,+ xvalues: xvalues,+ yvalues: yvalues,+ shape: style.shape+ });+ }+ else+ {+ this._clearMarkerCache();+ }+ },++ /**+ * Resizes and positions markers based on a mouse interaction.+ *+ * @method updateMarkerState+ * @param {String} type state of the marker+ * @param {Number} i index of the marker+ * @protected+ */+ updateMarkerState: function(type, i)+ {+ if(this._markers && this._markers[i])+ {+ var styles,+ markerStyles,+ state = this._getState(type),+ xcoords = this.get("xcoords"),+ marker = this._markers[i],+ offset = 0,+ fillColor,+ borderColor; + styles = this.get("styles").marker;+ offset = styles.width * 0.5;+ markerStyles = state == "off" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]); + markerStyles.height = marker.get("height");+ markerStyles.x = (xcoords[i] - offset);+ markerStyles.y = marker.get("y");+ markerStyles.id = marker.get("id");+ fillColor = markerStyles.fill.color; + borderColor = markerStyles.border.color;+ if(Y_Lang.isArray(fillColor))+ {+ markerStyles.fill.color = fillColor[i % fillColor.length];+ }+ else+ {+ markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);+ }+ if(Y_Lang.isArray(borderColor))+ {+ markerStyles.border.color = borderColor[i % borderColor.length];+ }+ else+ {+ markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);+ }+ marker.set(markerStyles);+ }+ },+ + /**+ * Gets the default values for the markers. + *+ * @method _getPlotDefaults+ * @return Object+ * @protected+ */+ _getPlotDefaults: function()+ {+ var defs = {+ fill:{+ type: "solid",+ alpha: 1,+ colors:null,+ alphas: null,+ ratios: null+ },+ border:{+ weight: 0,+ alpha: 1+ },+ width: 24,+ height: 24,+ shape: "rect",++ padding:{+ top: 0,+ left: 0,+ right: 0,+ bottom: 0+ }+ };+ defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");+ defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");+ return defs;+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedColumn+ */+ type: {+ value: "stackedColumn"+ },++ /**+ * @attribute negativeBaseValues+ * @type Array+ * @default null+ * @private+ */+ negativeBaseValues: {+ value: null+ },++ /**+ * @attribute positiveBaseValues+ * @type Array+ * @default null+ * @private+ */+ positiveBaseValues: {+ value: null+ }+ + /**+ * Style properties used for drawing markers. This attribute is inherited from `ColumnSeries`. Below are the default values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>width</dt><dd>indicates the width of the marker. The default value is 24.</dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++/**+ * The StackedBarSeries renders bar chart in which series are stacked horizontally to show+ * their contribution to the cumulative total.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedBarSeries+ * @extends BarSeries+ * @uses StackingUtil+ * @constructor+ */+Y.StackedBarSeries = Y.Base.create("stackedBarSeries", Y.BarSeries, [Y.StackingUtil], {+ /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ if(this.get("xcoords").length < 1) + {+ return;+ }++ var isNumber = Y_Lang.isNumber,+ style = Y.clone(this.get("styles").marker),+ w = style.width,+ h = style.height,+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ i = 0,+ len = xcoords.length,+ top = ycoords[0],+ type = this.get("type"),+ graph = this.get("graph"),+ seriesCollection = graph.seriesTypes[type],+ ratio,+ order = this.get("order"),+ graphOrder = this.get("graphOrder"),+ left,+ marker,+ lastCollection,+ negativeBaseValues,+ positiveBaseValues,+ fillColors,+ borderColors,+ useOrigin = order === 0,+ totalHeight = len * h,+ dimensions = {+ width: [],+ height: []+ },+ xvalues = [],+ yvalues = [],+ groupMarkers = this.get("groupMarkers");+ if(Y_Lang.isArray(style.fill.color))+ {+ fillColors = style.fill.color.concat(); + }+ if(Y_Lang.isArray(style.border.color))+ {+ borderColors = style.border.color.concat();+ }+ this._createMarkerCache();+ if(totalHeight > this.get("height"))+ {+ ratio = this.height/totalHeight;+ h *= ratio;+ h = Math.max(h, 1);+ }+ if(!useOrigin)+ {+ lastCollection = seriesCollection[order - 1];+ negativeBaseValues = lastCollection.get("negativeBaseValues");+ positiveBaseValues = lastCollection.get("positiveBaseValues");+ if(!negativeBaseValues || !positiveBaseValues)+ {+ useOrigin = true;+ positiveBaseValues = [];+ negativeBaseValues = [];+ }+ }+ else+ {+ negativeBaseValues = [];+ positiveBaseValues = [];+ }+ this.set("negativeBaseValues", negativeBaseValues);+ this.set("positiveBaseValues", positiveBaseValues);+ for(i = 0; i < len; ++i)+ {+ top = ycoords[i];+ left = xcoords[i];+ if(!isNumber(top) || !isNumber(left))+ {+ if(useOrigin)+ {+ positiveBaseValues[i] = this._leftOrigin;+ negativeBaseValues[i] = this._leftOrigin;+ }+ this._markers.push(null);+ continue;+ }+ if(useOrigin)+ {+ w = Math.abs(left - this._leftOrigin);+ if(left > this._leftOrigin)+ {+ positiveBaseValues[i] = left;+ negativeBaseValues[i] = this._leftOrigin;+ left -= w;+ }+ else if(left < this._leftOrigin)+ { + positiveBaseValues[i] = this._leftOrigin;+ negativeBaseValues[i] = left;+ }+ else+ {+ positiveBaseValues[i] = left;+ negativeBaseValues[i] = this._leftOrigin;+ }+ }+ else+ {+ if(left < this._leftOrigin)+ {+ left = negativeBaseValues[i] - (this._leftOrigin - xcoords[i]);+ w = negativeBaseValues[i] - left;+ negativeBaseValues[i] = left;+ }+ else if(left >= this._leftOrigin)+ {+ left += (positiveBaseValues[i] - this._leftOrigin);+ w = left - positiveBaseValues[i];+ positiveBaseValues[i] = left;+ left -= w;+ }+ }+ if(!isNaN(w) && w > 0)+ {+ top -= h/2;+ if(groupMarkers)+ {+ dimensions.width[i] = w;+ dimensions.height[i] = h;+ xvalues.push(left);+ yvalues.push(top);+ }+ else+ {+ style.width = w;+ style.height = h;+ style.x = left;+ style.y = top;+ if(fillColors)+ {+ style.fill.color = fillColors[i % fillColors.length];+ }+ if(borderColors)+ {+ style.border.color = borderColors[i % borderColors.length];+ }+ marker = this.getMarker(style, graphOrder, i);+ }+ }+ else if(!groupMarkers)+ {+ this._markers.push(null);+ }+ }+ if(groupMarkers)+ {+ this._createGroupMarker({+ fill: style.fill,+ border: style.border,+ dimensions: dimensions,+ xvalues: xvalues,+ yvalues: yvalues,+ shape: style.shape+ });+ }+ else+ {+ this._clearMarkerCache();+ }+ },++ /**+ * @protected+ *+ * Resizes and positions markers based on a mouse interaction.+ *+ * @method updateMarkerState+ * @param {String} type state of the marker+ * @param {Number} i index of the marker+ */+ updateMarkerState: function(type, i)+ {+ if(this._markers[i])+ {+ var state = this._getState(type),+ ycoords = this.get("ycoords"),+ marker = this._markers[i],+ styles = this.get("styles").marker,+ h = styles.height,+ markerStyles = state == "off" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]), + fillColor,+ borderColor; + markerStyles.y = (ycoords[i] - h/2);+ markerStyles.x = marker.get("x");+ markerStyles.width = marker.get("width");+ markerStyles.id = marker.get("id");+ fillColor = markerStyles.fill.color; + borderColor = markerStyles.border.color;+ if(Y_Lang.isArray(fillColor))+ {+ markerStyles.fill.color = fillColor[i % fillColor.length];+ }+ else+ {+ markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);+ }+ if(Y_Lang.isArray(borderColor))+ {+ markerStyles.border.color = borderColor[i % borderColor.length];+ }+ else+ {+ markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);+ }+ marker.set(markerStyles);+ }+ },+ + /**+ * @protected+ *+ * Returns default values for the `styles` attribute.+ * + * @method _getPlotDefaults+ * @return Object+ */+ _getPlotDefaults: function()+ {+ var defs = {+ fill:{+ type: "solid",+ alpha: 1,+ colors:null,+ alphas: null,+ ratios: null+ },+ border:{+ weight: 0,+ alpha: 1+ },+ width: 24,+ height: 24,+ shape: "rect",++ padding:{+ top: 0,+ left: 0,+ right: 0,+ bottom: 0+ }+ };+ defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");+ defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");+ return defs;+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedBar+ */+ type: {+ value: "stackedBar"+ },++ /**+ * Direction of the series+ *+ * @attribute direction+ * @type String+ * @default vertical+ */+ direction: {+ value: "vertical"+ },++ /**+ * @private+ *+ * @attribute negativeBaseValues+ * @type Array+ * @default null+ */+ negativeBaseValues: {+ value: null+ },++ /**+ * @private+ *+ * @attribute positiveBaseValues+ * @type Array+ * @default null+ */+ positiveBaseValues: {+ value: null+ }+ + /**+ * Style properties used for drawing markers. This attribute is inherited from `BarSeries`. Below are the default values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>height</dt><dd>indicates the width of the marker. The default value is 24.</dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++/**+ * PieSeries visualizes data as a circular chart divided into wedges which represent data as a + * percentage of a whole.+ *+ * @module charts+ * @submodule charts-base+ * @class PieSeries+ * @constructor+ * @extends MarkerSeries+ */+Y.PieSeries = Y.Base.create("pieSeries", Y.MarkerSeries, [], { + /**+ * Image map used for interactivity when rendered with canvas.+ *+ * @property _map+ * @type HTMLElement+ * @private+ */+ _map: null,++ /**+ * Image used for image map when rendered with canvas.+ *+ * @property _image+ * @type HTMLElement+ * @private+ */+ _image: null,++ /**+ * Creates or updates the image map when rendered with canvas.+ *+ * @method _setMap+ * @private+ */+ _setMap: function()+ {+ var id = "pieHotSpotMapi_" + Math.round(100000 * Math.random()),+ cb = this.get("graph").get("contentBox"),+ areaNode;+ if(this._image)+ {+ cb.removeChild(this._image);+ while(this._areaNodes && this._areaNodes.length > 0)+ {+ areaNode = this._areaNodes.shift();+ this._map.removeChild(areaNode);+ }+ cb.removeChild(this._map);+ }+ this._image = DOCUMENT.createElement("img"); + this._image.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==";+ cb.appendChild(this._image);+ this._image.setAttribute("usemap", "#" + id);+ this._image.style.zIndex = 3;+ this._image.style.opacity = 0;+ this._image.setAttribute("alt", "imagemap");+ this._map = DOCUMENT.createElement("map");+ this._map.style.zIndex = 5;+ cb.appendChild(this._map);+ this._map.setAttribute("name", id);+ this._map.setAttribute("id", id);+ this._areaNodes = [];+ },++ /**+ * Storage for `categoryDisplayName` attribute.+ *+ * @property _categoryDisplayName+ * @private+ */+ _categoryDisplayName: null,+ + /**+ * Storage for `valueDisplayName` attribute.+ *+ * @property _valueDisplayName+ * @private+ */+ _valueDisplayName: null,++ /**+ * Adds event listeners.+ *+ * @method addListeners+ * @private+ */+ addListeners: function()+ {+ var categoryAxis = this.get("categoryAxis"),+ valueAxis = this.get("valueAxis");+ if(categoryAxis)+ {+ categoryAxis.after("dataReady", Y.bind(this._categoryDataChangeHandler, this));+ categoryAxis.after("dataUpdate", Y.bind(this._categoryDataChangeHandler, this));+ }+ if(valueAxis)+ {+ valueAxis.after("dataReady", Y.bind(this._valueDataChangeHandler, this));+ valueAxis.after("dataUpdate", Y.bind(this._valueDataChangeHandler, this));+ }+ this.after("categoryAxisChange", this.categoryAxisChangeHandler);+ this.after("valueAxisChange", this.valueAxisChangeHandler);+ this.after("stylesChange", this._updateHandler);+ },+ + /**+ * Draws the series.+ *+ * @method validate+ * @private+ */+ validate: function()+ {+ this.draw();+ this._renderered = true;+ },++ /**+ * Event handler for the categoryAxisChange event.+ *+ * @method _categoryAxisChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _categoryAxisChangeHandler: function(e)+ {+ var categoryAxis = this.get("categoryAxis");+ categoryAxis.after("dataReady", Y.bind(this._categoryDataChangeHandler, this));+ categoryAxis.after("dataUpdate", Y.bind(this._categoryDataChangeHandler, this));+ },+ + /**+ * Event handler for the valueAxisChange event.+ *+ * @method _valueAxisChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _valueAxisChangeHandler: function(e)+ {+ var valueAxis = this.get("valueAxis");+ valueAxis.after("dataReady", Y.bind(this._valueDataChangeHandler, this));+ valueAxis.after("dataUpdate", Y.bind(this._valueDataChangeHandler, this));+ },+ + /**+ * Constant used to generate unique id.+ *+ * @property GUID+ * @type String+ * @private+ */+ GUID: "pieseries",+ + /**+ * Event handler for categoryDataChange event.+ *+ * @method _categoryDataChangeHandler+ * @param {Object} event Event object.+ * @private + */+ _categoryDataChangeHandler: function(event)+ {+ if(this._rendered && this.get("categoryKey") && this.get("valueKey"))+ {+ this.draw();+ }+ },++ /**+ * Event handler for valueDataChange event.+ *+ * @method _valueDataChangeHandler+ * @param {Object} event Event object.+ * @private + */+ _valueDataChangeHandler: function(event)+ {+ if(this._rendered && this.get("categoryKey") && this.get("valueKey"))+ {+ this.draw();+ }+ },+ + /**+ * Draws the series. Overrides the base implementation.+ *+ * @method draw+ * @protected+ */+ draw: function()+ {+ var graph = this.get("graph"),+ w = graph.get("width"),+ h = graph.get("height");+ if(isFinite(w) && isFinite(h) && w > 0 && h > 0)+ { + this._rendered = true;+ if(this._drawing)+ {+ this._callLater = true;+ return;+ }+ this._drawing = true;+ this._callLater = false;+ this.drawSeries();+ this._drawing = false;+ if(this._callLater)+ {+ this.draw();+ }+ else+ {+ this.fire("drawingComplete");+ }+ }+ },++ /**+ * Draws the markers+ *+ * @method drawPlots+ * @protected+ */+ drawPlots: function()+ {+ var values = this.get("valueAxis").getDataByKey(this.get("valueKey")).concat(),+ catValues = this.get("categoryAxis").getDataByKey(this.get("categoryKey")).concat(),+ totalValue = 0,+ itemCount = values.length,+ styles = this.get("styles").marker,+ fillColors = styles.fill.colors,+ fillAlphas = styles.fill.alphas || ["1"],+ borderColors = styles.border.colors,+ borderWeights = [styles.border.weight],+ borderAlphas = [styles.border.alpha],+ tbw = borderWeights.concat(),+ tbc = borderColors.concat(),+ tba = borderAlphas.concat(),+ tfc,+ tfa,+ padding = styles.padding,+ graph = this.get("graph"),+ minDimension = Math.min(graph.get("width"), graph.get("height")),+ w = minDimension - (padding.left + padding.right),+ h = minDimension - (padding.top + padding.bottom),+ startAngle = -90,+ halfWidth = w / 2,+ halfHeight = h / 2,+ radius = Math.min(halfWidth, halfHeight),+ i = 0,+ value,+ angle = 0,+ lc,+ la,+ lw,+ wedgeStyle,+ marker,+ graphOrder = this.get("graphOrder"),+ isCanvas = Y.Graphic.NAME == "canvasGraphic";+ for(; i < itemCount; ++i)+ {+ value = parseFloat(values[i]);+ + values.push(value);+ if(!isNaN(value))+ {+ totalValue += value;+ }+ }+ + tfc = fillColors ? fillColors.concat() : null;+ tfa = fillAlphas ? fillAlphas.concat() : null;+ this._createMarkerCache();+ if(isCanvas)+ {+ this._setMap();+ this._image.width = w;+ this._image.height = h;+ }+ for(i = 0; i < itemCount; i++)+ {+ value = values[i];+ if(totalValue === 0)+ {+ angle = 360 / values.length;+ }+ else+ {+ angle = 360 * (value / totalValue);+ }+ if(tfc && tfc.length < 1)+ {+ tfc = fillColors.concat();+ }+ if(tfa && tfa.length < 1)+ {+ tfa = fillAlphas.concat();+ }+ if(tbw && tbw.length < 1)+ {+ tbw = borderWeights.concat();+ }+ if(tbw && tbc.length < 1)+ {+ tbc = borderColors.concat();+ }+ if(tba && tba.length < 1)+ {+ tba = borderAlphas.concat();+ }+ lw = tbw ? tbw.shift() : null;+ lc = tbc ? tbc.shift() : null;+ la = tba ? tba.shift() : null;+ startAngle += angle;+ wedgeStyle = {+ border: {+ color:lc,+ weight:lw,+ alpha:la+ },+ fill: {+ color:tfc ? tfc.shift() : this._getDefaultColor(i, "slice"),+ alpha:tfa ? tfa.shift() : null+ },+ type: "pieslice",+ arc: angle,+ radius: radius,+ startAngle: startAngle,+ cx: halfWidth,+ cy: halfHeight,+ width: w,+ height: h+ };+ marker = this.getMarker(wedgeStyle, graphOrder, i);+ if(isCanvas)+ {+ this._addHotspot(wedgeStyle, graphOrder, i);+ }+ }+ this._clearMarkerCache();+ },++ /**+ * Adds an interactive map when rendering in canvas.+ *+ * @method _addHotspot+ * @param {Object} cfg Object containing data used to draw the hotspot+ * @param {Number} seriesIndex Index of series in the `seriesCollection`.+ * @param {Number} index Index of the marker using the hotspot.+ * @private+ */+ _addHotspot: function(cfg, seriesIndex, index)+ {+ var areaNode = DOCUMENT.createElement("area"),+ i = 1,+ x = cfg.cx,+ y = cfg.cy, + arc = cfg.arc,+ startAngle = cfg.startAngle - arc, + endAngle = cfg.startAngle,+ radius = cfg.radius, + ax = x + Math.cos(startAngle / 180 * Math.PI) * radius,+ ay = y + Math.sin(startAngle / 180 * Math.PI) * radius,+ bx = x + Math.cos(endAngle / 180 * Math.PI) * radius,+ by = y + Math.sin(endAngle / 180 * Math.PI) * radius,+ numPoints = Math.floor(arc/10) - 1,+ divAngle = (arc/(Math.floor(arc/10)) / 180) * Math.PI,+ angleCoord = Math.atan((ay - y)/(ax - x)),+ pts = x + ", " + y + ", " + ax + ", " + ay,+ cosAng,+ sinAng,+ multDivAng;+ for(i = 1; i <= numPoints; ++i)+ {+ multDivAng = divAngle * i;+ cosAng = Math.cos(angleCoord + multDivAng);+ sinAng = Math.sin(angleCoord + multDivAng);+ if(startAngle <= 90)+ {+ pts += ", " + (x + (radius * Math.cos(angleCoord + (divAngle * i))));+ pts += ", " + (y + (radius * Math.sin(angleCoord + (divAngle * i))));+ }+ else+ {+ pts += ", " + (x - (radius * Math.cos(angleCoord + (divAngle * i))));+ pts += ", " + (y - (radius * Math.sin(angleCoord + (divAngle * i))));+ }+ }+ pts += ", " + bx + ", " + by;+ pts += ", " + x + ", " + y;+ this._map.appendChild(areaNode);+ areaNode.setAttribute("class", SERIES_MARKER);+ areaNode.setAttribute("id", "hotSpot_" + seriesIndex + "_" + index);+ areaNode.setAttribute("shape", "polygon");+ areaNode.setAttribute("coords", pts);+ this._areaNodes.push(areaNode);++ },++ /**+ * Resizes and positions markers based on a mouse interaction.+ *+ * @method updateMarkerState+ * @param {String} type state of the marker+ * @param {Number} i index of the marker+ * @protected+ */+ updateMarkerState: function(type, i)+ {+ if(this._markers[i])+ {+ var state = this._getState(type),+ markerStyles,+ indexStyles,+ marker = this._markers[i],+ styles = this.get("styles").marker; + markerStyles = state == "off" || !styles[state] ? styles : styles[state]; + indexStyles = this._mergeStyles(markerStyles, {});+ indexStyles.fill.color = indexStyles.fill.colors[i % indexStyles.fill.colors.length];+ indexStyles.fill.alpha = indexStyles.fill.alphas[i % indexStyles.fill.alphas.length];+ marker.set(indexStyles);+ }+ },+ + /**+ * Creates a shape to be used as a marker.+ *+ * @method _createMarker+ * @param {Object} styles Hash of style properties.+ * @param {Number} order Order of the series.+ * @param {Number} index Index within the series associated with the marker.+ * @return Shape+ * @private+ */+ _createMarker: function(styles, order, index)+ {+ var graphic = this.get("graphic"),+ marker,+ cfg = Y.clone(styles);+ graphic.set("autoDraw", false);+ marker = graphic.addShape(cfg); + marker.addClass(SERIES_MARKER);+ return marker;+ },+ + /**+ * Creates a cache of markers for reuse.+ *+ * @method _createMarkerCache+ * @private+ */+ _clearMarkerCache: function()+ {+ var len = this._markerCache.length,+ i = 0,+ marker;+ for(; i < len; ++i)+ {+ marker = this._markerCache[i];+ if(marker)+ {+ marker.destroy();+ }+ }+ this._markerCache = [];+ },++ /**+ * Gets the default style values for the markers.+ *+ * @method _getPlotDefaults+ * @return Object+ * @private+ */+ _getPlotDefaults: function()+ {+ var defs = {+ padding:{+ top: 0,+ left: 0,+ right: 0,+ bottom: 0+ },+ fill:{+ alphas:["1"]+ },+ border: {+ weight: 0,+ alpha: 1+ }+ };+ defs.fill.colors = this._defaultSliceColors;+ defs.border.colors = this._defaultBorderColors;+ return defs;+ },++ /**+ * Collection of default colors used for lines in a series when not specified by user.+ *+ * @property _defaultLineColors+ * @type Array+ * @protected+ */+ _defaultLineColors:["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"],++ /**+ * Collection of default colors used for marker fills in a series when not specified by user.+ *+ * @property _defaultFillColors+ * @type Array+ * @protected+ */+ _defaultFillColors:["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"],+ + /**+ * Collection of default colors used for marker borders in a series when not specified by user.+ *+ * @property _defaultBorderColors+ * @type Array+ * @protected+ */+ _defaultBorderColors:["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"],+ + /**+ * Collection of default colors used for area fills, histogram fills and pie fills in a series when not specified by user.+ *+ * @property _defaultSliceColors+ * @type Array+ * @protected+ */+ _defaultSliceColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],++ /**+ * Colors used if style colors are not specified+ *+ * @method _getDefaultColor+ * @param {Number} index Index indicating the series order.+ * @param {String} type Indicates which type of object needs the color.+ * @return String+ * @protected+ */+ _getDefaultColor: function(index, type)+ {+ var colors = {+ line: this._defaultLineColors,+ fill: this._defaultFillColors,+ border: this._defaultBorderColors,+ slice: this._defaultSliceColors+ },+ col = colors[type],+ l = col.length;+ index = index || 0;+ if(index >= l)+ {+ index = index % l;+ }+ type = type || "fill";+ return colors[type][index];+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default pie+ */+ type: { + value: "pie"+ },+ + /**+ * Order of this instance of this `type`.+ *+ * @attribute order+ * @type Number+ */+ order: {},++ /**+ * Reference to the `Graph` in which the series is drawn into.+ *+ * @attribute graph+ * @type Graph+ */+ graph: {},+ + /**+ * Reference to the `Axis` instance used for assigning + * category values to the graph.+ *+ * @attribute categoryAxis+ * @type Axis+ */+ categoryAxis: {+ value: null,++ validator: function(value)+ {+ return value !== this.get("categoryAxis");+ }+ },+ + /**+ * Reference to the `Axis` instance used for assigning + * series values to the graph.+ *+ * @attribute categoryAxis+ * @type Axis+ */+ valueAxis: {+ value: null,++ validator: function(value)+ {+ return value !== this.get("valueAxis");+ }+ },++ /**+ * Indicates which array to from the hash of value arrays in + * the category `Axis` instance.+ *+ * @attribute categoryKey+ * @type String+ */+ categoryKey: {+ value: null,++ validator: function(value)+ {+ return value !== this.get("categoryKey");+ }+ },+ /**+ * Indicates which array to from the hash of value arrays in + * the value `Axis` instance.+ *+ * @attribute valueKey+ * @type String+ */+ valueKey: {+ value: null,++ validator: function(value)+ {+ return value !== this.get("valueKey");+ }+ },++ /**+ * Name used for for displaying category data+ *+ * @attribute categoryDisplayName+ * @type String+ */+ categoryDisplayName: {+ setter: function(val)+ {+ this._categoryDisplayName = val;+ return val;+ },++ getter: function()+ {+ return this._categoryDisplayName || this.get("categoryKey");+ }+ },++ /**+ * Name used for for displaying value data+ *+ * @attribute valueDisplayName+ * @type String+ */+ valueDisplayName: {+ setter: function(val)+ {+ this._valueDisplayName = val;+ return val;+ },++ getter: function()+ {+ return this._valueDisplayName || this.get("valueKey");+ }+ },+ + /**+ * @attribute slices+ * @type Array+ * @private+ */+ slices: null+ + /**+ * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>colors</dt><dd>An array of colors to be used for the marker fills. The color for each marker is retrieved from the + * array below:<br/>+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alphas</dt><dd>An array of alpha references (Number from 0 to 1) indicating the opacity of each marker fill. The default value is [1].</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>An array of colors to be used for the marker borders. The color for each marker is retrieved from the+ * array below:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});+/**+ * Gridlines draws gridlines on a Graph.+ *+ * @module charts+ * @submodule charts-base+ * @class Gridlines+ * @constructor+ * @extends Base+ * @uses Renderer+ */+Y.Gridlines = Y.Base.create("gridlines", Y.Base, [Y.Renderer], {+ /**+ * Reference to the `Path` element used for drawing Gridlines.+ *+ * @property _path+ * @type Path+ * @private+ */+ _path: null,++ /**+ * Removes the Gridlines.+ *+ * @method remove+ * @private+ */+ remove: function()+ {+ var path = this._path;+ if(path)+ {+ path.destroy();+ }+ },++ /**+ * Draws the gridlines+ *+ * @method draw+ * @protected+ */+ draw: function()+ {+ if(this.get("axis") && this.get("graph"))+ {+ this._drawGridlines();+ }+ },++ /**+ * Algorithm for drawing gridlines+ *+ * @method _drawGridlines+ * @private+ */+ _drawGridlines: function()+ {+ var path,+ axis = this.get("axis"),+ axisPosition = axis.get("position"),+ points,+ i = 0,+ l,+ direction = this.get("direction"),+ graph = this.get("graph"),+ w = graph.get("width"),+ h = graph.get("height"),+ line = this.get("styles").line,+ color = line.color,+ weight = line.weight,+ alpha = line.alpha,+ lineFunction = direction == "vertical" ? this._verticalLine : this._horizontalLine;+ if(isFinite(w) && isFinite(h) && w > 0 && h > 0)+ {+ if(axisPosition != "none" && axis && axis.get("tickPoints"))+ {+ points = axis.get("tickPoints");+ l = points.length;+ }+ else+ {+ points = [];+ l = axis.get("styles").majorUnit.count;+ for(; i < l; ++i)+ {+ points[i] = {+ x: w * (i/(l-1)),+ y: h * (i/(l-1))+ };+ }+ i = 0;+ }+ path = graph.get("gridlines");+ path.set("width", w);+ path.set("height", h);+ path.set("stroke", {+ weight: weight,+ color: color,+ opacity: alpha+ });+ for(; i < l; ++i)+ {+ lineFunction(path, points[i], w, h);+ }+ path.end();+ }+ },++ /**+ * Algorithm for horizontal lines.+ *+ * @method _horizontalLine+ * @param {Path} path Reference to path element+ * @param {Object} pt Coordinates corresponding to a major unit of an axis.+ * @param {Number} w Width of the Graph+ * @param {Number} h Height of the Graph+ * @private+ */+ _horizontalLine: function(path, pt, w, h)+ {+ path.moveTo(0, pt.y);+ path.lineTo(w, pt.y);+ },++ /**+ * Algorithm for vertical lines.+ *+ * @method _verticalLine+ * @param {Path} path Reference to path element+ * @param {Object} pt Coordinates corresponding to a major unit of an axis.+ * @param {Number} w Width of the Graph+ * @param {Number} h Height of the Graph+ * @private+ */+ _verticalLine: function(path, pt, w, h)+ {+ path.moveTo(pt.x, 0);+ path.lineTo(pt.x, h);+ },+ + /**+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ * @protected+ */+ _getDefaultStyles: function()+ {+ var defs = {+ line: {+ color:"#f0efe9",+ weight: 1,+ alpha: 1+ }+ };+ return defs;+ }++},+{+ ATTRS: {+ /**+ * Indicates the direction of the gridline.+ *+ * @attribute direction+ * @type String+ */+ direction: {},+ + /**+ * Indicate the `Axis` in which to bind+ * the gridlines.+ *+ * @attribute axis+ * @type Axis+ */+ axis: {},+ + /**+ * Indicates the `Graph` in which the gridlines + * are drawn.+ *+ * @attribute graph+ * @type Graph+ */+ graph: {}+ }+});+/**+ * Graph manages and contains series instances for a `CartesianChart`+ * instance.+ *+ * @module charts+ * @submodule charts-base+ * @class Graph+ * @constructor+ * @extends Widget+ * @uses Renderer+ */+Y.Graph = Y.Base.create("graph", Y.Widget, [Y.Renderer], {+ /**+ * @method bindUI+ * @private+ */+ bindUI: function()+ {+ var bb = this.get("boundingBox");+ bb.setStyle("position", "absolute");+ this.after("widthChange", this._sizeChangeHandler);+ this.after("heightChange", this._sizeChangeHandler);+ this.after("stylesChange", this._updateStyles);+ this.after("groupMarkersChange", this._drawSeries);+ },++ /**+ * @method syncUI+ * @private+ */+ syncUI: function()+ {+ var background,+ cb,+ bg,+ sc = this.get("seriesCollection"),+ series,+ i = 0,+ len = sc ? sc.length : 0,+ hgl = this.get("horizontalGridlines"),+ vgl = this.get("verticalGridlines");+ if(this.get("showBackground"))+ {+ background = this.get("background");+ cb = this.get("contentBox");+ bg = this.get("styles").background;+ bg.stroke = bg.border;+ bg.stroke.opacity = bg.stroke.alpha;+ bg.fill.opacity = bg.fill.alpha;+ bg.width = this.get("width");+ bg.height = this.get("height");+ bg.type = bg.shape;+ background.set(bg);+ }+ for(; i < len; ++i)+ {+ series = sc[i];+ if(series instanceof Y.CartesianSeries)+ {+ series.render();+ }+ }+ if(hgl && hgl instanceof Y.Gridlines)+ {+ hgl.draw();+ }+ if(vgl && vgl instanceof Y.Gridlines)+ {+ vgl.draw();+ }+ },+ + /**+ * Object of arrays containing series mapped to a series type.+ *+ * @property seriesTypes+ * @type Object+ * @private+ */+ seriesTypes: null,++ /**+ * Returns a series instance based on an index.+ * + * @method getSeriesByIndex+ * @param {Number} val index of the series+ * @return CartesianSeries+ */+ getSeriesByIndex: function(val)+ {+ var col = this.get("seriesCollection"),+ series;+ if(col && col.length > val)+ {+ series = col[val];+ }+ return series;+ },++ /**+ * Returns a series instance based on a key value.+ * + * @method getSeriesByKey+ * @param {String} val key value of the series+ * @return CartesianSeries+ */+ getSeriesByKey: function(val)+ {+ var obj = this._seriesDictionary,+ series;+ if(obj && obj.hasOwnProperty(val))+ {+ series = obj[val];+ }+ return series;+ },++ /**+ * Adds dispatcher to a `_dispatcher` used to+ * to ensure all series have redrawn before for firing event.+ *+ * @method addDispatcher+ * @param {CartesianSeries} val series instance to add+ * @protected+ */+ addDispatcher: function(val)+ {+ if(!this._dispatchers)+ {+ this._dispatchers = [];+ }+ this._dispatchers.push(val);+ },++ /**+ * Collection of series to be displayed in the graph.+ *+ * @property _seriesCollection+ * @type Array+ * @private + */+ _seriesCollection: null,+ + /**+ * Object containing key value pairs of `CartesianSeries` instances.+ *+ * @property _seriesDictionary+ * @type Object+ * @private+ */+ _seriesDictionary: null,++ /**+ * Parses series instances to be displayed in the graph.+ *+ * @method _parseSeriesCollection+ * @param {Array} Collection of `CartesianSeries` instances or objects container `CartesianSeries` attributes values.+ * @private+ */+ _parseSeriesCollection: function(val)+ {+ if(!val)+ {+ return;+ } + var len = val.length,+ i = 0,+ series,+ seriesKey;+ this._seriesCollection = [];+ this._seriesDictionary = {};+ this.seriesTypes = [];+ for(; i < len; ++i)+ { + series = val[i];+ if(!(series instanceof Y.CartesianSeries) && !(series instanceof Y.PieSeries))+ {+ this._createSeries(series);+ continue;+ }+ this._addSeries(series);+ }+ len = this._seriesCollection.length;+ for(i = 0; i < len; ++i)+ {+ series = this.get("seriesCollection")[i];+ seriesKey = series.get("direction") == "horizontal" ? "yKey" : "xKey";+ this._seriesDictionary[series.get(seriesKey)] = series;+ }+ },++ /**+ * Adds a series to the graph.+ *+ * @method _addSeries+ * @param {CartesianSeries} series Series to add to the graph.+ * @private+ */+ _addSeries: function(series)+ {+ var type = series.get("type"),+ seriesCollection = this.get("seriesCollection"),+ graphSeriesLength = seriesCollection.length,+ seriesTypes = this.seriesTypes,+ typeSeriesCollection; + if(!series.get("graph")) + {+ series.set("graph", this);+ }+ seriesCollection.push(series);+ if(!seriesTypes.hasOwnProperty(type))+ {+ this.seriesTypes[type] = [];+ }+ typeSeriesCollection = this.seriesTypes[type];+ series.set("graphOrder", graphSeriesLength);+ series.set("order", typeSeriesCollection.length);+ typeSeriesCollection.push(series);+ this.addDispatcher(series);+ series.after("drawingComplete", Y.bind(this._drawingCompleteHandler, this));+ this.fire("seriesAdded", series);+ },++ /**+ * Creates a `CartesianSeries` instance from an object containing attribute key value pairs. The key value pairs include attributes for the specific series and a type value which defines the type of+ * series to be used. + *+ * @method createSeries+ * @param {Object} seriesData Series attribute key value pairs.+ * @private+ */+ _createSeries: function(seriesData)+ {+ var type = seriesData.type,+ seriesCollection = this.get("seriesCollection"),+ seriesTypes = this.seriesTypes,+ typeSeriesCollection,+ seriesType,+ series;+ seriesData.graph = this;+ if(!seriesTypes.hasOwnProperty(type))+ {+ seriesTypes[type] = [];+ }+ typeSeriesCollection = seriesTypes[type];+ seriesData.graph = this;+ seriesData.order = typeSeriesCollection.length;+ seriesData.graphOrder = seriesCollection.length;+ seriesType = this._getSeries(seriesData.type);+ series = new seriesType(seriesData);+ this.addDispatcher(series);+ series.after("drawingComplete", Y.bind(this._drawingCompleteHandler, this));+ typeSeriesCollection.push(series);+ seriesCollection.push(series);+ if(this.get("rendered"))+ {+ series.render();+ }+ },+ + /**+ * String reference for pre-defined `Series` classes.+ *+ * @property _seriesMap+ * @type Object+ * @private+ */+ _seriesMap: {+ line : Y.LineSeries,+ column : Y.ColumnSeries,+ bar : Y.BarSeries,+ area : Y.AreaSeries,+ candlestick : Y.CandlestickSeries,+ ohlc : Y.OHLCSeries,+ stackedarea : Y.StackedAreaSeries,+ stackedline : Y.StackedLineSeries,+ stackedcolumn : Y.StackedColumnSeries,+ stackedbar : Y.StackedBarSeries,+ markerseries : Y.MarkerSeries,+ spline : Y.SplineSeries,+ areaspline : Y.AreaSplineSeries,+ stackedspline : Y.StackedSplineSeries,+ stackedareaspline : Y.StackedAreaSplineSeries,+ stackedmarkerseries : Y.StackedMarkerSeries,+ pie : Y.PieSeries,+ combo : Y.ComboSeries,+ stackedcombo : Y.StackedComboSeries,+ combospline : Y.ComboSplineSeries,+ stackedcombospline : Y.StackedComboSplineSeries+ },++ /**+ * Returns a specific `CartesianSeries` class based on key value from a look up table of a direct reference to a class. When specifying a key value, the following options+ * are available:+ *+ * <table>+ * <tr><th>Key Value</th><th>Class</th></tr>+ * <tr><td>line</td><td>Y.LineSeries</td></tr> + * <tr><td>column</td><td>Y.ColumnSeries</td></tr> + * <tr><td>bar</td><td>Y.BarSeries</td></tr> + * <tr><td>area</td><td>Y.AreaSeries</td></tr> + * <tr><td>stackedarea</td><td>Y.StackedAreaSeries</td></tr> + * <tr><td>stackedline</td><td>Y.StackedLineSeries</td></tr> + * <tr><td>stackedcolumn</td><td>Y.StackedColumnSeries</td></tr> + * <tr><td>stackedbar</td><td>Y.StackedBarSeries</td></tr> + * <tr><td>markerseries</td><td>Y.MarkerSeries</td></tr> + * <tr><td>spline</td><td>Y.SplineSeries</td></tr> + * <tr><td>areaspline</td><td>Y.AreaSplineSeries</td></tr> + * <tr><td>stackedspline</td><td>Y.StackedSplineSeries</td></tr>+ * <tr><td>stackedareaspline</td><td>Y.StackedAreaSplineSeries</td></tr>+ * <tr><td>stackedmarkerseries</td><td>Y.StackedMarkerSeries</td></tr>+ * <tr><td>pie</td><td>Y.PieSeries</td></tr>+ * <tr><td>combo</td><td>Y.ComboSeries</td></tr>+ * <tr><td>stackedcombo</td><td>Y.StackedComboSeries</td></tr>+ * <tr><td>combospline</td><td>Y.ComboSplineSeries</td></tr>+ * <tr><td>stackedcombospline</td><td>Y.StackedComboSplineSeries</td></tr>+ * </table>+ * + * When referencing a class directly, you can specify any of the above classes or any custom class that extends `CartesianSeries` or `PieSeries`.+ *+ * @method _getSeries+ * @param {String | Object} type Series type.+ * @return CartesianSeries+ * @private+ */+ _getSeries: function(type)+ {+ var seriesClass;+ if(Y_Lang.isString(type))+ {+ seriesClass = this._seriesMap[type];+ }+ else + {+ seriesClass = type;+ }+ return seriesClass;+ },++ /**+ * Event handler for marker events.+ *+ * @method _markerEventHandler+ * @param {Object} e Event object.+ * @private+ */+ _markerEventHandler: function(e)+ {+ var type = e.type,+ markerNode = e.currentTarget,+ strArr = markerNode.getAttribute("id").split("_"),+ series = this.getSeriesByIndex(strArr[1]),+ index = strArr[2];+ series.updateMarkerState(type, index);+ },++ /**+ * Collection of `CartesianSeries` instances to be redrawn.+ *+ * @property _dispatchers+ * @type Array+ * @private+ */+ _dispatchers: null,++ /**+ * Updates the `Graph` styles.+ *+ * @method _updateStyles+ * @private+ */+ _updateStyles: function()+ {+ var styles = this.get("styles").background,+ border = styles.border;+ border.opacity = border.alpha;+ styles.stroke = border;+ styles.fill.opacity = styles.fill.alpha;+ this.get("background").set(styles);+ this._sizeChangeHandler();+ },++ /**+ * Event handler for size changes.+ *+ * @method _sizeChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _sizeChangeHandler: function(e)+ {+ var hgl = this.get("horizontalGridlines"),+ vgl = this.get("verticalGridlines"),+ w = this.get("width"),+ h = this.get("height"),+ bg = this.get("styles").background,+ weight,+ background;+ if(bg && bg.border)+ {+ weight = bg.border.weight || 0;+ }+ if(this.get("showBackground"))+ {+ background = this.get("background");+ if(w && h)+ {+ background.set("width", w);+ background.set("height", h);+ }+ }+ if(this._gridlines)+ {+ this._gridlines.clear();+ }+ if(hgl && hgl instanceof Y.Gridlines)+ {+ hgl.draw();+ }+ if(vgl && vgl instanceof Y.Gridlines)+ {+ vgl.draw();+ }+ this._drawSeries();+ },++ /**+ * Draws each series.+ *+ * @method _drawSeries+ * @private+ */+ _drawSeries: function()+ {+ if(this._drawing)+ {+ this._callLater = true;+ return;+ }+ var sc,+ i,+ len,+ graphic = this.get("graphic");+ graphic.set("autoDraw", false);+ this._callLater = false;+ this._drawing = true;+ sc = this.get("seriesCollection");+ i = 0;+ len = sc ? sc.length : 0;+ for(; i < len; ++i)+ {+ sc[i].draw();+ if((!sc[i].get("xcoords") || !sc[i].get("ycoords")) && !sc[i] instanceof Y.PieSeries)+ {+ this._callLater = true;+ break;+ }+ }+ this._drawing = false;+ if(this._callLater)+ {+ this._drawSeries();+ }+ }, ++ /**+ * Event handler for series drawingComplete event.+ *+ * @method _drawingCompleteHandler+ * @param {Object} e Event object.+ * @private+ */+ _drawingCompleteHandler: function(e)+ {+ var series = e.currentTarget,+ graphic,+ index = Y.Array.indexOf(this._dispatchers, series);+ if(index > -1)+ {+ this._dispatchers.splice(index, 1);+ }+ if(this._dispatchers.length < 1)+ {+ graphic = this.get("graphic");+ if(!graphic.get("autoDraw"))+ {+ graphic._redraw();+ }+ this.fire("chartRendered");+ }+ },++ /**+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ * @protected+ */+ _getDefaultStyles: function()+ {+ var defs = {+ background: {+ shape: "rect",+ fill:{+ color:"#faf9f2"+ },+ border: {+ color:"#dad8c9",+ weight: 1+ }+ }+ };+ return defs;+ },++ /**+ * Destructor implementation Graph class. Removes all Graphic instances from the widget.+ *+ * @method destructor+ * @protected+ */+ destructor: function()+ {+ if(this._graphic)+ {+ this._graphic.destroy();+ this._graphic = null;+ }+ if(this._background)+ {+ this._background.get("graphic").destroy();+ this._background = null;+ }+ if(this._gridlines)+ {+ this._gridlines.get("graphic").destroy();+ this._gridlines = null;+ }+ }+}, {+ ATTRS: {+ /**+ * The x-coordinate for the graph.+ *+ * @attribute x+ * @type Number+ * @protected+ */+ x: {+ setter: function(val)+ {+ this.get("boundingBox").setStyle("left", val + "px");+ return val;+ }+ },++ /**+ * The y-coordinate for the graph.+ *+ * @attribute y+ * @type Number+ * @protected+ */+ y: {+ setter: function(val)+ {+ this.get("boundingBox").setStyle("top", val + "px");+ return val;+ }+ },++ /**+ * Reference to the chart instance using the graph.+ *+ * @attribute chart+ * @type ChartBase+ * @readOnly+ */+ chart: {},++ /**+ * Collection of series. When setting the `seriesCollection` the array can contain a combination of either+ * `CartesianSeries` instances or object literals with properties that will define a series.+ *+ * @attribute seriesCollection+ * @type CartesianSeries+ */+ seriesCollection: {+ getter: function()+ {+ return this._seriesCollection;+ },++ setter: function(val)+ {+ this._parseSeriesCollection(val);+ return this._seriesCollection;+ }+ },+ + /**+ * Indicates whether the `Graph` has a background.+ *+ * @attribute showBackground+ * @type Boolean+ * @default true+ */+ showBackground: {+ value: true+ },++ /**+ * Read-only hash lookup for all series on in the `Graph`.+ *+ * @attribute seriesDictionary+ * @type Object+ * @readOnly+ */+ seriesDictionary: {+ readOnly: true,++ getter: function()+ {+ return this._seriesDictionary;+ }+ },++ /**+ * Reference to the horizontal `Gridlines` instance.+ *+ * @attribute horizontalGridlines+ * @type Gridlines+ * @default null+ */+ horizontalGridlines: {+ value: null,++ setter: function(val)+ {+ var gl = this.get("horizontalGridlines");+ if(gl && gl instanceof Y.Gridlines)+ {+ gl.remove();+ }+ if(val instanceof Y.Gridlines)+ {+ gl = val;+ val.set("graph", this);+ return val;+ }+ else if(val && val.axis)+ {+ gl = new Y.Gridlines({direction:"horizontal", axis:val.axis, graph:this, styles:val.styles});+ return gl;+ }+ }+ },+ + /**+ * Reference to the vertical `Gridlines` instance.+ *+ * @attribute verticalGridlines+ * @type Gridlines+ * @default null+ */+ verticalGridlines: {+ value: null,++ setter: function(val)+ {+ var gl = this.get("verticalGridlines");+ if(gl && gl instanceof Y.Gridlines)+ {+ gl.remove();+ }+ if(val instanceof Y.Gridlines)+ {+ gl = val;+ val.set("graph", this);+ return val;+ }+ else if(val && val.axis)+ {+ gl = new Y.Gridlines({direction:"vertical", axis:val.axis, graph:this, styles:val.styles});+ return gl;+ }+ }+ },++ /**+ * Reference to graphic instance used for the background.+ *+ * @attribute background+ * @type Graphic+ * @readOnly+ */+ background: {+ getter: function()+ {+ if(!this._background)+ {+ this._backgroundGraphic = new Y.Graphic({render:this.get("contentBox")});+ this._backgroundGraphic.get("node").style.zIndex = 0; + this._background = this._backgroundGraphic.addShape({type: "rect"});+ }+ return this._background;+ }+ },++ /**+ * Reference to graphic instance used for gridlines.+ *+ * @attribute gridlines+ * @type Graphic+ * @readOnly+ */+ gridlines: {+ readOnly: true,++ getter: function()+ {+ if(!this._gridlines)+ {+ this._gridlinesGraphic = new Y.Graphic({render:this.get("contentBox")});+ this._gridlinesGraphic.get("node").style.zIndex = 1; + this._gridlines = this._gridlinesGraphic.addShape({type: "path"});+ }+ return this._gridlines;+ }+ },+ + /**+ * Reference to graphic instance used for series.+ *+ * @attribute graphic+ * @type Graphic+ * @readOnly+ */+ graphic: {+ readOnly: true,++ getter: function() + {+ if(!this._graphic)+ {+ this._graphic = new Y.Graphic({render:this.get("contentBox")});+ this._graphic.get("node").style.zIndex = 2; + this._graphic.set("autoDraw", false);+ }+ return this._graphic;+ }+ },++ /**+ * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.+ *+ * @attribute groupMarkers+ * @type Boolean+ */+ groupMarkers: {+ value: false+ }++ /**+ * Style properties used for drawing a background. Below are the default values:+ * <dl>+ * <dt>background</dt><dd>An object containing the following values:+ * <dl>+ * <dt>fill</dt><dd>Defines the style properties for the fill. Contains the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is #faf9f2.</dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the background fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>Defines the style properties for the border. Contains the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is #dad8c9.</dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the background border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * </dl>+ * </dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});+/**+ * The ChartBase class is an abstract class used to create charts.+ *+ * @module charts+ * @submodule charts-base+ * @class ChartBase+ * @constructor+ */+function ChartBase() {}++ChartBase.ATTRS = {+ /**+ * Data used to generate the chart.+ * + * @attribute dataProvider+ * @type Array+ */+ dataProvider: {+ lazyAdd: false,++ valueFn: function()+ {+ var defDataProvider = [];+ if(!this._seriesKeysExplicitlySet)+ {+ this._seriesKeys = this._buildSeriesKeys(defDataProvider);+ }+ return defDataProvider;+ },++ setter: function(val)+ {+ var dataProvider = this._setDataValues(val);+ if(!this._seriesKeysExplicitlySet)+ {+ this._seriesKeys = this._buildSeriesKeys(dataProvider);+ }+ return dataProvider;+ }+ },++ /**+ * A collection of keys that map to the series axes. If no keys are set,+ * they will be generated automatically depending on the data structure passed into + * the chart.+ *+ * @attribute seriesKeys+ * @type Array+ */+ seriesKeys: {+ getter: function()+ {+ return this._seriesKeys;+ },++ setter: function(val)+ {+ this._seriesKeysExplicitlySet = true;+ this._seriesKeys = val;+ return val;+ }+ },++ /**+ * Sets the `aria-label` for the chart.+ *+ * @attribute ariaLabel+ * @type String+ */+ ariaLabel: {+ value: "Chart Application",++ setter: function(val)+ {+ var cb = this.get("contentBox");+ if(cb)+ {+ cb.setAttribute("aria-label", val);+ }+ return val;+ }+ },+ + /**+ * Sets the aria description for the chart.+ *+ * @attribute ariaDescription+ * @type String+ */+ ariaDescription: {+ value: "Use the up and down keys to navigate between series. Use the left and right keys to navigate through items in a series.",++ setter: function(val)+ {+ if(this._description)+ {+ this._description.setContent("");+ this._description.appendChild(DOCUMENT.createTextNode(val));+ }+ return val;+ }+ },+ + /**+ * Reference to the default tooltip available for the chart.+ * <p>Contains the following properties:</p>+ * <dl>+ * <dt>node</dt><dd>Reference to the actual dom node</dd>+ * <dt>showEvent</dt><dd>Event that should trigger the tooltip</dd>+ * <dt>hideEvent</dt><dd>Event that should trigger the removal of a tooltip (can be an event or an array of events)</dd>+ * <dt>styles</dt><dd>A hash of style properties that will be applied to the tooltip node</dd>+ * <dt>show</dt><dd>Indicates whether or not to show the tooltip</dd>+ * <dt>markerEventHandler</dt><dd>Displays and hides tooltip based on marker events</dd>+ * <dt>planarEventHandler</dt><dd>Displays and hides tooltip based on planar events</dd>+ * <dt>markerLabelFunction</dt><dd>Reference to the function used to format a marker event triggered tooltip's text. The method contains + * the following arguments:+ * <dl>+ * <dt>categoryItem</dt><dd>An object containing the following:+ * <dl>+ * <dt>axis</dt><dd>The axis to which the category is bound.</dd>+ * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided).</dd>+ * <dt>key</dt><dd>The key of the category.</dd>+ * <dt>value</dt><dd>The value of the category.</dd>+ * </dl>+ * </dd>+ * <dt>valueItem</dt><dd>An object containing the following:+ * <dl>+ * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>+ * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>+ * <dt>key</dt><dd>The key for the series.</dd>+ * <dt>value</dt><dd>The value for the series item.</dd> + * </dl>+ * </dd>+ * <dt>itemIndex</dt><dd>The index of the item within the series.</dd>+ * <dt>series</dt><dd> The `CartesianSeries` instance of the item.</dd>+ * <dt>seriesIndex</dt><dd>The index of the series in the `seriesCollection`.</dd>+ * </dl>+ * The method returns an `HTMLElement` which is written into the DOM using `appendChild`. If you override this method and choose to return an html string, you+ * will also need to override the tooltip's `setTextFunction` method to accept an html string.+ * </dd>+ * <dt>planarLabelFunction</dt><dd>Reference to the function used to format a planar event triggered tooltip's text+ * <dl>+ * <dt>categoryAxis</dt><dd> `CategoryAxis` Reference to the categoryAxis of the chart.+ * <dt>valueItems</dt><dd>Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:+ * <dl>+ * <dt>axis</dt><dd>The value axis of the series.</dd>+ * <dt>key</dt><dd>The key for the series.</dd>+ * <dt>value</dt><dd>The value for the series item.</dd>+ * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>+ * </dl> + * </dd>+ * <dt>index</dt><dd>The index of the item within its series.</dd>+ * <dt>seriesArray</dt><dd>Array of series instances for each value item.</dd>+ * <dt>seriesIndex</dt><dd>The index of the series in the `seriesCollection`.</dd>+ * </dl>+ * </dd>+ * </dl>+ * The method returns an `HTMLElement` which is written into the DOM using `appendChild`. If you override this method and choose to return an html string, you+ * will also need to override the tooltip's `setTextFunction` method to accept an html string.+ * </dd>+ * <dt>setTextFunction</dt><dd>Method that writes content returned from `planarLabelFunction` or `markerLabelFunction` into the the tooltip node.+ * has the following signature:+ * <dl>+ * <dt>label</dt><dd>The `HTMLElement` that the content is to be added.</dd>+ * <dt>val</dt><dd>The content to be rendered into tooltip. This can be a `String` or `HTMLElement`. If an HTML string is used, it will be rendered as a+ * string.</dd>+ * </dl>+ * </dd>+ * </dl>+ * @attribute tooltip+ * @type Object+ */ + tooltip: {+ valueFn: "_getTooltip",++ setter: function(val)+ {+ return this._updateTooltip(val);+ }+ },++ /** + * The key value used for the chart's category axis. + *+ * @attribute categoryKey+ * @type String+ * @default category+ */+ categoryKey: {+ value: "category"+ },+ + /**+ * Indicates the type of axis to use for the category axis.+ *+ * <dl>+ * <dt>category</dt><dd>Specifies a `CategoryAxis`.</dd>+ * <dt>time</dt><dd>Specifies a `TimeAxis</dd>+ * </dl>+ *+ * @attribute categoryType+ * @type String+ * @default category+ */+ categoryType:{+ value:"category"+ },++ /**+ * Indicates the the type of interactions that will fire events.+ *+ * <dl>+ * <dt>marker</dt><dd>Events will be broadcasted when the mouse interacts with individual markers.</dd>+ * <dt>planar</dt><dd>Events will be broadcasted when the mouse intersects the plane of any markers on the chart.</dd>+ * <dt>none</dt><dd>No events will be broadcasted.</dd>+ * </dl>+ *+ * @attribute interactionType+ * @type String+ * @default marker+ */+ interactionType: {+ value: "marker"+ },++ /**+ * Reference to all the axes in the chart.+ *+ * @attribute axesCollection+ * @type Array+ */+ axesCollection: {},++ /**+ * Reference to graph instance.+ * + * @attribute graph+ * @type Graph + */+ graph: {+ valueFn: "_getGraph"+ },++ /**+ * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.+ *+ * @attribute groupMarkers+ * @type Boolean+ */+ groupMarkers: {+ value: false+ }+};++ChartBase.prototype = {+ /**+ * Handles groupMarkers change event.+ *+ * @method _groupMarkersChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _groupMarkersChangeHandler: function(e)+ {+ var graph = this.get("graph"),+ useGroupMarkers = e.newVal;+ if(graph)+ {+ graph.set("groupMarkers", useGroupMarkers);+ }+ },++ /**+ * Handler for itemRendered event.+ *+ * @method _itemRendered+ * @param {Object} e Event object.+ * @private+ */+ _itemRendered: function(e)+ {+ this._itemRenderQueue = this._itemRenderQueue.splice(1 + Y.Array.indexOf(this._itemRenderQueue, e.currentTarget), 1);+ if(this._itemRenderQueue.length < 1)+ {+ this._redraw();+ }+ },++ /**+ * Default value function for the `Graph` attribute.+ *+ * @method _getGraph+ * @return Graph+ * @private+ */+ _getGraph: function()+ {+ var graph = new Y.Graph({+ chart:this,+ groupMarkers: this.get("groupMarkers") + });+ graph.after("chartRendered", Y.bind(function(e) {+ this.fire("chartRendered");+ }, this));+ return graph; + },++ /**+ * Returns a series instance by index or key value.+ *+ * @method getSeries+ * @param val+ * @return CartesianSeries+ */+ getSeries: function(val)+ {+ var series = null, + graph = this.get("graph");+ if(graph)+ {+ if(Y_Lang.isNumber(val))+ {+ series = graph.getSeriesByIndex(val);+ }+ else+ {+ series = graph.getSeriesByKey(val);+ }+ }+ return series;+ },++ /**+ * Returns an `Axis` instance by key reference. If the axis was explicitly set through the `axes` attribute,+ * the key will be the same as the key used in the `axes` object. For default axes, the key for+ * the category axis is the value of the `categoryKey` (`category`). For the value axis, the default + * key is `values`.+ *+ * @method getAxisByKey+ * @param {String} val Key reference used to look up the axis.+ * @return Axis+ */+ getAxisByKey: function(val)+ {+ var axis,+ axes = this.get("axes");+ if(axes && axes.hasOwnProperty(val))+ {+ axis = axes[val];+ }+ return axis;+ },++ /**+ * Returns the category axis for the chart.+ *+ * @method getCategoryAxis+ * @return Axis+ */+ getCategoryAxis: function()+ {+ var axis,+ key = this.get("categoryKey"),+ axes = this.get("axes");+ if(axes.hasOwnProperty(key))+ {+ axis = axes[key];+ }+ return axis;+ },++ /**+ * Default direction of the chart.+ *+ * @property _direction+ * @type String+ * @default horizontal+ * @private+ */+ _direction: "horizontal",+ + /**+ * Storage for the `dataProvider` attribute.+ *+ * @property _dataProvider+ * @type Array+ * @private+ */+ _dataProvider: null,++ /**+ * Setter method for `dataProvider` attribute.+ *+ * @method _setDataValues+ * @param {Array} val Array to be set as `dataProvider`.+ * @return Array+ * @private+ */+ _setDataValues: function(val)+ {+ if(Y_Lang.isArray(val[0]))+ {+ var hash, + dp = [], + cats = val[0], + i = 0, + l = cats.length, + n, + sl = val.length;+ for(; i < l; ++i)+ {+ hash = {category:cats[i]};+ for(n = 1; n < sl; ++n)+ {+ hash["series" + n] = val[n][i];+ }+ dp[i] = hash; + }+ return dp;+ }+ return val;+ },++ /**+ * Storage for `seriesCollection` attribute.+ *+ * @property _seriesCollection+ * @type Array+ * @private + */+ _seriesCollection: null,++ /**+ * Setter method for `seriesCollection` attribute.+ *+ * @property _setSeriesCollection+ * @param {Array} val Array of either `CartesianSeries` instances or objects containing series attribute key value pairs.+ * @private+ */+ _setSeriesCollection: function(val)+ {+ this._seriesCollection = val;+ },+ /**+ * Helper method that returns the axis class that a key references.+ *+ * @method _getAxisClass+ * @param {String} t The type of axis.+ * @return Axis+ * @private+ */+ _getAxisClass: function(t)+ {+ return this._axisClass[t];+ },+ + /**+ * Key value pairs of axis types. + *+ * @property _axisClass+ * @type Object+ * @private+ */+ _axisClass: {+ stacked: Y.StackedAxis,+ numeric: Y.NumericAxis,+ category: Y.CategoryAxis,+ time: Y.TimeAxis+ },++ /**+ * Collection of axes.+ *+ * @property _axes+ * @type Array+ * @private+ */+ _axes: null,++ /**+ * @method initializer+ * @private+ */+ initializer: function()+ {+ this._itemRenderQueue = [];+ this._seriesIndex = -1;+ this._itemIndex = -1;+ this.after("dataProviderChange", this._dataProviderChangeHandler);+ },++ /**+ * @method renderUI+ * @private+ */+ renderUI: function()+ {+ var tt = this.get("tooltip"),+ bb = this.get("boundingBox"),+ cb = this.get("contentBox");+ //move the position = absolute logic to a class file+ bb.setStyle("position", "absolute");+ cb.setStyle("position", "absolute");+ this._addAxes();+ this._addSeries();+ if(tt && tt.show)+ {+ this._addTooltip();+ }+ this._setAriaElements(bb, cb);+ },+ + /**+ * Creates an aria `live-region`, `aria-label` and `aria-describedby` for the Chart.+ *+ * @method _setAriaElements+ * @param {Node} cb Reference to the Chart's `contentBox` attribute.+ * @private+ */+ _setAriaElements: function(bb, cb)+ {+ var description = this._getAriaOffscreenNode(),+ id = this.get("id") + "_description",+ liveRegion = this._getAriaOffscreenNode();+ cb.set("tabIndex", 0);+ cb.set("role", "img");+ cb.setAttribute("aria-label", this.get("ariaLabel"));+ cb.setAttribute("aria-describedby", id);+ description.set("id", id);+ description.set("tabIndex", -1);+ description.appendChild(DOCUMENT.createTextNode(this.get("ariaDescription")));+ liveRegion.set("id", "live-region");+ liveRegion.set("aria-live", "polite");+ liveRegion.set("aria-atomic", "true");+ liveRegion.set("role", "status");+ bb.setAttribute("role", "application");+ bb.appendChild(description);+ bb.appendChild(liveRegion);+ this._description = description;+ this._liveRegion = liveRegion;+ },++ /**+ * Sets a node offscreen for use as aria-description or aria-live-regin.+ *+ * @method _setOffscreen+ * @return Node + * @private+ */+ _getAriaOffscreenNode: function() + {+ var node = Y.Node.create("<div></div>"),+ ie = Y.UA.ie,+ clipRect = (ie && ie < 8) ? "rect(1px 1px 1px 1px)" : "rect(1px, 1px, 1px, 1px)";+ node.setStyle("position", "absolute");+ node.setStyle("height", "1px"); + node.setStyle("width", "1px"); + node.setStyle("overflow", "hidden");+ node.setStyle("clip", clipRect); + return node;+ },+ + /**+ * @method syncUI+ * @private+ */+ syncUI: function()+ {+ this._redraw();+ },++ /**+ * @method bindUI+ * @private+ */+ bindUI: function()+ {+ this.after("tooltipChange", Y.bind(this._tooltipChangeHandler, this));+ this.after("widthChange", this._sizeChanged);+ this.after("heightChange", this._sizeChanged);+ this.after("groupMarkersChange", this._groupMarkersChangeHandler);+ var tt = this.get("tooltip"),+ hideEvent = "mouseout",+ showEvent = "mouseover",+ cb = this.get("contentBox"),+ interactionType = this.get("interactionType"),+ i = 0,+ len,+ markerClassName = "." + SERIES_MARKER,+ isTouch = ((WINDOW && ("ontouchstart" in WINDOW)) && !(Y.UA.chrome && Y.UA.chrome < 6));+ Y.on("keydown", Y.bind(function(e) {+ var key = e.keyCode,+ numKey = parseFloat(key),+ msg;+ if(numKey > 36 && numKey < 41)+ {+ e.halt();+ msg = this._getAriaMessage(numKey);+ this._liveRegion.setContent("");+ this._liveRegion.appendChild(DOCUMENT.createTextNode(msg));+ }+ }, this), this.get("contentBox"));+ if(interactionType == "marker")+ {+ //if touch capabilities, toggle tooltip on touchend. otherwise, the tooltip attribute's hideEvent/showEvent types.+ hideEvent = tt.hideEvent;+ showEvent = tt.showEvent;+ if(isTouch)+ {+ Y.delegate("touchend", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);+ //hide active tooltip if the chart is touched+ Y.on("touchend", Y.bind(function(e) {+ e.halt(true);+ if(this._activeMarker)+ {+ this._activeMarker = null;+ this.hideTooltip(e);+ }+ }, this));+ }+ else+ {+ Y.delegate("mouseenter", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);+ Y.delegate("mousedown", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);+ Y.delegate("mouseup", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);+ Y.delegate("mouseleave", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);+ Y.delegate("click", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);+ Y.delegate("mousemove", Y.bind(this._positionTooltip, this), cb, markerClassName);+ }+ }+ else if(interactionType == "planar")+ {+ if(isTouch)+ {+ this._overlay.on("touchend", Y.bind(this._planarEventDispatcher, this));+ }+ else+ {+ this._overlay.on("mousemove", Y.bind(this._planarEventDispatcher, this));+ this.on("mouseout", this.hideTooltip);+ }+ }+ if(tt)+ {+ this.on("markerEvent:touchend", Y.bind(function(e) {+ var marker = e.series.get("markers")[e.index];+ if(this._activeMarker && marker === this._activeMarker)+ {+ this._activeMarker = null;+ this.hideTooltip(e);+ }+ else+ {++ this._activeMarker = marker;+ tt.markerEventHandler.apply(this, [e]);+ }+ }, this));+ if(hideEvent && showEvent && hideEvent == showEvent)+ {+ this.on(interactionType + "Event:" + hideEvent, this.toggleTooltip);+ }+ else+ {+ if(showEvent)+ {+ this.on(interactionType + "Event:" + showEvent, tt[interactionType + "EventHandler"]);+ }+ if(hideEvent)+ {+ if(Y_Lang.isArray(hideEvent))+ {+ len = hideEvent.length;+ for(; i < len; ++i)+ {+ this.on(interactionType + "Event:" + hideEvent[i], this.hideTooltip);+ }+ }+ this.on(interactionType + "Event:" + hideEvent, this.hideTooltip);+ }+ }+ }+ },+ + /**+ * Event handler for marker events.+ *+ * @method _markerEventDispatcher+ * @param {Object} e Event object.+ * @private+ */+ _markerEventDispatcher: function(e)+ {+ var type = e.type,+ cb = this.get("contentBox"),+ markerNode = e.currentTarget,+ strArr = markerNode.getAttribute("id").split("_"),+ index = strArr.pop(),+ seriesIndex = strArr.pop(),+ series = this.getSeries(parseInt(seriesIndex, 10)),+ items = this.getSeriesItems(series, index),+ isTouch = e && e.hasOwnProperty("changedTouches"),+ pageX = isTouch ? e.changedTouches[0].pageX : e.pageX,+ pageY = isTouch ? e.changedTouches[0].pageY : e.pageY,+ x = pageX - cb.getX(),+ y = pageY - cb.getY();+ if(type == "mouseenter")+ {+ type = "mouseover";+ }+ else if(type == "mouseleave")+ {+ type = "mouseout";+ }+ series.updateMarkerState(type, index);+ e.halt();+ /**+ * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseover event.+ * + *+ * @event markerEvent:mouseover+ * @preventable false+ * @param {EventFacade} e Event facade with the following additional+ * properties:+ * <dl>+ * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>+ * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>+ * <dt>node</dt><dd>The dom node of the marker.</dd>+ * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>series</dt><dd>Reference to the series of the marker.</dd>+ * <dt>index</dt><dd>Index of the marker in the series.</dd>+ * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>+ * </dl>+ */+ /**+ * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseout event.+ *+ * @event markerEvent:mouseout+ * @preventable false+ * @param {EventFacade} e Event facade with the following additional+ * properties:+ * <dl>+ * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>+ * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>+ * <dt>node</dt><dd>The dom node of the marker.</dd>+ * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>series</dt><dd>Reference to the series of the marker.</dd>+ * <dt>index</dt><dd>Index of the marker in the series.</dd>+ * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>+ * </dl>+ */+ /**+ * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mousedown event.+ *+ * @event markerEvent:mousedown+ * @preventable false+ * @param {EventFacade} e Event facade with the following additional+ * properties:+ * <dl>+ * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>+ * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>+ * <dt>node</dt><dd>The dom node of the marker.</dd>+ * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>series</dt><dd>Reference to the series of the marker.</dd>+ * <dt>index</dt><dd>Index of the marker in the series.</dd>+ * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>+ * </dl>+ */+ /**+ * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseup event.+ *+ * @event markerEvent:mouseup+ * @preventable false+ * @param {EventFacade} e Event facade with the following additional+ * properties:+ * <dl>+ * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>+ * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>+ * <dt>node</dt><dd>The dom node of the marker.</dd>+ * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>series</dt><dd>Reference to the series of the marker.</dd>+ * <dt>index</dt><dd>Index of the marker in the series.</dd>+ * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>+ * </dl>+ */+ /**+ * Broadcasts when `interactionType` is set to `marker` and a series marker has received a click event.+ *+ * @event markerEvent:click+ * @preventable false+ * @param {EventFacade} e Event facade with the following additional+ * properties:+ * <dl>+ * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>+ * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>+ * <dt>node</dt><dd>The dom node of the marker.</dd>+ * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>pageX</dt><dd>The x location of the event on the page (including scroll)</dd>+ * <dt>pageY</dt><dd>The y location of the event on the page (including scroll)</dd>+ * <dt>series</dt><dd>Reference to the series of the marker.</dd>+ * <dt>index</dt><dd>Index of the marker in the series.</dd>+ * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>+ * <dt>originEvent</dt><dd>Underlying dom event.</dd>+ * </dl>+ */+ this.fire("markerEvent:" + type, {+ originEvent: e,+ pageX:pageX, + pageY:pageY, + categoryItem:items.category, + valueItem:items.value, + node:markerNode, + x:x, + y:y, + series:series, + index:index, + seriesIndex:seriesIndex+ });+ },++ /**+ * Event handler for dataProviderChange.+ *+ * @method _dataProviderChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _dataProviderChangeHandler: function(e)+ {+ var dataProvider = e.newVal,+ axes,+ i,+ axis;+ this._seriesIndex = -1;+ this._itemIndex = -1;+ if(this instanceof Y.CartesianChart)+ {+ this.set("axes", this.get("axes"));+ this.set("seriesCollection", this.get("seriesCollection"));+ }+ axes = this.get("axes");+ if(axes)+ {+ for(i in axes)+ {+ if(axes.hasOwnProperty(i))+ {+ axis = axes[i];+ if(axis instanceof Y.Axis)+ {+ if(axis.get("position") != "none")+ {+ this._addToAxesRenderQueue(axis);+ }+ axis.set("dataProvider", dataProvider);+ }+ }+ }+ }+ },+ + /**+ * Event listener for toggling the tooltip. If a tooltip is visible, hide it. If not, it + * will create and show a tooltip based on the event object.+ * + * @method toggleTooltip+ * @param {Object} e Event object.+ */+ toggleTooltip: function(e)+ {+ var tt = this.get("tooltip");+ if(tt.visible)+ {+ this.hideTooltip();+ }+ else+ {+ tt.markerEventHandler.apply(this, [e]);+ }+ },++ /**+ * Shows a tooltip+ *+ * @method _showTooltip+ * @param {String} msg Message to dispaly in the tooltip.+ * @param {Number} x x-coordinate + * @param {Number} y y-coordinate+ * @private+ */+ _showTooltip: function(msg, x, y)+ {+ var tt = this.get("tooltip"),+ node = tt.node;+ if(msg)+ {+ tt.visible = true;+ tt.setTextFunction(node, msg);+ node.setStyle("top", y + "px");+ node.setStyle("left", x + "px");+ node.setStyle("visibility", "visible");+ }+ },++ /**+ * Positions the tooltip+ *+ * @method _positionTooltip+ * @param {Object} e Event object.+ * @private+ */+ _positionTooltip: function(e)+ {+ var tt = this.get("tooltip"),+ node = tt.node,+ cb = this.get("contentBox"),+ x = (e.pageX + 10) - cb.getX(),+ y = (e.pageY + 10) - cb.getY();+ if(node)+ {+ node.setStyle("left", x + "px");+ node.setStyle("top", y + "px");+ }+ },++ /**+ * Hides the default tooltip+ *+ * @method hideTooltip+ */+ hideTooltip: function()+ {+ var tt = this.get("tooltip"),+ node = tt.node;+ tt.visible = false;+ node.set("innerHTML", "");+ node.setStyle("left", -10000);+ node.setStyle("top", -10000);+ node.setStyle("visibility", "hidden");+ },++ /**+ * Adds a tooltip to the dom.+ *+ * @method _addTooltip+ * @private+ */+ _addTooltip: function()+ {+ var tt = this.get("tooltip"),+ id = this.get("id") + "_tooltip",+ cb = this.get("contentBox"),+ oldNode = DOCUMENT.getElementById(id);+ if(oldNode)+ {+ cb.removeChild(oldNode);+ }+ tt.node.set("id", id);+ tt.node.setStyle("visibility", "hidden");+ cb.appendChild(tt.node);+ },++ /**+ * Updates the tooltip attribute.+ *+ * @method _updateTooltip+ * @param {Object} val Object containing properties for the tooltip.+ * @return Object+ * @private+ */+ _updateTooltip: function(val)+ {+ var tt = this.get("tooltip") || this._getTooltip(),+ i,+ styles,+ node,+ props = {+ markerLabelFunction:"markerLabelFunction",+ planarLabelFunction:"planarLabelFunction",+ setTextFunction:"setTextFunction",+ showEvent:"showEvent",+ hideEvent:"hideEvent",+ markerEventHandler:"markerEventHandler",+ planarEventHandler:"planarEventHandler",+ show:"show"+ };+ if(Y_Lang.isObject(val))+ {+ styles = val.styles;+ node = Y.one(val.node) || tt.node;+ if(styles)+ {+ for(i in styles)+ {+ if(styles.hasOwnProperty(i))+ {+ node.setStyle(i, styles[i]);+ }+ }+ }+ for(i in props)+ {+ if(val.hasOwnProperty(i))+ {+ tt[i] = val[i];+ }+ }+ tt.node = node;+ }+ return tt;+ },++ /**+ * Default getter for `tooltip` attribute.+ *+ * @method _getTooltip+ * @return Object+ * @private+ */+ _getTooltip: function()+ {+ var node = DOCUMENT.createElement("div"),+ tooltipClass = _getClassName("chart-tooltip"),+ tt = {+ setTextFunction: this._setText,+ markerLabelFunction: this._tooltipLabelFunction,+ planarLabelFunction: this._planarLabelFunction,+ show: true,+ hideEvent: "mouseout",+ showEvent: "mouseover",+ markerEventHandler: function(e)+ {+ var tt = this.get("tooltip"),+ msg = tt.markerLabelFunction.apply(this, [e.categoryItem, e.valueItem, e.index, e.series, e.seriesIndex]);+ this._showTooltip(msg, e.x + 10, e.y + 10);+ },+ planarEventHandler: function(e)+ {+ var tt = this.get("tooltip"),+ msg ,+ categoryAxis = this.get("categoryAxis");+ msg = tt.planarLabelFunction.apply(this, [categoryAxis, e.valueItem, e.index, e.items, e.seriesIndex]);+ this._showTooltip(msg, e.x + 10, e.y + 10);+ }+ };+ node = Y.one(node);+ node.set("id", this.get("id") + "_tooltip");+ node.setStyle("fontSize", "85%");+ node.setStyle("opacity", "0.83");+ node.setStyle("position", "absolute");+ node.setStyle("paddingTop", "2px");+ node.setStyle("paddingRight", "5px");+ node.setStyle("paddingBottom", "4px");+ node.setStyle("paddingLeft", "2px");+ node.setStyle("backgroundColor", "#fff");+ node.setStyle("border", "1px solid #dbdccc");+ node.setStyle("pointerEvents", "none");+ node.setStyle("zIndex", 3);+ node.setStyle("whiteSpace", "noWrap");+ node.setStyle("visibility", "hidden");+ node.addClass(tooltipClass);+ tt.node = Y.one(node);+ return tt;+ },++ /**+ * Formats tooltip text when `interactionType` is `planar`.+ *+ * @method _planarLabelFunction+ * @param {Axis} categoryAxis Reference to the categoryAxis of the chart.+ * @param {Array} valueItems Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:+ * <dl>+ * <dt>axis</dt><dd>The value axis of the series.</dd>+ * <dt>key</dt><dd>The key for the series.</dd>+ * <dt>value</dt><dd>The value for the series item.</dd>+ * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>+ * </dl> + * @param {Number} index The index of the item within its series.+ * @param {Array} seriesArray Array of series instances for each value item.+ * @param {Number} seriesIndex The index of the series in the `seriesCollection`.+ * @return {String | HTML} + * @private+ */+ _planarLabelFunction: function(categoryAxis, valueItems, index, seriesArray, seriesIndex)+ {+ var msg = DOCUMENT.createElement("div"),+ valueItem,+ i = 0,+ len = seriesArray.length,+ axis,+ categoryValue,+ seriesValue,+ series;+ if(categoryAxis)+ {+ categoryValue = categoryAxis.get("labelFunction").apply(this, [categoryAxis.getKeyValueAt(this.get("categoryKey"), index), categoryAxis.get("labelFormat")]);+ if(!Y_Lang.isObject(categoryValue))+ {+ categoryValue = DOCUMENT.createTextNode(categoryValue);+ }+ msg.appendChild(categoryValue);+ }++ for(; i < len; ++i)+ {+ series = seriesArray[i];+ if(series.get("visible"))+ {+ valueItem = valueItems[i];+ axis = valueItem.axis;+ seriesValue = axis.get("labelFunction").apply(this, [axis.getKeyValueAt(valueItem.key, index), axis.get("labelFormat")]);+ msg.appendChild(DOCUMENT.createElement("br"));+ msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName));+ msg.appendChild(DOCUMENT.createTextNode(": "));+ if(!Y_Lang.isObject(seriesValue))+ {+ seriesValue = DOCUMENT.createTextNode(seriesValue);+ }+ msg.appendChild(seriesValue);+ }+ }+ return msg;+ },++ /**+ * Formats tooltip text when `interactionType` is `marker`.+ *+ * @method _tooltipLabelFunction+ * @param {Object} categoryItem An object containing the following:+ * <dl>+ * <dt>axis</dt><dd>The axis to which the category is bound.</dd>+ * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided)</dd>+ * <dt>key</dt><dd>The key of the category.</dd>+ * <dt>value</dt><dd>The value of the category</dd>+ * </dl>+ * @param {Object} valueItem An object containing the following:+ * <dl>+ * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>+ * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>+ * <dt>key</dt><dd>The key for the series.</dd>+ * <dt>value</dt><dd>The value for the series item.</dd> + * </dl>+ * @param {Number} itemIndex The index of the item within the series.+ * @param {CartesianSeries} series The `CartesianSeries` instance of the item.+ * @param {Number} seriesIndex The index of the series in the `seriesCollection`.+ * @return {String | HTML}+ * @private+ */+ _tooltipLabelFunction: function(categoryItem, valueItem, itemIndex, series, seriesIndex)+ {+ var msg = DOCUMENT.createElement("div"),+ categoryValue = categoryItem.axis.get("labelFunction").apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]),+ seriesValue = valueItem.axis.get("labelFunction").apply(this, [valueItem.value, valueItem.axis.get("labelFormat")]);+ msg.appendChild(DOCUMENT.createTextNode(categoryItem.displayName)); + msg.appendChild(DOCUMENT.createTextNode(": ")); + if(!Y_Lang.isObject(categoryValue))+ {+ categoryValue = DOCUMENT.createTextNode(categoryValue);+ }+ msg.appendChild(categoryValue);+ msg.appendChild(DOCUMENT.createElement("br"));+ msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName)); + msg.appendChild(DOCUMENT.createTextNode(": ")); + if(!Y_Lang.isObject(seriesValue))+ {+ seriesValue = DOCUMENT.createTextNode(seriesValue);+ }+ msg.appendChild(seriesValue);+ return msg; + },++ /**+ * Event handler for the tooltipChange.+ *+ * @method _tooltipChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _tooltipChangeHandler: function(e)+ {+ if(this.get("tooltip"))+ {+ var tt = this.get("tooltip"),+ node = tt.node,+ show = tt.show,+ cb = this.get("contentBox");+ if(node && show)+ {+ if(!cb.contains(node))+ {+ this._addTooltip();+ }+ }+ }+ },+ + /**+ * Updates the content of text field. This method writes a value into a text field using + * `appendChild`. If the value is a `String`, it is converted to a `TextNode` first. + *+ * @method _setText+ * @param label {HTMLElement} label to be updated+ * @param val {String} value with which to update the label+ * @private+ */+ _setText: function(textField, val)+ { + textField.setContent("");+ if(Y_Lang.isNumber(val))+ {+ val = val + "";+ }+ else if(!val)+ {+ val = "";+ }+ if(IS_STRING(val))+ {+ val = DOCUMENT.createTextNode(val);+ }+ textField.appendChild(val);+ },++ /**+ * Returns all the keys contained in a `dataProvider`.+ *+ * @method _getAllKeys+ * @param {Array} dp Collection of objects to be parsed.+ * @return Object+ */+ _getAllKeys: function(dp)+ {+ var i = 0,+ len = dp.length,+ item,+ key,+ keys = {};+ for(; i < len; ++i)+ {+ item = dp[i];+ for(key in item)+ {+ if(item.hasOwnProperty(key))+ {+ keys[key] = true;+ }+ }+ }+ return keys;+ },+ + /**+ * Constructs seriesKeys if not explicitly specified.+ *+ * @method _buildSeriesKeys+ * @param {Array} dataProvider The dataProvider for the chart.+ * @return Array+ * @private+ */+ _buildSeriesKeys: function(dataProvider)+ {+ var allKeys,+ catKey = this.get("categoryKey"),+ keys = [],+ i;+ if(this._seriesKeysExplicitlySet)+ {+ return this._seriesKeys;+ }+ allKeys = this._getAllKeys(dataProvider);+ for(i in allKeys)+ {+ if(allKeys.hasOwnProperty(i) && i != catKey)+ {+ keys.push(i);+ }+ }+ return keys;+ }+};+Y.ChartBase = ChartBase;+/**+ * The CartesianChart class creates a chart with horizontal and vertical axes.+ *+ * @module charts+ * @submodule charts-base+ * @class CartesianChart+ * @extends ChartBase+ * @constructor+ */+Y.CartesianChart = Y.Base.create("cartesianChart", Y.Widget, [Y.ChartBase], {+ /**+ * @method renderUI+ * @private+ */+ renderUI: function()+ {+ var bb = this.get("boundingBox"),+ cb = this.get("contentBox"),+ tt = this.get("tooltip"),+ overlay,+ overlayClass = _getClassName("overlay");+ //move the position = absolute logic to a class file+ bb.setStyle("position", "absolute");+ cb.setStyle("position", "absolute");+ this._addAxes();+ this._addGridlines();+ this._addSeries();+ if(tt && tt.show)+ {+ this._addTooltip();+ }+ //If there is a style definition. Force them to set.+ this.get("styles");+ if(this.get("interactionType") == "planar")+ {+ overlay = DOCUMENT.createElement("div");+ this.get("contentBox").appendChild(overlay);+ this._overlay = Y.one(overlay); + this._overlay.set("id", this.get("id") + "_overlay");+ this._overlay.setStyle("position", "absolute");+ this._overlay.setStyle("background", "#fff");+ this._overlay.setStyle("opacity", 0);+ this._overlay.addClass(overlayClass);+ this._overlay.setStyle("zIndex", 4);+ }+ this._setAriaElements(bb, cb);+ this._redraw();+ },++ /**+ * When `interactionType` is set to `planar`, listens for mouse move events and fires `planarEvent:mouseover` or `planarEvent:mouseout` depending on the position of the mouse in relation to + * data points on the `Chart`.+ *+ * @method _planarEventDispatcher+ * @param {Object} e Event object.+ * @private+ */+ _planarEventDispatcher: function(e)+ {+ var graph = this.get("graph"),+ bb = this.get("boundingBox"),+ cb = graph.get("contentBox"),+ isTouch = e && e.hasOwnProperty("changedTouches"),+ pageX = isTouch ? e.changedTouches[0].pageX : e.pageX,+ pageY = isTouch ? e.changedTouches[0].pageY : e.pageY,+ posX = pageX - bb.getX(),+ posY = pageY - bb.getY(),+ offset = {+ x: pageX - cb.getX(),+ y: pageY - cb.getY()+ },+ sc = graph.get("seriesCollection"),+ series,+ i = 0,+ index,+ oldIndex = this._selectedIndex,+ item,+ items = [],+ categoryItems = [],+ valueItems = [],+ direction = this.get("direction"),+ hasMarkers,+ catAxis,+ valAxis,+ coord,+ //data columns and area data could be created on a graph level+ markerPlane,+ len,+ coords;+ e.halt(true);+ if(direction == "horizontal")+ {+ catAxis = "x";+ valAxis = "y";+ }+ else+ {+ valAxis = "x";+ catAxis = "y";+ }+ coord = offset[catAxis];+ if(sc)+ {+ len = sc.length;+ while(i < len && !markerPlane)+ {+ if(sc[i])+ {+ markerPlane = sc[i].get(catAxis + "MarkerPlane");+ }+ i++;+ }+ }+ if(markerPlane)+ {+ len = markerPlane.length;+ for(i = 0; i < len; ++i)+ {+ if(coord <= markerPlane[i].end && coord >= markerPlane[i].start)+ {+ index = i;+ break;+ }+ }+ len = sc.length;+ for(i = 0; i < len; ++i)+ {+ series = sc[i];+ coords = series.get(valAxis + "coords");+ hasMarkers = series.get("markers");+ if(hasMarkers && !isNaN(oldIndex) && oldIndex > -1)+ {+ series.updateMarkerState("mouseout", oldIndex);+ }+ if(coords && coords[index] > -1)+ {+ if(hasMarkers && !isNaN(index) && index > -1)+ {+ series.updateMarkerState("mouseover", index);+ }+ item = this.getSeriesItems(series, index);+ categoryItems.push(item.category);+ valueItems.push(item.value);+ items.push(series);+ }+ + }+ this._selectedIndex = index;++ /**+ * Broadcasts when `interactionType` is set to `planar` and a series' marker plane has received a mouseover event.+ * + *+ * @event planarEvent:mouseover+ * @preventable false+ * @param {EventFacade} e Event facade with the following additional+ * properties:+ * <dl>+ * <dt>categoryItem</dt><dd>An array of hashes, each containing information about the category `Axis` of each marker whose plane has been intersected.</dd>+ * <dt>valueItem</dt><dd>An array of hashes, each containing information about the value `Axis` of each marker whose plane has been intersected.</dd>+ * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>pageX</dt><dd>The x location of the event on the page (including scroll)</dd>+ * <dt>pageY</dt><dd>The y location of the event on the page (including scroll)</dd>+ * <dt>items</dt><dd>An array including all the series which contain a marker whose plane has been intersected.</dd>+ * <dt>index</dt><dd>Index of the markers in their respective series.</dd>+ * <dt>originEvent</dt><dd>Underlying dom event.</dd>+ * </dl>+ */+ /**+ * Broadcasts when `interactionType` is set to `planar` and a series' marker plane has received a mouseout event.+ *+ * @event planarEvent:mouseout+ * @preventable false+ * @param {EventFacade} e + */+ if(index > -1)+ {+ this.fire("planarEvent:mouseover", {+ categoryItem:categoryItems, + valueItem:valueItems, + x:posX, + y:posY, + pageX:pageX,+ pageY:pageY,+ items:items, + index:index,+ originEvent:e+ });+ }+ else+ {+ this.fire("planarEvent:mouseout");+ }+ }+ },++ /**+ * Indicates the default series type for the chart.+ *+ * @property _type+ * @type {String}+ * @private+ */+ _type: "combo",++ /**+ * Queue of axes instances that will be updated. This method is used internally to determine when all axes have been updated.+ *+ * @property _itemRenderQueue+ * @type Array+ * @private+ */+ _itemRenderQueue: null,++ /**+ * Adds an `Axis` instance to the `_itemRenderQueue`.+ *+ * @method _addToAxesRenderQueue+ * @param {Axis} axis An `Axis` instance.+ * @private + */+ _addToAxesRenderQueue: function(axis)+ {+ if(!this._itemRenderQueue)+ {+ this._itemRenderQueue = [];+ }+ if(Y.Array.indexOf(this._itemRenderQueue, axis) < 0)+ {+ this._itemRenderQueue.push(axis);+ }+ },++ /**+ * Adds axis instance to the appropriate array based on position+ *+ * @method _addToAxesCollection+ * @param {String} position The position of the axis+ * @param {Axis} axis The `Axis` instance+ */+ _addToAxesCollection: function(position, axis)+ {+ var axesCollection = this.get(position + "AxesCollection");+ if(!axesCollection)+ {+ axesCollection = [];+ this.set(position + "AxesCollection", axesCollection);+ }+ axesCollection.push(axis);+ },++ /**+ * Returns the default value for the `seriesCollection` attribute.+ *+ * @method _getDefaultSeriesCollection+ * @param {Array} val Array containing either `CartesianSeries` instances or objects containing data to construct series instances.+ * @return Array+ * @private+ */+ _getDefaultSeriesCollection: function()+ {+ var seriesCollection,+ dataProvider = this.get("dataProvider");+ if(dataProvider)+ {+ seriesCollection = this._parseSeriesCollection();+ }+ return seriesCollection;+ },++ /**+ * Parses and returns a series collection from an object and default properties.+ *+ * @method _parseSeriesCollection+ * @param {Object} val Object contain properties for series being set.+ * @return Object+ * @private+ */+ _parseSeriesCollection: function(val)+ {+ var dir = this.get("direction"), + sc = [], + catAxis,+ valAxis,+ tempKeys = [],+ series,+ seriesKeys = this.get("seriesKeys").concat(),+ i,+ index,+ l,+ type = this.get("type"),+ key,+ catKey,+ seriesKey,+ graph,+ orphans = [],+ categoryKey = this.get("categoryKey"),+ showMarkers = this.get("showMarkers"),+ showAreaFill = this.get("showAreaFill"),+ showLines = this.get("showLines");+ val = val || []; + if(dir == "vertical")+ {+ catAxis = "yAxis";+ catKey = "yKey";+ valAxis = "xAxis";+ seriesKey = "xKey";+ }+ else+ {+ catAxis = "xAxis";+ catKey = "xKey";+ valAxis = "yAxis";+ seriesKey = "yKey";+ }+ l = val.length;+ while(val && val.length > 0)+ {+ series = val.shift();+ key = this._getBaseAttribute(series, seriesKey);+ if(key)+ {+ index = Y.Array.indexOf(seriesKeys, key);+ if(index > -1)+ {+ seriesKeys.splice(index, 1);+ tempKeys.push(key);+ sc.push(series);+ }+ else+ {+ orphans.push(series);+ }+ }+ else+ {+ orphans.push(series);+ }+ }+ while(orphans.length > 0)+ {+ series = orphans.shift();+ if(seriesKeys.length > 0)+ {+ key = seriesKeys.shift();+ this._setBaseAttribute(series, seriesKey, key);+ tempKeys.push(key);+ sc.push(series);+ }+ else if(series instanceof Y.CartesianSeries)+ {+ series.destroy(true);+ }+ }+ if(seriesKeys.length > 0)+ {+ tempKeys = tempKeys.concat(seriesKeys);+ }+ l = tempKeys.length;+ for(i = 0; i < l; ++i)+ {+ series = sc[i] || {type:type};+ if(series instanceof Y.CartesianSeries)+ {+ this._parseSeriesAxes(series);+ continue;+ }++ series[catKey] = series[catKey] || categoryKey;+ series[seriesKey] = series[seriesKey] || seriesKeys.shift();+ series[catAxis] = this._getCategoryAxis();+ series[valAxis] = this._getSeriesAxis(series[seriesKey]);+ + series.type = series.type || type;+ series.direction = series.direction || dir;+ + if((series.type == "combo" || series.type == "stackedcombo" || series.type == "combospline" || series.type == "stackedcombospline"))+ {+ if(showAreaFill !== null)+ {+ series.showAreaFill = (series.showAreaFill !== null && series.showAreaFill !== undefined) ? series.showAreaFill : showAreaFill;+ }+ if(showMarkers !== null)+ {+ series.showMarkers = (series.showMarkers !== null && series.showMarkers !== undefined) ? series.showMarkers : showMarkers;+ }+ if(showLines !== null)+ {+ series.showLines = (series.showLines !== null && series.showLines !== undefined) ? series.showLines : showLines;+ }+ }+ sc[i] = series;+ }+ if(sc)+ {+ graph = this.get("graph");+ graph.set("seriesCollection", sc);+ sc = graph.get("seriesCollection");+ }+ return sc;+ },++ /**+ * Parse and sets the axes for a series instance.+ *+ * @method _parseSeriesAxes+ * @param {CartesianSeries} series A `CartesianSeries` instance.+ * @private+ */+ _parseSeriesAxes: function(series)+ {+ var axes = this.get("axes"),+ xAxis = series.get("xAxis"),+ yAxis = series.get("yAxis"),+ YAxis = Y.Axis,+ axis;+ if(xAxis && !(xAxis instanceof YAxis) && Y_Lang.isString(xAxis) && axes.hasOwnProperty(xAxis))+ {+ axis = axes[xAxis];+ if(axis instanceof YAxis)+ {+ series.set("xAxis", axis);+ }+ }+ if(yAxis && !(yAxis instanceof YAxis) && Y_Lang.isString(yAxis) && axes.hasOwnProperty(yAxis))+ { + axis = axes[yAxis];+ if(axis instanceof YAxis)+ {+ series.set("yAxis", axis);+ }+ }++ },++ /**+ * Returns the category axis instance for the chart.+ *+ * @method _getCategoryAxis+ * @return Axis+ * @private+ */+ _getCategoryAxis: function()+ {+ var axis,+ axes = this.get("axes"),+ categoryAxisName = this.get("categoryAxisName") || this.get("categoryKey");+ axis = axes[categoryAxisName];+ return axis;+ },++ /**+ * Returns the value axis for a series.+ *+ * @method _getSeriesAxis+ * @param {String} key The key value used to determine the axis instance.+ * @return Axis+ * @private+ */+ _getSeriesAxis:function(key, axisName)+ {+ var axes = this.get("axes"),+ i,+ keys,+ axis;+ if(axes)+ {+ if(axisName && axes.hasOwnProperty(axisName))+ {+ axis = axes[axisName];+ }+ else+ {+ for(i in axes)+ {+ if(axes.hasOwnProperty(i))+ {+ keys = axes[i].get("keys");+ if(keys && keys.hasOwnProperty(key))+ {+ axis = axes[i];+ break;+ }+ }+ }+ }+ }+ return axis;+ },++ /**+ * Gets an attribute from an object, using a getter for Base objects and a property for object+ * literals. Used for determining attributes from series/axis references which can be an actual class instance+ * or a hash of properties that will be used to create a class instance.+ *+ * @method _getBaseAttribute+ * @param {Object} item Object or instance in which the attribute resides.+ * @param {String} key Attribute whose value will be returned.+ * @return Object+ * @private+ */+ _getBaseAttribute: function(item, key)+ {+ if(item instanceof Y.Base)+ {+ return item.get(key);+ }+ if(item.hasOwnProperty(key))+ {+ return item[key];+ }+ return null;+ },++ /**+ * Sets an attribute on an object, using a setter of Base objects and a property for object+ * literals. Used for setting attributes on a Base class, either directly or to be stored in an object literal+ * for use at instantiation.+ *+ * @method _setBaseAttribute+ * @param {Object} item Object or instance in which the attribute resides.+ * @param {String} key Attribute whose value will be assigned.+ * @param {Object} value Value to be assigned to the attribute.+ * @private+ */+ _setBaseAttribute: function(item, key, value)+ {+ if(item instanceof Y.Base)+ {+ item.set(key, value);+ }+ else+ {+ item[key] = value;+ }+ },++ /**+ * Creates `Axis` instances.+ *+ * @method _setAxes+ * @param {Object} val Object containing `Axis` instances or objects in which to construct `Axis` instances.+ * @return Object+ * @private+ */+ _setAxes: function(val)+ {+ var hash = this._parseAxes(val),+ axes = {},+ axesAttrs = {+ edgeOffset: "edgeOffset", + position: "position",+ overlapGraph:"overlapGraph",+ labelFunction:"labelFunction",+ labelFunctionScope:"labelFunctionScope",+ labelFormat:"labelFormat",+ appendLabelFunction: "appendLabelFunction",+ appendTitleFunction: "appendTitleFunction",+ maximum:"maximum",+ minimum:"minimum", + roundingMethod:"roundingMethod",+ alwaysShowZero:"alwaysShowZero",+ title:"title",+ width:"width",+ height:"height"+ },+ dp = this.get("dataProvider"),+ ai,+ i, + pos, + axis,+ axisPosition,+ dh, + axisClass, + config,+ axesCollection;+ for(i in hash)+ {+ if(hash.hasOwnProperty(i))+ {+ dh = hash[i];+ if(dh instanceof Y.Axis)+ {+ axis = dh;+ }+ else+ {+ axis = null;+ config = {};+ config.dataProvider = dh.dataProvider || dp;+ config.keys = dh.keys;+ + if(dh.hasOwnProperty("roundingUnit"))+ {+ config.roundingUnit = dh.roundingUnit;+ }+ pos = dh.position;+ if(dh.styles)+ {+ config.styles = dh.styles;+ }+ config.position = dh.position;+ for(ai in axesAttrs)+ {+ if(axesAttrs.hasOwnProperty(ai) && dh.hasOwnProperty(ai))+ {+ config[ai] = dh[ai];+ }+ }+ + //only check for existing axis if we constructed the default axes already+ if(val)+ {+ axis = this.getAxisByKey(i);+ }+ + if(axis && axis instanceof Y.Axis)+ {+ axisPosition = axis.get("position");+ if(pos != axisPosition)+ {+ if(axisPosition != "none")+ {+ axesCollection = this.get(axisPosition + "AxesCollection");+ axesCollection.splice(Y.Array.indexOf(axesCollection, axis), 1);+ }+ if(pos != "none")+ {+ this._addToAxesCollection(pos, axis);+ }+ }+ axis.setAttrs(config);+ }+ else+ {+ axisClass = this._getAxisClass(dh.type);+ axis = new axisClass(config);+ axis.after("axisRendered", Y.bind(this._itemRendered, this));+ }+ }++ if(axis)+ {+ axesCollection = this.get(pos + "AxesCollection");+ if(axesCollection && Y.Array.indexOf(axesCollection, axis) > 0)+ {+ axis.set("overlapGraph", false);+ }+ axes[i] = axis;+ }+ }+ }+ return axes;+ },+ + /**+ * Adds axes to the chart.+ *+ * @method _addAxes+ * @private+ */+ _addAxes: function()+ {+ var axes = this.get("axes"),+ i, + axis, + pos,+ w = this.get("width"),+ h = this.get("height"),+ node = Y.Node.one(this._parentNode);+ if(!this._axesCollection)+ { + this._axesCollection = [];+ }+ for(i in axes)+ {+ if(axes.hasOwnProperty(i))+ {+ axis = axes[i];+ if(axis instanceof Y.Axis)+ {+ if(!w)+ {+ this.set("width", node.get("offsetWidth"));+ w = this.get("width");+ }+ if(!h)+ {+ this.set("height", node.get("offsetHeight"));+ h = this.get("height");+ }+ this._addToAxesRenderQueue(axis);+ pos = axis.get("position");+ if(!this.get(pos + "AxesCollection"))+ {+ this.set(pos + "AxesCollection", [axis]);+ }+ else+ {+ this.get(pos + "AxesCollection").push(axis);+ }+ this._axesCollection.push(axis);+ if(axis.get("keys").hasOwnProperty(this.get("categoryKey")))+ {+ this.set("categoryAxis", axis);+ }+ axis.render(this.get("contentBox"));+ }+ }+ }+ },++ /**+ * Renders the Graph.+ *+ * @method _addSeries+ * @private+ */+ _addSeries: function()+ {+ var graph = this.get("graph"),+ sc = this.get("seriesCollection");+ graph.render(this.get("contentBox"));++ },++ /**+ * Adds gridlines to the chart.+ *+ * @method _addGridlines+ * @private+ */+ _addGridlines: function()+ {+ var graph = this.get("graph"),+ hgl = this.get("horizontalGridlines"),+ vgl = this.get("verticalGridlines"),+ direction = this.get("direction"),+ leftAxesCollection = this.get("leftAxesCollection"),+ rightAxesCollection = this.get("rightAxesCollection"),+ bottomAxesCollection = this.get("bottomAxesCollection"),+ topAxesCollection = this.get("topAxesCollection"),+ seriesAxesCollection,+ catAxis = this.get("categoryAxis"),+ hAxis,+ vAxis;+ if(this._axesCollection)+ {+ seriesAxesCollection = this._axesCollection.concat();+ seriesAxesCollection.splice(Y.Array.indexOf(seriesAxesCollection, catAxis), 1);+ }+ if(hgl)+ {+ if(leftAxesCollection && leftAxesCollection[0])+ {+ hAxis = leftAxesCollection[0];+ }+ else if(rightAxesCollection && rightAxesCollection[0])+ {+ hAxis = rightAxesCollection[0];+ }+ else + {+ hAxis = direction == "horizontal" ? catAxis : seriesAxesCollection[0];+ }+ if(!this._getBaseAttribute(hgl, "axis") && hAxis)+ {+ this._setBaseAttribute(hgl, "axis", hAxis);+ }+ if(this._getBaseAttribute(hgl, "axis"))+ {+ graph.set("horizontalGridlines", hgl);+ }+ }+ if(vgl)+ {+ if(bottomAxesCollection && bottomAxesCollection[0])+ {+ vAxis = bottomAxesCollection[0];+ }+ else if (topAxesCollection && topAxesCollection[0])+ {+ vAxis = topAxesCollection[0];+ }+ else + {+ vAxis = direction == "vertical" ? catAxis : seriesAxesCollection[0];+ }+ if(!this._getBaseAttribute(vgl, "axis") && vAxis)+ {+ this._setBaseAttribute(vgl, "axis", vAxis);+ }+ if(this._getBaseAttribute(vgl, "axis"))+ {+ graph.set("verticalGridlines", vgl);+ }+ }+ },+ + /**+ * Default Function for the axes attribute.+ *+ * @method _getDefaultAxes+ * @return Object+ * @private+ */+ _getDefaultAxes: function()+ {+ var axes;+ if(this.get("dataProvider"))+ {+ axes = this._parseAxes();+ }+ return axes;+ },++ /**+ * Generates and returns a key-indexed object containing `Axis` instances or objects used to create `Axis` instances.+ *+ * @method _parseAxes+ * @param {Object} axes Object containing `Axis` instances or `Axis` attributes.+ * @return Object+ * @private+ */+ _parseAxes: function(axes)+ {+ var catKey = this.get("categoryKey"),+ axis,+ attr,+ keys,+ newAxes = {},+ claimedKeys = [],+ categoryAxisName = this.get("categoryAxisName") || this.get("categoryKey"),+ valueAxisName = this.get("valueAxisName"),+ seriesKeys = this.get("seriesKeys").concat(),+ i, + l,+ ii,+ ll,+ cIndex,+ direction = this.get("direction"),+ seriesPosition,+ categoryPosition,+ valueAxes = [],+ seriesAxis = this.get("stacked") ? "stacked" : "numeric";+ if(direction == "vertical")+ {+ seriesPosition = "bottom";+ categoryPosition = "left";+ }+ else+ {+ seriesPosition = "left";+ categoryPosition = "bottom";+ }+ if(axes)+ {+ for(i in axes)+ {+ if(axes.hasOwnProperty(i))+ {+ axis = axes[i];+ keys = this._getBaseAttribute(axis, "keys");+ attr = this._getBaseAttribute(axis, "type");+ if(attr == "time" || attr == "category")+ {+ categoryAxisName = i;+ this.set("categoryAxisName", i);+ if(Y_Lang.isArray(keys) && keys.length > 0)+ {+ catKey = keys[0];+ this.set("categoryKey", catKey);+ }+ newAxes[i] = axis;+ }+ else if(i == categoryAxisName)+ {+ newAxes[i] = axis;+ }+ else + {+ newAxes[i] = axis;+ if(i != valueAxisName && keys && Y_Lang.isArray(keys))+ {+ ll = keys.length;+ for(ii = 0; ii < ll; ++ii)+ {+ claimedKeys.push(keys[ii]);+ }+ valueAxes.push(newAxes[i]);+ }+ if(!(this._getBaseAttribute(newAxes[i], "type")))+ {+ this._setBaseAttribute(newAxes[i], "type", seriesAxis);+ }+ if(!(this._getBaseAttribute(newAxes[i], "position")))+ {+ this._setBaseAttribute(newAxes[i], "position", this._getDefaultAxisPosition(newAxes[i], valueAxes, seriesPosition));+ }+ }+ }+ }+ }+ cIndex = Y.Array.indexOf(seriesKeys, catKey);+ if(cIndex > -1)+ {+ seriesKeys.splice(cIndex, 1);+ }+ l = claimedKeys.length;+ for(i = 0; i < l; ++i)+ {+ cIndex = Y.Array.indexOf(seriesKeys, claimedKeys[i]); + if(cIndex > -1)+ {+ seriesKeys.splice(cIndex, 1);+ }+ }+ if(!newAxes.hasOwnProperty(categoryAxisName))+ {+ newAxes[categoryAxisName] = {};+ }+ if(!(this._getBaseAttribute(newAxes[categoryAxisName], "keys")))+ {+ this._setBaseAttribute(newAxes[categoryAxisName], "keys", [catKey]);+ }+ + if(!(this._getBaseAttribute(newAxes[categoryAxisName], "position")))+ {+ this._setBaseAttribute(newAxes[categoryAxisName], "position", categoryPosition);+ }+ + if(!(this._getBaseAttribute(newAxes[categoryAxisName], "type")))+ {+ this._setBaseAttribute(newAxes[categoryAxisName], "type", this.get("categoryType"));+ }+ if(!newAxes.hasOwnProperty(valueAxisName) && seriesKeys && seriesKeys.length > 0)+ {+ newAxes[valueAxisName] = {keys:seriesKeys};+ valueAxes.push(newAxes[valueAxisName]);+ }+ if(claimedKeys.length > 0)+ {+ if(seriesKeys.length > 0)+ {+ seriesKeys = claimedKeys.concat(seriesKeys);+ }+ else+ {+ seriesKeys = claimedKeys;+ }+ }+ if(newAxes.hasOwnProperty(valueAxisName))+ {+ if(!(this._getBaseAttribute(newAxes[valueAxisName], "position")))+ {+ this._setBaseAttribute(newAxes[valueAxisName], "position", this._getDefaultAxisPosition(newAxes[valueAxisName], valueAxes, seriesPosition));+ }+ this._setBaseAttribute(newAxes[valueAxisName], "type", seriesAxis);+ this._setBaseAttribute(newAxes[valueAxisName], "keys", seriesKeys);+ } + if(!this._seriesKeysExplicitlySet)+ {+ this._seriesKeys = seriesKeys;+ }+ return newAxes;+ },++ /**+ * Determines the position of an axis when one is not specified.+ *+ * @method _getDefaultAxisPosition+ * @param {Axis} axis `Axis` instance.+ * @param {Array} valueAxes Array of `Axis` instances.+ * @param {String} position Default position depending on the direction of the chart and type of axis.+ * @return String+ * @private+ */+ _getDefaultAxisPosition: function(axis, valueAxes, position)+ {+ var direction = this.get("direction"),+ i = Y.Array.indexOf(valueAxes, axis);+ + if(valueAxes[i - 1] && valueAxes[i - 1].position)+ {+ if(direction == "horizontal")+ {+ if(valueAxes[i - 1].position == "left")+ {+ position = "right";+ }+ else if(valueAxes[i - 1].position == "right")+ {+ position = "left";+ }+ }+ else+ {+ if (valueAxes[i -1].position == "bottom")+ {+ position = "top";+ } + else+ {+ position = "bottom";+ }+ }+ }+ return position;+ },++ + /**+ * Returns an object literal containing a categoryItem and a valueItem for a given series index. Below is the structure of each:+ * + * @method getSeriesItems+ * @param {CartesianSeries} series Reference to a series.+ * @param {Number} index Index of the specified item within a series.+ * @return Object An object literal containing the following:+ *+ * <dl>+ * <dt>categoryItem</dt><dd>Object containing the following data related to the category axis of the series.+ * <dl>+ * <dt>axis</dt><dd>Reference to the category axis of the series.</dd>+ * <dt>key</dt><dd>Category key for the series.</dd>+ * <dt>value</dt><dd>Value on the axis corresponding to the series index.</dd>+ * </dl>+ * </dd>+ * <dt>valueItem</dt><dd>Object containing the following data related to the category axis of the series.+ * <dl>+ * <dt>axis</dt><dd>Reference to the value axis of the series.</dd>+ * <dt>key</dt><dd>Value key for the series.</dd>+ * <dt>value</dt><dd>Value on the axis corresponding to the series index.</dd>+ * </dl>+ * </dd>+ * </dl>+ */+ getSeriesItems: function(series, index)+ {+ var xAxis = series.get("xAxis"),+ yAxis = series.get("yAxis"),+ xKey = series.get("xKey"),+ yKey = series.get("yKey"),+ categoryItem,+ valueItem;+ if(this.get("direction") == "vertical")+ {+ categoryItem = {+ axis:yAxis,+ key:yKey,+ value:yAxis.getKeyValueAt(yKey, index)+ };+ valueItem = {+ axis:xAxis,+ key:xKey,+ value: xAxis.getKeyValueAt(xKey, index)+ };+ }+ else+ {+ valueItem = {+ axis:yAxis,+ key:yKey,+ value:yAxis.getKeyValueAt(yKey, index)+ };+ categoryItem = {+ axis:xAxis,+ key:xKey,+ value: xAxis.getKeyValueAt(xKey, index)+ };+ }+ categoryItem.displayName = series.get("categoryDisplayName");+ valueItem.displayName = series.get("valueDisplayName");+ categoryItem.value = categoryItem.axis.getKeyValueAt(categoryItem.key, index);+ valueItem.value = valueItem.axis.getKeyValueAt(valueItem.key, index);+ return {category:categoryItem, value:valueItem};+ },++ /**+ * Handler for sizeChanged event.+ *+ * @method _sizeChanged+ * @param {Object} e Event object.+ * @private+ */+ _sizeChanged: function(e)+ {+ if(this._axesCollection)+ {+ var ac = this._axesCollection,+ i = 0,+ l = ac.length;+ for(; i < l; ++i)+ {+ this._addToAxesRenderQueue(ac[i]);+ }+ this._redraw();+ }+ },+ + /**+ * Returns the maximum distance in pixels that the extends outside the top bounds of all vertical axes.+ *+ * @method _getTopOverflow+ * @param {Array} set1 Collection of axes to check.+ * @param {Array} set2 Seconf collection of axes to check.+ * @param {Number} width Width of the axes+ * @return Number+ * @private+ */+ _getTopOverflow: function(set1, set2, height)+ {+ var i = 0,+ len,+ overflow = 0,+ axis;+ if(set1)+ {+ len = set1.length;+ for(; i < len; ++i)+ {+ axis = set1[i];+ overflow = Math.max(overflow, Math.abs(axis.getMaxLabelBounds().top) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));+ }+ }+ if(set2)+ {+ i = 0;+ len = set2.length;+ for(; i < len; ++i)+ {+ axis = set2[i];+ overflow = Math.max(overflow, Math.abs(axis.getMaxLabelBounds().top) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));+ }+ }+ return overflow;+ },+ + /**+ * Returns the maximum distance in pixels that the extends outside the right bounds of all horizontal axes.+ *+ * @method _getRightOverflow+ * @param {Array} set1 Collection of axes to check.+ * @param {Array} set2 Seconf collection of axes to check.+ * @param {Number} width Width of the axes+ * @return Number+ * @private+ */+ _getRightOverflow: function(set1, set2, width)+ {+ var i = 0,+ len,+ overflow = 0,+ axis;+ if(set1)+ {+ len = set1.length;+ for(; i < len; ++i)+ {+ axis = set1[i];+ overflow = Math.max(overflow, axis.getMaxLabelBounds().right - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));+ }+ }+ if(set2)+ {+ i = 0;+ len = set2.length;+ for(; i < len; ++i)+ {+ axis = set2[i];+ overflow = Math.max(overflow, axis.getMaxLabelBounds().right - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));+ }+ }+ return overflow;+ },+ + /**+ * Returns the maximum distance in pixels that the extends outside the left bounds of all horizontal axes.+ *+ * @method _getLeftOverflow+ * @param {Array} set1 Collection of axes to check.+ * @param {Array} set2 Seconf collection of axes to check.+ * @param {Number} width Width of the axes+ * @return Number+ * @private+ */+ _getLeftOverflow: function(set1, set2, width)+ {+ var i = 0,+ len,+ overflow = 0,+ axis;+ if(set1)+ {+ len = set1.length;+ for(; i < len; ++i)+ {+ axis = set1[i];+ overflow = Math.max(overflow, Math.abs(axis.getMinLabelBounds().left) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));+ }+ }+ if(set2)+ {+ i = 0;+ len = set2.length;+ for(; i < len; ++i)+ {+ axis = set2[i];+ overflow = Math.max(overflow, Math.abs(axis.getMinLabelBounds().left) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));+ }+ }+ return overflow;+ },+ + /**+ * Returns the maximum distance in pixels that the extends outside the bottom bounds of all vertical axes.+ *+ * @method _getBottomOverflow+ * @param {Array} set1 Collection of axes to check.+ * @param {Array} set2 Seconf collection of axes to check.+ * @param {Number} height Height of the axes+ * @return Number+ * @private+ */+ _getBottomOverflow: function(set1, set2, height)+ {+ var i = 0,+ len,+ overflow = 0,+ axis;+ if(set1)+ {+ len = set1.length;+ for(; i < len; ++i)+ {+ axis = set1[i];+ overflow = Math.max(overflow, axis.getMinLabelBounds().bottom - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));+ }+ }+ if(set2)+ {+ i = 0;+ len = set2.length;+ for(; i < len; ++i)+ {+ axis = set2[i];+ overflow = Math.max(overflow, axis.getMinLabelBounds().bottom - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));+ }+ }+ return overflow;+ },++ /**+ * Redraws and position all the components of the chart instance.+ *+ * @method _redraw+ * @private+ */+ _redraw: function()+ {+ if(this._drawing)+ {+ this._callLater = true;+ return;+ }+ this._drawing = true;+ this._callLater = false;+ var w = this.get("width"),+ h = this.get("height"),+ leftPaneWidth = 0,+ rightPaneWidth = 0,+ topPaneHeight = 0,+ bottomPaneHeight = 0,+ leftAxesCollection = this.get("leftAxesCollection"),+ rightAxesCollection = this.get("rightAxesCollection"),+ topAxesCollection = this.get("topAxesCollection"),+ bottomAxesCollection = this.get("bottomAxesCollection"),+ i = 0,+ l,+ axis,+ graphOverflow = "visible",+ graph = this.get("graph"),+ topOverflow,+ bottomOverflow,+ leftOverflow,+ rightOverflow,+ graphWidth,+ graphHeight,+ graphX,+ graphY,+ allowContentOverflow = this.get("allowContentOverflow"),+ diff,+ rightAxesXCoords,+ leftAxesXCoords,+ topAxesYCoords,+ bottomAxesYCoords,+ graphRect = {};+ if(leftAxesCollection)+ {+ leftAxesXCoords = [];+ l = leftAxesCollection.length;+ for(i = l - 1; i > -1; --i)+ {+ leftAxesXCoords.unshift(leftPaneWidth);+ leftPaneWidth += leftAxesCollection[i].get("width");+ }+ }+ if(rightAxesCollection)+ {+ rightAxesXCoords = [];+ l = rightAxesCollection.length;+ i = 0;+ for(i = l - 1; i > -1; --i)+ {+ rightPaneWidth += rightAxesCollection[i].get("width");+ rightAxesXCoords.unshift(w - rightPaneWidth);+ }+ }+ if(topAxesCollection)+ {+ topAxesYCoords = [];+ l = topAxesCollection.length;+ for(i = l - 1; i > -1; --i)+ {+ topAxesYCoords.unshift(topPaneHeight);+ topPaneHeight += topAxesCollection[i].get("height");+ }+ }+ if(bottomAxesCollection)+ {+ bottomAxesYCoords = [];+ l = bottomAxesCollection.length;+ for(i = l - 1; i > -1; --i)+ {+ bottomPaneHeight += bottomAxesCollection[i].get("height");+ bottomAxesYCoords.unshift(h - bottomPaneHeight);+ }+ }+ + graphWidth = w - (leftPaneWidth + rightPaneWidth);+ graphHeight = h - (bottomPaneHeight + topPaneHeight);+ graphRect.left = leftPaneWidth;+ graphRect.top = topPaneHeight;+ graphRect.bottom = h - bottomPaneHeight;+ graphRect.right = w - rightPaneWidth;+ if(!allowContentOverflow)+ {+ topOverflow = this._getTopOverflow(leftAxesCollection, rightAxesCollection);+ bottomOverflow = this._getBottomOverflow(leftAxesCollection, rightAxesCollection);+ leftOverflow = this._getLeftOverflow(bottomAxesCollection, topAxesCollection);+ rightOverflow = this._getRightOverflow(bottomAxesCollection, topAxesCollection);+ + diff = topOverflow - topPaneHeight;+ if(diff > 0)+ {+ graphRect.top = topOverflow;+ if(topAxesYCoords)+ {+ i = 0;+ l = topAxesYCoords.length;+ for(; i < l; ++i)+ {+ topAxesYCoords[i] += diff;+ }+ }+ }++ diff = bottomOverflow - bottomPaneHeight;+ if(diff > 0)+ {+ graphRect.bottom = h - bottomOverflow;+ if(bottomAxesYCoords)+ {+ i = 0;+ l = bottomAxesYCoords.length;+ for(; i < l; ++i)+ {+ bottomAxesYCoords[i] -= diff;+ }+ }+ }++ diff = leftOverflow - leftPaneWidth;+ if(diff > 0)+ {+ graphRect.left = leftOverflow;+ if(leftAxesXCoords)+ {+ i = 0;+ l = leftAxesXCoords.length;+ for(; i < l; ++i)+ {+ leftAxesXCoords[i] += diff;+ }+ }+ }++ diff = rightOverflow - rightPaneWidth;+ if(diff > 0)+ {+ graphRect.right = w - rightOverflow;+ if(rightAxesXCoords)+ {+ i = 0;+ l = rightAxesXCoords.length;+ for(; i < l; ++i)+ {+ rightAxesXCoords[i] -= diff;+ }+ }+ }+ }+ graphWidth = graphRect.right - graphRect.left;+ graphHeight = graphRect.bottom - graphRect.top;+ graphX = graphRect.left;+ graphY = graphRect.top;+ if(topAxesCollection)+ {+ l = topAxesCollection.length;+ i = 0;+ for(; i < l; i++)+ {+ axis = topAxesCollection[i];+ if(axis.get("width") !== graphWidth)+ {+ axis.set("width", graphWidth);+ }+ axis.get("boundingBox").setStyle("left", graphX + "px");+ axis.get("boundingBox").setStyle("top", topAxesYCoords[i] + "px");+ }+ if(axis._hasDataOverflow())+ {+ graphOverflow = "hidden";+ }+ }+ if(bottomAxesCollection)+ {+ l = bottomAxesCollection.length;+ i = 0;+ for(; i < l; i++)+ {+ axis = bottomAxesCollection[i];+ if(axis.get("width") !== graphWidth)+ {+ axis.set("width", graphWidth);+ }+ axis.get("boundingBox").setStyle("left", graphX + "px");+ axis.get("boundingBox").setStyle("top", bottomAxesYCoords[i] + "px");+ }+ if(axis._hasDataOverflow())+ {+ graphOverflow = "hidden";+ }+ }+ if(leftAxesCollection)+ {+ l = leftAxesCollection.length;+ i = 0;+ for(; i < l; ++i)+ {+ axis = leftAxesCollection[i];+ axis.get("boundingBox").setStyle("top", graphY + "px");+ axis.get("boundingBox").setStyle("left", leftAxesXCoords[i] + "px");+ if(axis.get("height") !== graphHeight)+ {+ axis.set("height", graphHeight);+ }+ }+ if(axis._hasDataOverflow())+ {+ graphOverflow = "hidden";+ }+ }+ if(rightAxesCollection)+ {+ l = rightAxesCollection.length;+ i = 0;+ for(; i < l; ++i)+ {+ axis = rightAxesCollection[i];+ axis.get("boundingBox").setStyle("top", graphY + "px");+ axis.get("boundingBox").setStyle("left", rightAxesXCoords[i] + "px");+ if(axis.get("height") !== graphHeight)+ {+ axis.set("height", graphHeight);+ }+ }+ if(axis._hasDataOverflow())+ {+ graphOverflow = "hidden";+ }+ }+ this._drawing = false;+ if(this._callLater)+ {+ this._redraw();+ return;+ }+ if(graph)+ {+ graph.get("boundingBox").setStyle("left", graphX + "px");+ graph.get("boundingBox").setStyle("top", graphY + "px");+ graph.set("width", graphWidth);+ graph.set("height", graphHeight);+ graph.get("boundingBox").setStyle("overflow", graphOverflow);+ }++ if(this._overlay)+ {+ this._overlay.setStyle("left", graphX + "px");+ this._overlay.setStyle("top", graphY + "px");+ this._overlay.setStyle("width", graphWidth + "px");+ this._overlay.setStyle("height", graphHeight + "px");+ }+ },++ /**+ * Destructor implementation for the CartesianChart class. Calls destroy on all axes, series and the Graph instance.+ * Removes the tooltip and overlay HTML elements.+ *+ * @method destructor+ * @protected+ */+ destructor: function()+ {+ var graph = this.get("graph"),+ i = 0,+ len,+ seriesCollection = this.get("seriesCollection"),+ axesCollection = this._axesCollection,+ tooltip = this.get("tooltip").node;+ if(this._description)+ {+ this._description.empty();+ this._description.remove(true);+ }+ if(this._liveRegion)+ {+ this._liveRegion.empty();+ this._liveRegion.remove(true);+ }+ len = seriesCollection ? seriesCollection.length : 0;+ for(; i < len; ++i)+ {+ if(seriesCollection[i] instanceof Y.CartesianSeries)+ {+ seriesCollection[i].destroy(true);+ }+ }+ len = axesCollection ? axesCollection.length : 0;+ for(i = 0; i < len; ++i)+ {+ if(axesCollection[i] instanceof Y.Axis)+ {+ axesCollection[i].destroy(true);+ }+ }+ if(graph)+ {+ graph.destroy(true);+ }+ if(tooltip)+ {+ tooltip.empty();+ tooltip.remove(true);+ }+ if(this._overlay)+ {+ this._overlay.empty();+ this._overlay.remove(true);+ }+ },++ /**+ * Returns the appropriate message based on the key press.+ *+ * @method _getAriaMessage+ * @param {Number} key The keycode that was pressed.+ * @return String+ */+ _getAriaMessage: function(key)+ {+ var msg = "",+ series,+ items,+ categoryItem,+ valueItem,+ seriesIndex = this._seriesIndex,+ itemIndex = this._itemIndex,+ seriesCollection = this.get("seriesCollection"),+ len = seriesCollection.length,+ dataLength;+ if(key % 2 === 0)+ {+ if(len > 1)+ {+ if(key === 38)+ {+ seriesIndex = seriesIndex < 1 ? len - 1 : seriesIndex - 1;+ }+ else if(key === 40)+ {+ seriesIndex = seriesIndex >= len - 1 ? 0 : seriesIndex + 1;+ }+ this._itemIndex = -1;+ }+ else+ {+ seriesIndex = 0;+ }+ this._seriesIndex = seriesIndex;+ series = this.getSeries(parseInt(seriesIndex, 10));+ msg = series.get("valueDisplayName") + " series.";+ }+ else+ {+ if(seriesIndex > -1)+ {+ msg = "";+ series = this.getSeries(parseInt(seriesIndex, 10));+ }+ else+ {+ seriesIndex = 0;+ this._seriesIndex = seriesIndex;+ series = this.getSeries(parseInt(seriesIndex, 10));+ msg = series.get("valueDisplayName") + " series.";+ }+ dataLength = series._dataLength ? series._dataLength : 0;+ if(key === 37)+ {+ itemIndex = itemIndex > 0 ? itemIndex - 1 : dataLength - 1;+ }+ else if(key === 39)+ {+ itemIndex = itemIndex >= dataLength - 1 ? 0 : itemIndex + 1;+ }+ this._itemIndex = itemIndex;+ items = this.getSeriesItems(series, itemIndex);+ categoryItem = items.category;+ valueItem = items.value;+ if(categoryItem && valueItem && categoryItem.value && valueItem.value)+ {+ msg += categoryItem.displayName + ": " + categoryItem.axis.formatLabel.apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]) + ", ";+ msg += valueItem.displayName + ": " + valueItem.axis.formatLabel.apply(this, [valueItem.value, valueItem.axis.get("labelFormat")]) + ", "; + }+ else+ {+ msg += "No data available.";+ }+ msg += (itemIndex + 1) + " of " + dataLength + ". ";+ }+ return msg;+ }+}, {+ ATTRS: {+ /**+ * Indicates whether axis labels are allowed to overflow beyond the bounds of the chart's content box.+ *+ * @attribute allowContentOverflow+ * @type Boolean+ */+ allowContentOverflow: {+ value: false+ },++ /**+ * Style object for the axes.+ *+ * @attribute axesStyles+ * @type Object+ * @private+ */+ axesStyles: {+ getter: function()+ {+ var axes = this.get("axes"),+ i,+ styles = this._axesStyles;+ if(axes)+ {+ for(i in axes)+ {+ if(axes.hasOwnProperty(i) && axes[i] instanceof Y.Axis)+ {+ if(!styles)+ {+ styles = {};+ }+ styles[i] = axes[i].get("styles");+ }+ }+ }+ return styles;+ },+ + setter: function(val)+ {+ var axes = this.get("axes"),+ i;+ for(i in val)+ {+ if(val.hasOwnProperty(i) && axes.hasOwnProperty(i))+ {+ this._setBaseAttribute(axes[i], "styles", val[i]);+ }+ }+ }+ },++ /**+ * Style object for the series+ *+ * @attribute seriesStyles+ * @type Object+ * @private+ */+ seriesStyles: {+ getter: function()+ {+ var styles = this._seriesStyles,+ graph = this.get("graph"),+ dict,+ i;+ if(graph)+ {+ dict = graph.get("seriesDictionary");+ if(dict)+ {+ styles = {};+ for(i in dict)+ {+ if(dict.hasOwnProperty(i))+ {+ styles[i] = dict[i].get("styles");+ }+ }+ }+ }+ return styles;+ },+ + setter: function(val)+ {+ var i,+ l,+ s;+ + if(Y_Lang.isArray(val))+ {+ s = this.get("seriesCollection");+ i = 0;+ l = val.length;++ for(; i < l; ++i)+ {+ this._setBaseAttribute(s[i], "styles", val[i]);+ }+ }+ else+ {+ for(i in val)+ {+ if(val.hasOwnProperty(i))+ {+ s = this.getSeries(i);+ this._setBaseAttribute(s, "styles", val[i]);+ }+ }+ }+ }+ },++ /**+ * Styles for the graph.+ *+ * @attribute graphStyles+ * @type Object+ * @private+ */+ graphStyles: {+ getter: function()+ {+ var graph = this.get("graph");+ if(graph)+ {+ return(graph.get("styles"));+ }+ return this._graphStyles;+ },++ setter: function(val)+ {+ var graph = this.get("graph");+ this._setBaseAttribute(graph, "styles", val);+ }++ },++ /**+ * Style properties for the chart. Contains a key indexed hash of the following:+ * <dl>+ * <dt>series</dt><dd>A key indexed hash containing references to the `styles` attribute for each series in the chart.+ * Specific style attributes vary depending on the series:+ * <ul>+ * <li><a href="AreaSeries.html#attr_styles">AreaSeries</a></li>+ * <li><a href="BarSeries.html#attr_styles">BarSeries</a></li>+ * <li><a href="ColumnSeries.html#attr_styles">ColumnSeries</a></li>+ * <li><a href="ComboSeries.html#attr_styles">ComboSeries</a></li>+ * <li><a href="LineSeries.html#attr_styles">LineSeries</a></li>+ * <li><a href="MarkerSeries.html#attr_styles">MarkerSeries</a></li>+ * <li><a href="SplineSeries.html#attr_styles">SplineSeries</a></li>+ * </ul>+ * </dd>+ * <dt>axes</dt><dd>A key indexed hash containing references to the `styles` attribute for each axes in the chart. Specific+ * style attributes can be found in the <a href="Axis.html#attr_styles">Axis</a> class.</dd>+ * <dt>graph</dt><dd>A reference to the `styles` attribute in the chart. Specific style attributes can be found in the+ * <a href="Graph.html#attr_styles">Graph</a> class.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ styles: {+ getter: function()+ {+ var styles = { + axes: this.get("axesStyles"),+ series: this.get("seriesStyles"),+ graph: this.get("graphStyles")+ };+ return styles;+ },+ setter: function(val)+ {+ if(val.hasOwnProperty("axes"))+ {+ if(this.get("axesStyles"))+ {+ this.set("axesStyles", val.axes);+ }+ else+ {+ this._axesStyles = val.axes;+ }+ }+ if(val.hasOwnProperty("series"))+ {+ if(this.get("seriesStyles"))+ {+ this.set("seriesStyles", val.series);+ }+ else+ {+ this._seriesStyles = val.series;+ }+ }+ if(val.hasOwnProperty("graph"))+ {+ this.set("graphStyles", val.graph);+ }+ }+ },++ /**+ * Axes to appear in the chart. This can be a key indexed hash of axis instances or object literals+ * used to construct the appropriate axes.+ *+ * @attribute axes+ * @type Object+ */+ axes: {+ valueFn: "_getDefaultAxes",++ setter: function(val)+ {+ if(this.get("dataProvider"))+ {+ val = this._setAxes(val);+ }+ return val;+ }+ },++ /**+ * Collection of series to appear on the chart. This can be an array of Series instances or object literals+ * used to construct the appropriate series.+ *+ * @attribute seriesCollection+ * @type Array+ */+ seriesCollection: {+ valueFn: "_getDefaultSeriesCollection",+ + setter: function(val)+ {+ if(this.get("dataProvider"))+ {+ val = this._parseSeriesCollection(val);+ }+ return val;+ }+ },++ /**+ * Reference to the left-aligned axes for the chart.+ *+ * @attribute leftAxesCollection+ * @type Array+ * @private+ */+ leftAxesCollection: {},++ /**+ * Reference to the bottom-aligned axes for the chart.+ *+ * @attribute bottomAxesCollection+ * @type Array+ * @private+ */+ bottomAxesCollection: {},++ /**+ * Reference to the right-aligned axes for the chart.+ *+ * @attribute rightAxesCollection+ * @type Array+ * @private+ */+ rightAxesCollection: {},++ /**+ * Reference to the top-aligned axes for the chart.+ *+ * @attribute topAxesCollection+ * @type Array+ * @private+ */+ topAxesCollection: {},+ + /**+ * Indicates whether or not the chart is stacked.+ *+ * @attribute stacked+ * @type Boolean+ */+ stacked: {+ value: false+ },++ /**+ * Direction of chart's category axis when there is no series collection specified. Charts can+ * be horizontal or vertical. When the chart type is column, the chart is horizontal.+ * When the chart type is bar, the chart is vertical. + *+ * @attribute direction+ * @type String+ */+ direction: {+ getter: function()+ {+ var type = this.get("type");+ if(type == "bar")+ { + return "vertical";+ }+ else if(type == "column")+ {+ return "horizontal";+ }+ return this._direction;+ },++ setter: function(val)+ {+ this._direction = val;+ return this._direction;+ }+ },++ /**+ * Indicates whether or not an area is filled in a combo chart.+ * + * @attribute showAreaFill+ * @type Boolean+ */+ showAreaFill: {},++ /**+ * Indicates whether to display markers in a combo chart.+ *+ * @attribute showMarkers+ * @type Boolean+ */+ showMarkers:{},++ /**+ * Indicates whether to display lines in a combo chart.+ *+ * @attribute showLines+ * @type Boolean+ */+ showLines:{},++ /**+ * Indicates the key value used to identify a category axis in the `axes` hash. If+ * not specified, the categoryKey attribute value will be used.+ * + * @attribute categoryAxisName+ * @type String+ */+ categoryAxisName: {+ },++ /**+ * Indicates the key value used to identify a the series axis when an axis not generated.+ *+ * @attribute valueAxisName+ * @type String+ */+ valueAxisName: {+ value: "values"+ },++ /**+ * Reference to the horizontalGridlines for the chart.+ *+ * @attribute horizontalGridlines+ * @type Gridlines+ */+ horizontalGridlines: {+ getter: function()+ {+ var graph = this.get("graph");+ if(graph)+ {+ return graph.get("horizontalGridlines");+ }+ return this._horizontalGridlines;+ },+ setter: function(val)+ {+ var graph = this.get("graph");+ if(val && !Y_Lang.isObject(val))+ {+ val = {};+ }+ if(graph)+ {+ graph.set("horizontalGridlines", val);+ }+ else+ {+ this._horizontalGridlines = val;+ }+ }+ },++ /**+ * Reference to the verticalGridlines for the chart.+ *+ * @attribute verticalGridlines+ * @type Gridlines+ */+ verticalGridlines: {+ getter: function()+ {+ var graph = this.get("graph");+ if(graph)+ {+ return graph.get("verticalGridlines");+ }+ return this._verticalGridlines;+ },+ setter: function(val)+ {+ var graph = this.get("graph");+ if(val && !Y_Lang.isObject(val))+ {+ val = {};+ }+ if(graph)+ {+ graph.set("verticalGridlines", val);+ }+ else+ {+ this._verticalGridlines = val;+ }+ }+ },+ + /**+ * Type of chart when there is no series collection specified.+ *+ * @attribute type+ * @type String + */+ type: {+ getter: function()+ {+ if(this.get("stacked"))+ {+ return "stacked" + this._type;+ }+ return this._type;+ },++ setter: function(val)+ {+ if(this._type == "bar")+ {+ if(val != "bar")+ {+ this.set("direction", "horizontal");+ }+ }+ else+ {+ if(val == "bar")+ {+ this.set("direction", "vertical");+ }+ }+ this._type = val;+ return this._type;+ }+ },+ + /**+ * Reference to the category axis used by the chart.+ *+ * @attribute categoryAxis+ * @type Axis+ */+ categoryAxis:{}+ }+});+/**+ * The PieChart class creates a pie chart+ *+ * @module charts+ * @submodule charts-base+ * @class PieChart+ * @extends ChartBase+ * @constructor+ */+Y.PieChart = Y.Base.create("pieChart", Y.Widget, [Y.ChartBase], {+ /**+ * Calculates and returns a `seriesCollection`.+ *+ * @method _getSeriesCollection+ * @return Array+ * @private+ */+ _getSeriesCollection: function()+ {+ if(this._seriesCollection)+ {+ return this._seriesCollection;+ }+ var axes = this.get("axes"),+ sc = [], + seriesKeys,+ i = 0,+ l,+ type = this.get("type"),+ key,+ catAxis = "categoryAxis",+ catKey = "categoryKey",+ valAxis = "valueAxis",+ seriesKey = "valueKey";+ if(axes)+ {+ seriesKeys = axes.values.get("keyCollection");+ key = axes.category.get("keyCollection")[0];+ l = seriesKeys.length;+ for(; i < l; ++i)+ {+ sc[i] = {type:type};+ sc[i][catAxis] = "category";+ sc[i][valAxis] = "values";+ sc[i][catKey] = key;+ sc[i][seriesKey] = seriesKeys[i];+ }+ }+ this._seriesCollection = sc;+ return sc;+ },++ /**+ * Creates `Axis` instances.+ *+ * @method _parseAxes+ * @param {Object} val Object containing `Axis` instances or objects in which to construct `Axis` instances.+ * @return Object+ * @private+ */+ _parseAxes: function(hash)+ {+ if(!this._axes)+ {+ this._axes = {};+ }+ var i, pos, axis, dh, config, axisClass,+ type = this.get("type"),+ w = this.get("width"),+ h = this.get("height"),+ node = Y.Node.one(this._parentNode);+ if(!w)+ {+ this.set("width", node.get("offsetWidth"));+ w = this.get("width");+ }+ if(!h)+ {+ this.set("height", node.get("offsetHeight"));+ h = this.get("height");+ }+ for(i in hash)+ {+ if(hash.hasOwnProperty(i))+ {+ dh = hash[i];+ pos = type == "pie" ? "none" : dh.position;+ axisClass = this._getAxisClass(dh.type);+ config = {dataProvider:this.get("dataProvider")};+ if(dh.hasOwnProperty("roundingUnit"))+ {+ config.roundingUnit = dh.roundingUnit;+ }+ config.keys = dh.keys;+ config.width = w;+ config.height = h;+ config.position = pos;+ config.styles = dh.styles;+ axis = new axisClass(config);+ axis.on("axisRendered", Y.bind(this._itemRendered, this));+ this._axes[i] = axis;+ }+ }+ },++ /**+ * Adds axes to the chart.+ *+ * @method _addAxes+ * @private+ */+ _addAxes: function()+ {+ var axes = this.get("axes"),+ i, + axis, + p;+ if(!axes)+ {+ this.set("axes", this._getDefaultAxes());+ axes = this.get("axes");+ }+ if(!this._axesCollection)+ { + this._axesCollection = [];+ }+ for(i in axes)+ {+ if(axes.hasOwnProperty(i))+ {+ axis = axes[i];+ p = axis.get("position");+ if(!this.get(p + "AxesCollection"))+ {+ this.set(p + "AxesCollection", [axis]);+ }+ else+ {+ this.get(p + "AxesCollection").push(axis);+ }+ this._axesCollection.push(axis);+ }+ }+ },++ /**+ * Renders the Graph.+ *+ * @method _addSeries+ * @private+ */+ _addSeries: function()+ {+ var graph = this.get("graph"),+ seriesCollection = this.get("seriesCollection");+ this._parseSeriesAxes(seriesCollection);+ graph.set("showBackground", false);+ graph.set("width", this.get("width"));+ graph.set("height", this.get("height"));+ graph.set("seriesCollection", seriesCollection);+ this._seriesCollection = graph.get("seriesCollection");+ graph.render(this.get("contentBox"));+ },++ /**+ * Parse and sets the axes for the chart.+ *+ * @method _parseSeriesAxes+ * @param {Array} c A collection `PieSeries` instance.+ * @private+ */+ _parseSeriesAxes: function(c)+ {+ var i = 0, + len = c.length, + s,+ axes = this.get("axes"),+ axis;+ for(; i < len; ++i)+ {+ s = c[i];+ if(s)+ {+ //If series is an actual series instance, + //replace axes attribute string ids with axes+ if(s instanceof Y.PieSeries)+ {+ axis = s.get("categoryAxis");+ if(axis && !(axis instanceof Y.Axis))+ {+ s.set("categoryAxis", axes[axis]);+ }+ axis = s.get("valueAxis");+ if(axis && !(axis instanceof Y.Axis))+ {+ s.set("valueAxis", axes[axis]);+ }+ continue;+ }+ s.categoryAxis = axes.category;+ s.valueAxis = axes.values;+ if(!s.type)+ {+ s.type = this.get("type");+ }+ }+ }+ },++ /**+ * Generates and returns a key-indexed object containing `Axis` instances or objects used to create `Axis` instances.+ *+ * @method _getDefaultAxes+ * @return Object+ * @private+ */+ _getDefaultAxes: function()+ {+ var catKey = this.get("categoryKey"),+ seriesKeys = this.get("seriesKeys").concat(), + seriesAxis = "numeric";+ return {+ values:{+ keys:seriesKeys,+ type:seriesAxis+ },+ category:{+ keys:[catKey],+ type:this.get("categoryType")+ }+ };+ },+ + /**+ * Returns an object literal containing a categoryItem and a valueItem for a given series index.+ *+ * @method getSeriesItem+ * @param series Reference to a series.+ * @param index Index of the specified item within a series.+ * @return Object+ */+ getSeriesItems: function(series, index)+ {+ var categoryItem = {+ axis: series.get("categoryAxis"),+ key: series.get("categoryKey"),+ displayName: series.get("categoryDisplayName")+ },+ valueItem = {+ axis: series.get("valueAxis"),+ key: series.get("valueKey"),+ displayName: series.get("valueDisplayName")+ };+ categoryItem.value = categoryItem.axis.getKeyValueAt(categoryItem.key, index);+ valueItem.value = valueItem.axis.getKeyValueAt(valueItem.key, index);+ return {category:categoryItem, value:valueItem};+ },++ /**+ * Handler for sizeChanged event.+ *+ * @method _sizeChanged+ * @param {Object} e Event object.+ * @private+ */+ _sizeChanged: function(e)+ {+ this._redraw();+ },++ /**+ * Redraws the chart instance.+ *+ * @method _redraw+ * @private+ */+ _redraw: function()+ {+ var graph = this.get("graph"),+ w = this.get("width"),+ h = this.get("height"),+ dimension;+ if(graph)+ {+ dimension = Math.min(w, h);+ graph.set("width", dimension);+ graph.set("height", dimension);+ }+ },+ + /**+ * Formats tooltip text for a pie chart.+ *+ * @method _tooltipLabelFunction+ * @param {Object} categoryItem An object containing the following:+ * <dl>+ * <dt>axis</dt><dd>The axis to which the category is bound.</dd>+ * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided)</dd>+ * <dt>key</dt><dd>The key of the category.</dd>+ * <dt>value</dt><dd>The value of the category</dd>+ * </dl>+ * @param {Object} valueItem An object containing the following:+ * <dl>+ * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>+ * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>+ * <dt>key</dt><dd>The key for the series.</dd>+ * <dt>value</dt><dd>The value for the series item.</dd> + * </dl>+ * @param {Number} itemIndex The index of the item within the series.+ * @param {CartesianSeries} series The `PieSeries` instance of the item.+ * @param {Number} seriesIndex The index of the series in the `seriesCollection`.+ * @return {HTML}+ * @private+ */+ _tooltipLabelFunction: function(categoryItem, valueItem, itemIndex, series, seriesIndex)+ {+ var msg = DOCUMENT.createElement("div"),+ total = series.getTotalValues(),+ pct = Math.round((valueItem.value / total) * 10000)/100;+ msg.appendChild(DOCUMENT.createTextNode(categoryItem.displayName ++ ": " + categoryItem.axis.get("labelFunction").apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]))); + msg.appendChild(DOCUMENT.createElement("br"));+ msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName + + ": " + valueItem.axis.get("labelFunction").apply(this, [valueItem.value, valueItem.axis.get("labelFormat")])));+ msg.appendChild(DOCUMENT.createElement("br"));+ msg.appendChild(DOCUMENT.createTextNode(pct + "%")); + return msg; + },++ /**+ * Returns the appropriate message based on the key press.+ *+ * @method _getAriaMessage+ * @param {Number} key The keycode that was pressed.+ * @return String+ */+ _getAriaMessage: function(key)+ {+ var msg = "",+ categoryItem,+ items,+ series,+ valueItem,+ seriesIndex = 0,+ itemIndex = this._itemIndex,+ seriesCollection = this.get("seriesCollection"),+ len,+ total,+ pct,+ markers;+ series = this.getSeries(parseInt(seriesIndex, 10));+ markers = series.get("markers");+ len = markers && markers.length ? markers.length : 0;+ if(key === 37)+ {+ itemIndex = itemIndex > 0 ? itemIndex - 1 : len - 1;+ }+ else if(key === 39)+ {+ itemIndex = itemIndex >= len - 1 ? 0 : itemIndex + 1;+ }+ this._itemIndex = itemIndex;+ items = this.getSeriesItems(series, itemIndex);+ categoryItem = items.category;+ valueItem = items.value;+ total = series.getTotalValues();+ pct = Math.round((valueItem.value / total) * 10000)/100;+ if(categoryItem && valueItem)+ {+ msg += categoryItem.displayName + ": " + categoryItem.axis.formatLabel.apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]) + ", ";+ msg += valueItem.displayName + ": " + valueItem.axis.formatLabel.apply(this, [valueItem.value, valueItem.axis.get("labelFormat")]) + ", "; + msg += "Percent of total " + valueItem.displayName + ": " + pct + "%,"; + }+ else+ {+ msg += "No data available,";+ }+ msg += (itemIndex + 1) + " of " + len + ". ";+ return msg;+ }+}, {+ ATTRS: {+ /**+ * Sets the aria description for the chart.+ *+ * @attribute ariaDescription+ * @type String+ */+ ariaDescription: {+ value: "Use the left and right keys to navigate through items.",++ setter: function(val)+ {+ if(this._description)+ {+ this._description.setContent("");+ this._description.appendChild(DOCUMENT.createTextNode(val));+ }+ return val;+ }+ },+ + /**+ * Axes to appear in the chart. + *+ * @attribute axes+ * @type Object+ */+ axes: {+ getter: function()+ {+ return this._axes;+ },++ setter: function(val)+ {+ this._parseAxes(val);+ }+ },++ /**+ * Collection of series to appear on the chart. This can be an array of Series instances or object literals+ * used to describe a Series instance.+ *+ * @attribute seriesCollection+ * @type Array+ */+ seriesCollection: {+ getter: function()+ {+ return this._getSeriesCollection();+ },+ + setter: function(val)+ {+ return this._setSeriesCollection(val);+ }+ },+ + /**+ * Type of chart when there is no series collection specified.+ *+ * @attribute type+ * @type String + */+ type: {+ value: "pie"+ }+ }+});+++}, '3.7.1', {"requires": ["dom", "datatype-number", "datatype-date", "event-custom", "event-mouseenter", "event-touch", "widget", "widget-position", "widget-stack", "graphics"]});
@@ -1,27 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("charts-base",function(b){var A=b.config,v=A.win,g=A.doc,q=b.Lang,m=q.isString,k,p,u,a,c=b.ClassNameManager.getClassName,n=c("seriesmarker"),r,C,w,z,t;r=function(D){r.superclass.constructor.apply(this,arguments);};r.NAME="shapeGroup";b.extend(r,b.Path,{_draw:function(){var K=this.get("xvalues"),H=this.get("yvalues"),O,N,E,G,V=0,W,S=[],I=this.get("dimensions"),T=I.width,P=I.height,F=I.radius,J=I.yRadius,Q=this.get("id"),D=this.node.className,U=q.isArray(T),R=q.isArray(P),L=q.isArray(F),M=q.isArray(J);if(K&&H&&K.length>0){this.clear();W=K.length;for(;V<W;++V){O=K[V];N=H[V];E=L?F[V]:F;G=M?J[V]:J;if(!isNaN(O)&&!isNaN(N)&&!isNaN(E)){this.drawShape({x:O,y:N,width:U?T[V]:T,height:R?P[V]:P,radius:E,yRadius:G});this.closePath();S[V]={id:Q+"_"+V,className:D,coords:(O-this._left)+", "+(N-this._top)+", "+F,shape:"circle"};}}this._closePath();}},_getRadiusCollection:function(G){var E=0,D=G.length,F=[];for(;E<D;++E){F[E]=G[E]*0.5;}return F;}});r.ATTRS=b.merge(b.Path.ATTRS,{dimensions:{getter:function(){var H=this._dimensions,F,E,G,D;if(H.hasOwnProperty("radius")){return H;}else{G=H.width;D=H.height;F=q.isArray(G)?this._getRadiusCollection(G):(G*0.5);E=q.isArray(D)?this._getRadiusCollection(D):(D*0.5);return{width:G,height:D,radius:F,yRadius:E};}},setter:function(D){this._dimensions=D;return D;}},xvalues:{getter:function(){return this._xvalues;},setter:function(D){this._xvalues=D;}},yvalues:{getter:function(){return this._yvalues;},setter:function(D){this._yvalues=D;}}});b.ShapeGroup=r;C=function(D){C.superclass.constructor.apply(this,arguments);};C.NAME="circleGroup";b.extend(C,b.ShapeGroup,{drawShape:function(D){this.drawCircle(D.x,D.y,D.radius);}});C.ATTRS=b.merge(b.ShapeGroup.ATTRS,{dimensions:{getter:function(){var H=this._dimensions,F,E,G,D;if(H.hasOwnProperty("radius")){return H;}else{G=H.width;D=H.height;F=q.isArray(G)?this._getRadiusCollection(G):(G*0.5);E=F;return{width:G,height:D,radius:F,yRadius:E};}}}});C.ATTRS=b.ShapeGroup.ATTRS;b.CircleGroup=C;w=function(D){w.superclass.constructor.apply(this,arguments);};w.NAME="rectGroup";b.extend(w,b.ShapeGroup,{drawShape:function(D){this.drawRect(D.x,D.y,D.width,D.height);}});w.ATTRS=b.ShapeGroup.ATTRS;b.RectGroup=w;t=function(D){t.superclass.constructor.apply(this,arguments);};t.NAME="diamondGroup";b.extend(t,b.ShapeGroup,{drawShape:function(D){this.drawDiamond(D.x,D.y,D.width,D.height);}});t.ATTRS=b.ShapeGroup.ATTRS;b.DiamondGroup=t;z=function(D){z.superclass.constructor.apply(this,arguments);};z.NAME="diamondGroup";b.extend(z,b.ShapeGroup,{drawShape:function(D){this.drawEllipse(D.x,D.y,D.width,D.height);}});z.ATTRS=b.ShapeGroup.ATTRS;b.EllipseGroup=z;function s(){}s.ATTRS={styles:{getter:function(){this._styles=this._styles||this._getDefaultStyles();return this._styles;},setter:function(D){this._styles=this._setStyles(D);}},graphic:{}};s.NAME="renderer";s.prototype={_styles:null,_setStyles:function(E){var D=this.get("styles");return this._mergeStyles(E,D);},_mergeStyles:function(E,D){if(!D){D={};}var F=b.merge(D,{});b.Object.each(E,function(I,H,G){if(D.hasOwnProperty(H)&&q.isObject(I)&&!q.isFunction(I)&&!q.isArray(I)){F[H]=this._mergeStyles(I,D[H]);}else{F[H]=I;}},this);return F;},_getDefaultStyles:function(){return{padding:{top:0,right:0,bottom:0,left:0}};}};b.augment(s,b.Attribute);b.Renderer=s;k=function(){};k.prototype={_getDefaultMargins:function(){return{top:0,left:0,right:4,bottom:0};},setTickOffsets:function(){var F=this,H=F.get("styles").majorTicks,E=H.length,D=E*0.5,G=H.display;F.set("topTickOffset",0);F.set("bottomTickOffset",0);switch(G){case"inside":F.set("rightTickOffset",E);F.set("leftTickOffset",0);break;case"outside":F.set("rightTickOffset",0);F.set("leftTickOffset",E);break;case"cross":F.set("rightTickOffset",D);F.set("leftTickOffset",D);break;default:F.set("rightTickOffset",0);F.set("leftTickOffset",0);break;}},drawTick:function(K,L,G){var J=this,D=J.get("styles"),I=D.padding,H=G.length,E={x:I.left,y:L.y},F={x:H+I.left,y:L.y};J.drawLine(K,E,F);},getLineStart:function(){var D=this.get("styles"),H=D.padding,I=D.majorTicks,E=I.length,G=I.display,F={x:H.left,y:0};if(G==="outside"){F.x+=E;}else{if(G==="cross"){F.x+=E/2;}}return F;},getLabelPoint:function(D){return{x:D.x-this.get("leftTickOffset"),y:D.y};},updateMaxLabelSize:function(H,F){var L=this,I=this._labelRotationProps,D=I.rot,G=I.absRot,K=I.sinRadians,E=I.cosRadians,J;if(D===0){J=H;}else{if(G===90){J=F;}else{J=(E*H)+(K*F);}}L._maxLabelSize=Math.max(L._maxLabelSize,J);},getExplicitlySized:function(G){if(this._explicitWidth){var F=this,D=F._explicitWidth,E=F._totalTitleSize,I=F.get("leftTickOffset"),H=G.label.margin.right;F._maxLabelSize=D-(I+H+E);return true;}return false;},positionTitle:function(K){var M=this,D=M._titleBounds,E=M.get("styles").title.margin,H=M._titleRotationProps,L=D.right-D.left,G=K.offsetWidth,F=K.offsetHeight,J=(G*-0.5)+(L*0.5),I=(M.get("height")*0.5)-(F*0.5);H.labelWidth=G;H.labelHeight=F;if(E&&E.left){J+=E.left;}H.x=J;H.y=I;H.transformOrigin=[0.5,0.5];M._rotate(K,H);},positionLabel:function(N,R,P,I){var Q=this,O=Q.get("leftTickOffset"),K=this._totalTitleSize,F=R.x+K-O,J=R.y,M=this._labelRotationProps,E=M.rot,H=M.absRot,D=Q._maxLabelSize,L=this._labelWidths[I],G=this._labelHeights[I];if(E===0){F-=L;J-=G*0.5;}else{if(E===90){F-=L*0.5;}else{if(E===-90){F-=L*0.5;J-=G;}else{F-=L+(G*H/360);J-=G*0.5;}}}M.labelWidth=L;M.labelHeight=G;M.x=Math.round(D+F);M.y=Math.round(J);this._rotate(N,M);},_setRotationCoords:function(H){var E=H.rot,F=H.absRot,I,G,D=H.labelWidth,J=H.labelHeight;if(E===0){I=D;G=J*0.5;}else{if(E===90){G=0;I=D*0.5;}else{if(E===-90){I=D*0.5;G=J;}else{I=D+(J*F/360);G=J*0.5;}}}H.x-=I;H.y-=G;},_getTransformOrigin:function(D){var E;if(D===0){E=[0,0];}else{if(D===90){E=[0.5,0];}else{if(D===-90){E=[0.5,1];}else{E=[1,0.5];}}}return E;},offsetNodeForTick:function(D){},setCalculatedSize:function(){var I=this,K=this.get("graphic"),H=I.get("styles"),G=H.label,J=I.get("leftTickOffset"),E=I._maxLabelSize,F=this._totalTitleSize,D=Math.round(F+J+E+G.margin.right);-if(this._explicitWidth){D=this._explicitWidth;}this.set("calculatedWidth",D);K.set("x",D-J);}};b.LeftAxisLayout=k;p=function(){};p.prototype={_getDefaultMargins:function(){return{top:0,left:4,right:0,bottom:0};},setTickOffsets:function(){var F=this,H=F.get("styles").majorTicks,E=H.length,D=E*0.5,G=H.display;F.set("topTickOffset",0);F.set("bottomTickOffset",0);switch(G){case"inside":F.set("leftTickOffset",E);F.set("rightTickOffset",0);break;case"outside":F.set("leftTickOffset",0);F.set("rightTickOffset",E);break;case"cross":F.set("rightTickOffset",D);F.set("leftTickOffset",D);break;default:F.set("leftTickOffset",0);F.set("rightTickOffset",0);break;}},drawTick:function(K,L,G){var J=this,D=J.get("styles"),I=D.padding,H=G.length,E={x:I.left,y:L.y},F={x:I.left+H,y:L.y};J.drawLine(K,E,F);},getLineStart:function(){var F=this,D=F.get("styles"),I=D.padding,J=D.majorTicks,E=J.length,H=J.display,G={x:I.left,y:I.top};if(H==="inside"){G.x+=E;}else{if(H==="cross"){G.x+=E/2;}}return G;},getLabelPoint:function(D){return{x:D.x+this.get("rightTickOffset"),y:D.y};},updateMaxLabelSize:function(H,F){var L=this,I=this._labelRotationProps,D=I.rot,G=I.absRot,K=I.sinRadians,E=I.cosRadians,J;if(D===0){J=H;}else{if(G===90){J=F;}else{J=(E*H)+(K*F);}}L._maxLabelSize=Math.max(L._maxLabelSize,J);},getExplicitlySized:function(G){if(this._explicitWidth){var F=this,D=F._explicitWidth,E=this._totalTitleSize,I=F.get("rightTickOffset"),H=G.label.margin.right;F._maxLabelSize=D-(I+H+E);return true;}return false;},positionTitle:function(K){var M=this,D=M._titleBounds,E=M.get("styles").title.margin,H=M._titleRotationProps,G=K.offsetWidth,F=K.offsetHeight,L=D.right-D.left,J=this.get("width")-(G*0.5)-(L*0.5),I=(M.get("height")*0.5)-(F*0.5);H.labelWidth=G;H.labelHeight=F;if(E&&E.right){J-=E.left;}H.x=J;H.y=I;H.transformOrigin=[0.5,0.5];M._rotate(K,H);},positionLabel:function(N,R,P,I){var Q=this,O=Q.get("rightTickOffset"),M=P.label,F=0,E=R.x,J=R.y,L=this._labelRotationProps,D=L.rot,H=L.absRot,K=this._labelWidths[I],G=this._labelHeights[I];if(M.margin&&M.margin.left){F=M.margin.left;}if(D===0){J-=G*0.5;}else{if(D===90){E-=K*0.5;J-=G;}else{if(D===-90){E-=K*0.5;}else{J-=G*0.5;E+=G/2*H/90;}}}E+=F;E+=O;L.labelWidth=K;L.labelHeight=G;L.x=Math.round(E);L.y=Math.round(J);this._rotate(N,L);},_setRotationCoords:function(H){var E=H.rot,F=H.absRot,I=0,G=0,D=H.labelWidth,J=H.labelHeight;if(E===0){G=J*0.5;}else{if(E===90){I=D*0.5;G=J;}else{if(E===-90){I=D*0.5;}else{G=J*0.5;I=J/2*F/90;}}}H.x-=I;H.y-=G;},_getTransformOrigin:function(D){var E;if(D===0){E=[0,0];}else{if(D===90){E=[0.5,1];}else{if(D===-90){E=[0.5,0];}else{E=[0,0.5];}}}return E;},offsetNodeForTick:function(D){var E=this,G=E.get("leftTickOffset"),F=0-G;D.setStyle("left",F);},setCalculatedSize:function(){var H=this,G=H.get("styles"),E=G.label,F=this._totalTitleSize,D=Math.round(H.get("rightTickOffset")+H._maxLabelSize+F+E.margin.left);if(this._explicitWidth){D=this._explicitWidth;}H.set("calculatedWidth",D);H.get("contentBox").setStyle("width",D);}};b.RightAxisLayout=p;u=function(){};u.prototype={_getDefaultMargins:function(){return{top:4,left:0,right:0,bottom:0};},setTickOffsets:function(){var F=this,H=F.get("styles").majorTicks,E=H.length,D=E*0.5,G=H.display;F.set("leftTickOffset",0);F.set("rightTickOffset",0);switch(G){case"inside":F.set("topTickOffset",E);F.set("bottomTickOffset",0);break;case"outside":F.set("topTickOffset",0);F.set("bottomTickOffset",E);break;case"cross":F.set("topTickOffset",D);F.set("bottomTickOffset",D);break;default:F.set("topTickOffset",0);F.set("bottomTickOffset",0);break;}},getLineStart:function(){var D=this.get("styles"),H=D.padding,I=D.majorTicks,E=I.length,G=I.display,F={x:0,y:H.top};if(G==="inside"){F.y+=E;}else{if(G==="cross"){F.y+=E/2;}}return F;},drawTick:function(K,L,G){var J=this,D=J.get("styles"),I=D.padding,H=G.length,E={x:L.x,y:I.top},F={x:L.x,y:H+I.top};J.drawLine(K,E,F);},getLabelPoint:function(D){return{x:D.x,y:D.y+this.get("bottomTickOffset")};},updateMaxLabelSize:function(H,F){var L=this,I=this._labelRotationProps,D=I.rot,G=I.absRot,K=I.sinRadians,E=I.cosRadians,J;if(D===0){J=F;}else{if(G===90){J=H;}else{J=(K*H)+(E*F);}}L._maxLabelSize=Math.max(L._maxLabelSize,J);},getExplicitlySized:function(H){if(this._explicitHeight){var G=this,E=G._explicitHeight,D=G._totalTitleSize,F=G.get("bottomTickOffset"),I=H.label.margin.right;G._maxLabelSize=E-(F+I+D);return true;}return false;},positionTitle:function(L){var M=this,D=M._titleBounds,E=M.get("styles").title.margin,I=M._titleRotationProps,G=D.bottom-D.top,H=L.offsetWidth,F=L.offsetHeight,K=(M.get("width")*0.5)-(H*0.5),J=M.get("height")-F/2-G/2;I.labelWidth=H;I.labelHeight=F;if(E&&E.bottom){J-=E.bottom;}I.x=K;I.y=J;I.transformOrigin=[0.5,0.5];M._rotate(L,I);},positionLabel:function(N,R,P,I){var Q=this,O=Q.get("bottomTickOffset"),M=P.label,F=0,L=Q._labelRotationProps,E=L.rot,H=L.absRot,D=Math.round(R.x),J=Math.round(R.y),K=Q._labelWidths[I],G=Q._labelHeights[I];if(M.margin&&M.margin.top){F=M.margin.top;}if(E>0){J-=G/2*E/90;}else{if(E<0){D-=K;J-=G/2*H/90;}else{D-=K*0.5;}}J+=F;J+=O;L.labelWidth=K;L.labelHeight=G;L.x=D;L.y=J;Q._rotate(N,L);},_setRotationCoords:function(H){var E=H.rot,F=H.absRot,D=H.labelWidth,J=H.labelHeight,I,G;if(E>0){I=0;G=J/2*E/90;}else{if(E<0){I=D;G=J/2*F/90;}else{I=D*0.5;G=0;}}H.x-=I;H.y-=G;},_getTransformOrigin:function(D){var E;if(D>0){E=[0,0.5];}else{if(D<0){E=[1,0.5];}else{E=[0,0];}}return E;},offsetNodeForTick:function(D){var E=this;E.get("contentBox").setStyle("top",0-E.get("topTickOffset"));},setCalculatedSize:function(){var H=this,G=H.get("styles"),E=G.label,F=H._totalTitleSize,D=Math.round(H.get("bottomTickOffset")+H._maxLabelSize+E.margin.top+F);if(H._explicitHeight){D=H._explicitHeight;}H.set("calculatedHeight",D);}};b.BottomAxisLayout=u;a=function(){};a.prototype={_getDefaultMargins:function(){return{top:0,left:0,right:0,bottom:4};},setTickOffsets:function(){var F=this,H=F.get("styles").majorTicks,E=H.length,D=E*0.5,G=H.display;F.set("leftTickOffset",0);F.set("rightTickOffset",0);-switch(G){case"inside":F.set("bottomTickOffset",E);F.set("topTickOffset",0);break;case"outside":F.set("bottomTickOffset",0);F.set("topTickOffset",E);break;case"cross":F.set("topTickOffset",D);F.set("bottomTickOffset",D);break;default:F.set("topTickOffset",0);F.set("bottomTickOffset",0);break;}},getLineStart:function(){var F=this,D=F.get("styles"),I=D.padding,J=D.majorTicks,E=J.length,H=J.display,G={x:0,y:I.top};if(H==="outside"){G.y+=E;}else{if(H==="cross"){G.y+=E/2;}}return G;},drawTick:function(K,L,G){var J=this,D=J.get("styles"),I=D.padding,H=G.length,E={x:L.x,y:I.top},F={x:L.x,y:H+I.top};J.drawLine(K,E,F);},getLabelPoint:function(D){return{x:D.x,y:D.y-this.get("topTickOffset")};},updateMaxLabelSize:function(H,F){var L=this,I=this._labelRotationProps,D=I.rot,G=I.absRot,K=I.sinRadians,E=I.cosRadians,J;if(D===0){J=F;}else{if(G===90){J=H;}else{J=(K*H)+(E*F);}}L._maxLabelSize=Math.max(L._maxLabelSize,J);},getExplicitlySized:function(G){if(this._explicitHeight){var F=this,E=F._explicitHeight,D=F._totalTitleSize,I=F.get("topTickOffset"),H=G.label.margin.right;F._maxLabelSize=E-(I+H+D);return true;}return false;},positionTitle:function(L){var M=this,D=M._titleBounds,E=M.get("styles").title.margin,I=M._titleRotationProps,H=L.offsetWidth,F=L.offsetHeight,G=D.bottom-D.top,K=(M.get("width")*0.5)-(H*0.5),J=G/2-F/2;I.labelWidth=H;I.labelHeight=F;if(E&&E.top){J+=E.top;}I.x=K;I.y=J;I.transformOrigin=[0.5,0.5];M._rotate(L,I);},positionLabel:function(N,Q,O,I){var P=this,K=this._totalTitleSize,D=P._maxLabelSize,F=Q.x,J=Q.y+K+D,M=this._labelRotationProps,E=M.rot,H=M.absRot,L=this._labelWidths[I],G=this._labelHeights[I];if(E===0){F-=L*0.5;J-=G;}else{if(E===90){F-=L;J-=(G*0.5);}else{if(E===-90){J-=(G*0.5);}else{if(E>0){F-=L;J-=G-(G*E/180);}else{J-=G-(G*H/180);}}}}M.x=Math.round(F);M.y=Math.round(J);M.labelWidth=L;M.labelHeight=G;this._rotate(N,M);},_setRotationCoords:function(H){var E=H.rot,F=H.absRot,D=H.labelWidth,J=H.labelHeight,I,G;if(E===0){I=D*0.5;G=J;}else{if(E===90){I=D;G=(J*0.5);}else{if(E===-90){G=(J*0.5);}else{if(E>0){I=D;G=J-(J*E/180);}else{G=J-(J*F/180);}}}}H.x-=I;H.y-=G;},_getTransformOrigin:function(D){var E;if(D===0){E=[0,0];}else{if(D===90){E=[1,0.5];}else{if(D===-90){E=[0,0.5];}else{if(D>0){E=[1,0.5];}else{E=[0,0.5];}}}}return E;},offsetNodeForTick:function(D){},setCalculatedSize:function(){var H=this,K=H.get("graphic"),G=H.get("styles"),F=G.label.margin,J=F.bottom+H._maxLabelSize,E=H._totalTitleSize,I=this.get("topTickOffset"),D=Math.round(I+J+E);if(this._explicitHeight){D=this._explicitWidth;}H.set("calculatedHeight",D);K.set("y",D-I);}};b.TopAxisLayout=a;b.Axis=b.Base.create("axis",b.Widget,[b.Renderer],{_calculatedWidth:0,_calculatedHeight:0,_dataChangeHandler:function(D){if(this.get("rendered")){this._drawAxis();}},_positionChangeHandler:function(D){this._updateGraphic(D.newVal);this._updateHandler();},_updateGraphic:function(D){var E=this.get("graphic");if(D=="none"){if(E){E.destroy();}}else{if(!E){this._setCanvas();}}},_updateHandler:function(D){if(this.get("rendered")){this._drawAxis();}},renderUI:function(){this._updateGraphic(this.get("position"));},syncUI:function(){var H=this._layout,G,F,D,I,E;if(H){G=H._getDefaultMargins();F=this.get("styles");D=F.label.margin;I=F.title.margin;for(E in G){if(G.hasOwnProperty(E)){D[E]=D[E]===undefined?G[E]:D[E];I[E]=I[E]===undefined?G[E]:I[E];}}}this._drawAxis();},_setCanvas:function(){var D=this.get("contentBox"),I=this.get("boundingBox"),H=this.get("position"),F=this._parentNode,E=this.get("width"),G=this.get("height");I.setStyle("position","absolute");I.setStyle("zIndex",2);E=E?E+"px":F.getStyle("width");G=G?G+"px":F.getStyle("height");if(H==="top"||H==="bottom"){D.setStyle("width",E);}else{D.setStyle("height",G);}D.setStyle("position","relative");D.setStyle("left","0px");D.setStyle("top","0px");this.set("graphic",new b.Graphic());this.get("graphic").render(D);},_getDefaultStyles:function(){var D={majorTicks:{display:"inside",length:4,color:"#dad8c9",weight:1,alpha:1},minorTicks:{display:"none",length:2,color:"#dad8c9",weight:1},line:{weight:1,color:"#dad8c9",alpha:1},majorUnit:{determinant:"count",count:11,distance:75},top:"0px",left:"0px",width:"100px",height:"100px",label:{color:"#808080",alpha:1,fontSize:"85%",rotation:0,margin:{top:undefined,right:undefined,bottom:undefined,left:undefined}},title:{color:"#808080",alpha:1,fontSize:"85%",rotation:undefined,margin:{top:undefined,right:undefined,bottom:undefined,left:undefined}},hideOverlappingLabelTicks:false};return b.merge(b.Renderer.prototype._getDefaultStyles(),D);},_handleSizeChange:function(G){var F=G.attrName,I=this.get("position"),E=I=="left"||I=="right",D=this.get("contentBox"),H=I=="bottom"||I=="top";D.setStyle("width",this.get("width"));D.setStyle("height",this.get("height"));if((H&&F=="width")||(E&&F=="height")){this._drawAxis();}},_layoutClasses:{top:a,bottom:u,left:k,right:p},drawLine:function(F,E,D){F.moveTo(E.x,E.y);F.lineTo(D.x,D.y);},_getTextRotationProps:function(H){if(H.rotation===undefined){switch(this.get("position")){case"left":H.rotation=-90;break;case"right":H.rotation=90;break;default:H.rotation=0;break;}}var E=Math.min(90,Math.max(-90,H.rotation)),G=Math.abs(E),F=Math.PI/180,I=parseFloat(parseFloat(Math.sin(G*F)).toFixed(8)),D=parseFloat(parseFloat(Math.cos(G*F)).toFixed(8));return{rot:E,absRot:G,radCon:F,sinRadians:I,cosRadians:D,textAlpha:H.alpha};},_drawAxis:function(){if(this._drawing){this._callLater=true;return;}this._drawing=true;this._callLater=false;if(this._layout){var L=this.get("styles"),N=L.line,J=L.label,Z=L.majorTicks,D=Z.display!="none",M,G=L.majorUnit,W,U,V=0,X=this._layout,T,aa,P,K,Y,E,I=this.get("labelFunction"),F=this.get("labelFunctionScope"),H=this.get("labelFormat"),O=this.get("graphic"),Q=this.get("path"),R,S;this._labelWidths=[];this._labelHeights=[];O.set("autoDraw",false);Q.clear();Q.set("stroke",{weight:N.weight,color:N.color,opacity:N.alpha});this._labelRotationProps=this._getTextRotationProps(J);this._labelRotationProps.transformOrigin=X._getTransformOrigin(this._labelRotationProps.rot);-X.setTickOffsets.apply(this);T=this.getLength();P=X.getLineStart.apply(this);W=this.getTotalMajorUnits(G);U=this.getMajorUnitDistance(W,T,G);this.set("edgeOffset",this.getEdgeOffset(W,T)*0.5);if(W<1){this._clearLabelCache();}else{M=this.getFirstPoint(P);this.drawLine(Q,P,this.getLineEnd(M));if(D){R=this.get("tickPath");R.clear();R.set("stroke",{weight:Z.weight,color:Z.color,opacity:Z.alpha});X.drawTick.apply(this,[R,M,Z]);}this._createLabelCache();this._tickPoints=[];this._maxLabelSize=0;this._totalTitleSize=0;this._titleSize=0;this._setTitle();S=X.getExplicitlySized.apply(this,[L]);for(;V<W;++V){if(D){X.drawTick.apply(this,[R,M,Z]);}aa=this.getPosition(M);K=this.getLabel(M,J);this._labels.push(K);this._tickPoints.push({x:M.x,y:M.y});this.get("appendLabelFunction")(K,I.apply(F,[this.getLabelByIndex(V,W),H]));Y=Math.round(K.offsetWidth);E=Math.round(K.offsetHeight);if(!S){this._layout.updateMaxLabelSize.apply(this,[Y,E]);}this._labelWidths.push(Y);this._labelHeights.push(E);M=this.getNextPoint(M,U);}this._clearLabelCache();if(this.get("overlapGraph")){X.offsetNodeForTick.apply(this,[this.get("contentBox")]);}X.setCalculatedSize.apply(this);if(this._titleTextField){this._layout.positionTitle.apply(this,[this._titleTextField]);}for(V=0;V<W;++V){X.positionLabel.apply(this,[this.get("labels")[V],this._tickPoints[V],L,V]);}}}this._drawing=false;if(this._callLater){this._drawAxis();}else{this._updatePathElement();this.fire("axisRendered");}},_setTotalTitleSize:function(L){var J=this._titleTextField,K=J.offsetWidth,H=J.offsetHeight,E=this._titleRotationProps.rot,D,M,F=L.margin,G=this.get("position"),I=new b.Matrix();I.rotate(E);D=I.getContentRect(K,H);if(G=="left"||G=="right"){M=D.right-D.left;if(F){M+=F.left+F.right;}}else{M=D.bottom-D.top;if(F){M+=F.top+F.bottom;}}this._titleBounds=D;this._totalTitleSize=M;},_updatePathElement:function(){var D=this._path,G=this._tickPath,E=false,F=this.get("graphic");if(D){E=true;D.end();}if(G){E=true;G.end();}if(E){F._redraw();}},_setTitle:function(){var F,H,G,I=this.get("title"),E=this._titleTextField,D;if(I!==null&&I!==undefined){G={rotation:"rotation",margin:"margin",alpha:"alpha"};H=this.get("styles").title;if(!E){E=g.createElement("span");E.style.display="block";E.style.whiteSpace="nowrap";E.setAttribute("class","axisTitle");this.get("contentBox").append(E);}else{if(!g.createElementNS){if(E.style.filter){E.style.filter=null;}}}E.style.position="absolute";for(F in H){if(H.hasOwnProperty(F)&&!G.hasOwnProperty(F)){E.style[F]=H[F];}}this.get("appendTitleFunction")(E,I);this._titleTextField=E;this._titleRotationProps=this._getTextRotationProps(H);this._setTotalTitleSize(H);}else{if(E){D=E.parentNode;if(D){D.removeChild(E);}this._titleTextField=null;this._totalTitleSize=0;}}},getLabel:function(I,G){var E,D,H=this._labelCache,F={rotation:"rotation",margin:"margin",alpha:"alpha"};if(H&&H.length>0){D=H.shift();}else{D=g.createElement("span");D.className=b.Lang.trim([D.className,"axisLabel"].join(" "));this.get("contentBox").append(D);}if(!g.createElementNS){if(D.style.filter){D.style.filter=null;}}D.style.display="block";D.style.whiteSpace="nowrap";D.style.position="absolute";for(E in G){if(G.hasOwnProperty(E)&&!F.hasOwnProperty(E)){D.style[E]=G[E];}}return D;},_createLabelCache:function(){if(this._labels){while(this._labels.length>0){this._labelCache.push(this._labels.shift());}}else{this._clearLabelCache();}this._labels=[];},_clearLabelCache:function(){if(this._labelCache){var D=this._labelCache.length,F=0,E;for(;F<D;++F){E=this._labelCache[F];this._removeChildren(E);b.Event.purgeElement(E,true);E.parentNode.removeChild(E);}}this._labelCache=[];},getLineEnd:function(F){var D=this.get("width"),E=this.get("height"),G=this.get("position");if(G==="top"||G==="bottom"){return{x:D,y:F.y};}else{return{x:F.x,y:E};}},getLength:function(){var E,G=this.get("styles"),H=G.padding,D=this.get("width"),F=this.get("height"),I=this.get("position");if(I==="top"||I==="bottom"){E=D-(H.left+H.right);}else{E=F-(H.top+H.bottom);}return E;},getFirstPoint:function(G){var D=this.get("styles"),H=this.get("position"),F=D.padding,E={x:G.x,y:G.y};if(H==="top"||H==="bottom"){E.x+=F.left+this.get("edgeOffset");}else{E.y+=this.get("height")-(F.top+this.get("edgeOffset"));}return E;},getNextPoint:function(D,E){var F=this.get("position");if(F==="top"||F==="bottom"){D.x=D.x+E;}else{D.y=D.y-E;}return D;},getLastPoint:function(){var E=this.get("styles"),F=E.padding,D=this.get("width"),G=this.get("position");if(G==="top"||G==="bottom"){return{x:D-F.right,y:F.top};}else{return{x:F.left,y:F.top};}},getPosition:function(D){var I,G=this.get("height"),F=this.get("styles"),H=F.padding,J=this.get("position"),E=this.get("dataType");if(J==="left"||J==="right"){if(E==="numeric"){I=(G-(H.top+H.bottom))-(D.y-H.top);}else{I=D.y-H.top;}}else{I=D.x-H.left;}return I;},_rotate:function(J,G){var D=G.rot,L=G.x,I=G.y,F,M,K=new b.Matrix(),E=G.transformOrigin||[0,0],H;if(g.createElementNS){K.translate(L,I);K.rotate(D);J.style.MozTransformOrigin=(E[0]*100)+"% "+(E[1]*100)+"%";J.style.MozTransform=K.toCSSText();J.style.webkitTransformOrigin=(E[0]*100)+"% "+(E[1]*100)+"%";J.style.webkitTransform=K.toCSSText();J.style.msTransformOrigin=(E[0]*100)+"% "+(E[1]*100)+"%";J.style.msTransform=K.toCSSText();J.style.OTransformOrigin=(E[0]*100)+"% "+(E[1]*100)+"%";J.style.OTransform=K.toCSSText();}else{M=G.textAlpha;if(q.isNumber(M)&&M<1&&M>-1&&!isNaN(M)){F="progid:DXImageTransform.Microsoft.Alpha(Opacity="+Math.round(M*100)+")";}if(D!==0){K.rotate(D);H=K.getContentRect(G.labelWidth,G.labelHeight);K.init();K.translate(H.left,H.top);K.translate(L,I);this._simulateRotateWithTransformOrigin(K,D,E,G.labelWidth,G.labelHeight);if(F){F+=" ";}else{F="";}F+=K.toFilterText();J.style.left=K.dx+"px";J.style.top=K.dy+"px";}else{J.style.left=L+"px";J.style.top=I+"px";}if(F){J.style.filter=F;}}},_simulateRotateWithTransformOrigin:function(F,E,G,D,H){var J=G[0]*D,I=G[1]*H;J=!isNaN(J)?J:0;I=!isNaN(I)?I:0;F.translate(J,I);F.rotate(E);F.translate(-J,-I);},getMaxLabelBounds:function(){return this._getLabelBounds(this.getMaximumValue());-},getMinLabelBounds:function(){return this._getLabelBounds(this.getMinimumValue());},_getLabelBounds:function(I){var H=this._layout,G=this.get("styles").label,D=new b.Matrix(),E,F=this._getTextRotationProps(G);F.transformOrigin=H._getTransformOrigin(F.rot);E=this.getLabel({x:0,y:0},G);this.get("appendLabelFunction")(E,this.get("labelFunction").apply(this,[I,this.get("labelFormat")]));F.labelWidth=E.offsetWidth;F.labelHeight=E.offsetHeight;this._removeChildren(E);b.Event.purgeElement(E,true);E.parentNode.removeChild(E);F.x=0;F.y=0;H._setRotationCoords(F);D.translate(F.x,F.y);this._simulateRotateWithTransformOrigin(D,F.rot,F.transformOrigin,F.labelWidth,F.labelHeight);return D.getContentRect(F.labelWidth,F.labelHeight);},_removeChildren:function(D){if(D.hasChildNodes()){var E;while(D.firstChild){E=D.firstChild;this._removeChildren(E);D.removeChild(E);}}},destructor:function(){var E=this.get("contentBox").getDOMNode(),H=this.get("labels"),G=this.get("graphic"),F,D=H?H.length:0;if(D>0){while(H.length>0){F=H.shift();this._removeChildren(F);E.removeChild(F);F=null;}}if(G){G.destroy();}},_maxLabelSize:0,_setText:function(D,E){D.innerHTML="";if(q.isNumber(E)){E=E+"";}else{if(!E){E="";}}if(m(E)){E=g.createTextNode(E);}D.appendChild(E);}},{ATTRS:{width:{lazyAdd:false,getter:function(){if(this._explicitWidth){return this._explicitWidth;}return this._calculatedWidth;},setter:function(D){this._explicitWidth=D;return D;}},height:{lazyAdd:false,getter:function(){if(this._explicitHeight){return this._explicitHeight;}return this._calculatedHeight;},setter:function(D){this._explicitHeight=D;return D;}},calculatedWidth:{getter:function(){return this._calculatedWidth;},setter:function(D){this._calculatedWidth=D;return D;}},calculatedHeight:{getter:function(){return this._calculatedHeight;},setter:function(D){this._calculatedHeight=D;return D;}},edgeOffset:{value:0},graphic:{},path:{readOnly:true,getter:function(){if(!this._path){var D=this.get("graphic");if(D){this._path=D.addShape({type:"path"});}}return this._path;}},tickPath:{readOnly:true,getter:function(){if(!this._tickPath){var D=this.get("graphic");if(D){this._tickPath=D.addShape({type:"path"});}}return this._tickPath;}},node:{},position:{setter:function(E){var D=this._layoutClasses[E];if(E&&E!="none"){this._layout=new D();}return E;}},topTickOffset:{value:0},bottomTickOffset:{value:0},leftTickOffset:{value:0},rightTickOffset:{value:0},labels:{readOnly:true,getter:function(){return this._labels;}},tickPoints:{readOnly:true,getter:function(){if(this.get("position")=="none"){return this.get("styles").majorUnit.count;}return this._tickPoints;}},overlapGraph:{value:true,validator:function(D){return q.isBoolean(D);}},labelFunctionScope:{},maxLabelSize:{getter:function(){return this._maxLabelSize;},setter:function(D){this._maxLabelSize=D;return D;}},title:{value:null},labelFunction:{value:function(E,D){return E;}},appendLabelFunction:{getter:function(){return this._setText;}},appendTitleFunction:{getter:function(){return this._setText;}}}});b.AxisType=b.Base.create("baseAxis",b.Axis,[],{initializer:function(){this.after("dataReady",b.bind(this._dataChangeHandler,this));this.after("dataUpdate",b.bind(this._dataChangeHandler,this));this.after("minimumChange",b.bind(this._keyChangeHandler,this));this.after("maximumChange",b.bind(this._keyChangeHandler,this));this.after("keysChange",this._keyChangeHandler);this.after("dataProviderChange",this._dataProviderChangeHandler);this.after("alwaysShowZeroChange",this._keyChangeHandler);this.after("roundingMethodChange",this._keyChangeHandler);},bindUI:function(){this.after("stylesChange",this._updateHandler);this.after("overlapGraphChange",this._updateHandler);this.after("positionChange",this._positionChangeHandler);this.after("widthChange",this._handleSizeChange);this.after("heightChange",this._handleSizeChange);this.after("calculatedWidthChange",this._handleSizeChange);this.after("calculatedHeightChange",this._handleSizeChange);},_dataProviderChangeHandler:function(G){var D=this.get("keyCollection").concat(),F=this.get("keys"),E;if(F){for(E in F){if(F.hasOwnProperty(E)){delete F[E];}}}if(D&&D.length){this.set("keys",D);}},GUID:"yuibaseaxis",_type:null,_setMaximum:null,_dataMaximum:null,_setMinimum:null,_data:null,_updateTotalDataFlag:true,_dataReady:false,addKey:function(D){this.set("keys",D);},_getKeyArray:function(G,H){var F=0,I,E=[],D=H.length;for(;F<D;++F){I=H[F];E[F]=I[G];}return E;},_setDataByKey:function(H,I){var G,J,E=[],F=this._dataClone.concat(),D=F.length;for(G=0;G<D;++G){J=F[G];E[G]=J[H];}this.get("keys")[H]=E;this._updateTotalDataFlag=true;},_updateTotalData:function(){var E=this.get("keys"),D;this._data=[];for(D in E){if(E.hasOwnProperty(D)){this._data=this._data.concat(E[D]);}}this._updateTotalDataFlag=false;},removeKey:function(E){var D=this.get("keys");if(D.hasOwnProperty(E)){delete D[E];this._keyChangeHandler();}},getKeyValueAt:function(E,D){var G=NaN,F=this.get("keys");if(F[E]&&q.isNumber(parseFloat(F[E][D]))){G=F[E][D];}return parseFloat(G);},getDataByKey:function(E){var D=this.get("keys");if(D[E]){return D[E];}return null;},_updateMinAndMax:function(){var I=this.get("data"),E=0,H=0,D,F,G;if(I&&I.length&&I.length>0){D=I.length;E=H=I[0];if(D>1){for(G=1;G<D;G++){F=I[G];if(isNaN(F)){continue;}E=Math.max(F,E);H=Math.min(F,H);}}}this._dataMaximum=E;this._dataMinimum=H;},getTotalMajorUnits:function(){var E,F=this.get("styles").majorUnit,D=this.get("length");if(F.determinant==="count"){E=F.count;}else{if(F.determinant==="distance"){E=(D/F.distance)+1;}}return E;},getMajorUnitDistance:function(D,G,E){var F;if(E.determinant==="count"){F=G/(D-1);}else{if(E.determinant==="distance"){F=E.distance;}}return F;},getEdgeOffset:function(E,D){return 0;},getLabelByIndex:function(H,E){var G=this.get("minimum"),D=this.get("maximum"),I=(D-G)/(E-1),F;E-=1;F=G+(H*I);return F;},_keyChangeHandler:function(D){this._updateMinAndMax();this.fire("dataUpdate");},_hasDataOverflow:function(){if(this.get("setMin")||this.get("setMax")){return true;-}return false;},getMinimumValue:function(){return this.get("minimum");},getMaximumValue:function(){return this.get("maximum");}},{ATTRS:{keys:{value:{},setter:function(H){var F={},E,D,G=this.get("dataProvider");if(q.isArray(H)){D=H.length;for(E=0;E<D;++E){F[H[E]]=this._getKeyArray(H[E],G);}}else{if(q.isString(H)){F=this.get("keys");F[H]=this._getKeyArray(H,G);}else{for(E in H){if(H.hasOwnProperty(E)){F[E]=this._getKeyArray(E,G);}}}}this._updateTotalDataFlag=true;return F;}},roundingMethod:{value:"niceNumber"},type:{readOnly:true,getter:function(){return this._type;}},dataProvider:{setter:function(D){return D;}},dataMaximum:{getter:function(){if(!this._dataMaximum){this._updateMinAndMax();}return this._dataMaximum;}},maximum:{lazyAdd:false,getter:function(){var D=this.get("dataMaximum"),E=this.get("minimum");if(E===0&&D===0){D=10;}if(q.isNumber(this._setMaximum)){D=this._setMaximum;}return parseFloat(D);},setter:function(D){this._setMaximum=parseFloat(D);return D;}},dataMinimum:{getter:function(){if(!this._dataMinimum){this._updateMinAndMax();}return this._dataMinimum;}},minimum:{lazyAdd:false,getter:function(){var D=this.get("dataMinimum");if(q.isNumber(this._setMinimum)){D=this._setMinimum;}return parseFloat(D);},setter:function(D){this._setMinimum=parseFloat(D);return D;}},setMax:{readOnly:true,getter:function(){return q.isNumber(this._setMaximum);}},setMin:{readOnly:true,getter:function(){return q.isNumber(this._setMinimum);}},data:{getter:function(){if(!this._data||this._updateTotalDataFlag){this._updateTotalData();}return this._data;}},keyCollection:{getter:function(){var F=this.get("keys"),E,D=[];for(E in F){if(F.hasOwnProperty(E)){D.push(E);}}return D;},readOnly:true}}});function l(D){l.superclass.constructor.apply(this,arguments);}l.NAME="numericAxis";l.ATTRS={alwaysShowZero:{value:true},labelFunction:{value:function(E,D){if(D){return b.DataType.Number.format(E,D);}return E;}},labelFormat:{value:{prefix:"",thousandsSeparator:"",decimalSeparator:"",decimalPlaces:"0",suffix:""}}};b.extend(l,b.AxisType,{formatLabel:function(E,D){if(D){return b.DataType.Number.format(E,D);}return E;},getTotalByKey:function(G){var H=0,E=this.getDataByKey(G),F=0,I,D=E?E.length:0;for(;F<D;++F){I=parseFloat(E[F]);if(!isNaN(I)){H+=I;}}return H;},_type:"numeric",_getMinimumUnit:function(D,F,E){return this._getNiceNumber(Math.ceil((D-F)/E));},_getNiceNumber:function(F){var H=F,D=Math.ceil(Math.log(H)*0.4342944819032518),G=Math.pow(10,D),E;if(G/2>=H){E=Math.floor((G/2-H)/(Math.pow(10,D-1)/2));H=G/2-E*Math.pow(10,D-1)/2;}else{H=G;}if(!isNaN(H)){return H;}return F;},_updateMinAndMax:function(){var E=this.get("data"),J,D,H,G,F=0,K,L=this.get("setMax"),I=this.get("setMin");if(!L||!I){if(E&&E.length&&E.length>0){H=E.length;for(;F<H;F++){G=E[F];if(isNaN(G)){if(q.isObject(G)){D=J=0;for(K in G){if(G.hasOwnProperty(K)){J=Math.max(G[K],J);D=Math.min(G[K],D);}}}J=L?this._setMaximum:J;D=I?this._setMinimum:D;continue;}if(I){D=this._setMinimum;}else{if(D===undefined){D=G;}else{D=Math.min(G,D);}}if(L){J=this._setMaximum;}else{if(J===undefined){J=G;}else{J=Math.max(G,J);}}this._actualMaximum=J;this._actualMinimum=D;}}this._roundMinAndMax(D,J,I,L);}},_roundMinAndMax:function(J,M,K,P){var E,V,S=J>=0,G=M>0,U,D,R,L,N,T,Q,I=this.getTotalMajorUnits()-1,O=this.get("alwaysShowZero"),F=this.get("roundingMethod"),H=(M-J)/I>=1;if(F){if(F=="niceNumber"){E=this._getMinimumUnit(M,J,I);if(S&&G){if((O||J<E)&&!K){J=0;E=this._getMinimumUnit(M,J,I);}else{J=this._roundDownToNearest(J,E);}if(P){if(!O){J=M-(E*I);}}else{if(K){M=J+(E*I);}else{M=this._roundUpToNearest(M,E);}}}else{if(G&&!S){if(O){L=Math.round(I/((-1*J)/M+1));L=Math.max(Math.min(L,I-1),1);N=I-L;T=Math.ceil(M/L);Q=Math.floor(J/N)*-1;if(K){while(Q<T&&N>=0){N--;L++;T=Math.ceil(M/L);Q=Math.floor(J/N)*-1;}if(N>0){M=Q*L;}else{M=J+(E*I);}}else{if(P){while(T<Q&&L>=0){N++;L--;Q=Math.floor(J/N)*-1;T=Math.ceil(M/L);}if(L>0){J=T*N*-1;}else{J=M-(E*I);}}else{E=Math.max(T,Q);E=this._getNiceNumber(E);M=E*L;J=E*N*-1;}}}else{if(P){J=M-(E*I);}else{if(K){M=J+(E*I);}else{J=this._roundDownToNearest(J,E);M=this._roundUpToNearest(M,E);}}}}else{if(K){if(O){M=0;}else{M=J+(E*I);}}else{if(!P){if(O||M===0||M+E>0){M=0;E=this._getMinimumUnit(M,J,I);J=M-(E*I);}else{J=this._roundDownToNearest(J,E);M=this._roundUpToNearest(M,E);}}else{J=M-(E*I);}}}}}else{if(F=="auto"){if(S&&G){if((O||J<(M-J)/I)&&!K){J=0;}E=(M-J)/I;if(H){E=Math.ceil(E);}M=J+(E*I);}else{if(G&&!S){if(O){L=Math.round(I/((-1*J)/M+1));L=Math.max(Math.min(L,I-1),1);N=I-L;if(H){T=Math.ceil(M/L);Q=Math.floor(J/N)*-1;}else{T=M/L;Q=J/N*-1;}E=Math.max(T,Q);M=E*L;J=E*N*-1;}else{E=(M-J)/I;if(H){E=Math.ceil(E);}J=this._roundDownToNearest(J,E);M=this._roundUpToNearest(M,E);}}else{E=(M-J)/I;if(H){E=Math.ceil(E);}if(O||M===0||M+E>0){M=0;E=(M-J)/I;if(H){Math.ceil(E);}J=M-(E*I);}else{J=this._roundDownToNearest(J,E);M=this._roundUpToNearest(M,E);}}}}else{if(!isNaN(F)&&isFinite(F)){E=F;V=E*I;U=(M-J)>V;R=this._roundDownToNearest(J,E);D=this._roundUpToNearest(M,E);if(P){J=M-V;}else{if(K){M=J+V;}else{if(S&&G){if(O||R<=0){J=0;}else{J=R;}M=J+V;}else{if(G&&!S){J=R;M=D;}else{if(O||D>=0){M=0;}else{M=D;}J=M-V;}}}}}}}}this._dataMaximum=M;this._dataMinimum=J;},getLabelByIndex:function(H,E){var G=this.get("minimum"),D=this.get("maximum"),J=(D-G)/(E-1),F,I=this.get("roundingMethod");E-=1;if(H===0){F=G;}else{if(H===E){F=D;}else{F=(H*J);if(I=="niceNumber"){F=this._roundToNearest(F,J);}F+=G;}}return parseFloat(F);},_roundToNearest:function(F,E){E=E||1;if(E===0){return F;}var D=Math.round(this._roundToPrecision(F/E,10))*E;return this._roundToPrecision(D,10);},_roundUpToNearest:function(E,D){D=D||1;if(D===0){return E;}return Math.ceil(this._roundToPrecision(E/D,10))*D;},_roundDownToNearest:function(E,D){D=D||1;if(D===0){return E;}return Math.floor(this._roundToPrecision(E/D,10))*D;},_roundToPrecision:function(F,D){D=D||0;var E=Math.pow(10,D);return Math.round(E*F)/E;},_hasDataOverflow:function(){var F,E,D;if(this.get("setMin")||this.get("setMax")){return true;}F=this.get("roundingMethod");-E=this._actualMinimum;D=this._actualMaximum;if(q.isNumber(F)&&((q.isNumber(D)&&D>this._dataMaximum)||(q.isNumber(E)&&E<this._dataMinimum))){return true;}return false;}});b.NumericAxis=l;function e(D){e.superclass.constructor.apply(this,arguments);}e.NAME="stackedAxis";b.extend(e,b.NumericAxis,{_updateMinAndMax:function(){var K=0,E=0,J=0,D=0,H=0,F=0,L,G,M=this.get("keys"),I=this.get("setMin"),N=this.get("setMax");for(L in M){if(M.hasOwnProperty(L)){H=Math.max(H,M[L].length);}}for(;F<H;++F){J=0;D=0;for(L in M){if(M.hasOwnProperty(L)){G=M[L][F];if(isNaN(G)){continue;}if(G>=0){J+=G;}else{D+=G;}}}if(J>0){K=Math.max(K,J);}else{K=Math.max(K,D);}if(D<0){E=Math.min(E,D);}else{E=Math.min(E,J);}}this._actualMaximum=K;this._actualMinimum=E;if(N){K=this._setMaximum;}if(I){E=this._setMinimum;}this._roundMinAndMax(E,K,I,N);}});b.StackedAxis=e;function d(D){d.superclass.constructor.apply(this,arguments);}d.NAME="timeAxis";d.ATTRS={setMax:{readOnly:true,getter:function(){var D=this._getNumber(this._setMaximum);return(q.isNumber(D));}},setMin:{readOnly:true,getter:function(){var D=this._getNumber(this._setMinimum);return(q.isNumber(D));}},maximum:{getter:function(){var D=this._getNumber(this._setMaximum);if(!q.isNumber(D)){D=this._getNumber(this.get("dataMaximum"));}return parseFloat(D);},setter:function(D){this._setMaximum=this._getNumber(D);return D;}},minimum:{getter:function(){var D=this._getNumber(this._setMinimum);if(!q.isNumber(D)){D=this._getNumber(this.get("dataMinimum"));}return parseFloat(D);},setter:function(D){this._setMinimum=this._getNumber(D);return D;}},labelFunction:{value:function(E,D){E=b.DataType.Date.parse(E);if(D){return b.DataType.Date.format(E,{format:D});}return E;}},labelFormat:{value:"%b %d, %y"}};b.extend(d,b.AxisType,{formatLabel:function(E,D){E=b.DataType.Date.parse(E);if(D){return b.DataType.Date.format(E,{format:D});}return E;},GUID:"yuitimeaxis",_dataType:"time",getLabelByIndex:function(I,F){var H=this.get("minimum"),E=this.get("maximum"),D=this.get("position"),J,G;F-=1;J=((E-H)/F)*I;if(D=="bottom"||D=="top"){G=H+J;}else{G=E-J;}return G;},_getKeyArray:function(G,H){var I,E=[],F=0,J,D=H.length;for(;F<D;++F){I=H[F][G];if(q.isDate(I)){J=I.valueOf();}else{J=new Date(I);if(q.isDate(J)){J=J.valueOf();}else{if(!q.isNumber(I)){if(q.isNumber(parseFloat(I))){J=parseFloat(I);}else{if(typeof I!="string"){I=I;}J=new Date(I).valueOf();}}else{J=I;}}}E[F]=J;}return E;},_setDataByKey:function(H,I){var J,E=[],G=this._dataClone.concat(),F,K,D=G.length;for(F=0;F<D;++F){J=G[F][H];if(q.isDate(J)){K=J.valueOf();}else{K=new Date(J);if(q.isDate(K)){K=K.valueOf();}else{if(!q.isNumber(J)){if(q.isNumber(parseFloat(J))){K=parseFloat(J);}else{if(typeof J!="string"){J=J.toString();}K=new Date(J).valueOf();}}else{K=J;}}}E[F]=K;}this.get("keys")[H]=E;this._updateTotalDataFlag=true;},_getNumber:function(D){if(q.isDate(D)){D=D.valueOf();}else{if(!q.isNumber(D)&&D){D=new Date(D).valueOf();}}return D;}});b.TimeAxis=d;function f(D){f.superclass.constructor.apply(this,arguments);}f.NAME="categoryAxis";b.extend(f,b.AxisType,{formatLabel:function(E,D){return E;},_indices:null,GUID:"yuicategoryaxis",_type:"category",_updateMinAndMax:function(){this._dataMaximum=Math.max(this.get("data").length-1,0);this._dataMinimum=0;},_getKeyArray:function(G,H){var F=0,I,E=[],J=[],D=H.length;if(!this._indices){this._indices={};}for(;F<D;++F){I=H[F];E[F]=F;J[F]=I[G];}this._indices[G]=E;return J;},_setDataByKey:function(H){var G,I,E=[],J=[],F=this._dataClone.concat(),D=F.length;if(!this._indices){this._indices={};}for(G=0;G<D;++G){I=F[G];E[G]=G;J[G]=I[H];}this._indices[H]=E;this.get("keys")[H]=J.concat();this._updateTotalDataFlag=true;},getDataByKey:function(E){if(!this._indices){this.get("keys");}var D=this._indices;if(D[E]){return D[E];}return null;},getTotalMajorUnits:function(E,D){return this.get("data").length;},getMajorUnitDistance:function(D,G,E){var F;if(E.determinant==="count"){F=G/D;}else{if(E.determinant==="distance"){F=E.distance;}}return F;},getEdgeOffset:function(E,D){return D/E;},getKeyValueAt:function(E,D){var G=NaN,F=this.get("keys");if(F[E]&&F[E][D]){G=F[E][D];}return G;},getLabelByIndex:function(G,E){var F,H=this.get("data"),D=this.get("position");if(D=="bottom"||D=="top"){F=H[G];}else{F=H[E-(G+1)];}return F;},getMinimumValue:function(){var E=this.get("data"),D=E[0];return D;},getMaximumValue:function(){var F=this.get("data"),D=F.length-1,E=F[D];return E;}});b.CategoryAxis=f;function j(){}j.prototype={getCurveControlPoints:function(G,J){var H=[],F=1,E=G.length-1,D=[],I=[];if(E<1){return null;}H[0]={startx:G[0],starty:J[0],endx:G[1],endy:J[1]};if(E===1){H[0].ctrlx1=(2*G[0]+G[1])/3;H[0].ctrly2=(2*J[0]+J[1])/3;H[0].ctrlx2=2*H[0].ctrlx1-G[0];H[0].ctrly2=2*H[0].ctrly1-J[0];return H;}for(;F<E;++F){H.push({startx:Math.round(G[F]),starty:Math.round(J[F]),endx:Math.round(G[F+1]),endy:Math.round(J[F+1])});D[F]=4*G[F]+2*G[F+1];I[F]=4*J[F]+2*J[F+1];}D[0]=G[0]+(2*G[1]);D[E-1]=(8*G[E-1]+G[E])/2;D=this.getControlPoints(D.concat());I[0]=J[0]+(2*J[1]);I[E-1]=(8*J[E-1]+J[E])/2;I=this.getControlPoints(I.concat());for(F=0;F<E;++F){H[F].ctrlx1=Math.round(D[F]);H[F].ctrly1=Math.round(I[F]);if(F<E-1){H[F].ctrlx2=Math.round(2*G[F+1]-D[F+1]);H[F].ctrly2=Math.round(2*J[F+1]-I[F+1]);}else{H[F].ctrlx2=Math.round((G[E]+D[E-1])/2);H[F].ctrly2=Math.round((J[E]+I[E-1])/2);}}return H;},getControlPoints:function(I){var F=I.length,E=[],H=[],D=2,G=1;E[0]=I[0]/D;for(;G<F;++G){H[G]=1/D;D=(G<F-1?4:3.5)-H[G];E[G]=(I[G]-E[G-1])/D;}for(G=1;G<F;++G){E[F-G-1]-=H[F-G]*E[F-G];}return E;}};b.CurveUtil=j;function i(){}i.prototype={_stackCoordinates:function(){var N=this.get("direction"),F=this.get("order"),L=this.get("type"),O=this.get("graph"),I=O.get("height"),E=O.seriesTypes[L],H=0,K,M=this.get("xcoords"),G=this.get("ycoords"),J,D;if(F===0){return;}J=E[F-1].get("xcoords").concat();D=E[F-1].get("ycoords").concat();if(N==="vertical"){K=J.length;for(;H<K;++H){if(!isNaN(J[H])&&!isNaN(M[H])){M[H]+=J[H];}}}else{K=D.length;for(;H<K;++H){if(!isNaN(D[H])&&!isNaN(G[H])){G[H]=D[H]-(I-G[H]);-}}}}};b.StackingUtil=i;function h(){}h.prototype={_lineDefaults:null,_getGraphic:function(){var D=this.get("graphic")||this.get("graph").get("graphic");if(!this._lineGraphic){this._lineGraphic=D.addShape({type:"path"});}this._lineGraphic.clear();return this._lineGraphic;},_toggleVisible:function(D){if(this._lineGraphic){this._lineGraphic.set("visible",D);}},drawLines:function(){if(this.get("xcoords").length<1){return;}var K=q.isNumber,L=this.get("xcoords").concat(),aa=this.get("ycoords").concat(),W=this.get("direction"),R=W==="vertical"?aa.length:L.length,Y,D,G=true,Z,X,V,S,Q,H=this.get("styles").line,T=H.lineType,O=H.color||this._getDefaultColor(this.get("graphOrder"),"line"),M=H.alpha,U=H.dashLength,J=H.gapSpace,I=H.connectDiscontinuousPoints,E=H.discontinuousType,F=H.discontinuousDashLength,P=H.discontinuousGapSpace,N=this._getGraphic();N.set("stroke",{weight:H.weight,color:O,opacity:M});for(Q=0;Q<R;Q=++Q){V=L[Q];S=aa[Q];D=K(V)&&K(S);if(!D){Y=D;continue;}if(G){G=false;N.moveTo(V,S);}else{if(Y){if(T!="dashed"){N.lineTo(V,S);}else{this.drawDashedLine(N,Z,X,V,S,U,J);}}else{if(!I){N.moveTo(V,S);}else{if(E!="solid"){this.drawDashedLine(N,Z,X,V,S,F,P);}else{N.lineTo(V,S);}}}}Z=V;X=S;Y=true;}N.end();},drawSpline:function(){if(this.get("xcoords").length<1){return;}var N=this.get("xcoords"),H=this.get("ycoords"),P=this.getCurveControlPoints(N,H),I=P.length,K,J,E,D,O,M,G=0,Q=this.get("styles").line,R=this._getGraphic(),L=Q.alpha,F=Q.color||this._getDefaultColor(this.get("graphOrder"),"line");R.set("stroke",{weight:Q.weight,color:F,opacity:L});R.moveTo(N[0],H[0]);for(;G<I;G=++G){O=P[G].endx;M=P[G].endy;K=P[G].ctrlx1;J=P[G].ctrlx2;E=P[G].ctrly1;D=P[G].ctrly2;R.curveTo(K,E,J,D,O,M);}R.end();},drawDashedLine:function(R,N,S,D,P,F,E){F=F||10;E=E||10;var H=F+E,K=D-N,O=P-S,Q=Math.sqrt(Math.pow(K,2)+Math.pow(O,2)),I=Math.floor(Math.abs(Q/H)),G=Math.atan2(O,K),M=N,L=S,J;K=Math.cos(G)*H;O=Math.sin(G)*H;for(J=0;J<I;++J){R.moveTo(M,L);R.lineTo(M+Math.cos(G)*F,L+Math.sin(G)*F);M+=K;L+=O;}R.moveTo(M,L);Q=Math.sqrt((D-M)*(D-M)+(P-L)*(P-L));if(Q>F){R.lineTo(M+Math.cos(G)*F,L+Math.sin(G)*F);}else{if(Q>0){R.lineTo(M+Math.cos(G)*Q,L+Math.sin(G)*Q);}}R.moveTo(D,P);},_getLineDefaults:function(){return{alpha:1,weight:6,lineType:"solid",dashLength:10,gapSpace:10,connectDiscontinuousPoints:true,discontinuousType:"solid",discontinuousDashLength:10,discontinuousGapSpace:10};}};b.augment(h,b.Attribute);b.Lines=h;function y(D){var E={area:{getter:function(){return this._defaults||this._getAreaDefaults();},setter:function(G){var F=this._defaults||this._getAreaDefaults();this._defaults=b.merge(F,G);}}};this.addAttrs(E,D);this.get("styles");}y.prototype={_getPath:function(){var D=this._path;if(!D){D=this.get("graph").get("graphic").addShape({type:"path"});this._path=D;}return D;},_toggleVisible:function(D){if(this._path){this._path.set("visible",D);}},drawFill:function(L,H){if(L.length<1){return;}var K=L.length,E=L[0],D=H[0],J=E,I=D,P,N,G=1,M=this.get("styles").area,O=this._getPath(),F=M.color||this._getDefaultColor(this.get("graphOrder"),"slice");O.clear();O.set("fill",{color:F,opacity:M.alpha});O.set("stroke",{weight:0});O.moveTo(E,D);for(;G<K;G=++G){P=L[G];N=H[G];if(isNaN(N)){J=P;I=N;continue;}O.lineTo(P,N);J=P;I=N;}O.end();},drawAreaSpline:function(){if(this.get("xcoords").length<1){return;}var O=this.get("xcoords"),J=this.get("ycoords"),Q=this.getCurveControlPoints(O,J),K=Q.length,M,L,G,F,P,N,I=0,E=O[0],D=J[0],R=this.get("styles").area,S=this._getPath(),H=R.color||this._getDefaultColor(this.get("graphOrder"),"slice");S.set("fill",{color:H,opacity:R.alpha});S.set("stroke",{weight:0});S.moveTo(E,D);for(;I<K;I=++I){P=Q[I].endx;N=Q[I].endy;M=Q[I].ctrlx1;L=Q[I].ctrlx2;G=Q[I].ctrly1;F=Q[I].ctrly2;S.curveTo(M,G,L,F,P,N);}if(this.get("direction")==="vertical"){S.lineTo(this._leftOrigin,N);S.lineTo(this._leftOrigin,D);}else{S.lineTo(P,this._bottomOrigin);S.lineTo(E,this._bottomOrigin);}S.lineTo(E,D);S.end();},drawStackedAreaSpline:function(){if(this.get("xcoords").length<1){return;}var N=this.get("xcoords"),Y=this.get("ycoords"),M,T=this.get("order"),F=this.get("type"),D=this.get("graph"),G=D.seriesTypes[F],E,Q,V,P,O,X,W,K,I,U=0,L,J,H=this.get("styles").area,R=this._getPath(),S=H.color||this._getDefaultColor(this.get("graphOrder"),"slice");L=N[0];J=Y[0];M=this.getCurveControlPoints(N,Y);V=M.length;R.set("fill",{color:S,opacity:H.alpha});R.set("stroke",{weight:0});R.moveTo(L,J);for(;U<V;U=++U){K=M[U].endx;I=M[U].endy;P=M[U].ctrlx1;O=M[U].ctrlx2;X=M[U].ctrly1;W=M[U].ctrly2;R.curveTo(P,X,O,W,K,I);}if(T>0){E=G[T-1].get("xcoords").concat().reverse();Q=G[T-1].get("ycoords").concat().reverse();M=this.getCurveControlPoints(E,Q);U=0;V=M.length;R.lineTo(E[0],Q[0]);for(;U<V;U=++U){K=M[U].endx;I=M[U].endy;P=M[U].ctrlx1;O=M[U].ctrlx2;X=M[U].ctrly1;W=M[U].ctrly2;R.curveTo(P,X,O,W,K,I);}}else{if(this.get("direction")==="vertical"){R.lineTo(this._leftOrigin,Y[Y.length-1]);R.lineTo(this._leftOrigin,J);}else{R.lineTo(N[N.length-1],this._bottomOrigin);R.lineTo(L,this._bottomOrigin);}}R.lineTo(L,J);R.end();},_defaults:null,_getClosingPoints:function(){var D=this.get("xcoords").concat(),E=this.get("ycoords").concat();if(this.get("direction")==="vertical"){D.push(this._leftOrigin);D.push(this._leftOrigin);E.push(E[E.length-1]);E.push(E[0]);}else{D.push(D[D.length-1]);D.push(D[0]);E.push(this._bottomOrigin);E.push(this._bottomOrigin);}D.push(D[0]);E.push(E[0]);return[D,E];},_getStackedClosingPoints:function(){var H=this.get("order"),K=this.get("type"),N=this.get("graph"),L=this.get("direction"),F=N.seriesTypes[K],J,G,M=this.get("xcoords").concat(),I=this.get("ycoords").concat(),E=M[0],D=I[0];if(H>0){J=F[H-1].get("xcoords").concat();G=F[H-1].get("ycoords").concat();M=M.concat(J.concat().reverse());I=I.concat(G.concat().reverse());M.push(M[0]);I.push(I[0]);}else{if(L==="vertical"){M.push(this._leftOrigin);M.push(this._leftOrigin);I.push(I[I.length-1]);I.push(D);}else{M.push(M[M.length-1]);M.push(E);I.push(this._bottomOrigin);I.push(this._bottomOrigin);}}return[M,I];-},_getAreaDefaults:function(){return{};}};b.augment(y,b.Attribute);b.Fills=y;function x(D){var E={markers:{getter:function(){return this._markers;}}};this.addAttrs(E,D);}x.prototype={_plotDefaults:null,drawPlots:function(){if(!this.get("xcoords")||this.get("xcoords").length<1){return;}var N=q.isNumber,U=b.clone(this.get("styles").marker),M=U.width,T=U.height,O=this.get("xcoords"),V=this.get("ycoords"),R=0,S=O.length,P=V[0],G,J,Q=M/2,F=T/2,K,H,E=null,I=null,L=this.get("graphOrder"),D=this.get("groupMarkers");if(D){K=[];H=[];for(;R<S;++R){K.push(parseFloat(O[R]-Q));H.push(parseFloat(V[R]-F));}this._createGroupMarker({xvalues:K,yvalues:H,fill:U.fill,border:U.border,dimensions:{width:M,height:T},graphOrder:L,shape:U.shape});return;}if(q.isArray(U.fill.color)){E=U.fill.color.concat();}if(q.isArray(U.border.color)){I=U.border.color.concat();}this._createMarkerCache();for(;R<S;++R){P=parseFloat(V[R]-F);G=parseFloat(O[R]-Q);if(!N(G)||!N(P)){this._markers.push(null);continue;}if(E){U.fill.color=E[R%E.length];}if(I){U.border.color=I[R%I.length];}U.x=G;U.y=P;J=this.getMarker(U,L,R);}this._clearMarkerCache();},_groupShapes:{circle:b.CircleGroup,rect:b.RectGroup,ellipse:b.EllipseGroup,diamond:b.DiamondGroup},_getGroupShape:function(D){if(q.isString(D)){D=this._groupShapes[D];}return D;},_getPlotDefaults:function(){var D={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:1,alpha:1},width:10,height:10,shape:"circle"};D.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill");D.border.color=this._getDefaultColor(this.get("graphOrder"),"border");return D;},_markers:null,_markerCache:null,getMarker:function(H,D,G){var E,F=H.border;H.id=this.get("chart").get("id")+"_"+D+"_"+G;F.opacity=F.alpha;H.stroke=F;H.fill.opacity=H.fill.alpha;if(this._markerCache.length>0){while(!E){if(this._markerCache.length<1){E=this._createMarker(H,D,G);break;}E=this._markerCache.shift();}E.set(H);}else{E=this._createMarker(H,D,G);}this._markers.push(E);return E;},_createMarker:function(H,D,G){var I=this.get("graphic"),F,E=b.clone(H);I.set("autoDraw",false);E.type=E.shape;F=I.addShape(E);F.addClass(n);return F;},_createMarkerCache:function(){if(this._groupMarker){this._groupMarker.destroy();this._groupMarker=null;}if(this._markers&&this._markers.length>0){this._markerCache=this._markers.concat();}else{this._markerCache=[];}this._markers=[];},_createGroupMarker:function(H){var E,I=this.get("markers"),G=H.border,J,D,F;if(I&&I.length>0){while(I.length>0){E=I.shift();E.destroy();}this.set("markers",[]);}G.opacity=G.alpha;D={id:this.get("chart").get("id")+"_"+H.graphOrder,stroke:G,fill:H.fill,dimensions:H.dimensions,xvalues:H.xvalues,yvalues:H.yvalues};D.fill.opacity=H.fill.alpha;F=this._getGroupShape(H.shape);if(F){D.type=F;}if(H.hasOwnProperty("radius")&&!isNaN(H.radius)){D.dimensions.radius=H.radius;}if(this._groupMarker){this._groupMarker.destroy();}J=this.get("graphic");J.set("autoDraw",true);this._groupMarker=J.addShape(D);},_toggleVisible:function(H){var E,G=this.get("markers"),F=0,D;if(G){D=G.length;for(;F<D;++F){E=G[F];if(E){E.set("visible",H);}}}},_clearMarkerCache:function(){var D;while(this._markerCache.length>0){D=this._markerCache.shift();if(D){D.destroy();}}},updateMarkerState:function(J,H){if(this._markers&&this._markers[H]){var L,I,M=b.clone(this.get("styles").marker),D=this._getState(J),K=this.get("xcoords"),G=this.get("ycoords"),F=this._markers[H],E=D=="off"||!M[D]?M:M[D];E.fill.color=this._getItemColor(E.fill.color,H);E.border.color=this._getItemColor(E.border.color,H);E.stroke=E.border;F.set(E);L=E.width;I=E.height;F.set("x",(K[H]-L/2));F.set("y",(G[H]-I/2));F.set("visible",this.get("visible"));}},_getItemColor:function(E,D){if(q.isArray(E)){return E[D%E.length];}return E;},_setStyles:function(D){D=this._parseMarkerStyles(D);return b.Renderer.prototype._setStyles.apply(this,[D]);},_parseMarkerStyles:function(E){if(E.marker){var D=this._getPlotDefaults();E.marker=this._mergeStyles(E.marker,D);if(E.marker.over){E.marker.over=this._mergeStyles(E.marker.over,E.marker);}if(E.marker.down){E.marker.down=this._mergeStyles(E.marker.down,E.marker);}}return E;},_getState:function(D){var E;switch(D){case"mouseout":E="off";break;case"mouseover":E="over";break;case"mouseup":E="over";break;case"mousedown":E="down";break;}return E;},_stateSyles:null};b.augment(x,b.Attribute);b.Plots=x;function B(){}B.prototype={drawSeries:function(){if(this.get("xcoords").length<1){return;}var af=b.clone(this.get("styles").marker),V,R,N=this.get("xcoords"),O=this.get("ycoords"),ag=0,K=N.length,G=O[0],am=this.get("type"),aa=this.get("graph"),Y=aa.seriesTypes[am],E=Y.length,ad=0,ai=0,ab=0,ac,T,U=this.get("order"),ak=this.get("graphOrder"),F,al,P,Q,W,ah=null,D=null,X=[],H=[],L,M,S,aj,Z={width:[],height:[]},J=[],I=[],ae=this.get("groupMarkers");if(q.isArray(af.fill.color)){ah=af.fill.color.concat();}if(q.isArray(af.border.color)){D=af.border.color.concat();}if(this.get("direction")=="vertical"){P="height";Q="width";}else{P="width";Q="height";}V=af[P];R=af[Q];this._createMarkerCache();for(;ag<E;++ag){T=Y[ag];ad+=T.get("styles").marker[P];if(U>ag){ab=ad;}}ai=K*ad;this._maxSize=aa.get(P);if(ai>this._maxSize){ac=aa.get(P)/ai;ad*=ac;ab*=ac;V*=ac;V=Math.max(V,1);this._maxSize=V;}ab-=ad/2;for(ag=0;ag<K;++ag){L=N[ag]-ad/2;M=L+ad;S=O[ag]-ad/2;aj=S+ad;X.push({start:L,end:M});H.push({start:S,end:aj});if(isNaN(N[ag])||isNaN(O[ag])){this._markers.push(null);continue;}W=this._getMarkerDimensions(N[ag],O[ag],R,ab);if(!isNaN(W.calculatedSize)&&W.calculatedSize>0){G=W.top;F=W.left;if(ae){Z[P][ag]=V;Z[Q][ag]=W.calculatedSize;J.push(F);I.push(G);}else{af[P]=V;af[Q]=W.calculatedSize;af.x=F;af.y=G;if(ah){af.fill.color=ah[ag%ah.length];}if(D){af.border.color=D[ag%D.length];}al=this.getMarker(af,ak,ag);}}else{if(!ae){this._markers.push(null);}}}this.set("xMarkerPlane",X);this.set("yMarkerPlane",H);if(ae){this._createGroupMarker({fill:af.fill,border:af.border,dimensions:Z,xvalues:J,yvalues:I,shape:af.shape});}else{this._clearMarkerCache();-}},_defaultFillColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getPlotDefaults:function(){var D={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:0,alpha:1},width:12,height:12,shape:"rect",padding:{top:0,left:0,right:0,bottom:0}};D.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill");D.border.color=this._getDefaultColor(this.get("graphOrder"),"border");return D;}};b.Histogram=B;b.CartesianSeries=b.Base.create("cartesianSeries",b.Base,[b.Renderer],{_xDisplayName:null,_yDisplayName:null,_leftOrigin:null,_bottomOrigin:null,render:function(){this._setCanvas();this.addListeners();this.set("rendered",true);this.validate();},addListeners:function(){var E=this.get("xAxis"),D=this.get("yAxis");if(E){E.after("dataReady",b.bind(this._xDataChangeHandler,this));E.after("dataUpdate",b.bind(this._xDataChangeHandler,this));}if(D){D.after("dataReady",b.bind(this._yDataChangeHandler,this));D.after("dataUpdate",b.bind(this._yDataChangeHandler,this));}this.after("xAxisChange",this._xAxisChangeHandler);this.after("yAxisChange",this._yAxisChangeHandler);this.after("stylesChange",function(G){var F=this._updateAxisData();if(F){this.draw();}});this.after("widthChange",function(G){var F=this._updateAxisData();if(F){this.draw();}});this.after("heightChange",function(G){var F=this._updateAxisData();if(F){this.draw();}});this.after("visibleChange",this._handleVisibleChange);},_xAxisChangeHandler:function(E){var D=this.get("xAxis");D.after("dataReady",b.bind(this._xDataChangeHandler,this));D.after("dataUpdate",b.bind(this._xDataChangeHandler,this));},_yAxisChangeHandler:function(E){var D=this.get("yAxis");D.after("dataReady",b.bind(this._yDataChangeHandler,this));D.after("dataUpdate",b.bind(this._yDataChangeHandler,this));},GUID:"yuicartesianseries",_xDataChangeHandler:function(D){var E=this._updateAxisData();if(E){this.draw();}},_yDataChangeHandler:function(D){var E=this._updateAxisData();if(E){this.draw();}},_updateAxisData:function(){var H=this.get("xAxis"),E=this.get("yAxis"),F=this.get("xKey"),D=this.get("yKey"),G,I;if(!H||!E||!F||!D){return false;}I=H.getDataByKey(F);G=E.getDataByKey(D);if(!I||!G){return false;}this.set("xData",I.concat());this.set("yData",G.concat());return true;},validate:function(){if((this.get("xData")&&this.get("yData"))||this._updateAxisData()){this.draw();}else{this.fire("drawingComplete");}},_setCanvas:function(){var D=this.get("graph"),E=D.get("graphic");this.set("graphic",E);},setAreaData:function(){var U=q.isNumber,ai,ag,H=this.get("graph"),Q=H.get("width"),ab=H.get("height"),O=this.get("xAxis"),E=this.get("yAxis"),J=this.get("xData").concat(),ae=this.get("yData").concat(),Y,ac,al=O.getEdgeOffset(J.length,Q),N=E.getEdgeOffset(ae.length,ab),V=this.get("styles").padding,X=V.left,af=V.top,L=Q-(X+V.right+al),aa=ab-(af+V.bottom+N),T=[],ak=[],aj=O.get("maximum"),ad=O.get("minimum"),G=E.get("maximum"),D=E.get("minimum"),K=L/(aj-ad),R=aa/(G-D),M,ah=this.get("direction"),Z=0,P=[],W=[],I=this.get("xMarkerPlaneOffset"),F=this.get("yMarkerPlaneOffset"),S=this.get("graphic");S.set("width",Q);S.set("height",ab);M=J.length;al*=0.5;N*=0.5;if(ah==="vertical"){ae=ae.reverse();}this._leftOrigin=Math.round(((0-ad)*K)+X+al);this._bottomOrigin=Math.round((aa+af+N));for(;Z<M;++Z){Y=parseFloat(J[Z]);ac=parseFloat(ae[Z]);if(U(Y)){ai=Math.round((((Y-ad)*K)+X+al));}else{ai=NaN;}if(U(ac)){ag=Math.round(((aa+af+N)-(ac-D)*R));}else{ag=NaN;}T.push(ai);ak.push(ag);P.push({start:ai-I,end:ai+I});W.push({start:ag-F,end:ag+F});}this.set("xcoords",T);this.set("ycoords",ak);this.set("xMarkerPlane",P);this.set("yMarkerPlane",W);this._dataLength=M;},draw:function(){var F=this.get("graph"),D=F.get("width"),E=F.get("height");if(this.get("rendered")){if((isFinite(D)&&isFinite(E)&&D>0&&E>0)&&((this.get("xData")&&this.get("yData"))||this._updateAxisData())){if(this._drawing){this._callLater=true;return;}this._drawing=true;this._callLater=false;this.setAreaData();if(this.get("xcoords")&&this.get("ycoords")){this.drawSeries();}this._drawing=false;if(this._callLater){this.draw();}else{this._toggleVisible(this.get("visible"));this.fire("drawingComplete");}}}},_defaultPlaneOffset:4,_getDefaultStyles:function(){return{padding:{top:0,left:0,right:0,bottom:0}};},_defaultLineColors:["#426ab3","#d09b2c","#000000","#b82837","#b384b5","#ff7200","#779de3","#cbc8ba","#7ed7a6","#007a6c"],_defaultFillColors:["#6084d0","#eeb647","#6c6b5f","#d6484f","#ce9ed1","#ff9f3b","#93b7ff","#e0ddd0","#94ecba","#309687"],_defaultBorderColors:["#205096","#b38206","#000000","#94001e","#9d6fa0","#e55b00","#5e85c9","#adab9e","#6ac291","#006457"],_defaultSliceColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getDefaultColor:function(G,H){var E={line:this._defaultLineColors,fill:this._defaultFillColors,border:this._defaultBorderColors,slice:this._defaultSliceColors},F=E[H],D=F.length;G=G||0;if(G>=D){G=G%D;}H=H||"fill";return E[H][G];},_handleVisibleChange:function(D){this._toggleVisible(this.get("visible"));},getTotalValues:function(){var D=this.get("valueAxis").getTotalByKey(this.get("valueKey"));return D;},destructor:function(){if(this._path){this._path.destroy();}if(this._lineGraphic){this._lineGraphic.destroy();this._lineGraphic=null;}if(this.get("graphic")){this.get("graphic").destroy();}}},{ATTRS:{xDisplayName:{getter:function(){return this._xDisplayName||this.get("xKey");},setter:function(D){this._xDisplayName=D.toString();return D;}},yDisplayName:{getter:function(){return this._yDisplayName||this.get("yKey");},setter:function(D){this._yDisplayName=D.toString();return D;}},categoryDisplayName:{readOnly:true,getter:function(){return this.get("direction")=="vertical"?this.get("yDisplayName"):this.get("xDisplayName");}},valueDisplayName:{readOnly:true,getter:function(){return this.get("direction")=="vertical"?this.get("xDisplayName"):this.get("yDisplayName");}},type:{value:"cartesian"},order:{},graphOrder:{},xcoords:{},ycoords:{},chart:{readOnly:true,getter:function(){return this.get("graph").get("chart");-}},graph:{},xAxis:{},yAxis:{},xKey:{setter:function(D){return D.toString();}},yKey:{setter:function(D){return D.toString();}},xData:{},yData:{},rendered:{value:false},width:{readOnly:true,getter:function(){this.get("graph").get("width");}},height:{readOnly:true,getter:function(){this.get("graph").get("height");}},visible:{value:true},xMarkerPlane:{},yMarkerPlane:{},xMarkerPlaneOffset:{getter:function(){var D=this.get("styles").marker;if(D&&D.width&&isFinite(D.width)){return D.width*0.5;}return this._defaultPlaneOffset;}},yMarkerPlaneOffset:{getter:function(){var D=this.get("styles").marker;if(D&&D.height&&isFinite(D.height)){return D.height*0.5;}return this._defaultPlaneOffset;}},direction:{value:"horizontal"},groupMarkers:{getter:function(){if(this._groupMarkers===undefined){return this.get("graph").get("groupMarkers");}else{return this._groupMarkers;}},setter:function(D){this._groupMarkers=D;return D;}}}});b.MarkerSeries=b.Base.create("markerSeries",b.CartesianSeries,[b.Plots],{drawSeries:function(){this.drawPlots();},_setStyles:function(D){if(!D.marker){D={marker:D};}D=this._parseMarkerStyles(D);return b.MarkerSeries.superclass._mergeStyles.apply(this,[D,this._getDefaultStyles()]);},_getDefaultStyles:function(){var D=this._mergeStyles({marker:this._getPlotDefaults()},b.MarkerSeries.superclass._getDefaultStyles());return D;}},{ATTRS:{type:{value:"marker"}}});b.LineSeries=b.Base.create("lineSeries",b.CartesianSeries,[b.Lines],{drawSeries:function(){this.drawLines();},_setStyles:function(D){if(!D.line){D={line:D};}return b.LineSeries.superclass._setStyles.apply(this,[D]);},_getDefaultStyles:function(){var D=this._mergeStyles({line:this._getLineDefaults()},b.LineSeries.superclass._getDefaultStyles());return D;}},{ATTRS:{type:{value:"line"}}});b.SplineSeries=b.Base.create("splineSeries",b.LineSeries,[b.CurveUtil,b.Lines],{drawSeries:function(){this.drawSpline();}},{ATTRS:{type:{value:"spline"}}});b.AreaSplineSeries=b.Base.create("areaSplineSeries",b.CartesianSeries,[b.Fills,b.CurveUtil],{drawSeries:function(){this.drawAreaSpline();}},{ATTRS:{type:{value:"areaSpline"}}});b.StackedSplineSeries=b.Base.create("stackedSplineSeries",b.SplineSeries,[b.StackingUtil],{setAreaData:function(){b.StackedSplineSeries.superclass.setAreaData.apply(this);this._stackCoordinates.apply(this);}},{ATTRS:{type:{value:"stackedSpline"}}});b.StackedMarkerSeries=b.Base.create("stackedMarkerSeries",b.MarkerSeries,[b.StackingUtil],{setAreaData:function(){b.StackedMarkerSeries.superclass.setAreaData.apply(this);this._stackCoordinates.apply(this);}},{ATTRS:{type:{value:"stackedMarker"}}});b.ColumnSeries=b.Base.create("columnSeries",b.MarkerSeries,[b.Histogram],{_getMarkerDimensions:function(E,D,G,H){var F={left:E+H};if(this._bottomOrigin>=D){F.top=D;F.calculatedSize=this._bottomOrigin-F.top;}else{F.top=this._bottomOrigin;F.calculatedSize=D-this._bottomOrigin;}return F;},updateMarkerState:function(F,R){if(this._markers&&this._markers[R]){var L=b.clone(this.get("styles").marker),V,G=this._getState(F),N=this.get("xcoords"),W=this.get("ycoords"),I=this._markers[R],T,D=this.get("graph"),E,J=D.seriesTypes[this.get("type")],S=J.length,M=0,H=0,P,O=0,K=[],Q=this.get("order"),U;V=G=="off"||!L[G]?b.clone(L):b.clone(L[G]);V.fill.color=this._getItemColor(V.fill.color,R);V.border.color=this._getItemColor(V.border.color,R);U=this._getMarkerDimensions(N[R],W[R],L.width,H);V.height=U.calculatedSize;V.width=Math.min(this._maxSize,V.width);I.set(V);for(;O<S;++O){K[O]=N[R]+M;E=J[O].get("styles").marker;M+=Math.min(this._maxSize,E.width);if(Q>O){H=M;}H-=M/2;}for(O=0;O<S;++O){T=J[O].get("markers");if(T){P=T[R];if(P&&P!==undefined){P.set("x",(K[O]-M/2));}}}}}},{ATTRS:{type:{value:"column"}}});b.BarSeries=b.Base.create("barSeries",b.MarkerSeries,[b.Histogram],{_getMarkerDimensions:function(E,D,G,H){var F={top:D+H};if(E>=this._leftOrigin){F.left=this._leftOrigin;F.calculatedSize=E-F.left;}else{F.left=E;F.calculatedSize=this._leftOrigin-E;}return F;},updateMarkerState:function(F,R){if(this._markers&&this._markers[R]){var K=b.clone(this.get("styles").marker),V,G=this._getState(F),M=this.get("xcoords"),W=this.get("ycoords"),I=this._markers[R],T,D=this.get("graph"),J=D.seriesTypes[this.get("type")],S=J.length,E,L=0,H=0,O,N=0,Q=[],P=this.get("order"),U;V=G=="off"||!K[G]?K:K[G];V.fill.color=this._getItemColor(V.fill.color,R);V.border.color=this._getItemColor(V.border.color,R);U=this._getMarkerDimensions(M[R],W[R],K.height,H);V.width=U.calculatedSize;V.height=Math.min(this._maxSize,V.height);I.set(V);for(;N<S;++N){Q[N]=W[R]+L;E=J[N].get("styles").marker;L+=Math.min(this._maxSize,E.height);if(P>N){H=L;}H-=L/2;}for(N=0;N<S;++N){T=J[N].get("markers");if(T){O=T[R];if(O&&O!==undefined){O.set("y",(Q[N]-L/2));}}}}}},{ATTRS:{type:{value:"bar"},direction:{value:"vertical"}}});b.AreaSeries=b.Base.create("areaSeries",b.CartesianSeries,[b.Fills],{drawSeries:function(){this.drawFill.apply(this,this._getClosingPoints());},_setStyles:function(D){if(!D.area){D={area:D};}return b.AreaSeries.superclass._setStyles.apply(this,[D]);},_getDefaultStyles:function(){var D=this._mergeStyles({area:this._getAreaDefaults()},b.AreaSeries.superclass._getDefaultStyles());return D;}},{ATTRS:{type:{value:"area"}}});b.StackedAreaSplineSeries=b.Base.create("stackedAreaSplineSeries",b.AreaSeries,[b.CurveUtil,b.StackingUtil],{drawSeries:function(){this._stackCoordinates();this.drawStackedAreaSpline();}},{ATTRS:{type:{value:"stackedAreaSpline"}}});b.ComboSeries=b.Base.create("comboSeries",b.CartesianSeries,[b.Fills,b.Lines,b.Plots],{drawSeries:function(){if(this.get("showAreaFill")){this.drawFill.apply(this,this._getClosingPoints());}if(this.get("showLines")){this.drawLines();}if(this.get("showMarkers")){this.drawPlots();}},_toggleVisible:function(H){var G,E,D,F;if(this.get("showAreaFill")&&this._path){this._path.set("visible",H);}if(this.get("showLines")&&this._lineGraphic){this._lineGraphic.set("visible",H);}if(this.get("showMarkers")){G=this.get("markers");if(G){F=0;D=G.length;for(;F<D;++F){E=G[F];-if(E){E.set("visible",H);}}}}},_getDefaultStyles:function(){var D=b.ComboSeries.superclass._getDefaultStyles();D.line=this._getLineDefaults();D.marker=this._getPlotDefaults();D.area=this._getAreaDefaults();return D;}},{ATTRS:{type:{value:"combo"},showAreaFill:{value:false},showLines:{value:true},showMarkers:{value:true},marker:{lazyAdd:false,getter:function(){return this.get("styles").marker;},setter:function(D){this.set("styles",{marker:D});}},line:{lazyAdd:false,getter:function(){return this.get("styles").line;},setter:function(D){this.set("styles",{line:D});}},area:{lazyAdd:false,getter:function(){return this.get("styles").area;},setter:function(D){this.set("styles",{area:D});}}}});b.StackedComboSeries=b.Base.create("stackedComboSeries",b.ComboSeries,[b.StackingUtil],{setAreaData:function(){b.StackedComboSeries.superclass.setAreaData.apply(this);this._stackCoordinates.apply(this);},drawSeries:function(){if(this.get("showAreaFill")){this.drawFill.apply(this,this._getStackedClosingPoints());}if(this.get("showLines")){this.drawLines();}if(this.get("showMarkers")){this.drawPlots();}}},{ATTRS:{type:{value:"stackedCombo"},showAreaFill:{value:true}}});b.ComboSplineSeries=b.Base.create("comboSplineSeries",b.ComboSeries,[b.CurveUtil],{drawSeries:function(){if(this.get("showAreaFill")){this.drawAreaSpline();}if(this.get("showLines")){this.drawSpline();}if(this.get("showMarkers")){this.drawPlots();}}},{ATTRS:{type:{value:"comboSpline"}}});b.StackedComboSplineSeries=b.Base.create("stackedComboSplineSeries",b.StackedComboSeries,[b.CurveUtil],{drawSeries:function(){if(this.get("showAreaFill")){this.drawStackedAreaSpline();}if(this.get("showLines")){this.drawSpline();}if(this.get("showMarkers")){this.drawPlots();}}},{ATTRS:{type:{value:"stackedComboSpline"},showAreaFill:{value:true}}});b.StackedLineSeries=b.Base.create("stackedLineSeries",b.LineSeries,[b.StackingUtil],{setAreaData:function(){b.StackedLineSeries.superclass.setAreaData.apply(this);this._stackCoordinates.apply(this);}},{ATTRS:{type:{value:"stackedLine"}}});b.StackedAreaSeries=b.Base.create("stackedAreaSeries",b.AreaSeries,[b.StackingUtil],{setAreaData:function(){b.StackedAreaSeries.superclass.setAreaData.apply(this);this._stackCoordinates.apply(this);},drawSeries:function(){this.drawFill.apply(this,this._getStackedClosingPoints());}},{ATTRS:{type:{value:"stackedArea"}}});b.StackedColumnSeries=b.Base.create("stackedColumnSeries",b.ColumnSeries,[b.StackingUtil],{drawSeries:function(){if(this.get("xcoords").length<1){return;}var V=q.isNumber,ad=b.clone(this.get("styles").marker),U=ad.width,ac=ad.height,W=this.get("xcoords"),ae=this.get("ycoords"),aa=0,ab=W.length,X=ae[0],I=this.get("type"),G=this.get("graph"),R=G.seriesTypes[I],P,Z=this.get("order"),T=this.get("graphOrder"),J,Q,E,O,M,S,Y,F=Z===0,H=ab*U,L={width:[],height:[]},N=[],K=[],D=this.get("groupMarkers");if(q.isArray(ad.fill.color)){E=ad.fill.color.concat();}if(q.isArray(ad.border.color)){O=ad.border.color.concat();}this._createMarkerCache();if(H>this.get("width")){P=this.width/H;U*=P;U=Math.max(U,1);}if(!F){M=R[Z-1];S=M.get("negativeBaseValues");Y=M.get("positiveBaseValues");if(!S||!Y){F=true;Y=[];S=[];}}else{S=[];Y=[];}this.set("negativeBaseValues",S);this.set("positiveBaseValues",Y);for(aa=0;aa<ab;++aa){J=W[aa];X=ae[aa];if(!V(X)||!V(J)){if(F){S[aa]=this._bottomOrigin;Y[aa]=this._bottomOrigin;}this._markers.push(null);continue;}if(F){ac=Math.abs(this._bottomOrigin-X);if(X<this._bottomOrigin){Y[aa]=X;S[aa]=this._bottomOrigin;}else{if(X>this._bottomOrigin){Y[aa]=this._bottomOrigin;S[aa]=X;X-=ac;}else{Y[aa]=X;S[aa]=X;}}}else{if(X>this._bottomOrigin){X+=(S[aa]-this._bottomOrigin);ac=X-S[aa];S[aa]=X;X-=ac;}else{if(X<=this._bottomOrigin){X=Y[aa]-(this._bottomOrigin-X);ac=Y[aa]-X;Y[aa]=X;}}}if(!isNaN(ac)&&ac>0){J-=U/2;if(D){L.width[aa]=U;L.height[aa]=ac;N.push(J);K.push(X);}else{ad.width=U;ad.height=ac;ad.x=J;ad.y=X;if(E){ad.fill.color=E[aa%E.length];}if(O){ad.border.color=O[aa%O.length];}Q=this.getMarker(ad,T,aa);}}else{if(!D){this._markers.push(null);}}}if(D){this._createGroupMarker({fill:ad.fill,border:ad.border,dimensions:L,xvalues:N,yvalues:K,shape:ad.shape});}else{this._clearMarkerCache();}},updateMarkerState:function(K,I){if(this._markers&&this._markers[I]){var M,F,D=this._getState(K),L=this.get("xcoords"),J=this._markers[I],H=0,E,G;M=this.get("styles").marker;H=M.width*0.5;F=D=="off"||!M[D]?b.clone(M):b.clone(M[D]);F.height=J.get("height");F.x=(L[I]-H);F.y=J.get("y");F.id=J.get("id");E=F.fill.color;G=F.border.color;if(q.isArray(E)){F.fill.color=E[I%E.length];}else{F.fill.color=this._getItemColor(F.fill.color,I);}if(q.isArray(G)){F.border.color=G[I%G.length];}else{F.border.color=this._getItemColor(F.border.color,I);}J.set(F);}},_getPlotDefaults:function(){var D={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:0,alpha:1},width:24,height:24,shape:"rect",padding:{top:0,left:0,right:0,bottom:0}};D.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill");D.border.color=this._getDefaultColor(this.get("graphOrder"),"border");return D;}},{ATTRS:{type:{value:"stackedColumn"},negativeBaseValues:{value:null},positiveBaseValues:{value:null}}});b.StackedBarSeries=b.Base.create("stackedBarSeries",b.BarSeries,[b.StackingUtil],{drawSeries:function(){if(this.get("xcoords").length<1){return;}var U=q.isNumber,ac=b.clone(this.get("styles").marker),T=ac.width,ab=ac.height,V=this.get("xcoords"),ae=this.get("ycoords"),Z=0,aa=V.length,W=ae[0],H=this.get("type"),G=this.get("graph"),Q=G.seriesTypes[H],O,Y=this.get("order"),S=this.get("graphOrder"),I,P,L,R,X,E,N,F=Y===0,ad=aa*ab,K={width:[],height:[]},M=[],J=[],D=this.get("groupMarkers");if(q.isArray(ac.fill.color)){E=ac.fill.color.concat();}if(q.isArray(ac.border.color)){N=ac.border.color.concat();}this._createMarkerCache();if(ad>this.get("height")){O=this.height/ad;ab*=O;ab=Math.max(ab,1);}if(!F){L=Q[Y-1];R=L.get("negativeBaseValues");X=L.get("positiveBaseValues");if(!R||!X){F=true;X=[];R=[];}}else{R=[];X=[];}this.set("negativeBaseValues",R);-this.set("positiveBaseValues",X);for(Z=0;Z<aa;++Z){W=ae[Z];I=V[Z];if(!U(W)||!U(I)){if(F){X[Z]=this._leftOrigin;R[Z]=this._leftOrigin;}this._markers.push(null);continue;}if(F){T=Math.abs(I-this._leftOrigin);if(I>this._leftOrigin){X[Z]=I;R[Z]=this._leftOrigin;I-=T;}else{if(I<this._leftOrigin){X[Z]=this._leftOrigin;R[Z]=I;}else{X[Z]=I;R[Z]=this._leftOrigin;}}}else{if(I<this._leftOrigin){I=R[Z]-(this._leftOrigin-V[Z]);T=R[Z]-I;R[Z]=I;}else{if(I>=this._leftOrigin){I+=(X[Z]-this._leftOrigin);T=I-X[Z];X[Z]=I;I-=T;}}}if(!isNaN(T)&&T>0){W-=ab/2;if(D){K.width[Z]=T;K.height[Z]=ab;M.push(I);J.push(W);}else{ac.width=T;ac.height=ab;ac.x=I;ac.y=W;if(E){ac.fill.color=E[Z%E.length];}if(N){ac.border.color=N[Z%N.length];}P=this.getMarker(ac,S,Z);}}else{if(!D){this._markers.push(null);}}}if(D){this._createGroupMarker({fill:ac.fill,border:ac.border,dimensions:K,xvalues:M,yvalues:J,shape:ac.shape});}else{this._clearMarkerCache();}},updateMarkerState:function(L,I){if(this._markers[I]){var D=this._getState(L),H=this.get("ycoords"),J=this._markers[I],M=this.get("styles").marker,K=M.height,F=D=="off"||!M[D]?b.clone(M):b.clone(M[D]),E,G;F.y=(H[I]-K/2);F.x=J.get("x");F.width=J.get("width");F.id=J.get("id");E=F.fill.color;G=F.border.color;if(q.isArray(E)){F.fill.color=E[I%E.length];}else{F.fill.color=this._getItemColor(F.fill.color,I);}if(q.isArray(G)){F.border.color=G[I%G.length];}else{F.border.color=this._getItemColor(F.border.color,I);}J.set(F);}},_getPlotDefaults:function(){var D={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:0,alpha:1},width:24,height:24,shape:"rect",padding:{top:0,left:0,right:0,bottom:0}};D.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill");D.border.color=this._getDefaultColor(this.get("graphOrder"),"border");return D;}},{ATTRS:{type:{value:"stackedBar"},direction:{value:"vertical"},negativeBaseValues:{value:null},positiveBaseValues:{value:null}}});b.PieSeries=b.Base.create("pieSeries",b.MarkerSeries,[],{_map:null,_image:null,_setMap:function(){var F="pieHotSpotMapi_"+Math.round(100000*Math.random()),D=this.get("graph").get("contentBox"),E;if(this._image){D.removeChild(this._image);while(this._areaNodes&&this._areaNodes.length>0){E=this._areaNodes.shift();this._map.removeChild(E);}D.removeChild(this._map);}this._image=g.createElement("img");this._image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==";D.appendChild(this._image);this._image.setAttribute("usemap","#"+F);this._image.style.zIndex=3;this._image.style.opacity=0;this._image.setAttribute("alt","imagemap");this._map=g.createElement("map");this._map.style.zIndex=5;D.appendChild(this._map);this._map.setAttribute("name",F);this._map.setAttribute("id",F);this._areaNodes=[];},_categoryDisplayName:null,_valueDisplayName:null,addListeners:function(){var D=this.get("categoryAxis"),E=this.get("valueAxis");if(D){D.after("dataReady",b.bind(this._categoryDataChangeHandler,this));D.after("dataUpdate",b.bind(this._categoryDataChangeHandler,this));}if(E){E.after("dataReady",b.bind(this._valueDataChangeHandler,this));E.after("dataUpdate",b.bind(this._valueDataChangeHandler,this));}this.after("categoryAxisChange",this.categoryAxisChangeHandler);this.after("valueAxisChange",this.valueAxisChangeHandler);this.after("stylesChange",this._updateHandler);},validate:function(){this.draw();this._renderered=true;},_categoryAxisChangeHandler:function(D){var E=this.get("categoryAxis");E.after("dataReady",b.bind(this._categoryDataChangeHandler,this));E.after("dataUpdate",b.bind(this._categoryDataChangeHandler,this));},_valueAxisChangeHandler:function(D){var E=this.get("valueAxis");E.after("dataReady",b.bind(this._valueDataChangeHandler,this));E.after("dataUpdate",b.bind(this._valueDataChangeHandler,this));},GUID:"pieseries",_categoryDataChangeHandler:function(D){if(this._rendered&&this.get("categoryKey")&&this.get("valueKey")){this.draw();}},_valueDataChangeHandler:function(D){if(this._rendered&&this.get("categoryKey")&&this.get("valueKey")){this.draw();}},draw:function(){var F=this.get("graph"),D=F.get("width"),E=F.get("height");if(isFinite(D)&&isFinite(E)&&D>0&&E>0){this._rendered=true;if(this._drawing){this._callLater=true;return;}this._drawing=true;this._callLater=false;this.drawSeries();this._drawing=false;if(this._callLater){this.draw();}else{this.fire("drawingComplete");}}},drawPlots:function(){var F=this.get("valueAxis").getDataByKey(this.get("valueKey")).concat(),G=this.get("categoryAxis").getDataByKey(this.get("categoryKey")).concat(),J=0,ai=F.length,R=this.get("styles").marker,D=R.fill.colors,aj=R.fill.alphas||["1"],N=R.border.colors,H=[R.border.weight],I=[R.border.alpha],ak=H.concat(),T=N.concat(),V=I.concat(),af,ah,W=R.padding,E=this.get("graph"),P=Math.min(E.get("width"),E.get("height")),U=P-(W.left+W.right),ae=P-(W.top+W.bottom),ac=-90,O=U/2,X=ae/2,K=Math.min(O,X),ad=0,aa,ag=0,Z,ab,L,S,M,Q=this.get("graphOrder"),Y=b.Graphic.NAME=="canvasGraphic";for(;ad<ai;++ad){aa=parseFloat(F[ad]);F.push(aa);if(!isNaN(aa)){J+=aa;}}af=D?D.concat():null;ah=aj?aj.concat():null;this._createMarkerCache();if(Y){this._setMap();this._image.width=U;this._image.height=ae;}for(ad=0;ad<ai;ad++){aa=F[ad];if(J===0){ag=360/F.length;}else{ag=360*(aa/J);}ag=Math.round(ag);if(af&&af.length<1){af=D.concat();}if(ah&&ah.length<1){ah=aj.concat();}if(ak&&ak.length<1){ak=H.concat();}if(ak&&T.length<1){T=N.concat();}if(V&&V.length<1){V=I.concat();}L=ak?ak.shift():null;Z=T?T.shift():null;ab=V?V.shift():null;ac+=ag;S={border:{color:Z,weight:L,alpha:ab},fill:{color:af?af.shift():this._getDefaultColor(ad,"slice"),alpha:ah?ah.shift():null},type:"pieslice",arc:ag,radius:K,startAngle:ac,cx:O,cy:X,width:U,height:ae};M=this.getMarker(S,Q,ad);if(Y){this._addHotspot(S,Q,ad);}}this._clearMarkerCache();},_addHotspot:function(G,T,H){var Q=g.createElement("area"),S=1,M=G.cx,K=G.cy,J=G.arc,R=G.startAngle-J,P=G.startAngle,E=G.radius,N=M+Math.cos(R/180*Math.PI)*E,L=K+Math.sin(R/180*Math.PI)*E,V=M+Math.cos(P/180*Math.PI)*E,U=K+Math.sin(P/180*Math.PI)*E,Y=Math.floor(J/10)-1,F=(J/(Math.floor(J/10))/180)*Math.PI,I=Math.atan((L-K)/(N-M)),X=M+", "+K+", "+N+", "+L,W,O,D;-for(S=1;S<=Y;++S){D=F*S;W=Math.cos(I+D);O=Math.sin(I+D);if(R<=90){X+=", "+(M+(E*Math.cos(I+(F*S))));X+=", "+(K+(E*Math.sin(I+(F*S))));}else{X+=", "+(M-(E*Math.cos(I+(F*S))));X+=", "+(K-(E*Math.sin(I+(F*S))));}}X+=", "+V+", "+U;X+=", "+M+", "+K;this._map.appendChild(Q);Q.setAttribute("class",n);Q.setAttribute("id","hotSpot_"+T+"_"+H);Q.setAttribute("shape","polygon");Q.setAttribute("coords",X);this._areaNodes.push(Q);},updateMarkerState:function(H,F){if(this._markers[F]){var J=this._getState(H),E,G,D=this._markers[F],I=this.get("styles").marker;E=J=="off"||!I[J]?I:I[J];G=this._mergeStyles(E,{});G.fill.color=G.fill.colors[F%G.fill.colors.length];G.fill.alpha=G.fill.alphas[F%G.fill.alphas.length];D.set(G);}},_createMarker:function(H,D,G){var I=this.get("graphic"),F,E=b.clone(H);I.set("autoDraw",false);F=I.addShape(E);F.addClass(n);return F;},_clearMarkerCache:function(){var D=this._markerCache.length,F=0,E;for(;F<D;++F){E=this._markerCache[F];if(E){E.destroy();}}this._markerCache=[];},_getPlotDefaults:function(){var D={padding:{top:0,left:0,right:0,bottom:0},fill:{alphas:["1"]},border:{weight:0,alpha:1}};D.fill.colors=this._defaultSliceColors;D.border.colors=this._defaultBorderColors;return D;},_defaultLineColors:["#426ab3","#d09b2c","#000000","#b82837","#b384b5","#ff7200","#779de3","#cbc8ba","#7ed7a6","#007a6c"],_defaultFillColors:["#6084d0","#eeb647","#6c6b5f","#d6484f","#ce9ed1","#ff9f3b","#93b7ff","#e0ddd0","#94ecba","#309687"],_defaultBorderColors:["#205096","#b38206","#000000","#94001e","#9d6fa0","#e55b00","#5e85c9","#adab9e","#6ac291","#006457"],_defaultSliceColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getDefaultColor:function(G,H){var E={line:this._defaultLineColors,fill:this._defaultFillColors,border:this._defaultBorderColors,slice:this._defaultSliceColors},F=E[H],D=F.length;G=G||0;if(G>=D){G=G%D;}H=H||"fill";return E[H][G];}},{ATTRS:{type:{value:"pie"},order:{},graph:{},categoryAxis:{value:null,validator:function(D){return D!==this.get("categoryAxis");}},valueAxis:{value:null,validator:function(D){return D!==this.get("valueAxis");}},categoryKey:{value:null,validator:function(D){return D!==this.get("categoryKey");}},valueKey:{value:null,validator:function(D){return D!==this.get("valueKey");}},categoryDisplayName:{setter:function(D){this._categoryDisplayName=D;return D;},getter:function(){return this._categoryDisplayName||this.get("categoryKey");}},valueDisplayName:{setter:function(D){this._valueDisplayName=D;return D;},getter:function(){return this._valueDisplayName||this.get("valueKey");}},slices:null}});b.Gridlines=b.Base.create("gridlines",b.Base,[b.Renderer],{_path:null,remove:function(){var D=this._path;if(D){D.destroy();}},draw:function(){if(this.get("axis")&&this.get("graph")){this._drawGridlines();}},_drawGridlines:function(){var R,D=this.get("axis"),L=D.get("position"),O,I=0,F,M=this.get("direction"),P=this.get("graph"),N=P.get("width"),K=P.get("height"),Q=this.get("styles").line,H=Q.color,J=Q.weight,G=Q.alpha,E=M=="vertical"?this._verticalLine:this._horizontalLine;if(isFinite(N)&&isFinite(K)&&N>0&&K>0){if(L!="none"&&D&&D.get("tickPoints")){O=D.get("tickPoints");F=O.length;}else{O=[];F=D.get("styles").majorUnit.count;for(;I<F;++I){O[I]={x:N*(I/(F-1)),y:K*(I/(F-1))};}I=0;}R=P.get("gridlines");R.set("width",N);R.set("height",K);R.set("stroke",{weight:J,color:H,opacity:G});for(;I<F;++I){E(R,O[I],N,K);}R.end();}},_horizontalLine:function(G,F,D,E){G.moveTo(0,F.y);G.lineTo(D,F.y);},_verticalLine:function(G,F,D,E){G.moveTo(F.x,0);G.lineTo(F.x,E);},_getDefaultStyles:function(){var D={line:{color:"#f0efe9",weight:1,alpha:1}};return D;}},{ATTRS:{direction:{},axis:{},graph:{}}});b.Graph=b.Base.create("graph",b.Widget,[b.Renderer],{bindUI:function(){var D=this.get("boundingBox");D.setStyle("position","absolute");this.after("widthChange",this._sizeChangeHandler);this.after("heightChange",this._sizeChangeHandler);this.after("stylesChange",this._updateStyles);},syncUI:function(){var D,G,H,L=this.get("seriesCollection"),I,J=0,K=L.length,E=this.get("horizontalGridlines"),F=this.get("verticalGridlines");if(this.get("showBackground")){D=this.get("background");G=this.get("contentBox");H=this.get("styles").background;H.stroke=H.border;H.stroke.opacity=H.stroke.alpha;H.fill.opacity=H.fill.alpha;H.width=this.get("width");H.height=this.get("height");H.type=H.shape;D.set(H);}for(;J<K;++J){I=L[J];if(I instanceof b.CartesianSeries){I.render();}}if(E&&E instanceof b.Gridlines){E.draw();}if(F&&F instanceof b.Gridlines){F.draw();}},seriesTypes:null,getSeriesByIndex:function(F){var D=this.get("seriesCollection"),E;if(D&&D.length>F){E=D[F];}return E;},getSeriesByKey:function(F){var E=this._seriesDictionary,D;if(E&&E.hasOwnProperty(F)){D=E[F];}return D;},addDispatcher:function(D){if(!this._dispatchers){this._dispatchers=[];}this._dispatchers.push(D);},_seriesCollection:null,_seriesDictionary:null,_parseSeriesCollection:function(H){if(!H){return;}var E=H.length,G=0,F,D;if(!this.get("seriesCollection")){this._seriesCollection=[];}if(!this._seriesDictionary){this._seriesDictionary={};}if(!this.seriesTypes){this.seriesTypes=[];}for(;G<E;++G){F=H[G];if(!(F instanceof b.CartesianSeries)&&!(F instanceof b.PieSeries)){this._createSeries(F);continue;}this._addSeries(F);}E=this.get("seriesCollection").length;for(G=0;G<E;++G){F=this.get("seriesCollection")[G];D=F.get("direction")=="horizontal"?"yKey":"xKey";this._seriesDictionary[F.get(D)]=F;}},_addSeries:function(F){var G=F.get("type"),I=this.get("seriesCollection"),H=I.length,E=this.seriesTypes,D;if(!F.get("graph")){F.set("graph",this);}I.push(F);if(!E.hasOwnProperty(G)){this.seriesTypes[G]=[];}D=this.seriesTypes[G];F.set("graphOrder",H);F.set("order",D.length);D.push(F);this.addDispatcher(F);F.after("drawingComplete",b.bind(this._drawingCompleteHandler,this));this.fire("seriesAdded",F);},_createSeries:function(H){var I=H.type,J=this.get("seriesCollection"),F=this.seriesTypes,E,D,G;H.graph=this;if(!F.hasOwnProperty(I)){F[I]=[];-}E=F[I];H.graph=this;H.order=E.length;H.graphOrder=J.length;D=this._getSeries(H.type);G=new D(H);this.addDispatcher(G);G.after("drawingComplete",b.bind(this._drawingCompleteHandler,this));E.push(G);J.push(G);},_seriesMap:{line:b.LineSeries,column:b.ColumnSeries,bar:b.BarSeries,area:b.AreaSeries,candlestick:b.CandlestickSeries,ohlc:b.OHLCSeries,stackedarea:b.StackedAreaSeries,stackedline:b.StackedLineSeries,stackedcolumn:b.StackedColumnSeries,stackedbar:b.StackedBarSeries,markerseries:b.MarkerSeries,spline:b.SplineSeries,areaspline:b.AreaSplineSeries,stackedspline:b.StackedSplineSeries,stackedareaspline:b.StackedAreaSplineSeries,stackedmarkerseries:b.StackedMarkerSeries,pie:b.PieSeries,combo:b.ComboSeries,stackedcombo:b.StackedComboSeries,combospline:b.ComboSplineSeries,stackedcombospline:b.StackedComboSplineSeries},_getSeries:function(D){var E;if(q.isString(D)){E=this._seriesMap[D];}else{E=D;}return E;},_markerEventHandler:function(I){var G=I.type,D=I.currentTarget,H=D.getAttribute("id").split("_"),F=this.getSeriesByIndex(H[1]),E=H[2];F.updateMarkerState(G,E);},_dispatchers:null,_updateStyles:function(){var E=this.get("styles").background,D=E.border;D.opacity=D.alpha;E.stroke=D;E.fill.opacity=E.fill.alpha;this.get("background").set(E);this._sizeChangeHandler();},_sizeChangeHandler:function(J){var D=this.get("horizontalGridlines"),K=this.get("verticalGridlines"),E=this.get("width"),H=this.get("height"),G=this.get("styles").background,I,F;if(G&&G.border){I=G.border.weight||0;}if(this.get("showBackground")){F=this.get("background");if(E&&H){F.set("width",E);F.set("height",H);}}if(this._gridlines){this._gridlines.clear();}if(D&&D instanceof b.Gridlines){D.draw();}if(K&&K instanceof b.Gridlines){K.draw();}this._drawSeries();},_drawSeries:function(){if(this._drawing){this._callLater=true;return;}var F,E,D,G=this.get("graphic");G.set("autoDraw",false);this._callLater=false;this._drawing=true;F=this.get("seriesCollection");E=0;D=F.length;for(;E<D;++E){F[E].draw();if((!F[E].get("xcoords")||!F[E].get("ycoords"))&&!F[E] instanceof b.PieSeries){this._callLater=true;break;}}this._drawing=false;if(this._callLater){this._drawSeries();}},_drawingCompleteHandler:function(F){var E=F.currentTarget,G,D=b.Array.indexOf(this._dispatchers,E);if(D>-1){this._dispatchers.splice(D,1);}if(this._dispatchers.length<1){G=this.get("graphic");if(!G.get("autoDraw")){G._redraw();}this.fire("chartRendered");}},_getDefaultStyles:function(){var D={background:{shape:"rect",fill:{color:"#faf9f2"},border:{color:"#dad8c9",weight:1}}};return D;},destructor:function(){if(this._graphic){this._graphic.destroy();}if(this._background){this._background.get("graphic").destroy();}if(this._gridlines){this._gridlines.get("graphic").destroy();}}},{ATTRS:{x:{setter:function(D){this.get("boundingBox").setStyle("left",D+"px");return D;}},y:{setter:function(D){this.get("boundingBox").setStyle("top",D+"px");return D;}},chart:{},seriesCollection:{getter:function(){return this._seriesCollection;},setter:function(D){this._parseSeriesCollection(D);return this._seriesCollection;}},showBackground:{value:true},seriesDictionary:{readOnly:true,getter:function(){return this._seriesDictionary;}},horizontalGridlines:{value:null,setter:function(E){var D=this.get("horizontalGridlines");if(D&&D instanceof b.Gridlines){D.remove();}if(E instanceof b.Gridlines){D=E;E.set("graph",this);return E;}else{if(E&&E.axis){D=new b.Gridlines({direction:"horizontal",axis:E.axis,graph:this,styles:E.styles});return D;}}}},verticalGridlines:{value:null,setter:function(E){var D=this.get("verticalGridlines");if(D&&D instanceof b.Gridlines){D.remove();}if(E instanceof b.Gridlines){D=E;E.set("graph",this);return E;}else{if(E&&E.axis){D=new b.Gridlines({direction:"vertical",axis:E.axis,graph:this,styles:E.styles});return D;}}}},background:{getter:function(){if(!this._background){this._backgroundGraphic=new b.Graphic({render:this.get("contentBox")});this._backgroundGraphic.get("node").style.zIndex=0;this._background=this._backgroundGraphic.addShape({type:"rect"});}return this._background;}},gridlines:{readOnly:true,getter:function(){if(!this._gridlines){this._gridlinesGraphic=new b.Graphic({render:this.get("contentBox")});this._gridlinesGraphic.get("node").style.zIndex=1;this._gridlines=this._gridlinesGraphic.addShape({type:"path"});}return this._gridlines;}},graphic:{readOnly:true,getter:function(){if(!this._graphic){this._graphic=new b.Graphic({render:this.get("contentBox")});this._graphic.get("node").style.zIndex=2;this._graphic.set("autoDraw",false);}return this._graphic;}},groupMarkers:{value:false}}});function o(){}o.ATTRS={ariaLabel:{value:"Chart Application",setter:function(E){var D=this.get("contentBox");if(D){D.setAttribute("aria-label",E);}return E;}},ariaDescription:{value:"Use the up and down keys to navigate between series. Use the left and right keys to navigate through items in a series.",setter:function(D){if(this._description){this._description.setContent("");this._description.appendChild(g.createTextNode(D));}return D;}},tooltip:{valueFn:"_getTooltip",setter:function(D){return this._updateTooltip(D);}},categoryKey:{value:"category"},categoryType:{value:"category"},interactionType:{value:"marker"},dataProvider:{setter:function(D){return this._setDataValues(D);}},seriesKeys:{},axesCollection:{},graph:{valueFn:"_getGraph"},groupMarkers:{value:false,setter:function(D){if(this.get("graph")){this.get("graph").set("groupMarkers",D);}return D;}}};o.prototype={_itemRendered:function(D){this._itemRenderQueue=this._itemRenderQueue.splice(1+b.Array.indexOf(this._itemRenderQueue,D.currentTarget),1);if(this._itemRenderQueue.length<1){this._redraw();}},_getGraph:function(){var D=new b.Graph({chart:this,groupMarkers:this.get("groupMarkers")});D.after("chartRendered",b.bind(function(E){this.fire("chartRendered");},this));return D;},getSeries:function(F){var D=null,E=this.get("graph");if(E){if(q.isNumber(F)){D=E.getSeriesByIndex(F);}else{D=E.getSeriesByKey(F);}}return D;},getAxisByKey:function(F){var D,E=this.get("axes");-if(E&&E.hasOwnProperty(F)){D=E[F];}return D;},getCategoryAxis:function(){var E,D=this.get("categoryKey"),F=this.get("axes");if(F.hasOwnProperty(D)){E=F[D];}return E;},_direction:"horizontal",_dataProvider:null,_setDataValues:function(I){if(q.isArray(I[0])){var H,K=[],F=I[0],G=0,E=F.length,J,D=I.length;for(;G<E;++G){H={category:F[G]};for(J=1;J<D;++J){H["series"+J]=I[J][G];}K[G]=H;}return K;}return I;},_seriesCollection:null,_setSeriesCollection:function(D){this._seriesCollection=D;},_getAxisClass:function(D){return this._axisClass[D];},_axisClass:{stacked:b.StackedAxis,numeric:b.NumericAxis,category:b.CategoryAxis,time:b.TimeAxis},_axes:null,initializer:function(){this._itemRenderQueue=[];this._seriesIndex=-1;this._itemIndex=-1;this.after("dataProviderChange",this._dataProviderChangeHandler);},renderUI:function(){var E=this.get("tooltip"),F=this.get("boundingBox"),D=this.get("contentBox");F.setStyle("position","absolute");D.setStyle("position","absolute");this._addAxes();this._addSeries();if(E&&E.show){this._addTooltip();}this._setAriaElements(F,D);},_setAriaElements:function(G,E){var F=this._getAriaOffscreenNode(),H=this.get("id")+"_description",D=this._getAriaOffscreenNode();E.set("tabIndex",0);E.set("role","img");E.setAttribute("aria-label",this.get("ariaLabel"));E.setAttribute("aria-describedby",H);F.set("id",H);F.set("tabIndex",-1);F.appendChild(g.createTextNode(this.get("ariaDescription")));D.set("id","live-region");D.set("aria-live","polite");D.set("aria-atomic","true");D.set("role","status");G.setAttribute("role","application");G.appendChild(F);G.appendChild(D);this._description=F;this._liveRegion=D;},_getAriaOffscreenNode:function(){var E=b.Node.create("<div></div>"),F=b.UA.ie,D=(F&&F<8)?"rect(1px 1px 1px 1px)":"rect(1px, 1px, 1px, 1px)";E.setStyle("position","absolute");E.setStyle("height","1px");E.setStyle("width","1px");E.setStyle("overflow","hidden");E.setStyle("clip",D);return E;},syncUI:function(){this._redraw();},bindUI:function(){this.after("tooltipChange",b.bind(this._tooltipChangeHandler,this));this.after("widthChange",this._sizeChanged);this.after("heightChange",this._sizeChanged);var K=this.get("tooltip"),E="mouseout",L="mouseover",F=this.get("contentBox"),D=this.get("interactionType"),I=0,J,H="."+n,G=((v&&("ontouchstart" in v))&&!(b.UA.chrome&&b.UA.chrome<6));b.on("keydown",b.bind(function(O){var N=O.keyCode,M=parseFloat(N),P;if(M>36&&M<41){O.halt();P=this._getAriaMessage(M);this._liveRegion.setContent("");this._liveRegion.appendChild(g.createTextNode(P));}},this),this.get("contentBox"));if(D=="marker"){E=K.hideEvent;L=K.showEvent;if(G){b.delegate("touchend",b.bind(this._markerEventDispatcher,this),F,H);b.on("touchend",b.bind(function(M){M.halt(true);if(this._activeMarker){this._activeMarker=null;this.hideTooltip(M);}},this));}else{b.delegate("mouseenter",b.bind(this._markerEventDispatcher,this),F,H);b.delegate("mousedown",b.bind(this._markerEventDispatcher,this),F,H);b.delegate("mouseup",b.bind(this._markerEventDispatcher,this),F,H);b.delegate("mouseleave",b.bind(this._markerEventDispatcher,this),F,H);b.delegate("click",b.bind(this._markerEventDispatcher,this),F,H);b.delegate("mousemove",b.bind(this._positionTooltip,this),F,H);}}else{if(D=="planar"){if(G){this._overlay.on("touchend",b.bind(this._planarEventDispatcher,this));}else{this._overlay.on("mousemove",b.bind(this._planarEventDispatcher,this));this.on("mouseout",this.hideTooltip);}}}if(K){this.on("markerEvent:touchend",b.bind(function(N){var M=N.series.get("markers")[N.index];if(this._activeMarker&&M===this._activeMarker){this._activeMarker=null;this.hideTooltip(N);}else{this._activeMarker=M;K.markerEventHandler.apply(this,[N]);}},this));if(E&&L&&E==L){this.on(D+"Event:"+E,this.toggleTooltip);}else{if(L){this.on(D+"Event:"+L,K[D+"EventHandler"]);}if(E){if(q.isArray(E)){J=E.length;for(;I<J;++I){this.on(D+"Event:"+E[I],this.hideTooltip);}}this.on(D+"Event:"+E,this.hideTooltip);}}}},_markerEventDispatcher:function(K){var M=K.type,D=this.get("contentBox"),Q=K.currentTarget,P=Q.getAttribute("id").split("_"),J=P.pop(),H=P.pop(),I=this.getSeries(parseInt(H,10)),L=this.getSeriesItems(I,J),F=K&&K.hasOwnProperty("changedTouches"),G=F?K.changedTouches[0].pageX:K.pageX,E=F?K.changedTouches[0].pageY:K.pageY,O=G-D.getX(),N=E-D.getY();if(M=="mouseenter"){M="mouseover";}else{if(M=="mouseleave"){M="mouseout";}}I.updateMarkerState(M,J);K.halt();this.fire("markerEvent:"+M,{originEvent:K,pageX:G,pageY:E,categoryItem:L.category,valueItem:L.value,node:Q,x:O,y:N,series:I,index:J,seriesIndex:H});},_dataProviderChangeHandler:function(H){var E=this.get("dataProvider"),G=this.get("axes"),D,F;this._seriesIndex=-1;this._itemIndex=-1;if(G){for(D in G){if(G.hasOwnProperty(D)){F=G[D];if(F instanceof b.Axis){if(F.get("position")!="none"){this._addToAxesRenderQueue(F);}F.set("dataProvider",E);}}}}},toggleTooltip:function(E){var D=this.get("tooltip");if(D.visible){this.hideTooltip();}else{D.markerEventHandler.apply(this,[E]);}},_showTooltip:function(G,D,H){var E=this.get("tooltip"),F=E.node;if(G){E.visible=true;E.setTextFunction(F,G);F.setStyle("top",H+"px");F.setStyle("left",D+"px");F.setStyle("visibility","visible");}},_positionTooltip:function(H){var F=this.get("tooltip"),G=F.node,E=this.get("contentBox"),D=(H.pageX+10)-E.getX(),I=(H.pageY+10)-E.getY();if(G){G.setStyle("left",D+"px");G.setStyle("top",I+"px");}},hideTooltip:function(){var D=this.get("tooltip"),E=D.node;D.visible=false;E.set("innerHTML","");E.setStyle("left",-10000);E.setStyle("top",-10000);E.setStyle("visibility","hidden");},_addTooltip:function(){var E=this.get("tooltip"),G=this.get("id")+"_tooltip",D=this.get("contentBox"),F=g.getElementById(G);if(F){D.removeChild(F);}E.node.set("id",G);E.node.setStyle("visibility","hidden");D.appendChild(E.node);},_updateTooltip:function(I){var F=this._tooltip,D,H,G,E={markerLabelFunction:"markerLabelFunction",planarLabelFunction:"planarLabelFunction",setTextFunction:"setTextFunction",showEvent:"showEvent",hideEvent:"hideEvent",markerEventHandler:"markerEventHandler",planarEventHandler:"planarEventHandler",show:"show"};-if(q.isObject(I)){H=I.styles;G=b.one(I.node)||F.node;if(H){for(D in H){if(H.hasOwnProperty(D)){G.setStyle(D,H[D]);}}}for(D in E){if(I.hasOwnProperty(D)){F[D]=I[D];}}F.node=G;}return F;},_getTooltip:function(){var E=g.createElement("div"),D={setTextFunction:this._setText,markerLabelFunction:this._tooltipLabelFunction,planarLabelFunction:this._planarLabelFunction,show:true,hideEvent:"mouseout",showEvent:"mouseover",markerEventHandler:function(G){var F=this.get("tooltip"),H=F.markerLabelFunction.apply(this,[G.categoryItem,G.valueItem,G.index,G.series,G.seriesIndex]);this._showTooltip(H,G.x+10,G.y+10);},planarEventHandler:function(G){var F=this.get("tooltip"),I,H=this.get("categoryAxis");I=F.planarLabelFunction.apply(this,[H,G.valueItem,G.index,G.items,G.seriesIndex]);this._showTooltip(I,G.x+10,G.y+10);}};E=b.one(E);E.set("id",this.get("id")+"_tooltip");E.setStyle("fontSize","85%");E.setStyle("opacity","0.83");E.setStyle("position","absolute");E.setStyle("paddingTop","2px");E.setStyle("paddingRight","5px");E.setStyle("paddingBottom","4px");E.setStyle("paddingLeft","2px");E.setStyle("backgroundColor","#fff");E.setStyle("border","1px solid #dbdccc");E.setStyle("pointerEvents","none");E.setStyle("zIndex",3);E.setStyle("whiteSpace","noWrap");E.setStyle("visibility","hidden");D.node=b.one(E);this._tooltip=D;return D;},_planarLabelFunction:function(K,P,M,I,G){var E=g.createElement("div"),N,J=0,L=I.length,F,D,O,H;if(K){D=K.get("labelFunction").apply(this,[K.getKeyValueAt(this.get("categoryKey"),M),K.get("labelFormat")]);if(!q.isObject(D)){D=g.createTextNode(D);}E.appendChild(D);}for(;J<L;++J){H=I[J];if(H.get("visible")){N=P[J];F=N.axis;O=F.get("labelFunction").apply(this,[F.getKeyValueAt(N.key,M),F.get("labelFormat")]);E.appendChild(g.createElement("br"));E.appendChild(g.createTextNode(N.displayName));E.appendChild(g.createTextNode(": "));if(!q.isObject(O)){O=g.createTextNode(O);}E.appendChild(O);}}return E;},_tooltipLabelFunction:function(K,E,H,G,F){var J=g.createElement("div"),D=K.axis.get("labelFunction").apply(this,[K.value,K.axis.get("labelFormat")]),I=E.axis.get("labelFunction").apply(this,[E.value,E.axis.get("labelFormat")]);J.appendChild(g.createTextNode(K.displayName));J.appendChild(g.createTextNode(": "));if(!q.isObject(D)){D=g.createTextNode(D);}J.appendChild(D);J.appendChild(g.createElement("br"));J.appendChild(g.createTextNode(E.displayName));J.appendChild(g.createTextNode(": "));if(!q.isObject(I)){I=g.createTextNode(I);}J.appendChild(I);return J;},_tooltipChangeHandler:function(H){if(this.get("tooltip")){var F=this.get("tooltip"),G=F.node,E=F.show,D=this.get("contentBox");if(G&&E){if(!D.contains(G)){this._addTooltip();}}}},_setText:function(D,E){D.setContent("");if(q.isNumber(E)){E=E+"";}else{if(!E){E="";}}if(m(E)){E=g.createTextNode(E);}D.appendChild(E);}};b.ChartBase=o;b.CartesianChart=b.Base.create("cartesianChart",b.Widget,[b.ChartBase],{renderUI:function(){var H=this.get("boundingBox"),D=this.get("contentBox"),G=this.get("tooltip"),E,F=c("overlay");H.setStyle("position","absolute");D.setStyle("position","absolute");this._addAxes();this._addGridlines();this._addSeries();if(G&&G.show){this._addTooltip();}this.get("styles");if(this.get("interactionType")=="planar"){E=g.createElement("div");this.get("contentBox").appendChild(E);this._overlay=b.one(E);this._overlay.setStyle("position","absolute");this._overlay.setStyle("background","#fff");this._overlay.setStyle("opacity",0);this._overlay.addClass(F);this._overlay.setStyle("zIndex",4);}this._setAriaElements(H,D);this._redraw();},_planarEventDispatcher:function(Z){var G=this.get("graph"),K=this.get("boundingBox"),T=G.get("contentBox"),Q=Z&&Z.hasOwnProperty("changedTouches"),F=Q?Z.changedTouches[0].pageX:Z.pageX,D=Q?Z.changedTouches[0].pageY:Z.pageY,O=F-K.getX(),N=D-K.getY(),L={x:F-T.getX(),y:D-T.getY()},E=G.get("seriesCollection"),P,X=0,M,J=this._selectedIndex,ab,S=[],H=[],R=[],ac=this.get("direction"),ad,aa,V,U,I,Y,W;Z.halt(true);if(ac=="horizontal"){aa="x";V="y";}else{V="x";aa="y";}U=L[aa];if(E){Y=E.length;while(X<Y&&!I){if(E[X]){I=E[X].get(aa+"MarkerPlane");}X++;}}if(I){Y=I.length;for(X=0;X<Y;++X){if(U<=I[X].end&&U>=I[X].start){M=X;break;}}Y=E.length;for(X=0;X<Y;++X){P=E[X];W=P.get(V+"coords");ad=P.get("markers");if(ad&&!isNaN(J)&&J>-1){P.updateMarkerState("mouseout",J);}if(W&&W[M]>-1){if(ad&&!isNaN(M)&&M>-1){P.updateMarkerState("mouseover",M);}ab=this.getSeriesItems(P,M);H.push(ab.category);R.push(ab.value);S.push(P);}}this._selectedIndex=M;if(M>-1){this.fire("planarEvent:mouseover",{categoryItem:H,valueItem:R,x:O,y:N,pageX:F,pageY:D,items:S,index:M,originEvent:Z});}else{this.fire("planarEvent:mouseout");}}},_type:"combo",_itemRenderQueue:null,_addToAxesRenderQueue:function(D){if(!this._itemRenderQueue){this._itemRenderQueue=[];}if(b.Array.indexOf(this._itemRenderQueue,D)<0){this._itemRenderQueue.push(D);}},_addToAxesCollection:function(D,F){var E=this.get(D+"AxesCollection");if(!E){E=[];this.set(D+"AxesCollection",E);}E.push(F);},_getDefaultSeriesCollection:function(){return this._parseSeriesCollection();},_parseSeriesCollection:function(W){var M=this.get("direction"),D=W||[],T,Q,O=[],J,I=this.get("seriesKeys").concat(),S,H,P,G=this.get("type"),U,L,V,E,F=this.get("categoryKey"),R=this.get("showMarkers"),N=this.get("showAreaFill"),K=this.get("showLines");if(M=="vertical"){T="yAxis";L="yKey";Q="xAxis";V="xKey";}else{T="xAxis";L="xKey";Q="yAxis";V="yKey";}P=D.length;for(S=0;S<P;++S){U=this._getBaseAttribute(D[S],V);if(U){H=b.Array.indexOf(I,U);if(H>-1){I.splice(H,1);}O.push(U);}}if(I.length>0){O=O.concat(I);}P=O.length;for(S=0;S<P;++S){J=D[S]||{type:G};if(J instanceof b.CartesianSeries){this._parseSeriesAxes(J);continue;}J[L]=J[L]||F;J[V]=J[V]||I.shift();J[T]=this._getCategoryAxis();J[Q]=this._getSeriesAxis(J[V]);J.type=J.type||G;if((J.type=="combo"||J.type=="stackedcombo"||J.type=="combospline"||J.type=="stackedcombospline")){if(N!==null){J.showAreaFill=(J.showAreaFill!==null&&J.showAreaFill!==undefined)?J.showAreaFill:N;}if(R!==null){J.showMarkers=(J.showMarkers!==null&&J.showMarkers!==undefined)?J.showMarkers:R;-}if(K!==null){J.showLines=(J.showLines!==null&&J.showLines!==undefined)?J.showLines:K;}}D[S]=J;}if(W){E=this.get("graph");E.set("seriesCollection",D);D=E.get("seriesCollection");}return D;},_parseSeriesAxes:function(E){var I=this.get("axes"),G=E.get("xAxis"),D=E.get("yAxis"),H=b.Axis,F;if(G&&!(G instanceof H)&&q.isString(G)&&I.hasOwnProperty(G)){F=I[G];if(F instanceof H){E.set("xAxis",F);}}if(D&&!(D instanceof H)&&q.isString(D)&&I.hasOwnProperty(D)){F=I[D];if(F instanceof H){E.set("yAxis",F);}}},_getCategoryAxis:function(){var D,E=this.get("axes"),F=this.get("categoryAxisName")||this.get("categoryKey");D=E[F];return D;},_getSeriesAxis:function(E,I){var H=this.get("axes"),D,G,F;if(H){if(I&&H.hasOwnProperty(I)){F=H[I];}else{for(D in H){if(H.hasOwnProperty(D)){G=H[D].get("keys");if(G&&G.hasOwnProperty(E)){F=H[D];break;}}}}}return F;},_getBaseAttribute:function(E,D){if(E instanceof b.Base){return E.get(D);}if(E.hasOwnProperty(D)){return E[D];}return null;},_setBaseAttribute:function(E,D,F){if(E instanceof b.Base){E.set(D,F);}else{E[D]=F;}},_setAxes:function(E){var I=this._parseAxes(E),M={},G={edgeOffset:"edgeOffset",position:"position",overlapGraph:"overlapGraph",labelFunction:"labelFunction",labelFunctionScope:"labelFunctionScope",labelFormat:"labelFormat",maximum:"maximum",minimum:"minimum",roundingMethod:"roundingMethod",alwaysShowZero:"alwaysShowZero",title:"title",width:"width",height:"height"},H=this.get("dataProvider"),P,J,Q,F,K,O,N,D,L;for(J in I){if(I.hasOwnProperty(J)){O=I[J];if(O instanceof b.Axis){F=O;}else{F=null;D={};D.dataProvider=O.dataProvider||H;D.keys=O.keys;if(O.hasOwnProperty("roundingUnit")){D.roundingUnit=O.roundingUnit;}Q=O.position;if(O.styles){D.styles=O.styles;}D.position=O.position;for(P in G){if(G.hasOwnProperty(P)&&O.hasOwnProperty(P)){D[P]=O[P];}}if(E){F=this.getAxisByKey(J);}if(F&&F instanceof b.Axis){K=F.get("position");if(Q!=K){if(K!="none"){L=this.get(K+"AxesCollection");L.splice(b.Array.indexOf(L,F),1);}if(Q!="none"){this._addToAxesCollection(Q,F);}}F.setAttrs(D);}else{N=this._getAxisClass(O.type);F=new N(D);F.after("axisRendered",b.bind(this._itemRendered,this));}}if(F){L=this.get(Q+"AxesCollection");if(L&&b.Array.indexOf(L,F)>0){F.set("overlapGraph",false);}M[J]=F;}}}return M;},_addAxes:function(){var I=this.get("axes"),E,G,J,D=this.get("width"),F=this.get("height"),H=b.Node.one(this._parentNode);if(!this._axesCollection){this._axesCollection=[];}for(E in I){if(I.hasOwnProperty(E)){G=I[E];if(G instanceof b.Axis){if(!D){this.set("width",H.get("offsetWidth"));D=this.get("width");}if(!F){this.set("height",H.get("offsetHeight"));F=this.get("height");}this._addToAxesRenderQueue(G);J=G.get("position");if(!this.get(J+"AxesCollection")){this.set(J+"AxesCollection",[G]);}else{this.get(J+"AxesCollection").push(G);}this._axesCollection.push(G);if(G.get("keys").hasOwnProperty(this.get("categoryKey"))){this.set("categoryAxis",G);}G.render(this.get("contentBox"));}}}},_addSeries:function(){var D=this.get("graph"),E=this.get("seriesCollection");D.render(this.get("contentBox"));},_addGridlines:function(){var N=this.get("graph"),E=this.get("horizontalGridlines"),F=this.get("verticalGridlines"),M=this.get("direction"),O=this.get("leftAxesCollection"),I=this.get("rightAxesCollection"),K=this.get("bottomAxesCollection"),G=this.get("topAxesCollection"),H,D=this.get("categoryAxis"),L,J;if(this._axesCollection){H=this._axesCollection.concat();H.splice(b.Array.indexOf(H,D),1);}if(E){if(O&&O[0]){L=O[0];}else{if(I&&I[0]){L=I[0];}else{L=M=="horizontal"?D:H[0];}}if(!this._getBaseAttribute(E,"axis")&&L){this._setBaseAttribute(E,"axis",L);}if(this._getBaseAttribute(E,"axis")){N.set("horizontalGridlines",E);}}if(F){if(K&&K[0]){J=K[0];}else{if(G&&G[0]){J=G[0];}else{J=M=="vertical"?D:H[0];}}if(!this._getBaseAttribute(F,"axis")&&J){this._setBaseAttribute(F,"axis",J);}if(this._getBaseAttribute(F,"axis")){N.set("verticalGridlines",F);}}},_getAllKeys:function(I){var F=0,D=I.length,H,E,G={};for(;F<D;++F){H=I[F];for(E in H){if(H.hasOwnProperty(E)){G[E]=true;}}}return G;},_getDefaultAxes:function(){return this._parseAxes();},_parseAxes:function(V){var N=this.get("categoryKey"),E,T,P,G={},R=[],F=this.get("categoryAxisName")||this.get("categoryKey"),D=this.get("valueAxisName"),H=this.get("seriesKeys")||[],W,U,M,K,Q,O,S=this.get("dataProvider"),X=this.get("direction"),L,I,J=[],Y=this.get("stacked")?"stacked":"numeric";if(X=="vertical"){L="bottom";I="left";}else{L="left";I="bottom";}if(V){for(W in V){if(V.hasOwnProperty(W)){E=V[W];P=this._getBaseAttribute(E,"keys");T=this._getBaseAttribute(E,"type");if(T=="time"||T=="category"){F=W;this.set("categoryAxisName",W);if(q.isArray(P)&&P.length>0){N=P[0];this.set("categoryKey",N);}G[W]=E;}else{if(W==F){G[W]=E;}else{G[W]=E;if(W!=D&&P&&q.isArray(P)){K=P.length;for(M=0;M<K;++M){R.push(P[M]);}J.push(G[W]);}if(!(this._getBaseAttribute(G[W],"type"))){this._setBaseAttribute(G[W],"type",Y);}if(!(this._getBaseAttribute(G[W],"position"))){this._setBaseAttribute(G[W],"position",this._getDefaultAxisPosition(G[W],J,L));}}}}}}if(H.length<1){O=this._getAllKeys(S);for(W in O){if(O.hasOwnProperty(W)&&W!=N&&b.Array.indexOf(R,W)==-1){H.push(W);}}}Q=b.Array.indexOf(H,N);if(Q>-1){H.splice(Q,1);}U=R.length;for(W=0;W<U;++W){Q=b.Array.indexOf(H,R[W]);if(Q>-1){H.splice(Q,1);}}if(!G.hasOwnProperty(F)){G[F]={};}if(!(this._getBaseAttribute(G[F],"keys"))){this._setBaseAttribute(G[F],"keys",[N]);}if(!(this._getBaseAttribute(G[F],"position"))){this._setBaseAttribute(G[F],"position",I);}if(!(this._getBaseAttribute(G[F],"type"))){this._setBaseAttribute(G[F],"type",this.get("categoryType"));}if(!G.hasOwnProperty(D)&&H&&H.length>0){G[D]={keys:H};J.push(G[D]);}if(R.length>0){if(H.length>0){H=R.concat(H);}else{H=R;}}if(G.hasOwnProperty(D)){if(!(this._getBaseAttribute(G[D],"position"))){this._setBaseAttribute(G[D],"position",this._getDefaultAxisPosition(G[D],J,L));}if(!(this._getBaseAttribute(G[D],"type"))){this._setBaseAttribute(G[D],"type",Y);}if(!(this._getBaseAttribute(G[D],"keys"))){this._setBaseAttribute(G[D],"keys",H);-}}this.set("seriesKeys",H);return G;},_getDefaultAxisPosition:function(G,E,D){var H=this.get("direction"),F=b.Array.indexOf(E,G);if(E[F-1]&&E[F-1].position){if(H=="horizontal"){if(E[F-1].position=="left"){D="right";}else{if(E[F-1].position=="right"){D="left";}}}else{if(E[F-1].position=="bottom"){D="top";}else{D="bottom";}}}return D;},getSeriesItems:function(I,H){var J=I.get("xAxis"),F=I.get("yAxis"),G=I.get("xKey"),E=I.get("yKey"),K,D;if(this.get("direction")=="vertical"){K={axis:F,key:E,value:F.getKeyValueAt(E,H)};D={axis:J,key:G,value:J.getKeyValueAt(G,H)};}else{D={axis:F,key:E,value:F.getKeyValueAt(E,H)};K={axis:J,key:G,value:J.getKeyValueAt(G,H)};}K.displayName=I.get("categoryDisplayName");D.displayName=I.get("valueDisplayName");K.value=K.axis.getKeyValueAt(K.key,H);D.value=D.axis.getKeyValueAt(D.key,H);return{category:K,value:D};},_sizeChanged:function(G){if(this._axesCollection){var F=this._axesCollection,E=0,D=F.length;for(;E<D;++E){this._addToAxesRenderQueue(F[E]);}this._redraw();}},_getTopOverflow:function(I,G,E){var F=0,D,J=0,H;if(I){D=I.length;for(;F<D;++F){H=I[F];J=Math.max(J,Math.abs(H.getMaxLabelBounds().top)-(H.getEdgeOffset(H.get("styles").majorTicks.count,E)*0.5));}}if(G){F=0;D=G.length;for(;F<D;++F){H=G[F];J=Math.max(J,Math.abs(H.getMaxLabelBounds().top)-(H.getEdgeOffset(H.get("styles").majorTicks.count,E)*0.5));}}return J;},_getRightOverflow:function(I,F,H){var E=0,D,J=0,G;if(I){D=I.length;for(;E<D;++E){G=I[E];J=Math.max(J,G.getMaxLabelBounds().right-(G.getEdgeOffset(G.get("styles").majorTicks.count,H)*0.5));}}if(F){E=0;D=F.length;for(;E<D;++E){G=F[E];J=Math.max(J,G.getMaxLabelBounds().right-(G.getEdgeOffset(G.get("styles").majorTicks.count,H)*0.5));}}return J;},_getLeftOverflow:function(I,F,H){var E=0,D,J=0,G;if(I){D=I.length;for(;E<D;++E){G=I[E];J=Math.max(J,Math.abs(G.getMinLabelBounds().left)-(G.getEdgeOffset(G.get("styles").majorTicks.count,H)*0.5));}}if(F){E=0;D=F.length;for(;E<D;++E){G=F[E];J=Math.max(J,Math.abs(G.getMinLabelBounds().left)-(G.getEdgeOffset(G.get("styles").majorTicks.count,H)*0.5));}}return J;},_getBottomOverflow:function(I,G,E){var F=0,D,J=0,H;if(I){D=I.length;for(;F<D;++F){H=I[F];J=Math.max(J,H.getMinLabelBounds().bottom-(H.getEdgeOffset(H.get("styles").majorTicks.count,E)*0.5));}}if(G){F=0;D=G.length;for(;F<D;++F){H=G[F];J=Math.max(J,H.getMinLabelBounds().bottom-(H.getEdgeOffset(H.get("styles").majorTicks.count,E)*0.5));}}return J;},_redraw:function(){if(this._drawing){this._callLater=true;return;}this._drawing=true;this._callLater=false;var Q=this.get("width"),aa=this.get("height"),Y=0,I=0,ae=0,E=0,D=this.get("leftAxesCollection"),O=this.get("rightAxesCollection"),P=this.get("topAxesCollection"),ad=this.get("bottomAxesCollection"),Z=0,W,J,G="visible",H=this.get("graph"),L,R,X,V,M,N,ac,ab,U=this.get("allowContentOverflow"),S,F,ag,T,K,af={};if(D){ag=[];W=D.length;for(Z=W-1;Z>-1;--Z){ag.unshift(Y);Y+=D[Z].get("width");}}if(O){F=[];W=O.length;Z=0;for(Z=W-1;Z>-1;--Z){I+=O[Z].get("width");F.unshift(Q-I);}}if(P){T=[];W=P.length;for(Z=W-1;Z>-1;--Z){T.unshift(ae);ae+=P[Z].get("height");}}if(ad){K=[];W=ad.length;for(Z=W-1;Z>-1;--Z){E+=ad[Z].get("height");K.unshift(aa-E);}}M=Q-(Y+I);N=aa-(E+ae);af.left=Y;af.top=ae;af.bottom=aa-E;af.right=Q-I;if(!U){L=this._getTopOverflow(D,O);R=this._getBottomOverflow(D,O);X=this._getLeftOverflow(ad,P);V=this._getRightOverflow(ad,P);S=L-ae;if(S>0){af.top=L;if(T){Z=0;W=T.length;for(;Z<W;++Z){T[Z]+=S;}}}S=R-E;if(S>0){af.bottom=aa-R;if(K){Z=0;W=K.length;for(;Z<W;++Z){K[Z]-=S;}}}S=X-Y;if(S>0){af.left=X;if(ag){Z=0;W=ag.length;for(;Z<W;++Z){ag[Z]+=S;}}}S=V-I;if(S>0){af.right=Q-V;if(F){Z=0;W=F.length;for(;Z<W;++Z){F[Z]-=S;}}}}M=af.right-af.left;N=af.bottom-af.top;ac=af.left;ab=af.top;if(P){W=P.length;Z=0;for(;Z<W;Z++){J=P[Z];if(J.get("width")!==M){J.set("width",M);}J.get("boundingBox").setStyle("left",ac+"px");J.get("boundingBox").setStyle("top",T[Z]+"px");}if(J._hasDataOverflow()){G="hidden";}}if(ad){W=ad.length;Z=0;for(;Z<W;Z++){J=ad[Z];if(J.get("width")!==M){J.set("width",M);}J.get("boundingBox").setStyle("left",ac+"px");J.get("boundingBox").setStyle("top",K[Z]+"px");}if(J._hasDataOverflow()){G="hidden";}}if(D){W=D.length;Z=0;for(;Z<W;++Z){J=D[Z];J.get("boundingBox").setStyle("top",ab+"px");J.get("boundingBox").setStyle("left",ag[Z]+"px");if(J.get("height")!==N){J.set("height",N);}}if(J._hasDataOverflow()){G="hidden";}}if(O){W=O.length;Z=0;for(;Z<W;++Z){J=O[Z];J.get("boundingBox").setStyle("top",ab+"px");J.get("boundingBox").setStyle("left",F[Z]+"px");if(J.get("height")!==N){J.set("height",N);}}if(J._hasDataOverflow()){G="hidden";}}this._drawing=false;if(this._callLater){this._redraw();return;}if(H){H.get("boundingBox").setStyle("left",ac+"px");H.get("boundingBox").setStyle("top",ab+"px");H.set("width",M);H.set("height",N);H.get("boundingBox").setStyle("overflow",G);}if(this._overlay){this._overlay.setStyle("left",ac+"px");this._overlay.setStyle("top",ab+"px");this._overlay.setStyle("width",M+"px");this._overlay.setStyle("height",N+"px");}},destructor:function(){var H=this.get("graph"),F=0,D,I=this.get("seriesCollection"),E=this._axesCollection,G=this.get("tooltip").node;if(this._description){this._description.empty();this._description.remove(true);}if(this._liveRegion){this._liveRegion.empty();this._liveRegion.remove(true);}D=I?I.length:0;for(;F<D;++F){if(I[F] instanceof b.CartesianSeries){I[F].destroy(true);}}D=E?E.length:0;for(F=0;F<D;++F){if(E[F] instanceof b.Axis){E[F].destroy(true);}}if(H){H.destroy(true);}if(G){G.empty();G.remove(true);}if(this._overlay){this._overlay.empty();this._overlay.remove(true);}},_getAriaMessage:function(N){var G="",J,M,F,L,I=this._seriesIndex,D=this._itemIndex,H=this.get("seriesCollection"),K=H.length,E;if(N%2===0){if(K>1){if(N===38){I=I<1?K-1:I-1;}else{if(N===40){I=I>=K-1?0:I+1;}}this._itemIndex=-1;}else{I=0;}this._seriesIndex=I;J=this.getSeries(parseInt(I,10));G=J.get("valueDisplayName")+" series.";}else{if(I>-1){G="";J=this.getSeries(parseInt(I,10));}else{I=0;this._seriesIndex=I;J=this.getSeries(parseInt(I,10));-G=J.get("valueDisplayName")+" series.";}E=J._dataLength?J._dataLength:0;if(N===37){D=D>0?D-1:E-1;}else{if(N===39){D=D>=E-1?0:D+1;}}this._itemIndex=D;M=this.getSeriesItems(J,D);F=M.category;L=M.value;if(F&&L&&F.value&&L.value){G+=F.displayName+": "+F.axis.formatLabel.apply(this,[F.value,F.axis.get("labelFormat")])+", ";G+=L.displayName+": "+L.axis.formatLabel.apply(this,[L.value,L.axis.get("labelFormat")])+", ";}else{G+="No data available.";}G+=(D+1)+" of "+E+". ";}return G;}},{ATTRS:{allowContentOverflow:{value:false},axesStyles:{getter:function(){var F=this.get("axes"),D,E=this._axesStyles;if(F){for(D in F){if(F.hasOwnProperty(D)&&F[D] instanceof b.Axis){if(!E){E={};}E[D]=F[D].get("styles");}}}return E;},setter:function(F){var E=this.get("axes"),D;for(D in F){if(F.hasOwnProperty(D)&&E.hasOwnProperty(D)){this._setBaseAttribute(E[D],"styles",F[D]);}}}},seriesStyles:{getter:function(){var E=this._seriesStyles,F=this.get("graph"),G,D;if(F){G=F.get("seriesDictionary");if(G){E={};for(D in G){if(G.hasOwnProperty(D)){E[D]=G[D].get("styles");}}}}return E;},setter:function(G){var E,D,F;if(q.isArray(G)){F=this.get("seriesCollection");E=0;D=G.length;for(;E<D;++E){this._setBaseAttribute(F[E],"styles",G[E]);}}else{for(E in G){if(G.hasOwnProperty(E)){F=this.getSeries(E);this._setBaseAttribute(F,"styles",G[E]);}}}}},graphStyles:{getter:function(){var D=this.get("graph");if(D){return(D.get("styles"));}return this._graphStyles;},setter:function(E){var D=this.get("graph");this._setBaseAttribute(D,"styles",E);}},styles:{getter:function(){var D={axes:this.get("axesStyles"),series:this.get("seriesStyles"),graph:this.get("graphStyles")};return D;},setter:function(D){if(D.hasOwnProperty("axes")){if(this.get("axesStyles")){this.set("axesStyles",D.axes);}else{this._axesStyles=D.axes;}}if(D.hasOwnProperty("series")){if(this.get("seriesStyles")){this.set("seriesStyles",D.series);}else{this._seriesStyles=D.series;}}if(D.hasOwnProperty("graph")){this.set("graphStyles",D.graph);}}},axes:{valueFn:"_getDefaultAxes",setter:function(D){return this._setAxes(D);}},seriesCollection:{valueFn:"_getDefaultSeriesCollection",setter:function(D){return this._parseSeriesCollection(D);}},leftAxesCollection:{},bottomAxesCollection:{},rightAxesCollection:{},topAxesCollection:{},stacked:{value:false},direction:{getter:function(){var D=this.get("type");if(D=="bar"){return"vertical";}else{if(D=="column"){return"horizontal";}}return this._direction;},setter:function(D){this._direction=D;return this._direction;}},showAreaFill:{},showMarkers:{},showLines:{},categoryAxisName:{},valueAxisName:{value:"values"},horizontalGridlines:{getter:function(){var D=this.get("graph");if(D){return D.get("horizontalGridlines");}return this._horizontalGridlines;},setter:function(E){var D=this.get("graph");if(E&&!q.isObject(E)){E={};}if(D){D.set("horizontalGridlines",E);}else{this._horizontalGridlines=E;}}},verticalGridlines:{getter:function(){var D=this.get("graph");if(D){return D.get("verticalGridlines");}return this._verticalGridlines;},setter:function(E){var D=this.get("graph");if(E&&!q.isObject(E)){E={};}if(D){D.set("verticalGridlines",E);}else{this._verticalGridlines=E;}}},type:{getter:function(){if(this.get("stacked")){return"stacked"+this._type;}return this._type;},setter:function(D){if(this._type=="bar"){if(D!="bar"){this.set("direction","horizontal");}}else{if(D=="bar"){this.set("direction","vertical");}}this._type=D;return this._type;}},categoryAxis:{}}});b.PieChart=b.Base.create("pieChart",b.Widget,[b.ChartBase],{_getSeriesCollection:function(){if(this._seriesCollection){return this._seriesCollection;}var I=this.get("axes"),K=[],J,G=0,F,L=this.get("type"),N,D="categoryAxis",H="categoryKey",E="valueAxis",M="valueKey";if(I){J=I.values.get("keyCollection");N=I.category.get("keyCollection")[0];F=J.length;for(;G<F;++G){K[G]={type:L};K[G][D]="category";K[G][E]="values";K[G][H]=N;K[G][M]=J[G];}}this._seriesCollection=K;return K;},_parseAxes:function(G){if(!this._axes){this._axes={};}var H,M,F,K,D,J,L=this.get("type"),N=this.get("width"),I=this.get("height"),E=b.Node.one(this._parentNode);if(!N){this.set("width",E.get("offsetWidth"));N=this.get("width");}if(!I){this.set("height",E.get("offsetHeight"));I=this.get("height");}for(H in G){if(G.hasOwnProperty(H)){K=G[H];M=L=="pie"?"none":K.position;J=this._getAxisClass(K.type);D={dataProvider:this.get("dataProvider")};if(K.hasOwnProperty("roundingUnit")){D.roundingUnit=K.roundingUnit;}D.keys=K.keys;D.width=N;D.height=I;D.position=M;D.styles=K.styles;F=new J(D);F.on("axisRendered",b.bind(this._itemRendered,this));this._axes[H]=F;}}},_addAxes:function(){var G=this.get("axes"),D,E,F;if(!G){this.set("axes",this._getDefaultAxes());G=this.get("axes");}if(!this._axesCollection){this._axesCollection=[];}for(D in G){if(G.hasOwnProperty(D)){E=G[D];F=E.get("position");if(!this.get(F+"AxesCollection")){this.set(F+"AxesCollection",[E]);}else{this.get(F+"AxesCollection").push(E);}this._axesCollection.push(E);}}},_addSeries:function(){var D=this.get("graph"),E=this.get("seriesCollection");this._parseSeriesAxes(E);D.set("showBackground",false);D.set("width",this.get("width"));D.set("height",this.get("height"));D.set("seriesCollection",E);this._seriesCollection=D.get("seriesCollection");D.render(this.get("contentBox"));},_parseSeriesAxes:function(I){var E=0,D=I.length,G,H=this.get("axes"),F;for(;E<D;++E){G=I[E];if(G){if(G instanceof b.PieSeries){F=G.get("categoryAxis");if(F&&!(F instanceof b.Axis)){G.set("categoryAxis",H[F]);}F=G.get("valueAxis");if(F&&!(F instanceof b.Axis)){G.set("valueAxis",H[F]);}continue;}G.categoryAxis=H.category;G.valueAxis=H.values;if(!G.type){G.type=this.get("type");}}}},_getDefaultAxes:function(){var H=this.get("categoryKey"),E=this.get("seriesKeys")||[],D="numeric",G,F=this.get("dataProvider")[0];if(E.length<1){for(G in F){if(G!=H){E.push(G);}}if(E.length>0){this.set("seriesKeys",E);}}return{values:{keys:E,type:D},category:{keys:[H],type:this.get("categoryType")}};},getSeriesItems:function(F,E){var G={axis:F.get("categoryAxis"),key:F.get("categoryKey"),displayName:F.get("categoryDisplayName")},D={axis:F.get("valueAxis"),key:F.get("valueKey"),displayName:F.get("valueDisplayName")};-G.value=G.axis.getKeyValueAt(G.key,E);D.value=D.axis.getKeyValueAt(D.key,E);return{category:G,value:D};},_sizeChanged:function(D){this._redraw();},_redraw:function(){var F=this.get("graph"),D=this.get("width"),E=this.get("height"),G;if(F){G=Math.min(D,E);F.set("width",G);F.set("height",G);}},_tooltipLabelFunction:function(K,D,G,F,E){var J=g.createElement("div"),H=F.getTotalValues(),I=Math.round((D.value/H)*10000)/100;J.appendChild(g.createTextNode(K.displayName+": "+K.axis.get("labelFunction").apply(this,[K.value,K.axis.get("labelFormat")])));J.appendChild(g.createElement("br"));J.appendChild(g.createTextNode(D.displayName+": "+D.axis.get("labelFunction").apply(this,[D.value,D.axis.get("labelFormat")])));J.appendChild(g.createElement("br"));J.appendChild(g.createTextNode(I+"%"));return J;},_getAriaMessage:function(P){var F="",E,M,J,L,I=0,D=this._itemIndex,G=this.get("seriesCollection"),K,N,O,H;J=this.getSeries(parseInt(I,10));H=J.get("markers");K=H&&H.length?H.length:0;if(P===37){D=D>0?D-1:K-1;}else{if(P===39){D=D>=K-1?0:D+1;}}this._itemIndex=D;M=this.getSeriesItems(J,D);E=M.category;L=M.value;N=J.getTotalValues();O=Math.round((L.value/N)*10000)/100;if(E&&L){F+=E.displayName+": "+E.axis.formatLabel.apply(this,[E.value,E.axis.get("labelFormat")])+", ";F+=L.displayName+": "+L.axis.formatLabel.apply(this,[L.value,L.axis.get("labelFormat")])+", ";F+="Percent of total "+L.displayName+": "+O+"%,";}else{F+="No data available,";}F+=(D+1)+" of "+K+". ";return F;}},{ATTRS:{ariaDescription:{value:"Use the left and right keys to navigate through items.",setter:function(D){if(this._description){this._description.setContent("");this._description.appendChild(g.createTextNode(D));}return D;}},axes:{getter:function(){return this._axes;},setter:function(D){this._parseAxes(D);}},seriesCollection:{getter:function(){return this._getSeriesCollection();},setter:function(D){return this._setSeriesCollection(D);}},type:{value:"pie"}}});},"3.5.1",{requires:["dom","datatype-number","datatype-date","event-custom","event-mouseenter","event-touch","widget","widget-position","widget-stack","graphics"]});+YUI.add("charts-base",function(e,t){function b(){}function w(e){w.superclass.constructor.apply(this,arguments)}function E(e){E.superclass.constructor.apply(this,arguments)}function S(e){S.superclass.constructor.apply(this,arguments)}function x(e){x.superclass.constructor.apply(this,arguments)}function T(){}function N(){}function C(){}function k(t){var n={area:{getter:function(){return this._defaults||this._getAreaDefaults()},setter:function(t){var n=this._defaults||this._getAreaDefaults();this._defaults=e.merge(n,t)}}};this.addAttrs(n,t),this.get("styles")}function L(e){var t={markers:{getter:function(){return this._markers}}};this.addAttrs(t,e)}function A(){}function O(){}var n=e.config,r=n.win,i=n.doc,s=e.Lang,o=s.isString,u=e.DOM,a,f,l,c,h=e.ClassNameManager.getClassName,p=h("seriesmarker"),d,v,m,g,y;d=function(e){d.superclass.constructor.apply(this,arguments)},d.NAME="shapeGroup",e.extend(d,e.Path,{_draw:function(){var e=this.get("xvalues"),t=this.get("yvalues"),n,r,i,o,u=0,a,f=[],l=this.get("dimensions"),c=l.width,h=l.height,p=l.radius,d=l.yRadius,v=this.get("id"),m=this.node.className,g=s.isArray(c),y=s.isArray(h),b=s.isArray(p),w=s.isArray(d);if(e&&t&&e.length>0){this.clear(),a=e.length;for(;u<a;++u)n=e[u],r=t[u],i=b?p[u]:p,o=w?d[u]:d,!isNaN(n)&&!isNaN(r)&&!isNaN(i)&&(this.drawShape({x:n,y:r,width:g?c[u]:c,height:y?h[u]:h,radius:i,yRadius:o}),this.closePath(),f[u]={id:v+"_"+u,className:m,coords:n-this._left+", "+(r-this._top)+", "+p,shape:"circle"});this._closePath()}},_getRadiusCollection:function(e){var t=0,n=e.length,r=[];for(;t<n;++t)r[t]=e[t]*.5;return r}}),d.ATTRS=e.merge(e.Path.ATTRS,{dimensions:{getter:function(){var e=this._dimensions,t,n,r,i;return e.hasOwnProperty("radius")?e:(r=e.width,i=e.height,t=s.isArray(r)?this._getRadiusCollection(r):r*.5,n=s.isArray(i)?this._getRadiusCollection(i):i*.5,{width:r,height:i,radius:t,yRadius:n})},setter:function(e){return this._dimensions=e,e}},xvalues:{getter:function(){return this._xvalues},setter:function(e){this._xvalues=e}},yvalues:{getter:function(){return this._yvalues},setter:function(e){this._yvalues=e}}}),e.ShapeGroup=d,v=function(e){v.superclass.constructor.apply(this,arguments)},v.NAME="circleGroup",e.extend(v,e.ShapeGroup,{drawShape:function(e){this.drawCircle(e.x,e.y,e.radius)}}),v.ATTRS=e.merge(e.ShapeGroup.ATTRS,{dimensions:{getter:function(){var e=this._dimensions,t,n,r,i;return e.hasOwnProperty("radius")?e:(r=e.width,i=e.height,t=s.isArray(r)?this._getRadiusCollection(r):r*.5,n=t,{width:r,height:i,radius:t,yRadius:n})}}}),v.ATTRS=e.ShapeGroup.ATTRS,e.CircleGroup=v,m=function(e){m.superclass.constructor.apply(this,arguments)},m.NAME="rectGroup",e.extend(m,e.ShapeGroup,{drawShape:function(e){this.drawRect(e.x,e.y,e.width,e.height)}}),m.ATTRS=e.ShapeGroup.ATTRS,e.RectGroup=m,y=function(e){y.superclass.constructor.apply(this,arguments)},y.NAME="diamondGroup",e.extend(y,e.ShapeGroup,{drawShape:function(e){this.drawDiamond(e.x,e.y,e.width,e.height)}}),y.ATTRS=e.ShapeGroup.ATTRS,e.DiamondGroup=y,g=function(e){g.superclass.constructor.apply(this,arguments)},g.NAME="diamondGroup",e.extend(g,e.ShapeGroup,{drawShape:function(e){this.drawEllipse(e.x,e.y,e.width,e.height)}}),g.ATTRS=e.ShapeGroup.ATTRS,e.EllipseGroup=g,b.ATTRS={styles:{getter:function(){return this._styles=this._styles||this._getDefaultStyles(),this._styles},setter:function(e){this._styles=this._setStyles(e)}},graphic:{}},b.NAME="renderer",b.prototype={_styles:null,_setStyles:function(e){var t=this.get("styles");return this._mergeStyles(e,t)},_mergeStyles:function(t,n){n||(n={});var r=e.merge(n,{});return e.Object.each(t,function(e,t,i){n.hasOwnProperty(t)&&s.isObject(e)&&!s.isFunction(e)&&!s.isArray(e)?r[t]=this._mergeStyles(e,n[t]):r[t]=e},this),r},_getDefaultStyles:function(){return{padding:{top:0,right:0,bottom:0,left:0}}}},e.augment(b,e.Attribute),e.Renderer=b,a=function(){},a.prototype={_getDefaultMargins:function(){return{top:0,left:0,right:4,bottom:0}},setTickOffsets:function(){var e=this,t=e.get("styles").majorTicks,n=t.length,r=n*.5,i=t.display;e.set("topTickOffset",0),e.set("bottomTickOffset",0);switch(i){case"inside":e.set("rightTickOffset",n),e.set("leftTickOffset",0);break;case"outside":e.set("rightTickOffset",0),e.set("leftTickOffset",n);break;case"cross":e.set("rightTickOffset",r),e.set("leftTickOffset",r);break;default:e.set("rightTickOffset",0),e.set("leftTickOffset",0)}},drawTick:function(e,t,n){var r=this,i=r.get("styles"),s=i.padding,o=n.length,u={x:s.left,y:t.y},a={x:o+s.left,y:t.y};r.drawLine(e,u,a)},getLineStart:function(){var e=this.get("styles"),t=e.padding,n=e.majorTicks,r=n.length,i=n.display,s={x:t.left,y:0};return i==="outside"?s.x+=r:i==="cross"&&(s.x+=r/2),s},getLabelPoint:function(e){return{x:e.x-this.get("leftTickOffset"),y:e.y}},updateMaxLabelSize:function(e,t){var n=this,r=this._labelRotationProps,i=r.rot,s=r.absRot,o=r.sinRadians,u=r.cosRadians,a;i===0?a=e:s===90?a=t:a=u*e+o*t,n._maxLabelSize=Math.max(n._maxLabelSize,a)},getExplicitlySized:function(e){if(this._explicitWidth){var t=this,n=t._explicitWidth,r=t._totalTitleSize,i=t.get("leftTickOffset"),s=e.label.margin.right;return t._maxLabelSize=n-(i+s+r),!0}return!1},positionTitle:function(e){var t=this,n=t._titleBounds,r=t.get("styles").title.margin,i=t._titleRotationProps,s=n.right-n.left,o=e.offsetWidth,u=e.offsetHeight,a=o*-0.5+s*.5,f=t.get("height")*.5-u*.5;i.labelWidth=o,i.labelHeight=u,r&&r.left&&(a+=r.left),i.x=a,i.y=f,i.transformOrigin=[.5,.5],t._rotate(e,i)},positionLabel:function(e,t,n,r){var i=this,s=i.get("leftTickOffset"),o=this._totalTitleSize,u=t.x+o-s,a=t.y,f=this._labelRotationProps,l=f.rot,c=f.absRot,h=i._maxLabelSize,p=this._labelWidths[r],d=this._labelHeights[r];l===0?(u-=p,a-=d*.5):l===90?u-=p*.5:l===-90?(u-=p*.5,a-=d):(u-=p+d*c/360,a-=d*.5),f.labelWidth=p,f.labelHeight=d,f.x=Math.round(h+u),f.y=Math.round(a),this._rotate(e,f)},_setRotationCoords:function(e){var t=e.rot,n=e.absRot,r,i,s=e.labelWidth,o=e.labelHeight;t===0?(r=s,i=o*.5):t===90?(i=0,r=s*.5):t===-90?(r=s*.5,i=o):(r=s+o*n/360,i=o*.5),e.x-=r,e.y-=i},_getTransformOrigin:function(e){var t;return e===0?t=[0,0]:e===90?t=[.5,0]:e===-90?t=[.5,1]:t=[1,.5],t},offsetNodeForTick:function(e){},setCalculatedSize:function(){var e=this,t=this.get("graphic"),n=e.get("styles"),r=n.label,i=e.get("leftTickOffset"),s=e._maxLabelSize,o=this._totalTitleSize,u=Math.round(o+i+s+r.margin.right);this._explicitWidth&&(u=this._explicitWidth),this.set("calculatedWidth",u),t.set("x",u-i)}},e.LeftAxisLayout=a,f=function(){},f.prototype={_getDefaultMargins:function(){return{top:0,left:4,right:0,bottom:0}},setTickOffsets:function(){var e=this,t=e.get("styles").majorTicks,n=t.length,r=n*.5,i=t.display;e.set("topTickOffset",0),e.set("bottomTickOffset",0);switch(i){case"inside":e.set("leftTickOffset",n),e.set("rightTickOffset",0);break;case"outside":e.set("leftTickOffset",0),e.set("rightTickOffset",n);break;case"cross":e.set("rightTickOffset",r),e.set("leftTickOffset",r);break;default:e.set("leftTickOffset",0),e.set("rightTickOffset",0)}},drawTick:function(e,t,n){var r=this,i=r.get("styles"),s=i.padding,o=n.length,u={x:s.left,y:t.y},a={x:s.left+o,y:t.y};r.drawLine(e,u,a)},getLineStart:function(){var e=this,t=e.get("styles"),n=t.padding,r=t.majorTicks,i=r.length,s=r.display,o={x:n.left,y:n.top};return s==="inside"?o.x+=i:s==="cross"&&(o.x+=i/2),o},getLabelPoint:function(e){return{x:e.x+this.get("rightTickOffset"),y:e.y}},updateMaxLabelSize:function(e,t){var n=this,r=this._labelRotationProps,i=r.rot,s=r.absRot,o=r.sinRadians,u=r.cosRadians,a;i===0?a=e:s===90?a=t:a=u*e+o*t,n._maxLabelSize=Math.max(n._maxLabelSize,a)},getExplicitlySized:function(e){if(this._explicitWidth){var t=this,n=t._explicitWidth,r=this._totalTitleSize,i=t.get("rightTickOffset"),s=e.label.margin.right;return t._maxLabelSize=n-(i+s+r),!0}return!1},positionTitle:function(e){var t=this,n=t._titleBounds,r=t.get("styles").title.margin,i=t._titleRotationProps,s=e.offsetWidth,o=e.offsetHeight,u=n.right-n.left,a=this.get("width")-s*.5-u*.5,f=t.get("height")*.5-o*.5;i.labelWidth=s,i.labelHeight=o,r&&r.right&&(a-=r.left),i.x=a,i.y=f,i.transformOrigin=[.5,.5],t._rotate(e,i)},positionLabel:function(e,t,n,r){var i=this,s=i.get("rightTickOffset"),o=n.label,u=0,a=t.x,f=t.y,l=this._labelRotationProps,c=l.rot,h=l.absRot,p=this._labelWidths[r],d=this._labelHeights[r];o.margin&&o.margin.left&&(u=o.margin.left),c===0?f-=d*.5:c===90?(a-=p*.5,f-=d):c===-90?a-=p*.5:(f-=d*.5,a+=d/2*h/90),a+=u,a+=s,l.labelWidth=p,l.labelHeight=d,l.x=Math.round(a),l.y=Math.round(f),this._rotate(e,l)},_setRotationCoords:function(e){var t=e.rot,n=e.absRot,r=0,i=0,s=e.labelWidth,o=e.labelHeight;t===0?i=o*.5:t===90?(r=s*.5,i=o):t===-90?r=s*.5:(i=o*.5,r=o/2*n/90),e.x-=r,e.y-=i},_getTransformOrigin:function(e){var t;return e===0?t=[0,0]:e===90?t=[.5,1]:e===-90?t=[.5,0]:t=[0,.5],t},offsetNodeForTick:function(e){var t=this,n=t.get("leftTickOffset"),r=0-n;e.setStyle("left",r)},setCalculatedSize:function(){var e=this,t=e.get("styles"),n=t.label,r=this._totalTitleSize,i=Math.round(e.get("rightTickOffset")+e._maxLabelSize+r+n.margin.left);this._explicitWidth&&(i=this._explicitWidth),e.set("calculatedWidth",i),e.get("contentBox").setStyle("width",i)}},e.RightAxisLayout=f,l=function(){},l.prototype={_getDefaultMargins:function(){return{top:4,left:0,right:0,bottom:0}},setTickOffsets:function(){var e=this,t=e.get("styles").majorTicks,n=t.length,r=n*.5,i=t.display;e.set("leftTickOffset",0),e.set("rightTickOffset",0);switch(i){case"inside":e.set("topTickOffset",n),e.set("bottomTickOffset",0);break;case"outside":e.set("topTickOffset",0),e.set("bottomTickOffset",n);break;case"cross":e.set("topTickOffset",r),e.set("bottomTickOffset",r);break;default:e.set("topTickOffset",0),e.set("bottomTickOffset",0)}},getLineStart:function(){var e=this.get("styles"),t=e.padding,n=e.majorTicks,r=n.length,i=n.display,s={x:0,y:t.top};return i==="inside"?s.y+=r:i==="cross"&&(s.y+=r/2),s},drawTick:function(e,t,n){var r=this,i=r.get("styles"),s=i.padding,o=n.length,u={x:t.x,y:s.top},a={x:t.x,y:o+s.top};r.drawLine(e,u,a)},getLabelPoint:function(e){return{x:e.x,y:e.y+this.get("bottomTickOffset")}},updateMaxLabelSize:function(e,t){var n=this,r=this._labelRotationProps,i=r.rot,s=r.absRot,o=r.sinRadians,u=r.cosRadians,a;i===0?a=t:s===90?a=e:a=o*e+u*t,n._maxLabelSize=Math.max(n._maxLabelSize,a)},getExplicitlySized:function(e){if(this._explicitHeight){var t=this,n=t._explicitHeight,r=t._totalTitleSize,i=t.get("bottomTickOffset"),s=e.label.margin.right;return t._maxLabelSize=n-(i+s+r),!0}return!1},positionTitle:function(e){var t=this,n=t._titleBounds,r=t.get("styles").title.margin,i=t._titleRotationProps,s=n.bottom-n.top,o=e.offsetWidth,u=e.offsetHeight,a=t.get("width")*.5-o*.5,f=t.get("height")-u/2-s/2;i.labelWidth=o,i.labelHeight=u,r&&r.bottom&&(f-=r.bottom),i.x=a,i.y=f,i.transformOrigin=[.5,.5],t._rotate(e,i)},positionLabel:function(e,t,n,r){var i=this,s=i.get("bottomTickOffset"),o=n.label,u=0,a=i._labelRotationProps,f=a.rot,l=a.absRot,c=Math.round(t.x),h=Math.round(t.y),p=i._labelWidths[r],d=i._labelHeights[r];o.margin&&o.margin.top&&(u=o.margin.top),f>0?h-=d/2*f/90:f<0?(c-=p,h-=d/2*l/90):c-=p*.5,h+=u,h+=s,a.labelWidth=p,a.labelHeight=d,a.x=c,a.y=h,i._rotate(e,a)},_setRotationCoords:function(e){var t=e.rot,n=e.absRot,r=e.labelWidth,i=e.labelHeight,s,o;t>0?(s=0,o=i/2*t/90):t<0?(s=r,o=i/2*n/90):(s=r*.5,o=0),e.x-=s,e.y-=o},_getTransformOrigin:function(e){var t;return e>0?t=[0,.5]:e<0?t=[1,.5]:t=[0,0],t},offsetNodeForTick:function(e){var t=this;t.get("contentBox").setStyle("top",0-t.get("topTickOffset"))},setCalculatedSize:function(){var e=this,t=e.get("styles"),n=t.label,r=e._totalTitleSize,i=Math.round(e.get("bottomTickOffset")+e._maxLabelSize+n.margin.top+r);e._explicitHeight&&(i=e._explicitHeight),e.set("calculatedHeight",i)}},e.BottomAxisLayout=l,c=function(){},c.prototype={_getDefaultMargins:function(){return{top:0,left:0,right:0,bottom:4}},setTickOffsets:function(){var e=this,t=e.get("styles").majorTicks,n=t.length,r=n*.5,i=t.display;e.set("leftTickOffset",0),e.set("rightTickOffset",0);switch(i){case"inside":e.set("bottomTickOffset",n),e.set("topTickOffset",0);break;case"outside":e.set("bottomTickOffset",0),e.set("topTickOffset",n);break;case"cross":e.set("topTickOffset",r),e.set("bottomTickOffset",r);break;default:e.set("topTickOffset",0),e.set("bottomTickOffset",0)}},getLineStart:function(){var e=this,t=e.get("styles"),n=t.padding,r=t.majorTicks,i=r.length,s=r.display,o={x:0,y:n.top};return s==="outside"?o.y+=i:s==="cross"&&(o.y+=i/2),o},drawTick:function(e,t,n){var r=this,i=r.get("styles"),s=i.padding,o=n.length,u={x:t.x,y:s.top},a={x:t.x,y:o+s.top};r.drawLine(e,u,a)},getLabelPoint:function(e){return{x:e.x,y:e.y-this.get("topTickOffset")}},updateMaxLabelSize:function(e,t){var n=this,r=this._labelRotationProps,i=r.rot,s=r.absRot,o=r.sinRadians,u=r.cosRadians,a;i===0?a=t:s===90?a=e:a=o*e+u*t,n._maxLabelSize=Math.max(n._maxLabelSize,a)},getExplicitlySized:function(e){if(this._explicitHeight){var t=this,n=t._explicitHeight,r=t._totalTitleSize,i=t.get("topTickOffset"),s=e.label.margin.right;return t._maxLabelSize=n-(i+s+r),!0}return!1},positionTitle:function(e){var t=this,n=t._titleBounds,r=t.get("styles").title.margin,i=t._titleRotationProps,s=e.offsetWidth,o=e.offsetHeight,u=n.bottom-n.top,a=t.get("width")*.5-s*.5,f=u/2-o/2;i.labelWidth=s,i.labelHeight=o,r&&r.top&&(f+=r.top),i.x=a,i.y=f,i.transformOrigin=[.5,.5],t._rotate(e,i)},positionLabel:function(e,t,n,r){var i=this,s=this._totalTitleSize,o=i._maxLabelSize,u=t.x,a=t.y+s+o,f=this._labelRotationProps,l=f.rot,c=f.absRot,h=this._labelWidths[r],p=this._labelHeights[r];l===0?(u-=h*.5,a-=p):l===90?(u-=h,a-=p*.5):l===-90?a-=p*.5:l>0?(u-=h,a-=p-p*l/180):a-=p-p*c/180,f.x=Math.round(u),f.y=Math.round(a),f.labelWidth=h,f.labelHeight=p,this._rotate(e,f)},_setRotationCoords:function(e){var t=e.rot,n=e.absRot,r=e.labelWidth,i=e.labelHeight,s,o;t===0?(s=r*.5,o=i):t===90?(s=r,o=i*.5):t===-90?o=i*.5:t>0?(s=r,o=i-i*t/180):o=i-i*n/180,e.x-=s,e.y-=o},_getTransformOrigin:function(e){var t;return e===0?t=[0,0]:e===90?t=[1,.5]:e===-90?t=[0,.5]:e>0?t=[1,.5]:t=[0,.5],t},offsetNodeForTick:function(e){},setCalculatedSize:function(){var e=this,t=e.get("graphic"),n=e.get("styles"),r=n.label.margin,i=r.bottom+e._maxLabelSize,s=e._totalTitleSize,o=this.get("topTickOffset"),u=Math.round(o+i+s);this._explicitHeight&&(u=this._explicitWidth),e.set("calculatedHeight",u),t.set("y",u-o)}},e.TopAxisLayout=c,e.Axis=e.Base.create("axis",e.Widget,[e.Renderer],{_calculatedWidth:0,_calculatedHeight:0,_dataChangeHandler:function(e){this.get("rendered")&&this._drawAxis()},_positionChangeHandler:function(e){this._updateGraphic(e.newVal),this._updateHandler()},_updateGraphic:function(e){var t=this.get("graphic");e=="none"?t&&t.destroy():t||this._setCanvas()},_updateHandler:function(e){this.get("rendered")&&this._drawAxis()},renderUI:function(){this._updateGraphic(this.get("position"))},syncUI:function(){var e=this._layout,t,n,r,i,s;if(e){t=e._getDefaultMargins(),n=this.get("styles"),r=n.label.margin,i=n.title.margin;for(s in t)t.hasOwnProperty(s)&&(r[s]=r[s]===undefined?t[s]:r[s],i[s]=i[s]===undefined?t[s]:i[s])}this._drawAxis()},_setCanvas:function(){var t=this.get("contentBox"),n=this.get("boundingBox"),r=this.get("position"),i=this._parentNode,s=this.get("width"),o=this.get("height");n.setStyle("position","absolute"),n.setStyle("zIndex",2),s=s?s+"px":i.getStyle("width"),o=o?o+"px":i.getStyle("height"),r==="top"||r==="bottom"?t.setStyle("width",s):t.setStyle("height",o),t.setStyle("position","relative"),t.setStyle("left","0px"),t.setStyle("top","0px"),this.set("graphic",new e.Graphic),this.get("graphic").render(t)},_getDefaultStyles:function(){var t={majorTicks:{display:"inside",length:4,color:"#dad8c9",weight:1,alpha:1},minorTicks:{display:"none",length:2,color:"#dad8c9",weight:1},line:{weight:1,color:"#dad8c9",alpha:1},majorUnit:{determinant:"count",count:11,distance:75},top:"0px",left:"0px",width:"100px",height:"100px",label:{color:"#808080",alpha:1,fontSize:"85%",rotation:0,margin:{top:undefined,right:undefined,bottom:undefined,left:undefined}},title:{color:"#808080",alpha:1,fontSize:"85%",rotation:undefined,margin:{top:undefined,right:undefined,bottom:undefined,left:undefined}},hideOverlappingLabelTicks:!1};return e.merge(e.Renderer.prototype._getDefaultStyles(),t)},_handleSizeChange:function(e){var t=e.attrName,n=this.get("position"),r=n=="left"||n=="right",i=this.get("contentBox"),s=n=="bottom"||n=="top";i.setStyle("width",this.get("width")),i.setStyle("height",this.get("height")),(s&&t=="width"||r&&t=="height")&&this._drawAxis()},_layoutClasses:{top:c,bottom:l,left:a,right:f},drawLine:function(e,t,n){e.moveTo(t.x,t.y),e.lineTo(n.x,n.y)},_getTextRotationProps:function(e){if(e.rotation===undefined)switch(this.get("position")){case"left":e.rotation=-90;break;case"right":e.rotation=90;break;default:e.rotation=0}var t=Math.min(90,Math.max(-90,e.rotation)),n=Math.abs(t),r=Math.PI/180,i=parseFloat(parseFloat(Math.sin(n*r)).toFixed(8)),s=parseFloat(parseFloat(Math.cos(n*r)).toFixed(8));return{rot:t,absRot:n,radCon:r,sinRadians:i,cosRadians:s,textAlpha:e.alpha}},_drawAxis:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1;if(this._layout){var e=this.get("styles"),t=e.line,n=e.label,r=e.majorTicks,i=r.display!="none",s,o=e.majorUnit,u,a,f=0,l=this._layout,c,h,p,d,v,m,g=this.get("labelFunction"),y=this.get("labelFunctionScope"),b=this.get("labelFormat"),w=this.get("graphic"),E=this.get("path"),S,x;this._labelWidths=[],this._labelHeights=[],w.set("autoDraw",!1),E.clear(),E.set("stroke",{weight:t.weight,color:t.color,opacity:t.alpha}),this._labelRotationProps=this._getTextRotationProps(n),this._labelRotationProps.transformOrigin=l._getTransformOrigin(this._labelRotationProps.rot),l.setTickOffsets.apply(this),c=this.getLength(),p=l.getLineStart.apply(this),u=this.getTotalMajorUnits(o),a=this.getMajorUnitDistance(u,c,o),this.set("edgeOffset",this.getEdgeOffset(u,c)*.5);if(u<1)this._clearLabelCache();else{s=this.getFirstPoint(p),this.drawLine(E,p,this.getLineEnd(s)),i&&(S=this.get("tickPath"),S.clear(),S.set("stroke",{weight:r.weight,color:r.color,opacity:r.alpha}),l.drawTick.apply(this,[S,s,r])),this._createLabelCache(),this._tickPoints=[],this._maxLabelSize=0,this._totalTitleSize=0,this._titleSize=0,this._setTitle(),x=l.getExplicitlySized.apply(this,[e]);for(;f<u;++f)i&&l.drawTick.apply(this,[S,s,r]),h=this.getPosition(s),d=this.getLabel(s,n),this._labels.push(d),this._tickPoints.push({x:s.x,y:s.y}),this.get("appendLabelFunction")(d,g.apply(y,[this.getLabelByIndex(f,u),b])),v=Math.round(d.offsetWidth),m=Math.round(d.offsetHeight),x||this._layout.updateMaxLabelSize.apply(this,[v,m]),this._labelWidths.push(v),this._labelHeights.push(m),s=this.getNextPoint(s,a);this._clearLabelCache(),this.get("overlapGraph")&&l.offsetNodeForTick.apply(this,[this.get("contentBox")]),l.setCalculatedSize.apply(this),this._titleTextField&&this._layout.positionTitle.apply(this,[this._titleTextField]);for(f=0;f<u;++f)l.positionLabel.apply(this,[this.get("labels")[f],this._tickPoints[f],e,f])}}this._drawing=!1,this._callLater?this._drawAxis():(this._updatePathElement(),this.fire("axisRendered"))},_setTotalTitleSize:function(t){var n=this._titleTextField,r=n.offsetWidth,i=n.offsetHeight,s=this._titleRotationProps.rot,o,u,a=t.margin,f=this.get("position"),l=new e.Matrix;l.rotate(s),o=l.getContentRect(r,i),f=="left"||f=="right"?(u=o.right-o.left,a&&(u+=a.left+a.right)):(u=o.bottom-o.top,a&&(u+=a.top+a.bottom)),this._titleBounds=o,this._totalTitleSize=u},_updatePathElement:function(){var e=this._path,t=this._tickPath,n=!1,r=this.get("graphic");e&&(n=!0,e.end()),t&&(n=!0,t.end()),n&&r._redraw()},_setTitle:function(){var e,t,n,r=this.get("title"),s=this._titleTextField,o;if(r!==null&&r!==undefined){n={rotation:"rotation",margin:"margin",alpha:"alpha"},t=this.get("styles").title,s?i.createElementNS||s.style.filter&&(s.style.filter=null):(s=i.createElement("span"),s.style.display="block",s.style.whiteSpace="nowrap",s.setAttribute("class","axisTitle"),this.get("contentBox").append(s)),s.style.position="absolute";for(e in t)t.hasOwnProperty(e)&&!n.hasOwnProperty(e)&&(s.style[e]=t[e]);this.get("appendTitleFunction")(s,r),this._titleTextField=s,this._titleRotationProps=this._getTextRotationProps(t),this._setTotalTitleSize(t)}else s&&(o=s.parentNode,o&&o.removeChild(s),this._titleTextField=null,this._totalTitleSize=0)},getLabel:function(t,n){var r,s,o=this._labelCache,u={rotation:"rotation",margin:"margin",alpha:"alpha"};o&&o.length>0?s=o.shift():(s=i.createElement("span"),s.className=e.Lang.trim([s.className,"axisLabel"].join(" ")),this.get("contentBox").append(s)),i.createElementNS||s.style.filter&&(s.style.filter=null),s.style.display="block",s.style.whiteSpace="nowrap",s.style.position="absolute";for(r in n)n.hasOwnProperty(r)&&!u.hasOwnProperty(r)&&(s.style[r]=n[r]);return s},_createLabelCache:function(){if(this._labels)while(this._labels.length>0)this._labelCache.push(this._labels.shift());else this._clearLabelCache();this._labels=[]},_clearLabelCache:function(){if(this._labelCache){var t=this._labelCache.length,n=0,r;for(;n<t;++n)r=this._labelCache[n],this._removeChildren(r),e.Event.purgeElement(r,!0),r.parentNode.removeChild(r)}this._labelCache=[]},getLineEnd:function(e){var t=this.get("width"),n=this.get("height"),r=this.get("position");return r==="top"||r==="bottom"?{x:t,y:e.y}:{x:e.x,y:n}},getLength:function(){var e,t=this.get("styles"),n=t.padding,r=this.get("width"),i=this.get("height"),s=this.get("position");return s==="top"||s==="bottom"?e=r-(n.left+n.right):e=i-(n.top+n.bottom),e},getFirstPoint:function(e){var t=this.get("styles"),n=this.get("position"),r=t.padding,i={x:e.x,y:e.y};return n==="top"||n==="bottom"?i.x+=r.left+this.get("edgeOffset"):i.y+=this.get("height")-(r.top+this.get("edgeOffset")),i},getNextPoint:function(e,t){var n=this.get("position");return n==="top"||n==="bottom"?e.x=e.x+t:e.y=e.y-t,e},getLastPoint:function(){var e=this.get("styles"),t=e.padding,n=this.get("width"),r=this.get("position");return r==="top"||r==="bottom"?{x:n-t.right,y:t.top}:{x:t.left,y:t.top}},getPosition:function(e){var t,n=this.get("height"),r=this.get("styles"),i=r.padding,s=this.get("position"),o=this.get("dataType");return s==="left"||s==="right"?o==="numeric"?t=n-(i.top+i.bottom)-(e.y-i.top):t=e.y-i.top:t=e.x-i.left,t},_rotate:function(t,n){var r=n.rot,o=n.x,a=n.y,f,l,c=new e.Matrix,h=n.transformOrigin||[0,0],p;i.createElementNS?(c.translate(o,a),c.rotate(r),u.setStyle(t,"transformOrigin",h[0]*100+"% "+h[1]*100+"%"),u.setStyle(t,"transform",c.toCSSText())):(l=n.textAlpha,s.isNumber(l)&&l<1&&l>-1&&!isNaN(l)&&(f="progid:DXImageTransform.Microsoft.Alpha(Opacity="+Math.round(l*100)+")"),r!==0?(c.rotate(r),p=c.getContentRect(n.labelWidth,n.labelHeight),c.init(),c.translate(p.left,p.top),c.translate(o,a),this._simulateRotateWithTransformOrigin(c,r,h,n.labelWidth,n.labelHeight),f?f+=" ":f="",f+=c.toFilterText(),t.style.left=c.dx+"px",t.style.top=c.dy+"px"):(t.style.left=o+"px",t.style.top=a+"px"),f&&(t.style.filter=f))},_simulateRotateWithTransformOrigin:function(e,t,n,r,i){var s=n[0]*r,o=n[1]*i;s=isNaN(s)?0:s,o=isNaN(o)?0:o,e.translate(s,o),e.rotate(t),e.translate(-s,-o)},getMaxLabelBounds:function(){return this._getLabelBounds(this.getMaximumValue())},getMinLabelBounds:function(){return this._getLabelBounds(this.getMinimumValue())},_getLabelBounds:function(t){var n=this._layout,r=this.get("styles").label,i=new e.Matrix,s,o=this._getTextRotationProps(r);return o.transformOrigin=n._getTransformOrigin(o.rot),s=this.getLabel({x:0,y:0},r),this.get("appendLabelFunction")(s,this.get("labelFunction").apply(this,[t,this.get("labelFormat")])),o.labelWidth=s.offsetWidth,o.labelHeight=s.offsetHeight,this._removeChildren(s),e.Event.purgeElement(s,!0),s.parentNode.removeChild(s),o.x=0,o.y=0,n._setRotationCoords(o),i.translate(o.x,o.y),this._simulateRotateWithTransformOrigin(i,o.rot,o.transformOrigin,o.labelWidth,o.labelHeight),i.getContentRect(o.labelWidth,o.labelHeight)},_removeChildren:function(e){if(e.hasChildNodes()){var t;while(e.firstChild)t=e.firstChild,this._removeChildren(t),e.removeChild(t)}},destructor:function(){var e=this.get("contentBox").getDOMNode(),t=this.get("labels"),n=this.get("graphic"),r,i=t?t.length:0;if(i>0)while(t.length>0)r=t.shift(),this._removeChildren(r),e.removeChild(r),r=null;n&&n.destroy()},_maxLabelSize:0,_setText:function(e,t){e.innerHTML="",s.isNumber(t)?t+="":t||(t=""),o(t)&&(t=i.createTextNode(t)),e.appendChild(t)}},{ATTRS:{width:{lazyAdd:!1,getter:function(){return this._explicitWidth?this._explicitWidth:this._calculatedWidth},setter:function(e){return this._explicitWidth=e,e}},height:{lazyAdd:!1,getter:function(){return this._explicitHeight?this._explicitHeight:this._calculatedHeight},setter:function(e){return this._explicitHeight=e,e}},calculatedWidth:{getter:function(){return this._calculatedWidth},setter:function(e){return this._calculatedWidth=e,e}},calculatedHeight:{getter:function(){return this._calculatedHeight},setter:function(e){return this._calculatedHeight=e,e}},edgeOffset:{value:0},graphic:{},path:{readOnly:!0,getter:function(){if(!this._path){var e=this.get("graphic");e&&(this._path=e.addShape({type:"path"}))}return this._path}},tickPath:{readOnly:!0,getter:function(){if(!this._tickPath){var e=this.get("graphic");e&&(this._tickPath=e.addShape({type:"path"}))}return this._tickPath}},node:{},position:{setter:function(e){var t=this._layoutClasses[e];return e&&e!="none"&&(this._layout=new t),e}},topTickOffset:{value:0},bottomTickOffset:{value:0},leftTickOffset:{value:0},rightTickOffset:{value:0},labels:{readOnly:!0,getter:function(){return this._labels}},tickPoints:{readOnly:!0,getter:function(){return this.get("position")=="none"?this.get("styles").majorUnit.count:this._tickPoints}},overlapGraph:{value:!0,validator:function(e){return s.isBoolean(e)}},labelFunctionScope:{},maxLabelSize:{getter:function(){return this._maxLabelSize},setter:function(e){return this._maxLabelSize=e,e}},title:{value:null},labelFunction:{value:function(e,t){return e}},appendLabelFunction:{valueFn:function(){return this._setText}},appendTitleFunction:{valueFn:function(){return this._setText}}}}),e.AxisType=e.Base.create("baseAxis",e.Axis,[],{initializer:function(){this.after("dataReady",e.bind(this._dataChangeHandler,this)),this.after("dataUpdate",e.bind(this._dataChangeHandler,this)),this.after("minimumChange",e.bind(this._keyChangeHandler,this)),this.after("maximumChange",e.bind(this._keyChangeHandler,this)),this.after("keysChange",this._keyChangeHandler),this.after("dataProviderChange",this._dataProviderChangeHandler),this.after("alwaysShowZeroChange",this._keyChangeHandler),this.after("roundingMethodChange",this._keyChangeHandler)},bindUI:function(){this.after("stylesChange",this._updateHandler),this.after("overlapGraphChange",this._updateHandler),this.after("positionChange",this._positionChangeHandler),this.after("widthChange",this._handleSizeChange),this.after("heightChange",this._handleSizeChange),this.after("calculatedWidthChange",this._handleSizeChange),this.after("calculatedHeightChange",this._handleSizeChange)},_dataProviderChangeHandler:function(e){var t=this.get("keyCollection").concat(),n=this.get("keys"),r;if(n)for(r in n)n.hasOwnProperty(r)&&delete n[r];t&&t.length&&this.set("keys",t)},GUID:"yuibaseaxis",_type:null,_setMaximum:null,_dataMaximum:null,_setMinimum:null,_data:null,_updateTotalDataFlag:!0,_dataReady:!1,addKey:function(e){this.set("keys",e)},_getKeyArray:function(e,t){var n=0,r,i=[],s=t.length;for(;n<s;++n)r=t[n],i[n]=r[e];return i},_setDataByKey:function(e,t){var n,r,i=[],s=this._dataClone.concat(),o=s.length;for(n=0;n<o;++n)r=s[n],i[n]=r[e];this.get("keys")[e]=i,this._updateTotalDataFlag=!0},_updateTotalData:function(){var e=this.get("keys"),t;this._data=[];for(t in e)e.hasOwnProperty(t)&&(this._data=this._data.concat(e[t]));this._updateTotalDataFlag=!1},removeKey:function(e){var t=this.get("keys");t.hasOwnProperty(e)&&(delete t[e],this._keyChangeHandler())},getKeyValueAt:function(e,t){var n=NaN,r=this.get("keys");return r[e]&&s.isNumber(parseFloat(r[e][t]))&&(n=r[e][t]),parseFloat(n)},getDataByKey:function(e){var t=this.get("keys");return t[e]?t[e]:null},_updateMinAndMax:function(){var e=this.get("data"),t=0,n=0,r,i,s;if(e&&e.length&&e.length>0){r=e.length,t=n=e[0];if(r>1)for(s=1;s<r;s++){i=e[s];if(isNaN(i))continue;t=Math.max(i,t),n=Math.min(i,n)}}this._dataMaximum=t,this._dataMinimum=n},getTotalMajorUnits:function(){var e,t=this.get("styles").majorUnit,n=this.get("length");return t.determinant==="count"?e=t.count:t.determinant==="distance"&&(e=n/t.distance+1),e},getMajorUnitDistance:function(e,t,n){var r;return n.determinant==="count"?r=t/(e-1):n.determinant==="distance"&&(r=n.distance),r},getEdgeOffset:function(e,t){return 0},getLabelByIndex:function(e,t){var n=this.get("minimum"),r=this.get("maximum"),i=(r-n)/(t-1),s;return t-=1,s=n+e*i,s},_keyChangeHandler:function(e){this._updateMinAndMax(),this.fire("dataUpdate")},_hasDataOverflow:function(){return this.get("setMin")||this.get("setMax")?!0:!1},getMinimumValue:function(){return this.get("minimum")},getMaximumValue:function(){return this.get("maximum")}},{ATTRS:{keys:{value:{},setter:function(e){var t={},n,r,i=this.get("dataProvider");if(s.isArray(e)){r=e.length;for(n=0;n<r;++n)t[e[n]]=this._getKeyArray(e[n],i)}else if(s.isString(e))t=this.get("keys"),t[e]=this._getKeyArray(e,i);else for(n in e)e.hasOwnProperty(n)&&(t[n]=this._getKeyArray(n,i));return this._updateTotalDataFlag=!0,t}},roundingMethod:{value:"niceNumber"},type:{readOnly:!0,getter:function(){return this._type}},dataProvider:{setter:function(e){return e}},dataMaximum:{getter:function(){return this._dataMaximum||this._updateMinAndMax(),this._dataMaximum}},maximum:{lazyAdd:!1,getter:function(){var e=this.get("dataMaximum"),t=this.get("minimum");return t===0&&e===0&&(e=10),s.isNumber(this._setMaximum)&&(e=this._setMaximum),parseFloat(e)},setter:function(e){return this._setMaximum=parseFloat(e),e}},dataMinimum:{getter:function(){return this._dataMinimum||this._updateMinAndMax(),this._dataMinimum}},minimum:{lazyAdd:!1,getter:function(){var e=this.get("dataMinimum");return s.isNumber(this._setMinimum)&&(e=this._setMinimum),parseFloat(e)},setter:function(e){return this._setMinimum=parseFloat(e),e}},setMax:{readOnly:!0,getter:function(){return s.isNumber(this._setMaximum)}},setMin:{readOnly:!0,getter:function(){return s.isNumber(this._setMinimum)}},data:{getter:function(){return(!this._data||this._updateTotalDataFlag)&&this._updateTotalData(),this._data}},keyCollection:{getter:function(){var e=this.get("keys"),t,n=[];for(t in e)e.hasOwnProperty(t)&&n.push(t);return n},readOnly:!0}}}),w.NAME="numericAxis",w.ATTRS={alwaysShowZero:{value:!0},labelFunction:{value:function(t,n){return n?e.DataType.Number.format(t,n):t}},labelFormat:{value:{prefix:"",thousandsSeparator:"",decimalSeparator:"",decimalPlaces:"0",suffix:""}}},e.extend(w,e.AxisType,{formatLabel:function(t,n){return n?e.DataType.Number.format(t,n):t},getTotalByKey:function(e){var t=0,n=this.getDataByKey(e),r=0,i,s=n?n.length:0;for(;r<s;++r)i=parseFloat(n[r]),isNaN(i)||(t+=i);return t},_type:"numeric",_getMinimumUnit:function(e,t,n){return this._getNiceNumber(Math.ceil((e-t)/n))},_getNiceNumber:function(e){var t=e,n=Math.ceil(Math.log(t)*.4342944819032518),r=Math.pow(10,n),i;return r/2>=t?(i=Math.floor((r/2-t)/(Math.pow(10,n-1)/2)),t=r/2-i*Math.pow(10,n-1)/2):t=r,isNaN(t)?e:t},_updateMinAndMax:function(){var e=this.get("data"),t,n,r,i,o=0,u,a=this.get("setMax"),f=this.get("setMin");if(!a||!f){if(e&&e.length&&e.length>0){r=e.length;for(;o<r;o++){i=e[o];if(isNaN(i)){if(s.isObject(i)){n=t=0;for(u in i)i.hasOwnProperty(u)&&(t=Math.max(i[u],t),n=Math.min(i[u],n))}t=a?this._setMaximum:t,n=f?this._setMinimum:n;continue}f?n=this._setMinimum:n===undefined?n=i:n=Math.min(i,n),a?t=this._setMaximum:t===undefined?t=i:t=Math.max(i,t),this._actualMaximum=t,this._actualMinimum=n}}this._roundMinAndMax(n,t,f,a)}},_roundMinAndMax:function(e,t,n,r){var i,s,o=e>=0,u=t>0,a,f,l,c,h,p,d,v=this.getTotalMajorUnits()-1,m=this.get("alwaysShowZero"),g=this.get("roundingMethod"),y=(t-e)/v>=1;if(g)if(g=="niceNumber"){i=this._getMinimumUnit(t,e,v);if(o&&u)(m||e<i)&&!n?(e=0,i=this._getMinimumUnit(t,e,v)):e=this._roundDownToNearest(e,i),r?m||(e=t-i*v):n?t=e+i*v:t=this._roundUpToNearest(t,i);else if(u&&!o)if(m){c=Math.round(v/(-1*e/t+1)),c=Math.max(Math.min(c,v-1),1),h=v-c,p=Math.ceil(t/c),d=Math.floor(e/h)*-1;if(n){while(d<p&&h>=0)h--,c++,p=Math.ceil(t/c),d=Math.floor(e/h)*-1;h>0?t=d*c:t=e+i*v}else if(r){while(p<d&&c>=0)h++,c--,d=Math.floor(e/h)*-1,p=Math.ceil(t/c);c>0?e=p*h*-1:e=t-i*v}else i=Math.max(p,d),i=this._getNiceNumber(i),t=i*c,e=i*h*-1}else r?e=t-i*v:n?t=e+i*v:(e=this._roundDownToNearest(e,i),t=this._roundUpToNearest(t,i));else n?m?t=0:t=e+i*v:r?e=t-i*v:m||t===0||t+i>0?(t=0,i=this._getMinimumUnit(t,e,v),e=t-i*v):(e=this._roundDownToNearest(e,i),t=this._roundUpToNearest(t,i))}else g=="auto"?o&&u?((m||e<(t-e)/v)&&!n&&(e=0),i=(t-e)/v,y&&(i=Math.ceil(i)),t=e+i*v):u&&!o?m?(c=Math.round(v/(-1*e/t+1)),c=Math.max(Math.min(c,v-1),1),h=v-c,y?(p=Math.ceil(t/c),d=Math.floor(e/h)*-1):(p=t/c,d=e/h*-1),i=Math.max(p,d),t=i*c,e=i*h*-1):(i=(t-e)/v,y&&(i=Math.ceil(i)),e=this._roundDownToNearest(e,i),t=this._roundUpToNearest(t,i)):(i=(t-e)/v,y&&(i=Math.ceil(i)),m||t===0||t+i>0?(t=0,i=(t-e)/v,y&&Math.ceil(i),e=t-i*v):(e=this._roundDownToNearest(e,i),t=this._roundUpToNearest(t,i))):!isNaN(g)&&isFinite(g)&&(i=g,s=i*v,a=t-e>s,l=this._roundDownToNearest(e,i),f=this._roundUpToNearest(t,i),r?e=t-s:n?t=e+s:o&&u?(m||l<=0?e=0:e=l,t=e+s):u&&!o?(e=l,t=f):(m||f>=0?t=0:t=f,e=t-s));this._dataMaximum=t,this._dataMinimum=e},getLabelByIndex:function(e,t){var n=this.get("minimum"),r=this.get("maximum"),i=(r-n)/(t-1),s,o=this.get("roundingMethod");return t-=1,e===0?s=n:e===t?s=r:(s=e*i,o=="niceNumber"&&(s=this._roundToNearest(s,i)),s+=n),parseFloat(s)},_roundToNearest:function(e,t){t=t||1;if(t===0)return e;var n=Math.round(this._roundToPrecision(e/t,10))*t;return this._roundToPrecision(n,10)},_roundUpToNearest:function(e,t){return t=t||1,t===0?e:Math.ceil(this._roundToPrecision(e/t,10))*t},_roundDownToNearest:function(e,t){return t=t||1,t===0?e:Math.floor(this._roundToPrecision(e/t,10))*t},_roundToPrecision:function(e,t){t=t||0;var n=Math.pow(10,t);return Math.round(n*e)/n},_hasDataOverflow:function(){var e,t,n;return this.get("setMin")||this.get("setMax")?!0:(e=this.get("roundingMethod"),t=this._actualMinimum,n=this._actualMaximum,s.isNumber(e)&&(s.isNumber(n)&&n>this._dataMaximum||s.isNumber(t)&&t<this._dataMinimum)?!0:!1)}}),e.NumericAxis=w,E.NAME="stackedAxis",e.extend(E,e.NumericAxis,{_updateMinAndMax:function(){var e=0,t=0,n=0,r=0,i=0,s=0,o,u,a=this.get("keys"),f=this.get("setMin"),l=this.get("setMax");for(o in a)a.hasOwnProperty(o)&&(i=Math.max(i,a[o].length));for(;s<i;++s){n=0,r=0;for(o in a)if(a.hasOwnProperty(o)){u=a[o][s];if(isNaN(u))continue;u>=0?n+=u:r+=u}n>0?e=Math.max(e,n):e=Math.max(e,r),r<0?t=Math.min(t,r):t=Math.min(t,n)}this._actualMaximum=e,this._actualMinimum=t,l&&(e=this._setMaximum),f&&(t=this._setMinimum),this._roundMinAndMax(t,e,f,l)}}),e.StackedAxis=E,S.NAME="timeAxis",S.ATTRS={setMax:{readOnly:!0,getter:function(){var e=this._getNumber(this._setMaximum);return s.isNumber(e)}},setMin:{readOnly:!0,getter:function(){var e=this._getNumber(this._setMinimum);return s.isNumber(e)}},maximum:{getter:function(){var e=this._getNumber(this._setMaximum);return s.isNumber(e)||(e=this._getNumber(this.get("dataMaximum"))),parseFloat(e)},setter:function(e){return this._setMaximum=this._getNumber(e),e}},minimum:{getter:function(){var e=this._getNumber(this._setMinimum);return s.isNumber(e)||(e=this._getNumber(this.get("dataMinimum"))),parseFloat(e)},setter:function(e){return this._setMinimum=this._getNumber(e),e}},labelFunction:{value:function(t,n){return t=e.DataType.Date.parse(t),n?e.DataType.Date.format(t,{format:n}):t}},labelFormat:{value:"%b %d, %y"}},e.extend(S,e.AxisType,{formatLabel:function(t,n){return t=e.DataType.Date.parse(t),n?e.DataType.Date.format(t,{format:n}):t},GUID:"yuitimeaxis",_dataType:"time",getLabelByIndex:function(e,t){var n=this.get("minimum"),r=this.get("maximum"),i=this.get("position"),s,o;return t-=1,s=(r-n)/t*e,i=="bottom"||i=="top"?o=n+s:o=r-s,o},_getKeyArray:function(e,t){var n,r=[],i=0,o,u=t.length;for(;i<u;++i)n=t[i][e],s.isDate(n)?o=n.valueOf():(o=new Date(n),s.isDate(o)?o=o.valueOf():s.isNumber(n)?o=n:s.isNumber(parseFloat(n))?o=parseFloat(n):(typeof n!="string"&&(n=n),o=(new Date(n)).valueOf())),r[i]=o;return r},_setDataByKey:function(e,t){var n,r=[],i=this._dataClone.concat(),o,u,a=i.length;for(o=0;o<a;++o)n=i[o][e],s.isDate(n)?u=n.valueOf():(u=new Date(n),s.isDate(u)?u=u.valueOf():s.isNumber(n)?u=n:s.isNumber(parseFloat(n))?u=parseFloat(n):(typeof n!="string"&&(n=n.toString()),u=(new Date(n)).valueOf())),r[o]=u;this.get("keys")[e]=r,this._updateTotalDataFlag=!0},_getNumber:function(e){return s.isDate(e)?e=e.valueOf():!s.isNumber(e)&&e&&(e=(new Date(e)).valueOf()),e}}),e.TimeAxis=S,x.NAME="categoryAxis",e.extend(x,e.AxisType,{formatLabel:function(e,t){return e},_indices:null,GUID:"yuicategoryaxis",_type:"category",_updateMinAndMax:function(){this._dataMaximum=Math.max(this.get("data").length-1,0),this._dataMinimum=0},_getKeyArray:function(e,t){var n=0,r,i=[],s=[],o=t.length;this._indices||(this._indices={});for(;n<o;++n)r=t[n],i[n]=n,s[n]=r[e];return this._indices[e]=i,s},_setDataByKey:function(e){var t,n,r=[],i=[],s=this._dataClone.concat(),o=s.length;this._indices||(this._indices={});for(t=0;t<o;++t)n=s[t],r[t]=t,i[t]=n[e];this._indices[e]=r,this.get("keys")[e]=i.concat(),this._updateTotalDataFlag=!0},getDataByKey:function(e){this._indices||this.get("keys");var t=this._indices;return t[e]?t[e]:null},getTotalMajorUnits:function(e,t){return this.get("data").length},getMajorUnitDistance:function(e,t,n){var r;return n.determinant==="count"?r=t/e:n.determinant==="distance"&&(r=n.distance),r},getEdgeOffset:function(e,t){return t/e},getKeyValueAt:function(e,t){var n=NaN,r=this.get("keys");return r[e]&&r[e][t]&&(n=r[e][t]),n},getLabelByIndex:function(e,t){var n,r=this.get("data"),i=this.get("position");return i=="bottom"||i=="top"?n=r[e]:n=r[t-(e+1)],n},getMinimumValue:function(){var e=this.get("data"),t=e[0];return t},getMaximumValue:function(){var e=this.get("data"),t=e.length-1,n=e[t];return n}}),e.CategoryAxis=x,T.prototype={getCurveControlPoints:function(e,t){var n=[],r=1,i=e.length-1,s=[],o=[];if(i<1)return null;n[0]={startx:e[0],starty:t[0],endx:e[1],endy:t[1]};if(i===1)return n[0].ctrlx1=(2*e[0]+e[1])/3,n[0].ctrly2=(2*t[0]+t[1])/3,n[0].ctrlx2=2*n[0].ctrlx1-e[0],n[0].ctrly2=2*n[0].ctrly1-t[0],n;for(;r<i;++r)n.push({startx:Math.round(e[r]),starty:Math.round(t[r]),endx:Math.round(e[r+1]),endy:Math.round(t[r+1])}),s[r]=4*e[r]+2*e[r+1],o[r]=4*t[r]+2*t[r+1];s[0]=e[0]+2*e[1],s[i-1]=(8*e[i-1]+e[i])/2,s=this.getControlPoints(s.concat()),o[0]=t[0]+2*t[1],o[i-1]=(8*t[i-1]+t[i])/2,o=this.getControlPoints(o.concat());for(r=0;r<i;++r)n[r].ctrlx1=Math.round(s[r]),n[r].ctrly1=Math.round(o[r]),r<i-1?(n[r].ctrlx2=Math.round(2*e[r+1]-s[r+1]),n[r].ctrly2=Math.round(2*t[r+1]-o[r+1])):(n[r].ctrlx2=Math.round((e[i]+s[i-1])/2),n[r].ctrly2=Math.round((t[i]+o[i-1])/2));return n},getControlPoints:function(e){var t=e.length,n=[],r=[],i=2,s=1;n[0]=e[0]/i;for(;s<t;++s)r[s]=1/i,i=(s<t-1?4:3.5)-r[s],n[s]=(e[s]-n[s-1])/i;for(s=1;s<t;++s)n[t-s-1]-=r[t-s]*n[t-s];return n}},e.CurveUtil=T,N.prototype={_stacked:!0,_stackCoordinates:function(){this.get("direction")=="vertical"?this._stackXCoords():this._stackYCoords()},_stackXCoords:function(){var e=this.get("order"),t=this.get("type"),n=this.get("graph"),r=n.seriesTypes[t],i=0,o=this.get("xcoords"),u=this.get("ycoords"),a,f,l,c,h=o.concat(),p,d,v=[],m;e>0?(p=r[e-1].get("stackedXCoords"),d=r[e-1].get("stackedYCoords"),a=p.length):a=o.length;for(;i<a;i+=1)if(s.isNumber(o[i])){if(e>0){l=p[i];if(!s.isNumber(l)){c=e;while(c>-1&&!s.isNumber(l))c-=1,c>-1?l=r[c].get("stackedXCoords")[i]:l=this._leftOrigin}o[i]=o[i]+l}h[i]=o[i]}else v.push(i);this._cleanXNaN(h,u),a=v.length;if(a>0)for(i=0;i<a;i+=1)m=v[i],f=e>0?p[m]:this._leftOrigin,h[m]=Math.max(h[m],f);this.set("stackedXCoords",h),this.set("stackedYCoords",u)},_stackYCoords:function(){var e=this.get("order"),t=this.get("type"),n=this.get("graph"),r=n.get("height"),i=n.seriesTypes[t],o=0,u=this.get("xcoords"),a=this.get("ycoords"),f,l,c,h,p=a.concat(),d,v,m=[],g;e>0?(d=i[e-1].get("stackedXCoords"),v=i[e-1].get("stackedYCoords"),f=v.length):f=a.length;for(;o<f;o+=1)if(s.isNumber(a[o])){if(e>0){c=v[o];if(!s.isNumber(c)){h=e;while(h>-1&&!s.isNumber(c))h-=1,h>-1?c=i[h].get("stackedYCoords")[o]:c=this._bottomOrigin}a[o]=c-(r-a[o])}p[o]=a[o]}else m.push(o);this._cleanYNaN(u,p),f=m.length;if(f>0)for(o=0;o<f;o+=1)g=m[o],l=e>0?v[g]:r,p[g]=Math.min(p[g],l);this.set("stackedXCoords",u),this.set("stackedYCoords",p)},_cleanXNaN:function(e,t){var n,r,i,o,u,a,f,l,c=s.isNumber,h,p=0,d=t.length;for(;p<d;++p)u=e[p],a=t[p],!c(u)&&p>0&&p<d-1&&(o=t[p-1],i=this._getPreviousValidCoordValue(e,p),l=t[p+1],f=this._getNextValidCoordValue(e,p),c(i)&&c(f)&&(h=(l-o)/(f-i),e[p]=(a+h*i-o)/h),n=NaN,r=NaN)},_getPreviousValidCoordValue:function(e,t){var n,r=s.isNumber,i=-1;while(!r(n)&&t>i)t-=1,n=e[t];return n},_getNextValidCoordValue:function(e,t){var n,r=s.isNumber,i=e.length;while(!r(n)&&t<i)t+=1,n=e[t];return n},_cleanYNaN:function(e,t){var n,r,i,o,u,a,f,l,c=s.isNumber,h,p=0,d=e.length;for(;p<d;++p)u=e[p],a=t[p],!c(a)&&p>0&&p<d-1&&(i=e[p-1],o=this._getPreviousValidCoordValue(t,p),f=e[p+1],l=this._getNextValidCoordValue(t,p),c(o)&&c(l)&&(h=(l-o)/(f-i),t[p]=o+(h*u-h*i)),n=NaN,r=NaN)}},e.StackingUtil=N,C.prototype={_lineDefaults:null,_getGraphic:function(){var e=this.get("graphic")||this.get("graph").get("graphic");return this._lineGraphic||(this._lineGraphic=e.addShape({type:"path"})),this._lineGraphic.clear(),this._lineGraphic},_toggleVisible:function(e){this._lineGraphic&&this._lineGraphic.set("visible",e)},drawLines:function(){if(this.get("xcoords").length<1)return;var e=s.isNumber,t,n,r=this.get("direction"),i,o,u,a=!0,f,l,c,h,p,d=this.get("styles").line,v=d.lineType,m=d.color||this._getDefaultColor(this.get("graphOrder"),"line"),g=d.alpha,y=d.dashLength,b=d.gapSpace,w=d.connectDiscontinuousPoints,E=d.discontinuousType,S=d.discontinuousDashLength,x=d.discontinuousGapSpace,T=this._getGraphic();this._stacked?(t=this.get("stackedXCoords"),n=this.get("stackedYCoords")):(t=this.get("xcoords"),n=this.get("ycoords")),i=r==="vertical"?n.length:t.length,T.set("stroke",{weight:d.weight,color:m,opacity:g});for(p=0;p<i;p=++p){c=t[p],h=n[p],u=e(c)&&e(h);if(!u){o=u;continue}a?(a=!1,T.moveTo(c,h)):o?v!="dashed"?T.lineTo(c,h):this.drawDashedLine(T,f,l,c,h,y,b):w?E!="solid"?this.drawDashedLine(T,f,l,c,h,S,x):T.lineTo(c,h):T.moveTo(c,h),f=c,l=h,o=!0}T.end()},drawSpline:function(){if(this.get("xcoords").length<1)return;var e=this.get("xcoords"),t=this.get("ycoords"),n=this.getCurveControlPoints(e,t),r=n.length,i,s,o,u,a,f,l=0,c=this.get("styles").line,h=this._getGraphic(),p=c.alpha,d=c.color||this._getDefaultColor(this.get("graphOrder"),"line");h.set("stroke",{weight:c.weight,color:d,opacity:p}),h.moveTo(e[0],t[0]);for(;l<r;l=++l)a=n[l].endx,f=n[l].endy,i=n[l].ctrlx1,s=n[l].ctrlx2,o=n[l].ctrly1,u=n[l].ctrly2,h.curveTo(i,o,s,u,a,f);h.end()},drawDashedLine:function(e,t,n,r,i,s,o){s=s||10,o=o||10;var u=s+o,a=r-t,f=i-n,l=Math.sqrt(Math.pow(a,2)+Math.pow(f,2)),c=Math.floor(Math.abs(l/u)),h=Math.atan2(f,a),p=t,d=n,v;a=Math.cos(h)*u,f=Math.sin(h)*u;for(v=0;v<c;++v)e.moveTo(p,d),e.lineTo(p+Math.cos(h)*s,d+Math.sin(h)*s),p+=a,d+=f;e.moveTo(p,d),l=Math.sqrt((r-p)*(r-p)+(i-d)*(i-d)),l>s?e.lineTo(p+Math.cos(h)*s,d+Math.sin(h)*s):l>0&&e.lineTo(p+Math.cos(h)*l,d+Math.sin(h)*l),e.moveTo(r,i)},_getLineDefaults:function(){return{alpha:1,weight:6,lineType:"solid",dashLength:10,gapSpace:10,connectDiscontinuousPoints:!0,discontinuousType:"solid",discontinuousDashLength:10,discontinuousGapSpace:10}}},e.augment(C,e.Attribute),e.Lines=C,k.prototype={_getPath:function(){var e=this._path;return e||(e=this.get("graph").get("graphic").addShape({type:"path"}),this._path=e),e},_toggleVisible:function(e){this._path&&this._path.set("visible",e)},drawFill:function(e,t){if(e.length<1)return;var n=s.isNumber,r=e.length,i=e[0],o=t[0],u=i,a=o,f,l,c,h=!0,p=0,d=this.get("styles").area,v=this._getPath(),m=d.color||this._getDefaultColor(this.get("graphOrder"),"slice");v.clear(),v.set("fill",{color:m,opacity:d.alpha}),v.set("stroke",{weight:0});for(;p<r;p=++p){f=e[p],l=t[p],c=n(f)&&n(l);if(!c)continue;h?(this._firstValidX=f,this._firstValidY=l,h=!1,v.moveTo(f,l)):v.lineTo(f,l),u=f,a=l}this._lastValidX=u,this._lastValidY=a,v.end()},drawAreaSpline:function(){if(this.get("xcoords").length<1)return;var e=this.get("xcoords"),t=this.get("ycoords"),n=this.getCurveControlPoints(e,t),r=n.length,i,s,o,u,a,f,l=0,c=e[0],h=t[0],p=this.get("styles").area,d=this._getPath(),v=p.color||this._getDefaultColor(this.get("graphOrder"),"slice");d.set("fill",{color:v,opacity:p.alpha}),d.set("stroke",{weight:0}),d.moveTo(c,h);for(;l<r;l=++l)a=n[l].endx,f=n[l].endy,i=n[l].ctrlx1,s=n[l].ctrlx2,o=n[l].ctrly1,u=n[l].ctrly2,d.curveTo(i,o,s,u,a,f);this.get("direction")==="vertical"?(d.lineTo(this._leftOrigin,f),d.lineTo(this._leftOrigin,h)):(d.lineTo(a,this._bottomOrigin),d.lineTo(c,this._bottomOrigin)),d.lineTo(c,h),d.end()},drawStackedAreaSpline:function(){if(this.get("xcoords").length<1)return;var e=this.get("xcoords"),t=this.get("ycoords"),n,r=this.get("order"),i=this.get("type"),s=this.get("graph"),o=s.seriesTypes[i],u,a,f,l,c,h,p,d,v,m=0,g,y,b=this.get("styles").area,w=this._getPath(),E=b.color||this._getDefaultColor(this.get("graphOrder"),"slice");g=e[0],y=t[0],n=this.getCurveControlPoints(e,t),f=n.length,w.set("fill",{color:E,opacity:b.alpha}),w.set("stroke",{weight:0}),w.moveTo(g,y);for(;m<f;m=++m)d=n[m].endx,v=n[m].endy,l=n[m].ctrlx1,c=n[m].ctrlx2,h=n[m].ctrly1,p=n[m].ctrly2,w.curveTo(l,h,c,p,d,v);if(r>0){u=o[r-1].get("xcoords").concat().reverse(),a=o[r-1].get("ycoords").concat().reverse(),n=this.getCurveControlPoints(u,a),m=0,f=n.length,w.lineTo(u[0],a[0]);for(;m<f;m=++m)d=n[m].endx,v=n[m].endy,l=n[m].ctrlx1,c=n[m].ctrlx2,h=n[m].ctrly1,p=n[m].ctrly2,w.curveTo(l,h,c,p,d,v)}else this.get("direction")==="vertical"?(w.lineTo(this._leftOrigin,t[t.length-1]),w.lineTo(this._leftOrigin,y)):(w.lineTo(e[e.length-1],this._bottomOrigin),w.lineTo(g,this._bottomOrigin));w.lineTo(g,y),w.end()},_defaults:null,_getClosingPoints:function(){var e=this.get("xcoords").concat(),t=this.get("ycoords").concat(),n,r;return this.get("direction")==="vertical"?(r=this._getLastValidIndex(e),n=this._getFirstValidIndex(e),t.push(t[r]),t.push(t[n]),e.push(this._leftOrigin),e.push(this._leftOrigin)):(r=this._getLastValidIndex(t),n=this._getFirstValidIndex(t),e.push(e[r]),e.push(e[n]),t.push(this._bottomOrigin),t.push(this._bottomOrigin)),e.push(e[0]),t.push(t[0]),[e,t]},_getHighestValidOrder:function(e,t,n,r){var i=r=="vertical"?"stackedXCoords":"stackedYCoords",s;while(isNaN(s)&&n>-1)n-=1,n>-1&&(s=e[n].get(i)[t]);return n},_getCoordsByOrderAndIndex:function(e,t,n,r){var i,s;return r=="vertical"?(i=n<0?this._leftOrigin:e[n].get("stackedXCoords")[t],s=this.get("stackedYCoords")[t]):(i=this.get("stackedXCoords")[t],s=n<0?this._bottomOrigin:e[n].get("stackedYCoords")[t]),[i,s]},_getStackedClosingPoints:function(){var e=this.get("order"),t=this.get("type"),n=this.get("graph"),r=this.get("direction"),i=n.seriesTypes[t],s,o,u=this.get("stackedXCoords"),a=this.get("stackedYCoords"),f,l,c,h,p,d,v,m,g,y,b,w;if(e<1)return this._getClosingPoints();l=i[e-1],p=l.get("stackedXCoords").concat(),d=l.get("stackedYCoords").concat(),r=="vertical"?(s=this._getFirstValidIndex(u),o=this._getLastValidIndex(u),c=l._getFirstValidIndex(p),h=l._getLastValidIndex(p)):(s=this._getFirstValidIndex(a),o=this._getLastValidIndex(a),c=l._getFirstValidIndex(d),h=l._getLastValidIndex(d)),h>=s&&c<=o?(c=Math.max(s,c),h=Math.min(o,h),p=p.slice(c,h+1),d=d.slice(c,h+1),f=c):f=o,m=[u[s]],g=[a[s]],y=s;while((isNaN(b)||b<e-1)&&y<=f)w=b,b=this._getHighestValidOrder(i,y,e,r),!isNaN(w)&&b>w&&(v=this._getCoordsByOrderAndIndex(i,y,w,r),m.push(v[0]),g.push(v[1])),v=this._getCoordsByOrderAndIndex(i,y,b,r),m.push(v[0]),g.push(v[1]),y+=1;p&&p.length>0&&h>s&&c<o&&(m=m.concat(p),g=g.concat(d),b=e-1),y=Math.max(s,h),e-=1,b=NaN;while(y<=o)w=b,b=this._getHighestValidOrder(i,y,e,r),isNaN(w)||(b>w?(v=this._getCoordsByOrderAndIndex(i,y,w,r),m.push(v[0]),g.push(v[1])):b<w&&(v=this._getCoordsByOrderAndIndex(i,y-1,b,r),m.push(v[0]),g.push(v[1]))),v=this._getCoordsByOrderAndIndex(i,y,b,r),m.push(v[0]),g.push(v[1]),y+=1;return m.reverse(),g.reverse(),[u.concat(m),a.concat(g)]},_getAreaDefaults:function(){return{}}},e.augment(k,e.Attribute),e.Fills=k,L.prototype={_plotDefaults:null,drawPlots:function(){if(!this.get("xcoords")||this.get("xcoords").length<1)return;var t=s.isNumber,n=e.clone(this.get("styles").marker),r=n.width,i=n.height,o=this.get("xcoords"),u=this.get("ycoords"),a=0,f=o.length,l=u[0],c,h,p=r/2,d=i/2,v,m,g=null,y=null,b=this.get("graphOrder"),w=this.get("groupMarkers");if(w){v=[],m=[];for(;a<f;++a)v.push(parseFloat(o[a]-p)),m.push(parseFloat(u[a]-d));this._createGroupMarker({xvalues:v,yvalues:m,fill:n.fill,border:n.border,dimensions:{width:r,height:i},graphOrder:b,shape:n.shape});return}s.isArray(n.fill.color)&&(g=n.fill.color.concat()),s.isArray(n.border.color)&&(y=n.border.color.concat()),this._createMarkerCache();for(;a<f;++a){l=parseFloat(u[a]-d),c=parseFloat(o[a]-p);if(!t(c)||!t(l)){this._markers.push(null);continue}g&&(n.fill.color=g[a%g.length]),y&&(n.border.color=y[a%y.length]),n.x=c,n.y=l,h=this.getMarker(n,b,a)}this._clearMarkerCache()},_groupShapes:{circle:e.CircleGroup,rect:e.RectGroup,ellipse:e.EllipseGroup,diamond:e.DiamondGroup},_getGroupShape:function(e){return s.isString(e)&&(e=this._groupShapes[e]),e},_getPlotDefaults:function(){var e={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:1,alpha:1},width:10,height:10,shape:"circle"};return e.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill"),e.border.color=this._getDefaultColor(this.get("graphOrder"),"border"),e},_markers:null,_markerCache:null,getMarker:function(e,t,n){var r,i=e.border;e.id=this.get("chart").get("id")+"_"+t+"_"+n,i.opacity=i.alpha,e.stroke=i,e.fill.opacity=e.fill.alpha;if(this._markerCache.length>0){while(!r){if(this._markerCache.length<1){r=this._createMarker(e,t,n);break}r=this._markerCache.shift()}r.set(e)}else r=this._createMarker(e,t,n);return this._markers.push(r),r},_createMarker:function(t,n,r){var i=this.get("graphic"),s,o=e.clone(t);return i.set("autoDraw",!1),o.type=o.shape,s=i.addShape(o),s.addClass(p),s},_createMarkerCache:function(){this._groupMarker&&(this._groupMarker.destroy(),this._groupMarker=null),this._markers&&this._markers.length>0?this._markerCache=this._markers.concat():this._markerCache=[],this._markers=[]},_createGroupMarker:function(e){var t,n=this.get("markers"),r=e.border,i,s,o;if(n&&n.length>0){while(n.length>0)t=n.shift(),t.destroy();this.set("markers",[])}r.opacity=r.alpha,s={id:this.get("chart").get("id")+"_"+e.graphOrder,stroke:r,fill:e.fill,dimensions:e.dimensions,xvalues:e.xvalues,yvalues:e.yvalues},s.fill.opacity=e.fill.alpha,o=this._getGroupShape(e.shape),o&&(s.type=o),e.hasOwnProperty("radius")&&!isNaN(e.radius)&&(s.dimensions.radius=e.radius),this._groupMarker&&this._groupMarker.destroy(),i=this.get("graphic"),this._groupMarker=i.addShape(s),i._redraw()},_toggleVisible:function(e){var t,n=this.get("markers"),r=0,i;if(n){i=n.length;for(;r<i;++r)t=n[r],t&&t.set("visible",e)}},_clearMarkerCache:function(){var e;while(this._markerCache.length>0)e=this._markerCache.shift(),e&&e.destroy()},updateMarkerState:function(t,n){if(this._markers&&this._markers[n]){var r,i,s=e.clone(this.get("styles").marker),o=this._getState(t),u=this.get("xcoords"),a=this.get("ycoords"),f=this._markers[n],l=o=="off"||!s[o]?s:s[o];l.fill.color=this._getItemColor(l.fill.color,n),l.border.color=this._getItemColor(l.border.color,n),l.stroke=l.border,f.set(l),r=l.width,i=l.height,f.set("x",u[n]-r/2),f.set("y",a[n]-i/2),f.set("visible",this.get("visible"))}},_getItemColor:function(e,t){return s.isArray(e)?e[t%e.length]:e},_setStyles:function(t){return t=this._parseMarkerStyles(t),e.Renderer.prototype._setStyles.apply(this,[t])},_parseMarkerStyles:function(e){if(e.marker){var t=this._getPlotDefaults();e.marker=this._mergeStyles(e.marker,t),e.marker.over&&(e.marker.over=this._mergeStyles(e.marker.over,e.marker)),e.marker.down&&(e.marker.down=this._mergeStyles(e.marker.down,e.marker))}return e},_getState:function(e){var t;switch(e){case"mouseout":t="off";break;case"mouseover":t="over";break;case"mouseup":t="over";break;case"mousedown":t="down"}return t},_stateSyles:null},e.augment(L,e.Attribute),e.Plots=L,A.prototype={drawSeries:function(){if(this.get("xcoords").length<1)return;var t=e.clone(this.get("styles").marker),n,r,i=this.get("xcoords"),o=this.get("ycoords"),u=0,a=i.length,f=o[0],l=this.get("type"),c=this.get("graph"),h=c.seriesTypes[l],p=h.length,d=0,v=0,m=0,g,y,b=this.get("order"),w=this.get("graphOrder"),E,S,x,T,N,C=null,k=null,L=[],A=[],O,M,_,D,P={width:[],height:[]},H=[],B=[],j=this.get("groupMarkers");s.isArray(t.fill.color)&&(C=t.fill.color.concat()),s.isArray(t.border.color)&&(k=t.border.color.concat()),this.get("direction")=="vertical"?(x="height",T="width"):(x="width",T="height"),n=t[x],r=t[T],this._createMarkerCache();for(;u<p;++u)y=h[u],d+=y.get("styles").marker[x],b>u&&(m=d);v=a*d,this._maxSize=c.get(x),v>this._maxSize&&(g=c.get(x)/v,d*=g,m*=g,n*=g,n=Math.max(n,1),this._maxSize=n),m-=d/2;for(u=0;u<a;++u){O=i[u]-d/2,M=O+d,_=o[u]-d/2,D=_+d,L.push({start:O,end:M}),A.push({start:_,end:D});if(isNaN(i[u])||isNaN(o[u])){this._markers.push(null);continue}N=this._getMarkerDimensions(i[u],o[u],r,m),!isNaN(N.calculatedSize)&&N.calculatedSize>0?(f=N.top,E=N.left,j?(P[x][u]=n,P[T][u]=N.calculatedSize,H.push(E),B.push(f)):(t[x]=n,t[T]=N.calculatedSize,t.x=E,t.y=f,C&&(t.fill.color=C[u%C.length]),k&&(t.border.color=k[u%k.length]),S=this.getMarker(t,w,u))):j||this._markers.push(null)}this.set("xMarkerPlane",L),this.set("yMarkerPlane",A),j?this._createGroupMarker({fill:t.fill,border:t.border,dimensions:P,xvalues:H,yvalues:B,shape:t.shape}):this._clearMarkerCache()},_defaultFillColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getPlotDefaults:function(){var e={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:0,alpha:1},width:12,height:12,shape:"rect",padding:{top:0,left:0,right:0,bottom:0}};return e.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill"),e.border.color=this._getDefaultColor(this.get("graphOrder"),"border"),e}},e.Histogram=A,e.CartesianSeries=e.Base.create("cartesianSeries",e.Base,[e.Renderer],{_xDisplayName:null,_yDisplayName:null,_leftOrigin:null,_bottomOrigin:null,render:function(){this._setCanvas(),this.addListeners(),this.set("rendered",!0),this.validate()},addListeners:function(){var t=this.get("xAxis"),n=this.get("yAxis");t&&(this._xDataReadyHandle=t.after("dataReady",e.bind(this._xDataChangeHandler,this)),this._xDataUpdateHandle=t.after("dataUpdate",e.bind(this._xDataChangeHandler,this))),n&&(this._yDataReadyHandle=n.after("dataReady",e.bind(this._yDataChangeHandler,this)),this._yDataUpdateHandle=n.after("dataUpdate",e.bind(this._yDataChangeHandler,this))),this._xAxisChangeHandle=this.after("xAxisChange",this._xAxisChangeHandler),this._yAxisChangeHandle=this.after("yAxisChange",this._yAxisChangeHandler),this._stylesChangeHandle=this.after("stylesChange",function(e){var t=this._updateAxisData();t&&this.draw()}),this._widthChangeHandle=this.after("widthChange",function(e){var t=this._updateAxisData();t&&this.draw()}),this._heightChangeHandle=this.after("heightChange",function(e){var t=this._updateAxisData();t&&this.draw()}),this._visibleChangeHandle=this.after("visibleChange",this._handleVisibleChange)},_xAxisChangeHandler:function(t){var n=this.get("xAxis");n.after("dataReady",e.bind(this._xDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._xDataChangeHandler,this))},_yAxisChangeHandler:function(t){var n=this.get("yAxis");n.after("dataReady",e.bind(this._yDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._yDataChangeHandler,this))},GUID:"yuicartesianseries",_xDataChangeHandler:function(e){var t=this._updateAxisData();t&&this.draw()},_yDataChangeHandler:function(e){var t=this._updateAxisData();t&&this.draw()},_updateAxisData:function(){var e=this.get("xAxis"),t=this.get("yAxis"),n=this.get("xKey"),r=this.get("yKey"),i,s;return!e||!t||!n||!r?!1:(s=e.getDataByKey(n),i=t.getDataByKey(r),!s||!i?!1:(this.set("xData",s.concat()),this.set("yData",i.concat()),!0))},validate:function(){this.get("xData")&&this.get("yData")||this._updateAxisData()?this.draw():this.fire("drawingComplete")},_setCanvas:function(){var e=this.get("graph"),t=e.get("graphic");this.set("graphic",t)},setAreaData:function(){var e=s.isNumber,t,n,r=this.get("graph"),i=r.get("width"),o=r.get("height"),u=this.get("xAxis"),a=this.get("yAxis"),f=this.get("xData").concat(),l=this.get("yData").concat(),c,h,p=u.getEdgeOffset(f.length,i),d=a.getEdgeOffset(l.length,o),v=this.get("styles").padding,m=v.left,g=v.top,y=i-(m+v.right+p),b=o-(g+v.bottom+d),w=[],E=[],S=u.get("maximum"),x=u.get("minimum"),T=a.get("maximum"),N=a.get("minimum"),C=y/(S-x),k=b/(T-N),L,A=this.get("direction"),O=0,M=[],_=[],D=this.get("xMarkerPlaneOffset"),P=this.get("yMarkerPlaneOffset"),H=this.get("graphic");H.set("width",i),H.set("height",o),L=f.length,p*=.5,d*=.5,A==="vertical"&&(l=l.reverse()),this._leftOrigin=Math.round((0-x)*C+m+p),this._bottomOrigin=Math.round(b+g+d),N<0&&(this._bottomOrigin=this._bottomOrigin-(0-N)*k);for(;O<L;++O)c=parseFloat(f[O]),h=parseFloat(l[O]),e(c)?t=(c-x)*C+m+p:t=NaN,e(h)?n=b+g+d-(h-N)*k:n=NaN,w.push(t),E.push(n),M.push({start:t-D,end:t+D}),_.push({start:n-P,end:n+P});this.set("xcoords",w),this.set("ycoords",E),this.set("xMarkerPlane",M),this.set("yMarkerPlane",_),this._dataLength=L},_getFirstValidIndex:function(e){var t,n=-1,r=e.length;while(!s.isNumber(t)&&n<r)n+=1,t=e[n];return n},_getLastValidIndex:function(e){var t,n=e.length,r=-1;while(!s.isNumber(t)&&n>r)n-=1,t=e[n];return n},draw:function(){var e=this.get("graph"),t=e.get("width"),n=e.get("height");if(this.get("rendered")&&isFinite(t)&&isFinite(n)&&t>0&&n>0&&(this.get("xData")&&this.get("yData")||this._updateAxisData())){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1,this.setAreaData(),this.get("xcoords")&&this.get("ycoords")&&this.drawSeries(),this._drawing=!1,this._callLater?this.draw():(this._toggleVisible(this.get("visible")),this.fire("drawingComplete"))}},_defaultPlaneOffset:4,_getDefaultStyles:function(){return{padding:{top:0,left:0,right:0,bottom:0}}},_defaultLineColors:["#426ab3","#d09b2c","#000000","#b82837","#b384b5","#ff7200","#779de3","#cbc8ba","#7ed7a6","#007a6c"],_defaultFillColors:["#6084d0","#eeb647","#6c6b5f","#d6484f","#ce9ed1","#ff9f3b","#93b7ff","#e0ddd0","#94ecba","#309687"],_defaultBorderColors:["#205096","#b38206","#000000","#94001e","#9d6fa0","#e55b00","#5e85c9","#adab9e","#6ac291","#006457"],_defaultSliceColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getDefaultColor:function(e,t){var n={line:this._defaultLineColors,fill:this._defaultFillColors,border:this._defaultBorderColors,slice:this._defaultSliceColors},r=n[t],i=r.length;return e=e||0,e>=i&&(e%=i),t=t||"fill",n[t][e]},_handleVisibleChange:function(e){this._toggleVisible(this.get("visible"))},getTotalValues:function(){var e=this.get("valueAxis").getTotalByKey(this.get("valueKey"));return e},destructor:function(){var t,n=this.get("markers");this.get("rendered")&&(this._xDataReadyHandle&&this._xDataReadyHandle.detach(),this._xDataUpdateHandle&&this._xDataUpdateHandle.detach(),this._yDataReadyHandle&&this._yDataReadyHandle.detach(),this._yDataUpdateHandle&&this._yDataUpdateHandle.detach(),this._xAxisChangeHandle.detach(),this._yAxisChangeHandle.detach(),this._stylesChangeHandle.detach(),this._widthChangeHandle.detach(),this._heightChangeHandle.detach(),this._visibleChangeHandle.detach());while(n&&n.length>0)t=n.shift(),t&&t instanceof e.Shape&&t.destroy();this._path&&(this._path.destroy(),this._path=null),this._lineGraphic&&(this._lineGraphic.destroy(),this._lineGraphic=null),this._groupMarker&&(this._groupMarker.destroy(),this._groupMarker=null)}},{ATTRS:{xDisplayName:{getter:function(){return this._xDisplayName||this.get("xKey")},setter:function(e){return this._xDisplayName=e.toString(),e}},yDisplayName:{getter:function(){return this._yDisplayName||this.get("yKey")},setter:function(e){return this._yDisplayName=e.toString(),e}},categoryDisplayName:{lazyAdd:!1,getter:function(){return this.get("direction")=="vertical"?this.get("yDisplayName"):this.get("xDisplayName")},setter:function(e){return this.get("direction")=="vertical"?this._yDisplayName=e:this._xDisplayName=e,e}},valueDisplayName:{lazyAdd:!1,getter:function(){return this.get("direction")=="vertical"?this.get("xDisplayName"):this.get("yDisplayName")},setter:function(e){return this.get("direction")=="vertical"?this._xDisplayName=e:this._yDisplayName=e,e}},type:{value:"cartesian"},order:{},graphOrder:{},xcoords:{},ycoords:{},chart:{readOnly:!0,getter:function(){return this.get("graph").get("chart")}},graph:{},xAxis:{},yAxis:{},xKey:{setter:function(e){return e.toString()}},yKey:{setter:function(e){return e.toString()}},xData:{},yData:{},rendered:{value:!1},width:{readOnly:!0,getter:function(){this.get("graph").get("width")}},height:{readOnly:!0,getter:function(){this.get("graph").get("height")}},visible:{value:!0},xMarkerPlane:{},yMarkerPlane:{},xMarkerPlaneOffset:{getter:function(){var e=this.get("styles").marker;return e&&e.width&&isFinite(e.width)?e.width*.5:this._defaultPlaneOffset}},yMarkerPlaneOffset:{getter:function(){var e=this.get("styles").marker;return e&&e.height&&isFinite(e.height)?e.height*.5:this._defaultPlaneOffset}},direction:{value:"horizontal"},groupMarkers:{getter:function(){return this._groupMarkers===undefined?this.get("graph").get("groupMarkers"):this._groupMarkers},setter:function(e){return this._groupMarkers=e,e}}}}),e.MarkerSeries=e.Base.create("markerSeries",e.CartesianSeries,[e.Plots],{drawSeries:function(){this.drawPlots()},_setStyles:function(t){return t.marker||(t={marker:t}),t=this._parseMarkerStyles(t),e.MarkerSeries.superclass._mergeStyles.apply(this,[t,this._getDefaultStyles()])},_getDefaultStyles:function(){var t=this._mergeStyles({marker:this._getPlotDefaults()},e.MarkerSeries.superclass._getDefaultStyles());return t}},{ATTRS:{type:{value:"marker"}}}),e.LineSeries=e.Base.create("lineSeries",e.CartesianSeries,[e.Lines],{drawSeries:function(){this.drawLines()},_setStyles:function(t){return t.line||(t={line:t}),e.LineSeries.superclass._setStyles.apply(this,[t])},_getDefaultStyles:function(){var t=this._mergeStyles({line:this._getLineDefaults()},e.LineSeries.superclass._getDefaultStyles());return t}},{ATTRS:{type:{value:"line"}}}),e.SplineSeries=e.Base.create("splineSeries",e.LineSeries,[e.CurveUtil,e.Lines],{drawSeries:function(){this.drawSpline()}},{ATTRS:{type:{value:"spline"}}}),e.StackedSplineSeries=e.Base.create("stackedSplineSeries",e.SplineSeries,[e.StackingUtil],{setAreaData:function(){e.StackedSplineSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)}},{ATTRS:{type:{value:"stackedSpline"}}}),e.StackedMarkerSeries=e.Base.create("stackedMarkerSeries",e.MarkerSeries,[e.StackingUtil],{setAreaData:function(){e.StackedMarkerSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)}},{ATTRS:{type:{value:"stackedMarker"}}}),e.ColumnSeries=e.Base.create("columnSeries",e.MarkerSeries,[e.Histogram],{_getMarkerDimensions:function(e,t,n,r){var i={left:e+r};return this._bottomOrigin>=t?(i.top=t,i.calculatedSize=this._bottomOrigin-i.top):(i.top=this._bottomOrigin,i.calculatedSize=t-this._bottomOrigin),i},updateMarkerState:function(t,n){if(this._markers&&this._markers[n]){var r=e.clone(this.get("styles").marker),i,s=this._getState(t),o=this.get("xcoords"),u=this.get("ycoords"),a=this._markers[n],f,l=this.get("graph"),c,h=l.seriesTypes[this.get("type")],p=h.length,d=0,v=0,m,g=0,y=[],b=this.get("order"),w;i=s=="off"||!r[s]?e.clone(r):e.clone(r[s]),i.fill.color=this._getItemColor(i.fill.color,n),i.border.color=this._getItemColor(i.border.color,n),w=this._getMarkerDimensions(o[n],u[n],r.width,v),i.height=w.calculatedSize,i.width=Math.min(this._maxSize,i.width),a.set(i);for(;g<p;++g)y[g]=o[n]+d,c=h[g].get("styles").marker,d+=Math.min(this._maxSize,c.width),b>g&&(v=d),v-=d/2;for(g=0;g<p;++g)f=h[g].get("markers"),f&&(m=f[n],m&&m!==undefined&&m.set("x",y[g]-d/2))}}},{ATTRS:{type:{value:"column"}}}),e.BarSeries=e.Base.create("barSeries",e.MarkerSeries,[e.Histogram],{_getMarkerDimensions:function(e,t,n,r){var i={top:t+r};return e>=this._leftOrigin?(i.left=this._leftOrigin,i.calculatedSize=e-i.left):(i.left=e,i.calculatedSize=this._leftOrigin-e),i},updateMarkerState:function(t,n){if(this._markers&&this._markers[n]){var r=e.clone(this.get("styles").marker),i,s=this._getState(t),o=this.get("xcoords"),u=this.get("ycoords"),a=this._markers[n],f,l=this.get("graph"),c=l.seriesTypes[this.get("type")],h=c.length,p,d=0,v=0,m,g=0,y=[],b=this.get("order"),w;i=s=="off"||!r[s]?r:r[s],i.fill.color=this._getItemColor(i.fill.color,n),i.border.color=this._getItemColor(i.border.color,n),w=this._getMarkerDimensions(o[n],u[n],r.height,v),i.width=w.calculatedSize,i.height=Math.min(this._maxSize,i.height),a.set(i);for(;g<h;++g)y[g]=u[n]+d,p=c[g].get("styles").marker,d+=Math.min(this._maxSize,p.height),b>g&&(v=d),v-=d/2;for(g=0;g<h;++g)f=c[g].get("markers"),f&&(m=f[n],m&&m!==undefined&&m.set("y",y[g]-d/2))}}},{ATTRS:{type:{value:"bar"},direction:{value:"vertical"}}}),e.AreaSeries=e.Base.create("areaSeries",e.CartesianSeries,[e.Fills],{drawSeries:function(){this.drawFill.apply(this,this._getClosingPoints())},_setStyles:function(t){return t.area||(t={area:t}),e.AreaSeries.superclass._setStyles.apply(this,[t])},_getDefaultStyles:function(){var t=this._mergeStyles({area:this._getAreaDefaults()},e.AreaSeries.superclass._getDefaultStyles());return t}},{ATTRS:{type:{value:"area"}}}),e.AreaSplineSeries=e.Base.create("areaSplineSeries",e.AreaSeries,[e.CurveUtil],{drawSeries:function(){this.drawAreaSpline()}},{ATTRS:{type:{value:"areaSpline"}}}),e.StackedAreaSplineSeries=e.Base.create("stackedAreaSplineSeries",e.AreaSeries,[e.CurveUtil,e.StackingUtil],{drawSeries:function(){this._stackCoordinates(),this.drawStackedAreaSpline()}},{ATTRS:{type:{value:"stackedAreaSpline"}}}),e.ComboSeries=e.Base.create("comboSeries",e.CartesianSeries,[e.Fills,e.Lines,e.Plots],{drawSeries:function(){this.get("showAreaFill")&&this.drawFill.apply(this,this._getClosingPoints()),this.get("showLines")&&this.drawLines(),this.get("showMarkers")&&this.drawPlots()},_toggleVisible:function(e){var t,n,r,i;this.get("showAreaFill")&&this._path&&this._path.set("visible",e),this.get("showLines")&&this._lineGraphic&&this._lineGraphic.set("visible",e);if(this.get("showMarkers")){t=this.get("markers");if(t){i=0,r=t.length;for(;i<r;++i)n=t[i],n&&n.set("visible",e)}}},_getDefaultStyles:function(){var t=e.ComboSeries.superclass._getDefaultStyles();return t.line=this._getLineDefaults(),t.marker=this._getPlotDefaults(),t.area=this._getAreaDefaults(),t}},{ATTRS:{type:{value:"combo"},showAreaFill:{value:!1},showLines:{value:!0},showMarkers:{value:!0},marker:{lazyAdd:!1,getter:function(){return this.get("styles").marker},setter:function(e){this.set("styles",{marker:e})}},line:{lazyAdd:!1,getter:function(){return this.get("styles").line},setter:function(e){this.set("styles",{line:e})}},area:{lazyAdd:!1,getter:function(){return this.get("styles").area},setter:function(e){this.set("styles",{area:e})}}}}),e.StackedComboSeries=e.Base.create("stackedComboSeries",e.ComboSeries,[e.StackingUtil],{setAreaData:function(){e.StackedComboSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)},drawSeries:function(){this.get("showAreaFill")&&this.drawFill.apply(this,this._getStackedClosingPoints()),this.get("showLines")&&this.drawLines(),this.get("showMarkers")&&this.drawPlots()}},{ATTRS:{type:{value:"stackedCombo"},showAreaFill:{value:!0}}}),e.ComboSplineSeries=e.Base.create("comboSplineSeries",e.ComboSeries,[e.CurveUtil],{drawSeries:function(){this.get("showAreaFill")&&this.drawAreaSpline(),this.get("showLines")&&this.drawSpline(),this.get("showMarkers")&&this.drawPlots()}},{ATTRS:{type:{value:"comboSpline"}}}),e.StackedComboSplineSeries=e.Base.create("stackedComboSplineSeries",e.StackedComboSeries,[e.CurveUtil],{drawSeries:function(){this.get("showAreaFill")&&this.drawStackedAreaSpline(),this.get("showLines")&&this.drawSpline(),this.get("showMarkers")&&this.drawPlots()}},{ATTRS:{type:{value:"stackedComboSpline"},showAreaFill:{value:!0}}}),e.StackedLineSeries=e.Base.create("stackedLineSeries",e.LineSeries,[e.StackingUtil],{setAreaData:function(){e.StackedLineSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)}},{ATTRS:{type:{value:"stackedLine"}}}),e.StackedAreaSeries=e.Base.create("stackedAreaSeries",e.AreaSeries,[e.StackingUtil],{setAreaData:function(){e.StackedAreaSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)},drawSeries:function(){this.drawFill.apply(this,this._getStackedClosingPoints())}},{ATTRS:{type:{value:"stackedArea"}}}),e.StackedColumnSeries=e.Base.create("stackedColumnSeries",e.ColumnSeries,[e.StackingUtil],{drawSeries:function(){if(this.get("xcoords").length<1)return;var t=s.isNumber,n=e.clone(this.get("styles").marker),r=n.width,i=n.height,o=this.get("xcoords"),u=this.get("ycoords"),a=0,f=o.length,l=u[0],c=this.get("type"),h=this.get("graph"),p=h.seriesTypes[c],d,v=this.get("order"),m=this.get("graphOrder"),g,y,b,w,E,S,x,T=v===0,N=f*r,C={width:[],height:[]},k=[],L=[],A=this.get("groupMarkers");s.isArray(n.fill.color)&&(b=n.fill.color.concat()),s.isArray(n.border.color)&&(w=n.border.color.concat()),this._createMarkerCache(),N>this.get("width")&&(d=this.width/N,r*=d,r=Math.max(r,1));if(!T){E=p[v-1],S=E.get("negativeBaseValues"),x=E.get("positiveBaseValues");if(!S||!x)T=!0,x=[],S=[]}else S=[],x=[];this.set("negativeBaseValues",S),this.set("positiveBaseValues",x);for(a=0;a<f;++a){g=o[a],l=u[a];if(!t(l)||!t(g)){T&&(S[a]=this._bottomOrigin,x[a]=this._bottomOrigin),this._markers.push(null);continue}T?(i=Math.abs(this._bottomOrigin-l),l<this._bottomOrigin?(x[a]=l,S[a]=this._bottomOrigin):l>this._bottomOrigin?(x[a]=this._bottomOrigin,S[a]=l,l-=i):(x[a]=l,S[a]=l)):l>this._bottomOrigin?(l+=S[a]-this._bottomOrigin,i=l-S[a],S[a]=l,l-=i):l<=this._bottomOrigin&&(l=x[a]-(this._bottomOrigin-l),i=x[a]-l,x[a]=l),!isNaN(i)&&i>0?(g-=r/2,A?(C.width[a]=r,C.height[a]=i,k.push(g),L.push(l)):(n.width=r,n.height=i,n.x=g,n.y=l,b&&(n.fill.color=b[a%b.length]),w&&(n.border.color=w[a%w.length]),y=this.getMarker(n,m,a))):A||this._markers.push(null)}A?this._createGroupMarker({fill:n.fill,border:n.border,dimensions:C,xvalues:k,yvalues:L,shape:n.shape}):this._clearMarkerCache()},updateMarkerState:function(t,n){if(this._markers&&this._markers[n]){var r,i,o=this._getState(t),u=this.get("xcoords"),a=this._markers[n],f=0,l,c;r=this.get("styles").marker,f=r.width*.5,i=o=="off"||!r[o]?e.clone(r):e.clone(r[o]),i.height=a.get("height"),i.x=u[n]-f,i.y=a.get("y"),i.id=a.get("id"),l=i.fill.color,c=i.border.color,s.isArray(l)?i.fill.color=l[n%l.length]:i.fill.color=this._getItemColor(i.fill.color,n),s.isArray(c)?i.border.color=c[n%c.length]:i.border.color=this._getItemColor(i.border.color,n),a.set(i)}},_getPlotDefaults:function(){var e={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:0,alpha:1},width:24,height:24,shape:"rect",padding:{top:0,left:0,right:0,bottom:0}};return e.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill"),e.border.color=this._getDefaultColor(this.get("graphOrder"),"border"),e}},{ATTRS:{type:{value:"stackedColumn"},negativeBaseValues:{value:null},positiveBaseValues:{value:null}}}),e.StackedBarSeries=e.Base.create("stackedBarSeries",e.BarSeries,[e.StackingUtil],{drawSeries:function(){if(this.get("xcoords").length<1)return;var t=s.isNumber,n=e.clone(this.get("styles").marker),r=n.width,i=n.height,o=this.get("xcoords"),u=this.get("ycoords"),a=0,f=o.length,l=u[0],c=this.get("type"),h=this.get("graph"),p=h.seriesTypes[c],d,v=this.get("order"),m=this.get("graphOrder"),g,y,b,w,E,S,x,T=v===0,N=f*i,C={width:[],height:[]},k=[],L=[],A=this.get("groupMarkers");s.isArray(n.fill.color)&&(S=n.fill.color.concat()),s.isArray(n.border.color)&&(x=n.border.color.concat()),this._createMarkerCache(),N>this.get("height")&&(d=this.height/N,i*=d,i=Math.max(i,1));if(!T){b=p[v-1],w=b.get("negativeBaseValues"),E=b.get("positiveBaseValues");if(!w||!E)T=!0,E=[],w=[]}else w=[],E=[];this.set("negativeBaseValues",w),this.set("positiveBaseValues",E);for(a=0;a<f;++a){l=u[a],g=o[a];if(!t(l)||!t(g)){T&&(E[a]=this._leftOrigin,w[a]=this._leftOrigin),this._markers.push(null);continue}T?(r=Math.abs(g-this._leftOrigin),g>this._leftOrigin?(E[a]=g,w[a]=this._leftOrigin,g-=r):g<this._leftOrigin?(E[a]=this._leftOrigin,w[a]=g):(E[a]=g,w[a]=this._leftOrigin)):g<this._leftOrigin?(g=w[a]-(this._leftOrigin-o[a]),r=w[a]-g,w[a]=g):g>=this._leftOrigin&&(g+=E[a]-this._leftOrigin,r=g-E[a],E[a]=g,g-=r),!isNaN(r)&&r>0?(l-=i/2,A?(C.width[a]=r,C.height[a]=i,k.push(g),L.push(l)):(n.width=r,n.height=i,n.x=g,n.y=l,S&&(n.fill.color=S[a%S.length]),x&&(n.border.color=x[a%x.length]),y=this.getMarker(n,m,a))):A||this._markers.push(null)}A?this._createGroupMarker({fill:n.fill,border:n.border,dimensions:C,xvalues:k,yvalues:L,shape:n.shape}):this._clearMarkerCache()},updateMarkerState:function(t,n){if(this._markers[n]){var r=this._getState(t),i=this.get("ycoords"),o=this._markers[n],u=this.get("styles").marker,a=u.height,f=r=="off"||!u[r]?e.clone(u):e.clone(u[r]),l,c;f.y=i[n]-a/2,f.x=o.get("x"),f.width=o.get("width"),f.id=o.get("id"),l=f.fill.color,c=f.border.color,s.isArray(l)?f.fill.color=l[n%l.length]:f.fill.color=this._getItemColor(f.fill.color,n),s.isArray(c)?f.border.color=c[n%c.length]:f.border.color=this._getItemColor(f.border.color,n),o.set(f)}},_getPlotDefaults:function(){var e={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:0,alpha:1},width:24,height:24,shape:"rect",padding:{top:0,left:0,right:0,bottom:0}};return e.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill"),e.border.color=this._getDefaultColor(this.get("graphOrder"),"border"),e}},{ATTRS:{type:{value:"stackedBar"},direction:{value:"vertical"},negativeBaseValues:{value:null},positiveBaseValues:{value:null}}}),e.PieSeries=e.Base.create("pieSeries",e.MarkerSeries,[],{_map:null,_image:null,_setMap:function(){var e="pieHotSpotMapi_"+Math.round(1e5*Math.random()),t=this.get("graph").get("contentBox"),n;if(this._image){t.removeChild(this._image);while(this._areaNodes&&this._areaNodes.length>0)n=this._areaNodes.shift(),this._map.removeChild(n);t.removeChild(this._map)}this._image=i.createElement("img"),this._image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==",t.appendChild(this._image),this._image.setAttribute("usemap","#"+e),this._image.style.zIndex=3,this._image.style.opacity=0,this._image.setAttribute("alt","imagemap"),this._map=i.createElement("map"),this._map.style.zIndex=5,t.appendChild(this._map),this._map.setAttribute("name",e),this._map.setAttribute("id",e),this._areaNodes=[]},_categoryDisplayName:null,_valueDisplayName:null,addListeners:function(){var t=this.get("categoryAxis"),n=this.get("valueAxis");t&&(t.after("dataReady",e.bind(this._categoryDataChangeHandler,this)),t.after("dataUpdate",e.bind(this._categoryDataChangeHandler,this))),n&&(n.after("dataReady",e.bind(this._valueDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._valueDataChangeHandler,this))),this.after("categoryAxisChange",this.categoryAxisChangeHandler),this.after("valueAxisChange",this.valueAxisChangeHandler),this.after("stylesChange",this._updateHandler)},validate:function(){this.draw(),this._renderered=!0},_categoryAxisChangeHandler:function(t){var n=this.get("categoryAxis");n.after("dataReady",e.bind(this._categoryDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._categoryDataChangeHandler,this))},_valueAxisChangeHandler:function(t){var n=this.get("valueAxis");n.after("dataReady",e.bind(this._valueDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._valueDataChangeHandler,this))},GUID:"pieseries",_categoryDataChangeHandler:function(e){this._rendered&&this.get("categoryKey")&&this.get("valueKey")&&this.draw()},_valueDataChangeHandler:function(e){this._rendered&&this.get("categoryKey")&&this.get("valueKey")&&this.draw()},draw:function(){var e=this.get("graph"),t=e.get("width"),n=e.get("height");if(isFinite(t)&&isFinite(n)&&t>0&&n>0){this._rendered=!0;if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1,this.drawSeries(),this._drawing=!1,this._callLater?this.draw():this.fire("drawingComplete")}},drawPlots:function(){var t=this.get("valueAxis").getDataByKey(this.get("valueKey")).concat(),n=this.get("categoryAxis").getDataByKey(this.get("categoryKey")).concat(),r=0,i=t.length,s=this.get("styles").marker,o=s.fill.colors,u=s.fill.alphas||["1"],a=s.border.colors,f=[s.border.weight],l=[s.border.alpha],c=f.concat(),h=a.concat(),p=l.concat(),d,v,m=s.padding,g=this.get("graph"),y=Math.min(g.get("width"),g.get("height")),b=y-(m.left+m.right),w=y-(m.top+m.bottom),E=-90,S=b/2,x=w/2,T=Math.min(S,x),N=0,C,k=0,L,A,O,M,_,D=this.get("graphOrder"),P=e.Graphic.NAME=="canvasGraphic";for(;N<i;++N)C=parseFloat(t[N]),t.push(C),isNaN(C)||(r+=C);d=o?o.concat():null,v=u?u.concat():null,this._createMarkerCache(),P&&(this._setMap(),this._image.width=b,this._image.height=w);for(N=0;N<i;N++)C=t[N],r===0?k=360/t.length:k=360*(C/r),d&&d.length<1&&(d=o.concat()),v&&v.length<1&&(v=u.concat()),c&&c.length<1&&(c=f.concat()),c&&h.length<1&&(h=a.concat()),p&&p.length<1&&(p=l.concat()),O=c?c.shift():null,L=h?h.shift():null,A=p?p.shift():null,E+=k,M={border:{color:L,weight:O,alpha:A},fill:{color:d?d.shift():this._getDefaultColor(N,"slice"),alpha:v?v.shift():null},type:"pieslice",arc:k,radius:T,startAngle:E,cx:S,cy:x,width:b,height:w},_=this.getMarker(M,D,N),P&&this._addHotspot(M,D,N);this._clearMarkerCache()},_addHotspot:function(e,t,n){var r=i.createElement("area"),s=1,o=e.cx,u=e.cy,a=e.arc,f=e.startAngle-a,l=e.startAngle,c=e.radius,h=o+Math.cos(f/180*Math.PI)*c,d=u+Math.sin(f/180*Math.PI)*c,v=o+Math.cos(l/180*Math.PI)*c,m=u+Math.sin(l/180*Math.PI)*c,g=Math.floor(a/10)-1,y=a/Math.floor(a/10)/180*Math.PI,b=Math.atan((d-u)/(h-o)),w=o+", "+u+", "+h+", "+d,E,S,x;for(s=1;s<=g;++s)x=y*s,E=Math.cos(b+x),S=Math.sin(b+x),f<=90?(w+=", "+(o+c*Math.cos(b+y*s)),w+=", "+(u+c*Math.sin(b+y*s))):(w+=", "+(o-c*Math.cos(b+y*s)),w+=", "+(u-c*Math.sin(b+y*s)));w+=", "+v+", "+m,w+=", "+o+", "+u,this._map.appendChild(r),r.setAttribute("class",p),r.setAttribute("id","hotSpot_"+t+"_"+n),r.setAttribute("shape","polygon"),r.setAttribute("coords",w),this._areaNodes.push(r)},updateMarkerState:function(e,t){if(this._markers[t]){var n=this._getState(e),r,i,s=this._markers[t],o=this.get("styles").marker;r=n=="off"||!o[n]?o:o[n],i=this._mergeStyles(r,{}),i.fill.color=i.fill.colors[t%i.fill.colors.length],i.fill.alpha=i.fill.alphas[t%i.fill.alphas.length],s.set(i)}},_createMarker:function(t,n,r){var i=this.get("graphic"),s,o=e.clone(t);return i.set("autoDraw",!1),s=i.addShape(o),s.addClass(p),s},_clearMarkerCache:function(){var e=this._markerCache.length,t=0,n;for(;t<e;++t)n=this._markerCache[t],n&&n.destroy();this._markerCache=[]},_getPlotDefaults:function(){var e={padding:{top:0,left:0,right:0,bottom:0},fill:{alphas:["1"]},border:{weight:0,alpha:1}};return e.fill.colors=this._defaultSliceColors,e.border.colors=this._defaultBorderColors,e},_defaultLineColors:["#426ab3","#d09b2c","#000000","#b82837","#b384b5","#ff7200","#779de3","#cbc8ba","#7ed7a6","#007a6c"],_defaultFillColors:["#6084d0","#eeb647","#6c6b5f","#d6484f","#ce9ed1","#ff9f3b","#93b7ff","#e0ddd0","#94ecba","#309687"],_defaultBorderColors:["#205096","#b38206","#000000","#94001e","#9d6fa0","#e55b00","#5e85c9","#adab9e","#6ac291","#006457"],_defaultSliceColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getDefaultColor:function(e,t){var n={line:this._defaultLineColors,fill:this._defaultFillColors,border:this._defaultBorderColors,slice:this._defaultSliceColors},r=n[t],i=r.length;return e=e||0,e>=i&&(e%=i),t=t||"fill",n[t][e]}},{ATTRS:{type:{value:"pie"},order:{},graph:{},categoryAxis:{value:null,validator:function(e){return e!==this.get("categoryAxis")}},valueAxis:{value:null,validator:function(e){return e!==this.get("valueAxis")}},categoryKey:{value:null,validator:function(e){return e!==this.get("categoryKey")}},valueKey:{value:null,validator:function(e){return e!==this.get("valueKey")}},categoryDisplayName:{setter:function(e){return this._categoryDisplayName=e,e},getter:function(){return this._categoryDisplayName||this.get("categoryKey")}},valueDisplayName:{setter:function(e){return this._valueDisplayName=e,e},getter:function(){return this._valueDisplayName||this.get("valueKey")}},slices:null}}),e.Gridlines=e.Base.create("gridlines",e.Base,[e.Renderer],{_path:null,remove:function(){var e=this._path;e&&e.destroy()},draw:function(){this.get("axis")&&this.get("graph")&&this._drawGridlines()},_drawGridlines:function(){var e,t=this.get("axis"),n=t.get("position"),r,i=0,s,o=this.get("direction"),u=this.get("graph"),a=u.get("width"),f=u.get("height"),l=this.get("styles").line,c=l.color,h=l.weight,p=l.alpha,d=o=="vertical"?this._verticalLine:this._horizontalLine;if(isFinite(a)&&isFinite(f)&&a>0&&f>0){if(n!="none"&&t&&t.get("tickPoints"))r=t.get("tickPoints"),s=r.length;else{r=[],s=t.get("styles").majorUnit.count;for(;i<s;++i)r[i]={x:a*(i/(s-1)),y:f*(i/(s-1))};i=0}e=u.get("gridlines"),e.set("width",a),e.set("height",f),e.set("stroke",{weight:h,color:c,opacity:p});for(;i<s;++i)d(e,r[i],a,f);e.end()}},_horizontalLine:function(e,t,n,r){e.moveTo(0,t.y),e.lineTo(n,t.y)},_verticalLine:function(e,t,n,r){e.moveTo(t.x,0),e.lineTo(t.x,r)},_getDefaultStyles:function(){var e={line:{color:"#f0efe9",weight:1,alpha:1}};return e}},{ATTRS:{direction:{},axis:{},graph:{}}}),e.Graph=e.Base.create("graph",e.Widget,[e.Renderer],{bindUI:function(){var e=this.get("boundingBox");e.setStyle("position","absolute"),this.after("widthChange",this._sizeChangeHandler),this.after("heightChange",this._sizeChangeHandler),this.after("stylesChange",this._updateStyles),this.after("groupMarkersChange",this._drawSeries)},syncUI:function(){var t,n,r,i=this.get("seriesCollection"),s,o=0,u=i?i.length:0,a=this.get("horizontalGridlines"),f=this.get("verticalGridlines");this.get("showBackground")&&(t=this.get("background"),n=this.get("contentBox"),r=this.get("styles").background,r.stroke=r.border,r.stroke.opacity=r.stroke.alpha,r.fill.opacity=r.fill.alpha,r.width=this.get("width"),r.height=this.get("height"),r.type=r.shape,t.set(r));for(;o<u;++o)s=i[o],s instanceof e.CartesianSeries&&s.render();a&&a instanceof e.Gridlines&&a.draw(),f&&f instanceof e.Gridlines&&f.draw()},seriesTypes:null,getSeriesByIndex:function(e){var t=this.get("seriesCollection"),n;return t&&t.length>e&&(n=t[e]),n},getSeriesByKey:function(e){var t=this._seriesDictionary,n;return t&&t.hasOwnProperty(e)&&(n=t[e]),n},addDispatcher:function(e){this._dispatchers||(this._dispatchers=[]),this._dispatchers.push(e)},_seriesCollection:null,_seriesDictionary:null,_parseSeriesCollection:function(t){if(!t)return;var n=t.length,r=0,i,s;this._seriesCollection=[],this._seriesDictionary={},this.seriesTypes=[];for(;r<n;++r){i=t[r];if(!(i instanceof e.CartesianSeries||i instanceof e.PieSeries)){this._createSeries(i);continue}this._addSeries(i)}n=this._seriesCollection.length;for(r=0;r<n;++r)i=this.get("seriesCollection")[r],s=i.get("direction")=="horizontal"?"yKey":"xKey",this._seriesDictionary[i.get(s)]=i},_addSeries:function(t){var n=t.get("type"),r=this.get("seriesCollection"),i=r.length,s=this.seriesTypes,o;t.get("graph")||t.set("graph",this),r.push(t),s.hasOwnProperty(n)||(this.seriesTypes[n]=[]),o=this.seriesTypes[n],t.set("graphOrder",i),t.set("order",o.length),o.push(t),this.addDispatcher(t),t.after("drawingComplete",e.bind(this._drawingCompleteHandler,this)),this.fire("seriesAdded",t)},_createSeries:function(t){var n=t.type,r=this.get("seriesCollection"),i=this.seriesTypes,s,o,u;t.graph=this,i.hasOwnProperty(n)||(i[n]=[]),s=i[n],t.graph=this,t.order=s.length,t.graphOrder=r.length,o=this._getSeries(t.type),u=new o(t),this.addDispatcher(u),u.after("drawingComplete",e.bind(this._drawingCompleteHandler,this)),s.push(u),r.push(u),this.get("rendered")&&u.render()},_seriesMap:{line:e.LineSeries,column:e.ColumnSeries,bar:e.BarSeries,area:e.AreaSeries,candlestick:e.CandlestickSeries,ohlc:e.OHLCSeries,stackedarea:e.StackedAreaSeries,stackedline:e.StackedLineSeries,stackedcolumn:e.StackedColumnSeries,stackedbar:e.StackedBarSeries,markerseries:e.MarkerSeries,spline:e.SplineSeries,areaspline:e.AreaSplineSeries,stackedspline:e.StackedSplineSeries,stackedareaspline:e.StackedAreaSplineSeries,stackedmarkerseries:e.StackedMarkerSeries,pie:e.PieSeries,combo:e.ComboSeries,stackedcombo:e.StackedComboSeries,combospline:e.ComboSplineSeries,stackedcombospline:e.StackedComboSplineSeries},_getSeries:function(e){var t;return s.isString(e)?t=this._seriesMap[e]:t=e,t},_markerEventHandler:function(e){var t=e.type,n=e.currentTarget,r=n.getAttribute("id").split("_"),i=this.getSeriesByIndex(r[1]),s=r[2];i.updateMarkerState(t,s)},_dispatchers:null,_updateStyles:function(){var e=this.get("styles").background,t=e.border;t.opacity=t.alpha,e.stroke=t,e.fill.opacity=e.fill.alpha,this.get("background").set(e),this._sizeChangeHandler()},_sizeChangeHandler:function(t){var n=this.get("horizontalGridlines"),r=this.get("verticalGridlines"),i=this.get("width"),s=this.get("height"),o=this.get("styles").background,u,a;o&&o.border&&(u=o.border.weight||0),this.get("showBackground")&&(a=this.get("background"),i&&s&&(a.set("width",i),a.set("height",s))),this._gridlines&&this._gridlines.clear(),n&&n instanceof e.Gridlines&&n.draw(),r&&r instanceof e.Gridlines&&r.draw(),this._drawSeries()},_drawSeries:function(){if(this._drawing){this._callLater=!0;return}var t,n,r,i=this.get("graphic");i.set("autoDraw",!1),this._callLater=!1,this._drawing=!0,t=this.get("seriesCollection"),n=0,r=t?t.length:0;for(;n<r;++n){t[n].draw();if((!t[n].get("xcoords")||!t[n].get("ycoords"))&&!t[n]instanceof e.PieSeries){this._callLater=!0;break}}this._drawing=!1,this._callLater&&this._drawSeries()},_drawingCompleteHandler:function(t){var n=t.currentTarget,r,i=e.Array.indexOf(this._dispatchers,n);i>-1&&this._dispatchers.splice(i,1),this._dispatchers.length<1&&(r=this.get("graphic"),r.get("autoDraw")||r._redraw(),this.fire("chartRendered"))},_getDefaultStyles:function(){var e={background:{shape:"rect",fill:{color:"#faf9f2"},border:{color:"#dad8c9",weight:1}}};return e},destructor:function(){this._graphic&&(this._graphic.destroy(),this._graphic=null),this._background&&(this._background.get("graphic").destroy(),this._background=null),this._gridlines&&(this._gridlines.get("graphic").destroy(),this._gridlines=null)}},{ATTRS:{x:{setter:function(e){return this.get("boundingBox").setStyle("left",e+"px"),e}},y:{setter:function(e){return this.get("boundingBox").setStyle("top",e+"px"),e}},chart:{},seriesCollection:{getter:function(){return this._seriesCollection},setter:function(e){return this._parseSeriesCollection(e),this._seriesCollection}},showBackground:{value:!0},seriesDictionary:{readOnly:!0,getter:function(){return this._seriesDictionary}},horizontalGridlines:{value:null,setter:function(t){var n=this.get("horizontalGridlines");n&&n instanceof e.Gridlines&&n.remove();if(t instanceof e.Gridlines)return n=t,t.set("graph",this),t;if(t&&t.axis)return n=new e.Gridlines({direction:"horizontal",axis:t.axis,graph:this,styles:t.styles}),n}},verticalGridlines:{value:null,setter:function(t){var n=this.get("verticalGridlines");n&&n instanceof e.Gridlines&&n.remove();if(t instanceof e.Gridlines)return n=t,t.set("graph",this),t;if(t&&t.axis)return n=new e.Gridlines({direction:"vertical",axis:t.axis,graph:this,styles:t.styles}),n}},background:{getter:function(){return this._background||(this._backgroundGraphic=new e.Graphic({render:this.get("contentBox")}),this._backgroundGraphic.get("node").style.zIndex=0,this._background=this._backgroundGraphic.addShape({type:"rect"})),this._background}},gridlines:{readOnly:!0,getter:function(){return this._gridlines||(this._gridlinesGraphic=new e.Graphic({render:this.get("contentBox")}),this._gridlinesGraphic.get("node").style.zIndex=1,this._gridlines=this._gridlinesGraphic.addShape({type:"path"})),this._gridlines}},graphic:{readOnly:!0,getter:function(){return this._graphic||(this._graphic=new e.Graphic({render:this.get("contentBox")}),this._graphic.get("node").style.zIndex=2,this._graphic.set("autoDraw",!1)),this._graphic}},groupMarkers:{value:!1}}}),O.ATTRS={dataProvider:{lazyAdd:!1,valueFn:function(){var e=[];return this._seriesKeysExplicitlySet||(this._seriesKeys=this._buildSeriesKeys(e)),e},setter:function(e){var t=this._setDataValues(e);return this._seriesKeysExplicitlySet||(this._seriesKeys=this._buildSeriesKeys(t)),t}},seriesKeys:{getter:function(){return this._seriesKeys},setter:function(e){return this._seriesKeysExplicitlySet=!0,this._seriesKeys=e,e}},ariaLabel:{value:"Chart Application",setter:function(e){var t=this.get("contentBox");return t&&t.setAttribute("aria-label",e),e}},ariaDescription:{value:"Use the up and down keys to navigate between series. Use the left and right keys to navigate through items in a series.",setter:function(e){return this._description&&(this._description.setContent(""),this._description.appendChild(i.createTextNode(e))),e}},tooltip:{valueFn:"_getTooltip",setter:function(e){return this._updateTooltip(e)}},categoryKey:{value:"category"},categoryType:{value:"category"},interactionType:{value:"marker"},axesCollection:{},graph:{valueFn:"_getGraph"},groupMarkers:{value:!1}},O.prototype={_groupMarkersChangeHandler:function(e){var t=this.get("graph"),n=e.newVal;t&&t.set("groupMarkers",n)},_itemRendered:function(t){this._itemRenderQueue=this._itemRenderQueue.splice(1+e.Array.indexOf(this._itemRenderQueue,t.currentTarget),1),this._itemRenderQueue.length<1&&this._redraw()},_getGraph:function(){var t=new e.Graph({chart:this,groupMarkers:this.get("groupMarkers")});return t.after("chartRendered",e.bind(function(e){this.fire("chartRendered")},this)),t},getSeries:function(e){var t=null,n=this.get("graph");return n&&(s.isNumber(e)?t=n.getSeriesByIndex(e):t=n.getSeriesByKey(e)),t},getAxisByKey:function(e){var t,n=this.get("axes");return n&&n.hasOwnProperty(e)&&(t=n[e]),t},getCategoryAxis:function(){var e,t=this.get("categoryKey"),n=this.get("axes");return n.hasOwnProperty(t)&&(e=n[t]),e},_direction:"horizontal",_dataProvider:null,_setDataValues:function(e){if(s.isArray(e[0])){var t,n=[],r=e[0],i=0,o=r.length,u,a=e.length;for(;i<o;++i){t={category:r[i]};for(u=1;u<a;++u)t["series"+u]=e[u][i];n[i]=t}return n}return e},_seriesCollection:null,_setSeriesCollection:function(e){this._seriesCollection=e},_getAxisClass:function(e){return this._axisClass[e]},_axisClass:{stacked:e.StackedAxis,numeric:e.NumericAxis,category:e.CategoryAxis,time:e.TimeAxis},_axes:null,initializer:function(){this._itemRenderQueue=[],this._seriesIndex=-1,this._itemIndex=-1,this.after("dataProviderChange",this._dataProviderChangeHandler)},renderUI:function(){var e=this.get("tooltip"),t=this.get("boundingBox"),n=this.get("contentBox");t.setStyle("position","absolute"),n.setStyle("position","absolute"),this._addAxes(),this._addSeries(),e&&e.show&&this._addTooltip(),this._setAriaElements(t,n)},_setAriaElements:function(e,t){var n=this._getAriaOffscreenNode(),r=this.get("id")+"_description",s=this._getAriaOffscreenNode();t.set("tabIndex",0),t.set("role","img"),t.setAttribute("aria-label",this.get("ariaLabel")),t.setAttribute("aria-describedby",r),n.set("id",r),n.set("tabIndex",-1),n.appendChild(i.createTextNode(this.get("ariaDescription"))),s.set("id","live-region"),s.set("aria-live","polite"),s.set("aria-atomic","true"),s.set("role","status"),e.setAttribute("role","application"),e.appendChild(n),e.appendChild(s),this._description=n,this._liveRegion=s},_getAriaOffscreenNode:function(){var t=e.Node.create("<div></div>"),n=e.UA.ie,r=n&&n<8?"rect(1px 1px 1px 1px)":"rect(1px, 1px, 1px, 1px)";return t.setStyle("position","absolute"),t.setStyle("height","1px"),t.setStyle("width","1px"),t.setStyle("overflow","hidden"),t.setStyle("clip",r),t},syncUI:function(){this._redraw()},bindUI:function(){this.after("tooltipChange",e.bind(this._tooltipChangeHandler,this)),this.after("widthChange",this._sizeChanged),this.after("heightChange",this._sizeChanged),this.after("groupMarkersChange",this._groupMarkersChangeHandler);var t=this.get("tooltip"),n="mouseout",o="mouseover",u=this.get("contentBox"),a=this.get("interactionType"),f=0,l,c="."+p,h=r&&"ontouchstart"in r&&!(e.UA.chrome&&e.UA.chrome<6);e.on("keydown",e.bind(function(e){var t=e.keyCode,n=parseFloat(t),r;n>36&&n<41&&(e.halt(),r=this._getAriaMessage(n),this._liveRegion.setContent(""),this._liveRegion.appendChild(i.createTextNode(r)))},this),this.get("contentBox")),a=="marker"?(n=t.hideEvent,o=t.showEvent,h?(e.delegate("touchend",e.bind(this._markerEventDispatcher,this),u,c),e.on("touchend",e.bind(function(e){e.halt(!0),this._activeMarker&&(this._activeMarker=null,this.hideTooltip(e))},this))):(e.delegate("mouseenter",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("mousedown",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("mouseup",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("mouseleave",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("click",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("mousemove",e.bind(this._positionTooltip,this),u,c))):a=="planar"&&(h?this._overlay.on("touchend",e.bind(this._planarEventDispatcher,this)):(this._overlay.on("mousemove",e.bind(this._planarEventDispatcher,this)),this.on("mouseout",this.hideTooltip)));if(t){this.on("markerEvent:touchend",e.bind(function(e){var n=e.series.get("markers")[e.index];this._activeMarker&&n===this._activeMarker?(this._activeMarker=null,this.hideTooltip(e)):(this._activeMarker=n,t.markerEventHandler.apply(this,[e]))},this));if(n&&o&&n==o)this.on(a+"Event:"+n,this.toggleTooltip);else{o&&this.on(a+"Event:"+o,t[a+"EventHandler"]);if(n){if(s.isArray(n)){l=n.length;for(;f<l;++f)this.on(a+"Event:"+n[f],this.hideTooltip)}this.on(a+"Event:"+n,this.hideTooltip)}}}},_markerEventDispatcher:function(e){var t=e.type,n=this.get("contentBox"),r=e.currentTarget,i=r.getAttribute("id").split("_"),s=i.pop(),o=i.pop(),u=this.getSeries(parseInt(o,10)),a=this.getSeriesItems(u,s),f=e&&e.hasOwnProperty("changedTouches"),l=f?e.changedTouches[0].pageX:e.pageX,c=f?e.changedTouches[0].pageY:e.pageY,h=l-n.getX(),p=c-n.getY();t=="mouseenter"?t="mouseover":t=="mouseleave"&&(t="mouseout"),u.updateMarkerState(t,s),e.halt(),this.fire("markerEvent:"+t,{originEvent:e,pageX:l,pageY:c,categoryItem:a.category,valueItem:a.value,node:r,x:h,y:p,series:u,index:s,seriesIndex:o})},_dataProviderChangeHandler:function(t){var n=t.newVal,r,i,s;this._seriesIndex=-1,this._itemIndex=-1,this instanceof e.CartesianChart&&(this.set("axes",this.get("axes")),this.set("seriesCollection",this.get("seriesCollection"))),r=this.get("axes");if(r)for(i in r)r.hasOwnProperty(i)&&(s=r[i],s instanceof e.Axis&&(s.get("position")!="none"&&this._addToAxesRenderQueue(s),s.set("dataProvider",n)))},toggleTooltip:function(e){var t=this.get("tooltip");t.visible?this.hideTooltip():t.markerEventHandler.apply(this,[e])},_showTooltip:function(e,t,n){var r=this.get("tooltip"),i=r.node;e&&(r.visible=!0,r.setTextFunction(i,e),i.setStyle("top",n+"px"),i.setStyle("left",t+"px"),i.setStyle("visibility","visible"))},_positionTooltip:function(e){var t=this.get("tooltip"),n=t.node,r=this.get("contentBox"),i=e.pageX+10-r.getX(),s=e.pageY+10-r.getY();n&&(n.setStyle("left",i+"px"),n.setStyle("top",s+"px"))},hideTooltip:function(){var e=this.get("tooltip"),t=e.node;e.visible=!1,t.set("innerHTML",""),t.setStyle("left",-1e4),t.setStyle("top",-1e4),t.setStyle("visibility","hidden")},_addTooltip:function(){var e=this.get("tooltip"),t=this.get("id")+"_tooltip",n=this.get("contentBox"),r=i.getElementById(t);r&&n.removeChild(r),e.node.set("id",t),e.node.setStyle("visibility","hidden"),n.appendChild(e.node)},_updateTooltip:function(t){var n=this.get("tooltip")||this._getTooltip(),r,i,o,u={markerLabelFunction:"markerLabelFunction",planarLabelFunction:"planarLabelFunction",setTextFunction:"setTextFunction",showEvent:"showEvent",hideEvent:"hideEvent",markerEventHandler:"markerEventHandler",planarEventHandler:"planarEventHandler",show:"show"};if(s.isObject(t)){i=t.styles,o=e.one(t.node)||n.node;if(i)for(r in i)i.hasOwnProperty(r)&&o.setStyle(r,i[r]);for(r in u)t.hasOwnProperty(r)&&(n[r]=t[r]);n.node=o}return n},_getTooltip:function(){var t=i.createElement("div"),n=h("chart-tooltip"),r={setTextFunction:this._setText,markerLabelFunction:this._tooltipLabelFunction,planarLabelFunction:this._planarLabelFunction,show:!0,hideEvent:"mouseout",showEvent:"mouseover",markerEventHandler:function(e){var t=this.get("tooltip"),n=t.markerLabelFunction.apply(this,[e.categoryItem,e.valueItem,e.index,e.series,e.seriesIndex]);this._showTooltip(n,e.x+10,e.y+10)},planarEventHandler:function(e){var t=this.get("tooltip"),n,r=this.get("categoryAxis");n=t.planarLabelFunction.apply(this,[r,e.valueItem,e.index,e.items,e.seriesIndex]),this._showTooltip(n,e.x+10,e.y+10)}};return t=e.one(t),t.set("id",this.get("id")+"_tooltip"),t.setStyle("fontSize","85%"),t.setStyle("opacity","0.83"),t.setStyle("position","absolute"),t.setStyle("paddingTop","2px"),t.setStyle("paddingRight","5px"),t.setStyle("paddingBottom","4px"),t.setStyle("paddingLeft","2px"),t.setStyle("backgroundColor","#fff"),t.setStyle("border","1px solid #dbdccc"),t.setStyle("pointerEvents","none"),t.setStyle("zIndex",3),t.setStyle("whiteSpace","noWrap"),t.setStyle("visibility","hidden"),t.addClass(n),r.node=e.one(t),r},_planarLabelFunction:function(e,t,n,r,o){var u=i.createElement("div"),a,f=0,l=r.length,c,h,p,d;e&&(h=e.get("labelFunction").apply(this,[e.getKeyValueAt(this.get("categoryKey"),n),e.get("labelFormat")]),s.isObject(h)||(h=i.createTextNode(h)),u.appendChild(h));for(;f<l;++f)d=r[f],d.get("visible")&&(a=t[f],c=a.axis,p=c.get("labelFunction").apply(this,[c.getKeyValueAt(a.key,n),c.get("labelFormat")]),u.appendChild(i.createElement("br")),u.appendChild(i.createTextNode(a.displayName)),u.appendChild(i.createTextNode(": ")),s.isObject(p)||(p=i.createTextNode(p)),u.appendChild(p));return u},_tooltipLabelFunction:function(e,t,n,r,o){var u=i.createElement("div"),a=e.axis.get("labelFunction").apply(this,[e.value,e.axis.get("labelFormat")]),f=t.axis.get("labelFunction").apply(this,[t.value,t.axis.get("labelFormat")]);return u.appendChild(i.createTextNode(e.displayName)),u.appendChild(i.createTextNode(": ")),s.isObject(a)||(a=i.createTextNode(a)),u.appendChild(a),u.appendChild(i.createElement("br")),u.appendChild(i.createTextNode(t.displayName)),u.appendChild(i.createTextNode(": ")),s.isObject(f)||(f=i.createTextNode(f)),u.appendChild(f),u},_tooltipChangeHandler:function(e){if(this.get("tooltip")){var t=this.get("tooltip"),n=t.node,r=t.show,i=this.get("contentBox");n&&r&&(i.contains(n)||this._addTooltip())}},_setText:function(e,t){e.setContent(""),s.isNumber(t)?t+="":t||(t=""),o(t)&&(t=i.createTextNode(t)),e.appendChild(t)},_getAllKeys:function(e){var t=0,n=e.length,r,i,s={};for(;t<n;++t){r=e[t];for(i in r)r.hasOwnProperty(i)&&(s[i]=!0)}return s},_buildSeriesKeys:function(e){var t,n=this.get("categoryKey"),r=[],i;if(this._seriesKeysExplicitlySet)return this._seriesKeys;t=this._getAllKeys(e);for(i in t)t.hasOwnProperty(i)&&i!=n&&r.push(i);return r}},e.ChartBase=O,e.CartesianChart=e.Base.create("cartesianChart",e.Widget,[e.ChartBase],{renderUI:function(){var t=this.get("boundingBox"),n=this.get("contentBox"),r=this.get("tooltip"),s,o=h("overlay");t.setStyle("position","absolute"),n.setStyle("position","absolute"),this._addAxes(),this._addGridlines(),this._addSeries(),r&&r.show&&this._addTooltip(),this.get("styles"),this.get("interactionType")=="planar"&&(s=i.createElement("div"),this.get("contentBox").appendChild(s),this._overlay=e.one(s),this._overlay.set("id",this.get("id")+"_overlay"),this._overlay.setStyle("position","absolute"),this._overlay.setStyle("background","#fff"),this._overlay.setStyle("opacity",0),this._overlay.addClass(o),this._overlay.setStyle("zIndex",4)),this._setAriaElements(t,n),this._redraw()},_planarEventDispatcher:function(e){var t=this.get("graph"),n=this.get("boundingBox"),r=t.get("contentBox"),i=e&&e.hasOwnProperty("changedTouches"),s=i?e.changedTouches[0].pageX:e.pageX,o=i?e.changedTouches[0].pageY:e.pageY,u=s-n.getX(),a=o-n.getY(),f={x:s-r.getX(),y:o-r.getY()},l=t.get("seriesCollection"),c,h=0,p,d=this._selectedIndex,v,m=[],g=[],y=[],b=this.get("direction"),w,E,S,x,T,N,C;e.halt(!0),b=="horizontal"?(E="x",S="y"):(S="x",E="y"),x=f[E];if(l){N=l.length;while(h<N&&!T)l[h]&&(T=l[h].get(E+"MarkerPlane")),h++}if(T){N=T.length;for(h=0;h<N;++h)if(x<=T[h].end&&x>=T[h].start){p=h;break}N=l.length;for(h=0;h<N;++h)c=l[h],C=c.get(S+"coords"),w=c.get("markers"),w&&!isNaN(d)&&d>-1&&c.updateMarkerState("mouseout",d),C&&C[p]>-1&&(w&&!isNaN(p)&&p>-1&&c.updateMarkerState("mouseover",p),v=this.getSeriesItems(c,p),g.push(v.category),y.push(v.value),m.push(c));this._selectedIndex=p,p>-1?this.fire("planarEvent:mouseover",{categoryItem:g,valueItem:y,x:u,y:a,pageX:s,pageY:o,items:m,index:p,originEvent:e}):this.fire("planarEvent:mouseout")}},_type:"combo",_itemRenderQueue:null,_addToAxesRenderQueue:function(t){this._itemRenderQueue||(this._itemRenderQueue=[]),e.Array.indexOf(this._itemRenderQueue,t)<0&&this._itemRenderQueue.push(t)},_addToAxesCollection:function(e,t){var n=this.get(e+"AxesCollection");n||(n=[],this.set(e+"AxesCollection",n)),n.push(t)},_getDefaultSeriesCollection:function(){var e,t=this.get("dataProvider");return t&&(e=this._parseSeriesCollection()),e},_parseSeriesCollection:function(t){var n=this.get("direction"),r=[],i,s,o=[],u,a=this.get("seriesKeys").concat(),f,l,c,h=this.get("type"),p,d,v,m,g=[],y=this.get("categoryKey"),b=this.get("showMarkers"),w=this.get("showAreaFill"),E=this.get("showLines");t=t||[],n=="vertical"?(i="yAxis",d="yKey",s="xAxis",v="xKey"):(i="xAxis",d="xKey",s="yAxis",v="yKey"),c=t.length;while(t&&t.length>0)u=t.shift(),p=this._getBaseAttribute(u,v),p?(l=e.Array.indexOf(a,p),l>-1?(a.splice(l,1),o.push(p),r.push(u)):g.push(u)):g.push(u);while(g.length>0)u=g.shift(),a.length>0?(p=a.shift(),this._setBaseAttribute(u,v,p),o.push(p),r.push(u)):u instanceof e.CartesianSeries&&u.destroy(!0);a.length>0&&(o=o.concat(a)),c=o.length;for(f=0;f<c;++f){u=r[f]||{type:h};if(u instanceof e.CartesianSeries){this._parseSeriesAxes(u);continue}u[d]=u[d]||y,u[v]=u[v]||a.shift(),u[i]=this._getCategoryAxis(),u[s]=this._getSeriesAxis(u[v]),u.type=u.type||h,u.direction=u.direction||n;if(u.type=="combo"||u.type=="stackedcombo"||u.type=="combospline"||u.type=="stackedcombospline")w!==null&&(u.showAreaFill=u.showAreaFill!==null&&u.showAreaFill!==undefined?u.showAreaFill:w),b!==null&&(u.showMarkers=u.showMarkers!==null&&u.showMarkers!==undefined?u.showMarkers:b),E!==null&&(u.showLines=u.showLines!==null&&u.showLines!==undefined?u.showLines:E);r[f]=u}return r&&(m=this.get("graph"),m.set("seriesCollection",r),r=m.get("seriesCollection")),r},_parseSeriesAxes:function(t){var n=this.get("axes"),r=t.get("xAxis"),i=t.get("yAxis"),o=e.Axis,u;r&&!(r instanceof o)&&s.isString(r)&&n.hasOwnProperty(r)&&(u=n[r],u instanceof o&&t.set("xAxis",u)),i&&!(i instanceof o)&&s.isString(i)&&n.hasOwnProperty(i)&&(u=n[i],u instanceof o&&t.set("yAxis",u))},_getCategoryAxis:function(){var e,t=this.get("axes"),n=this.get("categoryAxisName")||this.get("categoryKey");return e=t[n],e},_getSeriesAxis:function(e,t){var n=this.get("axes"),r,i,s;if(n)if(t&&n.hasOwnProperty(t))s=n[t];else for(r in n)if(n.hasOwnProperty(r)){i=n[r].get("keys");if(i&&i.hasOwnProperty(e)){s=n[r];break}}return s},_getBaseAttribute:function(t,n){return t instanceof e.Base?t.get(n):t.hasOwnProperty(n)?t[n]:null},_setBaseAttribute:function(t,n,r){t instanceof e.Base?t.set(n,r):t[n]=r},_setAxes:function(t){var n=this._parseAxes(t),r={},i={edgeOffset:"edgeOffset",position:"position",overlapGraph:"overlapGraph",labelFunction:"labelFunction",labelFunctionScope:"labelFunctionScope",labelFormat:"labelFormat",appendLabelFunction:"appendLabelFunction",appendTitleFunction:"appendTitleFunction",maximum:"maximum",minimum:"minimum",roundingMethod:"roundingMethod",alwaysShowZero:"alwaysShowZero",title:"title",width:"width",height:"height"},s=this.get("dataProvider"),o,u,a,f,l,c,h,p,d;for(u in n)if(n.hasOwnProperty(u)){c=n[u];if(c instanceof e.Axis)f=c;else{f=null,p={},p.dataProvider=c.dataProvider||s,p.keys=c.keys,c.hasOwnProperty("roundingUnit")&&(p.roundingUnit=c.roundingUnit),a=c.position,c.styles&&(p.styles=c.styles),p.position=c.position;for(o in i)i.hasOwnProperty(o)&&c.hasOwnProperty(o)&&(p[o]=c[o]);t&&(f=this.getAxisByKey(u)),f&&f instanceof e.Axis?(l=f.get("position"),a!=l&&(l!="none"&&(d=this.get(l+"AxesCollection"),d.splice(e.Array.indexOf(d,f),1)),a!="none"&&this._addToAxesCollection(a,f)),f.setAttrs(p)):(h=this._getAxisClass(c.type),f=new h(p),f.after("axisRendered",e.bind(this._itemRendered,this)))}f&&(d=this.get(a+"AxesCollection"),d&&e.Array.indexOf(d,f)>0&&f.set("overlapGraph",!1),r[u]=f)}return r},_addAxes:function(){var t=this.get("axes"),n,r,i,s=this.get("width"),o=this.get("height"),u=e.Node.one(this._parentNode);this._axesCollection||(this._axesCollection=[]);for(n in t)t.hasOwnProperty(n)&&(r=t[n],r instanceof e.Axis&&(s||(this.set("width",u.get("offsetWidth")),s=this.get("width")),o||(this.set("height",u.get("offsetHeight")),o=this.get("height")),this._addToAxesRenderQueue(r),i=r.get("position"),this.get(i+"AxesCollection")?this.get(i+"AxesCollection").push(r):this.set(i+"AxesCollection",[r]),this._axesCollection.push(r),r.get("keys").hasOwnProperty(this.get("categoryKey"))&&this.set("categoryAxis",r),r.render(this.get("contentBox"))))},_addSeries:function(){var e=this.get("graph"),t=this.get("seriesCollection");e.render(this.get("contentBox"))},_addGridlines:function(){var t=this.get("graph"),n=this.get("horizontalGridlines"),r=this.get("verticalGridlines"),i=this.get("direction"),s=this.get("leftAxesCollection"),o=this.get("rightAxesCollection"),u=this.get("bottomAxesCollection"),a=this.get("topAxesCollection"),f,l=this.get("categoryAxis"),c,h;this._axesCollection&&(f=this._axesCollection.concat(),f.splice(e.Array.indexOf(f,l),1)),n&&(s&&s[0]?c=s[0]:o&&o[0]?c=o[0]:c=i=="horizontal"?l:f[0],!this._getBaseAttribute(n,"axis")&&c&&this._setBaseAttribute(n,"axis",c),this._getBaseAttribute(n,"axis")&&t.set("horizontalGridlines",n)),r&&(u&&u[0]?h=u[0]:a&&a[0]?h=a[0]:h=i=="vertical"?l:f[0],!this._getBaseAttribute(r,"axis")&&h&&this._setBaseAttribute(r,"axis",h),this._getBaseAttribute(r,"axis")&&t.set("verticalGridlines",r))},_getDefaultAxes:function(){var e;return this.get("dataProvider")&&(e=this._parseAxes()),e},_parseAxes:function(t){var n=this.get("categoryKey"),r,i,o,u={},a=[],f=this.get("categoryAxisName")||this.get("categoryKey"),l=this.get("valueAxisName"),c=this.get("seriesKeys").concat(),h,p,d,v,m,g=this.get("direction"),y,b,w=[],E=this.get("stacked")?"stacked":"numeric";g=="vertical"?(y="bottom",b="left"):(y="left",b="bottom");if(t)for(h in t)if(t.hasOwnProperty(h)){r=t[h],o=this._getBaseAttribute(r,"keys"),i=this._getBaseAttribute(r,"type");if(i=="time"||i=="category")f=h,this.set("categoryAxisName",h),s.isArray(o)&&o.length>0&&(n=o[0],this.set("categoryKey",n)),u[h]=r;else if(h==f)u[h]=r;else{u[h]=r;if(h!=l&&o&&s.isArray(o)){v=o.length;for(d=0;d<v;++d)a.push(o[d]);w.push(u[h])}this._getBaseAttribute(u[h],"type")||this._setBaseAttribute(u[h],"type",E),this._getBaseAttribute(u[h],"position")||this._setBaseAttribute(u[h],"position",this._getDefaultAxisPosition(u[h],w,y))}}m=e.Array.indexOf(c,n),m>-1&&c.splice(m,1),p=a.length;for(h=0;h<p;++h)m=e.Array.indexOf(c,a[h]),m>-1&&c.splice(m,1);return u.hasOwnProperty(f)||(u[f]={}),this._getBaseAttribute(u[f],"keys")||this._setBaseAttribute(u[f],"keys",[n]),this._getBaseAttribute(u[f],"position")||this._setBaseAttribute(u[f],"position",b),this._getBaseAttribute(u[f],"type")||this._setBaseAttribute(u[f],"type",this.get("categoryType")),!u.hasOwnProperty(l)&&c&&c.length>0&&(u[l]={keys:c},w.push(u[l])),a.length>0&&(c.length>0?c=a.concat(c):c=a),u.hasOwnProperty(l)&&(this._getBaseAttribute(u[l],"position")||this._setBaseAttribute(u[l],"position",this._getDefaultAxisPosition(u[l],w,y)),this._setBaseAttribute(u[l],"type",E),this._setBaseAttribute(u[l],"keys",c)),this._seriesKeysExplicitlySet||(this._seriesKeys=c),u},_getDefaultAxisPosition:function(t,n,r){var i=this.get("direction"),s=e.Array.indexOf(n,t);return n[s-1]&&n[s-1].position&&(i=="horizontal"?n[s-1].position=="left"?r="right":n[s-1].position=="right"&&(r="left"):n[s-1].position=="bottom"?r="top":r="bottom"),r},getSeriesItems:function(e,t){var n=e.get("xAxis"),r=e.get("yAxis"),i=e.get("xKey"),s=e.get("yKey"),o,u;return this.get("direction")=="vertical"?(o={axis:r,key:s,value:r.getKeyValueAt(s,t)},u={axis:n,key:i,value:n.getKeyValueAt(i,t)}):(u={axis:r,key:s,value:r.getKeyValueAt(s,t)},o={axis:n,key:i,value:n.getKeyValueAt(i,t)}),o.displayName=e.get("categoryDisplayName"),u.displayName=e.get("valueDisplayName"),o.value=o.axis.getKeyValueAt(o.key,t),u.value=u.axis.getKeyValueAt(u.key,t),{category:o,value:u}},_sizeChanged:function(e){if(this._axesCollection){var t=this._axesCollection,n=0,r=t.length;for(;n<r;++n)this._addToAxesRenderQueue(t[n]);this._redraw()}},_getTopOverflow:function(e,t,n){var r=0,i,s=0,o;if(e){i=e.length;for(;r<i;++r)o=e[r],s=Math.max(s,Math.abs(o.getMaxLabelBounds().top)-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}if(t){r=0,i=t.length;for(;r<i;++r)o=t[r],s=Math.max(s,Math.abs(o.getMaxLabelBounds().top)-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}return s},_getRightOverflow:function(e,t,n){var r=0,i,s=0,o;if(e){i=e.length;for(;r<i;++r)o=e[r],s=Math.max(s,o.getMaxLabelBounds().right-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}if(t){r=0,i=t.length;for(;r<i;++r)o=t[r],s=Math.max(s,o.getMaxLabelBounds().right-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}return s},_getLeftOverflow:function(e,t,n){var r=0,i,s=0,o;if(e){i=e.length;for(;r<i;++r)o=e[r],s=Math.max(s,Math.abs(o.getMinLabelBounds().left)-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}if(t){r=0,i=t.length;for(;r<i;++r)o=t[r],s=Math.max(s,Math.abs(o.getMinLabelBounds().left)-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}return s},_getBottomOverflow:function(e,t,n){var r=0,i,s=0,o;if(e){i=e.length;for(;r<i;++r)o=e[r],s=Math.max(s,o.getMinLabelBounds().bottom-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}if(t){r=0,i=t.length;for(;r<i;++r)o=t[r],s=Math.max(s,o.getMinLabelBounds().bottom-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}return s},_redraw:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1;var e=this.get("width"),t=this.get("height"),n=0,r=0,i=0,s=0,o=this.get("leftAxesCollection"),u=this.get("rightAxesCollection"),a=this.get("topAxesCollection"),f=this.get("bottomAxesCollection"),l=0,c,h,p="visible",d=this.get("graph"),v,m,g,y,b,w,E,S,x=this.get("allowContentOverflow"),T,N,C,k,L,A={};if(o){C=[],c=o.length;for(l=c-1;l>-1;--l)C.unshift(n),n+=o[l].get("width")}if(u){N=[],c=u.length,l=0;for(l=c-1;l>-1;--l)r+=u[l].get("width"),N.unshift(e-r)}if(a){k=[],c=a.length;for(l=c-1;l>-1;--l)k.unshift(i),i+=a[l].get("height")}if(f){L=[],c=f.length;for(l=c-1;l>-1;--l)s+=f[l].get("height"),L.unshift(t-s)}b=e-(n+r),w=t-(s+i),A.left=n,A.top=i,A.bottom=t-s,A.right=e-r;if(!x){v=this._getTopOverflow(o,u),m=this._getBottomOverflow(o,u),g=this._getLeftOverflow(f,a),y=this._getRightOverflow(f,a),T=v-i;if(T>0){A.top=v;if(k){l=0,c=k.length;for(;l<c;++l)k[l]+=T}}T=m-s;if(T>0){A.bottom=t-m;if(L){l=0,c=L.length;for(;l<c;++l)L[l]-=T}}T=g-n;if(T>0){A.left=g;if(C){l=0,c=C.length;for(;l<c;++l)C[l]+=T}}T=y-r;if(T>0){A.right=e-y;if(N){l=0,c=N.length;for(;l<c;++l)N[l]-=T}}}b=A.right-A.left,w=A.bottom-A.top,E=A.left,S=A.top;if(a){c=a.length,l=0;for(;l<c;l++)h=a[l],h.get("width")!==b&&h.set("width",b),h.get("boundingBox").setStyle("left",E+"px"),h.get("boundingBox").setStyle("top",k[l]+"px");h._hasDataOverflow()&&(p="hidden")}if(f){c=f.length,l=0;for(;l<c;l++)h=f[l],h.get("width")!==b&&h.set("width",b),h.get("boundingBox").setStyle("left",E+"px"),h.get("boundingBox").setStyle("top",L[l]+"px");h._hasDataOverflow()&&(p="hidden")}if(o){c=o.length,l=0;for(;l<c;++l)h=o[l],h.get("boundingBox").setStyle("top",S+"px"),h.get("boundingBox").setStyle("left",C[l]+"px"),h.get("height")!==w&&h.set("height",w);h._hasDataOverflow()&&(p="hidden")}if(u){c=u.length,l=0;for(;l<c;++l)h=u[l],h.get("boundingBox").setStyle("top",S+"px"),h.get("boundingBox").setStyle("left",N[l]+"px"),h.get("height")!==w&&h.set("height",w);h._hasDataOverflow()&&(p="hidden")}this._drawing=!1;if(this._callLater){this._redraw();return}d&&(d.get("boundingBox").setStyle("left",E+"px"),d.get("boundingBox").setStyle("top",S+"px"),d.set("width",b),d.set("height",w),d.get("boundingBox").setStyle("overflow",p)),this._overlay&&(this._overlay.setStyle("left",E+"px"),this._overlay.setStyle("top",S+"px"),this._overlay.setStyle("width",b+"px"),this._overlay.setStyle("height",w+"px"))},destructor:function(){var t=this.get("graph"),n=0,r,i=this.get("seriesCollection"),s=this._axesCollection,o=this.get("tooltip").node;this._description&&(this._description.empty(),this._description.remove(!0)),this._liveRegion&&(this._liveRegion.empty(),this._liveRegion.remove(!0)),r=i?i.length:0;for(;n<r;++n)i[n]instanceof e.CartesianSeries&&i[n].destroy(!0);r=s?s.length:0;for(n=0;n<r;++n)s[n]instanceof e.Axis&&s[n].destroy(!0);t&&t.destroy(!0),o&&(o.empty(),o.remove(!0)),this._overlay&&(this._overlay.empty(),this._overlay.remove(!0))},_getAriaMessage:function(e){var t="",n,r,i,s,o=this._seriesIndex,u=this._itemIndex,a=this.get("seriesCollection"),f=a.length,l;return e%2===0?(f>1?(e===38?o=o<1?f-1:o-1:e===40&&(o=o>=f-1?0:o+1),this._itemIndex=-1):o=0,this._seriesIndex=o,n=this.getSeries(parseInt(o,10)),t=n.get("valueDisplayName")+" series."):(o>-1?(t="",n=this.getSeries(parseInt(o,10))):(o=0,this._seriesIndex=o,n=this.getSeries(parseInt(o,10)),t=n.get("valueDisplayName")+" series."),l=n._dataLength?n._dataLength:0,e===37?u=u>0?u-1:l-1:e===39&&(u=u>=l-1?0:u+1),this._itemIndex=u,r=this.getSeriesItems(n,u),i=r.category,s=r.value,i&&s&&i.value&&s.value?(t+=i.displayName+": "+i.axis.formatLabel.apply(this,[i.value,i.axis.get("labelFormat")])+", ",t+=s.displayName+": "+s.axis.formatLabel.apply(this,[s.value,s.axis.get("labelFormat")])+", "):t+="No data available.",t+=u+1+" of "+l+". "),t}},{ATTRS:{allowContentOverflow:{value:!1},axesStyles:{getter:function(){var t=this.get("axes"),n,r=this._axesStyles;if(t)for(n in t)t.hasOwnProperty(n)&&t[n]instanceof e.Axis&&(r||(r={}),r[n]=t[n].get("styles"));return r},setter:function(e){var t=this.get("axes"),n;for(n in e)e.hasOwnProperty(n)&&t.hasOwnProperty(n)&&this._setBaseAttribute(t[n],"styles",e[n])}},seriesStyles:{getter:function(){var e=this._seriesStyles,t=this.get("graph"),n,r;if(t){n=t.get("seriesDictionary");if(n){e={};for(r in n)n.hasOwnProperty(r)&&(e[r]=n[r].get("styles"))}}return e},setter:function(e){var t,n,r;if(s.isArray(e)){r=this.get("seriesCollection"),t=0,n=e.length;for(;t<n;++t)this._setBaseAttribute(r[t],"styles",e[t])}else for(t in e)e.hasOwnProperty(t)&&(r=this.getSeries(t),this._setBaseAttribute(r,"styles",e[t]))}},graphStyles:{getter:function(){var e=this.get("graph");return e?e.get("styles"):this._graphStyles},setter:function(e){var t=this.get("graph");this._setBaseAttribute(t,"styles",e)}},styles:{getter:function(){var e={axes:this.get("axesStyles"),series:this.get("seriesStyles"),graph:this.get("graphStyles")};return e},setter:function(e){e.hasOwnProperty("axes")&&(this.get("axesStyles")?this.set("axesStyles",e.axes):this._axesStyles=e.axes),e.hasOwnProperty("series")&&(this.get("seriesStyles")?this.set("seriesStyles",e.series):this._seriesStyles=e.series),e.hasOwnProperty("graph")&&this.set("graphStyles",e.graph)}},axes:{valueFn:"_getDefaultAxes",setter:function(e){return this.get("dataProvider")&&(e=this._setAxes(e)),e}},seriesCollection:{valueFn:"_getDefaultSeriesCollection",setter:function(e){return this.get("dataProvider")&&(e=this._parseSeriesCollection(e)),e}},leftAxesCollection:{},bottomAxesCollection:{},rightAxesCollection:{},topAxesCollection:{},stacked:{value:!1},direction:{getter:function(){var e=this.get("type");return e=="bar"?"vertical":e=="column"?"horizontal":this._direction},setter:function(e){return this._direction=e,this._direction}},showAreaFill:{},showMarkers:{},showLines:{},categoryAxisName:{},valueAxisName:{value:"values"},horizontalGridlines:{getter:function(){var e=this.get("graph");return e?e.get("horizontalGridlines"):this._horizontalGridlines},setter:function(e){var t=this.get("graph");e&&!s.isObject(e)&&(e={}),t?t.set("horizontalGridlines",e):this._horizontalGridlines=e}},verticalGridlines:{getter:function(){var e=this.get("graph");return e?e.get("verticalGridlines"):this._verticalGridlines},setter:function(e){var t=this.get("graph");e&&!s.isObject(e)&&(e={}),t?t.set("verticalGridlines",e):this._verticalGridlines=e}},type:{getter:function(){return this.get("stacked")?"stacked"+this._type:this._type},setter:function(e){return this._type=="bar"?e!="bar"&&this.set("direction","horizontal"):e=="bar"&&this.set("direction","vertical"),this._type=e,this._type}},categoryAxis:{}}}),e.PieChart=e.Base.create("pieChart",e.Widget,[e.ChartBase],{_getSeriesCollection:function(){if(this._seriesCollection)return this._seriesCollection;var e=this.get("axes"),t=[],n,r=0,i,s=this.get("type"),o,u="categoryAxis",a="categoryKey",f="valueAxis",l="valueKey";if(e){n=e.values.get("keyCollection"),o=e.category.get("keyCollection")[0],i=n.length;for(;r<i;++r)t[r]={type:s},t[r][u]="category",t[r][f]="values",t[r][a]=o,t[r][l]=n[r]}return this._seriesCollection=t,t},_parseAxes:function(t){this._axes||(this._axes={});var n,r,i,s,o,u,a=this.get("type"),f=this.get("width"),l=this.get("height"),c=e.Node.one(this._parentNode);f||(this.set("width",c.get("offsetWidth")),f=this.get("width")),l||(this.set("height",c.get("offsetHeight")),l=this.get("height"));for(n in t)t.hasOwnProperty(n)&&(s=t[n],r=a=="pie"?"none":s.position,u=this._getAxisClass(s.type),o={dataProvider:this.get("dataProvider")},s.hasOwnProperty("roundingUnit")&&(o.roundingUnit=s.roundingUnit),o.keys=s.keys,o.width=f,o.height=l,o.position=r,o.styles=s.styles,i=new u(o),i.on("axisRendered",e.bind(this._itemRendered,this)),this._axes[n]=i)},_addAxes:function(){var e=this.get("axes"),t,n,r;e||(this.set("axes",this._getDefaultAxes()),e=this.get("axes")),this._axesCollection||(this._axesCollection=[]);for(t in e)e.hasOwnProperty(t)&&(n=e[t],r=n.get("position"),this.get(r+"AxesCollection")?this.get(r+"AxesCollection").push(n):this.set(r+"AxesCollection",[n]),this._axesCollection.push(n))},_addSeries:function(){var e=this.get("graph"),t=this.get("seriesCollection");this._parseSeriesAxes(t),e.set("showBackground",!1),e.set("width",this.get("width")),e.set("height",this.get("height")),e.set("seriesCollection",t),this._seriesCollection=e.get("seriesCollection"),e.render(this.get("contentBox"))},_parseSeriesAxes:function(t){var n=0,r=t.length,i,s=this.get("axes"),o;for(;n<r;++n){i=t[n];if(i){if(i instanceof e.PieSeries){o=i.get("categoryAxis"),o&&!(o instanceof e.Axis)&&i.set("categoryAxis",s[o]),o=i.get("valueAxis"),o&&!(o instanceof e.Axis)&&i.set("valueAxis",s[o]);continue}i.categoryAxis=s.category,i.valueAxis=s.values,i.type||(i.type=this.get("type"))}}},_getDefaultAxes:function(){var e=this.get("categoryKey"),t=this.get("seriesKeys").concat(),n="numeric";return{values:{keys:t,type:n},category:{keys:[e],type:this.get("categoryType")}}},getSeriesItems:function(e,t){var n={axis:e.get("categoryAxis"),key:e.get("categoryKey"),displayName:e.get("categoryDisplayName")},r={axis:e.get("valueAxis"),key:e.get("valueKey"),displayName:e.get("valueDisplayName")};return n.value=n.axis.getKeyValueAt(n.key,t),r.value=r.axis.getKeyValueAt(r.key,t),{category:n,value:r}},_sizeChanged:function(e){this._redraw()},_redraw:function(){var e=this.get("graph"),t=this.get("width"),n=this.get("height"),r;e&&(r=Math.min(t,n),e.set("width",r),e.set("height",r))},_tooltipLabelFunction:function(e,t,n,r,s){var o=i.createElement("div"),u=r.getTotalValues(),a=Math.round(t.value/u*1e4)/100;return o.appendChild(i.createTextNode(e.displayName+": "+e.axis.get("labelFunction").apply(this,[e.value,e.axis.get("labelFormat")]))),o.appendChild(i.createElement("br")),o.appendChild(i.createTextNode(t.displayName+": "+t.axis.get("labelFunction").apply(this,[t.value,t.axis.get("labelFormat")]))),o.appendChild(i.createElement("br")),o.appendChild(i.createTextNode(a+"%")),o},_getAriaMessage:function(e){var t="",n,r,i,s,o=0,u=this._itemIndex,a=this.get("seriesCollection"),f,l,c,h;return i=this.getSeries(parseInt(o,10)),h=i.get("markers"),f=h&&h.length?h.length:0,e===37?u=u>0?u-1:f-1:e===39&&(u=u>=f-1?0:u+1),this._itemIndex=u,r=this.getSeriesItems(i,u),n=r.category,s=r.value,l=i.getTotalValues(),c=Math.round(s.value/l*1e4)/100,n&&s?(t+=n.displayName+": "+n.axis.formatLabel.apply(this,[n.value,n.axis.get("labelFormat")])+", ",t+=s.displayName+": "+s.axis.formatLabel.apply(this,[s.value,s.axis.get("labelFormat")])+", ",t+="Percent of total "+s.displayName+": "+c+"%,"):t+="No data available,",t+=u+1+" of "+f+". ",t}},{ATTRS:{ariaDescription:{value:"Use the left and right keys to navigate through items.",setter:function(e){return this._description&&(this._description.setContent(""),this._description.appendChild(i.createTextNode(e))),e}},axes:{getter:function(){return this._axes},setter:function(e){this._parseAxes(e)}},seriesCollection:{getter:function(){return this._getSeriesCollection()},setter:function(e){return this._setSeriesCollection(e)}},type:{value:"pie"}}})},"3.7.1",{requires:["dom","datatype-number","datatype-date","event-custom","event-mouseenter","event-touch","widget","widget-position","widget-stack","graphics"]});
@@ -1,15451 +1,16205 @@ /*-YUI 3.5.1 (build 22)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-YUI.add('charts-base', function(Y) {--/**- * The Charts widget provides an api for displaying data- * graphically.- *- * @module charts- * @main charts- */-var CONFIG = Y.config,- WINDOW = CONFIG.win,- DOCUMENT = CONFIG.doc,- Y_Lang = Y.Lang,- IS_STRING = Y_Lang.isString,- LeftAxisLayout,- RightAxisLayout,- BottomAxisLayout,- TopAxisLayout,- _getClassName = Y.ClassNameManager.getClassName,- SERIES_MARKER = _getClassName("seriesmarker"),- ShapeGroup,- CircleGroup,- RectGroup,- EllipseGroup,- DiamondGroup;--/**- * Abstract class for creating groups of shapes with the same styles and dimensions.- *- * @module graphics- * @class ShapeGroup- * @constructor- */- ShapeGroup = function(cfg)- {- ShapeGroup.superclass.constructor.apply(this, arguments);- };- - ShapeGroup.NAME = "shapeGroup";-- Y.extend(ShapeGroup, Y.Path, { - /**- * Updates the shape.- *- * @method _draw- * @private- */- _draw: function()- {- var xvalues = this.get("xvalues"),- yvalues = this.get("yvalues"),- x,- y,- xRad,- yRad,- i = 0,- len,- attrs = [],- dimensions = this.get("dimensions"),- width = dimensions.width,- height = dimensions.height,- radius = dimensions.radius,- yRadius = dimensions.yRadius,- id = this.get("id"),- className = this.node.className,- widthIsArray = Y_Lang.isArray(width),- heightIsArray = Y_Lang.isArray(height),- radiusIsArray = Y_Lang.isArray(radius),- yRadiusIsArray = Y_Lang.isArray(yRadius);- if(xvalues && yvalues && xvalues.length > 0)- {- this.clear();-- len = xvalues.length;- for(; i < len; ++i)- {- x = xvalues[i];- y = yvalues[i];- xRad = radiusIsArray ? radius[i] : radius;- yRad = yRadiusIsArray ? yRadius[i] : yRadius;- if(!isNaN(x) && !isNaN(y) && !isNaN(xRad))- {- this.drawShape({- x: x,- y: y,- width: widthIsArray ? width[i] : width,- height: heightIsArray ? height[i] : height,- radius: xRad,- yRadius: yRad - });- this.closePath();- attrs[i] = {- id: id + "_" + i,- className: className,- coords: (x - this._left) + ", " + (y - this._top) + ", " + radius,- shape: "circle"- };- }- }- this._closePath();- }- },-- /**- * Parses and array of lengths into radii- *- * @method _getRadiusCollection- * @param {Array} val Array of lengths- * @return Array- * @private- */- _getRadiusCollection: function(val)- {- var i = 0,- len = val.length,- radii = [];- for(; i < len; ++i)- { - radii[i] = val[i] * 0.5;- }- return radii;- }- });- -ShapeGroup.ATTRS = Y.merge(Y.Path.ATTRS, {- dimensions: {- getter: function()- {- var dimensions = this._dimensions,- radius,- yRadius,- width,- height;- if(dimensions.hasOwnProperty("radius"))- {- return dimensions;- }- else- {- width = dimensions.width;- height = dimensions.height;- radius = Y_Lang.isArray(width) ? this._getRadiusCollection(width) : (width * 0.5);- yRadius = Y_Lang.isArray(height) ? this._getRadiusCollection(height) : (height * 0.5);- return {- width: width,- height: height,- radius: radius,- yRadius: yRadius- };- }- },-- setter: function(val)- {- this._dimensions = val;- return val;- }- },- xvalues: {- getter: function()- {- return this._xvalues;- },- setter: function(val)- {- this._xvalues = val;- }- },- yvalues: {- getter: function()- {- return this._yvalues;- },- setter: function(val)- {- this._yvalues = val;- }- }-});-Y.ShapeGroup = ShapeGroup;-/**- * Abstract class for creating groups of circles with the same styles and dimensions.- *- * @module graphics- * @class GroupCircle- * @constructor- */- CircleGroup = function(cfg)- {- CircleGroup.superclass.constructor.apply(this, arguments);- };- - CircleGroup.NAME = "circleGroup";-- Y.extend(CircleGroup, Y.ShapeGroup, { - /**- * Algorithm for drawing shape.- *- * @method drawShape- * @param {Object} cfg Parameters used to draw the shape.- */- drawShape: function(cfg)- {- this.drawCircle(cfg.x, cfg.y, cfg.radius);- }- });--CircleGroup.ATTRS = Y.merge(Y.ShapeGroup.ATTRS, {- dimensions: {- getter: function()- {- var dimensions = this._dimensions,- radius,- yRadius,- width,- height;- if(dimensions.hasOwnProperty("radius"))- {- return dimensions;- }- else- {- width = dimensions.width;- height = dimensions.height;- radius = Y_Lang.isArray(width) ? this._getRadiusCollection(width) : (width * 0.5);- yRadius = radius;- return {- width: width,- height: height,- radius: radius,- yRadius: yRadius- };- }- }- }-});- -CircleGroup.ATTRS = Y.ShapeGroup.ATTRS;-Y.CircleGroup = CircleGroup;-/**- * Abstract class for creating groups of rects with the same styles and dimensions.- *- * @module graphics- * @class GroupRect- * @constructor- */- RectGroup = function(cfg)- {- RectGroup.superclass.constructor.apply(this, arguments);- };- - RectGroup.NAME = "rectGroup";-- Y.extend(RectGroup, Y.ShapeGroup, { - /**- * Updates the rect.- *- * @method _draw- * @private- */- drawShape: function(cfg)- {- this.drawRect(cfg.x, cfg.y, cfg.width, cfg.height);- }- });- -RectGroup.ATTRS = Y.ShapeGroup.ATTRS;-Y.RectGroup = RectGroup;-/**- * Abstract class for creating groups of diamonds with the same styles and dimensions.- *- * @module graphics- * @class GroupDiamond- * @constructor- */- DiamondGroup = function(cfg)- {- DiamondGroup.superclass.constructor.apply(this, arguments);- };- - DiamondGroup.NAME = "diamondGroup";-- Y.extend(DiamondGroup, Y.ShapeGroup, { - /**- * Updates the diamond.- *- * @method _draw- * @private- */- drawShape: function(cfg)- {- this.drawDiamond(cfg.x, cfg.y, cfg.width, cfg.height);- }- });- -DiamondGroup.ATTRS = Y.ShapeGroup.ATTRS;-Y.DiamondGroup = DiamondGroup;-/**- * Abstract class for creating groups of diamonds with the same styles and dimensions.- *- * @module graphics- * @class EllipseGroup- * @constructor- */- EllipseGroup = function(cfg)- {- EllipseGroup.superclass.constructor.apply(this, arguments);- };- - EllipseGroup.NAME = "diamondGroup";-- Y.extend(EllipseGroup, Y.ShapeGroup, { - /**- * Updates the diamond.- *- * @method _draw- * @private- */- drawShape: function(cfg)- {- this.drawEllipse(cfg.x, cfg.y, cfg.width, cfg.height);- }- });- -EllipseGroup.ATTRS = Y.ShapeGroup.ATTRS;-Y.EllipseGroup = EllipseGroup;-/**- * The Renderer class is a base class for chart components that use the `styles`- * attribute.- *- * @module charts- * @class Renderer- * @constructor- */-function Renderer(){}--Renderer.ATTRS = {- /**- * Style properties for class- * - * @attribute styles- * @type Object- */- styles:- {- getter: function()- {- this._styles = this._styles || this._getDefaultStyles();- return this._styles;- },-- setter: function(val)- {- this._styles = this._setStyles(val);- }- },- - /**- * The graphic in which drawings will be rendered.- *- * @attribute graphic- * @type Graphic- */- graphic: {}-};-Renderer.NAME = "renderer";--Renderer.prototype = {- /**- * Storage for `styles` attribute.- *- * @property _styles- * @type Object- * @private- */- _styles: null,- - /**- * Method used by `styles` setter.- *- * @method _setStyles- * @param {Object} newStyles Hash of properties to update.- * @return Object- * @protected- */- _setStyles: function(newstyles)- {- var styles = this.get("styles");- return this._mergeStyles(newstyles, styles);- },- - /**- * Merges to object literals so that only specified properties are - * overwritten.- *- * @method _mergeStyles- * @param {Object} a Hash of new styles- * @param {Object} b Hash of original styles- * @return Object- * @protected- */- _mergeStyles: function(a, b)- {- if(!b)- {- b = {};- }- var newstyles = Y.merge(b, {});- Y.Object.each(a, function(value, key, a)- {- if(b.hasOwnProperty(key) && Y_Lang.isObject(value) && !Y_Lang.isFunction(value) && !Y_Lang.isArray(value))- {- newstyles[key] = this._mergeStyles(value, b[key]);- }- else- {- newstyles[key] = value;- }- }, this);- return newstyles;- },-- /**- * Gets the default value for the `styles` attribute. - *- * @method _getDefaultStyles- * @return Object- * @protected- */- _getDefaultStyles: function()- {- return {padding:{- top:0,- right: 0,- bottom: 0,- left: 0- }};- }-};--Y.augment(Renderer, Y.Attribute);-Y.Renderer = Renderer;--/**- * Algorithmic strategy for rendering a left axis.- *- * @module charts- * @class LeftAxisLayout- * @constructor- */-LeftAxisLayout = function() {};--LeftAxisLayout.prototype = {- /**- * Default margins for text fields.- *- * @private- * @method _getDefaultMargins- * @return Object- */- _getDefaultMargins: function() - {- return {- top: 0,- left: 0,- right: 4,- bottom: 0- };- },-- /**- * Sets the length of the tick on either side of the axis line.- *- * @method setTickOffset- * @protected- */- setTickOffsets: function()- {- var host = this,- majorTicks = host.get("styles").majorTicks,- tickLength = majorTicks.length,- halfTick = tickLength * 0.5,- display = majorTicks.display;- host.set("topTickOffset", 0);- host.set("bottomTickOffset", 0);- - switch(display)- {- case "inside" :- host.set("rightTickOffset", tickLength);- host.set("leftTickOffset", 0);- break;- case "outside" : - host.set("rightTickOffset", 0);- host.set("leftTickOffset", tickLength);- break;- case "cross":- host.set("rightTickOffset", halfTick); - host.set("leftTickOffset", halfTick);- break;- default:- host.set("rightTickOffset", 0);- host.set("leftTickOffset", 0);- break;- }- },- - /**- * Draws a tick- *- * @method drawTick- * @param {Path} path reference to the path `Path` element in which to draw the tick.- * @param {Object} pt Point on the axis in which the tick will intersect.- * @param {Object} tickStyle Hash of properties to apply to the tick.- * @protected- */- drawTick: function(path, pt, tickStyles)- {- var host = this,- style = host.get("styles"),- padding = style.padding,- tickLength = tickStyles.length,- start = {x:padding.left, y:pt.y},- end = {x:tickLength + padding.left, y:pt.y};- host.drawLine(path, start, end);- },-- /**- * Calculates the coordinates for the first point on an axis.- *- * @method getLineStart- * @return {Object}- * @protected- */- getLineStart: function()- {- var style = this.get("styles"),- padding = style.padding,- majorTicks = style.majorTicks,- tickLength = majorTicks.length,- display = majorTicks.display,- pt = {x:padding.left, y:0};- if(display === "outside")- {- pt.x += tickLength;- }- else if(display === "cross")- {- pt.x += tickLength/2;- }- return pt; - },- - /**- * Calculates the point for a label.- *- * @method getLabelPoint- * @param {Object} point Point on the axis in which the tick will intersect.- * @return {Object} - * @protected- */- getLabelPoint: function(point)- {- return {x:point.x - this.get("leftTickOffset"), y:point.y};- },- - /**- * Updates the value for the `maxLabelSize` for use in calculating total size.- *- * @method updateMaxLabelSize- * @param {HTMLElement} label to measure- * @protected- */- updateMaxLabelSize: function(labelWidth, labelHeight)- {- var host = this,- props = this._labelRotationProps,- rot = props.rot,- absRot = props.absRot,- sinRadians = props.sinRadians,- cosRadians = props.cosRadians,- max;- if(rot === 0)- {- max = labelWidth;- }- else if(absRot === 90)- {- max = labelHeight;- }- else- {- max = (cosRadians * labelWidth) + (sinRadians * labelHeight);- }- host._maxLabelSize = Math.max(host._maxLabelSize, max);- },- - /**- * Determines the available label width when the axis width has been explicitly set.- *- * @method getExplicitlySized- * @return Boolean- * @protected- */- getExplicitlySized: function(styles)- {- if(this._explicitWidth)- {- var host = this,- w = host._explicitWidth,- totalTitleSize = host._totalTitleSize,- leftTickOffset = host.get("leftTickOffset"),- margin = styles.label.margin.right;- host._maxLabelSize = w - (leftTickOffset + margin + totalTitleSize);- return true;- }- return false;- },-- /**- * Rotate and position title.- *- * @method positionTitle- * @param {HTMLElement} label to rotate position- * @protected- */- positionTitle: function(label)- {- var host = this,- bounds = host._titleBounds,- margin = host.get("styles").title.margin,- props = host._titleRotationProps,- w = bounds.right - bounds.left,- labelWidth = label.offsetWidth,- labelHeight = label.offsetHeight,- x = (labelWidth * -0.5) + (w * 0.5),- y = (host.get("height") * 0.5) - (labelHeight * 0.5);- props.labelWidth = labelWidth;- props.labelHeight = labelHeight;- if(margin && margin.left)- {- x += margin.left;- }- props.x = x;- props.y = y;- props.transformOrigin = [0.5, 0.5];- host._rotate(label, props);- },-- /**- * Rotate and position labels.- *- * @method positionLabel- * @param {HTMLElement} label to rotate position- * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned- * against.- * @protected- */- positionLabel: function(label, pt, styles, i)- {- var host = this,- tickOffset = host.get("leftTickOffset"),- totalTitleSize = this._totalTitleSize,- leftOffset = pt.x + totalTitleSize - tickOffset,- topOffset = pt.y,- props = this._labelRotationProps,- rot = props.rot,- absRot = props.absRot,- maxLabelSize = host._maxLabelSize,- labelWidth = this._labelWidths[i],- labelHeight = this._labelHeights[i];- if(rot === 0)- {- leftOffset -= labelWidth;- topOffset -= labelHeight * 0.5;- }- else if(rot === 90)- {- leftOffset -= labelWidth * 0.5;- }- else if(rot === -90)- {- leftOffset -= labelWidth * 0.5;- topOffset -= labelHeight;- }- else- {- leftOffset -= labelWidth + (labelHeight * absRot/360);- topOffset -= labelHeight * 0.5;- }- props.labelWidth = labelWidth;- props.labelHeight = labelHeight;- props.x = Math.round(maxLabelSize + leftOffset);- props.y = Math.round(topOffset);- this._rotate(label, props);- },-- /**- * Adjusts the coordinates of an axis label based on the rotation.- *- * @method _setRotationCoords- * @param {Object} props Coordinates, dimension and rotation properties of the label.- * @protected- */- _setRotationCoords: function(props)- {- var rot = props.rot,- absRot = props.absRot,- leftOffset,- topOffset,- labelWidth = props.labelWidth,- labelHeight = props.labelHeight;- if(rot === 0)- {- leftOffset = labelWidth;- topOffset = labelHeight * 0.5;- }- else if(rot === 90)- {- topOffset = 0;- leftOffset = labelWidth * 0.5;- }- else if(rot === -90)- {- leftOffset = labelWidth * 0.5;- topOffset = labelHeight;- }- else- {- leftOffset = labelWidth + (labelHeight * absRot/360);- topOffset = labelHeight * 0.5;- }- props.x -= leftOffset;- props.y -= topOffset;- },-- /**- * Returns the transformOrigin to use for an axis label based on the position of the axis - * and the rotation of the label.- *- * @method _getTransformOrigin- * @param {Number} rot The rotation (in degrees) of the label.- * @return Array- * @protected- */- _getTransformOrigin: function(rot)- {- var transformOrigin;- if(rot === 0)- {- transformOrigin = [0, 0];- }- else if(rot === 90)- {- transformOrigin = [0.5, 0];- }- else if(rot === -90)- {- transformOrigin = [0.5, 1];- }- else- {- transformOrigin = [1, 0.5];- }- return transformOrigin;- },-- /**- * Adjust the position of the Axis widget's content box for internal axes.- *- * @method offsetNodeForTick- * @param {Node} cb Content box of the Axis.- * @protected- */- offsetNodeForTick: function(cb)- {- },-- /**- * Sets the width of the axis based on its contents.- *- * @method setCalculatedSize- * @protected- */- setCalculatedSize: function()- {- var host = this,- graphic = this.get("graphic"),- style = host.get("styles"),- label = style.label,- tickOffset = host.get("leftTickOffset"),- max = host._maxLabelSize,- totalTitleSize = this._totalTitleSize,- ttl = Math.round(totalTitleSize + tickOffset + max + label.margin.right);- if(this._explicitWidth)- {- ttl = this._explicitWidth;- }- this.set("calculatedWidth", ttl);- graphic.set("x", ttl - tickOffset);- }-};--Y.LeftAxisLayout = LeftAxisLayout;-/**- * RightAxisLayout contains algorithms for rendering a right axis.- *- * @module charts- * @class RightAxisLayout- * @constructor- */-RightAxisLayout = function(){};--RightAxisLayout.prototype = {- /**- * Default margins for text fields.- *- * @private- * @method _getDefaultMargins- * @return Object- */- _getDefaultMargins: function() - {- return {- top: 0,- left: 4,- right: 0,- bottom: 0- };- },-- /**- * Sets the length of the tick on either side of the axis line.- *- * @method setTickOffset- * @protected- */- setTickOffsets: function()- {- var host = this,- majorTicks = host.get("styles").majorTicks,- tickLength = majorTicks.length,- halfTick = tickLength * 0.5,- display = majorTicks.display;- host.set("topTickOffset", 0);- host.set("bottomTickOffset", 0);- - switch(display)- {- case "inside" :- host.set("leftTickOffset", tickLength);- host.set("rightTickOffset", 0);- break;- case "outside" : - host.set("leftTickOffset", 0);- host.set("rightTickOffset", tickLength);- break;- case "cross" :- host.set("rightTickOffset", halfTick);- host.set("leftTickOffset", halfTick);- break;- default:- host.set("leftTickOffset", 0);- host.set("rightTickOffset", 0);- break;- }- },-- /**- * Draws a tick- *- * @method drawTick- * @param {Path} path reference to the path `Path` element in which to draw the tick.- * @param {Object} pt Point on the axis in which the tick will intersect.- * @param {Object) tickStyle Hash of properties to apply to the tick.- * @protected- */- drawTick: function(path, pt, tickStyles)- {- var host = this,- style = host.get("styles"),- padding = style.padding,- tickLength = tickStyles.length,- start = {x:padding.left, y:pt.y},- end = {x:padding.left + tickLength, y:pt.y};- host.drawLine(path, start, end);- },- - /**- * Calculates the coordinates for the first point on an axis.- *- * @method getLineStart- * @return {Object}- * @protected- */- getLineStart: function()- {- var host = this,- style = host.get("styles"),- padding = style.padding,- majorTicks = style.majorTicks,- tickLength = majorTicks.length,- display = majorTicks.display,- pt = {x:padding.left, y:padding.top};- if(display === "inside")- {- pt.x += tickLength;- }- else if(display === "cross")- {- pt.x += tickLength/2;- }- return pt;- },- - /**- * Calculates the point for a label.- *- * @method getLabelPoint- * @param {Object} point Point on the axis in which the tick will intersect.- * @return {Object} - * @protected- */- getLabelPoint: function(point)- {- return {x:point.x + this.get("rightTickOffset"), y:point.y};- },- - /**- * Updates the value for the `maxLabelSize` for use in calculating total size.- *- * @method updateMaxLabelSize- * @param {HTMLElement} label to measure- * @protected- */- updateMaxLabelSize: function(labelWidth, labelHeight)- {- var host = this,- props = this._labelRotationProps,- rot = props.rot,- absRot = props.absRot,- sinRadians = props.sinRadians,- cosRadians = props.cosRadians,- max;- if(rot === 0)- {- max = labelWidth;- }- else if(absRot === 90)- {- max = labelHeight;- }- else- {- max = (cosRadians * labelWidth) + (sinRadians * labelHeight);- }- host._maxLabelSize = Math.max(host._maxLabelSize, max);- },- - /**- * Determines the available label width when the axis width has been explicitly set.- *- * @method getExplicitlySized- * @return Boolean- * @protected- */- getExplicitlySized: function(styles)- {- if(this._explicitWidth)- {- var host = this,- w = host._explicitWidth,- totalTitleSize = this._totalTitleSize,- rightTickOffset = host.get("rightTickOffset"),- margin = styles.label.margin.right;- host._maxLabelSize = w - (rightTickOffset + margin + totalTitleSize);- return true;- }- return false;- },-- /**- * Rotate and position title.- *- * @method positionTitle- * @param {HTMLElement} label to rotate position- * @protected- */- positionTitle: function(label)- {- var host = this,- bounds = host._titleBounds,- margin = host.get("styles").title.margin,- props = host._titleRotationProps,- labelWidth = label.offsetWidth,- labelHeight = label.offsetHeight,- w = bounds.right - bounds.left,- x = this.get("width") - (labelWidth * 0.5) - (w * 0.5),- y = (host.get("height") * 0.5) - (labelHeight * 0.5);- props.labelWidth = labelWidth;- props.labelHeight = labelHeight;- if(margin && margin.right)- {- x -= margin.left;- }- props.x = x;- props.y = y;- props.transformOrigin = [0.5, 0.5];- host._rotate(label, props);- },-- /**- * Rotate and position labels.- *- * @method positionLabel- * @param {HTMLElement} label to rotate position- * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned- * against.- * @protected- */- positionLabel: function(label, pt, styles, i)- {- var host = this,- tickOffset = host.get("rightTickOffset"),- labelStyles = styles.label,- margin = 0,- leftOffset = pt.x,- topOffset = pt.y,- props = this._labelRotationProps,- rot = props.rot,- absRot = props.absRot,- labelWidth = this._labelWidths[i],- labelHeight = this._labelHeights[i];- if(labelStyles.margin && labelStyles.margin.left)- {- margin = labelStyles.margin.left;- }- if(rot === 0)- {- topOffset -= labelHeight * 0.5;- }- else if(rot === 90)- {- leftOffset -= labelWidth * 0.5;- topOffset -= labelHeight;- }- else if(rot === -90)- {- leftOffset -= labelWidth * 0.5;- }- else- {- topOffset -= labelHeight * 0.5;- leftOffset += labelHeight/2 * absRot/90;- }- leftOffset += margin;- leftOffset += tickOffset;- props.labelWidth = labelWidth;- props.labelHeight = labelHeight;- props.x = Math.round(leftOffset);- props.y = Math.round(topOffset);- this._rotate(label, props);- },- - /**- * Adjusts the coordinates of an axis label based on the rotation.- *- * @method _setRotationCoords- * @param {Object} props Coordinates, dimension and rotation properties of the label.- * @protected- */- _setRotationCoords: function(props)- {- var rot = props.rot,- absRot = props.absRot,- leftOffset = 0,- topOffset = 0,- labelWidth = props.labelWidth,- labelHeight = props.labelHeight;- if(rot === 0)- {- topOffset = labelHeight * 0.5;- }- else if(rot === 90)- {- leftOffset = labelWidth * 0.5;- topOffset = labelHeight;- }- else if(rot === -90)- {- leftOffset = labelWidth * 0.5;- }- else- {- topOffset = labelHeight * 0.5;- leftOffset = labelHeight/2 * absRot/90;- }- props.x -= leftOffset;- props.y -= topOffset;- },- - /**- * Returns the transformOrigin to use for an axis label based on the position of the axis - * and the rotation of the label.- *- * @method _getTransformOrigin- * @param {Number} rot The rotation (in degrees) of the label.- * @return Array- * @protected- */- _getTransformOrigin: function(rot)- {- var transformOrigin;- if(rot === 0)- {- transformOrigin = [0, 0];- }- else if(rot === 90)- {- transformOrigin = [0.5, 1];- }- else if(rot === -90)- {- transformOrigin = [0.5, 0];- }- else- {- transformOrigin = [0, 0.5];- }- return transformOrigin;- },-- /**- * Adjusts position for inner ticks.- *- * @method offsetNodeForTick- * @param {Node} cb contentBox of the axis- * @protected- */- offsetNodeForTick: function(cb)- {- var host = this,- tickOffset = host.get("leftTickOffset"),- offset = 0 - tickOffset;- cb.setStyle("left", offset);- },-- /**- * Assigns a height based on the size of the contents.- *- * @method setCalculatedSize- * @protected- */- setCalculatedSize: function()- {- var host = this,- styles = host.get("styles"),- labelStyle = styles.label,- totalTitleSize = this._totalTitleSize,- ttl = Math.round(host.get("rightTickOffset") + host._maxLabelSize + totalTitleSize + labelStyle.margin.left);- if(this._explicitWidth)- {- ttl = this._explicitWidth;- }- host.set("calculatedWidth", ttl);- host.get("contentBox").setStyle("width", ttl);- }-};--Y.RightAxisLayout = RightAxisLayout;-/**- * Contains algorithms for rendering a bottom axis.- *- * @module charts- * @class BottomAxisLayout- * @Constructor- */-BottomAxisLayout = function(){};--BottomAxisLayout.prototype = {- /**- * Default margins for text fields.- *- * @private- * @method _getDefaultMargins- * @return Object- */- _getDefaultMargins: function() - {- return {- top: 4,- left: 0,- right: 0,- bottom: 0- };- },-- /**- * Sets the length of the tick on either side of the axis line.- *- * @method setTickOffsets- * @protected- */- setTickOffsets: function()- {- var host = this,- majorTicks = host.get("styles").majorTicks,- tickLength = majorTicks.length,- halfTick = tickLength * 0.5,- display = majorTicks.display;- host.set("leftTickOffset", 0);- host.set("rightTickOffset", 0);-- switch(display)- {- case "inside" :- host.set("topTickOffset", tickLength);- host.set("bottomTickOffset", 0);- break;- case "outside" : - host.set("topTickOffset", 0);- host.set("bottomTickOffset", tickLength);- break;- case "cross":- host.set("topTickOffset", halfTick);- host.set("bottomTickOffset", halfTick);- break;- default:- host.set("topTickOffset", 0);- host.set("bottomTickOffset", 0);- break;- }- },-- /**- * Calculates the coordinates for the first point on an axis.- *- * @method getLineStart- * @protected- */- getLineStart: function()- {- var style = this.get("styles"),- padding = style.padding,- majorTicks = style.majorTicks,- tickLength = majorTicks.length,- display = majorTicks.display,- pt = {x:0, y:padding.top};- if(display === "inside")- {- pt.y += tickLength;- }- else if(display === "cross")- {- pt.y += tickLength/2;- }- return pt; - },- - /**- * Draws a tick- *- * @method drawTick- * @param {Path} path reference to the path `Path` element in which to draw the tick.- * @param {Object} pt hash containing x and y coordinates- * @param {Object} tickStyles hash of properties used to draw the tick- * @protected- */- drawTick: function(path, pt, tickStyles)- {- var host = this,- style = host.get("styles"),- padding = style.padding,- tickLength = tickStyles.length,- start = {x:pt.x, y:padding.top},- end = {x:pt.x, y:tickLength + padding.top};- host.drawLine(path, start, end);- },-- /**- * Calculates the point for a label.- *- * @method getLabelPoint- * @param {Object} pt Object containing x and y coordinates- * @return Object- * @protected- */- getLabelPoint: function(point)- {- return {x:point.x, y:point.y + this.get("bottomTickOffset")};- },- - /**- * Updates the value for the `maxLabelSize` for use in calculating total size.- *- * @method updateMaxLabelSize- * @param {HTMLElement} label to measure- * @protected- */- updateMaxLabelSize: function(labelWidth, labelHeight)- {- var host = this,- props = this._labelRotationProps,- rot = props.rot,- absRot = props.absRot,- sinRadians = props.sinRadians,- cosRadians = props.cosRadians,- max;- if(rot === 0)- {- max = labelHeight;- }- else if(absRot === 90)- {- max = labelWidth;- }- else- {- max = (sinRadians * labelWidth) + (cosRadians * labelHeight); - }- host._maxLabelSize = Math.max(host._maxLabelSize, max);- },- - /**- * Determines the available label height when the axis width has been explicitly set.- *- * @method getExplicitlySized- * @return Boolean- * @protected- */- getExplicitlySized: function(styles)- {- if(this._explicitHeight)- {- var host = this,- h = host._explicitHeight,- totalTitleSize = host._totalTitleSize,- bottomTickOffset = host.get("bottomTickOffset"),- margin = styles.label.margin.right;- host._maxLabelSize = h - (bottomTickOffset + margin + totalTitleSize);- return true;- }- return false;- },-- /**- * Rotate and position title.- *- * @method positionTitle- * @param {HTMLElement} label to rotate position- * @protected- */- positionTitle: function(label)- {- var host = this,- bounds = host._titleBounds,- margin = host.get("styles").title.margin,- props = host._titleRotationProps,- h = bounds.bottom - bounds.top,- labelWidth = label.offsetWidth,- labelHeight = label.offsetHeight,- x = (host.get("width") * 0.5) - (labelWidth * 0.5),- y = host.get("height") - labelHeight/2 - h/2;- props.labelWidth = labelWidth;- props.labelHeight = labelHeight;- if(margin && margin.bottom)- {- y -= margin.bottom;- }- props.x = x;- props.y = y;- props.transformOrigin = [0.5, 0.5];- host._rotate(label, props);- },- - /**- * Rotate and position labels.- *- * @method positionLabel- * @param {HTMLElement} label to rotate position- * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned- * against.- * @protected- */- positionLabel: function(label, pt, styles, i)- {- var host = this,- tickOffset = host.get("bottomTickOffset"),- labelStyles = styles.label,- margin = 0,- props = host._labelRotationProps,- rot = props.rot,- absRot = props.absRot,- leftOffset = Math.round(pt.x),- topOffset = Math.round(pt.y),- labelWidth = host._labelWidths[i],- labelHeight = host._labelHeights[i];- if(labelStyles.margin && labelStyles.margin.top)- {- margin = labelStyles.margin.top;- }- if(rot > 0)- {- topOffset -= labelHeight/2 * rot/90;- }- else if(rot < 0)- {- leftOffset -= labelWidth;- topOffset -= labelHeight/2 * absRot/90;- }- else- {- leftOffset -= labelWidth * 0.5;- }- topOffset += margin;- topOffset += tickOffset;- props.labelWidth = labelWidth;- props.labelHeight = labelHeight;- props.x = leftOffset;- props.y = topOffset;- host._rotate(label, props);- },- - /**- * Adjusts the coordinates of an axis label based on the rotation.- *- * @method _setRotationCoords- * @param {Object} props Coordinates, dimension and rotation properties of the label.- * @protected- */- _setRotationCoords: function(props)- {- var rot = props.rot,- absRot = props.absRot,- labelWidth = props.labelWidth,- labelHeight = props.labelHeight,- leftOffset,- topOffset;-- if(rot > 0)- {- leftOffset = 0;- topOffset = labelHeight/2 * rot/90;- }- else if(rot < 0)- {- leftOffset = labelWidth;- topOffset = labelHeight/2 * absRot/90;- }- else- {- leftOffset = labelWidth * 0.5;- topOffset = 0;- }- props.x -= leftOffset;- props.y -= topOffset;- },-- /**- * Returns the transformOrigin to use for an axis label based on the position of the axis - * and the rotation of the label.- *- * @method _getTransformOrigin- * @param {Number} rot The rotation (in degrees) of the label.- * @return Array- * @protected- */- _getTransformOrigin: function(rot)- {- var transformOrigin;- if(rot > 0)- {- transformOrigin = [0, 0.5];- }- else if(rot < 0)- {- transformOrigin = [1, 0.5];- }- else- {- transformOrigin = [0, 0];- }- return transformOrigin;- },-- /**- * Adjusts position for inner ticks.- *- * @method offsetNodeForTick- * @param {Node} cb contentBox of the axis- * @protected- */- offsetNodeForTick: function(cb)- {- var host = this;- host.get("contentBox").setStyle("top", 0 - host.get("topTickOffset"));- },-- /**- * Assigns a height based on the size of the contents.- *- * @method setCalculatedSize- * @protected- */- setCalculatedSize: function()- {- var host = this,- styles = host.get("styles"),- labelStyle = styles.label,- totalTitleSize = host._totalTitleSize,- ttl = Math.round(host.get("bottomTickOffset") + host._maxLabelSize + labelStyle.margin.top + totalTitleSize);- if(host._explicitHeight)- {- ttl = host._explicitHeight;- }- host.set("calculatedHeight", ttl);- }-};-Y.BottomAxisLayout = BottomAxisLayout;-/**- * Contains algorithms for rendering a top axis.- *- * @module charts- * @class TopAxisLayout- * @constructor- */-TopAxisLayout = function(){};--TopAxisLayout.prototype = {- /**- * Default margins for text fields.- *- * @private- * @method _getDefaultMargins- * @return Object- */- _getDefaultMargins: function() - {- return {- top: 0,- left: 0,- right: 0,- bottom: 4- };- },- - /**- * Sets the length of the tick on either side of the axis line.- *- * @method setTickOffsets- * @protected- */- setTickOffsets: function()- {- var host = this,- majorTicks = host.get("styles").majorTicks,- tickLength = majorTicks.length,- halfTick = tickLength * 0.5,- display = majorTicks.display;- host.set("leftTickOffset", 0);- host.set("rightTickOffset", 0);- switch(display)- {- case "inside" :- host.set("bottomTickOffset", tickLength);- host.set("topTickOffset", 0);- break;- case "outside" : - host.set("bottomTickOffset", 0);- host.set("topTickOffset", tickLength);- break;- case "cross" :- host.set("topTickOffset", halfTick);- host.set("bottomTickOffset", halfTick);- break;- default:- host.set("topTickOffset", 0);- host.set("bottomTickOffset", 0);- break;- }- },-- /**- * Calculates the coordinates for the first point on an axis.- *- * @method getLineStart- * @protected- */- getLineStart: function()- {- var host = this,- style = host.get("styles"),- padding = style.padding,- majorTicks = style.majorTicks,- tickLength = majorTicks.length,- display = majorTicks.display,- pt = {x:0, y:padding.top};- if(display === "outside")- {- pt.y += tickLength;- }- else if(display === "cross")- {- pt.y += tickLength/2;- }- return pt; - },- - /**- * Draws a tick- *- * @method drawTick- * @param {Path} path reference to the path `Path` element in which to draw the tick.- * @param {Object} pt hash containing x and y coordinates- * @param {Object} tickStyles hash of properties used to draw the tick- * @protected- */- drawTick: function(path, pt, tickStyles)- {- var host = this,- style = host.get("styles"),- padding = style.padding,- tickLength = tickStyles.length,- start = {x:pt.x, y:padding.top},- end = {x:pt.x, y:tickLength + padding.top};- host.drawLine(path, start, end);- },- - /**- * Calculates the point for a label.- *- * @method getLabelPoint- * @param {Object} pt hash containing x and y coordinates- * @return Object- * @protected- */- getLabelPoint: function(pt)- {- return {x:pt.x, y:pt.y - this.get("topTickOffset")};- },- - /**- * Updates the value for the `maxLabelSize` for use in calculating total size.- *- * @method updateMaxLabelSize- * @param {HTMLElement} label to measure- * @protected- */- updateMaxLabelSize: function(labelWidth, labelHeight)- {- var host = this,- props = this._labelRotationProps,- rot = props.rot,- absRot = props.absRot,- sinRadians = props.sinRadians,- cosRadians = props.cosRadians,- max;- if(rot === 0)- {- max = labelHeight;- }- else if(absRot === 90)- {- max = labelWidth;- }- else- {- max = (sinRadians * labelWidth) + (cosRadians * labelHeight); - }- host._maxLabelSize = Math.max(host._maxLabelSize, max);- },-- /**- * Determines the available label height when the axis width has been explicitly set.- *- * @method getExplicitlySized- * @return Boolean- * @protected- */- getExplicitlySized: function(styles)- {- if(this._explicitHeight)- {- var host = this,- h = host._explicitHeight,- totalTitleSize = host._totalTitleSize,- topTickOffset = host.get("topTickOffset"),- margin = styles.label.margin.right;- host._maxLabelSize = h - (topTickOffset + margin + totalTitleSize);- return true;- }- return false;- },-- /**- * Rotate and position title.- *- * @method positionTitle- * @param {HTMLElement} label to rotate position- * @protected- */- positionTitle: function(label)- {- var host = this,- bounds = host._titleBounds,- margin = host.get("styles").title.margin,- props = host._titleRotationProps,- labelWidth = label.offsetWidth,- labelHeight = label.offsetHeight,- h = bounds.bottom - bounds.top,- x = (host.get("width") * 0.5) - (labelWidth * 0.5),- y = h/2 - labelHeight/2;- props.labelWidth = labelWidth;- props.labelHeight = labelHeight;- if(margin && margin.top)- {- y += margin.top;- }- props.x = x;- props.y = y;- props.transformOrigin = [0.5, 0.5];- host._rotate(label, props);- },-- /**- * Rotate and position labels.- *- * @method positionLabel- * @param {HTMLElement} label to rotate position- * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned- * against.- * @protected- */- positionLabel: function(label, pt, styles, i)- {- var host = this,- totalTitleSize = this._totalTitleSize,- maxLabelSize = host._maxLabelSize,- leftOffset = pt.x,- topOffset = pt.y + totalTitleSize + maxLabelSize,- props = this._labelRotationProps,- rot = props.rot,- absRot = props.absRot,- labelWidth = this._labelWidths[i],- labelHeight = this._labelHeights[i];- if(rot === 0)- {- leftOffset -= labelWidth * 0.5;- topOffset -= labelHeight;- }- else- {- if(rot === 90)- {- leftOffset -= labelWidth;- topOffset -= (labelHeight * 0.5);- }- else if (rot === -90)- {- topOffset -= (labelHeight * 0.5);- } - else if(rot > 0)- {- leftOffset -= labelWidth;- topOffset -= labelHeight - (labelHeight * rot/180);- }- else- {- topOffset -= labelHeight - (labelHeight * absRot/180);- }- }- props.x = Math.round(leftOffset);- props.y = Math.round(topOffset);- props.labelWidth = labelWidth;- props.labelHeight = labelHeight;- this._rotate(label, props);- },-- /**- * Adjusts the coordinates of an axis label based on the rotation.- *- * @method _setRotationCoords- * @param {Object} props Coordinates, dimension and rotation properties of the label.- * @protected- */- _setRotationCoords: function(props)- {- var rot = props.rot,- absRot = props.absRot,- labelWidth = props.labelWidth,- labelHeight = props.labelHeight,- leftOffset,- topOffset;- if(rot === 0)- {- leftOffset = labelWidth * 0.5;- topOffset = labelHeight;- }- else- {- if(rot === 90)- {- leftOffset = labelWidth;- topOffset = (labelHeight * 0.5);- }- else if (rot === -90)- {- topOffset = (labelHeight * 0.5);- } - else if(rot > 0)- {- leftOffset = labelWidth;- topOffset = labelHeight - (labelHeight * rot/180);- }- else- {- topOffset = labelHeight - (labelHeight * absRot/180);- }- }- props.x -= leftOffset;- props.y -= topOffset;- },-- /**- * Returns the transformOrigin to use for an axis label based on the position of the axis - * and the rotation of the label.- *- * @method _getTransformOrigin- * @param {Number} rot The rotation (in degrees) of the label.- * @return Array- * @protected- */- _getTransformOrigin: function(rot)- {- var transformOrigin;- if(rot === 0)- {- transformOrigin = [0, 0];- }- else- {- if(rot === 90)- {- transformOrigin = [1, 0.5];- }- else if (rot === -90)- {- transformOrigin = [0, 0.5];- } - else if(rot > 0)- {- transformOrigin = [1, 0.5];- }- else- {- transformOrigin = [0, 0.5];- }- }- return transformOrigin;- },-- /**- * Adjusts position for inner ticks.- *- * @method offsetNodeForTick- * @param {Node} cb contentBox of the axis- * @protected- */- offsetNodeForTick: function(cb)- {- },-- /**- * Assigns a height based on the size of the contents.- *- * @method setCalculatedSize- * @protected- */- setCalculatedSize: function()- {- var host = this,- graphic = host.get("graphic"),- styles = host.get("styles"),- labelMargin = styles.label.margin,- totalLabelSize = labelMargin.bottom + host._maxLabelSize,- totalTitleSize = host._totalTitleSize,- topTickOffset = this.get("topTickOffset"),- ttl = Math.round(topTickOffset + totalLabelSize + totalTitleSize);- if(this._explicitHeight)- {- ttl = this._explicitWidth; - }- host.set("calculatedHeight", ttl);- graphic.set("y", ttl - topTickOffset);- }-};-Y.TopAxisLayout = TopAxisLayout;--/**- * The Axis class. Generates axes for a chart.- *- * @module charts- * @class Axis- * @extends Widget- * @uses Renderer- * @constructor- * @param {Object} config (optional) Configuration parameters for the Chart.- */-Y.Axis = Y.Base.create("axis", Y.Widget, [Y.Renderer], {- /**- * Storage for calculatedWidth value.- *- * @property _calculatedWidth- * @type Number- * @private- */- _calculatedWidth: 0,-- /**- * Storage for calculatedHeight value.- *- * @property _calculatedHeight- * @type Number- * @private- */- _calculatedHeight: 0,-- /**- * Handles change to the dataProvider- * - * @method _dataChangeHandler- * @param {Object} e Event object- * @private- */- _dataChangeHandler: function(e)- {- if(this.get("rendered"))- {- this._drawAxis();- }- },-- /**- * Handles change to the position attribute- *- * @method _positionChangeHandler- * @param {Object} e Event object- * @private- */- _positionChangeHandler: function(e)- {- this._updateGraphic(e.newVal);- this._updateHandler();- },-- /**- * Updates the the Graphic instance- *- * @method _updateGraphic- * @param {String} position Position of axis - * @private- */- _updateGraphic: function(position)- {- var graphic = this.get("graphic");- if(position == "none")- {- if(graphic)- {- graphic.destroy();- }- }- else- {- if(!graphic)- {- this._setCanvas();- }- }- },-- /**- * Handles changes to axis.- *- * @method _updateHandler- * @param {Object} e Event object- * @private- */- _updateHandler: function(e)- {- if(this.get("rendered"))- {- this._drawAxis();- }- },- - /**- * @method renderUI- * @private- */- renderUI: function()- {- this._updateGraphic(this.get("position"));- },-- /**- * @method syncUI- * @private- */- syncUI: function()- {- var layout = this._layout,- defaultMargins,- styles,- label,- title,- i;- if(layout)- {- defaultMargins = layout._getDefaultMargins();- styles = this.get("styles");- label = styles.label.margin;- title =styles.title.margin;- //need to defaultMargins method to the layout classes.- for(i in defaultMargins)- {- if(defaultMargins.hasOwnProperty(i))- {- label[i] = label[i] === undefined ? defaultMargins[i] : label[i];- title[i] = title[i] === undefined ? defaultMargins[i] : title[i];- }- }- }- this._drawAxis();- },-- /**- * Creates a graphic instance to be used for the axis line and ticks.- *- * @method _setCanvas- * @private- */- _setCanvas: function()- {- var cb = this.get("contentBox"),- bb = this.get("boundingBox"),- p = this.get("position"),- pn = this._parentNode,- w = this.get("width"),- h = this.get("height");- bb.setStyle("position", "absolute");- bb.setStyle("zIndex", 2);- w = w ? w + "px" : pn.getStyle("width");- h = h ? h + "px" : pn.getStyle("height");- if(p === "top" || p === "bottom")- {- cb.setStyle("width", w);- }- else- {- cb.setStyle("height", h);- }- cb.setStyle("position", "relative");- cb.setStyle("left", "0px");- cb.setStyle("top", "0px");- this.set("graphic", new Y.Graphic());- this.get("graphic").render(cb);- },- - /**- * Gets the default value for the `styles` attribute. Overrides- * base implementation.- *- * @method _getDefaultStyles- * @return Object- * @protected- */- _getDefaultStyles: function()- {- var axisstyles = {- majorTicks: {- display:"inside",- length:4,- color:"#dad8c9",- weight:1,- alpha:1- },- minorTicks: {- display:"none",- length:2,- color:"#dad8c9",- weight:1- },- line: {- weight:1,- color:"#dad8c9",- alpha:1- },- majorUnit: {- determinant:"count",- count:11,- distance:75- },- top: "0px",- left: "0px",- width: "100px",- height: "100px",- label: {- color:"#808080",- alpha: 1,- fontSize:"85%",- rotation: 0,- margin: {- top: undefined,- right: undefined,- bottom: undefined,- left: undefined- }- },- title: {- color:"#808080",- alpha: 1,- fontSize:"85%",- rotation: undefined,- margin: {- top: undefined,- right: undefined,- bottom: undefined,- left: undefined- }- },- hideOverlappingLabelTicks: false- };- - return Y.merge(Y.Renderer.prototype._getDefaultStyles(), axisstyles); - },-- /**- * Updates the axis when the size changes.- *- * @method _handleSizeChange- * @param {Object} e Event object.- * @private- */- _handleSizeChange: function(e)- {- var attrName = e.attrName,- pos = this.get("position"),- vert = pos == "left" || pos == "right",- cb = this.get("contentBox"),- hor = pos == "bottom" || pos == "top";- cb.setStyle("width", this.get("width"));- cb.setStyle("height", this.get("height"));- if((hor && attrName == "width") || (vert && attrName == "height"))- {- this._drawAxis();- }- },- - /**- * Maps key values to classes containing layout algorithms- *- * @property _layoutClasses- * @type Object- * @private- */- _layoutClasses: - {- top : TopAxisLayout,- bottom: BottomAxisLayout,- left: LeftAxisLayout,- right : RightAxisLayout- },- - /**- * Draws a line segment between 2 points- *- * @method drawLine- * @param {Object} startPoint x and y coordinates for the start point of the line segment- * @param {Object} endPoint x and y coordinates for the for the end point of the line segment- * @param {Object} line styles (weight, color and alpha to be applied to the line segment)- * @private- */- drawLine: function(path, startPoint, endPoint)- {- path.moveTo(startPoint.x, startPoint.y);- path.lineTo(endPoint.x, endPoint.y);- },-- /**- * Generates the properties necessary for rotating and positioning a text field.- *- * @method _getTextRotationProps- * @param {Object} styles properties for the text field- * @return Object- * @private- */- _getTextRotationProps: function(styles)- {- if(styles.rotation === undefined)- {- switch(this.get("position"))- {- case "left" :- styles.rotation = -90;- break; - case "right" : - styles.rotation = 90;- break;- default :- styles.rotation = 0;- break;- }- }- var rot = Math.min(90, Math.max(-90, styles.rotation)),- absRot = Math.abs(rot),- radCon = Math.PI/180,- sinRadians = parseFloat(parseFloat(Math.sin(absRot * radCon)).toFixed(8)),- cosRadians = parseFloat(parseFloat(Math.cos(absRot * radCon)).toFixed(8));- return {- rot: rot,- absRot: absRot,- radCon: radCon,- sinRadians: sinRadians,- cosRadians: cosRadians,- textAlpha: styles.alpha- };- },-- /**- * Draws an axis. - *- * @method _drawAxis- * @private- */- _drawAxis: function ()- {- if(this._drawing)- {- this._callLater = true;- return;- }- this._drawing = true;- this._callLater = false;- if(this._layout)- {- var styles = this.get("styles"),- line = styles.line,- labelStyles = styles.label,- majorTickStyles = styles.majorTicks,- drawTicks = majorTickStyles.display != "none",- tickPoint,- majorUnit = styles.majorUnit,- len,- majorUnitDistance,- i = 0,- layout = this._layout,- layoutLength,- position,- lineStart,- label,- labelWidth,- labelHeight,- labelFunction = this.get("labelFunction"),- labelFunctionScope = this.get("labelFunctionScope"),- labelFormat = this.get("labelFormat"),- graphic = this.get("graphic"),- path = this.get("path"),- tickPath,- explicitlySized;- this._labelWidths = [];- this._labelHeights = [];- graphic.set("autoDraw", false);- path.clear();- path.set("stroke", {- weight: line.weight, - color: line.color, - opacity: line.alpha- });- this._labelRotationProps = this._getTextRotationProps(labelStyles);- this._labelRotationProps.transformOrigin = layout._getTransformOrigin(this._labelRotationProps.rot);- layout.setTickOffsets.apply(this);- layoutLength = this.getLength();- lineStart = layout.getLineStart.apply(this);- len = this.getTotalMajorUnits(majorUnit);- majorUnitDistance = this.getMajorUnitDistance(len, layoutLength, majorUnit);- this.set("edgeOffset", this.getEdgeOffset(len, layoutLength) * 0.5);- if(len < 1)- {- this._clearLabelCache();- }- else- {- tickPoint = this.getFirstPoint(lineStart);- this.drawLine(path, lineStart, this.getLineEnd(tickPoint));- if(drawTicks) - {- tickPath = this.get("tickPath");- tickPath.clear();- tickPath.set("stroke", {- weight: majorTickStyles.weight,- color: majorTickStyles.color,- opacity: majorTickStyles.alpha- });- layout.drawTick.apply(this, [tickPath, tickPoint, majorTickStyles]);- }- this._createLabelCache();- this._tickPoints = [];- this._maxLabelSize = 0; - this._totalTitleSize = 0;- this._titleSize = 0;- this._setTitle();- explicitlySized = layout.getExplicitlySized.apply(this, [styles]);- for(; i < len; ++i)- {- if(drawTicks) - {- layout.drawTick.apply(this, [tickPath, tickPoint, majorTickStyles]);- }- position = this.getPosition(tickPoint);- label = this.getLabel(tickPoint, labelStyles);- this._labels.push(label);- this._tickPoints.push({x:tickPoint.x, y:tickPoint.y});- this.get("appendLabelFunction")(label, labelFunction.apply(labelFunctionScope, [this.getLabelByIndex(i, len), labelFormat]));- labelWidth = Math.round(label.offsetWidth);- labelHeight = Math.round(label.offsetHeight);- if(!explicitlySized)- {- this._layout.updateMaxLabelSize.apply(this, [labelWidth, labelHeight]);- }- this._labelWidths.push(labelWidth);- this._labelHeights.push(labelHeight);- tickPoint = this.getNextPoint(tickPoint, majorUnitDistance);- }- this._clearLabelCache();- if(this.get("overlapGraph"))- {- layout.offsetNodeForTick.apply(this, [this.get("contentBox")]);- }- layout.setCalculatedSize.apply(this);- if(this._titleTextField)- {- this._layout.positionTitle.apply(this, [this._titleTextField]);- }- for(i = 0; i < len; ++i)- {- layout.positionLabel.apply(this, [this.get("labels")[i], this._tickPoints[i], styles, i]);- }- }- }- this._drawing = false;- if(this._callLater)- {- this._drawAxis();- }- else- {- this._updatePathElement();- this.fire("axisRendered");- }- },- - /**- * Calculates and sets the total size of a title.- *- * @method _setTotalTitleSize- * @param {Object} styles Properties for the title field.- * @private- */- _setTotalTitleSize: function(styles)- {- var title = this._titleTextField,- w = title.offsetWidth,- h = title.offsetHeight,- rot = this._titleRotationProps.rot,- bounds,- size,- margin = styles.margin,- position = this.get("position"),- matrix = new Y.Matrix();- matrix.rotate(rot);- bounds = matrix.getContentRect(w, h);- if(position == "left" || position == "right")- {- size = bounds.right - bounds.left;- if(margin)- {- size += margin.left + margin.right;- }- }- else- {- size = bounds.bottom - bounds.top;- if(margin)- {- size += margin.top + margin.bottom;- }- }- this._titleBounds = bounds;- this._totalTitleSize = size;- },-- /**- * Updates path.- *- * @method _updatePathElement- * @private- */- _updatePathElement: function()- {- var path = this._path,- tickPath = this._tickPath,- redrawGraphic = false,- graphic = this.get("graphic");- if(path)- {- redrawGraphic = true;- path.end();- }- if(tickPath)- {- redrawGraphic = true;- tickPath.end();- }- if(redrawGraphic)- {- graphic._redraw();- }- },-- /**- * Updates the content and style properties for a title field.- *- * @method _updateTitle- * @private- */- _setTitle: function()- {- var i,- styles,- customStyles,- title = this.get("title"),- titleTextField = this._titleTextField,- parentNode;- if(title !== null && title !== undefined)- {- customStyles = {- rotation: "rotation",- margin: "margin",- alpha: "alpha"- };- styles = this.get("styles").title;- if(!titleTextField)- {- titleTextField = DOCUMENT.createElement('span');- titleTextField.style.display = "block";- titleTextField.style.whiteSpace = "nowrap";- titleTextField.setAttribute("class", "axisTitle");- this.get("contentBox").append(titleTextField);- }- else if(!DOCUMENT.createElementNS)- {- if(titleTextField.style.filter)- {- titleTextField.style.filter = null;- }- }- titleTextField.style.position = "absolute";- for(i in styles)- {- if(styles.hasOwnProperty(i) && !customStyles.hasOwnProperty(i))- {- titleTextField.style[i] = styles[i];- }- }- this.get("appendTitleFunction")(titleTextField, title);- this._titleTextField = titleTextField;- this._titleRotationProps = this._getTextRotationProps(styles);- this._setTotalTitleSize(styles);- }- else if(titleTextField)- {- parentNode = titleTextField.parentNode;- if(parentNode)- {- parentNode.removeChild(titleTextField);- }- this._titleTextField = null;- this._totalTitleSize = 0;- }- },-- /**- * Creates or updates an axis label.- *- * @method getLabel- * @param {Object} pt x and y coordinates for the label- * @param {Object} styles styles applied to label- * @return HTMLElement - * @private- */- getLabel: function(pt, styles)- {- var i,- label,- labelCache = this._labelCache,- customStyles = {- rotation: "rotation",- margin: "margin",- alpha: "alpha"- };- if(labelCache && labelCache.length > 0)- {- label = labelCache.shift();- }- else- {- label = DOCUMENT.createElement("span");- label.className = Y.Lang.trim([label.className, "axisLabel"].join(' '));- this.get("contentBox").append(label);- }- if(!DOCUMENT.createElementNS)- {- if(label.style.filter)- {- label.style.filter = null;- }- }- label.style.display = "block";- label.style.whiteSpace = "nowrap";- label.style.position = "absolute";- for(i in styles)- {- if(styles.hasOwnProperty(i) && !customStyles.hasOwnProperty(i))- {- label.style[i] = styles[i];- }- }- return label;- },-- /**- * Creates a cache of labels that can be re-used when the axis redraws.- *- * @method _createLabelCache- * @private- */- _createLabelCache: function()- {- if(this._labels)- {- while(this._labels.length > 0)- {- this._labelCache.push(this._labels.shift());- }- }- else- {- this._clearLabelCache();- }- this._labels = [];- },- - /**- * Removes axis labels from the dom and clears the label cache.- *- * @method _clearLabelCache- * @private- */- _clearLabelCache: function()- {- if(this._labelCache)- {- var len = this._labelCache.length,- i = 0,- label;- for(; i < len; ++i)- {- label = this._labelCache[i];- this._removeChildren(label);- Y.Event.purgeElement(label, true);- label.parentNode.removeChild(label);- }- }- this._labelCache = [];- },-- /**- * Gets the end point of an axis.- *- * @method getLineEnd- * @return Object- * @private - */- getLineEnd: function(pt)- {- var w = this.get("width"),- h = this.get("height"),- pos = this.get("position");- if(pos === "top" || pos === "bottom")- {- return {x:w, y:pt.y};- }- else- {- return {x:pt.x, y:h};- }- },-- /**- * Calcuates the width or height of an axis depending on its direction.- *- * @method getLength- * @return Number- * @private- */- getLength: function()- {- var l,- style = this.get("styles"),- padding = style.padding,- w = this.get("width"),- h = this.get("height"),- pos = this.get("position");- if(pos === "top" || pos === "bottom")- {- l = w - (padding.left + padding.right);- }- else- {- l = h - (padding.top + padding.bottom);- }- return l;- },-- /**- * Gets the position of the first point on an axis.- *- * @method getFirstPoint- * @param {Object} pt Object containing x and y coordinates.- * @return Object- * @private- */- getFirstPoint:function(pt)- {- var style = this.get("styles"),- pos = this.get("position"),- padding = style.padding,- np = {x:pt.x, y:pt.y};- if(pos === "top" || pos === "bottom")- {- np.x += padding.left + this.get("edgeOffset");- }- else- {- np.y += this.get("height") - (padding.top + this.get("edgeOffset"));- }- return np;- },-- /**- * Gets the position of the next point on an axis.- *- * @method getNextPoint- * @param {Object} point Object containing x and y coordinates.- * @param {Number} majorUnitDistance Distance in pixels between ticks.- * @return Object- * @private- */- getNextPoint: function(point, majorUnitDistance)- {- var pos = this.get("position");- if(pos === "top" || pos === "bottom")- {- point.x = point.x + majorUnitDistance; - }- else- {- point.y = point.y - majorUnitDistance;- }- return point;- },-- /**- * Calculates the placement of last tick on an axis.- *- * @method getLastPoint- * @return Object- * @private - */- getLastPoint: function()- {- var style = this.get("styles"),- padding = style.padding,- w = this.get("width"),- pos = this.get("position");- if(pos === "top" || pos === "bottom")- {- return {x:w - padding.right, y:padding.top};- }- else- {- return {x:padding.left, y:padding.top};- }- },-- /**- * Calculates position on the axis.- *- * @method getPosition- * @param {Object} point contains x and y values- * @private - */- getPosition: function(point)- {- var p,- h = this.get("height"),- style = this.get("styles"),- padding = style.padding,- pos = this.get("position"),- dataType = this.get("dataType");- if(pos === "left" || pos === "right") - {- //Numeric data on a vertical axis is displayed from bottom to top.- //Categorical and Timeline data is displayed from top to bottom.- if(dataType === "numeric")- {- p = (h - (padding.top + padding.bottom)) - (point.y - padding.top);- }- else- {- p = point.y - padding.top;- }- }- else- {- p = point.x - padding.left;- }- return p;- },-- /**- * Rotates and positions a text field.- *- * @method _rotate- * @param {HTMLElement} label text field to rotate and position- * @param {Object} props properties to be applied to the text field. - * @private- */- _rotate: function(label, props)- {- var rot = props.rot,- x = props.x,- y = props.y,- filterString,- textAlpha,- matrix = new Y.Matrix(),- transformOrigin = props.transformOrigin || [0, 0],- offsetRect;- if(DOCUMENT.createElementNS)- {- matrix.translate(x, y);- matrix.rotate(rot);- label.style.MozTransformOrigin = (transformOrigin[0] * 100) + "% " + (transformOrigin[1] * 100) + "%";- label.style.MozTransform = matrix.toCSSText();- label.style.webkitTransformOrigin = (transformOrigin[0] * 100) + "% " + (transformOrigin[1] * 100) + "%";- label.style.webkitTransform = matrix.toCSSText();- label.style.msTransformOrigin = (transformOrigin[0] * 100) + "% " + (transformOrigin[1] * 100) + "%";- label.style.msTransform = matrix.toCSSText();- label.style.OTransformOrigin = (transformOrigin[0] * 100) + "% " + (transformOrigin[1] * 100) + "%";- label.style.OTransform = matrix.toCSSText();- }- else- {- textAlpha = props.textAlpha;- if(Y_Lang.isNumber(textAlpha) && textAlpha < 1 && textAlpha > -1 && !isNaN(textAlpha))- {- filterString = "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + Math.round(textAlpha * 100) + ")";- }- if(rot !== 0)- {- //ms filters kind of, sort of uses a transformOrigin of 0, 0. - //we'll translate the difference to create a true 0, 0 origin.- matrix.rotate(rot);- offsetRect = matrix.getContentRect(props.labelWidth, props.labelHeight);- matrix.init();- matrix.translate(offsetRect.left, offsetRect.top);- matrix.translate(x, y);- this._simulateRotateWithTransformOrigin(matrix, rot, transformOrigin, props.labelWidth, props.labelHeight);- if(filterString)- {- filterString += " ";- }- else- {- filterString = ""; - }- filterString += matrix.toFilterText();- label.style.left = matrix.dx + "px";- label.style.top = matrix.dy + "px";- }- else- {- label.style.left = x + "px";- label.style.top = y + "px";- }- if(filterString)- {- label.style.filter = filterString;- }- }- },- - /**- * Simulates a rotation with a specified transformOrigin. - *- * @method _simulateTransformOrigin- * @param {Matrix} matrix Reference to a `Matrix` instance.- * @param {Number} rot The rotation (in degrees) that will be performed on a matrix.- * @param {Array} transformOrigin An array represeniting the origin in which to perform the transform. The first - * index represents the x origin and the second index represents the y origin.- * @param {Number} w The width of the object that will be transformed.- * @param {Number} h The height of the object that will be transformed.- * @private- */- _simulateRotateWithTransformOrigin: function(matrix, rot, transformOrigin, w, h)- {- var transformX = transformOrigin[0] * w,- transformY = transformOrigin[1] * h;- transformX = !isNaN(transformX) ? transformX : 0;- transformY = !isNaN(transformY) ? transformY : 0;- matrix.translate(transformX, transformY);- matrix.rotate(rot);- matrix.translate(-transformX, -transformY);- },-- /**- * Returns the coordinates (top, right, bottom, left) for the bounding box of the last label. - *- * @method getMaxLabelBounds- * @return Object- */- getMaxLabelBounds: function()- {- return this._getLabelBounds(this.getMaximumValue());- },-- /**- * Returns the coordinates (top, right, bottom, left) for the bounding box of the first label. - *- * @method getMinLabelBounds- * @return Object- */- getMinLabelBounds: function()- {- return this._getLabelBounds(this.getMinimumValue());- },- - /**- * Returns the coordinates (top, right, bottom, left) for the bounding box of a label. - *- * @method _getLabelBounds- * @param {String} Value of the label- * @return Object- * @private- */- _getLabelBounds: function(val)- {- var layout = this._layout,- labelStyles = this.get("styles").label,- matrix = new Y.Matrix(),- label,- props = this._getTextRotationProps(labelStyles);- props.transformOrigin = layout._getTransformOrigin(props.rot);- label = this.getLabel({x: 0, y: 0}, labelStyles);- this.get("appendLabelFunction")(label, this.get("labelFunction").apply(this, [val, this.get("labelFormat")]));- props.labelWidth = label.offsetWidth;- props.labelHeight = label.offsetHeight;- this._removeChildren(label);- Y.Event.purgeElement(label, true);- label.parentNode.removeChild(label);- props.x = 0;- props.y = 0;- layout._setRotationCoords(props);- matrix.translate(props.x, props.y);- this._simulateRotateWithTransformOrigin(matrix, props.rot, props.transformOrigin, props.labelWidth, props.labelHeight);- return matrix.getContentRect(props.labelWidth, props.labelHeight);- },-- /**- * Removes all DOM elements from an HTML element. Used to clear out labels during detruction- * phase.- *- * @method _removeChildren- * @private- */- _removeChildren: function(node)- {- if(node.hasChildNodes())- {- var child;- while(node.firstChild)- {- child = node.firstChild;- this._removeChildren(child);- node.removeChild(child);- }- }- },- - /**- * Destructor implementation Axis class. Removes all labels and the Graphic instance from the widget.- *- * @method destructor- * @protected- */- destructor: function()- {- var cb = this.get("contentBox").getDOMNode(),- labels = this.get("labels"),- graphic = this.get("graphic"),- label,- len = labels ? labels.length : 0;- if(len > 0)- {- while(labels.length > 0)- {- label = labels.shift();- this._removeChildren(label);- cb.removeChild(label);- label = null;- }- }- if(graphic)- {- graphic.destroy();- }- },-- /**- * Length in pixels of largest text bounding box. Used to calculate the height of the axis.- *- * @property maxLabelSize- * @type Number- * @protected- */- _maxLabelSize: 0,- - /**- * Updates the content of text field. This method writes a value into a text field using - * `appendChild`. If the value is a `String`, it is converted to a `TextNode` first. - *- * @method _setText- * @param label {HTMLElement} label to be updated- * @param val {String} value with which to update the label- * @private- */- _setText: function(textField, val)- { - textField.innerHTML = "";- if(Y_Lang.isNumber(val))- {- val = val + "";- }- else if(!val)- {- val = "";- }- if(IS_STRING(val))- {- val = DOCUMENT.createTextNode(val);- }- textField.appendChild(val);- }-}, {- ATTRS: - {- /**- * When set, defines the width of a vertical axis instance. By default, vertical axes automatically size based on their contents. When the- * width attribute is set, the axis will not calculate its width. When the width attribute is explicitly set, axis labels will postion themselves off of the - * the inner edge of the axis and the title, if present, will position itself off of the outer edge. If a specified width is less than the sum of - * the axis' contents, excess content will overflow.- *- * @attribute width- * @type Number- */- width: {- lazyAdd: false,-- getter: function() - {- if(this._explicitWidth)- {- return this._explicitWidth; - }- return this._calculatedWidth;- },-- setter: function(val)- {- this._explicitWidth = val;- return val;- }- },-- /**- * When set, defines the height of a horizontal axis instance. By default, horizontal axes automatically size based on their contents. When the- * height attribute is set, the axis will not calculate its height. When the height attribute is explicitly set, axis labels will postion themselves off of the - * the inner edge of the axis and the title, if present, will position itself off of the outer edge. If a specified height is less than the sum of - * the axis' contents, excess content will overflow.- *- * @attribute height- * @type Number- */- height: {- lazyAdd: false,-- getter: function() - {- if(this._explicitHeight)- {- return this._explicitHeight; - }- return this._calculatedHeight;- },-- setter: function(val)- {- this._explicitHeight = val;- return val;- }- },-- /**- * Calculated value of an axis' width. By default, the value is used internally for vertical axes. If the `width` attribute is explicitly set, this value will be ignored.- *- * @attribute calculatedWidth- * @type Number- * @private- */- calculatedWidth: {- getter: function()- {- return this._calculatedWidth;- },-- setter: function(val)- {- this._calculatedWidth = val;- return val;- }- },-- /**- * Calculated value of an axis' height. By default, the value is used internally for horizontal axes. If the `height` attribute is explicitly set, this value will be ignored.- *- * @attribute calculatedHeight- * @type Number- * @private- */- calculatedHeight: {- getter: function()- {- return this._calculatedHeight;- },-- setter: function(val)- {- this._calculatedHeight = val;- return val;- }- },-- /**- * Difference betweend the first/last tick and edge of axis.- *- * @attribute edgeOffset- * @type Number- * @protected- */- edgeOffset: - {- value: 0- },-- /**- * The graphic in which the axis line and ticks will be rendered.- *- * @attribute graphic- * @type Graphic- */- graphic: {},- - /**- * @attribute path- * @type Shape- * @readOnly- * @private- */- path: {- readOnly: true,-- getter: function()- {- if(!this._path)- {- var graphic = this.get("graphic");- if(graphic)- {- this._path = graphic.addShape({type:"path"});- }- }- return this._path;- }- },-- /**- * @attribute tickPath- * @type Shape- * @readOnly- * @private- */- tickPath: {- readOnly: true,-- getter: function()- {- if(!this._tickPath)- {- var graphic = this.get("graphic");- if(graphic)- {- this._tickPath = graphic.addShape({type:"path"});- }- }- return this._tickPath;- }- },- - /**- * Contains the contents of the axis. - *- * @attribute node- * @type HTMLElement- */- node: {},-- /**- * Direction of the axis.- *- * @attribute position- * @type String- */- position: {- setter: function(val)- {- var layoutClass = this._layoutClasses[val];- if(val && val != "none")- {- this._layout = new layoutClass();- }- return val;- }- },-- /**- * Distance determined by the tick styles used to calculate the distance between the axis- * line in relation to the top of the axis.- *- * @attribute topTickOffset- * @type Number- */- topTickOffset: {- value: 0- },-- /**- * Distance determined by the tick styles used to calculate the distance between the axis- * line in relation to the bottom of the axis.- *- * @attribute bottomTickOffset- * @type Number- */- bottomTickOffset: {- value: 0- },-- /**- * Distance determined by the tick styles used to calculate the distance between the axis- * line in relation to the left of the axis.- *- * @attribute leftTickOffset- * @type Number- */- leftTickOffset: {- value: 0- },-- /**- * Distance determined by the tick styles used to calculate the distance between the axis- * line in relation to the right side of the axis.- *- * @attribute rightTickOffset- * @type Number- */- rightTickOffset: {- value: 0- },- - /**- * Collection of labels used to render the axis.- *- * @attribute labels- * @type Array- */- labels: {- readOnly: true,- getter: function()- {- return this._labels;- }- },-- /**- * Collection of points used for placement of labels and ticks along the axis.- *- * @attribute tickPoints- * @type Array- */- tickPoints: {- readOnly: true,-- getter: function()- {- if(this.get("position") == "none")- {- return this.get("styles").majorUnit.count;- }- return this._tickPoints;- }- },-- /**- * Indicates whether the axis overlaps the graph. If an axis is the inner most axis on a given- * position and the tick position is inside or cross, the axis will need to overlap the graph.- *- * @attribute overlapGraph- * @type Boolean- */- overlapGraph: {- value:true,-- validator: function(val)- {- return Y_Lang.isBoolean(val);- }- },-- /**- * Object which should have by the labelFunction- *- * @attribute labelFunctionScope- * @type Object- */- labelFunctionScope: {},- - /**- * Length in pixels of largest text bounding box. Used to calculate the height of the axis.- *- * @attribute maxLabelSize- * @type Number- * @protected- */- maxLabelSize: {- getter: function()- {- return this._maxLabelSize;- },-- setter: function(val)- {- this._maxLabelSize = val;- return val; - }- },- - /**- * Title for the axis. When specified, the title will display. The position of the title is determined by the axis position. - * <dl>- * <dt>top</dt><dd>Appears above the axis and it labels. The default rotation is 0.</dd>- * <dt>right</dt><dd>Appears to the right of the axis and its labels. The default rotation is 90.</dd>- * <dt>bottom</dt><dd>Appears below the axis and its labels. The default rotation is 0.</dd>- * <dt>left</dt><dd>Appears to the left of the axis and its labels. The default rotation is -90.</dd>- * </dl>- *- * @attribute title- * @type String- */- title: {- value: null- },- - /**- * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need- * to implement the arguments below and return a `String` or `HTMLElement`. - * <dl>- * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>- * <dt>format</dt><dd>Template for formatting label. (optional)</dd>- * </dl>- *- * @attribute labelFunction- * @type Function- */- labelFunction: {- value: function(val, format)- {- return val;- }- },- - /**- * Function used to append an axis value to an axis label. This function has the following signature:- * <dl>- * <dt>textField</dt><dd>The axis label to be appended. (`HTMLElement`)</dd>- * <dt>val</dt><dd>The value to attach to the text field. This method will accept an `HTMLELement`- * or a `String`. This method does not use (`HTMLElement` | `String`)</dd>- * </dl>- * The default method appends a value to the `HTMLElement` using the `appendChild` method. If the given - * value is a `String`, the method will convert the the value to a `textNode` before appending to the - * `HTMLElement`. This method will not convert an `HTMLString` to an `HTMLElement`. - *- * @attribute appendLabelFunction- * @type Function- */- appendLabelFunction: {- getter: function()- {- return this._setText;- }- },- - /**- * Function used to append a title value to the title object. This function has the following signature:- * <dl>- * <dt>textField</dt><dd>The title text field to be appended. (`HTMLElement`)</dd>- * <dt>val</dt><dd>The value to attach to the text field. This method will accept an `HTMLELement`- * or a `String`. This method does not use (`HTMLElement` | `String`)</dd>- * </dl>- * The default method appends a value to the `HTMLElement` using the `appendChild` method. If the given - * value is a `String`, the method will convert the the value to a `textNode` before appending to the - * `HTMLElement` element. This method will not convert an `HTMLString` to an `HTMLElement`. - *- * @attribute appendTitleFunction- * @type Function- */- appendTitleFunction: {- getter: function()- {- return this._setText;- }- }- - /**- * Style properties used for drawing an axis. This attribute is inherited from `Renderer`. Below are the default values:- * <dl>- * <dt>majorTicks</dt><dd>Properties used for drawing ticks.- * <dl>- * <dt>display</dt><dd>Position of the tick. Possible values are `inside`, `outside`, `cross` and `none`. The- * default value is `inside`.</dd>- * <dt>length</dt><dd>The length (in pixels) of the tick. The default value is 4.</dd>- * <dt>color</dt><dd>The color of the tick. The default value is `#dad8c9`</dd>- * <dt>weight</dt><dd>Number indicating the width of the tick. The default value is 1.</dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the tick. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>line</dt><dd>Properties used for drawing the axis line. - * <dl>- * <dt>weight</dt><dd>Number indicating the width of the axis line. The default value is 1.</dd>- * <dt>color</dt><dd>The color of the axis line. The default value is `#dad8c9`.</dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the tick. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>majorUnit</dt><dd>Properties used to calculate the `majorUnit` for the axis. - * <dl>- * <dt>determinant</dt><dd>The algorithm used for calculating distance between ticks. The possible options are `count` and `distance`. If- * the `determinant` is `count`, the axis ticks will spaced so that a specified number of ticks appear on the axis. If the `determinant`- * is `distance`, the axis ticks will spaced out according to the specified distance. The default value is `count`.</dd>- * <dt>count</dt><dd>Number of ticks to appear on the axis when the `determinant` is `count`. The default value is 11.</dd>- * <dt>distance</dt><dd>The distance (in pixels) between ticks when the `determinant` is `distance`. The default value is 75.</dd>- * </dl>- * </dd>- * <dt>label</dt><dd>Properties and styles applied to the axis labels.- * <dl>- * <dt>color</dt><dd>The color of the labels. The default value is `#808080`.</dd>- * <dt>alpha</dt><dd>Number between 0 and 1 indicating the opacity of the labels. The default value is 1.</dd>- * <dt>fontSize</dt><dd>The font-size of the labels. The default value is 85%</dd>- * <dt>rotation</dt><dd>The rotation, in degrees (between -90 and 90) of the labels. The default value is 0.</dd>- * <dt>margin</dt><dd>The distance between the label and the axis/tick. Depending on the position of the `Axis`, only one of the properties used.- * <dl>- * <dt>top</dt><dd>Pixel value used for an axis with a `position` of `bottom`. The default value is 4.</dd>- * <dt>right</dt><dd>Pixel value used for an axis with a `position` of `left`. The default value is 4.</dd>- * <dt>bottom</dt><dd>Pixel value used for an axis with a `position` of `top`. The default value is 4.</dd>- * <dt>left</dt><dd>Pixel value used for an axis with a `position` of `right`. The default value is 4.</dd>- * </dl>- * </dd>- * </dl>- * </dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});-/**- * AxisType is an abstract class that manages the data for an axis.- *- * @module charts- * @class AxisType- * @constructor- * @extends Axis- */-Y.AxisType = Y.Base.create("baseAxis", Y.Axis, [], {- /**- * @method initializer- * @private- */- initializer: function()- {- this.after("dataReady", Y.bind(this._dataChangeHandler, this));- this.after("dataUpdate", Y.bind(this._dataChangeHandler, this));- this.after("minimumChange", Y.bind(this._keyChangeHandler, this));- this.after("maximumChange", Y.bind(this._keyChangeHandler, this));- this.after("keysChange", this._keyChangeHandler);- this.after("dataProviderChange", this._dataProviderChangeHandler);- this.after("alwaysShowZeroChange", this._keyChangeHandler);- this.after("roundingMethodChange", this._keyChangeHandler);- },-- /**- * @method bindUI- * @private- */- bindUI: function()- {- this.after("stylesChange", this._updateHandler);- this.after("overlapGraphChange", this._updateHandler);- this.after("positionChange", this._positionChangeHandler);- this.after("widthChange", this._handleSizeChange);- this.after("heightChange", this._handleSizeChange);- this.after("calculatedWidthChange", this._handleSizeChange);- this.after("calculatedHeightChange", this._handleSizeChange);- },-- /**- * Handles changes to `dataProvider`.- *- * @method _dataProviderChangeHandler- * @param {Object} e Event object.- * @private- */- _dataProviderChangeHandler: function(e)- {- var keyCollection = this.get("keyCollection").concat(),- keys = this.get("keys"),- i;- if(keys)- {- for(i in keys)- {- if(keys.hasOwnProperty(i))- {- delete keys[i];- }- }- }- if(keyCollection && keyCollection.length)- {- this.set("keys", keyCollection);- }- },-- /**- * Constant used to generate unique id.- *- * @property GUID- * @type String- * @private- */- GUID: "yuibaseaxis",- - /**- * Type of data used in `Axis`.- *- * @property _type- * @type String - * @readOnly- * @private- */- _type: null,- - /**- * Storage for `setMaximum` attribute.- *- * @property _setMaximum- * @type Object- * @private- */- _setMaximum: null,- - /**- * Storage for `dataMaximum` attribute.- *- * @property _dataMaximum- * @type Object- * @private- */- _dataMaximum: null,- - /**- * Storage for `setMinimum` attribute.- *- * @property _setMinimum- * @type Object- * @private- */- _setMinimum: null,- - /**- * Reference to data array.- *- * @property _data- * @type Array- * @private- */- _data: null,-- /**- * Indicates whether the all data is up to date.- *- * @property _updateTotalDataFlag- * @type Boolean- * @private- */- _updateTotalDataFlag: true,-- /**- * Storage for `dataReady` attribute.- *- * @property _dataReady- * @type Boolean- * @readOnly- * @private- */- _dataReady: false,- - /**- * Adds an array to the key hash.- *- * @method addKey- * @param value Indicates what key to use in retrieving- * the array.- */- addKey: function (value)- {- this.set("keys", value);- },-- /**- * Gets an array of values based on a key.- *- * @method _getKeyArray- * @param {String} key Value key associated with the data array.- * @param {Array} data Array in which the data resides.- * @return Array- * @private- */- _getKeyArray: function(key, data)- {- var i = 0,- obj,- keyArray = [],- len = data.length;- for(; i < len; ++i)- {- obj = data[i];- keyArray[i] = obj[key];- }- return keyArray;- },-- /**- * Sets data by key- *- * @method _setDataByKey- * @param {String} key Key value to use.- * @param {Array} data Array to use.- * @private - */- _setDataByKey: function(key, data)- {- var i,- obj, - arr = [], - dv = this._dataClone.concat(), - len = dv.length;- for(i = 0; i < len; ++i)- {- obj = dv[i];- arr[i] = obj[key];- }- this.get("keys")[key] = arr;- this._updateTotalDataFlag = true;- },-- /**- * Updates the total data array.- *- * @method _updateTotalData- * @private- */- _updateTotalData: function()- {- var keys = this.get("keys"),- i;- this._data = [];- for(i in keys)- {- if(keys.hasOwnProperty(i))- {- this._data = this._data.concat(keys[i]);- }- }- this._updateTotalDataFlag = false;- },-- /**- * Removes an array from the key hash.- * - * @method removeKey- * @param {String} value Indicates what key to use in removing from - * the hash.- */- removeKey: function(value)- {- var keys = this.get("keys");- if(keys.hasOwnProperty(value)) - {- delete keys[value];- this._keyChangeHandler();- }- },-- /**- * Returns a value based of a key value and an index.- *- * @method getKeyValueAt- * @param {String} key value used to look up the correct array- * @param {Number} index within the array- * @return Number - */- getKeyValueAt: function(key, index)- {- var value = NaN,- keys = this.get("keys");- if(keys[key] && Y_Lang.isNumber(parseFloat(keys[key][index])))- {- value = keys[key][index];- }- return parseFloat(value);- },-- /**- * Returns an array of values based on an identifier key.- *- * @method getDataByKey- * @param {String} value value used to identify the array- * @return Object- */- getDataByKey: function (value)- {- var keys = this.get("keys");- if(keys[value])- {- return keys[value];- }- return null;- },-- /**- * Calculates the maximum and minimum values for the `Axis`.- *- * @method _updateMinAndMax- * @private - */- _updateMinAndMax: function() - {- var data = this.get("data"),- max = 0,- min = 0,- len,- num,- i;- if(data && data.length && data.length > 0)- {- len = data.length;- max = min = data[0];- if(len > 1)- {- for(i = 1; i < len; i++)- { - num = data[i];- if(isNaN(num))- {- continue;- }- max = Math.max(num, max);- min = Math.min(num, min);- }- }- }- this._dataMaximum = max;- this._dataMinimum = min;- },-- /**- * Returns the total number of majorUnits that will appear on an axis.- *- * @method getTotalMajorUnits- * @return Number- */- getTotalMajorUnits: function()- {- var units,- majorUnit = this.get("styles").majorUnit,- len = this.get("length");- if(majorUnit.determinant === "count") - {- units = majorUnit.count;- }- else if(majorUnit.determinant === "distance") - {- units = (len/majorUnit.distance) + 1;- }- return units; - },-- /**- * Returns the distance between major units on an axis.- *- * @method getMajorUnitDistance- * @param {Number} len Number of ticks- * @param {Number} uiLen Size of the axis.- * @param {Object} majorUnit Hash of properties used to determine the majorUnit- * @return Number- */- getMajorUnitDistance: function(len, uiLen, majorUnit)- {- var dist;- if(majorUnit.determinant === "count")- {- dist = uiLen/(len - 1);- }- else if(majorUnit.determinant === "distance")- {- dist = majorUnit.distance;- }- return dist;- },- - /**- * Gets the distance that the first and last ticks are offset from there respective- * edges.- *- * @method getEdgeOffset- * @param {Number} ct Number of ticks on the axis.- * @param {Number} l Length (in pixels) of the axis.- * @return Number- */- getEdgeOffset: function(ct, l)- {- return 0;- },-- /**- * Calculates and returns a value based on the number of labels and the index of- * the current label.- *- * @method getLabelByIndex- * @param {Number} i Index of the label.- * @param {Number} l Total number of labels.- * @return String- */- getLabelByIndex: function(i, l)- {- var min = this.get("minimum"),- max = this.get("maximum"),- increm = (max - min)/(l-1),- label;- l -= 1;- label = min + (i * increm);- return label;- },-- /**- * Updates the `Axis` after a change in keys.- *- * @method _keyChangeHandler- * @param {Object} e Event object.- * @private- */- _keyChangeHandler: function(e)- {- this._updateMinAndMax();- this.fire("dataUpdate");- },-- /**- * Checks to see if data extends beyond the range of the axis. If so,- * that data will need to be hidden. This method is internal, temporary and subject- * to removal in the future.- *- * @method _hasDataOverflow- * @protected- * @return Boolean- */- _hasDataOverflow: function()- {- if(this.get("setMin") || this.get("setMax"))- {- return true;- }- return false;- },-- /**- * Returns a string corresponding to the first label on an - * axis.- *- * @method getMinimumValue- * @return String- */- getMinimumValue: function()- {- return this.get("minimum");- },-- /**- * Returns a string corresponding to the last label on an - * axis.- *- * @method getMaximumValue- * @return String- */- getMaximumValue: function()- {- return this.get("maximum");- }-}, {- ATTRS: {- /**- * Hash of array identifed by a string value.- *- * @attribute keys- * @type Object- */- keys: {- value: {},-- setter: function(val)- {- var keys = {},- i, - len,- data = this.get("dataProvider");- if(Y_Lang.isArray(val))- {- len = val.length;- for(i = 0; i < len; ++i)- {- keys[val[i]] = this._getKeyArray(val[i], data); - }- - }- else if(Y_Lang.isString(val))- {- keys = this.get("keys");- keys[val] = this._getKeyArray(val, data);- }- else- {- for(i in val)- {- if(val.hasOwnProperty(i))- {- keys[i] = this._getKeyArray(i, data);- }- }- }- this._updateTotalDataFlag = true;- return keys;- }- },-- /**- *Indicates how to round unit values.- * <dl>- * <dt>niceNumber</dt><dd>Units will be smoothed based on the number of ticks and data range.</dd>- * <dt>auto</dt><dd>If the range is greater than 1, the units will be rounded.</dd>- * <dt>numeric value</dt><dd>Units will be equal to the numeric value.</dd>- * <dt>null</dt><dd>No rounding will occur.</dd>- * </dl>- *- * @attribute roundingMethod- * @type String- * @default niceNumber- */- roundingMethod: {- value: "niceNumber"- },-- /**- *Returns the type of axis data- * <dl>- * <dt>time</dt><dd>Manages time data</dd>- * <dt>stacked</dt><dd>Manages stacked numeric data</dd> - * <dt>numeric</dt><dd>Manages numeric data</dd>- * <dt>category</dt><dd>Manages categorical data</dd>- * </dl>- *- * @attribute type- * @type String- */- type:- {- readOnly: true,-- getter: function ()- {- return this._type;- }- },-- /**- * Instance of `ChartDataProvider` that the class uses- * to build its own data.- *- * @attribute dataProvider- * @type Array- */- dataProvider:{- setter: function (value)- {- return value;- }- },-- /**- * The maximum value contained in the `data` array. Used for- * `maximum` when `autoMax` is true.- *- * @attribute dataMaximum- * @type Number- */- dataMaximum: {- getter: function ()- {- if(!this._dataMaximum)- { - this._updateMinAndMax();- }- return this._dataMaximum;- }- },-- /**- * The maximum value that will appear on an axis.- *- * @attribute maximum- * @type Number- */- maximum: {- lazyAdd: false,-- getter: function ()- {- var max = this.get("dataMaximum"),- min = this.get("minimum");- //If all values are zero, force a range so that the Axis and related series- //will still render.- if(min === 0 && max === 0)- {- max = 10;- }- if(Y_Lang.isNumber(this._setMaximum))- {- max = this._setMaximum;- }- return parseFloat(max);- },- setter: function (value)- {- this._setMaximum = parseFloat(value);- return value;- }- },-- /**- * The minimum value contained in the `data` array. Used for- * `minimum` when `autoMin` is true.- *- * @attribute dataMinimum- * @type Number- */- dataMinimum: {- getter: function ()- {- if(!this._dataMinimum)- {- this._updateMinAndMax();- }- return this._dataMinimum;- }- },-- /**- * The minimum value that will appear on an axis.- *- * @attribute minimum- * @type Number- */- minimum: {- lazyAdd: false,-- getter: function ()- {- var min = this.get("dataMinimum");- if(Y_Lang.isNumber(this._setMinimum))- {- min = this._setMinimum;- }- return parseFloat(min);- },- setter: function(val)- {- this._setMinimum = parseFloat(val);- return val;- }- },-- /**- * Determines whether the maximum is calculated or explicitly - * set by the user.- *- * @attribute setMax- * @type Boolean- */- setMax: {- readOnly: true,-- getter: function()- {- return Y_Lang.isNumber(this._setMaximum);- }- },-- /**- * Determines whether the minimum is calculated or explicitly- * set by the user.- *- * @attribute setMin- * @type Boolean- */- setMin: {- readOnly: true,-- getter: function()- {- return Y_Lang.isNumber(this._setMinimum);- }- },-- /**- * Array of axis data- *- * @attribute data- * @type Array- */- data: {- getter: function ()- {- if(!this._data || this._updateTotalDataFlag)- {- this._updateTotalData();- }- return this._data;- }- },-- /**- * Array containing all the keys in the axis.- - * @attribute keyCollection- * @type Array- */- keyCollection: {- getter: function()- {- var keys = this.get("keys"),- i, - col = [];- for(i in keys)- {- if(keys.hasOwnProperty(i))- {- col.push(i);- }- }- return col;- },- readOnly: true- }- }-});-/**- * NumericAxis manages numeric data on an axis.- *- * @module charts- * @class NumericAxis- * @constructor- * @param {Object} config (optional) Configuration parameters for the Chart.- * @extends AxisType- */-function NumericAxis(config)-{- NumericAxis.superclass.constructor.apply(this, arguments);-}--NumericAxis.NAME = "numericAxis";--NumericAxis.ATTRS = {- /**- * Indicates whether 0 should always be displayed.- *- * @attribute alwaysShowZero- * @type Boolean- */- alwaysShowZero: {- value: true - },- - /**- * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need- * to implement the arguments below and return a `String` or an `HTMLElement`. The default implementation of the method returns a `String`. The output of this method- * will be rendered to the DOM using `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override the Axis' - * `appendLabelFunction` to accept html as a `String`.- * <dl>- * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>- * <dt>format</dt><dd>Object containing properties used to format the label. (optional)</dd>- * </dl>- *- * @attribute labelFunction- * @type Function- */- labelFunction: { - value: function(val, format)- {- if(format)- {- return Y.DataType.Number.format(val, format);- }- return val;- }- },-- /**- * Object containing properties used by the `labelFunction` to format a- * label.- *- * @attribute labelFormat- * @type Object- */- labelFormat: {- value: {- prefix: "",- thousandsSeparator: "",- decimalSeparator: "",- decimalPlaces: "0",- suffix: ""- }- }-};--Y.extend(NumericAxis, Y.AxisType,-{- /**- * Formats a label based on the axis type and optionally specified format.- *- * @method formatLabel- * @param {Object} value- * @param {Object} format Pattern used to format the value.- * @return String- */- formatLabel: function(val, format)- {- if(format)- {- return Y.DataType.Number.format(val, format);- }- return val;- },-- /**- * Returns the sum of all values per key.- *- * @method getTotalByKey- * @param {String} key The identifier for the array whose values will be calculated.- * @return Number- */- getTotalByKey: function(key)- {- var total = 0,- values = this.getDataByKey(key),- i = 0,- val,- len = values ? values.length : 0;- for(; i < len; ++i)- {- val = parseFloat(values[i]);- if(!isNaN(val))- {- total += val;- }- }- return total;- },-- /**- * Type of data used in `Axis`.- *- * @property _type- * @readOnly- * @private- */- _type: "numeric",-- /**- * Helper method for getting a `roundingUnit` when calculating the minimum and maximum values.- *- * @method _getMinimumUnit- * @param {Number} max Maximum number- * @param {Number} min Minimum number- * @param {Number} units Number of units on the axis- * @return Number- * @private- */- _getMinimumUnit:function(max, min, units)- {- return this._getNiceNumber(Math.ceil((max - min)/units));- },-- /**- * Calculates a nice rounding unit based on the range.- *- * @method _getNiceNumber- * @param {Number} roundingUnit The calculated rounding unit.- * @return Number- * @private- */- _getNiceNumber: function(roundingUnit)- {- var tempMajorUnit = roundingUnit,- order = Math.ceil(Math.log(tempMajorUnit) * 0.4342944819032518),- roundedMajorUnit = Math.pow(10, order),- roundedDiff;-- if (roundedMajorUnit / 2 >= tempMajorUnit) - {- roundedDiff = Math.floor((roundedMajorUnit / 2 - tempMajorUnit) / (Math.pow(10,order-1)/2));- tempMajorUnit = roundedMajorUnit/2 - roundedDiff*Math.pow(10,order-1)/2;- }- else - {- tempMajorUnit = roundedMajorUnit;- }- if(!isNaN(tempMajorUnit))- {- return tempMajorUnit;- }- return roundingUnit;-- },-- /**- * Calculates the maximum and minimum values for the `Axis`.- *- * @method _updateMinAndMax- * @private - */- _updateMinAndMax: function()- {- var data = this.get("data"),- max, - min,- len,- num,- i = 0,- key,- setMax = this.get("setMax"),- setMin = this.get("setMin");- if(!setMax || !setMin)- {- if(data && data.length && data.length > 0)- {- len = data.length;- for(; i < len; i++)- { - num = data[i];- if(isNaN(num))- {- if(Y_Lang.isObject(num))- {- min = max = 0;- //hloc values- for(key in num)- {- if(num.hasOwnProperty(key))- {- max = Math.max(num[key], max);- min = Math.min(num[key], min);- }- }- }- max = setMax ? this._setMaximum : max;- min = setMin ? this._setMinimum : min;- continue;- }- - if(setMin)- {- min = this._setMinimum;- }- else if(min === undefined)- {- min = num;- }- else- {- min = Math.min(num, min); - }- if(setMax)- {- max = this._setMaximum;- }- else if(max === undefined)- {- max = num;- }- else- {- max = Math.max(num, max);- }- - this._actualMaximum = max;- this._actualMinimum = min;- }- }- this._roundMinAndMax(min, max, setMin, setMax);- }- },-- /**- * Rounds the mimimum and maximum values based on the `roundingUnit` attribute.- *- * @method _roundMinAndMax- * @param {Number} min Minimum value- * @param {Number} max Maximum value- * @private- */- _roundMinAndMax: function(min, max, setMin, setMax)- {- var roundingUnit,- minimumRange,- minGreaterThanZero = min >= 0,- maxGreaterThanZero = max > 0,- dataRangeGreater,- maxRound,- minRound,- topTicks,- botTicks,- tempMax,- tempMin,- units = this.getTotalMajorUnits() - 1,- alwaysShowZero = this.get("alwaysShowZero"),- roundingMethod = this.get("roundingMethod"),- useIntegers = (max - min)/units >= 1;- if(roundingMethod)- {- if(roundingMethod == "niceNumber")- {- roundingUnit = this._getMinimumUnit(max, min, units);- if(minGreaterThanZero && maxGreaterThanZero)- {- if((alwaysShowZero || min < roundingUnit) && !setMin)- {- min = 0;- roundingUnit = this._getMinimumUnit(max, min, units);- }- else- {- min = this._roundDownToNearest(min, roundingUnit);- }- if(setMax)- {- if(!alwaysShowZero)- {- min = max - (roundingUnit * units);- }- }- else if(setMin)- {- max = min + (roundingUnit * units);- }- else- {- max = this._roundUpToNearest(max, roundingUnit);- }- }- else if(maxGreaterThanZero && !minGreaterThanZero)- {- if(alwaysShowZero)- {- topTicks = Math.round(units/((-1 * min)/max + 1));- topTicks = Math.max(Math.min(topTicks, units - 1), 1);- botTicks = units - topTicks;- tempMax = Math.ceil( max/topTicks );- tempMin = Math.floor( min/botTicks ) * -1;- - if(setMin)- {- while(tempMin < tempMax && botTicks >= 0)- {- botTicks--;- topTicks++;- tempMax = Math.ceil( max/topTicks );- tempMin = Math.floor( min/botTicks ) * -1;- }- //if there are any bottom ticks left calcualate the maximum by multiplying by the tempMin value- //if not, it's impossible to ensure that a zero is shown. skip it- if(botTicks > 0)- {- max = tempMin * topTicks;- }- else- {- max = min + (roundingUnit * units);- }- }- else if(setMax)- {- while(tempMax < tempMin && topTicks >= 0)- {- botTicks++;- topTicks--;- tempMin = Math.floor( min/botTicks ) * -1;- tempMax = Math.ceil( max/topTicks );- }- //if there are any top ticks left calcualate the minimum by multiplying by the tempMax value- //if not, it's impossible to ensure that a zero is shown. skip it- if(topTicks > 0)- {- min = tempMax * botTicks * -1;- }- else- {- min = max - (roundingUnit * units);- }- }- else- {- roundingUnit = Math.max(tempMax, tempMin);- roundingUnit = this._getNiceNumber(roundingUnit); - max = roundingUnit * topTicks;- min = roundingUnit * botTicks * -1;- }- }- else - {- if(setMax)- {- min = max - (roundingUnit * units);- }- else if(setMin)- {- max = min + (roundingUnit * units);- }- else- {- min = this._roundDownToNearest(min, roundingUnit);- max = this._roundUpToNearest(max, roundingUnit);- }- }- }- else- {- if(setMin)- {- if(alwaysShowZero)- {- max = 0;- }- else- {- max = min + (roundingUnit * units);- }- }- else if(!setMax)- {- if(alwaysShowZero || max === 0 || max + roundingUnit > 0)- {- max = 0;- roundingUnit = this._getMinimumUnit(max, min, units);- min = max - (roundingUnit * units);- }- else- {- min = this._roundDownToNearest(min, roundingUnit);- max = this._roundUpToNearest(max, roundingUnit);- }- }- else- {- min = max - (roundingUnit * units);- }- }- }- else if(roundingMethod == "auto") - {- if(minGreaterThanZero && maxGreaterThanZero)- {- if((alwaysShowZero || min < (max-min)/units) && !setMin)- {- min = 0;- }- - roundingUnit = (max - min)/units;- if(useIntegers)- {- roundingUnit = Math.ceil(roundingUnit);- }- max = min + (roundingUnit * units);- }- else if(maxGreaterThanZero && !minGreaterThanZero)- {- if(alwaysShowZero)- {- topTicks = Math.round( units / ( (-1 * min) /max + 1) );- topTicks = Math.max(Math.min(topTicks, units - 1), 1);- botTicks = units - topTicks;-- if(useIntegers)- {- tempMax = Math.ceil( max/topTicks );- tempMin = Math.floor( min/botTicks ) * -1;- }- else- {- tempMax = max/topTicks;- tempMin = min/botTicks * -1;- }- roundingUnit = Math.max(tempMax, tempMin);- max = roundingUnit * topTicks;- min = roundingUnit * botTicks * -1;- }- else- {- roundingUnit = (max - min)/units;- if(useIntegers)- {- roundingUnit = Math.ceil(roundingUnit);- }- min = this._roundDownToNearest(min, roundingUnit);- max = this._roundUpToNearest(max, roundingUnit);- }- }- else- {- roundingUnit = (max - min)/units;- if(useIntegers)- { - roundingUnit = Math.ceil(roundingUnit);- }- if(alwaysShowZero || max === 0 || max + roundingUnit > 0)- {- max = 0;- roundingUnit = (max - min)/units;- if(useIntegers)- {- Math.ceil(roundingUnit);- }- min = max - (roundingUnit * units);- }- else- {- min = this._roundDownToNearest(min, roundingUnit);- max = this._roundUpToNearest(max, roundingUnit);- }-- }- }- else if(!isNaN(roundingMethod) && isFinite(roundingMethod))- {- roundingUnit = roundingMethod;- minimumRange = roundingUnit * units;- dataRangeGreater = (max - min) > minimumRange;- minRound = this._roundDownToNearest(min, roundingUnit);- maxRound = this._roundUpToNearest(max, roundingUnit);- if(setMax)- {- min = max - minimumRange;- }- else if(setMin)- {- max = min + minimumRange;- }- else if(minGreaterThanZero && maxGreaterThanZero)- {- if(alwaysShowZero || minRound <= 0)- {- min = 0;- }- else- {- min = minRound;- }- max = min + minimumRange;- }- else if(maxGreaterThanZero && !minGreaterThanZero)- {- min = minRound;- max = maxRound;- }- else- {- if(alwaysShowZero || maxRound >= 0)- {- max = 0;- }- else- {- max = maxRound;- }- min = max - minimumRange;- }- }- }- this._dataMaximum = max;- this._dataMinimum = min;- },-- /**- * Calculates and returns a value based on the number of labels and the index of- * the current label.- *- * @method getLabelByIndex- * @param {Number} i Index of the label.- * @param {Number} l Total number of labels.- * @return String- */- getLabelByIndex: function(i, l)- {- var min = this.get("minimum"),- max = this.get("maximum"),- increm = (max - min)/(l-1),- label,- roundingMethod = this.get("roundingMethod");- l -= 1;- //respect the min and max. calculate all other labels.- if(i === 0)- {- label = min;- }- else if(i === l)- {- label = max;- }- else- {- label = (i * increm);- if(roundingMethod == "niceNumber")- {- label = this._roundToNearest(label, increm);- }- label += min;- }- return parseFloat(label);- },-- /**- * Rounds a Number to the nearest multiple of an input. For example, by rounding- * 16 to the nearest 10, you will receive 20. Similar to the built-in function Math.round().- *- * @method _roundToNearest- * @param {Number} number Number to round- * @param {Number} nearest Multiple to round towards.- * @return Number- * @private- */- _roundToNearest: function(number, nearest)- {- nearest = nearest || 1;- if(nearest === 0)- {- return number;- }- var roundedNumber = Math.round(this._roundToPrecision(number / nearest, 10)) * nearest;- return this._roundToPrecision(roundedNumber, 10);- },- - /**- * Rounds a Number up to the nearest multiple of an input. For example, by rounding- * 16 up to the nearest 10, you will receive 20. Similar to the built-in function Math.ceil().- *- * @method _roundUpToNearest- * @param {Number} number Number to round- * @param {Number} nearest Multiple to round towards.- * @return Number- * @private- */- _roundUpToNearest: function(number, nearest)- {- nearest = nearest || 1;- if(nearest === 0)- {- return number;- }- return Math.ceil(this._roundToPrecision(number / nearest, 10)) * nearest;- },- - /**- * Rounds a Number down to the nearest multiple of an input. For example, by rounding- * 16 down to the nearest 10, you will receive 10. Similar to the built-in function Math.floor().- *- * @method _roundDownToNearest- * @param {Number} number Number to round- * @param {Number} nearest Multiple to round towards.- * @return Number- * @private- */- _roundDownToNearest: function(number, nearest)- {- nearest = nearest || 1;- if(nearest === 0)- {- return number;- }- return Math.floor(this._roundToPrecision(number / nearest, 10)) * nearest;- },-- /**- * Rounds a number to a certain level of precision. Useful for limiting the number of- * decimal places on a fractional number.- *- * @method _roundToPrecision- * @param {Number} number Number to round- * @param {Number} precision Multiple to round towards.- * @return Number- * @private- */- _roundToPrecision: function(number, precision)- {- precision = precision || 0;- var decimalPlaces = Math.pow(10, precision);- return Math.round(decimalPlaces * number) / decimalPlaces;- },- - /**- * Checks to see if data extends beyond the range of the axis. If so,- * that data will need to be hidden. This method is internal, temporary and subject- * to removal in the future.- *- * @method _hasDataOverflow- * @protected- * @return Boolean- */- _hasDataOverflow: function()- {- var roundingMethod,- min,- max;- if(this.get("setMin") || this.get("setMax"))- {- return true;- }- roundingMethod = this.get("roundingMethod");- min = this._actualMinimum;- max = this._actualMaximum;- if(Y_Lang.isNumber(roundingMethod) && ((Y_Lang.isNumber(max) && max > this._dataMaximum) || (Y_Lang.isNumber(min) && min < this._dataMinimum)))- {- return true;- }- return false;- }-});--Y.NumericAxis = NumericAxis;- -/**- * StackedAxis manages stacked numeric data on an axis.- *- * @module charts- * @class StackedAxis- * @constructor- * @param {Object} config (optional) Configuration parameters for the Chart.- * @extends NumericAxis- */-function StackedAxis(config)-{- StackedAxis.superclass.constructor.apply(this, arguments);-}--StackedAxis.NAME = "stackedAxis";---Y.extend(StackedAxis, Y.NumericAxis,-{- /**- * Calculates the maximum and minimum values for the `Axis`.- *- * @method _updateMinAndMax- * @private - */- _updateMinAndMax: function()- {- var max = 0,- min = 0,- pos = 0,- neg = 0,- len = 0,- i = 0,- key,- num,- keys = this.get("keys"),- setMin = this.get("setMin"),- setMax = this.get("setMax");-- for(key in keys)- {- if(keys.hasOwnProperty(key))- {- len = Math.max(len, keys[key].length);- }- }- for(; i < len; ++i)- {- pos = 0;- neg = 0;- for(key in keys)- {- if(keys.hasOwnProperty(key))- {- num = keys[key][i];- if(isNaN(num))- {- continue;- }- if(num >= 0)- {- pos += num;- }- else- {- neg += num;- }- }- }- if(pos > 0)- {- max = Math.max(max, pos);- }- else - {- max = Math.max(max, neg);- }- if(neg < 0)- {- min = Math.min(min, neg);- }- else- {- min = Math.min(min, pos);- }- }- this._actualMaximum = max;- this._actualMinimum = min;- if(setMax)- {- max = this._setMaximum;- }- if(setMin)- {- min = this._setMinimum;- }- this._roundMinAndMax(min, max, setMin, setMax);- }-});--Y.StackedAxis = StackedAxis;- -/**- * TimeAxis manages time data on an axis.- *- * @module charts- * @class TimeAxis- * @constructor- * @param {Object} config (optional) Configuration parameters for the Chart.- * @extends AxisType- */-function TimeAxis(config)-{- TimeAxis.superclass.constructor.apply(this, arguments);-}--TimeAxis.NAME = "timeAxis";--TimeAxis.ATTRS = -{- /**- * Indicates whether the maximum is calculated or explicitly set. - *- * @attribute setMax- * @readOnly- * @type Boolean- * @private- */- setMax: {- readOnly: true,-- getter: function()- {- var max = this._getNumber(this._setMaximum);- return (Y_Lang.isNumber(max));- }- },-- /**- * Indicates whether the minimum is calculated or explicitly set. - *- * @attribute setMin- * @readOnly- * @type Boolean- * @private- */- setMin: {- readOnly: true,-- getter: function()- {- var min = this._getNumber(this._setMinimum);- return (Y_Lang.isNumber(min));- }- },-- /**- * The maximum value that will appear on an axis. Unless explicitly set, this value is calculated by the `Axis`.- *- * @attribute maximum- * @type Number- */- maximum: {- getter: function ()- {- var max = this._getNumber(this._setMaximum);- if(!Y_Lang.isNumber(max))- {- max = this._getNumber(this.get("dataMaximum"));- }- return parseFloat(max);- },- setter: function (value)- {- this._setMaximum = this._getNumber(value);- return value;- }- },-- /**- * The minimum value that will appear on an axis. Unless explicitly set, this value is calculated by the `Axis`.- *- * @attribute minimum- * @type Number- */- minimum: {- getter: function ()- {- var min = this._getNumber(this._setMinimum);- if(!Y_Lang.isNumber(min)) - {- min = this._getNumber(this.get("dataMinimum"));- }- return parseFloat(min);- },- setter: function (value)- {- this._setMinimum = this._getNumber(value);- return value;- }- },-- /**- * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need- * to implement the arguments below and return a `String` or an `HTMLElement`. The default implementation of the method returns a `String`. The output of this method- * will be rendered to the DOM using `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override the Axis' - * `appendLabelFunction` to accept html as a `String`.- * <dl>- * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>- * <dt>format</dt><dd>STRFTime string used to format the label. (optional)</dd>- * </dl>- *- * @attribute labelFunction- * @type Function- */- labelFunction: {- value: function(val, format)- {- val = Y.DataType.Date.parse(val);- if(format)- {- return Y.DataType.Date.format(val, {format:format});- }- return val;- }- },-- /**- * Pattern used by the `labelFunction` to format a label.- *- * @attribute labelFormat- * @type String- */- labelFormat: {- value: "%b %d, %y"- }-};--Y.extend(TimeAxis, Y.AxisType, {- /**- * Formats a label based on the axis type and optionally specified format.- *- * @method formatLabel- * @param {Object} value- * @param {Object} format Pattern used to format the value.- * @return String- */- formatLabel: function(val, format)- {- val = Y.DataType.Date.parse(val);- if(format)- {- return Y.DataType.Date.format(val, {format:format});- }- return val;- },-- /**- * Constant used to generate unique id.- *- * @property GUID- * @type String- * @private- */- GUID: "yuitimeaxis",- - /**- * Type of data used in `Axis`.- *- * @property _dataType- * @readOnly- * @private- */- _dataType: "time",- - /**- * Calculates and returns a value based on the number of labels and the index of- * the current label.- *- * @method getLabelByIndex- * @param {Number} i Index of the label.- * @param {Number} l Total number of labels.- * @return String- */- getLabelByIndex: function(i, l)- {- var min = this.get("minimum"),- max = this.get("maximum"),- position = this.get("position"),- increm,- label;- l -= 1;- increm = ((max - min)/l) * i;- if(position == "bottom" || position == "top")- {- label = min + increm;- }- else- {- label = max - increm;- }- return label;- },-- /**- * Gets an array of values based on a key.- *- * @method _getKeyArray- * @param {String} key Value key associated with the data array.- * @param {Array} data Array in which the data resides.- * @return Array- * @private- */- _getKeyArray: function(key, data)- {- var obj,- keyArray = [],- i = 0,- val,- len = data.length;- for(; i < len; ++i)- {- obj = data[i][key];- if(Y_Lang.isDate(obj))- { - val = obj.valueOf();- }- else- {- val = new Date(obj);- if(Y_Lang.isDate(val))- {- val = val.valueOf();- }- else if(!Y_Lang.isNumber(obj))- {- if(Y_Lang.isNumber(parseFloat(obj)))- {- val = parseFloat(obj);- }- else- {- if(typeof obj != "string")- {- obj = obj;- }- val = new Date(obj).valueOf();- }- }- else- {- val = obj;- }- }- keyArray[i] = val;- }- return keyArray;- },-- /**- * Sets data by key- *- * @method _setDataByKey- * @param {String} key Key value to use.- * @param {Array} data Array to use.- * @private - */- _setDataByKey: function(key, data)- {- var obj, - arr = [], - dv = this._dataClone.concat(), - i, - val,- len = dv.length;- for(i = 0; i < len; ++i)- {- obj = dv[i][key];- if(Y_Lang.isDate(obj))- { - val = obj.valueOf();- }- else- {- val = new Date(obj);- if(Y_Lang.isDate(val))- {- val = val.valueOf();- }- else if(!Y_Lang.isNumber(obj))- {- if(Y_Lang.isNumber(parseFloat(obj)))- {- val = parseFloat(obj);- }- else- {- if(typeof obj != "string")- {- obj = obj.toString();- }- val = new Date(obj).valueOf();- }- }- else- {- val = obj;- }- }- arr[i] = val;- }- this.get("keys")[key] = arr;- this._updateTotalDataFlag = true;- },-- /**- * Parses value into a number.- *- * @method _getNumber- * @param val {Object} Value to parse into a number- * @return Number- * @private- */- _getNumber: function(val)- {- if(Y_Lang.isDate(val))- {- val = val.valueOf();- }- else if(!Y_Lang.isNumber(val) && val)- {- val = new Date(val).valueOf();- }-- return val;- }-});--Y.TimeAxis = TimeAxis;- -/**- * CategoryAxis manages category data on an axis.- *- * @module charts- * @class CategoryAxis- * @constructor- * @param {Object} config (optional) Configuration parameters for the Chart.- * @extends AxisType- */-function CategoryAxis(config)-{- CategoryAxis.superclass.constructor.apply(this, arguments);-}--CategoryAxis.NAME = "categoryAxis";--Y.extend(CategoryAxis, Y.AxisType,-{- /**- * Formats a label based on the axis type and optionally specified format.- *- * @method formatLabel- * @param {Object} value- * @param {Object} format Pattern used to format the value.- * @return String- */- formatLabel: function(val, format)- {- return val;- },-- /**- * Object storing key data.- *- * @property _indices- * @private- */- _indices: null,-- /**- * Constant used to generate unique id.- *- * @property GUID- * @type String- * @private- */- GUID: "yuicategoryaxis",-- /**- * Type of data used in `Axis`.- *- * @property _dataType- * @readOnly- * @private- */- _type: "category",- - /**- * Calculates the maximum and minimum values for the `Axis`.- *- * @method _updateMinAndMax- * @private - */- _updateMinAndMax: function()- {- this._dataMaximum = Math.max(this.get("data").length - 1, 0);- this._dataMinimum = 0;- },-- /**- * Gets an array of values based on a key.- *- * @method _getKeyArray- * @param {String} key Value key associated with the data array.- * @param {Array} data Array in which the data resides.- * @return Array- * @private- */- _getKeyArray: function(key, data)- {- var i = 0,- obj,- keyArr = [],- labels = [],- len = data.length;- if(!this._indices)- {- this._indices = {};- }- for(; i < len; ++i)- {- obj = data[i];- keyArr[i] = i;- labels[i] = obj[key];- }- this._indices[key] = keyArr;- return labels;- },-- /**- * Sets data by key- *- * @method _setDataByKey- * @param {String} key Key value to use.- * @param {Array} data Array to use.- * @private - */- _setDataByKey: function(key)- {- var i,- obj, - arr = [], - labels = [], - dv = this._dataClone.concat(), - len = dv.length;- if(!this._indices)- {- this._indices = {};- }- for(i = 0; i < len; ++i)- {- obj = dv[i];- arr[i] = i;- labels[i] = obj[key];- }- this._indices[key] = arr;- this.get("keys")[key] = labels.concat();- this._updateTotalDataFlag = true;- },-- /**- * Returns an array of values based on an identifier key.- *- * @method getDataByKey- * @param {String} value value used to identify the array- * @return Array- */- getDataByKey: function (value)- {- if(!this._indices)- {- this.get("keys");- }- var keys = this._indices;- if(keys[value])- {- return keys[value];- }- return null;- },-- /**- * Returns the total number of majorUnits that will appear on an axis.- *- * @method getTotalMajorUnits- * @param {Object} majorUnit Object containing properties related to the majorUnit.- * @param {Number} len Length of the axis.- * @return Number- */- getTotalMajorUnits: function(majorUnit, len)- {- return this.get("data").length;- },- - /**- * Returns the distance between major units on an axis.- *- * @method getMajorUnitDistance- * @param {Number} len Number of ticks- * @param {Number} uiLen Size of the axis.- * @param {Object} majorUnit Hash of properties used to determine the majorUnit- * @return Number- */- getMajorUnitDistance: function(len, uiLen, majorUnit)- {- var dist;- if(majorUnit.determinant === "count")- {- dist = uiLen/len;- }- else if(majorUnit.determinant === "distance")- {- dist = majorUnit.distance;- }- return dist;- },- - /**- * Gets the distance that the first and last ticks are offset from there respective- * edges.- *- * @method getEdgeOffset- * @param {Number} ct Number of ticks on the axis.- * @param {Number} l Length (in pixels) of the axis.- * @return Number- */- getEdgeOffset: function(ct, l)- {- return l/ct;- },-- /**- * Returns a value based of a key value and an index.- *- * @method getKeyValueAt- * @param {String} key value used to look up the correct array- * @param {Number} index within the array- * @return String - */- getKeyValueAt: function(key, index)- {- var value = NaN,- keys = this.get("keys");- if(keys[key] && keys[key][index]) - {- value = keys[key][index];- }- return value;- },- - /**- * Calculates and returns a value based on the number of labels and the index of- * the current label.- *- * @method getLabelByIndex- * @param {Number} i Index of the label.- * @param {Number} l Total number of labels.- * @return String- */- getLabelByIndex: function(i, l)- {- var label,- data = this.get("data"),- position = this.get("position");- if(position == "bottom" || position == "top")- {- label = data[i];- }- else- {- label = data[l - (i + 1)];- } - return label;- },-- /**- * Returns a string corresponding to the first label on an - * axis.- *- * @method getMinimumValue- * @return String- */- getMinimumValue: function()- {- var data = this.get("data"),- label = data[0];- return label;- },-- /**- * Returns a string corresponding to the last label on an - * axis.- *- * @method getMaximumValue- * @return String- */- getMaximumValue: function()- {- var data = this.get("data"),- len = data.length - 1,- label = data[len];- return label;- }-});--Y.CategoryAxis = CategoryAxis;- -/**- * Utility class used for calculating curve points.- *- * @module charts- * @class CurveUtil- * @constructor- */-function CurveUtil()-{-}--CurveUtil.prototype = {- /**- * Creates an array of start, end and control points for splines.- *- * @method getCurveControlPoints- * @param {Array} xcoords Collection of x-coordinates used for calculate the curves- * @param {Array} ycoords Collection of y-coordinates used for calculate the curves- * @return Object- * @protected- */- getCurveControlPoints: function(xcoords, ycoords) - {- var outpoints = [],- i = 1,- l = xcoords.length - 1,- xvals = [],- yvals = [];- - - // Too few points, need at least two- if (l < 1) - {- return null;- } - - outpoints[0] = {- startx: xcoords[0], - starty: ycoords[0],- endx: xcoords[1],- endy: ycoords[1]- };- - // Special case, the Bezier should be a straight line- if (l === 1) - {- outpoints[0].ctrlx1 = (2.0*xcoords[0] + xcoords[1])/3.0; - outpoints[0].ctrly2 = (2.0*ycoords[0] + ycoords[1])/3.0;- outpoints[0].ctrlx2 = 2.0*outpoints[0].ctrlx1 - xcoords[0];- outpoints[0].ctrly2 = 2.0*outpoints[0].ctrly1 - ycoords[0];- return outpoints;- }-- for (; i < l; ++i) - {- outpoints.push({startx: Math.round(xcoords[i]), starty: Math.round(ycoords[i]), endx: Math.round(xcoords[i+1]), endy: Math.round(ycoords[i+1])});- xvals[i] = 4.0 * xcoords[i] + 2*xcoords[i+1];- yvals[i] = 4.0*ycoords[i] + 2*ycoords[i+1];- }- - xvals[0] = xcoords[0] + (2.0 * xcoords[1]);- xvals[l-1] = (8.0 * xcoords[l-1] + xcoords[l]) / 2.0;- xvals = this.getControlPoints(xvals.concat());- yvals[0] = ycoords[0] + (2.0 * ycoords[1]);- yvals[l-1] = (8.0 * ycoords[l-1] + ycoords[l]) / 2.0; - yvals = this.getControlPoints(yvals.concat());- - for (i = 0; i < l; ++i) - {- outpoints[i].ctrlx1 = Math.round(xvals[i]);- outpoints[i].ctrly1 = Math.round(yvals[i]);- - if (i < l-1) - {- outpoints[i].ctrlx2 = Math.round(2*xcoords[i+1] - xvals[i+1]);- outpoints[i].ctrly2 = Math.round(2*ycoords[i+1] - yvals[i+1]);- }- else - {- outpoints[i].ctrlx2 = Math.round((xcoords[l] + xvals[l-1])/2);- outpoints[i].ctrly2 = Math.round((ycoords[l] + yvals[l-1])/2);- }- }- - return outpoints; - },-- /**- * Gets the control points for the curve.- *- * @method getControlPoints- * @param {Array} vals Collection of values coords used to generate control points.- * @return Array- * @private- */- getControlPoints: function(vals) - {- var l = vals.length,- x = [],- tmp = [],- b = 2.0,- i = 1;- x[0] = vals[0] / b;- for (; i < l; ++i) - {- tmp[i] = 1/b;- b = (i < l-1 ? 4.0 : 3.5) - tmp[i];- x[i] = (vals[i] - x[i-1]) / b;- }- - for (i = 1; i < l; ++i) - {- x[l-i-1] -= tmp[l-i] * x[l-i];- }- - return x;- }-};-Y.CurveUtil = CurveUtil;-/**- * Utility class used for creating stacked series.- *- * @module charts- * @class StackingUtil- * @constructor- */-function StackingUtil(){}--StackingUtil.prototype = {- /**- * @protected- *- * Adjusts coordinate values for stacked series.- *- * @method _stackCoordinates- */- _stackCoordinates: function() - {- var direction = this.get("direction"),- order = this.get("order"),- type = this.get("type"),- graph = this.get("graph"),- h = graph.get("height"), - seriesCollection = graph.seriesTypes[type],- i = 0,- len,- xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- prevXCoords,- prevYCoords;- if(order === 0)- {- return;- }- prevXCoords = seriesCollection[order - 1].get("xcoords").concat();- prevYCoords = seriesCollection[order - 1].get("ycoords").concat();- if(direction === "vertical")- {- len = prevXCoords.length;- for(; i < len; ++i)- {- if(!isNaN(prevXCoords[i]) && !isNaN(xcoords[i]))- {- xcoords[i] += prevXCoords[i];- }- }- }- else- {- len = prevYCoords.length;- for(; i < len; ++i)- {- if(!isNaN(prevYCoords[i]) && !isNaN(ycoords[i]))- {- ycoords[i] = prevYCoords[i] - (h - ycoords[i]);- }- }- }- }-};-Y.StackingUtil = StackingUtil;-/**- * Utility class used for drawing lines.- *- * @module charts- * @class Lines- * @constructor- */-function Lines(){}--Lines.prototype = {- /**- * @property _lineDefaults- * @type Object- * @private- */- _lineDefaults: null,- - /**- * Creates a graphic in which to draw a series.- *- * @method _getGraphic- * @return Graphic- * @private- */- _getGraphic: function()- {- var graphic = this.get("graphic") || this.get("graph").get("graphic");- if(!this._lineGraphic)- {- this._lineGraphic = graphic.addShape({type: "path"});- }- this._lineGraphic.clear();- return this._lineGraphic;- },- - /**- * Toggles visibility- *- * @method _toggleVisible- * @param {Boolean} visible indicates visibilitye- * @private- */- _toggleVisible: function(visible)- {- if(this._lineGraphic)- {- this._lineGraphic.set("visible", visible);- }- },-- /**- * Draws lines for the series.- *- * @method drawLines- * @protected- */- drawLines: function()- {- if(this.get("xcoords").length < 1) - {- return;- }- var isNumber = Y_Lang.isNumber,- xcoords = this.get("xcoords").concat(),- ycoords = this.get("ycoords").concat(),- direction = this.get("direction"),- len = direction === "vertical" ? ycoords.length : xcoords.length,- lastPointValid,- pointValid,- noPointsRendered = true,- lastValidX,- lastValidY,- nextX,- nextY,- i,- styles = this.get("styles").line,- lineType = styles.lineType,- lc = styles.color || this._getDefaultColor(this.get("graphOrder"), "line"),- lineAlpha = styles.alpha,- dashLength = styles.dashLength,- gapSpace = styles.gapSpace,- connectDiscontinuousPoints = styles.connectDiscontinuousPoints,- discontinuousType = styles.discontinuousType,- discontinuousDashLength = styles.discontinuousDashLength,- discontinuousGapSpace = styles.discontinuousGapSpace,- path = this._getGraphic();- path.set("stroke", {- weight: styles.weight, - color: lc, - opacity: lineAlpha- });- for(i = 0; i < len; i = ++i)- {- nextX = xcoords[i];- nextY = ycoords[i];- pointValid = isNumber(nextX) && isNumber(nextY); - if(!pointValid)- {- lastPointValid = pointValid;- continue;- }- if(noPointsRendered)- {- noPointsRendered = false;- path.moveTo(nextX, nextY);- }- else if(lastPointValid)- {- if(lineType != "dashed")- {- path.lineTo(nextX, nextY);- }- else- {- this.drawDashedLine(path, lastValidX, lastValidY, nextX, nextY, - dashLength, - gapSpace);- }- }- else if(!connectDiscontinuousPoints)- {- path.moveTo(nextX, nextY);- }- else- {- if(discontinuousType != "solid")- {- this.drawDashedLine(path, lastValidX, lastValidY, nextX, nextY, - discontinuousDashLength, - discontinuousGapSpace);- }- else- {- path.lineTo(nextX, nextY);- }- }- lastValidX = nextX;- lastValidY = nextY;- lastPointValid = true;- }- path.end();- },- - /**- * Connects data points with a consistent curve for a series.- * - * @method drawSpline- * @protected- */- drawSpline: function()- {- if(this.get("xcoords").length < 1) - {- return;- }- var xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- curvecoords = this.getCurveControlPoints(xcoords, ycoords),- len = curvecoords.length,- cx1,- cx2,- cy1,- cy2,- x,- y,- i = 0,- styles = this.get("styles").line,- path = this._getGraphic(),- lineAlpha = styles.alpha,- color = styles.color || this._getDefaultColor(this.get("graphOrder"), "line");- path.set("stroke", { - weight: styles.weight, - color: color, - opacity: lineAlpha- });- path.moveTo(xcoords[0], ycoords[0]);- for(; i < len; i = ++i)- {- x = curvecoords[i].endx;- y = curvecoords[i].endy;- cx1 = curvecoords[i].ctrlx1;- cx2 = curvecoords[i].ctrlx2;- cy1 = curvecoords[i].ctrly1;- cy2 = curvecoords[i].ctrly2;- path.curveTo(cx1, cy1, cx2, cy2, x, y);- }- path.end();- },-- /**- * Draws a dashed line between two points.- * - * @method drawDashedLine- * @param {Number} xStart The x position of the start of the line- * @param {Number} yStart The y position of the start of the line- * @param {Number} xEnd The x position of the end of the line- * @param {Number} yEnd The y position of the end of the line- * @param {Number} dashSize the size of dashes, in pixels- * @param {Number} gapSize the size of gaps between dashes, in pixels- * @private- */- drawDashedLine: function(path, xStart, yStart, xEnd, yEnd, dashSize, gapSize)- {- dashSize = dashSize || 10;- gapSize = gapSize || 10;- var segmentLength = dashSize + gapSize,- xDelta = xEnd - xStart,- yDelta = yEnd - yStart,- delta = Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2)),- segmentCount = Math.floor(Math.abs(delta / segmentLength)),- radians = Math.atan2(yDelta, xDelta),- xCurrent = xStart,- yCurrent = yStart,- i;- xDelta = Math.cos(radians) * segmentLength;- yDelta = Math.sin(radians) * segmentLength;- - for(i = 0; i < segmentCount; ++i)- {- path.moveTo(xCurrent, yCurrent);- path.lineTo(xCurrent + Math.cos(radians) * dashSize, yCurrent + Math.sin(radians) * dashSize);- xCurrent += xDelta;- yCurrent += yDelta;- }- - path.moveTo(xCurrent, yCurrent);- delta = Math.sqrt((xEnd - xCurrent) * (xEnd - xCurrent) + (yEnd - yCurrent) * (yEnd - yCurrent));- - if(delta > dashSize)- {- path.lineTo(xCurrent + Math.cos(radians) * dashSize, yCurrent + Math.sin(radians) * dashSize);- }- else if(delta > 0)- {- path.lineTo(xCurrent + Math.cos(radians) * delta, yCurrent + Math.sin(radians) * delta);- }- - path.moveTo(xEnd, yEnd);- },-- /**- * Default values for `styles` attribute.- *- * @method _getLineDefaults- * @return Object- * @protected- */- _getLineDefaults: function()- {- return {- alpha: 1,- weight: 6,- lineType:"solid", - dashLength:10, - gapSpace:10, - connectDiscontinuousPoints:true, - discontinuousType:"solid", - discontinuousDashLength:10, - discontinuousGapSpace:10- };- }-};-Y.augment(Lines, Y.Attribute);-Y.Lines = Lines;-/**- * Utility class used for drawing area fills.- *- * @module charts- * @class Fills- * @constructor- */-function Fills(cfg)-{- var attrs = {- area: {- getter: function()- {- return this._defaults || this._getAreaDefaults();- },-- setter: function(val)- {- var defaults = this._defaults || this._getAreaDefaults();- this._defaults = Y.merge(defaults, val);- }- }- };- this.addAttrs(attrs, cfg);- this.get("styles");-}--Fills.prototype = {- /**- * Returns a path shape used for drawing fills.- *- * @method _getPath- * @return Path- * @private- */- _getPath: function()- {- var path = this._path;- if(!path)- {- path = this.get("graph").get("graphic").addShape({type:"path"});- this._path = path;- }- return path;- },- - /**- * Toggles visibility- *- * @method _toggleVisible- * @param {Boolean} visible indicates visibilitye- * @private- */- _toggleVisible: function(visible)- { - if(this._path)- {- this._path.set("visible", visible);- }- },-- /**- * Draws fill- *- * @method drawFill- * @param {Array} xcoords The x-coordinates for the series.- * @param {Array} ycoords The y-coordinates for the series.- * @protected- */- drawFill: function(xcoords, ycoords)- {- if(xcoords.length < 1) - {- return;- }- var len = xcoords.length,- firstX = xcoords[0],- firstY = ycoords[0],- lastValidX = firstX,- lastValidY = firstY,- nextX,- nextY,- i = 1,- styles = this.get("styles").area,- path = this._getPath(),- color = styles.color || this._getDefaultColor(this.get("graphOrder"), "slice");- path.clear();- path.set("fill", {- color: color, - opacity: styles.alpha- });- path.set("stroke", {weight: 0});- path.moveTo(firstX, firstY);- for(; i < len; i = ++i)- {- nextX = xcoords[i];- nextY = ycoords[i];- if(isNaN(nextY))- {- lastValidX = nextX;- lastValidY = nextY;- continue;- }- path.lineTo(nextX, nextY);- lastValidX = nextX;- lastValidY = nextY;- }- path.end();- },- - /**- * Draws a fill for a spline- *- * @method drawAreaSpline- * @protected- */- drawAreaSpline: function()- {- if(this.get("xcoords").length < 1) - {- return;- }- var xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- curvecoords = this.getCurveControlPoints(xcoords, ycoords),- len = curvecoords.length,- cx1,- cx2,- cy1,- cy2,- x,- y,- i = 0,- firstX = xcoords[0],- firstY = ycoords[0],- styles = this.get("styles").area,- path = this._getPath(),- color = styles.color || this._getDefaultColor(this.get("graphOrder"), "slice");- path.set("fill", {- color: color, - opacity: styles.alpha- });- path.set("stroke", {weight: 0});- path.moveTo(firstX, firstY);- for(; i < len; i = ++i)- {- x = curvecoords[i].endx;- y = curvecoords[i].endy;- cx1 = curvecoords[i].ctrlx1;- cx2 = curvecoords[i].ctrlx2;- cy1 = curvecoords[i].ctrly1;- cy2 = curvecoords[i].ctrly2;- path.curveTo(cx1, cy1, cx2, cy2, x, y);- }- if(this.get("direction") === "vertical")- {- path.lineTo(this._leftOrigin, y);- path.lineTo(this._leftOrigin, firstY);- }- else- {- path.lineTo(x, this._bottomOrigin);- path.lineTo(firstX, this._bottomOrigin);- }- path.lineTo(firstX, firstY);- path.end();- },- - /**- * Draws a a stacked area spline- *- * @method drawStackedAreaSpline- * @protected- */- drawStackedAreaSpline: function()- {- if(this.get("xcoords").length < 1) - {- return;- }- var xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- curvecoords,- order = this.get("order"),- type = this.get("type"),- graph = this.get("graph"),- seriesCollection = graph.seriesTypes[type],- prevXCoords,- prevYCoords,- len,- cx1,- cx2,- cy1,- cy2,- x,- y,- i = 0,- firstX,- firstY,- styles = this.get("styles").area,- path = this._getPath(),- color = styles.color || this._getDefaultColor(this.get("graphOrder"), "slice");- firstX = xcoords[0];- firstY = ycoords[0];- curvecoords = this.getCurveControlPoints(xcoords, ycoords);- len = curvecoords.length;- path.set("fill", {- color: color, - opacity: styles.alpha- });- path.set("stroke", {weight: 0});- path.moveTo(firstX, firstY);- for(; i < len; i = ++i)- {- x = curvecoords[i].endx;- y = curvecoords[i].endy;- cx1 = curvecoords[i].ctrlx1;- cx2 = curvecoords[i].ctrlx2;- cy1 = curvecoords[i].ctrly1;- cy2 = curvecoords[i].ctrly2;- path.curveTo(cx1, cy1, cx2, cy2, x, y);- }- if(order > 0)- {- prevXCoords = seriesCollection[order - 1].get("xcoords").concat().reverse();- prevYCoords = seriesCollection[order - 1].get("ycoords").concat().reverse();- curvecoords = this.getCurveControlPoints(prevXCoords, prevYCoords);- i = 0;- len = curvecoords.length;- path.lineTo(prevXCoords[0], prevYCoords[0]);- for(; i < len; i = ++i)- {- x = curvecoords[i].endx;- y = curvecoords[i].endy;- cx1 = curvecoords[i].ctrlx1;- cx2 = curvecoords[i].ctrlx2;- cy1 = curvecoords[i].ctrly1;- cy2 = curvecoords[i].ctrly2;- path.curveTo(cx1, cy1, cx2, cy2, x, y);- }- }- else- {- if(this.get("direction") === "vertical")- {- path.lineTo(this._leftOrigin, ycoords[ycoords.length-1]);- path.lineTo(this._leftOrigin, firstY);- }- else- {- path.lineTo(xcoords[xcoords.length-1], this._bottomOrigin);- path.lineTo(firstX, this._bottomOrigin);- }-- }- path.lineTo(firstX, firstY);- path.end();- },- - /**- * Storage for default area styles.- *- * @property _defaults- * @type Object- * @private- */- _defaults: null,-- /**- * Concatenates coordinate array with correct coordinates for closing an area fill.- *- * @method _getClosingPoints- * @return Array- * @protected- */- _getClosingPoints: function()- {- var xcoords = this.get("xcoords").concat(),- ycoords = this.get("ycoords").concat();- if(this.get("direction") === "vertical")- {- xcoords.push(this._leftOrigin);- xcoords.push(this._leftOrigin);- ycoords.push(ycoords[ycoords.length - 1]);- ycoords.push(ycoords[0]);- }- else- {- xcoords.push(xcoords[xcoords.length - 1]);- xcoords.push(xcoords[0]);- ycoords.push(this._bottomOrigin);- ycoords.push(this._bottomOrigin);- }- xcoords.push(xcoords[0]);- ycoords.push(ycoords[0]);- return [xcoords, ycoords];- },-- /**- * Concatenates coordinate array with the correct coordinates for closing an area stack.- *- * @method _getStackedClosingPoints- * @return Array- * @protected- */- _getStackedClosingPoints: function()- {- var order = this.get("order"),- type = this.get("type"),- graph = this.get("graph"),- direction = this.get("direction"),- seriesCollection = graph.seriesTypes[type],- prevXCoords,- prevYCoords,- allXCoords = this.get("xcoords").concat(),- allYCoords = this.get("ycoords").concat(),- firstX = allXCoords[0],- firstY = allYCoords[0];- - if(order > 0)- {- prevXCoords = seriesCollection[order - 1].get("xcoords").concat();- prevYCoords = seriesCollection[order - 1].get("ycoords").concat();- allXCoords = allXCoords.concat(prevXCoords.concat().reverse());- allYCoords = allYCoords.concat(prevYCoords.concat().reverse());- allXCoords.push(allXCoords[0]);- allYCoords.push(allYCoords[0]);- }- else- {- if(direction === "vertical")- {- allXCoords.push(this._leftOrigin);- allXCoords.push(this._leftOrigin);- allYCoords.push(allYCoords[allYCoords.length-1]);- allYCoords.push(firstY);- }- else- {- allXCoords.push(allXCoords[allXCoords.length-1]);- allXCoords.push(firstX);- allYCoords.push(this._bottomOrigin);- allYCoords.push(this._bottomOrigin);- }- }- return [allXCoords, allYCoords];- },-- /**- * Returns default values for area styles.- *- * @method _getAreaDefaults- * @return Object- * @private- */- _getAreaDefaults: function()- {- return {- };- }-};-Y.augment(Fills, Y.Attribute);-Y.Fills = Fills;-/**- * Utility class used for drawing markers.- *- * @module charts- * @class Plots- * @constructor- */-function Plots(cfg)-{- var attrs = { - markers: {- getter: function()- {- return this._markers;- }- }- };- this.addAttrs(attrs, cfg);-}--Plots.prototype = {- /**- * Storage for default marker styles.- *- * @property _plotDefaults- * @type Object- * @private- */- _plotDefaults: null,-- /**- * Draws the markers- *- * @method drawPlots- * @protected- */- drawPlots: function()- {- if(!this.get("xcoords") || this.get("xcoords").length < 1) - {- return;- }- var isNumber = Y_Lang.isNumber,- style = Y.clone(this.get("styles").marker),- w = style.width,- h = style.height,- xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- i = 0,- len = xcoords.length,- top = ycoords[0],- left,- marker,- offsetWidth = w/2,- offsetHeight = h/2,- xvalues,- yvalues,- fillColors = null,- borderColors = null,- graphOrder = this.get("graphOrder"),- groupMarkers = this.get("groupMarkers");- if(groupMarkers)- {- xvalues = [];- yvalues = [];- for(; i < len; ++i)- {- xvalues.push(parseFloat(xcoords[i] - offsetWidth));- yvalues.push(parseFloat(ycoords[i] - offsetHeight));- }- this._createGroupMarker({- xvalues: xvalues,- yvalues: yvalues,- fill: style.fill,- border: style.border,- dimensions: {- width: w,- height: h- },- graphOrder: graphOrder,- shape: style.shape- });- return;- }- if(Y_Lang.isArray(style.fill.color))- {- fillColors = style.fill.color.concat(); - }- if(Y_Lang.isArray(style.border.color))- {- borderColors = style.border.color.concat();- }- this._createMarkerCache();- for(; i < len; ++i)- {- top = parseFloat(ycoords[i] - offsetHeight);- left = parseFloat(xcoords[i] - offsetWidth); - if(!isNumber(left) || !isNumber(top))- {- this._markers.push(null);- continue;- }- if(fillColors)- {- style.fill.color = fillColors[i % fillColors.length];- }- if(borderColors)- {- style.border.color = borderColors[i % borderColors.length];- }-- style.x = left;- style.y = top;- marker = this.getMarker(style, graphOrder, i);- }- this._clearMarkerCache();- },-- /**- * Pre-defined group shapes.- *- * @property _groupShapes- * @private- */- _groupShapes: {- circle: Y.CircleGroup,- rect: Y.RectGroup,- ellipse: Y.EllipseGroup,- diamond: Y.DiamondGroup- },-- /**- * Returns the correct group shape class.- *- * @method _getGroupShape- * @param {Shape | String} shape Indicates which shape class. - * @return Function- * @protected- */- _getGroupShape: function(shape)- {- if(Y_Lang.isString(shape))- {- shape = this._groupShapes[shape];- }- return shape;- },-- /**- * Gets the default values for series that use the utility. This method is used by- * the class' `styles` attribute's getter to get build default values.- *- * @method _getPlotDefaults- * @return Object- * @protected- */- _getPlotDefaults: function()- {- var defs = {- fill:{- type: "solid",- alpha: 1,- colors:null,- alphas: null,- ratios: null- },- border:{- weight: 1,- alpha: 1- },- width: 10,- height: 10,- shape: "circle"- };- defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");- defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");- return defs;- },-- /**- * Collection of markers to be used in the series.- *- * @property _markers- * @type Array- * @private- */- _markers: null,-- /**- * Collection of markers to be re-used on a series redraw.- *- * @property _markerCache- * @type Array- * @private- */- _markerCache: null,- - /**- * Gets and styles a marker. If there is a marker in cache, it will use it. Otherwise- * it will create one.- *- * @method getMarker- * @param {Object} styles Hash of style properties.- * @param {Number} order Order of the series.- * @param {Number} index Index within the series associated with the marker.- * @return Shape- * @protected- */- getMarker: function(styles, order, index)- {- var marker,- border = styles.border;- styles.id = this.get("chart").get("id") + "_" + order + "_" + index;- //fix name differences between graphic layer- border.opacity = border.alpha;- styles.stroke = border;- styles.fill.opacity = styles.fill.alpha;- if(this._markerCache.length > 0)- {- while(!marker)- {- if(this._markerCache.length < 1)- {- marker = this._createMarker(styles, order, index);- break;- }- marker = this._markerCache.shift();-- }- marker.set(styles);- }- else- {- marker = this._createMarker(styles, order, index);- }- this._markers.push(marker);- return marker;- },- - /**- * Creates a shape to be used as a marker.- *- * @method _createMarker- * @param {Object} styles Hash of style properties.- * @param {Number} order Order of the series.- * @param {Number} index Index within the series associated with the marker.- * @return Shape- * @private- */- _createMarker: function(styles, order, index)- {- var graphic = this.get("graphic"),- marker,- cfg = Y.clone(styles);- graphic.set("autoDraw", false);- cfg.type = cfg.shape;- marker = graphic.addShape(cfg); - marker.addClass(SERIES_MARKER);- return marker;- },- - /**- * Creates a cache of markers for reuse.- *- * @method _createMarkerCache- * @private- */- _createMarkerCache: function()- {- if(this._groupMarker)- {- this._groupMarker.destroy();- this._groupMarker = null;- }- if(this._markers && this._markers.length > 0)- {- this._markerCache = this._markers.concat();- }- else- {- this._markerCache = [];- }- this._markers = [];- },- - /**- * Draws a series of markers in a single shape instance.- *- * @method _createGroupMarkers- * @param {Object} styles Set of configuration properties used to create the markers.- * @protected- */- _createGroupMarker: function(styles)- {- var marker,- markers = this.get("markers"),- border = styles.border,- graphic,- cfg,- shape;- if(markers && markers.length > 0)- {- while(markers.length > 0)- {- marker = markers.shift();- marker.destroy();- }- this.set("markers", []);- }- //fix name differences between graphic layer- border.opacity = border.alpha;- cfg = {- id: this.get("chart").get("id") + "_" + styles.graphOrder,- stroke: border,- fill: styles.fill,- dimensions: styles.dimensions,- xvalues: styles.xvalues,- yvalues: styles.yvalues- };- cfg.fill.opacity = styles.fill.alpha;- shape = this._getGroupShape(styles.shape);- if(shape)- {- cfg.type = shape;- }- if(styles.hasOwnProperty("radius") && !isNaN(styles.radius))- {- cfg.dimensions.radius = styles.radius;- }- if(this._groupMarker)- {- this._groupMarker.destroy();- }- graphic = this.get("graphic");- graphic.set("autoDraw", true);- this._groupMarker = graphic.addShape(cfg);- },-- /**- * Toggles visibility- *- * @method _toggleVisible- * @param {Boolean} visible indicates visibilitye- * @private- */- _toggleVisible: function(visible)- {- var marker,- markers = this.get("markers"),- i = 0,- len;- if(markers)- {- len = markers.length;- for(; i < len; ++i)- {- marker = markers[i];- if(marker)- {- marker.set("visible", visible);- }- }- }- },-- /**- * Removes unused markers from the marker cache- *- * @method _clearMarkerCache- * @private- */- _clearMarkerCache: function()- {- var marker;- while(this._markerCache.length > 0)- {- marker = this._markerCache.shift();- if(marker)- {- marker.destroy();- }- }- },-- /**- * Resizes and positions markers based on a mouse interaction.- *- * @method updateMarkerState- * @param {String} type state of the marker- * @param {Number} i index of the marker- * @protected- */- updateMarkerState: function(type, i)- {- if(this._markers && this._markers[i])- {- var w,- h,- styles = Y.clone(this.get("styles").marker),- state = this._getState(type),- xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- marker = this._markers[i],- markerStyles = state == "off" || !styles[state] ? styles : styles[state]; - markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);- markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);- markerStyles.stroke = markerStyles.border;- marker.set(markerStyles);- w = markerStyles.width;- h = markerStyles.height;- marker.set("x", (xcoords[i] - w/2));- marker.set("y", (ycoords[i] - h/2));- marker.set("visible", this.get("visible"));- }- },-- /**- * Parses a color from an array.- *- * @method _getItemColor- * @param {Array} val collection of colors- * @param {Number} i index of the item- * @return String- * @protected- */- _getItemColor: function(val, i)- {- if(Y_Lang.isArray(val))- {- return val[i % val.length];- }- return val;- },-- /**- * Method used by `styles` setter. Overrides base implementation.- *- * @method _setStyles- * @param {Object} newStyles Hash of properties to update.- * @return Object- * @protected- */- _setStyles: function(val)- {- val = this._parseMarkerStyles(val);- return Y.Renderer.prototype._setStyles.apply(this, [val]);- },-- /**- * Combines new styles with existing styles.- *- * @method _parseMarkerStyles- * @param {Object} Object containing style properties for the marker.- * @return Object- * @private- */- _parseMarkerStyles: function(val)- {- if(val.marker)- {- var defs = this._getPlotDefaults();- val.marker = this._mergeStyles(val.marker, defs);- if(val.marker.over)- {- val.marker.over = this._mergeStyles(val.marker.over, val.marker);- }- if(val.marker.down)- {- val.marker.down = this._mergeStyles(val.marker.down, val.marker);- }- }- return val;- },-- /**- * Returns marker state based on event type- *- * @method _getState- * @param {String} type event type- * @return String- * @protected- */- _getState: function(type)- {- var state;- switch(type)- {- case "mouseout" :- state = "off";- break;- case "mouseover" :- state = "over";- break;- case "mouseup" :- state = "over";- break;- case "mousedown" :- state = "down";- break;- }- return state;- },- - /**- * @property _statSyles- * @type Object- * @private- */- _stateSyles: null-};--Y.augment(Plots, Y.Attribute);-Y.Plots = Plots;-/**- * Histogram is the base class for Column and Bar series.- *- * @module charts- * @class Histogram- * @constructor- */-function Histogram(){}--Histogram.prototype = {- /**- * Draws the series.- *- * @method drawSeries- * @protected- */- drawSeries: function()- {- if(this.get("xcoords").length < 1) - {- return;- }- var style = Y.clone(this.get("styles").marker),- setSize,- calculatedSize,- xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- i = 0,- len = xcoords.length,- top = ycoords[0],- type = this.get("type"),- graph = this.get("graph"),- seriesCollection = graph.seriesTypes[type],- seriesLen = seriesCollection.length,- seriesSize = 0,- totalSize = 0,- offset = 0,- ratio,- renderer,- order = this.get("order"),- graphOrder = this.get("graphOrder"),- left,- marker,- setSizeKey,- calculatedSizeKey,- config,- fillColors = null,- borderColors = null,- xMarkerPlane = [],- yMarkerPlane = [],- xMarkerPlaneLeft,- xMarkerPlaneRight,- yMarkerPlaneTop,- yMarkerPlaneBottom,- dimensions = {- width: [],- height: []- },- xvalues = [],- yvalues = [],- groupMarkers = this.get("groupMarkers");- if(Y_Lang.isArray(style.fill.color))- {- fillColors = style.fill.color.concat(); - }- if(Y_Lang.isArray(style.border.color))- {- borderColors = style.border.color.concat();- }- if(this.get("direction") == "vertical")- {- setSizeKey = "height";- calculatedSizeKey = "width";- }- else- {- setSizeKey = "width";- calculatedSizeKey = "height";- }- setSize = style[setSizeKey];- calculatedSize = style[calculatedSizeKey];- this._createMarkerCache();- for(; i < seriesLen; ++i)- {- renderer = seriesCollection[i];- seriesSize += renderer.get("styles").marker[setSizeKey];- if(order > i) - {- offset = seriesSize;- }- }- totalSize = len * seriesSize;- this._maxSize = graph.get(setSizeKey);- if(totalSize > this._maxSize)- {- ratio = graph.get(setSizeKey)/totalSize;- seriesSize *= ratio;- offset *= ratio;- setSize *= ratio;- setSize = Math.max(setSize, 1);- this._maxSize = setSize;- }- offset -= seriesSize/2;- for(i = 0; i < len; ++i)- {- xMarkerPlaneLeft = xcoords[i] - seriesSize/2;- xMarkerPlaneRight = xMarkerPlaneLeft + seriesSize;- yMarkerPlaneTop = ycoords[i] - seriesSize/2;- yMarkerPlaneBottom = yMarkerPlaneTop + seriesSize;- xMarkerPlane.push({start: xMarkerPlaneLeft, end: xMarkerPlaneRight});- yMarkerPlane.push({start: yMarkerPlaneTop, end: yMarkerPlaneBottom});- if(isNaN(xcoords[i]) || isNaN(ycoords[i]))- {- this._markers.push(null);- continue;- }- config = this._getMarkerDimensions(xcoords[i], ycoords[i], calculatedSize, offset);- if(!isNaN(config.calculatedSize) && config.calculatedSize > 0)- {- top = config.top;- left = config.left;-- if(groupMarkers)- {- dimensions[setSizeKey][i] = setSize;- dimensions[calculatedSizeKey][i] = config.calculatedSize;- xvalues.push(left);- yvalues.push(top);- }- else- {- style[setSizeKey] = setSize;- style[calculatedSizeKey] = config.calculatedSize;- style.x = left;- style.y = top;- if(fillColors)- {- style.fill.color = fillColors[i % fillColors.length];- }- if(borderColors)- {- style.border.color = borderColors[i % borderColors.length];- }- marker = this.getMarker(style, graphOrder, i);- }-- }- else if(!groupMarkers)- {- this._markers.push(null);- }- }- this.set("xMarkerPlane", xMarkerPlane);- this.set("yMarkerPlane", yMarkerPlane);- if(groupMarkers)- {- this._createGroupMarker({- fill: style.fill,- border: style.border,- dimensions: dimensions,- xvalues: xvalues,- yvalues: yvalues,- shape: style.shape- });- }- else- {- this._clearMarkerCache();- }- },- - /**- * Collection of default colors used for marker fills in a series when not specified by user.- *- * @property _defaultFillColors- * @type Array- * @protected- */- _defaultFillColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],- - /**- * Gets the default style values for the markers.- *- * @method _getPlotDefaults- * @return Object- * @private- */- _getPlotDefaults: function()- {- var defs = {- fill:{- type: "solid",- alpha: 1,- colors:null,- alphas: null,- ratios: null- },- border:{- weight: 0,- alpha: 1- },- width: 12,- height: 12,- shape: "rect",-- padding:{- top: 0,- left: 0,- right: 0,- bottom: 0- }- };- defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");- defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");- return defs;- }-};--Y.Histogram = Histogram;-/**- * The CartesianSeries class creates a chart with horizontal and vertical axes.- *- * @module charts- * @class CartesianSeries- * @extends Base- * @uses Renderer- * @constructor- */-Y.CartesianSeries = Y.Base.create("cartesianSeries", Y.Base, [Y.Renderer], {- /**- * Storage for `xDisplayName` attribute.- *- * @property _xDisplayName- * @type String- * @private- */- _xDisplayName: null,-- /**- * Storage for `yDisplayName` attribute.- *- * @property _yDisplayName- * @type String- * @private- */- _yDisplayName: null,- - /**- * Th x-coordinate for the left edge of the series.- *- * @property _leftOrigin- * @type String- * @private- */- _leftOrigin: null,-- /**- * The y-coordinate for the bottom edge of the series.- * - * @property _bottomOrigin- * @type String- * @private- */- _bottomOrigin: null,-- /**- * @method render- * @private- */- render: function()- {- this._setCanvas();- this.addListeners();- this.set("rendered", true);- this.validate();- },-- /**- * Adds event listeners.- *- * @method addListeners- * @private- */- addListeners: function()- {- var xAxis = this.get("xAxis"),- yAxis = this.get("yAxis");- if(xAxis)- {- xAxis.after("dataReady", Y.bind(this._xDataChangeHandler, this));- xAxis.after("dataUpdate", Y.bind(this._xDataChangeHandler, this));- }- if(yAxis)- {- yAxis.after("dataReady", Y.bind(this._yDataChangeHandler, this));- yAxis.after("dataUpdate", Y.bind(this._yDataChangeHandler, this));- }- this.after("xAxisChange", this._xAxisChangeHandler);- this.after("yAxisChange", this._yAxisChangeHandler);- this.after("stylesChange", function(e) {- var axesReady = this._updateAxisData();- if(axesReady)- {- this.draw();- }- });- this.after("widthChange", function(e) {- var axesReady = this._updateAxisData();- if(axesReady)- {- this.draw();- }- });- this.after("heightChange", function(e) {- var axesReady = this._updateAxisData();- if(axesReady)- {- this.draw();- }- });- this.after("visibleChange", this._handleVisibleChange);- },- - /**- * Event handler for the xAxisChange event.- *- * @method _xAxisChangeHandler- * @param {Object} e Event object.- * @private- */- _xAxisChangeHandler: function(e)- {- var xAxis = this.get("xAxis");- xAxis.after("dataReady", Y.bind(this._xDataChangeHandler, this));- xAxis.after("dataUpdate", Y.bind(this._xDataChangeHandler, this));- },- - /**- * Event handler the yAxisChange event.- *- * @method _yAxisChangeHandler- * @param {Object} e Event object.- * @private- */- _yAxisChangeHandler: function(e)- {- var yAxis = this.get("yAxis");- yAxis.after("dataReady", Y.bind(this._yDataChangeHandler, this));- yAxis.after("dataUpdate", Y.bind(this._yDataChangeHandler, this));- },-- /**- * Constant used to generate unique id.- *- * @property GUID- * @type String- * @private- */- GUID: "yuicartesianseries",-- /**- * Event handler for xDataChange event.- *- * @method _xDataChangeHandler- * @param {Object} event Event object.- * @private - */- _xDataChangeHandler: function(event)- {- var axesReady = this._updateAxisData();- if(axesReady)- {- this.draw();- }- },-- /**- * Event handler for yDataChange event.- *- * @method _yDataChangeHandler- * @param {Object} event Event object.- * @private - */- _yDataChangeHandler: function(event)- {- var axesReady = this._updateAxisData();- if(axesReady)- {- this.draw();- }- },-- /**- * Checks to ensure that both xAxis and yAxis data are available. If so, set the `xData` and `yData` attributes and return `true`. Otherwise, return `false`.- *- * @method _updateAxisData- * @return Boolean- * @private - */- _updateAxisData: function()- {- var xAxis = this.get("xAxis"),- yAxis = this.get("yAxis"),- xKey = this.get("xKey"),- yKey = this.get("yKey"),- yData,- xData;- if(!xAxis || !yAxis || !xKey || !yKey)- {- return false;- }- xData = xAxis.getDataByKey(xKey);- yData = yAxis.getDataByKey(yKey);- if(!xData || !yData)- {- return false;- }- this.set("xData", xData.concat());- this.set("yData", yData.concat());- return true;- },-- /**- * Draws the series is the xAxis and yAxis data are both available.- *- * @method validate- * @private- */- validate: function()- {- if((this.get("xData") && this.get("yData")) || this._updateAxisData())- {- this.draw();- }- else- {- this.fire("drawingComplete");- }- },-- /**- * Creates a `Graphic` instance.- *- * @method _setCanvas- * @protected- */- _setCanvas: function()- {- var graph = this.get("graph"),- graphic = graph.get("graphic");- this.set("graphic", graphic);- },-- /**- * Calculates the coordinates for the series.- *- * @method setAreaData- * @protected- */- setAreaData: function()- {- var isNumber = Y_Lang.isNumber,- nextX, nextY,- graph = this.get("graph"),- w = graph.get("width"),- h = graph.get("height"),- xAxis = this.get("xAxis"),- yAxis = this.get("yAxis"),- xData = this.get("xData").concat(),- yData = this.get("yData").concat(),- xValue,- yValue,- xOffset = xAxis.getEdgeOffset(xData.length, w),- yOffset = yAxis.getEdgeOffset(yData.length, h),- padding = this.get("styles").padding,- leftPadding = padding.left,- topPadding = padding.top,- dataWidth = w - (leftPadding + padding.right + xOffset),- dataHeight = h - (topPadding + padding.bottom + yOffset),- xcoords = [],- ycoords = [],- xMax = xAxis.get("maximum"),- xMin = xAxis.get("minimum"),- yMax = yAxis.get("maximum"),- yMin = yAxis.get("minimum"),- xScaleFactor = dataWidth / (xMax - xMin),- yScaleFactor = dataHeight / (yMax - yMin),- dataLength,- direction = this.get("direction"),- i = 0,- xMarkerPlane = [],- yMarkerPlane = [],- xMarkerPlaneOffset = this.get("xMarkerPlaneOffset"),- yMarkerPlaneOffset = this.get("yMarkerPlaneOffset"),- graphic = this.get("graphic");- graphic.set("width", w);- graphic.set("height", h);- dataLength = xData.length;- xOffset *= 0.5;- yOffset *= 0.5;- //Assuming a vertical graph has a range/category for its vertical axis. - if(direction === "vertical")- {- yData = yData.reverse();- }- this._leftOrigin = Math.round(((0 - xMin) * xScaleFactor) + leftPadding + xOffset);- this._bottomOrigin = Math.round((dataHeight + topPadding + yOffset)); - for (; i < dataLength; ++i) - {- xValue = parseFloat(xData[i]);- yValue = parseFloat(yData[i]);- if(isNumber(xValue))- {- nextX = Math.round((((xValue - xMin) * xScaleFactor) + leftPadding + xOffset));- }- else- {- nextX = NaN;- }- if(isNumber(yValue))- {- nextY = Math.round(((dataHeight + topPadding + yOffset) - (yValue - yMin) * yScaleFactor));- }- else- {- nextY = NaN;- }- xcoords.push(nextX);- ycoords.push(nextY);- xMarkerPlane.push({start:nextX - xMarkerPlaneOffset, end: nextX + xMarkerPlaneOffset});- yMarkerPlane.push({start:nextY - yMarkerPlaneOffset, end: nextY + yMarkerPlaneOffset});- }- this.set("xcoords", xcoords);- this.set("ycoords", ycoords);- this.set("xMarkerPlane", xMarkerPlane);- this.set("yMarkerPlane", yMarkerPlane);- this._dataLength = dataLength;- },-- /**- * Draws the series.- *- * @method draw- * @protected- */- draw: function()- {- var graph = this.get("graph"),- w = graph.get("width"),- h = graph.get("height");- if(this.get("rendered"))- {- if((isFinite(w) && isFinite(h) && w > 0 && h > 0) && ((this.get("xData") && this.get("yData")) || this._updateAxisData()))- {- if(this._drawing)- {- this._callLater = true;- return;- }- this._drawing = true;- this._callLater = false;- this.setAreaData();- if(this.get("xcoords") && this.get("ycoords"))- {- this.drawSeries();- }- this._drawing = false;- if(this._callLater)- {- this.draw();- }- else- {- this._toggleVisible(this.get("visible"));- this.fire("drawingComplete");- }- }- }- },- - /**- * Default value for plane offsets when the parent chart's `interactiveType` is `planar`. - *- * @property _defaultPlaneOffset- * @type Number- * @private- */- _defaultPlaneOffset: 4,- - /**- * Gets the default value for the `styles` attribute. Overrides- * base implementation.- *- * @method _getDefaultStyles- * @return Object- * @protected- */- _getDefaultStyles: function()- {- return {padding:{- top: 0,- left: 0,- right: 0,- bottom: 0- }};- },-- /**- * Collection of default colors used for lines in a series when not specified by user.- *- * @property _defaultLineColors- * @type Array- * @protected- */- _defaultLineColors:["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"],-- /**- * Collection of default colors used for marker fills in a series when not specified by user.- *- * @property _defaultFillColors- * @type Array- * @protected- */- _defaultFillColors:["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"],- - /**- * Collection of default colors used for marker borders in a series when not specified by user.- *- * @property _defaultBorderColors- * @type Array- * @protected- */- _defaultBorderColors:["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"],- - /**- * Collection of default colors used for area fills, histogram fills and pie fills in a series when not specified by user.- *- * @property _defaultSliceColors- * @type Array- * @protected- */- _defaultSliceColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],-- /**- * Parses a color based on a series order and type.- *- * @method _getDefaultColor- * @param {Number} index Index indicating the series order.- * @param {String} type Indicates which type of object needs the color.- * @return String- * @protected- */- _getDefaultColor: function(index, type)- {- var colors = {- line: this._defaultLineColors,- fill: this._defaultFillColors,- border: this._defaultBorderColors,- slice: this._defaultSliceColors- },- col = colors[type],- l = col.length;- index = index || 0;- if(index >= l)- {- index = index % l;- }- type = type || "fill";- return colors[type][index];- },- - /**- * Shows/hides contents of the series.- *- * @method _handleVisibleChange- * @param {Object} e Event object.- * @protected- */- _handleVisibleChange: function(e) - {- this._toggleVisible(this.get("visible"));- },-- /**- * Returns the sum of all values for the series.- *- * @method getTotalValues- * @return Number- */- getTotalValues: function()- {- var total = this.get("valueAxis").getTotalByKey(this.get("valueKey"));- return total;- },-- /**- * Destructor implementation for the CartesianSeries class. Calls destroy on all Graphic instances.- *- * @method destructor- * @protected- */- destructor: function()- {- if(this._path)- {- this._path.destroy();- }- if(this._lineGraphic)- {- this._lineGraphic.destroy();- this._lineGraphic = null;- }- if(this.get("graphic"))- {- this.get("graphic").destroy();- } - }-}, {- ATTRS: {- /**- * Name used for for displaying data related to the x-coordinate.- *- * @attribute xDisplayName- * @type String- */- xDisplayName: {- getter: function()- {- return this._xDisplayName || this.get("xKey");- },-- setter: function(val)- {- this._xDisplayName = val.toString();- return val;- }- },-- /**- * Name used for for displaying data related to the y-coordinate.- *- * @attribute yDisplayName- * @type String- */- yDisplayName: {- getter: function()- {- return this._yDisplayName || this.get("yKey");- },-- setter: function(val)- {- this._yDisplayName = val.toString();- return val;- }- },- - /**- * Name used for for displaying category data- *- * @attribute categoryDisplayName- * @type String- * @readOnly- */- categoryDisplayName: {- readOnly: true,-- getter: function()- {- return this.get("direction") == "vertical" ? this.get("yDisplayName") : this.get("xDisplayName");- }- },-- /**- * Name used for for displaying value data- *- * @attribute valueDisplayName- * @type String- * @readOnly- */- valueDisplayName: {- readOnly: true,-- getter: function()- {- return this.get("direction") == "vertical" ? this.get("xDisplayName") : this.get("yDisplayName");- }- },- - /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default cartesian- */- type: { - value: "cartesian"- },-- /**- * Order of this instance of this `type`.- *- * @attribute order- * @type Number- */- order: {},-- /**- * Order of the instance- *- * @attribute graphOrder- * @type Number- */- graphOrder: {},-- /**- * x coordinates for the series.- *- * @attribute xcoords- * @type Array- */- xcoords: {},- - /**- * y coordinates for the series- *- * @attribute ycoords- * @type Array- */- ycoords: {},-- /**- * Reference to the `Chart` application.- *- * @attribute chart- * @type ChartBase- * @readOnly- */- chart: {- readOnly: true,-- getter: function()- {- return this.get("graph").get("chart");- }- },- - /**- * Reference to the `Graph` in which the series is drawn into.- *- * @attribute graph- * @type Graph- */- graph: {},-- /**- * Reference to the `Axis` instance used for assigning - * x-values to the graph.- *- * @attribute xAxis- * @type Axis- */- xAxis: {},- - /**- * Reference to the `Axis` instance used for assigning - * y-values to the graph.- *- * @attribute yAxis- * @type Axis- */- yAxis: {},- - /**- * Indicates which array to from the hash of value arrays in - * the x-axis `Axis` instance.- *- * @attribute xKey- * @type String- */- xKey: {- setter: function(val)- {- return val.toString();- }- },-- /**- * Indicates which array to from the hash of value arrays in - * the y-axis `Axis` instance.- *- * @attribute yKey- * @type String- */- yKey: {- setter: function(val)- {- return val.toString();- }- },-- /**- * Array of x values for the series.- *- * @attribute xData- * @type Array- */- xData: {},-- /**- * Array of y values for the series.- *- * @attribute yData- * @type Array- */- yData: {},- - /**- * Indicates whether the Series has been through its initial set up.- *- * @attribute rendered- * @type Boolean- */- rendered: {- value: false- },-- /*- * Returns the width of the parent graph- *- * @attribute width- * @type Number- */- width: {- readOnly: true,- - getter: function()- {- this.get("graph").get("width");- }- },-- /**- * Returns the height of the parent graph- *- * @attribute height- * @type Number- */- height: {- readOnly: true,- - getter: function()- {- this.get("graph").get("height");- }- },-- /**- * Indicates whether to show the series- *- * @attribute visible- * @type Boolean- * @default true- */- visible: {- value: true- },-- /**- * Collection of area maps along the xAxis. Used to determine mouseover for multiple- * series.- *- * @attribute xMarkerPlane- * @type Array- */- xMarkerPlane: {},- - /**- * Collection of area maps along the yAxis. Used to determine mouseover for multiple- * series.- *- * @attribute yMarkerPlane- * @type Array- */- yMarkerPlane: {},-- /**- * Distance from a data coordinate to the left/right for setting a hotspot.- *- * @attribute xMarkerPlaneOffset- * @type Number- */- xMarkerPlaneOffset: {- getter: function() {- var marker = this.get("styles").marker;- if(marker && marker.width && isFinite(marker.width))- {- return marker.width * 0.5;- }- return this._defaultPlaneOffset;- }- },-- /**- * Distance from a data coordinate to the top/bottom for setting a hotspot.- *- * @attribute yMarkerPlaneOffset- * @type Number- */- yMarkerPlaneOffset: {- getter: function() {- var marker = this.get("styles").marker;- if(marker && marker.height && isFinite(marker.height))- {- return marker.height * 0.5;- }- return this._defaultPlaneOffset;- }- },-- /**- * Direction of the series- *- * @attribute direction- * @type String- */- direction: {- value: "horizontal"- },-- /**- * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.- *- * @attribute groupMarkers- * @type Boolean- */- groupMarkers: {- getter: function()- {- if(this._groupMarkers === undefined)- {- return this.get("graph").get("groupMarkers");- }- else- {- return this._groupMarkers;- }- },-- setter: function(val)- {- this._groupMarkers = val;- return val;- }- }- }-});-/**- * The MarkerSeries class renders quantitative data by plotting relevant data points - * on a graph.- *- * @module charts- * @class MarkerSeries- * @extends CartesianSeries- * @uses Plots- * @constructor- */-Y.MarkerSeries = Y.Base.create("markerSeries", Y.CartesianSeries, [Y.Plots], {- /**- * @protected- *- * Draws the series.- *- * @method drawSeries- */- drawSeries: function()- {- this.drawPlots();- },- - /**- * @protected- *- * Method used by `styles` setter. Overrides base implementation.- *- * @method _setStyles- * @param {Object} newStyles Hash of properties to update.- * @return Object- */- _setStyles: function(val)- {- if(!val.marker)- {- val = {marker:val};- }- val = this._parseMarkerStyles(val);- return Y.MarkerSeries.superclass._mergeStyles.apply(this, [val, this._getDefaultStyles()]);- },- - /**- * @protected- *- * Gets the default value for the `styles` attribute. Overrides- * base implementation.- *- * @method _getDefaultStyles- * @return Object- */- _getDefaultStyles: function()- {- var styles = this._mergeStyles({marker:this._getPlotDefaults()}, Y.MarkerSeries.superclass._getDefaultStyles());- return styles;- }-},{- ATTRS : {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default marker- */- type: {- value:"marker"- }- - /**- * Style properties used for drawing markers. This attribute is inherited from `Renderer`. Below are the default values:- * <dl>- * <dt>fill</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"]`- * </dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>border</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>- * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>width</dt><dd>indicates the width of the marker. The default value is 10.</dd>- * <dt>height</dt><dd>indicates the height of the marker The default value is 10.</dd>- * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default - * values for each style is null. When an over style is not set, the non-over value will be used. For example,- * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});--/**- * The LineSeries class renders quantitative data on a graph by connecting relevant data points.- *- * @module charts- * @class LineSeries- * @extends CartesianSeries- * @uses Lines- * @constructor- */-Y.LineSeries = Y.Base.create("lineSeries", Y.CartesianSeries, [Y.Lines], {- /**- * @protected- *- * @method drawSeries- */- drawSeries: function()- {- this.drawLines();- },-- /**- * @protected- *- * Method used by `styles` setter. Overrides base implementation.- *- * @method _setStyles- * @param {Object} newStyles Hash of properties to update.- * @return Object- */- _setStyles: function(val)- {- if(!val.line)- {- val = {line:val};- }- return Y.LineSeries.superclass._setStyles.apply(this, [val]);- },-- /**- * @protected- *- * Gets the default value for the `styles` attribute. Overrides- * base implementation.- *- * @method _getDefaultStyles- * @return Object- */- _getDefaultStyles: function()- {- var styles = this._mergeStyles({line:this._getLineDefaults()}, Y.LineSeries.superclass._getDefaultStyles());- return styles;- }-},-{- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default line- */- type: {- value:"line"- }-- /**- * Style properties used for drawing lines. This attribute is inherited from `Renderer`. Below are the default values:- * <dl>- * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be- * retrieved from the following array: - * `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]`- * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>- * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>- * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> - * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>- * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>- * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> - * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>- * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>- * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});---- -- -/**- * SplineSeries renders a graph with data points connected by a curve.- *- * @module charts- * @class SplineSeries- * @constructor- * @extends CartesianSeries- * @uses CurveUtil- * @uses Lines- */-Y.SplineSeries = Y.Base.create("splineSeries", Y.LineSeries, [Y.CurveUtil, Y.Lines], {- /**- * @protected- *- * Draws the series.- *- * @method drawSeries- */- drawSeries: function()- {- this.drawSpline();- }-}, {- ATTRS : {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default spline- */- type : {- value:"spline"- }-- /**- * Style properties used for drawing lines. This attribute is inherited from `Renderer`. Below are the default values:- * <dl>- * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be- * retrieved from the following array: - * `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]`- * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>- * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>- * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> - * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>- * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>- * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> - * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>- * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>- * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});---- -- -/**- * AreaSplineSeries renders an area graph with data points connected by a curve.- *- * @module charts- * @class AreaSplineSeries- * @constructor- * @extends CartesianSeries- * @uses Fills- * @uses CurveUtil- */-Y.AreaSplineSeries = Y.Base.create("areaSplineSeries", Y.CartesianSeries, [Y.Fills, Y.CurveUtil], {- /**- * @protected- *- * Draws the series.- *- * @method drawSeries- */- drawSeries: function()- {- this.drawAreaSpline();- }-}, {- ATTRS : {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default areaSpline- */- type: {- value:"areaSpline"- }- - /**- * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values:- *- * <dl>- * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be - * retrieved from the following array:- * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`- * </dd>- * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});--/**- * StackedSplineSeries creates spline graphs in which the different series are stacked along a value axis- * to indicate their contribution to a cumulative total.- *- * @module charts- * @class StackedSplineSeries- * @constructor- * @extends SplineSeries- * @extends StackingUtil- */-Y.StackedSplineSeries = Y.Base.create("stackedSplineSeries", Y.SplineSeries, [Y.StackingUtil], {- /**- * @protected- *- * Calculates the coordinates for the series. Overrides base implementation.- *- * @method setAreaData- */- setAreaData: function()- { - Y.StackedSplineSeries.superclass.setAreaData.apply(this);- this._stackCoordinates.apply(this);- }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default stackedSpline- */- type: {- value:"stackedSpline"- }- }-});--/**- * StackedMarkerSeries plots markers with different series stacked along the value axis to indicate each- * series' contribution to a cumulative total.- *- * @module charts- * @class StackedMarkerSeries- * @constructor- * @extends MarkerSeries- * @extends StackingUtil- */-Y.StackedMarkerSeries = Y.Base.create("stackedMarkerSeries", Y.MarkerSeries, [Y.StackingUtil], {- /**- * @protected- *- * Calculates the coordinates for the series. Overrides base implementation.- *- * @method setAreaData- */- setAreaData: function()- { - Y.StackedMarkerSeries.superclass.setAreaData.apply(this);- this._stackCoordinates.apply(this);- }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default stackedMarker- */- type: {- value:"stackedMarker"- }- }-});--/**- * The ColumnSeries class renders columns positioned horizontally along a category or time axis. The columns'- * lengths are proportional to the values they represent along a vertical axis.- * and the relevant data points.- *- * @module charts- * @class ColumnSeries- * @extends MarkerSeries- * @uses Histogram- * @constructor- */-Y.ColumnSeries = Y.Base.create("columnSeries", Y.MarkerSeries, [Y.Histogram], {- /**- * Helper method for calculating the size of markers. - *- * @method _getMarkerDimensions- * @param {Number} xcoord The x-coordinate representing the data point for the marker.- * @param {Number} ycoord The y-coordinate representing the data point for the marker.- * @param {Number} calculatedSize The calculated size for the marker. For a `BarSeries` is it the width. For a `ColumnSeries` it is the height.- * @param {Number} offset Distance of position offset dictated by other marker series in the same graph.- * @return Object- * @private- */- _getMarkerDimensions: function(xcoord, ycoord, calculatedSize, offset)- {- var config = {- left: xcoord + offset- };- if(this._bottomOrigin >= ycoord)- {- config.top = ycoord;- config.calculatedSize = this._bottomOrigin - config.top;- }- else- {- config.top = this._bottomOrigin;- config.calculatedSize = ycoord - this._bottomOrigin;- }- return config;- },-- /**- * Resizes and positions markers based on a mouse interaction.- *- * @method updateMarkerState- * @param {String} type state of the marker- * @param {Number} i index of the marker- * @protected- */- updateMarkerState: function(type, i)- {- if(this._markers && this._markers[i])- {- var styles = Y.clone(this.get("styles").marker),- markerStyles,- state = this._getState(type),- xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- marker = this._markers[i],- markers,- graph = this.get("graph"),- seriesStyles,- seriesCollection = graph.seriesTypes[this.get("type")],- seriesLen = seriesCollection.length,- seriesSize = 0,- offset = 0,- renderer,- n = 0,- xs = [],- order = this.get("order"),- config;- markerStyles = state == "off" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]); - markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);- markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);- config = this._getMarkerDimensions(xcoords[i], ycoords[i], styles.width, offset);- markerStyles.height = config.calculatedSize;- markerStyles.width = Math.min(this._maxSize, markerStyles.width);- marker.set(markerStyles);- for(; n < seriesLen; ++n)- {- xs[n] = xcoords[i] + seriesSize;- seriesStyles = seriesCollection[n].get("styles").marker;- seriesSize += Math.min(this._maxSize, seriesStyles.width);- if(order > n)- {- offset = seriesSize;- }- offset -= seriesSize/2;- }- for(n = 0; n < seriesLen; ++n)- {- markers = seriesCollection[n].get("markers");- if(markers)- {- renderer = markers[i];- if(renderer && renderer !== undefined)- {- renderer.set("x", (xs[n] - seriesSize/2));- }- }- }- }- }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @readOnly- * @default column- */- type: {- value: "column"- }- - /**- * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:- * <dl>- * <dt>fill</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`- * </dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>border</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>- * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>width</dt><dd>indicates the width of the marker. The default value is 12.</dd>- * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default - * values for each style is null. When an over style is not set, the non-over value will be used. For example,- * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});-/**- * The BarSeries class renders bars positioned vertically along a category or time axis. The bars'- * lengths are proportional to the values they represent along a horizontal axis.- * and the relevant data points.- *- * @module charts- * @class BarSeries- * @extends MarkerSeries- * @uses Histogram- * @constructor- */-Y.BarSeries = Y.Base.create("barSeries", Y.MarkerSeries, [Y.Histogram], {- /**- * Helper method for calculating the size of markers. - *- * @method _getMarkerDimensions- * @param {Number} xcoord The x-coordinate representing the data point for the marker.- * @param {Number} ycoord The y-coordinate representing the data point for the marker.- * @param {Number} calculatedSize The calculated size for the marker. For a `BarSeries` is it the width. For a `ColumnSeries` it is the height.- * @param {Number} offset Distance of position offset dictated by other marker series in the same graph.- * @return Object- * @private- */- _getMarkerDimensions: function(xcoord, ycoord, calculatedSize, offset)- {- var config = {- top: ycoord + offset- };- if(xcoord >= this._leftOrigin)- {- config.left = this._leftOrigin;- config.calculatedSize = xcoord - config.left;- }- else- {- config.left = xcoord;- config.calculatedSize = this._leftOrigin - xcoord;- }- return config;- },- - /**- * Resizes and positions markers based on a mouse interaction.- *- * @method updateMarkerState- * @param {String} type state of the marker- * @param {Number} i index of the marker- * @protected- */- updateMarkerState: function(type, i)- {- if(this._markers && this._markers[i])- {- var styles = Y.clone(this.get("styles").marker),- markerStyles,- state = this._getState(type),- xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- marker = this._markers[i],- markers,- graph = this.get("graph"),- seriesCollection = graph.seriesTypes[this.get("type")],- seriesLen = seriesCollection.length,- seriesStyles,- seriesSize = 0,- offset = 0,- renderer,- n = 0,- ys = [],- order = this.get("order"),- config;- markerStyles = state == "off" || !styles[state] ? styles : styles[state]; - markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);- markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);- config = this._getMarkerDimensions(xcoords[i], ycoords[i], styles.height, offset);- markerStyles.width = config.calculatedSize;- markerStyles.height = Math.min(this._maxSize, markerStyles.height);- marker.set(markerStyles);- for(; n < seriesLen; ++n)- {- ys[n] = ycoords[i] + seriesSize;- seriesStyles = seriesCollection[n].get("styles").marker;- seriesSize += Math.min(this._maxSize, seriesStyles.height); - if(order > n)- {- offset = seriesSize;- }- offset -= seriesSize/2;- }- for(n = 0; n < seriesLen; ++n)- {- markers = seriesCollection[n].get("markers");- if(markers)- {- renderer = markers[i];- if(renderer && renderer !== undefined)- {- renderer.set("y", (ys[n] - seriesSize/2));- }- }- }- }- }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default bar- */- type: {- value: "bar"- },-- /**- * Indicates the direction of the category axis that the bars are plotted against.- *- * @attribute direction- * @type String- */- direction: {- value: "vertical"- }- - /**- * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:- * <dl>- * <dt>fill</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`- * </dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>border</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>- * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>height</dt><dd>indicates the width of the marker. The default value is 12.</dd>- * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default - * values for each style is null. When an over style is not set, the non-over value will be used. For example,- * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});-/**- * The AreaSeries class renders quantitative data on a graph by creating a fill between 0- * and the relevant data points.- *- * @module charts- * @class AreaSeries- * @extends CartesianSeries- * @uses Fills- * @constructor- */-Y.AreaSeries = Y.Base.create("areaSeries", Y.CartesianSeries, [Y.Fills], {- /**- * @protected- *- * Renders the series. - *- * @method drawSeries- */- drawSeries: function()- {- this.drawFill.apply(this, this._getClosingPoints());- },- - /**- * @protected- *- * Method used by `styles` setter. Overrides base implementation.- *- * @method _setStyles- * @param {Object} newStyles Hash of properties to update.- * @return Object- */- _setStyles: function(val)- {- if(!val.area)- {- val = {area:val};- }- return Y.AreaSeries.superclass._setStyles.apply(this, [val]);- },-- /**- * @protected- *- * Gets the default value for the `styles` attribute. Overrides- * base implementation.- *- * @method _getDefaultStyles- * @return Object- */- _getDefaultStyles: function()- {- var styles = this._mergeStyles({area:this._getAreaDefaults()}, Y.AreaSeries.superclass._getDefaultStyles());- return styles;- }-},-{- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default area- */- type: {- value:"area"- }- - /**- * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values:- *- * <dl>- * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be - * retrieved from the following array:- * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`- * </dd>- * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});---- -- -/**- * StackedAreaSplineSeries creates a stacked area chart with points data points connected by a curve.- *- * @module charts- * @class StackedAreaSplineSeries- * @constructor- * @extends AreaSeries- * @uses CurveUtil- * @uses StackingUtil- */-Y.StackedAreaSplineSeries = Y.Base.create("stackedAreaSplineSeries", Y.AreaSeries, [Y.CurveUtil, Y.StackingUtil], {- /**- * @protected- *- * Draws the series.- *- * @method drawSeries- */- drawSeries: function()- {- this._stackCoordinates();- this.drawStackedAreaSpline();- }-}, {- ATTRS : {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default stackedAreaSpline- */- type: {- value:"stackedAreaSpline"- }- }-});--/**- * The ComboSeries class renders a combination of lines, plots and area fills in a single series. Each- * series type has a corresponding boolean attribute indicating if it is rendered. By default, lines and plots - * are rendered and area is not. - *- * @module charts- * @class ComboSeries- * @extends CartesianSeries - * @uses Fills- * @uses Lines- * @uses Plots- * @constructor- */-Y.ComboSeries = Y.Base.create("comboSeries", Y.CartesianSeries, [Y.Fills, Y.Lines, Y.Plots], {- /**- * @protected- * - * Draws the series.- *- * @method drawSeries- */- drawSeries: function()- {- if(this.get("showAreaFill"))- {- this.drawFill.apply(this, this._getClosingPoints());- }- if(this.get("showLines")) - {- this.drawLines();- }- if(this.get("showMarkers"))- {- this.drawPlots();- } - },- - /**- * Toggles visibility- *- * @method _toggleVisible- * @param {Boolean} visible indicates visibilitye- * @private- */- _toggleVisible: function(visible)- {- var markers,- marker,- len,- i;- if(this.get("showAreaFill") && this._path)- {- this._path.set("visible", visible);- }- if(this.get("showLines") && this._lineGraphic)- {- this._lineGraphic.set("visible", visible);- }- if(this.get("showMarkers"))- {- markers = this.get("markers");- if(markers)- {- i = 0;- len = markers.length;- for(; i < len; ++i)- {- marker = markers[i];- if(marker)- {- marker.set("visible", visible);- }- }- }- }- },-- /**- * @protected- *- * Returns the default hash for the `styles` attribute.- *- * @method _getDefaultStyles- * @return Object- */- _getDefaultStyles: function()- {- var styles = Y.ComboSeries.superclass._getDefaultStyles();- styles.line = this._getLineDefaults();- styles.marker = this._getPlotDefaults();- styles.area = this._getAreaDefaults();- return styles;- }-},-{- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default combo- */- type: {- value:"combo"- },-- /**- * Indicates whether a fill is displayed.- *- * @attribute showAreaFill- * @type Boolean- * @default false- */- showAreaFill: {- value: false- },-- /**- * Indicates whether lines are displayed.- *- * @attribute showLines- * @type Boolean- * @default true- */- showLines: {- value: true- },-- /**- * Indicates whether markers are displayed.- *- * @attribute showMarkers- * @type Boolean- * @default true- */- showMarkers: {- value: true- },-- /**- * Reference to the styles of the markers. These styles can also- * be accessed through the `styles` attribute. Below are default- * values:- * <dl>- * <dt>fill</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"]`- * </dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>border</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>- * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>width</dt><dd>indicates the width of the marker. The default value is 10.</dd>- * <dt>height</dt><dd>indicates the height of the marker The default value is 10.</dd>- * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default - * values for each style is null. When an over style is not set, the non-over value will be used. For example,- * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>- * </dl>- *- * @attribute marker- * @type Object- */- marker: {- lazyAdd: false,- getter: function()- {- return this.get("styles").marker;- },- setter: function(val)- {- this.set("styles", {marker:val});- }- },- - /**- * Reference to the styles of the lines. These styles can also be accessed through the `styles` attribute.- * Below are the default values:- * <dl>- * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be- * retrieved from the following array: - * `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]`- * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>- * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>- * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> - * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>- * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>- * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> - * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>- * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>- * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>- * </dl>- *- * @attribute line- * @type Object- */- line: {- lazyAdd: false,- getter: function()- {- return this.get("styles").line;- },- setter: function(val)- {- this.set("styles", {line:val});- }- },- - /**- * Reference to the styles of the area fills. These styles can also be accessed through the `styles` attribute.- * Below are the default values:- *- * <dl>- * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be - * retrieved from the following array:- * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`- * </dd>- * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>- * </dl>- *- * @attribute area- * @type Object- */- area: {- lazyAdd: false,- getter: function()- {- return this.get("styles").area;- },- setter: function(val)- {- this.set("styles", {area:val});- }- }-- /**- * Style properties for the series. Contains a key indexed hash of the following:- * <dl>- * <dt>marker</dt><dd>Style properties for the markers in the series. Specific style attributes are listed- * <a href="#attr_marker">here</a>.</dd>- * <dt>line</dt><dd>Style properties for the lines in the series. Specific- * style attributes are listed <a href="#attr_line">here</a>.</dd>- * <dt>area</dt><dd>Style properties for the area fills in the series. Specific style attributes are listed- * <a href="#attr_area">here</a>.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});---- -- -/**- * The StackedComboSeries class renders a combination of lines, plots and area fills in a single series. Series- * are stacked along the value axis to indicate each series contribution to a cumulative total. Each- * series type has a corresponding boolean attribute indicating if it is rendered. By default, all three types are- * rendered. - *- * @module charts- * @class StackedComboSeries- * @extends ComboSeries- * @uses StackingUtil- * @constructor- */-Y.StackedComboSeries = Y.Base.create("stackedComboSeries", Y.ComboSeries, [Y.StackingUtil], {- /**- * @protected- *- * Calculates the coordinates for the series. Overrides base implementation.- *- * @method setAreaData- */- setAreaData: function()- { - Y.StackedComboSeries.superclass.setAreaData.apply(this);- this._stackCoordinates.apply(this);- },- - /**- * @protected- *- * Draws the series.- *- * @method drawSeries- */- drawSeries: function()- {- if(this.get("showAreaFill"))- {- this.drawFill.apply(this, this._getStackedClosingPoints());- }- if(this.get("showLines")) - {- this.drawLines();- }- if(this.get("showMarkers"))- {- this.drawPlots();- } - }- -}, {- ATTRS : {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default stackedCombo- */- type: {- value: "stackedCombo"- },-- /**- * Indicates whether a fill is displayed.- *- * @attribute showAreaFill- * @type Boolean- * @default true- */- showAreaFill: {- value: true- }- }-});-/**- * The ComboSplineSeries class renders a combination of splines, plots and areaspline fills in a single series. Each- * series type has a corresponding boolean attribute indicating if it is rendered. By default, splines and plots - * are rendered and areaspline is not. - *- * @module charts- * @class ComboSplineSeries- * @extends ComboSeries- * @extends CurveUtil- * @constructor- */-Y.ComboSplineSeries = Y.Base.create("comboSplineSeries", Y.ComboSeries, [Y.CurveUtil], {- /**- * @protected- * - * Draws the series.- *- * @method drawSeries- */- drawSeries: function()- {- if(this.get("showAreaFill"))- {- this.drawAreaSpline();- }- if(this.get("showLines")) - {- this.drawSpline();- }- if(this.get("showMarkers"))- {- this.drawPlots();- } - }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default comboSpline- */- type: {- value : "comboSpline"- }- }-});-/**- * The StackedComboSplineSeries class renders a combination of splines, plots and areaspline fills in a single series. Series- * are stacked along the value axis to indicate each series contribution to a cumulative total. Each- * series type has a corresponding boolean attribute indicating if it is rendered. By default, all three types are- * rendered. - *- * @module charts- * @class StackedComboSplineSeries- * @extends StackedComboSeries- * @uses CurveUtil- * @constructor- */-Y.StackedComboSplineSeries = Y.Base.create("stackedComboSplineSeries", Y.StackedComboSeries, [Y.CurveUtil], {- /**- * @protected- *- * Draws the series.- *- * @method drawSeries- */- drawSeries: function()- {- if(this.get("showAreaFill"))- {- this.drawStackedAreaSpline();- }- if(this.get("showLines")) - {- this.drawSpline();- }- if(this.get("showMarkers"))- {- this.drawPlots();- } - }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default stackedComboSpline- */- type : {- value : "stackedComboSpline"- },-- /**- * Indicates whether a fill is displayed.- *- * @attribute showAreaFill- * @type Boolean- * @default true- */- showAreaFill: {- value: true- }- }-});-/**- * StackedLineSeries creates line graphs in which the different series are stacked along a value axis- * to indicate their contribution to a cumulative total.- *- * @module charts- * @class StackedLineSeries- * @constructor- * @extends LineSeries- * @uses StackingUtil- */-Y.StackedLineSeries = Y.Base.create("stackedLineSeries", Y.LineSeries, [Y.StackingUtil], {- /**- * @protected- *- * Calculates the coordinates for the series. Overrides base implementation.- *- * @method setAreaData- */- setAreaData: function()- { - Y.StackedLineSeries.superclass.setAreaData.apply(this);- this._stackCoordinates.apply(this);- }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default stackedLine- */- type: {- value:"stackedLine"- }- }-});-/**- * StackedAreaSeries area fills to display data showing its contribution to a whole.- *- * @module charts- * @class StackedAreaSeries- * @constructor- * @param {Object} config (optional) Configuration parameters for the Chart.- * @extends AreaSeries- * @uses StackingUtil- */-Y.StackedAreaSeries = Y.Base.create("stackedAreaSeries", Y.AreaSeries, [Y.StackingUtil], {- /**- * @protected- *- * Calculates the coordinates for the series. Overrides base implementation.- *- * @method setAreaData- */- setAreaData: function()- { - Y.StackedAreaSeries.superclass.setAreaData.apply(this);- this._stackCoordinates.apply(this);- },-- /**- * @protected- *- * Draws the series- *- * @method drawSeries- */- drawSeries: function()- {- this.drawFill.apply(this, this._getStackedClosingPoints());- }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default stackedArea- */- type: {- value:"stackedArea"- }- }-});-/**- * The StackedColumnSeries renders column chart in which series are stacked vertically to show- * their contribution to the cumulative total.- *- * @module charts- * @class StackedColumnSeries- * @extends ColumnSeries- * @uses StackingUtil- * @constructor- */-Y.StackedColumnSeries = Y.Base.create("stackedColumnSeries", Y.ColumnSeries, [Y.StackingUtil], {- /**- * Draws the series.- *- * @method drawSeries- * @protected- */- drawSeries: function()- {- if(this.get("xcoords").length < 1) - {- return;- }- var isNumber = Y_Lang.isNumber,- style = Y.clone(this.get("styles").marker), - w = style.width,- h = style.height,- xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- i = 0,- len = xcoords.length,- top = ycoords[0],- type = this.get("type"),- graph = this.get("graph"),- seriesCollection = graph.seriesTypes[type],- ratio,- order = this.get("order"),- graphOrder = this.get("graphOrder"),- left,- marker,- fillColors,- borderColors,- lastCollection,- negativeBaseValues,- positiveBaseValues,- useOrigin = order === 0,- totalWidth = len * w,- dimensions = {- width: [],- height: []- },- xvalues = [],- yvalues = [],- groupMarkers = this.get("groupMarkers");- if(Y_Lang.isArray(style.fill.color))- {- fillColors = style.fill.color.concat(); - }- if(Y_Lang.isArray(style.border.color))- {- borderColors = style.border.color.concat();- }- this._createMarkerCache();- if(totalWidth > this.get("width"))- {- ratio = this.width/totalWidth;- w *= ratio;- w = Math.max(w, 1);- }- if(!useOrigin)- {- lastCollection = seriesCollection[order - 1];- negativeBaseValues = lastCollection.get("negativeBaseValues");- positiveBaseValues = lastCollection.get("positiveBaseValues");- if(!negativeBaseValues || !positiveBaseValues)- {- useOrigin = true;- positiveBaseValues = [];- negativeBaseValues = [];- }- }- else- {- negativeBaseValues = [];- positiveBaseValues = [];- }- this.set("negativeBaseValues", negativeBaseValues);- this.set("positiveBaseValues", positiveBaseValues);- for(i = 0; i < len; ++i)- {- left = xcoords[i];- top = ycoords[i];- - if(!isNumber(top) || !isNumber(left))- {- if(useOrigin)- {- negativeBaseValues[i] = this._bottomOrigin;- positiveBaseValues[i] = this._bottomOrigin;- }- this._markers.push(null); - continue;- }- if(useOrigin)- {- h = Math.abs(this._bottomOrigin - top);- if(top < this._bottomOrigin)- {- positiveBaseValues[i] = top;- negativeBaseValues[i] = this._bottomOrigin;- }- else if(top > this._bottomOrigin)- {- positiveBaseValues[i] = this._bottomOrigin;- negativeBaseValues[i] = top;- top -= h;- }- else- {- positiveBaseValues[i] = top;- negativeBaseValues[i] = top;- }- }- else - {- if(top > this._bottomOrigin)- {- top += (negativeBaseValues[i] - this._bottomOrigin);- h = top - negativeBaseValues[i];- negativeBaseValues[i] = top;- top -= h;- }- else if(top <= this._bottomOrigin)- {- top = positiveBaseValues[i] - (this._bottomOrigin - top);- h = positiveBaseValues[i] - top;- positiveBaseValues[i] = top;- }- }- if(!isNaN(h) && h > 0)- {- left -= w/2;- if(groupMarkers)- {- dimensions.width[i] = w;- dimensions.height[i] = h;- xvalues.push(left);- yvalues.push(top);- }- else- {- style.width = w;- style.height = h;- style.x = left;- style.y = top;- if(fillColors)- {- style.fill.color = fillColors[i % fillColors.length];- }- if(borderColors)- {- style.border.color = borderColors[i % borderColors.length];- }- marker = this.getMarker(style, graphOrder, i);- }- }- else if(!groupMarkers)- {- this._markers.push(null);- }- }- if(groupMarkers)- {- this._createGroupMarker({- fill: style.fill,- border: style.border,- dimensions: dimensions,- xvalues: xvalues,- yvalues: yvalues,- shape: style.shape- });- }- else- {- this._clearMarkerCache();- }- },-- /**- * Resizes and positions markers based on a mouse interaction.- *- * @method updateMarkerState- * @param {String} type state of the marker- * @param {Number} i index of the marker- * @protected- */- updateMarkerState: function(type, i)- {- if(this._markers && this._markers[i])- {- var styles,- markerStyles,- state = this._getState(type),- xcoords = this.get("xcoords"),- marker = this._markers[i],- offset = 0,- fillColor,- borderColor; - styles = this.get("styles").marker;- offset = styles.width * 0.5;- markerStyles = state == "off" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]); - markerStyles.height = marker.get("height");- markerStyles.x = (xcoords[i] - offset);- markerStyles.y = marker.get("y");- markerStyles.id = marker.get("id");- fillColor = markerStyles.fill.color; - borderColor = markerStyles.border.color;- if(Y_Lang.isArray(fillColor))- {- markerStyles.fill.color = fillColor[i % fillColor.length];- }- else- {- markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);- }- if(Y_Lang.isArray(borderColor))- {- markerStyles.border.color = borderColor[i % borderColor.length];- }- else- {- markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);- }- marker.set(markerStyles);- }- },- - /**- * Gets the default values for the markers. - *- * @method _getPlotDefaults- * @return Object- * @protected- */- _getPlotDefaults: function()- {- var defs = {- fill:{- type: "solid",- alpha: 1,- colors:null,- alphas: null,- ratios: null- },- border:{- weight: 0,- alpha: 1- },- width: 24,- height: 24,- shape: "rect",-- padding:{- top: 0,- left: 0,- right: 0,- bottom: 0- }- };- defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");- defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");- return defs;- }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default stackedColumn- */- type: {- value: "stackedColumn"- },-- /**- * @attribute negativeBaseValues- * @type Array- * @default null- * @private- */- negativeBaseValues: {- value: null- },-- /**- * @attribute positiveBaseValues- * @type Array- * @default null- * @private- */- positiveBaseValues: {- value: null- }- - /**- * Style properties used for drawing markers. This attribute is inherited from `ColumnSeries`. Below are the default values:- * <dl>- * <dt>fill</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`- * </dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>border</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>- * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>width</dt><dd>indicates the width of the marker. The default value is 24.</dd>- * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default - * values for each style is null. When an over style is not set, the non-over value will be used. For example,- * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});--/**- * The StackedBarSeries renders bar chart in which series are stacked horizontally to show- * their contribution to the cumulative total.- *- * @module charts- * @class StackedBarSeries- * @extends BarSeries- * @uses StackingUtil- * @constructor- */-Y.StackedBarSeries = Y.Base.create("stackedBarSeries", Y.BarSeries, [Y.StackingUtil], {- /**- * @protected- *- * Draws the series.- *- * @method drawSeries- */- drawSeries: function()- {- if(this.get("xcoords").length < 1) - {- return;- }-- var isNumber = Y_Lang.isNumber,- style = Y.clone(this.get("styles").marker),- w = style.width,- h = style.height,- xcoords = this.get("xcoords"),- ycoords = this.get("ycoords"),- i = 0,- len = xcoords.length,- top = ycoords[0],- type = this.get("type"),- graph = this.get("graph"),- seriesCollection = graph.seriesTypes[type],- ratio,- order = this.get("order"),- graphOrder = this.get("graphOrder"),- left,- marker,- lastCollection,- negativeBaseValues,- positiveBaseValues,- fillColors,- borderColors,- useOrigin = order === 0,- totalHeight = len * h,- dimensions = {- width: [],- height: []- },- xvalues = [],- yvalues = [],- groupMarkers = this.get("groupMarkers");- if(Y_Lang.isArray(style.fill.color))- {- fillColors = style.fill.color.concat(); - }- if(Y_Lang.isArray(style.border.color))- {- borderColors = style.border.color.concat();- }- this._createMarkerCache();- if(totalHeight > this.get("height"))- {- ratio = this.height/totalHeight;- h *= ratio;- h = Math.max(h, 1);- }- if(!useOrigin)- {- lastCollection = seriesCollection[order - 1];- negativeBaseValues = lastCollection.get("negativeBaseValues");- positiveBaseValues = lastCollection.get("positiveBaseValues");- if(!negativeBaseValues || !positiveBaseValues)- {- useOrigin = true;- positiveBaseValues = [];- negativeBaseValues = [];- }- }- else- {- negativeBaseValues = [];- positiveBaseValues = [];- }- this.set("negativeBaseValues", negativeBaseValues);- this.set("positiveBaseValues", positiveBaseValues);- for(i = 0; i < len; ++i)- {- top = ycoords[i];- left = xcoords[i];- if(!isNumber(top) || !isNumber(left))- {- if(useOrigin)- {- positiveBaseValues[i] = this._leftOrigin;- negativeBaseValues[i] = this._leftOrigin;- }- this._markers.push(null);- continue;- }- if(useOrigin)- {- w = Math.abs(left - this._leftOrigin);- if(left > this._leftOrigin)- {- positiveBaseValues[i] = left;- negativeBaseValues[i] = this._leftOrigin;- left -= w;- }- else if(left < this._leftOrigin)- { - positiveBaseValues[i] = this._leftOrigin;- negativeBaseValues[i] = left;- }- else- {- positiveBaseValues[i] = left;- negativeBaseValues[i] = this._leftOrigin;- }- }- else- {- if(left < this._leftOrigin)- {- left = negativeBaseValues[i] - (this._leftOrigin - xcoords[i]);- w = negativeBaseValues[i] - left;- negativeBaseValues[i] = left;- }- else if(left >= this._leftOrigin)- {- left += (positiveBaseValues[i] - this._leftOrigin);- w = left - positiveBaseValues[i];- positiveBaseValues[i] = left;- left -= w;- }- }- if(!isNaN(w) && w > 0)- {- top -= h/2;- if(groupMarkers)- {- dimensions.width[i] = w;- dimensions.height[i] = h;- xvalues.push(left);- yvalues.push(top);- }- else- {- style.width = w;- style.height = h;- style.x = left;- style.y = top;- if(fillColors)- {- style.fill.color = fillColors[i % fillColors.length];- }- if(borderColors)- {- style.border.color = borderColors[i % borderColors.length];- }- marker = this.getMarker(style, graphOrder, i);- }- }- else if(!groupMarkers)- {- this._markers.push(null);- }- }- if(groupMarkers)- {- this._createGroupMarker({- fill: style.fill,- border: style.border,- dimensions: dimensions,- xvalues: xvalues,- yvalues: yvalues,- shape: style.shape- });- }- else- {- this._clearMarkerCache();- }- },-- /**- * @protected- *- * Resizes and positions markers based on a mouse interaction.- *- * @method updateMarkerState- * @param {String} type state of the marker- * @param {Number} i index of the marker- */- updateMarkerState: function(type, i)- {- if(this._markers[i])- {- var state = this._getState(type),- ycoords = this.get("ycoords"),- marker = this._markers[i],- styles = this.get("styles").marker,- h = styles.height,- markerStyles = state == "off" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]), - fillColor,- borderColor; - markerStyles.y = (ycoords[i] - h/2);- markerStyles.x = marker.get("x");- markerStyles.width = marker.get("width");- markerStyles.id = marker.get("id");- fillColor = markerStyles.fill.color; - borderColor = markerStyles.border.color;- if(Y_Lang.isArray(fillColor))- {- markerStyles.fill.color = fillColor[i % fillColor.length];- }- else- {- markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);- }- if(Y_Lang.isArray(borderColor))- {- markerStyles.border.color = borderColor[i % borderColor.length];- }- else- {- markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);- }- marker.set(markerStyles);- }- },- - /**- * @protected- *- * Returns default values for the `styles` attribute.- * - * @method _getPlotDefaults- * @return Object- */- _getPlotDefaults: function()- {- var defs = {- fill:{- type: "solid",- alpha: 1,- colors:null,- alphas: null,- ratios: null- },- border:{- weight: 0,- alpha: 1- },- width: 24,- height: 24,- shape: "rect",-- padding:{- top: 0,- left: 0,- right: 0,- bottom: 0- }- };- defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");- defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");- return defs;- }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default stackedBar- */- type: {- value: "stackedBar"- },-- /**- * Direction of the series- *- * @attribute direction- * @type String- * @default vertical- */- direction: {- value: "vertical"- },-- /**- * @private- *- * @attribute negativeBaseValues- * @type Array- * @default null- */- negativeBaseValues: {- value: null- },-- /**- * @private- *- * @attribute positiveBaseValues- * @type Array- * @default null- */- positiveBaseValues: {- value: null- }- - /**- * Style properties used for drawing markers. This attribute is inherited from `BarSeries`. Below are the default values:- * <dl>- * <dt>fill</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`- * </dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>border</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color- * will be retrieved from the below array:<br/>- * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>- * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>height</dt><dd>indicates the width of the marker. The default value is 24.</dd>- * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default - * values for each style is null. When an over style is not set, the non-over value will be used. For example,- * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});--/**- * PieSeries visualizes data as a circular chart divided into wedges which represent data as a - * percentage of a whole.- *- * @module charts- * @class PieSeries- * @constructor- * @extends MarkerSeries- */-Y.PieSeries = Y.Base.create("pieSeries", Y.MarkerSeries, [], { - /**- * Image map used for interactivity when rendered with canvas.- *- * @property _map- * @type HTMLElement- * @private- */- _map: null,-- /**- * Image used for image map when rendered with canvas.- *- * @property _image- * @type HTMLElement- * @private- */- _image: null,-- /**- * Creates or updates the image map when rendered with canvas.- *- * @method _setMap- * @private- */- _setMap: function()- {- var id = "pieHotSpotMapi_" + Math.round(100000 * Math.random()),- cb = this.get("graph").get("contentBox"),- areaNode;- if(this._image)- {- cb.removeChild(this._image);- while(this._areaNodes && this._areaNodes.length > 0)- {- areaNode = this._areaNodes.shift();- this._map.removeChild(areaNode);- }- cb.removeChild(this._map);- }- this._image = DOCUMENT.createElement("img"); - this._image.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==";- cb.appendChild(this._image);- this._image.setAttribute("usemap", "#" + id);- this._image.style.zIndex = 3;- this._image.style.opacity = 0;- this._image.setAttribute("alt", "imagemap");- this._map = DOCUMENT.createElement("map");- this._map.style.zIndex = 5;- cb.appendChild(this._map);- this._map.setAttribute("name", id);- this._map.setAttribute("id", id);- this._areaNodes = [];- },-- /**- * Storage for `categoryDisplayName` attribute.- *- * @property _categoryDisplayName- * @private- */- _categoryDisplayName: null,- - /**- * Storage for `valueDisplayName` attribute.- *- * @property _valueDisplayName- * @private- */- _valueDisplayName: null,-- /**- * Adds event listeners.- *- * @method addListeners- * @private- */- addListeners: function()- {- var categoryAxis = this.get("categoryAxis"),- valueAxis = this.get("valueAxis");- if(categoryAxis)- {- categoryAxis.after("dataReady", Y.bind(this._categoryDataChangeHandler, this));- categoryAxis.after("dataUpdate", Y.bind(this._categoryDataChangeHandler, this));- }- if(valueAxis)- {- valueAxis.after("dataReady", Y.bind(this._valueDataChangeHandler, this));- valueAxis.after("dataUpdate", Y.bind(this._valueDataChangeHandler, this));- }- this.after("categoryAxisChange", this.categoryAxisChangeHandler);- this.after("valueAxisChange", this.valueAxisChangeHandler);- this.after("stylesChange", this._updateHandler);- },- - /**- * Draws the series.- *- * @method validate- * @private- */- validate: function()- {- this.draw();- this._renderered = true;- },-- /**- * Event handler for the categoryAxisChange event.- *- * @method _categoryAxisChangeHandler- * @param {Object} e Event object.- * @private- */- _categoryAxisChangeHandler: function(e)- {- var categoryAxis = this.get("categoryAxis");- categoryAxis.after("dataReady", Y.bind(this._categoryDataChangeHandler, this));- categoryAxis.after("dataUpdate", Y.bind(this._categoryDataChangeHandler, this));- },- - /**- * Event handler for the valueAxisChange event.- *- * @method _valueAxisChangeHandler- * @param {Object} e Event object.- * @private- */- _valueAxisChangeHandler: function(e)- {- var valueAxis = this.get("valueAxis");- valueAxis.after("dataReady", Y.bind(this._valueDataChangeHandler, this));- valueAxis.after("dataUpdate", Y.bind(this._valueDataChangeHandler, this));- },- - /**- * Constant used to generate unique id.- *- * @property GUID- * @type String- * @private- */- GUID: "pieseries",- - /**- * Event handler for categoryDataChange event.- *- * @method _categoryDataChangeHandler- * @param {Object} event Event object.- * @private - */- _categoryDataChangeHandler: function(event)- {- if(this._rendered && this.get("categoryKey") && this.get("valueKey"))- {- this.draw();- }- },-- /**- * Event handler for valueDataChange event.- *- * @method _valueDataChangeHandler- * @param {Object} event Event object.- * @private - */- _valueDataChangeHandler: function(event)- {- if(this._rendered && this.get("categoryKey") && this.get("valueKey"))- {- this.draw();- }- },- - /**- * Draws the series. Overrides the base implementation.- *- * @method draw- * @protected- */- draw: function()- {- var graph = this.get("graph"),- w = graph.get("width"),- h = graph.get("height");- if(isFinite(w) && isFinite(h) && w > 0 && h > 0)- { - this._rendered = true;- if(this._drawing)- {- this._callLater = true;- return;- }- this._drawing = true;- this._callLater = false;- this.drawSeries();- this._drawing = false;- if(this._callLater)- {- this.draw();- }- else- {- this.fire("drawingComplete");- }- }- },-- /**- * Draws the markers- *- * @method drawPlots- * @protected- */- drawPlots: function()- {- var values = this.get("valueAxis").getDataByKey(this.get("valueKey")).concat(),- catValues = this.get("categoryAxis").getDataByKey(this.get("categoryKey")).concat(),- totalValue = 0,- itemCount = values.length,- styles = this.get("styles").marker,- fillColors = styles.fill.colors,- fillAlphas = styles.fill.alphas || ["1"],- borderColors = styles.border.colors,- borderWeights = [styles.border.weight],- borderAlphas = [styles.border.alpha],- tbw = borderWeights.concat(),- tbc = borderColors.concat(),- tba = borderAlphas.concat(),- tfc,- tfa,- padding = styles.padding,- graph = this.get("graph"),- minDimension = Math.min(graph.get("width"), graph.get("height")),- w = minDimension - (padding.left + padding.right),- h = minDimension - (padding.top + padding.bottom),- startAngle = -90,- halfWidth = w / 2,- halfHeight = h / 2,- radius = Math.min(halfWidth, halfHeight),- i = 0,- value,- angle = 0,- lc,- la,- lw,- wedgeStyle,- marker,- graphOrder = this.get("graphOrder"),- isCanvas = Y.Graphic.NAME == "canvasGraphic";- for(; i < itemCount; ++i)- {- value = parseFloat(values[i]);- - values.push(value);- if(!isNaN(value))- {- totalValue += value;- }- }- - tfc = fillColors ? fillColors.concat() : null;- tfa = fillAlphas ? fillAlphas.concat() : null;- this._createMarkerCache();- if(isCanvas)- {- this._setMap();- this._image.width = w;- this._image.height = h;- }- for(i = 0; i < itemCount; i++)- {- value = values[i];- if(totalValue === 0)- {- angle = 360 / values.length;- }- else- {- angle = 360 * (value / totalValue);- }- angle = Math.round(angle);- if(tfc && tfc.length < 1)- {- tfc = fillColors.concat();- }- if(tfa && tfa.length < 1)- {- tfa = fillAlphas.concat();- }- if(tbw && tbw.length < 1)- {- tbw = borderWeights.concat();- }- if(tbw && tbc.length < 1)- {- tbc = borderColors.concat();- }- if(tba && tba.length < 1)- {- tba = borderAlphas.concat();- }- lw = tbw ? tbw.shift() : null;- lc = tbc ? tbc.shift() : null;- la = tba ? tba.shift() : null;- startAngle += angle;- wedgeStyle = {- border: {- color:lc,- weight:lw,- alpha:la- },- fill: {- color:tfc ? tfc.shift() : this._getDefaultColor(i, "slice"),- alpha:tfa ? tfa.shift() : null- },- type: "pieslice",- arc: angle,- radius: radius,- startAngle: startAngle,- cx: halfWidth,- cy: halfHeight,- width: w,- height: h- };- marker = this.getMarker(wedgeStyle, graphOrder, i);- if(isCanvas)- {- this._addHotspot(wedgeStyle, graphOrder, i);- }- }- this._clearMarkerCache();- },-- /**- * Adds an interactive map when rendering in canvas.- *- * @method _addHotspot- * @param {Object} cfg Object containing data used to draw the hotspot- * @param {Number} seriesIndex Index of series in the `seriesCollection`.- * @param {Number} index Index of the marker using the hotspot.- * @private- */- _addHotspot: function(cfg, seriesIndex, index)- {- var areaNode = DOCUMENT.createElement("area"),- i = 1,- x = cfg.cx,- y = cfg.cy, - arc = cfg.arc,- startAngle = cfg.startAngle - arc, - endAngle = cfg.startAngle,- radius = cfg.radius, - ax = x + Math.cos(startAngle / 180 * Math.PI) * radius,- ay = y + Math.sin(startAngle / 180 * Math.PI) * radius,- bx = x + Math.cos(endAngle / 180 * Math.PI) * radius,- by = y + Math.sin(endAngle / 180 * Math.PI) * radius,- numPoints = Math.floor(arc/10) - 1,- divAngle = (arc/(Math.floor(arc/10)) / 180) * Math.PI,- angleCoord = Math.atan((ay - y)/(ax - x)),- pts = x + ", " + y + ", " + ax + ", " + ay,- cosAng,- sinAng,- multDivAng;- for(i = 1; i <= numPoints; ++i)- {- multDivAng = divAngle * i;- cosAng = Math.cos(angleCoord + multDivAng);- sinAng = Math.sin(angleCoord + multDivAng);- if(startAngle <= 90)- {- pts += ", " + (x + (radius * Math.cos(angleCoord + (divAngle * i))));- pts += ", " + (y + (radius * Math.sin(angleCoord + (divAngle * i))));- }- else- {- pts += ", " + (x - (radius * Math.cos(angleCoord + (divAngle * i))));- pts += ", " + (y - (radius * Math.sin(angleCoord + (divAngle * i))));- }- }- pts += ", " + bx + ", " + by;- pts += ", " + x + ", " + y;- this._map.appendChild(areaNode);- areaNode.setAttribute("class", SERIES_MARKER);- areaNode.setAttribute("id", "hotSpot_" + seriesIndex + "_" + index);- areaNode.setAttribute("shape", "polygon");- areaNode.setAttribute("coords", pts);- this._areaNodes.push(areaNode);-- },-- /**- * Resizes and positions markers based on a mouse interaction.- *- * @method updateMarkerState- * @param {String} type state of the marker- * @param {Number} i index of the marker- * @protected- */- updateMarkerState: function(type, i)- {- if(this._markers[i])- {- var state = this._getState(type),- markerStyles,- indexStyles,- marker = this._markers[i],- styles = this.get("styles").marker; - markerStyles = state == "off" || !styles[state] ? styles : styles[state]; - indexStyles = this._mergeStyles(markerStyles, {});- indexStyles.fill.color = indexStyles.fill.colors[i % indexStyles.fill.colors.length];- indexStyles.fill.alpha = indexStyles.fill.alphas[i % indexStyles.fill.alphas.length];- marker.set(indexStyles);- }- },- - /**- * Creates a shape to be used as a marker.- *- * @method _createMarker- * @param {Object} styles Hash of style properties.- * @param {Number} order Order of the series.- * @param {Number} index Index within the series associated with the marker.- * @return Shape- * @private- */- _createMarker: function(styles, order, index)- {- var graphic = this.get("graphic"),- marker,- cfg = Y.clone(styles);- graphic.set("autoDraw", false);- marker = graphic.addShape(cfg); - marker.addClass(SERIES_MARKER);- return marker;- },- - /**- * Creates a cache of markers for reuse.- *- * @method _createMarkerCache- * @private- */- _clearMarkerCache: function()- {- var len = this._markerCache.length,- i = 0,- marker;- for(; i < len; ++i)- {- marker = this._markerCache[i];- if(marker)- {- marker.destroy();- }- }- this._markerCache = [];- },-- /**- * Gets the default style values for the markers.- *- * @method _getPlotDefaults- * @return Object- * @private- */- _getPlotDefaults: function()- {- var defs = {- padding:{- top: 0,- left: 0,- right: 0,- bottom: 0- },- fill:{- alphas:["1"]- },- border: {- weight: 0,- alpha: 1- }- };- defs.fill.colors = this._defaultSliceColors;- defs.border.colors = this._defaultBorderColors;- return defs;- },-- /**- * Collection of default colors used for lines in a series when not specified by user.- *- * @property _defaultLineColors- * @type Array- * @protected- */- _defaultLineColors:["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"],-- /**- * Collection of default colors used for marker fills in a series when not specified by user.- *- * @property _defaultFillColors- * @type Array- * @protected- */- _defaultFillColors:["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"],- - /**- * Collection of default colors used for marker borders in a series when not specified by user.- *- * @property _defaultBorderColors- * @type Array- * @protected- */- _defaultBorderColors:["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"],- - /**- * Collection of default colors used for area fills, histogram fills and pie fills in a series when not specified by user.- *- * @property _defaultSliceColors- * @type Array- * @protected- */- _defaultSliceColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],-- /**- * Colors used if style colors are not specified- *- * @method _getDefaultColor- * @param {Number} index Index indicating the series order.- * @param {String} type Indicates which type of object needs the color.- * @return String- * @protected- */- _getDefaultColor: function(index, type)- {- var colors = {- line: this._defaultLineColors,- fill: this._defaultFillColors,- border: this._defaultBorderColors,- slice: this._defaultSliceColors- },- col = colors[type],- l = col.length;- index = index || 0;- if(index >= l)- {- index = index % l;- }- type = type || "fill";- return colors[type][index];- }-}, {- ATTRS: {- /**- * Read-only attribute indicating the type of series.- *- * @attribute type- * @type String- * @default pie- */- type: { - value: "pie"- },- - /**- * Order of this instance of this `type`.- *- * @attribute order- * @type Number- */- order: {},-- /**- * Reference to the `Graph` in which the series is drawn into.- *- * @attribute graph- * @type Graph- */- graph: {},- - /**- * Reference to the `Axis` instance used for assigning - * category values to the graph.- *- * @attribute categoryAxis- * @type Axis- */- categoryAxis: {- value: null,-- validator: function(value)- {- return value !== this.get("categoryAxis");- }- },- - /**- * Reference to the `Axis` instance used for assigning - * series values to the graph.- *- * @attribute categoryAxis- * @type Axis- */- valueAxis: {- value: null,-- validator: function(value)- {- return value !== this.get("valueAxis");- }- },-- /**- * Indicates which array to from the hash of value arrays in - * the category `Axis` instance.- *- * @attribute categoryKey- * @type String- */- categoryKey: {- value: null,-- validator: function(value)- {- return value !== this.get("categoryKey");- }- },- /**- * Indicates which array to from the hash of value arrays in - * the value `Axis` instance.- *- * @attribute valueKey- * @type String- */- valueKey: {- value: null,-- validator: function(value)- {- return value !== this.get("valueKey");- }- },-- /**- * Name used for for displaying category data- *- * @attribute categoryDisplayName- * @type String- */- categoryDisplayName: {- setter: function(val)- {- this._categoryDisplayName = val;- return val;- },-- getter: function()- {- return this._categoryDisplayName || this.get("categoryKey");- }- },-- /**- * Name used for for displaying value data- *- * @attribute valueDisplayName- * @type String- */- valueDisplayName: {- setter: function(val)- {- this._valueDisplayName = val;- return val;- },-- getter: function()- {- return this._valueDisplayName || this.get("valueKey");- }- },- - /**- * @attribute slices- * @type Array- * @private- */- slices: null- - /**- * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:- * <dl>- * <dt>fill</dt><dd>A hash containing the following values:- * <dl>- * <dt>colors</dt><dd>An array of colors to be used for the marker fills. The color for each marker is retrieved from the - * array below:<br/>- * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`- * </dd>- * <dt>alphas</dt><dd>An array of alpha references (Number from 0 to 1) indicating the opacity of each marker fill. The default value is [1].</dd>- * </dl>- * </dd>- * <dt>border</dt><dd>A hash containing the following values:- * <dl>- * <dt>color</dt><dd>An array of colors to be used for the marker borders. The color for each marker is retrieved from the- * array below:<br/>- * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>- * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default - * values for each style is null. When an over style is not set, the non-over value will be used. For example,- * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});-/**- * Gridlines draws gridlines on a Graph.- *- * @module charts- * @class Gridlines- * @constructor- * @extends Base- * @uses Renderer- */-Y.Gridlines = Y.Base.create("gridlines", Y.Base, [Y.Renderer], {- /**- * Reference to the `Path` element used for drawing Gridlines.- *- * @property _path- * @type Path- * @private- */- _path: null,-- /**- * Removes the Gridlines.- *- * @method remove- * @private- */- remove: function()- {- var path = this._path;- if(path)- {- path.destroy();- }- },-- /**- * Draws the gridlines- *- * @method draw- * @protected- */- draw: function()- {- if(this.get("axis") && this.get("graph"))- {- this._drawGridlines();- }- },-- /**- * Algorithm for drawing gridlines- *- * @method _drawGridlines- * @private- */- _drawGridlines: function()- {- var path,- axis = this.get("axis"),- axisPosition = axis.get("position"),- points,- i = 0,- l,- direction = this.get("direction"),- graph = this.get("graph"),- w = graph.get("width"),- h = graph.get("height"),- line = this.get("styles").line,- color = line.color,- weight = line.weight,- alpha = line.alpha,- lineFunction = direction == "vertical" ? this._verticalLine : this._horizontalLine;- if(isFinite(w) && isFinite(h) && w > 0 && h > 0)- {- if(axisPosition != "none" && axis && axis.get("tickPoints"))- {- points = axis.get("tickPoints");- l = points.length;- }- else- {- points = [];- l = axis.get("styles").majorUnit.count;- for(; i < l; ++i)- {- points[i] = {- x: w * (i/(l-1)),- y: h * (i/(l-1))- };- }- i = 0;- }- path = graph.get("gridlines");- path.set("width", w);- path.set("height", h);- path.set("stroke", {- weight: weight,- color: color,- opacity: alpha- });- for(; i < l; ++i)- {- lineFunction(path, points[i], w, h);- }- path.end();- }- },-- /**- * Algorithm for horizontal lines.- *- * @method _horizontalLine- * @param {Path} path Reference to path element- * @param {Object} pt Coordinates corresponding to a major unit of an axis.- * @param {Number} w Width of the Graph- * @param {Number} h Height of the Graph- * @private- */- _horizontalLine: function(path, pt, w, h)- {- path.moveTo(0, pt.y);- path.lineTo(w, pt.y);- },-- /**- * Algorithm for vertical lines.- *- * @method _verticalLine- * @param {Path} path Reference to path element- * @param {Object} pt Coordinates corresponding to a major unit of an axis.- * @param {Number} w Width of the Graph- * @param {Number} h Height of the Graph- * @private- */- _verticalLine: function(path, pt, w, h)- {- path.moveTo(pt.x, 0);- path.lineTo(pt.x, h);- },- - /**- * Gets the default value for the `styles` attribute. Overrides- * base implementation.- *- * @method _getDefaultStyles- * @return Object- * @protected- */- _getDefaultStyles: function()- {- var defs = {- line: {- color:"#f0efe9",- weight: 1,- alpha: 1- }- };- return defs;- }--},-{- ATTRS: {- /**- * Indicates the direction of the gridline.- *- * @attribute direction- * @type String- */- direction: {},- - /**- * Indicate the `Axis` in which to bind- * the gridlines.- *- * @attribute axis- * @type Axis- */- axis: {},- - /**- * Indicates the `Graph` in which the gridlines - * are drawn.- *- * @attribute graph- * @type Graph- */- graph: {}- }-});-/**- * Graph manages and contains series instances for a `CartesianChart`- * instance.- *- * @module charts- * @class Graph- * @constructor- * @extends Widget- * @uses Renderer- */-Y.Graph = Y.Base.create("graph", Y.Widget, [Y.Renderer], {- /**- * @method bindUI- * @private- */- bindUI: function()- {- var bb = this.get("boundingBox");- bb.setStyle("position", "absolute");- this.after("widthChange", this._sizeChangeHandler);- this.after("heightChange", this._sizeChangeHandler);- this.after("stylesChange", this._updateStyles);- },-- /**- * @method syncUI- * @private- */- syncUI: function()- {- var background,- cb,- bg,- sc = this.get("seriesCollection"),- series,- i = 0,- len = sc.length,- hgl = this.get("horizontalGridlines"),- vgl = this.get("verticalGridlines");- if(this.get("showBackground"))- {- background = this.get("background");- cb = this.get("contentBox");- bg = this.get("styles").background;- bg.stroke = bg.border;- bg.stroke.opacity = bg.stroke.alpha;- bg.fill.opacity = bg.fill.alpha;- bg.width = this.get("width");- bg.height = this.get("height");- bg.type = bg.shape;- background.set(bg);- }- for(; i < len; ++i)- {- series = sc[i];- if(series instanceof Y.CartesianSeries)- {- series.render();- }- }- if(hgl && hgl instanceof Y.Gridlines)- {- hgl.draw();- }- if(vgl && vgl instanceof Y.Gridlines)- {- vgl.draw();- }- },- - /**- * Object of arrays containing series mapped to a series type.- *- * @property seriesTypes- * @type Object- * @private- */- seriesTypes: null,-- /**- * Returns a series instance based on an index.- * - * @method getSeriesByIndex- * @param {Number} val index of the series- * @return CartesianSeries- */- getSeriesByIndex: function(val)- {- var col = this.get("seriesCollection"),- series;- if(col && col.length > val)- {- series = col[val];- }- return series;- },-- /**- * Returns a series instance based on a key value.- * - * @method getSeriesByKey- * @param {String} val key value of the series- * @return CartesianSeries- */- getSeriesByKey: function(val)- {- var obj = this._seriesDictionary,- series;- if(obj && obj.hasOwnProperty(val))- {- series = obj[val];- }- return series;- },-- /**- * Adds dispatcher to a `_dispatcher` used to- * to ensure all series have redrawn before for firing event.- *- * @method addDispatcher- * @param {CartesianSeries} val series instance to add- * @protected- */- addDispatcher: function(val)- {- if(!this._dispatchers)- {- this._dispatchers = [];- }- this._dispatchers.push(val);- },-- /**- * Collection of series to be displayed in the graph.- *- * @property _seriesCollection- * @type Array- * @private - */- _seriesCollection: null,- - /**- * Object containing key value pairs of `CartesianSeries` instances.- *- * @property _seriesDictionary- * @type Object- * @private- */- _seriesDictionary: null,-- /**- * Parses series instances to be displayed in the graph.- *- * @method _parseSeriesCollection- * @param {Array} Collection of `CartesianSeries` instances or objects container `CartesianSeries` attributes values.- * @private- */- _parseSeriesCollection: function(val)- {- if(!val)- {- return;- } - var len = val.length,- i = 0,- series,- seriesKey;- if(!this.get("seriesCollection"))- {- this._seriesCollection = [];- }- if(!this._seriesDictionary)- {- this._seriesDictionary = {};- }- if(!this.seriesTypes)- {- this.seriesTypes = [];- }- for(; i < len; ++i)- { - series = val[i];- if(!(series instanceof Y.CartesianSeries) && !(series instanceof Y.PieSeries))- {- this._createSeries(series);- continue;- }- this._addSeries(series);- }- len = this.get("seriesCollection").length;- for(i = 0; i < len; ++i)- {- series = this.get("seriesCollection")[i];- seriesKey = series.get("direction") == "horizontal" ? "yKey" : "xKey";- this._seriesDictionary[series.get(seriesKey)] = series;- }- },-- /**- * Adds a series to the graph.- *- * @method _addSeries- * @param {CartesianSeries} series Series to add to the graph.- * @private- */- _addSeries: function(series)- {- var type = series.get("type"),- seriesCollection = this.get("seriesCollection"),- graphSeriesLength = seriesCollection.length,- seriesTypes = this.seriesTypes,- typeSeriesCollection; - if(!series.get("graph")) - {- series.set("graph", this);- }- seriesCollection.push(series);- if(!seriesTypes.hasOwnProperty(type))- {- this.seriesTypes[type] = [];- }- typeSeriesCollection = this.seriesTypes[type];- series.set("graphOrder", graphSeriesLength);- series.set("order", typeSeriesCollection.length);- typeSeriesCollection.push(series);- this.addDispatcher(series);- series.after("drawingComplete", Y.bind(this._drawingCompleteHandler, this));- this.fire("seriesAdded", series);- },-- /**- * Creates a `CartesianSeries` instance from an object containing attribute key value pairs. The key value pairs include attributes for the specific series and a type value which defines the type of- * series to be used. - *- * @method createSeries- * @param {Object} seriesData Series attribute key value pairs.- * @private- */- _createSeries: function(seriesData)- {- var type = seriesData.type,- seriesCollection = this.get("seriesCollection"),- seriesTypes = this.seriesTypes,- typeSeriesCollection,- seriesType,- series;- seriesData.graph = this;- if(!seriesTypes.hasOwnProperty(type))- {- seriesTypes[type] = [];- }- typeSeriesCollection = seriesTypes[type];- seriesData.graph = this;- seriesData.order = typeSeriesCollection.length;- seriesData.graphOrder = seriesCollection.length;- seriesType = this._getSeries(seriesData.type);- series = new seriesType(seriesData);- this.addDispatcher(series);- series.after("drawingComplete", Y.bind(this._drawingCompleteHandler, this));- typeSeriesCollection.push(series);- seriesCollection.push(series);- },- - /**- * String reference for pre-defined `Series` classes.- *- * @property _seriesMap- * @type Object- * @private- */- _seriesMap: {- line : Y.LineSeries,- column : Y.ColumnSeries,- bar : Y.BarSeries,- area : Y.AreaSeries,- candlestick : Y.CandlestickSeries,- ohlc : Y.OHLCSeries,- stackedarea : Y.StackedAreaSeries,- stackedline : Y.StackedLineSeries,- stackedcolumn : Y.StackedColumnSeries,- stackedbar : Y.StackedBarSeries,- markerseries : Y.MarkerSeries,- spline : Y.SplineSeries,- areaspline : Y.AreaSplineSeries,- stackedspline : Y.StackedSplineSeries,- stackedareaspline : Y.StackedAreaSplineSeries,- stackedmarkerseries : Y.StackedMarkerSeries,- pie : Y.PieSeries,- combo : Y.ComboSeries,- stackedcombo : Y.StackedComboSeries,- combospline : Y.ComboSplineSeries,- stackedcombospline : Y.StackedComboSplineSeries- },-- /**- * Returns a specific `CartesianSeries` class based on key value from a look up table of a direct reference to a class. When specifying a key value, the following options- * are available:- *- * <table>- * <tr><th>Key Value</th><th>Class</th></tr>- * <tr><td>line</td><td>Y.LineSeries</td></tr> - * <tr><td>column</td><td>Y.ColumnSeries</td></tr> - * <tr><td>bar</td><td>Y.BarSeries</td></tr> - * <tr><td>area</td><td>Y.AreaSeries</td></tr> - * <tr><td>stackedarea</td><td>Y.StackedAreaSeries</td></tr> - * <tr><td>stackedline</td><td>Y.StackedLineSeries</td></tr> - * <tr><td>stackedcolumn</td><td>Y.StackedColumnSeries</td></tr> - * <tr><td>stackedbar</td><td>Y.StackedBarSeries</td></tr> - * <tr><td>markerseries</td><td>Y.MarkerSeries</td></tr> - * <tr><td>spline</td><td>Y.SplineSeries</td></tr> - * <tr><td>areaspline</td><td>Y.AreaSplineSeries</td></tr> - * <tr><td>stackedspline</td><td>Y.StackedSplineSeries</td></tr>- * <tr><td>stackedareaspline</td><td>Y.StackedAreaSplineSeries</td></tr>- * <tr><td>stackedmarkerseries</td><td>Y.StackedMarkerSeries</td></tr>- * <tr><td>pie</td><td>Y.PieSeries</td></tr>- * <tr><td>combo</td><td>Y.ComboSeries</td></tr>- * <tr><td>stackedcombo</td><td>Y.StackedComboSeries</td></tr>- * <tr><td>combospline</td><td>Y.ComboSplineSeries</td></tr>- * <tr><td>stackedcombospline</td><td>Y.StackedComboSplineSeries</td></tr>- * </table>- * - * When referencing a class directly, you can specify any of the above classes or any custom class that extends `CartesianSeries` or `PieSeries`.- *- * @method _getSeries- * @param {String | Object} type Series type.- * @return CartesianSeries- * @private- */- _getSeries: function(type)- {- var seriesClass;- if(Y_Lang.isString(type))- {- seriesClass = this._seriesMap[type];- }- else - {- seriesClass = type;- }- return seriesClass;- },-- /**- * Event handler for marker events.- *- * @method _markerEventHandler- * @param {Object} e Event object.- * @private- */- _markerEventHandler: function(e)- {- var type = e.type,- markerNode = e.currentTarget,- strArr = markerNode.getAttribute("id").split("_"),- series = this.getSeriesByIndex(strArr[1]),- index = strArr[2];- series.updateMarkerState(type, index);- },-- /**- * Collection of `CartesianSeries` instances to be redrawn.- *- * @property _dispatchers- * @type Array- * @private- */- _dispatchers: null,-- /**- * Updates the `Graph` styles.- *- * @method _updateStyles- * @private- */- _updateStyles: function()- {- var styles = this.get("styles").background,- border = styles.border;- border.opacity = border.alpha;- styles.stroke = border;- styles.fill.opacity = styles.fill.alpha;- this.get("background").set(styles);- this._sizeChangeHandler();- },-- /**- * Event handler for size changes.- *- * @method _sizeChangeHandler- * @param {Object} e Event object.- * @private- */- _sizeChangeHandler: function(e)- {- var hgl = this.get("horizontalGridlines"),- vgl = this.get("verticalGridlines"),- w = this.get("width"),- h = this.get("height"),- bg = this.get("styles").background,- weight,- background;- if(bg && bg.border)- {- weight = bg.border.weight || 0;- }- if(this.get("showBackground"))- {- background = this.get("background");- if(w && h)- {- background.set("width", w);- background.set("height", h);- }- }- if(this._gridlines)- {- this._gridlines.clear();- }- if(hgl && hgl instanceof Y.Gridlines)- {- hgl.draw();- }- if(vgl && vgl instanceof Y.Gridlines)- {- vgl.draw();- }- this._drawSeries();- },-- /**- * Draws each series.- *- * @method _drawSeries- * @private- */- _drawSeries: function()- {- if(this._drawing)- {- this._callLater = true;- return;- }- var sc,- i,- len,- graphic = this.get("graphic");- graphic.set("autoDraw", false);- this._callLater = false;- this._drawing = true;- sc = this.get("seriesCollection");- i = 0;- len = sc.length;- for(; i < len; ++i)- {- sc[i].draw();- if((!sc[i].get("xcoords") || !sc[i].get("ycoords")) && !sc[i] instanceof Y.PieSeries)- {- this._callLater = true;- break;- }- }- this._drawing = false;- if(this._callLater)- {- this._drawSeries();- }- }, -- /**- * Event handler for series drawingComplete event.- *- * @method _drawingCompleteHandler- * @param {Object} e Event object.- * @private- */- _drawingCompleteHandler: function(e)- {- var series = e.currentTarget,- graphic,- index = Y.Array.indexOf(this._dispatchers, series);- if(index > -1)- {- this._dispatchers.splice(index, 1);- }- if(this._dispatchers.length < 1)- {- graphic = this.get("graphic");- if(!graphic.get("autoDraw"))- {- graphic._redraw();- }- this.fire("chartRendered");- }- },-- /**- * Gets the default value for the `styles` attribute. Overrides- * base implementation.- *- * @method _getDefaultStyles- * @return Object- * @protected- */- _getDefaultStyles: function()- {- var defs = {- background: {- shape: "rect",- fill:{- color:"#faf9f2"- },- border: {- color:"#dad8c9",- weight: 1- }- }- };- return defs;- },-- /**- * Destructor implementation Graph class. Removes all Graphic instances from the widget.- *- * @method destructor- * @protected- */- destructor: function()- {- if(this._graphic)- {- this._graphic.destroy();- }- if(this._background)- {- this._background.get("graphic").destroy();- }- if(this._gridlines)- {- this._gridlines.get("graphic").destroy();- }- }-}, {- ATTRS: {- /**- * The x-coordinate for the graph.- *- * @attribute x- * @type Number- * @protected- */- x: {- setter: function(val)- {- this.get("boundingBox").setStyle("left", val + "px");- return val;- }- },-- /**- * The y-coordinate for the graph.- *- * @attribute y- * @type Number- * @protected- */- y: {- setter: function(val)- {- this.get("boundingBox").setStyle("top", val + "px");- return val;- }- },-- /**- * Reference to the chart instance using the graph.- *- * @attribute chart- * @type ChartBase- * @readOnly- */- chart: {},-- /**- * Collection of series. When setting the `seriesCollection` the array can contain a combination of either- * `CartesianSeries` instances or object literals with properties that will define a series.- *- * @attribute seriesCollection- * @type CartesianSeries- */- seriesCollection: {- getter: function()- {- return this._seriesCollection;- },-- setter: function(val)- {- this._parseSeriesCollection(val);- return this._seriesCollection;- }- },- - /**- * Indicates whether the `Graph` has a background.- *- * @attribute showBackground- * @type Boolean- * @default true- */- showBackground: {- value: true- },-- /**- * Read-only hash lookup for all series on in the `Graph`.- *- * @attribute seriesDictionary- * @type Object- * @readOnly- */- seriesDictionary: {- readOnly: true,-- getter: function()- {- return this._seriesDictionary;- }- },-- /**- * Reference to the horizontal `Gridlines` instance.- *- * @attribute horizontalGridlines- * @type Gridlines- * @default null- */- horizontalGridlines: {- value: null,-- setter: function(val)- {- var gl = this.get("horizontalGridlines");- if(gl && gl instanceof Y.Gridlines)- {- gl.remove();- }- if(val instanceof Y.Gridlines)- {- gl = val;- val.set("graph", this);- return val;- }- else if(val && val.axis)- {- gl = new Y.Gridlines({direction:"horizontal", axis:val.axis, graph:this, styles:val.styles});- return gl;- }- }- },- - /**- * Reference to the vertical `Gridlines` instance.- *- * @attribute verticalGridlines- * @type Gridlines- * @default null- */- verticalGridlines: {- value: null,-- setter: function(val)- {- var gl = this.get("verticalGridlines");- if(gl && gl instanceof Y.Gridlines)- {- gl.remove();- }- if(val instanceof Y.Gridlines)- {- gl = val;- val.set("graph", this);- return val;- }- else if(val && val.axis)- {- gl = new Y.Gridlines({direction:"vertical", axis:val.axis, graph:this, styles:val.styles});- return gl;- }- }- },-- /**- * Reference to graphic instance used for the background.- *- * @attribute background- * @type Graphic- * @readOnly- */- background: {- getter: function()- {- if(!this._background)- {- this._backgroundGraphic = new Y.Graphic({render:this.get("contentBox")});- this._backgroundGraphic.get("node").style.zIndex = 0; - this._background = this._backgroundGraphic.addShape({type: "rect"});- }- return this._background;- }- },-- /**- * Reference to graphic instance used for gridlines.- *- * @attribute gridlines- * @type Graphic- * @readOnly- */- gridlines: {- readOnly: true,-- getter: function()- {- if(!this._gridlines)- {- this._gridlinesGraphic = new Y.Graphic({render:this.get("contentBox")});- this._gridlinesGraphic.get("node").style.zIndex = 1; - this._gridlines = this._gridlinesGraphic.addShape({type: "path"});- }- return this._gridlines;- }- },- - /**- * Reference to graphic instance used for series.- *- * @attribute graphic- * @type Graphic- * @readOnly- */- graphic: {- readOnly: true,-- getter: function() - {- if(!this._graphic)- {- this._graphic = new Y.Graphic({render:this.get("contentBox")});- this._graphic.get("node").style.zIndex = 2; - this._graphic.set("autoDraw", false);- }- return this._graphic;- }- },-- /**- * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.- *- * @attribute groupMarkers- * @type Boolean- */- groupMarkers: {- value: false- }-- /**- * Style properties used for drawing a background. Below are the default values:- * <dl>- * <dt>background</dt><dd>An object containing the following values:- * <dl>- * <dt>fill</dt><dd>Defines the style properties for the fill. Contains the following values:- * <dl>- * <dt>color</dt><dd>Color of the fill. The default value is #faf9f2.</dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the background fill. The default value is 1.</dd>- * </dl>- * </dd>- * <dt>border</dt><dd>Defines the style properties for the border. Contains the following values:- * <dl>- * <dt>color</dt><dd>Color of the border. The default value is #dad8c9.</dd>- * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the background border. The default value is 1.</dd>- * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>- * </dl>- * </dd>- * </dl>- * </dd>- * </dl>- *- * @attribute styles- * @type Object- */- }-});-/**- * The ChartBase class is an abstract class used to create charts.- *- * @module charts- * @class ChartBase- * @constructor- */-function ChartBase() {}--ChartBase.ATTRS = {- /**- * Sets the `aria-label` for the chart.- *- * @attribute ariaLabel- * @type String- */- ariaLabel: {- value: "Chart Application",-- setter: function(val)- {- var cb = this.get("contentBox");- if(cb)- {- cb.setAttribute("aria-label", val);- }- return val;- }- },- - /**- * Sets the aria description for the chart.- *- * @attribute ariaDescription- * @type String- */- ariaDescription: {- value: "Use the up and down keys to navigate between series. Use the left and right keys to navigate through items in a series.",-- setter: function(val)- {- if(this._description)- {- this._description.setContent("");- this._description.appendChild(DOCUMENT.createTextNode(val));- }- return val;- }- },- - /**- * Reference to the default tooltip available for the chart.- * <p>Contains the following properties:</p>- * <dl>- * <dt>node</dt><dd>Reference to the actual dom node</dd>- * <dt>showEvent</dt><dd>Event that should trigger the tooltip</dd>- * <dt>hideEvent</dt><dd>Event that should trigger the removal of a tooltip (can be an event or an array of events)</dd>- * <dt>styles</dt><dd>A hash of style properties that will be applied to the tooltip node</dd>- * <dt>show</dt><dd>Indicates whether or not to show the tooltip</dd>- * <dt>markerEventHandler</dt><dd>Displays and hides tooltip based on marker events</dd>- * <dt>planarEventHandler</dt><dd>Displays and hides tooltip based on planar events</dd>- * <dt>markerLabelFunction</dt><dd>Reference to the function used to format a marker event triggered tooltip's text. The method contains - * the following arguments:- * <dl>- * <dt>categoryItem</dt><dd>An object containing the following:- * <dl>- * <dt>axis</dt><dd>The axis to which the category is bound.</dd>- * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided).</dd>- * <dt>key</dt><dd>The key of the category.</dd>- * <dt>value</dt><dd>The value of the category.</dd>- * </dl>- * </dd>- * <dt>valueItem</dt><dd>An object containing the following:- * <dl>- * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>- * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>- * <dt>key</dt><dd>The key for the series.</dd>- * <dt>value</dt><dd>The value for the series item.</dd> - * </dl>- * </dd>- * <dt>itemIndex</dt><dd>The index of the item within the series.</dd>- * <dt>series</dt><dd> The `CartesianSeries` instance of the item.</dd>- * <dt>seriesIndex</dt><dd>The index of the series in the `seriesCollection`.</dd>- * </dl>- * The method returns an `HTMLElement` which is written into the DOM using `appendChild`. If you override this method and choose to return an html string, you- * will also need to override the tooltip's `setTextFunction` method to accept an html string.- * </dd>- * <dt>planarLabelFunction</dt><dd>Reference to the function used to format a planar event triggered tooltip's text- * <dl>- * <dt>categoryAxis</dt><dd> `CategoryAxis` Reference to the categoryAxis of the chart.- * <dt>valueItems</dt><dd>Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:- * <dl>- * <dt>axis</dt><dd>The value axis of the series.</dd>- * <dt>key</dt><dd>The key for the series.</dd>- * <dt>value</dt><dd>The value for the series item.</dd>- * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>- * </dl> - * </dd>- * <dt>index</dt><dd>The index of the item within its series.</dd>- * <dt>seriesArray</dt><dd>Array of series instances for each value item.</dd>- * <dt>seriesIndex</dt><dd>The index of the series in the `seriesCollection`.</dd>- * </dl>- * </dd>- * </dl>- * The method returns an `HTMLElement` which is written into the DOM using `appendChild`. If you override this method and choose to return an html string, you- * will also need to override the tooltip's `setTextFunction` method to accept an html string.- * </dd>- * <dt>setTextFunction</dt><dd>Method that writes content returned from `planarLabelFunction` or `markerLabelFunction` into the the tooltip node.- * has the following signature:- * <dl>- * <dt>label</dt><dd>The `HTMLElement` that the content is to be added.</dd>- * <dt>val</dt><dd>The content to be rendered into tooltip. This can be a `String` or `HTMLElement`. If an HTML string is used, it will be rendered as a- * string.</dd>- * </dl>- * </dd>- * </dl>- * @attribute tooltip- * @type Object- */ - tooltip: {- valueFn: "_getTooltip",-- setter: function(val)- {- return this._updateTooltip(val);- }- },-- /** - * The key value used for the chart's category axis. - *- * @attribute categoryKey- * @type String- * @default category- */- categoryKey: {- value: "category"- },- - /**- * Indicates the type of axis to use for the category axis.- *- * <dl>- * <dt>category</dt><dd>Specifies a `CategoryAxis`.</dd>- * <dt>time</dt><dd>Specifies a `TimeAxis</dd>- * </dl>- *- * @attribute categoryType- * @type String- * @default category- */- categoryType:{- value:"category"- },-- /**- * Indicates the the type of interactions that will fire events.- *- * <dl>- * <dt>marker</dt><dd>Events will be broadcasted when the mouse interacts with individual markers.</dd>- * <dt>planar</dt><dd>Events will be broadcasted when the mouse intersects the plane of any markers on the chart.</dd>- * <dt>none</dt><dd>No events will be broadcasted.</dd>- * </dl>- *- * @attribute interactionType- * @type String- * @default marker- */- interactionType: {- value: "marker"- },-- /**- * Data used to generate the chart.- * - * @attribute dataProvider- * @type Array- */- dataProvider: {- setter: function(val)- {- return this._setDataValues(val);- }- },- - /**- * A collection of keys that map to the series axes. If no keys are set,- * they will be generated automatically depending on the data structure passed into - * the chart.- *- * @attribute seriesKeys- * @type Array- */- seriesKeys: {},-- /**- * Reference to all the axes in the chart.- *- * @attribute axesCollection- * @type Array- */- axesCollection: {},-- /**- * Reference to graph instance.- * - * @attribute graph- * @type Graph - */- graph: {- valueFn: "_getGraph"- },-- /**- * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.- *- * @attribute groupMarkers- * @type Boolean- */- groupMarkers: {- value: false,-- setter: function(val)- {- if(this.get("graph"))- {- this.get("graph").set("groupMarkers", val);- }- return val;- }- }-};--ChartBase.prototype = {- /**- * Handler for itemRendered event.- *- * @method _itemRendered- * @param {Object} e Event object.- * @private- */- _itemRendered: function(e)- {- this._itemRenderQueue = this._itemRenderQueue.splice(1 + Y.Array.indexOf(this._itemRenderQueue, e.currentTarget), 1);- if(this._itemRenderQueue.length < 1)- {- this._redraw();- }- },-- /**- * Default value function for the `Graph` attribute.- *- * @method _getGraph- * @return Graph- * @private- */- _getGraph: function()- {- var graph = new Y.Graph({- chart:this,- groupMarkers: this.get("groupMarkers") - });- graph.after("chartRendered", Y.bind(function(e) {- this.fire("chartRendered");- }, this));- return graph; - },-- /**- * Returns a series instance by index or key value.- *- * @method getSeries- * @param val- * @return CartesianSeries- */- getSeries: function(val)- {- var series = null, - graph = this.get("graph");- if(graph)- {- if(Y_Lang.isNumber(val))- {- series = graph.getSeriesByIndex(val);- }- else- {- series = graph.getSeriesByKey(val);- }- }- return series;- },-- /**- * Returns an `Axis` instance by key reference. If the axis was explicitly set through the `axes` attribute,- * the key will be the same as the key used in the `axes` object. For default axes, the key for- * the category axis is the value of the `categoryKey` (`category`). For the value axis, the default - * key is `values`.- *- * @method getAxisByKey- * @param {String} val Key reference used to look up the axis.- * @return Axis- */- getAxisByKey: function(val)- {- var axis,- axes = this.get("axes");- if(axes && axes.hasOwnProperty(val))- {- axis = axes[val];- }- return axis;- },-- /**- * Returns the category axis for the chart.- *- * @method getCategoryAxis- * @return Axis- */- getCategoryAxis: function()- {- var axis,- key = this.get("categoryKey"),- axes = this.get("axes");- if(axes.hasOwnProperty(key))- {- axis = axes[key];- }- return axis;- },-- /**- * Default direction of the chart.- *- * @property _direction- * @type String- * @default horizontal- * @private- */- _direction: "horizontal",- - /**- * Storage for the `dataProvider` attribute.- *- * @property _dataProvider- * @type Array- * @private- */- _dataProvider: null,-- /**- * Setter method for `dataProvider` attribute.- *- * @method _setDataValues- * @param {Array} val Array to be set as `dataProvider`.- * @return Array- * @private- */- _setDataValues: function(val)- {- if(Y_Lang.isArray(val[0]))- {- var hash, - dp = [], - cats = val[0], - i = 0, - l = cats.length, - n, - sl = val.length;- for(; i < l; ++i)- {- hash = {category:cats[i]};- for(n = 1; n < sl; ++n)- {- hash["series" + n] = val[n][i];- }- dp[i] = hash; - }- return dp;- }- return val;- },-- /**- * Storage for `seriesCollection` attribute.- *- * @property _seriesCollection- * @type Array- * @private - */- _seriesCollection: null,-- /**- * Setter method for `seriesCollection` attribute.- *- * @property _setSeriesCollection- * @param {Array} val Array of either `CartesianSeries` instances or objects containing series attribute key value pairs.- * @private- */- _setSeriesCollection: function(val)- {- this._seriesCollection = val;- },- /**- * Helper method that returns the axis class that a key references.- *- * @method _getAxisClass- * @param {String} t The type of axis.- * @return Axis- * @private- */- _getAxisClass: function(t)- {- return this._axisClass[t];- },- - /**- * Key value pairs of axis types. - *- * @property _axisClass- * @type Object- * @private- */- _axisClass: {- stacked: Y.StackedAxis,- numeric: Y.NumericAxis,- category: Y.CategoryAxis,- time: Y.TimeAxis- },-- /**- * Collection of axes.- *- * @property _axes- * @type Array- * @private- */- _axes: null,-- /**- * @method initializer- * @private- */- initializer: function()- {- this._itemRenderQueue = [];- this._seriesIndex = -1;- this._itemIndex = -1;- this.after("dataProviderChange", this._dataProviderChangeHandler);- },-- /**- * @method renderUI- * @private- */- renderUI: function()- {- var tt = this.get("tooltip"),- bb = this.get("boundingBox"),- cb = this.get("contentBox");- //move the position = absolute logic to a class file- bb.setStyle("position", "absolute");- cb.setStyle("position", "absolute");- this._addAxes();- this._addSeries();- if(tt && tt.show)- {- this._addTooltip();- }- this._setAriaElements(bb, cb);- },- - /**- * Creates an aria `live-region`, `aria-label` and `aria-describedby` for the Chart.- *- * @method _setAriaElements- * @param {Node} cb Reference to the Chart's `contentBox` attribute.- * @private- */- _setAriaElements: function(bb, cb)- {- var description = this._getAriaOffscreenNode(),- id = this.get("id") + "_description",- liveRegion = this._getAriaOffscreenNode();- cb.set("tabIndex", 0);- cb.set("role", "img");- cb.setAttribute("aria-label", this.get("ariaLabel"));- cb.setAttribute("aria-describedby", id);- description.set("id", id);- description.set("tabIndex", -1);- description.appendChild(DOCUMENT.createTextNode(this.get("ariaDescription")));- liveRegion.set("id", "live-region");- liveRegion.set("aria-live", "polite");- liveRegion.set("aria-atomic", "true");- liveRegion.set("role", "status");- bb.setAttribute("role", "application");- bb.appendChild(description);- bb.appendChild(liveRegion);- this._description = description;- this._liveRegion = liveRegion;- },-- /**- * Sets a node offscreen for use as aria-description or aria-live-regin.- *- * @method _setOffscreen- * @return Node - * @private- */- _getAriaOffscreenNode: function() - {- var node = Y.Node.create("<div></div>"),- ie = Y.UA.ie,- clipRect = (ie && ie < 8) ? "rect(1px 1px 1px 1px)" : "rect(1px, 1px, 1px, 1px)";- node.setStyle("position", "absolute");- node.setStyle("height", "1px"); - node.setStyle("width", "1px"); - node.setStyle("overflow", "hidden");- node.setStyle("clip", clipRect); - return node;- },- - /**- * @method syncUI- * @private- */- syncUI: function()- {- this._redraw();- },-- /**- * @method bindUI- * @private- */- bindUI: function()- {- this.after("tooltipChange", Y.bind(this._tooltipChangeHandler, this));- this.after("widthChange", this._sizeChanged);- this.after("heightChange", this._sizeChanged);- var tt = this.get("tooltip"),- hideEvent = "mouseout",- showEvent = "mouseover",- cb = this.get("contentBox"),- interactionType = this.get("interactionType"),- i = 0,- len,- markerClassName = "." + SERIES_MARKER,- isTouch = ((WINDOW && ("ontouchstart" in WINDOW)) && !(Y.UA.chrome && Y.UA.chrome < 6));- Y.on("keydown", Y.bind(function(e) {- var key = e.keyCode,- numKey = parseFloat(key),- msg;- if(numKey > 36 && numKey < 41)- {- e.halt();- msg = this._getAriaMessage(numKey);- this._liveRegion.setContent("");- this._liveRegion.appendChild(DOCUMENT.createTextNode(msg));- }- }, this), this.get("contentBox"));- if(interactionType == "marker")- {- //if touch capabilities, toggle tooltip on touchend. otherwise, the tooltip attribute's hideEvent/showEvent types.- hideEvent = tt.hideEvent;- showEvent = tt.showEvent;- if(isTouch)- {- Y.delegate("touchend", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);- //hide active tooltip if the chart is touched- Y.on("touchend", Y.bind(function(e) {- e.halt(true);- if(this._activeMarker)- {- this._activeMarker = null;- this.hideTooltip(e);- }- }, this));- }- else- {- Y.delegate("mouseenter", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);- Y.delegate("mousedown", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);- Y.delegate("mouseup", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);- Y.delegate("mouseleave", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);- Y.delegate("click", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);- Y.delegate("mousemove", Y.bind(this._positionTooltip, this), cb, markerClassName);- }- }- else if(interactionType == "planar")- {- if(isTouch)- {- this._overlay.on("touchend", Y.bind(this._planarEventDispatcher, this));- }- else- {- this._overlay.on("mousemove", Y.bind(this._planarEventDispatcher, this));- this.on("mouseout", this.hideTooltip);- }- }- if(tt)- {- this.on("markerEvent:touchend", Y.bind(function(e) {- var marker = e.series.get("markers")[e.index];- if(this._activeMarker && marker === this._activeMarker)- {- this._activeMarker = null;- this.hideTooltip(e);- }- else- {-- this._activeMarker = marker;- tt.markerEventHandler.apply(this, [e]);- }- }, this));- if(hideEvent && showEvent && hideEvent == showEvent)- {- this.on(interactionType + "Event:" + hideEvent, this.toggleTooltip);- }- else- {- if(showEvent)- {- this.on(interactionType + "Event:" + showEvent, tt[interactionType + "EventHandler"]);- }- if(hideEvent)- {- if(Y_Lang.isArray(hideEvent))- {- len = hideEvent.length;- for(; i < len; ++i)- {- this.on(interactionType + "Event:" + hideEvent[i], this.hideTooltip);- }- }- this.on(interactionType + "Event:" + hideEvent, this.hideTooltip);- }- }- }- },- - /**- * Event handler for marker events.- *- * @method _markerEventDispatcher- * @param {Object} e Event object.- * @private- */- _markerEventDispatcher: function(e)- {- var type = e.type,- cb = this.get("contentBox"),- markerNode = e.currentTarget,- strArr = markerNode.getAttribute("id").split("_"),- index = strArr.pop(),- seriesIndex = strArr.pop(),- series = this.getSeries(parseInt(seriesIndex, 10)),- items = this.getSeriesItems(series, index),- isTouch = e && e.hasOwnProperty("changedTouches"),- pageX = isTouch ? e.changedTouches[0].pageX : e.pageX,- pageY = isTouch ? e.changedTouches[0].pageY : e.pageY,- x = pageX - cb.getX(),- y = pageY - cb.getY();- if(type == "mouseenter")- {- type = "mouseover";- }- else if(type == "mouseleave")- {- type = "mouseout";- }- series.updateMarkerState(type, index);- e.halt();- /**- * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseover event.- * - *- * @event markerEvent:mouseover- * @preventable false- * @param {EventFacade} e Event facade with the following additional- * properties:- * <dl>- * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>- * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>- * <dt>node</dt><dd>The dom node of the marker.</dd>- * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>- * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>- * <dt>series</dt><dd>Reference to the series of the marker.</dd>- * <dt>index</dt><dd>Index of the marker in the series.</dd>- * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>- * </dl>- */- /**- * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseout event.- *- * @event markerEvent:mouseout- * @preventable false- * @param {EventFacade} e Event facade with the following additional- * properties:- * <dl>- * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>- * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>- * <dt>node</dt><dd>The dom node of the marker.</dd>- * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>- * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>- * <dt>series</dt><dd>Reference to the series of the marker.</dd>- * <dt>index</dt><dd>Index of the marker in the series.</dd>- * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>- * </dl>- */- /**- * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mousedown event.- *- * @event markerEvent:mousedown- * @preventable false- * @param {EventFacade} e Event facade with the following additional- * properties:- * <dl>- * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>- * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>- * <dt>node</dt><dd>The dom node of the marker.</dd>- * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>- * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>- * <dt>series</dt><dd>Reference to the series of the marker.</dd>- * <dt>index</dt><dd>Index of the marker in the series.</dd>- * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>- * </dl>- */- /**- * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseup event.- *- * @event markerEvent:mouseup- * @preventable false- * @param {EventFacade} e Event facade with the following additional- * properties:- * <dl>- * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>- * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>- * <dt>node</dt><dd>The dom node of the marker.</dd>- * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>- * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>- * <dt>series</dt><dd>Reference to the series of the marker.</dd>- * <dt>index</dt><dd>Index of the marker in the series.</dd>- * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>- * </dl>- */- /**- * Broadcasts when `interactionType` is set to `marker` and a series marker has received a click event.- *- * @event markerEvent:click- * @preventable false- * @param {EventFacade} e Event facade with the following additional- * properties:- * <dl>- * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>- * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>- * <dt>node</dt><dd>The dom node of the marker.</dd>- * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>- * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>- * <dt>pageX</dt><dd>The x location of the event on the page (including scroll)</dd>- * <dt>pageY</dt><dd>The y location of the event on the page (including scroll)</dd>- * <dt>series</dt><dd>Reference to the series of the marker.</dd>- * <dt>index</dt><dd>Index of the marker in the series.</dd>- * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>- * <dt>originEvent</dt><dd>Underlying dom event.</dd>- * </dl>- */- this.fire("markerEvent:" + type, {- originEvent: e,- pageX:pageX, - pageY:pageY, - categoryItem:items.category, - valueItem:items.value, - node:markerNode, - x:x, - y:y, - series:series, - index:index, - seriesIndex:seriesIndex- });- },-- /**- * Event handler for dataProviderChange.- *- * @method _dataProviderChangeHandler- * @param {Object} e Event object.- * @private- */- _dataProviderChangeHandler: function(e)- {- var dataProvider = this.get("dataProvider"),- axes = this.get("axes"),- i,- axis;- this._seriesIndex = -1;- this._itemIndex = -1;- if(axes)- {- for(i in axes)- {- if(axes.hasOwnProperty(i))- {- axis = axes[i];- if(axis instanceof Y.Axis)- {- if(axis.get("position") != "none")- {- this._addToAxesRenderQueue(axis);- }- axis.set("dataProvider", dataProvider);- }- }- }- }- },- - /**- * Event listener for toggling the tooltip. If a tooltip is visible, hide it. If not, it - * will create and show a tooltip based on the event object.- * - * @method toggleTooltip- * @param {Object} e Event object.- */- toggleTooltip: function(e)- {- var tt = this.get("tooltip");- if(tt.visible)- {- this.hideTooltip();- }- else- {- tt.markerEventHandler.apply(this, [e]);- }- },-- /**- * Shows a tooltip- *- * @method _showTooltip- * @param {String} msg Message to dispaly in the tooltip.- * @param {Number} x x-coordinate - * @param {Number} y y-coordinate- * @private- */- _showTooltip: function(msg, x, y)- {- var tt = this.get("tooltip"),- node = tt.node;- if(msg)- {- tt.visible = true;- tt.setTextFunction(node, msg);- node.setStyle("top", y + "px");- node.setStyle("left", x + "px");- node.setStyle("visibility", "visible");- }- },-- /**- * Positions the tooltip- *- * @method _positionTooltip- * @param {Object} e Event object.- * @private- */- _positionTooltip: function(e)- {- var tt = this.get("tooltip"),- node = tt.node,- cb = this.get("contentBox"),- x = (e.pageX + 10) - cb.getX(),- y = (e.pageY + 10) - cb.getY();- if(node)- {- node.setStyle("left", x + "px");- node.setStyle("top", y + "px");- }- },-- /**- * Hides the default tooltip- *- * @method hideTooltip- */- hideTooltip: function()- {- var tt = this.get("tooltip"),- node = tt.node;- tt.visible = false;- node.set("innerHTML", "");- node.setStyle("left", -10000);- node.setStyle("top", -10000);- node.setStyle("visibility", "hidden");- },-- /**- * Adds a tooltip to the dom.- *- * @method _addTooltip- * @private- */- _addTooltip: function()- {- var tt = this.get("tooltip"),- id = this.get("id") + "_tooltip",- cb = this.get("contentBox"),- oldNode = DOCUMENT.getElementById(id);- if(oldNode)- {- cb.removeChild(oldNode);- }- tt.node.set("id", id);- tt.node.setStyle("visibility", "hidden");- cb.appendChild(tt.node);- },-- /**- * Updates the tooltip attribute.- *- * @method _updateTooltip- * @param {Object} val Object containing properties for the tooltip.- * @return Object- * @private- */- _updateTooltip: function(val)- {- var tt = this._tooltip,- i,- styles,- node,- props = {- markerLabelFunction:"markerLabelFunction",- planarLabelFunction:"planarLabelFunction",- setTextFunction:"setTextFunction",- showEvent:"showEvent",- hideEvent:"hideEvent",- markerEventHandler:"markerEventHandler",- planarEventHandler:"planarEventHandler",- show:"show"- };- if(Y_Lang.isObject(val))- {- styles = val.styles;- node = Y.one(val.node) || tt.node;- if(styles)- {- for(i in styles)- {- if(styles.hasOwnProperty(i))- {- node.setStyle(i, styles[i]);- }- }- }- for(i in props)- {- if(val.hasOwnProperty(i))- {- tt[i] = val[i];- }- }- tt.node = node;- }- return tt;- },-- /**- * Default getter for `tooltip` attribute.- *- * @method _getTooltip- * @return Object- * @private- */- _getTooltip: function()- {- var node = DOCUMENT.createElement("div"),- tt = {- setTextFunction: this._setText,- markerLabelFunction: this._tooltipLabelFunction,- planarLabelFunction: this._planarLabelFunction,- show: true,- hideEvent: "mouseout",- showEvent: "mouseover",- markerEventHandler: function(e)- {- var tt = this.get("tooltip"),- msg = tt.markerLabelFunction.apply(this, [e.categoryItem, e.valueItem, e.index, e.series, e.seriesIndex]);- this._showTooltip(msg, e.x + 10, e.y + 10);- },- planarEventHandler: function(e)- {- var tt = this.get("tooltip"),- msg ,- categoryAxis = this.get("categoryAxis");- msg = tt.planarLabelFunction.apply(this, [categoryAxis, e.valueItem, e.index, e.items, e.seriesIndex]);- this._showTooltip(msg, e.x + 10, e.y + 10);- }- };- node = Y.one(node);- node.set("id", this.get("id") + "_tooltip");- node.setStyle("fontSize", "85%");- node.setStyle("opacity", "0.83");- node.setStyle("position", "absolute");- node.setStyle("paddingTop", "2px");- node.setStyle("paddingRight", "5px");- node.setStyle("paddingBottom", "4px");- node.setStyle("paddingLeft", "2px");- node.setStyle("backgroundColor", "#fff");- node.setStyle("border", "1px solid #dbdccc");- node.setStyle("pointerEvents", "none");- node.setStyle("zIndex", 3);- node.setStyle("whiteSpace", "noWrap");- node.setStyle("visibility", "hidden");- tt.node = Y.one(node);- this._tooltip = tt;- return tt;- },-- /**- * Formats tooltip text when `interactionType` is `planar`.- *- * @method _planarLabelFunction- * @param {Axis} categoryAxis Reference to the categoryAxis of the chart.- * @param {Array} valueItems Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:- * <dl>- * <dt>axis</dt><dd>The value axis of the series.</dd>- * <dt>key</dt><dd>The key for the series.</dd>- * <dt>value</dt><dd>The value for the series item.</dd>- * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>- * </dl> - * @param {Number} index The index of the item within its series.- * @param {Array} seriesArray Array of series instances for each value item.- * @param {Number} seriesIndex The index of the series in the `seriesCollection`.- * @return {String | HTML} - * @private- */- _planarLabelFunction: function(categoryAxis, valueItems, index, seriesArray, seriesIndex)- {- var msg = DOCUMENT.createElement("div"),- valueItem,- i = 0,- len = seriesArray.length,- axis,- categoryValue,- seriesValue,- series;- if(categoryAxis)- {- categoryValue = categoryAxis.get("labelFunction").apply(this, [categoryAxis.getKeyValueAt(this.get("categoryKey"), index), categoryAxis.get("labelFormat")]);- if(!Y_Lang.isObject(categoryValue))- {- categoryValue = DOCUMENT.createTextNode(categoryValue);- }- msg.appendChild(categoryValue);- }-- for(; i < len; ++i)- {- series = seriesArray[i];- if(series.get("visible"))- {- valueItem = valueItems[i];- axis = valueItem.axis;- seriesValue = axis.get("labelFunction").apply(this, [axis.getKeyValueAt(valueItem.key, index), axis.get("labelFormat")]);- msg.appendChild(DOCUMENT.createElement("br"));- msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName));- msg.appendChild(DOCUMENT.createTextNode(": "));- if(!Y_Lang.isObject(seriesValue))- {- seriesValue = DOCUMENT.createTextNode(seriesValue);- }- msg.appendChild(seriesValue);- }- }- return msg;- },-- /**- * Formats tooltip text when `interactionType` is `marker`.- *- * @method _tooltipLabelFunction- * @param {Object} categoryItem An object containing the following:- * <dl>- * <dt>axis</dt><dd>The axis to which the category is bound.</dd>- * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided)</dd>- * <dt>key</dt><dd>The key of the category.</dd>- * <dt>value</dt><dd>The value of the category</dd>- * </dl>- * @param {Object} valueItem An object containing the following:- * <dl>- * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>- * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>- * <dt>key</dt><dd>The key for the series.</dd>- * <dt>value</dt><dd>The value for the series item.</dd> - * </dl>- * @param {Number} itemIndex The index of the item within the series.- * @param {CartesianSeries} series The `CartesianSeries` instance of the item.- * @param {Number} seriesIndex The index of the series in the `seriesCollection`.- * @return {String | HTML}- * @private- */- _tooltipLabelFunction: function(categoryItem, valueItem, itemIndex, series, seriesIndex)- {- var msg = DOCUMENT.createElement("div"),- categoryValue = categoryItem.axis.get("labelFunction").apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]),- seriesValue = valueItem.axis.get("labelFunction").apply(this, [valueItem.value, valueItem.axis.get("labelFormat")]);- msg.appendChild(DOCUMENT.createTextNode(categoryItem.displayName)); - msg.appendChild(DOCUMENT.createTextNode(": ")); - if(!Y_Lang.isObject(categoryValue))- {- categoryValue = DOCUMENT.createTextNode(categoryValue);- }- msg.appendChild(categoryValue);- msg.appendChild(DOCUMENT.createElement("br"));- msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName)); - msg.appendChild(DOCUMENT.createTextNode(": ")); - if(!Y_Lang.isObject(seriesValue))- {- seriesValue = DOCUMENT.createTextNode(seriesValue);- }- msg.appendChild(seriesValue);- return msg; - },-- /**- * Event handler for the tooltipChange.- *- * @method _tooltipChangeHandler- * @param {Object} e Event object.- * @private- */- _tooltipChangeHandler: function(e)- {- if(this.get("tooltip"))- {- var tt = this.get("tooltip"),- node = tt.node,- show = tt.show,- cb = this.get("contentBox");- if(node && show)- {- if(!cb.contains(node))- {- this._addTooltip();- }- }- }- },- - /**- * Updates the content of text field. This method writes a value into a text field using - * `appendChild`. If the value is a `String`, it is converted to a `TextNode` first. - *- * @method _setText- * @param label {HTMLElement} label to be updated- * @param val {String} value with which to update the label- * @private- */- _setText: function(textField, val)- { - textField.setContent("");- if(Y_Lang.isNumber(val))- {- val = val + "";- }- else if(!val)- {- val = "";- }- if(IS_STRING(val))- {- val = DOCUMENT.createTextNode(val);- }- textField.appendChild(val);- }-};-Y.ChartBase = ChartBase;-/**- * The CartesianChart class creates a chart with horizontal and vertical axes.- *- * @module charts- * @class CartesianChart- * @extends ChartBase- * @constructor- */-Y.CartesianChart = Y.Base.create("cartesianChart", Y.Widget, [Y.ChartBase], {- /**- * @method renderUI- * @private- */- renderUI: function()- {- var bb = this.get("boundingBox"),- cb = this.get("contentBox"),- tt = this.get("tooltip"),- overlay,- overlayClass = _getClassName("overlay");- //move the position = absolute logic to a class file- bb.setStyle("position", "absolute");- cb.setStyle("position", "absolute");- this._addAxes();- this._addGridlines();- this._addSeries();- if(tt && tt.show)- {- this._addTooltip();- }- //If there is a style definition. Force them to set.- this.get("styles");- if(this.get("interactionType") == "planar")- {- overlay = DOCUMENT.createElement("div");- this.get("contentBox").appendChild(overlay);- this._overlay = Y.one(overlay); - this._overlay.setStyle("position", "absolute");- this._overlay.setStyle("background", "#fff");- this._overlay.setStyle("opacity", 0);- this._overlay.addClass(overlayClass);- this._overlay.setStyle("zIndex", 4);- }- this._setAriaElements(bb, cb);- this._redraw();- },-- /**- * When `interactionType` is set to `planar`, listens for mouse move events and fires `planarEvent:mouseover` or `planarEvent:mouseout` depending on the position of the mouse in relation to - * data points on the `Chart`.- *- * @method _planarEventDispatcher- * @param {Object} e Event object.- * @private- */- _planarEventDispatcher: function(e)- {- var graph = this.get("graph"),- bb = this.get("boundingBox"),- cb = graph.get("contentBox"),- isTouch = e && e.hasOwnProperty("changedTouches"),- pageX = isTouch ? e.changedTouches[0].pageX : e.pageX,- pageY = isTouch ? e.changedTouches[0].pageY : e.pageY,- posX = pageX - bb.getX(),- posY = pageY - bb.getY(),- offset = {- x: pageX - cb.getX(),- y: pageY - cb.getY()- },- sc = graph.get("seriesCollection"),- series,- i = 0,- index,- oldIndex = this._selectedIndex,- item,- items = [],- categoryItems = [],- valueItems = [],- direction = this.get("direction"),- hasMarkers,- catAxis,- valAxis,- coord,- //data columns and area data could be created on a graph level- markerPlane,- len,- coords;- e.halt(true);- if(direction == "horizontal")- {- catAxis = "x";- valAxis = "y";- }- else- {- valAxis = "x";- catAxis = "y";- }- coord = offset[catAxis];- if(sc)- {- len = sc.length;- while(i < len && !markerPlane)- {- if(sc[i])- {- markerPlane = sc[i].get(catAxis + "MarkerPlane");- }- i++;- }- }- if(markerPlane)- {- len = markerPlane.length;- for(i = 0; i < len; ++i)- {- if(coord <= markerPlane[i].end && coord >= markerPlane[i].start)- {- index = i;- break;- }- }- len = sc.length;- for(i = 0; i < len; ++i)- {- series = sc[i];- coords = series.get(valAxis + "coords");- hasMarkers = series.get("markers");- if(hasMarkers && !isNaN(oldIndex) && oldIndex > -1)- {- series.updateMarkerState("mouseout", oldIndex);- }- if(coords && coords[index] > -1)- {- if(hasMarkers && !isNaN(index) && index > -1)- {- series.updateMarkerState("mouseover", index);- }- item = this.getSeriesItems(series, index);- categoryItems.push(item.category);- valueItems.push(item.value);- items.push(series);- }- - }- this._selectedIndex = index;-- /**- * Broadcasts when `interactionType` is set to `planar` and a series' marker plane has received a mouseover event.- * - *- * @event planarEvent:mouseover- * @preventable false- * @param {EventFacade} e Event facade with the following additional- * properties:- * <dl>- * <dt>categoryItem</dt><dd>An array of hashes, each containing information about the category `Axis` of each marker whose plane has been intersected.</dd>- * <dt>valueItem</dt><dd>An array of hashes, each containing information about the value `Axis` of each marker whose plane has been intersected.</dd>- * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>- * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>- * <dt>pageX</dt><dd>The x location of the event on the page (including scroll)</dd>- * <dt>pageY</dt><dd>The y location of the event on the page (including scroll)</dd>- * <dt>items</dt><dd>An array including all the series which contain a marker whose plane has been intersected.</dd>- * <dt>index</dt><dd>Index of the markers in their respective series.</dd>- * <dt>originEvent</dt><dd>Underlying dom event.</dd>- * </dl>- */- /**- * Broadcasts when `interactionType` is set to `planar` and a series' marker plane has received a mouseout event.- *- * @event planarEvent:mouseout- * @preventable false- * @param {EventFacade} e - */- if(index > -1)- {- this.fire("planarEvent:mouseover", {- categoryItem:categoryItems, - valueItem:valueItems, - x:posX, - y:posY, - pageX:pageX,- pageY:pageY,- items:items, - index:index,- originEvent:e- });- }- else- {- this.fire("planarEvent:mouseout");- }- }- },-- /**- * Indicates the default series type for the chart.- *- * @property _type- * @type {String}- * @private- */- _type: "combo",-- /**- * Queue of axes instances that will be updated. This method is used internally to determine when all axes have been updated.- *- * @property _itemRenderQueue- * @type Array- * @private- */- _itemRenderQueue: null,-- /**- * Adds an `Axis` instance to the `_itemRenderQueue`.- *- * @method _addToAxesRenderQueue- * @param {Axis} axis An `Axis` instance.- * @private - */- _addToAxesRenderQueue: function(axis)- {- if(!this._itemRenderQueue)- {- this._itemRenderQueue = [];- }- if(Y.Array.indexOf(this._itemRenderQueue, axis) < 0)- {- this._itemRenderQueue.push(axis);- }- },-- /**- * Adds axis instance to the appropriate array based on position- *- * @method _addToAxesCollection- * @param {String} position The position of the axis- * @param {Axis} axis The `Axis` instance- */- _addToAxesCollection: function(position, axis)- {- var axesCollection = this.get(position + "AxesCollection");- if(!axesCollection)- {- axesCollection = [];- this.set(position + "AxesCollection", axesCollection);- }- axesCollection.push(axis);- },-- /**- * Returns the default value for the `seriesCollection` attribute.- *- * @method _getDefaultSeriesCollection- * @param {Array} val Array containing either `CartesianSeries` instances or objects containing data to construct series instances.- * @return Array- * @private- */- _getDefaultSeriesCollection: function()- {- return this._parseSeriesCollection();- },-- /**- * Parses and returns a series collection from an object and default properties.- *- * @method _parseSeriesCollection- * @param {Object} val Object contain properties for series being set.- * @return Object- * @private- */- _parseSeriesCollection: function(val)- {- var dir = this.get("direction"), - sc = val || [], - catAxis,- valAxis,- tempKeys = [],- series,- seriesKeys = this.get("seriesKeys").concat(),- i,- index,- l,- type = this.get("type"),- key,- catKey,- seriesKey,- graph,- categoryKey = this.get("categoryKey"),- showMarkers = this.get("showMarkers"),- showAreaFill = this.get("showAreaFill"),- showLines = this.get("showLines");- if(dir == "vertical")- {- catAxis = "yAxis";- catKey = "yKey";- valAxis = "xAxis";- seriesKey = "xKey";- }- else- {- catAxis = "xAxis";- catKey = "xKey";- valAxis = "yAxis";- seriesKey = "yKey";- }- l = sc.length;- for(i = 0; i < l; ++i)- {- key = this._getBaseAttribute(sc[i], seriesKey);- if(key)- {- index = Y.Array.indexOf(seriesKeys, key);- if(index > -1)- {- seriesKeys.splice(index, 1);- }- tempKeys.push(key);- }- }- if(seriesKeys.length > 0)- {- tempKeys = tempKeys.concat(seriesKeys);- }- l = tempKeys.length;- for(i = 0; i < l; ++i)- {- series = sc[i] || {type:type};- if(series instanceof Y.CartesianSeries)- {- this._parseSeriesAxes(series);- continue;- }- - series[catKey] = series[catKey] || categoryKey;- series[seriesKey] = series[seriesKey] || seriesKeys.shift();- series[catAxis] = this._getCategoryAxis();- series[valAxis] = this._getSeriesAxis(series[seriesKey]);- - series.type = series.type || type;- - if((series.type == "combo" || series.type == "stackedcombo" || series.type == "combospline" || series.type == "stackedcombospline"))- {- if(showAreaFill !== null)- {- series.showAreaFill = (series.showAreaFill !== null && series.showAreaFill !== undefined) ? series.showAreaFill : showAreaFill;- }- if(showMarkers !== null)- {- series.showMarkers = (series.showMarkers !== null && series.showMarkers !== undefined) ? series.showMarkers : showMarkers;- }- if(showLines !== null)- {- series.showLines = (series.showLines !== null && series.showLines !== undefined) ? series.showLines : showLines;- }- }- sc[i] = series;- }- if(val)- {- graph = this.get("graph");- graph.set("seriesCollection", sc);- sc = graph.get("seriesCollection");- }- return sc;- },-- /**- * Parse and sets the axes for a series instance.- *- * @method _parseSeriesAxes- * @param {CartesianSeries} series A `CartesianSeries` instance.- * @private- */- _parseSeriesAxes: function(series)- {- var axes = this.get("axes"),- xAxis = series.get("xAxis"),- yAxis = series.get("yAxis"),- YAxis = Y.Axis,- axis;- if(xAxis && !(xAxis instanceof YAxis) && Y_Lang.isString(xAxis) && axes.hasOwnProperty(xAxis))- {- axis = axes[xAxis];- if(axis instanceof YAxis)- {- series.set("xAxis", axis);- }- }- if(yAxis && !(yAxis instanceof YAxis) && Y_Lang.isString(yAxis) && axes.hasOwnProperty(yAxis))- { - axis = axes[yAxis];- if(axis instanceof YAxis)- {- series.set("yAxis", axis);- }- }-- },-- /**- * Returns the category axis instance for the chart.- *- * @method _getCategoryAxis- * @return Axis- * @private- */- _getCategoryAxis: function()- {- var axis,- axes = this.get("axes"),- categoryAxisName = this.get("categoryAxisName") || this.get("categoryKey");- axis = axes[categoryAxisName];- return axis;- },-- /**- * Returns the value axis for a series.- *- * @method _getSeriesAxis- * @param {String} key The key value used to determine the axis instance.- * @return Axis- * @private- */- _getSeriesAxis:function(key, axisName)- {- var axes = this.get("axes"),- i,- keys,- axis;- if(axes)- {- if(axisName && axes.hasOwnProperty(axisName))- {- axis = axes[axisName];- }- else- {- for(i in axes)- {- if(axes.hasOwnProperty(i))- {- keys = axes[i].get("keys");- if(keys && keys.hasOwnProperty(key))- {- axis = axes[i];- break;- }- }- }- }- }- return axis;- },-- /**- * Gets an attribute from an object, using a getter for Base objects and a property for object- * literals. Used for determining attributes from series/axis references which can be an actual class instance- * or a hash of properties that will be used to create a class instance.- *- * @method _getBaseAttribute- * @param {Object} item Object or instance in which the attribute resides.- * @param {String} key Attribute whose value will be returned.- * @return Object- * @private- */- _getBaseAttribute: function(item, key)- {- if(item instanceof Y.Base)- {- return item.get(key);- }- if(item.hasOwnProperty(key))- {- return item[key];- }- return null;- },-- /**- * Sets an attribute on an object, using a setter of Base objects and a property for object- * literals. Used for setting attributes on a Base class, either directly or to be stored in an object literal- * for use at instantiation.- *- * @method _setBaseAttribute- * @param {Object} item Object or instance in which the attribute resides.- * @param {String} key Attribute whose value will be assigned.- * @param {Object} value Value to be assigned to the attribute.- * @private- */- _setBaseAttribute: function(item, key, value)- {- if(item instanceof Y.Base)- {- item.set(key, value);- }- else- {- item[key] = value;- }- },-- /**- * Creates `Axis` instances.- *- * @method _setAxes- * @param {Object} val Object containing `Axis` instances or objects in which to construct `Axis` instances.- * @return Object- * @private- */- _setAxes: function(val)- {- var hash = this._parseAxes(val),- axes = {},- axesAttrs = {- edgeOffset: "edgeOffset", - position: "position",- overlapGraph:"overlapGraph",- labelFunction:"labelFunction",- labelFunctionScope:"labelFunctionScope",- labelFormat:"labelFormat",- maximum:"maximum",- minimum:"minimum", - roundingMethod:"roundingMethod",- alwaysShowZero:"alwaysShowZero",- title:"title",- width:"width",- height:"height"- },- dp = this.get("dataProvider"),- ai,- i, - pos, - axis,- axisPosition,- dh, - axisClass, - config,- axesCollection;- for(i in hash)- {- if(hash.hasOwnProperty(i))- {- dh = hash[i];- if(dh instanceof Y.Axis)- {- axis = dh;- }- else- {- axis = null;- config = {};- config.dataProvider = dh.dataProvider || dp;- config.keys = dh.keys;- - if(dh.hasOwnProperty("roundingUnit"))- {- config.roundingUnit = dh.roundingUnit;- }- pos = dh.position;- if(dh.styles)- {- config.styles = dh.styles;- }- config.position = dh.position;- for(ai in axesAttrs)- {- if(axesAttrs.hasOwnProperty(ai) && dh.hasOwnProperty(ai))- {- config[ai] = dh[ai];- }- }- - //only check for existing axis if we constructed the default axes already- if(val)- {- axis = this.getAxisByKey(i);- }- - if(axis && axis instanceof Y.Axis)- {- axisPosition = axis.get("position");- if(pos != axisPosition)- {- if(axisPosition != "none")- {- axesCollection = this.get(axisPosition + "AxesCollection");- axesCollection.splice(Y.Array.indexOf(axesCollection, axis), 1);- }- if(pos != "none")- {- this._addToAxesCollection(pos, axis);- }- }- axis.setAttrs(config);- }- else- {- axisClass = this._getAxisClass(dh.type);- axis = new axisClass(config);- axis.after("axisRendered", Y.bind(this._itemRendered, this));- }- }-- if(axis)- {- axesCollection = this.get(pos + "AxesCollection");- if(axesCollection && Y.Array.indexOf(axesCollection, axis) > 0)- {- axis.set("overlapGraph", false);- }- axes[i] = axis;- }- }- }- return axes;- },- - /**- * Adds axes to the chart.- *- * @method _addAxes- * @private- */- _addAxes: function()- {- var axes = this.get("axes"),- i, - axis, - pos,- w = this.get("width"),- h = this.get("height"),- node = Y.Node.one(this._parentNode);- if(!this._axesCollection)- { - this._axesCollection = [];- }- for(i in axes)- {- if(axes.hasOwnProperty(i))- {- axis = axes[i];- if(axis instanceof Y.Axis)- {- if(!w)- {- this.set("width", node.get("offsetWidth"));- w = this.get("width");- }- if(!h)- {- this.set("height", node.get("offsetHeight"));- h = this.get("height");- }- this._addToAxesRenderQueue(axis);- pos = axis.get("position");- if(!this.get(pos + "AxesCollection"))- {- this.set(pos + "AxesCollection", [axis]);- }- else- {- this.get(pos + "AxesCollection").push(axis);- }- this._axesCollection.push(axis);- if(axis.get("keys").hasOwnProperty(this.get("categoryKey")))- {- this.set("categoryAxis", axis);- }- axis.render(this.get("contentBox"));- }- }- }- },-- /**- * Renders the Graph.- *- * @method _addSeries- * @private- */- _addSeries: function()- {- var graph = this.get("graph"),- sc = this.get("seriesCollection");- graph.render(this.get("contentBox"));-- },-- /**- * Adds gridlines to the chart.- *- * @method _addGridlines- * @private- */- _addGridlines: function()- {- var graph = this.get("graph"),- hgl = this.get("horizontalGridlines"),- vgl = this.get("verticalGridlines"),- direction = this.get("direction"),- leftAxesCollection = this.get("leftAxesCollection"),- rightAxesCollection = this.get("rightAxesCollection"),- bottomAxesCollection = this.get("bottomAxesCollection"),- topAxesCollection = this.get("topAxesCollection"),- seriesAxesCollection,- catAxis = this.get("categoryAxis"),- hAxis,- vAxis;- if(this._axesCollection)- {- seriesAxesCollection = this._axesCollection.concat();- seriesAxesCollection.splice(Y.Array.indexOf(seriesAxesCollection, catAxis), 1);- }- if(hgl)- {- if(leftAxesCollection && leftAxesCollection[0])- {- hAxis = leftAxesCollection[0];- }- else if(rightAxesCollection && rightAxesCollection[0])- {- hAxis = rightAxesCollection[0];- }- else - {- hAxis = direction == "horizontal" ? catAxis : seriesAxesCollection[0];- }- if(!this._getBaseAttribute(hgl, "axis") && hAxis)- {- this._setBaseAttribute(hgl, "axis", hAxis);- }- if(this._getBaseAttribute(hgl, "axis"))- {- graph.set("horizontalGridlines", hgl);- }- }- if(vgl)- {- if(bottomAxesCollection && bottomAxesCollection[0])- {- vAxis = bottomAxesCollection[0];- }- else if (topAxesCollection && topAxesCollection[0])- {- vAxis = topAxesCollection[0];- }- else - {- vAxis = direction == "vertical" ? catAxis : seriesAxesCollection[0];- }- if(!this._getBaseAttribute(vgl, "axis") && vAxis)- {- this._setBaseAttribute(vgl, "axis", vAxis);- }- if(this._getBaseAttribute(vgl, "axis"))- {- graph.set("verticalGridlines", vgl);- }- }- },- - /**- * Returns all the keys contained in a `dataProvider`.- *- * @method _getAllKeys- * @param {Array} dp Collection of objects to be parsed.- * @return Object- */- _getAllKeys: function(dp)- {- var i = 0,- len = dp.length,- item,- key,- keys = {};- for(; i < len; ++i)- {- item = dp[i];- for(key in item)- {- if(item.hasOwnProperty(key))- {- keys[key] = true;- }- }- }- return keys;- },- - /**- * Default Function for the axes attribute.- *- * @method _getDefaultAxes- * @return Object- * @private- */- _getDefaultAxes: function()- {- return this._parseAxes();- },-- /**- * Generates and returns a key-indexed object containing `Axis` instances or objects used to create `Axis` instances.- *- * @method _parseAxes- * @param {Object} axes Object containing `Axis` instances or `Axis` attributes.- * @return Object- * @private- */- _parseAxes: function(axes)- {- var catKey = this.get("categoryKey"),- axis,- attr,- keys,- newAxes = {},- claimedKeys = [],- categoryAxisName = this.get("categoryAxisName") || this.get("categoryKey"),- valueAxisName = this.get("valueAxisName"),- seriesKeys = this.get("seriesKeys") || [], - i, - l,- ii,- ll,- cIndex,- dv,- dp = this.get("dataProvider"),- direction = this.get("direction"),- seriesPosition,- categoryPosition,- valueAxes = [],- seriesAxis = this.get("stacked") ? "stacked" : "numeric";- if(direction == "vertical")- {- seriesPosition = "bottom";- categoryPosition = "left";- }- else- {- seriesPosition = "left";- categoryPosition = "bottom";- }- if(axes)- {- for(i in axes)- {- if(axes.hasOwnProperty(i))- {- axis = axes[i];- keys = this._getBaseAttribute(axis, "keys");- attr = this._getBaseAttribute(axis, "type");- if(attr == "time" || attr == "category")- {- categoryAxisName = i;- this.set("categoryAxisName", i);- if(Y_Lang.isArray(keys) && keys.length > 0)- {- catKey = keys[0];- this.set("categoryKey", catKey);- }- newAxes[i] = axis;- }- else if(i == categoryAxisName)- {- newAxes[i] = axis;- }- else - {- newAxes[i] = axis;- if(i != valueAxisName && keys && Y_Lang.isArray(keys))- {- ll = keys.length;- for(ii = 0; ii < ll; ++ii)- {- claimedKeys.push(keys[ii]);- }- valueAxes.push(newAxes[i]);- }- if(!(this._getBaseAttribute(newAxes[i], "type")))- {- this._setBaseAttribute(newAxes[i], "type", seriesAxis);- }- if(!(this._getBaseAttribute(newAxes[i], "position")))- {- this._setBaseAttribute(newAxes[i], "position", this._getDefaultAxisPosition(newAxes[i], valueAxes, seriesPosition));- }- }- }- }- }- if(seriesKeys.length < 1)- {- dv = this._getAllKeys(dp);- for(i in dv)- {- if(dv.hasOwnProperty(i) && i != catKey && Y.Array.indexOf(claimedKeys, i) == -1)- {- seriesKeys.push(i);- }- }- }- cIndex = Y.Array.indexOf(seriesKeys, catKey);- if(cIndex > -1)- {- seriesKeys.splice(cIndex, 1);- }- l = claimedKeys.length;- for(i = 0; i < l; ++i)- {- cIndex = Y.Array.indexOf(seriesKeys, claimedKeys[i]); - if(cIndex > -1)- {- seriesKeys.splice(cIndex, 1);- }- }- if(!newAxes.hasOwnProperty(categoryAxisName))- {- newAxes[categoryAxisName] = {};- }- if(!(this._getBaseAttribute(newAxes[categoryAxisName], "keys")))- {- this._setBaseAttribute(newAxes[categoryAxisName], "keys", [catKey]);- }- - if(!(this._getBaseAttribute(newAxes[categoryAxisName], "position")))- {- this._setBaseAttribute(newAxes[categoryAxisName], "position", categoryPosition);- }- - if(!(this._getBaseAttribute(newAxes[categoryAxisName], "type")))- {- this._setBaseAttribute(newAxes[categoryAxisName], "type", this.get("categoryType"));- }- if(!newAxes.hasOwnProperty(valueAxisName) && seriesKeys && seriesKeys.length > 0)- {- newAxes[valueAxisName] = {keys:seriesKeys};- valueAxes.push(newAxes[valueAxisName]);- }- if(claimedKeys.length > 0)- {- if(seriesKeys.length > 0)- {- seriesKeys = claimedKeys.concat(seriesKeys);- }- else- {- seriesKeys = claimedKeys;- }- }- if(newAxes.hasOwnProperty(valueAxisName))- {- if(!(this._getBaseAttribute(newAxes[valueAxisName], "position")))- {- this._setBaseAttribute(newAxes[valueAxisName], "position", this._getDefaultAxisPosition(newAxes[valueAxisName], valueAxes, seriesPosition));- }- if(!(this._getBaseAttribute(newAxes[valueAxisName], "type")))- {- this._setBaseAttribute(newAxes[valueAxisName], "type", seriesAxis);- }- if(!(this._getBaseAttribute(newAxes[valueAxisName], "keys")))- {- this._setBaseAttribute(newAxes[valueAxisName], "keys", seriesKeys);- }- } - this.set("seriesKeys", seriesKeys);- return newAxes;- },-- /**- * Determines the position of an axis when one is not specified.- *- * @method _getDefaultAxisPosition- * @param {Axis} axis `Axis` instance.- * @param {Array} valueAxes Array of `Axis` instances.- * @param {String} position Default position depending on the direction of the chart and type of axis.- * @return String- * @private- */- _getDefaultAxisPosition: function(axis, valueAxes, position)- {- var direction = this.get("direction"),- i = Y.Array.indexOf(valueAxes, axis);- - if(valueAxes[i - 1] && valueAxes[i - 1].position)- {- if(direction == "horizontal")- {- if(valueAxes[i - 1].position == "left")- {- position = "right";- }- else if(valueAxes[i - 1].position == "right")- {- position = "left";- }- }- else- {- if (valueAxes[i -1].position == "bottom")- {- position = "top";- } - else- {- position = "bottom";- }- }- }- return position;- },-- - /**- * Returns an object literal containing a categoryItem and a valueItem for a given series index. Below is the structure of each:- * - * @method getSeriesItems- * @param {CartesianSeries} series Reference to a series.- * @param {Number} index Index of the specified item within a series.- * @return Object An object literal containing the following:- *- * <dl>- * <dt>categoryItem</dt><dd>Object containing the following data related to the category axis of the series.- * <dl>- * <dt>axis</dt><dd>Reference to the category axis of the series.</dd>- * <dt>key</dt><dd>Category key for the series.</dd>- * <dt>value</dt><dd>Value on the axis corresponding to the series index.</dd>- * </dl>- * </dd>- * <dt>valueItem</dt><dd>Object containing the following data related to the category axis of the series.- * <dl>- * <dt>axis</dt><dd>Reference to the value axis of the series.</dd>- * <dt>key</dt><dd>Value key for the series.</dd>- * <dt>value</dt><dd>Value on the axis corresponding to the series index.</dd>- * </dl>- * </dd>- * </dl>- */- getSeriesItems: function(series, index)- {- var xAxis = series.get("xAxis"),- yAxis = series.get("yAxis"),- xKey = series.get("xKey"),- yKey = series.get("yKey"),- categoryItem,- valueItem;- if(this.get("direction") == "vertical")- {- categoryItem = {- axis:yAxis,- key:yKey,- value:yAxis.getKeyValueAt(yKey, index)- };- valueItem = {- axis:xAxis,- key:xKey,- value: xAxis.getKeyValueAt(xKey, index)- };- }- else- {- valueItem = {- axis:yAxis,- key:yKey,- value:yAxis.getKeyValueAt(yKey, index)- };- categoryItem = {- axis:xAxis,- key:xKey,- value: xAxis.getKeyValueAt(xKey, index)- };- }- categoryItem.displayName = series.get("categoryDisplayName");- valueItem.displayName = series.get("valueDisplayName");- categoryItem.value = categoryItem.axis.getKeyValueAt(categoryItem.key, index);- valueItem.value = valueItem.axis.getKeyValueAt(valueItem.key, index);- return {category:categoryItem, value:valueItem};- },-- /**- * Handler for sizeChanged event.- *- * @method _sizeChanged- * @param {Object} e Event object.- * @private- */- _sizeChanged: function(e)- {- if(this._axesCollection)- {- var ac = this._axesCollection,- i = 0,- l = ac.length;- for(; i < l; ++i)- {- this._addToAxesRenderQueue(ac[i]);- }- this._redraw();- }- },- - /**- * Returns the maximum distance in pixels that the extends outside the top bounds of all vertical axes.- *- * @method _getTopOverflow- * @param {Array} set1 Collection of axes to check.- * @param {Array} set2 Seconf collection of axes to check.- * @param {Number} width Width of the axes- * @return Number- * @private- */- _getTopOverflow: function(set1, set2, height)- {- var i = 0,- len,- overflow = 0,- axis;- if(set1)- {- len = set1.length;- for(; i < len; ++i)- {- axis = set1[i];- overflow = Math.max(overflow, Math.abs(axis.getMaxLabelBounds().top) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));- }- }- if(set2)- {- i = 0;- len = set2.length;- for(; i < len; ++i)- {- axis = set2[i];- overflow = Math.max(overflow, Math.abs(axis.getMaxLabelBounds().top) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));- }- }- return overflow;- },- - /**- * Returns the maximum distance in pixels that the extends outside the right bounds of all horizontal axes.- *- * @method _getRightOverflow- * @param {Array} set1 Collection of axes to check.- * @param {Array} set2 Seconf collection of axes to check.- * @param {Number} width Width of the axes- * @return Number- * @private- */- _getRightOverflow: function(set1, set2, width)- {- var i = 0,- len,- overflow = 0,- axis;- if(set1)- {- len = set1.length;- for(; i < len; ++i)- {- axis = set1[i];- overflow = Math.max(overflow, axis.getMaxLabelBounds().right - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));- }- }- if(set2)- {- i = 0;- len = set2.length;- for(; i < len; ++i)- {- axis = set2[i];- overflow = Math.max(overflow, axis.getMaxLabelBounds().right - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));- }- }- return overflow;- },- - /**- * Returns the maximum distance in pixels that the extends outside the left bounds of all horizontal axes.- *- * @method _getLeftOverflow- * @param {Array} set1 Collection of axes to check.- * @param {Array} set2 Seconf collection of axes to check.- * @param {Number} width Width of the axes- * @return Number- * @private- */- _getLeftOverflow: function(set1, set2, width)- {- var i = 0,- len,- overflow = 0,- axis;- if(set1)- {- len = set1.length;- for(; i < len; ++i)- {- axis = set1[i];- overflow = Math.max(overflow, Math.abs(axis.getMinLabelBounds().left) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));- }- }- if(set2)- {- i = 0;- len = set2.length;- for(; i < len; ++i)- {- axis = set2[i];- overflow = Math.max(overflow, Math.abs(axis.getMinLabelBounds().left) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));- }- }- return overflow;- },- - /**- * Returns the maximum distance in pixels that the extends outside the bottom bounds of all vertical axes.- *- * @method _getBottomOverflow- * @param {Array} set1 Collection of axes to check.- * @param {Array} set2 Seconf collection of axes to check.- * @param {Number} height Height of the axes- * @return Number- * @private- */- _getBottomOverflow: function(set1, set2, height)- {- var i = 0,- len,- overflow = 0,- axis;- if(set1)- {- len = set1.length;- for(; i < len; ++i)- {- axis = set1[i];- overflow = Math.max(overflow, axis.getMinLabelBounds().bottom - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));- }- }- if(set2)- {- i = 0;- len = set2.length;- for(; i < len; ++i)- {- axis = set2[i];- overflow = Math.max(overflow, axis.getMinLabelBounds().bottom - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));- }- }- return overflow;- },-- /**- * Redraws and position all the components of the chart instance.- *- * @method _redraw- * @private- */- _redraw: function()- {- if(this._drawing)- {- this._callLater = true;- return;- }- this._drawing = true;- this._callLater = false;- var w = this.get("width"),- h = this.get("height"),- leftPaneWidth = 0,- rightPaneWidth = 0,- topPaneHeight = 0,- bottomPaneHeight = 0,- leftAxesCollection = this.get("leftAxesCollection"),- rightAxesCollection = this.get("rightAxesCollection"),- topAxesCollection = this.get("topAxesCollection"),- bottomAxesCollection = this.get("bottomAxesCollection"),- i = 0,- l,- axis,- graphOverflow = "visible",- graph = this.get("graph"),- topOverflow,- bottomOverflow,- leftOverflow,- rightOverflow,- graphWidth,- graphHeight,- graphX,- graphY,- allowContentOverflow = this.get("allowContentOverflow"),- diff,- rightAxesXCoords,- leftAxesXCoords,- topAxesYCoords,- bottomAxesYCoords,- graphRect = {};- if(leftAxesCollection)- {- leftAxesXCoords = [];- l = leftAxesCollection.length;- for(i = l - 1; i > -1; --i)- {- leftAxesXCoords.unshift(leftPaneWidth);- leftPaneWidth += leftAxesCollection[i].get("width");- }- }- if(rightAxesCollection)- {- rightAxesXCoords = [];- l = rightAxesCollection.length;- i = 0;- for(i = l - 1; i > -1; --i)- {- rightPaneWidth += rightAxesCollection[i].get("width");- rightAxesXCoords.unshift(w - rightPaneWidth);- }- }- if(topAxesCollection)- {- topAxesYCoords = [];- l = topAxesCollection.length;- for(i = l - 1; i > -1; --i)- {- topAxesYCoords.unshift(topPaneHeight);- topPaneHeight += topAxesCollection[i].get("height");- }- }- if(bottomAxesCollection)- {- bottomAxesYCoords = [];- l = bottomAxesCollection.length;- for(i = l - 1; i > -1; --i)- {- bottomPaneHeight += bottomAxesCollection[i].get("height");- bottomAxesYCoords.unshift(h - bottomPaneHeight);- }- }- - graphWidth = w - (leftPaneWidth + rightPaneWidth);- graphHeight = h - (bottomPaneHeight + topPaneHeight);- graphRect.left = leftPaneWidth;- graphRect.top = topPaneHeight;- graphRect.bottom = h - bottomPaneHeight;- graphRect.right = w - rightPaneWidth;- if(!allowContentOverflow)- {- topOverflow = this._getTopOverflow(leftAxesCollection, rightAxesCollection);- bottomOverflow = this._getBottomOverflow(leftAxesCollection, rightAxesCollection);- leftOverflow = this._getLeftOverflow(bottomAxesCollection, topAxesCollection);- rightOverflow = this._getRightOverflow(bottomAxesCollection, topAxesCollection);- - diff = topOverflow - topPaneHeight;- if(diff > 0)- {- graphRect.top = topOverflow;- if(topAxesYCoords)- {- i = 0;- l = topAxesYCoords.length;- for(; i < l; ++i)- {- topAxesYCoords[i] += diff;- }- }- }-- diff = bottomOverflow - bottomPaneHeight;- if(diff > 0)- {- graphRect.bottom = h - bottomOverflow;- if(bottomAxesYCoords)- {- i = 0;- l = bottomAxesYCoords.length;- for(; i < l; ++i)- {- bottomAxesYCoords[i] -= diff;- }- }- }-- diff = leftOverflow - leftPaneWidth;- if(diff > 0)- {- graphRect.left = leftOverflow;- if(leftAxesXCoords)- {- i = 0;- l = leftAxesXCoords.length;- for(; i < l; ++i)- {- leftAxesXCoords[i] += diff;- }- }- }-- diff = rightOverflow - rightPaneWidth;- if(diff > 0)- {- graphRect.right = w - rightOverflow;- if(rightAxesXCoords)- {- i = 0;- l = rightAxesXCoords.length;- for(; i < l; ++i)- {- rightAxesXCoords[i] -= diff;- }- }- }- }- graphWidth = graphRect.right - graphRect.left;- graphHeight = graphRect.bottom - graphRect.top;- graphX = graphRect.left;- graphY = graphRect.top;- if(topAxesCollection)- {- l = topAxesCollection.length;- i = 0;- for(; i < l; i++)- {- axis = topAxesCollection[i];- if(axis.get("width") !== graphWidth)- {- axis.set("width", graphWidth);- }- axis.get("boundingBox").setStyle("left", graphX + "px");- axis.get("boundingBox").setStyle("top", topAxesYCoords[i] + "px");- }- if(axis._hasDataOverflow())- {- graphOverflow = "hidden";- }- }- if(bottomAxesCollection)- {- l = bottomAxesCollection.length;- i = 0;- for(; i < l; i++)- {- axis = bottomAxesCollection[i];- if(axis.get("width") !== graphWidth)- {- axis.set("width", graphWidth);- }- axis.get("boundingBox").setStyle("left", graphX + "px");- axis.get("boundingBox").setStyle("top", bottomAxesYCoords[i] + "px");- }- if(axis._hasDataOverflow())- {- graphOverflow = "hidden";- }- }- if(leftAxesCollection)- {- l = leftAxesCollection.length;- i = 0;- for(; i < l; ++i)- {- axis = leftAxesCollection[i];- axis.get("boundingBox").setStyle("top", graphY + "px");- axis.get("boundingBox").setStyle("left", leftAxesXCoords[i] + "px");- if(axis.get("height") !== graphHeight)- {- axis.set("height", graphHeight);- }- }- if(axis._hasDataOverflow())- {- graphOverflow = "hidden";- }- }- if(rightAxesCollection)- {- l = rightAxesCollection.length;- i = 0;- for(; i < l; ++i)- {- axis = rightAxesCollection[i];- axis.get("boundingBox").setStyle("top", graphY + "px");- axis.get("boundingBox").setStyle("left", rightAxesXCoords[i] + "px");- if(axis.get("height") !== graphHeight)- {- axis.set("height", graphHeight);- }- }- if(axis._hasDataOverflow())- {- graphOverflow = "hidden";- }- }- this._drawing = false;- if(this._callLater)- {- this._redraw();- return;- }- if(graph)- {- graph.get("boundingBox").setStyle("left", graphX + "px");- graph.get("boundingBox").setStyle("top", graphY + "px");- graph.set("width", graphWidth);- graph.set("height", graphHeight);- graph.get("boundingBox").setStyle("overflow", graphOverflow);- }-- if(this._overlay)- {- this._overlay.setStyle("left", graphX + "px");- this._overlay.setStyle("top", graphY + "px");- this._overlay.setStyle("width", graphWidth + "px");- this._overlay.setStyle("height", graphHeight + "px");- }- },-- /**- * Destructor implementation for the CartesianChart class. Calls destroy on all axes, series and the Graph instance.- * Removes the tooltip and overlay HTML elements.- *- * @method destructor- * @protected- */- destructor: function()- {- var graph = this.get("graph"),- i = 0,- len,- seriesCollection = this.get("seriesCollection"),- axesCollection = this._axesCollection,- tooltip = this.get("tooltip").node;- if(this._description)- {- this._description.empty();- this._description.remove(true);- }- if(this._liveRegion)- {- this._liveRegion.empty();- this._liveRegion.remove(true);- }- len = seriesCollection ? seriesCollection.length : 0;- for(; i < len; ++i)- {- if(seriesCollection[i] instanceof Y.CartesianSeries)- {- seriesCollection[i].destroy(true);- }- }- len = axesCollection ? axesCollection.length : 0;- for(i = 0; i < len; ++i)- {- if(axesCollection[i] instanceof Y.Axis)- {- axesCollection[i].destroy(true);- }- }- if(graph)- {- graph.destroy(true);- }- if(tooltip)- {- tooltip.empty();- tooltip.remove(true);- }- if(this._overlay)- {- this._overlay.empty();- this._overlay.remove(true);- }- },-- /**- * Returns the appropriate message based on the key press.- *- * @method _getAriaMessage- * @param {Number} key The keycode that was pressed.- * @return String- */- _getAriaMessage: function(key)- {- var msg = "",- series,- items,- categoryItem,- valueItem,- seriesIndex = this._seriesIndex,- itemIndex = this._itemIndex,- seriesCollection = this.get("seriesCollection"),- len = seriesCollection.length,- dataLength;- if(key % 2 === 0)- {- if(len > 1)- {- if(key === 38)- {- seriesIndex = seriesIndex < 1 ? len - 1 : seriesIndex - 1;- }- else if(key === 40)- {- seriesIndex = seriesIndex >= len - 1 ? 0 : seriesIndex + 1;- }- this._itemIndex = -1;- }- else- {- seriesIndex = 0;- }- this._seriesIndex = seriesIndex;- series = this.getSeries(parseInt(seriesIndex, 10));- msg = series.get("valueDisplayName") + " series.";- }- else- {- if(seriesIndex > -1)- {- msg = "";- series = this.getSeries(parseInt(seriesIndex, 10));- }- else- {- seriesIndex = 0;- this._seriesIndex = seriesIndex;- series = this.getSeries(parseInt(seriesIndex, 10));- msg = series.get("valueDisplayName") + " series.";- }- dataLength = series._dataLength ? series._dataLength : 0;- if(key === 37)- {- itemIndex = itemIndex > 0 ? itemIndex - 1 : dataLength - 1;- }- else if(key === 39)- {- itemIndex = itemIndex >= dataLength - 1 ? 0 : itemIndex + 1;- }- this._itemIndex = itemIndex;- items = this.getSeriesItems(series, itemIndex);- categoryItem = items.category;- valueItem = items.value;- if(categoryItem && valueItem && categoryItem.value && valueItem.value)- {- msg += categoryItem.displayName + ": " + categoryItem.axis.formatLabel.apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]) + ", ";- msg += valueItem.displayName + ": " + valueItem.axis.formatLabel.apply(this, [valueItem.value, valueItem.axis.get("labelFormat")]) + ", "; - }- else- {- msg += "No data available.";- }- msg += (itemIndex + 1) + " of " + dataLength + ". ";- }- return msg;- }-}, {- ATTRS: {- /**- * Indicates whether axis labels are allowed to overflow beyond the bounds of the chart's content box.- *- * @attribute allowContentOverflow- * @type Boolean- */- allowContentOverflow: {- value: false- },-- /**- * Style object for the axes.- *- * @attribute axesStyles- * @type Object- * @private- */- axesStyles: {- getter: function()- {- var axes = this.get("axes"),- i,- styles = this._axesStyles;- if(axes)- {- for(i in axes)- {- if(axes.hasOwnProperty(i) && axes[i] instanceof Y.Axis)- {- if(!styles)- {- styles = {};- }- styles[i] = axes[i].get("styles");- }- }- }- return styles;- },- - setter: function(val)- {- var axes = this.get("axes"),- i;- for(i in val)- {- if(val.hasOwnProperty(i) && axes.hasOwnProperty(i))- {- this._setBaseAttribute(axes[i], "styles", val[i]);- }- }- }- },-- /**- * Style object for the series- *- * @attribute seriesStyles- * @type Object- * @private- */- seriesStyles: {- getter: function()- {- var styles = this._seriesStyles,- graph = this.get("graph"),- dict,- i;- if(graph)- {- dict = graph.get("seriesDictionary");- if(dict)- {- styles = {};- for(i in dict)- {- if(dict.hasOwnProperty(i))- {- styles[i] = dict[i].get("styles");- }- }- }- }- return styles;- },- - setter: function(val)- {- var i,- l,- s;- - if(Y_Lang.isArray(val))- {- s = this.get("seriesCollection");- i = 0;- l = val.length;-- for(; i < l; ++i)- {- this._setBaseAttribute(s[i], "styles", val[i]);- }- }- else- {- for(i in val)- {- if(val.hasOwnProperty(i))- {- s = this.getSeries(i);- this._setBaseAttribute(s, "styles", val[i]);- }- }- }- }- },-- /**- * Styles for the graph.- *- * @attribute graphStyles- * @type Object- * @private- */- graphStyles: {- getter: function()- {- var graph = this.get("graph");- if(graph)- {- return(graph.get("styles"));- }- return this._graphStyles;- },-- setter: function(val)- {- var graph = this.get("graph");- this._setBaseAttribute(graph, "styles", val);- }-- },-- /**- * Style properties for the chart. Contains a key indexed hash of the following:- * <dl>- * <dt>series</dt><dd>A key indexed hash containing references to the `styles` attribute for each series in the chart.- * Specific style attributes vary depending on the series:- * <ul>- * <li><a href="AreaSeries.html#attr_styles">AreaSeries</a></li>- * <li><a href="BarSeries.html#attr_styles">BarSeries</a></li>- * <li><a href="ColumnSeries.html#attr_styles">ColumnSeries</a></li>- * <li><a href="ComboSeries.html#attr_styles">ComboSeries</a></li>- * <li><a href="LineSeries.html#attr_styles">LineSeries</a></li>- * <li><a href="MarkerSeries.html#attr_styles">MarkerSeries</a></li>- * <li><a href="SplineSeries.html#attr_styles">SplineSeries</a></li>- * </ul>- * </dd>- * <dt>axes</dt><dd>A key indexed hash containing references to the `styles` attribute for each axes in the chart. Specific- * style attributes can be found in the <a href="Axis.html#attr_styles">Axis</a> class.</dd>- * <dt>graph</dt><dd>A reference to the `styles` attribute in the chart. Specific style attributes can be found in the- * <a href="Graph.html#attr_styles">Graph</a> class.</dd>- * </dl>- *- * @attribute styles- * @type Object- */- styles: {- getter: function()- {- var styles = { - axes: this.get("axesStyles"),- series: this.get("seriesStyles"),- graph: this.get("graphStyles")- };- return styles;- },- setter: function(val)- {- if(val.hasOwnProperty("axes"))- {- if(this.get("axesStyles"))- {- this.set("axesStyles", val.axes);- }- else- {- this._axesStyles = val.axes;- }- }- if(val.hasOwnProperty("series"))- {- if(this.get("seriesStyles"))- {- this.set("seriesStyles", val.series);- }- else- {- this._seriesStyles = val.series;- }- }- if(val.hasOwnProperty("graph"))- {- this.set("graphStyles", val.graph);- }- }- },-- /**- * Axes to appear in the chart. This can be a key indexed hash of axis instances or object literals- * used to construct the appropriate axes.- *- * @attribute axes- * @type Object- */- axes: {- valueFn: "_getDefaultAxes",-- setter: function(val)- {- return this._setAxes(val);- }- },-- /**- * Collection of series to appear on the chart. This can be an array of Series instances or object literals- * used to construct the appropriate series.- *- * @attribute seriesCollection- * @type Array- */- seriesCollection: {- valueFn: "_getDefaultSeriesCollection",- - setter: function(val)- {- return this._parseSeriesCollection(val);- }- },-- /**- * Reference to the left-aligned axes for the chart.- *- * @attribute leftAxesCollection- * @type Array- * @private- */- leftAxesCollection: {},-- /**- * Reference to the bottom-aligned axes for the chart.- *- * @attribute bottomAxesCollection- * @type Array- * @private- */- bottomAxesCollection: {},-- /**- * Reference to the right-aligned axes for the chart.- *- * @attribute rightAxesCollection- * @type Array- * @private- */- rightAxesCollection: {},-- /**- * Reference to the top-aligned axes for the chart.- *- * @attribute topAxesCollection- * @type Array- * @private- */- topAxesCollection: {},- - /**- * Indicates whether or not the chart is stacked.- *- * @attribute stacked- * @type Boolean- */- stacked: {- value: false- },-- /**- * Direction of chart's category axis when there is no series collection specified. Charts can- * be horizontal or vertical. When the chart type is column, the chart is horizontal.- * When the chart type is bar, the chart is vertical. - *- * @attribute direction- * @type String- */- direction: {- getter: function()- {- var type = this.get("type");- if(type == "bar")- { - return "vertical";- }- else if(type == "column")- {- return "horizontal";- }- return this._direction;- },-- setter: function(val)- {- this._direction = val;- return this._direction;- }- },-- /**- * Indicates whether or not an area is filled in a combo chart.- * - * @attribute showAreaFill- * @type Boolean- */- showAreaFill: {},-- /**- * Indicates whether to display markers in a combo chart.- *- * @attribute showMarkers- * @type Boolean- */- showMarkers:{},-- /**- * Indicates whether to display lines in a combo chart.- *- * @attribute showLines- * @type Boolean- */- showLines:{},-- /**- * Indicates the key value used to identify a category axis in the `axes` hash. If- * not specified, the categoryKey attribute value will be used.- * - * @attribute categoryAxisName- * @type String- */- categoryAxisName: {- },-- /**- * Indicates the key value used to identify a the series axis when an axis not generated.- *- * @attribute valueAxisName- * @type String- */- valueAxisName: {- value: "values"- },-- /**- * Reference to the horizontalGridlines for the chart.- *- * @attribute horizontalGridlines- * @type Gridlines- */- horizontalGridlines: {- getter: function()- {- var graph = this.get("graph");- if(graph)- {- return graph.get("horizontalGridlines");- }- return this._horizontalGridlines;- },- setter: function(val)- {- var graph = this.get("graph");- if(val && !Y_Lang.isObject(val))- {- val = {};- }- if(graph)- {- graph.set("horizontalGridlines", val);- }- else- {- this._horizontalGridlines = val;- }- }- },-- /**- * Reference to the verticalGridlines for the chart.- *- * @attribute verticalGridlines- * @type Gridlines- */- verticalGridlines: {- getter: function()- {- var graph = this.get("graph");- if(graph)- {- return graph.get("verticalGridlines");- }- return this._verticalGridlines;- },- setter: function(val)- {- var graph = this.get("graph");- if(val && !Y_Lang.isObject(val))- {- val = {};- }- if(graph)- {- graph.set("verticalGridlines", val);- }- else- {- this._verticalGridlines = val;- }- }- },- - /**- * Type of chart when there is no series collection specified.- *- * @attribute type- * @type String - */- type: {- getter: function()- {- if(this.get("stacked"))- {- return "stacked" + this._type;- }- return this._type;- },-- setter: function(val)- {- if(this._type == "bar")- {- if(val != "bar")- {- this.set("direction", "horizontal");- }- }- else- {- if(val == "bar")- {- this.set("direction", "vertical");- }- }- this._type = val;- return this._type;- }- },- - /**- * Reference to the category axis used by the chart.- *- * @attribute categoryAxis- * @type Axis- */- categoryAxis:{}- }-});-/**- * The PieChart class creates a pie chart- *- * @module charts- * @class PieChart- * @extends ChartBase- * @constructor- */-Y.PieChart = Y.Base.create("pieChart", Y.Widget, [Y.ChartBase], {- /**- * Calculates and returns a `seriesCollection`.- *- * @method _getSeriesCollection- * @return Array- * @private- */- _getSeriesCollection: function()- {- if(this._seriesCollection)- {- return this._seriesCollection;- }- var axes = this.get("axes"),- sc = [], - seriesKeys,- i = 0,- l,- type = this.get("type"),- key,- catAxis = "categoryAxis",- catKey = "categoryKey",- valAxis = "valueAxis",- seriesKey = "valueKey";- if(axes)- {- seriesKeys = axes.values.get("keyCollection");- key = axes.category.get("keyCollection")[0];- l = seriesKeys.length;- for(; i < l; ++i)- {- sc[i] = {type:type};- sc[i][catAxis] = "category";- sc[i][valAxis] = "values";- sc[i][catKey] = key;- sc[i][seriesKey] = seriesKeys[i];- }- }- this._seriesCollection = sc;- return sc;- },-- /**- * Creates `Axis` instances.- *- * @method _parseAxes- * @param {Object} val Object containing `Axis` instances or objects in which to construct `Axis` instances.- * @return Object- * @private- */- _parseAxes: function(hash)- {- if(!this._axes)- {- this._axes = {};- }- var i, pos, axis, dh, config, axisClass,- type = this.get("type"),- w = this.get("width"),- h = this.get("height"),- node = Y.Node.one(this._parentNode);- if(!w)- {- this.set("width", node.get("offsetWidth"));- w = this.get("width");- }- if(!h)- {- this.set("height", node.get("offsetHeight"));- h = this.get("height");- }- for(i in hash)- {- if(hash.hasOwnProperty(i))- {- dh = hash[i];- pos = type == "pie" ? "none" : dh.position;- axisClass = this._getAxisClass(dh.type);- config = {dataProvider:this.get("dataProvider")};- if(dh.hasOwnProperty("roundingUnit"))- {- config.roundingUnit = dh.roundingUnit;- }- config.keys = dh.keys;- config.width = w;- config.height = h;- config.position = pos;- config.styles = dh.styles;- axis = new axisClass(config);- axis.on("axisRendered", Y.bind(this._itemRendered, this));- this._axes[i] = axis;- }- }- },-- /**- * Adds axes to the chart.- *- * @method _addAxes- * @private- */- _addAxes: function()- {- var axes = this.get("axes"),- i, - axis, - p;- if(!axes)- {- this.set("axes", this._getDefaultAxes());- axes = this.get("axes");- }- if(!this._axesCollection)- { - this._axesCollection = [];- }- for(i in axes)- {- if(axes.hasOwnProperty(i))- {- axis = axes[i];- p = axis.get("position");- if(!this.get(p + "AxesCollection"))- {- this.set(p + "AxesCollection", [axis]);- }- else- {- this.get(p + "AxesCollection").push(axis);- }- this._axesCollection.push(axis);- }- }- },-- /**- * Renders the Graph.- *- * @method _addSeries- * @private- */- _addSeries: function()- {- var graph = this.get("graph"),- seriesCollection = this.get("seriesCollection");- this._parseSeriesAxes(seriesCollection);- graph.set("showBackground", false);- graph.set("width", this.get("width"));- graph.set("height", this.get("height"));- graph.set("seriesCollection", seriesCollection);- this._seriesCollection = graph.get("seriesCollection");- graph.render(this.get("contentBox"));- },-- /**- * Parse and sets the axes for the chart.- *- * @method _parseSeriesAxes- * @param {Array} c A collection `PieSeries` instance.- * @private- */- _parseSeriesAxes: function(c)- {- var i = 0, - len = c.length, - s,- axes = this.get("axes"),- axis;- for(; i < len; ++i)- {- s = c[i];- if(s)- {- //If series is an actual series instance, - //replace axes attribute string ids with axes- if(s instanceof Y.PieSeries)- {- axis = s.get("categoryAxis");- if(axis && !(axis instanceof Y.Axis))- {- s.set("categoryAxis", axes[axis]);- }- axis = s.get("valueAxis");- if(axis && !(axis instanceof Y.Axis))- {- s.set("valueAxis", axes[axis]);- }- continue;- }- s.categoryAxis = axes.category;- s.valueAxis = axes.values;- if(!s.type)- {- s.type = this.get("type");- }- }- }- },-- /**- * Generates and returns a key-indexed object containing `Axis` instances or objects used to create `Axis` instances.- *- * @method _getDefaultAxes- * @return Object- * @private- */- _getDefaultAxes: function()- {- var catKey = this.get("categoryKey"),- seriesKeys = this.get("seriesKeys") || [], - seriesAxis = "numeric",- i, - dv = this.get("dataProvider")[0];- if(seriesKeys.length < 1)- {- for(i in dv)- {- if(i != catKey)- {- seriesKeys.push(i);- }- }- if(seriesKeys.length > 0)- {- this.set("seriesKeys", seriesKeys);- }- }- return {- values:{- keys:seriesKeys,- type:seriesAxis- },- category:{- keys:[catKey],- type:this.get("categoryType")- }- };- },- - /**- * Returns an object literal containing a categoryItem and a valueItem for a given series index.- *- * @method getSeriesItem- * @param series Reference to a series.- * @param index Index of the specified item within a series.- * @return Object- */- getSeriesItems: function(series, index)- {- var categoryItem = {- axis: series.get("categoryAxis"),- key: series.get("categoryKey"),- displayName: series.get("categoryDisplayName")- },- valueItem = {- axis: series.get("valueAxis"),- key: series.get("valueKey"),- displayName: series.get("valueDisplayName")- };- categoryItem.value = categoryItem.axis.getKeyValueAt(categoryItem.key, index);- valueItem.value = valueItem.axis.getKeyValueAt(valueItem.key, index);- return {category:categoryItem, value:valueItem};- },-- /**- * Handler for sizeChanged event.- *- * @method _sizeChanged- * @param {Object} e Event object.- * @private- */- _sizeChanged: function(e)- {- this._redraw();- },-- /**- * Redraws the chart instance.- *- * @method _redraw- * @private- */- _redraw: function()- {- var graph = this.get("graph"),- w = this.get("width"),- h = this.get("height"),- dimension;- if(graph)- {- dimension = Math.min(w, h);- graph.set("width", dimension);- graph.set("height", dimension);- }- },- - /**- * Formats tooltip text for a pie chart.- *- * @method _tooltipLabelFunction- * @param {Object} categoryItem An object containing the following:- * <dl>- * <dt>axis</dt><dd>The axis to which the category is bound.</dd>- * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided)</dd>- * <dt>key</dt><dd>The key of the category.</dd>- * <dt>value</dt><dd>The value of the category</dd>- * </dl>- * @param {Object} valueItem An object containing the following:- * <dl>- * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>- * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>- * <dt>key</dt><dd>The key for the series.</dd>- * <dt>value</dt><dd>The value for the series item.</dd> - * </dl>- * @param {Number} itemIndex The index of the item within the series.- * @param {CartesianSeries} series The `PieSeries` instance of the item.- * @param {Number} seriesIndex The index of the series in the `seriesCollection`.- * @return {HTML}- * @private- */- _tooltipLabelFunction: function(categoryItem, valueItem, itemIndex, series, seriesIndex)- {- var msg = DOCUMENT.createElement("div"),- total = series.getTotalValues(),- pct = Math.round((valueItem.value / total) * 10000)/100;- msg.appendChild(DOCUMENT.createTextNode(categoryItem.displayName +- ": " + categoryItem.axis.get("labelFunction").apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]))); - msg.appendChild(DOCUMENT.createElement("br"));- msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName + - ": " + valueItem.axis.get("labelFunction").apply(this, [valueItem.value, valueItem.axis.get("labelFormat")])));- msg.appendChild(DOCUMENT.createElement("br"));- msg.appendChild(DOCUMENT.createTextNode(pct + "%")); - return msg; - },-- /**- * Returns the appropriate message based on the key press.- *- * @method _getAriaMessage- * @param {Number} key The keycode that was pressed.- * @return String- */- _getAriaMessage: function(key)- {- var msg = "",- categoryItem,- items,- series,- valueItem,- seriesIndex = 0,- itemIndex = this._itemIndex,- seriesCollection = this.get("seriesCollection"),- len,- total,- pct,- markers;- series = this.getSeries(parseInt(seriesIndex, 10));- markers = series.get("markers");- len = markers && markers.length ? markers.length : 0;- if(key === 37)- {- itemIndex = itemIndex > 0 ? itemIndex - 1 : len - 1;- }- else if(key === 39)- {- itemIndex = itemIndex >= len - 1 ? 0 : itemIndex + 1;- }- this._itemIndex = itemIndex;- items = this.getSeriesItems(series, itemIndex);- categoryItem = items.category;- valueItem = items.value;- total = series.getTotalValues();- pct = Math.round((valueItem.value / total) * 10000)/100;- if(categoryItem && valueItem)- {- msg += categoryItem.displayName + ": " + categoryItem.axis.formatLabel.apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]) + ", ";- msg += valueItem.displayName + ": " + valueItem.axis.formatLabel.apply(this, [valueItem.value, valueItem.axis.get("labelFormat")]) + ", "; - msg += "Percent of total " + valueItem.displayName + ": " + pct + "%,"; - }- else- {- msg += "No data available,";- }- msg += (itemIndex + 1) + " of " + len + ". ";- return msg;- }-}, {- ATTRS: {- /**- * Sets the aria description for the chart.- *- * @attribute ariaDescription- * @type String- */- ariaDescription: {- value: "Use the left and right keys to navigate through items.",-- setter: function(val)- {- if(this._description)- {- this._description.setContent("");- this._description.appendChild(DOCUMENT.createTextNode(val));- }- return val;- }- },- - /**- * Axes to appear in the chart. - *- * @attribute axes- * @type Object- */- axes: {- getter: function()- {- return this._axes;- },-- setter: function(val)- {- this._parseAxes(val);- }- },-- /**- * Collection of series to appear on the chart. This can be an array of Series instances or object literals- * used to describe a Series instance.- *- * @attribute seriesCollection- * @type Array- */- seriesCollection: {- getter: function()- {- return this._getSeriesCollection();- },- - setter: function(val)- {- return this._setSeriesCollection(val);- }- },- - /**- * Type of chart when there is no series collection specified.- *- * @attribute type- * @type String - */- type: {- value: "pie"- }- }-});---}, '3.5.1' ,{requires:['dom', 'datatype-number', 'datatype-date', 'event-custom', 'event-mouseenter', 'event-touch', 'widget', 'widget-position', 'widget-stack', 'graphics']});+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+YUI.add('charts-base', function (Y, NAME) {++/**+ * The Charts widget provides an api for displaying data+ * graphically.+ *+ * @module charts+ * @main charts+ */++/**+ * The charts-base submodule contains the core functionality for the charts module.+ *+ * @module charts+ * @submodule charts-base+ */+var CONFIG = Y.config,+ WINDOW = CONFIG.win,+ DOCUMENT = CONFIG.doc,+ Y_Lang = Y.Lang,+ IS_STRING = Y_Lang.isString,+ Y_DOM = Y.DOM,+ LeftAxisLayout,+ RightAxisLayout,+ BottomAxisLayout,+ TopAxisLayout,+ _getClassName = Y.ClassNameManager.getClassName,+ SERIES_MARKER = _getClassName("seriesmarker"),+ ShapeGroup,+ CircleGroup,+ RectGroup,+ EllipseGroup,+ DiamondGroup;++/**+ * Abstract class for creating groups of shapes with the same styles and dimensions.+ *+ * @class ShapeGroup+ * @constructor+ */+ ShapeGroup = function(cfg)+ {+ ShapeGroup.superclass.constructor.apply(this, arguments);+ };+ + ShapeGroup.NAME = "shapeGroup";++ Y.extend(ShapeGroup, Y.Path, { + /**+ * Updates the shape.+ *+ * @method _draw+ * @private+ */+ _draw: function()+ {+ var xvalues = this.get("xvalues"),+ yvalues = this.get("yvalues"),+ x,+ y,+ xRad,+ yRad,+ i = 0,+ len,+ attrs = [],+ dimensions = this.get("dimensions"),+ width = dimensions.width,+ height = dimensions.height,+ radius = dimensions.radius,+ yRadius = dimensions.yRadius,+ id = this.get("id"),+ className = this.node.className,+ widthIsArray = Y_Lang.isArray(width),+ heightIsArray = Y_Lang.isArray(height),+ radiusIsArray = Y_Lang.isArray(radius),+ yRadiusIsArray = Y_Lang.isArray(yRadius);+ if(xvalues && yvalues && xvalues.length > 0)+ {+ this.clear();++ len = xvalues.length;+ for(; i < len; ++i)+ {+ x = xvalues[i];+ y = yvalues[i];+ xRad = radiusIsArray ? radius[i] : radius;+ yRad = yRadiusIsArray ? yRadius[i] : yRadius;+ if(!isNaN(x) && !isNaN(y) && !isNaN(xRad))+ {+ this.drawShape({+ x: x,+ y: y,+ width: widthIsArray ? width[i] : width,+ height: heightIsArray ? height[i] : height,+ radius: xRad,+ yRadius: yRad + });+ this.closePath();+ attrs[i] = {+ id: id + "_" + i,+ className: className,+ coords: (x - this._left) + ", " + (y - this._top) + ", " + radius,+ shape: "circle"+ };+ }+ }+ this._closePath();+ }+ },++ /**+ * Parses and array of lengths into radii+ *+ * @method _getRadiusCollection+ * @param {Array} val Array of lengths+ * @return Array+ * @private+ */+ _getRadiusCollection: function(val)+ {+ var i = 0,+ len = val.length,+ radii = [];+ for(; i < len; ++i)+ { + radii[i] = val[i] * 0.5;+ }+ return radii;+ }+ });+ +ShapeGroup.ATTRS = Y.merge(Y.Path.ATTRS, {+ dimensions: {+ getter: function()+ {+ var dimensions = this._dimensions,+ radius,+ yRadius,+ width,+ height;+ if(dimensions.hasOwnProperty("radius"))+ {+ return dimensions;+ }+ else+ {+ width = dimensions.width;+ height = dimensions.height;+ radius = Y_Lang.isArray(width) ? this._getRadiusCollection(width) : (width * 0.5);+ yRadius = Y_Lang.isArray(height) ? this._getRadiusCollection(height) : (height * 0.5);+ return {+ width: width,+ height: height,+ radius: radius,+ yRadius: yRadius+ };+ }+ },++ setter: function(val)+ {+ this._dimensions = val;+ return val;+ }+ },+ xvalues: {+ getter: function()+ {+ return this._xvalues;+ },+ setter: function(val)+ {+ this._xvalues = val;+ }+ },+ yvalues: {+ getter: function()+ {+ return this._yvalues;+ },+ setter: function(val)+ {+ this._yvalues = val;+ }+ }+});+Y.ShapeGroup = ShapeGroup;+/**+ * Abstract class for creating groups of circles with the same styles and dimensions.+ *+ * @module charts+ * @submodule charts-base+ * @class CircleGroup+ * @constructor+ */+ CircleGroup = function(cfg)+ {+ CircleGroup.superclass.constructor.apply(this, arguments);+ };+ + CircleGroup.NAME = "circleGroup";++ Y.extend(CircleGroup, Y.ShapeGroup, { + /**+ * Algorithm for drawing shape.+ *+ * @method drawShape+ * @param {Object} cfg Parameters used to draw the shape.+ */+ drawShape: function(cfg)+ {+ this.drawCircle(cfg.x, cfg.y, cfg.radius);+ }+ });++CircleGroup.ATTRS = Y.merge(Y.ShapeGroup.ATTRS, {+ dimensions: {+ getter: function()+ {+ var dimensions = this._dimensions,+ radius,+ yRadius,+ width,+ height;+ if(dimensions.hasOwnProperty("radius"))+ {+ return dimensions;+ }+ else+ {+ width = dimensions.width;+ height = dimensions.height;+ radius = Y_Lang.isArray(width) ? this._getRadiusCollection(width) : (width * 0.5);+ yRadius = radius;+ return {+ width: width,+ height: height,+ radius: radius,+ yRadius: yRadius+ };+ }+ }+ }+});+ +CircleGroup.ATTRS = Y.ShapeGroup.ATTRS;+Y.CircleGroup = CircleGroup;+/**+ * Abstract class for creating groups of rects with the same styles and dimensions.+ *+ * @module charts+ * @submodule charts-base+ * @class GroupRect+ * @constructor+ */+ RectGroup = function(cfg)+ {+ RectGroup.superclass.constructor.apply(this, arguments);+ };+ + RectGroup.NAME = "rectGroup";++ Y.extend(RectGroup, Y.ShapeGroup, { + /**+ * Updates the rect.+ *+ * @method _draw+ * @private+ */+ drawShape: function(cfg)+ {+ this.drawRect(cfg.x, cfg.y, cfg.width, cfg.height);+ }+ });+ +RectGroup.ATTRS = Y.ShapeGroup.ATTRS;+Y.RectGroup = RectGroup;+/**+ * Abstract class for creating groups of diamonds with the same styles and dimensions.+ *+ * @module charts+ * @submodule charts-base+ * @class GroupDiamond+ * @constructor+ */+ DiamondGroup = function(cfg)+ {+ DiamondGroup.superclass.constructor.apply(this, arguments);+ };+ + DiamondGroup.NAME = "diamondGroup";++ Y.extend(DiamondGroup, Y.ShapeGroup, { + /**+ * Updates the diamond.+ *+ * @method _draw+ * @private+ */+ drawShape: function(cfg)+ {+ this.drawDiamond(cfg.x, cfg.y, cfg.width, cfg.height);+ }+ });+ +DiamondGroup.ATTRS = Y.ShapeGroup.ATTRS;+Y.DiamondGroup = DiamondGroup;+/**+ * Abstract class for creating groups of diamonds with the same styles and dimensions.+ *+ * @module charts+ * @submodule charts-base+ * @class EllipseGroup+ * @constructor+ */+ EllipseGroup = function(cfg)+ {+ EllipseGroup.superclass.constructor.apply(this, arguments);+ };+ + EllipseGroup.NAME = "diamondGroup";++ Y.extend(EllipseGroup, Y.ShapeGroup, { + /**+ * Updates the diamond.+ *+ * @method _draw+ * @private+ */+ drawShape: function(cfg)+ {+ this.drawEllipse(cfg.x, cfg.y, cfg.width, cfg.height);+ }+ });+ +EllipseGroup.ATTRS = Y.ShapeGroup.ATTRS;+Y.EllipseGroup = EllipseGroup;+/**+ * The Renderer class is a base class for chart components that use the `styles`+ * attribute.+ *+ * @module charts+ * @submodule charts-base+ * @class Renderer+ * @constructor+ */+function Renderer(){}++Renderer.ATTRS = {+ /**+ * Style properties for class+ * + * @attribute styles+ * @type Object+ */+ styles:+ {+ getter: function()+ {+ this._styles = this._styles || this._getDefaultStyles();+ return this._styles;+ },++ setter: function(val)+ {+ this._styles = this._setStyles(val);+ }+ },+ + /**+ * The graphic in which drawings will be rendered.+ *+ * @attribute graphic+ * @type Graphic+ */+ graphic: {}+};+Renderer.NAME = "renderer";++Renderer.prototype = {+ /**+ * Storage for `styles` attribute.+ *+ * @property _styles+ * @type Object+ * @private+ */+ _styles: null,+ + /**+ * Method used by `styles` setter.+ *+ * @method _setStyles+ * @param {Object} newStyles Hash of properties to update.+ * @return Object+ * @protected+ */+ _setStyles: function(newstyles)+ {+ var styles = this.get("styles");+ return this._mergeStyles(newstyles, styles);+ },+ + /**+ * Merges to object literals so that only specified properties are + * overwritten.+ *+ * @method _mergeStyles+ * @param {Object} a Hash of new styles+ * @param {Object} b Hash of original styles+ * @return Object+ * @protected+ */+ _mergeStyles: function(a, b)+ {+ if(!b)+ {+ b = {};+ }+ var newstyles = Y.merge(b, {});+ Y.Object.each(a, function(value, key, a)+ {+ if(b.hasOwnProperty(key) && Y_Lang.isObject(value) && !Y_Lang.isFunction(value) && !Y_Lang.isArray(value))+ {+ newstyles[key] = this._mergeStyles(value, b[key]);+ }+ else+ {+ newstyles[key] = value;+ }+ }, this);+ return newstyles;+ },++ /**+ * Gets the default value for the `styles` attribute. + *+ * @method _getDefaultStyles+ * @return Object+ * @protected+ */+ _getDefaultStyles: function()+ {+ return {padding:{+ top:0,+ right: 0,+ bottom: 0,+ left: 0+ }};+ }+};++Y.augment(Renderer, Y.Attribute);+Y.Renderer = Renderer;++/**+ * Algorithmic strategy for rendering a left axis.+ *+ * @module charts+ * @submodule charts-base+ * @class LeftAxisLayout+ * @constructor+ */+LeftAxisLayout = function() {};++LeftAxisLayout.prototype = {+ /**+ * Default margins for text fields.+ *+ * @private+ * @method _getDefaultMargins+ * @return Object+ */+ _getDefaultMargins: function() + {+ return {+ top: 0,+ left: 0,+ right: 4,+ bottom: 0+ };+ },++ /**+ * Sets the length of the tick on either side of the axis line.+ *+ * @method setTickOffset+ * @protected+ */+ setTickOffsets: function()+ {+ var host = this,+ majorTicks = host.get("styles").majorTicks,+ tickLength = majorTicks.length,+ halfTick = tickLength * 0.5,+ display = majorTicks.display;+ host.set("topTickOffset", 0);+ host.set("bottomTickOffset", 0);+ + switch(display)+ {+ case "inside" :+ host.set("rightTickOffset", tickLength);+ host.set("leftTickOffset", 0);+ break;+ case "outside" : + host.set("rightTickOffset", 0);+ host.set("leftTickOffset", tickLength);+ break;+ case "cross":+ host.set("rightTickOffset", halfTick); + host.set("leftTickOffset", halfTick);+ break;+ default:+ host.set("rightTickOffset", 0);+ host.set("leftTickOffset", 0);+ break;+ }+ },+ + /**+ * Draws a tick+ *+ * @method drawTick+ * @param {Path} path reference to the path `Path` element in which to draw the tick.+ * @param {Object} pt Point on the axis in which the tick will intersect.+ * @param {Object} tickStyle Hash of properties to apply to the tick.+ * @protected+ */+ drawTick: function(path, pt, tickStyles)+ {+ var host = this,+ style = host.get("styles"),+ padding = style.padding,+ tickLength = tickStyles.length,+ start = {x:padding.left, y:pt.y},+ end = {x:tickLength + padding.left, y:pt.y};+ host.drawLine(path, start, end);+ },++ /**+ * Calculates the coordinates for the first point on an axis.+ *+ * @method getLineStart+ * @return {Object}+ * @protected+ */+ getLineStart: function()+ {+ var style = this.get("styles"),+ padding = style.padding,+ majorTicks = style.majorTicks,+ tickLength = majorTicks.length,+ display = majorTicks.display,+ pt = {x:padding.left, y:0};+ if(display === "outside")+ {+ pt.x += tickLength;+ }+ else if(display === "cross")+ {+ pt.x += tickLength/2;+ }+ return pt; + },+ + /**+ * Calculates the point for a label.+ *+ * @method getLabelPoint+ * @param {Object} point Point on the axis in which the tick will intersect.+ * @return {Object} + * @protected+ */+ getLabelPoint: function(point)+ {+ return {x:point.x - this.get("leftTickOffset"), y:point.y};+ },+ + /**+ * Updates the value for the `maxLabelSize` for use in calculating total size.+ *+ * @method updateMaxLabelSize+ * @param {HTMLElement} label to measure+ * @protected+ */+ updateMaxLabelSize: function(labelWidth, labelHeight)+ {+ var host = this,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ sinRadians = props.sinRadians,+ cosRadians = props.cosRadians,+ max;+ if(rot === 0)+ {+ max = labelWidth;+ }+ else if(absRot === 90)+ {+ max = labelHeight;+ }+ else+ {+ max = (cosRadians * labelWidth) + (sinRadians * labelHeight);+ }+ host._maxLabelSize = Math.max(host._maxLabelSize, max);+ },+ + /**+ * Determines the available label width when the axis width has been explicitly set.+ *+ * @method getExplicitlySized+ * @return Boolean+ * @protected+ */+ getExplicitlySized: function(styles)+ {+ if(this._explicitWidth)+ {+ var host = this,+ w = host._explicitWidth,+ totalTitleSize = host._totalTitleSize,+ leftTickOffset = host.get("leftTickOffset"),+ margin = styles.label.margin.right;+ host._maxLabelSize = w - (leftTickOffset + margin + totalTitleSize);+ return true;+ }+ return false;+ },++ /**+ * Rotate and position title.+ *+ * @method positionTitle+ * @param {HTMLElement} label to rotate position+ * @protected+ */+ positionTitle: function(label)+ {+ var host = this,+ bounds = host._titleBounds,+ margin = host.get("styles").title.margin,+ props = host._titleRotationProps,+ w = bounds.right - bounds.left,+ labelWidth = label.offsetWidth,+ labelHeight = label.offsetHeight,+ x = (labelWidth * -0.5) + (w * 0.5),+ y = (host.get("height") * 0.5) - (labelHeight * 0.5);+ props.labelWidth = labelWidth;+ props.labelHeight = labelHeight;+ if(margin && margin.left)+ {+ x += margin.left;+ }+ props.x = x;+ props.y = y;+ props.transformOrigin = [0.5, 0.5];+ host._rotate(label, props);+ },++ /**+ * Rotate and position labels.+ *+ * @method positionLabel+ * @param {HTMLElement} label to rotate position+ * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned+ * against.+ * @protected+ */+ positionLabel: function(label, pt, styles, i)+ {+ var host = this,+ tickOffset = host.get("leftTickOffset"),+ totalTitleSize = this._totalTitleSize,+ leftOffset = pt.x + totalTitleSize - tickOffset,+ topOffset = pt.y,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ maxLabelSize = host._maxLabelSize,+ labelWidth = this._labelWidths[i],+ labelHeight = this._labelHeights[i];+ if(rot === 0)+ {+ leftOffset -= labelWidth;+ topOffset -= labelHeight * 0.5;+ }+ else if(rot === 90)+ {+ leftOffset -= labelWidth * 0.5;+ }+ else if(rot === -90)+ {+ leftOffset -= labelWidth * 0.5;+ topOffset -= labelHeight;+ }+ else+ {+ leftOffset -= labelWidth + (labelHeight * absRot/360);+ topOffset -= labelHeight * 0.5;+ }+ props.labelWidth = labelWidth;+ props.labelHeight = labelHeight;+ props.x = Math.round(maxLabelSize + leftOffset);+ props.y = Math.round(topOffset);+ this._rotate(label, props);+ },++ /**+ * Adjusts the coordinates of an axis label based on the rotation.+ *+ * @method _setRotationCoords+ * @param {Object} props Coordinates, dimension and rotation properties of the label.+ * @protected+ */+ _setRotationCoords: function(props)+ {+ var rot = props.rot,+ absRot = props.absRot,+ leftOffset,+ topOffset,+ labelWidth = props.labelWidth,+ labelHeight = props.labelHeight;+ if(rot === 0)+ {+ leftOffset = labelWidth;+ topOffset = labelHeight * 0.5;+ }+ else if(rot === 90)+ {+ topOffset = 0;+ leftOffset = labelWidth * 0.5;+ }+ else if(rot === -90)+ {+ leftOffset = labelWidth * 0.5;+ topOffset = labelHeight;+ }+ else+ {+ leftOffset = labelWidth + (labelHeight * absRot/360);+ topOffset = labelHeight * 0.5;+ }+ props.x -= leftOffset;+ props.y -= topOffset;+ },++ /**+ * Returns the transformOrigin to use for an axis label based on the position of the axis + * and the rotation of the label.+ *+ * @method _getTransformOrigin+ * @param {Number} rot The rotation (in degrees) of the label.+ * @return Array+ * @protected+ */+ _getTransformOrigin: function(rot)+ {+ var transformOrigin;+ if(rot === 0)+ {+ transformOrigin = [0, 0];+ }+ else if(rot === 90)+ {+ transformOrigin = [0.5, 0];+ }+ else if(rot === -90)+ {+ transformOrigin = [0.5, 1];+ }+ else+ {+ transformOrigin = [1, 0.5];+ }+ return transformOrigin;+ },++ /**+ * Adjust the position of the Axis widget's content box for internal axes.+ *+ * @method offsetNodeForTick+ * @param {Node} cb Content box of the Axis.+ * @protected+ */+ offsetNodeForTick: function(cb)+ {+ },++ /**+ * Sets the width of the axis based on its contents.+ *+ * @method setCalculatedSize+ * @protected+ */+ setCalculatedSize: function()+ {+ var host = this,+ graphic = this.get("graphic"),+ style = host.get("styles"),+ label = style.label,+ tickOffset = host.get("leftTickOffset"),+ max = host._maxLabelSize,+ totalTitleSize = this._totalTitleSize,+ ttl = Math.round(totalTitleSize + tickOffset + max + label.margin.right);+ if(this._explicitWidth)+ {+ ttl = this._explicitWidth;+ }+ this.set("calculatedWidth", ttl);+ graphic.set("x", ttl - tickOffset);+ }+};++Y.LeftAxisLayout = LeftAxisLayout;+/**+ * RightAxisLayout contains algorithms for rendering a right axis.+ *+ * @module charts+ * @submodule charts-base+ * @class RightAxisLayout+ * @constructor+ */+RightAxisLayout = function(){};++RightAxisLayout.prototype = {+ /**+ * Default margins for text fields.+ *+ * @private+ * @method _getDefaultMargins+ * @return Object+ */+ _getDefaultMargins: function() + {+ return {+ top: 0,+ left: 4,+ right: 0,+ bottom: 0+ };+ },++ /**+ * Sets the length of the tick on either side of the axis line.+ *+ * @method setTickOffset+ * @protected+ */+ setTickOffsets: function()+ {+ var host = this,+ majorTicks = host.get("styles").majorTicks,+ tickLength = majorTicks.length,+ halfTick = tickLength * 0.5,+ display = majorTicks.display;+ host.set("topTickOffset", 0);+ host.set("bottomTickOffset", 0);+ + switch(display)+ {+ case "inside" :+ host.set("leftTickOffset", tickLength);+ host.set("rightTickOffset", 0);+ break;+ case "outside" : + host.set("leftTickOffset", 0);+ host.set("rightTickOffset", tickLength);+ break;+ case "cross" :+ host.set("rightTickOffset", halfTick);+ host.set("leftTickOffset", halfTick);+ break;+ default:+ host.set("leftTickOffset", 0);+ host.set("rightTickOffset", 0);+ break;+ }+ },++ /**+ * Draws a tick+ *+ * @method drawTick+ * @param {Path} path reference to the path `Path` element in which to draw the tick.+ * @param {Object} pt Point on the axis in which the tick will intersect.+ * @param {Object) tickStyle Hash of properties to apply to the tick.+ * @protected+ */+ drawTick: function(path, pt, tickStyles)+ {+ var host = this,+ style = host.get("styles"),+ padding = style.padding,+ tickLength = tickStyles.length,+ start = {x:padding.left, y:pt.y},+ end = {x:padding.left + tickLength, y:pt.y};+ host.drawLine(path, start, end);+ },+ + /**+ * Calculates the coordinates for the first point on an axis.+ *+ * @method getLineStart+ * @return {Object}+ * @protected+ */+ getLineStart: function()+ {+ var host = this,+ style = host.get("styles"),+ padding = style.padding,+ majorTicks = style.majorTicks,+ tickLength = majorTicks.length,+ display = majorTicks.display,+ pt = {x:padding.left, y:padding.top};+ if(display === "inside")+ {+ pt.x += tickLength;+ }+ else if(display === "cross")+ {+ pt.x += tickLength/2;+ }+ return pt;+ },+ + /**+ * Calculates the point for a label.+ *+ * @method getLabelPoint+ * @param {Object} point Point on the axis in which the tick will intersect.+ * @return {Object} + * @protected+ */+ getLabelPoint: function(point)+ {+ return {x:point.x + this.get("rightTickOffset"), y:point.y};+ },+ + /**+ * Updates the value for the `maxLabelSize` for use in calculating total size.+ *+ * @method updateMaxLabelSize+ * @param {HTMLElement} label to measure+ * @protected+ */+ updateMaxLabelSize: function(labelWidth, labelHeight)+ {+ var host = this,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ sinRadians = props.sinRadians,+ cosRadians = props.cosRadians,+ max;+ if(rot === 0)+ {+ max = labelWidth;+ }+ else if(absRot === 90)+ {+ max = labelHeight;+ }+ else+ {+ max = (cosRadians * labelWidth) + (sinRadians * labelHeight);+ }+ host._maxLabelSize = Math.max(host._maxLabelSize, max);+ },+ + /**+ * Determines the available label width when the axis width has been explicitly set.+ *+ * @method getExplicitlySized+ * @return Boolean+ * @protected+ */+ getExplicitlySized: function(styles)+ {+ if(this._explicitWidth)+ {+ var host = this,+ w = host._explicitWidth,+ totalTitleSize = this._totalTitleSize,+ rightTickOffset = host.get("rightTickOffset"),+ margin = styles.label.margin.right;+ host._maxLabelSize = w - (rightTickOffset + margin + totalTitleSize);+ return true;+ }+ return false;+ },++ /**+ * Rotate and position title.+ *+ * @method positionTitle+ * @param {HTMLElement} label to rotate position+ * @protected+ */+ positionTitle: function(label)+ {+ var host = this,+ bounds = host._titleBounds,+ margin = host.get("styles").title.margin,+ props = host._titleRotationProps,+ labelWidth = label.offsetWidth,+ labelHeight = label.offsetHeight,+ w = bounds.right - bounds.left,+ x = this.get("width") - (labelWidth * 0.5) - (w * 0.5),+ y = (host.get("height") * 0.5) - (labelHeight * 0.5);+ props.labelWidth = labelWidth;+ props.labelHeight = labelHeight;+ if(margin && margin.right)+ {+ x -= margin.left;+ }+ props.x = x;+ props.y = y;+ props.transformOrigin = [0.5, 0.5];+ host._rotate(label, props);+ },++ /**+ * Rotate and position labels.+ *+ * @method positionLabel+ * @param {HTMLElement} label to rotate position+ * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned+ * against.+ * @protected+ */+ positionLabel: function(label, pt, styles, i)+ {+ var host = this,+ tickOffset = host.get("rightTickOffset"),+ labelStyles = styles.label,+ margin = 0,+ leftOffset = pt.x,+ topOffset = pt.y,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ labelWidth = this._labelWidths[i],+ labelHeight = this._labelHeights[i];+ if(labelStyles.margin && labelStyles.margin.left)+ {+ margin = labelStyles.margin.left;+ }+ if(rot === 0)+ {+ topOffset -= labelHeight * 0.5;+ }+ else if(rot === 90)+ {+ leftOffset -= labelWidth * 0.5;+ topOffset -= labelHeight;+ }+ else if(rot === -90)+ {+ leftOffset -= labelWidth * 0.5;+ }+ else+ {+ topOffset -= labelHeight * 0.5;+ leftOffset += labelHeight/2 * absRot/90;+ }+ leftOffset += margin;+ leftOffset += tickOffset;+ props.labelWidth = labelWidth;+ props.labelHeight = labelHeight;+ props.x = Math.round(leftOffset);+ props.y = Math.round(topOffset);+ this._rotate(label, props);+ },+ + /**+ * Adjusts the coordinates of an axis label based on the rotation.+ *+ * @method _setRotationCoords+ * @param {Object} props Coordinates, dimension and rotation properties of the label.+ * @protected+ */+ _setRotationCoords: function(props)+ {+ var rot = props.rot,+ absRot = props.absRot,+ leftOffset = 0,+ topOffset = 0,+ labelWidth = props.labelWidth,+ labelHeight = props.labelHeight;+ if(rot === 0)+ {+ topOffset = labelHeight * 0.5;+ }+ else if(rot === 90)+ {+ leftOffset = labelWidth * 0.5;+ topOffset = labelHeight;+ }+ else if(rot === -90)+ {+ leftOffset = labelWidth * 0.5;+ }+ else+ {+ topOffset = labelHeight * 0.5;+ leftOffset = labelHeight/2 * absRot/90;+ }+ props.x -= leftOffset;+ props.y -= topOffset;+ },+ + /**+ * Returns the transformOrigin to use for an axis label based on the position of the axis + * and the rotation of the label.+ *+ * @method _getTransformOrigin+ * @param {Number} rot The rotation (in degrees) of the label.+ * @return Array+ * @protected+ */+ _getTransformOrigin: function(rot)+ {+ var transformOrigin;+ if(rot === 0)+ {+ transformOrigin = [0, 0];+ }+ else if(rot === 90)+ {+ transformOrigin = [0.5, 1];+ }+ else if(rot === -90)+ {+ transformOrigin = [0.5, 0];+ }+ else+ {+ transformOrigin = [0, 0.5];+ }+ return transformOrigin;+ },++ /**+ * Adjusts position for inner ticks.+ *+ * @method offsetNodeForTick+ * @param {Node} cb contentBox of the axis+ * @protected+ */+ offsetNodeForTick: function(cb)+ {+ var host = this,+ tickOffset = host.get("leftTickOffset"),+ offset = 0 - tickOffset;+ cb.setStyle("left", offset);+ },++ /**+ * Assigns a height based on the size of the contents.+ *+ * @method setCalculatedSize+ * @protected+ */+ setCalculatedSize: function()+ {+ var host = this,+ styles = host.get("styles"),+ labelStyle = styles.label,+ totalTitleSize = this._totalTitleSize,+ ttl = Math.round(host.get("rightTickOffset") + host._maxLabelSize + totalTitleSize + labelStyle.margin.left);+ if(this._explicitWidth)+ {+ ttl = this._explicitWidth;+ }+ host.set("calculatedWidth", ttl);+ host.get("contentBox").setStyle("width", ttl);+ }+};++Y.RightAxisLayout = RightAxisLayout;+/**+ * Contains algorithms for rendering a bottom axis.+ *+ * @module charts+ * @submodule charts-base+ * @class BottomAxisLayout+ * @Constructor+ */+BottomAxisLayout = function(){};++BottomAxisLayout.prototype = {+ /**+ * Default margins for text fields.+ *+ * @private+ * @method _getDefaultMargins+ * @return Object+ */+ _getDefaultMargins: function() + {+ return {+ top: 4,+ left: 0,+ right: 0,+ bottom: 0+ };+ },++ /**+ * Sets the length of the tick on either side of the axis line.+ *+ * @method setTickOffsets+ * @protected+ */+ setTickOffsets: function()+ {+ var host = this,+ majorTicks = host.get("styles").majorTicks,+ tickLength = majorTicks.length,+ halfTick = tickLength * 0.5,+ display = majorTicks.display;+ host.set("leftTickOffset", 0);+ host.set("rightTickOffset", 0);++ switch(display)+ {+ case "inside" :+ host.set("topTickOffset", tickLength);+ host.set("bottomTickOffset", 0);+ break;+ case "outside" : + host.set("topTickOffset", 0);+ host.set("bottomTickOffset", tickLength);+ break;+ case "cross":+ host.set("topTickOffset", halfTick);+ host.set("bottomTickOffset", halfTick);+ break;+ default:+ host.set("topTickOffset", 0);+ host.set("bottomTickOffset", 0);+ break;+ }+ },++ /**+ * Calculates the coordinates for the first point on an axis.+ *+ * @method getLineStart+ * @protected+ */+ getLineStart: function()+ {+ var style = this.get("styles"),+ padding = style.padding,+ majorTicks = style.majorTicks,+ tickLength = majorTicks.length,+ display = majorTicks.display,+ pt = {x:0, y:padding.top};+ if(display === "inside")+ {+ pt.y += tickLength;+ }+ else if(display === "cross")+ {+ pt.y += tickLength/2;+ }+ return pt; + },+ + /**+ * Draws a tick+ *+ * @method drawTick+ * @param {Path} path reference to the path `Path` element in which to draw the tick.+ * @param {Object} pt hash containing x and y coordinates+ * @param {Object} tickStyles hash of properties used to draw the tick+ * @protected+ */+ drawTick: function(path, pt, tickStyles)+ {+ var host = this,+ style = host.get("styles"),+ padding = style.padding,+ tickLength = tickStyles.length,+ start = {x:pt.x, y:padding.top},+ end = {x:pt.x, y:tickLength + padding.top};+ host.drawLine(path, start, end);+ },++ /**+ * Calculates the point for a label.+ *+ * @method getLabelPoint+ * @param {Object} pt Object containing x and y coordinates+ * @return Object+ * @protected+ */+ getLabelPoint: function(point)+ {+ return {x:point.x, y:point.y + this.get("bottomTickOffset")};+ },+ + /**+ * Updates the value for the `maxLabelSize` for use in calculating total size.+ *+ * @method updateMaxLabelSize+ * @param {HTMLElement} label to measure+ * @protected+ */+ updateMaxLabelSize: function(labelWidth, labelHeight)+ {+ var host = this,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ sinRadians = props.sinRadians,+ cosRadians = props.cosRadians,+ max;+ if(rot === 0)+ {+ max = labelHeight;+ }+ else if(absRot === 90)+ {+ max = labelWidth;+ }+ else+ {+ max = (sinRadians * labelWidth) + (cosRadians * labelHeight); + }+ host._maxLabelSize = Math.max(host._maxLabelSize, max);+ },+ + /**+ * Determines the available label height when the axis width has been explicitly set.+ *+ * @method getExplicitlySized+ * @return Boolean+ * @protected+ */+ getExplicitlySized: function(styles)+ {+ if(this._explicitHeight)+ {+ var host = this,+ h = host._explicitHeight,+ totalTitleSize = host._totalTitleSize,+ bottomTickOffset = host.get("bottomTickOffset"),+ margin = styles.label.margin.right;+ host._maxLabelSize = h - (bottomTickOffset + margin + totalTitleSize);+ return true;+ }+ return false;+ },++ /**+ * Rotate and position title.+ *+ * @method positionTitle+ * @param {HTMLElement} label to rotate position+ * @protected+ */+ positionTitle: function(label)+ {+ var host = this,+ bounds = host._titleBounds,+ margin = host.get("styles").title.margin,+ props = host._titleRotationProps,+ h = bounds.bottom - bounds.top,+ labelWidth = label.offsetWidth,+ labelHeight = label.offsetHeight,+ x = (host.get("width") * 0.5) - (labelWidth * 0.5),+ y = host.get("height") - labelHeight/2 - h/2;+ props.labelWidth = labelWidth;+ props.labelHeight = labelHeight;+ if(margin && margin.bottom)+ {+ y -= margin.bottom;+ }+ props.x = x;+ props.y = y;+ props.transformOrigin = [0.5, 0.5];+ host._rotate(label, props);+ },+ + /**+ * Rotate and position labels.+ *+ * @method positionLabel+ * @param {HTMLElement} label to rotate position+ * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned+ * against.+ * @protected+ */+ positionLabel: function(label, pt, styles, i)+ {+ var host = this,+ tickOffset = host.get("bottomTickOffset"),+ labelStyles = styles.label,+ margin = 0,+ props = host._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ leftOffset = Math.round(pt.x),+ topOffset = Math.round(pt.y),+ labelWidth = host._labelWidths[i],+ labelHeight = host._labelHeights[i];+ if(labelStyles.margin && labelStyles.margin.top)+ {+ margin = labelStyles.margin.top;+ }+ if(rot > 0)+ {+ topOffset -= labelHeight/2 * rot/90;+ }+ else if(rot < 0)+ {+ leftOffset -= labelWidth;+ topOffset -= labelHeight/2 * absRot/90;+ }+ else+ {+ leftOffset -= labelWidth * 0.5;+ }+ topOffset += margin;+ topOffset += tickOffset;+ props.labelWidth = labelWidth;+ props.labelHeight = labelHeight;+ props.x = leftOffset;+ props.y = topOffset;+ host._rotate(label, props);+ },+ + /**+ * Adjusts the coordinates of an axis label based on the rotation.+ *+ * @method _setRotationCoords+ * @param {Object} props Coordinates, dimension and rotation properties of the label.+ * @protected+ */+ _setRotationCoords: function(props)+ {+ var rot = props.rot,+ absRot = props.absRot,+ labelWidth = props.labelWidth,+ labelHeight = props.labelHeight,+ leftOffset,+ topOffset;++ if(rot > 0)+ {+ leftOffset = 0;+ topOffset = labelHeight/2 * rot/90;+ }+ else if(rot < 0)+ {+ leftOffset = labelWidth;+ topOffset = labelHeight/2 * absRot/90;+ }+ else+ {+ leftOffset = labelWidth * 0.5;+ topOffset = 0;+ }+ props.x -= leftOffset;+ props.y -= topOffset;+ },++ /**+ * Returns the transformOrigin to use for an axis label based on the position of the axis + * and the rotation of the label.+ *+ * @method _getTransformOrigin+ * @param {Number} rot The rotation (in degrees) of the label.+ * @return Array+ * @protected+ */+ _getTransformOrigin: function(rot)+ {+ var transformOrigin;+ if(rot > 0)+ {+ transformOrigin = [0, 0.5];+ }+ else if(rot < 0)+ {+ transformOrigin = [1, 0.5];+ }+ else+ {+ transformOrigin = [0, 0];+ }+ return transformOrigin;+ },++ /**+ * Adjusts position for inner ticks.+ *+ * @method offsetNodeForTick+ * @param {Node} cb contentBox of the axis+ * @protected+ */+ offsetNodeForTick: function(cb)+ {+ var host = this;+ host.get("contentBox").setStyle("top", 0 - host.get("topTickOffset"));+ },++ /**+ * Assigns a height based on the size of the contents.+ *+ * @method setCalculatedSize+ * @protected+ */+ setCalculatedSize: function()+ {+ var host = this,+ styles = host.get("styles"),+ labelStyle = styles.label,+ totalTitleSize = host._totalTitleSize,+ ttl = Math.round(host.get("bottomTickOffset") + host._maxLabelSize + labelStyle.margin.top + totalTitleSize);+ if(host._explicitHeight)+ {+ ttl = host._explicitHeight;+ }+ host.set("calculatedHeight", ttl);+ }+};+Y.BottomAxisLayout = BottomAxisLayout;+/**+ * Contains algorithms for rendering a top axis.+ *+ * @module charts+ * @submodule charts-base+ * @class TopAxisLayout+ * @constructor+ */+TopAxisLayout = function(){};++TopAxisLayout.prototype = {+ /**+ * Default margins for text fields.+ *+ * @private+ * @method _getDefaultMargins+ * @return Object+ */+ _getDefaultMargins: function() + {+ return {+ top: 0,+ left: 0,+ right: 0,+ bottom: 4+ };+ },+ + /**+ * Sets the length of the tick on either side of the axis line.+ *+ * @method setTickOffsets+ * @protected+ */+ setTickOffsets: function()+ {+ var host = this,+ majorTicks = host.get("styles").majorTicks,+ tickLength = majorTicks.length,+ halfTick = tickLength * 0.5,+ display = majorTicks.display;+ host.set("leftTickOffset", 0);+ host.set("rightTickOffset", 0);+ switch(display)+ {+ case "inside" :+ host.set("bottomTickOffset", tickLength);+ host.set("topTickOffset", 0);+ break;+ case "outside" : + host.set("bottomTickOffset", 0);+ host.set("topTickOffset", tickLength);+ break;+ case "cross" :+ host.set("topTickOffset", halfTick);+ host.set("bottomTickOffset", halfTick);+ break;+ default:+ host.set("topTickOffset", 0);+ host.set("bottomTickOffset", 0);+ break;+ }+ },++ /**+ * Calculates the coordinates for the first point on an axis.+ *+ * @method getLineStart+ * @protected+ */+ getLineStart: function()+ {+ var host = this,+ style = host.get("styles"),+ padding = style.padding,+ majorTicks = style.majorTicks,+ tickLength = majorTicks.length,+ display = majorTicks.display,+ pt = {x:0, y:padding.top};+ if(display === "outside")+ {+ pt.y += tickLength;+ }+ else if(display === "cross")+ {+ pt.y += tickLength/2;+ }+ return pt; + },+ + /**+ * Draws a tick+ *+ * @method drawTick+ * @param {Path} path reference to the path `Path` element in which to draw the tick.+ * @param {Object} pt hash containing x and y coordinates+ * @param {Object} tickStyles hash of properties used to draw the tick+ * @protected+ */+ drawTick: function(path, pt, tickStyles)+ {+ var host = this,+ style = host.get("styles"),+ padding = style.padding,+ tickLength = tickStyles.length,+ start = {x:pt.x, y:padding.top},+ end = {x:pt.x, y:tickLength + padding.top};+ host.drawLine(path, start, end);+ },+ + /**+ * Calculates the point for a label.+ *+ * @method getLabelPoint+ * @param {Object} pt hash containing x and y coordinates+ * @return Object+ * @protected+ */+ getLabelPoint: function(pt)+ {+ return {x:pt.x, y:pt.y - this.get("topTickOffset")};+ },+ + /**+ * Updates the value for the `maxLabelSize` for use in calculating total size.+ *+ * @method updateMaxLabelSize+ * @param {HTMLElement} label to measure+ * @protected+ */+ updateMaxLabelSize: function(labelWidth, labelHeight)+ {+ var host = this,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ sinRadians = props.sinRadians,+ cosRadians = props.cosRadians,+ max;+ if(rot === 0)+ {+ max = labelHeight;+ }+ else if(absRot === 90)+ {+ max = labelWidth;+ }+ else+ {+ max = (sinRadians * labelWidth) + (cosRadians * labelHeight); + }+ host._maxLabelSize = Math.max(host._maxLabelSize, max);+ },++ /**+ * Determines the available label height when the axis width has been explicitly set.+ *+ * @method getExplicitlySized+ * @return Boolean+ * @protected+ */+ getExplicitlySized: function(styles)+ {+ if(this._explicitHeight)+ {+ var host = this,+ h = host._explicitHeight,+ totalTitleSize = host._totalTitleSize,+ topTickOffset = host.get("topTickOffset"),+ margin = styles.label.margin.right;+ host._maxLabelSize = h - (topTickOffset + margin + totalTitleSize);+ return true;+ }+ return false;+ },++ /**+ * Rotate and position title.+ *+ * @method positionTitle+ * @param {HTMLElement} label to rotate position+ * @protected+ */+ positionTitle: function(label)+ {+ var host = this,+ bounds = host._titleBounds,+ margin = host.get("styles").title.margin,+ props = host._titleRotationProps,+ labelWidth = label.offsetWidth,+ labelHeight = label.offsetHeight,+ h = bounds.bottom - bounds.top,+ x = (host.get("width") * 0.5) - (labelWidth * 0.5),+ y = h/2 - labelHeight/2;+ props.labelWidth = labelWidth;+ props.labelHeight = labelHeight;+ if(margin && margin.top)+ {+ y += margin.top;+ }+ props.x = x;+ props.y = y;+ props.transformOrigin = [0.5, 0.5];+ host._rotate(label, props);+ },++ /**+ * Rotate and position labels.+ *+ * @method positionLabel+ * @param {HTMLElement} label to rotate position+ * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned+ * against.+ * @protected+ */+ positionLabel: function(label, pt, styles, i)+ {+ var host = this,+ totalTitleSize = this._totalTitleSize,+ maxLabelSize = host._maxLabelSize,+ leftOffset = pt.x,+ topOffset = pt.y + totalTitleSize + maxLabelSize,+ props = this._labelRotationProps,+ rot = props.rot,+ absRot = props.absRot,+ labelWidth = this._labelWidths[i],+ labelHeight = this._labelHeights[i];+ if(rot === 0)+ {+ leftOffset -= labelWidth * 0.5;+ topOffset -= labelHeight;+ }+ else+ {+ if(rot === 90)+ {+ leftOffset -= labelWidth;+ topOffset -= (labelHeight * 0.5);+ }+ else if (rot === -90)+ {+ topOffset -= (labelHeight * 0.5);+ } + else if(rot > 0)+ {+ leftOffset -= labelWidth;+ topOffset -= labelHeight - (labelHeight * rot/180);+ }+ else+ {+ topOffset -= labelHeight - (labelHeight * absRot/180);+ }+ }+ props.x = Math.round(leftOffset);+ props.y = Math.round(topOffset);+ props.labelWidth = labelWidth;+ props.labelHeight = labelHeight;+ this._rotate(label, props);+ },++ /**+ * Adjusts the coordinates of an axis label based on the rotation.+ *+ * @method _setRotationCoords+ * @param {Object} props Coordinates, dimension and rotation properties of the label.+ * @protected+ */+ _setRotationCoords: function(props)+ {+ var rot = props.rot,+ absRot = props.absRot,+ labelWidth = props.labelWidth,+ labelHeight = props.labelHeight,+ leftOffset,+ topOffset;+ if(rot === 0)+ {+ leftOffset = labelWidth * 0.5;+ topOffset = labelHeight;+ }+ else+ {+ if(rot === 90)+ {+ leftOffset = labelWidth;+ topOffset = (labelHeight * 0.5);+ }+ else if (rot === -90)+ {+ topOffset = (labelHeight * 0.5);+ } + else if(rot > 0)+ {+ leftOffset = labelWidth;+ topOffset = labelHeight - (labelHeight * rot/180);+ }+ else+ {+ topOffset = labelHeight - (labelHeight * absRot/180);+ }+ }+ props.x -= leftOffset;+ props.y -= topOffset;+ },++ /**+ * Returns the transformOrigin to use for an axis label based on the position of the axis + * and the rotation of the label.+ *+ * @method _getTransformOrigin+ * @param {Number} rot The rotation (in degrees) of the label.+ * @return Array+ * @protected+ */+ _getTransformOrigin: function(rot)+ {+ var transformOrigin;+ if(rot === 0)+ {+ transformOrigin = [0, 0];+ }+ else+ {+ if(rot === 90)+ {+ transformOrigin = [1, 0.5];+ }+ else if (rot === -90)+ {+ transformOrigin = [0, 0.5];+ } + else if(rot > 0)+ {+ transformOrigin = [1, 0.5];+ }+ else+ {+ transformOrigin = [0, 0.5];+ }+ }+ return transformOrigin;+ },++ /**+ * Adjusts position for inner ticks.+ *+ * @method offsetNodeForTick+ * @param {Node} cb contentBox of the axis+ * @protected+ */+ offsetNodeForTick: function(cb)+ {+ },++ /**+ * Assigns a height based on the size of the contents.+ *+ * @method setCalculatedSize+ * @protected+ */+ setCalculatedSize: function()+ {+ var host = this,+ graphic = host.get("graphic"),+ styles = host.get("styles"),+ labelMargin = styles.label.margin,+ totalLabelSize = labelMargin.bottom + host._maxLabelSize,+ totalTitleSize = host._totalTitleSize,+ topTickOffset = this.get("topTickOffset"),+ ttl = Math.round(topTickOffset + totalLabelSize + totalTitleSize);+ if(this._explicitHeight)+ {+ ttl = this._explicitWidth; + }+ host.set("calculatedHeight", ttl);+ graphic.set("y", ttl - topTickOffset);+ }+};+Y.TopAxisLayout = TopAxisLayout;++/**+ * The Axis class. Generates axes for a chart.+ *+ * @module charts+ * @submodule charts-base+ * @class Axis+ * @extends Widget+ * @uses Renderer+ * @constructor+ * @param {Object} config (optional) Configuration parameters for the Chart.+ */+Y.Axis = Y.Base.create("axis", Y.Widget, [Y.Renderer], {+ /**+ * Storage for calculatedWidth value.+ *+ * @property _calculatedWidth+ * @type Number+ * @private+ */+ _calculatedWidth: 0,++ /**+ * Storage for calculatedHeight value.+ *+ * @property _calculatedHeight+ * @type Number+ * @private+ */+ _calculatedHeight: 0,++ /**+ * Handles change to the dataProvider+ * + * @method _dataChangeHandler+ * @param {Object} e Event object+ * @private+ */+ _dataChangeHandler: function(e)+ {+ if(this.get("rendered"))+ {+ this._drawAxis();+ }+ },++ /**+ * Handles change to the position attribute+ *+ * @method _positionChangeHandler+ * @param {Object} e Event object+ * @private+ */+ _positionChangeHandler: function(e)+ {+ this._updateGraphic(e.newVal);+ this._updateHandler();+ },++ /**+ * Updates the the Graphic instance+ *+ * @method _updateGraphic+ * @param {String} position Position of axis + * @private+ */+ _updateGraphic: function(position)+ {+ var graphic = this.get("graphic");+ if(position == "none")+ {+ if(graphic)+ {+ graphic.destroy();+ }+ }+ else+ {+ if(!graphic)+ {+ this._setCanvas();+ }+ }+ },++ /**+ * Handles changes to axis.+ *+ * @method _updateHandler+ * @param {Object} e Event object+ * @private+ */+ _updateHandler: function(e)+ {+ if(this.get("rendered"))+ {+ this._drawAxis();+ }+ },+ + /**+ * @method renderUI+ * @private+ */+ renderUI: function()+ {+ this._updateGraphic(this.get("position"));+ },++ /**+ * @method syncUI+ * @private+ */+ syncUI: function()+ {+ var layout = this._layout,+ defaultMargins,+ styles,+ label,+ title,+ i;+ if(layout)+ {+ defaultMargins = layout._getDefaultMargins();+ styles = this.get("styles");+ label = styles.label.margin;+ title =styles.title.margin;+ //need to defaultMargins method to the layout classes.+ for(i in defaultMargins)+ {+ if(defaultMargins.hasOwnProperty(i))+ {+ label[i] = label[i] === undefined ? defaultMargins[i] : label[i];+ title[i] = title[i] === undefined ? defaultMargins[i] : title[i];+ }+ }+ }+ this._drawAxis();+ },++ /**+ * Creates a graphic instance to be used for the axis line and ticks.+ *+ * @method _setCanvas+ * @private+ */+ _setCanvas: function()+ {+ var cb = this.get("contentBox"),+ bb = this.get("boundingBox"),+ p = this.get("position"),+ pn = this._parentNode,+ w = this.get("width"),+ h = this.get("height");+ bb.setStyle("position", "absolute");+ bb.setStyle("zIndex", 2);+ w = w ? w + "px" : pn.getStyle("width");+ h = h ? h + "px" : pn.getStyle("height");+ if(p === "top" || p === "bottom")+ {+ cb.setStyle("width", w);+ }+ else+ {+ cb.setStyle("height", h);+ }+ cb.setStyle("position", "relative");+ cb.setStyle("left", "0px");+ cb.setStyle("top", "0px");+ this.set("graphic", new Y.Graphic());+ this.get("graphic").render(cb);+ },+ + /**+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ * @protected+ */+ _getDefaultStyles: function()+ {+ var axisstyles = {+ majorTicks: {+ display:"inside",+ length:4,+ color:"#dad8c9",+ weight:1,+ alpha:1+ },+ minorTicks: {+ display:"none",+ length:2,+ color:"#dad8c9",+ weight:1+ },+ line: {+ weight:1,+ color:"#dad8c9",+ alpha:1+ },+ majorUnit: {+ determinant:"count",+ count:11,+ distance:75+ },+ top: "0px",+ left: "0px",+ width: "100px",+ height: "100px",+ label: {+ color:"#808080",+ alpha: 1,+ fontSize:"85%",+ rotation: 0,+ margin: {+ top: undefined,+ right: undefined,+ bottom: undefined,+ left: undefined+ }+ },+ title: {+ color:"#808080",+ alpha: 1,+ fontSize:"85%",+ rotation: undefined,+ margin: {+ top: undefined,+ right: undefined,+ bottom: undefined,+ left: undefined+ }+ },+ hideOverlappingLabelTicks: false+ };+ + return Y.merge(Y.Renderer.prototype._getDefaultStyles(), axisstyles); + },++ /**+ * Updates the axis when the size changes.+ *+ * @method _handleSizeChange+ * @param {Object} e Event object.+ * @private+ */+ _handleSizeChange: function(e)+ {+ var attrName = e.attrName,+ pos = this.get("position"),+ vert = pos == "left" || pos == "right",+ cb = this.get("contentBox"),+ hor = pos == "bottom" || pos == "top";+ cb.setStyle("width", this.get("width"));+ cb.setStyle("height", this.get("height"));+ if((hor && attrName == "width") || (vert && attrName == "height"))+ {+ this._drawAxis();+ }+ },+ + /**+ * Maps key values to classes containing layout algorithms+ *+ * @property _layoutClasses+ * @type Object+ * @private+ */+ _layoutClasses: + {+ top : TopAxisLayout,+ bottom: BottomAxisLayout,+ left: LeftAxisLayout,+ right : RightAxisLayout+ },+ + /**+ * Draws a line segment between 2 points+ *+ * @method drawLine+ * @param {Object} startPoint x and y coordinates for the start point of the line segment+ * @param {Object} endPoint x and y coordinates for the for the end point of the line segment+ * @param {Object} line styles (weight, color and alpha to be applied to the line segment)+ * @private+ */+ drawLine: function(path, startPoint, endPoint)+ {+ path.moveTo(startPoint.x, startPoint.y);+ path.lineTo(endPoint.x, endPoint.y);+ },++ /**+ * Generates the properties necessary for rotating and positioning a text field.+ *+ * @method _getTextRotationProps+ * @param {Object} styles properties for the text field+ * @return Object+ * @private+ */+ _getTextRotationProps: function(styles)+ {+ if(styles.rotation === undefined)+ {+ switch(this.get("position"))+ {+ case "left" :+ styles.rotation = -90;+ break; + case "right" : + styles.rotation = 90;+ break;+ default :+ styles.rotation = 0;+ break;+ }+ }+ var rot = Math.min(90, Math.max(-90, styles.rotation)),+ absRot = Math.abs(rot),+ radCon = Math.PI/180,+ sinRadians = parseFloat(parseFloat(Math.sin(absRot * radCon)).toFixed(8)),+ cosRadians = parseFloat(parseFloat(Math.cos(absRot * radCon)).toFixed(8));+ return {+ rot: rot,+ absRot: absRot,+ radCon: radCon,+ sinRadians: sinRadians,+ cosRadians: cosRadians,+ textAlpha: styles.alpha+ };+ },++ /**+ * Draws an axis. + *+ * @method _drawAxis+ * @private+ */+ _drawAxis: function ()+ {+ if(this._drawing)+ {+ this._callLater = true;+ return;+ }+ this._drawing = true;+ this._callLater = false;+ if(this._layout)+ {+ var styles = this.get("styles"),+ line = styles.line,+ labelStyles = styles.label,+ majorTickStyles = styles.majorTicks,+ drawTicks = majorTickStyles.display != "none",+ tickPoint,+ majorUnit = styles.majorUnit,+ len,+ majorUnitDistance,+ i = 0,+ layout = this._layout,+ layoutLength,+ position,+ lineStart,+ label,+ labelWidth,+ labelHeight,+ labelFunction = this.get("labelFunction"),+ labelFunctionScope = this.get("labelFunctionScope"),+ labelFormat = this.get("labelFormat"),+ graphic = this.get("graphic"),+ path = this.get("path"),+ tickPath,+ explicitlySized;+ this._labelWidths = [];+ this._labelHeights = [];+ graphic.set("autoDraw", false);+ path.clear();+ path.set("stroke", {+ weight: line.weight, + color: line.color, + opacity: line.alpha+ });+ this._labelRotationProps = this._getTextRotationProps(labelStyles);+ this._labelRotationProps.transformOrigin = layout._getTransformOrigin(this._labelRotationProps.rot);+ layout.setTickOffsets.apply(this);+ layoutLength = this.getLength();+ lineStart = layout.getLineStart.apply(this);+ len = this.getTotalMajorUnits(majorUnit);+ majorUnitDistance = this.getMajorUnitDistance(len, layoutLength, majorUnit);+ this.set("edgeOffset", this.getEdgeOffset(len, layoutLength) * 0.5);+ if(len < 1)+ {+ this._clearLabelCache();+ }+ else+ {+ tickPoint = this.getFirstPoint(lineStart);+ this.drawLine(path, lineStart, this.getLineEnd(tickPoint));+ if(drawTicks) + {+ tickPath = this.get("tickPath");+ tickPath.clear();+ tickPath.set("stroke", {+ weight: majorTickStyles.weight,+ color: majorTickStyles.color,+ opacity: majorTickStyles.alpha+ });+ layout.drawTick.apply(this, [tickPath, tickPoint, majorTickStyles]);+ }+ this._createLabelCache();+ this._tickPoints = [];+ this._maxLabelSize = 0; + this._totalTitleSize = 0;+ this._titleSize = 0;+ this._setTitle();+ explicitlySized = layout.getExplicitlySized.apply(this, [styles]);+ for(; i < len; ++i)+ {+ if(drawTicks) + {+ layout.drawTick.apply(this, [tickPath, tickPoint, majorTickStyles]);+ }+ position = this.getPosition(tickPoint);+ label = this.getLabel(tickPoint, labelStyles);+ this._labels.push(label);+ this._tickPoints.push({x:tickPoint.x, y:tickPoint.y});+ this.get("appendLabelFunction")(label, labelFunction.apply(labelFunctionScope, [this.getLabelByIndex(i, len), labelFormat]));+ labelWidth = Math.round(label.offsetWidth);+ labelHeight = Math.round(label.offsetHeight);+ if(!explicitlySized)+ {+ this._layout.updateMaxLabelSize.apply(this, [labelWidth, labelHeight]);+ }+ this._labelWidths.push(labelWidth);+ this._labelHeights.push(labelHeight);+ tickPoint = this.getNextPoint(tickPoint, majorUnitDistance);+ }+ this._clearLabelCache();+ if(this.get("overlapGraph"))+ {+ layout.offsetNodeForTick.apply(this, [this.get("contentBox")]);+ }+ layout.setCalculatedSize.apply(this);+ if(this._titleTextField)+ {+ this._layout.positionTitle.apply(this, [this._titleTextField]);+ }+ for(i = 0; i < len; ++i)+ {+ layout.positionLabel.apply(this, [this.get("labels")[i], this._tickPoints[i], styles, i]);+ }+ }+ }+ this._drawing = false;+ if(this._callLater)+ {+ this._drawAxis();+ }+ else+ {+ this._updatePathElement();+ this.fire("axisRendered");+ }+ },+ + /**+ * Calculates and sets the total size of a title.+ *+ * @method _setTotalTitleSize+ * @param {Object} styles Properties for the title field.+ * @private+ */+ _setTotalTitleSize: function(styles)+ {+ var title = this._titleTextField,+ w = title.offsetWidth,+ h = title.offsetHeight,+ rot = this._titleRotationProps.rot,+ bounds,+ size,+ margin = styles.margin,+ position = this.get("position"),+ matrix = new Y.Matrix();+ matrix.rotate(rot);+ bounds = matrix.getContentRect(w, h);+ if(position == "left" || position == "right")+ {+ size = bounds.right - bounds.left;+ if(margin)+ {+ size += margin.left + margin.right;+ }+ }+ else+ {+ size = bounds.bottom - bounds.top;+ if(margin)+ {+ size += margin.top + margin.bottom;+ }+ }+ this._titleBounds = bounds;+ this._totalTitleSize = size;+ },++ /**+ * Updates path.+ *+ * @method _updatePathElement+ * @private+ */+ _updatePathElement: function()+ {+ var path = this._path,+ tickPath = this._tickPath,+ redrawGraphic = false,+ graphic = this.get("graphic");+ if(path)+ {+ redrawGraphic = true;+ path.end();+ }+ if(tickPath)+ {+ redrawGraphic = true;+ tickPath.end();+ }+ if(redrawGraphic)+ {+ graphic._redraw();+ }+ },++ /**+ * Updates the content and style properties for a title field.+ *+ * @method _updateTitle+ * @private+ */+ _setTitle: function()+ {+ var i,+ styles,+ customStyles,+ title = this.get("title"),+ titleTextField = this._titleTextField,+ parentNode;+ if(title !== null && title !== undefined)+ {+ customStyles = {+ rotation: "rotation",+ margin: "margin",+ alpha: "alpha"+ };+ styles = this.get("styles").title;+ if(!titleTextField)+ {+ titleTextField = DOCUMENT.createElement('span');+ titleTextField.style.display = "block";+ titleTextField.style.whiteSpace = "nowrap";+ titleTextField.setAttribute("class", "axisTitle");+ this.get("contentBox").append(titleTextField);+ }+ else if(!DOCUMENT.createElementNS)+ {+ if(titleTextField.style.filter)+ {+ titleTextField.style.filter = null;+ }+ }+ titleTextField.style.position = "absolute";+ for(i in styles)+ {+ if(styles.hasOwnProperty(i) && !customStyles.hasOwnProperty(i))+ {+ titleTextField.style[i] = styles[i];+ }+ }+ this.get("appendTitleFunction")(titleTextField, title);+ this._titleTextField = titleTextField;+ this._titleRotationProps = this._getTextRotationProps(styles);+ this._setTotalTitleSize(styles);+ }+ else if(titleTextField)+ {+ parentNode = titleTextField.parentNode;+ if(parentNode)+ {+ parentNode.removeChild(titleTextField);+ }+ this._titleTextField = null;+ this._totalTitleSize = 0;+ }+ },++ /**+ * Creates or updates an axis label.+ *+ * @method getLabel+ * @param {Object} pt x and y coordinates for the label+ * @param {Object} styles styles applied to label+ * @return HTMLElement + * @private+ */+ getLabel: function(pt, styles)+ {+ var i,+ label,+ labelCache = this._labelCache,+ customStyles = {+ rotation: "rotation",+ margin: "margin",+ alpha: "alpha"+ };+ if(labelCache && labelCache.length > 0)+ {+ label = labelCache.shift();+ }+ else+ {+ label = DOCUMENT.createElement("span");+ label.className = Y.Lang.trim([label.className, "axisLabel"].join(' '));+ this.get("contentBox").append(label);+ }+ if(!DOCUMENT.createElementNS)+ {+ if(label.style.filter)+ {+ label.style.filter = null;+ }+ }+ label.style.display = "block";+ label.style.whiteSpace = "nowrap";+ label.style.position = "absolute";+ for(i in styles)+ {+ if(styles.hasOwnProperty(i) && !customStyles.hasOwnProperty(i))+ {+ label.style[i] = styles[i];+ }+ }+ return label;+ },++ /**+ * Creates a cache of labels that can be re-used when the axis redraws.+ *+ * @method _createLabelCache+ * @private+ */+ _createLabelCache: function()+ {+ if(this._labels)+ {+ while(this._labels.length > 0)+ {+ this._labelCache.push(this._labels.shift());+ }+ }+ else+ {+ this._clearLabelCache();+ }+ this._labels = [];+ },+ + /**+ * Removes axis labels from the dom and clears the label cache.+ *+ * @method _clearLabelCache+ * @private+ */+ _clearLabelCache: function()+ {+ if(this._labelCache)+ {+ var len = this._labelCache.length,+ i = 0,+ label;+ for(; i < len; ++i)+ {+ label = this._labelCache[i];+ this._removeChildren(label);+ Y.Event.purgeElement(label, true);+ label.parentNode.removeChild(label);+ }+ }+ this._labelCache = [];+ },++ /**+ * Gets the end point of an axis.+ *+ * @method getLineEnd+ * @return Object+ * @private + */+ getLineEnd: function(pt)+ {+ var w = this.get("width"),+ h = this.get("height"),+ pos = this.get("position");+ if(pos === "top" || pos === "bottom")+ {+ return {x:w, y:pt.y};+ }+ else+ {+ return {x:pt.x, y:h};+ }+ },++ /**+ * Calcuates the width or height of an axis depending on its direction.+ *+ * @method getLength+ * @return Number+ * @private+ */+ getLength: function()+ {+ var l,+ style = this.get("styles"),+ padding = style.padding,+ w = this.get("width"),+ h = this.get("height"),+ pos = this.get("position");+ if(pos === "top" || pos === "bottom")+ {+ l = w - (padding.left + padding.right);+ }+ else+ {+ l = h - (padding.top + padding.bottom);+ }+ return l;+ },++ /**+ * Gets the position of the first point on an axis.+ *+ * @method getFirstPoint+ * @param {Object} pt Object containing x and y coordinates.+ * @return Object+ * @private+ */+ getFirstPoint:function(pt)+ {+ var style = this.get("styles"),+ pos = this.get("position"),+ padding = style.padding,+ np = {x:pt.x, y:pt.y};+ if(pos === "top" || pos === "bottom")+ {+ np.x += padding.left + this.get("edgeOffset");+ }+ else+ {+ np.y += this.get("height") - (padding.top + this.get("edgeOffset"));+ }+ return np;+ },++ /**+ * Gets the position of the next point on an axis.+ *+ * @method getNextPoint+ * @param {Object} point Object containing x and y coordinates.+ * @param {Number} majorUnitDistance Distance in pixels between ticks.+ * @return Object+ * @private+ */+ getNextPoint: function(point, majorUnitDistance)+ {+ var pos = this.get("position");+ if(pos === "top" || pos === "bottom")+ {+ point.x = point.x + majorUnitDistance; + }+ else+ {+ point.y = point.y - majorUnitDistance;+ }+ return point;+ },++ /**+ * Calculates the placement of last tick on an axis.+ *+ * @method getLastPoint+ * @return Object+ * @private + */+ getLastPoint: function()+ {+ var style = this.get("styles"),+ padding = style.padding,+ w = this.get("width"),+ pos = this.get("position");+ if(pos === "top" || pos === "bottom")+ {+ return {x:w - padding.right, y:padding.top};+ }+ else+ {+ return {x:padding.left, y:padding.top};+ }+ },++ /**+ * Calculates position on the axis.+ *+ * @method getPosition+ * @param {Object} point contains x and y values+ * @private + */+ getPosition: function(point)+ {+ var p,+ h = this.get("height"),+ style = this.get("styles"),+ padding = style.padding,+ pos = this.get("position"),+ dataType = this.get("dataType");+ if(pos === "left" || pos === "right") + {+ //Numeric data on a vertical axis is displayed from bottom to top.+ //Categorical and Timeline data is displayed from top to bottom.+ if(dataType === "numeric")+ {+ p = (h - (padding.top + padding.bottom)) - (point.y - padding.top);+ }+ else+ {+ p = point.y - padding.top;+ }+ }+ else+ {+ p = point.x - padding.left;+ }+ return p;+ },++ /**+ * Rotates and positions a text field.+ *+ * @method _rotate+ * @param {HTMLElement} label text field to rotate and position+ * @param {Object} props properties to be applied to the text field. + * @private+ */+ _rotate: function(label, props)+ {+ var rot = props.rot,+ x = props.x,+ y = props.y,+ filterString,+ textAlpha,+ matrix = new Y.Matrix(),+ transformOrigin = props.transformOrigin || [0, 0],+ offsetRect;+ if(DOCUMENT.createElementNS)+ {+ matrix.translate(x, y);+ matrix.rotate(rot);+ Y_DOM.setStyle(label, "transformOrigin", (transformOrigin[0] * 100) + "% " + (transformOrigin[1] * 100) + "%");+ Y_DOM.setStyle(label, "transform", matrix.toCSSText());+ }+ else+ {+ textAlpha = props.textAlpha;+ if(Y_Lang.isNumber(textAlpha) && textAlpha < 1 && textAlpha > -1 && !isNaN(textAlpha))+ {+ filterString = "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + Math.round(textAlpha * 100) + ")";+ }+ if(rot !== 0)+ {+ //ms filters kind of, sort of uses a transformOrigin of 0, 0. + //we'll translate the difference to create a true 0, 0 origin.+ matrix.rotate(rot);+ offsetRect = matrix.getContentRect(props.labelWidth, props.labelHeight);+ matrix.init();+ matrix.translate(offsetRect.left, offsetRect.top);+ matrix.translate(x, y);+ this._simulateRotateWithTransformOrigin(matrix, rot, transformOrigin, props.labelWidth, props.labelHeight);+ if(filterString)+ {+ filterString += " ";+ }+ else+ {+ filterString = ""; + }+ filterString += matrix.toFilterText();+ label.style.left = matrix.dx + "px";+ label.style.top = matrix.dy + "px";+ }+ else+ {+ label.style.left = x + "px";+ label.style.top = y + "px";+ }+ if(filterString)+ {+ label.style.filter = filterString;+ }+ }+ },+ + /**+ * Simulates a rotation with a specified transformOrigin. + *+ * @method _simulateTransformOrigin+ * @param {Matrix} matrix Reference to a `Matrix` instance.+ * @param {Number} rot The rotation (in degrees) that will be performed on a matrix.+ * @param {Array} transformOrigin An array represeniting the origin in which to perform the transform. The first + * index represents the x origin and the second index represents the y origin.+ * @param {Number} w The width of the object that will be transformed.+ * @param {Number} h The height of the object that will be transformed.+ * @private+ */+ _simulateRotateWithTransformOrigin: function(matrix, rot, transformOrigin, w, h)+ {+ var transformX = transformOrigin[0] * w,+ transformY = transformOrigin[1] * h;+ transformX = !isNaN(transformX) ? transformX : 0;+ transformY = !isNaN(transformY) ? transformY : 0;+ matrix.translate(transformX, transformY);+ matrix.rotate(rot);+ matrix.translate(-transformX, -transformY);+ },++ /**+ * Returns the coordinates (top, right, bottom, left) for the bounding box of the last label. + *+ * @method getMaxLabelBounds+ * @return Object+ */+ getMaxLabelBounds: function()+ {+ return this._getLabelBounds(this.getMaximumValue());+ },++ /**+ * Returns the coordinates (top, right, bottom, left) for the bounding box of the first label. + *+ * @method getMinLabelBounds+ * @return Object+ */+ getMinLabelBounds: function()+ {+ return this._getLabelBounds(this.getMinimumValue());+ },+ + /**+ * Returns the coordinates (top, right, bottom, left) for the bounding box of a label. + *+ * @method _getLabelBounds+ * @param {String} Value of the label+ * @return Object+ * @private+ */+ _getLabelBounds: function(val)+ {+ var layout = this._layout,+ labelStyles = this.get("styles").label,+ matrix = new Y.Matrix(),+ label,+ props = this._getTextRotationProps(labelStyles);+ props.transformOrigin = layout._getTransformOrigin(props.rot);+ label = this.getLabel({x: 0, y: 0}, labelStyles);+ this.get("appendLabelFunction")(label, this.get("labelFunction").apply(this, [val, this.get("labelFormat")]));+ props.labelWidth = label.offsetWidth;+ props.labelHeight = label.offsetHeight;+ this._removeChildren(label);+ Y.Event.purgeElement(label, true);+ label.parentNode.removeChild(label);+ props.x = 0;+ props.y = 0;+ layout._setRotationCoords(props);+ matrix.translate(props.x, props.y);+ this._simulateRotateWithTransformOrigin(matrix, props.rot, props.transformOrigin, props.labelWidth, props.labelHeight);+ return matrix.getContentRect(props.labelWidth, props.labelHeight);+ },++ /**+ * Removes all DOM elements from an HTML element. Used to clear out labels during detruction+ * phase.+ *+ * @method _removeChildren+ * @private+ */+ _removeChildren: function(node)+ {+ if(node.hasChildNodes())+ {+ var child;+ while(node.firstChild)+ {+ child = node.firstChild;+ this._removeChildren(child);+ node.removeChild(child);+ }+ }+ },+ + /**+ * Destructor implementation Axis class. Removes all labels and the Graphic instance from the widget.+ *+ * @method destructor+ * @protected+ */+ destructor: function()+ {+ var cb = this.get("contentBox").getDOMNode(),+ labels = this.get("labels"),+ graphic = this.get("graphic"),+ label,+ len = labels ? labels.length : 0;+ if(len > 0)+ {+ while(labels.length > 0)+ {+ label = labels.shift();+ this._removeChildren(label);+ cb.removeChild(label);+ label = null;+ }+ }+ if(graphic)+ {+ graphic.destroy();+ }+ },++ /**+ * Length in pixels of largest text bounding box. Used to calculate the height of the axis.+ *+ * @property maxLabelSize+ * @type Number+ * @protected+ */+ _maxLabelSize: 0,+ + /**+ * Updates the content of text field. This method writes a value into a text field using + * `appendChild`. If the value is a `String`, it is converted to a `TextNode` first. + *+ * @method _setText+ * @param label {HTMLElement} label to be updated+ * @param val {String} value with which to update the label+ * @private+ */+ _setText: function(textField, val)+ { + textField.innerHTML = "";+ if(Y_Lang.isNumber(val))+ {+ val = val + "";+ }+ else if(!val)+ {+ val = "";+ }+ if(IS_STRING(val))+ {+ val = DOCUMENT.createTextNode(val);+ }+ textField.appendChild(val);+ }+}, {+ ATTRS: + {+ /**+ * When set, defines the width of a vertical axis instance. By default, vertical axes automatically size based on their contents. When the+ * width attribute is set, the axis will not calculate its width. When the width attribute is explicitly set, axis labels will postion themselves off of the + * the inner edge of the axis and the title, if present, will position itself off of the outer edge. If a specified width is less than the sum of + * the axis' contents, excess content will overflow.+ *+ * @attribute width+ * @type Number+ */+ width: {+ lazyAdd: false,++ getter: function() + {+ if(this._explicitWidth)+ {+ return this._explicitWidth; + }+ return this._calculatedWidth;+ },++ setter: function(val)+ {+ this._explicitWidth = val;+ return val;+ }+ },++ /**+ * When set, defines the height of a horizontal axis instance. By default, horizontal axes automatically size based on their contents. When the+ * height attribute is set, the axis will not calculate its height. When the height attribute is explicitly set, axis labels will postion themselves off of the + * the inner edge of the axis and the title, if present, will position itself off of the outer edge. If a specified height is less than the sum of + * the axis' contents, excess content will overflow.+ *+ * @attribute height+ * @type Number+ */+ height: {+ lazyAdd: false,++ getter: function() + {+ if(this._explicitHeight)+ {+ return this._explicitHeight; + }+ return this._calculatedHeight;+ },++ setter: function(val)+ {+ this._explicitHeight = val;+ return val;+ }+ },++ /**+ * Calculated value of an axis' width. By default, the value is used internally for vertical axes. If the `width` attribute is explicitly set, this value will be ignored.+ *+ * @attribute calculatedWidth+ * @type Number+ * @private+ */+ calculatedWidth: {+ getter: function()+ {+ return this._calculatedWidth;+ },++ setter: function(val)+ {+ this._calculatedWidth = val;+ return val;+ }+ },++ /**+ * Calculated value of an axis' height. By default, the value is used internally for horizontal axes. If the `height` attribute is explicitly set, this value will be ignored.+ *+ * @attribute calculatedHeight+ * @type Number+ * @private+ */+ calculatedHeight: {+ getter: function()+ {+ return this._calculatedHeight;+ },++ setter: function(val)+ {+ this._calculatedHeight = val;+ return val;+ }+ },++ /**+ * Difference betweend the first/last tick and edge of axis.+ *+ * @attribute edgeOffset+ * @type Number+ * @protected+ */+ edgeOffset: + {+ value: 0+ },++ /**+ * The graphic in which the axis line and ticks will be rendered.+ *+ * @attribute graphic+ * @type Graphic+ */+ graphic: {},+ + /**+ * @attribute path+ * @type Shape+ * @readOnly+ * @private+ */+ path: {+ readOnly: true,++ getter: function()+ {+ if(!this._path)+ {+ var graphic = this.get("graphic");+ if(graphic)+ {+ this._path = graphic.addShape({type:"path"});+ }+ }+ return this._path;+ }+ },++ /**+ * @attribute tickPath+ * @type Shape+ * @readOnly+ * @private+ */+ tickPath: {+ readOnly: true,++ getter: function()+ {+ if(!this._tickPath)+ {+ var graphic = this.get("graphic");+ if(graphic)+ {+ this._tickPath = graphic.addShape({type:"path"});+ }+ }+ return this._tickPath;+ }+ },+ + /**+ * Contains the contents of the axis. + *+ * @attribute node+ * @type HTMLElement+ */+ node: {},++ /**+ * Direction of the axis.+ *+ * @attribute position+ * @type String+ */+ position: {+ setter: function(val)+ {+ var layoutClass = this._layoutClasses[val];+ if(val && val != "none")+ {+ this._layout = new layoutClass();+ }+ return val;+ }+ },++ /**+ * Distance determined by the tick styles used to calculate the distance between the axis+ * line in relation to the top of the axis.+ *+ * @attribute topTickOffset+ * @type Number+ */+ topTickOffset: {+ value: 0+ },++ /**+ * Distance determined by the tick styles used to calculate the distance between the axis+ * line in relation to the bottom of the axis.+ *+ * @attribute bottomTickOffset+ * @type Number+ */+ bottomTickOffset: {+ value: 0+ },++ /**+ * Distance determined by the tick styles used to calculate the distance between the axis+ * line in relation to the left of the axis.+ *+ * @attribute leftTickOffset+ * @type Number+ */+ leftTickOffset: {+ value: 0+ },++ /**+ * Distance determined by the tick styles used to calculate the distance between the axis+ * line in relation to the right side of the axis.+ *+ * @attribute rightTickOffset+ * @type Number+ */+ rightTickOffset: {+ value: 0+ },+ + /**+ * Collection of labels used to render the axis.+ *+ * @attribute labels+ * @type Array+ */+ labels: {+ readOnly: true,+ getter: function()+ {+ return this._labels;+ }+ },++ /**+ * Collection of points used for placement of labels and ticks along the axis.+ *+ * @attribute tickPoints+ * @type Array+ */+ tickPoints: {+ readOnly: true,++ getter: function()+ {+ if(this.get("position") == "none")+ {+ return this.get("styles").majorUnit.count;+ }+ return this._tickPoints;+ }+ },++ /**+ * Indicates whether the axis overlaps the graph. If an axis is the inner most axis on a given+ * position and the tick position is inside or cross, the axis will need to overlap the graph.+ *+ * @attribute overlapGraph+ * @type Boolean+ */+ overlapGraph: {+ value:true,++ validator: function(val)+ {+ return Y_Lang.isBoolean(val);+ }+ },++ /**+ * Object which should have by the labelFunction+ *+ * @attribute labelFunctionScope+ * @type Object+ */+ labelFunctionScope: {},+ + /**+ * Length in pixels of largest text bounding box. Used to calculate the height of the axis.+ *+ * @attribute maxLabelSize+ * @type Number+ * @protected+ */+ maxLabelSize: {+ getter: function()+ {+ return this._maxLabelSize;+ },++ setter: function(val)+ {+ this._maxLabelSize = val;+ return val; + }+ },+ + /**+ * Title for the axis. When specified, the title will display. The position of the title is determined by the axis position. + * <dl>+ * <dt>top</dt><dd>Appears above the axis and it labels. The default rotation is 0.</dd>+ * <dt>right</dt><dd>Appears to the right of the axis and its labels. The default rotation is 90.</dd>+ * <dt>bottom</dt><dd>Appears below the axis and its labels. The default rotation is 0.</dd>+ * <dt>left</dt><dd>Appears to the left of the axis and its labels. The default rotation is -90.</dd>+ * </dl>+ *+ * @attribute title+ * @type String+ */+ title: {+ value: null+ },+ + /**+ * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need+ * to implement the arguments below and return a `String` or `HTMLElement`. + * <dl>+ * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>+ * <dt>format</dt><dd>Template for formatting label. (optional)</dd>+ * </dl>+ *+ * @attribute labelFunction+ * @type Function+ */+ labelFunction: {+ value: function(val, format)+ {+ return val;+ }+ },+ + /**+ * Function used to append an axis value to an axis label. This function has the following signature:+ * <dl>+ * <dt>textField</dt><dd>The axis label to be appended. (`HTMLElement`)</dd>+ * <dt>val</dt><dd>The value to attach to the text field. This method will accept an `HTMLELement`+ * or a `String`. This method does not use (`HTMLElement` | `String`)</dd>+ * </dl>+ * The default method appends a value to the `HTMLElement` using the `appendChild` method. If the given + * value is a `String`, the method will convert the the value to a `textNode` before appending to the + * `HTMLElement`. This method will not convert an `HTMLString` to an `HTMLElement`. + *+ * @attribute appendLabelFunction+ * @type Function+ */+ appendLabelFunction: {+ valueFn: function()+ {+ return this._setText;+ }+ },+ + /**+ * Function used to append a title value to the title object. This function has the following signature:+ * <dl>+ * <dt>textField</dt><dd>The title text field to be appended. (`HTMLElement`)</dd>+ * <dt>val</dt><dd>The value to attach to the text field. This method will accept an `HTMLELement`+ * or a `String`. This method does not use (`HTMLElement` | `String`)</dd>+ * </dl>+ * The default method appends a value to the `HTMLElement` using the `appendChild` method. If the given + * value is a `String`, the method will convert the the value to a `textNode` before appending to the + * `HTMLElement` element. This method will not convert an `HTMLString` to an `HTMLElement`. + *+ * @attribute appendTitleFunction+ * @type Function+ */+ appendTitleFunction: {+ valueFn: function()+ {+ return this._setText;+ }+ }+ + /**+ * Style properties used for drawing an axis. This attribute is inherited from `Renderer`. Below are the default values:+ * <dl>+ * <dt>majorTicks</dt><dd>Properties used for drawing ticks.+ * <dl>+ * <dt>display</dt><dd>Position of the tick. Possible values are `inside`, `outside`, `cross` and `none`. The+ * default value is `inside`.</dd>+ * <dt>length</dt><dd>The length (in pixels) of the tick. The default value is 4.</dd>+ * <dt>color</dt><dd>The color of the tick. The default value is `#dad8c9`</dd>+ * <dt>weight</dt><dd>Number indicating the width of the tick. The default value is 1.</dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the tick. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>line</dt><dd>Properties used for drawing the axis line. + * <dl>+ * <dt>weight</dt><dd>Number indicating the width of the axis line. The default value is 1.</dd>+ * <dt>color</dt><dd>The color of the axis line. The default value is `#dad8c9`.</dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the tick. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>majorUnit</dt><dd>Properties used to calculate the `majorUnit` for the axis. + * <dl>+ * <dt>determinant</dt><dd>The algorithm used for calculating distance between ticks. The possible options are `count` and `distance`. If+ * the `determinant` is `count`, the axis ticks will spaced so that a specified number of ticks appear on the axis. If the `determinant`+ * is `distance`, the axis ticks will spaced out according to the specified distance. The default value is `count`.</dd>+ * <dt>count</dt><dd>Number of ticks to appear on the axis when the `determinant` is `count`. The default value is 11.</dd>+ * <dt>distance</dt><dd>The distance (in pixels) between ticks when the `determinant` is `distance`. The default value is 75.</dd>+ * </dl>+ * </dd>+ * <dt>label</dt><dd>Properties and styles applied to the axis labels.+ * <dl>+ * <dt>color</dt><dd>The color of the labels. The default value is `#808080`.</dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 indicating the opacity of the labels. The default value is 1.</dd>+ * <dt>fontSize</dt><dd>The font-size of the labels. The default value is 85%</dd>+ * <dt>rotation</dt><dd>The rotation, in degrees (between -90 and 90) of the labels. The default value is 0.</dd>+ * <dt>margin</dt><dd>The distance between the label and the axis/tick. Depending on the position of the `Axis`, only one of the properties used.+ * <dl>+ * <dt>top</dt><dd>Pixel value used for an axis with a `position` of `bottom`. The default value is 4.</dd>+ * <dt>right</dt><dd>Pixel value used for an axis with a `position` of `left`. The default value is 4.</dd>+ * <dt>bottom</dt><dd>Pixel value used for an axis with a `position` of `top`. The default value is 4.</dd>+ * <dt>left</dt><dd>Pixel value used for an axis with a `position` of `right`. The default value is 4.</dd>+ * </dl>+ * </dd>+ * </dl>+ * </dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});+/**+ * AxisType is an abstract class that manages the data for an axis.+ *+ * @module charts+ * @submodule charts-base+ * @class AxisType+ * @constructor+ * @extends Axis+ */+Y.AxisType = Y.Base.create("baseAxis", Y.Axis, [], {+ /**+ * @method initializer+ * @private+ */+ initializer: function()+ {+ this.after("dataReady", Y.bind(this._dataChangeHandler, this));+ this.after("dataUpdate", Y.bind(this._dataChangeHandler, this));+ this.after("minimumChange", Y.bind(this._keyChangeHandler, this));+ this.after("maximumChange", Y.bind(this._keyChangeHandler, this));+ this.after("keysChange", this._keyChangeHandler);+ this.after("dataProviderChange", this._dataProviderChangeHandler);+ this.after("alwaysShowZeroChange", this._keyChangeHandler);+ this.after("roundingMethodChange", this._keyChangeHandler);+ },++ /**+ * @method bindUI+ * @private+ */+ bindUI: function()+ {+ this.after("stylesChange", this._updateHandler);+ this.after("overlapGraphChange", this._updateHandler);+ this.after("positionChange", this._positionChangeHandler);+ this.after("widthChange", this._handleSizeChange);+ this.after("heightChange", this._handleSizeChange);+ this.after("calculatedWidthChange", this._handleSizeChange);+ this.after("calculatedHeightChange", this._handleSizeChange);+ },++ /**+ * Handles changes to `dataProvider`.+ *+ * @method _dataProviderChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _dataProviderChangeHandler: function(e)+ {+ var keyCollection = this.get("keyCollection").concat(),+ keys = this.get("keys"),+ i;+ if(keys)+ {+ for(i in keys)+ {+ if(keys.hasOwnProperty(i))+ {+ delete keys[i];+ }+ }+ }+ if(keyCollection && keyCollection.length)+ {+ this.set("keys", keyCollection);+ }+ },++ /**+ * Constant used to generate unique id.+ *+ * @property GUID+ * @type String+ * @private+ */+ GUID: "yuibaseaxis",+ + /**+ * Type of data used in `Axis`.+ *+ * @property _type+ * @type String + * @readOnly+ * @private+ */+ _type: null,+ + /**+ * Storage for `setMaximum` attribute.+ *+ * @property _setMaximum+ * @type Object+ * @private+ */+ _setMaximum: null,+ + /**+ * Storage for `dataMaximum` attribute.+ *+ * @property _dataMaximum+ * @type Object+ * @private+ */+ _dataMaximum: null,+ + /**+ * Storage for `setMinimum` attribute.+ *+ * @property _setMinimum+ * @type Object+ * @private+ */+ _setMinimum: null,+ + /**+ * Reference to data array.+ *+ * @property _data+ * @type Array+ * @private+ */+ _data: null,++ /**+ * Indicates whether the all data is up to date.+ *+ * @property _updateTotalDataFlag+ * @type Boolean+ * @private+ */+ _updateTotalDataFlag: true,++ /**+ * Storage for `dataReady` attribute.+ *+ * @property _dataReady+ * @type Boolean+ * @readOnly+ * @private+ */+ _dataReady: false,+ + /**+ * Adds an array to the key hash.+ *+ * @method addKey+ * @param value Indicates what key to use in retrieving+ * the array.+ */+ addKey: function (value)+ {+ this.set("keys", value);+ },++ /**+ * Gets an array of values based on a key.+ *+ * @method _getKeyArray+ * @param {String} key Value key associated with the data array.+ * @param {Array} data Array in which the data resides.+ * @return Array+ * @private+ */+ _getKeyArray: function(key, data)+ {+ var i = 0,+ obj,+ keyArray = [],+ len = data.length;+ for(; i < len; ++i)+ {+ obj = data[i];+ keyArray[i] = obj[key];+ }+ return keyArray;+ },++ /**+ * Sets data by key+ *+ * @method _setDataByKey+ * @param {String} key Key value to use.+ * @param {Array} data Array to use.+ * @private + */+ _setDataByKey: function(key, data)+ {+ var i,+ obj, + arr = [], + dv = this._dataClone.concat(), + len = dv.length;+ for(i = 0; i < len; ++i)+ {+ obj = dv[i];+ arr[i] = obj[key];+ }+ this.get("keys")[key] = arr;+ this._updateTotalDataFlag = true;+ },++ /**+ * Updates the total data array.+ *+ * @method _updateTotalData+ * @private+ */+ _updateTotalData: function()+ {+ var keys = this.get("keys"),+ i;+ this._data = [];+ for(i in keys)+ {+ if(keys.hasOwnProperty(i))+ {+ this._data = this._data.concat(keys[i]);+ }+ }+ this._updateTotalDataFlag = false;+ },++ /**+ * Removes an array from the key hash.+ * + * @method removeKey+ * @param {String} value Indicates what key to use in removing from + * the hash.+ */+ removeKey: function(value)+ {+ var keys = this.get("keys");+ if(keys.hasOwnProperty(value)) + {+ delete keys[value];+ this._keyChangeHandler();+ }+ },++ /**+ * Returns a value based of a key value and an index.+ *+ * @method getKeyValueAt+ * @param {String} key value used to look up the correct array+ * @param {Number} index within the array+ * @return Number + */+ getKeyValueAt: function(key, index)+ {+ var value = NaN,+ keys = this.get("keys");+ if(keys[key] && Y_Lang.isNumber(parseFloat(keys[key][index])))+ {+ value = keys[key][index];+ }+ return parseFloat(value);+ },++ /**+ * Returns an array of values based on an identifier key.+ *+ * @method getDataByKey+ * @param {String} value value used to identify the array+ * @return Object+ */+ getDataByKey: function (value)+ {+ var keys = this.get("keys");+ if(keys[value])+ {+ return keys[value];+ }+ return null;+ },++ /**+ * Calculates the maximum and minimum values for the `Axis`.+ *+ * @method _updateMinAndMax+ * @private + */+ _updateMinAndMax: function() + {+ var data = this.get("data"),+ max = 0,+ min = 0,+ len,+ num,+ i;+ if(data && data.length && data.length > 0)+ {+ len = data.length;+ max = min = data[0];+ if(len > 1)+ {+ for(i = 1; i < len; i++)+ { + num = data[i];+ if(isNaN(num))+ {+ continue;+ }+ max = Math.max(num, max);+ min = Math.min(num, min);+ }+ }+ }+ this._dataMaximum = max;+ this._dataMinimum = min;+ },++ /**+ * Returns the total number of majorUnits that will appear on an axis.+ *+ * @method getTotalMajorUnits+ * @return Number+ */+ getTotalMajorUnits: function()+ {+ var units,+ majorUnit = this.get("styles").majorUnit,+ len = this.get("length");+ if(majorUnit.determinant === "count") + {+ units = majorUnit.count;+ }+ else if(majorUnit.determinant === "distance") + {+ units = (len/majorUnit.distance) + 1;+ }+ return units; + },++ /**+ * Returns the distance between major units on an axis.+ *+ * @method getMajorUnitDistance+ * @param {Number} len Number of ticks+ * @param {Number} uiLen Size of the axis.+ * @param {Object} majorUnit Hash of properties used to determine the majorUnit+ * @return Number+ */+ getMajorUnitDistance: function(len, uiLen, majorUnit)+ {+ var dist;+ if(majorUnit.determinant === "count")+ {+ dist = uiLen/(len - 1);+ }+ else if(majorUnit.determinant === "distance")+ {+ dist = majorUnit.distance;+ }+ return dist;+ },+ + /**+ * Gets the distance that the first and last ticks are offset from there respective+ * edges.+ *+ * @method getEdgeOffset+ * @param {Number} ct Number of ticks on the axis.+ * @param {Number} l Length (in pixels) of the axis.+ * @return Number+ */+ getEdgeOffset: function(ct, l)+ {+ return 0;+ },++ /**+ * Calculates and returns a value based on the number of labels and the index of+ * the current label.+ *+ * @method getLabelByIndex+ * @param {Number} i Index of the label.+ * @param {Number} l Total number of labels.+ * @return String+ */+ getLabelByIndex: function(i, l)+ {+ var min = this.get("minimum"),+ max = this.get("maximum"),+ increm = (max - min)/(l-1),+ label;+ l -= 1;+ label = min + (i * increm);+ return label;+ },++ /**+ * Updates the `Axis` after a change in keys.+ *+ * @method _keyChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _keyChangeHandler: function(e)+ {+ this._updateMinAndMax();+ this.fire("dataUpdate");+ },++ /**+ * Checks to see if data extends beyond the range of the axis. If so,+ * that data will need to be hidden. This method is internal, temporary and subject+ * to removal in the future.+ *+ * @method _hasDataOverflow+ * @protected+ * @return Boolean+ */+ _hasDataOverflow: function()+ {+ if(this.get("setMin") || this.get("setMax"))+ {+ return true;+ }+ return false;+ },++ /**+ * Returns a string corresponding to the first label on an + * axis.+ *+ * @method getMinimumValue+ * @return String+ */+ getMinimumValue: function()+ {+ return this.get("minimum");+ },++ /**+ * Returns a string corresponding to the last label on an + * axis.+ *+ * @method getMaximumValue+ * @return String+ */+ getMaximumValue: function()+ {+ return this.get("maximum");+ }+}, {+ ATTRS: {+ /**+ * Hash of array identifed by a string value.+ *+ * @attribute keys+ * @type Object+ */+ keys: {+ value: {},++ setter: function(val)+ {+ var keys = {},+ i, + len,+ data = this.get("dataProvider");+ if(Y_Lang.isArray(val))+ {+ len = val.length;+ for(i = 0; i < len; ++i)+ {+ keys[val[i]] = this._getKeyArray(val[i], data); + }+ + }+ else if(Y_Lang.isString(val))+ {+ keys = this.get("keys");+ keys[val] = this._getKeyArray(val, data);+ }+ else+ {+ for(i in val)+ {+ if(val.hasOwnProperty(i))+ {+ keys[i] = this._getKeyArray(i, data);+ }+ }+ }+ this._updateTotalDataFlag = true;+ return keys;+ }+ },++ /**+ *Indicates how to round unit values.+ * <dl>+ * <dt>niceNumber</dt><dd>Units will be smoothed based on the number of ticks and data range.</dd>+ * <dt>auto</dt><dd>If the range is greater than 1, the units will be rounded.</dd>+ * <dt>numeric value</dt><dd>Units will be equal to the numeric value.</dd>+ * <dt>null</dt><dd>No rounding will occur.</dd>+ * </dl>+ *+ * @attribute roundingMethod+ * @type String+ * @default niceNumber+ */+ roundingMethod: {+ value: "niceNumber"+ },++ /**+ *Returns the type of axis data+ * <dl>+ * <dt>time</dt><dd>Manages time data</dd>+ * <dt>stacked</dt><dd>Manages stacked numeric data</dd> + * <dt>numeric</dt><dd>Manages numeric data</dd>+ * <dt>category</dt><dd>Manages categorical data</dd>+ * </dl>+ *+ * @attribute type+ * @type String+ */+ type:+ {+ readOnly: true,++ getter: function ()+ {+ return this._type;+ }+ },++ /**+ * Instance of `ChartDataProvider` that the class uses+ * to build its own data.+ *+ * @attribute dataProvider+ * @type Array+ */+ dataProvider:{+ setter: function (value)+ {+ return value;+ }+ },++ /**+ * The maximum value contained in the `data` array. Used for+ * `maximum` when `autoMax` is true.+ *+ * @attribute dataMaximum+ * @type Number+ */+ dataMaximum: {+ getter: function ()+ {+ if(!this._dataMaximum)+ { + this._updateMinAndMax();+ }+ return this._dataMaximum;+ }+ },++ /**+ * The maximum value that will appear on an axis.+ *+ * @attribute maximum+ * @type Number+ */+ maximum: {+ lazyAdd: false,++ getter: function ()+ {+ var max = this.get("dataMaximum"),+ min = this.get("minimum");+ //If all values are zero, force a range so that the Axis and related series+ //will still render.+ if(min === 0 && max === 0)+ {+ max = 10;+ }+ if(Y_Lang.isNumber(this._setMaximum))+ {+ max = this._setMaximum;+ }+ return parseFloat(max);+ },+ setter: function (value)+ {+ this._setMaximum = parseFloat(value);+ return value;+ }+ },++ /**+ * The minimum value contained in the `data` array. Used for+ * `minimum` when `autoMin` is true.+ *+ * @attribute dataMinimum+ * @type Number+ */+ dataMinimum: {+ getter: function ()+ {+ if(!this._dataMinimum)+ {+ this._updateMinAndMax();+ }+ return this._dataMinimum;+ }+ },++ /**+ * The minimum value that will appear on an axis.+ *+ * @attribute minimum+ * @type Number+ */+ minimum: {+ lazyAdd: false,++ getter: function ()+ {+ var min = this.get("dataMinimum");+ if(Y_Lang.isNumber(this._setMinimum))+ {+ min = this._setMinimum;+ }+ return parseFloat(min);+ },+ setter: function(val)+ {+ this._setMinimum = parseFloat(val);+ return val;+ }+ },++ /**+ * Determines whether the maximum is calculated or explicitly + * set by the user.+ *+ * @attribute setMax+ * @type Boolean+ */+ setMax: {+ readOnly: true,++ getter: function()+ {+ return Y_Lang.isNumber(this._setMaximum);+ }+ },++ /**+ * Determines whether the minimum is calculated or explicitly+ * set by the user.+ *+ * @attribute setMin+ * @type Boolean+ */+ setMin: {+ readOnly: true,++ getter: function()+ {+ return Y_Lang.isNumber(this._setMinimum);+ }+ },++ /**+ * Array of axis data+ *+ * @attribute data+ * @type Array+ */+ data: {+ getter: function ()+ {+ if(!this._data || this._updateTotalDataFlag)+ {+ this._updateTotalData();+ }+ return this._data;+ }+ },++ /**+ * Array containing all the keys in the axis.+ + * @attribute keyCollection+ * @type Array+ */+ keyCollection: {+ getter: function()+ {+ var keys = this.get("keys"),+ i, + col = [];+ for(i in keys)+ {+ if(keys.hasOwnProperty(i))+ {+ col.push(i);+ }+ }+ return col;+ },+ readOnly: true+ }+ }+});+/**+ * NumericAxis manages numeric data on an axis.+ *+ * @module charts+ * @submodule charts-base+ * @class NumericAxis+ * @constructor+ * @param {Object} config (optional) Configuration parameters for the Chart.+ * @extends AxisType+ */+function NumericAxis(config)+{+ NumericAxis.superclass.constructor.apply(this, arguments);+}++NumericAxis.NAME = "numericAxis";++NumericAxis.ATTRS = {+ /**+ * Indicates whether 0 should always be displayed.+ *+ * @attribute alwaysShowZero+ * @type Boolean+ */+ alwaysShowZero: {+ value: true + },+ + /**+ * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need+ * to implement the arguments below and return a `String` or an `HTMLElement`. The default implementation of the method returns a `String`. The output of this method+ * will be rendered to the DOM using `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override the Axis' + * `appendLabelFunction` to accept html as a `String`.+ * <dl>+ * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>+ * <dt>format</dt><dd>Object containing properties used to format the label. (optional)</dd>+ * </dl>+ *+ * @attribute labelFunction+ * @type Function+ */+ labelFunction: { + value: function(val, format)+ {+ if(format)+ {+ return Y.DataType.Number.format(val, format);+ }+ return val;+ }+ },++ /**+ * Object containing properties used by the `labelFunction` to format a+ * label.+ *+ * @attribute labelFormat+ * @type Object+ */+ labelFormat: {+ value: {+ prefix: "",+ thousandsSeparator: "",+ decimalSeparator: "",+ decimalPlaces: "0",+ suffix: ""+ }+ }+};++Y.extend(NumericAxis, Y.AxisType,+{+ /**+ * Formats a label based on the axis type and optionally specified format.+ *+ * @method formatLabel+ * @param {Object} value+ * @param {Object} format Pattern used to format the value.+ * @return String+ */+ formatLabel: function(val, format)+ {+ if(format)+ {+ return Y.DataType.Number.format(val, format);+ }+ return val;+ },++ /**+ * Returns the sum of all values per key.+ *+ * @method getTotalByKey+ * @param {String} key The identifier for the array whose values will be calculated.+ * @return Number+ */+ getTotalByKey: function(key)+ {+ var total = 0,+ values = this.getDataByKey(key),+ i = 0,+ val,+ len = values ? values.length : 0;+ for(; i < len; ++i)+ {+ val = parseFloat(values[i]);+ if(!isNaN(val))+ {+ total += val;+ }+ }+ return total;+ },++ /**+ * Type of data used in `Axis`.+ *+ * @property _type+ * @readOnly+ * @private+ */+ _type: "numeric",++ /**+ * Helper method for getting a `roundingUnit` when calculating the minimum and maximum values.+ *+ * @method _getMinimumUnit+ * @param {Number} max Maximum number+ * @param {Number} min Minimum number+ * @param {Number} units Number of units on the axis+ * @return Number+ * @private+ */+ _getMinimumUnit:function(max, min, units)+ {+ return this._getNiceNumber(Math.ceil((max - min)/units));+ },++ /**+ * Calculates a nice rounding unit based on the range.+ *+ * @method _getNiceNumber+ * @param {Number} roundingUnit The calculated rounding unit.+ * @return Number+ * @private+ */+ _getNiceNumber: function(roundingUnit)+ {+ var tempMajorUnit = roundingUnit,+ order = Math.ceil(Math.log(tempMajorUnit) * 0.4342944819032518),+ roundedMajorUnit = Math.pow(10, order),+ roundedDiff;++ if (roundedMajorUnit / 2 >= tempMajorUnit) + {+ roundedDiff = Math.floor((roundedMajorUnit / 2 - tempMajorUnit) / (Math.pow(10,order-1)/2));+ tempMajorUnit = roundedMajorUnit/2 - roundedDiff*Math.pow(10,order-1)/2;+ }+ else + {+ tempMajorUnit = roundedMajorUnit;+ }+ if(!isNaN(tempMajorUnit))+ {+ return tempMajorUnit;+ }+ return roundingUnit;++ },++ /**+ * Calculates the maximum and minimum values for the `Axis`.+ *+ * @method _updateMinAndMax+ * @private + */+ _updateMinAndMax: function()+ {+ var data = this.get("data"),+ max, + min,+ len,+ num,+ i = 0,+ key,+ setMax = this.get("setMax"),+ setMin = this.get("setMin");+ if(!setMax || !setMin)+ {+ if(data && data.length && data.length > 0)+ {+ len = data.length;+ for(; i < len; i++)+ { + num = data[i];+ if(isNaN(num))+ {+ if(Y_Lang.isObject(num))+ {+ min = max = 0;+ //hloc values+ for(key in num)+ {+ if(num.hasOwnProperty(key))+ {+ max = Math.max(num[key], max);+ min = Math.min(num[key], min);+ }+ }+ }+ max = setMax ? this._setMaximum : max;+ min = setMin ? this._setMinimum : min;+ continue;+ }+ + if(setMin)+ {+ min = this._setMinimum;+ }+ else if(min === undefined)+ {+ min = num;+ }+ else+ {+ min = Math.min(num, min); + }+ if(setMax)+ {+ max = this._setMaximum;+ }+ else if(max === undefined)+ {+ max = num;+ }+ else+ {+ max = Math.max(num, max);+ }+ + this._actualMaximum = max;+ this._actualMinimum = min;+ }+ }+ this._roundMinAndMax(min, max, setMin, setMax);+ }+ },++ /**+ * Rounds the mimimum and maximum values based on the `roundingUnit` attribute.+ *+ * @method _roundMinAndMax+ * @param {Number} min Minimum value+ * @param {Number} max Maximum value+ * @private+ */+ _roundMinAndMax: function(min, max, setMin, setMax)+ {+ var roundingUnit,+ minimumRange,+ minGreaterThanZero = min >= 0,+ maxGreaterThanZero = max > 0,+ dataRangeGreater,+ maxRound,+ minRound,+ topTicks,+ botTicks,+ tempMax,+ tempMin,+ units = this.getTotalMajorUnits() - 1,+ alwaysShowZero = this.get("alwaysShowZero"),+ roundingMethod = this.get("roundingMethod"),+ useIntegers = (max - min)/units >= 1;+ if(roundingMethod)+ {+ if(roundingMethod == "niceNumber")+ {+ roundingUnit = this._getMinimumUnit(max, min, units);+ if(minGreaterThanZero && maxGreaterThanZero)+ {+ if((alwaysShowZero || min < roundingUnit) && !setMin)+ {+ min = 0;+ roundingUnit = this._getMinimumUnit(max, min, units);+ }+ else+ {+ min = this._roundDownToNearest(min, roundingUnit);+ }+ if(setMax)+ {+ if(!alwaysShowZero)+ {+ min = max - (roundingUnit * units);+ }+ }+ else if(setMin)+ {+ max = min + (roundingUnit * units);+ }+ else+ {+ max = this._roundUpToNearest(max, roundingUnit);+ }+ }+ else if(maxGreaterThanZero && !minGreaterThanZero)+ {+ if(alwaysShowZero)+ {+ topTicks = Math.round(units/((-1 * min)/max + 1));+ topTicks = Math.max(Math.min(topTicks, units - 1), 1);+ botTicks = units - topTicks;+ tempMax = Math.ceil( max/topTicks );+ tempMin = Math.floor( min/botTicks ) * -1;+ + if(setMin)+ {+ while(tempMin < tempMax && botTicks >= 0)+ {+ botTicks--;+ topTicks++;+ tempMax = Math.ceil( max/topTicks );+ tempMin = Math.floor( min/botTicks ) * -1;+ }+ //if there are any bottom ticks left calcualate the maximum by multiplying by the tempMin value+ //if not, it's impossible to ensure that a zero is shown. skip it+ if(botTicks > 0)+ {+ max = tempMin * topTicks;+ }+ else+ {+ max = min + (roundingUnit * units);+ }+ }+ else if(setMax)+ {+ while(tempMax < tempMin && topTicks >= 0)+ {+ botTicks++;+ topTicks--;+ tempMin = Math.floor( min/botTicks ) * -1;+ tempMax = Math.ceil( max/topTicks );+ }+ //if there are any top ticks left calcualate the minimum by multiplying by the tempMax value+ //if not, it's impossible to ensure that a zero is shown. skip it+ if(topTicks > 0)+ {+ min = tempMax * botTicks * -1;+ }+ else+ {+ min = max - (roundingUnit * units);+ }+ }+ else+ {+ roundingUnit = Math.max(tempMax, tempMin);+ roundingUnit = this._getNiceNumber(roundingUnit); + max = roundingUnit * topTicks;+ min = roundingUnit * botTicks * -1;+ }+ }+ else + {+ if(setMax)+ {+ min = max - (roundingUnit * units);+ }+ else if(setMin)+ {+ max = min + (roundingUnit * units);+ }+ else+ {+ min = this._roundDownToNearest(min, roundingUnit);+ max = this._roundUpToNearest(max, roundingUnit);+ }+ }+ }+ else+ {+ if(setMin)+ {+ if(alwaysShowZero)+ {+ max = 0;+ }+ else+ {+ max = min + (roundingUnit * units);+ }+ }+ else if(!setMax)+ {+ if(alwaysShowZero || max === 0 || max + roundingUnit > 0)+ {+ max = 0;+ roundingUnit = this._getMinimumUnit(max, min, units);+ min = max - (roundingUnit * units);+ }+ else+ {+ min = this._roundDownToNearest(min, roundingUnit);+ max = this._roundUpToNearest(max, roundingUnit);+ }+ }+ else+ {+ min = max - (roundingUnit * units);+ }+ }+ }+ else if(roundingMethod == "auto") + {+ if(minGreaterThanZero && maxGreaterThanZero)+ {+ if((alwaysShowZero || min < (max-min)/units) && !setMin)+ {+ min = 0;+ }+ + roundingUnit = (max - min)/units;+ if(useIntegers)+ {+ roundingUnit = Math.ceil(roundingUnit);+ }+ max = min + (roundingUnit * units);+ }+ else if(maxGreaterThanZero && !minGreaterThanZero)+ {+ if(alwaysShowZero)+ {+ topTicks = Math.round( units / ( (-1 * min) /max + 1) );+ topTicks = Math.max(Math.min(topTicks, units - 1), 1);+ botTicks = units - topTicks;++ if(useIntegers)+ {+ tempMax = Math.ceil( max/topTicks );+ tempMin = Math.floor( min/botTicks ) * -1;+ }+ else+ {+ tempMax = max/topTicks;+ tempMin = min/botTicks * -1;+ }+ roundingUnit = Math.max(tempMax, tempMin);+ max = roundingUnit * topTicks;+ min = roundingUnit * botTicks * -1;+ }+ else+ {+ roundingUnit = (max - min)/units;+ if(useIntegers)+ {+ roundingUnit = Math.ceil(roundingUnit);+ }+ min = this._roundDownToNearest(min, roundingUnit);+ max = this._roundUpToNearest(max, roundingUnit);+ }+ }+ else+ {+ roundingUnit = (max - min)/units;+ if(useIntegers)+ { + roundingUnit = Math.ceil(roundingUnit);+ }+ if(alwaysShowZero || max === 0 || max + roundingUnit > 0)+ {+ max = 0;+ roundingUnit = (max - min)/units;+ if(useIntegers)+ {+ Math.ceil(roundingUnit);+ }+ min = max - (roundingUnit * units);+ }+ else+ {+ min = this._roundDownToNearest(min, roundingUnit);+ max = this._roundUpToNearest(max, roundingUnit);+ }++ }+ }+ else if(!isNaN(roundingMethod) && isFinite(roundingMethod))+ {+ roundingUnit = roundingMethod;+ minimumRange = roundingUnit * units;+ dataRangeGreater = (max - min) > minimumRange;+ minRound = this._roundDownToNearest(min, roundingUnit);+ maxRound = this._roundUpToNearest(max, roundingUnit);+ if(setMax)+ {+ min = max - minimumRange;+ }+ else if(setMin)+ {+ max = min + minimumRange;+ }+ else if(minGreaterThanZero && maxGreaterThanZero)+ {+ if(alwaysShowZero || minRound <= 0)+ {+ min = 0;+ }+ else+ {+ min = minRound;+ }+ max = min + minimumRange;+ }+ else if(maxGreaterThanZero && !minGreaterThanZero)+ {+ min = minRound;+ max = maxRound;+ }+ else+ {+ if(alwaysShowZero || maxRound >= 0)+ {+ max = 0;+ }+ else+ {+ max = maxRound;+ }+ min = max - minimumRange;+ }+ }+ }+ this._dataMaximum = max;+ this._dataMinimum = min;+ },++ /**+ * Calculates and returns a value based on the number of labels and the index of+ * the current label.+ *+ * @method getLabelByIndex+ * @param {Number} i Index of the label.+ * @param {Number} l Total number of labels.+ * @return String+ */+ getLabelByIndex: function(i, l)+ {+ var min = this.get("minimum"),+ max = this.get("maximum"),+ increm = (max - min)/(l-1),+ label,+ roundingMethod = this.get("roundingMethod");+ l -= 1;+ //respect the min and max. calculate all other labels.+ if(i === 0)+ {+ label = min;+ }+ else if(i === l)+ {+ label = max;+ }+ else+ {+ label = (i * increm);+ if(roundingMethod == "niceNumber")+ {+ label = this._roundToNearest(label, increm);+ }+ label += min;+ }+ return parseFloat(label);+ },++ /**+ * Rounds a Number to the nearest multiple of an input. For example, by rounding+ * 16 to the nearest 10, you will receive 20. Similar to the built-in function Math.round().+ *+ * @method _roundToNearest+ * @param {Number} number Number to round+ * @param {Number} nearest Multiple to round towards.+ * @return Number+ * @private+ */+ _roundToNearest: function(number, nearest)+ {+ nearest = nearest || 1;+ if(nearest === 0)+ {+ return number;+ }+ var roundedNumber = Math.round(this._roundToPrecision(number / nearest, 10)) * nearest;+ return this._roundToPrecision(roundedNumber, 10);+ },+ + /**+ * Rounds a Number up to the nearest multiple of an input. For example, by rounding+ * 16 up to the nearest 10, you will receive 20. Similar to the built-in function Math.ceil().+ *+ * @method _roundUpToNearest+ * @param {Number} number Number to round+ * @param {Number} nearest Multiple to round towards.+ * @return Number+ * @private+ */+ _roundUpToNearest: function(number, nearest)+ {+ nearest = nearest || 1;+ if(nearest === 0)+ {+ return number;+ }+ return Math.ceil(this._roundToPrecision(number / nearest, 10)) * nearest;+ },+ + /**+ * Rounds a Number down to the nearest multiple of an input. For example, by rounding+ * 16 down to the nearest 10, you will receive 10. Similar to the built-in function Math.floor().+ *+ * @method _roundDownToNearest+ * @param {Number} number Number to round+ * @param {Number} nearest Multiple to round towards.+ * @return Number+ * @private+ */+ _roundDownToNearest: function(number, nearest)+ {+ nearest = nearest || 1;+ if(nearest === 0)+ {+ return number;+ }+ return Math.floor(this._roundToPrecision(number / nearest, 10)) * nearest;+ },++ /**+ * Rounds a number to a certain level of precision. Useful for limiting the number of+ * decimal places on a fractional number.+ *+ * @method _roundToPrecision+ * @param {Number} number Number to round+ * @param {Number} precision Multiple to round towards.+ * @return Number+ * @private+ */+ _roundToPrecision: function(number, precision)+ {+ precision = precision || 0;+ var decimalPlaces = Math.pow(10, precision);+ return Math.round(decimalPlaces * number) / decimalPlaces;+ },+ + /**+ * Checks to see if data extends beyond the range of the axis. If so,+ * that data will need to be hidden. This method is internal, temporary and subject+ * to removal in the future.+ *+ * @method _hasDataOverflow+ * @protected+ * @return Boolean+ */+ _hasDataOverflow: function()+ {+ var roundingMethod,+ min,+ max;+ if(this.get("setMin") || this.get("setMax"))+ {+ return true;+ }+ roundingMethod = this.get("roundingMethod");+ min = this._actualMinimum;+ max = this._actualMaximum;+ if(Y_Lang.isNumber(roundingMethod) && ((Y_Lang.isNumber(max) && max > this._dataMaximum) || (Y_Lang.isNumber(min) && min < this._dataMinimum)))+ {+ return true;+ }+ return false;+ }+});++Y.NumericAxis = NumericAxis;+ +/**+ * StackedAxis manages stacked numeric data on an axis.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedAxis+ * @constructor+ * @param {Object} config (optional) Configuration parameters for the Chart.+ * @extends NumericAxis+ */+function StackedAxis(config)+{+ StackedAxis.superclass.constructor.apply(this, arguments);+}++StackedAxis.NAME = "stackedAxis";+++Y.extend(StackedAxis, Y.NumericAxis,+{+ /**+ * Calculates the maximum and minimum values for the `Axis`.+ *+ * @method _updateMinAndMax+ * @private + */+ _updateMinAndMax: function()+ {+ var max = 0,+ min = 0,+ pos = 0,+ neg = 0,+ len = 0,+ i = 0,+ key,+ num,+ keys = this.get("keys"),+ setMin = this.get("setMin"),+ setMax = this.get("setMax");++ for(key in keys)+ {+ if(keys.hasOwnProperty(key))+ {+ len = Math.max(len, keys[key].length);+ }+ }+ for(; i < len; ++i)+ {+ pos = 0;+ neg = 0;+ for(key in keys)+ {+ if(keys.hasOwnProperty(key))+ {+ num = keys[key][i];+ if(isNaN(num))+ {+ continue;+ }+ if(num >= 0)+ {+ pos += num;+ }+ else+ {+ neg += num;+ }+ }+ }+ if(pos > 0)+ {+ max = Math.max(max, pos);+ }+ else + {+ max = Math.max(max, neg);+ }+ if(neg < 0)+ {+ min = Math.min(min, neg);+ }+ else+ {+ min = Math.min(min, pos);+ }+ }+ this._actualMaximum = max;+ this._actualMinimum = min;+ if(setMax)+ {+ max = this._setMaximum;+ }+ if(setMin)+ {+ min = this._setMinimum;+ }+ this._roundMinAndMax(min, max, setMin, setMax);+ }+});++Y.StackedAxis = StackedAxis;+ +/**+ * TimeAxis manages time data on an axis.+ *+ * @module charts+ * @submodule charts-base+ * @class TimeAxis+ * @constructor+ * @param {Object} config (optional) Configuration parameters for the Chart.+ * @extends AxisType+ */+function TimeAxis(config)+{+ TimeAxis.superclass.constructor.apply(this, arguments);+}++TimeAxis.NAME = "timeAxis";++TimeAxis.ATTRS = +{+ /**+ * Indicates whether the maximum is calculated or explicitly set. + *+ * @attribute setMax+ * @readOnly+ * @type Boolean+ * @private+ */+ setMax: {+ readOnly: true,++ getter: function()+ {+ var max = this._getNumber(this._setMaximum);+ return (Y_Lang.isNumber(max));+ }+ },++ /**+ * Indicates whether the minimum is calculated or explicitly set. + *+ * @attribute setMin+ * @readOnly+ * @type Boolean+ * @private+ */+ setMin: {+ readOnly: true,++ getter: function()+ {+ var min = this._getNumber(this._setMinimum);+ return (Y_Lang.isNumber(min));+ }+ },++ /**+ * The maximum value that will appear on an axis. Unless explicitly set, this value is calculated by the `Axis`.+ *+ * @attribute maximum+ * @type Number+ */+ maximum: {+ getter: function ()+ {+ var max = this._getNumber(this._setMaximum);+ if(!Y_Lang.isNumber(max))+ {+ max = this._getNumber(this.get("dataMaximum"));+ }+ return parseFloat(max);+ },+ setter: function (value)+ {+ this._setMaximum = this._getNumber(value);+ return value;+ }+ },++ /**+ * The minimum value that will appear on an axis. Unless explicitly set, this value is calculated by the `Axis`.+ *+ * @attribute minimum+ * @type Number+ */+ minimum: {+ getter: function ()+ {+ var min = this._getNumber(this._setMinimum);+ if(!Y_Lang.isNumber(min)) + {+ min = this._getNumber(this.get("dataMinimum"));+ }+ return parseFloat(min);+ },+ setter: function (value)+ {+ this._setMinimum = this._getNumber(value);+ return value;+ }+ },++ /**+ * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need+ * to implement the arguments below and return a `String` or an `HTMLElement`. The default implementation of the method returns a `String`. The output of this method+ * will be rendered to the DOM using `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override the Axis' + * `appendLabelFunction` to accept html as a `String`.+ * <dl>+ * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>+ * <dt>format</dt><dd>STRFTime string used to format the label. (optional)</dd>+ * </dl>+ *+ * @attribute labelFunction+ * @type Function+ */+ labelFunction: {+ value: function(val, format)+ {+ val = Y.DataType.Date.parse(val);+ if(format)+ {+ return Y.DataType.Date.format(val, {format:format});+ }+ return val;+ }+ },++ /**+ * Pattern used by the `labelFunction` to format a label.+ *+ * @attribute labelFormat+ * @type String+ */+ labelFormat: {+ value: "%b %d, %y"+ }+};++Y.extend(TimeAxis, Y.AxisType, {+ /**+ * Formats a label based on the axis type and optionally specified format.+ *+ * @method formatLabel+ * @param {Object} value+ * @param {Object} format Pattern used to format the value.+ * @return String+ */+ formatLabel: function(val, format)+ {+ val = Y.DataType.Date.parse(val);+ if(format)+ {+ return Y.DataType.Date.format(val, {format:format});+ }+ return val;+ },++ /**+ * Constant used to generate unique id.+ *+ * @property GUID+ * @type String+ * @private+ */+ GUID: "yuitimeaxis",+ + /**+ * Type of data used in `Axis`.+ *+ * @property _dataType+ * @readOnly+ * @private+ */+ _dataType: "time",+ + /**+ * Calculates and returns a value based on the number of labels and the index of+ * the current label.+ *+ * @method getLabelByIndex+ * @param {Number} i Index of the label.+ * @param {Number} l Total number of labels.+ * @return String+ */+ getLabelByIndex: function(i, l)+ {+ var min = this.get("minimum"),+ max = this.get("maximum"),+ position = this.get("position"),+ increm,+ label;+ l -= 1;+ increm = ((max - min)/l) * i;+ if(position == "bottom" || position == "top")+ {+ label = min + increm;+ }+ else+ {+ label = max - increm;+ }+ return label;+ },++ /**+ * Gets an array of values based on a key.+ *+ * @method _getKeyArray+ * @param {String} key Value key associated with the data array.+ * @param {Array} data Array in which the data resides.+ * @return Array+ * @private+ */+ _getKeyArray: function(key, data)+ {+ var obj,+ keyArray = [],+ i = 0,+ val,+ len = data.length;+ for(; i < len; ++i)+ {+ obj = data[i][key];+ if(Y_Lang.isDate(obj))+ { + val = obj.valueOf();+ }+ else+ {+ val = new Date(obj);+ if(Y_Lang.isDate(val))+ {+ val = val.valueOf();+ }+ else if(!Y_Lang.isNumber(obj))+ {+ if(Y_Lang.isNumber(parseFloat(obj)))+ {+ val = parseFloat(obj);+ }+ else+ {+ if(typeof obj != "string")+ {+ obj = obj;+ }+ val = new Date(obj).valueOf();+ }+ }+ else+ {+ val = obj;+ }+ }+ keyArray[i] = val;+ }+ return keyArray;+ },++ /**+ * Sets data by key+ *+ * @method _setDataByKey+ * @param {String} key Key value to use.+ * @param {Array} data Array to use.+ * @private + */+ _setDataByKey: function(key, data)+ {+ var obj, + arr = [], + dv = this._dataClone.concat(), + i, + val,+ len = dv.length;+ for(i = 0; i < len; ++i)+ {+ obj = dv[i][key];+ if(Y_Lang.isDate(obj))+ { + val = obj.valueOf();+ }+ else+ {+ val = new Date(obj);+ if(Y_Lang.isDate(val))+ {+ val = val.valueOf();+ }+ else if(!Y_Lang.isNumber(obj))+ {+ if(Y_Lang.isNumber(parseFloat(obj)))+ {+ val = parseFloat(obj);+ }+ else+ {+ if(typeof obj != "string")+ {+ obj = obj.toString();+ }+ val = new Date(obj).valueOf();+ }+ }+ else+ {+ val = obj;+ }+ }+ arr[i] = val;+ }+ this.get("keys")[key] = arr;+ this._updateTotalDataFlag = true;+ },++ /**+ * Parses value into a number.+ *+ * @method _getNumber+ * @param val {Object} Value to parse into a number+ * @return Number+ * @private+ */+ _getNumber: function(val)+ {+ if(Y_Lang.isDate(val))+ {+ val = val.valueOf();+ }+ else if(!Y_Lang.isNumber(val) && val)+ {+ val = new Date(val).valueOf();+ }++ return val;+ }+});++Y.TimeAxis = TimeAxis;+ +/**+ * CategoryAxis manages category data on an axis.+ *+ * @module charts+ * @submodule charts-base+ * @class CategoryAxis+ * @constructor+ * @param {Object} config (optional) Configuration parameters for the Chart.+ * @extends AxisType+ */+function CategoryAxis(config)+{+ CategoryAxis.superclass.constructor.apply(this, arguments);+}++CategoryAxis.NAME = "categoryAxis";++Y.extend(CategoryAxis, Y.AxisType,+{+ /**+ * Formats a label based on the axis type and optionally specified format.+ *+ * @method formatLabel+ * @param {Object} value+ * @param {Object} format Pattern used to format the value.+ * @return String+ */+ formatLabel: function(val, format)+ {+ return val;+ },++ /**+ * Object storing key data.+ *+ * @property _indices+ * @private+ */+ _indices: null,++ /**+ * Constant used to generate unique id.+ *+ * @property GUID+ * @type String+ * @private+ */+ GUID: "yuicategoryaxis",++ /**+ * Type of data used in `Axis`.+ *+ * @property _dataType+ * @readOnly+ * @private+ */+ _type: "category",+ + /**+ * Calculates the maximum and minimum values for the `Axis`.+ *+ * @method _updateMinAndMax+ * @private + */+ _updateMinAndMax: function()+ {+ this._dataMaximum = Math.max(this.get("data").length - 1, 0);+ this._dataMinimum = 0;+ },++ /**+ * Gets an array of values based on a key.+ *+ * @method _getKeyArray+ * @param {String} key Value key associated with the data array.+ * @param {Array} data Array in which the data resides.+ * @return Array+ * @private+ */+ _getKeyArray: function(key, data)+ {+ var i = 0,+ obj,+ keyArr = [],+ labels = [],+ len = data.length;+ if(!this._indices)+ {+ this._indices = {};+ }+ for(; i < len; ++i)+ {+ obj = data[i];+ keyArr[i] = i;+ labels[i] = obj[key];+ }+ this._indices[key] = keyArr;+ return labels;+ },++ /**+ * Sets data by key+ *+ * @method _setDataByKey+ * @param {String} key Key value to use.+ * @param {Array} data Array to use.+ * @private + */+ _setDataByKey: function(key)+ {+ var i,+ obj, + arr = [], + labels = [], + dv = this._dataClone.concat(), + len = dv.length;+ if(!this._indices)+ {+ this._indices = {};+ }+ for(i = 0; i < len; ++i)+ {+ obj = dv[i];+ arr[i] = i;+ labels[i] = obj[key];+ }+ this._indices[key] = arr;+ this.get("keys")[key] = labels.concat();+ this._updateTotalDataFlag = true;+ },++ /**+ * Returns an array of values based on an identifier key.+ *+ * @method getDataByKey+ * @param {String} value value used to identify the array+ * @return Array+ */+ getDataByKey: function (value)+ {+ if(!this._indices)+ {+ this.get("keys");+ }+ var keys = this._indices;+ if(keys[value])+ {+ return keys[value];+ }+ return null;+ },++ /**+ * Returns the total number of majorUnits that will appear on an axis.+ *+ * @method getTotalMajorUnits+ * @param {Object} majorUnit Object containing properties related to the majorUnit.+ * @param {Number} len Length of the axis.+ * @return Number+ */+ getTotalMajorUnits: function(majorUnit, len)+ {+ return this.get("data").length;+ },+ + /**+ * Returns the distance between major units on an axis.+ *+ * @method getMajorUnitDistance+ * @param {Number} len Number of ticks+ * @param {Number} uiLen Size of the axis.+ * @param {Object} majorUnit Hash of properties used to determine the majorUnit+ * @return Number+ */+ getMajorUnitDistance: function(len, uiLen, majorUnit)+ {+ var dist;+ if(majorUnit.determinant === "count")+ {+ dist = uiLen/len;+ }+ else if(majorUnit.determinant === "distance")+ {+ dist = majorUnit.distance;+ }+ return dist;+ },+ + /**+ * Gets the distance that the first and last ticks are offset from there respective+ * edges.+ *+ * @method getEdgeOffset+ * @param {Number} ct Number of ticks on the axis.+ * @param {Number} l Length (in pixels) of the axis.+ * @return Number+ */+ getEdgeOffset: function(ct, l)+ {+ return l/ct;+ },++ /**+ * Returns a value based of a key value and an index.+ *+ * @method getKeyValueAt+ * @param {String} key value used to look up the correct array+ * @param {Number} index within the array+ * @return String + */+ getKeyValueAt: function(key, index)+ {+ var value = NaN,+ keys = this.get("keys");+ if(keys[key] && keys[key][index]) + {+ value = keys[key][index];+ }+ return value;+ },+ + /**+ * Calculates and returns a value based on the number of labels and the index of+ * the current label.+ *+ * @method getLabelByIndex+ * @param {Number} i Index of the label.+ * @param {Number} l Total number of labels.+ * @return String+ */+ getLabelByIndex: function(i, l)+ {+ var label,+ data = this.get("data"),+ position = this.get("position");+ if(position == "bottom" || position == "top")+ {+ label = data[i];+ }+ else+ {+ label = data[l - (i + 1)];+ } + return label;+ },++ /**+ * Returns a string corresponding to the first label on an + * axis.+ *+ * @method getMinimumValue+ * @return String+ */+ getMinimumValue: function()+ {+ var data = this.get("data"),+ label = data[0];+ return label;+ },++ /**+ * Returns a string corresponding to the last label on an + * axis.+ *+ * @method getMaximumValue+ * @return String+ */+ getMaximumValue: function()+ {+ var data = this.get("data"),+ len = data.length - 1,+ label = data[len];+ return label;+ }+});++Y.CategoryAxis = CategoryAxis;+ +/**+ * Utility class used for calculating curve points.+ *+ * @module charts+ * @submodule charts-base+ * @class CurveUtil+ * @constructor+ */+function CurveUtil()+{+}++CurveUtil.prototype = {+ /**+ * Creates an array of start, end and control points for splines.+ *+ * @method getCurveControlPoints+ * @param {Array} xcoords Collection of x-coordinates used for calculate the curves+ * @param {Array} ycoords Collection of y-coordinates used for calculate the curves+ * @return Object+ * @protected+ */+ getCurveControlPoints: function(xcoords, ycoords) + {+ var outpoints = [],+ i = 1,+ l = xcoords.length - 1,+ xvals = [],+ yvals = [];+ + + // Too few points, need at least two+ if (l < 1) + {+ return null;+ } + + outpoints[0] = {+ startx: xcoords[0], + starty: ycoords[0],+ endx: xcoords[1],+ endy: ycoords[1]+ };+ + // Special case, the Bezier should be a straight line+ if (l === 1) + {+ outpoints[0].ctrlx1 = (2.0*xcoords[0] + xcoords[1])/3.0; + outpoints[0].ctrly2 = (2.0*ycoords[0] + ycoords[1])/3.0;+ outpoints[0].ctrlx2 = 2.0*outpoints[0].ctrlx1 - xcoords[0];+ outpoints[0].ctrly2 = 2.0*outpoints[0].ctrly1 - ycoords[0];+ return outpoints;+ }++ for (; i < l; ++i) + {+ outpoints.push({startx: Math.round(xcoords[i]), starty: Math.round(ycoords[i]), endx: Math.round(xcoords[i+1]), endy: Math.round(ycoords[i+1])});+ xvals[i] = 4.0 * xcoords[i] + 2*xcoords[i+1];+ yvals[i] = 4.0*ycoords[i] + 2*ycoords[i+1];+ }+ + xvals[0] = xcoords[0] + (2.0 * xcoords[1]);+ xvals[l-1] = (8.0 * xcoords[l-1] + xcoords[l]) / 2.0;+ xvals = this.getControlPoints(xvals.concat());+ yvals[0] = ycoords[0] + (2.0 * ycoords[1]);+ yvals[l-1] = (8.0 * ycoords[l-1] + ycoords[l]) / 2.0; + yvals = this.getControlPoints(yvals.concat());+ + for (i = 0; i < l; ++i) + {+ outpoints[i].ctrlx1 = Math.round(xvals[i]);+ outpoints[i].ctrly1 = Math.round(yvals[i]);+ + if (i < l-1) + {+ outpoints[i].ctrlx2 = Math.round(2*xcoords[i+1] - xvals[i+1]);+ outpoints[i].ctrly2 = Math.round(2*ycoords[i+1] - yvals[i+1]);+ }+ else + {+ outpoints[i].ctrlx2 = Math.round((xcoords[l] + xvals[l-1])/2);+ outpoints[i].ctrly2 = Math.round((ycoords[l] + yvals[l-1])/2);+ }+ }+ + return outpoints; + },++ /**+ * Gets the control points for the curve.+ *+ * @method getControlPoints+ * @param {Array} vals Collection of values coords used to generate control points.+ * @return Array+ * @private+ */+ getControlPoints: function(vals) + {+ var l = vals.length,+ x = [],+ tmp = [],+ b = 2.0,+ i = 1;+ x[0] = vals[0] / b;+ for (; i < l; ++i) + {+ tmp[i] = 1/b;+ b = (i < l-1 ? 4.0 : 3.5) - tmp[i];+ x[i] = (vals[i] - x[i-1]) / b;+ }+ + for (i = 1; i < l; ++i) + {+ x[l-i-1] -= tmp[l-i] * x[l-i];+ }+ + return x;+ }+};+Y.CurveUtil = CurveUtil;+/**+ * Utility class used for creating stacked series.+ *+ * @module charts+ * @submodule charts-base+ * @class StackingUtil+ * @constructor+ */+function StackingUtil(){}++StackingUtil.prototype = {+ /**+ * Indicates whether the series is stacked.+ *+ * @property _stacked+ * @private+ */+ _stacked: true,++ /**+ * @protected+ *+ * Adjusts coordinate values for stacked series.+ *+ * @method _stackCoordinates+ */+ _stackCoordinates: function() + {+ if(this.get("direction") == "vertical")+ {+ this._stackXCoords();+ }+ else+ {+ this._stackYCoords();+ }+ },++ /**+ * Stacks coordinates for a stacked vertical series.+ *+ * @method _stackXCoords+ * @protected+ */+ _stackXCoords: function()+ {+ var order = this.get("order"),+ type = this.get("type"),+ graph = this.get("graph"),+ seriesCollection = graph.seriesTypes[type],+ i = 0,+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ len,+ coord,+ prevCoord,+ prevOrder,+ stackedXCoords = xcoords.concat(),+ prevXCoords,+ prevYCoords,+ nullIndices = [],+ nullIndex;+ if(order > 0)+ {+ prevXCoords = seriesCollection[order - 1].get("stackedXCoords");+ prevYCoords = seriesCollection[order - 1].get("stackedYCoords");+ len = prevXCoords.length;+ }+ else+ {+ len = xcoords.length;+ }+ for(; i < len; i = i + 1)+ {+ if(Y_Lang.isNumber(xcoords[i]))+ {+ if(order > 0)+ {+ prevCoord = prevXCoords[i];+ if(!Y_Lang.isNumber(prevCoord))+ {+ prevOrder = order;+ while(prevOrder > - 1 && !Y_Lang.isNumber(prevCoord))+ {+ prevOrder = prevOrder - 1;+ if(prevOrder > -1)+ {+ prevCoord = seriesCollection[prevOrder].get("stackedXCoords")[i];+ }+ else+ {+ prevCoord = this._leftOrigin;+ }+ }+ }+ xcoords[i] = xcoords[i] + prevCoord;+ }+ stackedXCoords[i] = xcoords[i];+ }+ else+ {+ nullIndices.push(i);+ }+ }+ this._cleanXNaN(stackedXCoords, ycoords);+ len = nullIndices.length;+ if(len > 0)+ {+ for(i = 0; i < len; i = i + 1)+ {+ nullIndex = nullIndices[i];+ coord = order > 0 ? prevXCoords[nullIndex] : this._leftOrigin;+ stackedXCoords[nullIndex] = Math.max(stackedXCoords[nullIndex], coord);+ }+ }+ this.set("stackedXCoords", stackedXCoords);+ this.set("stackedYCoords", ycoords);+ },++ /**+ * Stacks coordinates for a stacked horizontal series.+ *+ * @method _stackYCoords+ * @protected+ */+ _stackYCoords: function()+ {+ var order = this.get("order"),+ type = this.get("type"),+ graph = this.get("graph"),+ h = graph.get("height"), + seriesCollection = graph.seriesTypes[type],+ i = 0,+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ len,+ coord,+ prevCoord,+ prevOrder,+ stackedYCoords = ycoords.concat(),+ prevXCoords,+ prevYCoords,+ nullIndices = [],+ nullIndex;+ if(order > 0)+ {+ prevXCoords = seriesCollection[order - 1].get("stackedXCoords");+ prevYCoords = seriesCollection[order - 1].get("stackedYCoords");+ len = prevYCoords.length;+ }+ else+ {+ len = ycoords.length;+ }+ for(; i < len; i = i + 1)+ {+ if(Y_Lang.isNumber(ycoords[i]))+ {+ if(order > 0)+ {+ prevCoord = prevYCoords[i];+ if(!Y_Lang.isNumber(prevCoord))+ {+ prevOrder = order;+ while(prevOrder > - 1 && !Y_Lang.isNumber(prevCoord))+ {+ prevOrder = prevOrder - 1;+ if(prevOrder > -1)+ {+ prevCoord = seriesCollection[prevOrder].get("stackedYCoords")[i];+ }+ else+ {+ prevCoord = this._bottomOrigin;+ }+ }+ }+ ycoords[i] = prevCoord - (h - ycoords[i]);+ }+ stackedYCoords[i] = ycoords[i];+ }+ else+ {+ nullIndices.push(i);+ }+ }+ this._cleanYNaN(xcoords, stackedYCoords);+ len = nullIndices.length;+ if(len > 0)+ {+ for(i = 0; i < len; i = i + 1)+ {+ nullIndex = nullIndices[i];+ coord = order > 0 ? prevYCoords[nullIndex] : h;+ stackedYCoords[nullIndex] = Math.min(stackedYCoords[nullIndex], coord);+ }+ }+ this.set("stackedXCoords", xcoords);+ this.set("stackedYCoords", stackedYCoords);+ },++ /**+ * Cleans invalid x-coordinates by calculating their value based on the corresponding y-coordinate, the previous valid x-coordinate with its + * corresponding y-coordinate and the next valid x-coordinate with its corresponding y-coordinate. If there is no previous or next valid x-coordinate,+ * the value will not be altered.+ *+ * @method _cleanXNaN+ * @param {Array} xcoords An array of x-coordinate values+ * @param {Array} ycoords An arry of y-coordinate values+ * @private+ */+ _cleanXNaN: function(xcoords, ycoords)+ {+ var previousValidIndex,+ nextValidIndex,+ previousValidX,+ previousValidY,+ x,+ y,+ nextValidX,+ nextValidY,+ isNumber = Y_Lang.isNumber,+ m,+ i = 0,+ len = ycoords.length;+ for(; i < len; ++i)+ {+ x = xcoords[i];+ y = ycoords[i];+ //if x is invalid, calculate where it should be+ if(!isNumber(x) && i > 0 && i < len - 1)+ {+ previousValidY = ycoords[i - 1];+ //check to see if the previous value is valid+ previousValidX = this._getPreviousValidCoordValue(xcoords, i);+ nextValidY = ycoords[i + 1];+ nextValidX = this._getNextValidCoordValue(xcoords, i);+ //check to see if the next value is valid+ if(isNumber(previousValidX) && isNumber(nextValidX))+ {+ //calculate slope and solve for x+ m = (nextValidY - previousValidY) / (nextValidX - previousValidX);+ xcoords[i] = (y + (m * previousValidX) - previousValidY)/m;+ }+ previousValidIndex = NaN;+ nextValidIndex = NaN;+ }+ }+ },++ /**+ * Returns the previous valid (numeric) value in an array if available.+ *+ * @method _getPreviousValidCoordValue+ * @param {Array} coords Array of values+ * @param {Number} index The index in the array in which to begin searching.+ * @return Number+ * @private+ */+ _getPreviousValidCoordValue: function(coords, index)+ {+ var coord,+ isNumber = Y_Lang.isNumber,+ limit = -1;+ while(!isNumber(coord) && index > limit)+ {+ index = index - 1;+ coord = coords[index];+ }+ return coord;+ },++ /**+ * Returns the next valid (numeric) value in an array if available.+ *+ * @method _getNextValidCoordValue+ * @param {Array} coords Array of values+ * @param {Number} index The index in the array in which to begin searching.+ * @return Number+ * @private+ */+ _getNextValidCoordValue: function(coords, index)+ {+ var coord,+ isNumber = Y_Lang.isNumber,+ limit = coords.length;+ while(!isNumber(coord) && index < limit)+ {+ index = index + 1;+ coord = coords[index];+ }+ return coord;+ },++ /**+ * Cleans invalid y-coordinates by calculating their value based on the corresponding x-coordinate, the previous valid y-coordinate with its + * corresponding x-coordinate and the next valid y-coordinate with its corresponding x-coordinate. If there is no previous or next valid y-coordinate,+ * the value will not be altered.+ *+ * @method _cleanYNaN+ * @param {Array} xcoords An array of x-coordinate values+ * @param {Array} ycoords An arry of y-coordinate values+ * @private+ */+ _cleanYNaN: function(xcoords, ycoords)+ {+ var previousValidIndex,+ nextValidIndex,+ previousValidX,+ previousValidY,+ x,+ y,+ nextValidX,+ nextValidY,+ isNumber = Y_Lang.isNumber,+ m,+ i = 0,+ len = xcoords.length;+ for(; i < len; ++i)+ {+ x = xcoords[i];+ y = ycoords[i];+ //if y is invalid, calculate where it should be+ if(!isNumber(y) && i > 0 && i < len - 1)+ {+ //check to see if the previous value is valid+ previousValidX = xcoords[i - 1];+ previousValidY = this._getPreviousValidCoordValue(ycoords, i);+ //check to see if the next value is valid+ nextValidX = xcoords[i + 1];+ nextValidY = this._getNextValidCoordValue(ycoords, i);+ if(isNumber(previousValidY) && isNumber(nextValidY))+ {+ //calculate slope and solve for y+ m = (nextValidY - previousValidY) / (nextValidX - previousValidX);+ ycoords[i] = previousValidY + ((m * x) - (m * previousValidX));+ }+ previousValidIndex = NaN;+ nextValidIndex = NaN;+ }+ }+ }+};+Y.StackingUtil = StackingUtil;+/**+ * Utility class used for drawing lines.+ *+ * @module charts+ * @submodule charts-base+ * @class Lines+ * @constructor+ */+function Lines(){}++Lines.prototype = {+ /**+ * @property _lineDefaults+ * @type Object+ * @private+ */+ _lineDefaults: null,+ + /**+ * Creates a graphic in which to draw a series.+ *+ * @method _getGraphic+ * @return Graphic+ * @private+ */+ _getGraphic: function()+ {+ var graphic = this.get("graphic") || this.get("graph").get("graphic");+ if(!this._lineGraphic)+ {+ this._lineGraphic = graphic.addShape({type: "path"});+ }+ this._lineGraphic.clear();+ return this._lineGraphic;+ },+ + /**+ * Toggles visibility+ *+ * @method _toggleVisible+ * @param {Boolean} visible indicates visibilitye+ * @private+ */+ _toggleVisible: function(visible)+ {+ if(this._lineGraphic)+ {+ this._lineGraphic.set("visible", visible);+ }+ },++ /**+ * Draws lines for the series.+ *+ * @method drawLines+ * @protected+ */+ drawLines: function()+ {+ if(this.get("xcoords").length < 1) + {+ return;+ }+ var isNumber = Y_Lang.isNumber,+ xcoords,+ ycoords,+ direction = this.get("direction"),+ len,+ lastPointValid,+ pointValid,+ noPointsRendered = true,+ lastValidX,+ lastValidY,+ nextX,+ nextY,+ i,+ styles = this.get("styles").line,+ lineType = styles.lineType,+ lc = styles.color || this._getDefaultColor(this.get("graphOrder"), "line"),+ lineAlpha = styles.alpha,+ dashLength = styles.dashLength,+ gapSpace = styles.gapSpace,+ connectDiscontinuousPoints = styles.connectDiscontinuousPoints,+ discontinuousType = styles.discontinuousType,+ discontinuousDashLength = styles.discontinuousDashLength,+ discontinuousGapSpace = styles.discontinuousGapSpace,+ path = this._getGraphic();+ if(this._stacked)+ {+ xcoords = this.get("stackedXCoords");+ ycoords = this.get("stackedYCoords");+ }+ else+ {+ xcoords = this.get("xcoords");+ ycoords = this.get("ycoords");+ }+ len = direction === "vertical" ? ycoords.length : xcoords.length;+ path.set("stroke", {+ weight: styles.weight, + color: lc, + opacity: lineAlpha+ });+ for(i = 0; i < len; i = ++i)+ {+ nextX = xcoords[i];+ nextY = ycoords[i];+ pointValid = isNumber(nextX) && isNumber(nextY); + if(!pointValid)+ {+ lastPointValid = pointValid;+ continue;+ }+ if(noPointsRendered)+ {+ noPointsRendered = false;+ path.moveTo(nextX, nextY);+ }+ else if(lastPointValid)+ {+ if(lineType != "dashed")+ {+ path.lineTo(nextX, nextY);+ }+ else+ {+ this.drawDashedLine(path, lastValidX, lastValidY, nextX, nextY, + dashLength, + gapSpace);+ }+ }+ else if(!connectDiscontinuousPoints)+ {+ path.moveTo(nextX, nextY);+ }+ else+ {+ if(discontinuousType != "solid")+ {+ this.drawDashedLine(path, lastValidX, lastValidY, nextX, nextY, + discontinuousDashLength, + discontinuousGapSpace);+ }+ else+ {+ path.lineTo(nextX, nextY);+ }+ }+ lastValidX = nextX;+ lastValidY = nextY;+ lastPointValid = true;+ }+ path.end();+ },+ + /**+ * Connects data points with a consistent curve for a series.+ * + * @method drawSpline+ * @protected+ */+ drawSpline: function()+ {+ if(this.get("xcoords").length < 1) + {+ return;+ }+ var xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ curvecoords = this.getCurveControlPoints(xcoords, ycoords),+ len = curvecoords.length,+ cx1,+ cx2,+ cy1,+ cy2,+ x,+ y,+ i = 0,+ styles = this.get("styles").line,+ path = this._getGraphic(),+ lineAlpha = styles.alpha,+ color = styles.color || this._getDefaultColor(this.get("graphOrder"), "line");+ path.set("stroke", { + weight: styles.weight, + color: color, + opacity: lineAlpha+ });+ path.moveTo(xcoords[0], ycoords[0]);+ for(; i < len; i = ++i)+ {+ x = curvecoords[i].endx;+ y = curvecoords[i].endy;+ cx1 = curvecoords[i].ctrlx1;+ cx2 = curvecoords[i].ctrlx2;+ cy1 = curvecoords[i].ctrly1;+ cy2 = curvecoords[i].ctrly2;+ path.curveTo(cx1, cy1, cx2, cy2, x, y);+ }+ path.end();+ },++ /**+ * Draws a dashed line between two points.+ * + * @method drawDashedLine+ * @param {Number} xStart The x position of the start of the line+ * @param {Number} yStart The y position of the start of the line+ * @param {Number} xEnd The x position of the end of the line+ * @param {Number} yEnd The y position of the end of the line+ * @param {Number} dashSize the size of dashes, in pixels+ * @param {Number} gapSize the size of gaps between dashes, in pixels+ * @private+ */+ drawDashedLine: function(path, xStart, yStart, xEnd, yEnd, dashSize, gapSize)+ {+ dashSize = dashSize || 10;+ gapSize = gapSize || 10;+ var segmentLength = dashSize + gapSize,+ xDelta = xEnd - xStart,+ yDelta = yEnd - yStart,+ delta = Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2)),+ segmentCount = Math.floor(Math.abs(delta / segmentLength)),+ radians = Math.atan2(yDelta, xDelta),+ xCurrent = xStart,+ yCurrent = yStart,+ i;+ xDelta = Math.cos(radians) * segmentLength;+ yDelta = Math.sin(radians) * segmentLength;+ + for(i = 0; i < segmentCount; ++i)+ {+ path.moveTo(xCurrent, yCurrent);+ path.lineTo(xCurrent + Math.cos(radians) * dashSize, yCurrent + Math.sin(radians) * dashSize);+ xCurrent += xDelta;+ yCurrent += yDelta;+ }+ + path.moveTo(xCurrent, yCurrent);+ delta = Math.sqrt((xEnd - xCurrent) * (xEnd - xCurrent) + (yEnd - yCurrent) * (yEnd - yCurrent));+ + if(delta > dashSize)+ {+ path.lineTo(xCurrent + Math.cos(radians) * dashSize, yCurrent + Math.sin(radians) * dashSize);+ }+ else if(delta > 0)+ {+ path.lineTo(xCurrent + Math.cos(radians) * delta, yCurrent + Math.sin(radians) * delta);+ }+ + path.moveTo(xEnd, yEnd);+ },++ /**+ * Default values for `styles` attribute.+ *+ * @method _getLineDefaults+ * @return Object+ * @protected+ */+ _getLineDefaults: function()+ {+ return {+ alpha: 1,+ weight: 6,+ lineType:"solid", + dashLength:10, + gapSpace:10, + connectDiscontinuousPoints:true, + discontinuousType:"solid", + discontinuousDashLength:10, + discontinuousGapSpace:10+ };+ }+};+Y.augment(Lines, Y.Attribute);+Y.Lines = Lines;+/**+ * Utility class used for drawing area fills.+ *+ * @module charts+ * @class Fills+ * @constructor+ */+function Fills(cfg)+{+ var attrs = {+ area: {+ getter: function()+ {+ return this._defaults || this._getAreaDefaults();+ },++ setter: function(val)+ {+ var defaults = this._defaults || this._getAreaDefaults();+ this._defaults = Y.merge(defaults, val);+ }+ }+ };+ this.addAttrs(attrs, cfg);+ this.get("styles");+}++Fills.prototype = {+ /**+ * Returns a path shape used for drawing fills.+ *+ * @method _getPath+ * @return Path+ * @private+ */+ _getPath: function()+ {+ var path = this._path;+ if(!path)+ {+ path = this.get("graph").get("graphic").addShape({type:"path"});+ this._path = path;+ }+ return path;+ },+ + /**+ * Toggles visibility+ *+ * @method _toggleVisible+ * @param {Boolean} visible indicates visibilitye+ * @private+ */+ _toggleVisible: function(visible)+ { + if(this._path)+ {+ this._path.set("visible", visible);+ }+ },++ /**+ * Draws fill+ *+ * @method drawFill+ * @param {Array} xcoords The x-coordinates for the series.+ * @param {Array} ycoords The y-coordinates for the series.+ * @protected+ */+ drawFill: function(xcoords, ycoords)+ {+ if(xcoords.length < 1) + {+ return;+ }+ var isNumber = Y_Lang.isNumber,+ len = xcoords.length,+ firstX = xcoords[0],+ firstY = ycoords[0],+ lastValidX = firstX,+ lastValidY = firstY,+ nextX,+ nextY,+ pointValid,+ noPointsRendered = true,+ i = 0,+ styles = this.get("styles").area,+ path = this._getPath(),+ color = styles.color || this._getDefaultColor(this.get("graphOrder"), "slice");+ path.clear();+ path.set("fill", {+ color: color, + opacity: styles.alpha+ });+ path.set("stroke", {weight: 0});+ for(; i < len; i = ++i)+ {+ nextX = xcoords[i];+ nextY = ycoords[i];+ pointValid = isNumber(nextX) && isNumber(nextY); + if(!pointValid)+ {+ continue;+ }+ if(noPointsRendered)+ {+ this._firstValidX = nextX;+ this._firstValidY = nextY;+ noPointsRendered = false;+ path.moveTo(nextX, nextY);+ }+ else+ {+ path.lineTo(nextX, nextY);+ }+ lastValidX = nextX;+ lastValidY = nextY;+ }+ this._lastValidX = lastValidX;+ this._lastValidY = lastValidY;+ path.end();+ },+ + /**+ * Draws a fill for a spline+ *+ * @method drawAreaSpline+ * @protected+ */+ drawAreaSpline: function()+ {+ if(this.get("xcoords").length < 1) + {+ return;+ }+ var xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ curvecoords = this.getCurveControlPoints(xcoords, ycoords),+ len = curvecoords.length,+ cx1,+ cx2,+ cy1,+ cy2,+ x,+ y,+ i = 0,+ firstX = xcoords[0],+ firstY = ycoords[0],+ styles = this.get("styles").area,+ path = this._getPath(),+ color = styles.color || this._getDefaultColor(this.get("graphOrder"), "slice");+ path.set("fill", {+ color: color, + opacity: styles.alpha+ });+ path.set("stroke", {weight: 0});+ path.moveTo(firstX, firstY);+ for(; i < len; i = ++i)+ {+ x = curvecoords[i].endx;+ y = curvecoords[i].endy;+ cx1 = curvecoords[i].ctrlx1;+ cx2 = curvecoords[i].ctrlx2;+ cy1 = curvecoords[i].ctrly1;+ cy2 = curvecoords[i].ctrly2;+ path.curveTo(cx1, cy1, cx2, cy2, x, y);+ }+ if(this.get("direction") === "vertical")+ {+ path.lineTo(this._leftOrigin, y);+ path.lineTo(this._leftOrigin, firstY);+ }+ else+ {+ path.lineTo(x, this._bottomOrigin);+ path.lineTo(firstX, this._bottomOrigin);+ }+ path.lineTo(firstX, firstY);+ path.end();+ },+ + /**+ * Draws a a stacked area spline+ *+ * @method drawStackedAreaSpline+ * @protected+ */+ drawStackedAreaSpline: function()+ {+ if(this.get("xcoords").length < 1) + {+ return;+ }+ var xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ curvecoords,+ order = this.get("order"),+ type = this.get("type"),+ graph = this.get("graph"),+ seriesCollection = graph.seriesTypes[type],+ prevXCoords,+ prevYCoords,+ len,+ cx1,+ cx2,+ cy1,+ cy2,+ x,+ y,+ i = 0,+ firstX,+ firstY,+ styles = this.get("styles").area,+ path = this._getPath(),+ color = styles.color || this._getDefaultColor(this.get("graphOrder"), "slice");+ firstX = xcoords[0];+ firstY = ycoords[0];+ curvecoords = this.getCurveControlPoints(xcoords, ycoords);+ len = curvecoords.length;+ path.set("fill", {+ color: color, + opacity: styles.alpha+ });+ path.set("stroke", {weight: 0});+ path.moveTo(firstX, firstY);+ for(; i < len; i = ++i)+ {+ x = curvecoords[i].endx;+ y = curvecoords[i].endy;+ cx1 = curvecoords[i].ctrlx1;+ cx2 = curvecoords[i].ctrlx2;+ cy1 = curvecoords[i].ctrly1;+ cy2 = curvecoords[i].ctrly2;+ path.curveTo(cx1, cy1, cx2, cy2, x, y);+ }+ if(order > 0)+ {+ prevXCoords = seriesCollection[order - 1].get("xcoords").concat().reverse();+ prevYCoords = seriesCollection[order - 1].get("ycoords").concat().reverse();+ curvecoords = this.getCurveControlPoints(prevXCoords, prevYCoords);+ i = 0;+ len = curvecoords.length;+ path.lineTo(prevXCoords[0], prevYCoords[0]);+ for(; i < len; i = ++i)+ {+ x = curvecoords[i].endx;+ y = curvecoords[i].endy;+ cx1 = curvecoords[i].ctrlx1;+ cx2 = curvecoords[i].ctrlx2;+ cy1 = curvecoords[i].ctrly1;+ cy2 = curvecoords[i].ctrly2;+ path.curveTo(cx1, cy1, cx2, cy2, x, y);+ }+ }+ else+ {+ if(this.get("direction") === "vertical")+ {+ path.lineTo(this._leftOrigin, ycoords[ycoords.length-1]);+ path.lineTo(this._leftOrigin, firstY);+ }+ else+ {+ path.lineTo(xcoords[xcoords.length-1], this._bottomOrigin);+ path.lineTo(firstX, this._bottomOrigin);+ }++ }+ path.lineTo(firstX, firstY);+ path.end();+ },+ + /**+ * Storage for default area styles.+ *+ * @property _defaults+ * @type Object+ * @private+ */+ _defaults: null,++ /**+ * Concatenates coordinate array with correct coordinates for closing an area fill.+ *+ * @method _getClosingPoints+ * @return Array+ * @protected+ */+ _getClosingPoints: function()+ {+ var xcoords = this.get("xcoords").concat(),+ ycoords = this.get("ycoords").concat(),+ firstValidIndex,+ lastValidIndex;+ if(this.get("direction") === "vertical")+ {+ lastValidIndex = this._getLastValidIndex(xcoords);+ firstValidIndex = this._getFirstValidIndex(xcoords);+ ycoords.push(ycoords[lastValidIndex]);+ ycoords.push(ycoords[firstValidIndex]);+ xcoords.push(this._leftOrigin);+ xcoords.push(this._leftOrigin);+ }+ else+ {+ lastValidIndex = this._getLastValidIndex(ycoords);+ firstValidIndex = this._getFirstValidIndex(ycoords);+ xcoords.push(xcoords[lastValidIndex]);+ xcoords.push(xcoords[firstValidIndex]);+ ycoords.push(this._bottomOrigin);+ ycoords.push(this._bottomOrigin);+ }+ xcoords.push(xcoords[0]);+ ycoords.push(ycoords[0]);+ return [xcoords, ycoords];+ },++ /**+ * Returns the order of the series closest to the current series that has a valid value for the current index.+ *+ * @method _getHighestValidOrder+ * @param {Array} seriesCollection Array of series of a given type.+ * @param {Number} index Index of the series item.+ * @param {Number} order Index of the the series in the seriesCollection+ * @param {String} direction Indicates the direction of the series+ * @return Number+ * @private+ */+ _getHighestValidOrder: function(seriesCollection, index, order, direction)+ {+ var coords = direction == "vertical" ? "stackedXCoords" : "stackedYCoords",+ coord;+ while(isNaN(coord) && order > -1)+ {+ order = order - 1;+ if(order > -1)+ {+ coord = seriesCollection[order].get(coords)[index];+ }+ }+ return order;+ },+ + /**+ * Returns an array containing the x and y coordinates for a given series and index.+ *+ * @method _getCoordsByOrderAndIndex+ * @param {Array} seriesCollection Array of series of a given type.+ * @param {Number} index Index of the series item.+ * @param {Number} order Index of the the series in the seriesCollection+ * @param {String} direction Indicates the direction of the series+ * @return Array+ * @private+ */+ _getCoordsByOrderAndIndex: function(seriesCollection, index, order, direction)+ {+ var xcoord,+ ycoord;+ if(direction == "vertical")+ {+ xcoord = order < 0 ? this._leftOrigin : seriesCollection[order].get("stackedXCoords")[index];+ ycoord = this.get("stackedYCoords")[index];+ }+ else+ {+ xcoord = this.get("stackedXCoords")[index];+ ycoord = order < 0 ? this._bottomOrigin : seriesCollection[order].get("stackedYCoords")[index];+ }+ return [xcoord, ycoord];+ },+ + /**+ * Concatenates coordinate array with the correct coordinates for closing an area stack.+ *+ * @method _getStackedClosingPoints+ * @return Array+ * @protected+ */+ _getStackedClosingPoints: function()+ {+ var order = this.get("order"),+ type = this.get("type"),+ graph = this.get("graph"),+ direction = this.get("direction"),+ seriesCollection = graph.seriesTypes[type],+ firstValidIndex,+ lastValidIndex,+ xcoords = this.get("stackedXCoords"),+ ycoords = this.get("stackedYCoords"),+ limit,+ previousSeries,+ previousSeriesFirstValidIndex,+ previousSeriesLastValidIndex,+ previousXCoords,+ previousYCoords,+ coords,+ closingXCoords,+ closingYCoords,+ currentIndex,+ highestValidOrder,+ oldOrder;+ if(order < 1)+ { + return this._getClosingPoints();+ }+ + previousSeries = seriesCollection[order - 1];+ previousXCoords = previousSeries.get("stackedXCoords").concat();+ previousYCoords = previousSeries.get("stackedYCoords").concat();+ if(direction == "vertical")+ {+ firstValidIndex = this._getFirstValidIndex(xcoords);+ lastValidIndex = this._getLastValidIndex(xcoords);+ previousSeriesFirstValidIndex = previousSeries._getFirstValidIndex(previousXCoords);+ previousSeriesLastValidIndex = previousSeries._getLastValidIndex(previousXCoords);+ }+ else+ {+ firstValidIndex = this._getFirstValidIndex(ycoords);+ lastValidIndex = this._getLastValidIndex(ycoords);+ previousSeriesFirstValidIndex = previousSeries._getFirstValidIndex(previousYCoords);+ previousSeriesLastValidIndex = previousSeries._getLastValidIndex(previousYCoords);+ }+ if(previousSeriesLastValidIndex >= firstValidIndex && previousSeriesFirstValidIndex <= lastValidIndex)+ {+ previousSeriesFirstValidIndex = Math.max(firstValidIndex, previousSeriesFirstValidIndex);+ previousSeriesLastValidIndex = Math.min(lastValidIndex, previousSeriesLastValidIndex);+ previousXCoords = previousXCoords.slice(previousSeriesFirstValidIndex, previousSeriesLastValidIndex + 1);+ previousYCoords = previousYCoords.slice(previousSeriesFirstValidIndex, previousSeriesLastValidIndex + 1);+ limit = previousSeriesFirstValidIndex;+ }+ else+ {+ limit = lastValidIndex;+ }++ closingXCoords = [xcoords[firstValidIndex]];+ closingYCoords = [ycoords[firstValidIndex]];+ currentIndex = firstValidIndex;+ while((isNaN(highestValidOrder) || highestValidOrder < order - 1) && currentIndex <= limit)+ {+ oldOrder = highestValidOrder;+ highestValidOrder = this._getHighestValidOrder(seriesCollection, currentIndex, order, direction);+ if(!isNaN(oldOrder) && highestValidOrder > oldOrder)+ {+ coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, oldOrder, direction);+ closingXCoords.push(coords[0]);+ closingYCoords.push(coords[1]);+ }+ coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, highestValidOrder, direction);+ closingXCoords.push(coords[0]);+ closingYCoords.push(coords[1]);+ currentIndex = currentIndex + 1;+ }+ if(previousXCoords && previousXCoords.length > 0 && previousSeriesLastValidIndex > firstValidIndex && previousSeriesFirstValidIndex < lastValidIndex)+ {+ closingXCoords = closingXCoords.concat(previousXCoords);+ closingYCoords = closingYCoords.concat(previousYCoords);+ highestValidOrder = order -1; + }+ currentIndex = Math.max(firstValidIndex, previousSeriesLastValidIndex);+ order = order - 1;+ highestValidOrder = NaN;+ while(currentIndex <= lastValidIndex)+ {+ oldOrder = highestValidOrder;+ highestValidOrder = this._getHighestValidOrder(seriesCollection, currentIndex, order, direction);+ if(!isNaN(oldOrder))+ {+ if(highestValidOrder > oldOrder)+ {+ coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, oldOrder, direction);+ closingXCoords.push(coords[0]);+ closingYCoords.push(coords[1]);+ }+ else if(highestValidOrder < oldOrder)+ {+ coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex - 1, highestValidOrder, direction);+ closingXCoords.push(coords[0]);+ closingYCoords.push(coords[1]);+ }+ }+ coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, highestValidOrder, direction);+ closingXCoords.push(coords[0]);+ closingYCoords.push(coords[1]);+ currentIndex = currentIndex + 1;+ }++ closingXCoords.reverse();+ closingYCoords.reverse();+ return [xcoords.concat(closingXCoords), ycoords.concat(closingYCoords)];+ },++ /**+ * Returns default values for area styles.+ *+ * @method _getAreaDefaults+ * @return Object+ * @private+ */+ _getAreaDefaults: function()+ {+ return {+ };+ }+};+Y.augment(Fills, Y.Attribute);+Y.Fills = Fills;+/**+ * Utility class used for drawing markers.+ *+ * @module charts+ * @submodule charts-base+ * @class Plots+ * @constructor+ */+function Plots(cfg)+{+ var attrs = { + markers: {+ getter: function()+ {+ return this._markers;+ }+ }+ };+ this.addAttrs(attrs, cfg);+}++Plots.prototype = {+ /**+ * Storage for default marker styles.+ *+ * @property _plotDefaults+ * @type Object+ * @private+ */+ _plotDefaults: null,++ /**+ * Draws the markers+ *+ * @method drawPlots+ * @protected+ */+ drawPlots: function()+ {+ if(!this.get("xcoords") || this.get("xcoords").length < 1) + {+ return;+ }+ var isNumber = Y_Lang.isNumber,+ style = Y.clone(this.get("styles").marker),+ w = style.width,+ h = style.height,+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ i = 0,+ len = xcoords.length,+ top = ycoords[0],+ left,+ marker,+ offsetWidth = w/2,+ offsetHeight = h/2,+ xvalues,+ yvalues,+ fillColors = null,+ borderColors = null,+ graphOrder = this.get("graphOrder"),+ groupMarkers = this.get("groupMarkers");+ if(groupMarkers)+ {+ xvalues = [];+ yvalues = [];+ for(; i < len; ++i)+ {+ xvalues.push(parseFloat(xcoords[i] - offsetWidth));+ yvalues.push(parseFloat(ycoords[i] - offsetHeight));+ }+ this._createGroupMarker({+ xvalues: xvalues,+ yvalues: yvalues,+ fill: style.fill,+ border: style.border,+ dimensions: {+ width: w,+ height: h+ },+ graphOrder: graphOrder,+ shape: style.shape+ });+ return;+ }+ if(Y_Lang.isArray(style.fill.color))+ {+ fillColors = style.fill.color.concat(); + }+ if(Y_Lang.isArray(style.border.color))+ {+ borderColors = style.border.color.concat();+ }+ this._createMarkerCache();+ for(; i < len; ++i)+ {+ top = parseFloat(ycoords[i] - offsetHeight);+ left = parseFloat(xcoords[i] - offsetWidth); + if(!isNumber(left) || !isNumber(top))+ {+ this._markers.push(null);+ continue;+ }+ if(fillColors)+ {+ style.fill.color = fillColors[i % fillColors.length];+ }+ if(borderColors)+ {+ style.border.color = borderColors[i % borderColors.length];+ }++ style.x = left;+ style.y = top;+ marker = this.getMarker(style, graphOrder, i);+ }+ this._clearMarkerCache();+ },++ /**+ * Pre-defined group shapes.+ *+ * @property _groupShapes+ * @private+ */+ _groupShapes: {+ circle: Y.CircleGroup,+ rect: Y.RectGroup,+ ellipse: Y.EllipseGroup,+ diamond: Y.DiamondGroup+ },++ /**+ * Returns the correct group shape class.+ *+ * @method _getGroupShape+ * @param {Shape | String} shape Indicates which shape class. + * @return Function+ * @protected+ */+ _getGroupShape: function(shape)+ {+ if(Y_Lang.isString(shape))+ {+ shape = this._groupShapes[shape];+ }+ return shape;+ },++ /**+ * Gets the default values for series that use the utility. This method is used by+ * the class' `styles` attribute's getter to get build default values.+ *+ * @method _getPlotDefaults+ * @return Object+ * @protected+ */+ _getPlotDefaults: function()+ {+ var defs = {+ fill:{+ type: "solid",+ alpha: 1,+ colors:null,+ alphas: null,+ ratios: null+ },+ border:{+ weight: 1,+ alpha: 1+ },+ width: 10,+ height: 10,+ shape: "circle"+ };+ defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");+ defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");+ return defs;+ },++ /**+ * Collection of markers to be used in the series.+ *+ * @property _markers+ * @type Array+ * @private+ */+ _markers: null,++ /**+ * Collection of markers to be re-used on a series redraw.+ *+ * @property _markerCache+ * @type Array+ * @private+ */+ _markerCache: null,+ + /**+ * Gets and styles a marker. If there is a marker in cache, it will use it. Otherwise+ * it will create one.+ *+ * @method getMarker+ * @param {Object} styles Hash of style properties.+ * @param {Number} order Order of the series.+ * @param {Number} index Index within the series associated with the marker.+ * @return Shape+ * @protected+ */+ getMarker: function(styles, order, index)+ {+ var marker,+ border = styles.border;+ styles.id = this.get("chart").get("id") + "_" + order + "_" + index;+ //fix name differences between graphic layer+ border.opacity = border.alpha;+ styles.stroke = border;+ styles.fill.opacity = styles.fill.alpha;+ if(this._markerCache.length > 0)+ {+ while(!marker)+ {+ if(this._markerCache.length < 1)+ {+ marker = this._createMarker(styles, order, index);+ break;+ }+ marker = this._markerCache.shift();++ }+ marker.set(styles);+ }+ else+ {+ marker = this._createMarker(styles, order, index);+ }+ this._markers.push(marker);+ return marker;+ },+ + /**+ * Creates a shape to be used as a marker.+ *+ * @method _createMarker+ * @param {Object} styles Hash of style properties.+ * @param {Number} order Order of the series.+ * @param {Number} index Index within the series associated with the marker.+ * @return Shape+ * @private+ */+ _createMarker: function(styles, order, index)+ {+ var graphic = this.get("graphic"),+ marker,+ cfg = Y.clone(styles);+ graphic.set("autoDraw", false);+ cfg.type = cfg.shape;+ marker = graphic.addShape(cfg); + marker.addClass(SERIES_MARKER);+ return marker;+ },+ + /**+ * Creates a cache of markers for reuse.+ *+ * @method _createMarkerCache+ * @private+ */+ _createMarkerCache: function()+ {+ if(this._groupMarker)+ {+ this._groupMarker.destroy();+ this._groupMarker = null;+ }+ if(this._markers && this._markers.length > 0)+ {+ this._markerCache = this._markers.concat();+ }+ else+ {+ this._markerCache = [];+ }+ this._markers = [];+ },+ + /**+ * Draws a series of markers in a single shape instance.+ *+ * @method _createGroupMarkers+ * @param {Object} styles Set of configuration properties used to create the markers.+ * @protected+ */+ _createGroupMarker: function(styles)+ {+ var marker,+ markers = this.get("markers"),+ border = styles.border,+ graphic,+ cfg,+ shape;+ if(markers && markers.length > 0)+ {+ while(markers.length > 0)+ {+ marker = markers.shift();+ marker.destroy();+ }+ this.set("markers", []);+ }+ //fix name differences between graphic layer+ border.opacity = border.alpha;+ cfg = {+ id: this.get("chart").get("id") + "_" + styles.graphOrder,+ stroke: border,+ fill: styles.fill,+ dimensions: styles.dimensions,+ xvalues: styles.xvalues,+ yvalues: styles.yvalues+ };+ cfg.fill.opacity = styles.fill.alpha;+ shape = this._getGroupShape(styles.shape);+ if(shape)+ {+ cfg.type = shape;+ }+ if(styles.hasOwnProperty("radius") && !isNaN(styles.radius))+ {+ cfg.dimensions.radius = styles.radius;+ }+ if(this._groupMarker)+ {+ this._groupMarker.destroy();+ }+ graphic = this.get("graphic");+ this._groupMarker = graphic.addShape(cfg);+ graphic._redraw();+ },++ /**+ * Toggles visibility+ *+ * @method _toggleVisible+ * @param {Boolean} visible indicates visibilitye+ * @private+ */+ _toggleVisible: function(visible)+ {+ var marker,+ markers = this.get("markers"),+ i = 0,+ len;+ if(markers)+ {+ len = markers.length;+ for(; i < len; ++i)+ {+ marker = markers[i];+ if(marker)+ {+ marker.set("visible", visible);+ }+ }+ }+ },++ /**+ * Removes unused markers from the marker cache+ *+ * @method _clearMarkerCache+ * @private+ */+ _clearMarkerCache: function()+ {+ var marker;+ while(this._markerCache.length > 0)+ {+ marker = this._markerCache.shift();+ if(marker)+ {+ marker.destroy();+ }+ }+ },++ /**+ * Resizes and positions markers based on a mouse interaction.+ *+ * @method updateMarkerState+ * @param {String} type state of the marker+ * @param {Number} i index of the marker+ * @protected+ */+ updateMarkerState: function(type, i)+ {+ if(this._markers && this._markers[i])+ {+ var w,+ h,+ styles = Y.clone(this.get("styles").marker),+ state = this._getState(type),+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ marker = this._markers[i],+ markerStyles = state == "off" || !styles[state] ? styles : styles[state]; + markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);+ markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);+ markerStyles.stroke = markerStyles.border;+ marker.set(markerStyles);+ w = markerStyles.width;+ h = markerStyles.height;+ marker.set("x", (xcoords[i] - w/2));+ marker.set("y", (ycoords[i] - h/2));+ marker.set("visible", this.get("visible"));+ }+ },++ /**+ * Parses a color from an array.+ *+ * @method _getItemColor+ * @param {Array} val collection of colors+ * @param {Number} i index of the item+ * @return String+ * @protected+ */+ _getItemColor: function(val, i)+ {+ if(Y_Lang.isArray(val))+ {+ return val[i % val.length];+ }+ return val;+ },++ /**+ * Method used by `styles` setter. Overrides base implementation.+ *+ * @method _setStyles+ * @param {Object} newStyles Hash of properties to update.+ * @return Object+ * @protected+ */+ _setStyles: function(val)+ {+ val = this._parseMarkerStyles(val);+ return Y.Renderer.prototype._setStyles.apply(this, [val]);+ },++ /**+ * Combines new styles with existing styles.+ *+ * @method _parseMarkerStyles+ * @param {Object} Object containing style properties for the marker.+ * @return Object+ * @private+ */+ _parseMarkerStyles: function(val)+ {+ if(val.marker)+ {+ var defs = this._getPlotDefaults();+ val.marker = this._mergeStyles(val.marker, defs);+ if(val.marker.over)+ {+ val.marker.over = this._mergeStyles(val.marker.over, val.marker);+ }+ if(val.marker.down)+ {+ val.marker.down = this._mergeStyles(val.marker.down, val.marker);+ }+ }+ return val;+ },++ /**+ * Returns marker state based on event type+ *+ * @method _getState+ * @param {String} type event type+ * @return String+ * @protected+ */+ _getState: function(type)+ {+ var state;+ switch(type)+ {+ case "mouseout" :+ state = "off";+ break;+ case "mouseover" :+ state = "over";+ break;+ case "mouseup" :+ state = "over";+ break;+ case "mousedown" :+ state = "down";+ break;+ }+ return state;+ },+ + /**+ * @property _statSyles+ * @type Object+ * @private+ */+ _stateSyles: null+};++Y.augment(Plots, Y.Attribute);+Y.Plots = Plots;+/**+ * Histogram is the base class for Column and Bar series.+ *+ * @module charts+ * @submodule charts-base+ * @class Histogram+ * @constructor+ */+function Histogram(){}++Histogram.prototype = {+ /**+ * Draws the series.+ *+ * @method drawSeries+ * @protected+ */+ drawSeries: function()+ {+ if(this.get("xcoords").length < 1) + {+ return;+ }+ var style = Y.clone(this.get("styles").marker),+ setSize,+ calculatedSize,+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ i = 0,+ len = xcoords.length,+ top = ycoords[0],+ type = this.get("type"),+ graph = this.get("graph"),+ seriesCollection = graph.seriesTypes[type],+ seriesLen = seriesCollection.length,+ seriesSize = 0,+ totalSize = 0,+ offset = 0,+ ratio,+ renderer,+ order = this.get("order"),+ graphOrder = this.get("graphOrder"),+ left,+ marker,+ setSizeKey,+ calculatedSizeKey,+ config,+ fillColors = null,+ borderColors = null,+ xMarkerPlane = [],+ yMarkerPlane = [],+ xMarkerPlaneLeft,+ xMarkerPlaneRight,+ yMarkerPlaneTop,+ yMarkerPlaneBottom,+ dimensions = {+ width: [],+ height: []+ },+ xvalues = [],+ yvalues = [],+ groupMarkers = this.get("groupMarkers");+ if(Y_Lang.isArray(style.fill.color))+ {+ fillColors = style.fill.color.concat(); + }+ if(Y_Lang.isArray(style.border.color))+ {+ borderColors = style.border.color.concat();+ }+ if(this.get("direction") == "vertical")+ {+ setSizeKey = "height";+ calculatedSizeKey = "width";+ }+ else+ {+ setSizeKey = "width";+ calculatedSizeKey = "height";+ }+ setSize = style[setSizeKey];+ calculatedSize = style[calculatedSizeKey];+ this._createMarkerCache();+ for(; i < seriesLen; ++i)+ {+ renderer = seriesCollection[i];+ seriesSize += renderer.get("styles").marker[setSizeKey];+ if(order > i) + {+ offset = seriesSize;+ }+ }+ totalSize = len * seriesSize;+ this._maxSize = graph.get(setSizeKey);+ if(totalSize > this._maxSize)+ {+ ratio = graph.get(setSizeKey)/totalSize;+ seriesSize *= ratio;+ offset *= ratio;+ setSize *= ratio;+ setSize = Math.max(setSize, 1);+ this._maxSize = setSize;+ }+ offset -= seriesSize/2;+ for(i = 0; i < len; ++i)+ {+ xMarkerPlaneLeft = xcoords[i] - seriesSize/2;+ xMarkerPlaneRight = xMarkerPlaneLeft + seriesSize;+ yMarkerPlaneTop = ycoords[i] - seriesSize/2;+ yMarkerPlaneBottom = yMarkerPlaneTop + seriesSize;+ xMarkerPlane.push({start: xMarkerPlaneLeft, end: xMarkerPlaneRight});+ yMarkerPlane.push({start: yMarkerPlaneTop, end: yMarkerPlaneBottom});+ if(isNaN(xcoords[i]) || isNaN(ycoords[i]))+ {+ this._markers.push(null);+ continue;+ }+ config = this._getMarkerDimensions(xcoords[i], ycoords[i], calculatedSize, offset);+ if(!isNaN(config.calculatedSize) && config.calculatedSize > 0)+ {+ top = config.top;+ left = config.left;++ if(groupMarkers)+ {+ dimensions[setSizeKey][i] = setSize;+ dimensions[calculatedSizeKey][i] = config.calculatedSize;+ xvalues.push(left);+ yvalues.push(top);+ }+ else+ {+ style[setSizeKey] = setSize;+ style[calculatedSizeKey] = config.calculatedSize;+ style.x = left;+ style.y = top;+ if(fillColors)+ {+ style.fill.color = fillColors[i % fillColors.length];+ }+ if(borderColors)+ {+ style.border.color = borderColors[i % borderColors.length];+ }+ marker = this.getMarker(style, graphOrder, i);+ }++ }+ else if(!groupMarkers)+ {+ this._markers.push(null);+ }+ }+ this.set("xMarkerPlane", xMarkerPlane);+ this.set("yMarkerPlane", yMarkerPlane);+ if(groupMarkers)+ {+ this._createGroupMarker({+ fill: style.fill,+ border: style.border,+ dimensions: dimensions,+ xvalues: xvalues,+ yvalues: yvalues,+ shape: style.shape+ });+ }+ else+ {+ this._clearMarkerCache();+ }+ },+ + /**+ * Collection of default colors used for marker fills in a series when not specified by user.+ *+ * @property _defaultFillColors+ * @type Array+ * @protected+ */+ _defaultFillColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],+ + /**+ * Gets the default style values for the markers.+ *+ * @method _getPlotDefaults+ * @return Object+ * @private+ */+ _getPlotDefaults: function()+ {+ var defs = {+ fill:{+ type: "solid",+ alpha: 1,+ colors:null,+ alphas: null,+ ratios: null+ },+ border:{+ weight: 0,+ alpha: 1+ },+ width: 12,+ height: 12,+ shape: "rect",++ padding:{+ top: 0,+ left: 0,+ right: 0,+ bottom: 0+ }+ };+ defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");+ defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");+ return defs;+ }+};++Y.Histogram = Histogram;+/**+ * The CartesianSeries class creates a chart with horizontal and vertical axes.+ *+ * @module charts+ * @submodule charts-base+ * @class CartesianSeries+ * @extends Base+ * @uses Renderer+ * @constructor+ */+Y.CartesianSeries = Y.Base.create("cartesianSeries", Y.Base, [Y.Renderer], {+ /**+ * Storage for `xDisplayName` attribute.+ *+ * @property _xDisplayName+ * @type String+ * @private+ */+ _xDisplayName: null,++ /**+ * Storage for `yDisplayName` attribute.+ *+ * @property _yDisplayName+ * @type String+ * @private+ */+ _yDisplayName: null,+ + /**+ * Th x-coordinate for the left edge of the series.+ *+ * @property _leftOrigin+ * @type String+ * @private+ */+ _leftOrigin: null,++ /**+ * The y-coordinate for the bottom edge of the series.+ * + * @property _bottomOrigin+ * @type String+ * @private+ */+ _bottomOrigin: null,++ /**+ * @method render+ * @private+ */+ render: function()+ {+ this._setCanvas();+ this.addListeners();+ this.set("rendered", true);+ this.validate();+ },++ /**+ * Adds event listeners.+ *+ * @method addListeners+ * @private+ */+ addListeners: function()+ {+ var xAxis = this.get("xAxis"),+ yAxis = this.get("yAxis");+ if(xAxis)+ {+ this._xDataReadyHandle = xAxis.after("dataReady", Y.bind(this._xDataChangeHandler, this));+ this._xDataUpdateHandle = xAxis.after("dataUpdate", Y.bind(this._xDataChangeHandler, this));+ }+ if(yAxis)+ {+ this._yDataReadyHandle = yAxis.after("dataReady", Y.bind(this._yDataChangeHandler, this));+ this._yDataUpdateHandle = yAxis.after("dataUpdate", Y.bind(this._yDataChangeHandler, this));+ }+ this._xAxisChangeHandle = this.after("xAxisChange", this._xAxisChangeHandler);+ this._yAxisChangeHandle = this.after("yAxisChange", this._yAxisChangeHandler);+ this._stylesChangeHandle = this.after("stylesChange", function(e) {+ var axesReady = this._updateAxisData();+ if(axesReady)+ {+ this.draw();+ }+ });+ this._widthChangeHandle = this.after("widthChange", function(e) {+ var axesReady = this._updateAxisData();+ if(axesReady)+ {+ this.draw();+ }+ });+ this._heightChangeHandle = this.after("heightChange", function(e) {+ var axesReady = this._updateAxisData();+ if(axesReady)+ {+ this.draw();+ }+ });+ this._visibleChangeHandle = this.after("visibleChange", this._handleVisibleChange);+ },+ + /**+ * Event handler for the xAxisChange event.+ *+ * @method _xAxisChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _xAxisChangeHandler: function(e)+ {+ var xAxis = this.get("xAxis");+ xAxis.after("dataReady", Y.bind(this._xDataChangeHandler, this));+ xAxis.after("dataUpdate", Y.bind(this._xDataChangeHandler, this));+ },+ + /**+ * Event handler the yAxisChange event.+ *+ * @method _yAxisChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _yAxisChangeHandler: function(e)+ {+ var yAxis = this.get("yAxis");+ yAxis.after("dataReady", Y.bind(this._yDataChangeHandler, this));+ yAxis.after("dataUpdate", Y.bind(this._yDataChangeHandler, this));+ },++ /**+ * Constant used to generate unique id.+ *+ * @property GUID+ * @type String+ * @private+ */+ GUID: "yuicartesianseries",++ /**+ * Event handler for xDataChange event.+ *+ * @method _xDataChangeHandler+ * @param {Object} event Event object.+ * @private + */+ _xDataChangeHandler: function(event)+ {+ var axesReady = this._updateAxisData();+ if(axesReady)+ {+ this.draw();+ }+ },++ /**+ * Event handler for yDataChange event.+ *+ * @method _yDataChangeHandler+ * @param {Object} event Event object.+ * @private + */+ _yDataChangeHandler: function(event)+ {+ var axesReady = this._updateAxisData();+ if(axesReady)+ {+ this.draw();+ }+ },++ /**+ * Checks to ensure that both xAxis and yAxis data are available. If so, set the `xData` and `yData` attributes and return `true`. Otherwise, return `false`.+ *+ * @method _updateAxisData+ * @return Boolean+ * @private + */+ _updateAxisData: function()+ {+ var xAxis = this.get("xAxis"),+ yAxis = this.get("yAxis"),+ xKey = this.get("xKey"),+ yKey = this.get("yKey"),+ yData,+ xData;+ if(!xAxis || !yAxis || !xKey || !yKey)+ {+ return false;+ }+ xData = xAxis.getDataByKey(xKey);+ yData = yAxis.getDataByKey(yKey);+ if(!xData || !yData)+ {+ return false;+ }+ this.set("xData", xData.concat());+ this.set("yData", yData.concat());+ return true;+ },++ /**+ * Draws the series is the xAxis and yAxis data are both available.+ *+ * @method validate+ * @private+ */+ validate: function()+ {+ if((this.get("xData") && this.get("yData")) || this._updateAxisData())+ {+ this.draw();+ }+ else+ {+ this.fire("drawingComplete");+ }+ },++ /**+ * Creates a `Graphic` instance.+ *+ * @method _setCanvas+ * @protected+ */+ _setCanvas: function()+ {+ var graph = this.get("graph"),+ graphic = graph.get("graphic");+ this.set("graphic", graphic);+ },++ /**+ * Calculates the coordinates for the series.+ *+ * @method setAreaData+ * @protected+ */+ setAreaData: function()+ {+ var isNumber = Y_Lang.isNumber,+ nextX, nextY,+ graph = this.get("graph"),+ w = graph.get("width"),+ h = graph.get("height"),+ xAxis = this.get("xAxis"),+ yAxis = this.get("yAxis"),+ xData = this.get("xData").concat(),+ yData = this.get("yData").concat(),+ xValue,+ yValue,+ xOffset = xAxis.getEdgeOffset(xData.length, w),+ yOffset = yAxis.getEdgeOffset(yData.length, h),+ padding = this.get("styles").padding,+ leftPadding = padding.left,+ topPadding = padding.top,+ dataWidth = w - (leftPadding + padding.right + xOffset),+ dataHeight = h - (topPadding + padding.bottom + yOffset),+ xcoords = [],+ ycoords = [],+ xMax = xAxis.get("maximum"),+ xMin = xAxis.get("minimum"),+ yMax = yAxis.get("maximum"),+ yMin = yAxis.get("minimum"),+ xScaleFactor = dataWidth / (xMax - xMin),+ yScaleFactor = dataHeight / (yMax - yMin),+ dataLength,+ direction = this.get("direction"),+ i = 0,+ xMarkerPlane = [],+ yMarkerPlane = [],+ xMarkerPlaneOffset = this.get("xMarkerPlaneOffset"),+ yMarkerPlaneOffset = this.get("yMarkerPlaneOffset"),+ graphic = this.get("graphic");+ graphic.set("width", w);+ graphic.set("height", h);+ dataLength = xData.length;+ xOffset *= 0.5;+ yOffset *= 0.5;+ //Assuming a vertical graph has a range/category for its vertical axis. + if(direction === "vertical")+ {+ yData = yData.reverse();+ }+ this._leftOrigin = Math.round(((0 - xMin) * xScaleFactor) + leftPadding + xOffset);+ this._bottomOrigin = Math.round((dataHeight + topPadding + yOffset)); + if(yMin < 0)+ {+ this._bottomOrigin = this._bottomOrigin - ((0 - yMin) * yScaleFactor);+ }+ for (; i < dataLength; ++i) + {+ xValue = parseFloat(xData[i]);+ yValue = parseFloat(yData[i]);+ if(isNumber(xValue))+ {+ nextX = (((xValue - xMin) * xScaleFactor) + leftPadding + xOffset);+ }+ else+ {+ nextX = NaN;+ }+ if(isNumber(yValue))+ {+ nextY = ((dataHeight + topPadding + yOffset) - (yValue - yMin) * yScaleFactor);+ }+ else+ {+ nextY = NaN;+ }+ xcoords.push(nextX);+ ycoords.push(nextY);+ xMarkerPlane.push({start:nextX - xMarkerPlaneOffset, end: nextX + xMarkerPlaneOffset});+ yMarkerPlane.push({start:nextY - yMarkerPlaneOffset, end: nextY + yMarkerPlaneOffset});+ }+ this.set("xcoords", xcoords);+ this.set("ycoords", ycoords);+ this.set("xMarkerPlane", xMarkerPlane);+ this.set("yMarkerPlane", yMarkerPlane);+ this._dataLength = dataLength;+ },++ /**+ * Finds the first valid index of an array coordinates.+ *+ * @method _getFirstValidIndex+ * @param {Array} coords An array of x or y coordinates.+ * @return Number+ * @private+ */+ _getFirstValidIndex: function(coords)+ {+ var coord,+ i = -1,+ limit = coords.length;+ while(!Y_Lang.isNumber(coord) && i < limit)+ {+ i += 1;+ coord = coords[i];+ }+ return i;+ },++ /**+ * Finds the last valid index of an array coordinates.+ *+ * @method _getLastValidIndex+ * @param {Array} coords An array of x or y coordinates.+ * @return Number+ * @private+ */+ _getLastValidIndex: function(coords)+ {+ var coord,+ i = coords.length,+ limit = -1;+ while(!Y_Lang.isNumber(coord) && i > limit)+ {+ i -= 1;+ coord = coords[i];+ }+ return i;+ },++ /**+ * Draws the series.+ *+ * @method draw+ * @protected+ */+ draw: function()+ {+ var graph = this.get("graph"),+ w = graph.get("width"),+ h = graph.get("height");+ if(this.get("rendered"))+ {+ if((isFinite(w) && isFinite(h) && w > 0 && h > 0) && ((this.get("xData") && this.get("yData")) || this._updateAxisData()))+ {+ if(this._drawing)+ {+ this._callLater = true;+ return;+ }+ this._drawing = true;+ this._callLater = false;+ this.setAreaData();+ if(this.get("xcoords") && this.get("ycoords"))+ {+ this.drawSeries();+ }+ this._drawing = false;+ if(this._callLater)+ {+ this.draw();+ }+ else+ {+ this._toggleVisible(this.get("visible"));+ this.fire("drawingComplete");+ }+ }+ }+ },+ + /**+ * Default value for plane offsets when the parent chart's `interactiveType` is `planar`. + *+ * @property _defaultPlaneOffset+ * @type Number+ * @private+ */+ _defaultPlaneOffset: 4,+ + /**+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ * @protected+ */+ _getDefaultStyles: function()+ {+ return {padding:{+ top: 0,+ left: 0,+ right: 0,+ bottom: 0+ }};+ },++ /**+ * Collection of default colors used for lines in a series when not specified by user.+ *+ * @property _defaultLineColors+ * @type Array+ * @protected+ */+ _defaultLineColors:["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"],++ /**+ * Collection of default colors used for marker fills in a series when not specified by user.+ *+ * @property _defaultFillColors+ * @type Array+ * @protected+ */+ _defaultFillColors:["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"],+ + /**+ * Collection of default colors used for marker borders in a series when not specified by user.+ *+ * @property _defaultBorderColors+ * @type Array+ * @protected+ */+ _defaultBorderColors:["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"],+ + /**+ * Collection of default colors used for area fills, histogram fills and pie fills in a series when not specified by user.+ *+ * @property _defaultSliceColors+ * @type Array+ * @protected+ */+ _defaultSliceColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],++ /**+ * Parses a color based on a series order and type.+ *+ * @method _getDefaultColor+ * @param {Number} index Index indicating the series order.+ * @param {String} type Indicates which type of object needs the color.+ * @return String+ * @protected+ */+ _getDefaultColor: function(index, type)+ {+ var colors = {+ line: this._defaultLineColors,+ fill: this._defaultFillColors,+ border: this._defaultBorderColors,+ slice: this._defaultSliceColors+ },+ col = colors[type],+ l = col.length;+ index = index || 0;+ if(index >= l)+ {+ index = index % l;+ }+ type = type || "fill";+ return colors[type][index];+ },+ + /**+ * Shows/hides contents of the series.+ *+ * @method _handleVisibleChange+ * @param {Object} e Event object.+ * @protected+ */+ _handleVisibleChange: function(e) + {+ this._toggleVisible(this.get("visible"));+ },++ /**+ * Returns the sum of all values for the series.+ *+ * @method getTotalValues+ * @return Number+ */+ getTotalValues: function()+ {+ var total = this.get("valueAxis").getTotalByKey(this.get("valueKey"));+ return total;+ },++ /**+ * Destructor implementation for the CartesianSeries class. Calls destroy on all Graphic instances.+ *+ * @method destructor+ * @protected+ */+ destructor: function()+ {+ var marker,+ markers = this.get("markers");+ if(this.get("rendered"))+ {+ if(this._xDataReadyHandle)+ {+ this._xDataReadyHandle.detach();+ }+ if(this._xDataUpdateHandle)+ {+ this._xDataUpdateHandle.detach();+ }+ if(this._yDataReadyHandle)+ {+ this._yDataReadyHandle.detach();+ }+ if(this._yDataUpdateHandle)+ {+ this._yDataUpdateHandle.detach();+ }+ this._xAxisChangeHandle.detach();+ this._yAxisChangeHandle.detach();+ this._stylesChangeHandle.detach();+ this._widthChangeHandle.detach();+ this._heightChangeHandle.detach();+ this._visibleChangeHandle.detach();+ }+ while(markers && markers.length > 0)+ {+ marker = markers.shift();+ if(marker && marker instanceof Y.Shape)+ {+ marker.destroy();+ }+ }+ if(this._path)+ {+ this._path.destroy();+ this._path = null;+ }+ if(this._lineGraphic)+ {+ this._lineGraphic.destroy();+ this._lineGraphic = null;+ }+ if(this._groupMarker)+ {+ this._groupMarker.destroy();+ this._groupMarker = null;+ }+ }+ /**+ * Event handle for the x-axis' dataReady event.+ * + * @property _xDataReadyHandle+ * @type {EventHandle}+ * @private+ */+ + /**+ * Event handle for the x-axis dataUpdate event.+ *+ * @property _xDataUpdateHandle+ * @type {EventHandle}+ * @private+ */+ + /**+ * Event handle for the y-axis dataReady event.+ *+ * @property _yDataReadyHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the y-axis dataUpdate event.+ * @property _yDataUpdateHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the xAxisChange event.+ * @property _xAxisChangeHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the yAxisChange event.+ * @property _yAxisChangeHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the stylesChange event.+ * @property _stylesChangeHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the widthChange event.+ * @property _widthChangeHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the heightChange event.+ * @property _heightChangeHandle+ * @type {EventHandle}+ * @private+ */++ /**+ * Event handle for the visibleChange event.+ * @property _visibleChangeHandle+ * @type {EventHandle}+ * @private+ */+}, {+ ATTRS: {+ /**+ * Name used for for displaying data related to the x-coordinate.+ *+ * @attribute xDisplayName+ * @type String+ */+ xDisplayName: {+ getter: function()+ {+ return this._xDisplayName || this.get("xKey");+ },++ setter: function(val)+ {+ this._xDisplayName = val.toString();+ return val;+ }+ },++ /**+ * Name used for for displaying data related to the y-coordinate.+ *+ * @attribute yDisplayName+ * @type String+ */+ yDisplayName: {+ getter: function()+ {+ return this._yDisplayName || this.get("yKey");+ },++ setter: function(val)+ {+ this._yDisplayName = val.toString();+ return val;+ }+ },+ + /**+ * Name used for for displaying category data+ *+ * @attribute categoryDisplayName+ * @type String+ * @readOnly+ */+ categoryDisplayName: {+ lazyAdd: false,++ getter: function()+ {+ return this.get("direction") == "vertical" ? this.get("yDisplayName") : this.get("xDisplayName");+ },++ setter: function(val)+ {+ if(this.get("direction") == "vertical")+ {+ this._yDisplayName = val;+ }+ else+ {+ this._xDisplayName = val;+ }+ return val;+ }+ },++ /**+ * Name used for for displaying value data+ *+ * @attribute valueDisplayName+ * @type String+ * @readOnly+ */+ valueDisplayName: {+ lazyAdd: false,++ getter: function()+ {+ return this.get("direction") == "vertical" ? this.get("xDisplayName") : this.get("yDisplayName");+ },++ setter: function(val)+ {+ if(this.get("direction") == "vertical")+ {+ this._xDisplayName = val;+ }+ else+ {+ this._yDisplayName = val;+ }+ return val;+ }+ },+ + /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default cartesian+ */+ type: { + value: "cartesian"+ },++ /**+ * Order of this instance of this `type`.+ *+ * @attribute order+ * @type Number+ */+ order: {},++ /**+ * Order of the instance+ *+ * @attribute graphOrder+ * @type Number+ */+ graphOrder: {},++ /**+ * x coordinates for the series.+ *+ * @attribute xcoords+ * @type Array+ */+ xcoords: {},+ + /**+ * y coordinates for the series+ *+ * @attribute ycoords+ * @type Array+ */+ ycoords: {},++ /**+ * Reference to the `Chart` application.+ *+ * @attribute chart+ * @type ChartBase+ * @readOnly+ */+ chart: {+ readOnly: true,++ getter: function()+ {+ return this.get("graph").get("chart");+ }+ },+ + /**+ * Reference to the `Graph` in which the series is drawn into.+ *+ * @attribute graph+ * @type Graph+ */+ graph: {},++ /**+ * Reference to the `Axis` instance used for assigning + * x-values to the graph.+ *+ * @attribute xAxis+ * @type Axis+ */+ xAxis: {},+ + /**+ * Reference to the `Axis` instance used for assigning + * y-values to the graph.+ *+ * @attribute yAxis+ * @type Axis+ */+ yAxis: {},+ + /**+ * Indicates which array to from the hash of value arrays in + * the x-axis `Axis` instance.+ *+ * @attribute xKey+ * @type String+ */+ xKey: {+ setter: function(val)+ {+ return val.toString();+ }+ },++ /**+ * Indicates which array to from the hash of value arrays in + * the y-axis `Axis` instance.+ *+ * @attribute yKey+ * @type String+ */+ yKey: {+ setter: function(val)+ {+ return val.toString();+ }+ },++ /**+ * Array of x values for the series.+ *+ * @attribute xData+ * @type Array+ */+ xData: {},++ /**+ * Array of y values for the series.+ *+ * @attribute yData+ * @type Array+ */+ yData: {},+ + /**+ * Indicates whether the Series has been through its initial set up.+ *+ * @attribute rendered+ * @type Boolean+ */+ rendered: {+ value: false+ },++ /*+ * Returns the width of the parent graph+ *+ * @attribute width+ * @type Number+ */+ width: {+ readOnly: true,+ + getter: function()+ {+ this.get("graph").get("width");+ }+ },++ /**+ * Returns the height of the parent graph+ *+ * @attribute height+ * @type Number+ */+ height: {+ readOnly: true,+ + getter: function()+ {+ this.get("graph").get("height");+ }+ },++ /**+ * Indicates whether to show the series+ *+ * @attribute visible+ * @type Boolean+ * @default true+ */+ visible: {+ value: true+ },++ /**+ * Collection of area maps along the xAxis. Used to determine mouseover for multiple+ * series.+ *+ * @attribute xMarkerPlane+ * @type Array+ */+ xMarkerPlane: {},+ + /**+ * Collection of area maps along the yAxis. Used to determine mouseover for multiple+ * series.+ *+ * @attribute yMarkerPlane+ * @type Array+ */+ yMarkerPlane: {},++ /**+ * Distance from a data coordinate to the left/right for setting a hotspot.+ *+ * @attribute xMarkerPlaneOffset+ * @type Number+ */+ xMarkerPlaneOffset: {+ getter: function() {+ var marker = this.get("styles").marker;+ if(marker && marker.width && isFinite(marker.width))+ {+ return marker.width * 0.5;+ }+ return this._defaultPlaneOffset;+ }+ },++ /**+ * Distance from a data coordinate to the top/bottom for setting a hotspot.+ *+ * @attribute yMarkerPlaneOffset+ * @type Number+ */+ yMarkerPlaneOffset: {+ getter: function() {+ var marker = this.get("styles").marker;+ if(marker && marker.height && isFinite(marker.height))+ {+ return marker.height * 0.5;+ }+ return this._defaultPlaneOffset;+ }+ },++ /**+ * Direction of the series+ *+ * @attribute direction+ * @type String+ */+ direction: {+ value: "horizontal"+ },++ /**+ * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.+ *+ * @attribute groupMarkers+ * @type Boolean+ */+ groupMarkers: {+ getter: function()+ {+ if(this._groupMarkers === undefined)+ {+ return this.get("graph").get("groupMarkers");+ }+ else+ {+ return this._groupMarkers;+ }+ },++ setter: function(val)+ {+ this._groupMarkers = val;+ return val;+ }+ }+ }+});+/**+ * The MarkerSeries class renders quantitative data by plotting relevant data points + * on a graph.+ *+ * @module charts+ * @submodule charts-base+ * @class MarkerSeries+ * @extends CartesianSeries+ * @uses Plots+ * @constructor+ */+Y.MarkerSeries = Y.Base.create("markerSeries", Y.CartesianSeries, [Y.Plots], {+ /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ this.drawPlots();+ },+ + /**+ * @protected+ *+ * Method used by `styles` setter. Overrides base implementation.+ *+ * @method _setStyles+ * @param {Object} newStyles Hash of properties to update.+ * @return Object+ */+ _setStyles: function(val)+ {+ if(!val.marker)+ {+ val = {marker:val};+ }+ val = this._parseMarkerStyles(val);+ return Y.MarkerSeries.superclass._mergeStyles.apply(this, [val, this._getDefaultStyles()]);+ },+ + /**+ * @protected+ *+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ */+ _getDefaultStyles: function()+ {+ var styles = this._mergeStyles({marker:this._getPlotDefaults()}, Y.MarkerSeries.superclass._getDefaultStyles());+ return styles;+ }+},{+ ATTRS : {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default marker+ */+ type: {+ value:"marker"+ }+ + /**+ * Style properties used for drawing markers. This attribute is inherited from `Renderer`. Below are the default values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"]`+ * </dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>width</dt><dd>indicates the width of the marker. The default value is 10.</dd>+ * <dt>height</dt><dd>indicates the height of the marker The default value is 10.</dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++/**+ * The LineSeries class renders quantitative data on a graph by connecting relevant data points.+ *+ * @module charts+ * @submodule charts-base+ * @class LineSeries+ * @extends CartesianSeries+ * @uses Lines+ * @constructor+ */+Y.LineSeries = Y.Base.create("lineSeries", Y.CartesianSeries, [Y.Lines], {+ /**+ * @protected+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ this.drawLines();+ },++ /**+ * @protected+ *+ * Method used by `styles` setter. Overrides base implementation.+ *+ * @method _setStyles+ * @param {Object} newStyles Hash of properties to update.+ * @return Object+ */+ _setStyles: function(val)+ {+ if(!val.line)+ {+ val = {line:val};+ }+ return Y.LineSeries.superclass._setStyles.apply(this, [val]);+ },++ /**+ * @protected+ *+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ */+ _getDefaultStyles: function()+ {+ var styles = this._mergeStyles({line:this._getLineDefaults()}, Y.LineSeries.superclass._getDefaultStyles());+ return styles;+ }+},+{+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default line+ */+ type: {+ value:"line"+ }++ /**+ * Style properties used for drawing lines. This attribute is inherited from `Renderer`. Below are the default values:+ * <dl>+ * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be+ * retrieved from the following array: + * `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]`+ * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>+ * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> + * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>+ * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>+ * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> + * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>+ * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>+ * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++++ ++ +/**+ * SplineSeries renders a graph with data points connected by a curve.+ *+ * @module charts+ * @submodule charts-base+ * @class SplineSeries+ * @constructor+ * @extends CartesianSeries+ * @uses CurveUtil+ * @uses Lines+ */+Y.SplineSeries = Y.Base.create("splineSeries", Y.LineSeries, [Y.CurveUtil, Y.Lines], {+ /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ this.drawSpline();+ }+}, {+ ATTRS : {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default spline+ */+ type : {+ value:"spline"+ }++ /**+ * Style properties used for drawing lines. This attribute is inherited from `Renderer`. Below are the default values:+ * <dl>+ * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be+ * retrieved from the following array: + * `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]`+ * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>+ * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> + * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>+ * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>+ * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> + * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>+ * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>+ * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++++ ++ +/**+ * StackedSplineSeries creates spline graphs in which the different series are stacked along a value axis+ * to indicate their contribution to a cumulative total.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedSplineSeries+ * @constructor+ * @extends SplineSeries+ * @extends StackingUtil+ */+Y.StackedSplineSeries = Y.Base.create("stackedSplineSeries", Y.SplineSeries, [Y.StackingUtil], {+ /**+ * @protected+ *+ * Calculates the coordinates for the series. Overrides base implementation.+ *+ * @method setAreaData+ */+ setAreaData: function()+ { + Y.StackedSplineSeries.superclass.setAreaData.apply(this);+ this._stackCoordinates.apply(this);+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedSpline+ */+ type: {+ value:"stackedSpline"+ }+ }+});++/**+ * StackedMarkerSeries plots markers with different series stacked along the value axis to indicate each+ * series' contribution to a cumulative total.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedMarkerSeries+ * @constructor+ * @extends MarkerSeries+ * @extends StackingUtil+ */+Y.StackedMarkerSeries = Y.Base.create("stackedMarkerSeries", Y.MarkerSeries, [Y.StackingUtil], {+ /**+ * @protected+ *+ * Calculates the coordinates for the series. Overrides base implementation.+ *+ * @method setAreaData+ */+ setAreaData: function()+ { + Y.StackedMarkerSeries.superclass.setAreaData.apply(this);+ this._stackCoordinates.apply(this);+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedMarker+ */+ type: {+ value:"stackedMarker"+ }+ }+});++/**+ * The ColumnSeries class renders columns positioned horizontally along a category or time axis. The columns'+ * lengths are proportional to the values they represent along a vertical axis.+ * and the relevant data points.+ *+ * @module charts+ * @submodule charts-base+ * @class ColumnSeries+ * @extends MarkerSeries+ * @uses Histogram+ * @constructor+ */+Y.ColumnSeries = Y.Base.create("columnSeries", Y.MarkerSeries, [Y.Histogram], {+ /**+ * Helper method for calculating the size of markers. + *+ * @method _getMarkerDimensions+ * @param {Number} xcoord The x-coordinate representing the data point for the marker.+ * @param {Number} ycoord The y-coordinate representing the data point for the marker.+ * @param {Number} calculatedSize The calculated size for the marker. For a `BarSeries` is it the width. For a `ColumnSeries` it is the height.+ * @param {Number} offset Distance of position offset dictated by other marker series in the same graph.+ * @return Object+ * @private+ */+ _getMarkerDimensions: function(xcoord, ycoord, calculatedSize, offset)+ {+ var config = {+ left: xcoord + offset+ };+ if(this._bottomOrigin >= ycoord)+ {+ config.top = ycoord;+ config.calculatedSize = this._bottomOrigin - config.top;+ }+ else+ {+ config.top = this._bottomOrigin;+ config.calculatedSize = ycoord - this._bottomOrigin;+ }+ return config;+ },++ /**+ * Resizes and positions markers based on a mouse interaction.+ *+ * @method updateMarkerState+ * @param {String} type state of the marker+ * @param {Number} i index of the marker+ * @protected+ */+ updateMarkerState: function(type, i)+ {+ if(this._markers && this._markers[i])+ {+ var styles = Y.clone(this.get("styles").marker),+ markerStyles,+ state = this._getState(type),+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ marker = this._markers[i],+ markers,+ graph = this.get("graph"),+ seriesStyles,+ seriesCollection = graph.seriesTypes[this.get("type")],+ seriesLen = seriesCollection.length,+ seriesSize = 0,+ offset = 0,+ renderer,+ n = 0,+ xs = [],+ order = this.get("order"),+ config;+ markerStyles = state == "off" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]); + markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);+ markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);+ config = this._getMarkerDimensions(xcoords[i], ycoords[i], styles.width, offset);+ markerStyles.height = config.calculatedSize;+ markerStyles.width = Math.min(this._maxSize, markerStyles.width);+ marker.set(markerStyles);+ for(; n < seriesLen; ++n)+ {+ xs[n] = xcoords[i] + seriesSize;+ seriesStyles = seriesCollection[n].get("styles").marker;+ seriesSize += Math.min(this._maxSize, seriesStyles.width);+ if(order > n)+ {+ offset = seriesSize;+ }+ offset -= seriesSize/2;+ }+ for(n = 0; n < seriesLen; ++n)+ {+ markers = seriesCollection[n].get("markers");+ if(markers)+ {+ renderer = markers[i];+ if(renderer && renderer !== undefined)+ {+ renderer.set("x", (xs[n] - seriesSize/2));+ }+ }+ }+ }+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @readOnly+ * @default column+ */+ type: {+ value: "column"+ }+ + /**+ * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>width</dt><dd>indicates the width of the marker. The default value is 12.</dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});+/**+ * The BarSeries class renders bars positioned vertically along a category or time axis. The bars'+ * lengths are proportional to the values they represent along a horizontal axis.+ * and the relevant data points.+ *+ * @module charts+ * @submodule charts-base+ * @class BarSeries+ * @extends MarkerSeries+ * @uses Histogram+ * @constructor+ */+Y.BarSeries = Y.Base.create("barSeries", Y.MarkerSeries, [Y.Histogram], {+ /**+ * Helper method for calculating the size of markers. + *+ * @method _getMarkerDimensions+ * @param {Number} xcoord The x-coordinate representing the data point for the marker.+ * @param {Number} ycoord The y-coordinate representing the data point for the marker.+ * @param {Number} calculatedSize The calculated size for the marker. For a `BarSeries` is it the width. For a `ColumnSeries` it is the height.+ * @param {Number} offset Distance of position offset dictated by other marker series in the same graph.+ * @return Object+ * @private+ */+ _getMarkerDimensions: function(xcoord, ycoord, calculatedSize, offset)+ {+ var config = {+ top: ycoord + offset+ };+ if(xcoord >= this._leftOrigin)+ {+ config.left = this._leftOrigin;+ config.calculatedSize = xcoord - config.left;+ }+ else+ {+ config.left = xcoord;+ config.calculatedSize = this._leftOrigin - xcoord;+ }+ return config;+ },+ + /**+ * Resizes and positions markers based on a mouse interaction.+ *+ * @method updateMarkerState+ * @param {String} type state of the marker+ * @param {Number} i index of the marker+ * @protected+ */+ updateMarkerState: function(type, i)+ {+ if(this._markers && this._markers[i])+ {+ var styles = Y.clone(this.get("styles").marker),+ markerStyles,+ state = this._getState(type),+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ marker = this._markers[i],+ markers,+ graph = this.get("graph"),+ seriesCollection = graph.seriesTypes[this.get("type")],+ seriesLen = seriesCollection.length,+ seriesStyles,+ seriesSize = 0,+ offset = 0,+ renderer,+ n = 0,+ ys = [],+ order = this.get("order"),+ config;+ markerStyles = state == "off" || !styles[state] ? styles : styles[state]; + markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);+ markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);+ config = this._getMarkerDimensions(xcoords[i], ycoords[i], styles.height, offset);+ markerStyles.width = config.calculatedSize;+ markerStyles.height = Math.min(this._maxSize, markerStyles.height);+ marker.set(markerStyles);+ for(; n < seriesLen; ++n)+ {+ ys[n] = ycoords[i] + seriesSize;+ seriesStyles = seriesCollection[n].get("styles").marker;+ seriesSize += Math.min(this._maxSize, seriesStyles.height); + if(order > n)+ {+ offset = seriesSize;+ }+ offset -= seriesSize/2;+ }+ for(n = 0; n < seriesLen; ++n)+ {+ markers = seriesCollection[n].get("markers");+ if(markers)+ {+ renderer = markers[i];+ if(renderer && renderer !== undefined)+ {+ renderer.set("y", (ys[n] - seriesSize/2));+ }+ }+ }+ }+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default bar+ */+ type: {+ value: "bar"+ },++ /**+ * Indicates the direction of the category axis that the bars are plotted against.+ *+ * @attribute direction+ * @type String+ */+ direction: {+ value: "vertical"+ }+ + /**+ * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>height</dt><dd>indicates the width of the marker. The default value is 12.</dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});+/**+ * The AreaSeries class renders quantitative data on a graph by creating a fill between 0+ * and the relevant data points.+ *+ * @module charts+ * @submodule charts-base+ * @class AreaSeries+ * @extends CartesianSeries+ * @uses Fills+ * @constructor+ */+Y.AreaSeries = Y.Base.create("areaSeries", Y.CartesianSeries, [Y.Fills], {+ /**+ * @protected+ *+ * Renders the series. + *+ * @method drawSeries+ */+ drawSeries: function()+ {+ this.drawFill.apply(this, this._getClosingPoints());+ },+ + /**+ * @protected+ *+ * Method used by `styles` setter. Overrides base implementation.+ *+ * @method _setStyles+ * @param {Object} newStyles Hash of properties to update.+ * @return Object+ */+ _setStyles: function(val)+ {+ if(!val.area)+ {+ val = {area:val};+ }+ return Y.AreaSeries.superclass._setStyles.apply(this, [val]);+ },++ /**+ * @protected+ *+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ */+ _getDefaultStyles: function()+ {+ var styles = this._mergeStyles({area:this._getAreaDefaults()}, Y.AreaSeries.superclass._getDefaultStyles());+ return styles;+ }+},+{+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default area+ */+ type: {+ value:"area"+ }+ + /**+ * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values:+ *+ * <dl>+ * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be + * retrieved from the following array:+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++++ ++ +/**+ * AreaSplineSeries renders an area graph with data points connected by a curve.+ *+ * @module charts+ * @submodule charts-base+ * @class AreaSplineSeries+ * @constructor+ * @extends CartesianSeries+ * @uses Fills+ * @uses CurveUtil+ */+Y.AreaSplineSeries = Y.Base.create("areaSplineSeries", Y.AreaSeries, [Y.CurveUtil], {+ /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ this.drawAreaSpline();+ }+}, {+ ATTRS : {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default areaSpline+ */+ type: {+ value:"areaSpline"+ }+ + /**+ * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values:+ *+ * <dl>+ * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be + * retrieved from the following array:+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++/**+ * StackedAreaSplineSeries creates a stacked area chart with points data points connected by a curve.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedAreaSplineSeries+ * @constructor+ * @extends AreaSeries+ * @uses CurveUtil+ * @uses StackingUtil+ */+Y.StackedAreaSplineSeries = Y.Base.create("stackedAreaSplineSeries", Y.AreaSeries, [Y.CurveUtil, Y.StackingUtil], {+ /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ this._stackCoordinates();+ this.drawStackedAreaSpline();+ }+}, {+ ATTRS : {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedAreaSpline+ */+ type: {+ value:"stackedAreaSpline"+ }+ }+});++/**+ * The ComboSeries class renders a combination of lines, plots and area fills in a single series. Each+ * series type has a corresponding boolean attribute indicating if it is rendered. By default, lines and plots + * are rendered and area is not. + *+ * @module charts+ * @submodule charts-base+ * @class ComboSeries+ * @extends CartesianSeries + * @uses Fills+ * @uses Lines+ * @uses Plots+ * @constructor+ */+Y.ComboSeries = Y.Base.create("comboSeries", Y.CartesianSeries, [Y.Fills, Y.Lines, Y.Plots], {+ /**+ * @protected+ * + * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ if(this.get("showAreaFill"))+ {+ this.drawFill.apply(this, this._getClosingPoints());+ }+ if(this.get("showLines")) + {+ this.drawLines();+ }+ if(this.get("showMarkers"))+ {+ this.drawPlots();+ } + },+ + /**+ * Toggles visibility+ *+ * @method _toggleVisible+ * @param {Boolean} visible indicates visibilitye+ * @private+ */+ _toggleVisible: function(visible)+ {+ var markers,+ marker,+ len,+ i;+ if(this.get("showAreaFill") && this._path)+ {+ this._path.set("visible", visible);+ }+ if(this.get("showLines") && this._lineGraphic)+ {+ this._lineGraphic.set("visible", visible);+ }+ if(this.get("showMarkers"))+ {+ markers = this.get("markers");+ if(markers)+ {+ i = 0;+ len = markers.length;+ for(; i < len; ++i)+ {+ marker = markers[i];+ if(marker)+ {+ marker.set("visible", visible);+ }+ }+ }+ }+ },++ /**+ * @protected+ *+ * Returns the default hash for the `styles` attribute.+ *+ * @method _getDefaultStyles+ * @return Object+ */+ _getDefaultStyles: function()+ {+ var styles = Y.ComboSeries.superclass._getDefaultStyles();+ styles.line = this._getLineDefaults();+ styles.marker = this._getPlotDefaults();+ styles.area = this._getAreaDefaults();+ return styles;+ }+},+{+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default combo+ */+ type: {+ value:"combo"+ },++ /**+ * Indicates whether a fill is displayed.+ *+ * @attribute showAreaFill+ * @type Boolean+ * @default false+ */+ showAreaFill: {+ value: false+ },++ /**+ * Indicates whether lines are displayed.+ *+ * @attribute showLines+ * @type Boolean+ * @default true+ */+ showLines: {+ value: true+ },++ /**+ * Indicates whether markers are displayed.+ *+ * @attribute showMarkers+ * @type Boolean+ * @default true+ */+ showMarkers: {+ value: true+ },++ /**+ * Reference to the styles of the markers. These styles can also+ * be accessed through the `styles` attribute. Below are default+ * values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"]`+ * </dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>width</dt><dd>indicates the width of the marker. The default value is 10.</dd>+ * <dt>height</dt><dd>indicates the height of the marker The default value is 10.</dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute marker+ * @type Object+ */+ marker: {+ lazyAdd: false,+ getter: function()+ {+ return this.get("styles").marker;+ },+ setter: function(val)+ {+ this.set("styles", {marker:val});+ }+ },+ + /**+ * Reference to the styles of the lines. These styles can also be accessed through the `styles` attribute.+ * Below are the default values:+ * <dl>+ * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be+ * retrieved from the following array: + * `["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"]`+ * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>+ * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> + * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>+ * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>+ * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> + * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>+ * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>+ * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>+ * </dl>+ *+ * @attribute line+ * @type Object+ */+ line: {+ lazyAdd: false,+ getter: function()+ {+ return this.get("styles").line;+ },+ setter: function(val)+ {+ this.set("styles", {line:val});+ }+ },+ + /**+ * Reference to the styles of the area fills. These styles can also be accessed through the `styles` attribute.+ * Below are the default values:+ *+ * <dl>+ * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be + * retrieved from the following array:+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>+ * </dl>+ *+ * @attribute area+ * @type Object+ */+ area: {+ lazyAdd: false,+ getter: function()+ {+ return this.get("styles").area;+ },+ setter: function(val)+ {+ this.set("styles", {area:val});+ }+ }++ /**+ * Style properties for the series. Contains a key indexed hash of the following:+ * <dl>+ * <dt>marker</dt><dd>Style properties for the markers in the series. Specific style attributes are listed+ * <a href="#attr_marker">here</a>.</dd>+ * <dt>line</dt><dd>Style properties for the lines in the series. Specific+ * style attributes are listed <a href="#attr_line">here</a>.</dd>+ * <dt>area</dt><dd>Style properties for the area fills in the series. Specific style attributes are listed+ * <a href="#attr_area">here</a>.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++++ ++ +/**+ * The StackedComboSeries class renders a combination of lines, plots and area fills in a single series. Series+ * are stacked along the value axis to indicate each series contribution to a cumulative total. Each+ * series type has a corresponding boolean attribute indicating if it is rendered. By default, all three types are+ * rendered. + *+ * @module charts+ * @submodule charts-base+ * @class StackedComboSeries+ * @extends ComboSeries+ * @uses StackingUtil+ * @constructor+ */+Y.StackedComboSeries = Y.Base.create("stackedComboSeries", Y.ComboSeries, [Y.StackingUtil], {+ /**+ * @protected+ *+ * Calculates the coordinates for the series. Overrides base implementation.+ *+ * @method setAreaData+ */+ setAreaData: function()+ { + Y.StackedComboSeries.superclass.setAreaData.apply(this);+ this._stackCoordinates.apply(this);+ },+ + /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ if(this.get("showAreaFill"))+ {+ this.drawFill.apply(this, this._getStackedClosingPoints());+ }+ if(this.get("showLines")) + {+ this.drawLines();+ }+ if(this.get("showMarkers"))+ {+ this.drawPlots();+ } + }+ +}, {+ ATTRS : {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedCombo+ */+ type: {+ value: "stackedCombo"+ },++ /**+ * Indicates whether a fill is displayed.+ *+ * @attribute showAreaFill+ * @type Boolean+ * @default true+ */+ showAreaFill: {+ value: true+ }+ }+});+/**+ * The ComboSplineSeries class renders a combination of splines, plots and areaspline fills in a single series. Each+ * series type has a corresponding boolean attribute indicating if it is rendered. By default, splines and plots + * are rendered and areaspline is not. + *+ * @module charts+ * @submodule charts-base+ * @class ComboSplineSeries+ * @extends ComboSeries+ * @extends CurveUtil+ * @constructor+ */+Y.ComboSplineSeries = Y.Base.create("comboSplineSeries", Y.ComboSeries, [Y.CurveUtil], {+ /**+ * @protected+ * + * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ if(this.get("showAreaFill"))+ {+ this.drawAreaSpline();+ }+ if(this.get("showLines")) + {+ this.drawSpline();+ }+ if(this.get("showMarkers"))+ {+ this.drawPlots();+ } + }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default comboSpline+ */+ type: {+ value : "comboSpline"+ }+ }+});+/**+ * The StackedComboSplineSeries class renders a combination of splines, plots and areaspline fills in a single series. Series+ * are stacked along the value axis to indicate each series contribution to a cumulative total. Each+ * series type has a corresponding boolean attribute indicating if it is rendered. By default, all three types are+ * rendered. + *+ * @module charts+ * @submodule charts-base+ * @class StackedComboSplineSeries+ * @extends StackedComboSeries+ * @uses CurveUtil+ * @constructor+ */+Y.StackedComboSplineSeries = Y.Base.create("stackedComboSplineSeries", Y.StackedComboSeries, [Y.CurveUtil], {+ /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ if(this.get("showAreaFill"))+ {+ this.drawStackedAreaSpline();+ }+ if(this.get("showLines")) + {+ this.drawSpline();+ }+ if(this.get("showMarkers"))+ {+ this.drawPlots();+ } + }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedComboSpline+ */+ type : {+ value : "stackedComboSpline"+ },++ /**+ * Indicates whether a fill is displayed.+ *+ * @attribute showAreaFill+ * @type Boolean+ * @default true+ */+ showAreaFill: {+ value: true+ }+ }+});+/**+ * StackedLineSeries creates line graphs in which the different series are stacked along a value axis+ * to indicate their contribution to a cumulative total.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedLineSeries+ * @constructor+ * @extends LineSeries+ * @uses StackingUtil+ */+Y.StackedLineSeries = Y.Base.create("stackedLineSeries", Y.LineSeries, [Y.StackingUtil], {+ /**+ * @protected+ *+ * Calculates the coordinates for the series. Overrides base implementation.+ *+ * @method setAreaData+ */+ setAreaData: function()+ { + Y.StackedLineSeries.superclass.setAreaData.apply(this);+ this._stackCoordinates.apply(this);+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedLine+ */+ type: {+ value:"stackedLine"+ }+ }+});+/**+ * StackedAreaSeries area fills to display data showing its contribution to a whole.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedAreaSeries+ * @constructor+ * @param {Object} config (optional) Configuration parameters for the Chart.+ * @extends AreaSeries+ * @uses StackingUtil+ */+Y.StackedAreaSeries = Y.Base.create("stackedAreaSeries", Y.AreaSeries, [Y.StackingUtil], {+ /**+ * @protected+ *+ * Calculates the coordinates for the series. Overrides base implementation.+ *+ * @method setAreaData+ */+ setAreaData: function()+ { + Y.StackedAreaSeries.superclass.setAreaData.apply(this);+ this._stackCoordinates.apply(this);+ },++ /**+ * @protected+ *+ * Draws the series+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ this.drawFill.apply(this, this._getStackedClosingPoints());+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedArea+ */+ type: {+ value:"stackedArea"+ }+ }+});+/**+ * The StackedColumnSeries renders column chart in which series are stacked vertically to show+ * their contribution to the cumulative total.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedColumnSeries+ * @extends ColumnSeries+ * @uses StackingUtil+ * @constructor+ */+Y.StackedColumnSeries = Y.Base.create("stackedColumnSeries", Y.ColumnSeries, [Y.StackingUtil], {+ /**+ * Draws the series.+ *+ * @method drawSeries+ * @protected+ */+ drawSeries: function()+ {+ if(this.get("xcoords").length < 1) + {+ return;+ }+ var isNumber = Y_Lang.isNumber,+ style = Y.clone(this.get("styles").marker), + w = style.width,+ h = style.height,+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ i = 0,+ len = xcoords.length,+ top = ycoords[0],+ type = this.get("type"),+ graph = this.get("graph"),+ seriesCollection = graph.seriesTypes[type],+ ratio,+ order = this.get("order"),+ graphOrder = this.get("graphOrder"),+ left,+ marker,+ fillColors,+ borderColors,+ lastCollection,+ negativeBaseValues,+ positiveBaseValues,+ useOrigin = order === 0,+ totalWidth = len * w,+ dimensions = {+ width: [],+ height: []+ },+ xvalues = [],+ yvalues = [],+ groupMarkers = this.get("groupMarkers");+ if(Y_Lang.isArray(style.fill.color))+ {+ fillColors = style.fill.color.concat(); + }+ if(Y_Lang.isArray(style.border.color))+ {+ borderColors = style.border.color.concat();+ }+ this._createMarkerCache();+ if(totalWidth > this.get("width"))+ {+ ratio = this.width/totalWidth;+ w *= ratio;+ w = Math.max(w, 1);+ }+ if(!useOrigin)+ {+ lastCollection = seriesCollection[order - 1];+ negativeBaseValues = lastCollection.get("negativeBaseValues");+ positiveBaseValues = lastCollection.get("positiveBaseValues");+ if(!negativeBaseValues || !positiveBaseValues)+ {+ useOrigin = true;+ positiveBaseValues = [];+ negativeBaseValues = [];+ }+ }+ else+ {+ negativeBaseValues = [];+ positiveBaseValues = [];+ }+ this.set("negativeBaseValues", negativeBaseValues);+ this.set("positiveBaseValues", positiveBaseValues);+ for(i = 0; i < len; ++i)+ {+ left = xcoords[i];+ top = ycoords[i];+ + if(!isNumber(top) || !isNumber(left))+ {+ if(useOrigin)+ {+ negativeBaseValues[i] = this._bottomOrigin;+ positiveBaseValues[i] = this._bottomOrigin;+ }+ this._markers.push(null); + continue;+ }+ if(useOrigin)+ {+ h = Math.abs(this._bottomOrigin - top);+ if(top < this._bottomOrigin)+ {+ positiveBaseValues[i] = top;+ negativeBaseValues[i] = this._bottomOrigin;+ }+ else if(top > this._bottomOrigin)+ {+ positiveBaseValues[i] = this._bottomOrigin;+ negativeBaseValues[i] = top;+ top -= h;+ }+ else+ {+ positiveBaseValues[i] = top;+ negativeBaseValues[i] = top;+ }+ }+ else + {+ if(top > this._bottomOrigin)+ {+ top += (negativeBaseValues[i] - this._bottomOrigin);+ h = top - negativeBaseValues[i];+ negativeBaseValues[i] = top;+ top -= h;+ }+ else if(top <= this._bottomOrigin)+ {+ top = positiveBaseValues[i] - (this._bottomOrigin - top);+ h = positiveBaseValues[i] - top;+ positiveBaseValues[i] = top;+ }+ }+ if(!isNaN(h) && h > 0)+ {+ left -= w/2;+ if(groupMarkers)+ {+ dimensions.width[i] = w;+ dimensions.height[i] = h;+ xvalues.push(left);+ yvalues.push(top);+ }+ else+ {+ style.width = w;+ style.height = h;+ style.x = left;+ style.y = top;+ if(fillColors)+ {+ style.fill.color = fillColors[i % fillColors.length];+ }+ if(borderColors)+ {+ style.border.color = borderColors[i % borderColors.length];+ }+ marker = this.getMarker(style, graphOrder, i);+ }+ }+ else if(!groupMarkers)+ {+ this._markers.push(null);+ }+ }+ if(groupMarkers)+ {+ this._createGroupMarker({+ fill: style.fill,+ border: style.border,+ dimensions: dimensions,+ xvalues: xvalues,+ yvalues: yvalues,+ shape: style.shape+ });+ }+ else+ {+ this._clearMarkerCache();+ }+ },++ /**+ * Resizes and positions markers based on a mouse interaction.+ *+ * @method updateMarkerState+ * @param {String} type state of the marker+ * @param {Number} i index of the marker+ * @protected+ */+ updateMarkerState: function(type, i)+ {+ if(this._markers && this._markers[i])+ {+ var styles,+ markerStyles,+ state = this._getState(type),+ xcoords = this.get("xcoords"),+ marker = this._markers[i],+ offset = 0,+ fillColor,+ borderColor; + styles = this.get("styles").marker;+ offset = styles.width * 0.5;+ markerStyles = state == "off" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]); + markerStyles.height = marker.get("height");+ markerStyles.x = (xcoords[i] - offset);+ markerStyles.y = marker.get("y");+ markerStyles.id = marker.get("id");+ fillColor = markerStyles.fill.color; + borderColor = markerStyles.border.color;+ if(Y_Lang.isArray(fillColor))+ {+ markerStyles.fill.color = fillColor[i % fillColor.length];+ }+ else+ {+ markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);+ }+ if(Y_Lang.isArray(borderColor))+ {+ markerStyles.border.color = borderColor[i % borderColor.length];+ }+ else+ {+ markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);+ }+ marker.set(markerStyles);+ }+ },+ + /**+ * Gets the default values for the markers. + *+ * @method _getPlotDefaults+ * @return Object+ * @protected+ */+ _getPlotDefaults: function()+ {+ var defs = {+ fill:{+ type: "solid",+ alpha: 1,+ colors:null,+ alphas: null,+ ratios: null+ },+ border:{+ weight: 0,+ alpha: 1+ },+ width: 24,+ height: 24,+ shape: "rect",++ padding:{+ top: 0,+ left: 0,+ right: 0,+ bottom: 0+ }+ };+ defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");+ defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");+ return defs;+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedColumn+ */+ type: {+ value: "stackedColumn"+ },++ /**+ * @attribute negativeBaseValues+ * @type Array+ * @default null+ * @private+ */+ negativeBaseValues: {+ value: null+ },++ /**+ * @attribute positiveBaseValues+ * @type Array+ * @default null+ * @private+ */+ positiveBaseValues: {+ value: null+ }+ + /**+ * Style properties used for drawing markers. This attribute is inherited from `ColumnSeries`. Below are the default values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>width</dt><dd>indicates the width of the marker. The default value is 24.</dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++/**+ * The StackedBarSeries renders bar chart in which series are stacked horizontally to show+ * their contribution to the cumulative total.+ *+ * @module charts+ * @submodule charts-base+ * @class StackedBarSeries+ * @extends BarSeries+ * @uses StackingUtil+ * @constructor+ */+Y.StackedBarSeries = Y.Base.create("stackedBarSeries", Y.BarSeries, [Y.StackingUtil], {+ /**+ * @protected+ *+ * Draws the series.+ *+ * @method drawSeries+ */+ drawSeries: function()+ {+ if(this.get("xcoords").length < 1) + {+ return;+ }++ var isNumber = Y_Lang.isNumber,+ style = Y.clone(this.get("styles").marker),+ w = style.width,+ h = style.height,+ xcoords = this.get("xcoords"),+ ycoords = this.get("ycoords"),+ i = 0,+ len = xcoords.length,+ top = ycoords[0],+ type = this.get("type"),+ graph = this.get("graph"),+ seriesCollection = graph.seriesTypes[type],+ ratio,+ order = this.get("order"),+ graphOrder = this.get("graphOrder"),+ left,+ marker,+ lastCollection,+ negativeBaseValues,+ positiveBaseValues,+ fillColors,+ borderColors,+ useOrigin = order === 0,+ totalHeight = len * h,+ dimensions = {+ width: [],+ height: []+ },+ xvalues = [],+ yvalues = [],+ groupMarkers = this.get("groupMarkers");+ if(Y_Lang.isArray(style.fill.color))+ {+ fillColors = style.fill.color.concat(); + }+ if(Y_Lang.isArray(style.border.color))+ {+ borderColors = style.border.color.concat();+ }+ this._createMarkerCache();+ if(totalHeight > this.get("height"))+ {+ ratio = this.height/totalHeight;+ h *= ratio;+ h = Math.max(h, 1);+ }+ if(!useOrigin)+ {+ lastCollection = seriesCollection[order - 1];+ negativeBaseValues = lastCollection.get("negativeBaseValues");+ positiveBaseValues = lastCollection.get("positiveBaseValues");+ if(!negativeBaseValues || !positiveBaseValues)+ {+ useOrigin = true;+ positiveBaseValues = [];+ negativeBaseValues = [];+ }+ }+ else+ {+ negativeBaseValues = [];+ positiveBaseValues = [];+ }+ this.set("negativeBaseValues", negativeBaseValues);+ this.set("positiveBaseValues", positiveBaseValues);+ for(i = 0; i < len; ++i)+ {+ top = ycoords[i];+ left = xcoords[i];+ if(!isNumber(top) || !isNumber(left))+ {+ if(useOrigin)+ {+ positiveBaseValues[i] = this._leftOrigin;+ negativeBaseValues[i] = this._leftOrigin;+ }+ this._markers.push(null);+ continue;+ }+ if(useOrigin)+ {+ w = Math.abs(left - this._leftOrigin);+ if(left > this._leftOrigin)+ {+ positiveBaseValues[i] = left;+ negativeBaseValues[i] = this._leftOrigin;+ left -= w;+ }+ else if(left < this._leftOrigin)+ { + positiveBaseValues[i] = this._leftOrigin;+ negativeBaseValues[i] = left;+ }+ else+ {+ positiveBaseValues[i] = left;+ negativeBaseValues[i] = this._leftOrigin;+ }+ }+ else+ {+ if(left < this._leftOrigin)+ {+ left = negativeBaseValues[i] - (this._leftOrigin - xcoords[i]);+ w = negativeBaseValues[i] - left;+ negativeBaseValues[i] = left;+ }+ else if(left >= this._leftOrigin)+ {+ left += (positiveBaseValues[i] - this._leftOrigin);+ w = left - positiveBaseValues[i];+ positiveBaseValues[i] = left;+ left -= w;+ }+ }+ if(!isNaN(w) && w > 0)+ {+ top -= h/2;+ if(groupMarkers)+ {+ dimensions.width[i] = w;+ dimensions.height[i] = h;+ xvalues.push(left);+ yvalues.push(top);+ }+ else+ {+ style.width = w;+ style.height = h;+ style.x = left;+ style.y = top;+ if(fillColors)+ {+ style.fill.color = fillColors[i % fillColors.length];+ }+ if(borderColors)+ {+ style.border.color = borderColors[i % borderColors.length];+ }+ marker = this.getMarker(style, graphOrder, i);+ }+ }+ else if(!groupMarkers)+ {+ this._markers.push(null);+ }+ }+ if(groupMarkers)+ {+ this._createGroupMarker({+ fill: style.fill,+ border: style.border,+ dimensions: dimensions,+ xvalues: xvalues,+ yvalues: yvalues,+ shape: style.shape+ });+ }+ else+ {+ this._clearMarkerCache();+ }+ },++ /**+ * @protected+ *+ * Resizes and positions markers based on a mouse interaction.+ *+ * @method updateMarkerState+ * @param {String} type state of the marker+ * @param {Number} i index of the marker+ */+ updateMarkerState: function(type, i)+ {+ if(this._markers[i])+ {+ var state = this._getState(type),+ ycoords = this.get("ycoords"),+ marker = this._markers[i],+ styles = this.get("styles").marker,+ h = styles.height,+ markerStyles = state == "off" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]), + fillColor,+ borderColor; + markerStyles.y = (ycoords[i] - h/2);+ markerStyles.x = marker.get("x");+ markerStyles.width = marker.get("width");+ markerStyles.id = marker.get("id");+ fillColor = markerStyles.fill.color; + borderColor = markerStyles.border.color;+ if(Y_Lang.isArray(fillColor))+ {+ markerStyles.fill.color = fillColor[i % fillColor.length];+ }+ else+ {+ markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);+ }+ if(Y_Lang.isArray(borderColor))+ {+ markerStyles.border.color = borderColor[i % borderColor.length];+ }+ else+ {+ markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);+ }+ marker.set(markerStyles);+ }+ },+ + /**+ * @protected+ *+ * Returns default values for the `styles` attribute.+ * + * @method _getPlotDefaults+ * @return Object+ */+ _getPlotDefaults: function()+ {+ var defs = {+ fill:{+ type: "solid",+ alpha: 1,+ colors:null,+ alphas: null,+ ratios: null+ },+ border:{+ weight: 0,+ alpha: 1+ },+ width: 24,+ height: 24,+ shape: "rect",++ padding:{+ top: 0,+ left: 0,+ right: 0,+ bottom: 0+ }+ };+ defs.fill.color = this._getDefaultColor(this.get("graphOrder"), "fill");+ defs.border.color = this._getDefaultColor(this.get("graphOrder"), "border");+ return defs;+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default stackedBar+ */+ type: {+ value: "stackedBar"+ },++ /**+ * Direction of the series+ *+ * @attribute direction+ * @type String+ * @default vertical+ */+ direction: {+ value: "vertical"+ },++ /**+ * @private+ *+ * @attribute negativeBaseValues+ * @type Array+ * @default null+ */+ negativeBaseValues: {+ value: null+ },++ /**+ * @private+ *+ * @attribute positiveBaseValues+ * @type Array+ * @default null+ */+ positiveBaseValues: {+ value: null+ }+ + /**+ * Style properties used for drawing markers. This attribute is inherited from `BarSeries`. Below are the default values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color+ * will be retrieved from the below array:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>height</dt><dd>indicates the width of the marker. The default value is 24.</dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});++/**+ * PieSeries visualizes data as a circular chart divided into wedges which represent data as a + * percentage of a whole.+ *+ * @module charts+ * @submodule charts-base+ * @class PieSeries+ * @constructor+ * @extends MarkerSeries+ */+Y.PieSeries = Y.Base.create("pieSeries", Y.MarkerSeries, [], { + /**+ * Image map used for interactivity when rendered with canvas.+ *+ * @property _map+ * @type HTMLElement+ * @private+ */+ _map: null,++ /**+ * Image used for image map when rendered with canvas.+ *+ * @property _image+ * @type HTMLElement+ * @private+ */+ _image: null,++ /**+ * Creates or updates the image map when rendered with canvas.+ *+ * @method _setMap+ * @private+ */+ _setMap: function()+ {+ var id = "pieHotSpotMapi_" + Math.round(100000 * Math.random()),+ cb = this.get("graph").get("contentBox"),+ areaNode;+ if(this._image)+ {+ cb.removeChild(this._image);+ while(this._areaNodes && this._areaNodes.length > 0)+ {+ areaNode = this._areaNodes.shift();+ this._map.removeChild(areaNode);+ }+ cb.removeChild(this._map);+ }+ this._image = DOCUMENT.createElement("img"); + this._image.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==";+ cb.appendChild(this._image);+ this._image.setAttribute("usemap", "#" + id);+ this._image.style.zIndex = 3;+ this._image.style.opacity = 0;+ this._image.setAttribute("alt", "imagemap");+ this._map = DOCUMENT.createElement("map");+ this._map.style.zIndex = 5;+ cb.appendChild(this._map);+ this._map.setAttribute("name", id);+ this._map.setAttribute("id", id);+ this._areaNodes = [];+ },++ /**+ * Storage for `categoryDisplayName` attribute.+ *+ * @property _categoryDisplayName+ * @private+ */+ _categoryDisplayName: null,+ + /**+ * Storage for `valueDisplayName` attribute.+ *+ * @property _valueDisplayName+ * @private+ */+ _valueDisplayName: null,++ /**+ * Adds event listeners.+ *+ * @method addListeners+ * @private+ */+ addListeners: function()+ {+ var categoryAxis = this.get("categoryAxis"),+ valueAxis = this.get("valueAxis");+ if(categoryAxis)+ {+ categoryAxis.after("dataReady", Y.bind(this._categoryDataChangeHandler, this));+ categoryAxis.after("dataUpdate", Y.bind(this._categoryDataChangeHandler, this));+ }+ if(valueAxis)+ {+ valueAxis.after("dataReady", Y.bind(this._valueDataChangeHandler, this));+ valueAxis.after("dataUpdate", Y.bind(this._valueDataChangeHandler, this));+ }+ this.after("categoryAxisChange", this.categoryAxisChangeHandler);+ this.after("valueAxisChange", this.valueAxisChangeHandler);+ this.after("stylesChange", this._updateHandler);+ },+ + /**+ * Draws the series.+ *+ * @method validate+ * @private+ */+ validate: function()+ {+ this.draw();+ this._renderered = true;+ },++ /**+ * Event handler for the categoryAxisChange event.+ *+ * @method _categoryAxisChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _categoryAxisChangeHandler: function(e)+ {+ var categoryAxis = this.get("categoryAxis");+ categoryAxis.after("dataReady", Y.bind(this._categoryDataChangeHandler, this));+ categoryAxis.after("dataUpdate", Y.bind(this._categoryDataChangeHandler, this));+ },+ + /**+ * Event handler for the valueAxisChange event.+ *+ * @method _valueAxisChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _valueAxisChangeHandler: function(e)+ {+ var valueAxis = this.get("valueAxis");+ valueAxis.after("dataReady", Y.bind(this._valueDataChangeHandler, this));+ valueAxis.after("dataUpdate", Y.bind(this._valueDataChangeHandler, this));+ },+ + /**+ * Constant used to generate unique id.+ *+ * @property GUID+ * @type String+ * @private+ */+ GUID: "pieseries",+ + /**+ * Event handler for categoryDataChange event.+ *+ * @method _categoryDataChangeHandler+ * @param {Object} event Event object.+ * @private + */+ _categoryDataChangeHandler: function(event)+ {+ if(this._rendered && this.get("categoryKey") && this.get("valueKey"))+ {+ this.draw();+ }+ },++ /**+ * Event handler for valueDataChange event.+ *+ * @method _valueDataChangeHandler+ * @param {Object} event Event object.+ * @private + */+ _valueDataChangeHandler: function(event)+ {+ if(this._rendered && this.get("categoryKey") && this.get("valueKey"))+ {+ this.draw();+ }+ },+ + /**+ * Draws the series. Overrides the base implementation.+ *+ * @method draw+ * @protected+ */+ draw: function()+ {+ var graph = this.get("graph"),+ w = graph.get("width"),+ h = graph.get("height");+ if(isFinite(w) && isFinite(h) && w > 0 && h > 0)+ { + this._rendered = true;+ if(this._drawing)+ {+ this._callLater = true;+ return;+ }+ this._drawing = true;+ this._callLater = false;+ this.drawSeries();+ this._drawing = false;+ if(this._callLater)+ {+ this.draw();+ }+ else+ {+ this.fire("drawingComplete");+ }+ }+ },++ /**+ * Draws the markers+ *+ * @method drawPlots+ * @protected+ */+ drawPlots: function()+ {+ var values = this.get("valueAxis").getDataByKey(this.get("valueKey")).concat(),+ catValues = this.get("categoryAxis").getDataByKey(this.get("categoryKey")).concat(),+ totalValue = 0,+ itemCount = values.length,+ styles = this.get("styles").marker,+ fillColors = styles.fill.colors,+ fillAlphas = styles.fill.alphas || ["1"],+ borderColors = styles.border.colors,+ borderWeights = [styles.border.weight],+ borderAlphas = [styles.border.alpha],+ tbw = borderWeights.concat(),+ tbc = borderColors.concat(),+ tba = borderAlphas.concat(),+ tfc,+ tfa,+ padding = styles.padding,+ graph = this.get("graph"),+ minDimension = Math.min(graph.get("width"), graph.get("height")),+ w = minDimension - (padding.left + padding.right),+ h = minDimension - (padding.top + padding.bottom),+ startAngle = -90,+ halfWidth = w / 2,+ halfHeight = h / 2,+ radius = Math.min(halfWidth, halfHeight),+ i = 0,+ value,+ angle = 0,+ lc,+ la,+ lw,+ wedgeStyle,+ marker,+ graphOrder = this.get("graphOrder"),+ isCanvas = Y.Graphic.NAME == "canvasGraphic";+ for(; i < itemCount; ++i)+ {+ value = parseFloat(values[i]);+ + values.push(value);+ if(!isNaN(value))+ {+ totalValue += value;+ }+ }+ + tfc = fillColors ? fillColors.concat() : null;+ tfa = fillAlphas ? fillAlphas.concat() : null;+ this._createMarkerCache();+ if(isCanvas)+ {+ this._setMap();+ this._image.width = w;+ this._image.height = h;+ }+ for(i = 0; i < itemCount; i++)+ {+ value = values[i];+ if(totalValue === 0)+ {+ angle = 360 / values.length;+ }+ else+ {+ angle = 360 * (value / totalValue);+ }+ if(tfc && tfc.length < 1)+ {+ tfc = fillColors.concat();+ }+ if(tfa && tfa.length < 1)+ {+ tfa = fillAlphas.concat();+ }+ if(tbw && tbw.length < 1)+ {+ tbw = borderWeights.concat();+ }+ if(tbw && tbc.length < 1)+ {+ tbc = borderColors.concat();+ }+ if(tba && tba.length < 1)+ {+ tba = borderAlphas.concat();+ }+ lw = tbw ? tbw.shift() : null;+ lc = tbc ? tbc.shift() : null;+ la = tba ? tba.shift() : null;+ startAngle += angle;+ wedgeStyle = {+ border: {+ color:lc,+ weight:lw,+ alpha:la+ },+ fill: {+ color:tfc ? tfc.shift() : this._getDefaultColor(i, "slice"),+ alpha:tfa ? tfa.shift() : null+ },+ type: "pieslice",+ arc: angle,+ radius: radius,+ startAngle: startAngle,+ cx: halfWidth,+ cy: halfHeight,+ width: w,+ height: h+ };+ marker = this.getMarker(wedgeStyle, graphOrder, i);+ if(isCanvas)+ {+ this._addHotspot(wedgeStyle, graphOrder, i);+ }+ }+ this._clearMarkerCache();+ },++ /**+ * Adds an interactive map when rendering in canvas.+ *+ * @method _addHotspot+ * @param {Object} cfg Object containing data used to draw the hotspot+ * @param {Number} seriesIndex Index of series in the `seriesCollection`.+ * @param {Number} index Index of the marker using the hotspot.+ * @private+ */+ _addHotspot: function(cfg, seriesIndex, index)+ {+ var areaNode = DOCUMENT.createElement("area"),+ i = 1,+ x = cfg.cx,+ y = cfg.cy, + arc = cfg.arc,+ startAngle = cfg.startAngle - arc, + endAngle = cfg.startAngle,+ radius = cfg.radius, + ax = x + Math.cos(startAngle / 180 * Math.PI) * radius,+ ay = y + Math.sin(startAngle / 180 * Math.PI) * radius,+ bx = x + Math.cos(endAngle / 180 * Math.PI) * radius,+ by = y + Math.sin(endAngle / 180 * Math.PI) * radius,+ numPoints = Math.floor(arc/10) - 1,+ divAngle = (arc/(Math.floor(arc/10)) / 180) * Math.PI,+ angleCoord = Math.atan((ay - y)/(ax - x)),+ pts = x + ", " + y + ", " + ax + ", " + ay,+ cosAng,+ sinAng,+ multDivAng;+ for(i = 1; i <= numPoints; ++i)+ {+ multDivAng = divAngle * i;+ cosAng = Math.cos(angleCoord + multDivAng);+ sinAng = Math.sin(angleCoord + multDivAng);+ if(startAngle <= 90)+ {+ pts += ", " + (x + (radius * Math.cos(angleCoord + (divAngle * i))));+ pts += ", " + (y + (radius * Math.sin(angleCoord + (divAngle * i))));+ }+ else+ {+ pts += ", " + (x - (radius * Math.cos(angleCoord + (divAngle * i))));+ pts += ", " + (y - (radius * Math.sin(angleCoord + (divAngle * i))));+ }+ }+ pts += ", " + bx + ", " + by;+ pts += ", " + x + ", " + y;+ this._map.appendChild(areaNode);+ areaNode.setAttribute("class", SERIES_MARKER);+ areaNode.setAttribute("id", "hotSpot_" + seriesIndex + "_" + index);+ areaNode.setAttribute("shape", "polygon");+ areaNode.setAttribute("coords", pts);+ this._areaNodes.push(areaNode);++ },++ /**+ * Resizes and positions markers based on a mouse interaction.+ *+ * @method updateMarkerState+ * @param {String} type state of the marker+ * @param {Number} i index of the marker+ * @protected+ */+ updateMarkerState: function(type, i)+ {+ if(this._markers[i])+ {+ var state = this._getState(type),+ markerStyles,+ indexStyles,+ marker = this._markers[i],+ styles = this.get("styles").marker; + markerStyles = state == "off" || !styles[state] ? styles : styles[state]; + indexStyles = this._mergeStyles(markerStyles, {});+ indexStyles.fill.color = indexStyles.fill.colors[i % indexStyles.fill.colors.length];+ indexStyles.fill.alpha = indexStyles.fill.alphas[i % indexStyles.fill.alphas.length];+ marker.set(indexStyles);+ }+ },+ + /**+ * Creates a shape to be used as a marker.+ *+ * @method _createMarker+ * @param {Object} styles Hash of style properties.+ * @param {Number} order Order of the series.+ * @param {Number} index Index within the series associated with the marker.+ * @return Shape+ * @private+ */+ _createMarker: function(styles, order, index)+ {+ var graphic = this.get("graphic"),+ marker,+ cfg = Y.clone(styles);+ graphic.set("autoDraw", false);+ marker = graphic.addShape(cfg); + marker.addClass(SERIES_MARKER);+ return marker;+ },+ + /**+ * Creates a cache of markers for reuse.+ *+ * @method _createMarkerCache+ * @private+ */+ _clearMarkerCache: function()+ {+ var len = this._markerCache.length,+ i = 0,+ marker;+ for(; i < len; ++i)+ {+ marker = this._markerCache[i];+ if(marker)+ {+ marker.destroy();+ }+ }+ this._markerCache = [];+ },++ /**+ * Gets the default style values for the markers.+ *+ * @method _getPlotDefaults+ * @return Object+ * @private+ */+ _getPlotDefaults: function()+ {+ var defs = {+ padding:{+ top: 0,+ left: 0,+ right: 0,+ bottom: 0+ },+ fill:{+ alphas:["1"]+ },+ border: {+ weight: 0,+ alpha: 1+ }+ };+ defs.fill.colors = this._defaultSliceColors;+ defs.border.colors = this._defaultBorderColors;+ return defs;+ },++ /**+ * Collection of default colors used for lines in a series when not specified by user.+ *+ * @property _defaultLineColors+ * @type Array+ * @protected+ */+ _defaultLineColors:["#426ab3", "#d09b2c", "#000000", "#b82837", "#b384b5", "#ff7200", "#779de3", "#cbc8ba", "#7ed7a6", "#007a6c"],++ /**+ * Collection of default colors used for marker fills in a series when not specified by user.+ *+ * @property _defaultFillColors+ * @type Array+ * @protected+ */+ _defaultFillColors:["#6084d0", "#eeb647", "#6c6b5f", "#d6484f", "#ce9ed1", "#ff9f3b", "#93b7ff", "#e0ddd0", "#94ecba", "#309687"],+ + /**+ * Collection of default colors used for marker borders in a series when not specified by user.+ *+ * @property _defaultBorderColors+ * @type Array+ * @protected+ */+ _defaultBorderColors:["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"],+ + /**+ * Collection of default colors used for area fills, histogram fills and pie fills in a series when not specified by user.+ *+ * @property _defaultSliceColors+ * @type Array+ * @protected+ */+ _defaultSliceColors: ["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"],++ /**+ * Colors used if style colors are not specified+ *+ * @method _getDefaultColor+ * @param {Number} index Index indicating the series order.+ * @param {String} type Indicates which type of object needs the color.+ * @return String+ * @protected+ */+ _getDefaultColor: function(index, type)+ {+ var colors = {+ line: this._defaultLineColors,+ fill: this._defaultFillColors,+ border: this._defaultBorderColors,+ slice: this._defaultSliceColors+ },+ col = colors[type],+ l = col.length;+ index = index || 0;+ if(index >= l)+ {+ index = index % l;+ }+ type = type || "fill";+ return colors[type][index];+ }+}, {+ ATTRS: {+ /**+ * Read-only attribute indicating the type of series.+ *+ * @attribute type+ * @type String+ * @default pie+ */+ type: { + value: "pie"+ },+ + /**+ * Order of this instance of this `type`.+ *+ * @attribute order+ * @type Number+ */+ order: {},++ /**+ * Reference to the `Graph` in which the series is drawn into.+ *+ * @attribute graph+ * @type Graph+ */+ graph: {},+ + /**+ * Reference to the `Axis` instance used for assigning + * category values to the graph.+ *+ * @attribute categoryAxis+ * @type Axis+ */+ categoryAxis: {+ value: null,++ validator: function(value)+ {+ return value !== this.get("categoryAxis");+ }+ },+ + /**+ * Reference to the `Axis` instance used for assigning + * series values to the graph.+ *+ * @attribute categoryAxis+ * @type Axis+ */+ valueAxis: {+ value: null,++ validator: function(value)+ {+ return value !== this.get("valueAxis");+ }+ },++ /**+ * Indicates which array to from the hash of value arrays in + * the category `Axis` instance.+ *+ * @attribute categoryKey+ * @type String+ */+ categoryKey: {+ value: null,++ validator: function(value)+ {+ return value !== this.get("categoryKey");+ }+ },+ /**+ * Indicates which array to from the hash of value arrays in + * the value `Axis` instance.+ *+ * @attribute valueKey+ * @type String+ */+ valueKey: {+ value: null,++ validator: function(value)+ {+ return value !== this.get("valueKey");+ }+ },++ /**+ * Name used for for displaying category data+ *+ * @attribute categoryDisplayName+ * @type String+ */+ categoryDisplayName: {+ setter: function(val)+ {+ this._categoryDisplayName = val;+ return val;+ },++ getter: function()+ {+ return this._categoryDisplayName || this.get("categoryKey");+ }+ },++ /**+ * Name used for for displaying value data+ *+ * @attribute valueDisplayName+ * @type String+ */+ valueDisplayName: {+ setter: function(val)+ {+ this._valueDisplayName = val;+ return val;+ },++ getter: function()+ {+ return this._valueDisplayName || this.get("valueKey");+ }+ },+ + /**+ * @attribute slices+ * @type Array+ * @private+ */+ slices: null+ + /**+ * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:+ * <dl>+ * <dt>fill</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>colors</dt><dd>An array of colors to be used for the marker fills. The color for each marker is retrieved from the + * array below:<br/>+ * `["#66007f", "#a86f41", "#295454", "#996ab2", "#e8cdb7", "#90bdbd","#000000","#c3b8ca", "#968373", "#678585"]`+ * </dd>+ * <dt>alphas</dt><dd>An array of alpha references (Number from 0 to 1) indicating the opacity of each marker fill. The default value is [1].</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>A hash containing the following values:+ * <dl>+ * <dt>color</dt><dd>An array of colors to be used for the marker borders. The color for each marker is retrieved from the+ * array below:<br/>+ * `["#205096", "#b38206", "#000000", "#94001e", "#9d6fa0", "#e55b00", "#5e85c9", "#adab9e", "#6ac291", "#006457"]`+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default + * values for each style is null. When an over style is not set, the non-over value will be used. For example,+ * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});+/**+ * Gridlines draws gridlines on a Graph.+ *+ * @module charts+ * @submodule charts-base+ * @class Gridlines+ * @constructor+ * @extends Base+ * @uses Renderer+ */+Y.Gridlines = Y.Base.create("gridlines", Y.Base, [Y.Renderer], {+ /**+ * Reference to the `Path` element used for drawing Gridlines.+ *+ * @property _path+ * @type Path+ * @private+ */+ _path: null,++ /**+ * Removes the Gridlines.+ *+ * @method remove+ * @private+ */+ remove: function()+ {+ var path = this._path;+ if(path)+ {+ path.destroy();+ }+ },++ /**+ * Draws the gridlines+ *+ * @method draw+ * @protected+ */+ draw: function()+ {+ if(this.get("axis") && this.get("graph"))+ {+ this._drawGridlines();+ }+ },++ /**+ * Algorithm for drawing gridlines+ *+ * @method _drawGridlines+ * @private+ */+ _drawGridlines: function()+ {+ var path,+ axis = this.get("axis"),+ axisPosition = axis.get("position"),+ points,+ i = 0,+ l,+ direction = this.get("direction"),+ graph = this.get("graph"),+ w = graph.get("width"),+ h = graph.get("height"),+ line = this.get("styles").line,+ color = line.color,+ weight = line.weight,+ alpha = line.alpha,+ lineFunction = direction == "vertical" ? this._verticalLine : this._horizontalLine;+ if(isFinite(w) && isFinite(h) && w > 0 && h > 0)+ {+ if(axisPosition != "none" && axis && axis.get("tickPoints"))+ {+ points = axis.get("tickPoints");+ l = points.length;+ }+ else+ {+ points = [];+ l = axis.get("styles").majorUnit.count;+ for(; i < l; ++i)+ {+ points[i] = {+ x: w * (i/(l-1)),+ y: h * (i/(l-1))+ };+ }+ i = 0;+ }+ path = graph.get("gridlines");+ path.set("width", w);+ path.set("height", h);+ path.set("stroke", {+ weight: weight,+ color: color,+ opacity: alpha+ });+ for(; i < l; ++i)+ {+ lineFunction(path, points[i], w, h);+ }+ path.end();+ }+ },++ /**+ * Algorithm for horizontal lines.+ *+ * @method _horizontalLine+ * @param {Path} path Reference to path element+ * @param {Object} pt Coordinates corresponding to a major unit of an axis.+ * @param {Number} w Width of the Graph+ * @param {Number} h Height of the Graph+ * @private+ */+ _horizontalLine: function(path, pt, w, h)+ {+ path.moveTo(0, pt.y);+ path.lineTo(w, pt.y);+ },++ /**+ * Algorithm for vertical lines.+ *+ * @method _verticalLine+ * @param {Path} path Reference to path element+ * @param {Object} pt Coordinates corresponding to a major unit of an axis.+ * @param {Number} w Width of the Graph+ * @param {Number} h Height of the Graph+ * @private+ */+ _verticalLine: function(path, pt, w, h)+ {+ path.moveTo(pt.x, 0);+ path.lineTo(pt.x, h);+ },+ + /**+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ * @protected+ */+ _getDefaultStyles: function()+ {+ var defs = {+ line: {+ color:"#f0efe9",+ weight: 1,+ alpha: 1+ }+ };+ return defs;+ }++},+{+ ATTRS: {+ /**+ * Indicates the direction of the gridline.+ *+ * @attribute direction+ * @type String+ */+ direction: {},+ + /**+ * Indicate the `Axis` in which to bind+ * the gridlines.+ *+ * @attribute axis+ * @type Axis+ */+ axis: {},+ + /**+ * Indicates the `Graph` in which the gridlines + * are drawn.+ *+ * @attribute graph+ * @type Graph+ */+ graph: {}+ }+});+/**+ * Graph manages and contains series instances for a `CartesianChart`+ * instance.+ *+ * @module charts+ * @submodule charts-base+ * @class Graph+ * @constructor+ * @extends Widget+ * @uses Renderer+ */+Y.Graph = Y.Base.create("graph", Y.Widget, [Y.Renderer], {+ /**+ * @method bindUI+ * @private+ */+ bindUI: function()+ {+ var bb = this.get("boundingBox");+ bb.setStyle("position", "absolute");+ this.after("widthChange", this._sizeChangeHandler);+ this.after("heightChange", this._sizeChangeHandler);+ this.after("stylesChange", this._updateStyles);+ this.after("groupMarkersChange", this._drawSeries);+ },++ /**+ * @method syncUI+ * @private+ */+ syncUI: function()+ {+ var background,+ cb,+ bg,+ sc = this.get("seriesCollection"),+ series,+ i = 0,+ len = sc ? sc.length : 0,+ hgl = this.get("horizontalGridlines"),+ vgl = this.get("verticalGridlines");+ if(this.get("showBackground"))+ {+ background = this.get("background");+ cb = this.get("contentBox");+ bg = this.get("styles").background;+ bg.stroke = bg.border;+ bg.stroke.opacity = bg.stroke.alpha;+ bg.fill.opacity = bg.fill.alpha;+ bg.width = this.get("width");+ bg.height = this.get("height");+ bg.type = bg.shape;+ background.set(bg);+ }+ for(; i < len; ++i)+ {+ series = sc[i];+ if(series instanceof Y.CartesianSeries)+ {+ series.render();+ }+ }+ if(hgl && hgl instanceof Y.Gridlines)+ {+ hgl.draw();+ }+ if(vgl && vgl instanceof Y.Gridlines)+ {+ vgl.draw();+ }+ },+ + /**+ * Object of arrays containing series mapped to a series type.+ *+ * @property seriesTypes+ * @type Object+ * @private+ */+ seriesTypes: null,++ /**+ * Returns a series instance based on an index.+ * + * @method getSeriesByIndex+ * @param {Number} val index of the series+ * @return CartesianSeries+ */+ getSeriesByIndex: function(val)+ {+ var col = this.get("seriesCollection"),+ series;+ if(col && col.length > val)+ {+ series = col[val];+ }+ return series;+ },++ /**+ * Returns a series instance based on a key value.+ * + * @method getSeriesByKey+ * @param {String} val key value of the series+ * @return CartesianSeries+ */+ getSeriesByKey: function(val)+ {+ var obj = this._seriesDictionary,+ series;+ if(obj && obj.hasOwnProperty(val))+ {+ series = obj[val];+ }+ return series;+ },++ /**+ * Adds dispatcher to a `_dispatcher` used to+ * to ensure all series have redrawn before for firing event.+ *+ * @method addDispatcher+ * @param {CartesianSeries} val series instance to add+ * @protected+ */+ addDispatcher: function(val)+ {+ if(!this._dispatchers)+ {+ this._dispatchers = [];+ }+ this._dispatchers.push(val);+ },++ /**+ * Collection of series to be displayed in the graph.+ *+ * @property _seriesCollection+ * @type Array+ * @private + */+ _seriesCollection: null,+ + /**+ * Object containing key value pairs of `CartesianSeries` instances.+ *+ * @property _seriesDictionary+ * @type Object+ * @private+ */+ _seriesDictionary: null,++ /**+ * Parses series instances to be displayed in the graph.+ *+ * @method _parseSeriesCollection+ * @param {Array} Collection of `CartesianSeries` instances or objects container `CartesianSeries` attributes values.+ * @private+ */+ _parseSeriesCollection: function(val)+ {+ if(!val)+ {+ return;+ } + var len = val.length,+ i = 0,+ series,+ seriesKey;+ this._seriesCollection = [];+ this._seriesDictionary = {};+ this.seriesTypes = [];+ for(; i < len; ++i)+ { + series = val[i];+ if(!(series instanceof Y.CartesianSeries) && !(series instanceof Y.PieSeries))+ {+ this._createSeries(series);+ continue;+ }+ this._addSeries(series);+ }+ len = this._seriesCollection.length;+ for(i = 0; i < len; ++i)+ {+ series = this.get("seriesCollection")[i];+ seriesKey = series.get("direction") == "horizontal" ? "yKey" : "xKey";+ this._seriesDictionary[series.get(seriesKey)] = series;+ }+ },++ /**+ * Adds a series to the graph.+ *+ * @method _addSeries+ * @param {CartesianSeries} series Series to add to the graph.+ * @private+ */+ _addSeries: function(series)+ {+ var type = series.get("type"),+ seriesCollection = this.get("seriesCollection"),+ graphSeriesLength = seriesCollection.length,+ seriesTypes = this.seriesTypes,+ typeSeriesCollection; + if(!series.get("graph")) + {+ series.set("graph", this);+ }+ seriesCollection.push(series);+ if(!seriesTypes.hasOwnProperty(type))+ {+ this.seriesTypes[type] = [];+ }+ typeSeriesCollection = this.seriesTypes[type];+ series.set("graphOrder", graphSeriesLength);+ series.set("order", typeSeriesCollection.length);+ typeSeriesCollection.push(series);+ this.addDispatcher(series);+ series.after("drawingComplete", Y.bind(this._drawingCompleteHandler, this));+ this.fire("seriesAdded", series);+ },++ /**+ * Creates a `CartesianSeries` instance from an object containing attribute key value pairs. The key value pairs include attributes for the specific series and a type value which defines the type of+ * series to be used. + *+ * @method createSeries+ * @param {Object} seriesData Series attribute key value pairs.+ * @private+ */+ _createSeries: function(seriesData)+ {+ var type = seriesData.type,+ seriesCollection = this.get("seriesCollection"),+ seriesTypes = this.seriesTypes,+ typeSeriesCollection,+ seriesType,+ series;+ seriesData.graph = this;+ if(!seriesTypes.hasOwnProperty(type))+ {+ seriesTypes[type] = [];+ }+ typeSeriesCollection = seriesTypes[type];+ seriesData.graph = this;+ seriesData.order = typeSeriesCollection.length;+ seriesData.graphOrder = seriesCollection.length;+ seriesType = this._getSeries(seriesData.type);+ series = new seriesType(seriesData);+ this.addDispatcher(series);+ series.after("drawingComplete", Y.bind(this._drawingCompleteHandler, this));+ typeSeriesCollection.push(series);+ seriesCollection.push(series);+ if(this.get("rendered"))+ {+ series.render();+ }+ },+ + /**+ * String reference for pre-defined `Series` classes.+ *+ * @property _seriesMap+ * @type Object+ * @private+ */+ _seriesMap: {+ line : Y.LineSeries,+ column : Y.ColumnSeries,+ bar : Y.BarSeries,+ area : Y.AreaSeries,+ candlestick : Y.CandlestickSeries,+ ohlc : Y.OHLCSeries,+ stackedarea : Y.StackedAreaSeries,+ stackedline : Y.StackedLineSeries,+ stackedcolumn : Y.StackedColumnSeries,+ stackedbar : Y.StackedBarSeries,+ markerseries : Y.MarkerSeries,+ spline : Y.SplineSeries,+ areaspline : Y.AreaSplineSeries,+ stackedspline : Y.StackedSplineSeries,+ stackedareaspline : Y.StackedAreaSplineSeries,+ stackedmarkerseries : Y.StackedMarkerSeries,+ pie : Y.PieSeries,+ combo : Y.ComboSeries,+ stackedcombo : Y.StackedComboSeries,+ combospline : Y.ComboSplineSeries,+ stackedcombospline : Y.StackedComboSplineSeries+ },++ /**+ * Returns a specific `CartesianSeries` class based on key value from a look up table of a direct reference to a class. When specifying a key value, the following options+ * are available:+ *+ * <table>+ * <tr><th>Key Value</th><th>Class</th></tr>+ * <tr><td>line</td><td>Y.LineSeries</td></tr> + * <tr><td>column</td><td>Y.ColumnSeries</td></tr> + * <tr><td>bar</td><td>Y.BarSeries</td></tr> + * <tr><td>area</td><td>Y.AreaSeries</td></tr> + * <tr><td>stackedarea</td><td>Y.StackedAreaSeries</td></tr> + * <tr><td>stackedline</td><td>Y.StackedLineSeries</td></tr> + * <tr><td>stackedcolumn</td><td>Y.StackedColumnSeries</td></tr> + * <tr><td>stackedbar</td><td>Y.StackedBarSeries</td></tr> + * <tr><td>markerseries</td><td>Y.MarkerSeries</td></tr> + * <tr><td>spline</td><td>Y.SplineSeries</td></tr> + * <tr><td>areaspline</td><td>Y.AreaSplineSeries</td></tr> + * <tr><td>stackedspline</td><td>Y.StackedSplineSeries</td></tr>+ * <tr><td>stackedareaspline</td><td>Y.StackedAreaSplineSeries</td></tr>+ * <tr><td>stackedmarkerseries</td><td>Y.StackedMarkerSeries</td></tr>+ * <tr><td>pie</td><td>Y.PieSeries</td></tr>+ * <tr><td>combo</td><td>Y.ComboSeries</td></tr>+ * <tr><td>stackedcombo</td><td>Y.StackedComboSeries</td></tr>+ * <tr><td>combospline</td><td>Y.ComboSplineSeries</td></tr>+ * <tr><td>stackedcombospline</td><td>Y.StackedComboSplineSeries</td></tr>+ * </table>+ * + * When referencing a class directly, you can specify any of the above classes or any custom class that extends `CartesianSeries` or `PieSeries`.+ *+ * @method _getSeries+ * @param {String | Object} type Series type.+ * @return CartesianSeries+ * @private+ */+ _getSeries: function(type)+ {+ var seriesClass;+ if(Y_Lang.isString(type))+ {+ seriesClass = this._seriesMap[type];+ }+ else + {+ seriesClass = type;+ }+ return seriesClass;+ },++ /**+ * Event handler for marker events.+ *+ * @method _markerEventHandler+ * @param {Object} e Event object.+ * @private+ */+ _markerEventHandler: function(e)+ {+ var type = e.type,+ markerNode = e.currentTarget,+ strArr = markerNode.getAttribute("id").split("_"),+ series = this.getSeriesByIndex(strArr[1]),+ index = strArr[2];+ series.updateMarkerState(type, index);+ },++ /**+ * Collection of `CartesianSeries` instances to be redrawn.+ *+ * @property _dispatchers+ * @type Array+ * @private+ */+ _dispatchers: null,++ /**+ * Updates the `Graph` styles.+ *+ * @method _updateStyles+ * @private+ */+ _updateStyles: function()+ {+ var styles = this.get("styles").background,+ border = styles.border;+ border.opacity = border.alpha;+ styles.stroke = border;+ styles.fill.opacity = styles.fill.alpha;+ this.get("background").set(styles);+ this._sizeChangeHandler();+ },++ /**+ * Event handler for size changes.+ *+ * @method _sizeChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _sizeChangeHandler: function(e)+ {+ var hgl = this.get("horizontalGridlines"),+ vgl = this.get("verticalGridlines"),+ w = this.get("width"),+ h = this.get("height"),+ bg = this.get("styles").background,+ weight,+ background;+ if(bg && bg.border)+ {+ weight = bg.border.weight || 0;+ }+ if(this.get("showBackground"))+ {+ background = this.get("background");+ if(w && h)+ {+ background.set("width", w);+ background.set("height", h);+ }+ }+ if(this._gridlines)+ {+ this._gridlines.clear();+ }+ if(hgl && hgl instanceof Y.Gridlines)+ {+ hgl.draw();+ }+ if(vgl && vgl instanceof Y.Gridlines)+ {+ vgl.draw();+ }+ this._drawSeries();+ },++ /**+ * Draws each series.+ *+ * @method _drawSeries+ * @private+ */+ _drawSeries: function()+ {+ if(this._drawing)+ {+ this._callLater = true;+ return;+ }+ var sc,+ i,+ len,+ graphic = this.get("graphic");+ graphic.set("autoDraw", false);+ this._callLater = false;+ this._drawing = true;+ sc = this.get("seriesCollection");+ i = 0;+ len = sc ? sc.length : 0;+ for(; i < len; ++i)+ {+ sc[i].draw();+ if((!sc[i].get("xcoords") || !sc[i].get("ycoords")) && !sc[i] instanceof Y.PieSeries)+ {+ this._callLater = true;+ break;+ }+ }+ this._drawing = false;+ if(this._callLater)+ {+ this._drawSeries();+ }+ }, ++ /**+ * Event handler for series drawingComplete event.+ *+ * @method _drawingCompleteHandler+ * @param {Object} e Event object.+ * @private+ */+ _drawingCompleteHandler: function(e)+ {+ var series = e.currentTarget,+ graphic,+ index = Y.Array.indexOf(this._dispatchers, series);+ if(index > -1)+ {+ this._dispatchers.splice(index, 1);+ }+ if(this._dispatchers.length < 1)+ {+ graphic = this.get("graphic");+ if(!graphic.get("autoDraw"))+ {+ graphic._redraw();+ }+ this.fire("chartRendered");+ }+ },++ /**+ * Gets the default value for the `styles` attribute. Overrides+ * base implementation.+ *+ * @method _getDefaultStyles+ * @return Object+ * @protected+ */+ _getDefaultStyles: function()+ {+ var defs = {+ background: {+ shape: "rect",+ fill:{+ color:"#faf9f2"+ },+ border: {+ color:"#dad8c9",+ weight: 1+ }+ }+ };+ return defs;+ },++ /**+ * Destructor implementation Graph class. Removes all Graphic instances from the widget.+ *+ * @method destructor+ * @protected+ */+ destructor: function()+ {+ if(this._graphic)+ {+ this._graphic.destroy();+ this._graphic = null;+ }+ if(this._background)+ {+ this._background.get("graphic").destroy();+ this._background = null;+ }+ if(this._gridlines)+ {+ this._gridlines.get("graphic").destroy();+ this._gridlines = null;+ }+ }+}, {+ ATTRS: {+ /**+ * The x-coordinate for the graph.+ *+ * @attribute x+ * @type Number+ * @protected+ */+ x: {+ setter: function(val)+ {+ this.get("boundingBox").setStyle("left", val + "px");+ return val;+ }+ },++ /**+ * The y-coordinate for the graph.+ *+ * @attribute y+ * @type Number+ * @protected+ */+ y: {+ setter: function(val)+ {+ this.get("boundingBox").setStyle("top", val + "px");+ return val;+ }+ },++ /**+ * Reference to the chart instance using the graph.+ *+ * @attribute chart+ * @type ChartBase+ * @readOnly+ */+ chart: {},++ /**+ * Collection of series. When setting the `seriesCollection` the array can contain a combination of either+ * `CartesianSeries` instances or object literals with properties that will define a series.+ *+ * @attribute seriesCollection+ * @type CartesianSeries+ */+ seriesCollection: {+ getter: function()+ {+ return this._seriesCollection;+ },++ setter: function(val)+ {+ this._parseSeriesCollection(val);+ return this._seriesCollection;+ }+ },+ + /**+ * Indicates whether the `Graph` has a background.+ *+ * @attribute showBackground+ * @type Boolean+ * @default true+ */+ showBackground: {+ value: true+ },++ /**+ * Read-only hash lookup for all series on in the `Graph`.+ *+ * @attribute seriesDictionary+ * @type Object+ * @readOnly+ */+ seriesDictionary: {+ readOnly: true,++ getter: function()+ {+ return this._seriesDictionary;+ }+ },++ /**+ * Reference to the horizontal `Gridlines` instance.+ *+ * @attribute horizontalGridlines+ * @type Gridlines+ * @default null+ */+ horizontalGridlines: {+ value: null,++ setter: function(val)+ {+ var gl = this.get("horizontalGridlines");+ if(gl && gl instanceof Y.Gridlines)+ {+ gl.remove();+ }+ if(val instanceof Y.Gridlines)+ {+ gl = val;+ val.set("graph", this);+ return val;+ }+ else if(val && val.axis)+ {+ gl = new Y.Gridlines({direction:"horizontal", axis:val.axis, graph:this, styles:val.styles});+ return gl;+ }+ }+ },+ + /**+ * Reference to the vertical `Gridlines` instance.+ *+ * @attribute verticalGridlines+ * @type Gridlines+ * @default null+ */+ verticalGridlines: {+ value: null,++ setter: function(val)+ {+ var gl = this.get("verticalGridlines");+ if(gl && gl instanceof Y.Gridlines)+ {+ gl.remove();+ }+ if(val instanceof Y.Gridlines)+ {+ gl = val;+ val.set("graph", this);+ return val;+ }+ else if(val && val.axis)+ {+ gl = new Y.Gridlines({direction:"vertical", axis:val.axis, graph:this, styles:val.styles});+ return gl;+ }+ }+ },++ /**+ * Reference to graphic instance used for the background.+ *+ * @attribute background+ * @type Graphic+ * @readOnly+ */+ background: {+ getter: function()+ {+ if(!this._background)+ {+ this._backgroundGraphic = new Y.Graphic({render:this.get("contentBox")});+ this._backgroundGraphic.get("node").style.zIndex = 0; + this._background = this._backgroundGraphic.addShape({type: "rect"});+ }+ return this._background;+ }+ },++ /**+ * Reference to graphic instance used for gridlines.+ *+ * @attribute gridlines+ * @type Graphic+ * @readOnly+ */+ gridlines: {+ readOnly: true,++ getter: function()+ {+ if(!this._gridlines)+ {+ this._gridlinesGraphic = new Y.Graphic({render:this.get("contentBox")});+ this._gridlinesGraphic.get("node").style.zIndex = 1; + this._gridlines = this._gridlinesGraphic.addShape({type: "path"});+ }+ return this._gridlines;+ }+ },+ + /**+ * Reference to graphic instance used for series.+ *+ * @attribute graphic+ * @type Graphic+ * @readOnly+ */+ graphic: {+ readOnly: true,++ getter: function() + {+ if(!this._graphic)+ {+ this._graphic = new Y.Graphic({render:this.get("contentBox")});+ this._graphic.get("node").style.zIndex = 2; + this._graphic.set("autoDraw", false);+ }+ return this._graphic;+ }+ },++ /**+ * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.+ *+ * @attribute groupMarkers+ * @type Boolean+ */+ groupMarkers: {+ value: false+ }++ /**+ * Style properties used for drawing a background. Below are the default values:+ * <dl>+ * <dt>background</dt><dd>An object containing the following values:+ * <dl>+ * <dt>fill</dt><dd>Defines the style properties for the fill. Contains the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the fill. The default value is #faf9f2.</dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the background fill. The default value is 1.</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>Defines the style properties for the border. Contains the following values:+ * <dl>+ * <dt>color</dt><dd>Color of the border. The default value is #dad8c9.</dd>+ * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the background border. The default value is 1.</dd>+ * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>+ * </dl>+ * </dd>+ * </dl>+ * </dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});+/**+ * The ChartBase class is an abstract class used to create charts.+ *+ * @module charts+ * @submodule charts-base+ * @class ChartBase+ * @constructor+ */+function ChartBase() {}++ChartBase.ATTRS = {+ /**+ * Data used to generate the chart.+ * + * @attribute dataProvider+ * @type Array+ */+ dataProvider: {+ lazyAdd: false,++ valueFn: function()+ {+ var defDataProvider = [];+ if(!this._seriesKeysExplicitlySet)+ {+ this._seriesKeys = this._buildSeriesKeys(defDataProvider);+ }+ return defDataProvider;+ },++ setter: function(val)+ {+ var dataProvider = this._setDataValues(val);+ if(!this._seriesKeysExplicitlySet)+ {+ this._seriesKeys = this._buildSeriesKeys(dataProvider);+ }+ return dataProvider;+ }+ },++ /**+ * A collection of keys that map to the series axes. If no keys are set,+ * they will be generated automatically depending on the data structure passed into + * the chart.+ *+ * @attribute seriesKeys+ * @type Array+ */+ seriesKeys: {+ getter: function()+ {+ return this._seriesKeys;+ },++ setter: function(val)+ {+ this._seriesKeysExplicitlySet = true;+ this._seriesKeys = val;+ return val;+ }+ },++ /**+ * Sets the `aria-label` for the chart.+ *+ * @attribute ariaLabel+ * @type String+ */+ ariaLabel: {+ value: "Chart Application",++ setter: function(val)+ {+ var cb = this.get("contentBox");+ if(cb)+ {+ cb.setAttribute("aria-label", val);+ }+ return val;+ }+ },+ + /**+ * Sets the aria description for the chart.+ *+ * @attribute ariaDescription+ * @type String+ */+ ariaDescription: {+ value: "Use the up and down keys to navigate between series. Use the left and right keys to navigate through items in a series.",++ setter: function(val)+ {+ if(this._description)+ {+ this._description.setContent("");+ this._description.appendChild(DOCUMENT.createTextNode(val));+ }+ return val;+ }+ },+ + /**+ * Reference to the default tooltip available for the chart.+ * <p>Contains the following properties:</p>+ * <dl>+ * <dt>node</dt><dd>Reference to the actual dom node</dd>+ * <dt>showEvent</dt><dd>Event that should trigger the tooltip</dd>+ * <dt>hideEvent</dt><dd>Event that should trigger the removal of a tooltip (can be an event or an array of events)</dd>+ * <dt>styles</dt><dd>A hash of style properties that will be applied to the tooltip node</dd>+ * <dt>show</dt><dd>Indicates whether or not to show the tooltip</dd>+ * <dt>markerEventHandler</dt><dd>Displays and hides tooltip based on marker events</dd>+ * <dt>planarEventHandler</dt><dd>Displays and hides tooltip based on planar events</dd>+ * <dt>markerLabelFunction</dt><dd>Reference to the function used to format a marker event triggered tooltip's text. The method contains + * the following arguments:+ * <dl>+ * <dt>categoryItem</dt><dd>An object containing the following:+ * <dl>+ * <dt>axis</dt><dd>The axis to which the category is bound.</dd>+ * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided).</dd>+ * <dt>key</dt><dd>The key of the category.</dd>+ * <dt>value</dt><dd>The value of the category.</dd>+ * </dl>+ * </dd>+ * <dt>valueItem</dt><dd>An object containing the following:+ * <dl>+ * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>+ * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>+ * <dt>key</dt><dd>The key for the series.</dd>+ * <dt>value</dt><dd>The value for the series item.</dd> + * </dl>+ * </dd>+ * <dt>itemIndex</dt><dd>The index of the item within the series.</dd>+ * <dt>series</dt><dd> The `CartesianSeries` instance of the item.</dd>+ * <dt>seriesIndex</dt><dd>The index of the series in the `seriesCollection`.</dd>+ * </dl>+ * The method returns an `HTMLElement` which is written into the DOM using `appendChild`. If you override this method and choose to return an html string, you+ * will also need to override the tooltip's `setTextFunction` method to accept an html string.+ * </dd>+ * <dt>planarLabelFunction</dt><dd>Reference to the function used to format a planar event triggered tooltip's text+ * <dl>+ * <dt>categoryAxis</dt><dd> `CategoryAxis` Reference to the categoryAxis of the chart.+ * <dt>valueItems</dt><dd>Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:+ * <dl>+ * <dt>axis</dt><dd>The value axis of the series.</dd>+ * <dt>key</dt><dd>The key for the series.</dd>+ * <dt>value</dt><dd>The value for the series item.</dd>+ * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>+ * </dl> + * </dd>+ * <dt>index</dt><dd>The index of the item within its series.</dd>+ * <dt>seriesArray</dt><dd>Array of series instances for each value item.</dd>+ * <dt>seriesIndex</dt><dd>The index of the series in the `seriesCollection`.</dd>+ * </dl>+ * </dd>+ * </dl>+ * The method returns an `HTMLElement` which is written into the DOM using `appendChild`. If you override this method and choose to return an html string, you+ * will also need to override the tooltip's `setTextFunction` method to accept an html string.+ * </dd>+ * <dt>setTextFunction</dt><dd>Method that writes content returned from `planarLabelFunction` or `markerLabelFunction` into the the tooltip node.+ * has the following signature:+ * <dl>+ * <dt>label</dt><dd>The `HTMLElement` that the content is to be added.</dd>+ * <dt>val</dt><dd>The content to be rendered into tooltip. This can be a `String` or `HTMLElement`. If an HTML string is used, it will be rendered as a+ * string.</dd>+ * </dl>+ * </dd>+ * </dl>+ * @attribute tooltip+ * @type Object+ */ + tooltip: {+ valueFn: "_getTooltip",++ setter: function(val)+ {+ return this._updateTooltip(val);+ }+ },++ /** + * The key value used for the chart's category axis. + *+ * @attribute categoryKey+ * @type String+ * @default category+ */+ categoryKey: {+ value: "category"+ },+ + /**+ * Indicates the type of axis to use for the category axis.+ *+ * <dl>+ * <dt>category</dt><dd>Specifies a `CategoryAxis`.</dd>+ * <dt>time</dt><dd>Specifies a `TimeAxis</dd>+ * </dl>+ *+ * @attribute categoryType+ * @type String+ * @default category+ */+ categoryType:{+ value:"category"+ },++ /**+ * Indicates the the type of interactions that will fire events.+ *+ * <dl>+ * <dt>marker</dt><dd>Events will be broadcasted when the mouse interacts with individual markers.</dd>+ * <dt>planar</dt><dd>Events will be broadcasted when the mouse intersects the plane of any markers on the chart.</dd>+ * <dt>none</dt><dd>No events will be broadcasted.</dd>+ * </dl>+ *+ * @attribute interactionType+ * @type String+ * @default marker+ */+ interactionType: {+ value: "marker"+ },++ /**+ * Reference to all the axes in the chart.+ *+ * @attribute axesCollection+ * @type Array+ */+ axesCollection: {},++ /**+ * Reference to graph instance.+ * + * @attribute graph+ * @type Graph + */+ graph: {+ valueFn: "_getGraph"+ },++ /**+ * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.+ *+ * @attribute groupMarkers+ * @type Boolean+ */+ groupMarkers: {+ value: false+ }+};++ChartBase.prototype = {+ /**+ * Handles groupMarkers change event.+ *+ * @method _groupMarkersChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _groupMarkersChangeHandler: function(e)+ {+ var graph = this.get("graph"),+ useGroupMarkers = e.newVal;+ if(graph)+ {+ graph.set("groupMarkers", useGroupMarkers);+ }+ },++ /**+ * Handler for itemRendered event.+ *+ * @method _itemRendered+ * @param {Object} e Event object.+ * @private+ */+ _itemRendered: function(e)+ {+ this._itemRenderQueue = this._itemRenderQueue.splice(1 + Y.Array.indexOf(this._itemRenderQueue, e.currentTarget), 1);+ if(this._itemRenderQueue.length < 1)+ {+ this._redraw();+ }+ },++ /**+ * Default value function for the `Graph` attribute.+ *+ * @method _getGraph+ * @return Graph+ * @private+ */+ _getGraph: function()+ {+ var graph = new Y.Graph({+ chart:this,+ groupMarkers: this.get("groupMarkers") + });+ graph.after("chartRendered", Y.bind(function(e) {+ this.fire("chartRendered");+ }, this));+ return graph; + },++ /**+ * Returns a series instance by index or key value.+ *+ * @method getSeries+ * @param val+ * @return CartesianSeries+ */+ getSeries: function(val)+ {+ var series = null, + graph = this.get("graph");+ if(graph)+ {+ if(Y_Lang.isNumber(val))+ {+ series = graph.getSeriesByIndex(val);+ }+ else+ {+ series = graph.getSeriesByKey(val);+ }+ }+ return series;+ },++ /**+ * Returns an `Axis` instance by key reference. If the axis was explicitly set through the `axes` attribute,+ * the key will be the same as the key used in the `axes` object. For default axes, the key for+ * the category axis is the value of the `categoryKey` (`category`). For the value axis, the default + * key is `values`.+ *+ * @method getAxisByKey+ * @param {String} val Key reference used to look up the axis.+ * @return Axis+ */+ getAxisByKey: function(val)+ {+ var axis,+ axes = this.get("axes");+ if(axes && axes.hasOwnProperty(val))+ {+ axis = axes[val];+ }+ return axis;+ },++ /**+ * Returns the category axis for the chart.+ *+ * @method getCategoryAxis+ * @return Axis+ */+ getCategoryAxis: function()+ {+ var axis,+ key = this.get("categoryKey"),+ axes = this.get("axes");+ if(axes.hasOwnProperty(key))+ {+ axis = axes[key];+ }+ return axis;+ },++ /**+ * Default direction of the chart.+ *+ * @property _direction+ * @type String+ * @default horizontal+ * @private+ */+ _direction: "horizontal",+ + /**+ * Storage for the `dataProvider` attribute.+ *+ * @property _dataProvider+ * @type Array+ * @private+ */+ _dataProvider: null,++ /**+ * Setter method for `dataProvider` attribute.+ *+ * @method _setDataValues+ * @param {Array} val Array to be set as `dataProvider`.+ * @return Array+ * @private+ */+ _setDataValues: function(val)+ {+ if(Y_Lang.isArray(val[0]))+ {+ var hash, + dp = [], + cats = val[0], + i = 0, + l = cats.length, + n, + sl = val.length;+ for(; i < l; ++i)+ {+ hash = {category:cats[i]};+ for(n = 1; n < sl; ++n)+ {+ hash["series" + n] = val[n][i];+ }+ dp[i] = hash; + }+ return dp;+ }+ return val;+ },++ /**+ * Storage for `seriesCollection` attribute.+ *+ * @property _seriesCollection+ * @type Array+ * @private + */+ _seriesCollection: null,++ /**+ * Setter method for `seriesCollection` attribute.+ *+ * @property _setSeriesCollection+ * @param {Array} val Array of either `CartesianSeries` instances or objects containing series attribute key value pairs.+ * @private+ */+ _setSeriesCollection: function(val)+ {+ this._seriesCollection = val;+ },+ /**+ * Helper method that returns the axis class that a key references.+ *+ * @method _getAxisClass+ * @param {String} t The type of axis.+ * @return Axis+ * @private+ */+ _getAxisClass: function(t)+ {+ return this._axisClass[t];+ },+ + /**+ * Key value pairs of axis types. + *+ * @property _axisClass+ * @type Object+ * @private+ */+ _axisClass: {+ stacked: Y.StackedAxis,+ numeric: Y.NumericAxis,+ category: Y.CategoryAxis,+ time: Y.TimeAxis+ },++ /**+ * Collection of axes.+ *+ * @property _axes+ * @type Array+ * @private+ */+ _axes: null,++ /**+ * @method initializer+ * @private+ */+ initializer: function()+ {+ this._itemRenderQueue = [];+ this._seriesIndex = -1;+ this._itemIndex = -1;+ this.after("dataProviderChange", this._dataProviderChangeHandler);+ },++ /**+ * @method renderUI+ * @private+ */+ renderUI: function()+ {+ var tt = this.get("tooltip"),+ bb = this.get("boundingBox"),+ cb = this.get("contentBox");+ //move the position = absolute logic to a class file+ bb.setStyle("position", "absolute");+ cb.setStyle("position", "absolute");+ this._addAxes();+ this._addSeries();+ if(tt && tt.show)+ {+ this._addTooltip();+ }+ this._setAriaElements(bb, cb);+ },+ + /**+ * Creates an aria `live-region`, `aria-label` and `aria-describedby` for the Chart.+ *+ * @method _setAriaElements+ * @param {Node} cb Reference to the Chart's `contentBox` attribute.+ * @private+ */+ _setAriaElements: function(bb, cb)+ {+ var description = this._getAriaOffscreenNode(),+ id = this.get("id") + "_description",+ liveRegion = this._getAriaOffscreenNode();+ cb.set("tabIndex", 0);+ cb.set("role", "img");+ cb.setAttribute("aria-label", this.get("ariaLabel"));+ cb.setAttribute("aria-describedby", id);+ description.set("id", id);+ description.set("tabIndex", -1);+ description.appendChild(DOCUMENT.createTextNode(this.get("ariaDescription")));+ liveRegion.set("id", "live-region");+ liveRegion.set("aria-live", "polite");+ liveRegion.set("aria-atomic", "true");+ liveRegion.set("role", "status");+ bb.setAttribute("role", "application");+ bb.appendChild(description);+ bb.appendChild(liveRegion);+ this._description = description;+ this._liveRegion = liveRegion;+ },++ /**+ * Sets a node offscreen for use as aria-description or aria-live-regin.+ *+ * @method _setOffscreen+ * @return Node + * @private+ */+ _getAriaOffscreenNode: function() + {+ var node = Y.Node.create("<div></div>"),+ ie = Y.UA.ie,+ clipRect = (ie && ie < 8) ? "rect(1px 1px 1px 1px)" : "rect(1px, 1px, 1px, 1px)";+ node.setStyle("position", "absolute");+ node.setStyle("height", "1px"); + node.setStyle("width", "1px"); + node.setStyle("overflow", "hidden");+ node.setStyle("clip", clipRect); + return node;+ },+ + /**+ * @method syncUI+ * @private+ */+ syncUI: function()+ {+ this._redraw();+ },++ /**+ * @method bindUI+ * @private+ */+ bindUI: function()+ {+ this.after("tooltipChange", Y.bind(this._tooltipChangeHandler, this));+ this.after("widthChange", this._sizeChanged);+ this.after("heightChange", this._sizeChanged);+ this.after("groupMarkersChange", this._groupMarkersChangeHandler);+ var tt = this.get("tooltip"),+ hideEvent = "mouseout",+ showEvent = "mouseover",+ cb = this.get("contentBox"),+ interactionType = this.get("interactionType"),+ i = 0,+ len,+ markerClassName = "." + SERIES_MARKER,+ isTouch = ((WINDOW && ("ontouchstart" in WINDOW)) && !(Y.UA.chrome && Y.UA.chrome < 6));+ Y.on("keydown", Y.bind(function(e) {+ var key = e.keyCode,+ numKey = parseFloat(key),+ msg;+ if(numKey > 36 && numKey < 41)+ {+ e.halt();+ msg = this._getAriaMessage(numKey);+ this._liveRegion.setContent("");+ this._liveRegion.appendChild(DOCUMENT.createTextNode(msg));+ }+ }, this), this.get("contentBox"));+ if(interactionType == "marker")+ {+ //if touch capabilities, toggle tooltip on touchend. otherwise, the tooltip attribute's hideEvent/showEvent types.+ hideEvent = tt.hideEvent;+ showEvent = tt.showEvent;+ if(isTouch)+ {+ Y.delegate("touchend", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);+ //hide active tooltip if the chart is touched+ Y.on("touchend", Y.bind(function(e) {+ e.halt(true);+ if(this._activeMarker)+ {+ this._activeMarker = null;+ this.hideTooltip(e);+ }+ }, this));+ }+ else+ {+ Y.delegate("mouseenter", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);+ Y.delegate("mousedown", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);+ Y.delegate("mouseup", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);+ Y.delegate("mouseleave", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);+ Y.delegate("click", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);+ Y.delegate("mousemove", Y.bind(this._positionTooltip, this), cb, markerClassName);+ }+ }+ else if(interactionType == "planar")+ {+ if(isTouch)+ {+ this._overlay.on("touchend", Y.bind(this._planarEventDispatcher, this));+ }+ else+ {+ this._overlay.on("mousemove", Y.bind(this._planarEventDispatcher, this));+ this.on("mouseout", this.hideTooltip);+ }+ }+ if(tt)+ {+ this.on("markerEvent:touchend", Y.bind(function(e) {+ var marker = e.series.get("markers")[e.index];+ if(this._activeMarker && marker === this._activeMarker)+ {+ this._activeMarker = null;+ this.hideTooltip(e);+ }+ else+ {++ this._activeMarker = marker;+ tt.markerEventHandler.apply(this, [e]);+ }+ }, this));+ if(hideEvent && showEvent && hideEvent == showEvent)+ {+ this.on(interactionType + "Event:" + hideEvent, this.toggleTooltip);+ }+ else+ {+ if(showEvent)+ {+ this.on(interactionType + "Event:" + showEvent, tt[interactionType + "EventHandler"]);+ }+ if(hideEvent)+ {+ if(Y_Lang.isArray(hideEvent))+ {+ len = hideEvent.length;+ for(; i < len; ++i)+ {+ this.on(interactionType + "Event:" + hideEvent[i], this.hideTooltip);+ }+ }+ this.on(interactionType + "Event:" + hideEvent, this.hideTooltip);+ }+ }+ }+ },+ + /**+ * Event handler for marker events.+ *+ * @method _markerEventDispatcher+ * @param {Object} e Event object.+ * @private+ */+ _markerEventDispatcher: function(e)+ {+ var type = e.type,+ cb = this.get("contentBox"),+ markerNode = e.currentTarget,+ strArr = markerNode.getAttribute("id").split("_"),+ index = strArr.pop(),+ seriesIndex = strArr.pop(),+ series = this.getSeries(parseInt(seriesIndex, 10)),+ items = this.getSeriesItems(series, index),+ isTouch = e && e.hasOwnProperty("changedTouches"),+ pageX = isTouch ? e.changedTouches[0].pageX : e.pageX,+ pageY = isTouch ? e.changedTouches[0].pageY : e.pageY,+ x = pageX - cb.getX(),+ y = pageY - cb.getY();+ if(type == "mouseenter")+ {+ type = "mouseover";+ }+ else if(type == "mouseleave")+ {+ type = "mouseout";+ }+ series.updateMarkerState(type, index);+ e.halt();+ /**+ * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseover event.+ * + *+ * @event markerEvent:mouseover+ * @preventable false+ * @param {EventFacade} e Event facade with the following additional+ * properties:+ * <dl>+ * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>+ * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>+ * <dt>node</dt><dd>The dom node of the marker.</dd>+ * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>series</dt><dd>Reference to the series of the marker.</dd>+ * <dt>index</dt><dd>Index of the marker in the series.</dd>+ * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>+ * </dl>+ */+ /**+ * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseout event.+ *+ * @event markerEvent:mouseout+ * @preventable false+ * @param {EventFacade} e Event facade with the following additional+ * properties:+ * <dl>+ * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>+ * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>+ * <dt>node</dt><dd>The dom node of the marker.</dd>+ * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>series</dt><dd>Reference to the series of the marker.</dd>+ * <dt>index</dt><dd>Index of the marker in the series.</dd>+ * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>+ * </dl>+ */+ /**+ * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mousedown event.+ *+ * @event markerEvent:mousedown+ * @preventable false+ * @param {EventFacade} e Event facade with the following additional+ * properties:+ * <dl>+ * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>+ * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>+ * <dt>node</dt><dd>The dom node of the marker.</dd>+ * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>series</dt><dd>Reference to the series of the marker.</dd>+ * <dt>index</dt><dd>Index of the marker in the series.</dd>+ * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>+ * </dl>+ */+ /**+ * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseup event.+ *+ * @event markerEvent:mouseup+ * @preventable false+ * @param {EventFacade} e Event facade with the following additional+ * properties:+ * <dl>+ * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>+ * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>+ * <dt>node</dt><dd>The dom node of the marker.</dd>+ * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>series</dt><dd>Reference to the series of the marker.</dd>+ * <dt>index</dt><dd>Index of the marker in the series.</dd>+ * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>+ * </dl>+ */+ /**+ * Broadcasts when `interactionType` is set to `marker` and a series marker has received a click event.+ *+ * @event markerEvent:click+ * @preventable false+ * @param {EventFacade} e Event facade with the following additional+ * properties:+ * <dl>+ * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>+ * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>+ * <dt>node</dt><dd>The dom node of the marker.</dd>+ * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>pageX</dt><dd>The x location of the event on the page (including scroll)</dd>+ * <dt>pageY</dt><dd>The y location of the event on the page (including scroll)</dd>+ * <dt>series</dt><dd>Reference to the series of the marker.</dd>+ * <dt>index</dt><dd>Index of the marker in the series.</dd>+ * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>+ * <dt>originEvent</dt><dd>Underlying dom event.</dd>+ * </dl>+ */+ this.fire("markerEvent:" + type, {+ originEvent: e,+ pageX:pageX, + pageY:pageY, + categoryItem:items.category, + valueItem:items.value, + node:markerNode, + x:x, + y:y, + series:series, + index:index, + seriesIndex:seriesIndex+ });+ },++ /**+ * Event handler for dataProviderChange.+ *+ * @method _dataProviderChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _dataProviderChangeHandler: function(e)+ {+ var dataProvider = e.newVal,+ axes,+ i,+ axis;+ this._seriesIndex = -1;+ this._itemIndex = -1;+ if(this instanceof Y.CartesianChart)+ {+ this.set("axes", this.get("axes"));+ this.set("seriesCollection", this.get("seriesCollection"));+ }+ axes = this.get("axes");+ if(axes)+ {+ for(i in axes)+ {+ if(axes.hasOwnProperty(i))+ {+ axis = axes[i];+ if(axis instanceof Y.Axis)+ {+ if(axis.get("position") != "none")+ {+ this._addToAxesRenderQueue(axis);+ }+ axis.set("dataProvider", dataProvider);+ }+ }+ }+ }+ },+ + /**+ * Event listener for toggling the tooltip. If a tooltip is visible, hide it. If not, it + * will create and show a tooltip based on the event object.+ * + * @method toggleTooltip+ * @param {Object} e Event object.+ */+ toggleTooltip: function(e)+ {+ var tt = this.get("tooltip");+ if(tt.visible)+ {+ this.hideTooltip();+ }+ else+ {+ tt.markerEventHandler.apply(this, [e]);+ }+ },++ /**+ * Shows a tooltip+ *+ * @method _showTooltip+ * @param {String} msg Message to dispaly in the tooltip.+ * @param {Number} x x-coordinate + * @param {Number} y y-coordinate+ * @private+ */+ _showTooltip: function(msg, x, y)+ {+ var tt = this.get("tooltip"),+ node = tt.node;+ if(msg)+ {+ tt.visible = true;+ tt.setTextFunction(node, msg);+ node.setStyle("top", y + "px");+ node.setStyle("left", x + "px");+ node.setStyle("visibility", "visible");+ }+ },++ /**+ * Positions the tooltip+ *+ * @method _positionTooltip+ * @param {Object} e Event object.+ * @private+ */+ _positionTooltip: function(e)+ {+ var tt = this.get("tooltip"),+ node = tt.node,+ cb = this.get("contentBox"),+ x = (e.pageX + 10) - cb.getX(),+ y = (e.pageY + 10) - cb.getY();+ if(node)+ {+ node.setStyle("left", x + "px");+ node.setStyle("top", y + "px");+ }+ },++ /**+ * Hides the default tooltip+ *+ * @method hideTooltip+ */+ hideTooltip: function()+ {+ var tt = this.get("tooltip"),+ node = tt.node;+ tt.visible = false;+ node.set("innerHTML", "");+ node.setStyle("left", -10000);+ node.setStyle("top", -10000);+ node.setStyle("visibility", "hidden");+ },++ /**+ * Adds a tooltip to the dom.+ *+ * @method _addTooltip+ * @private+ */+ _addTooltip: function()+ {+ var tt = this.get("tooltip"),+ id = this.get("id") + "_tooltip",+ cb = this.get("contentBox"),+ oldNode = DOCUMENT.getElementById(id);+ if(oldNode)+ {+ cb.removeChild(oldNode);+ }+ tt.node.set("id", id);+ tt.node.setStyle("visibility", "hidden");+ cb.appendChild(tt.node);+ },++ /**+ * Updates the tooltip attribute.+ *+ * @method _updateTooltip+ * @param {Object} val Object containing properties for the tooltip.+ * @return Object+ * @private+ */+ _updateTooltip: function(val)+ {+ var tt = this.get("tooltip") || this._getTooltip(),+ i,+ styles,+ node,+ props = {+ markerLabelFunction:"markerLabelFunction",+ planarLabelFunction:"planarLabelFunction",+ setTextFunction:"setTextFunction",+ showEvent:"showEvent",+ hideEvent:"hideEvent",+ markerEventHandler:"markerEventHandler",+ planarEventHandler:"planarEventHandler",+ show:"show"+ };+ if(Y_Lang.isObject(val))+ {+ styles = val.styles;+ node = Y.one(val.node) || tt.node;+ if(styles)+ {+ for(i in styles)+ {+ if(styles.hasOwnProperty(i))+ {+ node.setStyle(i, styles[i]);+ }+ }+ }+ for(i in props)+ {+ if(val.hasOwnProperty(i))+ {+ tt[i] = val[i];+ }+ }+ tt.node = node;+ }+ return tt;+ },++ /**+ * Default getter for `tooltip` attribute.+ *+ * @method _getTooltip+ * @return Object+ * @private+ */+ _getTooltip: function()+ {+ var node = DOCUMENT.createElement("div"),+ tooltipClass = _getClassName("chart-tooltip"),+ tt = {+ setTextFunction: this._setText,+ markerLabelFunction: this._tooltipLabelFunction,+ planarLabelFunction: this._planarLabelFunction,+ show: true,+ hideEvent: "mouseout",+ showEvent: "mouseover",+ markerEventHandler: function(e)+ {+ var tt = this.get("tooltip"),+ msg = tt.markerLabelFunction.apply(this, [e.categoryItem, e.valueItem, e.index, e.series, e.seriesIndex]);+ this._showTooltip(msg, e.x + 10, e.y + 10);+ },+ planarEventHandler: function(e)+ {+ var tt = this.get("tooltip"),+ msg ,+ categoryAxis = this.get("categoryAxis");+ msg = tt.planarLabelFunction.apply(this, [categoryAxis, e.valueItem, e.index, e.items, e.seriesIndex]);+ this._showTooltip(msg, e.x + 10, e.y + 10);+ }+ };+ node = Y.one(node);+ node.set("id", this.get("id") + "_tooltip");+ node.setStyle("fontSize", "85%");+ node.setStyle("opacity", "0.83");+ node.setStyle("position", "absolute");+ node.setStyle("paddingTop", "2px");+ node.setStyle("paddingRight", "5px");+ node.setStyle("paddingBottom", "4px");+ node.setStyle("paddingLeft", "2px");+ node.setStyle("backgroundColor", "#fff");+ node.setStyle("border", "1px solid #dbdccc");+ node.setStyle("pointerEvents", "none");+ node.setStyle("zIndex", 3);+ node.setStyle("whiteSpace", "noWrap");+ node.setStyle("visibility", "hidden");+ node.addClass(tooltipClass);+ tt.node = Y.one(node);+ return tt;+ },++ /**+ * Formats tooltip text when `interactionType` is `planar`.+ *+ * @method _planarLabelFunction+ * @param {Axis} categoryAxis Reference to the categoryAxis of the chart.+ * @param {Array} valueItems Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:+ * <dl>+ * <dt>axis</dt><dd>The value axis of the series.</dd>+ * <dt>key</dt><dd>The key for the series.</dd>+ * <dt>value</dt><dd>The value for the series item.</dd>+ * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>+ * </dl> + * @param {Number} index The index of the item within its series.+ * @param {Array} seriesArray Array of series instances for each value item.+ * @param {Number} seriesIndex The index of the series in the `seriesCollection`.+ * @return {String | HTML} + * @private+ */+ _planarLabelFunction: function(categoryAxis, valueItems, index, seriesArray, seriesIndex)+ {+ var msg = DOCUMENT.createElement("div"),+ valueItem,+ i = 0,+ len = seriesArray.length,+ axis,+ categoryValue,+ seriesValue,+ series;+ if(categoryAxis)+ {+ categoryValue = categoryAxis.get("labelFunction").apply(this, [categoryAxis.getKeyValueAt(this.get("categoryKey"), index), categoryAxis.get("labelFormat")]);+ if(!Y_Lang.isObject(categoryValue))+ {+ categoryValue = DOCUMENT.createTextNode(categoryValue);+ }+ msg.appendChild(categoryValue);+ }++ for(; i < len; ++i)+ {+ series = seriesArray[i];+ if(series.get("visible"))+ {+ valueItem = valueItems[i];+ axis = valueItem.axis;+ seriesValue = axis.get("labelFunction").apply(this, [axis.getKeyValueAt(valueItem.key, index), axis.get("labelFormat")]);+ msg.appendChild(DOCUMENT.createElement("br"));+ msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName));+ msg.appendChild(DOCUMENT.createTextNode(": "));+ if(!Y_Lang.isObject(seriesValue))+ {+ seriesValue = DOCUMENT.createTextNode(seriesValue);+ }+ msg.appendChild(seriesValue);+ }+ }+ return msg;+ },++ /**+ * Formats tooltip text when `interactionType` is `marker`.+ *+ * @method _tooltipLabelFunction+ * @param {Object} categoryItem An object containing the following:+ * <dl>+ * <dt>axis</dt><dd>The axis to which the category is bound.</dd>+ * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided)</dd>+ * <dt>key</dt><dd>The key of the category.</dd>+ * <dt>value</dt><dd>The value of the category</dd>+ * </dl>+ * @param {Object} valueItem An object containing the following:+ * <dl>+ * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>+ * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>+ * <dt>key</dt><dd>The key for the series.</dd>+ * <dt>value</dt><dd>The value for the series item.</dd> + * </dl>+ * @param {Number} itemIndex The index of the item within the series.+ * @param {CartesianSeries} series The `CartesianSeries` instance of the item.+ * @param {Number} seriesIndex The index of the series in the `seriesCollection`.+ * @return {String | HTML}+ * @private+ */+ _tooltipLabelFunction: function(categoryItem, valueItem, itemIndex, series, seriesIndex)+ {+ var msg = DOCUMENT.createElement("div"),+ categoryValue = categoryItem.axis.get("labelFunction").apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]),+ seriesValue = valueItem.axis.get("labelFunction").apply(this, [valueItem.value, valueItem.axis.get("labelFormat")]);+ msg.appendChild(DOCUMENT.createTextNode(categoryItem.displayName)); + msg.appendChild(DOCUMENT.createTextNode(": ")); + if(!Y_Lang.isObject(categoryValue))+ {+ categoryValue = DOCUMENT.createTextNode(categoryValue);+ }+ msg.appendChild(categoryValue);+ msg.appendChild(DOCUMENT.createElement("br"));+ msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName)); + msg.appendChild(DOCUMENT.createTextNode(": ")); + if(!Y_Lang.isObject(seriesValue))+ {+ seriesValue = DOCUMENT.createTextNode(seriesValue);+ }+ msg.appendChild(seriesValue);+ return msg; + },++ /**+ * Event handler for the tooltipChange.+ *+ * @method _tooltipChangeHandler+ * @param {Object} e Event object.+ * @private+ */+ _tooltipChangeHandler: function(e)+ {+ if(this.get("tooltip"))+ {+ var tt = this.get("tooltip"),+ node = tt.node,+ show = tt.show,+ cb = this.get("contentBox");+ if(node && show)+ {+ if(!cb.contains(node))+ {+ this._addTooltip();+ }+ }+ }+ },+ + /**+ * Updates the content of text field. This method writes a value into a text field using + * `appendChild`. If the value is a `String`, it is converted to a `TextNode` first. + *+ * @method _setText+ * @param label {HTMLElement} label to be updated+ * @param val {String} value with which to update the label+ * @private+ */+ _setText: function(textField, val)+ { + textField.setContent("");+ if(Y_Lang.isNumber(val))+ {+ val = val + "";+ }+ else if(!val)+ {+ val = "";+ }+ if(IS_STRING(val))+ {+ val = DOCUMENT.createTextNode(val);+ }+ textField.appendChild(val);+ },++ /**+ * Returns all the keys contained in a `dataProvider`.+ *+ * @method _getAllKeys+ * @param {Array} dp Collection of objects to be parsed.+ * @return Object+ */+ _getAllKeys: function(dp)+ {+ var i = 0,+ len = dp.length,+ item,+ key,+ keys = {};+ for(; i < len; ++i)+ {+ item = dp[i];+ for(key in item)+ {+ if(item.hasOwnProperty(key))+ {+ keys[key] = true;+ }+ }+ }+ return keys;+ },+ + /**+ * Constructs seriesKeys if not explicitly specified.+ *+ * @method _buildSeriesKeys+ * @param {Array} dataProvider The dataProvider for the chart.+ * @return Array+ * @private+ */+ _buildSeriesKeys: function(dataProvider)+ {+ var allKeys,+ catKey = this.get("categoryKey"),+ keys = [],+ i;+ if(this._seriesKeysExplicitlySet)+ {+ return this._seriesKeys;+ }+ allKeys = this._getAllKeys(dataProvider);+ for(i in allKeys)+ {+ if(allKeys.hasOwnProperty(i) && i != catKey)+ {+ keys.push(i);+ }+ }+ return keys;+ }+};+Y.ChartBase = ChartBase;+/**+ * The CartesianChart class creates a chart with horizontal and vertical axes.+ *+ * @module charts+ * @submodule charts-base+ * @class CartesianChart+ * @extends ChartBase+ * @constructor+ */+Y.CartesianChart = Y.Base.create("cartesianChart", Y.Widget, [Y.ChartBase], {+ /**+ * @method renderUI+ * @private+ */+ renderUI: function()+ {+ var bb = this.get("boundingBox"),+ cb = this.get("contentBox"),+ tt = this.get("tooltip"),+ overlay,+ overlayClass = _getClassName("overlay");+ //move the position = absolute logic to a class file+ bb.setStyle("position", "absolute");+ cb.setStyle("position", "absolute");+ this._addAxes();+ this._addGridlines();+ this._addSeries();+ if(tt && tt.show)+ {+ this._addTooltip();+ }+ //If there is a style definition. Force them to set.+ this.get("styles");+ if(this.get("interactionType") == "planar")+ {+ overlay = DOCUMENT.createElement("div");+ this.get("contentBox").appendChild(overlay);+ this._overlay = Y.one(overlay); + this._overlay.set("id", this.get("id") + "_overlay");+ this._overlay.setStyle("position", "absolute");+ this._overlay.setStyle("background", "#fff");+ this._overlay.setStyle("opacity", 0);+ this._overlay.addClass(overlayClass);+ this._overlay.setStyle("zIndex", 4);+ }+ this._setAriaElements(bb, cb);+ this._redraw();+ },++ /**+ * When `interactionType` is set to `planar`, listens for mouse move events and fires `planarEvent:mouseover` or `planarEvent:mouseout` depending on the position of the mouse in relation to + * data points on the `Chart`.+ *+ * @method _planarEventDispatcher+ * @param {Object} e Event object.+ * @private+ */+ _planarEventDispatcher: function(e)+ {+ var graph = this.get("graph"),+ bb = this.get("boundingBox"),+ cb = graph.get("contentBox"),+ isTouch = e && e.hasOwnProperty("changedTouches"),+ pageX = isTouch ? e.changedTouches[0].pageX : e.pageX,+ pageY = isTouch ? e.changedTouches[0].pageY : e.pageY,+ posX = pageX - bb.getX(),+ posY = pageY - bb.getY(),+ offset = {+ x: pageX - cb.getX(),+ y: pageY - cb.getY()+ },+ sc = graph.get("seriesCollection"),+ series,+ i = 0,+ index,+ oldIndex = this._selectedIndex,+ item,+ items = [],+ categoryItems = [],+ valueItems = [],+ direction = this.get("direction"),+ hasMarkers,+ catAxis,+ valAxis,+ coord,+ //data columns and area data could be created on a graph level+ markerPlane,+ len,+ coords;+ e.halt(true);+ if(direction == "horizontal")+ {+ catAxis = "x";+ valAxis = "y";+ }+ else+ {+ valAxis = "x";+ catAxis = "y";+ }+ coord = offset[catAxis];+ if(sc)+ {+ len = sc.length;+ while(i < len && !markerPlane)+ {+ if(sc[i])+ {+ markerPlane = sc[i].get(catAxis + "MarkerPlane");+ }+ i++;+ }+ }+ if(markerPlane)+ {+ len = markerPlane.length;+ for(i = 0; i < len; ++i)+ {+ if(coord <= markerPlane[i].end && coord >= markerPlane[i].start)+ {+ index = i;+ break;+ }+ }+ len = sc.length;+ for(i = 0; i < len; ++i)+ {+ series = sc[i];+ coords = series.get(valAxis + "coords");+ hasMarkers = series.get("markers");+ if(hasMarkers && !isNaN(oldIndex) && oldIndex > -1)+ {+ series.updateMarkerState("mouseout", oldIndex);+ }+ if(coords && coords[index] > -1)+ {+ if(hasMarkers && !isNaN(index) && index > -1)+ {+ series.updateMarkerState("mouseover", index);+ }+ item = this.getSeriesItems(series, index);+ categoryItems.push(item.category);+ valueItems.push(item.value);+ items.push(series);+ }+ + }+ this._selectedIndex = index;++ /**+ * Broadcasts when `interactionType` is set to `planar` and a series' marker plane has received a mouseover event.+ * + *+ * @event planarEvent:mouseover+ * @preventable false+ * @param {EventFacade} e Event facade with the following additional+ * properties:+ * <dl>+ * <dt>categoryItem</dt><dd>An array of hashes, each containing information about the category `Axis` of each marker whose plane has been intersected.</dd>+ * <dt>valueItem</dt><dd>An array of hashes, each containing information about the value `Axis` of each marker whose plane has been intersected.</dd>+ * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>+ * <dt>pageX</dt><dd>The x location of the event on the page (including scroll)</dd>+ * <dt>pageY</dt><dd>The y location of the event on the page (including scroll)</dd>+ * <dt>items</dt><dd>An array including all the series which contain a marker whose plane has been intersected.</dd>+ * <dt>index</dt><dd>Index of the markers in their respective series.</dd>+ * <dt>originEvent</dt><dd>Underlying dom event.</dd>+ * </dl>+ */+ /**+ * Broadcasts when `interactionType` is set to `planar` and a series' marker plane has received a mouseout event.+ *+ * @event planarEvent:mouseout+ * @preventable false+ * @param {EventFacade} e + */+ if(index > -1)+ {+ this.fire("planarEvent:mouseover", {+ categoryItem:categoryItems, + valueItem:valueItems, + x:posX, + y:posY, + pageX:pageX,+ pageY:pageY,+ items:items, + index:index,+ originEvent:e+ });+ }+ else+ {+ this.fire("planarEvent:mouseout");+ }+ }+ },++ /**+ * Indicates the default series type for the chart.+ *+ * @property _type+ * @type {String}+ * @private+ */+ _type: "combo",++ /**+ * Queue of axes instances that will be updated. This method is used internally to determine when all axes have been updated.+ *+ * @property _itemRenderQueue+ * @type Array+ * @private+ */+ _itemRenderQueue: null,++ /**+ * Adds an `Axis` instance to the `_itemRenderQueue`.+ *+ * @method _addToAxesRenderQueue+ * @param {Axis} axis An `Axis` instance.+ * @private + */+ _addToAxesRenderQueue: function(axis)+ {+ if(!this._itemRenderQueue)+ {+ this._itemRenderQueue = [];+ }+ if(Y.Array.indexOf(this._itemRenderQueue, axis) < 0)+ {+ this._itemRenderQueue.push(axis);+ }+ },++ /**+ * Adds axis instance to the appropriate array based on position+ *+ * @method _addToAxesCollection+ * @param {String} position The position of the axis+ * @param {Axis} axis The `Axis` instance+ */+ _addToAxesCollection: function(position, axis)+ {+ var axesCollection = this.get(position + "AxesCollection");+ if(!axesCollection)+ {+ axesCollection = [];+ this.set(position + "AxesCollection", axesCollection);+ }+ axesCollection.push(axis);+ },++ /**+ * Returns the default value for the `seriesCollection` attribute.+ *+ * @method _getDefaultSeriesCollection+ * @param {Array} val Array containing either `CartesianSeries` instances or objects containing data to construct series instances.+ * @return Array+ * @private+ */+ _getDefaultSeriesCollection: function()+ {+ var seriesCollection,+ dataProvider = this.get("dataProvider");+ if(dataProvider)+ {+ seriesCollection = this._parseSeriesCollection();+ }+ return seriesCollection;+ },++ /**+ * Parses and returns a series collection from an object and default properties.+ *+ * @method _parseSeriesCollection+ * @param {Object} val Object contain properties for series being set.+ * @return Object+ * @private+ */+ _parseSeriesCollection: function(val)+ {+ var dir = this.get("direction"), + sc = [], + catAxis,+ valAxis,+ tempKeys = [],+ series,+ seriesKeys = this.get("seriesKeys").concat(),+ i,+ index,+ l,+ type = this.get("type"),+ key,+ catKey,+ seriesKey,+ graph,+ orphans = [],+ categoryKey = this.get("categoryKey"),+ showMarkers = this.get("showMarkers"),+ showAreaFill = this.get("showAreaFill"),+ showLines = this.get("showLines");+ val = val || []; + if(dir == "vertical")+ {+ catAxis = "yAxis";+ catKey = "yKey";+ valAxis = "xAxis";+ seriesKey = "xKey";+ }+ else+ {+ catAxis = "xAxis";+ catKey = "xKey";+ valAxis = "yAxis";+ seriesKey = "yKey";+ }+ l = val.length;+ while(val && val.length > 0)+ {+ series = val.shift();+ key = this._getBaseAttribute(series, seriesKey);+ if(key)+ {+ index = Y.Array.indexOf(seriesKeys, key);+ if(index > -1)+ {+ seriesKeys.splice(index, 1);+ tempKeys.push(key);+ sc.push(series);+ }+ else+ {+ orphans.push(series);+ }+ }+ else+ {+ orphans.push(series);+ }+ }+ while(orphans.length > 0)+ {+ series = orphans.shift();+ if(seriesKeys.length > 0)+ {+ key = seriesKeys.shift();+ this._setBaseAttribute(series, seriesKey, key);+ tempKeys.push(key);+ sc.push(series);+ }+ else if(series instanceof Y.CartesianSeries)+ {+ series.destroy(true);+ }+ }+ if(seriesKeys.length > 0)+ {+ tempKeys = tempKeys.concat(seriesKeys);+ }+ l = tempKeys.length;+ for(i = 0; i < l; ++i)+ {+ series = sc[i] || {type:type};+ if(series instanceof Y.CartesianSeries)+ {+ this._parseSeriesAxes(series);+ continue;+ }++ series[catKey] = series[catKey] || categoryKey;+ series[seriesKey] = series[seriesKey] || seriesKeys.shift();+ series[catAxis] = this._getCategoryAxis();+ series[valAxis] = this._getSeriesAxis(series[seriesKey]);+ + series.type = series.type || type;+ series.direction = series.direction || dir;+ + if((series.type == "combo" || series.type == "stackedcombo" || series.type == "combospline" || series.type == "stackedcombospline"))+ {+ if(showAreaFill !== null)+ {+ series.showAreaFill = (series.showAreaFill !== null && series.showAreaFill !== undefined) ? series.showAreaFill : showAreaFill;+ }+ if(showMarkers !== null)+ {+ series.showMarkers = (series.showMarkers !== null && series.showMarkers !== undefined) ? series.showMarkers : showMarkers;+ }+ if(showLines !== null)+ {+ series.showLines = (series.showLines !== null && series.showLines !== undefined) ? series.showLines : showLines;+ }+ }+ sc[i] = series;+ }+ if(sc)+ {+ graph = this.get("graph");+ graph.set("seriesCollection", sc);+ sc = graph.get("seriesCollection");+ }+ return sc;+ },++ /**+ * Parse and sets the axes for a series instance.+ *+ * @method _parseSeriesAxes+ * @param {CartesianSeries} series A `CartesianSeries` instance.+ * @private+ */+ _parseSeriesAxes: function(series)+ {+ var axes = this.get("axes"),+ xAxis = series.get("xAxis"),+ yAxis = series.get("yAxis"),+ YAxis = Y.Axis,+ axis;+ if(xAxis && !(xAxis instanceof YAxis) && Y_Lang.isString(xAxis) && axes.hasOwnProperty(xAxis))+ {+ axis = axes[xAxis];+ if(axis instanceof YAxis)+ {+ series.set("xAxis", axis);+ }+ }+ if(yAxis && !(yAxis instanceof YAxis) && Y_Lang.isString(yAxis) && axes.hasOwnProperty(yAxis))+ { + axis = axes[yAxis];+ if(axis instanceof YAxis)+ {+ series.set("yAxis", axis);+ }+ }++ },++ /**+ * Returns the category axis instance for the chart.+ *+ * @method _getCategoryAxis+ * @return Axis+ * @private+ */+ _getCategoryAxis: function()+ {+ var axis,+ axes = this.get("axes"),+ categoryAxisName = this.get("categoryAxisName") || this.get("categoryKey");+ axis = axes[categoryAxisName];+ return axis;+ },++ /**+ * Returns the value axis for a series.+ *+ * @method _getSeriesAxis+ * @param {String} key The key value used to determine the axis instance.+ * @return Axis+ * @private+ */+ _getSeriesAxis:function(key, axisName)+ {+ var axes = this.get("axes"),+ i,+ keys,+ axis;+ if(axes)+ {+ if(axisName && axes.hasOwnProperty(axisName))+ {+ axis = axes[axisName];+ }+ else+ {+ for(i in axes)+ {+ if(axes.hasOwnProperty(i))+ {+ keys = axes[i].get("keys");+ if(keys && keys.hasOwnProperty(key))+ {+ axis = axes[i];+ break;+ }+ }+ }+ }+ }+ return axis;+ },++ /**+ * Gets an attribute from an object, using a getter for Base objects and a property for object+ * literals. Used for determining attributes from series/axis references which can be an actual class instance+ * or a hash of properties that will be used to create a class instance.+ *+ * @method _getBaseAttribute+ * @param {Object} item Object or instance in which the attribute resides.+ * @param {String} key Attribute whose value will be returned.+ * @return Object+ * @private+ */+ _getBaseAttribute: function(item, key)+ {+ if(item instanceof Y.Base)+ {+ return item.get(key);+ }+ if(item.hasOwnProperty(key))+ {+ return item[key];+ }+ return null;+ },++ /**+ * Sets an attribute on an object, using a setter of Base objects and a property for object+ * literals. Used for setting attributes on a Base class, either directly or to be stored in an object literal+ * for use at instantiation.+ *+ * @method _setBaseAttribute+ * @param {Object} item Object or instance in which the attribute resides.+ * @param {String} key Attribute whose value will be assigned.+ * @param {Object} value Value to be assigned to the attribute.+ * @private+ */+ _setBaseAttribute: function(item, key, value)+ {+ if(item instanceof Y.Base)+ {+ item.set(key, value);+ }+ else+ {+ item[key] = value;+ }+ },++ /**+ * Creates `Axis` instances.+ *+ * @method _setAxes+ * @param {Object} val Object containing `Axis` instances or objects in which to construct `Axis` instances.+ * @return Object+ * @private+ */+ _setAxes: function(val)+ {+ var hash = this._parseAxes(val),+ axes = {},+ axesAttrs = {+ edgeOffset: "edgeOffset", + position: "position",+ overlapGraph:"overlapGraph",+ labelFunction:"labelFunction",+ labelFunctionScope:"labelFunctionScope",+ labelFormat:"labelFormat",+ appendLabelFunction: "appendLabelFunction",+ appendTitleFunction: "appendTitleFunction",+ maximum:"maximum",+ minimum:"minimum", + roundingMethod:"roundingMethod",+ alwaysShowZero:"alwaysShowZero",+ title:"title",+ width:"width",+ height:"height"+ },+ dp = this.get("dataProvider"),+ ai,+ i, + pos, + axis,+ axisPosition,+ dh, + axisClass, + config,+ axesCollection;+ for(i in hash)+ {+ if(hash.hasOwnProperty(i))+ {+ dh = hash[i];+ if(dh instanceof Y.Axis)+ {+ axis = dh;+ }+ else+ {+ axis = null;+ config = {};+ config.dataProvider = dh.dataProvider || dp;+ config.keys = dh.keys;+ + if(dh.hasOwnProperty("roundingUnit"))+ {+ config.roundingUnit = dh.roundingUnit;+ }+ pos = dh.position;+ if(dh.styles)+ {+ config.styles = dh.styles;+ }+ config.position = dh.position;+ for(ai in axesAttrs)+ {+ if(axesAttrs.hasOwnProperty(ai) && dh.hasOwnProperty(ai))+ {+ config[ai] = dh[ai];+ }+ }+ + //only check for existing axis if we constructed the default axes already+ if(val)+ {+ axis = this.getAxisByKey(i);+ }+ + if(axis && axis instanceof Y.Axis)+ {+ axisPosition = axis.get("position");+ if(pos != axisPosition)+ {+ if(axisPosition != "none")+ {+ axesCollection = this.get(axisPosition + "AxesCollection");+ axesCollection.splice(Y.Array.indexOf(axesCollection, axis), 1);+ }+ if(pos != "none")+ {+ this._addToAxesCollection(pos, axis);+ }+ }+ axis.setAttrs(config);+ }+ else+ {+ axisClass = this._getAxisClass(dh.type);+ axis = new axisClass(config);+ axis.after("axisRendered", Y.bind(this._itemRendered, this));+ }+ }++ if(axis)+ {+ axesCollection = this.get(pos + "AxesCollection");+ if(axesCollection && Y.Array.indexOf(axesCollection, axis) > 0)+ {+ axis.set("overlapGraph", false);+ }+ axes[i] = axis;+ }+ }+ }+ return axes;+ },+ + /**+ * Adds axes to the chart.+ *+ * @method _addAxes+ * @private+ */+ _addAxes: function()+ {+ var axes = this.get("axes"),+ i, + axis, + pos,+ w = this.get("width"),+ h = this.get("height"),+ node = Y.Node.one(this._parentNode);+ if(!this._axesCollection)+ { + this._axesCollection = [];+ }+ for(i in axes)+ {+ if(axes.hasOwnProperty(i))+ {+ axis = axes[i];+ if(axis instanceof Y.Axis)+ {+ if(!w)+ {+ this.set("width", node.get("offsetWidth"));+ w = this.get("width");+ }+ if(!h)+ {+ this.set("height", node.get("offsetHeight"));+ h = this.get("height");+ }+ this._addToAxesRenderQueue(axis);+ pos = axis.get("position");+ if(!this.get(pos + "AxesCollection"))+ {+ this.set(pos + "AxesCollection", [axis]);+ }+ else+ {+ this.get(pos + "AxesCollection").push(axis);+ }+ this._axesCollection.push(axis);+ if(axis.get("keys").hasOwnProperty(this.get("categoryKey")))+ {+ this.set("categoryAxis", axis);+ }+ axis.render(this.get("contentBox"));+ }+ }+ }+ },++ /**+ * Renders the Graph.+ *+ * @method _addSeries+ * @private+ */+ _addSeries: function()+ {+ var graph = this.get("graph"),+ sc = this.get("seriesCollection");+ graph.render(this.get("contentBox"));++ },++ /**+ * Adds gridlines to the chart.+ *+ * @method _addGridlines+ * @private+ */+ _addGridlines: function()+ {+ var graph = this.get("graph"),+ hgl = this.get("horizontalGridlines"),+ vgl = this.get("verticalGridlines"),+ direction = this.get("direction"),+ leftAxesCollection = this.get("leftAxesCollection"),+ rightAxesCollection = this.get("rightAxesCollection"),+ bottomAxesCollection = this.get("bottomAxesCollection"),+ topAxesCollection = this.get("topAxesCollection"),+ seriesAxesCollection,+ catAxis = this.get("categoryAxis"),+ hAxis,+ vAxis;+ if(this._axesCollection)+ {+ seriesAxesCollection = this._axesCollection.concat();+ seriesAxesCollection.splice(Y.Array.indexOf(seriesAxesCollection, catAxis), 1);+ }+ if(hgl)+ {+ if(leftAxesCollection && leftAxesCollection[0])+ {+ hAxis = leftAxesCollection[0];+ }+ else if(rightAxesCollection && rightAxesCollection[0])+ {+ hAxis = rightAxesCollection[0];+ }+ else + {+ hAxis = direction == "horizontal" ? catAxis : seriesAxesCollection[0];+ }+ if(!this._getBaseAttribute(hgl, "axis") && hAxis)+ {+ this._setBaseAttribute(hgl, "axis", hAxis);+ }+ if(this._getBaseAttribute(hgl, "axis"))+ {+ graph.set("horizontalGridlines", hgl);+ }+ }+ if(vgl)+ {+ if(bottomAxesCollection && bottomAxesCollection[0])+ {+ vAxis = bottomAxesCollection[0];+ }+ else if (topAxesCollection && topAxesCollection[0])+ {+ vAxis = topAxesCollection[0];+ }+ else + {+ vAxis = direction == "vertical" ? catAxis : seriesAxesCollection[0];+ }+ if(!this._getBaseAttribute(vgl, "axis") && vAxis)+ {+ this._setBaseAttribute(vgl, "axis", vAxis);+ }+ if(this._getBaseAttribute(vgl, "axis"))+ {+ graph.set("verticalGridlines", vgl);+ }+ }+ },+ + /**+ * Default Function for the axes attribute.+ *+ * @method _getDefaultAxes+ * @return Object+ * @private+ */+ _getDefaultAxes: function()+ {+ var axes;+ if(this.get("dataProvider"))+ {+ axes = this._parseAxes();+ }+ return axes;+ },++ /**+ * Generates and returns a key-indexed object containing `Axis` instances or objects used to create `Axis` instances.+ *+ * @method _parseAxes+ * @param {Object} axes Object containing `Axis` instances or `Axis` attributes.+ * @return Object+ * @private+ */+ _parseAxes: function(axes)+ {+ var catKey = this.get("categoryKey"),+ axis,+ attr,+ keys,+ newAxes = {},+ claimedKeys = [],+ categoryAxisName = this.get("categoryAxisName") || this.get("categoryKey"),+ valueAxisName = this.get("valueAxisName"),+ seriesKeys = this.get("seriesKeys").concat(),+ i, + l,+ ii,+ ll,+ cIndex,+ direction = this.get("direction"),+ seriesPosition,+ categoryPosition,+ valueAxes = [],+ seriesAxis = this.get("stacked") ? "stacked" : "numeric";+ if(direction == "vertical")+ {+ seriesPosition = "bottom";+ categoryPosition = "left";+ }+ else+ {+ seriesPosition = "left";+ categoryPosition = "bottom";+ }+ if(axes)+ {+ for(i in axes)+ {+ if(axes.hasOwnProperty(i))+ {+ axis = axes[i];+ keys = this._getBaseAttribute(axis, "keys");+ attr = this._getBaseAttribute(axis, "type");+ if(attr == "time" || attr == "category")+ {+ categoryAxisName = i;+ this.set("categoryAxisName", i);+ if(Y_Lang.isArray(keys) && keys.length > 0)+ {+ catKey = keys[0];+ this.set("categoryKey", catKey);+ }+ newAxes[i] = axis;+ }+ else if(i == categoryAxisName)+ {+ newAxes[i] = axis;+ }+ else + {+ newAxes[i] = axis;+ if(i != valueAxisName && keys && Y_Lang.isArray(keys))+ {+ ll = keys.length;+ for(ii = 0; ii < ll; ++ii)+ {+ claimedKeys.push(keys[ii]);+ }+ valueAxes.push(newAxes[i]);+ }+ if(!(this._getBaseAttribute(newAxes[i], "type")))+ {+ this._setBaseAttribute(newAxes[i], "type", seriesAxis);+ }+ if(!(this._getBaseAttribute(newAxes[i], "position")))+ {+ this._setBaseAttribute(newAxes[i], "position", this._getDefaultAxisPosition(newAxes[i], valueAxes, seriesPosition));+ }+ }+ }+ }+ }+ cIndex = Y.Array.indexOf(seriesKeys, catKey);+ if(cIndex > -1)+ {+ seriesKeys.splice(cIndex, 1);+ }+ l = claimedKeys.length;+ for(i = 0; i < l; ++i)+ {+ cIndex = Y.Array.indexOf(seriesKeys, claimedKeys[i]); + if(cIndex > -1)+ {+ seriesKeys.splice(cIndex, 1);+ }+ }+ if(!newAxes.hasOwnProperty(categoryAxisName))+ {+ newAxes[categoryAxisName] = {};+ }+ if(!(this._getBaseAttribute(newAxes[categoryAxisName], "keys")))+ {+ this._setBaseAttribute(newAxes[categoryAxisName], "keys", [catKey]);+ }+ + if(!(this._getBaseAttribute(newAxes[categoryAxisName], "position")))+ {+ this._setBaseAttribute(newAxes[categoryAxisName], "position", categoryPosition);+ }+ + if(!(this._getBaseAttribute(newAxes[categoryAxisName], "type")))+ {+ this._setBaseAttribute(newAxes[categoryAxisName], "type", this.get("categoryType"));+ }+ if(!newAxes.hasOwnProperty(valueAxisName) && seriesKeys && seriesKeys.length > 0)+ {+ newAxes[valueAxisName] = {keys:seriesKeys};+ valueAxes.push(newAxes[valueAxisName]);+ }+ if(claimedKeys.length > 0)+ {+ if(seriesKeys.length > 0)+ {+ seriesKeys = claimedKeys.concat(seriesKeys);+ }+ else+ {+ seriesKeys = claimedKeys;+ }+ }+ if(newAxes.hasOwnProperty(valueAxisName))+ {+ if(!(this._getBaseAttribute(newAxes[valueAxisName], "position")))+ {+ this._setBaseAttribute(newAxes[valueAxisName], "position", this._getDefaultAxisPosition(newAxes[valueAxisName], valueAxes, seriesPosition));+ }+ this._setBaseAttribute(newAxes[valueAxisName], "type", seriesAxis);+ this._setBaseAttribute(newAxes[valueAxisName], "keys", seriesKeys);+ } + if(!this._seriesKeysExplicitlySet)+ {+ this._seriesKeys = seriesKeys;+ }+ return newAxes;+ },++ /**+ * Determines the position of an axis when one is not specified.+ *+ * @method _getDefaultAxisPosition+ * @param {Axis} axis `Axis` instance.+ * @param {Array} valueAxes Array of `Axis` instances.+ * @param {String} position Default position depending on the direction of the chart and type of axis.+ * @return String+ * @private+ */+ _getDefaultAxisPosition: function(axis, valueAxes, position)+ {+ var direction = this.get("direction"),+ i = Y.Array.indexOf(valueAxes, axis);+ + if(valueAxes[i - 1] && valueAxes[i - 1].position)+ {+ if(direction == "horizontal")+ {+ if(valueAxes[i - 1].position == "left")+ {+ position = "right";+ }+ else if(valueAxes[i - 1].position == "right")+ {+ position = "left";+ }+ }+ else+ {+ if (valueAxes[i -1].position == "bottom")+ {+ position = "top";+ } + else+ {+ position = "bottom";+ }+ }+ }+ return position;+ },++ + /**+ * Returns an object literal containing a categoryItem and a valueItem for a given series index. Below is the structure of each:+ * + * @method getSeriesItems+ * @param {CartesianSeries} series Reference to a series.+ * @param {Number} index Index of the specified item within a series.+ * @return Object An object literal containing the following:+ *+ * <dl>+ * <dt>categoryItem</dt><dd>Object containing the following data related to the category axis of the series.+ * <dl>+ * <dt>axis</dt><dd>Reference to the category axis of the series.</dd>+ * <dt>key</dt><dd>Category key for the series.</dd>+ * <dt>value</dt><dd>Value on the axis corresponding to the series index.</dd>+ * </dl>+ * </dd>+ * <dt>valueItem</dt><dd>Object containing the following data related to the category axis of the series.+ * <dl>+ * <dt>axis</dt><dd>Reference to the value axis of the series.</dd>+ * <dt>key</dt><dd>Value key for the series.</dd>+ * <dt>value</dt><dd>Value on the axis corresponding to the series index.</dd>+ * </dl>+ * </dd>+ * </dl>+ */+ getSeriesItems: function(series, index)+ {+ var xAxis = series.get("xAxis"),+ yAxis = series.get("yAxis"),+ xKey = series.get("xKey"),+ yKey = series.get("yKey"),+ categoryItem,+ valueItem;+ if(this.get("direction") == "vertical")+ {+ categoryItem = {+ axis:yAxis,+ key:yKey,+ value:yAxis.getKeyValueAt(yKey, index)+ };+ valueItem = {+ axis:xAxis,+ key:xKey,+ value: xAxis.getKeyValueAt(xKey, index)+ };+ }+ else+ {+ valueItem = {+ axis:yAxis,+ key:yKey,+ value:yAxis.getKeyValueAt(yKey, index)+ };+ categoryItem = {+ axis:xAxis,+ key:xKey,+ value: xAxis.getKeyValueAt(xKey, index)+ };+ }+ categoryItem.displayName = series.get("categoryDisplayName");+ valueItem.displayName = series.get("valueDisplayName");+ categoryItem.value = categoryItem.axis.getKeyValueAt(categoryItem.key, index);+ valueItem.value = valueItem.axis.getKeyValueAt(valueItem.key, index);+ return {category:categoryItem, value:valueItem};+ },++ /**+ * Handler for sizeChanged event.+ *+ * @method _sizeChanged+ * @param {Object} e Event object.+ * @private+ */+ _sizeChanged: function(e)+ {+ if(this._axesCollection)+ {+ var ac = this._axesCollection,+ i = 0,+ l = ac.length;+ for(; i < l; ++i)+ {+ this._addToAxesRenderQueue(ac[i]);+ }+ this._redraw();+ }+ },+ + /**+ * Returns the maximum distance in pixels that the extends outside the top bounds of all vertical axes.+ *+ * @method _getTopOverflow+ * @param {Array} set1 Collection of axes to check.+ * @param {Array} set2 Seconf collection of axes to check.+ * @param {Number} width Width of the axes+ * @return Number+ * @private+ */+ _getTopOverflow: function(set1, set2, height)+ {+ var i = 0,+ len,+ overflow = 0,+ axis;+ if(set1)+ {+ len = set1.length;+ for(; i < len; ++i)+ {+ axis = set1[i];+ overflow = Math.max(overflow, Math.abs(axis.getMaxLabelBounds().top) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));+ }+ }+ if(set2)+ {+ i = 0;+ len = set2.length;+ for(; i < len; ++i)+ {+ axis = set2[i];+ overflow = Math.max(overflow, Math.abs(axis.getMaxLabelBounds().top) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));+ }+ }+ return overflow;+ },+ + /**+ * Returns the maximum distance in pixels that the extends outside the right bounds of all horizontal axes.+ *+ * @method _getRightOverflow+ * @param {Array} set1 Collection of axes to check.+ * @param {Array} set2 Seconf collection of axes to check.+ * @param {Number} width Width of the axes+ * @return Number+ * @private+ */+ _getRightOverflow: function(set1, set2, width)+ {+ var i = 0,+ len,+ overflow = 0,+ axis;+ if(set1)+ {+ len = set1.length;+ for(; i < len; ++i)+ {+ axis = set1[i];+ overflow = Math.max(overflow, axis.getMaxLabelBounds().right - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));+ }+ }+ if(set2)+ {+ i = 0;+ len = set2.length;+ for(; i < len; ++i)+ {+ axis = set2[i];+ overflow = Math.max(overflow, axis.getMaxLabelBounds().right - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));+ }+ }+ return overflow;+ },+ + /**+ * Returns the maximum distance in pixels that the extends outside the left bounds of all horizontal axes.+ *+ * @method _getLeftOverflow+ * @param {Array} set1 Collection of axes to check.+ * @param {Array} set2 Seconf collection of axes to check.+ * @param {Number} width Width of the axes+ * @return Number+ * @private+ */+ _getLeftOverflow: function(set1, set2, width)+ {+ var i = 0,+ len,+ overflow = 0,+ axis;+ if(set1)+ {+ len = set1.length;+ for(; i < len; ++i)+ {+ axis = set1[i];+ overflow = Math.max(overflow, Math.abs(axis.getMinLabelBounds().left) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));+ }+ }+ if(set2)+ {+ i = 0;+ len = set2.length;+ for(; i < len; ++i)+ {+ axis = set2[i];+ overflow = Math.max(overflow, Math.abs(axis.getMinLabelBounds().left) - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, width) * 0.5));+ }+ }+ return overflow;+ },+ + /**+ * Returns the maximum distance in pixels that the extends outside the bottom bounds of all vertical axes.+ *+ * @method _getBottomOverflow+ * @param {Array} set1 Collection of axes to check.+ * @param {Array} set2 Seconf collection of axes to check.+ * @param {Number} height Height of the axes+ * @return Number+ * @private+ */+ _getBottomOverflow: function(set1, set2, height)+ {+ var i = 0,+ len,+ overflow = 0,+ axis;+ if(set1)+ {+ len = set1.length;+ for(; i < len; ++i)+ {+ axis = set1[i];+ overflow = Math.max(overflow, axis.getMinLabelBounds().bottom - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));+ }+ }+ if(set2)+ {+ i = 0;+ len = set2.length;+ for(; i < len; ++i)+ {+ axis = set2[i];+ overflow = Math.max(overflow, axis.getMinLabelBounds().bottom - (axis.getEdgeOffset(axis.get("styles").majorTicks.count, height) * 0.5));+ }+ }+ return overflow;+ },++ /**+ * Redraws and position all the components of the chart instance.+ *+ * @method _redraw+ * @private+ */+ _redraw: function()+ {+ if(this._drawing)+ {+ this._callLater = true;+ return;+ }+ this._drawing = true;+ this._callLater = false;+ var w = this.get("width"),+ h = this.get("height"),+ leftPaneWidth = 0,+ rightPaneWidth = 0,+ topPaneHeight = 0,+ bottomPaneHeight = 0,+ leftAxesCollection = this.get("leftAxesCollection"),+ rightAxesCollection = this.get("rightAxesCollection"),+ topAxesCollection = this.get("topAxesCollection"),+ bottomAxesCollection = this.get("bottomAxesCollection"),+ i = 0,+ l,+ axis,+ graphOverflow = "visible",+ graph = this.get("graph"),+ topOverflow,+ bottomOverflow,+ leftOverflow,+ rightOverflow,+ graphWidth,+ graphHeight,+ graphX,+ graphY,+ allowContentOverflow = this.get("allowContentOverflow"),+ diff,+ rightAxesXCoords,+ leftAxesXCoords,+ topAxesYCoords,+ bottomAxesYCoords,+ graphRect = {};+ if(leftAxesCollection)+ {+ leftAxesXCoords = [];+ l = leftAxesCollection.length;+ for(i = l - 1; i > -1; --i)+ {+ leftAxesXCoords.unshift(leftPaneWidth);+ leftPaneWidth += leftAxesCollection[i].get("width");+ }+ }+ if(rightAxesCollection)+ {+ rightAxesXCoords = [];+ l = rightAxesCollection.length;+ i = 0;+ for(i = l - 1; i > -1; --i)+ {+ rightPaneWidth += rightAxesCollection[i].get("width");+ rightAxesXCoords.unshift(w - rightPaneWidth);+ }+ }+ if(topAxesCollection)+ {+ topAxesYCoords = [];+ l = topAxesCollection.length;+ for(i = l - 1; i > -1; --i)+ {+ topAxesYCoords.unshift(topPaneHeight);+ topPaneHeight += topAxesCollection[i].get("height");+ }+ }+ if(bottomAxesCollection)+ {+ bottomAxesYCoords = [];+ l = bottomAxesCollection.length;+ for(i = l - 1; i > -1; --i)+ {+ bottomPaneHeight += bottomAxesCollection[i].get("height");+ bottomAxesYCoords.unshift(h - bottomPaneHeight);+ }+ }+ + graphWidth = w - (leftPaneWidth + rightPaneWidth);+ graphHeight = h - (bottomPaneHeight + topPaneHeight);+ graphRect.left = leftPaneWidth;+ graphRect.top = topPaneHeight;+ graphRect.bottom = h - bottomPaneHeight;+ graphRect.right = w - rightPaneWidth;+ if(!allowContentOverflow)+ {+ topOverflow = this._getTopOverflow(leftAxesCollection, rightAxesCollection);+ bottomOverflow = this._getBottomOverflow(leftAxesCollection, rightAxesCollection);+ leftOverflow = this._getLeftOverflow(bottomAxesCollection, topAxesCollection);+ rightOverflow = this._getRightOverflow(bottomAxesCollection, topAxesCollection);+ + diff = topOverflow - topPaneHeight;+ if(diff > 0)+ {+ graphRect.top = topOverflow;+ if(topAxesYCoords)+ {+ i = 0;+ l = topAxesYCoords.length;+ for(; i < l; ++i)+ {+ topAxesYCoords[i] += diff;+ }+ }+ }++ diff = bottomOverflow - bottomPaneHeight;+ if(diff > 0)+ {+ graphRect.bottom = h - bottomOverflow;+ if(bottomAxesYCoords)+ {+ i = 0;+ l = bottomAxesYCoords.length;+ for(; i < l; ++i)+ {+ bottomAxesYCoords[i] -= diff;+ }+ }+ }++ diff = leftOverflow - leftPaneWidth;+ if(diff > 0)+ {+ graphRect.left = leftOverflow;+ if(leftAxesXCoords)+ {+ i = 0;+ l = leftAxesXCoords.length;+ for(; i < l; ++i)+ {+ leftAxesXCoords[i] += diff;+ }+ }+ }++ diff = rightOverflow - rightPaneWidth;+ if(diff > 0)+ {+ graphRect.right = w - rightOverflow;+ if(rightAxesXCoords)+ {+ i = 0;+ l = rightAxesXCoords.length;+ for(; i < l; ++i)+ {+ rightAxesXCoords[i] -= diff;+ }+ }+ }+ }+ graphWidth = graphRect.right - graphRect.left;+ graphHeight = graphRect.bottom - graphRect.top;+ graphX = graphRect.left;+ graphY = graphRect.top;+ if(topAxesCollection)+ {+ l = topAxesCollection.length;+ i = 0;+ for(; i < l; i++)+ {+ axis = topAxesCollection[i];+ if(axis.get("width") !== graphWidth)+ {+ axis.set("width", graphWidth);+ }+ axis.get("boundingBox").setStyle("left", graphX + "px");+ axis.get("boundingBox").setStyle("top", topAxesYCoords[i] + "px");+ }+ if(axis._hasDataOverflow())+ {+ graphOverflow = "hidden";+ }+ }+ if(bottomAxesCollection)+ {+ l = bottomAxesCollection.length;+ i = 0;+ for(; i < l; i++)+ {+ axis = bottomAxesCollection[i];+ if(axis.get("width") !== graphWidth)+ {+ axis.set("width", graphWidth);+ }+ axis.get("boundingBox").setStyle("left", graphX + "px");+ axis.get("boundingBox").setStyle("top", bottomAxesYCoords[i] + "px");+ }+ if(axis._hasDataOverflow())+ {+ graphOverflow = "hidden";+ }+ }+ if(leftAxesCollection)+ {+ l = leftAxesCollection.length;+ i = 0;+ for(; i < l; ++i)+ {+ axis = leftAxesCollection[i];+ axis.get("boundingBox").setStyle("top", graphY + "px");+ axis.get("boundingBox").setStyle("left", leftAxesXCoords[i] + "px");+ if(axis.get("height") !== graphHeight)+ {+ axis.set("height", graphHeight);+ }+ }+ if(axis._hasDataOverflow())+ {+ graphOverflow = "hidden";+ }+ }+ if(rightAxesCollection)+ {+ l = rightAxesCollection.length;+ i = 0;+ for(; i < l; ++i)+ {+ axis = rightAxesCollection[i];+ axis.get("boundingBox").setStyle("top", graphY + "px");+ axis.get("boundingBox").setStyle("left", rightAxesXCoords[i] + "px");+ if(axis.get("height") !== graphHeight)+ {+ axis.set("height", graphHeight);+ }+ }+ if(axis._hasDataOverflow())+ {+ graphOverflow = "hidden";+ }+ }+ this._drawing = false;+ if(this._callLater)+ {+ this._redraw();+ return;+ }+ if(graph)+ {+ graph.get("boundingBox").setStyle("left", graphX + "px");+ graph.get("boundingBox").setStyle("top", graphY + "px");+ graph.set("width", graphWidth);+ graph.set("height", graphHeight);+ graph.get("boundingBox").setStyle("overflow", graphOverflow);+ }++ if(this._overlay)+ {+ this._overlay.setStyle("left", graphX + "px");+ this._overlay.setStyle("top", graphY + "px");+ this._overlay.setStyle("width", graphWidth + "px");+ this._overlay.setStyle("height", graphHeight + "px");+ }+ },++ /**+ * Destructor implementation for the CartesianChart class. Calls destroy on all axes, series and the Graph instance.+ * Removes the tooltip and overlay HTML elements.+ *+ * @method destructor+ * @protected+ */+ destructor: function()+ {+ var graph = this.get("graph"),+ i = 0,+ len,+ seriesCollection = this.get("seriesCollection"),+ axesCollection = this._axesCollection,+ tooltip = this.get("tooltip").node;+ if(this._description)+ {+ this._description.empty();+ this._description.remove(true);+ }+ if(this._liveRegion)+ {+ this._liveRegion.empty();+ this._liveRegion.remove(true);+ }+ len = seriesCollection ? seriesCollection.length : 0;+ for(; i < len; ++i)+ {+ if(seriesCollection[i] instanceof Y.CartesianSeries)+ {+ seriesCollection[i].destroy(true);+ }+ }+ len = axesCollection ? axesCollection.length : 0;+ for(i = 0; i < len; ++i)+ {+ if(axesCollection[i] instanceof Y.Axis)+ {+ axesCollection[i].destroy(true);+ }+ }+ if(graph)+ {+ graph.destroy(true);+ }+ if(tooltip)+ {+ tooltip.empty();+ tooltip.remove(true);+ }+ if(this._overlay)+ {+ this._overlay.empty();+ this._overlay.remove(true);+ }+ },++ /**+ * Returns the appropriate message based on the key press.+ *+ * @method _getAriaMessage+ * @param {Number} key The keycode that was pressed.+ * @return String+ */+ _getAriaMessage: function(key)+ {+ var msg = "",+ series,+ items,+ categoryItem,+ valueItem,+ seriesIndex = this._seriesIndex,+ itemIndex = this._itemIndex,+ seriesCollection = this.get("seriesCollection"),+ len = seriesCollection.length,+ dataLength;+ if(key % 2 === 0)+ {+ if(len > 1)+ {+ if(key === 38)+ {+ seriesIndex = seriesIndex < 1 ? len - 1 : seriesIndex - 1;+ }+ else if(key === 40)+ {+ seriesIndex = seriesIndex >= len - 1 ? 0 : seriesIndex + 1;+ }+ this._itemIndex = -1;+ }+ else+ {+ seriesIndex = 0;+ }+ this._seriesIndex = seriesIndex;+ series = this.getSeries(parseInt(seriesIndex, 10));+ msg = series.get("valueDisplayName") + " series.";+ }+ else+ {+ if(seriesIndex > -1)+ {+ msg = "";+ series = this.getSeries(parseInt(seriesIndex, 10));+ }+ else+ {+ seriesIndex = 0;+ this._seriesIndex = seriesIndex;+ series = this.getSeries(parseInt(seriesIndex, 10));+ msg = series.get("valueDisplayName") + " series.";+ }+ dataLength = series._dataLength ? series._dataLength : 0;+ if(key === 37)+ {+ itemIndex = itemIndex > 0 ? itemIndex - 1 : dataLength - 1;+ }+ else if(key === 39)+ {+ itemIndex = itemIndex >= dataLength - 1 ? 0 : itemIndex + 1;+ }+ this._itemIndex = itemIndex;+ items = this.getSeriesItems(series, itemIndex);+ categoryItem = items.category;+ valueItem = items.value;+ if(categoryItem && valueItem && categoryItem.value && valueItem.value)+ {+ msg += categoryItem.displayName + ": " + categoryItem.axis.formatLabel.apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]) + ", ";+ msg += valueItem.displayName + ": " + valueItem.axis.formatLabel.apply(this, [valueItem.value, valueItem.axis.get("labelFormat")]) + ", "; + }+ else+ {+ msg += "No data available.";+ }+ msg += (itemIndex + 1) + " of " + dataLength + ". ";+ }+ return msg;+ }+}, {+ ATTRS: {+ /**+ * Indicates whether axis labels are allowed to overflow beyond the bounds of the chart's content box.+ *+ * @attribute allowContentOverflow+ * @type Boolean+ */+ allowContentOverflow: {+ value: false+ },++ /**+ * Style object for the axes.+ *+ * @attribute axesStyles+ * @type Object+ * @private+ */+ axesStyles: {+ getter: function()+ {+ var axes = this.get("axes"),+ i,+ styles = this._axesStyles;+ if(axes)+ {+ for(i in axes)+ {+ if(axes.hasOwnProperty(i) && axes[i] instanceof Y.Axis)+ {+ if(!styles)+ {+ styles = {};+ }+ styles[i] = axes[i].get("styles");+ }+ }+ }+ return styles;+ },+ + setter: function(val)+ {+ var axes = this.get("axes"),+ i;+ for(i in val)+ {+ if(val.hasOwnProperty(i) && axes.hasOwnProperty(i))+ {+ this._setBaseAttribute(axes[i], "styles", val[i]);+ }+ }+ }+ },++ /**+ * Style object for the series+ *+ * @attribute seriesStyles+ * @type Object+ * @private+ */+ seriesStyles: {+ getter: function()+ {+ var styles = this._seriesStyles,+ graph = this.get("graph"),+ dict,+ i;+ if(graph)+ {+ dict = graph.get("seriesDictionary");+ if(dict)+ {+ styles = {};+ for(i in dict)+ {+ if(dict.hasOwnProperty(i))+ {+ styles[i] = dict[i].get("styles");+ }+ }+ }+ }+ return styles;+ },+ + setter: function(val)+ {+ var i,+ l,+ s;+ + if(Y_Lang.isArray(val))+ {+ s = this.get("seriesCollection");+ i = 0;+ l = val.length;++ for(; i < l; ++i)+ {+ this._setBaseAttribute(s[i], "styles", val[i]);+ }+ }+ else+ {+ for(i in val)+ {+ if(val.hasOwnProperty(i))+ {+ s = this.getSeries(i);+ this._setBaseAttribute(s, "styles", val[i]);+ }+ }+ }+ }+ },++ /**+ * Styles for the graph.+ *+ * @attribute graphStyles+ * @type Object+ * @private+ */+ graphStyles: {+ getter: function()+ {+ var graph = this.get("graph");+ if(graph)+ {+ return(graph.get("styles"));+ }+ return this._graphStyles;+ },++ setter: function(val)+ {+ var graph = this.get("graph");+ this._setBaseAttribute(graph, "styles", val);+ }++ },++ /**+ * Style properties for the chart. Contains a key indexed hash of the following:+ * <dl>+ * <dt>series</dt><dd>A key indexed hash containing references to the `styles` attribute for each series in the chart.+ * Specific style attributes vary depending on the series:+ * <ul>+ * <li><a href="AreaSeries.html#attr_styles">AreaSeries</a></li>+ * <li><a href="BarSeries.html#attr_styles">BarSeries</a></li>+ * <li><a href="ColumnSeries.html#attr_styles">ColumnSeries</a></li>+ * <li><a href="ComboSeries.html#attr_styles">ComboSeries</a></li>+ * <li><a href="LineSeries.html#attr_styles">LineSeries</a></li>+ * <li><a href="MarkerSeries.html#attr_styles">MarkerSeries</a></li>+ * <li><a href="SplineSeries.html#attr_styles">SplineSeries</a></li>+ * </ul>+ * </dd>+ * <dt>axes</dt><dd>A key indexed hash containing references to the `styles` attribute for each axes in the chart. Specific+ * style attributes can be found in the <a href="Axis.html#attr_styles">Axis</a> class.</dd>+ * <dt>graph</dt><dd>A reference to the `styles` attribute in the chart. Specific style attributes can be found in the+ * <a href="Graph.html#attr_styles">Graph</a> class.</dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ styles: {+ getter: function()+ {+ var styles = { + axes: this.get("axesStyles"),+ series: this.get("seriesStyles"),+ graph: this.get("graphStyles")+ };+ return styles;+ },+ setter: function(val)+ {+ if(val.hasOwnProperty("axes"))+ {+ if(this.get("axesStyles"))+ {+ this.set("axesStyles", val.axes);+ }+ else+ {+ this._axesStyles = val.axes;+ }+ }+ if(val.hasOwnProperty("series"))+ {+ if(this.get("seriesStyles"))+ {+ this.set("seriesStyles", val.series);+ }+ else+ {+ this._seriesStyles = val.series;+ }+ }+ if(val.hasOwnProperty("graph"))+ {+ this.set("graphStyles", val.graph);+ }+ }+ },++ /**+ * Axes to appear in the chart. This can be a key indexed hash of axis instances or object literals+ * used to construct the appropriate axes.+ *+ * @attribute axes+ * @type Object+ */+ axes: {+ valueFn: "_getDefaultAxes",++ setter: function(val)+ {+ if(this.get("dataProvider"))+ {+ val = this._setAxes(val);+ }+ return val;+ }+ },++ /**+ * Collection of series to appear on the chart. This can be an array of Series instances or object literals+ * used to construct the appropriate series.+ *+ * @attribute seriesCollection+ * @type Array+ */+ seriesCollection: {+ valueFn: "_getDefaultSeriesCollection",+ + setter: function(val)+ {+ if(this.get("dataProvider"))+ {+ val = this._parseSeriesCollection(val);+ }+ return val;+ }+ },++ /**+ * Reference to the left-aligned axes for the chart.+ *+ * @attribute leftAxesCollection+ * @type Array+ * @private+ */+ leftAxesCollection: {},++ /**+ * Reference to the bottom-aligned axes for the chart.+ *+ * @attribute bottomAxesCollection+ * @type Array+ * @private+ */+ bottomAxesCollection: {},++ /**+ * Reference to the right-aligned axes for the chart.+ *+ * @attribute rightAxesCollection+ * @type Array+ * @private+ */+ rightAxesCollection: {},++ /**+ * Reference to the top-aligned axes for the chart.+ *+ * @attribute topAxesCollection+ * @type Array+ * @private+ */+ topAxesCollection: {},+ + /**+ * Indicates whether or not the chart is stacked.+ *+ * @attribute stacked+ * @type Boolean+ */+ stacked: {+ value: false+ },++ /**+ * Direction of chart's category axis when there is no series collection specified. Charts can+ * be horizontal or vertical. When the chart type is column, the chart is horizontal.+ * When the chart type is bar, the chart is vertical. + *+ * @attribute direction+ * @type String+ */+ direction: {+ getter: function()+ {+ var type = this.get("type");+ if(type == "bar")+ { + return "vertical";+ }+ else if(type == "column")+ {+ return "horizontal";+ }+ return this._direction;+ },++ setter: function(val)+ {+ this._direction = val;+ return this._direction;+ }+ },++ /**+ * Indicates whether or not an area is filled in a combo chart.+ * + * @attribute showAreaFill+ * @type Boolean+ */+ showAreaFill: {},++ /**+ * Indicates whether to display markers in a combo chart.+ *+ * @attribute showMarkers+ * @type Boolean+ */+ showMarkers:{},++ /**+ * Indicates whether to display lines in a combo chart.+ *+ * @attribute showLines+ * @type Boolean+ */+ showLines:{},++ /**+ * Indicates the key value used to identify a category axis in the `axes` hash. If+ * not specified, the categoryKey attribute value will be used.+ * + * @attribute categoryAxisName+ * @type String+ */+ categoryAxisName: {+ },++ /**+ * Indicates the key value used to identify a the series axis when an axis not generated.+ *+ * @attribute valueAxisName+ * @type String+ */+ valueAxisName: {+ value: "values"+ },++ /**+ * Reference to the horizontalGridlines for the chart.+ *+ * @attribute horizontalGridlines+ * @type Gridlines+ */+ horizontalGridlines: {+ getter: function()+ {+ var graph = this.get("graph");+ if(graph)+ {+ return graph.get("horizontalGridlines");+ }+ return this._horizontalGridlines;+ },+ setter: function(val)+ {+ var graph = this.get("graph");+ if(val && !Y_Lang.isObject(val))+ {+ val = {};+ }+ if(graph)+ {+ graph.set("horizontalGridlines", val);+ }+ else+ {+ this._horizontalGridlines = val;+ }+ }+ },++ /**+ * Reference to the verticalGridlines for the chart.+ *+ * @attribute verticalGridlines+ * @type Gridlines+ */+ verticalGridlines: {+ getter: function()+ {+ var graph = this.get("graph");+ if(graph)+ {+ return graph.get("verticalGridlines");+ }+ return this._verticalGridlines;+ },+ setter: function(val)+ {+ var graph = this.get("graph");+ if(val && !Y_Lang.isObject(val))+ {+ val = {};+ }+ if(graph)+ {+ graph.set("verticalGridlines", val);+ }+ else+ {+ this._verticalGridlines = val;+ }+ }+ },+ + /**+ * Type of chart when there is no series collection specified.+ *+ * @attribute type+ * @type String + */+ type: {+ getter: function()+ {+ if(this.get("stacked"))+ {+ return "stacked" + this._type;+ }+ return this._type;+ },++ setter: function(val)+ {+ if(this._type == "bar")+ {+ if(val != "bar")+ {+ this.set("direction", "horizontal");+ }+ }+ else+ {+ if(val == "bar")+ {+ this.set("direction", "vertical");+ }+ }+ this._type = val;+ return this._type;+ }+ },+ + /**+ * Reference to the category axis used by the chart.+ *+ * @attribute categoryAxis+ * @type Axis+ */+ categoryAxis:{}+ }+});+/**+ * The PieChart class creates a pie chart+ *+ * @module charts+ * @submodule charts-base+ * @class PieChart+ * @extends ChartBase+ * @constructor+ */+Y.PieChart = Y.Base.create("pieChart", Y.Widget, [Y.ChartBase], {+ /**+ * Calculates and returns a `seriesCollection`.+ *+ * @method _getSeriesCollection+ * @return Array+ * @private+ */+ _getSeriesCollection: function()+ {+ if(this._seriesCollection)+ {+ return this._seriesCollection;+ }+ var axes = this.get("axes"),+ sc = [], + seriesKeys,+ i = 0,+ l,+ type = this.get("type"),+ key,+ catAxis = "categoryAxis",+ catKey = "categoryKey",+ valAxis = "valueAxis",+ seriesKey = "valueKey";+ if(axes)+ {+ seriesKeys = axes.values.get("keyCollection");+ key = axes.category.get("keyCollection")[0];+ l = seriesKeys.length;+ for(; i < l; ++i)+ {+ sc[i] = {type:type};+ sc[i][catAxis] = "category";+ sc[i][valAxis] = "values";+ sc[i][catKey] = key;+ sc[i][seriesKey] = seriesKeys[i];+ }+ }+ this._seriesCollection = sc;+ return sc;+ },++ /**+ * Creates `Axis` instances.+ *+ * @method _parseAxes+ * @param {Object} val Object containing `Axis` instances or objects in which to construct `Axis` instances.+ * @return Object+ * @private+ */+ _parseAxes: function(hash)+ {+ if(!this._axes)+ {+ this._axes = {};+ }+ var i, pos, axis, dh, config, axisClass,+ type = this.get("type"),+ w = this.get("width"),+ h = this.get("height"),+ node = Y.Node.one(this._parentNode);+ if(!w)+ {+ this.set("width", node.get("offsetWidth"));+ w = this.get("width");+ }+ if(!h)+ {+ this.set("height", node.get("offsetHeight"));+ h = this.get("height");+ }+ for(i in hash)+ {+ if(hash.hasOwnProperty(i))+ {+ dh = hash[i];+ pos = type == "pie" ? "none" : dh.position;+ axisClass = this._getAxisClass(dh.type);+ config = {dataProvider:this.get("dataProvider")};+ if(dh.hasOwnProperty("roundingUnit"))+ {+ config.roundingUnit = dh.roundingUnit;+ }+ config.keys = dh.keys;+ config.width = w;+ config.height = h;+ config.position = pos;+ config.styles = dh.styles;+ axis = new axisClass(config);+ axis.on("axisRendered", Y.bind(this._itemRendered, this));+ this._axes[i] = axis;+ }+ }+ },++ /**+ * Adds axes to the chart.+ *+ * @method _addAxes+ * @private+ */+ _addAxes: function()+ {+ var axes = this.get("axes"),+ i, + axis, + p;+ if(!axes)+ {+ this.set("axes", this._getDefaultAxes());+ axes = this.get("axes");+ }+ if(!this._axesCollection)+ { + this._axesCollection = [];+ }+ for(i in axes)+ {+ if(axes.hasOwnProperty(i))+ {+ axis = axes[i];+ p = axis.get("position");+ if(!this.get(p + "AxesCollection"))+ {+ this.set(p + "AxesCollection", [axis]);+ }+ else+ {+ this.get(p + "AxesCollection").push(axis);+ }+ this._axesCollection.push(axis);+ }+ }+ },++ /**+ * Renders the Graph.+ *+ * @method _addSeries+ * @private+ */+ _addSeries: function()+ {+ var graph = this.get("graph"),+ seriesCollection = this.get("seriesCollection");+ this._parseSeriesAxes(seriesCollection);+ graph.set("showBackground", false);+ graph.set("width", this.get("width"));+ graph.set("height", this.get("height"));+ graph.set("seriesCollection", seriesCollection);+ this._seriesCollection = graph.get("seriesCollection");+ graph.render(this.get("contentBox"));+ },++ /**+ * Parse and sets the axes for the chart.+ *+ * @method _parseSeriesAxes+ * @param {Array} c A collection `PieSeries` instance.+ * @private+ */+ _parseSeriesAxes: function(c)+ {+ var i = 0, + len = c.length, + s,+ axes = this.get("axes"),+ axis;+ for(; i < len; ++i)+ {+ s = c[i];+ if(s)+ {+ //If series is an actual series instance, + //replace axes attribute string ids with axes+ if(s instanceof Y.PieSeries)+ {+ axis = s.get("categoryAxis");+ if(axis && !(axis instanceof Y.Axis))+ {+ s.set("categoryAxis", axes[axis]);+ }+ axis = s.get("valueAxis");+ if(axis && !(axis instanceof Y.Axis))+ {+ s.set("valueAxis", axes[axis]);+ }+ continue;+ }+ s.categoryAxis = axes.category;+ s.valueAxis = axes.values;+ if(!s.type)+ {+ s.type = this.get("type");+ }+ }+ }+ },++ /**+ * Generates and returns a key-indexed object containing `Axis` instances or objects used to create `Axis` instances.+ *+ * @method _getDefaultAxes+ * @return Object+ * @private+ */+ _getDefaultAxes: function()+ {+ var catKey = this.get("categoryKey"),+ seriesKeys = this.get("seriesKeys").concat(), + seriesAxis = "numeric";+ return {+ values:{+ keys:seriesKeys,+ type:seriesAxis+ },+ category:{+ keys:[catKey],+ type:this.get("categoryType")+ }+ };+ },+ + /**+ * Returns an object literal containing a categoryItem and a valueItem for a given series index.+ *+ * @method getSeriesItem+ * @param series Reference to a series.+ * @param index Index of the specified item within a series.+ * @return Object+ */+ getSeriesItems: function(series, index)+ {+ var categoryItem = {+ axis: series.get("categoryAxis"),+ key: series.get("categoryKey"),+ displayName: series.get("categoryDisplayName")+ },+ valueItem = {+ axis: series.get("valueAxis"),+ key: series.get("valueKey"),+ displayName: series.get("valueDisplayName")+ };+ categoryItem.value = categoryItem.axis.getKeyValueAt(categoryItem.key, index);+ valueItem.value = valueItem.axis.getKeyValueAt(valueItem.key, index);+ return {category:categoryItem, value:valueItem};+ },++ /**+ * Handler for sizeChanged event.+ *+ * @method _sizeChanged+ * @param {Object} e Event object.+ * @private+ */+ _sizeChanged: function(e)+ {+ this._redraw();+ },++ /**+ * Redraws the chart instance.+ *+ * @method _redraw+ * @private+ */+ _redraw: function()+ {+ var graph = this.get("graph"),+ w = this.get("width"),+ h = this.get("height"),+ dimension;+ if(graph)+ {+ dimension = Math.min(w, h);+ graph.set("width", dimension);+ graph.set("height", dimension);+ }+ },+ + /**+ * Formats tooltip text for a pie chart.+ *+ * @method _tooltipLabelFunction+ * @param {Object} categoryItem An object containing the following:+ * <dl>+ * <dt>axis</dt><dd>The axis to which the category is bound.</dd>+ * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided)</dd>+ * <dt>key</dt><dd>The key of the category.</dd>+ * <dt>value</dt><dd>The value of the category</dd>+ * </dl>+ * @param {Object} valueItem An object containing the following:+ * <dl>+ * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>+ * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>+ * <dt>key</dt><dd>The key for the series.</dd>+ * <dt>value</dt><dd>The value for the series item.</dd> + * </dl>+ * @param {Number} itemIndex The index of the item within the series.+ * @param {CartesianSeries} series The `PieSeries` instance of the item.+ * @param {Number} seriesIndex The index of the series in the `seriesCollection`.+ * @return {HTML}+ * @private+ */+ _tooltipLabelFunction: function(categoryItem, valueItem, itemIndex, series, seriesIndex)+ {+ var msg = DOCUMENT.createElement("div"),+ total = series.getTotalValues(),+ pct = Math.round((valueItem.value / total) * 10000)/100;+ msg.appendChild(DOCUMENT.createTextNode(categoryItem.displayName ++ ": " + categoryItem.axis.get("labelFunction").apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]))); + msg.appendChild(DOCUMENT.createElement("br"));+ msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName + + ": " + valueItem.axis.get("labelFunction").apply(this, [valueItem.value, valueItem.axis.get("labelFormat")])));+ msg.appendChild(DOCUMENT.createElement("br"));+ msg.appendChild(DOCUMENT.createTextNode(pct + "%")); + return msg; + },++ /**+ * Returns the appropriate message based on the key press.+ *+ * @method _getAriaMessage+ * @param {Number} key The keycode that was pressed.+ * @return String+ */+ _getAriaMessage: function(key)+ {+ var msg = "",+ categoryItem,+ items,+ series,+ valueItem,+ seriesIndex = 0,+ itemIndex = this._itemIndex,+ seriesCollection = this.get("seriesCollection"),+ len,+ total,+ pct,+ markers;+ series = this.getSeries(parseInt(seriesIndex, 10));+ markers = series.get("markers");+ len = markers && markers.length ? markers.length : 0;+ if(key === 37)+ {+ itemIndex = itemIndex > 0 ? itemIndex - 1 : len - 1;+ }+ else if(key === 39)+ {+ itemIndex = itemIndex >= len - 1 ? 0 : itemIndex + 1;+ }+ this._itemIndex = itemIndex;+ items = this.getSeriesItems(series, itemIndex);+ categoryItem = items.category;+ valueItem = items.value;+ total = series.getTotalValues();+ pct = Math.round((valueItem.value / total) * 10000)/100;+ if(categoryItem && valueItem)+ {+ msg += categoryItem.displayName + ": " + categoryItem.axis.formatLabel.apply(this, [categoryItem.value, categoryItem.axis.get("labelFormat")]) + ", ";+ msg += valueItem.displayName + ": " + valueItem.axis.formatLabel.apply(this, [valueItem.value, valueItem.axis.get("labelFormat")]) + ", "; + msg += "Percent of total " + valueItem.displayName + ": " + pct + "%,"; + }+ else+ {+ msg += "No data available,";+ }+ msg += (itemIndex + 1) + " of " + len + ". ";+ return msg;+ }+}, {+ ATTRS: {+ /**+ * Sets the aria description for the chart.+ *+ * @attribute ariaDescription+ * @type String+ */+ ariaDescription: {+ value: "Use the left and right keys to navigate through items.",++ setter: function(val)+ {+ if(this._description)+ {+ this._description.setContent("");+ this._description.appendChild(DOCUMENT.createTextNode(val));+ }+ return val;+ }+ },+ + /**+ * Axes to appear in the chart. + *+ * @attribute axes+ * @type Object+ */+ axes: {+ getter: function()+ {+ return this._axes;+ },++ setter: function(val)+ {+ this._parseAxes(val);+ }+ },++ /**+ * Collection of series to appear on the chart. This can be an array of Series instances or object literals+ * used to describe a Series instance.+ *+ * @attribute seriesCollection+ * @type Array+ */+ seriesCollection: {+ getter: function()+ {+ return this._getSeriesCollection();+ },+ + setter: function(val)+ {+ return this._setSeriesCollection(val);+ }+ },+ + /**+ * Type of chart when there is no series collection specified.+ *+ * @attribute type+ * @type String + */+ type: {+ value: "pie"+ }+ }+});+++}, '3.7.1', {"requires": ["dom", "datatype-number", "datatype-date", "event-custom", "event-mouseenter", "event-touch", "widget", "widget-position", "widget-stack", "graphics"]});
@@ -0,0 +1,2307 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/charts-legend/charts-legend.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/charts-legend/charts-legend.js",+ code: []+};+_yuitest_coverage["build/charts-legend/charts-legend.js"].code=["YUI.add('charts-legend', function (Y, NAME) {","","/**"," * Adds legend functionality to charts."," *"," * @module charts"," * @submodule charts-legend"," */","var DOCUMENT = Y.config.doc, ","TOP = \"top\",","RIGHT = \"right\",","BOTTOM = \"bottom\",","LEFT = \"left\",","EXTERNAL = \"external\",","HORIZONTAL = \"horizontal\",","VERTICAL = \"vertical\",","WIDTH = \"width\",","HEIGHT = \"height\",","POSITION = \"position\",","_X = \"x\",","_Y = \"y\",","PX = \"px\",","LEGEND = {"," setter: function(val)"," { "," var legend = this.get(\"legend\");"," if(legend)"," {"," legend.destroy(true);"," }"," if(val instanceof Y.ChartLegend)"," {"," legend = val;"," legend.set(\"chart\", this);"," }"," else"," {"," val.chart = this;"," if(!val.hasOwnProperty(\"render\"))"," {"," val.render = this.get(\"contentBox\");"," val.includeInChartLayout = true;"," }"," legend = new Y.ChartLegend(val);"," }"," return legend;"," }","},","","/**"," * Contains methods for displaying items horizontally in a legend."," *"," * @module charts"," * @submodule charts-legend"," * @class HorizontalLegendLayout"," */","HorizontalLegendLayout = {"," /**"," * Displays items horizontally in a legend."," *"," * @method _positionLegendItems"," * @param {Array} items Array of items to display in the legend."," * @param {Number} maxWidth The width of the largest item in the legend."," * @param {Number} maxHeight The height of the largest item in the legend."," * @param {Number} totalWidth The total width of all items in a legend."," * @param {Number} totalHeight The total height of all items in a legend."," * @param {Number} padding The left, top, right and bottom padding properties for the legend."," * @param {Number} horizontalGap The horizontal distance between items in a legend."," * @param {Number} verticalGap The vertical distance between items in a legend."," * @param {String} hAlign The horizontal alignment of the legend."," * @param {String} vAlign The vertical alignment of the legend."," * @protected"," */"," _positionLegendItems: function(items, maxWidth, maxHeight, totalWidth, totalHeight, padding, horizontalGap, verticalGap, hAlign, vAlign)"," {"," var i = 0,"," rowIterator = 0,"," item,"," node,"," itemWidth,"," itemHeight,"," len,"," width = this.get(\"width\"),"," rows,"," rowsLen,"," row,"," totalWidthArray,"," legendWidth,"," topHeight = padding.top - verticalGap,"," limit = width - (padding.left + padding.right),"," left, "," top,"," right,"," bottom;"," HorizontalLegendLayout._setRowArrays(items, limit, horizontalGap);"," rows = HorizontalLegendLayout.rowArray;"," totalWidthArray = HorizontalLegendLayout.totalWidthArray;"," rowsLen = rows.length;"," for(; rowIterator < rowsLen; ++ rowIterator)"," {"," topHeight += verticalGap;"," row = rows[rowIterator];"," len = row.length;"," legendWidth = HorizontalLegendLayout.getStartPoint(width, totalWidthArray[rowIterator], hAlign, padding);"," for(i = 0; i < len; ++i)"," {"," item = row[i];"," node = item.node;"," itemWidth = item.width;"," itemHeight = item.height;"," item.x = legendWidth;"," item.y = 0;"," left = !isNaN(left) ? Math.min(left, legendWidth) : legendWidth;"," top = !isNaN(top) ? Math.min(top, topHeight) : topHeight;"," right = !isNaN(right) ? Math.max(legendWidth + itemWidth, right) : legendWidth + itemWidth;"," bottom = !isNaN(bottom) ? Math.max(topHeight + itemHeight, bottom) : topHeight + itemHeight;"," node.setStyle(\"left\", legendWidth + PX);"," node.setStyle(\"top\", topHeight + PX);"," legendWidth += itemWidth + horizontalGap;"," }"," topHeight += item.height;"," }"," this._contentRect = {"," left: left,"," top: top,"," right: right,"," bottom: bottom"," };"," if(this.get(\"includeInChartLayout\"))"," {"," this.set(\"height\", topHeight + padding.bottom);"," }"," },",""," /**"," * Creates row and total width arrays used for displaying multiple rows of"," * legend items based on the items, available width and horizontalGap for the legend."," *"," * @method _setRowArrays"," * @param {Array} items Array of legend items to display in a legend."," * @param {Number} limit Total available width for displaying items in a legend."," * @param {Number} horizontalGap Horizontal distance between items in a legend."," * @protected"," */"," _setRowArrays: function(items, limit, horizontalGap)"," {"," var item = items[0],"," rowArray = [[item]],"," i = 1,"," rowIterator = 0,"," len = items.length,"," totalWidth = item.width,"," itemWidth,"," totalWidthArray = [[totalWidth]];"," for(; i < len; ++i)"," {"," item = items[i];"," itemWidth = item.width;"," if((totalWidth + horizontalGap + itemWidth) <= limit)"," {"," totalWidth += horizontalGap + itemWidth;"," rowArray[rowIterator].push(item);"," }"," else"," {"," totalWidth = horizontalGap + itemWidth;"," if(rowArray[rowIterator])"," {"," rowIterator += 1;"," }"," rowArray[rowIterator] = [item];"," }"," totalWidthArray[rowIterator] = totalWidth;"," }"," HorizontalLegendLayout.rowArray = rowArray;"," HorizontalLegendLayout.totalWidthArray = totalWidthArray;"," },",""," /**"," * Returns the starting x-coordinate for a row of legend items."," *"," * @method getStartPoint"," * @param {Number} w Width of the legend."," * @param {Number} totalWidth Total width of all labels in the row."," * @param {String} align Horizontal alignment of items for the legend."," * @param {Object} padding Object contain left, top, right and bottom padding properties."," * @return Number"," * @protected"," */"," getStartPoint: function(w, totalWidth, align, padding)"," {"," var startPoint;"," switch(align)"," {"," case LEFT :"," startPoint = padding.left;"," break;"," case \"center\" :"," startPoint = (w - totalWidth) * 0.5;"," break;"," case RIGHT :"," startPoint = w - totalWidth - padding.right;"," break;"," }"," return startPoint;"," }","},","","/**"," * Contains methods for displaying items vertically in a legend."," *"," * @module charts"," * @submodule charts-legend"," * @class VerticalLegendLayout"," */","VerticalLegendLayout = {"," /**"," * Displays items vertically in a legend."," *"," * @method _positionLegendItems"," * @param {Array} items Array of items to display in the legend."," * @param {Number} maxWidth The width of the largest item in the legend."," * @param {Number} maxHeight The height of the largest item in the legend."," * @param {Number} totalWidth The total width of all items in a legend."," * @param {Number} totalHeight The total height of all items in a legend."," * @param {Number} padding The left, top, right and bottom padding properties for the legend."," * @param {Number} horizontalGap The horizontal distance between items in a legend."," * @param {Number} verticalGap The vertical distance between items in a legend."," * @param {String} hAlign The horizontal alignment of the legend."," * @param {String} vAlign The vertical alignment of the legend."," * @protected"," */"," _positionLegendItems: function(items, maxWidth, maxHeight, totalWidth, totalHeight, padding, horizontalGap, verticalGap, hAlign, vAlign)"," {"," var i = 0,"," columnIterator = 0,"," item,"," node,"," itemHeight,"," itemWidth,"," len,"," height = this.get(\"height\"),"," columns,"," columnsLen,"," column,"," totalHeightArray,"," legendHeight,"," leftWidth = padding.left - horizontalGap,"," legendWidth,"," limit = height - (padding.top + padding.bottom),"," left, "," top,"," right,"," bottom;"," VerticalLegendLayout._setColumnArrays(items, limit, verticalGap);"," columns = VerticalLegendLayout.columnArray;"," totalHeightArray = VerticalLegendLayout.totalHeightArray;"," columnsLen = columns.length;"," for(; columnIterator < columnsLen; ++ columnIterator)"," {"," leftWidth += horizontalGap;"," column = columns[columnIterator];"," len = column.length;"," legendHeight = VerticalLegendLayout.getStartPoint(height, totalHeightArray[columnIterator], vAlign, padding);"," legendWidth = 0;"," for(i = 0; i < len; ++i)"," {"," item = column[i];"," node = item.node;"," itemHeight = item.height;"," itemWidth = item.width;"," item.y = legendHeight;"," item.x = leftWidth;"," left = !isNaN(left) ? Math.min(left, leftWidth) : leftWidth;"," top = !isNaN(top) ? Math.min(top, legendHeight) : legendHeight;"," right = !isNaN(right) ? Math.max(leftWidth + itemWidth, right) : leftWidth + itemWidth;"," bottom = !isNaN(bottom) ? Math.max(legendHeight + itemHeight, bottom) : legendHeight + itemHeight;"," node.setStyle(\"left\", leftWidth + PX);"," node.setStyle(\"top\", legendHeight + PX);"," legendHeight += itemHeight + verticalGap;"," legendWidth = Math.max(legendWidth, item.width);"," }"," leftWidth += legendWidth;"," }"," this._contentRect = {"," left: left,"," top: top,"," right: right,"," bottom: bottom"," };"," if(this.get(\"includeInChartLayout\"))"," {"," this.set(\"width\", leftWidth + padding.right);"," }"," },",""," /**"," * Creates column and total height arrays used for displaying multiple columns of"," * legend items based on the items, available height and verticalGap for the legend."," *"," * @method _setColumnArrays"," * @param {Array} items Array of legend items to display in a legend."," * @param {Number} limit Total available height for displaying items in a legend."," * @param {Number} verticalGap Vertical distance between items in a legend."," * @protected"," */"," _setColumnArrays: function(items, limit, verticalGap)"," {"," var item = items[0],"," columnArray = [[item]],"," i = 1,"," columnIterator = 0,"," len = items.length,"," totalHeight = item.height,"," itemHeight,"," totalHeightArray = [[totalHeight]];"," for(; i < len; ++i)"," {"," item = items[i];"," itemHeight = item.height;"," if((totalHeight + verticalGap + itemHeight) <= limit)"," {"," totalHeight += verticalGap + itemHeight;"," columnArray[columnIterator].push(item);"," }"," else"," {"," totalHeight = verticalGap + itemHeight;"," if(columnArray[columnIterator])"," {"," columnIterator += 1;"," }"," columnArray[columnIterator] = [item];"," }"," totalHeightArray[columnIterator] = totalHeight;"," }"," VerticalLegendLayout.columnArray = columnArray;"," VerticalLegendLayout.totalHeightArray = totalHeightArray;"," },",""," /**"," * Returns the starting y-coordinate for a column of legend items."," *"," * @method getStartPoint"," * @param {Number} h Height of the legend."," * @param {Number} totalHeight Total height of all labels in the column."," * @param {String} align Vertical alignment of items for the legend."," * @param {Object} padding Object contain left, top, right and bottom padding properties."," * @return Number"," * @protected"," */"," getStartPoint: function(h, totalHeight, align, padding)"," {"," var startPoint;"," switch(align)"," {"," case TOP :"," startPoint = padding.top;"," break;"," case \"middle\" :"," startPoint = (h - totalHeight) * 0.5;"," break;"," case BOTTOM :"," startPoint = h - totalHeight - padding.bottom;"," break;"," }"," return startPoint;"," }","},","","CartesianChartLegend = Y.Base.create(\"cartesianChartLegend\", Y.CartesianChart, [], {"," /**"," * Redraws and position all the components of the chart instance."," *"," * @method _redraw"," * @private"," */"," _redraw: function()"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," var w = this.get(\"width\"),"," h = this.get(\"height\"),"," layoutBoxDimensions = this._getLayoutBoxDimensions(),"," leftPaneWidth = layoutBoxDimensions.left,"," rightPaneWidth = layoutBoxDimensions.right,"," topPaneHeight = layoutBoxDimensions.top,"," bottomPaneHeight = layoutBoxDimensions.bottom,"," leftAxesCollection = this.get(\"leftAxesCollection\"),"," rightAxesCollection = this.get(\"rightAxesCollection\"),"," topAxesCollection = this.get(\"topAxesCollection\"),"," bottomAxesCollection = this.get(\"bottomAxesCollection\"),"," i = 0,"," l,"," axis,"," graphOverflow = \"visible\","," graph = this.get(\"graph\"),"," topOverflow,"," bottomOverflow,"," leftOverflow,"," rightOverflow,"," graphWidth,"," graphHeight,"," graphX,"," graphY,"," allowContentOverflow = this.get(\"allowContentOverflow\"),"," diff,"," rightAxesXCoords,"," leftAxesXCoords,"," topAxesYCoords,"," bottomAxesYCoords,"," legend = this.get(\"legend\"),"," graphRect = {};",""," if(leftAxesCollection)"," {"," leftAxesXCoords = [];"," l = leftAxesCollection.length;"," for(i = l - 1; i > -1; --i)"," {"," leftAxesXCoords.unshift(leftPaneWidth);"," leftPaneWidth += leftAxesCollection[i].get(\"width\");"," }"," }"," if(rightAxesCollection)"," {"," rightAxesXCoords = [];"," l = rightAxesCollection.length;"," i = 0;"," for(i = l - 1; i > -1; --i)"," {"," rightPaneWidth += rightAxesCollection[i].get(\"width\");"," rightAxesXCoords.unshift(w - rightPaneWidth);"," }"," }"," if(topAxesCollection)"," {"," topAxesYCoords = [];"," l = topAxesCollection.length;"," for(i = l - 1; i > -1; --i)"," {"," topAxesYCoords.unshift(topPaneHeight);"," topPaneHeight += topAxesCollection[i].get(\"height\");"," }"," }"," if(bottomAxesCollection)"," {"," bottomAxesYCoords = [];"," l = bottomAxesCollection.length;"," for(i = l - 1; i > -1; --i)"," {"," bottomPaneHeight += bottomAxesCollection[i].get(\"height\");"," bottomAxesYCoords.unshift(h - bottomPaneHeight);"," }"," }"," "," graphWidth = w - (leftPaneWidth + rightPaneWidth);"," graphHeight = h - (bottomPaneHeight + topPaneHeight);"," graphRect.left = leftPaneWidth;"," graphRect.top = topPaneHeight;"," graphRect.bottom = h - bottomPaneHeight;"," graphRect.right = w - rightPaneWidth;"," if(!allowContentOverflow)"," {"," topOverflow = this._getTopOverflow(leftAxesCollection, rightAxesCollection);"," bottomOverflow = this._getBottomOverflow(leftAxesCollection, rightAxesCollection);"," leftOverflow = this._getLeftOverflow(bottomAxesCollection, topAxesCollection);"," rightOverflow = this._getRightOverflow(bottomAxesCollection, topAxesCollection);"," "," diff = topOverflow - topPaneHeight;"," if(diff > 0)"," {"," graphRect.top = topOverflow;"," if(topAxesYCoords)"," {"," i = 0;"," l = topAxesYCoords.length;"," for(; i < l; ++i)"," {"," topAxesYCoords[i] += diff;"," }"," }"," }",""," diff = bottomOverflow - bottomPaneHeight;"," if(diff > 0)"," {"," graphRect.bottom = h - bottomOverflow;"," if(bottomAxesYCoords)"," {"," i = 0;"," l = bottomAxesYCoords.length;"," for(; i < l; ++i)"," {"," bottomAxesYCoords[i] -= diff;"," }"," }"," }",""," diff = leftOverflow - leftPaneWidth;"," if(diff > 0)"," {"," graphRect.left = leftOverflow;"," if(leftAxesXCoords)"," {"," i = 0;"," l = leftAxesXCoords.length;"," for(; i < l; ++i)"," {"," leftAxesXCoords[i] += diff;"," }"," }"," }",""," diff = rightOverflow - rightPaneWidth;"," if(diff > 0)"," {"," graphRect.right = w - rightOverflow;"," if(rightAxesXCoords)"," {"," i = 0;"," l = rightAxesXCoords.length;"," for(; i < l; ++i)"," {"," rightAxesXCoords[i] -= diff;"," }"," }"," }"," }"," graphWidth = graphRect.right - graphRect.left;"," graphHeight = graphRect.bottom - graphRect.top;"," graphX = graphRect.left;"," graphY = graphRect.top;"," if(legend)"," {"," if(legend.get(\"includeInChartLayout\"))"," {"," switch(legend.get(\"position\"))"," {"," case \"left\" : "," legend.set(\"y\", graphY);"," legend.set(\"height\", graphHeight);"," break;"," case \"top\" :"," legend.set(\"x\", graphX);"," legend.set(\"width\", graphWidth);"," break;"," case \"bottom\" : "," legend.set(\"x\", graphX);"," legend.set(\"width\", graphWidth);"," break;"," case \"right\" :"," legend.set(\"y\", graphY);"," legend.set(\"height\", graphHeight);"," break;"," }"," }"," }"," if(topAxesCollection)"," {"," l = topAxesCollection.length;"," i = 0;"," for(; i < l; i++)"," {"," axis = topAxesCollection[i];"," if(axis.get(\"width\") !== graphWidth)"," {"," axis.set(\"width\", graphWidth);"," }"," axis.get(\"boundingBox\").setStyle(\"left\", graphX + PX);"," axis.get(\"boundingBox\").setStyle(\"top\", topAxesYCoords[i] + PX);"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," if(bottomAxesCollection)"," {"," l = bottomAxesCollection.length;"," i = 0;"," for(; i < l; i++)"," {"," axis = bottomAxesCollection[i];"," if(axis.get(\"width\") !== graphWidth)"," {"," axis.set(\"width\", graphWidth);"," }"," axis.get(\"boundingBox\").setStyle(\"left\", graphX + PX);"," axis.get(\"boundingBox\").setStyle(\"top\", bottomAxesYCoords[i] + PX);"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," if(leftAxesCollection)"," {"," l = leftAxesCollection.length;"," i = 0;"," for(; i < l; ++i)"," {"," axis = leftAxesCollection[i];"," axis.get(\"boundingBox\").setStyle(\"top\", graphY + PX);"," axis.get(\"boundingBox\").setStyle(\"left\", leftAxesXCoords[i] + PX);"," if(axis.get(\"height\") !== graphHeight)"," {"," axis.set(\"height\", graphHeight);"," }"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," if(rightAxesCollection)"," {"," l = rightAxesCollection.length;"," i = 0;"," for(; i < l; ++i)"," {"," axis = rightAxesCollection[i];"," axis.get(\"boundingBox\").setStyle(\"top\", graphY + PX);"," axis.get(\"boundingBox\").setStyle(\"left\", rightAxesXCoords[i] + PX);"," if(axis.get(\"height\") !== graphHeight)"," {"," axis.set(\"height\", graphHeight);"," }"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," this._drawing = false;"," if(this._callLater)"," {"," this._redraw();"," return;"," }"," if(graph)"," {"," graph.get(\"boundingBox\").setStyle(\"left\", graphX + PX);"," graph.get(\"boundingBox\").setStyle(\"top\", graphY + PX);"," graph.set(\"width\", graphWidth);"," graph.set(\"height\", graphHeight);"," graph.get(\"boundingBox\").setStyle(\"overflow\", graphOverflow);"," }",""," if(this._overlay)"," {"," this._overlay.setStyle(\"left\", graphX + PX);"," this._overlay.setStyle(\"top\", graphY + PX);"," this._overlay.setStyle(\"width\", graphWidth + PX);"," this._overlay.setStyle(\"height\", graphHeight + PX);"," }"," },",""," /**"," * Positions the legend in a chart and returns the properties of the legend to be used in the "," * chart's layout algorithm."," *"," * @method _getLayoutDimensions"," * @return {Object} The left, top, right and bottom values for the legend."," * @protected"," */"," _getLayoutBoxDimensions: function()"," {"," var box = {"," top: 0,"," right: 0,"," bottom: 0,"," left: 0"," },"," legend = this.get(\"legend\"),"," position,"," direction,"," dimension,"," size,"," w = this.get(WIDTH),"," h = this.get(HEIGHT),"," gap;"," if(legend && legend.get(\"includeInChartLayout\"))"," {"," gap = legend.get(\"styles\").gap;"," position = legend.get(POSITION);"," if(position != EXTERNAL)"," {"," direction = legend.get(\"direction\");"," dimension = direction == HORIZONTAL ? HEIGHT : WIDTH;"," size = legend.get(dimension);"," box[position] = size + gap;"," switch(position)"," {"," case TOP :"," legend.set(_Y, 0); "," break;"," case BOTTOM : "," legend.set(_Y, h - size); "," break;"," case RIGHT :"," legend.set(_X, w - size);"," break;"," case LEFT: "," legend.set(_X, 0);"," break;"," }"," }"," }"," return box;"," },",""," /**"," * Destructor implementation for the CartesianChart class. Calls destroy on all axes, series, legend (if available) and the Graph instance."," * Removes the tooltip and overlay HTML elements."," *"," * @method destructor"," * @protected"," */"," destructor: function()"," {"," var legend = this.get(\"legend\");"," if(legend)"," {"," legend.destroy(true);"," }"," }","}, {"," ATTRS: {"," legend: LEGEND"," }","});","","Y.CartesianChart = CartesianChartLegend;","","var PieChartLegend = Y.Base.create(\"pieChartLegend\", Y.PieChart, [], {"," /**"," * Redraws the chart instance."," *"," * @method _redraw"," * @private"," */"," _redraw: function()"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," var graph = this.get(\"graph\"),"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," graphWidth,"," graphHeight,"," legend = this.get(\"legend\"),"," x = 0,"," y = 0,"," legendX = 0,"," legendY = 0,"," legendWidth,"," legendHeight,"," dimension,"," gap,"," position,"," direction;"," if(graph)"," {"," if(legend)"," {"," position = legend.get(\"position\");"," direction = legend.get(\"direction\");"," graphWidth = graph.get(\"width\");"," graphHeight = graph.get(\"height\");"," legendWidth = legend.get(\"width\");"," legendHeight = legend.get(\"height\");"," gap = legend.get(\"styles\").gap;"," "," if((direction == \"vertical\" && (graphWidth + legendWidth + gap !== w)) || (direction == \"horizontal\" && (graphHeight + legendHeight + gap !== h)))"," {"," switch(legend.get(\"position\"))"," {"," case LEFT :"," dimension = Math.min(w - (legendWidth + gap), h);"," legendHeight = h;"," x = legendWidth + gap;"," legend.set(HEIGHT, legendHeight);"," break;"," case TOP :"," dimension = Math.min(h - (legendHeight + gap), w); "," legendWidth = w;"," y = legendHeight + gap;"," legend.set(WIDTH, legendWidth);"," break;"," case RIGHT :"," dimension = Math.min(w - (legendWidth + gap), h);"," legendHeight = h;"," legendX = dimension + gap;"," legend.set(HEIGHT, legendHeight);"," break;"," case BOTTOM :"," dimension = Math.min(h - (legendHeight + gap), w); "," legendWidth = w;"," legendY = dimension + gap; "," legend.set(WIDTH, legendWidth);"," break;"," }"," graph.set(WIDTH, dimension);"," graph.set(HEIGHT, dimension);"," }"," else"," {"," switch(legend.get(\"position\"))"," { "," case LEFT :"," x = legendWidth + gap;"," break;"," case TOP :"," y = legendHeight + gap;"," break;"," case RIGHT :"," legendX = graphWidth + gap;"," break;"," case BOTTOM :"," legendY = graphHeight + gap; "," break;"," }"," }"," }"," else"," {"," graph.set(_X, 0);"," graph.set(_Y, 0);"," graph.set(WIDTH, w);"," graph.set(HEIGHT, h);"," }"," }"," this._drawing = false;"," if(this._callLater)"," {"," this._redraw();"," return;"," }"," if(graph)"," {"," graph.set(_X, x);"," graph.set(_Y, y);"," }"," if(legend)"," {"," legend.set(_X, legendX);"," legend.set(_Y, legendY);"," }"," }","}, {"," ATTRS: {"," /**"," * The legend for the chart."," *"," * @attribute"," * @type Legend"," */"," legend: LEGEND"," }","});","Y.PieChart = PieChartLegend;","/**"," * ChartLegend provides a legend for a chart."," *"," * @class ChartLegend"," * @module charts"," * @submodule charts-legend"," * @extends Widget"," */","Y.ChartLegend = Y.Base.create(\"chartlegend\", Y.Widget, [Y.Renderer], {"," /**"," * Initializes the chart."," *"," * @method initializer"," * @private"," */"," initializer: function()"," {"," this._items = [];"," },",""," /**"," * @method renderUI"," * @private"," */"," renderUI: function()"," {"," var bb = this.get(\"boundingBox\"),"," cb = this.get(\"contentBox\"),"," styles = this.get(\"styles\").background,"," background = new Y.Rect({"," graphic: cb,"," fill: styles.fill,"," stroke: styles.border"," });"," bb.setStyle(\"display\", \"block\");"," bb.setStyle(\"position\", \"absolute\");"," this.set(\"background\", background);"," },"," "," /**"," * @method bindUI"," * @private"," */"," bindUI: function()"," {"," this.get(\"chart\").after(\"seriesCollectionChange\", Y.bind(this._updateHandler, this));"," this.after(\"stylesChange\", this._updateHandler);"," this.after(\"positionChange\", this._positionChangeHandler);"," this.after(\"widthChange\", this._handleSizeChange);"," this.after(\"heightChange\", this._handleSizeChange);"," },"," "," /**"," * @method syncUI"," * @private"," */"," syncUI: function()"," {"," var w = this.get(\"width\"),"," h = this.get(\"height\");"," if(isFinite(w) && isFinite(h) && w > 0 && h > 0)"," {"," this._drawLegend();"," }"," },",""," /**"," * Handles changes to legend."," *"," * @method _updateHandler"," * @param {Object} e Event object"," * @private"," */"," _updateHandler: function(e)"," {"," if(this.get(\"rendered\"))"," {"," this._drawLegend();"," }"," },",""," /** "," * Handles position changes."," *"," * @method _positionChangeHandler"," * @param {Object} e Event object"," * @private"," */"," _positionChangeHandler: function(e)"," {"," var chart = this.get(\"chart\"),"," parentNode = this._parentNode;"," if(parentNode && ((chart && this.get(\"includeInChartLayout\"))))"," {"," this.fire(\"legendRendered\");"," }"," else if(this.get(\"rendered\"))"," {"," this._drawLegend();"," }"," },",""," /**"," * Updates the legend when the size changes."," *"," * @method _handleSizeChange"," * @param {Object} e Event object."," * @private"," */"," _handleSizeChange: function(e)"," {"," var attrName = e.attrName,"," pos = this.get(POSITION),"," vert = pos == LEFT || pos == RIGHT,"," hor = pos == BOTTOM || pos == TOP;"," if((hor && attrName == WIDTH) || (vert && attrName == HEIGHT))"," {"," this._drawLegend();"," }"," },",""," /**"," * Draws the legend"," *"," * @method _drawLegend"," * @private"," */"," _drawLegend: function()"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," if(this.get(\"includeInChartLayout\"))"," {"," this.get(\"chart\")._itemRenderQueue.unshift(this);"," }"," var chart = this.get(\"chart\"),"," node = this.get(\"contentBox\"),"," seriesCollection = chart.get(\"seriesCollection\"),"," series,"," styles = this.get(\"styles\"),"," padding = styles.padding,"," itemStyles = styles.item,"," seriesStyles,"," hSpacing = itemStyles.hSpacing,"," vSpacing = itemStyles.vSpacing,"," hAlign = styles.hAlign,"," vAlign = styles.vAlign,"," marker = styles.marker,"," labelStyles = itemStyles.label,"," displayName,"," layout = this._layout[this.get(\"direction\")],"," i, "," len,"," isArray,"," shape,"," shapeClass,"," item,"," fill,"," border,"," fillColors,"," borderColors,"," borderWeight,"," items = [],"," markerWidth = marker.width,"," markerHeight = marker.height,"," totalWidth = 0 - hSpacing,"," totalHeight = 0 - vSpacing,"," maxWidth = 0,"," maxHeight = 0,"," itemWidth,"," itemHeight;"," if(marker && marker.shape)"," {"," shape = marker.shape;"," }"," this._destroyLegendItems();"," if(chart instanceof Y.PieChart)"," {"," series = seriesCollection[0];"," displayName = series.get(\"categoryAxis\").getDataByKey(series.get(\"categoryKey\")); "," seriesStyles = series.get(\"styles\").marker;"," fillColors = seriesStyles.fill.colors;"," borderColors = seriesStyles.border.colors;"," borderWeight = seriesStyles.border.weight;"," i = 0;"," len = displayName.length;"," shape = shape || Y.Circle;"," isArray = Y.Lang.isArray(shape);"," for(; i < len; ++i)"," {"," shape = isArray ? shape[i] : shape;"," fill = {"," color: fillColors[i]"," };"," border = {"," colors: borderColors[i],"," weight: borderWeight"," };"," displayName = chart.getSeriesItems(series, i).category.value;"," item = this._getLegendItem(node, this._getShapeClass(shape), fill, border, labelStyles, markerWidth, markerHeight, displayName);"," itemWidth = item.width;"," itemHeight = item.height;"," maxWidth = Math.max(maxWidth, itemWidth);"," maxHeight = Math.max(maxHeight, itemHeight);"," totalWidth += itemWidth + hSpacing;"," totalHeight += itemHeight + vSpacing;"," items.push(item);"," }"," }"," else"," {"," i = 0;"," len = seriesCollection.length;"," for(; i < len; ++i)"," {"," series = seriesCollection[i];"," seriesStyles = this._getStylesBySeriesType(series, shape);"," if(!shape)"," {"," shape = seriesStyles.shape;"," if(!shape)"," {"," shape = Y.Circle;"," }"," }"," shapeClass = Y.Lang.isArray(shape) ? shape[i] : shape;"," item = this._getLegendItem(node, this._getShapeClass(shape), seriesStyles.fill, seriesStyles.border, labelStyles, markerWidth, markerHeight, series.get(\"valueDisplayName\"));"," itemWidth = item.width;"," itemHeight = item.height;"," maxWidth = Math.max(maxWidth, itemWidth);"," maxHeight = Math.max(maxHeight, itemHeight);"," totalWidth += itemWidth + hSpacing;"," totalHeight += itemHeight + vSpacing;"," items.push(item);"," }"," }"," this._drawing = false;"," if(this._callLater)"," {"," this._drawLegend();"," }"," else"," {"," layout._positionLegendItems.apply(this, [items, maxWidth, maxHeight, totalWidth, totalHeight, padding, hSpacing, vSpacing, hAlign, vAlign]);"," this._updateBackground(styles);"," this.fire(\"legendRendered\");"," }"," },",""," /**"," * Updates the background for the legend."," *"," * @method _updateBackground"," * @param {Object} styles Reference to the legend's styles attribute"," * @private"," */"," _updateBackground: function(styles)"," {"," var backgroundStyles = styles.background,"," contentRect = this._contentRect,"," padding = styles.padding,"," x = contentRect.left - padding.left,"," y = contentRect.top - padding.top,"," w = contentRect.right - x + padding.right,"," h = contentRect.bottom - y + padding.bottom;"," this.get(\"background\").set({"," fill: backgroundStyles.fill,"," stroke: backgroundStyles.border,"," width: w,"," height: h,"," x: x,"," y: y"," });"," },",""," /**"," * Retrieves the marker styles based on the type of series. For series that contain a marker, the marker styles are returned."," * "," * @method _getStylesBySeriesType"," * @param {CartesianSeries | PieSeries} The series in which the style properties will be received."," * @return Object An object containing fill, border and shape information."," * @private"," */"," _getStylesBySeriesType: function(series)"," {"," var styles = series.get(\"styles\"),"," color;"," if(series instanceof Y.LineSeries || series instanceof Y.StackedLineSeries)"," {"," styles = series.get(\"styles\").line;"," color = styles.color || series._getDefaultColor(series.get(\"graphOrder\"), \"line\");"," return {"," border: {"," weight: 1,"," color: color"," },"," fill: {"," color: color"," }"," };"," }"," else if(series instanceof Y.AreaSeries || series instanceof Y.StackedAreaSeries)"," {"," styles = series.get(\"styles\").area;"," color = styles.color || series._getDefaultColor(series.get(\"graphOrder\"), \"slice\");"," return {"," border: {"," weight: 1,"," color: color"," },"," fill: {"," color: color"," }"," };"," }"," else "," {"," styles = series.get(\"styles\").marker;"," return {"," fill: styles.fill,",""," border: {"," weight: styles.border.weight,",""," color: styles.border.color,",""," shape: styles.shape"," },"," shape: styles.shape"," };"," }"," },",""," /**"," * Returns a legend item consisting of the following properties:"," * <dl>"," * <dt>node</dt><dd>The `Node` containing the legend item elements.</dd>"," * <dt>shape</dt><dd>The `Shape` element for the legend item.</dd>"," * <dt>textNode</dt><dd>The `Node` containing the text></dd>"," * <dt>text</dt><dd></dd>"," * </dl>"," *"," * @method _getLegendItem"," * @param {Node} shapeProps Reference to the `node` attribute."," * @param {String | Class} shapeClass The type of shape"," * @param {Object} fill Properties for the shape's fill"," * @param {Object} border Properties for the shape's border"," * @param {String} text String to be rendered as the legend's text"," * @param {Number} width Total width of the legend item"," * @param {Number} height Total height of the legend item"," * @param {HTML | String} text Text for the legendItem"," * @return Object"," * @private"," */"," _getLegendItem: function(node, shapeClass, fill, border, labelStyles, w, h, text) "," {"," var containerNode = Y.one(DOCUMENT.createElement(\"div\")),"," textField = Y.one(DOCUMENT.createElement(\"span\")),"," shape,"," dimension,"," padding,"," left,"," item;"," containerNode.setStyle(POSITION, \"absolute\");"," textField.setStyle(POSITION, \"absolute\");"," textField.setStyles(labelStyles);"," textField.appendChild(DOCUMENT.createTextNode(text));"," containerNode.appendChild(textField);"," node.appendChild(containerNode);"," dimension = textField.get(\"offsetHeight\");"," padding = dimension - h;"," left = w + padding + 2;"," textField.setStyle(\"left\", left + PX);"," containerNode.setStyle(\"height\", dimension + PX);"," containerNode.setStyle(\"width\", (left + textField.get(\"offsetWidth\")) + PX);"," shape = new shapeClass({"," fill: fill,"," stroke: border,"," width: w,"," height: h,"," x: padding * 0.5,"," y: padding * 0.5,"," w: w,"," h: h,"," graphic: containerNode"," });"," textField.setStyle(\"left\", dimension + PX);"," item = {"," node: containerNode,"," width: containerNode.get(\"offsetWidth\"),"," height: containerNode.get(\"offsetHeight\"),"," shape: shape,"," textNode: textField,"," text: text"," };"," this._items.push(item);"," return item;"," },",""," /**"," * Evaluates and returns correct class for drawing a shape."," *"," * @method _getShapeClass"," * @return Shape"," * @private"," */"," _getShapeClass: function()"," { "," var graphic = this.get(\"background\").get(\"graphic\");"," return graphic._getShapeClass.apply(graphic, arguments);"," },"," "," /**"," * Returns the default hash for the `styles` attribute."," *"," * @method _getDefaultStyles"," * @return Object"," * @protected"," */"," _getDefaultStyles: function()"," {"," var styles = { "," padding: {"," top: 8,"," right: 8,"," bottom: 8,"," left: 9"," },"," gap: 10,"," hAlign: \"center\","," vAlign: \"top\","," marker: this._getPlotDefaults(),"," item: {"," hSpacing: 10,"," vSpacing: 5,"," label: {"," color:\"#808080\","," fontSize:\"85%\","," whiteSpace: \"nowrap\""," }"," },"," background: {"," shape: \"rect\","," fill:{"," color:\"#faf9f2\""," },"," border: {"," color:\"#dad8c9\","," weight: 1"," }"," }"," };"," return styles;"," },",""," /**"," * Gets the default values for series that use the utility. This method is used by"," * the class' `styles` attribute's getter to get build default values."," *"," * @method _getPlotDefaults"," * @return Object"," * @protected"," */"," _getPlotDefaults: function()"," {"," var defs = {"," width: 10,"," height: 10"," };"," return defs;"," },",""," /**"," * Destroys legend items."," *"," * @method _destroyLegendItems"," * @private"," */"," _destroyLegendItems: function()"," {"," var item;"," if(this._items)"," {"," while(this._items.length > 0)"," {"," item = this._items.shift();"," item.shape.get(\"graphic\").destroy();"," item.node.empty();"," item.node.destroy(true);"," item.node = null;"," item = null;"," }"," }"," this._items = [];"," },",""," /**"," * Maps layout classes."," *"," * @property _layout"," * @private"," */"," _layout: {"," vertical: VerticalLegendLayout,"," horizontal: HorizontalLegendLayout"," },",""," /**"," * Destructor implementation ChartLegend class. Removes all items and the Graphic instance from the widget."," *"," * @method destructor"," * @protected"," */"," destructor: function()"," {"," var background = this.get(\"background\"),"," backgroundGraphic;"," this._destroyLegendItems();"," if(background)"," {"," backgroundGraphic = background.get(\"graphic\");"," if(backgroundGraphic)"," {"," backgroundGraphic.destroy();"," }"," else"," {"," background.destroy();"," }"," }",""," }","}, {"," ATTRS: {"," /**"," * Indicates whether the chart's contentBox is the parentNode for the legend."," *"," * @attribute includeInChartLayout"," * @type Boolean"," * @private"," */"," includeInChartLayout: {"," value: false"," },",""," /**"," * Reference to the `Chart` instance."," *"," * @attribute chart"," * @type Chart"," */"," chart: {"," setter: function(val)"," {"," this.after(\"legendRendered\", Y.bind(val._itemRendered, val));"," return val;"," }"," },",""," /**"," * Indicates the direction in relation of the legend's layout. The `direction` of the legend is determined by its"," * `position` value."," *"," * @attribute direction"," * @type String"," */"," direction: {"," value: \"vertical\""," },"," "," /**"," * Indicates the position and direction of the legend. Possible values are `left`, `top`, `right` and `bottom`. Values of `left` and"," * `right` values have a `direction` of `vertical`. Values of `top` and `bottom` values have a `direction` of `horizontal`."," *"," * @attribute position"," * @type String"," */"," position: {"," lazyAdd: false,",""," value: \"right\",",""," setter: function(val)"," {"," if(val == TOP || val == BOTTOM)"," {"," this.set(\"direction\", HORIZONTAL);"," }"," else if(val == LEFT || val == RIGHT)"," {"," this.set(\"direction\", VERTICAL);"," }"," return val;"," }"," },"," "," /**"," * The width of the legend. Depending on the implementation of the ChartLegend, this value is `readOnly`. By default, the legend is included in the layout of the `Chart` that "," * it references. Under this circumstance, `width` is always `readOnly`. When the legend is rendered in its own dom element, the `readOnly` status is determined by the "," * direction of the legend. If the `position` is `left` or `right` or the `direction` is `vertical`, width is `readOnly`. If the position is `top` or `bottom` or the `direction`"," * is `horizontal`, width can be explicitly set. If width is not explicitly set, the width will be determined by the width of the legend's parent element."," *"," * @attribute width"," * @type Number"," */"," width: {"," getter: function()"," {"," var chart = this.get(\"chart\"),"," parentNode = this._parentNode;"," if(parentNode)"," {"," if((chart && this.get(\"includeInChartLayout\")) || this._width)"," {"," if(!this._width)"," {"," this._width = 0;"," }"," return this._width;"," }"," else"," {"," return parentNode.get(\"offsetWidth\");"," }"," }"," return \"\";"," },",""," setter: function(val)"," {"," this._width = val;"," return val;"," }"," },",""," /**"," * The height of the legend. Depending on the implementation of the ChartLegend, this value is `readOnly`. By default, the legend is included in the layout of the `Chart` that "," * it references. Under this circumstance, `height` is always `readOnly`. When the legend is rendered in its own dom element, the `readOnly` status is determined by the "," * direction of the legend. If the `position` is `top` or `bottom` or the `direction` is `horizontal`, height is `readOnly`. If the position is `left` or `right` or the `direction`"," * is `vertical`, height can be explicitly set. If height is not explicitly set, the height will be determined by the width of the legend's parent element."," *"," * @attribute height "," * @type Number"," */"," height: {"," valueFn: \"_heightGetter\",",""," getter: function()"," {"," var chart = this.get(\"chart\"),"," parentNode = this._parentNode;"," if(parentNode) "," {"," if((chart && this.get(\"includeInChartLayout\")) || this._height)"," {"," if(!this._height)"," {"," this._height = 0;"," }"," return this._height;"," }"," else"," {"," return parentNode.get(\"offsetHeight\");"," }"," }"," return \"\";"," },",""," setter: function(val)"," {"," this._height = val;"," return val;"," }"," },",""," /**"," * Indicates the x position of legend."," *"," * @attribute x"," * @type Number"," * @readOnly"," */"," x: {"," lazyAdd: false,",""," value: 0,"," "," setter: function(val)"," {"," var node = this.get(\"boundingBox\");"," if(node)"," {"," node.setStyle(LEFT, val + PX);"," }"," return val;"," }"," },",""," /**"," * Indicates the y position of legend."," *"," * @attribute y"," * @type Number"," * @readOnly"," */"," y: {"," lazyAdd: false,",""," value: 0,"," "," setter: function(val)"," {"," var node = this.get(\"boundingBox\");"," if(node)"," {"," node.setStyle(TOP, val + PX);"," }"," return val;"," }"," },",""," /**"," * Array of items contained in the legend. Each item is an object containing the following properties:"," *"," * <dl>"," * <dt>node</dt><dd>Node containing text for the legend item.</dd>"," * <dt>marker</dt><dd>Shape for the legend item.</dd>"," * </dl>"," *"," * @attribute items"," * @type Array"," * @readOnly"," */"," items: {"," getter: function()"," {"," return this._items;"," }"," },",""," /**"," * Background for the legend."," *"," * @attribute background"," * @type Rect"," */"," background: {}",""," /**"," * Properties used to display and style the ChartLegend. This attribute is inherited from `Renderer`. Below are the default values:"," *"," * <dl>"," * <dt>gap</dt><dd>Distance, in pixels, between the `ChartLegend` instance and the chart's content. When `ChartLegend` is rendered within a `Chart` instance this value is applied.</dd>"," * <dt>hAlign</dt><dd>Defines the horizontal alignment of the `items` in a `ChartLegend` rendered in a horizontal direction. This value is applied when the instance's `position` is set to top or bottom. This attribute can be set to left, center or right. The default value is center.</dd>"," * <dt>vAlign</dt><dd>Defines the vertical alignment of the `items` in a `ChartLegend` rendered in vertical direction. This value is applied when the instance's `position` is set to left or right. The attribute can be set to top, middle or bottom. The default value is middle.</dd>"," * <dt>item</dt><dd>Set of style properties applied to the `items` of the `ChartLegend`."," * <dl>"," * <dt>hSpacing</dt><dd>Horizontal distance, in pixels, between legend `items`.</dd>"," * <dt>vSpacing</dt><dd>Vertical distance, in pixels, between legend `items`.</dd>"," * <dt>label</dt><dd>Properties for the text of an `item`."," * <dl>"," * <dt>color</dt><dd>Color of the text. The default values is \"#808080\".</dd>"," * <dt>fontSize</dt><dd>Font size for the text. The default value is \"85%\".</dd>"," * </dl>"," * </dd>"," * <dt>marker</dt><dd>Properties for the `item` markers."," * <dl>"," * <dt>width</dt><dd>Specifies the width of the markers.</dd>"," * <dt>height</dt><dd>Specifies the height of the markers.</dd>"," * </dl>"," * </dd>"," * </dl>"," * </dd>"," * <dt>background</dt><dd>Properties for the `ChartLegend` background."," * <dl>"," * <dt>fill</dt><dd>Properties for the background fill."," * <dl>"," * <dt>color</dt><dd>Color for the fill. The default value is \"#faf9f2\".</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>Properties for the background border."," * <dl>"," * <dt>color</dt><dd>Color for the border. The default value is \"#dad8c9\".</dd>"," * <dt>weight</dt><dd>Weight of the border. The default values is 1.</dd>"," * </dl>"," * </dd>"," * </dl>"," * </dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","/**"," * The Chart class is the basic application used to create a chart."," *"," * @module charts"," * @class Chart"," * @constructor"," */","function Chart(cfg)","{"," if(cfg.type != \"pie\")"," {"," return new Y.CartesianChart(cfg);"," }"," else"," {"," return new Y.PieChart(cfg);"," }","}","Y.Chart = Chart;","","","}, '3.7.1', {\"requires\": [\"charts-base\"]});"];+_yuitest_coverage["build/charts-legend/charts-legend.js"].lines = {"1":0,"9":0,"26":0,"27":0,"29":0,"31":0,"33":0,"34":0,"38":0,"39":0,"41":0,"42":0,"44":0,"46":0,"76":0,"95":0,"96":0,"97":0,"98":0,"99":0,"101":0,"102":0,"103":0,"104":0,"105":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"121":0,"123":0,"129":0,"131":0,"147":0,"155":0,"157":0,"158":0,"159":0,"161":0,"162":0,"166":0,"167":0,"169":0,"171":0,"173":0,"175":0,"176":0,"192":0,"193":0,"196":0,"197":0,"199":0,"200":0,"202":0,"203":0,"205":0,"235":0,"255":0,"256":0,"257":0,"258":0,"259":0,"261":0,"262":0,"263":0,"264":0,"265":0,"266":0,"268":0,"269":0,"270":0,"271":0,"272":0,"273":0,"274":0,"275":0,"276":0,"277":0,"278":0,"279":0,"280":0,"281":0,"283":0,"285":0,"291":0,"293":0,"309":0,"317":0,"319":0,"320":0,"321":0,"323":0,"324":0,"328":0,"329":0,"331":0,"333":0,"335":0,"337":0,"338":0,"354":0,"355":0,"358":0,"359":0,"361":0,"362":0,"364":0,"365":0,"367":0,"380":0,"382":0,"383":0,"385":0,"386":0,"387":0,"420":0,"422":0,"423":0,"424":0,"426":0,"427":0,"430":0,"432":0,"433":0,"434":0,"435":0,"437":0,"438":0,"441":0,"443":0,"444":0,"445":0,"447":0,"448":0,"451":0,"453":0,"454":0,"455":0,"457":0,"458":0,"462":0,"463":0,"464":0,"465":0,"466":0,"467":0,"468":0,"470":0,"471":0,"472":0,"473":0,"475":0,"476":0,"478":0,"479":0,"481":0,"482":0,"483":0,"485":0,"490":0,"491":0,"493":0,"494":0,"496":0,"497":0,"498":0,"500":0,"505":0,"506":0,"508":0,"509":0,"511":0,"512":0,"513":0,"515":0,"520":0,"521":0,"523":0,"524":0,"526":0,"527":0,"528":0,"530":0,"535":0,"536":0,"537":0,"538":0,"539":0,"541":0,"543":0,"546":0,"547":0,"548":0,"550":0,"551":0,"552":0,"554":0,"555":0,"556":0,"558":0,"559":0,"560":0,"564":0,"566":0,"567":0,"568":0,"570":0,"571":0,"573":0,"575":0,"576":0,"578":0,"580":0,"583":0,"585":0,"586":0,"587":0,"589":0,"590":0,"592":0,"594":0,"595":0,"597":0,"599":0,"602":0,"604":0,"605":0,"606":0,"608":0,"609":0,"610":0,"611":0,"613":0,"616":0,"618":0,"621":0,"623":0,"624":0,"625":0,"627":0,"628":0,"629":0,"630":0,"632":0,"635":0,"637":0,"640":0,"641":0,"643":0,"644":0,"646":0,"648":0,"649":0,"650":0,"651":0,"652":0,"655":0,"657":0,"658":0,"659":0,"660":0,"674":0,"688":0,"690":0,"691":0,"692":0,"694":0,"695":0,"696":0,"697":0,"698":0,"701":0,"702":0,"704":0,"705":0,"707":0,"708":0,"710":0,"711":0,"715":0,"727":0,"728":0,"730":0,"739":0,"741":0,"750":0,"752":0,"753":0,"755":0,"756":0,"757":0,"773":0,"775":0,"777":0,"778":0,"779":0,"780":0,"781":0,"782":0,"783":0,"785":0,"787":0,"790":0,"791":0,"792":0,"793":0,"794":0,"796":0,"797":0,"798":0,"799":0,"800":0,"802":0,"803":0,"804":0,"805":0,"806":0,"808":0,"809":0,"810":0,"811":0,"812":0,"814":0,"815":0,"819":0,"822":0,"823":0,"825":0,"826":0,"828":0,"829":0,"831":0,"832":0,"838":0,"839":0,"840":0,"841":0,"844":0,"845":0,"847":0,"848":0,"850":0,"852":0,"853":0,"855":0,"857":0,"858":0,"872":0,"881":0,"890":0,"899":0,"907":0,"908":0,"909":0,"918":0,"919":0,"920":0,"921":0,"922":0,"931":0,"933":0,"935":0,"948":0,"950":0,"963":0,"965":0,"967":0,"969":0,"971":0,"984":0,"988":0,"990":0,"1002":0,"1004":0,"1005":0,"1007":0,"1008":0,"1009":0,"1011":0,"1013":0,"1049":0,"1051":0,"1053":0,"1054":0,"1056":0,"1057":0,"1058":0,"1059":0,"1060":0,"1061":0,"1062":0,"1063":0,"1064":0,"1065":0,"1066":0,"1068":0,"1069":0,"1072":0,"1076":0,"1077":0,"1078":0,"1079":0,"1080":0,"1081":0,"1082":0,"1083":0,"1084":0,"1089":0,"1090":0,"1091":0,"1093":0,"1094":0,"1095":0,"1097":0,"1098":0,"1100":0,"1103":0,"1104":0,"1105":0,"1106":0,"1107":0,"1108":0,"1109":0,"1110":0,"1111":0,"1114":0,"1115":0,"1117":0,"1121":0,"1122":0,"1123":0,"1136":0,"1143":0,"1163":0,"1165":0,"1167":0,"1168":0,"1169":0,"1179":0,"1181":0,"1182":0,"1183":0,"1195":0,"1196":0,"1234":0,"1241":0,"1242":0,"1243":0,"1244":0,"1245":0,"1246":0,"1247":0,"1248":0,"1249":0,"1250":0,"1251":0,"1252":0,"1253":0,"1264":0,"1265":0,"1273":0,"1274":0,"1286":0,"1287":0,"1299":0,"1330":0,"1343":0,"1347":0,"1358":0,"1359":0,"1361":0,"1363":0,"1364":0,"1365":0,"1366":0,"1367":0,"1368":0,"1371":0,"1393":0,"1395":0,"1396":0,"1398":0,"1399":0,"1401":0,"1405":0,"1432":0,"1433":0,"1462":0,"1464":0,"1466":0,"1468":0,"1470":0,"1486":0,"1488":0,"1490":0,"1492":0,"1494":0,"1496":0,"1500":0,"1503":0,"1508":0,"1509":0,"1527":0,"1529":0,"1531":0,"1533":0,"1535":0,"1537":0,"1541":0,"1544":0,"1549":0,"1550":0,"1568":0,"1569":0,"1571":0,"1573":0,"1591":0,"1592":0,"1594":0,"1596":0,"1615":0,"1681":0,"1683":0,"1685":0,"1689":0,"1692":0};+_yuitest_coverage["build/charts-legend/charts-legend.js"].functions = {"setter:24":0,"_positionLegendItems:74":0,"_setRowArrays:145":0,"getStartPoint:190":0,"_positionLegendItems:233":0,"_setColumnArrays:307":0,"getStartPoint:352":0,"_redraw:378":0,"_getLayoutBoxDimensions:672":0,"destructor:725":0,"_redraw:748":0,"initializer:888":0,"renderUI:897":0,"bindUI:916":0,"syncUI:929":0,"_updateHandler:946":0,"_positionChangeHandler:961":0,"_handleSizeChange:982":0,"_drawLegend:1000":0,"_updateBackground:1134":0,"_getStylesBySeriesType:1161":0,"_getLegendItem:1232":0,"_getShapeClass:1284":0,"_getDefaultStyles:1297":0,"_getPlotDefaults:1341":0,"_destroyLegendItems:1356":0,"destructor:1391":0,"setter:1430":0,"setter:1460":0,"getter:1484":0,"setter:1506":0,"getter:1525":0,"setter:1547":0,"setter:1566":0,"setter:1589":0,"getter:1613":0,"Chart:1681":0,"(anonymous 1):1":0};+_yuitest_coverage["build/charts-legend/charts-legend.js"].coveredLines = 535;+_yuitest_coverage["build/charts-legend/charts-legend.js"].coveredFunctions = 38;+_yuitest_coverline("build/charts-legend/charts-legend.js", 1);+YUI.add('charts-legend', function (Y, NAME) {++/**+ * Adds legend functionality to charts.+ *+ * @module charts+ * @submodule charts-legend+ */+_yuitest_coverfunc("build/charts-legend/charts-legend.js", "(anonymous 1)", 1);+_yuitest_coverline("build/charts-legend/charts-legend.js", 9);+var DOCUMENT = Y.config.doc, +TOP = "top",+RIGHT = "right",+BOTTOM = "bottom",+LEFT = "left",+EXTERNAL = "external",+HORIZONTAL = "horizontal",+VERTICAL = "vertical",+WIDTH = "width",+HEIGHT = "height",+POSITION = "position",+_X = "x",+_Y = "y",+PX = "px",+LEGEND = {+ setter: function(val)+ { + _yuitest_coverfunc("build/charts-legend/charts-legend.js", "setter", 24);+_yuitest_coverline("build/charts-legend/charts-legend.js", 26);+var legend = this.get("legend");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 27);+if(legend)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 29);+legend.destroy(true);+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 31);+if(val instanceof Y.ChartLegend)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 33);+legend = val;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 34);+legend.set("chart", this);+ }+ else+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 38);+val.chart = this;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 39);+if(!val.hasOwnProperty("render"))+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 41);+val.render = this.get("contentBox");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 42);+val.includeInChartLayout = true;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 44);+legend = new Y.ChartLegend(val);+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 46);+return legend;+ }+},++/**+ * Contains methods for displaying items horizontally in a legend.+ *+ * @module charts+ * @submodule charts-legend+ * @class HorizontalLegendLayout+ */+HorizontalLegendLayout = {+ /**+ * Displays items horizontally in a legend.+ *+ * @method _positionLegendItems+ * @param {Array} items Array of items to display in the legend.+ * @param {Number} maxWidth The width of the largest item in the legend.+ * @param {Number} maxHeight The height of the largest item in the legend.+ * @param {Number} totalWidth The total width of all items in a legend.+ * @param {Number} totalHeight The total height of all items in a legend.+ * @param {Number} padding The left, top, right and bottom padding properties for the legend.+ * @param {Number} horizontalGap The horizontal distance between items in a legend.+ * @param {Number} verticalGap The vertical distance between items in a legend.+ * @param {String} hAlign The horizontal alignment of the legend.+ * @param {String} vAlign The vertical alignment of the legend.+ * @protected+ */+ _positionLegendItems: function(items, maxWidth, maxHeight, totalWidth, totalHeight, padding, horizontalGap, verticalGap, hAlign, vAlign)+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "_positionLegendItems", 74);+_yuitest_coverline("build/charts-legend/charts-legend.js", 76);+var i = 0,+ rowIterator = 0,+ item,+ node,+ itemWidth,+ itemHeight,+ len,+ width = this.get("width"),+ rows,+ rowsLen,+ row,+ totalWidthArray,+ legendWidth,+ topHeight = padding.top - verticalGap,+ limit = width - (padding.left + padding.right),+ left, + top,+ right,+ bottom;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 95);+HorizontalLegendLayout._setRowArrays(items, limit, horizontalGap);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 96);+rows = HorizontalLegendLayout.rowArray;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 97);+totalWidthArray = HorizontalLegendLayout.totalWidthArray;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 98);+rowsLen = rows.length;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 99);+for(; rowIterator < rowsLen; ++ rowIterator)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 101);+topHeight += verticalGap;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 102);+row = rows[rowIterator];+ _yuitest_coverline("build/charts-legend/charts-legend.js", 103);+len = row.length;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 104);+legendWidth = HorizontalLegendLayout.getStartPoint(width, totalWidthArray[rowIterator], hAlign, padding);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 105);+for(i = 0; i < len; ++i)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 107);+item = row[i];+ _yuitest_coverline("build/charts-legend/charts-legend.js", 108);+node = item.node;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 109);+itemWidth = item.width;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 110);+itemHeight = item.height;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 111);+item.x = legendWidth;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 112);+item.y = 0;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 113);+left = !isNaN(left) ? Math.min(left, legendWidth) : legendWidth;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 114);+top = !isNaN(top) ? Math.min(top, topHeight) : topHeight;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 115);+right = !isNaN(right) ? Math.max(legendWidth + itemWidth, right) : legendWidth + itemWidth;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 116);+bottom = !isNaN(bottom) ? Math.max(topHeight + itemHeight, bottom) : topHeight + itemHeight;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 117);+node.setStyle("left", legendWidth + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 118);+node.setStyle("top", topHeight + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 119);+legendWidth += itemWidth + horizontalGap;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 121);+topHeight += item.height;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 123);+this._contentRect = {+ left: left,+ top: top,+ right: right,+ bottom: bottom+ };+ _yuitest_coverline("build/charts-legend/charts-legend.js", 129);+if(this.get("includeInChartLayout"))+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 131);+this.set("height", topHeight + padding.bottom);+ }+ },++ /**+ * Creates row and total width arrays used for displaying multiple rows of+ * legend items based on the items, available width and horizontalGap for the legend.+ *+ * @method _setRowArrays+ * @param {Array} items Array of legend items to display in a legend.+ * @param {Number} limit Total available width for displaying items in a legend.+ * @param {Number} horizontalGap Horizontal distance between items in a legend.+ * @protected+ */+ _setRowArrays: function(items, limit, horizontalGap)+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "_setRowArrays", 145);+_yuitest_coverline("build/charts-legend/charts-legend.js", 147);+var item = items[0],+ rowArray = [[item]],+ i = 1,+ rowIterator = 0,+ len = items.length,+ totalWidth = item.width,+ itemWidth,+ totalWidthArray = [[totalWidth]];+ _yuitest_coverline("build/charts-legend/charts-legend.js", 155);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 157);+item = items[i];+ _yuitest_coverline("build/charts-legend/charts-legend.js", 158);+itemWidth = item.width;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 159);+if((totalWidth + horizontalGap + itemWidth) <= limit)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 161);+totalWidth += horizontalGap + itemWidth;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 162);+rowArray[rowIterator].push(item);+ }+ else+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 166);+totalWidth = horizontalGap + itemWidth;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 167);+if(rowArray[rowIterator])+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 169);+rowIterator += 1;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 171);+rowArray[rowIterator] = [item];+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 173);+totalWidthArray[rowIterator] = totalWidth;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 175);+HorizontalLegendLayout.rowArray = rowArray;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 176);+HorizontalLegendLayout.totalWidthArray = totalWidthArray;+ },++ /**+ * Returns the starting x-coordinate for a row of legend items.+ *+ * @method getStartPoint+ * @param {Number} w Width of the legend.+ * @param {Number} totalWidth Total width of all labels in the row.+ * @param {String} align Horizontal alignment of items for the legend.+ * @param {Object} padding Object contain left, top, right and bottom padding properties.+ * @return Number+ * @protected+ */+ getStartPoint: function(w, totalWidth, align, padding)+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "getStartPoint", 190);+_yuitest_coverline("build/charts-legend/charts-legend.js", 192);+var startPoint;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 193);+switch(align)+ {+ case LEFT :+ _yuitest_coverline("build/charts-legend/charts-legend.js", 196);+startPoint = padding.left;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 197);+break;+ case "center" :+ _yuitest_coverline("build/charts-legend/charts-legend.js", 199);+startPoint = (w - totalWidth) * 0.5;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 200);+break;+ case RIGHT :+ _yuitest_coverline("build/charts-legend/charts-legend.js", 202);+startPoint = w - totalWidth - padding.right;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 203);+break;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 205);+return startPoint;+ }+},++/**+ * Contains methods for displaying items vertically in a legend.+ *+ * @module charts+ * @submodule charts-legend+ * @class VerticalLegendLayout+ */+VerticalLegendLayout = {+ /**+ * Displays items vertically in a legend.+ *+ * @method _positionLegendItems+ * @param {Array} items Array of items to display in the legend.+ * @param {Number} maxWidth The width of the largest item in the legend.+ * @param {Number} maxHeight The height of the largest item in the legend.+ * @param {Number} totalWidth The total width of all items in a legend.+ * @param {Number} totalHeight The total height of all items in a legend.+ * @param {Number} padding The left, top, right and bottom padding properties for the legend.+ * @param {Number} horizontalGap The horizontal distance between items in a legend.+ * @param {Number} verticalGap The vertical distance between items in a legend.+ * @param {String} hAlign The horizontal alignment of the legend.+ * @param {String} vAlign The vertical alignment of the legend.+ * @protected+ */+ _positionLegendItems: function(items, maxWidth, maxHeight, totalWidth, totalHeight, padding, horizontalGap, verticalGap, hAlign, vAlign)+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "_positionLegendItems", 233);+_yuitest_coverline("build/charts-legend/charts-legend.js", 235);+var i = 0,+ columnIterator = 0,+ item,+ node,+ itemHeight,+ itemWidth,+ len,+ height = this.get("height"),+ columns,+ columnsLen,+ column,+ totalHeightArray,+ legendHeight,+ leftWidth = padding.left - horizontalGap,+ legendWidth,+ limit = height - (padding.top + padding.bottom),+ left, + top,+ right,+ bottom;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 255);+VerticalLegendLayout._setColumnArrays(items, limit, verticalGap);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 256);+columns = VerticalLegendLayout.columnArray;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 257);+totalHeightArray = VerticalLegendLayout.totalHeightArray;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 258);+columnsLen = columns.length;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 259);+for(; columnIterator < columnsLen; ++ columnIterator)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 261);+leftWidth += horizontalGap;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 262);+column = columns[columnIterator];+ _yuitest_coverline("build/charts-legend/charts-legend.js", 263);+len = column.length;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 264);+legendHeight = VerticalLegendLayout.getStartPoint(height, totalHeightArray[columnIterator], vAlign, padding);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 265);+legendWidth = 0;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 266);+for(i = 0; i < len; ++i)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 268);+item = column[i];+ _yuitest_coverline("build/charts-legend/charts-legend.js", 269);+node = item.node;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 270);+itemHeight = item.height;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 271);+itemWidth = item.width;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 272);+item.y = legendHeight;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 273);+item.x = leftWidth;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 274);+left = !isNaN(left) ? Math.min(left, leftWidth) : leftWidth;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 275);+top = !isNaN(top) ? Math.min(top, legendHeight) : legendHeight;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 276);+right = !isNaN(right) ? Math.max(leftWidth + itemWidth, right) : leftWidth + itemWidth;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 277);+bottom = !isNaN(bottom) ? Math.max(legendHeight + itemHeight, bottom) : legendHeight + itemHeight;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 278);+node.setStyle("left", leftWidth + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 279);+node.setStyle("top", legendHeight + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 280);+legendHeight += itemHeight + verticalGap;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 281);+legendWidth = Math.max(legendWidth, item.width);+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 283);+leftWidth += legendWidth;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 285);+this._contentRect = {+ left: left,+ top: top,+ right: right,+ bottom: bottom+ };+ _yuitest_coverline("build/charts-legend/charts-legend.js", 291);+if(this.get("includeInChartLayout"))+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 293);+this.set("width", leftWidth + padding.right);+ }+ },++ /**+ * Creates column and total height arrays used for displaying multiple columns of+ * legend items based on the items, available height and verticalGap for the legend.+ *+ * @method _setColumnArrays+ * @param {Array} items Array of legend items to display in a legend.+ * @param {Number} limit Total available height for displaying items in a legend.+ * @param {Number} verticalGap Vertical distance between items in a legend.+ * @protected+ */+ _setColumnArrays: function(items, limit, verticalGap)+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "_setColumnArrays", 307);+_yuitest_coverline("build/charts-legend/charts-legend.js", 309);+var item = items[0],+ columnArray = [[item]],+ i = 1,+ columnIterator = 0,+ len = items.length,+ totalHeight = item.height,+ itemHeight,+ totalHeightArray = [[totalHeight]];+ _yuitest_coverline("build/charts-legend/charts-legend.js", 317);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 319);+item = items[i];+ _yuitest_coverline("build/charts-legend/charts-legend.js", 320);+itemHeight = item.height;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 321);+if((totalHeight + verticalGap + itemHeight) <= limit)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 323);+totalHeight += verticalGap + itemHeight;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 324);+columnArray[columnIterator].push(item);+ }+ else+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 328);+totalHeight = verticalGap + itemHeight;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 329);+if(columnArray[columnIterator])+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 331);+columnIterator += 1;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 333);+columnArray[columnIterator] = [item];+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 335);+totalHeightArray[columnIterator] = totalHeight;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 337);+VerticalLegendLayout.columnArray = columnArray;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 338);+VerticalLegendLayout.totalHeightArray = totalHeightArray;+ },++ /**+ * Returns the starting y-coordinate for a column of legend items.+ *+ * @method getStartPoint+ * @param {Number} h Height of the legend.+ * @param {Number} totalHeight Total height of all labels in the column.+ * @param {String} align Vertical alignment of items for the legend.+ * @param {Object} padding Object contain left, top, right and bottom padding properties.+ * @return Number+ * @protected+ */+ getStartPoint: function(h, totalHeight, align, padding)+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "getStartPoint", 352);+_yuitest_coverline("build/charts-legend/charts-legend.js", 354);+var startPoint;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 355);+switch(align)+ {+ case TOP :+ _yuitest_coverline("build/charts-legend/charts-legend.js", 358);+startPoint = padding.top;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 359);+break;+ case "middle" :+ _yuitest_coverline("build/charts-legend/charts-legend.js", 361);+startPoint = (h - totalHeight) * 0.5;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 362);+break;+ case BOTTOM :+ _yuitest_coverline("build/charts-legend/charts-legend.js", 364);+startPoint = h - totalHeight - padding.bottom;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 365);+break;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 367);+return startPoint;+ }+},++CartesianChartLegend = Y.Base.create("cartesianChartLegend", Y.CartesianChart, [], {+ /**+ * Redraws and position all the components of the chart instance.+ *+ * @method _redraw+ * @private+ */+ _redraw: function()+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "_redraw", 378);+_yuitest_coverline("build/charts-legend/charts-legend.js", 380);+if(this._drawing)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 382);+this._callLater = true;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 383);+return;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 385);+this._drawing = true;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 386);+this._callLater = false;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 387);+var w = this.get("width"),+ h = this.get("height"),+ layoutBoxDimensions = this._getLayoutBoxDimensions(),+ leftPaneWidth = layoutBoxDimensions.left,+ rightPaneWidth = layoutBoxDimensions.right,+ topPaneHeight = layoutBoxDimensions.top,+ bottomPaneHeight = layoutBoxDimensions.bottom,+ leftAxesCollection = this.get("leftAxesCollection"),+ rightAxesCollection = this.get("rightAxesCollection"),+ topAxesCollection = this.get("topAxesCollection"),+ bottomAxesCollection = this.get("bottomAxesCollection"),+ i = 0,+ l,+ axis,+ graphOverflow = "visible",+ graph = this.get("graph"),+ topOverflow,+ bottomOverflow,+ leftOverflow,+ rightOverflow,+ graphWidth,+ graphHeight,+ graphX,+ graphY,+ allowContentOverflow = this.get("allowContentOverflow"),+ diff,+ rightAxesXCoords,+ leftAxesXCoords,+ topAxesYCoords,+ bottomAxesYCoords,+ legend = this.get("legend"),+ graphRect = {};++ _yuitest_coverline("build/charts-legend/charts-legend.js", 420);+if(leftAxesCollection)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 422);+leftAxesXCoords = [];+ _yuitest_coverline("build/charts-legend/charts-legend.js", 423);+l = leftAxesCollection.length;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 424);+for(i = l - 1; i > -1; --i)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 426);+leftAxesXCoords.unshift(leftPaneWidth);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 427);+leftPaneWidth += leftAxesCollection[i].get("width");+ }+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 430);+if(rightAxesCollection)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 432);+rightAxesXCoords = [];+ _yuitest_coverline("build/charts-legend/charts-legend.js", 433);+l = rightAxesCollection.length;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 434);+i = 0;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 435);+for(i = l - 1; i > -1; --i)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 437);+rightPaneWidth += rightAxesCollection[i].get("width");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 438);+rightAxesXCoords.unshift(w - rightPaneWidth);+ }+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 441);+if(topAxesCollection)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 443);+topAxesYCoords = [];+ _yuitest_coverline("build/charts-legend/charts-legend.js", 444);+l = topAxesCollection.length;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 445);+for(i = l - 1; i > -1; --i)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 447);+topAxesYCoords.unshift(topPaneHeight);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 448);+topPaneHeight += topAxesCollection[i].get("height");+ }+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 451);+if(bottomAxesCollection)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 453);+bottomAxesYCoords = [];+ _yuitest_coverline("build/charts-legend/charts-legend.js", 454);+l = bottomAxesCollection.length;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 455);+for(i = l - 1; i > -1; --i)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 457);+bottomPaneHeight += bottomAxesCollection[i].get("height");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 458);+bottomAxesYCoords.unshift(h - bottomPaneHeight);+ }+ }+ + _yuitest_coverline("build/charts-legend/charts-legend.js", 462);+graphWidth = w - (leftPaneWidth + rightPaneWidth);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 463);+graphHeight = h - (bottomPaneHeight + topPaneHeight);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 464);+graphRect.left = leftPaneWidth;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 465);+graphRect.top = topPaneHeight;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 466);+graphRect.bottom = h - bottomPaneHeight;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 467);+graphRect.right = w - rightPaneWidth;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 468);+if(!allowContentOverflow)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 470);+topOverflow = this._getTopOverflow(leftAxesCollection, rightAxesCollection);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 471);+bottomOverflow = this._getBottomOverflow(leftAxesCollection, rightAxesCollection);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 472);+leftOverflow = this._getLeftOverflow(bottomAxesCollection, topAxesCollection);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 473);+rightOverflow = this._getRightOverflow(bottomAxesCollection, topAxesCollection);+ + _yuitest_coverline("build/charts-legend/charts-legend.js", 475);+diff = topOverflow - topPaneHeight;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 476);+if(diff > 0)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 478);+graphRect.top = topOverflow;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 479);+if(topAxesYCoords)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 481);+i = 0;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 482);+l = topAxesYCoords.length;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 483);+for(; i < l; ++i)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 485);+topAxesYCoords[i] += diff;+ }+ }+ }++ _yuitest_coverline("build/charts-legend/charts-legend.js", 490);+diff = bottomOverflow - bottomPaneHeight;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 491);+if(diff > 0)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 493);+graphRect.bottom = h - bottomOverflow;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 494);+if(bottomAxesYCoords)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 496);+i = 0;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 497);+l = bottomAxesYCoords.length;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 498);+for(; i < l; ++i)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 500);+bottomAxesYCoords[i] -= diff;+ }+ }+ }++ _yuitest_coverline("build/charts-legend/charts-legend.js", 505);+diff = leftOverflow - leftPaneWidth;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 506);+if(diff > 0)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 508);+graphRect.left = leftOverflow;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 509);+if(leftAxesXCoords)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 511);+i = 0;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 512);+l = leftAxesXCoords.length;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 513);+for(; i < l; ++i)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 515);+leftAxesXCoords[i] += diff;+ }+ }+ }++ _yuitest_coverline("build/charts-legend/charts-legend.js", 520);+diff = rightOverflow - rightPaneWidth;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 521);+if(diff > 0)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 523);+graphRect.right = w - rightOverflow;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 524);+if(rightAxesXCoords)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 526);+i = 0;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 527);+l = rightAxesXCoords.length;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 528);+for(; i < l; ++i)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 530);+rightAxesXCoords[i] -= diff;+ }+ }+ }+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 535);+graphWidth = graphRect.right - graphRect.left;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 536);+graphHeight = graphRect.bottom - graphRect.top;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 537);+graphX = graphRect.left;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 538);+graphY = graphRect.top;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 539);+if(legend)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 541);+if(legend.get("includeInChartLayout"))+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 543);+switch(legend.get("position"))+ {+ case "left" : + _yuitest_coverline("build/charts-legend/charts-legend.js", 546);+legend.set("y", graphY);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 547);+legend.set("height", graphHeight);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 548);+break;+ case "top" :+ _yuitest_coverline("build/charts-legend/charts-legend.js", 550);+legend.set("x", graphX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 551);+legend.set("width", graphWidth);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 552);+break;+ case "bottom" : + _yuitest_coverline("build/charts-legend/charts-legend.js", 554);+legend.set("x", graphX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 555);+legend.set("width", graphWidth);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 556);+break;+ case "right" :+ _yuitest_coverline("build/charts-legend/charts-legend.js", 558);+legend.set("y", graphY);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 559);+legend.set("height", graphHeight);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 560);+break;+ }+ }+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 564);+if(topAxesCollection)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 566);+l = topAxesCollection.length;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 567);+i = 0;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 568);+for(; i < l; i++)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 570);+axis = topAxesCollection[i];+ _yuitest_coverline("build/charts-legend/charts-legend.js", 571);+if(axis.get("width") !== graphWidth)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 573);+axis.set("width", graphWidth);+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 575);+axis.get("boundingBox").setStyle("left", graphX + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 576);+axis.get("boundingBox").setStyle("top", topAxesYCoords[i] + PX);+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 578);+if(axis._hasDataOverflow())+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 580);+graphOverflow = "hidden";+ }+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 583);+if(bottomAxesCollection)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 585);+l = bottomAxesCollection.length;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 586);+i = 0;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 587);+for(; i < l; i++)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 589);+axis = bottomAxesCollection[i];+ _yuitest_coverline("build/charts-legend/charts-legend.js", 590);+if(axis.get("width") !== graphWidth)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 592);+axis.set("width", graphWidth);+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 594);+axis.get("boundingBox").setStyle("left", graphX + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 595);+axis.get("boundingBox").setStyle("top", bottomAxesYCoords[i] + PX);+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 597);+if(axis._hasDataOverflow())+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 599);+graphOverflow = "hidden";+ }+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 602);+if(leftAxesCollection)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 604);+l = leftAxesCollection.length;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 605);+i = 0;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 606);+for(; i < l; ++i)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 608);+axis = leftAxesCollection[i];+ _yuitest_coverline("build/charts-legend/charts-legend.js", 609);+axis.get("boundingBox").setStyle("top", graphY + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 610);+axis.get("boundingBox").setStyle("left", leftAxesXCoords[i] + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 611);+if(axis.get("height") !== graphHeight)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 613);+axis.set("height", graphHeight);+ }+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 616);+if(axis._hasDataOverflow())+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 618);+graphOverflow = "hidden";+ }+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 621);+if(rightAxesCollection)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 623);+l = rightAxesCollection.length;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 624);+i = 0;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 625);+for(; i < l; ++i)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 627);+axis = rightAxesCollection[i];+ _yuitest_coverline("build/charts-legend/charts-legend.js", 628);+axis.get("boundingBox").setStyle("top", graphY + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 629);+axis.get("boundingBox").setStyle("left", rightAxesXCoords[i] + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 630);+if(axis.get("height") !== graphHeight)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 632);+axis.set("height", graphHeight);+ }+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 635);+if(axis._hasDataOverflow())+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 637);+graphOverflow = "hidden";+ }+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 640);+this._drawing = false;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 641);+if(this._callLater)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 643);+this._redraw();+ _yuitest_coverline("build/charts-legend/charts-legend.js", 644);+return;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 646);+if(graph)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 648);+graph.get("boundingBox").setStyle("left", graphX + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 649);+graph.get("boundingBox").setStyle("top", graphY + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 650);+graph.set("width", graphWidth);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 651);+graph.set("height", graphHeight);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 652);+graph.get("boundingBox").setStyle("overflow", graphOverflow);+ }++ _yuitest_coverline("build/charts-legend/charts-legend.js", 655);+if(this._overlay)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 657);+this._overlay.setStyle("left", graphX + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 658);+this._overlay.setStyle("top", graphY + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 659);+this._overlay.setStyle("width", graphWidth + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 660);+this._overlay.setStyle("height", graphHeight + PX);+ }+ },++ /**+ * Positions the legend in a chart and returns the properties of the legend to be used in the + * chart's layout algorithm.+ *+ * @method _getLayoutDimensions+ * @return {Object} The left, top, right and bottom values for the legend.+ * @protected+ */+ _getLayoutBoxDimensions: function()+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "_getLayoutBoxDimensions", 672);+_yuitest_coverline("build/charts-legend/charts-legend.js", 674);+var box = {+ top: 0,+ right: 0,+ bottom: 0,+ left: 0+ },+ legend = this.get("legend"),+ position,+ direction,+ dimension,+ size,+ w = this.get(WIDTH),+ h = this.get(HEIGHT),+ gap;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 688);+if(legend && legend.get("includeInChartLayout"))+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 690);+gap = legend.get("styles").gap;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 691);+position = legend.get(POSITION);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 692);+if(position != EXTERNAL)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 694);+direction = legend.get("direction");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 695);+dimension = direction == HORIZONTAL ? HEIGHT : WIDTH;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 696);+size = legend.get(dimension);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 697);+box[position] = size + gap;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 698);+switch(position)+ {+ case TOP :+ _yuitest_coverline("build/charts-legend/charts-legend.js", 701);+legend.set(_Y, 0); + _yuitest_coverline("build/charts-legend/charts-legend.js", 702);+break;+ case BOTTOM : + _yuitest_coverline("build/charts-legend/charts-legend.js", 704);+legend.set(_Y, h - size); + _yuitest_coverline("build/charts-legend/charts-legend.js", 705);+break;+ case RIGHT :+ _yuitest_coverline("build/charts-legend/charts-legend.js", 707);+legend.set(_X, w - size);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 708);+break;+ case LEFT: + _yuitest_coverline("build/charts-legend/charts-legend.js", 710);+legend.set(_X, 0);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 711);+break;+ }+ }+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 715);+return box;+ },++ /**+ * Destructor implementation for the CartesianChart class. Calls destroy on all axes, series, legend (if available) and the Graph instance.+ * Removes the tooltip and overlay HTML elements.+ *+ * @method destructor+ * @protected+ */+ destructor: function()+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "destructor", 725);+_yuitest_coverline("build/charts-legend/charts-legend.js", 727);+var legend = this.get("legend");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 728);+if(legend)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 730);+legend.destroy(true);+ }+ }+}, {+ ATTRS: {+ legend: LEGEND+ }+});++_yuitest_coverline("build/charts-legend/charts-legend.js", 739);+Y.CartesianChart = CartesianChartLegend;++_yuitest_coverline("build/charts-legend/charts-legend.js", 741);+var PieChartLegend = Y.Base.create("pieChartLegend", Y.PieChart, [], {+ /**+ * Redraws the chart instance.+ *+ * @method _redraw+ * @private+ */+ _redraw: function()+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "_redraw", 748);+_yuitest_coverline("build/charts-legend/charts-legend.js", 750);+if(this._drawing)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 752);+this._callLater = true;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 753);+return;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 755);+this._drawing = true;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 756);+this._callLater = false;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 757);+var graph = this.get("graph"),+ w = this.get("width"),+ h = this.get("height"),+ graphWidth,+ graphHeight,+ legend = this.get("legend"),+ x = 0,+ y = 0,+ legendX = 0,+ legendY = 0,+ legendWidth,+ legendHeight,+ dimension,+ gap,+ position,+ direction;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 773);+if(graph)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 775);+if(legend)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 777);+position = legend.get("position");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 778);+direction = legend.get("direction");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 779);+graphWidth = graph.get("width");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 780);+graphHeight = graph.get("height");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 781);+legendWidth = legend.get("width");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 782);+legendHeight = legend.get("height");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 783);+gap = legend.get("styles").gap;+ + _yuitest_coverline("build/charts-legend/charts-legend.js", 785);+if((direction == "vertical" && (graphWidth + legendWidth + gap !== w)) || (direction == "horizontal" && (graphHeight + legendHeight + gap !== h)))+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 787);+switch(legend.get("position"))+ {+ case LEFT :+ _yuitest_coverline("build/charts-legend/charts-legend.js", 790);+dimension = Math.min(w - (legendWidth + gap), h);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 791);+legendHeight = h;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 792);+x = legendWidth + gap;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 793);+legend.set(HEIGHT, legendHeight);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 794);+break;+ case TOP :+ _yuitest_coverline("build/charts-legend/charts-legend.js", 796);+dimension = Math.min(h - (legendHeight + gap), w); + _yuitest_coverline("build/charts-legend/charts-legend.js", 797);+legendWidth = w;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 798);+y = legendHeight + gap;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 799);+legend.set(WIDTH, legendWidth);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 800);+break;+ case RIGHT :+ _yuitest_coverline("build/charts-legend/charts-legend.js", 802);+dimension = Math.min(w - (legendWidth + gap), h);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 803);+legendHeight = h;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 804);+legendX = dimension + gap;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 805);+legend.set(HEIGHT, legendHeight);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 806);+break;+ case BOTTOM :+ _yuitest_coverline("build/charts-legend/charts-legend.js", 808);+dimension = Math.min(h - (legendHeight + gap), w); + _yuitest_coverline("build/charts-legend/charts-legend.js", 809);+legendWidth = w;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 810);+legendY = dimension + gap; + _yuitest_coverline("build/charts-legend/charts-legend.js", 811);+legend.set(WIDTH, legendWidth);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 812);+break;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 814);+graph.set(WIDTH, dimension);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 815);+graph.set(HEIGHT, dimension);+ }+ else+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 819);+switch(legend.get("position"))+ { + case LEFT :+ _yuitest_coverline("build/charts-legend/charts-legend.js", 822);+x = legendWidth + gap;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 823);+break;+ case TOP :+ _yuitest_coverline("build/charts-legend/charts-legend.js", 825);+y = legendHeight + gap;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 826);+break;+ case RIGHT :+ _yuitest_coverline("build/charts-legend/charts-legend.js", 828);+legendX = graphWidth + gap;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 829);+break;+ case BOTTOM :+ _yuitest_coverline("build/charts-legend/charts-legend.js", 831);+legendY = graphHeight + gap; + _yuitest_coverline("build/charts-legend/charts-legend.js", 832);+break;+ }+ }+ }+ else+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 838);+graph.set(_X, 0);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 839);+graph.set(_Y, 0);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 840);+graph.set(WIDTH, w);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 841);+graph.set(HEIGHT, h);+ }+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 844);+this._drawing = false;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 845);+if(this._callLater)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 847);+this._redraw();+ _yuitest_coverline("build/charts-legend/charts-legend.js", 848);+return;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 850);+if(graph)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 852);+graph.set(_X, x);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 853);+graph.set(_Y, y);+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 855);+if(legend)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 857);+legend.set(_X, legendX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 858);+legend.set(_Y, legendY);+ }+ }+}, {+ ATTRS: {+ /**+ * The legend for the chart.+ *+ * @attribute+ * @type Legend+ */+ legend: LEGEND+ }+});+_yuitest_coverline("build/charts-legend/charts-legend.js", 872);+Y.PieChart = PieChartLegend;+/**+ * ChartLegend provides a legend for a chart.+ *+ * @class ChartLegend+ * @module charts+ * @submodule charts-legend+ * @extends Widget+ */+_yuitest_coverline("build/charts-legend/charts-legend.js", 881);+Y.ChartLegend = Y.Base.create("chartlegend", Y.Widget, [Y.Renderer], {+ /**+ * Initializes the chart.+ *+ * @method initializer+ * @private+ */+ initializer: function()+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "initializer", 888);+_yuitest_coverline("build/charts-legend/charts-legend.js", 890);+this._items = [];+ },++ /**+ * @method renderUI+ * @private+ */+ renderUI: function()+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "renderUI", 897);+_yuitest_coverline("build/charts-legend/charts-legend.js", 899);+var bb = this.get("boundingBox"),+ cb = this.get("contentBox"),+ styles = this.get("styles").background,+ background = new Y.Rect({+ graphic: cb,+ fill: styles.fill,+ stroke: styles.border+ });+ _yuitest_coverline("build/charts-legend/charts-legend.js", 907);+bb.setStyle("display", "block");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 908);+bb.setStyle("position", "absolute");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 909);+this.set("background", background);+ },+ + /**+ * @method bindUI+ * @private+ */+ bindUI: function()+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "bindUI", 916);+_yuitest_coverline("build/charts-legend/charts-legend.js", 918);+this.get("chart").after("seriesCollectionChange", Y.bind(this._updateHandler, this));+ _yuitest_coverline("build/charts-legend/charts-legend.js", 919);+this.after("stylesChange", this._updateHandler);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 920);+this.after("positionChange", this._positionChangeHandler);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 921);+this.after("widthChange", this._handleSizeChange);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 922);+this.after("heightChange", this._handleSizeChange);+ },+ + /**+ * @method syncUI+ * @private+ */+ syncUI: function()+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "syncUI", 929);+_yuitest_coverline("build/charts-legend/charts-legend.js", 931);+var w = this.get("width"),+ h = this.get("height");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 933);+if(isFinite(w) && isFinite(h) && w > 0 && h > 0)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 935);+this._drawLegend();+ }+ },++ /**+ * Handles changes to legend.+ *+ * @method _updateHandler+ * @param {Object} e Event object+ * @private+ */+ _updateHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "_updateHandler", 946);+_yuitest_coverline("build/charts-legend/charts-legend.js", 948);+if(this.get("rendered"))+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 950);+this._drawLegend();+ }+ },++ /** + * Handles position changes.+ *+ * @method _positionChangeHandler+ * @param {Object} e Event object+ * @private+ */+ _positionChangeHandler: function(e)+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "_positionChangeHandler", 961);+_yuitest_coverline("build/charts-legend/charts-legend.js", 963);+var chart = this.get("chart"),+ parentNode = this._parentNode;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 965);+if(parentNode && ((chart && this.get("includeInChartLayout"))))+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 967);+this.fire("legendRendered");+ }+ else {_yuitest_coverline("build/charts-legend/charts-legend.js", 969);+if(this.get("rendered"))+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 971);+this._drawLegend();+ }}+ },++ /**+ * Updates the legend when the size changes.+ *+ * @method _handleSizeChange+ * @param {Object} e Event object.+ * @private+ */+ _handleSizeChange: function(e)+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "_handleSizeChange", 982);+_yuitest_coverline("build/charts-legend/charts-legend.js", 984);+var attrName = e.attrName,+ pos = this.get(POSITION),+ vert = pos == LEFT || pos == RIGHT,+ hor = pos == BOTTOM || pos == TOP;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 988);+if((hor && attrName == WIDTH) || (vert && attrName == HEIGHT))+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 990);+this._drawLegend();+ }+ },++ /**+ * Draws the legend+ *+ * @method _drawLegend+ * @private+ */+ _drawLegend: function()+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "_drawLegend", 1000);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1002);+if(this._drawing)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1004);+this._callLater = true;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1005);+return;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1007);+this._drawing = true;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1008);+this._callLater = false;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1009);+if(this.get("includeInChartLayout"))+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1011);+this.get("chart")._itemRenderQueue.unshift(this);+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1013);+var chart = this.get("chart"),+ node = this.get("contentBox"),+ seriesCollection = chart.get("seriesCollection"),+ series,+ styles = this.get("styles"),+ padding = styles.padding,+ itemStyles = styles.item,+ seriesStyles,+ hSpacing = itemStyles.hSpacing,+ vSpacing = itemStyles.vSpacing,+ hAlign = styles.hAlign,+ vAlign = styles.vAlign,+ marker = styles.marker,+ labelStyles = itemStyles.label,+ displayName,+ layout = this._layout[this.get("direction")],+ i, + len,+ isArray,+ shape,+ shapeClass,+ item,+ fill,+ border,+ fillColors,+ borderColors,+ borderWeight,+ items = [],+ markerWidth = marker.width,+ markerHeight = marker.height,+ totalWidth = 0 - hSpacing,+ totalHeight = 0 - vSpacing,+ maxWidth = 0,+ maxHeight = 0,+ itemWidth,+ itemHeight;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1049);+if(marker && marker.shape)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1051);+shape = marker.shape;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1053);+this._destroyLegendItems();+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1054);+if(chart instanceof Y.PieChart)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1056);+series = seriesCollection[0];+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1057);+displayName = series.get("categoryAxis").getDataByKey(series.get("categoryKey")); + _yuitest_coverline("build/charts-legend/charts-legend.js", 1058);+seriesStyles = series.get("styles").marker;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1059);+fillColors = seriesStyles.fill.colors;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1060);+borderColors = seriesStyles.border.colors;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1061);+borderWeight = seriesStyles.border.weight;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1062);+i = 0;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1063);+len = displayName.length;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1064);+shape = shape || Y.Circle;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1065);+isArray = Y.Lang.isArray(shape);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1066);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1068);+shape = isArray ? shape[i] : shape;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1069);+fill = {+ color: fillColors[i]+ };+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1072);+border = {+ colors: borderColors[i],+ weight: borderWeight+ };+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1076);+displayName = chart.getSeriesItems(series, i).category.value;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1077);+item = this._getLegendItem(node, this._getShapeClass(shape), fill, border, labelStyles, markerWidth, markerHeight, displayName);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1078);+itemWidth = item.width;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1079);+itemHeight = item.height;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1080);+maxWidth = Math.max(maxWidth, itemWidth);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1081);+maxHeight = Math.max(maxHeight, itemHeight);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1082);+totalWidth += itemWidth + hSpacing;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1083);+totalHeight += itemHeight + vSpacing;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1084);+items.push(item);+ }+ }+ else+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1089);+i = 0;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1090);+len = seriesCollection.length;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1091);+for(; i < len; ++i)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1093);+series = seriesCollection[i];+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1094);+seriesStyles = this._getStylesBySeriesType(series, shape);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1095);+if(!shape)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1097);+shape = seriesStyles.shape;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1098);+if(!shape)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1100);+shape = Y.Circle;+ }+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1103);+shapeClass = Y.Lang.isArray(shape) ? shape[i] : shape;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1104);+item = this._getLegendItem(node, this._getShapeClass(shape), seriesStyles.fill, seriesStyles.border, labelStyles, markerWidth, markerHeight, series.get("valueDisplayName"));+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1105);+itemWidth = item.width;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1106);+itemHeight = item.height;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1107);+maxWidth = Math.max(maxWidth, itemWidth);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1108);+maxHeight = Math.max(maxHeight, itemHeight);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1109);+totalWidth += itemWidth + hSpacing;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1110);+totalHeight += itemHeight + vSpacing;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1111);+items.push(item);+ }+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1114);+this._drawing = false;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1115);+if(this._callLater)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1117);+this._drawLegend();+ }+ else+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1121);+layout._positionLegendItems.apply(this, [items, maxWidth, maxHeight, totalWidth, totalHeight, padding, hSpacing, vSpacing, hAlign, vAlign]);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1122);+this._updateBackground(styles);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1123);+this.fire("legendRendered");+ }+ },++ /**+ * Updates the background for the legend.+ *+ * @method _updateBackground+ * @param {Object} styles Reference to the legend's styles attribute+ * @private+ */+ _updateBackground: function(styles)+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "_updateBackground", 1134);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1136);+var backgroundStyles = styles.background,+ contentRect = this._contentRect,+ padding = styles.padding,+ x = contentRect.left - padding.left,+ y = contentRect.top - padding.top,+ w = contentRect.right - x + padding.right,+ h = contentRect.bottom - y + padding.bottom;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1143);+this.get("background").set({+ fill: backgroundStyles.fill,+ stroke: backgroundStyles.border,+ width: w,+ height: h,+ x: x,+ y: y+ });+ },++ /**+ * Retrieves the marker styles based on the type of series. For series that contain a marker, the marker styles are returned.+ * + * @method _getStylesBySeriesType+ * @param {CartesianSeries | PieSeries} The series in which the style properties will be received.+ * @return Object An object containing fill, border and shape information.+ * @private+ */+ _getStylesBySeriesType: function(series)+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "_getStylesBySeriesType", 1161);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1163);+var styles = series.get("styles"),+ color;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1165);+if(series instanceof Y.LineSeries || series instanceof Y.StackedLineSeries)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1167);+styles = series.get("styles").line;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1168);+color = styles.color || series._getDefaultColor(series.get("graphOrder"), "line");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1169);+return {+ border: {+ weight: 1,+ color: color+ },+ fill: {+ color: color+ }+ };+ }+ else {_yuitest_coverline("build/charts-legend/charts-legend.js", 1179);+if(series instanceof Y.AreaSeries || series instanceof Y.StackedAreaSeries)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1181);+styles = series.get("styles").area;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1182);+color = styles.color || series._getDefaultColor(series.get("graphOrder"), "slice");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1183);+return {+ border: {+ weight: 1,+ color: color+ },+ fill: {+ color: color+ }+ };+ }+ else + {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1195);+styles = series.get("styles").marker;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1196);+return {+ fill: styles.fill,++ border: {+ weight: styles.border.weight,++ color: styles.border.color,++ shape: styles.shape+ },+ shape: styles.shape+ };+ }}+ },++ /**+ * Returns a legend item consisting of the following properties:+ * <dl>+ * <dt>node</dt><dd>The `Node` containing the legend item elements.</dd>+ * <dt>shape</dt><dd>The `Shape` element for the legend item.</dd>+ * <dt>textNode</dt><dd>The `Node` containing the text></dd>+ * <dt>text</dt><dd></dd>+ * </dl>+ *+ * @method _getLegendItem+ * @param {Node} shapeProps Reference to the `node` attribute.+ * @param {String | Class} shapeClass The type of shape+ * @param {Object} fill Properties for the shape's fill+ * @param {Object} border Properties for the shape's border+ * @param {String} text String to be rendered as the legend's text+ * @param {Number} width Total width of the legend item+ * @param {Number} height Total height of the legend item+ * @param {HTML | String} text Text for the legendItem+ * @return Object+ * @private+ */+ _getLegendItem: function(node, shapeClass, fill, border, labelStyles, w, h, text) + {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "_getLegendItem", 1232);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1234);+var containerNode = Y.one(DOCUMENT.createElement("div")),+ textField = Y.one(DOCUMENT.createElement("span")),+ shape,+ dimension,+ padding,+ left,+ item;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1241);+containerNode.setStyle(POSITION, "absolute");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1242);+textField.setStyle(POSITION, "absolute");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1243);+textField.setStyles(labelStyles);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1244);+textField.appendChild(DOCUMENT.createTextNode(text));+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1245);+containerNode.appendChild(textField);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1246);+node.appendChild(containerNode);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1247);+dimension = textField.get("offsetHeight");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1248);+padding = dimension - h;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1249);+left = w + padding + 2;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1250);+textField.setStyle("left", left + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1251);+containerNode.setStyle("height", dimension + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1252);+containerNode.setStyle("width", (left + textField.get("offsetWidth")) + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1253);+shape = new shapeClass({+ fill: fill,+ stroke: border,+ width: w,+ height: h,+ x: padding * 0.5,+ y: padding * 0.5,+ w: w,+ h: h,+ graphic: containerNode+ });+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1264);+textField.setStyle("left", dimension + PX);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1265);+item = {+ node: containerNode,+ width: containerNode.get("offsetWidth"),+ height: containerNode.get("offsetHeight"),+ shape: shape,+ textNode: textField,+ text: text+ };+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1273);+this._items.push(item);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1274);+return item;+ },++ /**+ * Evaluates and returns correct class for drawing a shape.+ *+ * @method _getShapeClass+ * @return Shape+ * @private+ */+ _getShapeClass: function()+ { + _yuitest_coverfunc("build/charts-legend/charts-legend.js", "_getShapeClass", 1284);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1286);+var graphic = this.get("background").get("graphic");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1287);+return graphic._getShapeClass.apply(graphic, arguments);+ },+ + /**+ * Returns the default hash for the `styles` attribute.+ *+ * @method _getDefaultStyles+ * @return Object+ * @protected+ */+ _getDefaultStyles: function()+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "_getDefaultStyles", 1297);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1299);+var styles = { + padding: {+ top: 8,+ right: 8,+ bottom: 8,+ left: 9+ },+ gap: 10,+ hAlign: "center",+ vAlign: "top",+ marker: this._getPlotDefaults(),+ item: {+ hSpacing: 10,+ vSpacing: 5,+ label: {+ color:"#808080",+ fontSize:"85%",+ whiteSpace: "nowrap"+ }+ },+ background: {+ shape: "rect",+ fill:{+ color:"#faf9f2"+ },+ border: {+ color:"#dad8c9",+ weight: 1+ }+ }+ };+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1330);+return styles;+ },++ /**+ * Gets the default values for series that use the utility. This method is used by+ * the class' `styles` attribute's getter to get build default values.+ *+ * @method _getPlotDefaults+ * @return Object+ * @protected+ */+ _getPlotDefaults: function()+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "_getPlotDefaults", 1341);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1343);+var defs = {+ width: 10,+ height: 10+ };+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1347);+return defs;+ },++ /**+ * Destroys legend items.+ *+ * @method _destroyLegendItems+ * @private+ */+ _destroyLegendItems: function()+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "_destroyLegendItems", 1356);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1358);+var item;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1359);+if(this._items)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1361);+while(this._items.length > 0)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1363);+item = this._items.shift();+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1364);+item.shape.get("graphic").destroy();+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1365);+item.node.empty();+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1366);+item.node.destroy(true);+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1367);+item.node = null;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1368);+item = null;+ }+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1371);+this._items = [];+ },++ /**+ * Maps layout classes.+ *+ * @property _layout+ * @private+ */+ _layout: {+ vertical: VerticalLegendLayout,+ horizontal: HorizontalLegendLayout+ },++ /**+ * Destructor implementation ChartLegend class. Removes all items and the Graphic instance from the widget.+ *+ * @method destructor+ * @protected+ */+ destructor: function()+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "destructor", 1391);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1393);+var background = this.get("background"),+ backgroundGraphic;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1395);+this._destroyLegendItems();+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1396);+if(background)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1398);+backgroundGraphic = background.get("graphic");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1399);+if(backgroundGraphic)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1401);+backgroundGraphic.destroy();+ }+ else+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1405);+background.destroy();+ }+ }++ }+}, {+ ATTRS: {+ /**+ * Indicates whether the chart's contentBox is the parentNode for the legend.+ *+ * @attribute includeInChartLayout+ * @type Boolean+ * @private+ */+ includeInChartLayout: {+ value: false+ },++ /**+ * Reference to the `Chart` instance.+ *+ * @attribute chart+ * @type Chart+ */+ chart: {+ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "setter", 1430);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1432);+this.after("legendRendered", Y.bind(val._itemRendered, val));+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1433);+return val;+ }+ },++ /**+ * Indicates the direction in relation of the legend's layout. The `direction` of the legend is determined by its+ * `position` value.+ *+ * @attribute direction+ * @type String+ */+ direction: {+ value: "vertical"+ },+ + /**+ * Indicates the position and direction of the legend. Possible values are `left`, `top`, `right` and `bottom`. Values of `left` and+ * `right` values have a `direction` of `vertical`. Values of `top` and `bottom` values have a `direction` of `horizontal`.+ *+ * @attribute position+ * @type String+ */+ position: {+ lazyAdd: false,++ value: "right",++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "setter", 1460);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1462);+if(val == TOP || val == BOTTOM)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1464);+this.set("direction", HORIZONTAL);+ }+ else {_yuitest_coverline("build/charts-legend/charts-legend.js", 1466);+if(val == LEFT || val == RIGHT)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1468);+this.set("direction", VERTICAL);+ }}+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1470);+return val;+ }+ },+ + /**+ * The width of the legend. Depending on the implementation of the ChartLegend, this value is `readOnly`. By default, the legend is included in the layout of the `Chart` that + * it references. Under this circumstance, `width` is always `readOnly`. When the legend is rendered in its own dom element, the `readOnly` status is determined by the + * direction of the legend. If the `position` is `left` or `right` or the `direction` is `vertical`, width is `readOnly`. If the position is `top` or `bottom` or the `direction`+ * is `horizontal`, width can be explicitly set. If width is not explicitly set, the width will be determined by the width of the legend's parent element.+ *+ * @attribute width+ * @type Number+ */+ width: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "getter", 1484);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1486);+var chart = this.get("chart"),+ parentNode = this._parentNode;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1488);+if(parentNode)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1490);+if((chart && this.get("includeInChartLayout")) || this._width)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1492);+if(!this._width)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1494);+this._width = 0;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1496);+return this._width;+ }+ else+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1500);+return parentNode.get("offsetWidth");+ }+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1503);+return "";+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "setter", 1506);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1508);+this._width = val;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1509);+return val;+ }+ },++ /**+ * The height of the legend. Depending on the implementation of the ChartLegend, this value is `readOnly`. By default, the legend is included in the layout of the `Chart` that + * it references. Under this circumstance, `height` is always `readOnly`. When the legend is rendered in its own dom element, the `readOnly` status is determined by the + * direction of the legend. If the `position` is `top` or `bottom` or the `direction` is `horizontal`, height is `readOnly`. If the position is `left` or `right` or the `direction`+ * is `vertical`, height can be explicitly set. If height is not explicitly set, the height will be determined by the width of the legend's parent element.+ *+ * @attribute height + * @type Number+ */+ height: {+ valueFn: "_heightGetter",++ getter: function()+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "getter", 1525);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1527);+var chart = this.get("chart"),+ parentNode = this._parentNode;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1529);+if(parentNode) + {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1531);+if((chart && this.get("includeInChartLayout")) || this._height)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1533);+if(!this._height)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1535);+this._height = 0;+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1537);+return this._height;+ }+ else+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1541);+return parentNode.get("offsetHeight");+ }+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1544);+return "";+ },++ setter: function(val)+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "setter", 1547);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1549);+this._height = val;+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1550);+return val;+ }+ },++ /**+ * Indicates the x position of legend.+ *+ * @attribute x+ * @type Number+ * @readOnly+ */+ x: {+ lazyAdd: false,++ value: 0,+ + setter: function(val)+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "setter", 1566);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1568);+var node = this.get("boundingBox");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1569);+if(node)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1571);+node.setStyle(LEFT, val + PX);+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1573);+return val;+ }+ },++ /**+ * Indicates the y position of legend.+ *+ * @attribute y+ * @type Number+ * @readOnly+ */+ y: {+ lazyAdd: false,++ value: 0,+ + setter: function(val)+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "setter", 1589);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1591);+var node = this.get("boundingBox");+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1592);+if(node)+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1594);+node.setStyle(TOP, val + PX);+ }+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1596);+return val;+ }+ },++ /**+ * Array of items contained in the legend. Each item is an object containing the following properties:+ *+ * <dl>+ * <dt>node</dt><dd>Node containing text for the legend item.</dd>+ * <dt>marker</dt><dd>Shape for the legend item.</dd>+ * </dl>+ *+ * @attribute items+ * @type Array+ * @readOnly+ */+ items: {+ getter: function()+ {+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "getter", 1613);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1615);+return this._items;+ }+ },++ /**+ * Background for the legend.+ *+ * @attribute background+ * @type Rect+ */+ background: {}++ /**+ * Properties used to display and style the ChartLegend. This attribute is inherited from `Renderer`. Below are the default values:+ *+ * <dl>+ * <dt>gap</dt><dd>Distance, in pixels, between the `ChartLegend` instance and the chart's content. When `ChartLegend` is rendered within a `Chart` instance this value is applied.</dd>+ * <dt>hAlign</dt><dd>Defines the horizontal alignment of the `items` in a `ChartLegend` rendered in a horizontal direction. This value is applied when the instance's `position` is set to top or bottom. This attribute can be set to left, center or right. The default value is center.</dd>+ * <dt>vAlign</dt><dd>Defines the vertical alignment of the `items` in a `ChartLegend` rendered in vertical direction. This value is applied when the instance's `position` is set to left or right. The attribute can be set to top, middle or bottom. The default value is middle.</dd>+ * <dt>item</dt><dd>Set of style properties applied to the `items` of the `ChartLegend`.+ * <dl>+ * <dt>hSpacing</dt><dd>Horizontal distance, in pixels, between legend `items`.</dd>+ * <dt>vSpacing</dt><dd>Vertical distance, in pixels, between legend `items`.</dd>+ * <dt>label</dt><dd>Properties for the text of an `item`.+ * <dl>+ * <dt>color</dt><dd>Color of the text. The default values is "#808080".</dd>+ * <dt>fontSize</dt><dd>Font size for the text. The default value is "85%".</dd>+ * </dl>+ * </dd>+ * <dt>marker</dt><dd>Properties for the `item` markers.+ * <dl>+ * <dt>width</dt><dd>Specifies the width of the markers.</dd>+ * <dt>height</dt><dd>Specifies the height of the markers.</dd>+ * </dl>+ * </dd>+ * </dl>+ * </dd>+ * <dt>background</dt><dd>Properties for the `ChartLegend` background.+ * <dl>+ * <dt>fill</dt><dd>Properties for the background fill.+ * <dl>+ * <dt>color</dt><dd>Color for the fill. The default value is "#faf9f2".</dd>+ * </dl>+ * </dd>+ * <dt>border</dt><dd>Properties for the background border.+ * <dl>+ * <dt>color</dt><dd>Color for the border. The default value is "#dad8c9".</dd>+ * <dt>weight</dt><dd>Weight of the border. The default values is 1.</dd>+ * </dl>+ * </dd>+ * </dl>+ * </dd>+ * </dl>+ *+ * @attribute styles+ * @type Object+ */+ }+});+/**+ * The Chart class is the basic application used to create a chart.+ *+ * @module charts+ * @class Chart+ * @constructor+ */+_yuitest_coverline("build/charts-legend/charts-legend.js", 1681);+function Chart(cfg)+{+ _yuitest_coverfunc("build/charts-legend/charts-legend.js", "Chart", 1681);+_yuitest_coverline("build/charts-legend/charts-legend.js", 1683);+if(cfg.type != "pie")+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1685);+return new Y.CartesianChart(cfg);+ }+ else+ {+ _yuitest_coverline("build/charts-legend/charts-legend.js", 1689);+return new Y.PieChart(cfg);+ }+}+_yuitest_coverline("build/charts-legend/charts-legend.js", 1692);+Y.Chart = Chart;+++}, '3.7.1', {"requires": ["charts-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('charts-legend', function(Y) {+YUI.add('charts-legend', function (Y, NAME) { /** * Adds legend functionality to charts.@@ -921,7 +921,7 @@ */ bindUI: function() {- this.get("chart").after("seriesCollectionChange", this._updateHandler);+ this.get("chart").after("seriesCollectionChange", Y.bind(this._updateHandler, this)); this.after("stylesChange", this._updateHandler); this.after("positionChange", this._positionChangeHandler); this.after("widthChange", this._handleSizeChange);@@ -961,7 +961,7 @@ * Handles position changes. * * @method _positionChangeHandler- * @parma {Object} e Event object+ * @param {Object} e Event object * @private */ _positionChangeHandler: function(e)@@ -1117,7 +1117,6 @@ items.push(item); } }- this.set("items", items); this._drawing = false; if(this._callLater) {@@ -1167,30 +1166,33 @@ */ _getStylesBySeriesType: function(series) {- var styles = series.get("styles");+ var styles = series.get("styles"),+ color; if(series instanceof Y.LineSeries || series instanceof Y.StackedLineSeries) { styles = series.get("styles").line;+ color = styles.color || series._getDefaultColor(series.get("graphOrder"), "line"); return { border: { weight: 1,- color: styles.color+ color: color }, fill: {- color: styles.color+ color: color } }; } else if(series instanceof Y.AreaSeries || series instanceof Y.StackedAreaSeries) {- series = series.get("styles").fill;+ styles = series.get("styles").area;+ color = styles.color || series._getDefaultColor(series.get("graphOrder"), "slice"); return { border: { weight: 1,- color: styles.color+ color: color }, fill: {- color: styles.color+ color: color } }; }@@ -1316,7 +1318,8 @@ vSpacing: 5, label: { color:"#808080",- fontSize:"85%"+ fontSize:"85%",+ whiteSpace: "nowrap" } }, background: {@@ -1366,7 +1369,8 @@ item = this._items.shift(); item.shape.get("graphic").destroy(); item.node.empty();- item.node.remove(true);+ item.node.destroy(true);+ item.node = null; item = null; } }@@ -1392,12 +1396,22 @@ */ destructor: function() {- var graphic = this.get("graphic");+ var background = this.get("background"),+ backgroundGraphic; this._destroyLegendItems();- if(graphic)+ if(background) {- graphic.destroy();+ backgroundGraphic = background.get("graphic");+ if(backgroundGraphic)+ {+ backgroundGraphic.destroy();+ }+ else+ {+ background.destroy();+ } }+ } }, { ATTRS: {@@ -1590,6 +1604,25 @@ }, /**+ * Array of items contained in the legend. Each item is an object containing the following properties:+ *+ * <dl>+ * <dt>node</dt><dd>Node containing text for the legend item.</dd>+ * <dt>marker</dt><dd>Shape for the legend item.</dd>+ * </dl>+ *+ * @attribute items+ * @type Array+ * @readOnly+ */+ items: {+ getter: function()+ {+ return this._items;+ }+ },++ /** * Background for the legend. * * @attribute background@@ -1665,4 +1698,4 @@ Y.Chart = Chart; -}, '3.5.1' ,{requires:['charts-base']});+}, '3.7.1', {"requires": ["charts-base"]});
@@ -1,9 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("charts-legend",function(a){var c=a.config.doc,p="top",h="right",f="bottom",j="left",s="external",u="horizontal",q="vertical",b="width",n="height",m="position",i="x",g="y",e="px",l={setter:function(w){var v=this.get("legend");if(v){v.destroy(true);}if(w instanceof a.ChartLegend){v=w;v.set("chart",this);}else{w.chart=this;if(!w.hasOwnProperty("render")){w.render=this.get("contentBox");w.includeInChartLayout=true;}v=new a.ChartLegend(w);}return v;}},t={_positionLegendItems:function(K,T,N,w,X,H,E,A,Q,G){var R=0,L=0,V,O,y,P,S,M=this.get("width"),F,D,z,C,J,v=H.top-A,U=M-(H.left+H.right),x,I,W,B;t._setRowArrays(K,U,E);F=t.rowArray;C=t.totalWidthArray;D=F.length;for(;L<D;++L){v+=A;z=F[L];S=z.length;J=t.getStartPoint(M,C[L],Q,H);for(R=0;R<S;++R){V=z[R];O=V.node;y=V.width;P=V.height;V.x=J;V.y=0;x=!isNaN(x)?Math.min(x,J):J;I=!isNaN(I)?Math.min(I,v):v;W=!isNaN(W)?Math.max(J+y,W):J+y;B=!isNaN(B)?Math.max(v+P,B):v+P;O.setStyle("left",J+e);O.setStyle("top",v+e);J+=y+E;}v+=V.height;}this._contentRect={left:x,top:I,right:W,bottom:B};if(this.get("includeInChartLayout")){this.set("height",v+H.bottom);}},_setRowArrays:function(B,v,D){var F=B[0],C=[[F]],x=1,w=0,z=B.length,y=F.width,A,E=[[y]];for(;x<z;++x){F=B[x];A=F.width;if((y+D+A)<=v){y+=D+A;C[w].push(F);}else{y=D+A;if(C[w]){w+=1;}C[w]=[F];}E[w]=y;}t.rowArray=C;t.totalWidthArray=E;},getStartPoint:function(x,v,A,z){var y;switch(A){case j:y=z.left;break;case"center":y=(x-v)*0.5;break;case h:y=x-v-z.right;break;}return y;}},o={_positionLegendItems:function(M,T,N,x,X,I,E,C,Q,G){var R=0,F=0,V,O,P,B,S,L=this.get("height"),v,y,w,H,A,Y=I.left-E,K,U=L-(I.top+I.bottom),z,J,W,D;o._setColumnArrays(M,U,C);v=o.columnArray;H=o.totalHeightArray;y=v.length;for(;F<y;++F){Y+=E;w=v[F];S=w.length;A=o.getStartPoint(L,H[F],G,I);K=0;for(R=0;R<S;++R){V=w[R];O=V.node;P=V.height;B=V.width;V.y=A;V.x=Y;z=!isNaN(z)?Math.min(z,Y):Y;J=!isNaN(J)?Math.min(J,A):A;W=!isNaN(W)?Math.max(Y+B,W):Y+B;D=!isNaN(D)?Math.max(A+P,D):A+P;O.setStyle("left",Y+e);O.setStyle("top",A+e);A+=P+C;K=Math.max(K,V.width);}Y+=K;}this._contentRect={left:z,top:J,right:W,bottom:D};if(this.get("includeInChartLayout")){this.set("width",Y+I.right);}},_setColumnArrays:function(C,x,z){var F=C[0],D=[[F]],y=1,v=0,A=C.length,B=F.height,w,E=[[B]];for(;y<A;++y){F=C[y];w=F.height;if((B+z+w)<=x){B+=z+w;D[v].push(F);}else{B=z+w;if(D[v]){v+=1;}D[v]=[F];}E[v]=B;}o.columnArray=D;o.totalHeightArray=E;},getStartPoint:function(w,v,z,y){var x;switch(z){case p:x=y.top;break;case"middle":x=(w-v)*0.5;break;case f:x=w-v-y.bottom;break;}return x;}},d=a.Base.create("cartesianChartLegend",a.CartesianChart,[],{_redraw:function(){if(this._drawing){this._callLater=true;return;}this._drawing=true;this._callLater=false;var L=this.get("width"),V=this.get("height"),D=this._getLayoutBoxDimensions(),T=D.left,C=D.right,Z=D.top,x=D.bottom,v=this.get("leftAxesCollection"),J=this.get("rightAxesCollection"),K=this.get("topAxesCollection"),Y=this.get("bottomAxesCollection"),U=0,R,E,A="visible",B=this.get("graph"),G,M,S,Q,H,I,X,W,P=this.get("allowContentOverflow"),N,y,ab,O,F,z=this.get("legend"),aa={};if(v){ab=[];R=v.length;for(U=R-1;U>-1;--U){ab.unshift(T);T+=v[U].get("width");}}if(J){y=[];R=J.length;U=0;for(U=R-1;U>-1;--U){C+=J[U].get("width");y.unshift(L-C);}}if(K){O=[];R=K.length;for(U=R-1;U>-1;--U){O.unshift(Z);Z+=K[U].get("height");}}if(Y){F=[];R=Y.length;for(U=R-1;U>-1;--U){x+=Y[U].get("height");F.unshift(V-x);}}H=L-(T+C);I=V-(x+Z);aa.left=T;aa.top=Z;aa.bottom=V-x;aa.right=L-C;if(!P){G=this._getTopOverflow(v,J);M=this._getBottomOverflow(v,J);S=this._getLeftOverflow(Y,K);Q=this._getRightOverflow(Y,K);N=G-Z;if(N>0){aa.top=G;if(O){U=0;R=O.length;for(;U<R;++U){O[U]+=N;}}}N=M-x;if(N>0){aa.bottom=V-M;if(F){U=0;R=F.length;for(;U<R;++U){F[U]-=N;}}}N=S-T;if(N>0){aa.left=S;if(ab){U=0;R=ab.length;for(;U<R;++U){ab[U]+=N;}}}N=Q-C;if(N>0){aa.right=L-Q;if(y){U=0;R=y.length;for(;U<R;++U){y[U]-=N;}}}}H=aa.right-aa.left;I=aa.bottom-aa.top;X=aa.left;W=aa.top;if(z){if(z.get("includeInChartLayout")){switch(z.get("position")){case"left":z.set("y",W);z.set("height",I);break;case"top":z.set("x",X);z.set("width",H);break;case"bottom":z.set("x",X);z.set("width",H);break;case"right":z.set("y",W);z.set("height",I);break;}}}if(K){R=K.length;U=0;for(;U<R;U++){E=K[U];if(E.get("width")!==H){E.set("width",H);}E.get("boundingBox").setStyle("left",X+e);E.get("boundingBox").setStyle("top",O[U]+e);}if(E._hasDataOverflow()){A="hidden";}}if(Y){R=Y.length;U=0;for(;U<R;U++){E=Y[U];if(E.get("width")!==H){E.set("width",H);}E.get("boundingBox").setStyle("left",X+e);E.get("boundingBox").setStyle("top",F[U]+e);}if(E._hasDataOverflow()){A="hidden";}}if(v){R=v.length;U=0;for(;U<R;++U){E=v[U];E.get("boundingBox").setStyle("top",W+e);E.get("boundingBox").setStyle("left",ab[U]+e);if(E.get("height")!==I){E.set("height",I);}}if(E._hasDataOverflow()){A="hidden";}}if(J){R=J.length;U=0;for(;U<R;++U){E=J[U];E.get("boundingBox").setStyle("top",W+e);E.get("boundingBox").setStyle("left",y[U]+e);if(E.get("height")!==I){E.set("height",I);}}if(E._hasDataOverflow()){A="hidden";}}this._drawing=false;if(this._callLater){this._redraw();return;}if(B){B.get("boundingBox").setStyle("left",X+e);B.get("boundingBox").setStyle("top",W+e);B.set("width",H);B.set("height",I);B.get("boundingBox").setStyle("overflow",A);}if(this._overlay){this._overlay.setStyle("left",X+e);this._overlay.setStyle("top",W+e);this._overlay.setStyle("width",H+e);this._overlay.setStyle("height",I+e);}},_getLayoutBoxDimensions:function(){var x={top:0,right:0,bottom:0,left:0},C=this.get("legend"),z,B,v,E,D=this.get(b),y=this.get(n),A;if(C&&C.get("includeInChartLayout")){A=C.get("styles").gap;z=C.get(m);if(z!=s){B=C.get("direction");v=B==u?n:b;E=C.get(v);x[z]=E+A;switch(z){case p:C.set(g,0);break;case f:C.set(g,y-E);break;case h:C.set(i,D-E);break;case j:C.set(i,0);break;}}}return x;},destructor:function(){var v=this.get("legend");if(v){v.destroy(true);}}},{ATTRS:{legend:l}});a.CartesianChart=d;var k=a.Base.create("pieChartLegend",a.PieChart,[],{_redraw:function(){if(this._drawing){this._callLater=true;-return;}this._drawing=true;this._callLater=false;var N=this.get("graph"),K=this.get("width"),B=this.get("height"),M,v,J=this.get("legend"),H=0,E=0,D=0,C=0,L,I,z,G,A,F;if(N){if(J){A=J.get("position");F=J.get("direction");M=N.get("width");v=N.get("height");L=J.get("width");I=J.get("height");G=J.get("styles").gap;if((F=="vertical"&&(M+L+G!==K))||(F=="horizontal"&&(v+I+G!==B))){switch(J.get("position")){case j:z=Math.min(K-(L+G),B);I=B;H=L+G;J.set(n,I);break;case p:z=Math.min(B-(I+G),K);L=K;E=I+G;J.set(b,L);break;case h:z=Math.min(K-(L+G),B);I=B;D=z+G;J.set(n,I);break;case f:z=Math.min(B-(I+G),K);L=K;C=z+G;J.set(b,L);break;}N.set(b,z);N.set(n,z);}else{switch(J.get("position")){case j:H=L+G;break;case p:E=I+G;break;case h:D=M+G;break;case f:C=v+G;break;}}}else{N.set(i,0);N.set(g,0);N.set(b,K);N.set(n,B);}}this._drawing=false;if(this._callLater){this._redraw();return;}if(N){N.set(i,H);N.set(g,E);}if(J){J.set(i,D);J.set(g,C);}}},{ATTRS:{legend:l}});a.PieChart=k;a.ChartLegend=a.Base.create("chartlegend",a.Widget,[a.Renderer],{initializer:function(){this._items=[];},renderUI:function(){var y=this.get("boundingBox"),v=this.get("contentBox"),x=this.get("styles").background,w=new a.Rect({graphic:v,fill:x.fill,stroke:x.border});y.setStyle("display","block");y.setStyle("position","absolute");this.set("background",w);},bindUI:function(){this.get("chart").after("seriesCollectionChange",this._updateHandler);this.after("stylesChange",this._updateHandler);this.after("positionChange",this._positionChangeHandler);this.after("widthChange",this._handleSizeChange);this.after("heightChange",this._handleSizeChange);},syncUI:function(){var v=this.get("width"),x=this.get("height");if(isFinite(v)&&isFinite(x)&&v>0&&x>0){this._drawLegend();}},_updateHandler:function(v){if(this.get("rendered")){this._drawLegend();}},_positionChangeHandler:function(x){var w=this.get("chart"),v=this._parentNode;if(v&&((w&&this.get("includeInChartLayout")))){this.fire("legendRendered");}else{if(this.get("rendered")){this._drawLegend();}}},_handleSizeChange:function(x){var w=x.attrName,z=this.get(m),v=z==j||z==h,y=z==f||z==p;if((y&&w==b)||(v&&w==n)){this._drawLegend();}},_drawLegend:function(){if(this._drawing){this._callLater=true;return;}this._drawing=true;this._callLater=false;if(this.get("includeInChartLayout")){this.get("chart")._itemRenderQueue.unshift(this);}var ad=this.get("chart"),V=this.get("contentBox"),W=ad.get("seriesCollection"),A,S=this.get("styles"),Z=S.padding,L=S.item,X,z=L.hSpacing,B=L.vSpacing,F=S.hAlign,O=S.vAlign,ae=S.marker,H=L.label,T,U=this._layout[this.get("direction")],aa,I,N,J,D,R,G,E,ab,w,v,K=[],Q=ae.width,x=ae.height,C=0-z,P=0-B,M=0,Y=0,y,ac;if(ae&&ae.shape){J=ae.shape;}this._destroyLegendItems();if(ad instanceof a.PieChart){A=W[0];T=A.get("categoryAxis").getDataByKey(A.get("categoryKey"));X=A.get("styles").marker;ab=X.fill.colors;w=X.border.colors;v=X.border.weight;aa=0;I=T.length;J=J||a.Circle;N=a.Lang.isArray(J);for(;aa<I;++aa){J=N?J[aa]:J;G={color:ab[aa]};E={colors:w[aa],weight:v};T=ad.getSeriesItems(A,aa).category.value;R=this._getLegendItem(V,this._getShapeClass(J),G,E,H,Q,x,T);y=R.width;ac=R.height;M=Math.max(M,y);Y=Math.max(Y,ac);C+=y+z;P+=ac+B;K.push(R);}}else{aa=0;I=W.length;for(;aa<I;++aa){A=W[aa];X=this._getStylesBySeriesType(A,J);if(!J){J=X.shape;if(!J){J=a.Circle;}}D=a.Lang.isArray(J)?J[aa]:J;R=this._getLegendItem(V,this._getShapeClass(J),X.fill,X.border,H,Q,x,A.get("valueDisplayName"));y=R.width;ac=R.height;M=Math.max(M,y);Y=Math.max(Y,ac);C+=y+z;P+=ac+B;K.push(R);}}this.set("items",K);this._drawing=false;if(this._callLater){this._drawLegend();}else{U._positionLegendItems.apply(this,[K,M,Y,C,P,Z,z,B,F,O]);this._updateBackground(S);this.fire("legendRendered");}},_updateBackground:function(C){var D=C.background,z=this._contentRect,E=C.padding,v=z.left-E.left,F=z.top-E.top,A=z.right-v+E.right,B=z.bottom-F+E.bottom;this.get("background").set({fill:D.fill,stroke:D.border,width:A,height:B,x:v,y:F});},_getStylesBySeriesType:function(v){var w=v.get("styles");if(v instanceof a.LineSeries||v instanceof a.StackedLineSeries){w=v.get("styles").line;return{border:{weight:1,color:w.color},fill:{color:w.color}};}else{if(v instanceof a.AreaSeries||v instanceof a.StackedAreaSeries){v=v.get("styles").fill;return{border:{weight:1,color:w.color},fill:{color:w.color}};}else{w=v.get("styles").marker;return{fill:w.fill,border:{weight:w.border.weight,color:w.border.color,shape:w.shape},shape:w.shape};}}},_getLegendItem:function(x,E,K,A,F,H,C,I){var z=a.one(c.createElement("div")),y=a.one(c.createElement("span")),D,B,G,v,J;z.setStyle(m,"absolute");y.setStyle(m,"absolute");y.setStyles(F);y.appendChild(c.createTextNode(I));z.appendChild(y);x.appendChild(z);B=y.get("offsetHeight");G=B-C;v=H+G+2;y.setStyle("left",v+e);z.setStyle("height",B+e);z.setStyle("width",(v+y.get("offsetWidth"))+e);D=new E({fill:K,stroke:A,width:H,height:C,x:G*0.5,y:G*0.5,w:H,h:C,graphic:z});y.setStyle("left",B+e);J={node:z,width:z.get("offsetWidth"),height:z.get("offsetHeight"),shape:D,textNode:y,text:I};this._items.push(J);return J;},_getShapeClass:function(){var v=this.get("background").get("graphic");return v._getShapeClass.apply(v,arguments);},_getDefaultStyles:function(){var v={padding:{top:8,right:8,bottom:8,left:9},gap:10,hAlign:"center",vAlign:"top",marker:this._getPlotDefaults(),item:{hSpacing:10,vSpacing:5,label:{color:"#808080",fontSize:"85%"}},background:{shape:"rect",fill:{color:"#faf9f2"},border:{color:"#dad8c9",weight:1}}};return v;},_getPlotDefaults:function(){var v={width:10,height:10};return v;},_destroyLegendItems:function(){var v;if(this._items){while(this._items.length>0){v=this._items.shift();v.shape.get("graphic").destroy();v.node.empty();v.node.remove(true);v=null;}}this._items=[];},_layout:{vertical:o,horizontal:t},destructor:function(){var v=this.get("graphic");this._destroyLegendItems();if(v){v.destroy();}}},{ATTRS:{includeInChartLayout:{value:false},chart:{setter:function(v){this.after("legendRendered",a.bind(v._itemRendered,v));-return v;}},direction:{value:"vertical"},position:{lazyAdd:false,value:"right",setter:function(v){if(v==p||v==f){this.set("direction",u);}else{if(v==j||v==h){this.set("direction",q);}}return v;}},width:{getter:function(){var w=this.get("chart"),v=this._parentNode;if(v){if((w&&this.get("includeInChartLayout"))||this._width){if(!this._width){this._width=0;}return this._width;}else{return v.get("offsetWidth");}}return"";},setter:function(v){this._width=v;return v;}},height:{valueFn:"_heightGetter",getter:function(){var w=this.get("chart"),v=this._parentNode;if(v){if((w&&this.get("includeInChartLayout"))||this._height){if(!this._height){this._height=0;}return this._height;}else{return v.get("offsetHeight");}}return"";},setter:function(v){this._height=v;return v;}},x:{lazyAdd:false,value:0,setter:function(w){var v=this.get("boundingBox");if(v){v.setStyle(j,w+e);}return w;}},y:{lazyAdd:false,value:0,setter:function(w){var v=this.get("boundingBox");if(v){v.setStyle(p,w+e);}return w;}},background:{}}});function r(v){if(v.type!="pie"){return new a.CartesianChart(v);}else{return new a.PieChart(v);}}a.Chart=r;},"3.5.1",{requires:["charts-base"]});+YUI.add("charts-legend",function(e,t){function E(t){return t.type!="pie"?new e.CartesianChart(t):new e.PieChart(t)}var n=e.config.doc,r="top",i="right",s="bottom",o="left",u="external",a="horizontal",f="vertical",l="width",c="height",h="position",p="x",d="y",v="px",m={setter:function(t){var n=this.get("legend");return n&&n.destroy(!0),t instanceof e.ChartLegend?(n=t,n.set("chart",this)):(t.chart=this,t.hasOwnProperty("render")||(t.render=this.get("contentBox"),t.includeInChartLayout=!0),n=new e.ChartLegend(t)),n}},g={_positionLegendItems:function(e,t,n,r,i,s,o,u,a,f){var l=0,c=0,h,p,d,m,y,b=this.get("width"),w,E,S,x,T,N=s.top-u,C=b-(s.left+s.right),k,L,A,O;g._setRowArrays(e,C,o),w=g.rowArray,x=g.totalWidthArray,E=w.length;for(;c<E;++c){N+=u,S=w[c],y=S.length,T=g.getStartPoint(b,x[c],a,s);for(l=0;l<y;++l)h=S[l],p=h.node,d=h.width,m=h.height,h.x=T,h.y=0,k=isNaN(k)?T:Math.min(k,T),L=isNaN(L)?N:Math.min(L,N),A=isNaN(A)?T+d:Math.max(T+d,A),O=isNaN(O)?N+m:Math.max(N+m,O),p.setStyle("left",T+v),p.setStyle("top",N+v),T+=d+o;N+=h.height}this._contentRect={left:k,top:L,right:A,bottom:O},this.get("includeInChartLayout")&&this.set("height",N+s.bottom)},_setRowArrays:function(e,t,n){var r=e[0],i=[[r]],s=1,o=0,u=e.length,a=r.width,f,l=[[a]];for(;s<u;++s)r=e[s],f=r.width,a+n+f<=t?(a+=n+f,i[o].push(r)):(a=n+f,i[o]&&(o+=1),i[o]=[r]),l[o]=a;g.rowArray=i,g.totalWidthArray=l},getStartPoint:function(e,t,n,r){var s;switch(n){case o:s=r.left;break;case"center":s=(e-t)*.5;break;case i:s=e-t-r.right}return s}},y={_positionLegendItems:function(e,t,n,r,i,s,o,u,a,f){var l=0,c=0,h,p,d,m,g,b=this.get("height"),w,E,S,x,T,N=s.left-o,C,k=b-(s.top+s.bottom),L,A,O,M;y._setColumnArrays(e,k,u),w=y.columnArray,x=y.totalHeightArray,E=w.length;for(;c<E;++c){N+=o,S=w[c],g=S.length,T=y.getStartPoint(b,x[c],f,s),C=0;for(l=0;l<g;++l)h=S[l],p=h.node,d=h.height,m=h.width,h.y=T,h.x=N,L=isNaN(L)?N:Math.min(L,N),A=isNaN(A)?T:Math.min(A,T),O=isNaN(O)?N+m:Math.max(N+m,O),M=isNaN(M)?T+d:Math.max(T+d,M),p.setStyle("left",N+v),p.setStyle("top",T+v),T+=d+u,C=Math.max(C,h.width);N+=C}this._contentRect={left:L,top:A,right:O,bottom:M},this.get("includeInChartLayout")&&this.set("width",N+s.right)},_setColumnArrays:function(e,t,n){var r=e[0],i=[[r]],s=1,o=0,u=e.length,a=r.height,f,l=[[a]];for(;s<u;++s)r=e[s],f=r.height,a+n+f<=t?(a+=n+f,i[o].push(r)):(a=n+f,i[o]&&(o+=1),i[o]=[r]),l[o]=a;y.columnArray=i,y.totalHeightArray=l},getStartPoint:function(e,t,n,i){var o;switch(n){case r:o=i.top;break;case"middle":o=(e-t)*.5;break;case s:o=e-t-i.bottom}return o}},b=e.Base.create("cartesianChartLegend",e.CartesianChart,[],{_redraw:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1;var e=this.get("width"),t=this.get("height"),n=this._getLayoutBoxDimensions(),r=n.left,i=n.right,s=n.top,o=n.bottom,u=this.get("leftAxesCollection"),a=this.get("rightAxesCollection"),f=this.get("topAxesCollection"),l=this.get("bottomAxesCollection"),c=0,h,p,d="visible",m=this.get("graph"),g,y,b,w,E,S,x,T,N=this.get("allowContentOverflow"),C,k,L,A,O,M=this.get("legend"),_={};if(u){L=[],h=u.length;for(c=h-1;c>-1;--c)L.unshift(r),r+=u[c].get("width")}if(a){k=[],h=a.length,c=0;for(c=h-1;c>-1;--c)i+=a[c].get("width"),k.unshift(e-i)}if(f){A=[],h=f.length;for(c=h-1;c>-1;--c)A.unshift(s),s+=f[c].get("height")}if(l){O=[],h=l.length;for(c=h-1;c>-1;--c)o+=l[c].get("height"),O.unshift(t-o)}E=e-(r+i),S=t-(o+s),_.left=r,_.top=s,_.bottom=t-o,_.right=e-i;if(!N){g=this._getTopOverflow(u,a),y=this._getBottomOverflow(u,a),b=this._getLeftOverflow(l,f),w=this._getRightOverflow(l,f),C=g-s;if(C>0){_.top=g;if(A){c=0,h=A.length;for(;c<h;++c)A[c]+=C}}C=y-o;if(C>0){_.bottom=t-y;if(O){c=0,h=O.length;for(;c<h;++c)O[c]-=C}}C=b-r;if(C>0){_.left=b;if(L){c=0,h=L.length;for(;c<h;++c)L[c]+=C}}C=w-i;if(C>0){_.right=e-w;if(k){c=0,h=k.length;for(;c<h;++c)k[c]-=C}}}E=_.right-_.left,S=_.bottom-_.top,x=_.left,T=_.top;if(M&&M.get("includeInChartLayout"))switch(M.get("position")){case"left":M.set("y",T),M.set("height",S);break;case"top":M.set("x",x),M.set("width",E);break;case"bottom":M.set("x",x),M.set("width",E);break;case"right":M.set("y",T),M.set("height",S)}if(f){h=f.length,c=0;for(;c<h;c++)p=f[c],p.get("width")!==E&&p.set("width",E),p.get("boundingBox").setStyle("left",x+v),p.get("boundingBox").setStyle("top",A[c]+v);p._hasDataOverflow()&&(d="hidden")}if(l){h=l.length,c=0;for(;c<h;c++)p=l[c],p.get("width")!==E&&p.set("width",E),p.get("boundingBox").setStyle("left",x+v),p.get("boundingBox").setStyle("top",O[c]+v);p._hasDataOverflow()&&(d="hidden")}if(u){h=u.length,c=0;for(;c<h;++c)p=u[c],p.get("boundingBox").setStyle("top",T+v),p.get("boundingBox").setStyle("left",L[c]+v),p.get("height")!==S&&p.set("height",S);p._hasDataOverflow()&&(d="hidden")}if(a){h=a.length,c=0;for(;c<h;++c)p=a[c],p.get("boundingBox").setStyle("top",T+v),p.get("boundingBox").setStyle("left",k[c]+v),p.get("height")!==S&&p.set("height",S);p._hasDataOverflow()&&(d="hidden")}this._drawing=!1;if(this._callLater){this._redraw();return}m&&(m.get("boundingBox").setStyle("left",x+v),m.get("boundingBox").setStyle("top",T+v),m.set("width",E),m.set("height",S),m.get("boundingBox").setStyle("overflow",d)),this._overlay&&(this._overlay.setStyle("left",x+v),this._overlay.setStyle("top",T+v),this._overlay.setStyle("width",E+v),this._overlay.setStyle("height",S+v))},_getLayoutBoxDimensions:function(){var e={top:0,right:0,bottom:0,left:0},t=this.get("legend"),n,f,v,m,g=this.get(l),y=this.get(c),b;if(t&&t.get("includeInChartLayout")){b=t.get("styles").gap,n=t.get(h);if(n!=u){f=t.get("direction"),v=f==a?c:l,m=t.get(v),e[n]=m+b;switch(n){case r:t.set(d,0);break;case s:t.set(d,y-m);break;case i:t.set(p,g-m);break;case o:t.set(p,0)}}}return e},destructor:function(){var e=this.get("legend");e&&e.destroy(!0)}},{ATTRS:{legend:m}});e.CartesianChart=b;var w=e.Base.create("pieChartLegend",e.PieChart,[],{_redraw:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1;var e=this.get("graph"),t=this.get("width"),n=this.get("height"),u,a,f=this.get("legend"),h=0,v=0,m=0,g=0,y,b,w,E,S,x;if(e)if(f){S=f.get("position"),x=f.get("direction"),u=e.get("width"),a=e.get("height"),y=f.get("width"),b=f.get("height"),E=f.get("styles").gap;if(x=="vertical"&&u+y+E!==t||x=="horizontal"&&a+b+E!==n){switch(f.get("position")){case o:w=Math.min(t-(y+E),n),b=n,h=y+E,f.set(c,b);break;case r:w=Math.min(n-(b+E),t),y=t,v=b+E,f.set(l,y);break;case i:w=Math.min(t-(y+E),n),b=n,m=w+E,f.set(c,b);break;case s:w=Math.min(n-(b+E),t),y=t,g=w+E,f.set(l,y)}e.set(l,w),e.set(c,w)}else switch(f.get("position")){case o:h=y+E;break;case r:v=b+E;break;case i:m=u+E;break;case s:g=a+E}}else e.set(p,0),e.set(d,0),e.set(l,t),e.set(c,n);this._drawing=!1;if(this._callLater){this._redraw();return}e&&(e.set(p,h),e.set(d,v)),f&&(f.set(p,m),f.set(d,g))}},{ATTRS:{legend:m}});e.PieChart=w,e.ChartLegend=e.Base.create("chartlegend",e.Widget,[e.Renderer],{initializer:function(){this._items=[]},renderUI:function(){var t=this.get("boundingBox"),n=this.get("contentBox"),r=this.get("styles").background,i=new e.Rect({graphic:n,fill:r.fill,stroke:r.border});t.setStyle("display","block"),t.setStyle("position","absolute"),this.set("background",i)},bindUI:function(){this.get("chart").after("seriesCollectionChange",e.bind(this._updateHandler,this)),this.after("stylesChange",this._updateHandler),this.after("positionChange",this._positionChangeHandler),this.after("widthChange",this._handleSizeChange),this.after("heightChange",this._handleSizeChange)},syncUI:function(){var e=this.get("width"),t=this.get("height");isFinite(e)&&isFinite(t)&&e>0&&t>0&&this._drawLegend()},_updateHandler:function(e){this.get("rendered")&&this._drawLegend()},_positionChangeHandler:function(e){var t=this.get("chart"),n=this._parentNode;n&&t&&this.get("includeInChartLayout")?this.fire("legendRendered"):this.get("rendered")&&this._drawLegend()},_handleSizeChange:function(e){var t=e.attrName,n=this.get(h),u=n==o||n==i,a=n==s||n==r;(a&&t==l||u&&t==c)&&this._drawLegend()},_drawLegend:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1,this.get("includeInChartLayout")&&this.get("chart")._itemRenderQueue.unshift(this);var t=this.get("chart"),n=this.get("contentBox"),r=t.get("seriesCollection"),i,s=this.get("styles"),o=s.padding,u=s.item,a,f=u.hSpacing,l=u.vSpacing,c=s.hAlign,h=s.vAlign,p=s.marker,d=u.label,v,m=this._layout[this.get("direction")],g,y,b,w,E,S,x,T,N,C,k,L=[],A=p.width,O=p.height,M=0-f,_=0-l,D=0,P=0,H,B;p&&p.shape&&(w=p.shape),this._destroyLegendItems();if(t instanceof e.PieChart){i=r[0],v=i.get("categoryAxis").getDataByKey(i.get("categoryKey")),a=i.get("styles").marker,N=a.fill.colors,C=a.border.colors,k=a.border.weight,g=0,y=v.length,w=w||e.Circle,b=e.Lang.isArray(w);for(;g<y;++g)w=b?w[g]:w,x={color:N[g]},T={colors:C[g],weight:k},v=t.getSeriesItems(i,g).category.value,S=this._getLegendItem(n,this._getShapeClass(w),x,T,d,A,O,v),H=S.width,B=S.height,D=Math.max(D,H),P=Math.max(P,B),M+=H+f,_+=B+l,L.push(S)}else{g=0,y=r.length;for(;g<y;++g)i=r[g],a=this._getStylesBySeriesType(i,w),w||(w=a.shape,w||(w=e.Circle)),E=e.Lang.isArray(w)?w[g]:w,S=this._getLegendItem(n,this._getShapeClass(w),a.fill,a.border,d,A,O,i.get("valueDisplayName")),H=S.width,B=S.height,D=Math.max(D,H),P=Math.max(P,B),M+=H+f,_+=B+l,L.push(S)}this._drawing=!1,this._callLater?this._drawLegend():(m._positionLegendItems.apply(this,[L,D,P,M,_,o,f,l,c,h]),this._updateBackground(s),this.fire("legendRendered"))},_updateBackground:function(e){var t=e.background,n=this._contentRect,r=e.padding,i=n.left-r.left,s=n.top-r.top,o=n.right-i+r.right,u=n.bottom-s+r.bottom;this.get("background").set({fill:t.fill,stroke:t.border,width:o,height:u,x:i,y:s})},_getStylesBySeriesType:function(t){var n=t.get("styles"),r;return t instanceof e.LineSeries||t instanceof e.StackedLineSeries?(n=t.get("styles").line,r=n.color||t._getDefaultColor(t.get("graphOrder"),"line"),{border:{weight:1,color:r},fill:{color:r}}):t instanceof e.AreaSeries||t instanceof e.StackedAreaSeries?(n=t.get("styles").area,r=n.color||t._getDefaultColor(t.get("graphOrder"),"slice"),{border:{weight:1,color:r},fill:{color:r}}):(n=t.get("styles").marker,{fill:n.fill,border:{weight:n.border.weight,color:n.border.color,shape:n.shape},shape:n.shape})},_getLegendItem:function(t,r,i,s,o,u,a,f){var l=e.one(n.createElement("div")),c=e.one(n.createElement("span")),p,d,m,g,y;return l.setStyle(h,"absolute"),c.setStyle(h,"absolute"),c.setStyles(o),c.appendChild(n.createTextNode(f)),l.appendChild(c),t.appendChild(l),d=c.get("offsetHeight"),m=d-a,g=u+m+2,c.setStyle("left",g+v),l.setStyle("height",d+v),l.setStyle("width",g+c.get("offsetWidth")+v),p=new r({fill:i,stroke:s,width:u,height:a,x:m*.5,y:m*.5,w:u,h:a,graphic:l}),c.setStyle("left",d+v),y={node:l,width:l.get("offsetWidth"),height:l.get("offsetHeight"),shape:p,textNode:c,text:f},this._items.push(y),y},_getShapeClass:function(){var e=this.get("background").get("graphic");return e._getShapeClass.apply(e,arguments)},_getDefaultStyles:function(){var e={padding:{top:8,right:8,bottom:8,left:9},gap:10,hAlign:"center",vAlign:"top",marker:this._getPlotDefaults(),item:{hSpacing:10,vSpacing:5,label:{color:"#808080",fontSize:"85%",whiteSpace:"nowrap"}},background:{shape:"rect",fill:{color:"#faf9f2"},border:{color:"#dad8c9",weight:1}}};return e},_getPlotDefaults:function(){var e={width:10,height:10};return e},_destroyLegendItems:function(){var e;if(this._items)while(this._items.length>0)e=this._items.shift(),e.shape.get("graphic").destroy(),e.node.empty(),e.node.destroy(!0),e.node=null,e=null;this._items=[]},_layout:{vertical:y,horizontal:g},destructor:function(){var e=this.get("background"),t;this._destroyLegendItems(),e&&(t=e.get("graphic"),t?t.destroy():e.destroy())}},{ATTRS:{includeInChartLayout:{value:!1},chart:{setter:function(t){return this.after("legendRendered",e.bind(t._itemRendered,t)),t}},direction:{value:"vertical"},position:{lazyAdd:!1,value:"right",setter:function(e){return e==r||e==s?this.set("direction",a):(e==o||e==i)&&this.set("direction",f),e}},width:{getter:function(){var e=this.get("chart"),t=this._parentNode;return t?e&&this.get("includeInChartLayout")||this._width?(this._width||(this._width=0),this._width):t.get("offsetWidth"):""},setter:function(e){return this._width=e,e}},height:{valueFn:"_heightGetter",getter:function(){var e=this.get("chart"),t=this._parentNode;return t?e&&this.get("includeInChartLayout")||this._height?(this._height||(this._height=0),this._height):t.get("offsetHeight"):""},setter:function(e){return this._height=e,e}},x:{lazyAdd:!1,value:0,setter:function(e){var t=this.get("boundingBox");return t&&t.setStyle(o,e+v),e}},y:{lazyAdd:!1,value:0,setter:function(e){var t=this.get("boundingBox");return t&&t.setStyle(r,e+v),e}},items:{getter:function(){return this._items}},background:{}}}),e.Chart=E},"3.7.1",{requires:["charts-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('charts-legend', function(Y) {+YUI.add('charts-legend', function (Y, NAME) { /** * Adds legend functionality to charts.@@ -921,7 +921,7 @@ */ bindUI: function() {- this.get("chart").after("seriesCollectionChange", this._updateHandler);+ this.get("chart").after("seriesCollectionChange", Y.bind(this._updateHandler, this)); this.after("stylesChange", this._updateHandler); this.after("positionChange", this._positionChangeHandler); this.after("widthChange", this._handleSizeChange);@@ -961,7 +961,7 @@ * Handles position changes. * * @method _positionChangeHandler- * @parma {Object} e Event object+ * @param {Object} e Event object * @private */ _positionChangeHandler: function(e)@@ -1117,7 +1117,6 @@ items.push(item); } }- this.set("items", items); this._drawing = false; if(this._callLater) {@@ -1167,30 +1166,33 @@ */ _getStylesBySeriesType: function(series) {- var styles = series.get("styles");+ var styles = series.get("styles"),+ color; if(series instanceof Y.LineSeries || series instanceof Y.StackedLineSeries) { styles = series.get("styles").line;+ color = styles.color || series._getDefaultColor(series.get("graphOrder"), "line"); return { border: { weight: 1,- color: styles.color+ color: color }, fill: {- color: styles.color+ color: color } }; } else if(series instanceof Y.AreaSeries || series instanceof Y.StackedAreaSeries) {- series = series.get("styles").fill;+ styles = series.get("styles").area;+ color = styles.color || series._getDefaultColor(series.get("graphOrder"), "slice"); return { border: { weight: 1,- color: styles.color+ color: color }, fill: {- color: styles.color+ color: color } }; }@@ -1316,7 +1318,8 @@ vSpacing: 5, label: { color:"#808080",- fontSize:"85%"+ fontSize:"85%",+ whiteSpace: "nowrap" } }, background: {@@ -1366,7 +1369,8 @@ item = this._items.shift(); item.shape.get("graphic").destroy(); item.node.empty();- item.node.remove(true);+ item.node.destroy(true);+ item.node = null; item = null; } }@@ -1392,12 +1396,22 @@ */ destructor: function() {- var graphic = this.get("graphic");+ var background = this.get("background"),+ backgroundGraphic; this._destroyLegendItems();- if(graphic)+ if(background) {- graphic.destroy();+ backgroundGraphic = background.get("graphic");+ if(backgroundGraphic)+ {+ backgroundGraphic.destroy();+ }+ else+ {+ background.destroy();+ } }+ } }, { ATTRS: {@@ -1590,6 +1604,25 @@ }, /**+ * Array of items contained in the legend. Each item is an object containing the following properties:+ *+ * <dl>+ * <dt>node</dt><dd>Node containing text for the legend item.</dd>+ * <dt>marker</dt><dd>Shape for the legend item.</dd>+ * </dl>+ *+ * @attribute items+ * @type Array+ * @readOnly+ */+ items: {+ getter: function()+ {+ return this._items;+ }+ },++ /** * Background for the legend. * * @attribute background@@ -1665,4 +1698,4 @@ Y.Chart = Chart; -}, '3.5.1' ,{requires:['charts-base']});+}, '3.7.1', {"requires": ["charts-base"]});
@@ -0,0 +1,71 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/charts/charts.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/charts/charts.js",+ code: []+};+_yuitest_coverage["build/charts/charts.js"].code=["YUI.add('charts', function (Y, NAME) {","","/**"," * The Chart class is the basic application used to create a chart."," *"," * @module charts"," * @class Chart"," * @constructor"," */","function Chart(cfg)","{"," if(cfg.type != \"pie\")"," {"," return new Y.CartesianChart(cfg);"," }"," else"," {"," return new Y.PieChart(cfg);"," }","}","Y.Chart = Chart;","","","}, '3.7.1', {\"requires\": [\"charts-base\"]});"];+_yuitest_coverage["build/charts/charts.js"].lines = {"1":0,"10":0,"12":0,"14":0,"18":0,"21":0};+_yuitest_coverage["build/charts/charts.js"].functions = {"Chart:10":0,"(anonymous 1):1":0};+_yuitest_coverage["build/charts/charts.js"].coveredLines = 6;+_yuitest_coverage["build/charts/charts.js"].coveredFunctions = 2;+_yuitest_coverline("build/charts/charts.js", 1);+YUI.add('charts', function (Y, NAME) {++/**+ * The Chart class is the basic application used to create a chart.+ *+ * @module charts+ * @class Chart+ * @constructor+ */+_yuitest_coverfunc("build/charts/charts.js", "(anonymous 1)", 1);+_yuitest_coverline("build/charts/charts.js", 10);+function Chart(cfg)+{+ _yuitest_coverfunc("build/charts/charts.js", "Chart", 10);+_yuitest_coverline("build/charts/charts.js", 12);+if(cfg.type != "pie")+ {+ _yuitest_coverline("build/charts/charts.js", 14);+return new Y.CartesianChart(cfg);+ }+ else+ {+ _yuitest_coverline("build/charts/charts.js", 18);+return new Y.PieChart(cfg);+ }+}+_yuitest_coverline("build/charts/charts.js", 21);+Y.Chart = Chart;+++}, '3.7.1', {"requires": ["charts-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('charts', function(Y) {+YUI.add('charts', function (Y, NAME) { /** * The Chart class is the basic application used to create a chart.@@ -27,4 +27,4 @@ Y.Chart = Chart; -}, '3.5.1' ,{requires:['charts-base']});+}, '3.7.1', {"requires": ["charts-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("charts",function(b){function a(c){if(c.type!="pie"){return new b.CartesianChart(c);}else{return new b.PieChart(c);}}b.Chart=a;},"3.5.1",{requires:["charts-base"]});+YUI.add("charts",function(e,t){function n(t){return t.type!="pie"?new e.CartesianChart(t):new e.PieChart(t)}e.Chart=n},"3.7.1",{requires:["charts-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('charts', function(Y) {+YUI.add('charts', function (Y, NAME) { /** * The Chart class is the basic application used to create a chart.@@ -27,4 +27,4 @@ Y.Chart = Chart; -}, '3.5.1' ,{requires:['charts-base']});+}, '3.7.1', {"requires": ["charts-base"]});
@@ -0,0 +1,138 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/classnamemanager/classnamemanager.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/classnamemanager/classnamemanager.js",+ code: []+};+_yuitest_coverage["build/classnamemanager/classnamemanager.js"].code=["YUI.add('classnamemanager', function (Y, NAME) {","","/**","* Contains a singleton (ClassNameManager) that enables easy creation and caching of ","* prefixed class names.","* @module classnamemanager","*/","","/**"," * A singleton class providing: "," * "," * <ul>"," * <li>Easy creation of prefixed class names</li>"," * <li>Caching of previously created class names for improved performance.</li>"," * </ul>"," * "," * @class ClassNameManager"," * @static "," */","","// String constants","var CLASS_NAME_PREFIX = 'classNamePrefix',"," CLASS_NAME_DELIMITER = 'classNameDelimiter',"," CONFIG = Y.config;","","// Global config","","/**"," * Configuration property indicating the prefix for all CSS class names in this YUI instance."," *"," * @property classNamePrefix"," * @type {String}"," * @default \"yui\""," * @static"," */","CONFIG[CLASS_NAME_PREFIX] = CONFIG[CLASS_NAME_PREFIX] || 'yui3';","","/**"," * Configuration property indicating the delimiter used to compose all CSS class names in"," * this YUI instance."," *"," * @property classNameDelimiter"," * @type {String}"," * @default \"-\""," * @static"," */","CONFIG[CLASS_NAME_DELIMITER] = CONFIG[CLASS_NAME_DELIMITER] || '-';","","Y.ClassNameManager = function () {",""," var sPrefix = CONFIG[CLASS_NAME_PREFIX],"," sDelimiter = CONFIG[CLASS_NAME_DELIMITER];",""," return {",""," /**"," * Returns a class name prefixed with the the value of the "," * <code>Y.config.classNamePrefix</code> attribute + the provided strings."," * Uses the <code>Y.config.classNameDelimiter</code> attribute to delimit the "," * provided strings. E.g. Y.ClassNameManager.getClassName('foo','bar'); // yui-foo-bar"," *"," * @method getClassName"," * @param {String}+ classnameSection one or more classname sections to be joined"," * @param {Boolean} skipPrefix If set to true, the classname will not be prefixed with the default Y.config.classNameDelimiter value. "," */"," getClassName: Y.cached(function () {",""," var args = Y.Array(arguments);",""," if (args[args.length-1] !== true) {"," args.unshift(sPrefix);"," } else {"," args.pop();"," }",""," return args.join(sDelimiter);"," })",""," };","","}();","","","}, '3.7.1', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/classnamemanager/classnamemanager.js"].lines = {"1":0,"22":0,"36":0,"47":0,"49":0,"51":0,"54":0,"68":0,"70":0,"71":0,"73":0,"76":0};+_yuitest_coverage["build/classnamemanager/classnamemanager.js"].functions = {"(anonymous 2):66":0,"ClassNameManager:49":0,"(anonymous 1):1":0};+_yuitest_coverage["build/classnamemanager/classnamemanager.js"].coveredLines = 12;+_yuitest_coverage["build/classnamemanager/classnamemanager.js"].coveredFunctions = 3;+_yuitest_coverline("build/classnamemanager/classnamemanager.js", 1);+YUI.add('classnamemanager', function (Y, NAME) {++/**+* Contains a singleton (ClassNameManager) that enables easy creation and caching of +* prefixed class names.+* @module classnamemanager+*/++/**+ * A singleton class providing: + * + * <ul>+ * <li>Easy creation of prefixed class names</li>+ * <li>Caching of previously created class names for improved performance.</li>+ * </ul>+ * + * @class ClassNameManager+ * @static + */++// String constants+_yuitest_coverfunc("build/classnamemanager/classnamemanager.js", "(anonymous 1)", 1);+_yuitest_coverline("build/classnamemanager/classnamemanager.js", 22);+var CLASS_NAME_PREFIX = 'classNamePrefix',+ CLASS_NAME_DELIMITER = 'classNameDelimiter',+ CONFIG = Y.config;++// Global config++/**+ * Configuration property indicating the prefix for all CSS class names in this YUI instance.+ *+ * @property classNamePrefix+ * @type {String}+ * @default "yui"+ * @static+ */+_yuitest_coverline("build/classnamemanager/classnamemanager.js", 36);+CONFIG[CLASS_NAME_PREFIX] = CONFIG[CLASS_NAME_PREFIX] || 'yui3';++/**+ * Configuration property indicating the delimiter used to compose all CSS class names in+ * this YUI instance.+ *+ * @property classNameDelimiter+ * @type {String}+ * @default "-"+ * @static+ */+_yuitest_coverline("build/classnamemanager/classnamemanager.js", 47);+CONFIG[CLASS_NAME_DELIMITER] = CONFIG[CLASS_NAME_DELIMITER] || '-';++_yuitest_coverline("build/classnamemanager/classnamemanager.js", 49);+Y.ClassNameManager = function () {++ _yuitest_coverfunc("build/classnamemanager/classnamemanager.js", "ClassNameManager", 49);+_yuitest_coverline("build/classnamemanager/classnamemanager.js", 51);+var sPrefix = CONFIG[CLASS_NAME_PREFIX],+ sDelimiter = CONFIG[CLASS_NAME_DELIMITER];++ _yuitest_coverline("build/classnamemanager/classnamemanager.js", 54);+return {++ /**+ * Returns a class name prefixed with the the value of the + * <code>Y.config.classNamePrefix</code> attribute + the provided strings.+ * Uses the <code>Y.config.classNameDelimiter</code> attribute to delimit the + * provided strings. E.g. Y.ClassNameManager.getClassName('foo','bar'); // yui-foo-bar+ *+ * @method getClassName+ * @param {String}+ classnameSection one or more classname sections to be joined+ * @param {Boolean} skipPrefix If set to true, the classname will not be prefixed with the default Y.config.classNameDelimiter value. + */+ getClassName: Y.cached(function () {++ _yuitest_coverfunc("build/classnamemanager/classnamemanager.js", "(anonymous 2)", 66);+_yuitest_coverline("build/classnamemanager/classnamemanager.js", 68);+var args = Y.Array(arguments);++ _yuitest_coverline("build/classnamemanager/classnamemanager.js", 70);+if (args[args.length-1] !== true) {+ _yuitest_coverline("build/classnamemanager/classnamemanager.js", 71);+args.unshift(sPrefix);+ } else {+ _yuitest_coverline("build/classnamemanager/classnamemanager.js", 73);+args.pop();+ }++ _yuitest_coverline("build/classnamemanager/classnamemanager.js", 76);+return args.join(sDelimiter);+ })++ };++}();+++}, '3.7.1', {"requires": ["yui-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('classnamemanager', function(Y) {+YUI.add('classnamemanager', function (Y, NAME) { /** * Contains a singleton (ClassNameManager) that enables easy creation and caching of @@ -87,4 +87,4 @@ }(); -}, '3.5.1' ,{requires:['yui-base']});+}, '3.7.1', {"requires": ["yui-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("classnamemanager",function(c){var b="classNamePrefix",d="classNameDelimiter",a=c.config;a[b]=a[b]||"yui3";a[d]=a[d]||"-";c.ClassNameManager=function(){var e=a[b],f=a[d];return{getClassName:c.cached(function(){var g=c.Array(arguments);if(g[g.length-1]!==true){g.unshift(e);}else{g.pop();}return g.join(f);})};}();},"3.5.1",{requires:["yui-base"]});+YUI.add("classnamemanager",function(e,t){var n="classNamePrefix",r="classNameDelimiter",i=e.config;i[n]=i[n]||"yui3",i[r]=i[r]||"-",e.ClassNameManager=function(){var t=i[n],s=i[r];return{getClassName:e.cached(function(){var n=e.Array(arguments);return n[n.length-1]!==!0?n.unshift(t):n.pop(),n.join(s)})}}()},"3.7.1",{requires:["yui-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('classnamemanager', function(Y) {+YUI.add('classnamemanager', function (Y, NAME) { /** * Contains a singleton (ClassNameManager) that enables easy creation and caching of @@ -87,4 +87,4 @@ }(); -}, '3.5.1' ,{requires:['yui-base']});+}, '3.7.1', {"requires": ["yui-base"]});
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -0,0 +1,290 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/clickable-rail/clickable-rail.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/clickable-rail/clickable-rail.js",+ code: []+};+_yuitest_coverage["build/clickable-rail/clickable-rail.js"].code=["YUI.add('clickable-rail', function (Y, NAME) {","","/**"," * Adds support for mouse interaction with the Slider rail triggering thumb"," * movement."," *"," * @module slider"," * @submodule clickable-rail"," */","","/**"," * Slider extension that allows clicking on the Slider's rail element,"," * triggering the thumb to align with the location of the click."," *"," * @class ClickableRail"," */","function ClickableRail() {"," this._initClickableRail();","}","","Y.ClickableRail = Y.mix(ClickableRail, {",""," // Prototype methods added to host class"," prototype: {",""," /**"," * Initializes the internal state and sets up events."," *"," * @method _initClickableRail"," * @protected"," */"," _initClickableRail: function () {"," this._evtGuid = this._evtGuid || (Y.guid() + '|');",""," /**"," * Broadcasts when the rail has received a mousedown event and"," * triggers the thumb positioning. Use"," * <code>e.preventDefault()</code> or"," * <code>set("clickableRail", false)</code> to prevent"," * the thumb positioning."," *"," * @event railMouseDown"," * @preventable _defRailMouseDownFn"," */"," this.publish('railMouseDown', {"," defaultFn: this._defRailMouseDownFn"," });",""," this.after('render', this._bindClickableRail);"," this.on('destroy', this._unbindClickableRail);"," },",""," /** "," * Attaches DOM event subscribers to support rail interaction."," *"," * @method _bindClickableRail"," * @protected"," */"," _bindClickableRail: function () {"," this._dd.addHandle(this.rail);",""," this.rail.on(this._evtGuid + Y.DD.Drag.START_EVENT,"," Y.bind(this._onRailMouseDown, this));"," },",""," /**"," * Detaches DOM event subscribers for cleanup/destruction cycle."," *"," * @method _unbindClickableRail"," * @protected"," */"," _unbindClickableRail: function () {"," if (this.get('rendered')) {"," var contentBox = this.get('contentBox'),"," rail = contentBox.one('.' + this.getClassName('rail'));",""," rail.detach(this.evtGuid + '*');"," }"," },",""," /**"," * Dispatches the railMouseDown event."," *"," * @method _onRailMouseDown"," * @param e {DOMEvent} the mousedown event object"," * @protected"," */"," _onRailMouseDown: function (e) {"," if (this.get('clickableRail') && !this.get('disabled')) {"," this.fire('railMouseDown', { ev: e });"," this.thumb.focus();"," }"," },",""," /**"," * Default behavior for the railMouseDown event. Centers the thumb at"," * the click location and passes control to the DDM to behave as though"," * the thumb itself were clicked in preparation for a drag operation."," *"," * @method _defRailMouseDownFn"," * @param e {Event} the EventFacade for the railMouseDown custom event"," * @protected"," */"," _defRailMouseDownFn: function (e) {"," e = e.ev;",""," // Logic that determines which thumb should be used is abstracted"," // to someday support multi-thumb sliders"," var dd = this._resolveThumb(e),"," i = this._key.xyIndex,"," length = parseFloat(this.get('length'), 10),"," thumb,"," thumbSize,"," xy;"," "," if (dd) {"," thumb = dd.get('dragNode');"," thumbSize = parseFloat(thumb.getStyle(this._key.dim), 10);",""," // Step 1. Allow for aligning to thumb center or edge, etc"," xy = this._getThumbDestination(e, thumb);",""," // Step 2. Remove page offsets to give just top/left style val"," xy = xy[ i ] - this.rail.getXY()[i];",""," // Step 3. Constrain within the rail in case of attempt to"," // center the thumb when clicking on the end of the rail"," xy = Math.min("," Math.max(xy, 0),"," (length - thumbSize));",""," this._uiMoveThumb(xy, { source: 'rail' });",""," // Set e.target for DD's IE9 patch which calls"," // e.target._node.setCapture() to allow imgs to be dragged."," // Without this, setCapture is called from the rail and rail"," // clicks on other Sliders may have their thumb movements"," // overridden by a different Slider (the thumb on the wrong"," // Slider moves)."," e.target = this.thumb.one('img') || this.thumb;",""," // Delegate to DD's natural behavior"," dd._handleMouseDownEvent(e);",""," // TODO: this won't trigger a slideEnd if the rail is clicked"," // check if dd._move(e); dd._dragThreshMet = true; dd.start();"," // will do the trick. Is that even a good idea?"," }"," },",""," /**"," * Resolves which thumb to actuate if any. Override this if you want to"," * support multiple thumbs. By default, returns the Drag instance for"," * the thumb stored by the Slider."," *"," * @method _resolveThumb"," * @param e {DOMEvent} the mousedown event object"," * @return {DD.Drag} the Drag instance that should be moved"," * @protected"," */"," _resolveThumb: function (e) {"," /* Temporary workaround"," var primaryOnly = this._dd.get('primaryButtonOnly'),"," validClick = !primaryOnly || e.button <= 1;",""," return (validClick) ? this._dd : null;"," */"," return this._dd;"," },",""," /**"," * Calculates the top left position the thumb should be moved to to"," * align the click XY with the center of the specified node."," *"," * @method _getThumbDestination"," * @param e {DOMEvent} The mousedown event object"," * @param node {Node} The node to position"," * @return {Array} the [top, left] pixel position of the destination"," * @protected"," */"," _getThumbDestination: function (e, node) {"," var offsetWidth = node.get('offsetWidth'),"," offsetHeight = node.get('offsetHeight');",""," // center"," return ["," (e.pageX - Math.round((offsetWidth / 2))),"," (e.pageY - Math.round((offsetHeight / 2)))"," ];"," }",""," },",""," // Static properties added onto host class"," ATTRS: {"," /**"," * Enable or disable clickable rail support."," *"," * @attribute clickableRail"," * @type {Boolean}"," * @default true"," */"," clickableRail: {"," value: true,"," validator: Y.Lang.isBoolean"," }"," }","","}, true);","","","}, '3.7.1', {\"requires\": [\"slider-base\"]});"];+_yuitest_coverage["build/clickable-rail/clickable-rail.js"].lines = {"1":0,"17":0,"18":0,"21":0,"33":0,"45":0,"49":0,"50":0,"60":0,"62":0,"73":0,"74":0,"77":0,"89":0,"90":0,"91":0,"105":0,"109":0,"116":0,"117":0,"118":0,"121":0,"124":0,"128":0,"132":0,"140":0,"143":0,"168":0,"182":0,"186":0};+_yuitest_coverage["build/clickable-rail/clickable-rail.js"].functions = {"ClickableRail:17":0,"_initClickableRail:32":0,"_bindClickableRail:59":0,"_unbindClickableRail:72":0,"_onRailMouseDown:88":0,"_defRailMouseDownFn:104":0,"_resolveThumb:161":0,"_getThumbDestination:181":0,"(anonymous 1):1":0};+_yuitest_coverage["build/clickable-rail/clickable-rail.js"].coveredLines = 30;+_yuitest_coverage["build/clickable-rail/clickable-rail.js"].coveredFunctions = 9;+_yuitest_coverline("build/clickable-rail/clickable-rail.js", 1);+YUI.add('clickable-rail', function (Y, NAME) {++/**+ * Adds support for mouse interaction with the Slider rail triggering thumb+ * movement.+ *+ * @module slider+ * @submodule clickable-rail+ */++/**+ * Slider extension that allows clicking on the Slider's rail element,+ * triggering the thumb to align with the location of the click.+ *+ * @class ClickableRail+ */+_yuitest_coverfunc("build/clickable-rail/clickable-rail.js", "(anonymous 1)", 1);+_yuitest_coverline("build/clickable-rail/clickable-rail.js", 17);+function ClickableRail() {+ _yuitest_coverfunc("build/clickable-rail/clickable-rail.js", "ClickableRail", 17);+_yuitest_coverline("build/clickable-rail/clickable-rail.js", 18);+this._initClickableRail();+}++_yuitest_coverline("build/clickable-rail/clickable-rail.js", 21);+Y.ClickableRail = Y.mix(ClickableRail, {++ // Prototype methods added to host class+ prototype: {++ /**+ * Initializes the internal state and sets up events.+ *+ * @method _initClickableRail+ * @protected+ */+ _initClickableRail: function () {+ _yuitest_coverfunc("build/clickable-rail/clickable-rail.js", "_initClickableRail", 32);+_yuitest_coverline("build/clickable-rail/clickable-rail.js", 33);+this._evtGuid = this._evtGuid || (Y.guid() + '|');++ /**+ * Broadcasts when the rail has received a mousedown event and+ * triggers the thumb positioning. Use+ * <code>e.preventDefault()</code> or+ * <code>set("clickableRail", false)</code> to prevent+ * the thumb positioning.+ *+ * @event railMouseDown+ * @preventable _defRailMouseDownFn+ */+ _yuitest_coverline("build/clickable-rail/clickable-rail.js", 45);+this.publish('railMouseDown', {+ defaultFn: this._defRailMouseDownFn+ });++ _yuitest_coverline("build/clickable-rail/clickable-rail.js", 49);+this.after('render', this._bindClickableRail);+ _yuitest_coverline("build/clickable-rail/clickable-rail.js", 50);+this.on('destroy', this._unbindClickableRail);+ },++ /** + * Attaches DOM event subscribers to support rail interaction.+ *+ * @method _bindClickableRail+ * @protected+ */+ _bindClickableRail: function () {+ _yuitest_coverfunc("build/clickable-rail/clickable-rail.js", "_bindClickableRail", 59);+_yuitest_coverline("build/clickable-rail/clickable-rail.js", 60);+this._dd.addHandle(this.rail);++ _yuitest_coverline("build/clickable-rail/clickable-rail.js", 62);+this.rail.on(this._evtGuid + Y.DD.Drag.START_EVENT,+ Y.bind(this._onRailMouseDown, this));+ },++ /**+ * Detaches DOM event subscribers for cleanup/destruction cycle.+ *+ * @method _unbindClickableRail+ * @protected+ */+ _unbindClickableRail: function () {+ _yuitest_coverfunc("build/clickable-rail/clickable-rail.js", "_unbindClickableRail", 72);+_yuitest_coverline("build/clickable-rail/clickable-rail.js", 73);+if (this.get('rendered')) {+ _yuitest_coverline("build/clickable-rail/clickable-rail.js", 74);+var contentBox = this.get('contentBox'),+ rail = contentBox.one('.' + this.getClassName('rail'));++ _yuitest_coverline("build/clickable-rail/clickable-rail.js", 77);+rail.detach(this.evtGuid + '*');+ }+ },++ /**+ * Dispatches the railMouseDown event.+ *+ * @method _onRailMouseDown+ * @param e {DOMEvent} the mousedown event object+ * @protected+ */+ _onRailMouseDown: function (e) {+ _yuitest_coverfunc("build/clickable-rail/clickable-rail.js", "_onRailMouseDown", 88);+_yuitest_coverline("build/clickable-rail/clickable-rail.js", 89);+if (this.get('clickableRail') && !this.get('disabled')) {+ _yuitest_coverline("build/clickable-rail/clickable-rail.js", 90);+this.fire('railMouseDown', { ev: e });+ _yuitest_coverline("build/clickable-rail/clickable-rail.js", 91);+this.thumb.focus();+ }+ },++ /**+ * Default behavior for the railMouseDown event. Centers the thumb at+ * the click location and passes control to the DDM to behave as though+ * the thumb itself were clicked in preparation for a drag operation.+ *+ * @method _defRailMouseDownFn+ * @param e {Event} the EventFacade for the railMouseDown custom event+ * @protected+ */+ _defRailMouseDownFn: function (e) {+ _yuitest_coverfunc("build/clickable-rail/clickable-rail.js", "_defRailMouseDownFn", 104);+_yuitest_coverline("build/clickable-rail/clickable-rail.js", 105);+e = e.ev;++ // Logic that determines which thumb should be used is abstracted+ // to someday support multi-thumb sliders+ _yuitest_coverline("build/clickable-rail/clickable-rail.js", 109);+var dd = this._resolveThumb(e),+ i = this._key.xyIndex,+ length = parseFloat(this.get('length'), 10),+ thumb,+ thumbSize,+ xy;+ + _yuitest_coverline("build/clickable-rail/clickable-rail.js", 116);+if (dd) {+ _yuitest_coverline("build/clickable-rail/clickable-rail.js", 117);+thumb = dd.get('dragNode');+ _yuitest_coverline("build/clickable-rail/clickable-rail.js", 118);+thumbSize = parseFloat(thumb.getStyle(this._key.dim), 10);++ // Step 1. Allow for aligning to thumb center or edge, etc+ _yuitest_coverline("build/clickable-rail/clickable-rail.js", 121);+xy = this._getThumbDestination(e, thumb);++ // Step 2. Remove page offsets to give just top/left style val+ _yuitest_coverline("build/clickable-rail/clickable-rail.js", 124);+xy = xy[ i ] - this.rail.getXY()[i];++ // Step 3. Constrain within the rail in case of attempt to+ // center the thumb when clicking on the end of the rail+ _yuitest_coverline("build/clickable-rail/clickable-rail.js", 128);+xy = Math.min(+ Math.max(xy, 0),+ (length - thumbSize));++ _yuitest_coverline("build/clickable-rail/clickable-rail.js", 132);+this._uiMoveThumb(xy, { source: 'rail' });++ // Set e.target for DD's IE9 patch which calls+ // e.target._node.setCapture() to allow imgs to be dragged.+ // Without this, setCapture is called from the rail and rail+ // clicks on other Sliders may have their thumb movements+ // overridden by a different Slider (the thumb on the wrong+ // Slider moves).+ _yuitest_coverline("build/clickable-rail/clickable-rail.js", 140);+e.target = this.thumb.one('img') || this.thumb;++ // Delegate to DD's natural behavior+ _yuitest_coverline("build/clickable-rail/clickable-rail.js", 143);+dd._handleMouseDownEvent(e);++ // TODO: this won't trigger a slideEnd if the rail is clicked+ // check if dd._move(e); dd._dragThreshMet = true; dd.start();+ // will do the trick. Is that even a good idea?+ }+ },++ /**+ * Resolves which thumb to actuate if any. Override this if you want to+ * support multiple thumbs. By default, returns the Drag instance for+ * the thumb stored by the Slider.+ *+ * @method _resolveThumb+ * @param e {DOMEvent} the mousedown event object+ * @return {DD.Drag} the Drag instance that should be moved+ * @protected+ */+ _resolveThumb: function (e) {+ /* Temporary workaround+ var primaryOnly = this._dd.get('primaryButtonOnly'),+ validClick = !primaryOnly || e.button <= 1;++ return (validClick) ? this._dd : null;+ */+ _yuitest_coverfunc("build/clickable-rail/clickable-rail.js", "_resolveThumb", 161);+_yuitest_coverline("build/clickable-rail/clickable-rail.js", 168);+return this._dd;+ },++ /**+ * Calculates the top left position the thumb should be moved to to+ * align the click XY with the center of the specified node.+ *+ * @method _getThumbDestination+ * @param e {DOMEvent} The mousedown event object+ * @param node {Node} The node to position+ * @return {Array} the [top, left] pixel position of the destination+ * @protected+ */+ _getThumbDestination: function (e, node) {+ _yuitest_coverfunc("build/clickable-rail/clickable-rail.js", "_getThumbDestination", 181);+_yuitest_coverline("build/clickable-rail/clickable-rail.js", 182);+var offsetWidth = node.get('offsetWidth'),+ offsetHeight = node.get('offsetHeight');++ // center+ _yuitest_coverline("build/clickable-rail/clickable-rail.js", 186);+return [+ (e.pageX - Math.round((offsetWidth / 2))),+ (e.pageY - Math.round((offsetHeight / 2)))+ ];+ }++ },++ // Static properties added onto host class+ ATTRS: {+ /**+ * Enable or disable clickable rail support.+ *+ * @attribute clickableRail+ * @type {Boolean}+ * @default true+ */+ clickableRail: {+ value: true,+ validator: Y.Lang.isBoolean+ }+ }++}, true);+++}, '3.7.1', {"requires": ["slider-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('clickable-rail', function(Y) {+YUI.add('clickable-rail', function (Y, NAME) { /** * Adds support for mouse interaction with the Slider rail triggering thumb@@ -215,5 +215,4 @@ }, true); --}, '3.5.1' ,{requires:['slider-base']});+}, '3.7.1', {"requires": ["slider-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("clickable-rail",function(b){function a(){this._initClickableRail();}b.ClickableRail=b.mix(a,{prototype:{_initClickableRail:function(){this._evtGuid=this._evtGuid||(b.guid()+"|");this.publish("railMouseDown",{defaultFn:this._defRailMouseDownFn});this.after("render",this._bindClickableRail);this.on("destroy",this._unbindClickableRail);},_bindClickableRail:function(){this._dd.addHandle(this.rail);this.rail.on(this._evtGuid+b.DD.Drag.START_EVENT,b.bind(this._onRailMouseDown,this));},_unbindClickableRail:function(){if(this.get("rendered")){var c=this.get("contentBox"),d=c.one("."+this.getClassName("rail"));d.detach(this.evtGuid+"*");}},_onRailMouseDown:function(c){if(this.get("clickableRail")&&!this.get("disabled")){this.fire("railMouseDown",{ev:c});this.thumb.focus();}},_defRailMouseDownFn:function(k){k=k.ev;var c=this._resolveThumb(k),g=this._key.xyIndex,h=parseFloat(this.get("length"),10),f,d,j;if(c){f=c.get("dragNode");d=parseFloat(f.getStyle(this._key.dim),10);j=this._getThumbDestination(k,f);j=j[g]-this.rail.getXY()[g];j=Math.min(Math.max(j,0),(h-d));this._uiMoveThumb(j,{source:"rail"});k.target=this.thumb.one("img")||this.thumb;c._handleMouseDownEvent(k);}},_resolveThumb:function(c){return this._dd;},_getThumbDestination:function(g,f){var d=f.get("offsetWidth"),c=f.get("offsetHeight");return[(g.pageX-Math.round((d/2))),(g.pageY-Math.round((c/2)))];}},ATTRS:{clickableRail:{value:true,validator:b.Lang.isBoolean}}},true);},"3.5.1",{requires:["slider-base"]});+YUI.add("clickable-rail",function(e,t){function n(){this._initClickableRail()}e.ClickableRail=e.mix(n,{prototype:{_initClickableRail:function(){this._evtGuid=this._evtGuid||e.guid()+"|",this.publish("railMouseDown",{defaultFn:this._defRailMouseDownFn}),this.after("render",this._bindClickableRail),this.on("destroy",this._unbindClickableRail)},_bindClickableRail:function(){this._dd.addHandle(this.rail),this.rail.on(this._evtGuid+e.DD.Drag.START_EVENT,e.bind(this._onRailMouseDown,this))},_unbindClickableRail:function(){if(this.get("rendered")){var e=this.get("contentBox"),t=e.one("."+this.getClassName("rail"));t.detach(this.evtGuid+"*")}},_onRailMouseDown:function(e){this.get("clickableRail")&&!this.get("disabled")&&(this.fire("railMouseDown",{ev:e}),this.thumb.focus())},_defRailMouseDownFn:function(e){e=e.ev;var t=this._resolveThumb(e),n=this._key.xyIndex,r=parseFloat(this.get("length"),10),i,s,o;t&&(i=t.get("dragNode"),s=parseFloat(i.getStyle(this._key.dim),10),o=this._getThumbDestination(e,i),o=o[n]-this.rail.getXY()[n],o=Math.min(Math.max(o,0),r-s),this._uiMoveThumb(o,{source:"rail"}),e.target=this.thumb.one("img")||this.thumb,t._handleMouseDownEvent(e))},_resolveThumb:function(e){return this._dd},_getThumbDestination:function(e,t){var n=t.get("offsetWidth"),r=t.get("offsetHeight");return[e.pageX-Math.round(n/2),e.pageY-Math.round(r/2)]}},ATTRS:{clickableRail:{value:!0,validator:e.Lang.isBoolean}}},!0)},"3.7.1",{requires:["slider-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('clickable-rail', function(Y) {+YUI.add('clickable-rail', function (Y, NAME) { /** * Adds support for mouse interaction with the Slider rail triggering thumb@@ -215,5 +215,4 @@ }, true); --}, '3.5.1' ,{requires:['slider-base']});+}, '3.7.1', {"requires": ["slider-base"]});
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -0,0 +1,920 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/console-filters/console-filters.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/console-filters/console-filters.js",+ code: []+};+_yuitest_coverage["build/console-filters/console-filters.js"].code=["YUI.add('console-filters', function (Y, NAME) {","","/**"," * <p>Provides Plugin.ConsoleFilters plugin class.</p>"," *"," * <p>This plugin adds the ability to control which Console entries display by filtering on category and source. Two groups of checkboxes are added to the Console footer, one for categories and the other for sources. Only those messages that match a checked category or source are displayed.</p>"," *"," * @module console-filters"," * @namespace Plugin"," * @class ConsoleFilters"," */","","// Some common strings and functions","var getCN = Y.ClassNameManager.getClassName,"," CONSOLE = 'console',"," FILTERS = 'filters',"," FILTER = 'filter',"," CATEGORY = 'category',"," SOURCE = 'source',"," CATEGORY_DOT = 'category.',"," SOURCE_DOT = 'source.',",""," HOST = 'host',"," CHECKED = 'checked',"," DEF_VISIBILITY = 'defaultVisibility',",""," DOT = '.',"," EMPTY = '',",""," C_BODY = DOT + Y.Console.CHROME_CLASSES.console_bd_class,"," C_FOOT = DOT + Y.Console.CHROME_CLASSES.console_ft_class,",""," SEL_CHECK = 'input[type=checkbox].',"," "," isString = Y.Lang.isString;","","function ConsoleFilters() {"," ConsoleFilters.superclass.constructor.apply(this,arguments);","}","","Y.namespace('Plugin').ConsoleFilters = Y.extend(ConsoleFilters, Y.Plugin.Base,","","// Y.Plugin.ConsoleFilters prototype","{"," /**"," * Collection of all log messages passed through since the plugin's"," * instantiation. This holds all messages regardless of filter status."," * Used as a single source of truth for repopulating the Console body when"," * filters are changed."," *"," * @property _entries"," * @type Array"," * @protected"," */"," _entries : null,",""," /**"," * Maximum number of entries to store in the message cache."," *"," * @property _cacheLimit"," * @type {Number}"," * @default Infinity"," * @protected"," */"," _cacheLimit : Number.POSITIVE_INFINITY,",""," /**"," * The container node created to house the category filters."," *"," * @property _categories"," * @type Node"," * @protected"," */"," _categories : null,",""," /**"," * The container node created to house the source filters."," *"," * @property _sources"," * @type Node"," * @protected"," */"," _sources : null,",""," /**"," * Initialize entries collection and attach listeners to host events and"," * methods."," *"," * @method initializer"," * @protected"," */"," initializer : function () {"," this._entries = [];",""," this.get(HOST).on(\"entry\", this._onEntry, this);",""," this.doAfter(\"renderUI\", this.renderUI);"," this.doAfter(\"syncUI\", this.syncUI);"," this.doAfter(\"bindUI\", this.bindUI);",""," this.doAfter(\"clearConsole\", this._afterClearConsole);",""," if (this.get(HOST).get('rendered')) {"," this.renderUI();"," this.syncUI();"," this.bindUI();"," }",""," this.after(\"cacheLimitChange\", this._afterCacheLimitChange);"," },",""," /**"," * Removes the plugin UI and unwires events."," *"," * @method destructor"," * @protected"," */"," destructor : function () {"," //TODO: grab last {consoleLimit} entries and update the console with"," //them (no filtering)"," this._entries = [];",""," if (this._categories) {"," this._categories.remove();"," }"," if (this._sources) {"," this._sources.remove();"," }"," },",""," /**"," * Adds the category and source filter sections to the Console footer."," *"," * @method renderUI"," * @protected"," */"," renderUI : function () {"," var foot = this.get(HOST).get('contentBox').one(C_FOOT),"," html;",""," if (foot) {"," html = Y.Lang.sub("," ConsoleFilters.CATEGORIES_TEMPLATE,"," ConsoleFilters.CHROME_CLASSES);",""," this._categories = foot.appendChild(Y.Node.create(html));",""," html = Y.Lang.sub("," ConsoleFilters.SOURCES_TEMPLATE,"," ConsoleFilters.CHROME_CLASSES);",""," this._sources = foot.appendChild(Y.Node.create(html));"," }"," },",""," /**"," * Binds to checkbox click events and internal attribute change events to"," * maintain the UI state."," *"," * @method bindUI"," * @protected"," */"," bindUI : function () {"," this._categories.on('click', Y.bind(this._onCategoryCheckboxClick, this));",""," this._sources.on('click', Y.bind(this._onSourceCheckboxClick, this));"," "," this.after('categoryChange',this._afterCategoryChange);"," this.after('sourceChange', this._afterSourceChange);"," },",""," /**"," * Updates the UI to be in accordance with the current state of the plugin."," *"," * @method syncUI"," */"," syncUI : function () {"," Y.each(this.get(CATEGORY), function (v, k) {"," this._uiSetCheckbox(CATEGORY, k, v);"," }, this);",""," Y.each(this.get(SOURCE), function (v, k) {"," this._uiSetCheckbox(SOURCE, k, v);"," }, this);",""," this.refreshConsole();"," },",""," /**"," * Ensures a filter is set up for any new categories or sources and"," * collects the messages in _entries. If the message is stamped with a"," * category or source that is currently being filtered out, the message"," * will not pass to the Console's print buffer."," *"," * @method _onEntry"," * @param e {Event} the custom event object"," * @protected"," */"," _onEntry : function (e) {"," this._entries.push(e.message);"," "," var cat = CATEGORY_DOT + e.message.category,"," src = SOURCE_DOT + e.message.source,"," cat_filter = this.get(cat),"," src_filter = this.get(src),"," overLimit = this._entries.length - this._cacheLimit,"," visible;",""," if (overLimit > 0) {"," this._entries.splice(0, overLimit);"," }",""," if (cat_filter === undefined) {"," visible = this.get(DEF_VISIBILITY);"," this.set(cat, visible);"," cat_filter = visible;"," }",""," if (src_filter === undefined) {"," visible = this.get(DEF_VISIBILITY);"," this.set(src, visible);"," src_filter = visible;"," }"," "," if (!cat_filter || !src_filter) {"," e.preventDefault();"," }"," },",""," /**"," * Flushes the cached entries after a call to the Console's clearConsole()."," *"," * @method _afterClearConsole"," * @protected"," */"," _afterClearConsole : function () {"," this._entries = [];"," },",""," /**"," * Triggers the Console to update if a known category filter"," * changes value (e.g. visible => hidden). Updates the appropriate"," * checkbox's checked state if necessary."," *"," * @method _afterCategoryChange"," * @param e {Event} the attribute change event object"," * @protected"," */"," _afterCategoryChange : function (e) {"," var cat = e.subAttrName.replace(/category\\./, EMPTY),"," before = e.prevVal,"," after = e.newVal;",""," // Don't update the console for new categories"," if (!cat || before[cat] !== undefined) {"," this.refreshConsole();",""," this._filterBuffer();"," }",""," if (cat && !e.fromUI) {"," this._uiSetCheckbox(CATEGORY, cat, after[cat]);"," }"," },",""," /**"," * Triggers the Console to update if a known source filter"," * changes value (e.g. visible => hidden). Updates the appropriate"," * checkbox's checked state if necessary."," *"," * @method _afterSourceChange"," * @param e {Event} the attribute change event object"," * @protected"," */"," _afterSourceChange : function (e) {"," var src = e.subAttrName.replace(/source\\./, EMPTY),"," before = e.prevVal,"," after = e.newVal;",""," // Don't update the console for new sources"," if (!src || before[src] !== undefined) {"," this.refreshConsole();",""," this._filterBuffer();"," }",""," if (src && !e.fromUI) {"," this._uiSetCheckbox(SOURCE, src, after[src]);"," }"," },",""," /**"," * Flushes the Console's print buffer of any entries that have a category"," * or source that is currently being excluded."," *"," * @method _filterBuffer"," * @protected"," */"," _filterBuffer : function () {"," var cats = this.get(CATEGORY),"," srcs = this.get(SOURCE),"," buffer = this.get(HOST).buffer,"," start = null,"," i;",""," for (i = buffer.length - 1; i >= 0; --i) {"," if (!cats[buffer[i].category] || !srcs[buffer[i].source]) {"," start = start || i;"," } else if (start) {"," buffer.splice(i,(start - i));"," start = null;"," }"," }"," if (start) {"," buffer.splice(0,start + 1);"," }"," },",""," /**"," * Trims the cache of entries to the appropriate new length."," *"," * @method _afterCacheLimitChange "," * @param e {Event} the attribute change event object"," * @protected"," */"," _afterCacheLimitChange : function (e) {"," if (isFinite(e.newVal)) {"," var delta = this._entries.length - e.newVal;",""," if (delta > 0) {"," this._entries.splice(0,delta);"," }"," }"," },",""," /**"," * Repopulates the Console with entries appropriate to the current filter"," * settings."," *"," * @method refreshConsole"," */"," refreshConsole : function () {"," var entries = this._entries,"," host = this.get(HOST),"," body = host.get('contentBox').one(C_BODY),"," remaining = host.get('consoleLimit'),"," cats = this.get(CATEGORY),"," srcs = this.get(SOURCE),"," buffer = [],"," i,e;",""," if (body) {"," host._cancelPrintLoop();",""," // Evaluate all entries from latest to oldest"," for (i = entries.length - 1; i >= 0 && remaining >= 0; --i) {"," e = entries[i];"," if (cats[e.category] && srcs[e.source]) {"," buffer.unshift(e);"," --remaining;"," }"," }",""," body.setHTML(EMPTY);"," host.buffer = buffer;"," host.printBuffer();"," }"," },",""," /**"," * Updates the checked property of a filter checkbox of the specified type."," * If no checkbox is found for the input params, one is created."," *"," * @method _uiSetCheckbox"," * @param type {String} 'category' or 'source'"," * @param item {String} the name of the filter (e.g. 'info', 'event')"," * @param checked {Boolean} value to set the checkbox's checked property"," * @protected"," */"," _uiSetCheckbox : function (type, item, checked) {"," if (type && item) {"," var container = type === CATEGORY ?"," this._categories :"," this._sources,"," sel = SEL_CHECK + getCN(CONSOLE,FILTER,item),"," checkbox = container.one(sel),"," host;"," "," if (!checkbox) {"," host = this.get(HOST);",""," this._createCheckbox(container, item);",""," checkbox = container.one(sel);",""," host._uiSetHeight(host.get('height'));"," }"," "," checkbox.set(CHECKED, checked);"," }"," },",""," /**"," * Passes checkbox clicks on to the category attribute."," *"," * @method _onCategoryCheckboxClick"," * @param e {Event} the DOM event"," * @protected"," */"," _onCategoryCheckboxClick : function (e) {"," var t = e.target, cat;",""," if (t.hasClass(ConsoleFilters.CHROME_CLASSES.filter)) {"," cat = t.get('value');"," if (cat && cat in this.get(CATEGORY)) {"," this.set(CATEGORY_DOT + cat, t.get(CHECKED), { fromUI: true });"," }"," }"," },",""," /**"," * Passes checkbox clicks on to the source attribute."," *"," * @method _onSourceCheckboxClick"," * @param e {Event} the DOM event"," * @protected"," */"," _onSourceCheckboxClick : function (e) {"," var t = e.target, src;",""," if (t.hasClass(ConsoleFilters.CHROME_CLASSES.filter)) {"," src = t.get('value');"," if (src && src in this.get(SOURCE)) {"," this.set(SOURCE_DOT + src, t.get(CHECKED), { fromUI: true });"," }"," }"," },",""," /**"," * Hides any number of categories from the UI. Convenience method for"," * myConsole.filter.set('category.foo', false); set('category.bar', false);"," * and so on."," *"," * @method hideCategory"," * @param cat* {String} 1..n categories to filter out of the UI"," */"," hideCategory : function (cat, multiple) {"," if (isString(multiple)) {"," Y.Array.each(arguments, this.hideCategory, this);"," } else {"," this.set(CATEGORY_DOT + cat, false);"," }"," },",""," /**"," * Shows any number of categories in the UI. Convenience method for"," * myConsole.filter.set('category.foo', true); set('category.bar', true);"," * and so on."," *"," * @method showCategory"," * @param cat* {String} 1..n categories to allow to display in the UI"," */"," showCategory : function (cat, multiple) {"," if (isString(multiple)) {"," Y.Array.each(arguments, this.showCategory, this);"," } else {"," this.set(CATEGORY_DOT + cat, true);"," }"," },",""," /**"," * Hides any number of sources from the UI. Convenience method for"," * myConsole.filter.set('source.foo', false); set('source.bar', false);"," * and so on."," *"," * @method hideSource"," * @param src* {String} 1..n sources to filter out of the UI"," */"," hideSource : function (src, multiple) {"," if (isString(multiple)) {"," Y.Array.each(arguments, this.hideSource, this);"," } else {"," this.set(SOURCE_DOT + src, false);"," }"," },",""," /**"," * Shows any number of sources in the UI. Convenience method for"," * myConsole.filter.set('source.foo', true); set('source.bar', true);"," * and so on."," *"," * @method showSource"," * @param src* {String} 1..n sources to allow to display in the UI"," */"," showSource : function (src, multiple) {"," if (isString(multiple)) {"," Y.Array.each(arguments, this.showSource, this);"," } else {"," this.set(SOURCE_DOT + src, true);"," }"," },",""," /**"," * Creates a checkbox and label from the ConsoleFilters.FILTER_TEMPLATE for"," * the provided type and name. The checkbox and label are appended to the"," * container node passes as the first arg."," *"," * @method _createCheckbox"," * @param container {Node} the parentNode of the new checkbox and label"," * @param name {String} the identifier of the filter"," * @protected"," */"," _createCheckbox : function (container, name) {"," var info = Y.merge(ConsoleFilters.CHROME_CLASSES, {"," filter_name : name,"," filter_class : getCN(CONSOLE, FILTER, name)"," }),"," node = Y.Node.create("," Y.Lang.sub(ConsoleFilters.FILTER_TEMPLATE, info));",""," container.appendChild(node);"," },",""," /**"," * Validates category updates are objects and the subattribute is not too"," * deep."," *"," * @method _validateCategory"," * @param cat {String} the new category:visibility map"," * @param v {String} the subattribute path updated"," * @return Boolean"," * @protected"," */"," _validateCategory : function (cat, v) {"," return Y.Lang.isObject(v,true) && cat.split(/\\./).length < 3;"," },",""," /**"," * Validates source updates are objects and the subattribute is not too"," * deep."," *"," * @method _validateSource"," * @param cat {String} the new source:visibility map"," * @param v {String} the subattribute path updated"," * @return Boolean"," * @protected"," */"," _validateSource : function (src, v) {"," return Y.Lang.isObject(v,true) && src.split(/\\./).length < 3;"," },",""," /**"," * Setter method for cacheLimit attribute. Basically a validator to ensure"," * numeric input."," *"," * @method _setCacheLimit"," * @param v {Number} Maximum number of entries"," * @return {Number}"," * @protected"," */"," _setCacheLimit: function (v) {"," if (Y.Lang.isNumber(v)) {"," this._cacheLimit = v;"," return v;"," } else {"," return Y.Attribute.INVALID_VALUE;"," }"," }","},","","// Y.Plugin.ConsoleFilters static properties","{"," /**"," * Plugin name."," *"," * @property NAME"," * @type String"," * @static"," * @default 'consoleFilters'"," */"," NAME : 'consoleFilters',",""," /**"," * The namespace hung off the host object that this plugin will inhabit."," *"," * @property NS"," * @type String"," * @static"," * @default 'filter'"," */"," NS : FILTER,",""," /**"," * Markup template used to create the container for the category filters."," *"," * @property CATEGORIES_TEMPLATE"," * @type String"," * @static"," */"," CATEGORIES_TEMPLATE :"," '<div class=\"{categories}\"></div>',",""," /**"," * Markup template used to create the container for the source filters."," *"," * @property SOURCES_TEMPLATE"," * @type String"," * @static"," */"," SOURCES_TEMPLATE :"," '<div class=\"{sources}\"></div>',",""," /**"," * Markup template used to create the category and source filter checkboxes."," *"," * @property FILTER_TEMPLATE"," * @type String"," * @static"," */"," FILTER_TEMPLATE :"," // IE8 and FF3 don't permit breaking _between_ nowrap elements. IE8"," // doesn't understand (non spec) wbr tag, nor does it create text nodes"," // for spaces in innerHTML strings. The thin-space entity suffices to"," // create a breakable point."," '<label class=\"{filter_label}\">'+"," '<input type=\"checkbox\" value=\"{filter_name}\" '+"," 'class=\"{filter} {filter_class}\"> {filter_name}'+"," '</label> ',",""," /** "," * Classnames used by the templates when creating nodes."," *"," * @property CHROME_CLASSES"," * @type Object"," * @static"," * @protected"," */"," CHROME_CLASSES : {"," categories : getCN(CONSOLE,FILTERS,'categories'),"," sources : getCN(CONSOLE,FILTERS,'sources'),"," category : getCN(CONSOLE,FILTER,CATEGORY),"," source : getCN(CONSOLE,FILTER,SOURCE),"," filter : getCN(CONSOLE,FILTER),"," filter_label : getCN(CONSOLE,FILTER,'label')"," },",""," ATTRS : {"," /**"," * Default visibility applied to new categories and sources."," *"," * @attribute defaultVisibility"," * @type {Boolean}"," * @default true"," */"," defaultVisibility : {"," value : true,"," validator : Y.Lang.isBoolean"," },",""," /**"," * <p>Map of entry categories to their visibility status. Update a"," * particular category's visibility by setting the subattribute to true"," * (visible) or false (hidden).</p>"," *"," * <p>For example, yconsole.filter.set('category.info', false) to hide"," * log entries with the category/logLevel of 'info'.</p>"," *"," * <p>Similarly, yconsole.filter.get('category.warn') will return a"," * boolean indicating whether that category is currently being included"," * in the UI.</p>"," *"," * <p>Unlike the YUI instance configuration's logInclude and logExclude"," * properties, filtered entries are only hidden from the UI, but"," * can be made visible again.</p>"," *"," * @attribute category"," * @type Object"," */"," category : {"," value : {},"," validator : function (v,k) {"," return this._validateCategory(k,v);"," }"," },",""," /**"," * <p>Map of entry sources to their visibility status. Update a"," * particular sources's visibility by setting the subattribute to true"," * (visible) or false (hidden).</p>"," *"," * <p>For example, yconsole.filter.set('sources.slider', false) to hide"," * log entries originating from Y.Slider.</p>"," *"," * @attribute source"," * @type Object"," */"," source : {"," value : {},"," validator : function (v,k) {"," return this._validateSource(k,v);"," }"," },",""," /**"," * Maximum number of entries to store in the message cache. Use this to"," * limit the memory footprint in environments with heavy log usage."," * By default, there is no limit (Number.POSITIVE_INFINITY)."," *"," * @attribute cacheLimit"," * @type {Number}"," * @default Number.POSITIVE_INFINITY"," */"," cacheLimit : {"," value : Number.POSITIVE_INFINITY,"," setter : function (v) {"," return this._setCacheLimit(v);"," }"," }"," }","});","","","}, '3.7.1', {\"requires\": [\"plugin\", \"console\"], \"skinnable\": true});"];+_yuitest_coverage["build/console-filters/console-filters.js"].lines = {"1":0,"14":0,"37":0,"38":0,"41":0,"93":0,"95":0,"97":0,"98":0,"99":0,"101":0,"103":0,"104":0,"105":0,"106":0,"109":0,"121":0,"123":0,"124":0,"126":0,"127":0,"138":0,"141":0,"142":0,"146":0,"148":0,"152":0,"164":0,"166":0,"168":0,"169":0,"178":0,"179":0,"182":0,"183":0,"186":0,"200":0,"202":0,"209":0,"210":0,"213":0,"214":0,"215":0,"216":0,"219":0,"220":0,"221":0,"222":0,"225":0,"226":0,"237":0,"250":0,"255":0,"256":0,"258":0,"261":0,"262":0,"276":0,"281":0,"282":0,"284":0,"287":0,"288":0,"300":0,"306":0,"307":0,"308":0,"309":0,"310":0,"311":0,"314":0,"315":0,"327":0,"328":0,"330":0,"331":0,"343":0,"352":0,"353":0,"356":0,"357":0,"358":0,"359":0,"360":0,"364":0,"365":0,"366":0,"381":0,"382":0,"389":0,"390":0,"392":0,"394":0,"396":0,"399":0,"411":0,"413":0,"414":0,"415":0,"416":0,"429":0,"431":0,"432":0,"433":0,"434":0,"448":0,"449":0,"451":0,"464":0,"465":0,"467":0,"480":0,"481":0,"483":0,"496":0,"497":0,"499":0,"514":0,"521":0,"535":0,"549":0,"562":0,"563":0,"564":0,"566":0,"682":0,"700":0,"716":0};+_yuitest_coverage["build/console-filters/console-filters.js"].functions = {"ConsoleFilters:37":0,"initializer:92":0,"destructor:118":0,"renderUI:137":0,"bindUI:163":0,"(anonymous 2):178":0,"(anonymous 3):182":0,"syncUI:177":0,"_onEntry:199":0,"_afterClearConsole:236":0,"_afterCategoryChange:249":0,"_afterSourceChange:275":0,"_filterBuffer:299":0,"_afterCacheLimitChange:326":0,"refreshConsole:342":0,"_uiSetCheckbox:380":0,"_onCategoryCheckboxClick:410":0,"_onSourceCheckboxClick:428":0,"hideCategory:447":0,"showCategory:463":0,"hideSource:479":0,"showSource:495":0,"_createCheckbox:513":0,"_validateCategory:534":0,"_validateSource:548":0,"_setCacheLimit:561":0,"validator:681":0,"validator:699":0,"setter:715":0,"(anonymous 1):1":0};+_yuitest_coverage["build/console-filters/console-filters.js"].coveredLines = 128;+_yuitest_coverage["build/console-filters/console-filters.js"].coveredFunctions = 30;+_yuitest_coverline("build/console-filters/console-filters.js", 1);+YUI.add('console-filters', function (Y, NAME) {++/**+ * <p>Provides Plugin.ConsoleFilters plugin class.</p>+ *+ * <p>This plugin adds the ability to control which Console entries display by filtering on category and source. Two groups of checkboxes are added to the Console footer, one for categories and the other for sources. Only those messages that match a checked category or source are displayed.</p>+ *+ * @module console-filters+ * @namespace Plugin+ * @class ConsoleFilters+ */++// Some common strings and functions+_yuitest_coverfunc("build/console-filters/console-filters.js", "(anonymous 1)", 1);+_yuitest_coverline("build/console-filters/console-filters.js", 14);+var getCN = Y.ClassNameManager.getClassName,+ CONSOLE = 'console',+ FILTERS = 'filters',+ FILTER = 'filter',+ CATEGORY = 'category',+ SOURCE = 'source',+ CATEGORY_DOT = 'category.',+ SOURCE_DOT = 'source.',++ HOST = 'host',+ CHECKED = 'checked',+ DEF_VISIBILITY = 'defaultVisibility',++ DOT = '.',+ EMPTY = '',++ C_BODY = DOT + Y.Console.CHROME_CLASSES.console_bd_class,+ C_FOOT = DOT + Y.Console.CHROME_CLASSES.console_ft_class,++ SEL_CHECK = 'input[type=checkbox].',+ + isString = Y.Lang.isString;++_yuitest_coverline("build/console-filters/console-filters.js", 37);+function ConsoleFilters() {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "ConsoleFilters", 37);+_yuitest_coverline("build/console-filters/console-filters.js", 38);+ConsoleFilters.superclass.constructor.apply(this,arguments);+}++_yuitest_coverline("build/console-filters/console-filters.js", 41);+Y.namespace('Plugin').ConsoleFilters = Y.extend(ConsoleFilters, Y.Plugin.Base,++// Y.Plugin.ConsoleFilters prototype+{+ /**+ * Collection of all log messages passed through since the plugin's+ * instantiation. This holds all messages regardless of filter status.+ * Used as a single source of truth for repopulating the Console body when+ * filters are changed.+ *+ * @property _entries+ * @type Array+ * @protected+ */+ _entries : null,++ /**+ * Maximum number of entries to store in the message cache.+ *+ * @property _cacheLimit+ * @type {Number}+ * @default Infinity+ * @protected+ */+ _cacheLimit : Number.POSITIVE_INFINITY,++ /**+ * The container node created to house the category filters.+ *+ * @property _categories+ * @type Node+ * @protected+ */+ _categories : null,++ /**+ * The container node created to house the source filters.+ *+ * @property _sources+ * @type Node+ * @protected+ */+ _sources : null,++ /**+ * Initialize entries collection and attach listeners to host events and+ * methods.+ *+ * @method initializer+ * @protected+ */+ initializer : function () {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "initializer", 92);+_yuitest_coverline("build/console-filters/console-filters.js", 93);+this._entries = [];++ _yuitest_coverline("build/console-filters/console-filters.js", 95);+this.get(HOST).on("entry", this._onEntry, this);++ _yuitest_coverline("build/console-filters/console-filters.js", 97);+this.doAfter("renderUI", this.renderUI);+ _yuitest_coverline("build/console-filters/console-filters.js", 98);+this.doAfter("syncUI", this.syncUI);+ _yuitest_coverline("build/console-filters/console-filters.js", 99);+this.doAfter("bindUI", this.bindUI);++ _yuitest_coverline("build/console-filters/console-filters.js", 101);+this.doAfter("clearConsole", this._afterClearConsole);++ _yuitest_coverline("build/console-filters/console-filters.js", 103);+if (this.get(HOST).get('rendered')) {+ _yuitest_coverline("build/console-filters/console-filters.js", 104);+this.renderUI();+ _yuitest_coverline("build/console-filters/console-filters.js", 105);+this.syncUI();+ _yuitest_coverline("build/console-filters/console-filters.js", 106);+this.bindUI();+ }++ _yuitest_coverline("build/console-filters/console-filters.js", 109);+this.after("cacheLimitChange", this._afterCacheLimitChange);+ },++ /**+ * Removes the plugin UI and unwires events.+ *+ * @method destructor+ * @protected+ */+ destructor : function () {+ //TODO: grab last {consoleLimit} entries and update the console with+ //them (no filtering)+ _yuitest_coverfunc("build/console-filters/console-filters.js", "destructor", 118);+_yuitest_coverline("build/console-filters/console-filters.js", 121);+this._entries = [];++ _yuitest_coverline("build/console-filters/console-filters.js", 123);+if (this._categories) {+ _yuitest_coverline("build/console-filters/console-filters.js", 124);+this._categories.remove();+ }+ _yuitest_coverline("build/console-filters/console-filters.js", 126);+if (this._sources) {+ _yuitest_coverline("build/console-filters/console-filters.js", 127);+this._sources.remove();+ }+ },++ /**+ * Adds the category and source filter sections to the Console footer.+ *+ * @method renderUI+ * @protected+ */+ renderUI : function () {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "renderUI", 137);+_yuitest_coverline("build/console-filters/console-filters.js", 138);+var foot = this.get(HOST).get('contentBox').one(C_FOOT),+ html;++ _yuitest_coverline("build/console-filters/console-filters.js", 141);+if (foot) {+ _yuitest_coverline("build/console-filters/console-filters.js", 142);+html = Y.Lang.sub(+ ConsoleFilters.CATEGORIES_TEMPLATE,+ ConsoleFilters.CHROME_CLASSES);++ _yuitest_coverline("build/console-filters/console-filters.js", 146);+this._categories = foot.appendChild(Y.Node.create(html));++ _yuitest_coverline("build/console-filters/console-filters.js", 148);+html = Y.Lang.sub(+ ConsoleFilters.SOURCES_TEMPLATE,+ ConsoleFilters.CHROME_CLASSES);++ _yuitest_coverline("build/console-filters/console-filters.js", 152);+this._sources = foot.appendChild(Y.Node.create(html));+ }+ },++ /**+ * Binds to checkbox click events and internal attribute change events to+ * maintain the UI state.+ *+ * @method bindUI+ * @protected+ */+ bindUI : function () {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "bindUI", 163);+_yuitest_coverline("build/console-filters/console-filters.js", 164);+this._categories.on('click', Y.bind(this._onCategoryCheckboxClick, this));++ _yuitest_coverline("build/console-filters/console-filters.js", 166);+this._sources.on('click', Y.bind(this._onSourceCheckboxClick, this));+ + _yuitest_coverline("build/console-filters/console-filters.js", 168);+this.after('categoryChange',this._afterCategoryChange);+ _yuitest_coverline("build/console-filters/console-filters.js", 169);+this.after('sourceChange', this._afterSourceChange);+ },++ /**+ * Updates the UI to be in accordance with the current state of the plugin.+ *+ * @method syncUI+ */+ syncUI : function () {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "syncUI", 177);+_yuitest_coverline("build/console-filters/console-filters.js", 178);+Y.each(this.get(CATEGORY), function (v, k) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "(anonymous 2)", 178);+_yuitest_coverline("build/console-filters/console-filters.js", 179);+this._uiSetCheckbox(CATEGORY, k, v);+ }, this);++ _yuitest_coverline("build/console-filters/console-filters.js", 182);+Y.each(this.get(SOURCE), function (v, k) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "(anonymous 3)", 182);+_yuitest_coverline("build/console-filters/console-filters.js", 183);+this._uiSetCheckbox(SOURCE, k, v);+ }, this);++ _yuitest_coverline("build/console-filters/console-filters.js", 186);+this.refreshConsole();+ },++ /**+ * Ensures a filter is set up for any new categories or sources and+ * collects the messages in _entries. If the message is stamped with a+ * category or source that is currently being filtered out, the message+ * will not pass to the Console's print buffer.+ *+ * @method _onEntry+ * @param e {Event} the custom event object+ * @protected+ */+ _onEntry : function (e) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "_onEntry", 199);+_yuitest_coverline("build/console-filters/console-filters.js", 200);+this._entries.push(e.message);+ + _yuitest_coverline("build/console-filters/console-filters.js", 202);+var cat = CATEGORY_DOT + e.message.category,+ src = SOURCE_DOT + e.message.source,+ cat_filter = this.get(cat),+ src_filter = this.get(src),+ overLimit = this._entries.length - this._cacheLimit,+ visible;++ _yuitest_coverline("build/console-filters/console-filters.js", 209);+if (overLimit > 0) {+ _yuitest_coverline("build/console-filters/console-filters.js", 210);+this._entries.splice(0, overLimit);+ }++ _yuitest_coverline("build/console-filters/console-filters.js", 213);+if (cat_filter === undefined) {+ _yuitest_coverline("build/console-filters/console-filters.js", 214);+visible = this.get(DEF_VISIBILITY);+ _yuitest_coverline("build/console-filters/console-filters.js", 215);+this.set(cat, visible);+ _yuitest_coverline("build/console-filters/console-filters.js", 216);+cat_filter = visible;+ }++ _yuitest_coverline("build/console-filters/console-filters.js", 219);+if (src_filter === undefined) {+ _yuitest_coverline("build/console-filters/console-filters.js", 220);+visible = this.get(DEF_VISIBILITY);+ _yuitest_coverline("build/console-filters/console-filters.js", 221);+this.set(src, visible);+ _yuitest_coverline("build/console-filters/console-filters.js", 222);+src_filter = visible;+ }+ + _yuitest_coverline("build/console-filters/console-filters.js", 225);+if (!cat_filter || !src_filter) {+ _yuitest_coverline("build/console-filters/console-filters.js", 226);+e.preventDefault();+ }+ },++ /**+ * Flushes the cached entries after a call to the Console's clearConsole().+ *+ * @method _afterClearConsole+ * @protected+ */+ _afterClearConsole : function () {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "_afterClearConsole", 236);+_yuitest_coverline("build/console-filters/console-filters.js", 237);+this._entries = [];+ },++ /**+ * Triggers the Console to update if a known category filter+ * changes value (e.g. visible => hidden). Updates the appropriate+ * checkbox's checked state if necessary.+ *+ * @method _afterCategoryChange+ * @param e {Event} the attribute change event object+ * @protected+ */+ _afterCategoryChange : function (e) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "_afterCategoryChange", 249);+_yuitest_coverline("build/console-filters/console-filters.js", 250);+var cat = e.subAttrName.replace(/category\./, EMPTY),+ before = e.prevVal,+ after = e.newVal;++ // Don't update the console for new categories+ _yuitest_coverline("build/console-filters/console-filters.js", 255);+if (!cat || before[cat] !== undefined) {+ _yuitest_coverline("build/console-filters/console-filters.js", 256);+this.refreshConsole();++ _yuitest_coverline("build/console-filters/console-filters.js", 258);+this._filterBuffer();+ }++ _yuitest_coverline("build/console-filters/console-filters.js", 261);+if (cat && !e.fromUI) {+ _yuitest_coverline("build/console-filters/console-filters.js", 262);+this._uiSetCheckbox(CATEGORY, cat, after[cat]);+ }+ },++ /**+ * Triggers the Console to update if a known source filter+ * changes value (e.g. visible => hidden). Updates the appropriate+ * checkbox's checked state if necessary.+ *+ * @method _afterSourceChange+ * @param e {Event} the attribute change event object+ * @protected+ */+ _afterSourceChange : function (e) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "_afterSourceChange", 275);+_yuitest_coverline("build/console-filters/console-filters.js", 276);+var src = e.subAttrName.replace(/source\./, EMPTY),+ before = e.prevVal,+ after = e.newVal;++ // Don't update the console for new sources+ _yuitest_coverline("build/console-filters/console-filters.js", 281);+if (!src || before[src] !== undefined) {+ _yuitest_coverline("build/console-filters/console-filters.js", 282);+this.refreshConsole();++ _yuitest_coverline("build/console-filters/console-filters.js", 284);+this._filterBuffer();+ }++ _yuitest_coverline("build/console-filters/console-filters.js", 287);+if (src && !e.fromUI) {+ _yuitest_coverline("build/console-filters/console-filters.js", 288);+this._uiSetCheckbox(SOURCE, src, after[src]);+ }+ },++ /**+ * Flushes the Console's print buffer of any entries that have a category+ * or source that is currently being excluded.+ *+ * @method _filterBuffer+ * @protected+ */+ _filterBuffer : function () {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "_filterBuffer", 299);+_yuitest_coverline("build/console-filters/console-filters.js", 300);+var cats = this.get(CATEGORY),+ srcs = this.get(SOURCE),+ buffer = this.get(HOST).buffer,+ start = null,+ i;++ _yuitest_coverline("build/console-filters/console-filters.js", 306);+for (i = buffer.length - 1; i >= 0; --i) {+ _yuitest_coverline("build/console-filters/console-filters.js", 307);+if (!cats[buffer[i].category] || !srcs[buffer[i].source]) {+ _yuitest_coverline("build/console-filters/console-filters.js", 308);+start = start || i;+ } else {_yuitest_coverline("build/console-filters/console-filters.js", 309);+if (start) {+ _yuitest_coverline("build/console-filters/console-filters.js", 310);+buffer.splice(i,(start - i));+ _yuitest_coverline("build/console-filters/console-filters.js", 311);+start = null;+ }}+ }+ _yuitest_coverline("build/console-filters/console-filters.js", 314);+if (start) {+ _yuitest_coverline("build/console-filters/console-filters.js", 315);+buffer.splice(0,start + 1);+ }+ },++ /**+ * Trims the cache of entries to the appropriate new length.+ *+ * @method _afterCacheLimitChange + * @param e {Event} the attribute change event object+ * @protected+ */+ _afterCacheLimitChange : function (e) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "_afterCacheLimitChange", 326);+_yuitest_coverline("build/console-filters/console-filters.js", 327);+if (isFinite(e.newVal)) {+ _yuitest_coverline("build/console-filters/console-filters.js", 328);+var delta = this._entries.length - e.newVal;++ _yuitest_coverline("build/console-filters/console-filters.js", 330);+if (delta > 0) {+ _yuitest_coverline("build/console-filters/console-filters.js", 331);+this._entries.splice(0,delta);+ }+ }+ },++ /**+ * Repopulates the Console with entries appropriate to the current filter+ * settings.+ *+ * @method refreshConsole+ */+ refreshConsole : function () {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "refreshConsole", 342);+_yuitest_coverline("build/console-filters/console-filters.js", 343);+var entries = this._entries,+ host = this.get(HOST),+ body = host.get('contentBox').one(C_BODY),+ remaining = host.get('consoleLimit'),+ cats = this.get(CATEGORY),+ srcs = this.get(SOURCE),+ buffer = [],+ i,e;++ _yuitest_coverline("build/console-filters/console-filters.js", 352);+if (body) {+ _yuitest_coverline("build/console-filters/console-filters.js", 353);+host._cancelPrintLoop();++ // Evaluate all entries from latest to oldest+ _yuitest_coverline("build/console-filters/console-filters.js", 356);+for (i = entries.length - 1; i >= 0 && remaining >= 0; --i) {+ _yuitest_coverline("build/console-filters/console-filters.js", 357);+e = entries[i];+ _yuitest_coverline("build/console-filters/console-filters.js", 358);+if (cats[e.category] && srcs[e.source]) {+ _yuitest_coverline("build/console-filters/console-filters.js", 359);+buffer.unshift(e);+ _yuitest_coverline("build/console-filters/console-filters.js", 360);+--remaining;+ }+ }++ _yuitest_coverline("build/console-filters/console-filters.js", 364);+body.setHTML(EMPTY);+ _yuitest_coverline("build/console-filters/console-filters.js", 365);+host.buffer = buffer;+ _yuitest_coverline("build/console-filters/console-filters.js", 366);+host.printBuffer();+ }+ },++ /**+ * Updates the checked property of a filter checkbox of the specified type.+ * If no checkbox is found for the input params, one is created.+ *+ * @method _uiSetCheckbox+ * @param type {String} 'category' or 'source'+ * @param item {String} the name of the filter (e.g. 'info', 'event')+ * @param checked {Boolean} value to set the checkbox's checked property+ * @protected+ */+ _uiSetCheckbox : function (type, item, checked) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "_uiSetCheckbox", 380);+_yuitest_coverline("build/console-filters/console-filters.js", 381);+if (type && item) {+ _yuitest_coverline("build/console-filters/console-filters.js", 382);+var container = type === CATEGORY ?+ this._categories :+ this._sources,+ sel = SEL_CHECK + getCN(CONSOLE,FILTER,item),+ checkbox = container.one(sel),+ host;+ + _yuitest_coverline("build/console-filters/console-filters.js", 389);+if (!checkbox) {+ _yuitest_coverline("build/console-filters/console-filters.js", 390);+host = this.get(HOST);++ _yuitest_coverline("build/console-filters/console-filters.js", 392);+this._createCheckbox(container, item);++ _yuitest_coverline("build/console-filters/console-filters.js", 394);+checkbox = container.one(sel);++ _yuitest_coverline("build/console-filters/console-filters.js", 396);+host._uiSetHeight(host.get('height'));+ }+ + _yuitest_coverline("build/console-filters/console-filters.js", 399);+checkbox.set(CHECKED, checked);+ }+ },++ /**+ * Passes checkbox clicks on to the category attribute.+ *+ * @method _onCategoryCheckboxClick+ * @param e {Event} the DOM event+ * @protected+ */+ _onCategoryCheckboxClick : function (e) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "_onCategoryCheckboxClick", 410);+_yuitest_coverline("build/console-filters/console-filters.js", 411);+var t = e.target, cat;++ _yuitest_coverline("build/console-filters/console-filters.js", 413);+if (t.hasClass(ConsoleFilters.CHROME_CLASSES.filter)) {+ _yuitest_coverline("build/console-filters/console-filters.js", 414);+cat = t.get('value');+ _yuitest_coverline("build/console-filters/console-filters.js", 415);+if (cat && cat in this.get(CATEGORY)) {+ _yuitest_coverline("build/console-filters/console-filters.js", 416);+this.set(CATEGORY_DOT + cat, t.get(CHECKED), { fromUI: true });+ }+ }+ },++ /**+ * Passes checkbox clicks on to the source attribute.+ *+ * @method _onSourceCheckboxClick+ * @param e {Event} the DOM event+ * @protected+ */+ _onSourceCheckboxClick : function (e) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "_onSourceCheckboxClick", 428);+_yuitest_coverline("build/console-filters/console-filters.js", 429);+var t = e.target, src;++ _yuitest_coverline("build/console-filters/console-filters.js", 431);+if (t.hasClass(ConsoleFilters.CHROME_CLASSES.filter)) {+ _yuitest_coverline("build/console-filters/console-filters.js", 432);+src = t.get('value');+ _yuitest_coverline("build/console-filters/console-filters.js", 433);+if (src && src in this.get(SOURCE)) {+ _yuitest_coverline("build/console-filters/console-filters.js", 434);+this.set(SOURCE_DOT + src, t.get(CHECKED), { fromUI: true });+ }+ }+ },++ /**+ * Hides any number of categories from the UI. Convenience method for+ * myConsole.filter.set('category.foo', false); set('category.bar', false);+ * and so on.+ *+ * @method hideCategory+ * @param cat* {String} 1..n categories to filter out of the UI+ */+ hideCategory : function (cat, multiple) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "hideCategory", 447);+_yuitest_coverline("build/console-filters/console-filters.js", 448);+if (isString(multiple)) {+ _yuitest_coverline("build/console-filters/console-filters.js", 449);+Y.Array.each(arguments, this.hideCategory, this);+ } else {+ _yuitest_coverline("build/console-filters/console-filters.js", 451);+this.set(CATEGORY_DOT + cat, false);+ }+ },++ /**+ * Shows any number of categories in the UI. Convenience method for+ * myConsole.filter.set('category.foo', true); set('category.bar', true);+ * and so on.+ *+ * @method showCategory+ * @param cat* {String} 1..n categories to allow to display in the UI+ */+ showCategory : function (cat, multiple) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "showCategory", 463);+_yuitest_coverline("build/console-filters/console-filters.js", 464);+if (isString(multiple)) {+ _yuitest_coverline("build/console-filters/console-filters.js", 465);+Y.Array.each(arguments, this.showCategory, this);+ } else {+ _yuitest_coverline("build/console-filters/console-filters.js", 467);+this.set(CATEGORY_DOT + cat, true);+ }+ },++ /**+ * Hides any number of sources from the UI. Convenience method for+ * myConsole.filter.set('source.foo', false); set('source.bar', false);+ * and so on.+ *+ * @method hideSource+ * @param src* {String} 1..n sources to filter out of the UI+ */+ hideSource : function (src, multiple) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "hideSource", 479);+_yuitest_coverline("build/console-filters/console-filters.js", 480);+if (isString(multiple)) {+ _yuitest_coverline("build/console-filters/console-filters.js", 481);+Y.Array.each(arguments, this.hideSource, this);+ } else {+ _yuitest_coverline("build/console-filters/console-filters.js", 483);+this.set(SOURCE_DOT + src, false);+ }+ },++ /**+ * Shows any number of sources in the UI. Convenience method for+ * myConsole.filter.set('source.foo', true); set('source.bar', true);+ * and so on.+ *+ * @method showSource+ * @param src* {String} 1..n sources to allow to display in the UI+ */+ showSource : function (src, multiple) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "showSource", 495);+_yuitest_coverline("build/console-filters/console-filters.js", 496);+if (isString(multiple)) {+ _yuitest_coverline("build/console-filters/console-filters.js", 497);+Y.Array.each(arguments, this.showSource, this);+ } else {+ _yuitest_coverline("build/console-filters/console-filters.js", 499);+this.set(SOURCE_DOT + src, true);+ }+ },++ /**+ * Creates a checkbox and label from the ConsoleFilters.FILTER_TEMPLATE for+ * the provided type and name. The checkbox and label are appended to the+ * container node passes as the first arg.+ *+ * @method _createCheckbox+ * @param container {Node} the parentNode of the new checkbox and label+ * @param name {String} the identifier of the filter+ * @protected+ */+ _createCheckbox : function (container, name) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "_createCheckbox", 513);+_yuitest_coverline("build/console-filters/console-filters.js", 514);+var info = Y.merge(ConsoleFilters.CHROME_CLASSES, {+ filter_name : name,+ filter_class : getCN(CONSOLE, FILTER, name)+ }),+ node = Y.Node.create(+ Y.Lang.sub(ConsoleFilters.FILTER_TEMPLATE, info));++ _yuitest_coverline("build/console-filters/console-filters.js", 521);+container.appendChild(node);+ },++ /**+ * Validates category updates are objects and the subattribute is not too+ * deep.+ *+ * @method _validateCategory+ * @param cat {String} the new category:visibility map+ * @param v {String} the subattribute path updated+ * @return Boolean+ * @protected+ */+ _validateCategory : function (cat, v) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "_validateCategory", 534);+_yuitest_coverline("build/console-filters/console-filters.js", 535);+return Y.Lang.isObject(v,true) && cat.split(/\./).length < 3;+ },++ /**+ * Validates source updates are objects and the subattribute is not too+ * deep.+ *+ * @method _validateSource+ * @param cat {String} the new source:visibility map+ * @param v {String} the subattribute path updated+ * @return Boolean+ * @protected+ */+ _validateSource : function (src, v) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "_validateSource", 548);+_yuitest_coverline("build/console-filters/console-filters.js", 549);+return Y.Lang.isObject(v,true) && src.split(/\./).length < 3;+ },++ /**+ * Setter method for cacheLimit attribute. Basically a validator to ensure+ * numeric input.+ *+ * @method _setCacheLimit+ * @param v {Number} Maximum number of entries+ * @return {Number}+ * @protected+ */+ _setCacheLimit: function (v) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "_setCacheLimit", 561);+_yuitest_coverline("build/console-filters/console-filters.js", 562);+if (Y.Lang.isNumber(v)) {+ _yuitest_coverline("build/console-filters/console-filters.js", 563);+this._cacheLimit = v;+ _yuitest_coverline("build/console-filters/console-filters.js", 564);+return v;+ } else {+ _yuitest_coverline("build/console-filters/console-filters.js", 566);+return Y.Attribute.INVALID_VALUE;+ }+ }+},++// Y.Plugin.ConsoleFilters static properties+{+ /**+ * Plugin name.+ *+ * @property NAME+ * @type String+ * @static+ * @default 'consoleFilters'+ */+ NAME : 'consoleFilters',++ /**+ * The namespace hung off the host object that this plugin will inhabit.+ *+ * @property NS+ * @type String+ * @static+ * @default 'filter'+ */+ NS : FILTER,++ /**+ * Markup template used to create the container for the category filters.+ *+ * @property CATEGORIES_TEMPLATE+ * @type String+ * @static+ */+ CATEGORIES_TEMPLATE :+ '<div class="{categories}"></div>',++ /**+ * Markup template used to create the container for the source filters.+ *+ * @property SOURCES_TEMPLATE+ * @type String+ * @static+ */+ SOURCES_TEMPLATE :+ '<div class="{sources}"></div>',++ /**+ * Markup template used to create the category and source filter checkboxes.+ *+ * @property FILTER_TEMPLATE+ * @type String+ * @static+ */+ FILTER_TEMPLATE :+ // IE8 and FF3 don't permit breaking _between_ nowrap elements. IE8+ // doesn't understand (non spec) wbr tag, nor does it create text nodes+ // for spaces in innerHTML strings. The thin-space entity suffices to+ // create a breakable point.+ '<label class="{filter_label}">'++ '<input type="checkbox" value="{filter_name}" '++ 'class="{filter} {filter_class}"> {filter_name}'++ '</label> ',++ /** + * Classnames used by the templates when creating nodes.+ *+ * @property CHROME_CLASSES+ * @type Object+ * @static+ * @protected+ */+ CHROME_CLASSES : {+ categories : getCN(CONSOLE,FILTERS,'categories'),+ sources : getCN(CONSOLE,FILTERS,'sources'),+ category : getCN(CONSOLE,FILTER,CATEGORY),+ source : getCN(CONSOLE,FILTER,SOURCE),+ filter : getCN(CONSOLE,FILTER),+ filter_label : getCN(CONSOLE,FILTER,'label')+ },++ ATTRS : {+ /**+ * Default visibility applied to new categories and sources.+ *+ * @attribute defaultVisibility+ * @type {Boolean}+ * @default true+ */+ defaultVisibility : {+ value : true,+ validator : Y.Lang.isBoolean+ },++ /**+ * <p>Map of entry categories to their visibility status. Update a+ * particular category's visibility by setting the subattribute to true+ * (visible) or false (hidden).</p>+ *+ * <p>For example, yconsole.filter.set('category.info', false) to hide+ * log entries with the category/logLevel of 'info'.</p>+ *+ * <p>Similarly, yconsole.filter.get('category.warn') will return a+ * boolean indicating whether that category is currently being included+ * in the UI.</p>+ *+ * <p>Unlike the YUI instance configuration's logInclude and logExclude+ * properties, filtered entries are only hidden from the UI, but+ * can be made visible again.</p>+ *+ * @attribute category+ * @type Object+ */+ category : {+ value : {},+ validator : function (v,k) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "validator", 681);+_yuitest_coverline("build/console-filters/console-filters.js", 682);+return this._validateCategory(k,v);+ }+ },++ /**+ * <p>Map of entry sources to their visibility status. Update a+ * particular sources's visibility by setting the subattribute to true+ * (visible) or false (hidden).</p>+ *+ * <p>For example, yconsole.filter.set('sources.slider', false) to hide+ * log entries originating from Y.Slider.</p>+ *+ * @attribute source+ * @type Object+ */+ source : {+ value : {},+ validator : function (v,k) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "validator", 699);+_yuitest_coverline("build/console-filters/console-filters.js", 700);+return this._validateSource(k,v);+ }+ },++ /**+ * Maximum number of entries to store in the message cache. Use this to+ * limit the memory footprint in environments with heavy log usage.+ * By default, there is no limit (Number.POSITIVE_INFINITY).+ *+ * @attribute cacheLimit+ * @type {Number}+ * @default Number.POSITIVE_INFINITY+ */+ cacheLimit : {+ value : Number.POSITIVE_INFINITY,+ setter : function (v) {+ _yuitest_coverfunc("build/console-filters/console-filters.js", "setter", 715);+_yuitest_coverline("build/console-filters/console-filters.js", 716);+return this._setCacheLimit(v);+ }+ }+ }+});+++}, '3.7.1', {"requires": ["plugin", "console"], "skinnable": true});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('console-filters', function(Y) {+YUI.add('console-filters', function (Y, NAME) { /** * <p>Provides Plugin.ConsoleFilters plugin class.</p>@@ -145,13 +145,13 @@ html; if (foot) {- html = Y.substitute(+ html = Y.Lang.sub( ConsoleFilters.CATEGORIES_TEMPLATE, ConsoleFilters.CHROME_CLASSES); this._categories = foot.appendChild(Y.Node.create(html)); - html = Y.substitute(+ html = Y.Lang.sub( ConsoleFilters.SOURCES_TEMPLATE, ConsoleFilters.CHROME_CLASSES); @@ -367,7 +367,7 @@ } } - body.setContent(EMPTY);+ body.setHTML(EMPTY); host.buffer = buffer; host.printBuffer(); }@@ -522,7 +522,7 @@ filter_class : getCN(CONSOLE, FILTER, name) }), node = Y.Node.create(- Y.substitute(ConsoleFilters.FILTER_TEMPLATE, info));+ Y.Lang.sub(ConsoleFilters.FILTER_TEMPLATE, info)); container.appendChild(node); },@@ -726,4 +726,4 @@ }); -}, '3.5.1' ,{requires:['console','plugin']});+}, '3.7.1', {"requires": ["plugin", "console"], "skinnable": true});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("console-filters",function(c){var p=c.ClassNameManager.getClassName,g="console",b="filters",k="filter",f="category",d="source",e="category.",l="source.",o="host",q="checked",n="defaultVisibility",m=".",s="",r=m+c.Console.CHROME_CLASSES.console_bd_class,h=m+c.Console.CHROME_CLASSES.console_ft_class,a="input[type=checkbox].",i=c.Lang.isString;function j(){j.superclass.constructor.apply(this,arguments);}c.namespace("Plugin").ConsoleFilters=c.extend(j,c.Plugin.Base,{_entries:null,_cacheLimit:Number.POSITIVE_INFINITY,_categories:null,_sources:null,initializer:function(){this._entries=[];this.get(o).on("entry",this._onEntry,this);this.doAfter("renderUI",this.renderUI);this.doAfter("syncUI",this.syncUI);this.doAfter("bindUI",this.bindUI);this.doAfter("clearConsole",this._afterClearConsole);if(this.get(o).get("rendered")){this.renderUI();this.syncUI();this.bindUI();}this.after("cacheLimitChange",this._afterCacheLimitChange);},destructor:function(){this._entries=[];if(this._categories){this._categories.remove();}if(this._sources){this._sources.remove();}},renderUI:function(){var u=this.get(o).get("contentBox").one(h),t;if(u){t=c.substitute(j.CATEGORIES_TEMPLATE,j.CHROME_CLASSES);this._categories=u.appendChild(c.Node.create(t));t=c.substitute(j.SOURCES_TEMPLATE,j.CHROME_CLASSES);this._sources=u.appendChild(c.Node.create(t));}},bindUI:function(){this._categories.on("click",c.bind(this._onCategoryCheckboxClick,this));this._sources.on("click",c.bind(this._onSourceCheckboxClick,this));this.after("categoryChange",this._afterCategoryChange);this.after("sourceChange",this._afterSourceChange);},syncUI:function(){c.each(this.get(f),function(u,t){this._uiSetCheckbox(f,t,u);},this);c.each(this.get(d),function(u,t){this._uiSetCheckbox(d,t,u);},this);this.refreshConsole();},_onEntry:function(w){this._entries.push(w.message);var t=e+w.message.category,y=l+w.message.source,u=this.get(t),z=this.get(y),v=this._entries.length-this._cacheLimit,x;if(v>0){this._entries.splice(0,v);}if(u===undefined){x=this.get(n);this.set(t,x);u=x;}if(z===undefined){x=this.get(n);this.set(y,x);z=x;}if(!u||!z){w.preventDefault();}},_afterClearConsole:function(){this._entries=[];},_afterCategoryChange:function(v){var t=v.subAttrName.replace(/category\./,s),u=v.prevVal,w=v.newVal;if(!t||u[t]!==undefined){this.refreshConsole();this._filterBuffer();}if(t&&!v.fromUI){this._uiSetCheckbox(f,t,w[t]);}},_afterSourceChange:function(u){var w=u.subAttrName.replace(/source\./,s),t=u.prevVal,v=u.newVal;if(!w||t[w]!==undefined){this.refreshConsole();this._filterBuffer();}if(w&&!u.fromUI){this._uiSetCheckbox(d,w,v[w]);}},_filterBuffer:function(){var u=this.get(f),w=this.get(d),t=this.get(o).buffer,x=null,v;for(v=t.length-1;v>=0;--v){if(!u[t[v].category]||!w[t[v].source]){x=x||v;}else{if(x){t.splice(v,(x-v));x=null;}}}if(x){t.splice(0,x+1);}},_afterCacheLimitChange:function(t){if(isFinite(t.newVal)){var u=this._entries.length-t.newVal;if(u>0){this._entries.splice(0,u);}}},refreshConsole:function(){var x=this._entries,B=this.get(o),y=B.get("contentBox").one(r),u=B.get("consoleLimit"),A=this.get(f),t=this.get(d),v=[],w,z;if(y){B._cancelPrintLoop();for(w=x.length-1;w>=0&&u>=0;--w){z=x[w];if(A[z.category]&&t[z.source]){v.unshift(z);--u;}}y.setContent(s);B.buffer=v;B.printBuffer();}},_uiSetCheckbox:function(u,x,w){if(u&&x){var t=u===f?this._categories:this._sources,z=a+p(g,k,x),y=t.one(z),v;if(!y){v=this.get(o);this._createCheckbox(t,x);y=t.one(z);v._uiSetHeight(v.get("height"));}y.set(q,w);}},_onCategoryCheckboxClick:function(w){var v=w.target,u;if(v.hasClass(j.CHROME_CLASSES.filter)){u=v.get("value");if(u&&u in this.get(f)){this.set(e+u,v.get(q),{fromUI:true});}}},_onSourceCheckboxClick:function(v){var u=v.target,w;if(u.hasClass(j.CHROME_CLASSES.filter)){w=u.get("value");if(w&&w in this.get(d)){this.set(l+w,u.get(q),{fromUI:true});}}},hideCategory:function(u,t){if(i(t)){c.Array.each(arguments,this.hideCategory,this);}else{this.set(e+u,false);}},showCategory:function(u,t){if(i(t)){c.Array.each(arguments,this.showCategory,this);}else{this.set(e+u,true);}},hideSource:function(u,t){if(i(t)){c.Array.each(arguments,this.hideSource,this);}else{this.set(l+u,false);}},showSource:function(u,t){if(i(t)){c.Array.each(arguments,this.showSource,this);}else{this.set(l+u,true);}},_createCheckbox:function(t,u){var w=c.merge(j.CHROME_CLASSES,{filter_name:u,filter_class:p(g,k,u)}),v=c.Node.create(c.substitute(j.FILTER_TEMPLATE,w));t.appendChild(v);},_validateCategory:function(t,u){return c.Lang.isObject(u,true)&&t.split(/\./).length<3;},_validateSource:function(u,t){return c.Lang.isObject(t,true)&&u.split(/\./).length<3;},_setCacheLimit:function(t){if(c.Lang.isNumber(t)){this._cacheLimit=t;return t;}else{return c.Attribute.INVALID_VALUE;}}},{NAME:"consoleFilters",NS:k,CATEGORIES_TEMPLATE:'<div class="{categories}"></div>',SOURCES_TEMPLATE:'<div class="{sources}"></div>',FILTER_TEMPLATE:'<label class="{filter_label}">'+'<input type="checkbox" value="{filter_name}" '+'class="{filter} {filter_class}"> {filter_name}'+"</label> ",CHROME_CLASSES:{categories:p(g,b,"categories"),sources:p(g,b,"sources"),category:p(g,k,f),source:p(g,k,d),filter:p(g,k),filter_label:p(g,k,"label")},ATTRS:{defaultVisibility:{value:true,validator:c.Lang.isBoolean},category:{value:{},validator:function(u,t){return this._validateCategory(t,u);}},source:{value:{},validator:function(u,t){return this._validateSource(t,u);}},cacheLimit:{value:Number.POSITIVE_INFINITY,setter:function(t){return this._setCacheLimit(t);}}}});},"3.5.1",{requires:["console","plugin"]});+YUI.add("console-filters",function(e,t){function b(){b.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r="console",i="filters",s="filter",o="category",u="source",a="category.",f="source.",l="host",c="checked",h="defaultVisibility",p=".",d="",v=p+e.Console.CHROME_CLASSES.console_bd_class,m=p+e.Console.CHROME_CLASSES.console_ft_class,g="input[type=checkbox].",y=e.Lang.isString;e.namespace("Plugin").ConsoleFilters=e.extend(b,e.Plugin.Base,{_entries:null,_cacheLimit:Number.POSITIVE_INFINITY,_categories:null,_sources:null,initializer:function(){this._entries=[],this.get(l).on("entry",this._onEntry,this),this.doAfter("renderUI",this.renderUI),this.doAfter("syncUI",this.syncUI),this.doAfter("bindUI",this.bindUI),this.doAfter("clearConsole",this._afterClearConsole),this.get(l).get("rendered")&&(this.renderUI(),this.syncUI(),this.bindUI()),this.after("cacheLimitChange",this._afterCacheLimitChange)},destructor:function(){this._entries=[],this._categories&&this._categories.remove(),this._sources&&this._sources.remove()},renderUI:function(){var t=this.get(l).get("contentBox").one(m),n;t&&(n=e.Lang.sub(b.CATEGORIES_TEMPLATE,b.CHROME_CLASSES),this._categories=t.appendChild(e.Node.create(n)),n=e.Lang.sub(b.SOURCES_TEMPLATE,b.CHROME_CLASSES),this._sources=t.appendChild(e.Node.create(n)))},bindUI:function(){this._categories.on("click",e.bind(this._onCategoryCheckboxClick,this)),this._sources.on("click",e.bind(this._onSourceCheckboxClick,this)),this.after("categoryChange",this._afterCategoryChange),this.after("sourceChange",this._afterSourceChange)},syncUI:function(){e.each(this.get(o),function(e,t){this._uiSetCheckbox(o,t,e)},this),e.each(this.get(u),function(e,t){this._uiSetCheckbox(u,t,e)},this),this.refreshConsole()},_onEntry:function(e){this._entries.push(e.message);var t=a+e.message.category,n=f+e.message.source,r=this.get(t),i=this.get(n),s=this._entries.length-this._cacheLimit,o;s>0&&this._entries.splice(0,s),r===undefined&&(o=this.get(h),this.set(t,o),r=o),i===undefined&&(o=this.get(h),this.set(n,o),i=o),(!r||!i)&&e.preventDefault()},_afterClearConsole:function(){this._entries=[]},_afterCategoryChange:function(e){var t=e.subAttrName.replace(/category\./,d),n=e.prevVal,r=e.newVal;if(!t||n[t]!==undefined)this.refreshConsole(),this._filterBuffer();t&&!e.fromUI&&this._uiSetCheckbox(o,t,r[t])},_afterSourceChange:function(e){var t=e.subAttrName.replace(/source\./,d),n=e.prevVal,r=e.newVal;if(!t||n[t]!==undefined)this.refreshConsole(),this._filterBuffer();t&&!e.fromUI&&this._uiSetCheckbox(u,t,r[t])},_filterBuffer:function(){var e=this.get(o),t=this.get(u),n=this.get(l).buffer,r=null,i;for(i=n.length-1;i>=0;--i)!e[n[i].category]||!t[n[i].source]?r=r||i:r&&(n.splice(i,r-i),r=null);r&&n.splice(0,r+1)},_afterCacheLimitChange:function(e){if(isFinite(e.newVal)){var t=this._entries.length-e.newVal;t>0&&this._entries.splice(0,t)}},refreshConsole:function(){var e=this._entries,t=this.get(l),n=t.get("contentBox").one(v),r=t.get("consoleLimit"),i=this.get(o),s=this.get(u),a=[],f,c;if(n){t._cancelPrintLoop();for(f=e.length-1;f>=0&&r>=0;--f)c=e[f],i[c.category]&&s[c.source]&&(a.unshift(c),--r);n.setHTML(d),t.buffer=a,t.printBuffer()}},_uiSetCheckbox:function(e,t,i){if(e&&t){var u=e===o?this._categories:this._sources,a=g+n(r,s,t),f=u.one(a),h;f||(h=this.get(l),this._createCheckbox(u,t),f=u.one(a),h._uiSetHeight(h.get("height"))),f.set(c,i)}},_onCategoryCheckboxClick:function(e){var t=e.target,n;t.hasClass(b.CHROME_CLASSES.filter)&&(n=t.get("value"),n&&n in this.get(o)&&this.set(a+n,t.get(c),{fromUI:!0}))},_onSourceCheckboxClick:function(e){var t=e.target,n;t.hasClass(b.CHROME_CLASSES.filter)&&(n=t.get("value"),n&&n in this.get(u)&&this.set(f+n,t.get(c),{fromUI:!0}))},hideCategory:function(t,n){y(n)?e.Array.each(arguments,this.hideCategory,this):this.set(a+t,!1)},showCategory:function(t,n){y(n)?e.Array.each(arguments,this.showCategory,this):this.set(a+t,!0)},hideSource:function(t,n){y(n)?e.Array.each(arguments,this.hideSource,this):this.set(f+t,!1)},showSource:function(t,n){y(n)?e.Array.each(arguments,this.showSource,this):this.set(f+t,!0)},_createCheckbox:function(t,i){var o=e.merge(b.CHROME_CLASSES,{filter_name:i,filter_class:n(r,s,i)}),u=e.Node.create(e.Lang.sub(b.FILTER_TEMPLATE,o));t.appendChild(u)},_validateCategory:function(t,n){return e.Lang.isObject(n,!0)&&t.split(/\./).length<3},_validateSource:function(t,n){return e.Lang.isObject(n,!0)&&t.split(/\./).length<3},_setCacheLimit:function(t){return e.Lang.isNumber(t)?(this._cacheLimit=t,t):e.Attribute.INVALID_VALUE}},{NAME:"consoleFilters",NS:s,CATEGORIES_TEMPLATE:'<div class="{categories}"></div>',SOURCES_TEMPLATE:'<div class="{sources}"></div>',FILTER_TEMPLATE:'<label class="{filter_label}"><input type="checkbox" value="{filter_name}" class="{filter} {filter_class}"> {filter_name}</label> ',CHROME_CLASSES:{categories:n(r,i,"categories"),sources:n(r,i,"sources"),category:n(r,s,o),source:n(r,s,u),filter:n(r,s),filter_label:n(r,s,"label")},ATTRS:{defaultVisibility:{value:!0,validator:e.Lang.isBoolean},category:{value:{},validator:function(e,t){return this._validateCategory(t,e)}},source:{value:{},validator:function(e,t){return this._validateSource(t,e)}},cacheLimit:{value:Number.POSITIVE_INFINITY,setter:function(e){return this._setCacheLimit(e)}}}})},"3.7.1",{requires:["plugin","console"],skinnable:!0});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('console-filters', function(Y) {+YUI.add('console-filters', function (Y, NAME) { /** * <p>Provides Plugin.ConsoleFilters plugin class.</p>@@ -145,13 +145,13 @@ html; if (foot) {- html = Y.substitute(+ html = Y.Lang.sub( ConsoleFilters.CATEGORIES_TEMPLATE, ConsoleFilters.CHROME_CLASSES); this._categories = foot.appendChild(Y.Node.create(html)); - html = Y.substitute(+ html = Y.Lang.sub( ConsoleFilters.SOURCES_TEMPLATE, ConsoleFilters.CHROME_CLASSES); @@ -367,7 +367,7 @@ } } - body.setContent(EMPTY);+ body.setHTML(EMPTY); host.buffer = buffer; host.printBuffer(); }@@ -522,7 +522,7 @@ filter_class : getCN(CONSOLE, FILTER, name) }), node = Y.Node.create(- Y.substitute(ConsoleFilters.FILTER_TEMPLATE, info));+ Y.Lang.sub(ConsoleFilters.FILTER_TEMPLATE, info)); container.appendChild(node); },@@ -726,4 +726,4 @@ }); -}, '3.5.1' ,{requires:['console','plugin']});+}, '3.7.1', {"requires": ["plugin", "console"], "skinnable": true});
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -0,0 +1,1792 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/console/console.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/console/console.js",+ code: []+};+_yuitest_coverage["build/console/console.js"].code=["YUI.add('console', function (Y, NAME) {","","/**"," * Console creates a visualization for messages logged through calls to a YUI"," * instance's <code>Y.log( message, category, source )</code> method. The"," * debug versions of YUI modules will include logging statements to offer some"," * insight into the steps executed during that module's operation. Including"," * log statements in your code will cause those messages to also appear in the"," * Console. Use Console to aid in developing your page or application."," *"," * Entry categories "info", "warn", and "error""," * are also referred to as the log level, and entries are filtered against the"," * configured logLevel."," *"," * @module console"," * @class Console"," * @extends Widget"," * @param conf {Object} Configuration object (see Configuration attributes)"," * @constructor"," */","var getCN = Y.ClassNameManager.getClassName,"," CHECKED = 'checked',"," CLEAR = 'clear',"," CLICK = 'click',"," COLLAPSED = 'collapsed',"," CONSOLE = 'console',"," CONTENT_BOX = 'contentBox',"," DISABLED = 'disabled',"," ENTRY = 'entry',"," ERROR = 'error',"," HEIGHT = 'height',"," INFO = 'info',"," LAST_TIME = 'lastTime',"," PAUSE = 'pause',"," PAUSED = 'paused',"," RESET = 'reset',"," START_TIME = 'startTime',"," TITLE = 'title',"," WARN = 'warn',",""," DOT = '.',",""," C_BUTTON = getCN(CONSOLE,'button'),"," C_CHECKBOX = getCN(CONSOLE,'checkbox'),"," C_CLEAR = getCN(CONSOLE,CLEAR),"," C_COLLAPSE = getCN(CONSOLE,'collapse'),"," C_COLLAPSED = getCN(CONSOLE,COLLAPSED),"," C_CONSOLE_CONTROLS = getCN(CONSOLE,'controls'),"," C_CONSOLE_HD = getCN(CONSOLE,'hd'),"," C_CONSOLE_BD = getCN(CONSOLE,'bd'),"," C_CONSOLE_FT = getCN(CONSOLE,'ft'),"," C_CONSOLE_TITLE = getCN(CONSOLE,TITLE),"," C_ENTRY = getCN(CONSOLE,ENTRY),"," C_ENTRY_CAT = getCN(CONSOLE,ENTRY,'cat'),"," C_ENTRY_CONTENT = getCN(CONSOLE,ENTRY,'content'),"," C_ENTRY_META = getCN(CONSOLE,ENTRY,'meta'),"," C_ENTRY_SRC = getCN(CONSOLE,ENTRY,'src'),"," C_ENTRY_TIME = getCN(CONSOLE,ENTRY,'time'),"," C_PAUSE = getCN(CONSOLE,PAUSE),"," C_PAUSE_LABEL = getCN(CONSOLE,PAUSE,'label'),",""," RE_INLINE_SOURCE = /^(\\S+)\\s/,"," RE_AMP = /&(?!#?[a-z0-9]+;)/g,"," RE_GT = />/g,"," RE_LT = /</g,",""," ESC_AMP = '&',"," ESC_GT = '>',"," ESC_LT = '<',"," "," ENTRY_TEMPLATE_STR ="," '<div class=\"{entry_class} {cat_class} {src_class}\">'+"," '<p class=\"{entry_meta_class}\">'+"," '<span class=\"{entry_src_class}\">'+"," '{sourceAndDetail}'+"," '</span>'+"," '<span class=\"{entry_cat_class}\">'+"," '{category}</span>'+"," '<span class=\"{entry_time_class}\">'+"," ' {totalTime}ms (+{elapsedTime}) {localTime}'+"," '</span>'+"," '</p>'+"," '<pre class=\"{entry_content_class}\">{message}</pre>'+"," '</div>',",""," L = Y.Lang,"," create = Y.Node.create,"," isNumber = L.isNumber,"," isString = L.isString,"," merge = Y.merge,"," substitute = Y.Lang.sub;"," ","","function Console() {"," Console.superclass.constructor.apply(this,arguments);","}","","Y.Console = Y.extend(Console, Y.Widget,","","// Y.Console prototype","{"," /**"," * Category to prefix all event subscriptions to allow for ease of detach"," * during destroy."," *"," * @property _evtCat"," * @type string"," * @protected"," */"," _evtCat : null,",""," /**"," * Reference to the Node instance containing the header contents."," *"," * @property _head"," * @type Node"," * @default null"," * @protected"," */"," _head : null,",""," /**"," * Reference to the Node instance that will house the console messages."," *"," * @property _body"," * @type Node"," * @default null"," * @protected"," */"," _body : null,",""," /**"," * Reference to the Node instance containing the footer contents."," *"," * @property _foot"," * @type Node"," * @default null"," * @protected"," */"," _foot : null,",""," /**"," * Holds the object API returned from <code>Y.later</code> for the print"," * loop interval."," *"," * @property _printLoop"," * @type Object"," * @default null"," * @protected"," */"," _printLoop : null,",""," /**"," * Array of normalized message objects awaiting printing."," *"," * @property buffer"," * @type Array"," * @default null"," * @protected"," */"," buffer : null,",""," /**"," * Wrapper for <code>Y.log</code>."," *"," * @method log"," * @param arg* {MIXED} (all arguments passed through to <code>Y.log</code>)"," * @chainable"," */"," log : function () {"," Y.log.apply(Y,arguments);",""," return this;"," },",""," /**"," * Clear the console of messages and flush the buffer of pending messages."," *"," * @method clearConsole"," * @chainable"," */"," clearConsole : function () {"," // TODO: clear event listeners from console contents"," this._body.empty();",""," this._cancelPrintLoop();",""," this.buffer = [];",""," return this;"," },",""," /**"," * Clears the console and resets internal timers."," *"," * @method reset"," * @chainable"," */"," reset : function () {"," this.fire(RESET);"," "," return this;"," },",""," /**"," * Collapses the body and footer."," *"," * @method collapse"," * @chainable"," */"," collapse : function () {"," this.set(COLLAPSED, true);",""," return this;"," },",""," /**"," * Expands the body and footer if collapsed."," *"," * @method expand"," * @chainable"," */"," expand : function () {"," this.set(COLLAPSED, false);",""," return this;"," },",""," /**"," * Outputs buffered messages to the console UI. This is typically called"," * from a scheduled interval until the buffer is empty (referred to as the"," * print loop). The number of buffered messages output to the Console is"," * limited to the number provided as an argument. If no limit is passed,"," * all buffered messages are rendered."," * "," * @method printBuffer"," * @param limit {Number} (optional) max number of buffered entries to write"," * @chainable"," */"," printBuffer: function (limit) {"," var messages = this.buffer,"," debug = Y.config.debug,"," entries = [],"," consoleLimit= this.get('consoleLimit'),"," newestOnTop = this.get('newestOnTop'),"," anchor = newestOnTop ? this._body.get('firstChild') : null,"," i;",""," if (messages.length > consoleLimit) {"," messages.splice(0, messages.length - consoleLimit);"," }",""," limit = Math.min(messages.length, (limit || messages.length));"," "," // turn off logging system"," Y.config.debug = false;",""," if (!this.get(PAUSED) && this.get('rendered')) {",""," for (i = 0; i < limit && messages.length; ++i) {"," entries[i] = this._createEntryHTML(messages.shift());"," }",""," if (!messages.length) {"," this._cancelPrintLoop();"," }",""," if (entries.length) {"," if (newestOnTop) {"," entries.reverse();"," }",""," this._body.insertBefore(create(entries.join('')), anchor);",""," if (this.get('scrollIntoView')) {"," this.scrollToLatest();"," }",""," this._trimOldEntries();"," }"," }",""," // restore logging system"," Y.config.debug = debug;",""," return this;"," },",""," "," /**"," * Constructor code. Set up the buffer and entry template, publish"," * internal events, and subscribe to the configured logEvent."," * "," * @method initializer"," * @protected"," */"," initializer : function () {"," this._evtCat = Y.stamp(this) + '|';",""," this.buffer = [];",""," this.get('logSource').on(this._evtCat +"," this.get('logEvent'),Y.bind(\"_onLogEvent\",this));",""," /**"," * Transfers a received message to the print loop buffer. Default"," * behavior defined in _defEntryFn."," *"," * @event entry"," * @param event {Event.Facade} An Event Facade object with the following attribute specific properties added:"," * <dl>"," * <dt>message</dt>"," * <dd>The message data normalized into an object literal (see _normalizeMessage)</dd>"," * </dl>"," * @preventable _defEntryFn"," */"," this.publish(ENTRY, { defaultFn: this._defEntryFn });",""," /**"," * Triggers the reset behavior via the default logic in _defResetFn."," *"," * @event reset"," * @param event {Event.Facade} Event Facade object"," * @preventable _defResetFn"," */"," this.publish(RESET, { defaultFn: this._defResetFn });",""," this.after('rendered', this._schedulePrint);"," },",""," /**"," * Tears down the instance, flushing event subscriptions and purging the UI."," *"," * @method destructor"," * @protected"," */"," destructor : function () {"," var bb = this.get('boundingBox');",""," this._cancelPrintLoop();",""," this.get('logSource').detach(this._evtCat + '*');"," "," bb.purge(true);"," },",""," /**"," * Generate the Console UI."," *"," * @method renderUI"," * @protected"," */"," renderUI : function () {"," this._initHead();"," this._initBody();"," this._initFoot();",""," // Apply positioning to the bounding box if appropriate"," var style = this.get('style');"," if (style !== 'block') {"," this.get('boundingBox').addClass(this.getClassName(style));"," }"," },",""," /**"," * Sync the UI state to the current attribute state."," *"," * @method syncUI"," */"," syncUI : function () {"," this._uiUpdatePaused(this.get(PAUSED));"," this._uiUpdateCollapsed(this.get(COLLAPSED));"," this._uiSetHeight(this.get(HEIGHT));"," },",""," /**"," * Set up event listeners to wire up the UI to the internal state."," *"," * @method bindUI"," * @protected"," */"," bindUI : function () {"," this.get(CONTENT_BOX).one('button.'+C_COLLAPSE)."," on(CLICK,this._onCollapseClick,this);",""," this.get(CONTENT_BOX).one('input[type=checkbox].'+C_PAUSE)."," on(CLICK,this._onPauseClick,this);",""," this.get(CONTENT_BOX).one('button.'+C_CLEAR)."," on(CLICK,this._onClearClick,this);",""," // Attribute changes"," this.after(this._evtCat + 'stringsChange',"," this._afterStringsChange);"," this.after(this._evtCat + 'pausedChange',"," this._afterPausedChange);"," this.after(this._evtCat + 'consoleLimitChange',"," this._afterConsoleLimitChange);"," this.after(this._evtCat + 'collapsedChange',"," this._afterCollapsedChange);"," },",""," "," /**"," * Create the DOM structure for the header elements."," *"," * @method _initHead"," * @protected"," */"," _initHead : function () {"," var cb = this.get(CONTENT_BOX),"," info = merge(Console.CHROME_CLASSES, {"," str_collapse : this.get('strings.collapse'),"," str_title : this.get('strings.title')"," });",""," this._head = create(substitute(Console.HEADER_TEMPLATE,info));",""," cb.insertBefore(this._head,cb.get('firstChild'));"," },",""," /**"," * Create the DOM structure for the console body—where messages are"," * rendered."," *"," * @method _initBody"," * @protected"," */"," _initBody : function () {"," this._body = create(substitute("," Console.BODY_TEMPLATE,"," Console.CHROME_CLASSES));",""," this.get(CONTENT_BOX).appendChild(this._body);"," },",""," /**"," * Create the DOM structure for the footer elements."," *"," * @method _initFoot"," * @protected"," */"," _initFoot : function () {"," var info = merge(Console.CHROME_CLASSES, {"," id_guid : Y.guid(),"," str_pause : this.get('strings.pause'),"," str_clear : this.get('strings.clear')"," });",""," this._foot = create(substitute(Console.FOOTER_TEMPLATE,info));",""," this.get(CONTENT_BOX).appendChild(this._foot);"," },",""," /**"," * Determine if incoming log messages are within the configured logLevel"," * to be buffered for printing."," *"," * @method _isInLogLevel"," * @protected"," */"," _isInLogLevel : function (e) {"," var cat = e.cat, lvl = this.get('logLevel');",""," if (lvl !== INFO) {"," cat = cat || INFO;",""," if (isString(cat)) {"," cat = cat.toLowerCase();"," }",""," if ((cat === WARN && lvl === ERROR) ||"," (cat === INFO && lvl !== INFO)) {"," return false;"," }"," }",""," return true;"," },",""," /**"," * Create a log entry message from the inputs including the following keys:"," * <ul>"," * <li>time - this moment</li>"," * <li>message - leg message</li>"," * <li>category - logLevel or custom category for the message</li>"," * <li>source - when provided, the widget or util calling Y.log</li>"," * <li>sourceAndDetail - same as source but can include instance info</li>"," * <li>localTime - readable version of time</li>"," * <li>elapsedTime - ms since last entry</li>"," * <li>totalTime - ms since Console was instantiated or reset</li>"," * </ul>"," *"," * @method _normalizeMessage"," * @param e {Event} custom event containing the log message"," * @return Object the message object"," * @protected"," */"," _normalizeMessage : function (e) {",""," var msg = e.msg,"," cat = e.cat,"," src = e.src,",""," m = {"," time : new Date(),"," message : msg,"," category : cat || this.get('defaultCategory'),"," sourceAndDetail : src || this.get('defaultSource'),"," source : null,"," localTime : null,"," elapsedTime : null,"," totalTime : null"," };",""," // Extract m.source \"Foo\" from m.sourceAndDetail \"Foo bar baz\""," m.source = RE_INLINE_SOURCE.test(m.sourceAndDetail) ?"," RegExp.$1 : m.sourceAndDetail;"," m.localTime = m.time.toLocaleTimeString ? "," m.time.toLocaleTimeString() : (m.time + '');"," m.elapsedTime = m.time - this.get(LAST_TIME);"," m.totalTime = m.time - this.get(START_TIME);",""," this._set(LAST_TIME,m.time);",""," return m;"," },",""," /**"," * Sets an interval for buffered messages to be output to the console."," *"," * @method _schedulePrint"," * @protected"," */"," _schedulePrint : function () {"," if (!this._printLoop && !this.get(PAUSED) && this.get('rendered')) {"," this._printLoop = Y.later("," this.get('printTimeout'),"," this, this.printBuffer,"," this.get('printLimit'), true);"," }"," },",""," /**"," * Translates message meta into the markup for a console entry."," *"," * @method _createEntryHTML"," * @param m {Object} object literal containing normalized message metadata"," * @return String"," * @protected"," */"," _createEntryHTML : function (m) {"," m = merge("," this._htmlEscapeMessage(m),"," Console.ENTRY_CLASSES,"," {"," cat_class : this.getClassName(ENTRY,m.category),"," src_class : this.getClassName(ENTRY,m.source)"," });",""," return this.get('entryTemplate').replace(/\\{(\\w+)\\}/g,"," function (_,token) {"," return token in m ? m[token] : '';"," });"," },",""," /**"," * Scrolls to the most recent entry"," *"," * @method scrollToLatest"," * @chainable"," */"," scrollToLatest : function () {"," var scrollTop = this.get('newestOnTop') ?"," 0 :"," this._body.get('scrollHeight');",""," this._body.set('scrollTop', scrollTop);"," },",""," /**"," * Performs HTML escaping on strings in the message object."," *"," * @method _htmlEscapeMessage"," * @param m {Object} the normalized message object"," * @return Object the message object with proper escapement"," * @protected"," */"," _htmlEscapeMessage : function (m) {"," m.message = this._encodeHTML(m.message);"," m.source = this._encodeHTML(m.source);"," m.sourceAndDetail = this._encodeHTML(m.sourceAndDetail);"," m.category = this._encodeHTML(m.category);",""," return m;"," },",""," /**"," * Removes the oldest message entries from the UI to maintain the limit"," * specified in the consoleLimit configuration."," *"," * @method _trimOldEntries"," * @protected"," */"," _trimOldEntries : function () {"," // Turn off the logging system for the duration of this operation"," // to prevent an infinite loop"," Y.config.debug = false;",""," var bd = this._body,"," limit = this.get('consoleLimit'),"," debug = Y.config.debug,"," entries,e,i,l;",""," if (bd) {"," entries = bd.all(DOT+C_ENTRY);"," l = entries.size() - limit;",""," if (l > 0) {"," if (this.get('newestOnTop')) {"," i = limit;"," l = entries.size();"," } else {"," i = 0;"," }",""," this._body.setStyle('display','none');",""," for (;i < l; ++i) {"," e = entries.item(i);"," if (e) {"," e.remove();"," }"," }",""," this._body.setStyle('display','');"," }",""," }",""," Y.config.debug = debug;"," },",""," /**"," * Returns the input string with ampersands (&), <, and > encoded"," * as HTML entities."," *"," * @method _encodeHTML"," * @param s {String} the raw string"," * @return String the encoded string"," * @protected"," */"," _encodeHTML : function (s) {"," return isString(s) ?"," s.replace(RE_AMP,ESC_AMP)."," replace(RE_LT, ESC_LT)."," replace(RE_GT, ESC_GT) :"," s;"," },",""," /**"," * Clears the timeout for printing buffered messages."," *"," * @method _cancelPrintLoop"," * @protected"," */"," _cancelPrintLoop : function () {"," if (this._printLoop) {"," this._printLoop.cancel();"," this._printLoop = null;"," }"," },",""," /**"," * Validates input value for style attribute. Accepts only values 'inline',"," * 'block', and 'separate'."," *"," * @method _validateStyle"," * @param style {String} the proposed value"," * @return {Boolean} pass/fail"," * @protected"," */"," _validateStyle : function (style) {"," return style === 'inline' || style === 'block' || style === 'separate';"," },",""," /**"," * Event handler for clicking on the Pause checkbox to update the paused"," * attribute."," *"," * @method _onPauseClick"," * @param e {Event} DOM event facade for the click event"," * @protected"," */"," _onPauseClick : function (e) {"," this.set(PAUSED,e.target.get(CHECKED));"," },",""," /**"," * Event handler for clicking on the Clear button. Pass-through to"," * <code>this.clearConsole()</code>."," *"," * @method _onClearClick"," * @param e {Event} DOM event facade for the click event"," * @protected"," */"," _onClearClick : function (e) {"," this.clearConsole();"," },",""," /**"," * Event handler for clicking on the Collapse/Expand button. Sets the"," * "collapsed" attribute accordingly."," *"," * @method _onCollapseClick"," * @param e {Event} DOM event facade for the click event"," * @protected"," */"," _onCollapseClick : function (e) {"," this.set(COLLAPSED, !this.get(COLLAPSED));"," },","",""," /**"," * Validator for logSource attribute."," *"," * @method _validateLogSource"," * @param v {Object} the desired logSource"," * @return {Boolean} true if the input is an object with an <code>on</code>"," * method"," * @protected"," */"," _validateLogSource: function (v) {"," return v && Y.Lang.isFunction(v.on);"," },",""," /**"," * Setter method for logLevel attribute. Acceptable values are"," * "error", "warn", and "info" (case"," * insensitive). Other values are treated as "info"."," *"," * @method _setLogLevel"," * @param v {String} the desired log level"," * @return String One of Console.LOG_LEVEL_INFO, _WARN, or _ERROR"," * @protected"," */"," _setLogLevel : function (v) {"," if (isString(v)) {"," v = v.toLowerCase();"," }"," "," return (v === WARN || v === ERROR) ? v : INFO;"," },",""," /**"," * Getter method for useBrowserConsole attribute. Just a pass through to"," * the YUI instance configuration setting."," *"," * @method _getUseBrowserConsole"," * @return {Boolean} or null if logSource is not a YUI instance"," * @protected"," */"," _getUseBrowserConsole: function () {"," var logSource = this.get('logSource');"," return logSource instanceof YUI ?"," logSource.config.useBrowserConsole : null;"," },",""," /**"," * Setter method for useBrowserConsole attributes. Only functional if the"," * logSource attribute points to a YUI instance. Passes the value down to"," * the YUI instance. NOTE: multiple Console instances cannot maintain"," * independent useBrowserConsole values, since it is just a pass through to"," * the YUI instance configuration."," *"," * @method _setUseBrowserConsole"," * @param v {Boolean} false to disable browser console printing (default)"," * @return {Boolean} true|false if logSource is a YUI instance"," * @protected"," */"," _setUseBrowserConsole: function (v) {"," var logSource = this.get('logSource');"," if (logSource instanceof YUI) {"," v = !!v;"," logSource.config.useBrowserConsole = v;"," return v;"," } else {"," return Y.Attribute.INVALID_VALUE;"," }"," },",""," /**"," * Set the height of the Console container. Set the body height to the"," * difference between the configured height and the calculated heights of"," * the header and footer."," * Overrides Widget.prototype._uiSetHeight."," *"," * @method _uiSetHeight"," * @param v {String|Number} the new height"," * @protected"," */"," _uiSetHeight : function (v) {"," Console.superclass._uiSetHeight.apply(this,arguments);",""," if (this._head && this._foot) {"," var h = this.get('boundingBox').get('offsetHeight') -"," this._head.get('offsetHeight') -"," this._foot.get('offsetHeight');",""," this._body.setStyle(HEIGHT,h+'px');"," }"," },",""," /**"," * Over-ride default content box sizing to do nothing, since we're sizing"," * the body section to fill out height ourselves."," * "," * @method _uiSizeCB"," * @protected"," */"," _uiSizeCB : function() {"," // Do Nothing. Ideally want to move to Widget-StdMod, which accounts for"," // _uiSizeCB "," },",""," /**"," * Updates the UI if changes are made to any of the strings in the strings"," * attribute."," *"," * @method _afterStringsChange"," * @param e {Event} Custom event for the attribute change"," * @protected"," */"," _afterStringsChange : function (e) {"," var prop = e.subAttrName ? e.subAttrName.split(DOT)[1] : null,"," cb = this.get(CONTENT_BOX),"," before = e.prevVal,"," after = e.newVal;",""," if ((!prop || prop === TITLE) && before.title !== after.title) {"," cb.all(DOT+C_CONSOLE_TITLE).setHTML(after.title);"," }",""," if ((!prop || prop === PAUSE) && before.pause !== after.pause) {"," cb.all(DOT+C_PAUSE_LABEL).setHTML(after.pause);"," }",""," if ((!prop || prop === CLEAR) && before.clear !== after.clear) {"," cb.all(DOT+C_CLEAR).set('value',after.clear);"," }"," },",""," /**"," * Updates the UI and schedules or cancels the print loop."," *"," * @method _afterPausedChange"," * @param e {Event} Custom event for the attribute change"," * @protected"," */"," _afterPausedChange : function (e) {"," var paused = e.newVal;",""," if (e.src !== Y.Widget.SRC_UI) {"," this._uiUpdatePaused(paused);"," }",""," if (!paused) {"," this._schedulePrint();"," } else if (this._printLoop) {"," this._cancelPrintLoop();"," }"," },",""," /**"," * Checks or unchecks the paused checkbox"," *"," * @method _uiUpdatePaused"," * @param on {Boolean} the new checked state"," * @protected"," */"," _uiUpdatePaused : function (on) {"," var node = this._foot.all('input[type=checkbox].'+C_PAUSE);",""," if (node) {"," node.set(CHECKED,on);"," }"," },",""," /**"," * Calls this._trimOldEntries() in response to changes in the configured"," * consoleLimit attribute."," * "," * @method _afterConsoleLimitChange"," * @param e {Event} Custom event for the attribute change"," * @protected"," */"," _afterConsoleLimitChange : function () {"," this._trimOldEntries();"," },","",""," /**"," * Updates the className of the contentBox, which should trigger CSS to"," * hide or show the body and footer sections depending on the new value."," *"," * @method _afterCollapsedChange"," * @param e {Event} Custom event for the attribute change"," * @protected"," */"," _afterCollapsedChange : function (e) {"," this._uiUpdateCollapsed(e.newVal);"," },",""," /**"," * Updates the UI to reflect the new Collapsed state"," *"," * @method _uiUpdateCollapsed"," * @param v {Boolean} true for collapsed, false for expanded"," * @protected"," */"," _uiUpdateCollapsed : function (v) {"," var bb = this.get('boundingBox'),"," button = bb.all('button.'+C_COLLAPSE),"," method = v ? 'addClass' : 'removeClass',"," str = this.get('strings.'+(v ? 'expand' : 'collapse'));",""," bb[method](C_COLLAPSED);",""," if (button) {"," button.setHTML(str);"," }",""," this._uiSetHeight(v ? this._head.get('offsetHeight'): this.get(HEIGHT));"," },",""," /**"," * Makes adjustments to the UI if needed when the Console is hidden or shown"," *"," * @method _afterVisibleChange"," * @param e {Event} the visibleChange event"," * @protected"," */"," _afterVisibleChange : function (e) {"," Console.superclass._afterVisibleChange.apply(this,arguments);",""," this._uiUpdateFromHideShow(e.newVal);"," },",""," /**"," * Recalculates dimensions and updates appropriately when shown"," *"," * @method _uiUpdateFromHideShow"," * @param v {Boolean} true for visible, false for hidden"," * @protected"," */"," _uiUpdateFromHideShow : function (v) {"," if (v) {"," this._uiSetHeight(this.get(HEIGHT));"," }"," },",""," /**"," * Responds to log events by normalizing qualifying messages and passing"," * them along through the entry event for buffering etc."," * "," * @method _onLogEvent"," * @param msg {String} the log message"," * @param cat {String} OPTIONAL the category or logLevel of the message"," * @param src {String} OPTIONAL the source of the message (e.g. widget name)"," * @protected"," */"," _onLogEvent : function (e) {",""," if (!this.get(DISABLED) && this._isInLogLevel(e)) {",""," var debug = Y.config.debug;",""," /* TODO: needed? */"," Y.config.debug = false;",""," this.fire(ENTRY, {"," message : this._normalizeMessage(e)"," });",""," Y.config.debug = debug;"," }"," },",""," /**"," * Clears the console, resets the startTime attribute, enables and"," * unpauses the widget."," *"," * @method _defResetFn"," * @protected"," */"," _defResetFn : function () {"," this.clearConsole();"," this.set(START_TIME,new Date());"," this.set(DISABLED,false);"," this.set(PAUSED,false);"," },",""," /**"," * Buffers incoming message objects and schedules the printing."," *"," * @method _defEntryFn"," * @param e {Event} The Custom event carrying the message in its payload"," * @protected"," */"," _defEntryFn : function (e) {"," if (e.message) {"," this.buffer.push(e.message);"," this._schedulePrint();"," }"," }","","},","","// Y.Console static properties","{"," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @static"," */"," NAME : CONSOLE,",""," /**"," * Static identifier for logLevel configuration setting to allow all"," * incoming messages to generate Console entries."," *"," * @property LOG_LEVEL_INFO"," * @type String"," * @static"," */"," LOG_LEVEL_INFO : INFO,",""," /**"," * Static identifier for logLevel configuration setting to allow only"," * incoming messages of logLevel "warn" or "error""," * to generate Console entries."," *"," * @property LOG_LEVEL_WARN"," * @type String"," * @static"," */"," LOG_LEVEL_WARN : WARN,",""," /**"," * Static identifier for logLevel configuration setting to allow only"," * incoming messages of logLevel "error" to generate"," * Console entries."," *"," * @property LOG_LEVEL_ERROR"," * @type String"," * @static"," */"," LOG_LEVEL_ERROR : ERROR,",""," /**"," * Map (object) of classNames used to populate the placeholders in the"," * Console.ENTRY_TEMPLATE markup when rendering a new Console entry."," *"," * <p>By default, the keys contained in the object are:</p>"," * <ul>"," * <li>entry_class</li>"," * <li>entry_meta_class</li>"," * <li>entry_cat_class</li>"," * <li>entry_src_class</li>"," * <li>entry_time_class</li>"," * <li>entry_content_class</li>"," * </ul>"," *"," * @property ENTRY_CLASSES"," * @type Object"," * @static"," */"," ENTRY_CLASSES : {"," entry_class : C_ENTRY,"," entry_meta_class : C_ENTRY_META,"," entry_cat_class : C_ENTRY_CAT,"," entry_src_class : C_ENTRY_SRC,"," entry_time_class : C_ENTRY_TIME,"," entry_content_class : C_ENTRY_CONTENT"," },",""," /**"," * Map (object) of classNames used to populate the placeholders in the"," * Console.HEADER_TEMPLATE, Console.BODY_TEMPLATE, and"," * Console.FOOTER_TEMPLATE markup when rendering the Console UI."," *"," * <p>By default, the keys contained in the object are:</p>"," * <ul>"," * <li>console_hd_class</li>"," * <li>console_bd_class</li>"," * <li>console_ft_class</li>"," * <li>console_controls_class</li>"," * <li>console_checkbox_class</li>"," * <li>console_pause_class</li>"," * <li>console_pause_label_class</li>"," * <li>console_button_class</li>"," * <li>console_clear_class</li>"," * <li>console_collapse_class</li>"," * <li>console_title_class</li>"," * </ul>"," *"," * @property CHROME_CLASSES"," * @type Object"," * @static"," */"," CHROME_CLASSES : {"," console_hd_class : C_CONSOLE_HD,"," console_bd_class : C_CONSOLE_BD,"," console_ft_class : C_CONSOLE_FT,"," console_controls_class : C_CONSOLE_CONTROLS,"," console_checkbox_class : C_CHECKBOX,"," console_pause_class : C_PAUSE,"," console_pause_label_class : C_PAUSE_LABEL,"," console_button_class : C_BUTTON,"," console_clear_class : C_CLEAR,"," console_collapse_class : C_COLLAPSE,"," console_title_class : C_CONSOLE_TITLE"," },",""," /**"," * Markup template used to generate the DOM structure for the header"," * section of the Console when it is rendered. The template includes"," * these {placeholder}s:"," *"," * <ul>"," * <li>console_button_class - contributed by Console.CHROME_CLASSES</li>"," * <li>console_collapse_class - contributed by Console.CHROME_CLASSES</li>"," * <li>console_hd_class - contributed by Console.CHROME_CLASSES</li>"," * <li>console_title_class - contributed by Console.CHROME_CLASSES</li>"," * <li>str_collapse - pulled from attribute strings.collapse</li>"," * <li>str_title - pulled from attribute strings.title</li>"," * </ul>"," *"," * @property HEADER_TEMPLATE"," * @type String"," * @static"," */"," HEADER_TEMPLATE :"," '<div class=\"{console_hd_class}\">'+"," '<h4 class=\"{console_title_class}\">{str_title}</h4>'+"," '<button type=\"button\" class=\"'+"," '{console_button_class} {console_collapse_class}\">{str_collapse}'+"," '</button>'+"," '</div>',",""," /**"," * Markup template used to generate the DOM structure for the Console body"," * (where the messages are inserted) when it is rendered. The template"," * includes only the {placeholder} "console_bd_class", which is"," * constributed by Console.CHROME_CLASSES."," *"," * @property BODY_TEMPLATE"," * @type String"," * @static"," */"," BODY_TEMPLATE : '<div class=\"{console_bd_class}\"></div>',",""," /**"," * Markup template used to generate the DOM structure for the footer"," * section of the Console when it is rendered. The template includes"," * many of the {placeholder}s from Console.CHROME_CLASSES as well as:"," *"," * <ul>"," * <li>id_guid - generated unique id, relates the label and checkbox</li>"," * <li>str_pause - pulled from attribute strings.pause</li>"," * <li>str_clear - pulled from attribute strings.clear</li>"," * </ul>"," *"," * @property FOOTER_TEMPLATE"," * @type String"," * @static"," */"," FOOTER_TEMPLATE :"," '<div class=\"{console_ft_class}\">'+"," '<div class=\"{console_controls_class}\">'+"," '<label for=\"{id_guid}\" class=\"{console_pause_label_class}\">'+"," '<input type=\"checkbox\" class=\"{console_checkbox_class} '+"," '{console_pause_class}\" value=\"1\" id=\"{id_guid}\"> '+"," '{str_pause}</label>' +"," '<button type=\"button\" class=\"'+"," '{console_button_class} {console_clear_class}\">{str_clear}'+"," '</button>'+"," '</div>'+"," '</div>',",""," /**"," * Default markup template used to create the DOM structure for Console"," * entries. The markup contains {placeholder}s for content and classes"," * that are replaced via Y.Lang.sub. The default template contains"," * the {placeholder}s identified in Console.ENTRY_CLASSES as well as the"," * following placeholders that will be populated by the log entry data:"," *"," * <ul>"," * <li>cat_class</li>"," * <li>src_class</li>"," * <li>totalTime</li>"," * <li>elapsedTime</li>"," * <li>localTime</li>"," * <li>sourceAndDetail</li>"," * <li>message</li>"," * </ul>"," *"," * @property ENTRY_TEMPLATE"," * @type String"," * @static"," */"," ENTRY_TEMPLATE : ENTRY_TEMPLATE_STR,",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @Type Object"," * @static"," */"," ATTRS : {",""," /**"," * Name of the custom event that will communicate log messages."," *"," * @attribute logEvent"," * @type String"," * @default \"yui:log\""," */"," logEvent : {"," value : 'yui:log',"," writeOnce : true,"," validator : isString"," },",""," /**"," * Object that will emit the log events. By default the YUI instance."," * To have a single Console capture events from all YUI instances, set"," * this to the Y.Global object."," *"," * @attribute logSource"," * @type EventTarget"," * @default Y"," */"," logSource : {"," value : Y,"," writeOnce : true,"," validator : function (v) {"," return this._validateLogSource(v);"," }"," },",""," /**"," * Collection of strings used to label elements in the Console UI."," * Default collection contains the following name:value pairs:"," *"," * <ul>"," * <li>title : "Log Console"</li>"," * <li>pause : "Pause"</li>"," * <li>clear : "Clear"</li>"," * <li>collapse : "Collapse"</li>"," * <li>expand : "Expand"</li>"," * </ul>"," *"," * @attribute strings"," * @type Object"," */"," strings : {"," valueFn: function() { return Y.Intl.get(\"console\"); }"," },",""," /**"," * Boolean to pause the outputting of new messages to the console."," * When paused, messages will accumulate in the buffer."," *"," * @attribute paused"," * @type boolean"," * @default false"," */"," paused : {"," value : false,"," validator : L.isBoolean"," },",""," /**"," * If a category is not specified in the Y.log(..) statement, this"," * category will be used. Categories "info","," * "warn", and "error" are also called log level."," *"," * @attribute defaultCategory"," * @type String"," * @default \"info\""," */"," defaultCategory : {"," value : INFO,"," validator : isString"," },",""," /**"," * If a source is not specified in the Y.log(..) statement, this"," * source will be used."," *"," * @attribute defaultSource"," * @type String"," * @default \"global\""," */"," defaultSource : {"," value : 'global',"," validator : isString"," },",""," /**"," * Markup template used to create the DOM structure for Console entries."," *"," * @attribute entryTemplate"," * @type String"," * @default Console.ENTRY_TEMPLATE"," */"," entryTemplate : {"," value : ENTRY_TEMPLATE_STR,"," validator : isString"," },",""," /**"," * Minimum entry log level to render into the Console. The initial"," * logLevel value for all Console instances defaults from the"," * Y.config.logLevel YUI configuration, or Console.LOG_LEVEL_INFO if"," * that configuration is not set."," *"," * Possible values are "info", "warn","," * "error" (case insensitive), or their corresponding statics"," * Console.LOG_LEVEL_INFO and so on."," *"," * @attribute logLevel"," * @type String"," * @default Y.config.logLevel or Console.LOG_LEVEL_INFO"," */"," logLevel : {"," value : Y.config.logLevel || INFO,"," setter : function (v) {"," return this._setLogLevel(v);"," }"," },",""," /**"," * Millisecond timeout between iterations of the print loop, moving"," * entries from the buffer to the UI."," *"," * @attribute printTimeout"," * @type Number"," * @default 100"," */"," printTimeout : {"," value : 100,"," validator : isNumber"," },",""," /**"," * Maximum number of entries printed in each iteration of the print"," * loop. This is used to prevent excessive logging locking the page UI."," *"," * @attribute printLimit"," * @type Number"," * @default 50"," */"," printLimit : {"," value : 50,"," validator : isNumber"," },",""," /**"," * Maximum number of Console entries allowed in the Console body at one"," * time. This is used to keep acquired messages from exploding the"," * DOM tree and impacting page performance."," *"," * @attribute consoleLimit"," * @type Number"," * @default 300"," */"," consoleLimit : {"," value : 300,"," validator : isNumber"," },",""," /**"," * New entries should display at the top of the Console or the bottom?"," *"," * @attribute newestOnTop"," * @type Boolean"," * @default true"," */"," newestOnTop : {"," value : true"," },",""," /**"," * When new entries are added to the Console UI, should they be"," * scrolled into view?"," *"," * @attribute scrollIntoView"," * @type Boolean"," * @default true"," */"," scrollIntoView : {"," value : true"," },",""," /**"," * The baseline time for this Console instance, used to measure elapsed"," * time from the moment the console module is <code>use</code>d to the"," * moment each new entry is logged (not rendered)."," *"," * This value is reset by the instance method myConsole.reset()."," *"," * @attribute startTime"," * @type Date"," * @default The moment the console module is <code>use</code>d"," */"," startTime : {"," value : new Date()"," },",""," /**"," * The precise time the last entry was logged. Used to measure elapsed"," * time between log messages."," *"," * @attribute lastTime"," * @type Date"," * @default The moment the console module is <code>use</code>d"," */"," lastTime : {"," value : new Date(),"," readOnly: true"," },",""," /**"," * Controls the collapsed state of the Console"," *"," * @attribute collapsed"," * @type Boolean"," * @default false"," */"," collapsed : {"," value : false"," },",""," /**"," * String with units, or number, representing the height of the Console,"," * inclusive of header and footer. If a number is provided, the default"," * unit, defined by Widget's DEF_UNIT, property is used."," *"," * @attribute height"," * @default \"300px\""," * @type {String | Number}"," */"," height: {"," value: \"300px\""," },",""," /**"," * String with units, or number, representing the width of the Console."," * If a number is provided, the default unit, defined by Widget's"," * DEF_UNIT, property is used."," *"," * @attribute width"," * @default \"300px\""," * @type {String | Number}"," */"," width: {"," value: \"300px\""," },",""," /**"," * Pass through to the YUI instance useBrowserConsole configuration."," * By default this is set to false, which will disable logging to the"," * browser console when a Console instance is created. If the"," * logSource is not a YUI instance, this has no effect."," * "," * @attribute useBrowserConsole"," * @type {Boolean}"," * @default false"," */"," useBrowserConsole : {"," lazyAdd: false,"," value: false,"," getter : function () {"," return this._getUseBrowserConsole();"," },"," setter : function (v) {"," return this._setUseBrowserConsole(v);"," }"," },",""," /**"," * Allows the Console to flow in the document. Available values are"," * 'inline', 'block', and 'separate' (the default). "," *"," * @attribute style"," * @type {String}"," * @default 'separate'"," */"," style : {"," value : 'separate',"," writeOnce : true,"," validator : function (v) {"," return this._validateStyle(v);"," }"," }"," }","","});","","","}, '3.7.1', {\"requires\": [\"yui-log\", \"widget\"], \"skinnable\": true, \"lang\": [\"en\", \"es\", \"ja\"]});"];+_yuitest_coverage["build/console/console.js"].lines = {"1":0,"21":0,"94":0,"95":0,"98":0,"171":0,"173":0,"184":0,"186":0,"188":0,"190":0,"200":0,"202":0,"212":0,"214":0,"224":0,"226":0,"241":0,"249":0,"250":0,"253":0,"256":0,"258":0,"260":0,"261":0,"264":0,"265":0,"268":0,"269":0,"270":0,"273":0,"275":0,"276":0,"279":0,"284":0,"286":0,"298":0,"300":0,"302":0,"317":0,"326":0,"328":0,"338":0,"340":0,"342":0,"344":0,"354":0,"355":0,"356":0,"359":0,"360":0,"361":0,"371":0,"372":0,"373":0,"383":0,"386":0,"389":0,"393":0,"395":0,"397":0,"399":0,"411":0,"417":0,"419":0,"430":0,"434":0,"444":0,"450":0,"452":0,"463":0,"465":0,"466":0,"468":0,"469":0,"472":0,"474":0,"478":0,"501":0,"517":0,"519":0,"521":0,"522":0,"524":0,"526":0,"536":0,"537":0,"553":0,"561":0,"563":0,"574":0,"578":0,"590":0,"591":0,"592":0,"593":0,"595":0,"608":0,"610":0,"615":0,"616":0,"617":0,"619":0,"620":0,"621":0,"622":0,"624":0,"627":0,"629":0,"630":0,"631":0,"632":0,"636":0,"641":0,"654":0,"668":0,"669":0,"670":0,"684":0,"696":0,"708":0,"720":0,"734":0,"748":0,"749":0,"752":0,"764":0,"765":0,"782":0,"783":0,"784":0,"785":0,"786":0,"788":0,"803":0,"805":0,"806":0,"810":0,"835":0,"840":0,"841":0,"844":0,"845":0,"848":0,"849":0,"861":0,"863":0,"864":0,"867":0,"868":0,"869":0,"870":0,"882":0,"884":0,"885":0,"898":0,"911":0,"922":0,"927":0,"929":0,"930":0,"933":0,"944":0,"946":0,"957":0,"958":0,"974":0,"976":0,"979":0,"981":0,"985":0,"997":0,"998":0,"999":0,"1000":0,"1011":0,"1012":0,"1013":0,"1252":0,"1272":0,"1344":0,"1490":0,"1493":0,"1509":0};+_yuitest_coverage["build/console/console.js"].functions = {"Console:94":0,"log:170":0,"clearConsole:182":0,"reset:199":0,"collapse:211":0,"expand:223":0,"printBuffer:240":0,"initializer:297":0,"destructor:337":0,"renderUI:353":0,"syncUI:370":0,"bindUI:382":0,"_initHead:410":0,"_initBody:429":0,"_initFoot:443":0,"_isInLogLevel:462":0,"_normalizeMessage:499":0,"_schedulePrint:535":0,"(anonymous 2):562":0,"_createEntryHTML:552":0,"scrollToLatest:573":0,"_htmlEscapeMessage:589":0,"_trimOldEntries:605":0,"_encodeHTML:653":0,"_cancelPrintLoop:667":0,"_validateStyle:683":0,"_onPauseClick:695":0,"_onClearClick:707":0,"_onCollapseClick:719":0,"_validateLogSource:733":0,"_setLogLevel:747":0,"_getUseBrowserConsole:763":0,"_setUseBrowserConsole:781":0,"_uiSetHeight:802":0,"_afterStringsChange:834":0,"_afterPausedChange:860":0,"_uiUpdatePaused:881":0,"_afterConsoleLimitChange:897":0,"_afterCollapsedChange:910":0,"_uiUpdateCollapsed:921":0,"_afterVisibleChange:943":0,"_uiUpdateFromHideShow:956":0,"_onLogEvent:972":0,"_defResetFn:996":0,"_defEntryFn:1010":0,"validator:1251":0,"valueFn:1272":0,"setter:1343":0,"getter:1489":0,"setter:1492":0,"validator:1508":0,"(anonymous 1):1":0};+_yuitest_coverage["build/console/console.js"].coveredLines = 184;+_yuitest_coverage["build/console/console.js"].coveredFunctions = 52;+_yuitest_coverline("build/console/console.js", 1);+YUI.add('console', function (Y, NAME) {++/**+ * Console creates a visualization for messages logged through calls to a YUI+ * instance's <code>Y.log( message, category, source )</code> method. The+ * debug versions of YUI modules will include logging statements to offer some+ * insight into the steps executed during that module's operation. Including+ * log statements in your code will cause those messages to also appear in the+ * Console. Use Console to aid in developing your page or application.+ *+ * Entry categories "info", "warn", and "error"+ * are also referred to as the log level, and entries are filtered against the+ * configured logLevel.+ *+ * @module console+ * @class Console+ * @extends Widget+ * @param conf {Object} Configuration object (see Configuration attributes)+ * @constructor+ */+_yuitest_coverfunc("build/console/console.js", "(anonymous 1)", 1);+_yuitest_coverline("build/console/console.js", 21);+var getCN = Y.ClassNameManager.getClassName,+ CHECKED = 'checked',+ CLEAR = 'clear',+ CLICK = 'click',+ COLLAPSED = 'collapsed',+ CONSOLE = 'console',+ CONTENT_BOX = 'contentBox',+ DISABLED = 'disabled',+ ENTRY = 'entry',+ ERROR = 'error',+ HEIGHT = 'height',+ INFO = 'info',+ LAST_TIME = 'lastTime',+ PAUSE = 'pause',+ PAUSED = 'paused',+ RESET = 'reset',+ START_TIME = 'startTime',+ TITLE = 'title',+ WARN = 'warn',++ DOT = '.',++ C_BUTTON = getCN(CONSOLE,'button'),+ C_CHECKBOX = getCN(CONSOLE,'checkbox'),+ C_CLEAR = getCN(CONSOLE,CLEAR),+ C_COLLAPSE = getCN(CONSOLE,'collapse'),+ C_COLLAPSED = getCN(CONSOLE,COLLAPSED),+ C_CONSOLE_CONTROLS = getCN(CONSOLE,'controls'),+ C_CONSOLE_HD = getCN(CONSOLE,'hd'),+ C_CONSOLE_BD = getCN(CONSOLE,'bd'),+ C_CONSOLE_FT = getCN(CONSOLE,'ft'),+ C_CONSOLE_TITLE = getCN(CONSOLE,TITLE),+ C_ENTRY = getCN(CONSOLE,ENTRY),+ C_ENTRY_CAT = getCN(CONSOLE,ENTRY,'cat'),+ C_ENTRY_CONTENT = getCN(CONSOLE,ENTRY,'content'),+ C_ENTRY_META = getCN(CONSOLE,ENTRY,'meta'),+ C_ENTRY_SRC = getCN(CONSOLE,ENTRY,'src'),+ C_ENTRY_TIME = getCN(CONSOLE,ENTRY,'time'),+ C_PAUSE = getCN(CONSOLE,PAUSE),+ C_PAUSE_LABEL = getCN(CONSOLE,PAUSE,'label'),++ RE_INLINE_SOURCE = /^(\S+)\s/,+ RE_AMP = /&(?!#?[a-z0-9]+;)/g,+ RE_GT = />/g,+ RE_LT = /</g,++ ESC_AMP = '&',+ ESC_GT = '>',+ ESC_LT = '<',+ + ENTRY_TEMPLATE_STR =+ '<div class="{entry_class} {cat_class} {src_class}">'++ '<p class="{entry_meta_class}">'++ '<span class="{entry_src_class}">'++ '{sourceAndDetail}'++ '</span>'++ '<span class="{entry_cat_class}">'++ '{category}</span>'++ '<span class="{entry_time_class}">'++ ' {totalTime}ms (+{elapsedTime}) {localTime}'++ '</span>'++ '</p>'++ '<pre class="{entry_content_class}">{message}</pre>'++ '</div>',++ L = Y.Lang,+ create = Y.Node.create,+ isNumber = L.isNumber,+ isString = L.isString,+ merge = Y.merge,+ substitute = Y.Lang.sub;+ ++_yuitest_coverline("build/console/console.js", 94);+function Console() {+ _yuitest_coverfunc("build/console/console.js", "Console", 94);+_yuitest_coverline("build/console/console.js", 95);+Console.superclass.constructor.apply(this,arguments);+}++_yuitest_coverline("build/console/console.js", 98);+Y.Console = Y.extend(Console, Y.Widget,++// Y.Console prototype+{+ /**+ * Category to prefix all event subscriptions to allow for ease of detach+ * during destroy.+ *+ * @property _evtCat+ * @type string+ * @protected+ */+ _evtCat : null,++ /**+ * Reference to the Node instance containing the header contents.+ *+ * @property _head+ * @type Node+ * @default null+ * @protected+ */+ _head : null,++ /**+ * Reference to the Node instance that will house the console messages.+ *+ * @property _body+ * @type Node+ * @default null+ * @protected+ */+ _body : null,++ /**+ * Reference to the Node instance containing the footer contents.+ *+ * @property _foot+ * @type Node+ * @default null+ * @protected+ */+ _foot : null,++ /**+ * Holds the object API returned from <code>Y.later</code> for the print+ * loop interval.+ *+ * @property _printLoop+ * @type Object+ * @default null+ * @protected+ */+ _printLoop : null,++ /**+ * Array of normalized message objects awaiting printing.+ *+ * @property buffer+ * @type Array+ * @default null+ * @protected+ */+ buffer : null,++ /**+ * Wrapper for <code>Y.log</code>.+ *+ * @method log+ * @param arg* {MIXED} (all arguments passed through to <code>Y.log</code>)+ * @chainable+ */+ log : function () {+ _yuitest_coverfunc("build/console/console.js", "log", 170);+_yuitest_coverline("build/console/console.js", 171);+Y.log.apply(Y,arguments);++ _yuitest_coverline("build/console/console.js", 173);+return this;+ },++ /**+ * Clear the console of messages and flush the buffer of pending messages.+ *+ * @method clearConsole+ * @chainable+ */+ clearConsole : function () {+ // TODO: clear event listeners from console contents+ _yuitest_coverfunc("build/console/console.js", "clearConsole", 182);+_yuitest_coverline("build/console/console.js", 184);+this._body.empty();++ _yuitest_coverline("build/console/console.js", 186);+this._cancelPrintLoop();++ _yuitest_coverline("build/console/console.js", 188);+this.buffer = [];++ _yuitest_coverline("build/console/console.js", 190);+return this;+ },++ /**+ * Clears the console and resets internal timers.+ *+ * @method reset+ * @chainable+ */+ reset : function () {+ _yuitest_coverfunc("build/console/console.js", "reset", 199);+_yuitest_coverline("build/console/console.js", 200);+this.fire(RESET);+ + _yuitest_coverline("build/console/console.js", 202);+return this;+ },++ /**+ * Collapses the body and footer.+ *+ * @method collapse+ * @chainable+ */+ collapse : function () {+ _yuitest_coverfunc("build/console/console.js", "collapse", 211);+_yuitest_coverline("build/console/console.js", 212);+this.set(COLLAPSED, true);++ _yuitest_coverline("build/console/console.js", 214);+return this;+ },++ /**+ * Expands the body and footer if collapsed.+ *+ * @method expand+ * @chainable+ */+ expand : function () {+ _yuitest_coverfunc("build/console/console.js", "expand", 223);+_yuitest_coverline("build/console/console.js", 224);+this.set(COLLAPSED, false);++ _yuitest_coverline("build/console/console.js", 226);+return this;+ },++ /**+ * Outputs buffered messages to the console UI. This is typically called+ * from a scheduled interval until the buffer is empty (referred to as the+ * print loop). The number of buffered messages output to the Console is+ * limited to the number provided as an argument. If no limit is passed,+ * all buffered messages are rendered.+ * + * @method printBuffer+ * @param limit {Number} (optional) max number of buffered entries to write+ * @chainable+ */+ printBuffer: function (limit) {+ _yuitest_coverfunc("build/console/console.js", "printBuffer", 240);+_yuitest_coverline("build/console/console.js", 241);+var messages = this.buffer,+ debug = Y.config.debug,+ entries = [],+ consoleLimit= this.get('consoleLimit'),+ newestOnTop = this.get('newestOnTop'),+ anchor = newestOnTop ? this._body.get('firstChild') : null,+ i;++ _yuitest_coverline("build/console/console.js", 249);+if (messages.length > consoleLimit) {+ _yuitest_coverline("build/console/console.js", 250);+messages.splice(0, messages.length - consoleLimit);+ }++ _yuitest_coverline("build/console/console.js", 253);+limit = Math.min(messages.length, (limit || messages.length));+ + // turn off logging system+ _yuitest_coverline("build/console/console.js", 256);+Y.config.debug = false;++ _yuitest_coverline("build/console/console.js", 258);+if (!this.get(PAUSED) && this.get('rendered')) {++ _yuitest_coverline("build/console/console.js", 260);+for (i = 0; i < limit && messages.length; ++i) {+ _yuitest_coverline("build/console/console.js", 261);+entries[i] = this._createEntryHTML(messages.shift());+ }++ _yuitest_coverline("build/console/console.js", 264);+if (!messages.length) {+ _yuitest_coverline("build/console/console.js", 265);+this._cancelPrintLoop();+ }++ _yuitest_coverline("build/console/console.js", 268);+if (entries.length) {+ _yuitest_coverline("build/console/console.js", 269);+if (newestOnTop) {+ _yuitest_coverline("build/console/console.js", 270);+entries.reverse();+ }++ _yuitest_coverline("build/console/console.js", 273);+this._body.insertBefore(create(entries.join('')), anchor);++ _yuitest_coverline("build/console/console.js", 275);+if (this.get('scrollIntoView')) {+ _yuitest_coverline("build/console/console.js", 276);+this.scrollToLatest();+ }++ _yuitest_coverline("build/console/console.js", 279);+this._trimOldEntries();+ }+ }++ // restore logging system+ _yuitest_coverline("build/console/console.js", 284);+Y.config.debug = debug;++ _yuitest_coverline("build/console/console.js", 286);+return this;+ },++ + /**+ * Constructor code. Set up the buffer and entry template, publish+ * internal events, and subscribe to the configured logEvent.+ * + * @method initializer+ * @protected+ */+ initializer : function () {+ _yuitest_coverfunc("build/console/console.js", "initializer", 297);+_yuitest_coverline("build/console/console.js", 298);+this._evtCat = Y.stamp(this) + '|';++ _yuitest_coverline("build/console/console.js", 300);+this.buffer = [];++ _yuitest_coverline("build/console/console.js", 302);+this.get('logSource').on(this._evtCat ++ this.get('logEvent'),Y.bind("_onLogEvent",this));++ /**+ * Transfers a received message to the print loop buffer. Default+ * behavior defined in _defEntryFn.+ *+ * @event entry+ * @param event {Event.Facade} An Event Facade object with the following attribute specific properties added:+ * <dl>+ * <dt>message</dt>+ * <dd>The message data normalized into an object literal (see _normalizeMessage)</dd>+ * </dl>+ * @preventable _defEntryFn+ */+ _yuitest_coverline("build/console/console.js", 317);+this.publish(ENTRY, { defaultFn: this._defEntryFn });++ /**+ * Triggers the reset behavior via the default logic in _defResetFn.+ *+ * @event reset+ * @param event {Event.Facade} Event Facade object+ * @preventable _defResetFn+ */+ _yuitest_coverline("build/console/console.js", 326);+this.publish(RESET, { defaultFn: this._defResetFn });++ _yuitest_coverline("build/console/console.js", 328);+this.after('rendered', this._schedulePrint);+ },++ /**+ * Tears down the instance, flushing event subscriptions and purging the UI.+ *+ * @method destructor+ * @protected+ */+ destructor : function () {+ _yuitest_coverfunc("build/console/console.js", "destructor", 337);+_yuitest_coverline("build/console/console.js", 338);+var bb = this.get('boundingBox');++ _yuitest_coverline("build/console/console.js", 340);+this._cancelPrintLoop();++ _yuitest_coverline("build/console/console.js", 342);+this.get('logSource').detach(this._evtCat + '*');+ + _yuitest_coverline("build/console/console.js", 344);+bb.purge(true);+ },++ /**+ * Generate the Console UI.+ *+ * @method renderUI+ * @protected+ */+ renderUI : function () {+ _yuitest_coverfunc("build/console/console.js", "renderUI", 353);+_yuitest_coverline("build/console/console.js", 354);+this._initHead();+ _yuitest_coverline("build/console/console.js", 355);+this._initBody();+ _yuitest_coverline("build/console/console.js", 356);+this._initFoot();++ // Apply positioning to the bounding box if appropriate+ _yuitest_coverline("build/console/console.js", 359);+var style = this.get('style');+ _yuitest_coverline("build/console/console.js", 360);+if (style !== 'block') {+ _yuitest_coverline("build/console/console.js", 361);+this.get('boundingBox').addClass(this.getClassName(style));+ }+ },++ /**+ * Sync the UI state to the current attribute state.+ *+ * @method syncUI+ */+ syncUI : function () {+ _yuitest_coverfunc("build/console/console.js", "syncUI", 370);+_yuitest_coverline("build/console/console.js", 371);+this._uiUpdatePaused(this.get(PAUSED));+ _yuitest_coverline("build/console/console.js", 372);+this._uiUpdateCollapsed(this.get(COLLAPSED));+ _yuitest_coverline("build/console/console.js", 373);+this._uiSetHeight(this.get(HEIGHT));+ },++ /**+ * Set up event listeners to wire up the UI to the internal state.+ *+ * @method bindUI+ * @protected+ */+ bindUI : function () {+ _yuitest_coverfunc("build/console/console.js", "bindUI", 382);+_yuitest_coverline("build/console/console.js", 383);+this.get(CONTENT_BOX).one('button.'+C_COLLAPSE).+ on(CLICK,this._onCollapseClick,this);++ _yuitest_coverline("build/console/console.js", 386);+this.get(CONTENT_BOX).one('input[type=checkbox].'+C_PAUSE).+ on(CLICK,this._onPauseClick,this);++ _yuitest_coverline("build/console/console.js", 389);+this.get(CONTENT_BOX).one('button.'+C_CLEAR).+ on(CLICK,this._onClearClick,this);++ // Attribute changes+ _yuitest_coverline("build/console/console.js", 393);+this.after(this._evtCat + 'stringsChange',+ this._afterStringsChange);+ _yuitest_coverline("build/console/console.js", 395);+this.after(this._evtCat + 'pausedChange',+ this._afterPausedChange);+ _yuitest_coverline("build/console/console.js", 397);+this.after(this._evtCat + 'consoleLimitChange',+ this._afterConsoleLimitChange);+ _yuitest_coverline("build/console/console.js", 399);+this.after(this._evtCat + 'collapsedChange',+ this._afterCollapsedChange);+ },++ + /**+ * Create the DOM structure for the header elements.+ *+ * @method _initHead+ * @protected+ */+ _initHead : function () {+ _yuitest_coverfunc("build/console/console.js", "_initHead", 410);+_yuitest_coverline("build/console/console.js", 411);+var cb = this.get(CONTENT_BOX),+ info = merge(Console.CHROME_CLASSES, {+ str_collapse : this.get('strings.collapse'),+ str_title : this.get('strings.title')+ });++ _yuitest_coverline("build/console/console.js", 417);+this._head = create(substitute(Console.HEADER_TEMPLATE,info));++ _yuitest_coverline("build/console/console.js", 419);+cb.insertBefore(this._head,cb.get('firstChild'));+ },++ /**+ * Create the DOM structure for the console body—where messages are+ * rendered.+ *+ * @method _initBody+ * @protected+ */+ _initBody : function () {+ _yuitest_coverfunc("build/console/console.js", "_initBody", 429);+_yuitest_coverline("build/console/console.js", 430);+this._body = create(substitute(+ Console.BODY_TEMPLATE,+ Console.CHROME_CLASSES));++ _yuitest_coverline("build/console/console.js", 434);+this.get(CONTENT_BOX).appendChild(this._body);+ },++ /**+ * Create the DOM structure for the footer elements.+ *+ * @method _initFoot+ * @protected+ */+ _initFoot : function () {+ _yuitest_coverfunc("build/console/console.js", "_initFoot", 443);+_yuitest_coverline("build/console/console.js", 444);+var info = merge(Console.CHROME_CLASSES, {+ id_guid : Y.guid(),+ str_pause : this.get('strings.pause'),+ str_clear : this.get('strings.clear')+ });++ _yuitest_coverline("build/console/console.js", 450);+this._foot = create(substitute(Console.FOOTER_TEMPLATE,info));++ _yuitest_coverline("build/console/console.js", 452);+this.get(CONTENT_BOX).appendChild(this._foot);+ },++ /**+ * Determine if incoming log messages are within the configured logLevel+ * to be buffered for printing.+ *+ * @method _isInLogLevel+ * @protected+ */+ _isInLogLevel : function (e) {+ _yuitest_coverfunc("build/console/console.js", "_isInLogLevel", 462);+_yuitest_coverline("build/console/console.js", 463);+var cat = e.cat, lvl = this.get('logLevel');++ _yuitest_coverline("build/console/console.js", 465);+if (lvl !== INFO) {+ _yuitest_coverline("build/console/console.js", 466);+cat = cat || INFO;++ _yuitest_coverline("build/console/console.js", 468);+if (isString(cat)) {+ _yuitest_coverline("build/console/console.js", 469);+cat = cat.toLowerCase();+ }++ _yuitest_coverline("build/console/console.js", 472);+if ((cat === WARN && lvl === ERROR) ||+ (cat === INFO && lvl !== INFO)) {+ _yuitest_coverline("build/console/console.js", 474);+return false;+ }+ }++ _yuitest_coverline("build/console/console.js", 478);+return true;+ },++ /**+ * Create a log entry message from the inputs including the following keys:+ * <ul>+ * <li>time - this moment</li>+ * <li>message - leg message</li>+ * <li>category - logLevel or custom category for the message</li>+ * <li>source - when provided, the widget or util calling Y.log</li>+ * <li>sourceAndDetail - same as source but can include instance info</li>+ * <li>localTime - readable version of time</li>+ * <li>elapsedTime - ms since last entry</li>+ * <li>totalTime - ms since Console was instantiated or reset</li>+ * </ul>+ *+ * @method _normalizeMessage+ * @param e {Event} custom event containing the log message+ * @return Object the message object+ * @protected+ */+ _normalizeMessage : function (e) {++ _yuitest_coverfunc("build/console/console.js", "_normalizeMessage", 499);+_yuitest_coverline("build/console/console.js", 501);+var msg = e.msg,+ cat = e.cat,+ src = e.src,++ m = {+ time : new Date(),+ message : msg,+ category : cat || this.get('defaultCategory'),+ sourceAndDetail : src || this.get('defaultSource'),+ source : null,+ localTime : null,+ elapsedTime : null,+ totalTime : null+ };++ // Extract m.source "Foo" from m.sourceAndDetail "Foo bar baz"+ _yuitest_coverline("build/console/console.js", 517);+m.source = RE_INLINE_SOURCE.test(m.sourceAndDetail) ?+ RegExp.$1 : m.sourceAndDetail;+ _yuitest_coverline("build/console/console.js", 519);+m.localTime = m.time.toLocaleTimeString ? + m.time.toLocaleTimeString() : (m.time + '');+ _yuitest_coverline("build/console/console.js", 521);+m.elapsedTime = m.time - this.get(LAST_TIME);+ _yuitest_coverline("build/console/console.js", 522);+m.totalTime = m.time - this.get(START_TIME);++ _yuitest_coverline("build/console/console.js", 524);+this._set(LAST_TIME,m.time);++ _yuitest_coverline("build/console/console.js", 526);+return m;+ },++ /**+ * Sets an interval for buffered messages to be output to the console.+ *+ * @method _schedulePrint+ * @protected+ */+ _schedulePrint : function () {+ _yuitest_coverfunc("build/console/console.js", "_schedulePrint", 535);+_yuitest_coverline("build/console/console.js", 536);+if (!this._printLoop && !this.get(PAUSED) && this.get('rendered')) {+ _yuitest_coverline("build/console/console.js", 537);+this._printLoop = Y.later(+ this.get('printTimeout'),+ this, this.printBuffer,+ this.get('printLimit'), true);+ }+ },++ /**+ * Translates message meta into the markup for a console entry.+ *+ * @method _createEntryHTML+ * @param m {Object} object literal containing normalized message metadata+ * @return String+ * @protected+ */+ _createEntryHTML : function (m) {+ _yuitest_coverfunc("build/console/console.js", "_createEntryHTML", 552);+_yuitest_coverline("build/console/console.js", 553);+m = merge(+ this._htmlEscapeMessage(m),+ Console.ENTRY_CLASSES,+ {+ cat_class : this.getClassName(ENTRY,m.category),+ src_class : this.getClassName(ENTRY,m.source)+ });++ _yuitest_coverline("build/console/console.js", 561);+return this.get('entryTemplate').replace(/\{(\w+)\}/g,+ function (_,token) {+ _yuitest_coverfunc("build/console/console.js", "(anonymous 2)", 562);+_yuitest_coverline("build/console/console.js", 563);+return token in m ? m[token] : '';+ });+ },++ /**+ * Scrolls to the most recent entry+ *+ * @method scrollToLatest+ * @chainable+ */+ scrollToLatest : function () {+ _yuitest_coverfunc("build/console/console.js", "scrollToLatest", 573);+_yuitest_coverline("build/console/console.js", 574);+var scrollTop = this.get('newestOnTop') ?+ 0 :+ this._body.get('scrollHeight');++ _yuitest_coverline("build/console/console.js", 578);+this._body.set('scrollTop', scrollTop);+ },++ /**+ * Performs HTML escaping on strings in the message object.+ *+ * @method _htmlEscapeMessage+ * @param m {Object} the normalized message object+ * @return Object the message object with proper escapement+ * @protected+ */+ _htmlEscapeMessage : function (m) {+ _yuitest_coverfunc("build/console/console.js", "_htmlEscapeMessage", 589);+_yuitest_coverline("build/console/console.js", 590);+m.message = this._encodeHTML(m.message);+ _yuitest_coverline("build/console/console.js", 591);+m.source = this._encodeHTML(m.source);+ _yuitest_coverline("build/console/console.js", 592);+m.sourceAndDetail = this._encodeHTML(m.sourceAndDetail);+ _yuitest_coverline("build/console/console.js", 593);+m.category = this._encodeHTML(m.category);++ _yuitest_coverline("build/console/console.js", 595);+return m;+ },++ /**+ * Removes the oldest message entries from the UI to maintain the limit+ * specified in the consoleLimit configuration.+ *+ * @method _trimOldEntries+ * @protected+ */+ _trimOldEntries : function () {+ // Turn off the logging system for the duration of this operation+ // to prevent an infinite loop+ _yuitest_coverfunc("build/console/console.js", "_trimOldEntries", 605);+_yuitest_coverline("build/console/console.js", 608);+Y.config.debug = false;++ _yuitest_coverline("build/console/console.js", 610);+var bd = this._body,+ limit = this.get('consoleLimit'),+ debug = Y.config.debug,+ entries,e,i,l;++ _yuitest_coverline("build/console/console.js", 615);+if (bd) {+ _yuitest_coverline("build/console/console.js", 616);+entries = bd.all(DOT+C_ENTRY);+ _yuitest_coverline("build/console/console.js", 617);+l = entries.size() - limit;++ _yuitest_coverline("build/console/console.js", 619);+if (l > 0) {+ _yuitest_coverline("build/console/console.js", 620);+if (this.get('newestOnTop')) {+ _yuitest_coverline("build/console/console.js", 621);+i = limit;+ _yuitest_coverline("build/console/console.js", 622);+l = entries.size();+ } else {+ _yuitest_coverline("build/console/console.js", 624);+i = 0;+ }++ _yuitest_coverline("build/console/console.js", 627);+this._body.setStyle('display','none');++ _yuitest_coverline("build/console/console.js", 629);+for (;i < l; ++i) {+ _yuitest_coverline("build/console/console.js", 630);+e = entries.item(i);+ _yuitest_coverline("build/console/console.js", 631);+if (e) {+ _yuitest_coverline("build/console/console.js", 632);+e.remove();+ }+ }++ _yuitest_coverline("build/console/console.js", 636);+this._body.setStyle('display','');+ }++ }++ _yuitest_coverline("build/console/console.js", 641);+Y.config.debug = debug;+ },++ /**+ * Returns the input string with ampersands (&), <, and > encoded+ * as HTML entities.+ *+ * @method _encodeHTML+ * @param s {String} the raw string+ * @return String the encoded string+ * @protected+ */+ _encodeHTML : function (s) {+ _yuitest_coverfunc("build/console/console.js", "_encodeHTML", 653);+_yuitest_coverline("build/console/console.js", 654);+return isString(s) ?+ s.replace(RE_AMP,ESC_AMP).+ replace(RE_LT, ESC_LT).+ replace(RE_GT, ESC_GT) :+ s;+ },++ /**+ * Clears the timeout for printing buffered messages.+ *+ * @method _cancelPrintLoop+ * @protected+ */+ _cancelPrintLoop : function () {+ _yuitest_coverfunc("build/console/console.js", "_cancelPrintLoop", 667);+_yuitest_coverline("build/console/console.js", 668);+if (this._printLoop) {+ _yuitest_coverline("build/console/console.js", 669);+this._printLoop.cancel();+ _yuitest_coverline("build/console/console.js", 670);+this._printLoop = null;+ }+ },++ /**+ * Validates input value for style attribute. Accepts only values 'inline',+ * 'block', and 'separate'.+ *+ * @method _validateStyle+ * @param style {String} the proposed value+ * @return {Boolean} pass/fail+ * @protected+ */+ _validateStyle : function (style) {+ _yuitest_coverfunc("build/console/console.js", "_validateStyle", 683);+_yuitest_coverline("build/console/console.js", 684);+return style === 'inline' || style === 'block' || style === 'separate';+ },++ /**+ * Event handler for clicking on the Pause checkbox to update the paused+ * attribute.+ *+ * @method _onPauseClick+ * @param e {Event} DOM event facade for the click event+ * @protected+ */+ _onPauseClick : function (e) {+ _yuitest_coverfunc("build/console/console.js", "_onPauseClick", 695);+_yuitest_coverline("build/console/console.js", 696);+this.set(PAUSED,e.target.get(CHECKED));+ },++ /**+ * Event handler for clicking on the Clear button. Pass-through to+ * <code>this.clearConsole()</code>.+ *+ * @method _onClearClick+ * @param e {Event} DOM event facade for the click event+ * @protected+ */+ _onClearClick : function (e) {+ _yuitest_coverfunc("build/console/console.js", "_onClearClick", 707);+_yuitest_coverline("build/console/console.js", 708);+this.clearConsole();+ },++ /**+ * Event handler for clicking on the Collapse/Expand button. Sets the+ * "collapsed" attribute accordingly.+ *+ * @method _onCollapseClick+ * @param e {Event} DOM event facade for the click event+ * @protected+ */+ _onCollapseClick : function (e) {+ _yuitest_coverfunc("build/console/console.js", "_onCollapseClick", 719);+_yuitest_coverline("build/console/console.js", 720);+this.set(COLLAPSED, !this.get(COLLAPSED));+ },+++ /**+ * Validator for logSource attribute.+ *+ * @method _validateLogSource+ * @param v {Object} the desired logSource+ * @return {Boolean} true if the input is an object with an <code>on</code>+ * method+ * @protected+ */+ _validateLogSource: function (v) {+ _yuitest_coverfunc("build/console/console.js", "_validateLogSource", 733);+_yuitest_coverline("build/console/console.js", 734);+return v && Y.Lang.isFunction(v.on);+ },++ /**+ * Setter method for logLevel attribute. Acceptable values are+ * "error", "warn", and "info" (case+ * insensitive). Other values are treated as "info".+ *+ * @method _setLogLevel+ * @param v {String} the desired log level+ * @return String One of Console.LOG_LEVEL_INFO, _WARN, or _ERROR+ * @protected+ */+ _setLogLevel : function (v) {+ _yuitest_coverfunc("build/console/console.js", "_setLogLevel", 747);+_yuitest_coverline("build/console/console.js", 748);+if (isString(v)) {+ _yuitest_coverline("build/console/console.js", 749);+v = v.toLowerCase();+ }+ + _yuitest_coverline("build/console/console.js", 752);+return (v === WARN || v === ERROR) ? v : INFO;+ },++ /**+ * Getter method for useBrowserConsole attribute. Just a pass through to+ * the YUI instance configuration setting.+ *+ * @method _getUseBrowserConsole+ * @return {Boolean} or null if logSource is not a YUI instance+ * @protected+ */+ _getUseBrowserConsole: function () {+ _yuitest_coverfunc("build/console/console.js", "_getUseBrowserConsole", 763);+_yuitest_coverline("build/console/console.js", 764);+var logSource = this.get('logSource');+ _yuitest_coverline("build/console/console.js", 765);+return logSource instanceof YUI ?+ logSource.config.useBrowserConsole : null;+ },++ /**+ * Setter method for useBrowserConsole attributes. Only functional if the+ * logSource attribute points to a YUI instance. Passes the value down to+ * the YUI instance. NOTE: multiple Console instances cannot maintain+ * independent useBrowserConsole values, since it is just a pass through to+ * the YUI instance configuration.+ *+ * @method _setUseBrowserConsole+ * @param v {Boolean} false to disable browser console printing (default)+ * @return {Boolean} true|false if logSource is a YUI instance+ * @protected+ */+ _setUseBrowserConsole: function (v) {+ _yuitest_coverfunc("build/console/console.js", "_setUseBrowserConsole", 781);+_yuitest_coverline("build/console/console.js", 782);+var logSource = this.get('logSource');+ _yuitest_coverline("build/console/console.js", 783);+if (logSource instanceof YUI) {+ _yuitest_coverline("build/console/console.js", 784);+v = !!v;+ _yuitest_coverline("build/console/console.js", 785);+logSource.config.useBrowserConsole = v;+ _yuitest_coverline("build/console/console.js", 786);+return v;+ } else {+ _yuitest_coverline("build/console/console.js", 788);+return Y.Attribute.INVALID_VALUE;+ }+ },++ /**+ * Set the height of the Console container. Set the body height to the+ * difference between the configured height and the calculated heights of+ * the header and footer.+ * Overrides Widget.prototype._uiSetHeight.+ *+ * @method _uiSetHeight+ * @param v {String|Number} the new height+ * @protected+ */+ _uiSetHeight : function (v) {+ _yuitest_coverfunc("build/console/console.js", "_uiSetHeight", 802);+_yuitest_coverline("build/console/console.js", 803);+Console.superclass._uiSetHeight.apply(this,arguments);++ _yuitest_coverline("build/console/console.js", 805);+if (this._head && this._foot) {+ _yuitest_coverline("build/console/console.js", 806);+var h = this.get('boundingBox').get('offsetHeight') -+ this._head.get('offsetHeight') -+ this._foot.get('offsetHeight');++ _yuitest_coverline("build/console/console.js", 810);+this._body.setStyle(HEIGHT,h+'px');+ }+ },++ /**+ * Over-ride default content box sizing to do nothing, since we're sizing+ * the body section to fill out height ourselves.+ * + * @method _uiSizeCB+ * @protected+ */+ _uiSizeCB : function() {+ // Do Nothing. Ideally want to move to Widget-StdMod, which accounts for+ // _uiSizeCB + },++ /**+ * Updates the UI if changes are made to any of the strings in the strings+ * attribute.+ *+ * @method _afterStringsChange+ * @param e {Event} Custom event for the attribute change+ * @protected+ */+ _afterStringsChange : function (e) {+ _yuitest_coverfunc("build/console/console.js", "_afterStringsChange", 834);+_yuitest_coverline("build/console/console.js", 835);+var prop = e.subAttrName ? e.subAttrName.split(DOT)[1] : null,+ cb = this.get(CONTENT_BOX),+ before = e.prevVal,+ after = e.newVal;++ _yuitest_coverline("build/console/console.js", 840);+if ((!prop || prop === TITLE) && before.title !== after.title) {+ _yuitest_coverline("build/console/console.js", 841);+cb.all(DOT+C_CONSOLE_TITLE).setHTML(after.title);+ }++ _yuitest_coverline("build/console/console.js", 844);+if ((!prop || prop === PAUSE) && before.pause !== after.pause) {+ _yuitest_coverline("build/console/console.js", 845);+cb.all(DOT+C_PAUSE_LABEL).setHTML(after.pause);+ }++ _yuitest_coverline("build/console/console.js", 848);+if ((!prop || prop === CLEAR) && before.clear !== after.clear) {+ _yuitest_coverline("build/console/console.js", 849);+cb.all(DOT+C_CLEAR).set('value',after.clear);+ }+ },++ /**+ * Updates the UI and schedules or cancels the print loop.+ *+ * @method _afterPausedChange+ * @param e {Event} Custom event for the attribute change+ * @protected+ */+ _afterPausedChange : function (e) {+ _yuitest_coverfunc("build/console/console.js", "_afterPausedChange", 860);+_yuitest_coverline("build/console/console.js", 861);+var paused = e.newVal;++ _yuitest_coverline("build/console/console.js", 863);+if (e.src !== Y.Widget.SRC_UI) {+ _yuitest_coverline("build/console/console.js", 864);+this._uiUpdatePaused(paused);+ }++ _yuitest_coverline("build/console/console.js", 867);+if (!paused) {+ _yuitest_coverline("build/console/console.js", 868);+this._schedulePrint();+ } else {_yuitest_coverline("build/console/console.js", 869);+if (this._printLoop) {+ _yuitest_coverline("build/console/console.js", 870);+this._cancelPrintLoop();+ }}+ },++ /**+ * Checks or unchecks the paused checkbox+ *+ * @method _uiUpdatePaused+ * @param on {Boolean} the new checked state+ * @protected+ */+ _uiUpdatePaused : function (on) {+ _yuitest_coverfunc("build/console/console.js", "_uiUpdatePaused", 881);+_yuitest_coverline("build/console/console.js", 882);+var node = this._foot.all('input[type=checkbox].'+C_PAUSE);++ _yuitest_coverline("build/console/console.js", 884);+if (node) {+ _yuitest_coverline("build/console/console.js", 885);+node.set(CHECKED,on);+ }+ },++ /**+ * Calls this._trimOldEntries() in response to changes in the configured+ * consoleLimit attribute.+ * + * @method _afterConsoleLimitChange+ * @param e {Event} Custom event for the attribute change+ * @protected+ */+ _afterConsoleLimitChange : function () {+ _yuitest_coverfunc("build/console/console.js", "_afterConsoleLimitChange", 897);+_yuitest_coverline("build/console/console.js", 898);+this._trimOldEntries();+ },+++ /**+ * Updates the className of the contentBox, which should trigger CSS to+ * hide or show the body and footer sections depending on the new value.+ *+ * @method _afterCollapsedChange+ * @param e {Event} Custom event for the attribute change+ * @protected+ */+ _afterCollapsedChange : function (e) {+ _yuitest_coverfunc("build/console/console.js", "_afterCollapsedChange", 910);+_yuitest_coverline("build/console/console.js", 911);+this._uiUpdateCollapsed(e.newVal);+ },++ /**+ * Updates the UI to reflect the new Collapsed state+ *+ * @method _uiUpdateCollapsed+ * @param v {Boolean} true for collapsed, false for expanded+ * @protected+ */+ _uiUpdateCollapsed : function (v) {+ _yuitest_coverfunc("build/console/console.js", "_uiUpdateCollapsed", 921);+_yuitest_coverline("build/console/console.js", 922);+var bb = this.get('boundingBox'),+ button = bb.all('button.'+C_COLLAPSE),+ method = v ? 'addClass' : 'removeClass',+ str = this.get('strings.'+(v ? 'expand' : 'collapse'));++ _yuitest_coverline("build/console/console.js", 927);+bb[method](C_COLLAPSED);++ _yuitest_coverline("build/console/console.js", 929);+if (button) {+ _yuitest_coverline("build/console/console.js", 930);+button.setHTML(str);+ }++ _yuitest_coverline("build/console/console.js", 933);+this._uiSetHeight(v ? this._head.get('offsetHeight'): this.get(HEIGHT));+ },++ /**+ * Makes adjustments to the UI if needed when the Console is hidden or shown+ *+ * @method _afterVisibleChange+ * @param e {Event} the visibleChange event+ * @protected+ */+ _afterVisibleChange : function (e) {+ _yuitest_coverfunc("build/console/console.js", "_afterVisibleChange", 943);+_yuitest_coverline("build/console/console.js", 944);+Console.superclass._afterVisibleChange.apply(this,arguments);++ _yuitest_coverline("build/console/console.js", 946);+this._uiUpdateFromHideShow(e.newVal);+ },++ /**+ * Recalculates dimensions and updates appropriately when shown+ *+ * @method _uiUpdateFromHideShow+ * @param v {Boolean} true for visible, false for hidden+ * @protected+ */+ _uiUpdateFromHideShow : function (v) {+ _yuitest_coverfunc("build/console/console.js", "_uiUpdateFromHideShow", 956);+_yuitest_coverline("build/console/console.js", 957);+if (v) {+ _yuitest_coverline("build/console/console.js", 958);+this._uiSetHeight(this.get(HEIGHT));+ }+ },++ /**+ * Responds to log events by normalizing qualifying messages and passing+ * them along through the entry event for buffering etc.+ * + * @method _onLogEvent+ * @param msg {String} the log message+ * @param cat {String} OPTIONAL the category or logLevel of the message+ * @param src {String} OPTIONAL the source of the message (e.g. widget name)+ * @protected+ */+ _onLogEvent : function (e) {++ _yuitest_coverfunc("build/console/console.js", "_onLogEvent", 972);+_yuitest_coverline("build/console/console.js", 974);+if (!this.get(DISABLED) && this._isInLogLevel(e)) {++ _yuitest_coverline("build/console/console.js", 976);+var debug = Y.config.debug;++ /* TODO: needed? */+ _yuitest_coverline("build/console/console.js", 979);+Y.config.debug = false;++ _yuitest_coverline("build/console/console.js", 981);+this.fire(ENTRY, {+ message : this._normalizeMessage(e)+ });++ _yuitest_coverline("build/console/console.js", 985);+Y.config.debug = debug;+ }+ },++ /**+ * Clears the console, resets the startTime attribute, enables and+ * unpauses the widget.+ *+ * @method _defResetFn+ * @protected+ */+ _defResetFn : function () {+ _yuitest_coverfunc("build/console/console.js", "_defResetFn", 996);+_yuitest_coverline("build/console/console.js", 997);+this.clearConsole();+ _yuitest_coverline("build/console/console.js", 998);+this.set(START_TIME,new Date());+ _yuitest_coverline("build/console/console.js", 999);+this.set(DISABLED,false);+ _yuitest_coverline("build/console/console.js", 1000);+this.set(PAUSED,false);+ },++ /**+ * Buffers incoming message objects and schedules the printing.+ *+ * @method _defEntryFn+ * @param e {Event} The Custom event carrying the message in its payload+ * @protected+ */+ _defEntryFn : function (e) {+ _yuitest_coverfunc("build/console/console.js", "_defEntryFn", 1010);+_yuitest_coverline("build/console/console.js", 1011);+if (e.message) {+ _yuitest_coverline("build/console/console.js", 1012);+this.buffer.push(e.message);+ _yuitest_coverline("build/console/console.js", 1013);+this._schedulePrint();+ }+ }++},++// Y.Console static properties+{+ /**+ * The identity of the widget.+ *+ * @property NAME+ * @type String+ * @static+ */+ NAME : CONSOLE,++ /**+ * Static identifier for logLevel configuration setting to allow all+ * incoming messages to generate Console entries.+ *+ * @property LOG_LEVEL_INFO+ * @type String+ * @static+ */+ LOG_LEVEL_INFO : INFO,++ /**+ * Static identifier for logLevel configuration setting to allow only+ * incoming messages of logLevel "warn" or "error"+ * to generate Console entries.+ *+ * @property LOG_LEVEL_WARN+ * @type String+ * @static+ */+ LOG_LEVEL_WARN : WARN,++ /**+ * Static identifier for logLevel configuration setting to allow only+ * incoming messages of logLevel "error" to generate+ * Console entries.+ *+ * @property LOG_LEVEL_ERROR+ * @type String+ * @static+ */+ LOG_LEVEL_ERROR : ERROR,++ /**+ * Map (object) of classNames used to populate the placeholders in the+ * Console.ENTRY_TEMPLATE markup when rendering a new Console entry.+ *+ * <p>By default, the keys contained in the object are:</p>+ * <ul>+ * <li>entry_class</li>+ * <li>entry_meta_class</li>+ * <li>entry_cat_class</li>+ * <li>entry_src_class</li>+ * <li>entry_time_class</li>+ * <li>entry_content_class</li>+ * </ul>+ *+ * @property ENTRY_CLASSES+ * @type Object+ * @static+ */+ ENTRY_CLASSES : {+ entry_class : C_ENTRY,+ entry_meta_class : C_ENTRY_META,+ entry_cat_class : C_ENTRY_CAT,+ entry_src_class : C_ENTRY_SRC,+ entry_time_class : C_ENTRY_TIME,+ entry_content_class : C_ENTRY_CONTENT+ },++ /**+ * Map (object) of classNames used to populate the placeholders in the+ * Console.HEADER_TEMPLATE, Console.BODY_TEMPLATE, and+ * Console.FOOTER_TEMPLATE markup when rendering the Console UI.+ *+ * <p>By default, the keys contained in the object are:</p>+ * <ul>+ * <li>console_hd_class</li>+ * <li>console_bd_class</li>+ * <li>console_ft_class</li>+ * <li>console_controls_class</li>+ * <li>console_checkbox_class</li>+ * <li>console_pause_class</li>+ * <li>console_pause_label_class</li>+ * <li>console_button_class</li>+ * <li>console_clear_class</li>+ * <li>console_collapse_class</li>+ * <li>console_title_class</li>+ * </ul>+ *+ * @property CHROME_CLASSES+ * @type Object+ * @static+ */+ CHROME_CLASSES : {+ console_hd_class : C_CONSOLE_HD,+ console_bd_class : C_CONSOLE_BD,+ console_ft_class : C_CONSOLE_FT,+ console_controls_class : C_CONSOLE_CONTROLS,+ console_checkbox_class : C_CHECKBOX,+ console_pause_class : C_PAUSE,+ console_pause_label_class : C_PAUSE_LABEL,+ console_button_class : C_BUTTON,+ console_clear_class : C_CLEAR,+ console_collapse_class : C_COLLAPSE,+ console_title_class : C_CONSOLE_TITLE+ },++ /**+ * Markup template used to generate the DOM structure for the header+ * section of the Console when it is rendered. The template includes+ * these {placeholder}s:+ *+ * <ul>+ * <li>console_button_class - contributed by Console.CHROME_CLASSES</li>+ * <li>console_collapse_class - contributed by Console.CHROME_CLASSES</li>+ * <li>console_hd_class - contributed by Console.CHROME_CLASSES</li>+ * <li>console_title_class - contributed by Console.CHROME_CLASSES</li>+ * <li>str_collapse - pulled from attribute strings.collapse</li>+ * <li>str_title - pulled from attribute strings.title</li>+ * </ul>+ *+ * @property HEADER_TEMPLATE+ * @type String+ * @static+ */+ HEADER_TEMPLATE :+ '<div class="{console_hd_class}">'++ '<h4 class="{console_title_class}">{str_title}</h4>'++ '<button type="button" class="'++ '{console_button_class} {console_collapse_class}">{str_collapse}'++ '</button>'++ '</div>',++ /**+ * Markup template used to generate the DOM structure for the Console body+ * (where the messages are inserted) when it is rendered. The template+ * includes only the {placeholder} "console_bd_class", which is+ * constributed by Console.CHROME_CLASSES.+ *+ * @property BODY_TEMPLATE+ * @type String+ * @static+ */+ BODY_TEMPLATE : '<div class="{console_bd_class}"></div>',++ /**+ * Markup template used to generate the DOM structure for the footer+ * section of the Console when it is rendered. The template includes+ * many of the {placeholder}s from Console.CHROME_CLASSES as well as:+ *+ * <ul>+ * <li>id_guid - generated unique id, relates the label and checkbox</li>+ * <li>str_pause - pulled from attribute strings.pause</li>+ * <li>str_clear - pulled from attribute strings.clear</li>+ * </ul>+ *+ * @property FOOTER_TEMPLATE+ * @type String+ * @static+ */+ FOOTER_TEMPLATE :+ '<div class="{console_ft_class}">'++ '<div class="{console_controls_class}">'++ '<label for="{id_guid}" class="{console_pause_label_class}">'++ '<input type="checkbox" class="{console_checkbox_class} '++ '{console_pause_class}" value="1" id="{id_guid}"> '++ '{str_pause}</label>' ++ '<button type="button" class="'++ '{console_button_class} {console_clear_class}">{str_clear}'++ '</button>'++ '</div>'++ '</div>',++ /**+ * Default markup template used to create the DOM structure for Console+ * entries. The markup contains {placeholder}s for content and classes+ * that are replaced via Y.Lang.sub. The default template contains+ * the {placeholder}s identified in Console.ENTRY_CLASSES as well as the+ * following placeholders that will be populated by the log entry data:+ *+ * <ul>+ * <li>cat_class</li>+ * <li>src_class</li>+ * <li>totalTime</li>+ * <li>elapsedTime</li>+ * <li>localTime</li>+ * <li>sourceAndDetail</li>+ * <li>message</li>+ * </ul>+ *+ * @property ENTRY_TEMPLATE+ * @type String+ * @static+ */+ ENTRY_TEMPLATE : ENTRY_TEMPLATE_STR,++ /**+ * Static property used to define the default attribute configuration of+ * the Widget.+ *+ * @property ATTRS+ * @Type Object+ * @static+ */+ ATTRS : {++ /**+ * Name of the custom event that will communicate log messages.+ *+ * @attribute logEvent+ * @type String+ * @default "yui:log"+ */+ logEvent : {+ value : 'yui:log',+ writeOnce : true,+ validator : isString+ },++ /**+ * Object that will emit the log events. By default the YUI instance.+ * To have a single Console capture events from all YUI instances, set+ * this to the Y.Global object.+ *+ * @attribute logSource+ * @type EventTarget+ * @default Y+ */+ logSource : {+ value : Y,+ writeOnce : true,+ validator : function (v) {+ _yuitest_coverfunc("build/console/console.js", "validator", 1251);+_yuitest_coverline("build/console/console.js", 1252);+return this._validateLogSource(v);+ }+ },++ /**+ * Collection of strings used to label elements in the Console UI.+ * Default collection contains the following name:value pairs:+ *+ * <ul>+ * <li>title : "Log Console"</li>+ * <li>pause : "Pause"</li>+ * <li>clear : "Clear"</li>+ * <li>collapse : "Collapse"</li>+ * <li>expand : "Expand"</li>+ * </ul>+ *+ * @attribute strings+ * @type Object+ */+ strings : {+ valueFn: function() { _yuitest_coverfunc("build/console/console.js", "valueFn", 1272);+_yuitest_coverline("build/console/console.js", 1272);+return Y.Intl.get("console"); }+ },++ /**+ * Boolean to pause the outputting of new messages to the console.+ * When paused, messages will accumulate in the buffer.+ *+ * @attribute paused+ * @type boolean+ * @default false+ */+ paused : {+ value : false,+ validator : L.isBoolean+ },++ /**+ * If a category is not specified in the Y.log(..) statement, this+ * category will be used. Categories "info",+ * "warn", and "error" are also called log level.+ *+ * @attribute defaultCategory+ * @type String+ * @default "info"+ */+ defaultCategory : {+ value : INFO,+ validator : isString+ },++ /**+ * If a source is not specified in the Y.log(..) statement, this+ * source will be used.+ *+ * @attribute defaultSource+ * @type String+ * @default "global"+ */+ defaultSource : {+ value : 'global',+ validator : isString+ },++ /**+ * Markup template used to create the DOM structure for Console entries.+ *+ * @attribute entryTemplate+ * @type String+ * @default Console.ENTRY_TEMPLATE+ */+ entryTemplate : {+ value : ENTRY_TEMPLATE_STR,+ validator : isString+ },++ /**+ * Minimum entry log level to render into the Console. The initial+ * logLevel value for all Console instances defaults from the+ * Y.config.logLevel YUI configuration, or Console.LOG_LEVEL_INFO if+ * that configuration is not set.+ *+ * Possible values are "info", "warn",+ * "error" (case insensitive), or their corresponding statics+ * Console.LOG_LEVEL_INFO and so on.+ *+ * @attribute logLevel+ * @type String+ * @default Y.config.logLevel or Console.LOG_LEVEL_INFO+ */+ logLevel : {+ value : Y.config.logLevel || INFO,+ setter : function (v) {+ _yuitest_coverfunc("build/console/console.js", "setter", 1343);+_yuitest_coverline("build/console/console.js", 1344);+return this._setLogLevel(v);+ }+ },++ /**+ * Millisecond timeout between iterations of the print loop, moving+ * entries from the buffer to the UI.+ *+ * @attribute printTimeout+ * @type Number+ * @default 100+ */+ printTimeout : {+ value : 100,+ validator : isNumber+ },++ /**+ * Maximum number of entries printed in each iteration of the print+ * loop. This is used to prevent excessive logging locking the page UI.+ *+ * @attribute printLimit+ * @type Number+ * @default 50+ */+ printLimit : {+ value : 50,+ validator : isNumber+ },++ /**+ * Maximum number of Console entries allowed in the Console body at one+ * time. This is used to keep acquired messages from exploding the+ * DOM tree and impacting page performance.+ *+ * @attribute consoleLimit+ * @type Number+ * @default 300+ */+ consoleLimit : {+ value : 300,+ validator : isNumber+ },++ /**+ * New entries should display at the top of the Console or the bottom?+ *+ * @attribute newestOnTop+ * @type Boolean+ * @default true+ */+ newestOnTop : {+ value : true+ },++ /**+ * When new entries are added to the Console UI, should they be+ * scrolled into view?+ *+ * @attribute scrollIntoView+ * @type Boolean+ * @default true+ */+ scrollIntoView : {+ value : true+ },++ /**+ * The baseline time for this Console instance, used to measure elapsed+ * time from the moment the console module is <code>use</code>d to the+ * moment each new entry is logged (not rendered).+ *+ * This value is reset by the instance method myConsole.reset().+ *+ * @attribute startTime+ * @type Date+ * @default The moment the console module is <code>use</code>d+ */+ startTime : {+ value : new Date()+ },++ /**+ * The precise time the last entry was logged. Used to measure elapsed+ * time between log messages.+ *+ * @attribute lastTime+ * @type Date+ * @default The moment the console module is <code>use</code>d+ */+ lastTime : {+ value : new Date(),+ readOnly: true+ },++ /**+ * Controls the collapsed state of the Console+ *+ * @attribute collapsed+ * @type Boolean+ * @default false+ */+ collapsed : {+ value : false+ },++ /**+ * String with units, or number, representing the height of the Console,+ * inclusive of header and footer. If a number is provided, the default+ * unit, defined by Widget's DEF_UNIT, property is used.+ *+ * @attribute height+ * @default "300px"+ * @type {String | Number}+ */+ height: {+ value: "300px"+ },++ /**+ * String with units, or number, representing the width of the Console.+ * If a number is provided, the default unit, defined by Widget's+ * DEF_UNIT, property is used.+ *+ * @attribute width+ * @default "300px"+ * @type {String | Number}+ */+ width: {+ value: "300px"+ },++ /**+ * Pass through to the YUI instance useBrowserConsole configuration.+ * By default this is set to false, which will disable logging to the+ * browser console when a Console instance is created. If the+ * logSource is not a YUI instance, this has no effect.+ * + * @attribute useBrowserConsole+ * @type {Boolean}+ * @default false+ */+ useBrowserConsole : {+ lazyAdd: false,+ value: false,+ getter : function () {+ _yuitest_coverfunc("build/console/console.js", "getter", 1489);+_yuitest_coverline("build/console/console.js", 1490);+return this._getUseBrowserConsole();+ },+ setter : function (v) {+ _yuitest_coverfunc("build/console/console.js", "setter", 1492);+_yuitest_coverline("build/console/console.js", 1493);+return this._setUseBrowserConsole(v);+ }+ },++ /**+ * Allows the Console to flow in the document. Available values are+ * 'inline', 'block', and 'separate' (the default). + *+ * @attribute style+ * @type {String}+ * @default 'separate'+ */+ style : {+ value : 'separate',+ writeOnce : true,+ validator : function (v) {+ _yuitest_coverfunc("build/console/console.js", "validator", 1508);+_yuitest_coverline("build/console/console.js", 1509);+return this._validateStyle(v);+ }+ }+ }++});+++}, '3.7.1', {"requires": ["yui-log", "widget"], "skinnable": true, "lang": ["en", "es", "ja"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('console', function(Y) {+YUI.add('console', function (Y, NAME) { /** * Console creates a visualization for messages logged through calls to a YUI@@ -94,7 +94,7 @@ isNumber = L.isNumber, isString = L.isString, merge = Y.merge,- substitute = Y.substitute;+ substitute = Y.Lang.sub; function Console() {@@ -844,11 +844,11 @@ after = e.newVal; if ((!prop || prop === TITLE) && before.title !== after.title) {- cb.all(DOT+C_CONSOLE_TITLE).setContent(after.title);+ cb.all(DOT+C_CONSOLE_TITLE).setHTML(after.title); } if ((!prop || prop === PAUSE) && before.pause !== after.pause) {- cb.all(DOT+C_PAUSE_LABEL).setContent(after.pause);+ cb.all(DOT+C_PAUSE_LABEL).setHTML(after.pause); } if ((!prop || prop === CLEAR) && before.clear !== after.clear) {@@ -933,7 +933,7 @@ bb[method](C_COLLAPSED); if (button) {- button.setContent(str);+ button.setHTML(str); } this._uiSetHeight(v ? this._head.get('offsetHeight'): this.get(HEIGHT));@@ -1199,7 +1199,7 @@ /** * Default markup template used to create the DOM structure for Console * entries. The markup contains {placeholder}s for content and classes- * that are replaced via Y.substitute. The default template contains+ * that are replaced via Y.Lang.sub. The default template contains * the {placeholder}s identified in Console.ENTRY_CLASSES as well as the * following placeholders that will be populated by the log entry data: *@@ -1520,4 +1520,4 @@ }); -}, '3.5.1' ,{lang:['en', 'es', 'ja'], requires:['substitute','widget','yui-log']});+}, '3.7.1', {"requires": ["yui-log", "widget"], "skinnable": true, "lang": ["en", "es", "ja"]});
@@ -1,8 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("console",function(d){var g=d.ClassNameManager.getClassName,b="checked",R="clear",Q="click",s="collapsed",ad="console",B="contentBox",F="disabled",N="entry",J="error",H="height",o="info",l="lastTime",f="pause",D="paused",W="reset",U="startTime",O="title",G="warn",x=".",w=g(ad,"button"),z=g(ad,"checkbox"),ac=g(ad,R),V=g(ad,"collapse"),r=g(ad,s),e=g(ad,"controls"),C=g(ad,"hd"),A=g(ad,"bd"),c=g(ad,"ft"),I=g(ad,O),X=g(ad,N),S=g(ad,N,"cat"),y=g(ad,N,"content"),t=g(ad,N,"meta"),E=g(ad,N,"src"),a=g(ad,N,"time"),p=g(ad,f),v=g(ad,f,"label"),M=/^(\S+)\s/,Z=/&(?!#?[a-z0-9]+;)/g,T=/>/g,j=/</g,h="&",q=">",K="<",n='<div class="{entry_class} {cat_class} {src_class}">'+'<p class="{entry_meta_class}">'+'<span class="{entry_src_class}">'+"{sourceAndDetail}"+"</span>"+'<span class="{entry_cat_class}">'+"{category}</span>"+'<span class="{entry_time_class}">'+" {totalTime}ms (+{elapsedTime}) {localTime}"+"</span>"+"</p>"+'<pre class="{entry_content_class}">{message}</pre>'+"</div>",i=d.Lang,k=d.Node.create,ab=i.isNumber,m=i.isString,P=d.merge,aa=d.substitute;function u(){u.superclass.constructor.apply(this,arguments);}d.Console=d.extend(u,d.Widget,{_evtCat:null,_head:null,_body:null,_foot:null,_printLoop:null,buffer:null,log:function(){d.log.apply(d,arguments);return this;},clearConsole:function(){this._body.empty();this._cancelPrintLoop();this.buffer=[];return this;},reset:function(){this.fire(W);return this;},collapse:function(){this.set(s,true);return this;},expand:function(){this.set(s,false);return this;},printBuffer:function(Y){var aj=this.buffer,ae=d.config.debug,L=[],ag=this.get("consoleLimit"),ai=this.get("newestOnTop"),af=ai?this._body.get("firstChild"):null,ah;if(aj.length>ag){aj.splice(0,aj.length-ag);}Y=Math.min(aj.length,(Y||aj.length));d.config.debug=false;if(!this.get(D)&&this.get("rendered")){for(ah=0;ah<Y&&aj.length;++ah){L[ah]=this._createEntryHTML(aj.shift());}if(!aj.length){this._cancelPrintLoop();}if(L.length){if(ai){L.reverse();}this._body.insertBefore(k(L.join("")),af);if(this.get("scrollIntoView")){this.scrollToLatest();}this._trimOldEntries();}}d.config.debug=ae;return this;},initializer:function(){this._evtCat=d.stamp(this)+"|";this.buffer=[];this.get("logSource").on(this._evtCat+this.get("logEvent"),d.bind("_onLogEvent",this));this.publish(N,{defaultFn:this._defEntryFn});this.publish(W,{defaultFn:this._defResetFn});this.after("rendered",this._schedulePrint);},destructor:function(){var L=this.get("boundingBox");this._cancelPrintLoop();this.get("logSource").detach(this._evtCat+"*");L.purge(true);},renderUI:function(){this._initHead();this._initBody();this._initFoot();var L=this.get("style");if(L!=="block"){this.get("boundingBox").addClass(this.getClassName(L));}},syncUI:function(){this._uiUpdatePaused(this.get(D));this._uiUpdateCollapsed(this.get(s));this._uiSetHeight(this.get(H));},bindUI:function(){this.get(B).one("button."+V).on(Q,this._onCollapseClick,this);this.get(B).one("input[type=checkbox]."+p).on(Q,this._onPauseClick,this);this.get(B).one("button."+ac).on(Q,this._onClearClick,this);this.after(this._evtCat+"stringsChange",this._afterStringsChange);this.after(this._evtCat+"pausedChange",this._afterPausedChange);this.after(this._evtCat+"consoleLimitChange",this._afterConsoleLimitChange);this.after(this._evtCat+"collapsedChange",this._afterCollapsedChange);},_initHead:function(){var L=this.get(B),Y=P(u.CHROME_CLASSES,{str_collapse:this.get("strings.collapse"),str_title:this.get("strings.title")});this._head=k(aa(u.HEADER_TEMPLATE,Y));L.insertBefore(this._head,L.get("firstChild"));},_initBody:function(){this._body=k(aa(u.BODY_TEMPLATE,u.CHROME_CLASSES));this.get(B).appendChild(this._body);},_initFoot:function(){var L=P(u.CHROME_CLASSES,{id_guid:d.guid(),str_pause:this.get("strings.pause"),str_clear:this.get("strings.clear")});this._foot=k(aa(u.FOOTER_TEMPLATE,L));this.get(B).appendChild(this._foot);},_isInLogLevel:function(ae){var L=ae.cat,Y=this.get("logLevel");if(Y!==o){L=L||o;if(m(L)){L=L.toLowerCase();}if((L===G&&Y===J)||(L===o&&Y!==o)){return false;}}return true;},_normalizeMessage:function(ae){var ag=ae.msg,Y=ae.cat,af=ae.src,L={time:new Date(),message:ag,category:Y||this.get("defaultCategory"),sourceAndDetail:af||this.get("defaultSource"),source:null,localTime:null,elapsedTime:null,totalTime:null};L.source=M.test(L.sourceAndDetail)?RegExp.$1:L.sourceAndDetail;L.localTime=L.time.toLocaleTimeString?L.time.toLocaleTimeString():(L.time+"");L.elapsedTime=L.time-this.get(l);L.totalTime=L.time-this.get(U);this._set(l,L.time);return L;},_schedulePrint:function(){if(!this._printLoop&&!this.get(D)&&this.get("rendered")){this._printLoop=d.later(this.get("printTimeout"),this,this.printBuffer,this.get("printLimit"),true);}},_createEntryHTML:function(L){L=P(this._htmlEscapeMessage(L),u.ENTRY_CLASSES,{cat_class:this.getClassName(N,L.category),src_class:this.getClassName(N,L.source)});return this.get("entryTemplate").replace(/\{(\w+)\}/g,function(Y,ae){return ae in L?L[ae]:"";});},scrollToLatest:function(){var L=this.get("newestOnTop")?0:this._body.get("scrollHeight");this._body.set("scrollTop",L);},_htmlEscapeMessage:function(L){L.message=this._encodeHTML(L.message);L.source=this._encodeHTML(L.source);L.sourceAndDetail=this._encodeHTML(L.sourceAndDetail);L.category=this._encodeHTML(L.category);return L;},_trimOldEntries:function(){d.config.debug=false;var ah=this._body,ae=this.get("consoleLimit"),af=d.config.debug,L,ai,ag,Y;if(ah){L=ah.all(x+X);Y=L.size()-ae;if(Y>0){if(this.get("newestOnTop")){ag=ae;Y=L.size();}else{ag=0;}this._body.setStyle("display","none");for(;ag<Y;++ag){ai=L.item(ag);if(ai){ai.remove();}}this._body.setStyle("display","");}}d.config.debug=af;},_encodeHTML:function(L){return m(L)?L.replace(Z,h).replace(j,K).replace(T,q):L;},_cancelPrintLoop:function(){if(this._printLoop){this._printLoop.cancel();this._printLoop=null;}},_validateStyle:function(L){return L==="inline"||L==="block"||L==="separate";},_onPauseClick:function(L){this.set(D,L.target.get(b));-},_onClearClick:function(L){this.clearConsole();},_onCollapseClick:function(L){this.set(s,!this.get(s));},_validateLogSource:function(L){return L&&d.Lang.isFunction(L.on);},_setLogLevel:function(L){if(m(L)){L=L.toLowerCase();}return(L===G||L===J)?L:o;},_getUseBrowserConsole:function(){var L=this.get("logSource");return L instanceof YUI?L.config.useBrowserConsole:null;},_setUseBrowserConsole:function(L){var Y=this.get("logSource");if(Y instanceof YUI){L=!!L;Y.config.useBrowserConsole=L;return L;}else{return d.Attribute.INVALID_VALUE;}},_uiSetHeight:function(L){u.superclass._uiSetHeight.apply(this,arguments);if(this._head&&this._foot){var Y=this.get("boundingBox").get("offsetHeight")-this._head.get("offsetHeight")-this._foot.get("offsetHeight");this._body.setStyle(H,Y+"px");}},_uiSizeCB:function(){},_afterStringsChange:function(ae){var ag=ae.subAttrName?ae.subAttrName.split(x)[1]:null,L=this.get(B),Y=ae.prevVal,af=ae.newVal;if((!ag||ag===O)&&Y.title!==af.title){L.all(x+I).setContent(af.title);}if((!ag||ag===f)&&Y.pause!==af.pause){L.all(x+v).setContent(af.pause);}if((!ag||ag===R)&&Y.clear!==af.clear){L.all(x+ac).set("value",af.clear);}},_afterPausedChange:function(Y){var L=Y.newVal;if(Y.src!==d.Widget.SRC_UI){this._uiUpdatePaused(L);}if(!L){this._schedulePrint();}else{if(this._printLoop){this._cancelPrintLoop();}}},_uiUpdatePaused:function(L){var Y=this._foot.all("input[type=checkbox]."+p);if(Y){Y.set(b,L);}},_afterConsoleLimitChange:function(){this._trimOldEntries();},_afterCollapsedChange:function(L){this._uiUpdateCollapsed(L.newVal);},_uiUpdateCollapsed:function(L){var af=this.get("boundingBox"),Y=af.all("button."+V),ag=L?"addClass":"removeClass",ae=this.get("strings."+(L?"expand":"collapse"));af[ag](r);if(Y){Y.setContent(ae);}this._uiSetHeight(L?this._head.get("offsetHeight"):this.get(H));},_afterVisibleChange:function(L){u.superclass._afterVisibleChange.apply(this,arguments);this._uiUpdateFromHideShow(L.newVal);},_uiUpdateFromHideShow:function(L){if(L){this._uiSetHeight(this.get(H));}},_onLogEvent:function(Y){if(!this.get(F)&&this._isInLogLevel(Y)){var L=d.config.debug;d.config.debug=false;this.fire(N,{message:this._normalizeMessage(Y)});d.config.debug=L;}},_defResetFn:function(){this.clearConsole();this.set(U,new Date());this.set(F,false);this.set(D,false);},_defEntryFn:function(L){if(L.message){this.buffer.push(L.message);this._schedulePrint();}}},{NAME:ad,LOG_LEVEL_INFO:o,LOG_LEVEL_WARN:G,LOG_LEVEL_ERROR:J,ENTRY_CLASSES:{entry_class:X,entry_meta_class:t,entry_cat_class:S,entry_src_class:E,entry_time_class:a,entry_content_class:y},CHROME_CLASSES:{console_hd_class:C,console_bd_class:A,console_ft_class:c,console_controls_class:e,console_checkbox_class:z,console_pause_class:p,console_pause_label_class:v,console_button_class:w,console_clear_class:ac,console_collapse_class:V,console_title_class:I},HEADER_TEMPLATE:'<div class="{console_hd_class}">'+'<h4 class="{console_title_class}">{str_title}</h4>'+'<button type="button" class="'+'{console_button_class} {console_collapse_class}">{str_collapse}'+"</button>"+"</div>",BODY_TEMPLATE:'<div class="{console_bd_class}"></div>',FOOTER_TEMPLATE:'<div class="{console_ft_class}">'+'<div class="{console_controls_class}">'+'<label for="{id_guid}" class="{console_pause_label_class}">'+'<input type="checkbox" class="{console_checkbox_class} '+'{console_pause_class}" value="1" id="{id_guid}"> '+"{str_pause}</label>"+'<button type="button" class="'+'{console_button_class} {console_clear_class}">{str_clear}'+"</button>"+"</div>"+"</div>",ENTRY_TEMPLATE:n,ATTRS:{logEvent:{value:"yui:log",writeOnce:true,validator:m},logSource:{value:d,writeOnce:true,validator:function(L){return this._validateLogSource(L);}},strings:{valueFn:function(){return d.Intl.get("console");}},paused:{value:false,validator:i.isBoolean},defaultCategory:{value:o,validator:m},defaultSource:{value:"global",validator:m},entryTemplate:{value:n,validator:m},logLevel:{value:d.config.logLevel||o,setter:function(L){return this._setLogLevel(L);}},printTimeout:{value:100,validator:ab},printLimit:{value:50,validator:ab},consoleLimit:{value:300,validator:ab},newestOnTop:{value:true},scrollIntoView:{value:true},startTime:{value:new Date()},lastTime:{value:new Date(),readOnly:true},collapsed:{value:false},height:{value:"300px"},width:{value:"300px"},useBrowserConsole:{lazyAdd:false,value:false,getter:function(){return this._getUseBrowserConsole();},setter:function(L){return this._setUseBrowserConsole(L);}},style:{value:"separate",writeOnce:true,validator:function(L){return this._validateStyle(L);}}}});},"3.5.1",{lang:["en","es","ja"],requires:["substitute","widget","yui-log"]});+YUI.add("console",function(e,t){function et(){et.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r="checked",i="clear",s="click",o="collapsed",u="console",a="contentBox",f="disabled",l="entry",c="error",h="height",p="info",d="lastTime",v="pause",m="paused",g="reset",y="startTime",b="title",w="warn",E=".",S=n(u,"button"),x=n(u,"checkbox"),T=n(u,i),N=n(u,"collapse"),C=n(u,o),k=n(u,"controls"),L=n(u,"hd"),A=n(u,"bd"),O=n(u,"ft"),M=n(u,b),_=n(u,l),D=n(u,l,"cat"),P=n(u,l,"content"),H=n(u,l,"meta"),B=n(u,l,"src"),j=n(u,l,"time"),F=n(u,v),I=n(u,v,"label"),q=/^(\S+)\s/,R=/&(?!#?[a-z0-9]+;)/g,U=/>/g,z=/</g,W="&",X=">",V="<",$='<div class="{entry_class} {cat_class} {src_class}"><p class="{entry_meta_class}"><span class="{entry_src_class}">{sourceAndDetail}</span><span class="{entry_cat_class}">{category}</span><span class="{entry_time_class}"> {totalTime}ms (+{elapsedTime}) {localTime}</span></p><pre class="{entry_content_class}">{message}</pre></div>',J=e.Lang,K=e.Node.create,Q=J.isNumber,G=J.isString,Y=e.merge,Z=e.Lang.sub;e.Console=e.extend(et,e.Widget,{_evtCat:null,_head:null,_body:null,_foot:null,_printLoop:null,buffer:null,log:function(){return e.log.apply(e,arguments),this},clearConsole:function(){return this._body.empty(),this._cancelPrintLoop(),this.buffer=[],this},reset:function(){return this.fire(g),this},collapse:function(){return this.set(o,!0),this},expand:function(){return this.set(o,!1),this},printBuffer:function(t){var n=this.buffer,r=e.config.debug,i=[],s=this.get("consoleLimit"),o=this.get("newestOnTop"),u=o?this._body.get("firstChild"):null,a;n.length>s&&n.splice(0,n.length-s),t=Math.min(n.length,t||n.length),e.config.debug=!1;if(!this.get(m)&&this.get("rendered")){for(a=0;a<t&&n.length;++a)i[a]=this._createEntryHTML(n.shift());n.length||this._cancelPrintLoop(),i.length&&(o&&i.reverse(),this._body.insertBefore(K(i.join("")),u),this.get("scrollIntoView")&&this.scrollToLatest(),this._trimOldEntries())}return e.config.debug=r,this},initializer:function(){this._evtCat=e.stamp(this)+"|",this.buffer=[],this.get("logSource").on(this._evtCat+this.get("logEvent"),e.bind("_onLogEvent",this)),this.publish(l,{defaultFn:this._defEntryFn}),this.publish(g,{defaultFn:this._defResetFn}),this.after("rendered",this._schedulePrint)},destructor:function(){var e=this.get("boundingBox");this._cancelPrintLoop(),this.get("logSource").detach(this._evtCat+"*"),e.purge(!0)},renderUI:function(){this._initHead(),this._initBody(),this._initFoot();var e=this.get("style");e!=="block"&&this.get("boundingBox").addClass(this.getClassName(e))},syncUI:function(){this._uiUpdatePaused(this.get(m)),this._uiUpdateCollapsed(this.get(o)),this._uiSetHeight(this.get(h))},bindUI:function(){this.get(a).one("button."+N).on(s,this._onCollapseClick,this),this.get(a).one("input[type=checkbox]."+F).on(s,this._onPauseClick,this),this.get(a).one("button."+T).on(s,this._onClearClick,this),this.after(this._evtCat+"stringsChange",this._afterStringsChange),this.after(this._evtCat+"pausedChange",this._afterPausedChange),this.after(this._evtCat+"consoleLimitChange",this._afterConsoleLimitChange),this.after(this._evtCat+"collapsedChange",this._afterCollapsedChange)},_initHead:function(){var e=this.get(a),t=Y(et.CHROME_CLASSES,{str_collapse:this.get("strings.collapse"),str_title:this.get("strings.title")});this._head=K(Z(et.HEADER_TEMPLATE,t)),e.insertBefore(this._head,e.get("firstChild"))},_initBody:function(){this._body=K(Z(et.BODY_TEMPLATE,et.CHROME_CLASSES)),this.get(a).appendChild(this._body)},_initFoot:function(){var t=Y(et.CHROME_CLASSES,{id_guid:e.guid(),str_pause:this.get("strings.pause"),str_clear:this.get("strings.clear")});this._foot=K(Z(et.FOOTER_TEMPLATE,t)),this.get(a).appendChild(this._foot)},_isInLogLevel:function(e){var t=e.cat,n=this.get("logLevel");if(n!==p){t=t||p,G(t)&&(t=t.toLowerCase());if(t===w&&n===c||t===p&&n!==p)return!1}return!0},_normalizeMessage:function(e){var t=e.msg,n=e.cat,r=e.src,i={time:new Date,message:t,category:n||this.get("defaultCategory"),sourceAndDetail:r||this.get("defaultSource"),source:null,localTime:null,elapsedTime:null,totalTime:null};return i.source=q.test(i.sourceAndDetail)?RegExp.$1:i.sourceAndDetail,i.localTime=i.time.toLocaleTimeString?i.time.toLocaleTimeString():i.time+"",i.elapsedTime=i.time-this.get(d),i.totalTime=i.time-this.get(y),this._set(d,i.time),i},_schedulePrint:function(){!this._printLoop&&!this.get(m)&&this.get("rendered")&&(this._printLoop=e.later(this.get("printTimeout"),this,this.printBuffer,this.get("printLimit"),!0))},_createEntryHTML:function(e){return e=Y(this._htmlEscapeMessage(e),et.ENTRY_CLASSES,{cat_class:this.getClassName(l,e.category),src_class:this.getClassName(l,e.source)}),this.get("entryTemplate").replace(/\{(\w+)\}/g,function(t,n){return n in e?e[n]:""})},scrollToLatest:function(){var e=this.get("newestOnTop")?0:this._body.get("scrollHeight");this._body.set("scrollTop",e)},_htmlEscapeMessage:function(e){return e.message=this._encodeHTML(e.message),e.source=this._encodeHTML(e.source),e.sourceAndDetail=this._encodeHTML(e.sourceAndDetail),e.category=this._encodeHTML(e.category),e},_trimOldEntries:function(){e.config.debug=!1;var t=this._body,n=this.get("consoleLimit"),r=e.config.debug,i,s,o,u;if(t){i=t.all(E+_),u=i.size()-n;if(u>0){this.get("newestOnTop")?(o=n,u=i.size()):o=0,this._body.setStyle("display","none");for(;o<u;++o)s=i.item(o),s&&s.remove();this._body.setStyle("display","")}}e.config.debug=r},_encodeHTML:function(e){return G(e)?e.replace(R,W).replace(z,V).replace(U,X):e},_cancelPrintLoop:function(){this._printLoop&&(this._printLoop.cancel(),this._printLoop=null)},_validateStyle:function(e){return e==="inline"||e==="block"||e==="separate"},_onPauseClick:function(e){this.set(m,e.target.get(r))},_onClearClick:function(e){this.clearConsole()},_onCollapseClick:function(e){this.set(o,!this.get(o))},_validateLogSource:function(t){return t&&e.Lang.isFunction(t.on)},_setLogLevel:function(e){return G(e)&&(e=e.toLowerCase()),e===w||e===c?e:p},_getUseBrowserConsole:function(){var e=this.get("logSource");return e instanceof YUI?e.config.useBrowserConsole:null},_setUseBrowserConsole:function(t){var n=this.get("logSource");return n instanceof YUI?(t=!!t,n.config.useBrowserConsole=t,t):e.Attribute.INVALID_VALUE},_uiSetHeight:function(e){et.superclass._uiSetHeight.apply(this,arguments);if(this._head&&this._foot){var t=this.get("boundingBox").get("offsetHeight")-this._head.get("offsetHeight")-this._foot.get("offsetHeight");this._body.setStyle(h,t+"px")}},_uiSizeCB:function(){},_afterStringsChange:function(e){var t=e.subAttrName?e.subAttrName.split(E)[1]:null,n=this.get(a),r=e.prevVal,s=e.newVal;(!t||t===b)&&r.title!==s.title&&n.all(E+M).setHTML(s.title),(!t||t===v)&&r.pause!==s.pause&&n.all(E+I).setHTML(s.pause),(!t||t===i)&&r.clear!==s.clear&&n.all(E+T).set("value",s.clear)},_afterPausedChange:function(t){var n=t.newVal;t.src!==e.Widget.SRC_UI&&this._uiUpdatePaused(n),n?this._printLoop&&this._cancelPrintLoop():this._schedulePrint()},_uiUpdatePaused:function(e){var t=this._foot.all("input[type=checkbox]."+F);t&&t.set(r,e)},_afterConsoleLimitChange:function(){this._trimOldEntries()},_afterCollapsedChange:function(e){this._uiUpdateCollapsed(e.newVal)},_uiUpdateCollapsed:function(e){var t=this.get("boundingBox"),n=t.all("button."+N),r=e?"addClass":"removeClass",i=this.get("strings."+(e?"expand":"collapse"));t[r](C),n&&n.setHTML(i),this._uiSetHeight(e?this._head.get("offsetHeight"):this.get(h))},_afterVisibleChange:function(e){et.superclass._afterVisibleChange.apply(this,arguments),this._uiUpdateFromHideShow(e.newVal)},_uiUpdateFromHideShow:function(e){e&&this._uiSetHeight(this.get(h))},_onLogEvent:function(t){if(!this.get(f)&&this._isInLogLevel(t)){var n=e.config.debug;e.config.debug=!1,this.fire(l,{message:this._normalizeMessage(t)}),e.config.debug=n}},_defResetFn:function(){this.clearConsole(),this.set(y,new Date),this.set(f,!1),this.set(m,!1)},_defEntryFn:function(e){e.message&&(this.buffer.push(e.message),this._schedulePrint())}},{NAME:u,LOG_LEVEL_INFO:p,LOG_LEVEL_WARN:w,LOG_LEVEL_ERROR:c,ENTRY_CLASSES:{entry_class:_,entry_meta_class:H,entry_cat_class:D,entry_src_class:B,entry_time_class:j,entry_content_class:P},CHROME_CLASSES:{console_hd_class:L,console_bd_class:A,console_ft_class:O,console_controls_class:k,console_checkbox_class:x,console_pause_class:F,console_pause_label_class:I,console_button_class:S,console_clear_class:T,console_collapse_class:N,console_title_class:M},HEADER_TEMPLATE:'<div class="{console_hd_class}"><h4 class="{console_title_class}">{str_title}</h4><button type="button" class="{console_button_class} {console_collapse_class}">{str_collapse}</button></div>',BODY_TEMPLATE:'<div class="{console_bd_class}"></div>',FOOTER_TEMPLATE:'<div class="{console_ft_class}"><div class="{console_controls_class}"><label for="{id_guid}" class="{console_pause_label_class}"><input type="checkbox" class="{console_checkbox_class} {console_pause_class}" value="1" id="{id_guid}"> {str_pause}</label><button type="button" class="{console_button_class} {console_clear_class}">{str_clear}</button></div></div>',ENTRY_TEMPLATE:$,ATTRS:{logEvent:{value:"yui:log",writeOnce:!0,validator:G},logSource:{value:e,writeOnce:!0,validator:function(e){return this._validateLogSource(e)}},strings:{valueFn:function(){return e.Intl.get("console")}},paused:{value:!1,validator:J.isBoolean},defaultCategory:{value:p,validator:G},defaultSource:{value:"global",validator:G},entryTemplate:{value:$,validator:G},logLevel:{value:e.config.logLevel||p,setter:function(e){return this._setLogLevel(e)}},printTimeout:{value:100,validator:Q},printLimit:{value:50,validator:Q},consoleLimit:{value:300,validator:Q},newestOnTop:{value:!0},scrollIntoView:{value:!0},startTime:{value:new Date},lastTime:{value:new Date,readOnly:!0},collapsed:{value:!1},height:{value:"300px"},width:{value:"300px"},useBrowserConsole:{lazyAdd:!1,value:!1,getter:function(){return this._getUseBrowserConsole()},setter:function(e){return this._setUseBrowserConsole(e)}},style:{value:"separate",writeOnce:!0,validator:function(e){return this._validateStyle(e)}}}})},"3.7.1",{requires:["yui-log","widget"],skinnable:!0,lang:["en","es","ja"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('console', function(Y) {+YUI.add('console', function (Y, NAME) { /** * Console creates a visualization for messages logged through calls to a YUI@@ -94,7 +94,7 @@ isNumber = L.isNumber, isString = L.isString, merge = Y.merge,- substitute = Y.substitute;+ substitute = Y.Lang.sub; function Console() {@@ -844,11 +844,11 @@ after = e.newVal; if ((!prop || prop === TITLE) && before.title !== after.title) {- cb.all(DOT+C_CONSOLE_TITLE).setContent(after.title);+ cb.all(DOT+C_CONSOLE_TITLE).setHTML(after.title); } if ((!prop || prop === PAUSE) && before.pause !== after.pause) {- cb.all(DOT+C_PAUSE_LABEL).setContent(after.pause);+ cb.all(DOT+C_PAUSE_LABEL).setHTML(after.pause); } if ((!prop || prop === CLEAR) && before.clear !== after.clear) {@@ -933,7 +933,7 @@ bb[method](C_COLLAPSED); if (button) {- button.setContent(str);+ button.setHTML(str); } this._uiSetHeight(v ? this._head.get('offsetHeight'): this.get(HEIGHT));@@ -1199,7 +1199,7 @@ /** * Default markup template used to create the DOM structure for Console * entries. The markup contains {placeholder}s for content and classes- * that are replaced via Y.substitute. The default template contains+ * that are replaced via Y.Lang.sub. The default template contains * the {placeholder}s identified in Console.ENTRY_CLASSES as well as the * following placeholders that will be populated by the log entry data: *@@ -1520,4 +1520,4 @@ }); -}, '3.5.1' ,{lang:['en', 'es', 'ja'], requires:['substitute','widget','yui-log']});+}, '3.7.1', {"requires": ["yui-log", "widget"], "skinnable": true, "lang": ["en", "es", "ja"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/console",function(a){a.Intl.add("console","",{title:"Log Console",pause:"Pause",clear:"Clear",collapse:"Collapse",expand:"Expand"});},"3.5.1");+YUI.add("lang/console",function(e){e.Intl.add("console","",{title:"Log Console",pause:"Pause",clear:"Clear",collapse:"Collapse",expand:"Expand"})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/console_en",function(a){a.Intl.add("console","en",{title:"Log Console",pause:"Pause",clear:"Clear",collapse:"Collapse",expand:"Expand"});},"3.5.1");+YUI.add("lang/console_en",function(e){e.Intl.add("console","en",{title:"Log Console",pause:"Pause",clear:"Clear",collapse:"Collapse",expand:"Expand"})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/console_es",function(a){a.Intl.add("console","es",{title:"Consola de informacion",pause:"Pausa",clear:"Borrar",collapse:"Colapsar",expand:"Expandir"});},"3.5.1");+YUI.add("lang/console_es",function(e){e.Intl.add("console","es",{title:"Consola de informacion",pause:"Pausa",clear:"Borrar",collapse:"Colapsar",expand:"Expandir"})},"3.7.1");
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/console_ja",function(a){a.Intl.add("console","ja",{title:"\u30ED\u30B0\u30B3\u30F3\u30BD\u30FC\u30EB",pause:"\u4E00\u6642\u505C\u6B62",clear:"\u30AF\u30EA\u30A2",collapse:"\u9589\u3058\u308B",expand:"\u958B\u304F"});},"3.5.1");+YUI.add("lang/console_ja",function(e){e.Intl.add("console","ja",{title:"\u30ed\u30b0\u30b3\u30f3\u30bd\u30fc\u30eb",pause:"\u4e00\u6642\u505c\u6b62",clear:"\u30af\u30ea\u30a2",collapse:"\u9589\u3058\u308b",expand:"\u958b\u304f"})},"3.7.1");
@@ -0,0 +1,678 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/cookie/cookie.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/cookie/cookie.js",+ code: []+};+_yuitest_coverage["build/cookie/cookie.js"].code=["YUI.add('cookie', function (Y, NAME) {","","/**"," * Utilities for cookie management"," * @module cookie"," */",""," //shortcuts"," var L = Y.Lang,"," O = Y.Object,"," NULL = null,"," "," //shortcuts to functions"," isString = L.isString,"," isObject = L.isObject,"," isUndefined = L.isUndefined,"," isFunction = L.isFunction,"," encode = encodeURIComponent,"," decode = decodeURIComponent,"," "," //shortcut to document"," doc = Y.config.doc;"," "," /*"," * Throws an error message."," */"," function error(message){"," throw new TypeError(message);"," } "," "," /*"," * Checks the validity of a cookie name."," */"," function validateCookieName(name){"," if (!isString(name) || name === \"\"){"," error(\"Cookie name must be a non-empty string.\");"," } "," }"," "," /*"," * Checks the validity of a subcookie name."," */ "," function validateSubcookieName(subName){"," if (!isString(subName) || subName === \"\"){"," error(\"Subcookie name must be a non-empty string.\");"," } "," }"," "," /**"," * Cookie utility."," * @class Cookie"," * @static"," */"," Y.Cookie = {"," "," //-------------------------------------------------------------------------"," // Private Methods"," //-------------------------------------------------------------------------"," "," /**"," * Creates a cookie string that can be assigned into document.cookie."," * @param {String} name The name of the cookie."," * @param {String} value The value of the cookie."," * @param {Boolean} encodeValue True to encode the value, false to leave as-is."," * @param {Object} options (Optional) Options for the cookie."," * @return {String} The formatted cookie string."," * @method _createCookieString"," * @private"," * @static"," */"," _createCookieString : function (name /*:String*/, value /*:Variant*/, encodeValue /*:Boolean*/, options /*:Object*/) /*:String*/ {"," "," options = options || {};"," "," var text /*:String*/ = encode(name) + \"=\" + (encodeValue ? encode(value) : value),"," expires = options.expires,"," path = options.path,"," domain = options.domain;"," "," "," if (isObject(options)){"," //expiration date"," if (expires instanceof Date){"," text += \"; expires=\" + expires.toUTCString();"," }"," "," //path"," if (isString(path) && path !== \"\"){"," text += \"; path=\" + path;"," }"," "," //domain"," if (isString(domain) && domain !== \"\"){"," text += \"; domain=\" + domain;"," }"," "," //secure"," if (options.secure === true){"," text += \"; secure\";"," }"," }"," "," return text;"," },"," "," /**"," * Formats a cookie value for an object containing multiple values."," * @param {Object} hash An object of key-value pairs to create a string for."," * @return {String} A string suitable for use as a cookie value."," * @method _createCookieHashString"," * @private"," * @static"," */"," _createCookieHashString : function (hash /*:Object*/) /*:String*/ {"," if (!isObject(hash)){"," error(\"Cookie._createCookieHashString(): Argument must be an object.\");"," }"," "," var text /*:Array*/ = [];",""," O.each(hash, function(value, key){"," if (!isFunction(value) && !isUndefined(value)){"," text.push(encode(key) + \"=\" + encode(String(value)));"," } "," });"," "," return text.join(\"&\");"," },"," "," /**"," * Parses a cookie hash string into an object."," * @param {String} text The cookie hash string to parse (format: n1=v1&n2=v2)."," * @return {Object} An object containing entries for each cookie value."," * @method _parseCookieHash"," * @private"," * @static"," */"," _parseCookieHash : function (text) {"," "," var hashParts = text.split(\"&\"),"," hashPart = NULL,"," hash = {};"," "," if (text.length){"," for (var i=0, len=hashParts.length; i < len; i++){"," hashPart = hashParts[i].split(\"=\");"," hash[decode(hashPart[0])] = decode(hashPart[1]);"," }"," }"," "," return hash; "," },"," "," /**"," * Parses a cookie string into an object representing all accessible cookies."," * @param {String} text The cookie string to parse."," * @param {Boolean} shouldDecode (Optional) Indicates if the cookie values should be decoded or not. Default is true."," * @return {Object} An object containing entries for each accessible cookie."," * @method _parseCookieString"," * @private"," * @static"," */"," _parseCookieString : function (text /*:String*/, shouldDecode /*:Boolean*/) /*:Object*/ {"," "," var cookies /*:Object*/ = {}; "," "," if (isString(text) && text.length > 0) {"," "," var decodeValue = (shouldDecode === false ? function(s){return s;} : decode), "," cookieParts = text.split(/;\\s/g),"," cookieName = NULL,"," cookieValue = NULL,"," cookieNameValue = NULL;"," "," for (var i=0, len=cookieParts.length; i < len; i++){"," "," //check for normally-formatted cookie (name-value)"," cookieNameValue = cookieParts[i].match(/([^=]+)=/i);"," if (cookieNameValue instanceof Array){"," try {"," cookieName = decode(cookieNameValue[1]);"," cookieValue = decodeValue(cookieParts[i].substring(cookieNameValue[1].length+1));"," } catch (ex){"," //intentionally ignore the cookie - the encoding is wrong"," }"," } else {"," //means the cookie does not have an \"=\", so treat it as a boolean flag"," cookieName = decode(cookieParts[i]);"," cookieValue = \"\";"," }"," cookies[cookieName] = cookieValue;"," }",""," }"," "," return cookies;"," }, "," "," /**"," * Sets the document object that the cookie utility uses for setting"," * cookies. This method is necessary to ensure that the cookie utility"," * unit tests can pass even when run on a domain instead of locally."," * This method should not be used otherwise; you should use "," * <code>Y.config.doc</code> to change the document that the cookie"," * utility uses for everyday purposes."," * @param {Object} newDoc The object to use as the document."," * @return {void}"," * @method _setDoc"," * @private"," */ "," _setDoc: function(newDoc){"," doc = newDoc;"," },"," "," //-------------------------------------------------------------------------"," // Public Methods"," //-------------------------------------------------------------------------"," "," /**"," * Determines if the cookie with the given name exists. This is useful for"," * Boolean cookies (those that do not follow the name=value convention)."," * @param {String} name The name of the cookie to check."," * @return {Boolean} True if the cookie exists, false if not."," * @method exists"," * @static"," */"," exists: function(name) {"," "," validateCookieName(name); //throws error"," "," var cookies = this._parseCookieString(doc.cookie, true);"," "," return cookies.hasOwnProperty(name);"," }, "," "," /**"," * Returns the cookie value for the given name."," * @param {String} name The name of the cookie to retrieve."," * @param {Function|Object} options (Optional) An object containing one or more"," * cookie options: raw (true/false) and converter (a function)."," * The converter function is run on the value before returning it. The"," * function is not used if the cookie doesn't exist. The function can be"," * passed instead of the options object for backwards compatibility. When"," * raw is set to true, the cookie value is not URI decoded."," * @return {Variant} If no converter is specified, returns a string or null if"," * the cookie doesn't exist. If the converter is specified, returns the value"," * returned from the converter or null if the cookie doesn't exist."," * @method get"," * @static"," */"," get : function (name, options) {"," "," validateCookieName(name); //throws error "," "," var cookies,"," cookie,"," converter;"," "," //if options is a function, then it's the converter"," if (isFunction(options)) {"," converter = options;"," options = {};"," } else if (isObject(options)) {"," converter = options.converter;"," } else {"," options = {};"," }"," "," cookies = this._parseCookieString(doc.cookie, !options.raw);"," cookie = cookies[name];"," "," //should return null, not undefined if the cookie doesn't exist"," if (isUndefined(cookie)) {"," return NULL;"," }"," "," if (!isFunction(converter)){"," return cookie;"," } else {"," return converter(cookie);"," }"," },"," "," /**"," * Returns the value of a subcookie."," * @param {String} name The name of the cookie to retrieve."," * @param {String} subName The name of the subcookie to retrieve."," * @param {Function} converter (Optional) A function to run on the value before returning"," * it. The function is not used if the cookie doesn't exist."," * @return {Variant} If the cookie doesn't exist, null is returned. If the subcookie"," * doesn't exist, null if also returned. If no converter is specified and the"," * subcookie exists, a string is returned. If a converter is specified and the"," * subcookie exists, the value returned from the converter is returned."," * @method getSub"," * @static"," */"," getSub : function (name /*:String*/, subName /*:String*/, converter /*:Function*/) /*:Variant*/ {"," "," var hash /*:Variant*/ = this.getSubs(name); "," "," if (hash !== NULL) {"," "," validateSubcookieName(subName); //throws error"," "," if (isUndefined(hash[subName])){"," return NULL;"," } "," "," if (!isFunction(converter)){"," return hash[subName];"," } else {"," return converter(hash[subName]);"," }"," } else {"," return NULL;"," }"," "," },"," "," /**"," * Returns an object containing name-value pairs stored in the cookie with the given name."," * @param {String} name The name of the cookie to retrieve."," * @return {Object} An object of name-value pairs if the cookie with the given name"," * exists, null if it does not."," * @method getSubs"," * @static"," */"," getSubs : function (name) {"," "," validateCookieName(name); //throws error"," "," var cookies = this._parseCookieString(doc.cookie, false);"," if (isString(cookies[name])){"," return this._parseCookieHash(cookies[name]);"," }"," return NULL;"," },"," "," /**"," * Removes a cookie from the machine by setting its expiration date to"," * sometime in the past."," * @param {String} name The name of the cookie to remove."," * @param {Object} options (Optional) An object containing one or more"," * cookie options: path (a string), domain (a string), "," * and secure (true/false). The expires option will be overwritten"," * by the method."," * @return {String} The created cookie string."," * @method remove"," * @static"," */"," remove : function (name, options) {"," "," validateCookieName(name); //throws error"," "," //set options"," options = Y.merge(options || {}, {"," expires: new Date(0)"," });"," "," //set cookie"," return this.set(name, \"\", options);"," },"," "," /**"," * Removes a sub cookie with a given name."," * @param {String} name The name of the cookie in which the subcookie exists."," * @param {String} subName The name of the subcookie to remove."," * @param {Object} options (Optional) An object containing one or more"," * cookie options: path (a string), domain (a string), expires (a Date object),"," * removeIfEmpty (true/false), and secure (true/false). This must be the same"," * settings as the original subcookie."," * @return {String} The created cookie string."," * @method removeSub"," * @static"," */"," removeSub : function(name, subName, options) {"," "," validateCookieName(name); //throws error"," "," validateSubcookieName(subName); //throws error"," "," options = options || {};"," "," //get all subcookies for this cookie"," var subs = this.getSubs(name);"," "," //delete the indicated subcookie"," if (isObject(subs) && subs.hasOwnProperty(subName)){"," delete subs[subName];"," "," if (!options.removeIfEmpty) {"," //reset the cookie"," "," return this.setSubs(name, subs, options);"," } else {"," //reset the cookie if there are subcookies left, else remove"," for (var key in subs){"," if (subs.hasOwnProperty(key) && !isFunction(subs[key]) && !isUndefined(subs[key])){"," return this.setSubs(name, subs, options);"," }"," }"," "," return this.remove(name, options);"," } "," } else {"," return \"\";"," }"," "," },"," "," /**"," * Sets a cookie with a given name and value."," * @param {String} name The name of the cookie to set."," * @param {Variant} value The value to set for the cookie."," * @param {Object} options (Optional) An object containing one or more"," * cookie options: path (a string), domain (a string), expires (a Date object),"," * secure (true/false), and raw (true/false). Setting raw to true indicates"," * that the cookie should not be URI encoded before being set."," * @return {String} The created cookie string."," * @method set"," * @static"," */"," set : function (name, value, options) {"," "," validateCookieName(name); //throws error"," "," if (isUndefined(value)){"," error(\"Cookie.set(): Value cannot be undefined.\");"," }"," "," options = options || {};"," "," var text = this._createCookieString(name, value, !options.raw, options);"," doc.cookie = text;"," return text;"," },"," "," /**"," * Sets a sub cookie with a given name to a particular value."," * @param {String} name The name of the cookie to set."," * @param {String} subName The name of the subcookie to set."," * @param {Variant} value The value to set."," * @param {Object} options (Optional) An object containing one or more"," * cookie options: path (a string), domain (a string), expires (a Date object),"," * and secure (true/false)."," * @return {String} The created cookie string."," * @method setSub"," * @static"," */"," setSub : function (name, subName, value, options) {",""," validateCookieName(name); //throws error"," "," validateSubcookieName(subName); //throws error"," "," if (isUndefined(value)){"," error(\"Cookie.setSub(): Subcookie value cannot be undefined.\");"," }"," "," var hash = this.getSubs(name);"," "," if (!isObject(hash)){"," hash = {};"," }"," "," hash[subName] = value; "," "," return this.setSubs(name, hash, options);"," "," },"," "," /**"," * Sets a cookie with a given name to contain a hash of name-value pairs."," * @param {String} name The name of the cookie to set."," * @param {Object} value An object containing name-value pairs."," * @param {Object} options (Optional) An object containing one or more"," * cookie options: path (a string), domain (a string), expires (a Date object),"," * and secure (true/false)."," * @return {String} The created cookie string."," * @method setSubs"," * @static"," */"," setSubs : function (name, value, options) {"," "," validateCookieName(name); //throws error"," "," if (!isObject(value)){"," error(\"Cookie.setSubs(): Cookie value must be an object.\");"," }"," "," var text /*:String*/ = this._createCookieString(name, this._createCookieHashString(value), false, options);"," doc.cookie = text;"," return text; "," } "," "," };","","","}, '3.7.1', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/cookie/cookie.js"].lines = {"1":0,"9":0,"27":0,"28":0,"34":0,"35":0,"36":0,"43":0,"44":0,"45":0,"54":0,"73":0,"75":0,"81":0,"83":0,"84":0,"88":0,"89":0,"93":0,"94":0,"98":0,"99":0,"103":0,"115":0,"116":0,"119":0,"121":0,"122":0,"123":0,"127":0,"140":0,"144":0,"145":0,"146":0,"147":0,"151":0,"165":0,"167":0,"169":0,"175":0,"178":0,"179":0,"180":0,"181":0,"182":0,"188":0,"189":0,"191":0,"196":0,"212":0,"229":0,"231":0,"233":0,"253":0,"255":0,"260":0,"261":0,"262":0,"263":0,"264":0,"266":0,"269":0,"270":0,"273":0,"274":0,"277":0,"278":0,"280":0,"299":0,"301":0,"303":0,"305":0,"306":0,"309":0,"310":0,"312":0,"315":0,"330":0,"332":0,"333":0,"334":0,"336":0,"353":0,"356":0,"361":0,"378":0,"380":0,"382":0,"385":0,"388":0,"389":0,"391":0,"394":0,"397":0,"398":0,"399":0,"403":0,"406":0,"425":0,"427":0,"428":0,"431":0,"433":0,"434":0,"435":0,"452":0,"454":0,"456":0,"457":0,"460":0,"462":0,"463":0,"466":0,"468":0,"485":0,"487":0,"488":0,"491":0,"492":0,"493":0};+_yuitest_coverage["build/cookie/cookie.js"].functions = {"error:27":0,"validateCookieName:34":0,"validateSubcookieName:43":0,"_createCookieString:71":0,"(anonymous 2):121":0,"_createCookieHashString:114":0,"_parseCookieHash:138":0,"(anonymous 3):169":0,"_parseCookieString:163":0,"_setDoc:211":0,"exists:227":0,"get:251":0,"getSub:297":0,"getSubs:328":0,"remove:351":0,"removeSub:376":0,"set:423":0,"setSub:450":0,"setSubs:483":0,"(anonymous 1):1":0};+_yuitest_coverage["build/cookie/cookie.js"].coveredLines = 120;+_yuitest_coverage["build/cookie/cookie.js"].coveredFunctions = 20;+_yuitest_coverline("build/cookie/cookie.js", 1);+YUI.add('cookie', function (Y, NAME) {++/**+ * Utilities for cookie management+ * @module cookie+ */++ //shortcuts+ _yuitest_coverfunc("build/cookie/cookie.js", "(anonymous 1)", 1);+_yuitest_coverline("build/cookie/cookie.js", 9);+var L = Y.Lang,+ O = Y.Object,+ NULL = null,+ + //shortcuts to functions+ isString = L.isString,+ isObject = L.isObject,+ isUndefined = L.isUndefined,+ isFunction = L.isFunction,+ encode = encodeURIComponent,+ decode = decodeURIComponent,+ + //shortcut to document+ doc = Y.config.doc;+ + /*+ * Throws an error message.+ */+ _yuitest_coverline("build/cookie/cookie.js", 27);+function error(message){+ _yuitest_coverfunc("build/cookie/cookie.js", "error", 27);+_yuitest_coverline("build/cookie/cookie.js", 28);+throw new TypeError(message);+ } + + /*+ * Checks the validity of a cookie name.+ */+ _yuitest_coverline("build/cookie/cookie.js", 34);+function validateCookieName(name){+ _yuitest_coverfunc("build/cookie/cookie.js", "validateCookieName", 34);+_yuitest_coverline("build/cookie/cookie.js", 35);+if (!isString(name) || name === ""){+ _yuitest_coverline("build/cookie/cookie.js", 36);+error("Cookie name must be a non-empty string.");+ } + }+ + /*+ * Checks the validity of a subcookie name.+ */ + _yuitest_coverline("build/cookie/cookie.js", 43);+function validateSubcookieName(subName){+ _yuitest_coverfunc("build/cookie/cookie.js", "validateSubcookieName", 43);+_yuitest_coverline("build/cookie/cookie.js", 44);+if (!isString(subName) || subName === ""){+ _yuitest_coverline("build/cookie/cookie.js", 45);+error("Subcookie name must be a non-empty string.");+ } + }+ + /**+ * Cookie utility.+ * @class Cookie+ * @static+ */+ _yuitest_coverline("build/cookie/cookie.js", 54);+Y.Cookie = {+ + //-------------------------------------------------------------------------+ // Private Methods+ //-------------------------------------------------------------------------+ + /**+ * Creates a cookie string that can be assigned into document.cookie.+ * @param {String} name The name of the cookie.+ * @param {String} value The value of the cookie.+ * @param {Boolean} encodeValue True to encode the value, false to leave as-is.+ * @param {Object} options (Optional) Options for the cookie.+ * @return {String} The formatted cookie string.+ * @method _createCookieString+ * @private+ * @static+ */+ _createCookieString : function (name /*:String*/, value /*:Variant*/, encodeValue /*:Boolean*/, options /*:Object*/) /*:String*/ {+ + _yuitest_coverfunc("build/cookie/cookie.js", "_createCookieString", 71);+_yuitest_coverline("build/cookie/cookie.js", 73);+options = options || {};+ + _yuitest_coverline("build/cookie/cookie.js", 75);+var text /*:String*/ = encode(name) + "=" + (encodeValue ? encode(value) : value),+ expires = options.expires,+ path = options.path,+ domain = options.domain;+ + + _yuitest_coverline("build/cookie/cookie.js", 81);+if (isObject(options)){+ //expiration date+ _yuitest_coverline("build/cookie/cookie.js", 83);+if (expires instanceof Date){+ _yuitest_coverline("build/cookie/cookie.js", 84);+text += "; expires=" + expires.toUTCString();+ }+ + //path+ _yuitest_coverline("build/cookie/cookie.js", 88);+if (isString(path) && path !== ""){+ _yuitest_coverline("build/cookie/cookie.js", 89);+text += "; path=" + path;+ }+ + //domain+ _yuitest_coverline("build/cookie/cookie.js", 93);+if (isString(domain) && domain !== ""){+ _yuitest_coverline("build/cookie/cookie.js", 94);+text += "; domain=" + domain;+ }+ + //secure+ _yuitest_coverline("build/cookie/cookie.js", 98);+if (options.secure === true){+ _yuitest_coverline("build/cookie/cookie.js", 99);+text += "; secure";+ }+ }+ + _yuitest_coverline("build/cookie/cookie.js", 103);+return text;+ },+ + /**+ * Formats a cookie value for an object containing multiple values.+ * @param {Object} hash An object of key-value pairs to create a string for.+ * @return {String} A string suitable for use as a cookie value.+ * @method _createCookieHashString+ * @private+ * @static+ */+ _createCookieHashString : function (hash /*:Object*/) /*:String*/ {+ _yuitest_coverfunc("build/cookie/cookie.js", "_createCookieHashString", 114);+_yuitest_coverline("build/cookie/cookie.js", 115);+if (!isObject(hash)){+ _yuitest_coverline("build/cookie/cookie.js", 116);+error("Cookie._createCookieHashString(): Argument must be an object.");+ }+ + _yuitest_coverline("build/cookie/cookie.js", 119);+var text /*:Array*/ = [];++ _yuitest_coverline("build/cookie/cookie.js", 121);+O.each(hash, function(value, key){+ _yuitest_coverfunc("build/cookie/cookie.js", "(anonymous 2)", 121);+_yuitest_coverline("build/cookie/cookie.js", 122);+if (!isFunction(value) && !isUndefined(value)){+ _yuitest_coverline("build/cookie/cookie.js", 123);+text.push(encode(key) + "=" + encode(String(value)));+ } + });+ + _yuitest_coverline("build/cookie/cookie.js", 127);+return text.join("&");+ },+ + /**+ * Parses a cookie hash string into an object.+ * @param {String} text The cookie hash string to parse (format: n1=v1&n2=v2).+ * @return {Object} An object containing entries for each cookie value.+ * @method _parseCookieHash+ * @private+ * @static+ */+ _parseCookieHash : function (text) {+ + _yuitest_coverfunc("build/cookie/cookie.js", "_parseCookieHash", 138);+_yuitest_coverline("build/cookie/cookie.js", 140);+var hashParts = text.split("&"),+ hashPart = NULL,+ hash = {};+ + _yuitest_coverline("build/cookie/cookie.js", 144);+if (text.length){+ _yuitest_coverline("build/cookie/cookie.js", 145);+for (var i=0, len=hashParts.length; i < len; i++){+ _yuitest_coverline("build/cookie/cookie.js", 146);+hashPart = hashParts[i].split("=");+ _yuitest_coverline("build/cookie/cookie.js", 147);+hash[decode(hashPart[0])] = decode(hashPart[1]);+ }+ }+ + _yuitest_coverline("build/cookie/cookie.js", 151);+return hash; + },+ + /**+ * Parses a cookie string into an object representing all accessible cookies.+ * @param {String} text The cookie string to parse.+ * @param {Boolean} shouldDecode (Optional) Indicates if the cookie values should be decoded or not. Default is true.+ * @return {Object} An object containing entries for each accessible cookie.+ * @method _parseCookieString+ * @private+ * @static+ */+ _parseCookieString : function (text /*:String*/, shouldDecode /*:Boolean*/) /*:Object*/ {+ + _yuitest_coverfunc("build/cookie/cookie.js", "_parseCookieString", 163);+_yuitest_coverline("build/cookie/cookie.js", 165);+var cookies /*:Object*/ = {}; + + _yuitest_coverline("build/cookie/cookie.js", 167);+if (isString(text) && text.length > 0) {+ + _yuitest_coverline("build/cookie/cookie.js", 169);+var decodeValue = (shouldDecode === false ? function(s){_yuitest_coverfunc("build/cookie/cookie.js", "(anonymous 3)", 169);+return s;} : decode), + cookieParts = text.split(/;\s/g),+ cookieName = NULL,+ cookieValue = NULL,+ cookieNameValue = NULL;+ + _yuitest_coverline("build/cookie/cookie.js", 175);+for (var i=0, len=cookieParts.length; i < len; i++){+ + //check for normally-formatted cookie (name-value)+ _yuitest_coverline("build/cookie/cookie.js", 178);+cookieNameValue = cookieParts[i].match(/([^=]+)=/i);+ _yuitest_coverline("build/cookie/cookie.js", 179);+if (cookieNameValue instanceof Array){+ _yuitest_coverline("build/cookie/cookie.js", 180);+try {+ _yuitest_coverline("build/cookie/cookie.js", 181);+cookieName = decode(cookieNameValue[1]);+ _yuitest_coverline("build/cookie/cookie.js", 182);+cookieValue = decodeValue(cookieParts[i].substring(cookieNameValue[1].length+1));+ } catch (ex){+ //intentionally ignore the cookie - the encoding is wrong+ }+ } else {+ //means the cookie does not have an "=", so treat it as a boolean flag+ _yuitest_coverline("build/cookie/cookie.js", 188);+cookieName = decode(cookieParts[i]);+ _yuitest_coverline("build/cookie/cookie.js", 189);+cookieValue = "";+ }+ _yuitest_coverline("build/cookie/cookie.js", 191);+cookies[cookieName] = cookieValue;+ }++ }+ + _yuitest_coverline("build/cookie/cookie.js", 196);+return cookies;+ }, + + /**+ * Sets the document object that the cookie utility uses for setting+ * cookies. This method is necessary to ensure that the cookie utility+ * unit tests can pass even when run on a domain instead of locally.+ * This method should not be used otherwise; you should use + * <code>Y.config.doc</code> to change the document that the cookie+ * utility uses for everyday purposes.+ * @param {Object} newDoc The object to use as the document.+ * @return {void}+ * @method _setDoc+ * @private+ */ + _setDoc: function(newDoc){+ _yuitest_coverfunc("build/cookie/cookie.js", "_setDoc", 211);+_yuitest_coverline("build/cookie/cookie.js", 212);+doc = newDoc;+ },+ + //-------------------------------------------------------------------------+ // Public Methods+ //-------------------------------------------------------------------------+ + /**+ * Determines if the cookie with the given name exists. This is useful for+ * Boolean cookies (those that do not follow the name=value convention).+ * @param {String} name The name of the cookie to check.+ * @return {Boolean} True if the cookie exists, false if not.+ * @method exists+ * @static+ */+ exists: function(name) {+ + _yuitest_coverfunc("build/cookie/cookie.js", "exists", 227);+_yuitest_coverline("build/cookie/cookie.js", 229);+validateCookieName(name); //throws error+ + _yuitest_coverline("build/cookie/cookie.js", 231);+var cookies = this._parseCookieString(doc.cookie, true);+ + _yuitest_coverline("build/cookie/cookie.js", 233);+return cookies.hasOwnProperty(name);+ }, + + /**+ * Returns the cookie value for the given name.+ * @param {String} name The name of the cookie to retrieve.+ * @param {Function|Object} options (Optional) An object containing one or more+ * cookie options: raw (true/false) and converter (a function).+ * The converter function is run on the value before returning it. The+ * function is not used if the cookie doesn't exist. The function can be+ * passed instead of the options object for backwards compatibility. When+ * raw is set to true, the cookie value is not URI decoded.+ * @return {Variant} If no converter is specified, returns a string or null if+ * the cookie doesn't exist. If the converter is specified, returns the value+ * returned from the converter or null if the cookie doesn't exist.+ * @method get+ * @static+ */+ get : function (name, options) {+ + _yuitest_coverfunc("build/cookie/cookie.js", "get", 251);+_yuitest_coverline("build/cookie/cookie.js", 253);+validateCookieName(name); //throws error + + _yuitest_coverline("build/cookie/cookie.js", 255);+var cookies,+ cookie,+ converter;+ + //if options is a function, then it's the converter+ _yuitest_coverline("build/cookie/cookie.js", 260);+if (isFunction(options)) {+ _yuitest_coverline("build/cookie/cookie.js", 261);+converter = options;+ _yuitest_coverline("build/cookie/cookie.js", 262);+options = {};+ } else {_yuitest_coverline("build/cookie/cookie.js", 263);+if (isObject(options)) {+ _yuitest_coverline("build/cookie/cookie.js", 264);+converter = options.converter;+ } else {+ _yuitest_coverline("build/cookie/cookie.js", 266);+options = {};+ }}+ + _yuitest_coverline("build/cookie/cookie.js", 269);+cookies = this._parseCookieString(doc.cookie, !options.raw);+ _yuitest_coverline("build/cookie/cookie.js", 270);+cookie = cookies[name];+ + //should return null, not undefined if the cookie doesn't exist+ _yuitest_coverline("build/cookie/cookie.js", 273);+if (isUndefined(cookie)) {+ _yuitest_coverline("build/cookie/cookie.js", 274);+return NULL;+ }+ + _yuitest_coverline("build/cookie/cookie.js", 277);+if (!isFunction(converter)){+ _yuitest_coverline("build/cookie/cookie.js", 278);+return cookie;+ } else {+ _yuitest_coverline("build/cookie/cookie.js", 280);+return converter(cookie);+ }+ },+ + /**+ * Returns the value of a subcookie.+ * @param {String} name The name of the cookie to retrieve.+ * @param {String} subName The name of the subcookie to retrieve.+ * @param {Function} converter (Optional) A function to run on the value before returning+ * it. The function is not used if the cookie doesn't exist.+ * @return {Variant} If the cookie doesn't exist, null is returned. If the subcookie+ * doesn't exist, null if also returned. If no converter is specified and the+ * subcookie exists, a string is returned. If a converter is specified and the+ * subcookie exists, the value returned from the converter is returned.+ * @method getSub+ * @static+ */+ getSub : function (name /*:String*/, subName /*:String*/, converter /*:Function*/) /*:Variant*/ {+ + _yuitest_coverfunc("build/cookie/cookie.js", "getSub", 297);+_yuitest_coverline("build/cookie/cookie.js", 299);+var hash /*:Variant*/ = this.getSubs(name); + + _yuitest_coverline("build/cookie/cookie.js", 301);+if (hash !== NULL) {+ + _yuitest_coverline("build/cookie/cookie.js", 303);+validateSubcookieName(subName); //throws error+ + _yuitest_coverline("build/cookie/cookie.js", 305);+if (isUndefined(hash[subName])){+ _yuitest_coverline("build/cookie/cookie.js", 306);+return NULL;+ } + + _yuitest_coverline("build/cookie/cookie.js", 309);+if (!isFunction(converter)){+ _yuitest_coverline("build/cookie/cookie.js", 310);+return hash[subName];+ } else {+ _yuitest_coverline("build/cookie/cookie.js", 312);+return converter(hash[subName]);+ }+ } else {+ _yuitest_coverline("build/cookie/cookie.js", 315);+return NULL;+ }+ + },+ + /**+ * Returns an object containing name-value pairs stored in the cookie with the given name.+ * @param {String} name The name of the cookie to retrieve.+ * @return {Object} An object of name-value pairs if the cookie with the given name+ * exists, null if it does not.+ * @method getSubs+ * @static+ */+ getSubs : function (name) {+ + _yuitest_coverfunc("build/cookie/cookie.js", "getSubs", 328);+_yuitest_coverline("build/cookie/cookie.js", 330);+validateCookieName(name); //throws error+ + _yuitest_coverline("build/cookie/cookie.js", 332);+var cookies = this._parseCookieString(doc.cookie, false);+ _yuitest_coverline("build/cookie/cookie.js", 333);+if (isString(cookies[name])){+ _yuitest_coverline("build/cookie/cookie.js", 334);+return this._parseCookieHash(cookies[name]);+ }+ _yuitest_coverline("build/cookie/cookie.js", 336);+return NULL;+ },+ + /**+ * Removes a cookie from the machine by setting its expiration date to+ * sometime in the past.+ * @param {String} name The name of the cookie to remove.+ * @param {Object} options (Optional) An object containing one or more+ * cookie options: path (a string), domain (a string), + * and secure (true/false). The expires option will be overwritten+ * by the method.+ * @return {String} The created cookie string.+ * @method remove+ * @static+ */+ remove : function (name, options) {+ + _yuitest_coverfunc("build/cookie/cookie.js", "remove", 351);+_yuitest_coverline("build/cookie/cookie.js", 353);+validateCookieName(name); //throws error+ + //set options+ _yuitest_coverline("build/cookie/cookie.js", 356);+options = Y.merge(options || {}, {+ expires: new Date(0)+ });+ + //set cookie+ _yuitest_coverline("build/cookie/cookie.js", 361);+return this.set(name, "", options);+ },+ + /**+ * Removes a sub cookie with a given name.+ * @param {String} name The name of the cookie in which the subcookie exists.+ * @param {String} subName The name of the subcookie to remove.+ * @param {Object} options (Optional) An object containing one or more+ * cookie options: path (a string), domain (a string), expires (a Date object),+ * removeIfEmpty (true/false), and secure (true/false). This must be the same+ * settings as the original subcookie.+ * @return {String} The created cookie string.+ * @method removeSub+ * @static+ */+ removeSub : function(name, subName, options) {+ + _yuitest_coverfunc("build/cookie/cookie.js", "removeSub", 376);+_yuitest_coverline("build/cookie/cookie.js", 378);+validateCookieName(name); //throws error+ + _yuitest_coverline("build/cookie/cookie.js", 380);+validateSubcookieName(subName); //throws error+ + _yuitest_coverline("build/cookie/cookie.js", 382);+options = options || {};+ + //get all subcookies for this cookie+ _yuitest_coverline("build/cookie/cookie.js", 385);+var subs = this.getSubs(name);+ + //delete the indicated subcookie+ _yuitest_coverline("build/cookie/cookie.js", 388);+if (isObject(subs) && subs.hasOwnProperty(subName)){+ _yuitest_coverline("build/cookie/cookie.js", 389);+delete subs[subName];+ + _yuitest_coverline("build/cookie/cookie.js", 391);+if (!options.removeIfEmpty) {+ //reset the cookie+ + _yuitest_coverline("build/cookie/cookie.js", 394);+return this.setSubs(name, subs, options);+ } else {+ //reset the cookie if there are subcookies left, else remove+ _yuitest_coverline("build/cookie/cookie.js", 397);+for (var key in subs){+ _yuitest_coverline("build/cookie/cookie.js", 398);+if (subs.hasOwnProperty(key) && !isFunction(subs[key]) && !isUndefined(subs[key])){+ _yuitest_coverline("build/cookie/cookie.js", 399);+return this.setSubs(name, subs, options);+ }+ }+ + _yuitest_coverline("build/cookie/cookie.js", 403);+return this.remove(name, options);+ } + } else {+ _yuitest_coverline("build/cookie/cookie.js", 406);+return "";+ }+ + },+ + /**+ * Sets a cookie with a given name and value.+ * @param {String} name The name of the cookie to set.+ * @param {Variant} value The value to set for the cookie.+ * @param {Object} options (Optional) An object containing one or more+ * cookie options: path (a string), domain (a string), expires (a Date object),+ * secure (true/false), and raw (true/false). Setting raw to true indicates+ * that the cookie should not be URI encoded before being set.+ * @return {String} The created cookie string.+ * @method set+ * @static+ */+ set : function (name, value, options) {+ + _yuitest_coverfunc("build/cookie/cookie.js", "set", 423);+_yuitest_coverline("build/cookie/cookie.js", 425);+validateCookieName(name); //throws error+ + _yuitest_coverline("build/cookie/cookie.js", 427);+if (isUndefined(value)){+ _yuitest_coverline("build/cookie/cookie.js", 428);+error("Cookie.set(): Value cannot be undefined.");+ }+ + _yuitest_coverline("build/cookie/cookie.js", 431);+options = options || {};+ + _yuitest_coverline("build/cookie/cookie.js", 433);+var text = this._createCookieString(name, value, !options.raw, options);+ _yuitest_coverline("build/cookie/cookie.js", 434);+doc.cookie = text;+ _yuitest_coverline("build/cookie/cookie.js", 435);+return text;+ },+ + /**+ * Sets a sub cookie with a given name to a particular value.+ * @param {String} name The name of the cookie to set.+ * @param {String} subName The name of the subcookie to set.+ * @param {Variant} value The value to set.+ * @param {Object} options (Optional) An object containing one or more+ * cookie options: path (a string), domain (a string), expires (a Date object),+ * and secure (true/false).+ * @return {String} The created cookie string.+ * @method setSub+ * @static+ */+ setSub : function (name, subName, value, options) {++ _yuitest_coverfunc("build/cookie/cookie.js", "setSub", 450);+_yuitest_coverline("build/cookie/cookie.js", 452);+validateCookieName(name); //throws error+ + _yuitest_coverline("build/cookie/cookie.js", 454);+validateSubcookieName(subName); //throws error+ + _yuitest_coverline("build/cookie/cookie.js", 456);+if (isUndefined(value)){+ _yuitest_coverline("build/cookie/cookie.js", 457);+error("Cookie.setSub(): Subcookie value cannot be undefined.");+ }+ + _yuitest_coverline("build/cookie/cookie.js", 460);+var hash = this.getSubs(name);+ + _yuitest_coverline("build/cookie/cookie.js", 462);+if (!isObject(hash)){+ _yuitest_coverline("build/cookie/cookie.js", 463);+hash = {};+ }+ + _yuitest_coverline("build/cookie/cookie.js", 466);+hash[subName] = value; + + _yuitest_coverline("build/cookie/cookie.js", 468);+return this.setSubs(name, hash, options);+ + },+ + /**+ * Sets a cookie with a given name to contain a hash of name-value pairs.+ * @param {String} name The name of the cookie to set.+ * @param {Object} value An object containing name-value pairs.+ * @param {Object} options (Optional) An object containing one or more+ * cookie options: path (a string), domain (a string), expires (a Date object),+ * and secure (true/false).+ * @return {String} The created cookie string.+ * @method setSubs+ * @static+ */+ setSubs : function (name, value, options) {+ + _yuitest_coverfunc("build/cookie/cookie.js", "setSubs", 483);+_yuitest_coverline("build/cookie/cookie.js", 485);+validateCookieName(name); //throws error+ + _yuitest_coverline("build/cookie/cookie.js", 487);+if (!isObject(value)){+ _yuitest_coverline("build/cookie/cookie.js", 488);+error("Cookie.setSubs(): Cookie value must be an object.");+ }+ + _yuitest_coverline("build/cookie/cookie.js", 491);+var text /*:String*/ = this._createCookieString(name, this._createCookieHashString(value), false, options);+ _yuitest_coverline("build/cookie/cookie.js", 492);+doc.cookie = text;+ _yuitest_coverline("build/cookie/cookie.js", 493);+return text; + } + + };+++}, '3.7.1', {"requires": ["yui-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('cookie', function(Y) {+YUI.add('cookie', function (Y, NAME) { /** * Utilities for cookie management@@ -502,4 +502,4 @@ }; -}, '3.5.1' ,{requires:['yui-base']});+}, '3.7.1', {"requires": ["yui-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("cookie",function(c){var k=c.Lang,i=c.Object,g=null,d=k.isString,n=k.isObject,f=k.isUndefined,e=k.isFunction,h=encodeURIComponent,b=decodeURIComponent,m=c.config.doc;function j(o){throw new TypeError(o);}function l(o){if(!d(o)||o===""){j("Cookie name must be a non-empty string.");}}function a(o){if(!d(o)||o===""){j("Subcookie name must be a non-empty string.");}}c.Cookie={_createCookieString:function(q,t,r,p){p=p||{};var v=h(q)+"="+(r?h(t):t),o=p.expires,u=p.path,s=p.domain;if(n(p)){if(o instanceof Date){v+="; expires="+o.toUTCString();}if(d(u)&&u!==""){v+="; path="+u;}if(d(s)&&s!==""){v+="; domain="+s;}if(p.secure===true){v+="; secure";}}return v;},_createCookieHashString:function(o){if(!n(o)){j("Cookie._createCookieHashString(): Argument must be an object.");}var p=[];i.each(o,function(r,q){if(!e(r)&&!f(r)){p.push(h(q)+"="+h(String(r)));}});return p.join("&");},_parseCookieHash:function(s){var r=s.split("&"),t=g,q={};if(s.length){for(var p=0,o=r.length;p<o;p++){t=r[p].split("=");q[b(t[0])]=b(t[1]);}}return q;},_parseCookieString:function(w,y){var x={};if(d(w)&&w.length>0){var o=(y===false?function(z){return z;}:b),u=w.split(/;\s/g),v=g,p=g,r=g;for(var q=0,s=u.length;q<s;q++){r=u[q].match(/([^=]+)=/i);if(r instanceof Array){try{v=b(r[1]);p=o(u[q].substring(r[1].length+1));}catch(t){}}else{v=b(u[q]);p="";}x[v]=p;}}return x;},_setDoc:function(o){m=o;},exists:function(o){l(o);var p=this._parseCookieString(m.cookie,true);return p.hasOwnProperty(o);},get:function(p,o){l(p);var s,q,r;if(e(o)){r=o;o={};}else{if(n(o)){r=o.converter;}else{o={};}}s=this._parseCookieString(m.cookie,!o.raw);q=s[p];if(f(q)){return g;}if(!e(r)){return q;}else{return r(q);}},getSub:function(o,q,p){var r=this.getSubs(o);if(r!==g){a(q);if(f(r[q])){return g;}if(!e(p)){return r[q];}else{return p(r[q]);}}else{return g;}},getSubs:function(o){l(o);var p=this._parseCookieString(m.cookie,false);if(d(p[o])){return this._parseCookieHash(p[o]);}return g;},remove:function(p,o){l(p);o=c.merge(o||{},{expires:new Date(0)});return this.set(p,"",o);},removeSub:function(p,s,o){l(p);a(s);o=o||{};var r=this.getSubs(p);if(n(r)&&r.hasOwnProperty(s)){delete r[s];if(!o.removeIfEmpty){return this.setSubs(p,r,o);}else{for(var q in r){if(r.hasOwnProperty(q)&&!e(r[q])&&!f(r[q])){return this.setSubs(p,r,o);}}return this.remove(p,o);}}else{return"";}},set:function(p,q,o){l(p);if(f(q)){j("Cookie.set(): Value cannot be undefined.");}o=o||{};var r=this._createCookieString(p,q,!o.raw,o);m.cookie=r;return r;},setSub:function(p,r,q,o){l(p);a(r);if(f(q)){j("Cookie.setSub(): Subcookie value cannot be undefined.");}var s=this.getSubs(p);if(!n(s)){s={};}s[r]=q;return this.setSubs(p,s,o);},setSubs:function(p,q,o){l(p);if(!n(q)){j("Cookie.setSubs(): Cookie value must be an object.");}var r=this._createCookieString(p,this._createCookieHashString(q),false,o);m.cookie=r;return r;}};},"3.5.1",{requires:["yui-base"]});+YUI.add("cookie",function(e,t){function h(e){throw new TypeError(e)}function p(e){(!s(e)||e==="")&&h("Cookie name must be a non-empty string.")}function d(e){(!s(e)||e==="")&&h("Subcookie name must be a non-empty string.")}var n=e.Lang,r=e.Object,i=null,s=n.isString,o=n.isObject,u=n.isUndefined,a=n.isFunction,f=encodeURIComponent,l=decodeURIComponent,c=e.config.doc;e.Cookie={_createCookieString:function(e,t,n,r){r=r||{};var i=f(e)+"="+(n?f(t):t),u=r.expires,a=r.path,l=r.domain;return o(r)&&(u instanceof Date&&(i+="; expires="+u.toUTCString()),s(a)&&a!==""&&(i+="; path="+a),s(l)&&l!==""&&(i+="; domain="+l),r.secure===!0&&(i+="; secure")),i},_createCookieHashString:function(e){o(e)||h("Cookie._createCookieHashString(): Argument must be an object.");var t=[];return r.each(e,function(e,n){!a(e)&&!u(e)&&t.push(f(n)+"="+f(String(e)))}),t.join("&")},_parseCookieHash:function(e){var t=e.split("&"),n=i,r={};if(e.length)for(var s=0,o=t.length;s<o;s++)n=t[s].split("="),r[l(n[0])]=l(n[1]);return r},_parseCookieString:function(e,t){var n={};if(s(e)&&e.length>0){var r=t===!1?function(e){return e}:l,o=e.split(/;\s/g),u=i,a=i,f=i;for(var c=0,h=o.length;c<h;c++){f=o[c].match(/([^=]+)=/i);if(f instanceof Array)try{u=l(f[1]),a=r(o[c].substring(f[1].length+1))}catch(p){}else u=l(o[c]),a="";n[u]=a}}return n},_setDoc:function(e){c=e},exists:function(e){p(e);var t=this._parseCookieString(c.cookie,!0);return t.hasOwnProperty(e)},get:function(e,t){p(e);var n,r,s;return a(t)?(s=t,t={}):o(t)?s=t.converter:t={},n=this._parseCookieString(c.cookie,!t.raw),r=n[e],u(r)?i:a(s)?s(r):r},getSub:function(e,t,n){var r=this.getSubs(e);return r!==i?(d(t),u(r[t])?i:a(n)?n(r[t]):r[t]):i},getSubs:function(e){p(e);var t=this._parseCookieString(c.cookie,!1);return s(t[e])?this._parseCookieHash(t[e]):i},remove:function(t,n){return p(t),n=e.merge(n||{},{expires:new Date(0)}),this.set(t,"",n)},removeSub:function(e,t,n){p(e),d(t),n=n||{};var r=this.getSubs(e);if(o(r)&&r.hasOwnProperty(t)){delete r[t];if(!n.removeIfEmpty)return this.setSubs(e,r,n);for(var i in r)if(r.hasOwnProperty(i)&&!a(r[i])&&!u(r[i]))return this.setSubs(e,r,n);return this.remove(e,n)}return""},set:function(e,t,n){p(e),u(t)&&h("Cookie.set(): Value cannot be undefined."),n=n||{};var r=this._createCookieString(e,t,!n.raw,n);return c.cookie=r,r},setSub:function(e,t,n,r){p(e),d(t),u(n)&&h("Cookie.setSub(): Subcookie value cannot be undefined.");var i=this.getSubs(e);return o(i)||(i={}),i[t]=n,this.setSubs(e,i,r)},setSubs:function(e,t,n){p(e),o(t)||h("Cookie.setSubs(): Cookie value must be an object.");var r=this._createCookieString(e,this._createCookieHashString(t),!1,n);return c.cookie=r,r}}},"3.7.1",{requires:["yui-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('cookie', function(Y) {+YUI.add('cookie', function (Y, NAME) { /** * Utilities for cookie management@@ -502,4 +502,4 @@ }; -}, '3.5.1' ,{requires:['yui-base']});+}, '3.7.1', {"requires": ["yui-base"]});
@@ -0,0 +1,151 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/createlink-base/createlink-base.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/createlink-base/createlink-base.js",+ code: []+};+_yuitest_coverage["build/createlink-base/createlink-base.js"].code=["YUI.add('createlink-base', function (Y, NAME) {","",""," /**"," * Adds prompt style link creation. Adds an override for the <a href=\"Plugin.ExecCommand.html#method_COMMANDS.createlink\">createlink execCommand</a>."," * @class Plugin.CreateLinkBase"," * @static"," * @submodule createlink-base"," * @module editor"," */"," "," var CreateLinkBase = {};"," /**"," * Strings used by the plugin"," * @property STRINGS"," * @static"," */"," CreateLinkBase.STRINGS = {"," /**"," * String used for the Prompt"," * @property PROMPT"," * @static"," */"," PROMPT: 'Please enter the URL for the link to point to:',"," /**"," * String used as the default value of the Prompt"," * @property DEFAULT"," * @static"," */"," DEFAULT: 'http://'"," };",""," Y.namespace('Plugin');"," Y.Plugin.CreateLinkBase = CreateLinkBase;",""," Y.mix(Y.Plugin.ExecCommand.COMMANDS, {"," /**"," * Override for the createlink method from the <a href=\"Plugin.CreateLinkBase.html\">CreateLinkBase</a> plugin."," * @for ExecCommand"," * @method COMMANDS.createlink"," * @static"," * @param {String} cmd The command executed: createlink"," * @return {Node} Node instance of the item touched by this command."," */"," createlink: function(cmd) {"," var inst = this.get('host').getInstance(), out, a, sel, holder,"," url = prompt(CreateLinkBase.STRINGS.PROMPT, CreateLinkBase.STRINGS.DEFAULT);",""," if (url) {"," holder = inst.config.doc.createElement('div');"," url = url.replace(/\"/g, '').replace(/'/g, ''); //Remove single & double quotes"," url = inst.config.doc.createTextNode(url);"," holder.appendChild(url);"," url = holder.innerHTML;","",""," this.get('host')._execCommand(cmd, url);"," sel = new inst.EditorSelection();"," out = sel.getSelected();"," if (!sel.isCollapsed && out.size()) {"," //We have a selection"," a = out.item(0).one('a');"," if (a) {"," out.item(0).replace(a);"," }"," if (Y.UA.gecko) {"," if (a.get('parentNode').test('span')) {"," if (a.get('parentNode').one('br.yui-cursor')) {"," a.get('parentNode').insert(a, 'before');"," }"," }"," }"," } else {"," //No selection, insert a new node.."," this.get('host').execCommand('inserthtml', '<a href=\"' + url + '\">' + url + '</a>');"," }"," }"," return a;"," }"," });","","","","}, '3.7.1', {\"requires\": [\"editor-base\"]});"];+_yuitest_coverage["build/createlink-base/createlink-base.js"].lines = {"1":0,"12":0,"18":0,"33":0,"34":0,"36":0,"46":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"57":0,"58":0,"59":0,"60":0,"62":0,"63":0,"64":0,"66":0,"67":0,"68":0,"69":0,"75":0,"78":0};+_yuitest_coverage["build/createlink-base/createlink-base.js"].functions = {"createlink:45":0,"(anonymous 1):1":0};+_yuitest_coverage["build/createlink-base/createlink-base.js"].coveredLines = 26;+_yuitest_coverage["build/createlink-base/createlink-base.js"].coveredFunctions = 2;+_yuitest_coverline("build/createlink-base/createlink-base.js", 1);+YUI.add('createlink-base', function (Y, NAME) {+++ /**+ * Adds prompt style link creation. Adds an override for the <a href="Plugin.ExecCommand.html#method_COMMANDS.createlink">createlink execCommand</a>.+ * @class Plugin.CreateLinkBase+ * @static+ * @submodule createlink-base+ * @module editor+ */+ + _yuitest_coverfunc("build/createlink-base/createlink-base.js", "(anonymous 1)", 1);+_yuitest_coverline("build/createlink-base/createlink-base.js", 12);+var CreateLinkBase = {};+ /**+ * Strings used by the plugin+ * @property STRINGS+ * @static+ */+ _yuitest_coverline("build/createlink-base/createlink-base.js", 18);+CreateLinkBase.STRINGS = {+ /**+ * String used for the Prompt+ * @property PROMPT+ * @static+ */+ PROMPT: 'Please enter the URL for the link to point to:',+ /**+ * String used as the default value of the Prompt+ * @property DEFAULT+ * @static+ */+ DEFAULT: 'http://'+ };++ _yuitest_coverline("build/createlink-base/createlink-base.js", 33);+Y.namespace('Plugin');+ _yuitest_coverline("build/createlink-base/createlink-base.js", 34);+Y.Plugin.CreateLinkBase = CreateLinkBase;++ _yuitest_coverline("build/createlink-base/createlink-base.js", 36);+Y.mix(Y.Plugin.ExecCommand.COMMANDS, {+ /**+ * Override for the createlink method from the <a href="Plugin.CreateLinkBase.html">CreateLinkBase</a> plugin.+ * @for ExecCommand+ * @method COMMANDS.createlink+ * @static+ * @param {String} cmd The command executed: createlink+ * @return {Node} Node instance of the item touched by this command.+ */+ createlink: function(cmd) {+ _yuitest_coverfunc("build/createlink-base/createlink-base.js", "createlink", 45);+_yuitest_coverline("build/createlink-base/createlink-base.js", 46);+var inst = this.get('host').getInstance(), out, a, sel, holder,+ url = prompt(CreateLinkBase.STRINGS.PROMPT, CreateLinkBase.STRINGS.DEFAULT);++ _yuitest_coverline("build/createlink-base/createlink-base.js", 49);+if (url) {+ _yuitest_coverline("build/createlink-base/createlink-base.js", 50);+holder = inst.config.doc.createElement('div');+ _yuitest_coverline("build/createlink-base/createlink-base.js", 51);+url = url.replace(/"/g, '').replace(/'/g, ''); //Remove single & double quotes+ _yuitest_coverline("build/createlink-base/createlink-base.js", 52);+url = inst.config.doc.createTextNode(url);+ _yuitest_coverline("build/createlink-base/createlink-base.js", 53);+holder.appendChild(url);+ _yuitest_coverline("build/createlink-base/createlink-base.js", 54);+url = holder.innerHTML;+++ _yuitest_coverline("build/createlink-base/createlink-base.js", 57);+this.get('host')._execCommand(cmd, url);+ _yuitest_coverline("build/createlink-base/createlink-base.js", 58);+sel = new inst.EditorSelection();+ _yuitest_coverline("build/createlink-base/createlink-base.js", 59);+out = sel.getSelected();+ _yuitest_coverline("build/createlink-base/createlink-base.js", 60);+if (!sel.isCollapsed && out.size()) {+ //We have a selection+ _yuitest_coverline("build/createlink-base/createlink-base.js", 62);+a = out.item(0).one('a');+ _yuitest_coverline("build/createlink-base/createlink-base.js", 63);+if (a) {+ _yuitest_coverline("build/createlink-base/createlink-base.js", 64);+out.item(0).replace(a);+ }+ _yuitest_coverline("build/createlink-base/createlink-base.js", 66);+if (Y.UA.gecko) {+ _yuitest_coverline("build/createlink-base/createlink-base.js", 67);+if (a.get('parentNode').test('span')) {+ _yuitest_coverline("build/createlink-base/createlink-base.js", 68);+if (a.get('parentNode').one('br.yui-cursor')) {+ _yuitest_coverline("build/createlink-base/createlink-base.js", 69);+a.get('parentNode').insert(a, 'before');+ }+ }+ }+ } else {+ //No selection, insert a new node..+ _yuitest_coverline("build/createlink-base/createlink-base.js", 75);+this.get('host').execCommand('inserthtml', '<a href="' + url + '">' + url + '</a>');+ }+ }+ _yuitest_coverline("build/createlink-base/createlink-base.js", 78);+return a;+ }+ });++++}, '3.7.1', {"requires": ["editor-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('createlink-base', function(Y) {+YUI.add('createlink-base', function (Y, NAME) { /**@@ -88,4 +88,4 @@ -}, '3.5.1' ,{skinnable:false, requires:['editor-base']});+}, '3.7.1', {"requires": ["editor-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("createlink-base",function(b){var a={};a.STRINGS={PROMPT:"Please enter the URL for the link to point to:",DEFAULT:"http://"};b.namespace("Plugin");b.Plugin.CreateLinkBase=a;b.mix(b.Plugin.ExecCommand.COMMANDS,{createlink:function(i){var h=this.get("host").getInstance(),e,c,g,f,d=prompt(a.STRINGS.PROMPT,a.STRINGS.DEFAULT);if(d){f=h.config.doc.createElement("div");d=d.replace(/"/g,"").replace(/'/g,"");d=h.config.doc.createTextNode(d);f.appendChild(d);d=f.innerHTML;this.get("host")._execCommand(i,d);g=new h.EditorSelection();e=g.getSelected();if(!g.isCollapsed&&e.size()){c=e.item(0).one("a");if(c){e.item(0).replace(c);}if(b.UA.gecko){if(c.get("parentNode").test("span")){if(c.get("parentNode").one("br.yui-cursor")){c.get("parentNode").insert(c,"before");}}}}else{this.get("host").execCommand("inserthtml",'<a href="'+d+'">'+d+"</a>");}}return c;}});},"3.5.1",{skinnable:false,requires:["editor-base"]});+YUI.add("createlink-base",function(e,t){var n={};n.STRINGS={PROMPT:"Please enter the URL for the link to point to:",DEFAULT:"http://"},e.namespace("Plugin"),e.Plugin.CreateLinkBase=n,e.mix(e.Plugin.ExecCommand.COMMANDS,{createlink:function(t){var r=this.get("host").getInstance(),i,s,o,u,a=prompt(n.STRINGS.PROMPT,n.STRINGS.DEFAULT);return a&&(u=r.config.doc.createElement("div"),a=a.replace(/"/g,"").replace(/'/g,""),a=r.config.doc.createTextNode(a),u.appendChild(a),a=u.innerHTML,this.get("host")._execCommand(t,a),o=new r.EditorSelection,i=o.getSelected(),!o.isCollapsed&&i.size()?(s=i.item(0).one("a"),s&&i.item(0).replace(s),e.UA.gecko&&s.get("parentNode").test("span")&&s.get("parentNode").one("br.yui-cursor")&&s.get("parentNode").insert(s,"before")):this.get("host").execCommand("inserthtml",'<a href="'+a+'">'+a+"</a>")),s}})},"3.7.1",{requires:["editor-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('createlink-base', function(Y) {+YUI.add('createlink-base', function (Y, NAME) { /**@@ -87,4 +87,4 @@ -}, '3.5.1' ,{skinnable:false, requires:['editor-base']});+}, '3.7.1', {"requires": ["editor-base"]});
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -77,5 +77,6 @@ /* setting a consistent width, 160px; control of type=file still not possible */ .yui3-cssbase input[type=text],.yui3-cssbase input[type=password],.yui3-cssbase textarea{width:12.25em;*width:11.9em;}+ /* YUI CSS Detection Stamp */ #yui3-css-stamp.cssbase-context { display: none; }
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -77,5 +77,6 @@ /* setting a consistent width, 160px; control of type=file still not possible */ input[type=text],input[type=password],textarea{width:12.25em;*width:11.9em;}+ /* YUI CSS Detection Stamp */ #yui3-css-stamp.cssbase { display: none; }
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -144,5 +144,6 @@ .yui3-skin-night .yui3-button:-moz-focusring { outline-color: rgba(255, 255, 255, 0.85); }+ /* YUI CSS Detection Stamp */ #yui3-css-stamp.cssbutton { display: none; }
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -17,5 +17,6 @@ word-spacing: normal; vertical-align: top; }+ /* YUI CSS Detection Stamp */ #yui3-css-stamp.cssgrids-base { display: none; }
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -150,5 +150,6 @@ .yui3-u-23-24 { width: 95.8333%; }+ /* YUI CSS Detection Stamp */ #yui3-css-stamp.cssgrids-units { display: none; }
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -163,5 +163,6 @@ .yui3-u-23-24 { width: 95.8333%; }+ /* YUI CSS Detection Stamp */ #yui3-css-stamp.cssgrids { display: none; }
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -122,5 +122,6 @@ .yui3-cssreset legend { color:#000; }+ /* YUI CSS Detection Stamp */ #yui3-css-stamp.cssreset-context { display: none; }
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -122,5 +122,6 @@ legend { color:#000; }+ /* YUI CSS Detection Stamp */ #yui3-css-stamp.cssreset { display: none; }
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -0,0 +1,255 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/dataschema-array/dataschema-array.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/dataschema-array/dataschema-array.js",+ code: []+};+_yuitest_coverage["build/dataschema-array/dataschema-array.js"].code=["YUI.add('dataschema-array', function (Y, NAME) {","","/**"," * Provides a DataSchema implementation which can be used to work with data"," * stored in arrays."," *"," * @module dataschema"," * @submodule dataschema-array"," */","","/**","Provides a DataSchema implementation which can be used to work with data","stored in arrays.","","See the `apply` method below for usage.","","@class DataSchema.Array","@extends DataSchema.Base","@static","**/","var LANG = Y.Lang,",""," SchemaArray = {",""," ////////////////////////////////////////////////////////////////////////"," //"," // DataSchema.Array static methods"," //"," ////////////////////////////////////////////////////////////////////////",""," /**"," Applies a schema to an array of data, returning a normalized object"," with results in the `results` property. The `meta` property of the"," response object is present for consistency, but is assigned an empty"," object. If the input data is absent or not an array, an `error`"," property will be added.",""," The input array is expected to contain objects, arrays, or strings.",""," If _schema_ is not specified or _schema.resultFields_ is not an array,"," `response.results` will be assigned the input array unchanged.",""," When a _schema_ is specified, the following will occur:",""," If the input array contains strings, they will be copied as-is into the"," `response.results` array.",""," If the input array contains arrays, `response.results` will contain an"," array of objects with key:value pairs assuming the fields in"," _schema.resultFields_ are ordered in accordance with the data array"," values.",""," If the input array contains objects, the identified"," _schema.resultFields_ will be used to extract a value from those"," objects for the output result.",""," _schema.resultFields_ field identifiers are objects with the following properties:",""," * `key` : <strong>(required)</strong> The locator name (String)"," * `parser`: A function or the name of a function on `Y.Parsers` used"," to convert the input value into a normalized type. Parser"," functions are passed the value as input and are expected to"," return a value.",""," If no value parsing is needed, you can use strings as identifiers"," instead of objects (see example below).",""," @example"," // Process array of arrays"," var schema = { resultFields: [ 'fruit', 'color' ] },"," data = ["," [ 'Banana', 'yellow' ],"," [ 'Orange', 'orange' ],"," [ 'Eggplant', 'purple' ]"," ];",""," var response = Y.DataSchema.Array.apply(schema, data);",""," // response.results[0] is { fruit: \"Banana\", color: \"yellow\" }",""," "," // Process array of objects"," data = ["," { fruit: 'Banana', color: 'yellow', price: '1.96' },"," { fruit: 'Orange', color: 'orange', price: '2.04' },"," { fruit: 'Eggplant', color: 'purple', price: '4.31' }"," ];",""," response = Y.DataSchema.Array.apply(schema, data);",""," // response.results[0] is { fruit: \"Banana\", color: \"yellow\" }","",""," // Use parsers"," schema.resultFields = ["," {"," key: 'fruit',"," parser: function (val) { return val.toUpperCase(); }"," },"," {"," key: 'price',"," parser: 'number' // Uses Y.Parsers.number"," }"," ];",""," response = Y.DataSchema.Array.apply(schema, data);",""," // Note price was converted from a numeric string to a number"," // response.results[0] looks like { fruit: \"BANANA\", price: 1.96 }"," "," @method apply"," @param {Object} [schema] Schema to apply. Supported configuration"," properties are:"," @param {Array} [schema.resultFields] Field identifiers to"," locate/assign values in the response records. See above for"," details."," @param {Array} data Array data."," @return {Object} An Object with properties `results` and `meta`"," @static"," **/"," apply: function(schema, data) {"," var data_in = data,"," data_out = {results:[],meta:{}};",""," if(LANG.isArray(data_in)) {"," if(schema && LANG.isArray(schema.resultFields)) {"," // Parse results data"," data_out = SchemaArray._parseResults.call(this, schema.resultFields, data_in, data_out);"," }"," else {"," data_out.results = data_in;"," }"," }"," else {"," data_out.error = new Error(\"Array schema parse failure\");"," }",""," return data_out;"," },",""," /**"," * Schema-parsed list of results from full data"," *"," * @method _parseResults"," * @param fields {Array} Schema to parse against."," * @param array_in {Array} Array to parse."," * @param data_out {Object} In-progress parsed data to update."," * @return {Object} Parsed data object."," * @static"," * @protected"," */"," _parseResults: function(fields, array_in, data_out) {"," var results = [],"," result, item, type, field, key, value, i, j;",""," for(i=array_in.length-1; i>-1; i--) {"," result = {};"," item = array_in[i];"," type = (LANG.isObject(item) && !LANG.isFunction(item)) ? 2 : (LANG.isArray(item)) ? 1 : (LANG.isString(item)) ? 0 : -1;"," if(type > 0) {"," for(j=fields.length-1; j>-1; j--) {"," field = fields[j];"," key = (!LANG.isUndefined(field.key)) ? field.key : field;"," value = (!LANG.isUndefined(item[key])) ? item[key] : item[j];"," result[key] = Y.DataSchema.Base.parse.call(this, value, field);"," }"," }"," else if(type === 0) {"," result = item;"," }"," else {"," //TODO: null or {}?"," result = null;"," }"," results[i] = result;"," }"," data_out.results = results;",""," return data_out;"," }"," };","","Y.DataSchema.Array = Y.mix(SchemaArray, Y.DataSchema.Base);","","","}, '3.7.1', {\"requires\": [\"dataschema-base\"]});"];+_yuitest_coverage["build/dataschema-array/dataschema-array.js"].lines = {"1":0,"21":0,"122":0,"125":0,"126":0,"128":0,"131":0,"135":0,"138":0,"153":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"163":0,"164":0,"165":0,"168":0,"169":0,"173":0,"175":0,"177":0,"179":0,"183":0};+_yuitest_coverage["build/dataschema-array/dataschema-array.js"].functions = {"apply:121":0,"_parseResults:152":0,"(anonymous 1):1":0};+_yuitest_coverage["build/dataschema-array/dataschema-array.js"].coveredLines = 27;+_yuitest_coverage["build/dataschema-array/dataschema-array.js"].coveredFunctions = 3;+_yuitest_coverline("build/dataschema-array/dataschema-array.js", 1);+YUI.add('dataschema-array', function (Y, NAME) {++/**+ * Provides a DataSchema implementation which can be used to work with data+ * stored in arrays.+ *+ * @module dataschema+ * @submodule dataschema-array+ */++/**+Provides a DataSchema implementation which can be used to work with data+stored in arrays.++See the `apply` method below for usage.++@class DataSchema.Array+@extends DataSchema.Base+@static+**/+_yuitest_coverfunc("build/dataschema-array/dataschema-array.js", "(anonymous 1)", 1);+_yuitest_coverline("build/dataschema-array/dataschema-array.js", 21);+var LANG = Y.Lang,++ SchemaArray = {++ ////////////////////////////////////////////////////////////////////////+ //+ // DataSchema.Array static methods+ //+ ////////////////////////////////////////////////////////////////////////++ /**+ Applies a schema to an array of data, returning a normalized object+ with results in the `results` property. The `meta` property of the+ response object is present for consistency, but is assigned an empty+ object. If the input data is absent or not an array, an `error`+ property will be added.++ The input array is expected to contain objects, arrays, or strings.++ If _schema_ is not specified or _schema.resultFields_ is not an array,+ `response.results` will be assigned the input array unchanged.++ When a _schema_ is specified, the following will occur:++ If the input array contains strings, they will be copied as-is into the+ `response.results` array.++ If the input array contains arrays, `response.results` will contain an+ array of objects with key:value pairs assuming the fields in+ _schema.resultFields_ are ordered in accordance with the data array+ values.++ If the input array contains objects, the identified+ _schema.resultFields_ will be used to extract a value from those+ objects for the output result.++ _schema.resultFields_ field identifiers are objects with the following properties:++ * `key` : <strong>(required)</strong> The locator name (String)+ * `parser`: A function or the name of a function on `Y.Parsers` used+ to convert the input value into a normalized type. Parser+ functions are passed the value as input and are expected to+ return a value.++ If no value parsing is needed, you can use strings as identifiers+ instead of objects (see example below).++ @example+ // Process array of arrays+ var schema = { resultFields: [ 'fruit', 'color' ] },+ data = [+ [ 'Banana', 'yellow' ],+ [ 'Orange', 'orange' ],+ [ 'Eggplant', 'purple' ]+ ];++ var response = Y.DataSchema.Array.apply(schema, data);++ // response.results[0] is { fruit: "Banana", color: "yellow" }++ + // Process array of objects+ data = [+ { fruit: 'Banana', color: 'yellow', price: '1.96' },+ { fruit: 'Orange', color: 'orange', price: '2.04' },+ { fruit: 'Eggplant', color: 'purple', price: '4.31' }+ ];++ response = Y.DataSchema.Array.apply(schema, data);++ // response.results[0] is { fruit: "Banana", color: "yellow" }+++ // Use parsers+ schema.resultFields = [+ {+ key: 'fruit',+ parser: function (val) { return val.toUpperCase(); }+ },+ {+ key: 'price',+ parser: 'number' // Uses Y.Parsers.number+ }+ ];++ response = Y.DataSchema.Array.apply(schema, data);++ // Note price was converted from a numeric string to a number+ // response.results[0] looks like { fruit: "BANANA", price: 1.96 }+ + @method apply+ @param {Object} [schema] Schema to apply. Supported configuration+ properties are:+ @param {Array} [schema.resultFields] Field identifiers to+ locate/assign values in the response records. See above for+ details.+ @param {Array} data Array data.+ @return {Object} An Object with properties `results` and `meta`+ @static+ **/+ apply: function(schema, data) {+ _yuitest_coverfunc("build/dataschema-array/dataschema-array.js", "apply", 121);+_yuitest_coverline("build/dataschema-array/dataschema-array.js", 122);+var data_in = data,+ data_out = {results:[],meta:{}};++ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 125);+if(LANG.isArray(data_in)) {+ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 126);+if(schema && LANG.isArray(schema.resultFields)) {+ // Parse results data+ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 128);+data_out = SchemaArray._parseResults.call(this, schema.resultFields, data_in, data_out);+ }+ else {+ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 131);+data_out.results = data_in;+ }+ }+ else {+ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 135);+data_out.error = new Error("Array schema parse failure");+ }++ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 138);+return data_out;+ },++ /**+ * Schema-parsed list of results from full data+ *+ * @method _parseResults+ * @param fields {Array} Schema to parse against.+ * @param array_in {Array} Array to parse.+ * @param data_out {Object} In-progress parsed data to update.+ * @return {Object} Parsed data object.+ * @static+ * @protected+ */+ _parseResults: function(fields, array_in, data_out) {+ _yuitest_coverfunc("build/dataschema-array/dataschema-array.js", "_parseResults", 152);+_yuitest_coverline("build/dataschema-array/dataschema-array.js", 153);+var results = [],+ result, item, type, field, key, value, i, j;++ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 156);+for(i=array_in.length-1; i>-1; i--) {+ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 157);+result = {};+ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 158);+item = array_in[i];+ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 159);+type = (LANG.isObject(item) && !LANG.isFunction(item)) ? 2 : (LANG.isArray(item)) ? 1 : (LANG.isString(item)) ? 0 : -1;+ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 160);+if(type > 0) {+ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 161);+for(j=fields.length-1; j>-1; j--) {+ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 162);+field = fields[j];+ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 163);+key = (!LANG.isUndefined(field.key)) ? field.key : field;+ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 164);+value = (!LANG.isUndefined(item[key])) ? item[key] : item[j];+ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 165);+result[key] = Y.DataSchema.Base.parse.call(this, value, field);+ }+ }+ else {_yuitest_coverline("build/dataschema-array/dataschema-array.js", 168);+if(type === 0) {+ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 169);+result = item;+ }+ else {+ //TODO: null or {}?+ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 173);+result = null;+ }}+ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 175);+results[i] = result;+ }+ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 177);+data_out.results = results;++ _yuitest_coverline("build/dataschema-array/dataschema-array.js", 179);+return data_out;+ }+ };++_yuitest_coverline("build/dataschema-array/dataschema-array.js", 183);+Y.DataSchema.Array = Y.mix(SchemaArray, Y.DataSchema.Base);+++}, '3.7.1', {"requires": ["dataschema-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('dataschema-array', function(Y) {+YUI.add('dataschema-array', function (Y, NAME) { /** * Provides a DataSchema implementation which can be used to work with data@@ -192,4 +192,4 @@ Y.DataSchema.Array = Y.mix(SchemaArray, Y.DataSchema.Base); -}, '3.5.1' ,{requires:['dataschema-base']});+}, '3.7.1', {"requires": ["dataschema-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dataschema-array",function(c){var a=c.Lang,b={apply:function(f,g){var d=g,e={results:[],meta:{}};if(a.isArray(d)){if(f&&a.isArray(f.resultFields)){e=b._parseResults.call(this,f.resultFields,d,e);}else{e.results=d;}}else{e.error=new Error("Array schema parse failure");}return e;},_parseResults:function(h,m,d){var g=[],q,p,k,l,o,n,f,e;for(f=m.length-1;f>-1;f--){q={};p=m[f];k=(a.isObject(p)&&!a.isFunction(p))?2:(a.isArray(p))?1:(a.isString(p))?0:-1;if(k>0){for(e=h.length-1;e>-1;e--){l=h[e];o=(!a.isUndefined(l.key))?l.key:l;n=(!a.isUndefined(p[o]))?p[o]:p[e];q[o]=c.DataSchema.Base.parse.call(this,n,l);}}else{if(k===0){q=p;}else{q=null;}}g[f]=q;}d.results=g;return d;}};c.DataSchema.Array=c.mix(b,c.DataSchema.Base);},"3.5.1",{requires:["dataschema-base"]});+YUI.add("dataschema-array",function(e,t){var n=e.Lang,r={apply:function(e,t){var i=t,s={results:[],meta:{}};return n.isArray(i)?e&&n.isArray(e.resultFields)?s=r._parseResults.call(this,e.resultFields,i,s):s.results=i:s.error=new Error("Array schema parse failure"),s},_parseResults:function(t,r,i){var s=[],o,u,a,f,l,c,h,p;for(h=r.length-1;h>-1;h--){o={},u=r[h],a=n.isObject(u)&&!n.isFunction(u)?2:n.isArray(u)?1:n.isString(u)?0:-1;if(a>0)for(p=t.length-1;p>-1;p--)f=t[p],l=n.isUndefined(f.key)?f:f.key,c=n.isUndefined(u[l])?u[p]:u[l],o[l]=e.DataSchema.Base.parse.call(this,c,f);else a===0?o=u:o=null;s[h]=o}return i.results=s,i}};e.DataSchema.Array=e.mix(r,e.DataSchema.Base)},"3.7.1",{requires:["dataschema-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('dataschema-array', function(Y) {+YUI.add('dataschema-array', function (Y, NAME) { /** * Provides a DataSchema implementation which can be used to work with data@@ -189,4 +189,4 @@ Y.DataSchema.Array = Y.mix(SchemaArray, Y.DataSchema.Base); -}, '3.5.1' ,{requires:['dataschema-base']});+}, '3.7.1', {"requires": ["dataschema-base"]});
@@ -0,0 +1,118 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/dataschema-base/dataschema-base.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/dataschema-base/dataschema-base.js",+ code: []+};+_yuitest_coverage["build/dataschema-base/dataschema-base.js"].code=["YUI.add('dataschema-base', function (Y, NAME) {","","/**"," * The DataSchema utility provides a common configurable interface for widgets to"," * apply a given schema to a variety of data."," *"," * @module dataschema"," * @main dataschema"," */","","/**"," * Provides the base DataSchema implementation, which can be extended to "," * create DataSchemas for specific data formats, such XML, JSON, text and"," * arrays."," *"," * @module dataschema"," * @submodule dataschema-base"," */","","var LANG = Y.Lang,","/**"," * Base class for the YUI DataSchema Utility."," * @class DataSchema.Base"," * @static"," */"," SchemaBase = {"," /**"," * Overridable method returns data as-is."," *"," * @method apply"," * @param schema {Object} Schema to apply."," * @param data {Object} Data."," * @return {Object} Schema-parsed data."," * @static"," */"," apply: function(schema, data) {"," return data;"," },"," "," /**"," * Applies field parser, if defined"," *"," * @method parse"," * @param value {Object} Original value."," * @param field {Object} Field."," * @return {Object} Type-converted value."," */"," parse: function(value, field) {"," if(field.parser) {"," var parser = (LANG.isFunction(field.parser)) ?"," field.parser : Y.Parsers[field.parser+''];"," if(parser) {"," value = parser.call(this, value);"," }"," else {"," }"," }"," return value;"," }","};","","Y.namespace(\"DataSchema\").Base = SchemaBase;","Y.namespace(\"Parsers\");","","","}, '3.7.1', {\"requires\": [\"base\"]});"];+_yuitest_coverage["build/dataschema-base/dataschema-base.js"].lines = {"1":0,"20":0,"37":0,"49":0,"50":0,"52":0,"53":0,"58":0,"62":0,"63":0};+_yuitest_coverage["build/dataschema-base/dataschema-base.js"].functions = {"apply:36":0,"parse:48":0,"(anonymous 1):1":0};+_yuitest_coverage["build/dataschema-base/dataschema-base.js"].coveredLines = 10;+_yuitest_coverage["build/dataschema-base/dataschema-base.js"].coveredFunctions = 3;+_yuitest_coverline("build/dataschema-base/dataschema-base.js", 1);+YUI.add('dataschema-base', function (Y, NAME) {++/**+ * The DataSchema utility provides a common configurable interface for widgets to+ * apply a given schema to a variety of data.+ *+ * @module dataschema+ * @main dataschema+ */++/**+ * Provides the base DataSchema implementation, which can be extended to + * create DataSchemas for specific data formats, such XML, JSON, text and+ * arrays.+ *+ * @module dataschema+ * @submodule dataschema-base+ */++_yuitest_coverfunc("build/dataschema-base/dataschema-base.js", "(anonymous 1)", 1);+_yuitest_coverline("build/dataschema-base/dataschema-base.js", 20);+var LANG = Y.Lang,+/**+ * Base class for the YUI DataSchema Utility.+ * @class DataSchema.Base+ * @static+ */+ SchemaBase = {+ /**+ * Overridable method returns data as-is.+ *+ * @method apply+ * @param schema {Object} Schema to apply.+ * @param data {Object} Data.+ * @return {Object} Schema-parsed data.+ * @static+ */+ apply: function(schema, data) {+ _yuitest_coverfunc("build/dataschema-base/dataschema-base.js", "apply", 36);+_yuitest_coverline("build/dataschema-base/dataschema-base.js", 37);+return data;+ },+ + /**+ * Applies field parser, if defined+ *+ * @method parse+ * @param value {Object} Original value.+ * @param field {Object} Field.+ * @return {Object} Type-converted value.+ */+ parse: function(value, field) {+ _yuitest_coverfunc("build/dataschema-base/dataschema-base.js", "parse", 48);+_yuitest_coverline("build/dataschema-base/dataschema-base.js", 49);+if(field.parser) {+ _yuitest_coverline("build/dataschema-base/dataschema-base.js", 50);+var parser = (LANG.isFunction(field.parser)) ?+ field.parser : Y.Parsers[field.parser+''];+ _yuitest_coverline("build/dataschema-base/dataschema-base.js", 52);+if(parser) {+ _yuitest_coverline("build/dataschema-base/dataschema-base.js", 53);+value = parser.call(this, value);+ }+ else {+ }+ }+ _yuitest_coverline("build/dataschema-base/dataschema-base.js", 58);+return value;+ }+};++_yuitest_coverline("build/dataschema-base/dataschema-base.js", 62);+Y.namespace("DataSchema").Base = SchemaBase;+_yuitest_coverline("build/dataschema-base/dataschema-base.js", 63);+Y.namespace("Parsers");+++}, '3.7.1', {"requires": ["base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('dataschema-base', function(Y) {+YUI.add('dataschema-base', function (Y, NAME) { /** * The DataSchema utility provides a common configurable interface for widgets to@@ -70,4 +70,4 @@ Y.namespace("Parsers"); -}, '3.5.1' ,{requires:['base']});+}, '3.7.1', {"requires": ["base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dataschema-base",function(b){var a=b.Lang,c={apply:function(d,e){return e;},parse:function(d,e){if(e.parser){var f=(a.isFunction(e.parser))?e.parser:b.Parsers[e.parser+""];if(f){d=f.call(this,d);}else{}}return d;}};b.namespace("DataSchema").Base=c;b.namespace("Parsers");},"3.5.1",{requires:["base"]});+YUI.add("dataschema-base",function(e,t){var n=e.Lang,r={apply:function(e,t){return t},parse:function(t,r){if(r.parser){var i=n.isFunction(r.parser)?r.parser:e.Parsers[r.parser+""];i&&(t=i.call(this,t))}return t}};e.namespace("DataSchema").Base=r,e.namespace("Parsers")},"3.7.1",{requires:["base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('dataschema-base', function(Y) {+YUI.add('dataschema-base', function (Y, NAME) { /** * The DataSchema utility provides a common configurable interface for widgets to@@ -69,4 +69,4 @@ Y.namespace("Parsers"); -}, '3.5.1' ,{requires:['base']});+}, '3.7.1', {"requires": ["base"]});
@@ -0,0 +1,576 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/dataschema-json/dataschema-json.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/dataschema-json/dataschema-json.js",+ code: []+};+_yuitest_coverage["build/dataschema-json/dataschema-json.js"].code=["YUI.add('dataschema-json', function (Y, NAME) {","","/**","Provides a DataSchema implementation which can be used to work with JSON data.","","@module dataschema","@submodule dataschema-json","**/","","/**","Provides a DataSchema implementation which can be used to work with JSON data.","","See the `apply` method for usage.","","@class DataSchema.JSON","@extends DataSchema.Base","@static","**/","var LANG = Y.Lang,"," isFunction = LANG.isFunction,"," isObject = LANG.isObject,"," isArray = LANG.isArray,"," // TODO: I don't think the calls to Base.* need to be done via Base since"," // Base is mixed into SchemaJSON. Investigate for later."," Base = Y.DataSchema.Base,",""," SchemaJSON;"," ","SchemaJSON = {","","/////////////////////////////////////////////////////////////////////////////","//","// DataSchema.JSON static methods","//","/////////////////////////////////////////////////////////////////////////////"," /**"," * Utility function converts JSON locator strings into walkable paths"," *"," * @method getPath"," * @param locator {String} JSON value locator."," * @return {String[]} Walkable path to data value."," * @static"," */"," getPath: function(locator) {"," var path = null,"," keys = [],"," i = 0;",""," if (locator) {"," // Strip the [\"string keys\"] and [1] array indexes"," // TODO: the first two steps can probably be reduced to one with"," // /\\[\\s*(['\"])?(.*?)\\1\\s*\\]/g, but the array indices would be"," // stored as strings. This is not likely an issue."," locator = locator."," replace(/\\[\\s*(['\"])(.*?)\\1\\s*\\]/g,"," function (x,$1,$2) {keys[i]=$2;return '.@'+(i++);})."," replace(/\\[(\\d+)\\]/g,"," function (x,$1) {keys[i]=parseInt($1,10)|0;return '.@'+(i++);})."," replace(/^\\./,''); // remove leading dot",""," // Validate against problematic characters."," // commented out because the path isn't sent to eval, so it"," // should be safe. I'm not sure what makes a locator invalid."," //if (!/[^\\w\\.\\$@]/.test(locator)) {"," path = locator.split('.');"," for (i=path.length-1; i >= 0; --i) {"," if (path[i].charAt(0) === '@') {"," path[i] = keys[parseInt(path[i].substr(1),10)];"," }"," }"," /*}"," else {"," }"," */"," }"," return path;"," },",""," /**"," * Utility function to walk a path and return the value located there."," *"," * @method getLocationValue"," * @param path {String[]} Locator path."," * @param data {String} Data to traverse."," * @return {Object} Data value at location."," * @static"," */"," getLocationValue: function (path, data) {"," var i = 0,"," len = path.length;"," for (;i<len;i++) {"," if (isObject(data) && (path[i] in data)) {"," data = data[path[i]];"," } else {"," data = undefined;"," break;"," }"," }"," return data;"," },",""," /**"," Applies a schema to an array of data located in a JSON structure, returning"," a normalized object with results in the `results` property. Additional"," information can be parsed out of the JSON for inclusion in the `meta`"," property of the response object. If an error is encountered during"," processing, an `error` property will be added.",""," The input _data_ is expected to be an object or array. If it is a string,"," it will be passed through `Y.JSON.parse()`.",""," If _data_ contains an array of data records to normalize, specify the"," _schema.resultListLocator_ as a dot separated path string just as you would"," reference it in JavaScript. So if your _data_ object has a record array at"," _data.response.results_, use _schema.resultListLocator_ ="," \"response.results\". Bracket notation can also be used for array indices or"," object properties (e.g. \"response['results']\"); This is called a \"path"," locator\"",""," Field data in the result list is extracted with field identifiers in"," _schema.resultFields_. Field identifiers are objects with the following"," properties:",""," * `key` : <strong>(required)</strong> The path locator (String)"," * `parser`: A function or the name of a function on `Y.Parsers` used"," to convert the input value into a normalized type. Parser"," functions are passed the value as input and are expected to"," return a value.",""," If no value parsing is needed, you can use path locators (strings) "," instead of field identifiers (objects) -- see example below.",""," If no processing of the result list array is needed, _schema.resultFields_"," can be omitted; the `response.results` will point directly to the array.",""," If the result list contains arrays, `response.results` will contain an"," array of objects with key:value pairs assuming the fields in"," _schema.resultFields_ are ordered in accordance with the data array"," values.",""," If the result list contains objects, the identified _schema.resultFields_"," will be used to extract a value from those objects for the output result.",""," To extract additional information from the JSON, include an array of"," path locators in _schema.metaFields_. The collected values will be"," stored in `response.meta`.","",""," @example"," // Process array of arrays"," var schema = {"," resultListLocator: 'produce.fruit',"," resultFields: [ 'name', 'color' ]"," },"," data = {"," produce: {"," fruit: ["," [ 'Banana', 'yellow' ],"," [ 'Orange', 'orange' ],"," [ 'Eggplant', 'purple' ]"," ]"," }"," };",""," var response = Y.DataSchema.JSON.apply(schema, data);",""," // response.results[0] is { name: \"Banana\", color: \"yellow\" }",""," "," // Process array of objects + some metadata"," schema.metaFields = [ 'lastInventory' ];",""," data = {"," produce: {"," fruit: ["," { name: 'Banana', color: 'yellow', price: '1.96' },"," { name: 'Orange', color: 'orange', price: '2.04' },"," { name: 'Eggplant', color: 'purple', price: '4.31' }"," ]"," },"," lastInventory: '2011-07-19'"," };",""," response = Y.DataSchema.JSON.apply(schema, data);",""," // response.results[0] is { name: \"Banana\", color: \"yellow\" }"," // response.meta.lastInventory is '2001-07-19'","",""," // Use parsers"," schema.resultFields = ["," {"," key: 'name',"," parser: function (val) { return val.toUpperCase(); }"," },"," {"," key: 'price',"," parser: 'number' // Uses Y.Parsers.number"," }"," ];",""," response = Y.DataSchema.JSON.apply(schema, data);",""," // Note price was converted from a numeric string to a number"," // response.results[0] looks like { fruit: \"BANANA\", price: 1.96 }"," "," @method apply"," @param {Object} [schema] Schema to apply. Supported configuration"," properties are:"," @param {String} [schema.resultListLocator] Path locator for the"," location of the array of records to flatten into `response.results`"," @param {Array} [schema.resultFields] Field identifiers to"," locate/assign values in the response records. See above for"," details."," @param {Array} [schema.metaFields] Path locators to extract extra"," non-record related information from the data object."," @param {Object|Array|String} data JSON data or its string serialization."," @return {Object} An Object with properties `results` and `meta`"," @static"," **/"," apply: function(schema, data) {"," var data_in = data,"," data_out = { results: [], meta: {} };",""," // Convert incoming JSON strings"," if (!isObject(data)) {"," try {"," data_in = Y.JSON.parse(data);"," }"," catch(e) {"," data_out.error = e;"," return data_out;"," }"," }",""," if (isObject(data_in) && schema) {"," // Parse results data"," data_out = SchemaJSON._parseResults.call(this, schema, data_in, data_out);",""," // Parse meta data"," if (schema.metaFields !== undefined) {"," data_out = SchemaJSON._parseMeta(schema.metaFields, data_in, data_out);"," }"," }"," else {"," data_out.error = new Error(\"JSON schema parse failure\");"," }",""," return data_out;"," },",""," /**"," * Schema-parsed list of results from full data"," *"," * @method _parseResults"," * @param schema {Object} Schema to parse against."," * @param json_in {Object} JSON to parse."," * @param data_out {Object} In-progress parsed data to update."," * @return {Object} Parsed data object."," * @static"," * @protected"," */"," _parseResults: function(schema, json_in, data_out) {"," var getPath = SchemaJSON.getPath,"," getValue = SchemaJSON.getLocationValue,"," path = getPath(schema.resultListLocator),"," results = path ?"," (getValue(path, json_in) ||"," // Fall back to treat resultListLocator as a simple key"," json_in[schema.resultListLocator]) :"," // Or if no resultListLocator is supplied, use the input"," json_in;",""," if (isArray(results)) {"," // if no result fields are passed in, then just take"," // the results array whole-hog Sometimes you're getting"," // an array of strings, or want the whole object, so"," // resultFields don't make sense."," if (isArray(schema.resultFields)) {"," data_out = SchemaJSON._getFieldValues.call(this, schema.resultFields, results, data_out);"," } else {"," data_out.results = results;"," }"," } else if (schema.resultListLocator) {"," data_out.results = [];"," data_out.error = new Error(\"JSON results retrieval failure\");"," }",""," return data_out;"," },",""," /**"," * Get field data values out of list of full results"," *"," * @method _getFieldValues"," * @param fields {Array} Fields to find."," * @param array_in {Array} Results to parse."," * @param data_out {Object} In-progress parsed data to update."," * @return {Object} Parsed data object."," * @static"," * @protected"," */"," _getFieldValues: function(fields, array_in, data_out) {"," var results = [],"," len = fields.length,"," i, j,"," field, key, locator, path, parser, val,"," simplePaths = [], complexPaths = [], fieldParsers = [],"," result, record;",""," // First collect hashes of simple paths, complex paths, and parsers"," for (i=0; i<len; i++) {"," field = fields[i]; // A field can be a simple string or a hash"," key = field.key || field; // Find the key"," locator = field.locator || key; // Find the locator",""," // Validate and store locators for later"," path = SchemaJSON.getPath(locator);"," if (path) {"," if (path.length === 1) {"," simplePaths.push({"," key : key,"," path: path[0]"," });"," } else {"," complexPaths.push({"," key : key,"," path : path,"," locator: locator"," });"," }"," } else {"," }",""," // Validate and store parsers for later"," //TODO: use Y.DataSchema.parse?"," parser = (isFunction(field.parser)) ?"," field.parser :"," Y.Parsers[field.parser + ''];",""," if (parser) {"," fieldParsers.push({"," key : key,"," parser: parser"," });"," }"," }",""," // Traverse list of array_in, creating records of simple fields,"," // complex fields, and applying parsers as necessary"," for (i=array_in.length-1; i>=0; --i) {"," record = {};"," result = array_in[i];"," if(result) {"," // Cycle through complexLocators"," for (j=complexPaths.length - 1; j>=0; --j) {"," path = complexPaths[j];"," val = SchemaJSON.getLocationValue(path.path, result);"," if (val === undefined) {"," val = SchemaJSON.getLocationValue([path.locator], result);"," // Fail over keys like \"foo.bar\" from nested parsing"," // to single token parsing if a value is found in"," // results[\"foo.bar\"]"," if (val !== undefined) {"," simplePaths.push({"," key: path.key,"," path: path.locator"," });"," // Don't try to process the path as complex"," // for further results"," complexPaths.splice(i,1);"," continue;"," }"," }",""," record[path.key] = Base.parse.call(this,"," (SchemaJSON.getLocationValue(path.path, result)), path);"," }",""," // Cycle through simpleLocators"," for (j = simplePaths.length - 1; j >= 0; --j) {"," path = simplePaths[j];"," // Bug 1777850: The result might be an array instead of object"," record[path.key] = Base.parse.call(this,"," ((result[path.path] === undefined) ?"," result[j] : result[path.path]), path);"," }",""," // Cycle through fieldParsers"," for (j=fieldParsers.length-1; j>=0; --j) {"," key = fieldParsers[j].key;"," record[key] = fieldParsers[j].parser.call(this, record[key]);"," // Safety net"," if (record[key] === undefined) {"," record[key] = null;"," }"," }"," results[i] = record;"," }"," }"," data_out.results = results;"," return data_out;"," },",""," /**"," * Parses results data according to schema"," *"," * @method _parseMeta"," * @param metaFields {Object} Metafields definitions."," * @param json_in {Object} JSON to parse."," * @param data_out {Object} In-progress parsed data to update."," * @return {Object} Schema-parsed meta data."," * @static"," * @protected"," */"," _parseMeta: function(metaFields, json_in, data_out) {"," if (isObject(metaFields)) {"," var key, path;"," for(key in metaFields) {"," if (metaFields.hasOwnProperty(key)) {"," path = SchemaJSON.getPath(metaFields[key]);"," if (path && json_in) {"," data_out.meta[key] = SchemaJSON.getLocationValue(path, json_in);"," }"," }"," }"," }"," else {"," data_out.error = new Error(\"JSON meta data retrieval failure\");"," }"," return data_out;"," }","};","","// TODO: Y.Object + mix() might be better here","Y.DataSchema.JSON = Y.mix(SchemaJSON, Base);","","","}, '3.7.1', {\"requires\": [\"dataschema-base\", \"json\"]});"];+_yuitest_coverage["build/dataschema-json/dataschema-json.js"].lines = {"1":0,"19":0,"29":0,"45":0,"49":0,"54":0,"56":0,"58":0,"65":0,"66":0,"67":0,"68":0,"76":0,"89":0,"91":0,"92":0,"93":0,"95":0,"96":0,"99":0,"222":0,"226":0,"227":0,"228":0,"231":0,"232":0,"236":0,"238":0,"241":0,"242":0,"246":0,"249":0,"264":0,"274":0,"279":0,"280":0,"282":0,"284":0,"285":0,"286":0,"289":0,"304":0,"312":0,"313":0,"314":0,"315":0,"318":0,"319":0,"320":0,"321":0,"326":0,"337":0,"341":0,"342":0,"351":0,"352":0,"353":0,"354":0,"356":0,"357":0,"358":0,"359":0,"360":0,"364":0,"365":0,"371":0,"372":0,"376":0,"381":0,"382":0,"384":0,"390":0,"391":0,"392":0,"394":0,"395":0,"398":0,"401":0,"402":0,"417":0,"418":0,"419":0,"420":0,"421":0,"422":0,"423":0,"429":0,"431":0,"436":0};+_yuitest_coverage["build/dataschema-json/dataschema-json.js"].functions = {"(anonymous 2):56":0,"(anonymous 3):58":0,"getPath:44":0,"getLocationValue:88":0,"apply:221":0,"_parseResults:263":0,"_getFieldValues:303":0,"_parseMeta:416":0,"(anonymous 1):1":0};+_yuitest_coverage["build/dataschema-json/dataschema-json.js"].coveredLines = 89;+_yuitest_coverage["build/dataschema-json/dataschema-json.js"].coveredFunctions = 9;+_yuitest_coverline("build/dataschema-json/dataschema-json.js", 1);+YUI.add('dataschema-json', function (Y, NAME) {++/**+Provides a DataSchema implementation which can be used to work with JSON data.++@module dataschema+@submodule dataschema-json+**/++/**+Provides a DataSchema implementation which can be used to work with JSON data.++See the `apply` method for usage.++@class DataSchema.JSON+@extends DataSchema.Base+@static+**/+_yuitest_coverfunc("build/dataschema-json/dataschema-json.js", "(anonymous 1)", 1);+_yuitest_coverline("build/dataschema-json/dataschema-json.js", 19);+var LANG = Y.Lang,+ isFunction = LANG.isFunction,+ isObject = LANG.isObject,+ isArray = LANG.isArray,+ // TODO: I don't think the calls to Base.* need to be done via Base since+ // Base is mixed into SchemaJSON. Investigate for later.+ Base = Y.DataSchema.Base,++ SchemaJSON;+ +_yuitest_coverline("build/dataschema-json/dataschema-json.js", 29);+SchemaJSON = {++/////////////////////////////////////////////////////////////////////////////+//+// DataSchema.JSON static methods+//+/////////////////////////////////////////////////////////////////////////////+ /**+ * Utility function converts JSON locator strings into walkable paths+ *+ * @method getPath+ * @param locator {String} JSON value locator.+ * @return {String[]} Walkable path to data value.+ * @static+ */+ getPath: function(locator) {+ _yuitest_coverfunc("build/dataschema-json/dataschema-json.js", "getPath", 44);+_yuitest_coverline("build/dataschema-json/dataschema-json.js", 45);+var path = null,+ keys = [],+ i = 0;++ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 49);+if (locator) {+ // Strip the ["string keys"] and [1] array indexes+ // TODO: the first two steps can probably be reduced to one with+ // /\[\s*(['"])?(.*?)\1\s*\]/g, but the array indices would be+ // stored as strings. This is not likely an issue.+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 54);+locator = locator.+ replace(/\[\s*(['"])(.*?)\1\s*\]/g,+ function (x,$1,$2) {_yuitest_coverfunc("build/dataschema-json/dataschema-json.js", "(anonymous 2)", 56);+_yuitest_coverline("build/dataschema-json/dataschema-json.js", 56);+keys[i]=$2;return '.@'+(i++);}).+ replace(/\[(\d+)\]/g,+ function (x,$1) {_yuitest_coverfunc("build/dataschema-json/dataschema-json.js", "(anonymous 3)", 58);+_yuitest_coverline("build/dataschema-json/dataschema-json.js", 58);+keys[i]=parseInt($1,10)|0;return '.@'+(i++);}).+ replace(/^\./,''); // remove leading dot++ // Validate against problematic characters.+ // commented out because the path isn't sent to eval, so it+ // should be safe. I'm not sure what makes a locator invalid.+ //if (!/[^\w\.\$@]/.test(locator)) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 65);+path = locator.split('.');+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 66);+for (i=path.length-1; i >= 0; --i) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 67);+if (path[i].charAt(0) === '@') {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 68);+path[i] = keys[parseInt(path[i].substr(1),10)];+ }+ }+ /*}+ else {+ }+ */+ }+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 76);+return path;+ },++ /**+ * Utility function to walk a path and return the value located there.+ *+ * @method getLocationValue+ * @param path {String[]} Locator path.+ * @param data {String} Data to traverse.+ * @return {Object} Data value at location.+ * @static+ */+ getLocationValue: function (path, data) {+ _yuitest_coverfunc("build/dataschema-json/dataschema-json.js", "getLocationValue", 88);+_yuitest_coverline("build/dataschema-json/dataschema-json.js", 89);+var i = 0,+ len = path.length;+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 91);+for (;i<len;i++) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 92);+if (isObject(data) && (path[i] in data)) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 93);+data = data[path[i]];+ } else {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 95);+data = undefined;+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 96);+break;+ }+ }+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 99);+return data;+ },++ /**+ Applies a schema to an array of data located in a JSON structure, returning+ a normalized object with results in the `results` property. Additional+ information can be parsed out of the JSON for inclusion in the `meta`+ property of the response object. If an error is encountered during+ processing, an `error` property will be added.++ The input _data_ is expected to be an object or array. If it is a string,+ it will be passed through `Y.JSON.parse()`.++ If _data_ contains an array of data records to normalize, specify the+ _schema.resultListLocator_ as a dot separated path string just as you would+ reference it in JavaScript. So if your _data_ object has a record array at+ _data.response.results_, use _schema.resultListLocator_ =+ "response.results". Bracket notation can also be used for array indices or+ object properties (e.g. "response['results']"); This is called a "path+ locator"++ Field data in the result list is extracted with field identifiers in+ _schema.resultFields_. Field identifiers are objects with the following+ properties:++ * `key` : <strong>(required)</strong> The path locator (String)+ * `parser`: A function or the name of a function on `Y.Parsers` used+ to convert the input value into a normalized type. Parser+ functions are passed the value as input and are expected to+ return a value.++ If no value parsing is needed, you can use path locators (strings) + instead of field identifiers (objects) -- see example below.++ If no processing of the result list array is needed, _schema.resultFields_+ can be omitted; the `response.results` will point directly to the array.++ If the result list contains arrays, `response.results` will contain an+ array of objects with key:value pairs assuming the fields in+ _schema.resultFields_ are ordered in accordance with the data array+ values.++ If the result list contains objects, the identified _schema.resultFields_+ will be used to extract a value from those objects for the output result.++ To extract additional information from the JSON, include an array of+ path locators in _schema.metaFields_. The collected values will be+ stored in `response.meta`.+++ @example+ // Process array of arrays+ var schema = {+ resultListLocator: 'produce.fruit',+ resultFields: [ 'name', 'color' ]+ },+ data = {+ produce: {+ fruit: [+ [ 'Banana', 'yellow' ],+ [ 'Orange', 'orange' ],+ [ 'Eggplant', 'purple' ]+ ]+ }+ };++ var response = Y.DataSchema.JSON.apply(schema, data);++ // response.results[0] is { name: "Banana", color: "yellow" }++ + // Process array of objects + some metadata+ schema.metaFields = [ 'lastInventory' ];++ data = {+ produce: {+ fruit: [+ { name: 'Banana', color: 'yellow', price: '1.96' },+ { name: 'Orange', color: 'orange', price: '2.04' },+ { name: 'Eggplant', color: 'purple', price: '4.31' }+ ]+ },+ lastInventory: '2011-07-19'+ };++ response = Y.DataSchema.JSON.apply(schema, data);++ // response.results[0] is { name: "Banana", color: "yellow" }+ // response.meta.lastInventory is '2001-07-19'+++ // Use parsers+ schema.resultFields = [+ {+ key: 'name',+ parser: function (val) { return val.toUpperCase(); }+ },+ {+ key: 'price',+ parser: 'number' // Uses Y.Parsers.number+ }+ ];++ response = Y.DataSchema.JSON.apply(schema, data);++ // Note price was converted from a numeric string to a number+ // response.results[0] looks like { fruit: "BANANA", price: 1.96 }+ + @method apply+ @param {Object} [schema] Schema to apply. Supported configuration+ properties are:+ @param {String} [schema.resultListLocator] Path locator for the+ location of the array of records to flatten into `response.results`+ @param {Array} [schema.resultFields] Field identifiers to+ locate/assign values in the response records. See above for+ details.+ @param {Array} [schema.metaFields] Path locators to extract extra+ non-record related information from the data object.+ @param {Object|Array|String} data JSON data or its string serialization.+ @return {Object} An Object with properties `results` and `meta`+ @static+ **/+ apply: function(schema, data) {+ _yuitest_coverfunc("build/dataschema-json/dataschema-json.js", "apply", 221);+_yuitest_coverline("build/dataschema-json/dataschema-json.js", 222);+var data_in = data,+ data_out = { results: [], meta: {} };++ // Convert incoming JSON strings+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 226);+if (!isObject(data)) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 227);+try {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 228);+data_in = Y.JSON.parse(data);+ }+ catch(e) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 231);+data_out.error = e;+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 232);+return data_out;+ }+ }++ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 236);+if (isObject(data_in) && schema) {+ // Parse results data+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 238);+data_out = SchemaJSON._parseResults.call(this, schema, data_in, data_out);++ // Parse meta data+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 241);+if (schema.metaFields !== undefined) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 242);+data_out = SchemaJSON._parseMeta(schema.metaFields, data_in, data_out);+ }+ }+ else {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 246);+data_out.error = new Error("JSON schema parse failure");+ }++ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 249);+return data_out;+ },++ /**+ * Schema-parsed list of results from full data+ *+ * @method _parseResults+ * @param schema {Object} Schema to parse against.+ * @param json_in {Object} JSON to parse.+ * @param data_out {Object} In-progress parsed data to update.+ * @return {Object} Parsed data object.+ * @static+ * @protected+ */+ _parseResults: function(schema, json_in, data_out) {+ _yuitest_coverfunc("build/dataschema-json/dataschema-json.js", "_parseResults", 263);+_yuitest_coverline("build/dataschema-json/dataschema-json.js", 264);+var getPath = SchemaJSON.getPath,+ getValue = SchemaJSON.getLocationValue,+ path = getPath(schema.resultListLocator),+ results = path ?+ (getValue(path, json_in) ||+ // Fall back to treat resultListLocator as a simple key+ json_in[schema.resultListLocator]) :+ // Or if no resultListLocator is supplied, use the input+ json_in;++ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 274);+if (isArray(results)) {+ // if no result fields are passed in, then just take+ // the results array whole-hog Sometimes you're getting+ // an array of strings, or want the whole object, so+ // resultFields don't make sense.+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 279);+if (isArray(schema.resultFields)) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 280);+data_out = SchemaJSON._getFieldValues.call(this, schema.resultFields, results, data_out);+ } else {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 282);+data_out.results = results;+ }+ } else {_yuitest_coverline("build/dataschema-json/dataschema-json.js", 284);+if (schema.resultListLocator) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 285);+data_out.results = [];+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 286);+data_out.error = new Error("JSON results retrieval failure");+ }}++ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 289);+return data_out;+ },++ /**+ * Get field data values out of list of full results+ *+ * @method _getFieldValues+ * @param fields {Array} Fields to find.+ * @param array_in {Array} Results to parse.+ * @param data_out {Object} In-progress parsed data to update.+ * @return {Object} Parsed data object.+ * @static+ * @protected+ */+ _getFieldValues: function(fields, array_in, data_out) {+ _yuitest_coverfunc("build/dataschema-json/dataschema-json.js", "_getFieldValues", 303);+_yuitest_coverline("build/dataschema-json/dataschema-json.js", 304);+var results = [],+ len = fields.length,+ i, j,+ field, key, locator, path, parser, val,+ simplePaths = [], complexPaths = [], fieldParsers = [],+ result, record;++ // First collect hashes of simple paths, complex paths, and parsers+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 312);+for (i=0; i<len; i++) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 313);+field = fields[i]; // A field can be a simple string or a hash+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 314);+key = field.key || field; // Find the key+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 315);+locator = field.locator || key; // Find the locator++ // Validate and store locators for later+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 318);+path = SchemaJSON.getPath(locator);+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 319);+if (path) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 320);+if (path.length === 1) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 321);+simplePaths.push({+ key : key,+ path: path[0]+ });+ } else {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 326);+complexPaths.push({+ key : key,+ path : path,+ locator: locator+ });+ }+ } else {+ }++ // Validate and store parsers for later+ //TODO: use Y.DataSchema.parse?+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 337);+parser = (isFunction(field.parser)) ?+ field.parser :+ Y.Parsers[field.parser + ''];++ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 341);+if (parser) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 342);+fieldParsers.push({+ key : key,+ parser: parser+ });+ }+ }++ // Traverse list of array_in, creating records of simple fields,+ // complex fields, and applying parsers as necessary+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 351);+for (i=array_in.length-1; i>=0; --i) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 352);+record = {};+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 353);+result = array_in[i];+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 354);+if(result) {+ // Cycle through complexLocators+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 356);+for (j=complexPaths.length - 1; j>=0; --j) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 357);+path = complexPaths[j];+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 358);+val = SchemaJSON.getLocationValue(path.path, result);+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 359);+if (val === undefined) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 360);+val = SchemaJSON.getLocationValue([path.locator], result);+ // Fail over keys like "foo.bar" from nested parsing+ // to single token parsing if a value is found in+ // results["foo.bar"]+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 364);+if (val !== undefined) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 365);+simplePaths.push({+ key: path.key,+ path: path.locator+ });+ // Don't try to process the path as complex+ // for further results+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 371);+complexPaths.splice(i,1);+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 372);+continue;+ }+ }++ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 376);+record[path.key] = Base.parse.call(this,+ (SchemaJSON.getLocationValue(path.path, result)), path);+ }++ // Cycle through simpleLocators+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 381);+for (j = simplePaths.length - 1; j >= 0; --j) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 382);+path = simplePaths[j];+ // Bug 1777850: The result might be an array instead of object+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 384);+record[path.key] = Base.parse.call(this,+ ((result[path.path] === undefined) ?+ result[j] : result[path.path]), path);+ }++ // Cycle through fieldParsers+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 390);+for (j=fieldParsers.length-1; j>=0; --j) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 391);+key = fieldParsers[j].key;+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 392);+record[key] = fieldParsers[j].parser.call(this, record[key]);+ // Safety net+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 394);+if (record[key] === undefined) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 395);+record[key] = null;+ }+ }+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 398);+results[i] = record;+ }+ }+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 401);+data_out.results = results;+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 402);+return data_out;+ },++ /**+ * Parses results data according to schema+ *+ * @method _parseMeta+ * @param metaFields {Object} Metafields definitions.+ * @param json_in {Object} JSON to parse.+ * @param data_out {Object} In-progress parsed data to update.+ * @return {Object} Schema-parsed meta data.+ * @static+ * @protected+ */+ _parseMeta: function(metaFields, json_in, data_out) {+ _yuitest_coverfunc("build/dataschema-json/dataschema-json.js", "_parseMeta", 416);+_yuitest_coverline("build/dataschema-json/dataschema-json.js", 417);+if (isObject(metaFields)) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 418);+var key, path;+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 419);+for(key in metaFields) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 420);+if (metaFields.hasOwnProperty(key)) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 421);+path = SchemaJSON.getPath(metaFields[key]);+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 422);+if (path && json_in) {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 423);+data_out.meta[key] = SchemaJSON.getLocationValue(path, json_in);+ }+ }+ }+ }+ else {+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 429);+data_out.error = new Error("JSON meta data retrieval failure");+ }+ _yuitest_coverline("build/dataschema-json/dataschema-json.js", 431);+return data_out;+ }+};++// TODO: Y.Object + mix() might be better here+_yuitest_coverline("build/dataschema-json/dataschema-json.js", 436);+Y.DataSchema.JSON = Y.mix(SchemaJSON, Base);+++}, '3.7.1', {"requires": ["dataschema-base", "json"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('dataschema-json', function(Y) {+YUI.add('dataschema-json', function (Y, NAME) { /** Provides a DataSchema implementation which can be used to work with JSON data.@@ -446,4 +446,4 @@ Y.DataSchema.JSON = Y.mix(SchemaJSON, Base); -}, '3.5.1' ,{requires:['dataschema-base','json']});+}, '3.7.1', {"requires": ["dataschema-base", "json"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dataschema-json",function(g){var c=g.Lang,f=c.isFunction,a=c.isObject,b=c.isArray,e=g.DataSchema.Base,d;d={getPath:function(h){var l=null,k=[],j=0;if(h){h=h.replace(/\[\s*(['"])(.*?)\1\s*\]/g,function(m,i,n){k[j]=n;return".@"+(j++);}).replace(/\[(\d+)\]/g,function(m,i){k[j]=parseInt(i,10)|0;return".@"+(j++);}).replace(/^\./,"");l=h.split(".");for(j=l.length-1;j>=0;--j){if(l[j].charAt(0)==="@"){l[j]=k[parseInt(l[j].substr(1),10)];}}}return l;},getLocationValue:function(l,k){var j=0,h=l.length;for(;j<h;j++){if(a(k)&&(l[j] in k)){k=k[l[j]];}else{k=undefined;break;}}return k;},apply:function(j,k){var h=k,i={results:[],meta:{}};if(!a(k)){try{h=g.JSON.parse(k);}catch(l){i.error=l;return i;}}if(a(h)&&j){i=d._parseResults.call(this,j,h,i);if(j.metaFields!==undefined){i=d._parseMeta(j.metaFields,h,i);}}else{i.error=new Error("JSON schema parse failure");}return i;},_parseResults:function(m,h,l){var i=d.getPath,j=d.getLocationValue,n=i(m.resultListLocator),k=n?(j(n,h)||h[m.resultListLocator]):h;if(b(k)){if(b(m.resultFields)){l=d._getFieldValues.call(this,m.resultFields,k,l);}else{l.results=k;}}else{if(m.resultListLocator){l.results=[];l.error=new Error("JSON results retrieval failure");}}return l;},_getFieldValues:function(s,p,n){var u=[],x=s.length,w,v,h,z,m,r,l,A,t=[],y=[],o=[],q,k;for(w=0;w<x;w++){h=s[w];z=h.key||h;m=h.locator||z;r=d.getPath(m);if(r){if(r.length===1){t.push({key:z,path:r[0]});}else{y.push({key:z,path:r,locator:m});}}else{}l=(f(h.parser))?h.parser:g.Parsers[h.parser+""];if(l){o.push({key:z,parser:l});}}for(w=p.length-1;w>=0;--w){k={};q=p[w];if(q){for(v=y.length-1;v>=0;--v){r=y[v];A=d.getLocationValue(r.path,q);if(A===undefined){A=d.getLocationValue([r.locator],q);if(A!==undefined){t.push({key:r.key,path:r.locator});y.splice(w,1);continue;}}k[r.key]=e.parse.call(this,(d.getLocationValue(r.path,q)),r);}for(v=t.length-1;v>=0;--v){r=t[v];k[r.key]=e.parse.call(this,((q[r.path]===undefined)?q[v]:q[r.path]),r);}for(v=o.length-1;v>=0;--v){z=o[v].key;k[z]=o[v].parser.call(this,k[z]);if(k[z]===undefined){k[z]=null;}}u[w]=k;}}n.results=u;return n;},_parseMeta:function(k,h,j){if(a(k)){var i,l;for(i in k){if(k.hasOwnProperty(i)){l=d.getPath(k[i]);if(l&&h){j.meta[i]=d.getLocationValue(l,h);}}}}else{j.error=new Error("JSON meta data retrieval failure");}return j;}};g.DataSchema.JSON=g.mix(d,e);},"3.5.1",{requires:["dataschema-base","json"]});+YUI.add("dataschema-json",function(e,t){var n=e.Lang,r=n.isFunction,i=n.isObject,s=n.isArray,o=e.DataSchema.Base,u;u={getPath:function(e){var t=null,n=[],r=0;if(e){e=e.replace(/\[\s*(['"])(.*?)\1\s*\]/g,function(e,t,i){return n[r]=i,".@"+r++}).replace(/\[(\d+)\]/g,function(e,t){return n[r]=parseInt(t,10)|0,".@"+r++}).replace(/^\./,""),t=e.split(".");for(r=t.length-1;r>=0;--r)t[r].charAt(0)==="@"&&(t[r]=n[parseInt(t[r].substr(1),10)])}return t},getLocationValue:function(e,t){var n=0,r=e.length;for(;n<r;n++){if(!(i(t)&&e[n]in t)){t=undefined;break}t=t[e[n]]}return t},apply:function(t,n){var r=n,s={results:[],meta:{}};if(!i(n))try{r=e.JSON.parse(n)}catch(o){return s.error=o,s}return i(r)&&t?(s=u._parseResults.call(this,t,r,s),t.metaFields!==undefined&&(s=u._parseMeta(t.metaFields,r,s))):s.error=new Error("JSON schema parse failure"),s},_parseResults:function(e,t,n){var r=u.getPath,i=u.getLocationValue,o=r(e.resultListLocator),a=o?i(o,t)||t[e.resultListLocator]:t;return s(a)?s(e.resultFields)?n=u._getFieldValues.call(this,e.resultFields,a,n):n.results=a:e.resultListLocator&&(n.results=[],n.error=new Error("JSON results retrieval failure")),n},_getFieldValues:function(t,n,i){var s=[],a=t.length,f,l,c,h,p,d,v,m,g=[],y=[],b=[],w,E;for(f=0;f<a;f++)c=t[f],h=c.key||c,p=c.locator||h,d=u.getPath(p),d&&(d.length===1?g.push({key:h,path:d[0]}):y.push({key:h,path:d,locator:p})),v=r(c.parser)?c.parser:e.Parsers[c.parser+""],v&&b.push({key:h,parser:v});for(f=n.length-1;f>=0;--f){E={},w=n[f];if(w){for(l=y.length-1;l>=0;--l){d=y[l],m=u.getLocationValue(d.path,w);if(m===undefined){m=u.getLocationValue([d.locator],w);if(m!==undefined){g.push({key:d.key,path:d.locator}),y.splice(f,1);continue}}E[d.key]=o.parse.call(this,u.getLocationValue(d.path,w),d)}for(l=g.length-1;l>=0;--l)d=g[l],E[d.key]=o.parse.call(this,w[d.path]===undefined?w[l]:w[d.path],d);for(l=b.length-1;l>=0;--l)h=b[l].key,E[h]=b[l].parser.call(this,E[h]),E[h]===undefined&&(E[h]=null);s[f]=E}}return i.results=s,i},_parseMeta:function(e,t,n){if(i(e)){var r,s;for(r in e)e.hasOwnProperty(r)&&(s=u.getPath(e[r]),s&&t&&(n.meta[r]=u.getLocationValue(s,t)))}else n.error=new Error("JSON meta data retrieval failure");return n}},e.DataSchema.JSON=e.mix(u,o)},"3.7.1",{requires:["dataschema-base","json"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('dataschema-json', function(Y) {+YUI.add('dataschema-json', function (Y, NAME) { /** Provides a DataSchema implementation which can be used to work with JSON data.@@ -442,4 +442,4 @@ Y.DataSchema.JSON = Y.mix(SchemaJSON, Base); -}, '3.5.1' ,{requires:['dataschema-base','json']});+}, '3.7.1', {"requires": ["dataschema-base", "json"]});
@@ -0,0 +1,250 @@+/*+YUI 3.7.1 (build 5627)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/dataschema-text/dataschema-text.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/dataschema-text/dataschema-text.js",+ code: []+};+_yuitest_coverage["build/dataschema-text/dataschema-text.js"].code=["YUI.add('dataschema-text', function (Y, NAME) {","","/**"," * Provides a DataSchema implementation which can be used to work with"," * delimited text data."," *"," * @module dataschema"," * @submodule dataschema-text"," */","","/**","Provides a DataSchema implementation which can be used to work with","delimited text data.","","See the `apply` method for usage.","","@class DataSchema.Text","@extends DataSchema.Base","@static","**/","","var Lang = Y.Lang,"," isString = Lang.isString,"," isUndef = Lang.isUndefined,",""," SchemaText = {",""," ////////////////////////////////////////////////////////////////////////"," //"," // DataSchema.Text static methods"," //"," ////////////////////////////////////////////////////////////////////////"," /**"," Applies a schema to a string of delimited data, returning a normalized"," object with results in the `results` property. The `meta` property of"," the response object is present for consistency, but is assigned an"," empty object. If the input data is absent or not a string, an `error`"," property will be added.",""," Use _schema.resultDelimiter_ and _schema.fieldDelimiter_ to instruct"," `apply` how to split up the string into an array of data arrays for"," processing.",""," Use _schema.resultFields_ to specify the keys in the generated result"," objects in `response.results`. The key:value pairs will be assigned"," in the order of the _schema.resultFields_ array, assuming the values"," in the data records are defined in the same order.",""," _schema.resultFields_ field identifiers are objects with the following"," properties:",""," * `key` : <strong>(required)</strong> The property name you want"," the data value assigned to in the result object (String)"," * `parser`: A function or the name of a function on `Y.Parsers` used"," to convert the input value into a normalized type. Parser"," functions are passed the value as input and are expected to"," return a value.",""," If no value parsing is needed, you can use just the desired property"," name string as the field identifier instead of an object (see example"," below).",""," @example"," // Process simple csv"," var schema = {"," resultDelimiter: \"\\n\","," fieldDelimiter: \",\","," resultFields: [ 'fruit', 'color' ]"," },"," data = \"Banana,yellow\\nOrange,orange\\nEggplant,purple\";",""," var response = Y.DataSchema.Text.apply(schema, data);",""," // response.results[0] is { fruit: \"Banana\", color: \"yellow\" }","",""," // Use parsers"," schema.resultFields = ["," {"," key: 'fruit',"," parser: function (val) { return val.toUpperCase(); }"," },"," 'color' // mix and match objects and strings"," ];",""," response = Y.DataSchema.Text.apply(schema, data);",""," // response.results[0] is { fruit: \"BANANA\", color: \"yellow\" }"," "," @method apply"," @param {Object} schema Schema to apply. Supported configuration"," properties are:"," @param {String} schema.resultDelimiter Character or character"," sequence that marks the end of one record and the start of"," another."," @param {String} [schema.fieldDelimiter] Character or character"," sequence that marks the end of a field and the start of"," another within the same record."," @param {Array} [schema.resultFields] Field identifiers to"," assign values in the response records. See above for details."," @param {String} data Text data."," @return {Object} An Object with properties `results` and `meta`"," @static"," **/"," apply: function(schema, data) {"," var data_in = data,"," data_out = { results: [], meta: {} };",""," if (isString(data) && schema && isString(schema.resultDelimiter)) {"," // Parse results data"," data_out = SchemaText._parseResults.call(this, schema, data_in, data_out);"," } else {"," data_out.error = new Error(\"Text schema parse failure\");"," }",""," return data_out;"," },",""," /**"," * Schema-parsed list of results from full data"," *"," * @method _parseResults"," * @param schema {Array} Schema to parse against."," * @param text_in {String} Text to parse."," * @param data_out {Object} In-progress parsed data to update."," * @return {Object} Parsed data object."," * @static"," * @protected"," */"," _parseResults: function(schema, text_in, data_out) {"," var resultDelim = schema.resultDelimiter,"," fieldDelim = isString(schema.fieldDelimiter) &&"," schema.fieldDelimiter,"," fields = schema.resultFields || [],"," results = [],"," parse = Y.DataSchema.Base.parse,"," results_in, fields_in, result, item,"," field, key, value, i, j;",""," // Delete final delimiter at end of string if there"," if (text_in.slice(-resultDelim.length) === resultDelim) {"," text_in = text_in.slice(0, -resultDelim.length);"," }",""," // Split into results"," results_in = text_in.split(schema.resultDelimiter);",""," if (fieldDelim) {"," for (i = results_in.length - 1; i >= 0; --i) {"," result = {};"," item = results_in[i];",""," fields_in = item.split(schema.fieldDelimiter);",""," for (j = fields.length - 1; j >= 0; --j) {"," field = fields[j];"," key = (!isUndef(field.key)) ? field.key : field;"," // FIXME: unless the key is an array index, this test"," // for fields_in[key] is useless."," value = (!isUndef(fields_in[key])) ?"," fields_in[key] :"," fields_in[j];",""," result[key] = parse.call(this, value, field);"," }",""," results[i] = result;"," }"," } else {"," results = results_in;"," }",""," data_out.results = results;",""," return data_out;"," }"," };","","Y.DataSchema.Text = Y.mix(SchemaText, Y.DataSchema.Base);","","","}, '3.7.1', {\"requires\": [\"dataschema-base\"]});"];+_yuitest_coverage["build/dataschema-text/dataschema-text.js"].lines = {"1":0,"22":0,"106":0,"109":0,"111":0,"113":0,"116":0,"131":0,"141":0,"142":0,"146":0,"148":0,"149":0,"150":0,"151":0,"153":0,"155":0,"156":0,"157":0,"160":0,"164":0,"167":0,"170":0,"173":0,"175":0,"179":0};+_yuitest_coverage["build/dataschema-text/dataschema-text.js"].functions = {"apply:105":0,"_parseResults:130":0,"(anonymous 1):1":0};+_yuitest_coverage["build/dataschema-text/dataschema-text.js"].coveredLines = 26;+_yuitest_coverage["build/dataschema-text/dataschema-text.js"].coveredFunctions = 3;+_yuitest_coverline("build/dataschema-text/dataschema-text.js", 1);+YUI.add('dataschema-text', function (Y, NAME) {++/**+ * Provides a DataSchema implementation which can be used to work with+ * delimited text data.+ *+ * @module dataschema+ * @submodule dataschema-text+ */++/**+Provides a DataSchema implementation which can be used to work with+delimited text data.++See the `apply` method for usage.++@class DataSchema.Text+@extends DataSchema.Base+@static+**/++_yuitest_coverfunc("build/dataschema-text/dataschema-text.js", "(anonymous 1)", 1);+_yuitest_coverline("build/dataschema-text/dataschema-text.js", 22);+var Lang = Y.Lang,+ isString = Lang.isString,+ isUndef = Lang.isUndefined,++ SchemaText = {++ ////////////////////////////////////////////////////////////////////////+ //+ // DataSchema.Text static methods+ //+ ////////////////////////////////////////////////////////////////////////+ /**+ Applies a schema to a string of delimited data, returning a normalized+ object with results in the `results` property. The `meta` property of+ the response object is present for consistency, but is assigned an+ empty object. If the input data is absent or not a string, an `error`+ property will be added.++ Use _schema.resultDelimiter_ and _schema.fieldDelimiter_ to instruct+ `apply` how to split up the string into an array of data arrays for+ processing.++ Use _schema.resultFields_ to specify the keys in the generated result+ objects in `response.results`. The key:value pairs will be assigned+ in the order of the _schema.resultFields_ array, assuming the values+ in the data records are defined in the same order.++ _schema.resultFields_ field identifiers are objects with the following+ properties:++ * `key` : <strong>(required)</strong> The property name you want+ the data value assigned to in the result object (String)+ * `parser`: A function or the name of a function on `Y.Parsers` used+ to convert the input value into a normalized type. Parser+ functions are passed the value as input and are expected to+ return a value.++ If no value parsing is needed, you can use just the desired property+ name string as the field identifier instead of an object (see example+ below).++ @example+ // Process simple csv+ var schema = {+ resultDelimiter: "\n",+ fieldDelimiter: ",",+ resultFields: [ 'fruit', 'color' ]+ },+ data = "Banana,yellow\nOrange,orange\nEggplant,purple";++ var response = Y.DataSchema.Text.apply(schema, data);++ // response.results[0] is { fruit: "Banana", color: "yellow" }+++ // Use parsers+ schema.resultFields = [+ {+ key: 'fruit',+ parser: function (val) { return val.toUpperCase(); }+ },+ 'color' // mix and match objects and strings+ ];++ response = Y.DataSchema.Text.apply(schema, data);++ // response.results[0] is { fruit: "BANANA", color: "yellow" }+ + @method apply+ @param {Object} schema Schema to apply. Supported configuration+ properties are:+ @param {String} schema.resultDelimiter Character or character+ sequence that marks the end of one record and the start of+ another.+ @param {String} [schema.fieldDelimiter] Character or character+ sequence that marks the end of a field and the start of+ another within the same record.+ @param {Array} [schema.resultFields] Field identifiers to+ assign values in the response records. See above for details.+ @param {String} data Text data.+ @return {Object} An Object with properties `results` and `meta`+ @static+ **/+ apply: function(schema, data) {+ _yuitest_coverfunc("build/dataschema-text/dataschema-text.js", "apply", 105);+_yuitest_coverline("build/dataschema-text/dataschema-text.js", 106);+var data_in = data,+ data_out = { results: [], meta: {} };++ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 109);+if (isString(data) && schema && isString(schema.resultDelimiter)) {+ // Parse results data+ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 111);+data_out = SchemaText._parseResults.call(this, schema, data_in, data_out);+ } else {+ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 113);+data_out.error = new Error("Text schema parse failure");+ }++ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 116);+return data_out;+ },++ /**+ * Schema-parsed list of results from full data+ *+ * @method _parseResults+ * @param schema {Array} Schema to parse against.+ * @param text_in {String} Text to parse.+ * @param data_out {Object} In-progress parsed data to update.+ * @return {Object} Parsed data object.+ * @static+ * @protected+ */+ _parseResults: function(schema, text_in, data_out) {+ _yuitest_coverfunc("build/dataschema-text/dataschema-text.js", "_parseResults", 130);+_yuitest_coverline("build/dataschema-text/dataschema-text.js", 131);+var resultDelim = schema.resultDelimiter,+ fieldDelim = isString(schema.fieldDelimiter) &&+ schema.fieldDelimiter,+ fields = schema.resultFields || [],+ results = [],+ parse = Y.DataSchema.Base.parse,+ results_in, fields_in, result, item,+ field, key, value, i, j;++ // Delete final delimiter at end of string if there+ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 141);+if (text_in.slice(-resultDelim.length) === resultDelim) {+ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 142);+text_in = text_in.slice(0, -resultDelim.length);+ }++ // Split into results+ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 146);+results_in = text_in.split(schema.resultDelimiter);++ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 148);+if (fieldDelim) {+ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 149);+for (i = results_in.length - 1; i >= 0; --i) {+ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 150);+result = {};+ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 151);+item = results_in[i];++ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 153);+fields_in = item.split(schema.fieldDelimiter);++ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 155);+for (j = fields.length - 1; j >= 0; --j) {+ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 156);+field = fields[j];+ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 157);+key = (!isUndef(field.key)) ? field.key : field;+ // FIXME: unless the key is an array index, this test+ // for fields_in[key] is useless.+ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 160);+value = (!isUndef(fields_in[key])) ?+ fields_in[key] :+ fields_in[j];++ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 164);+result[key] = parse.call(this, value, field);+ }++ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 167);+results[i] = result;+ }+ } else {+ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 170);+results = results_in;+ }++ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 173);+data_out.results = results;++ _yuitest_coverline("build/dataschema-text/dataschema-text.js", 175);+return data_out;+ }+ };++_yuitest_coverline("build/dataschema-text/dataschema-text.js", 179);+Y.DataSchema.Text = Y.mix(SchemaText, Y.DataSchema.Base);+++}, '3.7.1', {"requires": ["dataschema-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('dataschema-text', function(Y) {+YUI.add('dataschema-text', function (Y, NAME) { /** * Provides a DataSchema implementation which can be used to work with@@ -186,4 +186,4 @@ Y.DataSchema.Text = Y.mix(SchemaText, Y.DataSchema.Base); -}, '3.5.1' ,{requires:['dataschema-base']});+}, '3.7.1', {"requires": ["dataschema-base"]});
@@ -1,7 +1,7 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dataschema-text",function(e){var c=e.Lang,a=c.isString,d=c.isUndefined,b={apply:function(h,i){var f=i,g={results:[],meta:{}};if(a(i)&&h&&a(h.resultDelimiter)){g=b._parseResults.call(this,h,f,g);}else{g.error=new Error("Text schema parse failure");}return g;},_parseResults:function(g,q,h){var o=g.resultDelimiter,n=a(g.fieldDelimiter)&&g.fieldDelimiter,p=g.resultFields||[],m=[],f=e.DataSchema.Base.parse,r,u,x,w,s,v,t,l,k;if(q.slice(-o.length)===o){q=q.slice(0,-o.length);}r=q.split(g.resultDelimiter);if(n){for(l=r.length-1;l>=0;--l){x={};w=r[l];u=w.split(g.fieldDelimiter);for(k=p.length-1;k>=0;--k){s=p[k];v=(!d(s.key))?s.key:s;t=(!d(u[v]))?u[v]:u[k];x[v]=f.call(this,t,s);}m[l]=x;}}else{m=r;}h.results=m;return h;}};e.DataSchema.Text=e.mix(b,e.DataSchema.Base);},"3.5.1",{requires:["dataschema-base"]});+YUI.add("dataschema-text",function(e,t){var n=e.Lang,r=n.isString,i=n.isUndefined,s={apply:function(e,t){var n=t,i={results:[],meta:{}};return r(t)&&e&&r(e.resultDelimiter)?i=s._parseResults.call(this,e,n,i):i.error=new Error("Text schema parse failure"),i},_parseResults:function(t,n,s){var o=t.resultDelimiter,u=r(t.fieldDelimiter)&&t.fieldDelimiter,a=t.resultFields||[],f=[],l=e.DataSchema.Base.parse,c,h,p,d,v,m,g,y,b;n.slice(-o.length)===o&&(n=n.slice(0,-o.length)),c=n.split(t.resultDelimiter);if(u)for(y=c.length-1;y>=0;--y){p={},d=c[y],h=d.split(t.fieldDelimiter);for(b=a.length-1;b>=0;--b)v=a[b],m=i(v.key)?v:v.key,g=i(h[m])?h[b]:h[m],p[m]=l.call(this,g,v);f[y]=p}else f=c;return s.results=f,s}};e.DataSchema.Text=e.mix(s,e.DataSchema.Base)},"3.7.1",{requires:["dataschema-base"]});
@@ -1,10 +1,10 @@ /*-YUI 3.5.1 (build 22)+YUI 3.7.1 (build 5627) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add('dataschema-text', function(Y) {+YUI.add('dataschema-text', function (Y, NAME) { /** * Provides a DataSchema implementation which can be used to work with@@ -185,4 +185,4 @@ Y.DataSchema.Text = Y.mix(SchemaText, Y.DataSchema.Base); -}, '3.5.1' ,{requires:['dataschema-base']});+}, '3.7.1', {"requires": ["dataschema-base"]});
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff