-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a2fedbe
commit 59910c8
Showing
10 changed files
with
163 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"private": true, | ||
"name": "@amcharts/amcharts5", | ||
"version": "5.0.0-beta.43", | ||
"version": "5.0.0-beta.44", | ||
"author": "amCharts <[email protected]> (https://www.amcharts.com/)", | ||
"description": "amCharts 5", | ||
"homepage": "https://www.amcharts.com/", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { Graphics, IGraphicsSettings, IGraphicsPrivate } from "./Graphics"; | ||
|
||
export interface ITriangleSettings extends IGraphicsSettings { | ||
} | ||
|
||
export interface ITrianglePrivate extends IGraphicsPrivate { | ||
} | ||
|
||
/** | ||
* Draws a triangle. | ||
* | ||
* @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/graphics/} for more info | ||
* @important | ||
*/ | ||
export class Triangle extends Graphics { | ||
|
||
declare public _settings: ITriangleSettings; | ||
declare public _privateSettings: ITrianglePrivate; | ||
|
||
public static className: string = "Triangle"; | ||
public static classNames: Array<string> = Graphics.classNames.concat([Triangle.className]); | ||
|
||
public _beforeChanged() { | ||
super._beforeChanged(); | ||
|
||
if (this.isDirty("width") || this.isDirty("height") || this.isPrivateDirty("width") || this.isPrivateDirty("height")) { | ||
this._clear = true; | ||
} | ||
} | ||
|
||
public _changed() { | ||
super._changed(); | ||
|
||
if (this._clear && !this.get("draw")) { | ||
this._draw(); | ||
} | ||
} | ||
|
||
protected _draw() { | ||
const w = this.width(); | ||
const h = this.height(); | ||
const display = this._display; | ||
display.moveTo(-w / 2, h / 2); | ||
display.lineTo(0, -h / 2); | ||
display.lineTo(w / 2, h / 2); | ||
display.lineTo(-w / 2, h / 2); | ||
|
||
} | ||
|
||
public _updateSize() { | ||
this.markDirty() | ||
this._clear = true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters