public/libraries.js
function (x, y, w, h, options) {
                var arrowLength = 6,
                  halfDistance = 6,
                  r = mathMin((options && options.r) || 0, w, h),
                  safeDistance = r + halfDistance,
                  anchorX = options && options.anchorX,
                  anchorY = options && options.anchorY,
                  path,
                  normalizer = mathRound(options.strokeWidth || 0) % 2 / 2; // mathRound because strokeWidth can sometimes have roundoff errors;

                x += normalizer;
                y += normalizer;
                path = [
                    'M', x + r, y,
                    'L', x + w - r, y, // top side
                    'C', x + w, y, x + w, y, x + w, y + r, // top-right corner
                    'L', x + w, y + h - r, // right side
                    'C', x + w, y + h, x + w, y + h, x + w - r, y + h, // bottom-right corner
                    'L', x + r, y + h, // bottom side
                    'C', x, y + h, x, y + h, x, y + h - r, // bottom-left corner
                    'L', x, y + r, // left side
                    'C', x, y, x, y, x + r, y // top-right corner
                ];

                if (anchorX && anchorX > w && anchorY > y + safeDistance && anchorY < y + h - safeDistance) { // replace right side
                    path.splice(13, 3,
                      'L', x + w, anchorY - halfDistance,
                      x + w + arrowLength, anchorY,
                      x + w, anchorY + halfDistance,
                      x + w, y + h - r
                    );
                } else if (anchorX && anchorX < 0 && anchorY > y + safeDistance && anchorY < y + h - safeDistance) { // replace left side
                    path.splice(33, 3,
                      'L', x, anchorY + halfDistance,
                      x - arrowLength, anchorY,
                      x, anchorY - halfDistance,
                      x, y + r
                    );
                } else if (anchorY && anchorY > h && anchorX > x + safeDistance && anchorX < x + w - safeDistance) { // replace bottom
                    path.splice(23, 3,
                      'L', anchorX + halfDistance, y + h,
                      anchorX, y + h + arrowLength,
                      anchorX - halfDistance, y + h,
                      x + r, y + h
                    );
                } else if (anchorY && anchorY < 0 && anchorX > x + safeDistance && anchorX < x + w - safeDistance) { // replace top
                    path.splice(3, 3,
                      'L', anchorX - halfDistance, y,
                      anchorX, y - arrowLength,
                      anchorX + halfDistance, y,
                      w - r, y
                    );
                }
                return path;
            }
function (x, y, w, h, options) {
                var arrowLength = 6,
                  halfDistance = 6,
                  r = mathMin((options && options.r) || 0, w, h),
                  safeDistance = r + halfDistance,
                  anchorX = options && options.anchorX,
                  anchorY = options && options.anchorY,
                  path,
                  normalizer = mathRound(options.strokeWidth || 0) % 2 / 2; // mathRound because strokeWidth can sometimes have roundoff errors;

                x += normalizer;
                y += normalizer;
                path = [
                    'M', x + r, y,
                    'L', x + w - r, y, // top side
                    'C', x + w, y, x + w, y, x + w, y + r, // top-right corner
                    'L', x + w, y + h - r, // right side
                    'C', x + w, y + h, x + w, y + h, x + w - r, y + h, // bottom-right corner
                    'L', x + r, y + h, // bottom side
                    'C', x, y + h, x, y + h, x, y + h - r, // bottom-left corner
                    'L', x, y + r, // left side
                    'C', x, y, x, y, x + r, y // top-right corner
                ];

                if (anchorX && anchorX > w && anchorY > y + safeDistance && anchorY < y + h - safeDistance) { // replace right side
                    path.splice(13, 3,
                      'L', x + w, anchorY - halfDistance,
                      x + w + arrowLength, anchorY,
                      x + w, anchorY + halfDistance,
                      x + w, y + h - r
                    );
                } else if (anchorX && anchorX < 0 && anchorY > y + safeDistance && anchorY < y + h - safeDistance) { // replace left side
                    path.splice(33, 3,
                      'L', x, anchorY + halfDistance,
                      x - arrowLength, anchorY,
                      x, anchorY - halfDistance,
                      x, y + r
                    );
                } else if (anchorY && anchorY > h && anchorX > x + safeDistance && anchorX < x + w - safeDistance) { // replace bottom
                    path.splice(23, 3,
                      'L', anchorX + halfDistance, y + h,
                      anchorX, y + h + arrowLength,
                      anchorX - halfDistance, y + h,
                      x + r, y + h
                    );
                } else if (anchorY && anchorY < 0 && anchorX > x + safeDistance && anchorX < x + w - safeDistance) { // replace top
                    path.splice(3, 3,
                      'L', anchorX - halfDistance, y,
                      anchorX, y - arrowLength,
                      anchorX + halfDistance, y,
                      w - r, y
                    );
                }
                return path;
            }
function ( x , y , w , h , options ) { var arrowLength = 6 , halfDistance = 6 , r = mathMin ( ( options && options . r ) || 0 , w , h ) , safeDistance = r + halfDistance , anchorX = options && options . anchorX , anchorY = options && options . anchorY , path , normalizer = mathRound ( options . strokeWidth || 0 ) % 2 / 2 ; // mathRound because strokeWidth can sometimes have roundoff errors; x += normalizer ; y += normalizer ; path = [ 'M' , x + r , y , 'L' , x + w - r , y , // top side 'C' , x + w , y , x + w , y , x + w , y + r , // top-right corner 'L' , x + w , y + h - r , // right side 'C' , x + w , y + h , x + w , y + h , x + w - r , y + h , // bottom-right corner 'L' , x + r , y + h , // bottom side 'C' , x , y + h , x , y + h , x , y + h - r , // bottom-left corner 'L' , x , y + r , // left side 'C' , x , y , x , y , x + r , y // top-right corner ] ; if ( anchorX && anchorX > w && anchorY > y + safeDistance && anchorY < y + h - safeDistance ) { // replace right side path . splice ( 13 , 3 , 'L' , x + w , anchorY - halfDistance , x + w + arrowLength , anchorY , x + w , anchorY + halfDistance , x + w , y + h - r ) ; } else if ( anchorX && anchorX < 0 && anchorY > y + safeDistance && anchorY < y + h - safeDistance ) { // replace left side path . splice ( 33 , 3 , 'L' , x , anchorY + halfDistance , x - arrowLength , anchorY , x , anchorY - halfDistance , x , y + r ) ; } else if ( anchorY && anchorY > h && anchorX > x + safeDistance && anchorX < x + w - safeDistance ) { // replace bottom path . splice ( 23 , 3 , 'L' , anchorX + halfDistance , y + h , anchorX , y + h + arrowLength , anchorX - halfDistance , y + h , x + r , y + h ) ; } else if ( anchorY && anchorY < 0 && anchorX > x + safeDistance && anchorX < x + w - safeDistance ) { // replace top path . splice ( 3 , 3 , 'L' , anchorX - halfDistance , y , anchorX , y - arrowLength , anchorX + halfDistance , y , w - r , y ) ; } return path ; }
Callout shape used for default tooltips, also used for rounded rectangles in VML
Callout shape used for default tooltips also used for rounded rectangles in VML