TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/spatialillusions/milsymbol/llms.txt
Use this file to discover all available pages before exploring further.
Symbol class is the core of milsymbol. Each instance represents a single military unit symbol generated from a SIDC (Symbol Identification Code) according to MIL-STD-2525 or STANAG APP-6. Once created, a symbol object can render itself to SVG, Canvas, or DOM, and can expose rich metadata about the decoded SIDC.
Constructor Signature
sidc property). All subsequent arguments are additional options objects that are merged in order.
How Options Work
Options can be spread across any number of arguments or collected into a single object — the result is identical. Every time options are updated (viasetOptions) the symbol is automatically re-rendered.
Methods can be chained directly off construction:
General Options
The SIDC (Symbol Identification Code) for the symbol. Can also be passed as
the first positional argument to the constructor instead of inside an options
object. Defaults to
''.Modifier Options
Modifiers are text or graphical additions defined in MIL-STD-2525 and STANAG APP-6. They appear as labels or decorations around the symbol frame.A text modifier for units, equipment, and installations; content is
implementation specific. Corresponds to Field H (max 20 characters).
Defaults to
''.A text modifier for units, equipment, and installations that displays either
altitude flight level, depth for submerged objects, or height of equipment or
structures on the ground. Corresponds to Field X (max 14 characters).
Defaults to
''.Auxiliary equipment indicator modifier. Defaults to
''.A text modifier for units and installations that indicates unit effectiveness
or installation capability. Corresponds to Field K (max 5 characters).
Defaults to
''.Common name for the equipment. Example:
"Hawk" for the Hawk SAM system.
Corresponds to Field AF. Defaults to ''.Three-letter code representing the country of origin. Corresponds to Field
AC. Defaults to
''.Direction of movement or orientation in degrees (not mils). Set to
undefined to remove the direction arrow entirely. Corresponds to Field
Q. Defaults to undefined.A text modifier for units, equipment, and installations that displays a
date-time group in the format
DDHHMMSSZMONYYYY, or "O/O" for on order.
Corresponds to Field W (max 16 characters). Defaults to ''.Engagement bar text. Shall be formatted as
A:BBB-CC. Corresponds to
Field AO. Defaults to ''.Engagement bar type. Should be one of
"TARGET", "NON-TARGET", or
"EXPIRED". Defaults to ''.Equipment teardown time in minutes. Corresponds to Field AE. Defaults to
''.A text modifier consisting of a one-letter reliability rating and a
one-number credibility rating. Corresponds to Field J (max 2
characters). Defaults to
''.During ballistic missile defence, identifies the unit guarding a particular
track. Corresponds to Field AQ (max 2 characters). Defaults to
''.Name of the headquarters element. Example:
'TOC' for Tactical Operations
Centre. Corresponds to Field AH. Defaults to ''.A text modifier for units indicating the number or title of the higher
echelon command (corps are designated by Roman numerals). Corresponds to
Field M (max 21 characters). Defaults to
''.A text modifier for equipment; the letters
"ENY" denote hostile symbols.
Corresponds to Field N (max 3 characters). Defaults to ''.A text modifier displaying IFF/SIF identification modes and codes.
Corresponds to Field P (max 5 characters). Defaults to
''.Composition of installation modifier. Defaults to
''.A text modifier for units, equipment, and installations that displays the
symbol’s location in degrees, minutes, and seconds (or UTM or other
applicable display format). Corresponds to Field Y (max 19
characters). Defaults to
''.Platform type identifier. Should be
"ELNOT" or "CENOT". Corresponds to
Field AD. Defaults to ''.A text modifier in an equipment symbol that identifies the number of items
present. Corresponds to Field C or Field R (max 9 characters).
Defaults to
''.A text modifier in a unit symbol that displays
(+) for reinforced, (-)
for reduced, or (±) for reinforced and reduced. Corresponds to Field F
(max 3 characters). Defaults to ''.SIGINT mobility indicator. Accepted values:
M = Mobile, S = Static, U
= Uncertain. Corresponds to Field R2. Defaults to ''.A text modifier for hostile equipment;
"!" indicates detectable electronic
signatures. Corresponds to Field L (max 1 character). Defaults to
''.Special track designators such as Non-Real Time (
NRT) or Tactically
Significant (SIG). Corresponds to Field AR (max 3 characters).
Defaults to ''.A text modifier for units rendered inside the frame; contains the name of a
special C2 Headquarters. Corresponds to Field AA (max 9 characters).
Defaults to
''.A text modifier for units and equipment that displays velocity as set forth
in MIL-STD-6040. Corresponds to Field Z (max 8 characters). Defaults
to
''.The length of the speed leader line in pixels. This value is independent of
the symbol
size. Defaults to 0.A text modifier for units, equipment, and installations; content is
implementation specific. Corresponds to Field G (max 20 characters).
Defaults to
''.A text modifier for equipment indicating equipment type. Corresponds to
Field V (max 24 characters). Defaults to
''.A text modifier for units, equipment, and installations that uniquely
identifies a particular symbol or track number. Also identifies acquisition
number when used with SIGINT symbology. Corresponds to Field T (max 21
characters). Defaults to
''.Style Options
Style options control the visual rendering of the symbol — colors, size, frame, fill, and text appearance.MIL-STD-2525D provides both MEDAL and alternate MEDAL icons for mine warfare
symbols. Set to
true to use the alternate MEDAL icons. Defaults to
false.MIL-STD-2525C specifies purple as an optional color for civilian symbols.
Set to
false to disable civilian purple coloring. Defaults to true.The color mode used for symbol fill. Can be set to a Defaults to
ColorMode object or a
string name of a registered color mode. The built-in registered modes are
"Light", "Medium", and "Dark". Use ms.ColorMode() to create a new
mode or ms.getColorMode() to retrieve an existing one.The string value is the name of a registered color mode — not a raw
color value. Passing an unregistered name will fall back to the default
behavior.
'Light'.Whether the symbol should be filled with color. Set to
false for an
outlined/unfilled symbol. Defaults to true.Overrides the affiliation-derived fill color with any valid CSS color string.
When set,
colorMode is ignored for the fill. Defaults to ''.The opacity of the symbol fill color, from
0 (transparent) to 1
(opaque). Defaults to 1.The font family used for all text labels surrounding the symbol icon.
Defaults to
'Arial'.Whether the symbol should have a frame. All symbols support being unframed,
not just those specified in MIL-STD-2525B. Defaults to
true.Overrides the color of the symbol frame with a
ColorMode object. When set
to false (the default), the frame color is derived from the affiliation and
colorMode. Defaults to false.Overrides the global headquarters staff length for this symbol instance.
When omitted the global value set by
ms.setHqStaffLength() is used.
Defaults to undefined.Whether the symbol should render its function icon inside the frame. Set to
false to display the frame only. Defaults to true.Overrides the color of the symbol’s icon. Accepts a
ColorMode object or a
CSS color string. When set to false (the default), the icon color is
derived automatically. Defaults to false.Sets the background color of the information (text label) area. Accepts a
ColorMode object or a CSS color string. Defaults to ''.Sets the frame color of the information (text label) background area.
Accepts a
ColorMode object or a CSS color string. Defaults to ''.The color used for text fields surrounding the symbol. Accepts a
ColorMode
object or a CSS color keyword / numerical RGB specification. Defaults to the
same color as the frame outline.Set to
false to suppress rendering of all text modifier fields and the
direction arrow, even if they have been populated. This lets you initialise a
symbol with full data but hide the labels. Defaults to true.The color of the outline drawn around text fields. Set to
false to inherit
the value of outlineColor. Defaults to 'rgb(239, 239, 239)'.The width in pixels of the outline drawn around text fields. Set to
false
to inherit the value of outlineWidth. Defaults to false.The relative size of text label fields. The value is a percentage of the
default symbol size of 100. For example,
40 means 40% of the octagon
width. Defaults to 40.A CSS color keyword or numerical RGB specification. When set, the symbol is
rendered in monochrome using this color without any fill. Overrides
colorMode, fillColor, and other color options. Defaults to ''.The color of the outline drawn around all symbol parts. Accepts a
ColorMode
object or a CSS color keyword / numerical RGB specification. Defaults to
'rgb(239, 239, 239)'.The width in pixels of the outline drawn around all symbol parts. Set to
0
to disable the outline. Defaults to 0.Extra padding in pixels to add around the tightly-fitted symbol bounding box.
Useful when placing symbols in contexts that clip at the bounding edge.
Defaults to
0.The
L value — the width of the icon octagon in pixels. All other symbol
dimensions scale proportionally to this value. Defaults to 100.Forces the use of simplified status modifiers. This is the automatic default
for unfilled symbols, but can be explicitly applied to filled symbols as
well. Defaults to
false.When
true, renders the symbol as a square with the insertion point at the
center. Defaults to false.Renders the symbol as a stack of unit symbols. The value indicates the number
of additional units displayed behind the main symbol. For example,
0
renders one unit, 3 renders four units in total. Defaults to 0.Per-symbol override of the global preferred standard. Set to
"2525" for
MIL-STD-2525 or "APP6" for STANAG APP-6. When omitted the global standard
set by ms.setStandard() is used. Defaults to ''.The stroke width used when drawing the symbol outline and frame. Defaults to
3.