Skip to content

Rendering

.qp.display

Display a plot with the given width and height. The renders the plot, but does not serve the plot to the IDE. The bytes can be used directly. For serving a visual, see .qp.go.

The image output (for whichever renderer was used) will be stored in the `output field of the result. The default renderer is a png renderer, and contains the following keys: `w`h`bytes.

Parameter(s):

Name Type Description
w long width in pixels
h long height in pixels
v table specification table

Returns:

Name Type Description
<returns> dict displayed GG object

See Also: .qp.go

Example:

 .qp.display[500;500] .qp.point[([]x:til 45); `x; `x; ::]
 /=>              | ::
 /=> i_.type      | `.gg.ty
 /=> i_.extensions| `symbol$()
 /=> id           | ::
 /=> origSpec     | +`id`parents`children`item!(deb08c0d-2d1f-9a...
 /=> spec         | +`id`parents`children`item!(3fe4d662-12ab-ed6...
 /=> output       | ``i_.type`i_.extensions`w`h`bytes!(::; ...

.qp.go

Render a visual specification at the given width and height, and send the visual to the IDE

Parameter(s):

Name Type Description
w long width in pixels
h long height in pixels
spec table a GG specification (for example, .qp.point[t; `x; `y; ::])

Returns:

Name Type Description
null

Example:

 .qp.go[500;500] .qp.point[([]x:til 45); `x; `x; ::]

.qp.managed

Render a visual specification at the given width and height, and send the visual to the IDE

Parameter(s):

Name Type Description
id symbol id of the managed plot
w long width in pixels
h long height in pixels
spec table a GG specification (for example, .qp.point[t; `x; `y; ::])

Returns:

Name Type Description
null

Example:

 .qp.go[500;500] .qp.point[([]x:til 45); `x; `x; ::]

.qp.png

Save a GG specification as a png

Parameter(s):

Name Type Description
filename symbol Symbolic file handle to PNG output location
w long width
h long height
spec table gg specification

Example:

 .qp.png[`:/output/file.png; 500; 500]
      .qp.point[([]x:til 45); `x; `x; ::]

.qp.push

Push a pre-rendered visual to the client

Parameter(s):

Name Type Description
gg dict a pre-rendered GG

Returns:

Name Type Description
null

Example:

 .qp.push .gg.dsl[()!()] `:image.gg