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
fillorstroke, depending on thefilledproperty. 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
fillOpacityorstrokeOpacity, depending on thefilledproperty. 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
orientexplicitly when bothxandyuse band-like scales.Default value: inferred
strokeCap-
Type:
"butt"|"square"|"round"| ExprRefThe 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
nullfor 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
sizeof 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
xandx2coordinates 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
yandy2coordinates in pixels. The offset is applied after the viewport scaling and translation.Default value:
0