{"version":3,"sources":["webpack:///../../../../../src/.internal/plugins/bullets/PointedCircle.ts","webpack:///../../../../../src/.internal/plugins/bullets/PinBullet.ts","webpack:///../../../../../src/.internal/plugins/bullets/FlagBullet.ts","webpack:///../../../../../src/.internal/plugins/bullets/Star.ts","webpack:///./plugins/bullets.js"],"names":["PointedCircle_PointedCircle","_super","PointedCircle","_this","call","this","className","element","paper","add","radius","pointerAngle","applyTheme","tslib_es6","prototype","draw","pw","pointerBaseWidth","pl","pointerLength","angle","x","pointerX","y","pointerY","path","Path","da","utils_Math","Math","atan","a1","a2","Object","defineProperty","getPropertyValue","value","setPropertyValue","PointedShape","Registry","registeredClasses","PinBullet_PinBullet","PinBullet","interfaceColors","InterfaceColorSet","circle","createChild","Circle","shouldClone","isMeasured","fill","getFor","Percent","background","fillOpacity","events","on","invalidate","validate","px","py","pa","r","p1","p2","x1","x2","y1","y2","radsq","q","sqrt","cx","cy","width","height","image","attr","preserveAspectRatio","label","_image","_disposers","push","parent","horizontalCenter","verticalCenter","mask","_label","textAlign","dy","copyFrom","source","clone","createBackground","Bullet","FlagBullet_FlagBullet","FlagBullet","waveHeight","waveLength","setWavedSides","strokeOpacity","stroke","pole","Line","Label","padding","poleHeight","updateBackground","bgHeight","pixelHeight","_background","maxLeft","measuredWidth","measuredHeight","abs","maxRight","maxBottom","maxTop","dispose","WavedRectangle","Star_Star","Star","pointCount","arc","innerRadius","cornerRadius","innerCornerRadius","startAngle","pixelInnerRadius","halfAngle","i","p0","replace","Type","setPercentProperty","Utils","Sprite","window","am4plugins_bullets","bullets_namespaceObject"],"mappings":";;;;;;;;;;;;;;;;;;;+VAuEAA,EAAA,SAAAC,GAoBC,SAAAC,IAAA,IAAAC,EACCF,EAAAG,KAAAC,OAAOA,YACPF,EAAKG,UAAY,gBACjBH,EAAKI,QAAUJ,EAAKK,MAAMC,IAAI,QAC9BN,EAAKO,OAAS,GACdP,EAAKQ,aAAe,GAEpBR,EAAKS,eAiFP,OA5GmCC,EAAA,EA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AiB,SAAUD,GAAO,oCAsBxCH,OAAAC,eAAWuF,EAAA3G,UAAA,eAOX,WACC,IAAIsB,EAAgB/B,KAAK8B,iBAAiB,WAK1C,OAHKkG,EAAA,SAAejG,KACnBA,EAAQ/B,KAAKK,QAEP0B,OAbR,SAAmBA,GAClB/B,KAAKgC,iBAAiB,UAAWD,GAAO,oCAwBzCH,OAAAC,eAAWuF,EAAA3G,UAAA,mBAOX,WACC,OAAOT,KAAK8B,iBAAiB,oBAR9B,SAAuBC,GACtB/B,KAAKiI,mBAAmB,cAAelG,GAAO,GAAM,EAAO,IAAI,oCAahEH,OAAAC,eAAWuF,EAAA3G,UAAA,wBAAX,WACC,OAAOyH,EAAA,gBAAuBlI,KAAKuH,YAAavH,KAAKK,yCAStDuB,OAAAC,eAAWuF,EAAA3G,UAAA,oBAOX,WACC,OAAOT,KAAK8B,iBAAiB,qBAR9B,SAAwBC,GACvB/B,KAAKgC,iBAAiB,eAAgBD,GAAO,oCAgB9CH,OAAAC,eAAWuF,EAAA3G,UAAA,yBAOX,WACC,OAAOT,KAAK8B,iBAAiB,0BAR9B,SAA6BC,GAC5B/B,KAAKgC,iBAAiB,oBAAqBD,GAAO,oCAgBnDH,OAAAC,eAAWuF,EAAA3G,UAAA,kBAOX,WACC,IAAIsB,EAAQ/B,KAAK8B,iBAAiB,cAClC,OAAOP,EAAA,IAAU,EAAGQ,QATrB,SAAsBA,GACrB/B,KAAKgC,iBAAiB,aAAcD,GAAO,oCAW7CqF,EAnSA,CAA0Be,EAAA,GA2S1BjG,EAAA,EAASC,kBAAwB,KAAIgF,EClarCiB,OAAAC,mBAA4BC","file":"./plugins/bullets.js","sourcesContent":["/**\r\n * Pointed rectangle module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { PointedShape, IPointedShapeProperties, IPointedShapeAdapters, IPointedShapeEvents } from \"../../core/elements/PointedShape\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\nimport * as $math from \"../../core/utils/Math\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[PointedCircle]].\r\n */\r\nexport interface IPointedCircleProperties extends IPointedShapeProperties {\r\n\r\n\t/**\r\n\t * Radius of a pin, in pixels.\r\n\t *\r\n\t * @default 18\r\n\t */\r\n\tradius?: number;\r\n\r\n\t/**\r\n\t * Angle of a pointer, in degrees.\r\n\t *\r\n\t * @default 90\r\n\t */\r\n\tpointerAngle?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[PointedCircle]].\r\n */\r\nexport interface IPointedCircleEvents extends IPointedShapeEvents { }\r\n\r\n/**\r\n * Defines adapters for [[PointedCircle]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IPointedCircleAdapters extends IPointedShapeAdapters, IPointedCircleProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Draws a circle with a pointer.\r\n *\r\n * @since 4.5.7\r\n * @see {@link https://www.amcharts.com/docs/v4/tutorials/plugin-bullets/} for usage instructions.\r\n * @see {@link IPointedCircleEvents} for a list of available events\r\n * @see {@link IPointedCircleAdapters} for a list of available Adapters\r\n */\r\nexport class PointedCircle extends PointedShape {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IPointedCircleProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPointedCircleAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPointedCircleEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"PointedCircle\";\r\n\t\tthis.element = this.paper.add(\"path\");\r\n\t\tthis.radius = 18;\r\n\t\tthis.pointerAngle = 90;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\r\n\t\tlet pw = this.pointerBaseWidth;\r\n\t\tlet pl = this.pointerLength;\r\n\r\n\t\tif (pl <= 0.001) {\r\n\t\t\tpl = 0.001;\r\n\t\t}\r\n\r\n\t\tlet angle = this.pointerAngle + 180;\r\n\t\tlet radius = this.radius;\r\n\r\n\r\n\t\tif (pw > 2 * radius) {\r\n\t\t\tpw = 2 * radius;\r\n\t\t}\r\n\r\n\t\tlet x = this.pointerX;\r\n\t\tlet y = this.pointerY;\r\n\r\n\t\tlet path = $path.moveTo({ x: x, y: x });\r\n\r\n\t\tlet da = $math.DEGREES * Math.atan(pw / 2 / pl);\r\n\r\n\t\tif (da <= 0.001) {\r\n\t\t\tda = 0.001;\r\n\t\t}\r\n\r\n\t\tlet a1 = angle - da;\r\n\t\tlet a2 = angle + da;\r\n\r\n\t\tpath += $path.lineTo({ x: x + pl * $math.cos(a1), y: y + pl * $math.sin(a1) });\r\n\t\tpath += $path.arcToPoint({ x: x + pl * $math.cos(a2), y: y + pl * $math.sin(a2) }, radius, radius, true, true);\r\n\t\tpath += $path.lineTo({ x: x, y: x });\r\n\r\n\t\tthis.path = path;\r\n\t}\r\n\r\n\t/**\r\n\t * Radius of a circle in pixels.\r\n\t *\r\n\t * @default 18\r\n\t * @param value Radius (px)\r\n\t */\r\n\tpublic set radius(value: number) {\r\n\t\tthis.setPropertyValue(\"radius\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius (px)\r\n\t */\r\n\tpublic get radius(): number {\r\n\t\treturn this.getPropertyValue(\"radius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Angle of a pointer, in degrees.\r\n\t * \r\n\t * @default 90\r\n\t * @param value Angle (degrees)\r\n\t */\r\n\tpublic set pointerAngle(value: number) {\r\n\t\tthis.setPropertyValue(\"pointerAngle\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Angle of a pointer, in degrees.\r\n\t */\r\n\tpublic get pointerAngle(): number {\r\n\t\treturn this.getPropertyValue(\"pointerAngle\");\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"PointerCircle\"] = PointedCircle;\n\n\n// WEBPACK FOOTER //\n// ../../../../../src/.internal/plugins/bullets/PointedCircle.ts","/**\r\n * Bullet module\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Bullet, IBulletProperties, IBulletAdapters, IBulletEvents } from \"../../charts/elements/Bullet\";\r\nimport { Circle } from \"../../core/elements/Circle\";\r\nimport { PointedCircle } from \"./PointedCircle\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport { percent, Percent } from \"../../core/utils/Percent\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\nimport { Image } from \"../../core/elements/Image\";\r\nimport { Label } from \"../../core/elements/Label\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[PinBullet]].\r\n */\r\nexport interface IPinBulletProperties extends IBulletProperties { }\r\n\r\n/**\r\n * Defines events for [[PinBullet]].\r\n */\r\nexport interface IPinBulletEvents extends IBulletEvents { }\r\n\r\n/**\r\n * Defines adapters.\r\n * \r\n * Includes both the [[Adapter]] definitions and properties\r\n * \r\n * @see {@link Adapter}\r\n */\r\nexport interface IPinBulletAdapters extends IBulletAdapters, IPinBulletProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a pin-shaped bullet with an optional text label and/or image inside\r\n * it.\r\n *\r\n * The background/body of the flag is a [[PointedCircle]] element. Most of\r\n * its the visual appearance is configured via `background` property.\r\n *\r\n * Uses [[Label]] instance to draw the label, so the label itself is\r\n * configurable.\r\n *\r\n * Example:\r\n * \r\n * ```TypeScript\r\n * let series = chart.series.push(new am4charts.LineSeries());\r\n * // ...\r\n * let pinBullet = series.bullets.push(new am4plugins_bullets.PinBullet());\r\n * pinBullet.poleHeight = 15;\r\n * pinBullet.label.text = \"{valueY}\";\r\n * ```\r\n * ```JavaScript\r\n * var series = chart.series.push(new am4charts.LineSeries());\r\n * // ...\r\n * var pinBullet = series.bullets.push(new am4plugins_bullets.PinBullet());\r\n * pinBullet.poleHeight = 15;\r\n * pinBullet.label.text = \"{valueY}\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"bullets\": [{\r\n * \"type\": \"PinBullet\",\r\n * \"poleHeight\": 15,\r\n * \"label\": {\r\n * \"text\": \"{valueY}\"\r\n * }\r\n * }]\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @since 4.5.7\r\n * @see {@link https://www.amcharts.com/docs/v4/tutorials/plugin-bullets/} for usage instructions.\r\n * @see {@link IBulletEvents} for a list of available events\r\n * @see {@link IBulletAdapters} for a list of available Adapters\r\n */\r\nexport class PinBullet extends Bullet {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IPinBulletProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IPinBulletAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IPinBulletEvents;\r\n\r\n\t/**\r\n\t * A [[Circle]] element of the pin. It is used for the \"inside\" of the pin.\r\n\t */\r\n\tpublic circle: Circle;\r\n\r\n\t/**\r\n\t * A type for the background element.\r\n\t */\r\n\tpublic _background: PointedCircle;\r\n\r\n\t/**\r\n\t * Image element.\r\n\t */\r\n\tprotected _image: Image;\r\n\r\n\t/**\r\n\t * Label element.\r\n\t */\r\n\tprotected _label: Label;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"PinBullet\";\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\r\n\t\tlet circle = this.createChild(Circle);\r\n\t\tcircle.shouldClone = false;\r\n\t\tcircle.isMeasured = false;\r\n\t\tcircle.fill = interfaceColors.getFor(\"background\");\r\n\t\tcircle.radius = percent(85);\r\n\r\n\t\tthis.circle = circle;\r\n\t\tlet background = this.background;\r\n\t\tbackground.fill = interfaceColors.getFor(\"alternativeBackground\");\r\n\t\tbackground.fillOpacity = 1;\r\n\t\tbackground.pointerBaseWidth = 20;\r\n\t\tbackground.pointerLength = 20;\r\n\t\tbackground.radius = 25;\r\n\t\tbackground.events.on(\"propertychanged\", this.invalidate, this, false);\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Validates element:\r\n\t * * Triggers events\r\n\t * * Redraws the element\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate() {\r\n\t\tsuper.validate();\r\n\t\tlet background = this.background;\r\n\r\n\t\tlet px = background.pointerX;\r\n\t\tlet py = background.pointerY;\r\n\t\tlet pl = background.pointerLength;\r\n\t\tlet pw = background.pointerBaseWidth;\r\n\t\tlet pa = background.pointerAngle + 180;\r\n\t\tlet r = background.radius;\r\n\r\n\t\tif (pw > 2 * r) {\r\n\t\t\tpw = 2 * r;\r\n\t\t}\r\n\r\n\t\tlet da = $math.DEGREES * Math.atan(pw / 2 / pl);\r\n\r\n\t\tif (da <= 0.001) {\r\n\t\t\tda = 0.001;\r\n\t\t}\r\n\r\n\t\tlet a1 = pa - da;\r\n\t\tlet a2 = pa + da;\r\n\r\n\t\tlet p1 = { x: px + pl * $math.cos(a1), y: py + pl * $math.sin(a1) };\r\n\t\tlet p2 = { x: px + pl * $math.cos(a2), y: py + pl * $math.sin(a2) };\r\n\r\n\t\tlet x1 = p1.x;\r\n\t\tlet x2 = p2.x;\r\n\r\n\t\tlet y1 = p1.y;\r\n\t\tlet y2 = p2.y;\r\n\r\n\t\tlet radsq = r * r;\r\n\t\tlet q = Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)));\r\n\r\n\t\tlet x3 = (x1 + x2) / 2;\r\n\t\tlet cx = x3 - Math.sqrt(radsq - ((q / 2) * (q / 2))) * ((y1 - y2) / q);\r\n\r\n\t\tlet y3 = (y1 + y2) / 2;\r\n\t\tlet cy = y3 - Math.sqrt(radsq - ((q / 2) * (q / 2))) * ((x2 - x1) / q);\r\n\r\n\t\tlet circleRadius = this.circle.radius;\r\n\r\n\t\tif (circleRadius instanceof Percent) {\r\n\t\t\tthis.circle.width = r * 2;\r\n\t\t\tthis.circle.height = r * 2;\r\n\t\t}\r\n\r\n\t\tlet image = this.image;\r\n\t\tif (image) {\r\n\t\t\timage.x = cx;\r\n\t\t\timage.y = cy;\r\n\t\t\timage.width = r * 2;\r\n\t\t\timage.height = r * 2;\r\n\t\t\timage.element.attr({preserveAspectRatio:\"xMidYMid slice\"})\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.circle.x = cx;\r\n\t\t\tthis.circle.y = cy;\r\n\t\t}\r\n\r\n\t\tlet label = this.label;\r\n\t\tif (label) {\r\n\t\t\tlabel.x = cx;\r\n\t\t\tlabel.y = cy;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * An element of type [[Image]] to show inside pin's circle.\r\n\t * \r\n\t * @param image Image\r\n\t */\r\n\tpublic set image(image: Image) {\r\n\t\tif (image) {\r\n\t\t\tthis._image = image;\r\n\t\t\tthis._disposers.push(image);\r\n\t\t\timage.shouldClone = false;\r\n\t\t\timage.parent = this;\r\n\t\t\timage.horizontalCenter = \"middle\";\r\n\t\t\timage.verticalCenter = \"middle\";\r\n\r\n\t\t\tif (this.circle) {\r\n\t\t\t\timage.mask = this.circle;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Image\r\n\t */\r\n\tpublic get image(): Image {\r\n\t\treturn this._image;\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Label]] element for displaying within flag.\r\n\t *\r\n\t * Use it's `text` property to set actual text, e.g.:\r\n\t *\r\n\t * ```TypeScript\r\n\t * pinBullet.text = \"Hello\";\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * pinBullet.text = \"Hello\";\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"series\": [{\r\n\t * // ...\r\n\t * \"bullets\": [{\r\n\t * \"type\": \"PinBullet\",\r\n\t * \"label\": {\r\n\t * \"text\": \"Hello\"\r\n\t * }\r\n\t * }]\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t * @param label Label\r\n\t */\r\n\tpublic set label(label: Label) {\r\n\t\tif (label) {\r\n\t\t\tthis._label = label;\r\n\t\t\tthis._disposers.push(label);\r\n\t\t\tlabel.shouldClone = false;\r\n\t\t\tlabel.parent = this;\r\n\t\t\tlabel.horizontalCenter = \"middle\";\r\n\t\t\tlabel.verticalCenter = \"middle\";\r\n\t\t\tlabel.textAlign = \"middle\";\r\n\t\t\tlabel.dy = 2;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Label\r\n\t */\r\n\tpublic get label(): Label {\r\n\t\treturn this._label;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all proprities and related stuff from another instance of\r\n\t * [[PinBullet]].\r\n\t *\r\n\t * @param source Source element\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tsuper.copyFrom(source);\r\n\t\tif (source.image) {\r\n\t\t\tif (!this._image) {\r\n\t\t\t\tthis.image = source.image.clone();\r\n\t\t\t}\r\n\t\t\tthis._image.copyFrom(source.image);\r\n\t\t}\r\n\t\tthis.circle.copyFrom(source.circle);\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and returns a background element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Background\r\n\t */\r\n\tpublic createBackground(): this[\"_background\"] {\r\n\t\treturn new PointedCircle();\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"PinBullet\"] = PinBullet;\r\n\n\n\n// WEBPACK FOOTER //\n// ../../../../../src/.internal/plugins/bullets/PinBullet.ts","/**\r\n * Flag bullet module.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Bullet, IBulletProperties, IBulletAdapters, IBulletEvents } from \"../../charts/elements/Bullet\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport { Label } from \"../../core/elements/Label\";\r\nimport { WavedRectangle } from \"../../core/elements/WavedRectangle\";\r\nimport { Line } from \"../../core/elements/Line\";\r\nimport { Sprite } from \"../../core/Sprite\";\r\nimport { InterfaceColorSet } from \"../../core/utils/InterfaceColorSet\";\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[FlagBullet]].\r\n */\r\nexport interface IFlagBulletProperties extends IBulletProperties {\r\n\r\n\t/**\r\n\t * Flag pole height in pixels.\r\n\t *\r\n\t * @default 10\r\n\t */\r\n\tpoleHeight?: number;\r\n\r\n}\r\n\r\n/**\r\n * Defines events for [[FlagBullet]].\r\n */\r\nexport interface IFlagBulletEvents extends IBulletEvents { }\r\n\r\n/**\r\n * Defines adapters.\r\n * \r\n * Includes both the [[Adapter]] definitions and properties.\r\n * @see {@link Adapter}\r\n */\r\nexport interface IFlagBulletAdapters extends IBulletAdapters, IFlagBulletProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Creates a flag-shaped bullet with an optional text label inside it.\r\n *\r\n * The background/body of the flag is a [[WavedRectangle]] element. Most of\r\n * its the visual appearance is configured via `background` property.\r\n *\r\n * The size of a background adopts to the size of a label automatically. If\r\n * you don't want a label to be shown at all, you can set it to `undefined`. In\r\n * this case flag size will be of the `width`/`height` set directly on the\r\n * [[FlagBullet]].\r\n *\r\n * Uses [[Label]] instance to draw the label, so the label itself is\r\n * configurable.\r\n *\r\n * Example:\r\n * \r\n * ```TypeScript\r\n * let series = chart.series.push(new am4charts.LineSeries());\r\n * // ...\r\n * let flagBullet = series.bullets.push(new am4plugins_bullets.FlagBullet());\r\n * flagBullet.poleHeight = 15;\r\n * flagBullet.label.text = \"{valueY}\";\r\n * ```\r\n * ```JavaScript\r\n * var series = chart.series.push(new am4charts.LineSeries());\r\n * // ...\r\n * var flagBullet = series.bullets.push(new am4plugins_bullets.FlagBullet());\r\n * flagBullet.poleHeight = 15;\r\n * flagBullet.label.text = \"{valueY}\";\r\n * ```\r\n * ```JSON\r\n * {\r\n * // ...\r\n * \"series\": [{\r\n * // ...\r\n * \"bullets\": [{\r\n * \"type\": \"FlagBullet\",\r\n * \"poleHeight\": 15,\r\n * \"label\": {\r\n * \"text\": \"{valueY}\"\r\n * }\r\n * }]\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @since 4.5.7\r\n * @see {@link https://www.amcharts.com/docs/v4/tutorials/plugin-bullets/} for usage instructions.\r\n * @see {@link IBulletEvents} for a list of available events\r\n * @see {@link IBulletAdapters} for a list of available Adapters\r\n */\r\nexport class FlagBullet extends Bullet {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IFlagBulletProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IFlagBulletAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IFlagBulletEvents;\r\n\r\n\t/**\r\n\t * A type for the background element.\r\n\t */\r\n\tpublic _background: WavedRectangle;\r\n\r\n\t/**\r\n\t * Label element.\r\n\t */\r\n\tprotected _label: Label;\r\n\r\n\t/**\r\n\t * An element of type [[Line]] that represents flag's \"pole\".\r\n\t * \r\n\t * To set actual height of the pole use `poleHeight` property, which\r\n\t * indicates height of the pole in pixels from bottom of the pole to the\r\n\t * bottom of the flag.\r\n\t */\r\n\tpublic pole: Line;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\r\n\t\tthis.className = \"FlagBullet\";\r\n\r\n\t\tlet background = this.background;\r\n\t\tbackground.fillOpacity = 1;\r\n\t\tbackground.events.on(\"propertychanged\", this.invalidate, this, false);\r\n\t\tbackground.waveHeight = 1.5;\r\n\t\tbackground.waveLength = 7;\r\n\t\tbackground.setWavedSides(true, false, true, false);\r\n\t\tbackground.strokeOpacity = 1;\r\n\r\n\t\tlet interfaceColors = new InterfaceColorSet();\r\n\t\tthis.stroke = interfaceColors.getFor(\"alternativeBackground\");\r\n\r\n\t\tthis.pole = this.createChild(Line);\r\n\t\tthis.pole.strokeOpacity = 1;\r\n\r\n\t\tthis.width = 22;\r\n\t\tthis.height = 16;\r\n\r\n\t\tlet label = new Label();\r\n\t\tlabel.padding(3, 5, 3, 5);\r\n\t\tlabel.dy = 1;\r\n\t\tlabel.events.on(\"propertychanged\", this.invalidate, this, false);\r\n\t\tlabel.events.on(\"positionchanged\", this.invalidate, this, false);\r\n\t\tlabel.strokeOpacity = 0;\r\n\r\n\t\tthis.label = label;\r\n\r\n\t\tthis.poleHeight = 10;\r\n\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Validates element:\r\n\t * * Triggers events\r\n\t * * Redraws the element\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic validate() {\r\n\t\tsuper.validate();\r\n\r\n\t\tthis.updateBackground();\r\n\r\n\t\tlet background = this.background;\r\n\r\n\t\tthis.pole.y1 = 0;\r\n\r\n\t\tlet poleHeight = this.poleHeight;\r\n\t\tlet label = this.label;\r\n\t\tlet bgHeight = background.pixelHeight;\r\n\r\n\t\tif (poleHeight > 0) {\r\n\t\t\tthis.pole.y2 = -poleHeight - bgHeight;\r\n\t\t\tif (label) {\r\n\t\t\t\tlabel.y = -poleHeight - bgHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.pole.y2 = -poleHeight + bgHeight;\r\n\t\t\tif (label) {\r\n\t\t\t\tlabel.y = -poleHeight;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (label && label.horizontalCenter == \"middle\") {\r\n\t\t\tthis.pole.y2 = -poleHeight;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Update the background to fit into specific dimensions.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @todo Make it protected?\r\n\t */\r\n\tpublic updateBackground(): void {\r\n\t\tlet background: Sprite = this._background; // accessing protected, as getter creates instance if it doesn't exist\r\n\t\tif (background) {\r\n\r\n\t\t\tlet label = this.label;\r\n\r\n\t\t\tif (label) {\r\n\t\t\t\tbackground.x = label.maxLeft;\r\n\t\t\t\tbackground.width = label.measuredWidth;\r\n\t\t\t\tbackground.height = label.measuredHeight;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbackground.width = Math.abs(this.maxRight - this.maxLeft);\r\n\t\t\t\tbackground.height = Math.abs(this.maxBottom - this.maxTop);\r\n\t\t\t}\r\n\t\t\tlet poleHeight = this.poleHeight;\r\n\t\t\tif (poleHeight > 0) {\r\n\t\t\t\tbackground.y = - poleHeight - background.pixelHeight;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbackground.y = - poleHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * A [[Label]] element for displaying within flag.\r\n\t *\r\n\t * Use it's `text` property to set actual text, e.g.:\r\n\t *\r\n\t * ```TypeScript\r\n\t * flagBullet.text = \"Hello\";\r\n\t * ```\r\n\t * ```JavaScript\r\n\t * flagBullet.text = \"Hello\";\r\n\t * ```\r\n\t * ```JSON\r\n\t * {\r\n\t * // ...\r\n\t * \"series\": [{\r\n\t * // ...\r\n\t * \"bullets\": [{\r\n\t * \"type\": \"FlagBullet\",\r\n\t * \"label\": {\r\n\t * \"text\": \"Hello\"\r\n\t * }\r\n\t * }]\r\n\t * }]\r\n\t * }\r\n\t * ```\r\n\t * @param label Label\r\n\t */\r\n\tpublic set label(label: Label) {\r\n\t\tif (label) {\r\n\t\t\tthis._label = label;\r\n\t\t\tthis._disposers.push(label);\r\n\t\t\tlabel.parent = this;\r\n\t\t\tlabel.shouldClone = false;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this._label) {\r\n\t\t\t\tthis._label.dispose();\r\n\t\t\t}\r\n\t\t\tthis._label = label;\r\n\t\t\tthis.invalidate();\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * @return Label\r\n\t */\r\n\tpublic get label(): Label {\r\n\t\treturn this._label;\r\n\t}\r\n\r\n\t/**\r\n\t * Copies all proprities and related stuff from another instance of\r\n\t * [[FlagBullet]].\r\n\t *\r\n\t * @param source Source element\r\n\t */\r\n\tpublic copyFrom(source: this): void {\r\n\t\tif (source.label) {\r\n\t\t\tthis.label = source.label.clone();\r\n\t\t}\r\n\t\tif (source.pole) {\r\n\t\t\tthis.pole.copyFrom(source.pole);\r\n\t\t}\r\n\t\tsuper.copyFrom(source);\r\n\t}\r\n\r\n\t/**\r\n\t * Creates and returns a background element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t * @return Background\r\n\t */\r\n\tpublic createBackground(): this[\"_background\"] {\r\n\t\treturn new WavedRectangle();\r\n\t}\r\n\r\n\t/**\r\n\t * Flag pole height in pixels.\r\n\t *\r\n\t * @default 10\r\n\t * @param value Height (px)\r\n\t */\r\n\tpublic set poleHeight(value: number) {\r\n\t\tthis.setPropertyValue(\"poleHeight\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Height (px)\r\n\t */\r\n\tpublic get poleHeight(): number {\r\n\t\treturn this.getPropertyValue(\"poleHeight\");\r\n\t}\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"FlagBullet\"] = FlagBullet;\r\n\n\n\n// WEBPACK FOOTER //\n// ../../../../../src/.internal/plugins/bullets/FlagBullet.ts","/**\r\n * Functionality for drawing Stars.\r\n */\r\n\r\n/**\r\n * ============================================================================\r\n * IMPORTS\r\n * ============================================================================\r\n * @hidden\r\n */\r\nimport { Sprite, ISpriteProperties, ISpriteAdapters, ISpriteEvents } from \"../../core/Sprite\";\r\nimport { registry } from \"../../core/Registry\";\r\nimport * as $path from \"../../core/rendering/Path\";\r\nimport * as $math from \"../../core/utils/Math\";\r\nimport * as $type from \"../../core/utils/Type\";\r\nimport * as $utils from \"../../core/utils/Utils\";\r\nimport { percent, Percent } from \"../../core/utils/Percent\";\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * REQUISITES\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Defines properties for [[Star]].\r\n */\r\nexport interface IStarProperties extends ISpriteProperties {\r\n\r\n\t/**\r\n\t * Radius of the star in pixels.\r\n\t *\r\n\t * @default 100\r\n\t */\r\n\tradius?: number;\r\n\r\n\t/**\r\n\t * Vertical radius for creating skewed star.\r\n\t *\r\n\t * This is relevant to `radius`, e.g. 0.5 will set vertical radius to half\r\n\t * the `radius`.\r\n\t */\r\n\tradiusY?: number;\r\n\r\n\t/**\r\n\t * Inner radius of the star, in px or %.\r\n\t */\r\n\tinnerRadius?: number | Percent;\r\n\r\n\t/**\r\n\t * The angle at which left edge of the star is drawn. (0-360)\r\n\t *\r\n\t * 0 is to the right of the center.\r\n\t *\r\n\t * @default -90\r\n\t */\r\n\tstartAngle?: number;\r\n\r\n\t/**\r\n\t * Radius of stars's outer corners in pixels.\r\n\t *\r\n\t * @default 0\r\n\t */\r\n\tcornerRadius?: number;\r\n\r\n\t/**\r\n\t * Radius of stars's inner corners in pixels.\r\n\t *\r\n\t * @default 0\r\n\t */\r\n\tinnerCornerRadius?: number;\r\n\r\n\t/**\r\n\t * How much of a complete circle the star will complete.\r\n\t *\r\n\t * A complete circle is 350 degrees. If set to 180, only half a star will\r\n\t * be drawn\r\n\t *\r\n\t * @default 360\r\n\t */\r\n\tarc?: number;\r\n\r\n\t/**\r\n\t * Number of points (tips).\r\n\t * \r\n\t * @default 5\r\n\t */\r\n\tpointCount?: number;\r\n}\r\n\r\n/**\r\n * Defines events for [[Star]].\r\n */\r\nexport interface IStarEvents extends ISpriteEvents { }\r\n\r\n/**\r\n * Defines adapters for [[Star]].\r\n *\r\n * @see {@link Adapter}\r\n */\r\nexport interface IStarAdapters extends ISpriteAdapters, IStarProperties { }\r\n\r\n\r\n/**\r\n * ============================================================================\r\n * MAIN CLASS\r\n * ============================================================================\r\n * @hidden\r\n */\r\n\r\n/**\r\n * Used to draw a Star shape.\r\n *\r\n * @since 4.5.7\r\n * @see {@link https://www.amcharts.com/docs/v4/tutorials/plugin-bullets/} for usage instructions.\r\n * @see {@link IStarEvents} for a list of available events\r\n * @see {@link IStarAdapters} for a list of available Adapters\r\n */\r\nexport class Star extends Sprite {\r\n\r\n\t/**\r\n\t * Defines available properties.\r\n\t */\r\n\tpublic _properties!: IStarProperties;\r\n\r\n\t/**\r\n\t * Defines available adapters.\r\n\t */\r\n\tpublic _adapter!: IStarAdapters;\r\n\r\n\t/**\r\n\t * Defines available events.\r\n\t */\r\n\tpublic _events!: IStarEvents;\r\n\r\n\t/**\r\n\t * Constructor\r\n\t */\r\n\tconstructor() {\r\n\t\tsuper();\r\n\t\tthis.className = \"Star\";\r\n\t\tthis.pointCount = 5;\r\n\t\tthis.arc = 360;\r\n\t\tthis.radius = 100;\r\n\t\tthis.innerRadius = percent(30);\r\n\t\tthis.cornerRadius = 0;\r\n\t\tthis.innerCornerRadius = 0;\r\n\t\tthis.startAngle = -90;\r\n\r\n\t\tthis.element = this.paper.add(\"path\");\r\n\t\tthis.applyTheme();\r\n\t}\r\n\r\n\t/**\r\n\t * Draws the element.\r\n\t *\r\n\t * @ignore Exclude from docs\r\n\t */\r\n\tpublic draw(): void {\r\n\t\tsuper.draw();\r\n\r\n\r\n\t\tlet startAngle = this.startAngle;\r\n\t\tlet arc = this.arc;\r\n\t\tlet pointCount = this.pointCount;\r\n\t\tlet radius = this.radius;\r\n\t\tlet innerRadius = this.pixelInnerRadius;\r\n\t\tlet cornerRadius = this.cornerRadius;\r\n\r\n\t\tif (cornerRadius > radius - innerRadius) {\r\n\t\t\tcornerRadius = radius - innerRadius;\r\n\t\t}\r\n\r\n\t\tlet innerCornerRadius = this.innerCornerRadius;\r\n\r\n\t\tif (innerCornerRadius > radius - cornerRadius - innerRadius) {\r\n\t\t\tinnerCornerRadius = radius - cornerRadius - innerRadius;\r\n\t\t}\r\n\r\n\r\n\t\tlet halfAngle = arc / pointCount / 2;\r\n\t\tlet path: string = \"\";\r\n\r\n\t\tfor (let i = 0; i < pointCount; i++) {\r\n\r\n\t\t\tlet angle = startAngle + i * arc / pointCount;\r\n\r\n\t\t\tif (cornerRadius > 0) {\r\n\t\t\t\tlet p0 = { x: innerRadius * $math.cos(angle - halfAngle), y: innerRadius * $math.sin(angle - halfAngle) };\r\n\t\t\t\tlet p1 = { x: radius * $math.cos(angle), y: radius * $math.sin(angle) };\r\n\t\t\t\tlet p2 = { x: innerRadius * $math.cos(angle + halfAngle), y: innerRadius * $math.sin(angle + halfAngle) };\r\n\r\n\t\t\t\tlet a1 = $math.getAngle(p1, p0);\r\n\t\t\t\tlet a2 = $math.getAngle(p1, p2);\r\n\r\n\t\t\t\tlet x1 = p1.x + cornerRadius * $math.cos(a1);\r\n\t\t\t\tlet y1 = p1.y + cornerRadius * $math.sin(a1);\r\n\r\n\t\t\t\tlet x2 = p1.x + cornerRadius * $math.cos(a2);\r\n\t\t\t\tlet y2 = p1.y + cornerRadius * $math.sin(a2);\r\n\r\n\t\t\t\tpath += $path.lineTo({ x: x1, y: y1 });\r\n\t\t\t\tpath += \" Q\" + p1.x + \",\" + p1.y + \" \" + x2 + \",\" + y2;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tpath += $path.lineTo({ x: radius * $math.cos(angle), y: radius * $math.sin(angle) });\r\n\t\t\t}\r\n\r\n\t\t\tangle += halfAngle;\r\n\r\n\t\t\tif (innerCornerRadius > 0) {\r\n\t\t\t\tlet p0 = { x: radius * $math.cos(angle - halfAngle), y: radius * $math.sin(angle - halfAngle) };\r\n\t\t\t\tlet p1 = { x: innerRadius * $math.cos(angle), y: innerRadius * $math.sin(angle) };\r\n\t\t\t\tlet p2 = { x: radius * $math.cos(angle + halfAngle), y: radius * $math.sin(angle + halfAngle) };\r\n\r\n\t\t\t\tlet a1 = $math.getAngle(p1, p0);\r\n\t\t\t\tlet a2 = $math.getAngle(p1, p2);\r\n\r\n\t\t\t\tlet x1 = p1.x + innerCornerRadius * $math.cos(a1);\r\n\t\t\t\tlet y1 = p1.y + innerCornerRadius * $math.sin(a1);\r\n\r\n\t\t\t\tlet x2 = p1.x + innerCornerRadius * $math.cos(a2);\r\n\t\t\t\tlet y2 = p1.y + innerCornerRadius * $math.sin(a2);\r\n\r\n\t\t\t\tpath += $path.lineTo({ x: x1, y: y1 });\r\n\t\t\t\tpath += \" Q\" + p1.x + \",\" + p1.y + \" \" + x2 + \",\" + y2;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tpath += $path.lineTo({ x: innerRadius * $math.cos(angle), y: innerRadius * $math.sin(angle) })\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.arc < 360) {\r\n\t\t\tpath += $path.lineTo({ x: 0, y: 0 })\r\n\t\t}\r\n\r\n\t\tpath += $path.closePath();\r\n\r\n\t\tpath = path.replace(\"L\", \"M\");\r\n\r\n\t\tthis.path = path;\r\n\t}\r\n\r\n\t/**\r\n\t * The angle at which left edge of the star is drawn. (0-360)\r\n\t *\r\n\t * 0 is to the right of the center.\r\n\t *\r\n\t * @default -90\r\n\t * @param value Angle (0-360)\r\n\t */\r\n\tpublic set startAngle(value: number) {\r\n\t\tthis.setPropertyValue(\"startAngle\", $math.normalizeAngle(value), true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Angle (0-360)\r\n\t */\r\n\tpublic get startAngle(): number {\r\n\t\treturn this.getPropertyValue(\"startAngle\");\r\n\t}\r\n\r\n\t/**\r\n\t * How much of a complete circle the star will complete.\r\n\t *\r\n\t * A complete circle is 350 degrees. If set to 180, only half a star will\r\n\t * be drawn\r\n\t *\r\n\t * @default 360\r\n\t * @param value Arc scope\r\n\t */\r\n\tpublic set arc(value: number) {\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = 360;\r\n\t\t}\r\n\t\tthis.setPropertyValue(\"arc\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Arc scope\r\n\t */\r\n\tpublic get arc(): number {\r\n\t\treturn this.getPropertyValue(\"arc\");\r\n\t}\r\n\r\n\t/**\r\n\t * Radius of the star in pixels.\r\n\t *\r\n\t * @default 100\r\n\t * @param value Radius (px)\r\n\t */\r\n\tpublic set radius(value: number) {\r\n\t\tthis.setPropertyValue(\"radius\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius (px)\r\n\t */\r\n\tpublic get radius(): number {\r\n\t\tlet radius: number = this.getPropertyValue(\"radius\");\r\n\t\tif (!$type.isNumber(radius)) {\r\n\t\t\tradius = 0;\r\n\t\t}\r\n\t\treturn radius;\r\n\t}\r\n\r\n\t/**\r\n\t * Vertical radius for creating skewed star shapes.\r\n\t *\r\n\t * This is relevant to `radius`, e.g. 0.5 will set vertical radius to half\r\n\t * the `radius`.\r\n\t *\r\n\t * @param value Vertical radius (0-1)\r\n\t */\r\n\tpublic set radiusY(value: number) {\r\n\t\tthis.setPropertyValue(\"radiusY\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Vertical radius (0-1)\r\n\t */\r\n\tpublic get radiusY(): number {\r\n\t\tlet value: number = this.getPropertyValue(\"radiusY\");\r\n\r\n\t\tif (!$type.isNumber(value)) {\r\n\t\t\tvalue = this.radius;\r\n\t\t}\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/**\r\n\t * Inner radius of the star (cutout).\r\n\t *\r\n\t * It can be set either by absolute pixel value or relative to radius in\r\n\t * percent.\r\n\t *\r\n\t * @default 0\r\n\t * @param value Radius (px or %)\r\n\t */\r\n\tpublic set innerRadius(value: number | Percent) {\r\n\t\tthis.setPercentProperty(\"innerRadius\", value, true, false, 10, false);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius (px or %)\r\n\t */\r\n\tpublic get innerRadius(): number | Percent {\r\n\t\treturn this.getPropertyValue(\"innerRadius\");\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius px\r\n\t */\r\n\tpublic get pixelInnerRadius(): number {\r\n\t\treturn $utils.relativeToValue(this.innerRadius, this.radius);\r\n\t}\r\n\r\n\t/**\r\n\t * Radius of star's outer corners in pixels.\r\n\t *\r\n\t * @default 0\r\n\t * @param value Radius (px)\r\n\t */\r\n\tpublic set cornerRadius(value: number) {\r\n\t\tthis.setPropertyValue(\"cornerRadius\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius (px)\r\n\t */\r\n\tpublic get cornerRadius(): number {\r\n\t\treturn this.getPropertyValue(\"cornerRadius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Radius of star's inner corners in pixels.\r\n\t *\r\n\t * @default 0\r\n\t * @param value Radius (px)\r\n\t */\r\n\tpublic set innerCornerRadius(value: number) {\r\n\t\tthis.setPropertyValue(\"innerCornerRadius\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Radius (px)\r\n\t */\r\n\tpublic get innerCornerRadius(): number {\r\n\t\treturn this.getPropertyValue(\"innerCornerRadius\");\r\n\t}\r\n\r\n\t/**\r\n\t * Number of start points\r\n\t *\r\n\t * @default 5\r\n\t * @param value\r\n\t */\r\n\tpublic set pointCount(value: number) {\r\n\t\tthis.setPropertyValue(\"pointCount\", value, true);\r\n\t}\r\n\r\n\t/**\r\n\t * @return Number of star points\r\n\t */\r\n\tpublic get pointCount(): number {\r\n\t\tlet value = this.getPropertyValue(\"pointCount\");\r\n\t\treturn $math.max(3, value);\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"Star\"] = Star;\n\n\n// WEBPACK FOOTER //\n// ../../../../../src/.internal/plugins/bullets/Star.ts","import * as m from \"../../es2015/plugins/bullets\";\nwindow.am4plugins_bullets = m;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./plugins/bullets.js\n// module id = null\n// module chunks = "],"sourceRoot":""}