How to use the paper.Path.Line function in paper

To help you get started, we’ve selected a few paper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aamks / aamks / gui / interface / src / app / views / main / risk / results / results.component.ts View on Github external
public append_dd_geoms() {
    // We attach to the static geoms
    var g;

    for (var i = 0; i < this.dd_geoms['rectangles'].length; i++) {
      g = this.dd_geoms['rectangles'][i];
      this.staticGeoms.addChild(new Path.Rectangle({ point: new Point(g["xy"][0], -g["xy"][1]), size: new Size(g["width"], -g["depth"]), strokeColor: g['strokeColor'], strokeWidth: g['strokeWidth'], fillColor: g['fillColor'], opacity: g['opacity'] }));
    }

    for (var i = 0; i < this.dd_geoms['lines'].length; i++) {
      g = this.dd_geoms['lines'][i];
      this.staticGeoms.addChild(new Path.Line({ from: new Point(g["xy"][0], -g["xy"][1]), to: new Point(g["x1"], -g["y1"]), strokeColor: g['strokeColor'], strokeWidth: g['strokeWidth'], opacity: g['opacity'] }));
    }

    for (var i = 0; i < this.dd_geoms['circles'].length; i++) {
      g = this.dd_geoms['circles'][i];
      this.staticGeoms.addChild(new Path.Circle({ center: new Point(g["xy"][0], -g["xy"][1]), radius: g["radius"], fillColor: g['fillColor'], opacity: g['opacity'] }));
    }
    for (var i = 0; i < this.dd_geoms['texts'].length; i++) {
      g = this.dd_geoms['texts'][i];
      this.staticGeoms.addChild(new PointText({ point: new Point(g["xy"][0], -g["xy"][1]), content: g["content"], fontFamily: 'Play', fontSize: g["fontSize"], fillColor: g['fillColor'], opacity: g['opacity'] }));
    }
  }
github aamks / aamks / gui / interface / src / app / views / main / risk / results / results.component.ts View on Github external
// Old elements must be removed on various occassions, so we cannot return to early.

    if (this.evacVelocities == undefined) {
      this.evacVelocities = new Group();
      this.evacBalls = new Group();
      this.evacLabels = new Group();
    } else {
      this.evacVelocities.removeChildren();
      this.evacBalls.removeChildren();
      this.evacLabels.removeChildren();
    }

    if (this.visContainsAnimation == 0) { return; }

    for (var i = 0; i < this.numberOfEvacuees; i++) {
      this.evacVelocities.addChild(new Path.Line({ from: new Point(this.evacueesData[0][i][0], -this.evacueesData[0][i][1]), to: new Point(this.evacueesData[0][i][2], -this.evacueesData[0][i][3]), strokeColor: this.colors['fg'], strokeCap: 'round', dashArray: [2, 10], strokeWidth: this.velocitiesSize }));
    }

    for (var i = 0; i < this.numberOfEvacuees; i++) {
      this.evacBalls.addChild(new Path.Circle({ center: new Point(this.evacueesData[0][i][0], -this.evacueesData[0][i][1]), radius: this.ballsSize, fillColor: this.colors['doseN'] }));
    }
  }
github fponticelli / tempo / paperjs / src / path.ts View on Github external
  >((_: State) => new Path.Line(options.args), options)