Skip to content

Marker symbols ​

Every value of marker.symbol that is built in. The lists on this page are generated from the symbol table the renderer draws from, which follows plotly.js' symbol order and numbering.

Holochart has 55 marker symbols. Each has 4 variants, the plain symbol and -open, -dot, -open-dot, which makes 220 names.

Every name also has a numeric code. The plain symbols are numbered 0 to 54 in the order of the table below, and each variant adds 100: arrow-wide is 54, arrow-wide-open is 154, arrow-wide-dot is 254, arrow-wide-open-dot is 354.

The chart below draws all of them with marker.symbol. Hover a marker for its name and code.

Loading example…
scatter/marker-symbols

Using a symbol ​

Set marker.symbol to a name or a code, for the whole trace or with one value per point:

ts
import { createChart } from '@mk7s/holochart';

createChart(el, {
  data: [
    {
      type: 'scatter',
      mode: 'markers',
      x: [1, 2, 3, 4],
      y: [2, 3, 1, 4],
      marker: {
        // 317 is 'star-open-dot'.
        symbol: ['diamond', 'diamond-open', 'star-dot', 317],
        size: 14,
        color: '#5e74d5',
        line: { width: 1, color: '#eceef4' },
      },
    },
  ],
});
  • The default is 'circle'.
  • Names are lower case. A code can also be given as a string: '317'.
  • A value for the whole trace that the trace type does not accept is reported as an invalid marker.symbol, and the trace draws circles. The entries of a per-point array are not checked: an unknown name draws a circle.

The variants differ in what marker.color and marker.line paint:

VariantFillOutline and inner linesDot
plainmarker.colormarker.line.color, marker.line.width widenone
-opennonemarker.color, marker.line.width wide or 1 px, whichever is morenone
-dotmarker.coloras the plain symbolmarker.line.color
-open-dotnoneas -openmarker.color

In the default look marker.line.width is 0, so a plain symbol has no outline until you set a width.

Trace types ​

Trace typesAttributeSymbolsNumeric codesOne per pointCustom symbols
scatter, splom, scatterpolarmarker.symbolAll 220 namesYesYesYes
box, violinmarker.symbolAll 220 namesYesNoYes
scatter3dmarker.symbol8: circle, circle-open, cross, diamond, diamond-open, square, square-open, xNoYesNo

Custom symbols are registered names and text: glyphs: see Custom symbols.

All symbols ​

Shape is drawn from the symbol's geometry, all at the same scale: the filled area is shaded and the lines are what marker.line strokes. The arrow symbols have their tip on the data point, so they extend to one side of it.

ShapeNameCode-open-dot-open-dotNotes
circle0100200300
square1101201301
diamond2102202302
cross3103203303
x4104204304
triangle-up5105205305
triangle-down6106206306
triangle-left7107207307
triangle-right8108208308
triangle-ne9109209309
triangle-se10110210310
triangle-sw11111211311
triangle-nw12112212312
pentagon13113213313
hexagon14114214314
hexagon215115215315
octagon16116216316
star17117217317
hexagram18118218318
star-triangle-up19119219319
star-triangle-down20120220320
star-square21121221321
star-diamond22122222322
diamond-tall23123223323
diamond-wide24124224324
hourglass25125225325
bowtie26126226326
circle-cross27127227327
circle-x28128228328
square-cross29129229329
square-x30130230330
diamond-cross31131231331
diamond-x32132232332
cross-thin33133233333Line only, No dot
x-thin34134234334Line only, No dot
asterisk35135235335Line only, No dot
hash36136236336Line only
y-up37137237337Line only, No dot
y-down38138238338Line only, No dot
y-left39139239339Line only, No dot
y-right40140240340Line only, No dot
line-ew41141241341Line only, No dot
line-ns42142242342Line only, No dot
line-ne43143243343Line only, No dot
line-nw44144244344Line only, No dot
arrow-up45145245345No dot
arrow-down46146246346No dot
arrow-left47147247347No dot
arrow-right48148248348No dot
arrow-bar-up49149249349No dot
arrow-bar-down50150250350No dot
arrow-bar-left51151251351No dot
arrow-bar-right52152252352No dot
arrow53153253353No dot
arrow-wide54154254354No dot

Two notes apply to some symbols:

  • Line only: the symbol has no area to fill. The plain symbol is drawn with marker.line alone, so it is invisible while marker.line.width is 0, which is the default. Set a line width, or use the -open name, which draws the lines in marker.color.
  • No dot: the -dot and -open-dot names and codes are valid, but draw no dot. They look like the plain and the -open symbol.

Custom symbols ​

symbols.register turns an SVG path into a symbol name with the same three variants, and 'text:…' draws a character or an emoji as the marker. Both are covered in Custom markers. Registered names are not listed on this page: symbols.names() returns them at run time.

Released under the MIT License.