Skip to content

Tick

Tick mark is a shorthand for a rule mark. By default, the tick spans the full band of the orthogonal band scale. If the orthogonal positional channel is omitted, the tick spans the full view in that direction.

{
  "description": "Tick mark example.",

  "data": { "url": "vega-datasets/cars.json" },
  "mark": "tick",
  "encoding": {
    "x": { "field": "Horsepower", "type": "quantitative" },
    "y": {
      "field": "Cylinders",
      "type": "ordinal",
      "scale": { "padding": 0.25 }
    }
  }
}

Channels

Tick mark supports the primary position channels and the color and opacity channels.

Unlike rule, tick does not expose x2, y2, or size as part of its public API. GenomeSpy derives the endpoints internally and uses the thickness property instead of size.

Properties

buildIndex

Type: boolean

Whether the x channel should build an index for efficient subset rendering. If omitted, GenomeSpy enables indexing automatically for positional x encodings.

clip

Type: boolean | "never"

If true, the mark is clipped to the UnitView's rectangle. By default, clipping is enabled for marks that have zoomable positional scales.

color

Type: string | ExprRef

Color of the mark. Affects either fill or stroke, depending on the filled property.

cursor

Type: string | ExprRef

Mouse cursor shown while the pointer is over the mark. Mark cursor takes precedence over enclosing view cursors.

Default value: browser default

minBufferSize

Type: number

Minimum size for WebGL buffers (number of data items). Allows for using bufferSubData() to update graphics.

This property is intended for internal use.

minLength

Type: number | ExprRef

The minimum stroke length in pixels. Use this property to ensure that very short strokes remain visible even when the user zooms out.

Default value: 0

opacity

Type: number | ExprRef

Opacity of the mark. Affects fillOpacity or strokeOpacity, depending on the filled property.

orient

Type: string

The orientation of the tick mark.

If omitted, GenomeSpy infers the orientation when one positional channel uses a band-like scale and the other does not, or when the orthogonal channel is omitted. Specify orient explicitly when both x and y use band-like scales.

Default value: inferred

strokeCap

Type: "butt" | "square" | "round" | ExprRef

The style of stroke ends. Available choices: "butt", "round", and "square".

Default value: "butt"

strokeDash

Type: array

An array of of alternating stroke and gap lengths or null for solid strokes.

Default value: null

strokeDashOffset

Type: number

An offset for the stroke dash pattern.

Default value: 0

style

Type: string | string[]

Named style reference(s) resolved from config.style. If an array is provided, later styles override earlier ones.

thickness

Type: number

The thickness of the tick mark in pixels. Equivalent to the size of the underlying rule mark.

Default value: 1

tooltip

Type: HandledTooltip | null | boolean

Tooltip handler. If null, no tooltip is shown. If string, specifies the tooltip handler to use.

x

Type: number | ExprRef

Position on the x axis.

xOffset

Type: number

Offsets of the x and x2 coordinates in pixels. The offset is applied after the viewport scaling and translation.

Default value: 0

y

Type: number | ExprRef

Position on the y axis.

yOffset

Type: number

Offsets of the y and y2 coordinates in pixels. The offset is applied after the viewport scaling and translation.

Default value: 0