added missing types
This commit is contained in:
parent
6156fac496
commit
99658a631a
4 changed files with 16 additions and 16 deletions
|
@ -1,9 +1,9 @@
|
|||
import { HTMLappendIt, Positionable, svgNamespace } from "../types";
|
||||
|
||||
export class SVGArrow implements HTMLappendIt {
|
||||
group;
|
||||
lineText;
|
||||
line;
|
||||
group: SVGElement;
|
||||
lineText: SVGElement;
|
||||
line: SVGElement;
|
||||
from: Positionable;
|
||||
to: Positionable;
|
||||
constructor(from: Positionable, to: Positionable) {
|
||||
|
@ -34,10 +34,10 @@ export class SVGArrow implements HTMLappendIt {
|
|||
let l = Math.sqrt(dx * dx + dy * dy);
|
||||
dx /= l;
|
||||
dy /= l;
|
||||
this.line.setAttribute('x1', this.from.x + dx * 30);
|
||||
this.line.setAttribute('y1', this.from.y + dy * 30);
|
||||
this.line.setAttribute('x2', this.to.x - dx * 40);
|
||||
this.line.setAttribute('y2', this.to.y - dy * 40);
|
||||
this.line.setAttribute('x1', (this.from.x + dx * 30) + "");
|
||||
this.line.setAttribute('y1', (this.from.y + dy * 30) + "");
|
||||
this.line.setAttribute('x2', (this.to.x - dx * 40) + "");
|
||||
this.line.setAttribute('y2', (this.to.y - dy * 40) + "");
|
||||
}
|
||||
appendIt(svg) {
|
||||
svg.appendChild(this.group);
|
||||
|
|
|
@ -2,10 +2,10 @@ import { HTMLappendIt, svgNamespace } from "../types";
|
|||
import { Tragable } from "./tragable";
|
||||
|
||||
export class SVGNode extends Tragable implements HTMLappendIt {
|
||||
group;
|
||||
circle;
|
||||
circleText;
|
||||
aboveText;
|
||||
group: SVGElement;
|
||||
circle: SVGElement;
|
||||
circleText: SVGElement;
|
||||
aboveText: SVGElement;
|
||||
constructor(node) {
|
||||
super();
|
||||
// Create the group element
|
||||
|
|
|
@ -2,9 +2,9 @@ import { HTMLappendIt, svgNamespace } from "../types";
|
|||
import { Tragable } from "./tragable";
|
||||
|
||||
export class SVGTRansition extends Tragable implements HTMLappendIt {
|
||||
group;
|
||||
rect;
|
||||
rectText;
|
||||
group: SVGElement;
|
||||
rect: SVGElement;
|
||||
rectText: SVGElement;
|
||||
constructor(trans) {
|
||||
super();
|
||||
// Create the group element
|
||||
|
|
|
@ -29,10 +29,10 @@ export class Tragable {
|
|||
});
|
||||
}
|
||||
|
||||
onMove(cb) {
|
||||
onMove(cb: (event: MouseEvent) => any) {
|
||||
this.#moveCB = cb;
|
||||
}
|
||||
onClick(cb) {
|
||||
onClick(cb: (event: MouseEvent) => any) {
|
||||
this.#clickCB = cb;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue