Skip to content

Style Properties ​

All available Cytoscape.js CSS properties that can be used in fiz style blocks. Properties are grouped by category.

For detailed value documentation, see the Cytoscape.js style documentation.

INFO

This vocabulary belongs to the Cytoscape renderer, which is the default. A different renderer declares its own property list, and the editor's autocomplete offers whichever one is active. Properties a recipe uses that the active renderer does not know are simply passed along and ignored.

Keyword values are strings and need quotes — shape: "diamond", not shape: diamond. Settings that are not element styles at all, such as the layout and the canvas color, go in a renderer directive.

Special Properties ​

PropertyApplies ToDescription
descriptionNodes, edges, namespacesExplanatory text, shown as a secondary label

description has a shorthand: a bare string literal in a style block becomes the description. See Descriptions.

Description Properties ​

Each of these styles the description text rather than the element's own label. They mirror the label-styling properties below, prefixed with description-.

PropertyDescription
description-font-familyDescription text's font-family
description-font-styleDescription text's font-style
description-font-weightDescription text's font-weight
description-font-sizeDescription text's font-size
description-text-transformDescription text's text-transform
description-text-wrapDescription text's text-wrap
description-text-overflow-wrapDescription text's text-overflow-wrap
description-text-max-widthDescription text's text-max-width
description-text-outline-widthDescription text's text-outline-width
description-line-heightDescription text's line-height
description-colorDescription text's color
description-text-outline-colorDescription text's text-outline-color
description-text-outline-opacityDescription text's text-outline-opacity
description-text-background-colorDescription text's text-background-color
description-text-background-opacityDescription text's text-background-opacity
description-text-background-paddingDescription text's text-background-padding
description-text-border-opacityDescription text's text-border-opacity
description-text-border-colorDescription text's text-border-color
description-text-border-widthDescription text's text-border-width
description-text-border-styleDescription text's text-border-style
description-text-background-shapeDescription text's text-background-shape
description-text-justificationDescription text's text-justification
description-text-opacityDescription text's text-opacity
description-min-zoomed-font-sizeDescription text's min-zoomed-font-size

description-text-halign and description-text-valign do not exist. In Cytoscape those control label position relative to the node body rather than alignment within a block, which is incompatible with the way descriptions are drawn for export.

Node Body ​

PropertyDescription
heightNode height
widthNode width
shapeNode shape (e.g., ellipse, rectangle, diamond, triangle)
shape-polygon-pointsCustom polygon shape points
corner-radiusRounded corner radius
background-colorNode fill color
background-fillFill type (solid, linear-gradient, radial-gradient)
background-opacityFill opacity (0–1)
background-blackenDarken/lighten factor (-1 to 1)
background-gradient-stop-colorsGradient colors
background-gradient-stop-positionsGradient stop positions
background-gradient-directionGradient direction
paddingInternal padding
padding-relative-toPadding reference (width, height, average, min, max)
bounds-expansionExpand hit area beyond bounds

Node Border ​

PropertyDescription
border-colorBorder color
border-opacityBorder opacity
border-widthBorder thickness
border-styleBorder style (solid, dotted, dashed, double)
border-capBorder line cap
border-joinBorder line join
border-dash-patternCustom dash pattern
border-dash-offsetDash offset
border-positionBorder position (center, inside, outside)

Node Outline ​

PropertyDescription
outline-colorOutline color
outline-opacityOutline opacity
outline-widthOutline thickness
outline-styleOutline style
outline-offsetOutline offset from border

Background Image ​

PropertyDescription
background-imageImage URL
background-image-crossoriginCORS setting
background-image-opacityImage opacity
background-image-containmentContainment mode
background-image-smoothingImage smoothing
background-position-xHorizontal position
background-position-yVertical position
background-width-relative-toWidth reference
background-height-relative-toHeight reference
background-repeatRepeat mode
background-fitFit mode (none, contain, cover)
background-clipClip mode
background-widthImage width
background-heightImage height
background-offset-xHorizontal offset
background-offset-yVertical offset

Labels ​

PropertyApplies ToDescription
labelBothLabel text
text-rotationBothLabel rotation angle
text-margin-xBothHorizontal label offset
text-margin-yBothVertical label offset
source-labelEdgesLabel near source
source-text-rotationEdgesSource label rotation
source-text-margin-xEdgesSource label horizontal offset
source-text-margin-yEdgesSource label vertical offset
source-text-offsetEdgesSource label offset along edge
target-labelEdgesLabel near target
target-text-rotationEdgesTarget label rotation
target-text-margin-xEdgesTarget label horizontal offset
target-text-margin-yEdgesTarget label vertical offset
target-text-offsetEdgesTarget label offset along edge

Label Styling ​

PropertyApplies ToDescription
font-familyBothFont family
font-styleBothFont style (normal, italic)
font-weightBothFont weight
font-sizeBothFont size
text-transformBothText transform (none, uppercase, lowercase)
text-wrapBothWrap mode (none, wrap, ellipsis)
text-overflow-wrapBothOverflow wrap behavior
text-max-widthBothMax label width before wrapping
text-outline-widthBothText outline thickness
line-heightBothLine height for wrapped text
text-valignBothVertical alignment (top, center, bottom)
text-halignBothHorizontal alignment (left, center, right)
colorBothText color
text-outline-colorBothText outline color
text-outline-opacityBothText outline opacity
text-background-colorBothLabel background color
text-background-opacityBothLabel background opacity
text-background-paddingBothLabel background padding
text-border-opacityBothLabel border opacity
text-border-colorBothLabel border color
text-border-widthBothLabel border width
text-border-styleBothLabel border style
text-background-shapeBothLabel background shape
text-justificationBothMulti-line text justification

Visibility ​

PropertyApplies ToDescription
displayBothDisplay mode (element, none)
visibilityBothVisibility (visible, hidden)
opacityBothElement opacity (0–1)
text-opacityBothLabel opacity (0–1)
min-zoomed-font-sizeBothHide label below this font size
z-indexBothStack order

Edge Line ​

PropertyDescription
line-styleLine style (solid, dotted, dashed)
line-colorLine color
line-fillLine fill type
line-capLine cap style
line-opacityLine opacity
line-dash-patternCustom dash pattern
line-dash-offsetDash offset
line-outline-widthLine outline thickness
line-outline-colorLine outline color
line-gradient-stop-colorsLine gradient colors
line-gradient-stop-positionsLine gradient positions
curve-styleCurve type (bezier, taxi, segments, haystack, etc.)
haystack-radiusHaystack radius
source-endpointSource connection point
target-endpointTarget connection point
control-point-step-sizeControl point spacing
control-point-distancesControl point distances
control-point-weightsControl point weights
segment-distancesSegment distances
segment-weightsSegment weights
segment-radiiSegment radii
radius-typeRadius type
taxi-turnTaxi turn position
taxi-turn-min-distanceMinimum taxi turn distance
taxi-directionTaxi direction
taxi-radiusTaxi corner radius
edge-distancesEdge distance calculation mode
arrow-scaleArrow size multiplier
loop-directionSelf-loop direction
loop-sweepSelf-loop sweep angle
source-distance-from-nodeGap between edge start and source node
target-distance-from-nodeGap between edge end and target node

Edge Arrows ​

Arrow properties are available for four positions: source, mid-source, target, and mid-target.

PropertyDescription
source-arrow-shapeSource arrow shape
source-arrow-colorSource arrow color
source-arrow-fillSource arrow fill (filled, hollow)
source-arrow-widthSource arrow width
mid-source-arrow-shapeMid-source arrow shape
mid-source-arrow-colorMid-source arrow color
mid-source-arrow-fillMid-source arrow fill
mid-source-arrow-widthMid-source arrow width
target-arrow-shapeTarget arrow shape
target-arrow-colorTarget arrow color
target-arrow-fillTarget arrow fill
target-arrow-widthTarget arrow width
mid-target-arrow-shapeMid-target arrow shape
mid-target-arrow-colorMid-target arrow color
mid-target-arrow-fillMid-target arrow fill
mid-target-arrow-widthMid-target arrow width

Common arrow shapes: triangle, triangle-tee, circle-triangle, triangle-cross, triangle-backcurve, vee, tee, square, circle, diamond, chevron, none.

Not Style Properties ​

Some things a renderer needs are not properties of any node or edge, so they are not in this list:

SettingWhere it goes
Which layout runs, and its options^cytoscape{ layout: … } - see Renderer Directives
The canvas background color^cytoscape{ background-color: … }
Which renderer draws at all^<name>{ } - see Renderers
Recipe metadata~<name>{ } - see About Notes