How to use the @swim/view.TypesetView.is function in @swim/view

To help you get started, we’ve selected a few @swim/view 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 swimos / swim / swim-system-js / swim-ux-js / @swim / chart / main / tick / LeftTickView.ts View on Github external
protected layoutTickLabel(tickLabel: RenderView, bounds: BoxR2, anchor: PointR2): void {
    const x0 = Math.round(anchor.x);
    const y = Math.round(anchor.y);
    const x1 = x0 - this.tickMarkLength.value!;
    const x2 = x1 - this.tickLabelPadding.value!;

    const tickLabelAnchor = new PointR2(x2, y);
    tickLabel.setAnchor(tickLabelAnchor);
    if (TypesetView.is(tickLabel)) {
      tickLabel.textAlign("right");
      tickLabel.textBaseline("middle");
    }
  }
github swimos / swim / swim-js / swim-vis-js / @swim / chart / main / tick / BottomTickView.ts View on Github external
protected layoutTickLabel(tickLabel: RenderView, bounds: BoxR2, anchor: PointR2): void {
    const x = Math.round(anchor.x);
    const y0 = Math.round(anchor.y);
    const y1 = y0 + this.tickMarkLength.value!;
    const y2 = y1 + this.tickLabelPadding.value!;

    const tickLabelAnchor = new PointR2(x, y2);
    tickLabel.setAnchor(tickLabelAnchor);
    if (TypesetView.is(tickLabel)) {
      tickLabel.textAlign("center");
      tickLabel.textBaseline("top");
    }
  }
github swimos / swim / swim-js / swim-vis-js / @swim / chart / main / tick / TopTickView.ts View on Github external
protected layoutTickLabel(tickLabel: RenderView, bounds: BoxR2, anchor: PointR2): void {
    const x = Math.round(anchor.x);
    const y0 = Math.round(anchor.y);
    const y1 = y0 - this.tickMarkLength.value!;
    const y2 = y1 - this.tickLabelPadding.value!;

    const tickLabelAnchor = new PointR2(x, y2);
    tickLabel.setAnchor(tickLabelAnchor);
    if (TypesetView.is(tickLabel)) {
      tickLabel.textAlign("center");
      tickLabel.textBaseline("bottom");
    }
  }
github swimos / swim / swim-system-js / swim-ux-js / @swim / chart / main / tick / RightTickView.ts View on Github external
protected layoutTickLabel(tickLabel: RenderView, bounds: BoxR2, anchor: PointR2): void {
    const x0 = Math.round(anchor.x);
    const y = Math.round(anchor.y);
    const x1 = x0 + this.tickMarkLength.value!;
    const x2 = x1 + this.tickLabelPadding.value!;

    const tickLabelAnchor = new PointR2(x2, y);
    tickLabel.setAnchor(tickLabelAnchor);
    if (TypesetView.is(tickLabel)) {
      tickLabel.textAlign("left");
      tickLabel.textBaseline("middle");
    }
  }

@swim/view

Unified HTML, SVG, and Canvas view hierarchy, with integrated controller architecture, animated procedural styling, and constraint-based layouts

Apache-2.0
Latest version published 3 years ago

Package Health Score

57 / 100
Full package analysis

Similar packages