function _mapPolygons(pattern) {

            // Append SVG to pattern container.
            $cash(SELECTORS.pattern).append(pattern);

            // Convert nodelist to array,
            // Used `.childNodes` because IE doesn't support `.children` on SVG.
            polygonMap.paths = [].slice.call(pattern.childNodes);

            polygonMap.points = [];

            polygonMap.paths.forEach(function(polygon) {

                // Hide polygons by adding CSS classes to each svg path (used attrs because of IE).
                $cash(polygon).attr('class', CLASSES.polygon);

                var rect = polygon.getBoundingClientRect();

                var point = {
                    x: rect.left + rect.width / 2,
                    y: rect.top + rect.height / 2
                };

                polygonMap.points.push(point);
            });

            // All polygons are hidden now, display the pattern container.
            $cash(SELECTORS.pattern).removeClass(CLASSES.patternHidden);
        }
/**
         * Store path elements, map coordinates and sizes.
         * @param {Element} pattern The SVG Element generated with Trianglify.
         * @private
         */
Store path elements, map coordinates and sizes.
@param {Element} pattern The SVG Element generated with Trianglify.
@private
Store path elements map coordinates and sizes . @param { Element } pattern The SVG Element generated with Trianglify . @private
function _mapPolygons(pattern) {
            $cash(SELECTORS.pattern).append(pattern);
            polygonMap.paths = [].slice.call(pattern.childNodes);
            polygonMap.points = [];
            polygonMap.paths.forEach(function(polygon) {
                $cash(polygon).attr('class', CLASSES.polygon);
                var rect = polygon.getBoundingClientRect();
                var point = {
                    x: rect.left + rect.width / 2,
                    y: rect.top + rect.height / 2
                };
                polygonMap.points.push(point);
            });
            $cash(SELECTORS.pattern).removeClass(CLASSES.patternHidden);
        }
function _mapPolygons ( pattern ) { $cash ( SELECTORS . pattern ) . append ( pattern ) ; polygonMap . paths = [ ] . slice . call ( pattern . childNodes ) ; polygonMap . points = [ ] ; polygonMap . paths . forEach ( function ( polygon ) { $cash ( polygon ) . attr ( 'class' , CLASSES . polygon ) ; var rect = polygon . getBoundingClientRect ( ) ; var point = { x : rect . left + rect . width / 2 , y : rect . top + rect . height / 2 } ; polygonMap . points . push ( point ) ; } ) ; $cash ( SELECTORS . pattern ) . removeClass ( CLASSES . patternHidden ) ; }
Store path elements, map coordinates and sizes.
Store path elements map coordinates and sizes .
// Append SVG to pattern container. // Convert nodelist to array, // Used `.childNodes` because IE doesn't support `.children` on SVG. // Hide polygons by adding CSS classes to each svg path (used attrs because of IE). // All polygons are hidden now, display the pattern container.