Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

Graph_Viewport

mattt edited this page Nov 16, 2020 · 2 revisions

Graph.Viewport

viewPort "%lf,%lf,%lf,%lf,%lf" or "%lf,%lf,%lf,'%s'" The viewPort W,H,Z,x,y or W,H,Z,N specifies a viewport for the final image. The pair (W,H) gives the dimensions (width and height) of the final image, in points. The optional Z is the zoom factor, i.e., the image in the original layout will be W/Z by H/Z points in size. By default, Z is 1. The optional last part is either a pair (x,y) giving a position in the original layout of the graph, in points, of the center of the viewport, or the name N of a node whose center should used as the focus. By default, the focus is the center of the graph bounding box, i.e., (bbx/2,bby/2), where "bbx,bby" is the value of the bounding box attribute bb.

public struct Viewport: Hashable

Sample values: 50,50,.5,'2.8 BSD' or 100,100,2,450,300. The first will take the 100x100 point square centered on the node 2.8 BSD and scale it down by 0.5, yielding a 50x50 point final image.

Inheritance

Hashable

Initializers

init(width:height:center:scale:)

public init(width: Double, height: Double, center: Center, scale: Double = 1.0)

Properties

width

var width: Double

height

var height: Double

center

var center: Center

scale

var scale: Double
Clone this wiki locally