import * as p5ex from 'p5ex' ; import KanjiNode from './KanjiNode' ; import PhysicsSpring from './PhysicsSpring' ; export default class KanjiEdge extends PhysicsSpring < KanjiNode > implements p5ex . Sprite { constructor ( p , nodeA , nodeB ) { super ( p , nodeA , nodeB , 20 , 0.001 ) ; } step ( ) { super . step ( ) ; } draw ( ) { this . p . line ( this . nodeA . position . x , this . nodeA . position . y , this . nodeB . position . x , this . nodeB . position . y ) ; } drawHud ( ) { this . draw ( ) ; } toString ( ) { return this . nodeA + ' -> ' + this . nodeB ; } }