Skip to main content

Overview

The jQuery Odontogram plugin uses numeric constants to represent different dental treatments and conditions. These constants are defined globally in jquery.odontogram.js (lines 1-35) and are used with the setMode() method.

Using Treatment Modes

// Set the current treatment mode
$('#odontogram').odontogram('setMode', ODONTOGRAM_MODE_AMF)

// User clicks on tooth surface → AMF treatment applied

Treatment Mode Constants

Control Modes

ODONTOGRAM_MODE_DEFAULT
number
default:0
Default mode - No actionValue: 0Description: Do nothing when clicking on teeth. Used to deselect active modes.
var ODONTOGRAM_MODE_DEFAULT = 0
ODONTOGRAM_MODE_HAPUS
number
default:100
Delete modeValue: 100Symbol: ❌ (Red X overlay)Description: Remove treatments from clicked surfaces or teeth.
var ODONTOGRAM_MODE_HAPUS = 100
Visual: Red semi-transparent overlay with X mark

Surface Treatments (Applied to Individual Surfaces)

ODONTOGRAM_MODE_AMF
number
default:1
Amalgam FillingValue: 1Symbol: /ADescription: Amalgam filling (tambalan amalgam). Displays /A symbol on surface.Color: Layer-based (Red for pre-existing, Blue for required)
var ODONTOGRAM_MODE_AMF = 1
ODONTOGRAM_MODE_COF
number
default:2
Composite Filling / ObturaciónValue: 2Symbol: /ObDescription: Composite filling. Displays /Ob symbol on surface.Color: Layer-based (Red/Blue)
var ODONTOGRAM_MODE_COF = 2
ODONTOGRAM_MODE_FIS
number
default:3
Pit and Fissure SealantValue: 3Symbol: Purple fillDescription: Pit and fissure sealant. Fills surface with purple color (#ed3bed).
var ODONTOGRAM_MODE_FIS = 3
ODONTOGRAM_MODE_CARIES
number
default:10
Treatable CariesValue: 10Symbol: Blue fillDescription: Treatable caries. Fills surface with blue (#6896ecff).
var ODONTOGRAM_MODE_CARIES = 10
Note: This is a pathology - does NOT use layer colors
ODONTOGRAM_MODE_CARIES_UNTREATABLE
number
default:27
Untreatable CariesValue: 27Symbol: Yellow/amber fillDescription: Untreatable caries (intratables). Fills surface with amber (#FFC107).
var ODONTOGRAM_MODE_CARIES_UNTREATABLE = 27
Note: This is a pathology - does NOT use layer colors
ODONTOGRAM_MODE_SIL
number
default:28
Sellante (Sealant)Value: 28Symbol: /SDescription: Sealant. Displays /S symbol on surface.Color: Layer-based (Red/Blue)
var ODONTOGRAM_MODE_SIL = 28
ODONTOGRAM_MODE_INC
number
default:29
Incrustación (Inlay)Value: 29Symbol: IDescription: Inlay. Displays I symbol on surface.Color: Layer-based (Red/Blue)
var ODONTOGRAM_MODE_INC = 29
ODONTOGRAM_MODE_RES
number
default:31
Restauración (Restoration)Value: 31Symbol: Red fillDescription: Restoration. Fills surface with red (#dc3545).
var ODONTOGRAM_MODE_RES = 31
Note: Always red in visual, regardless of layer
ODONTOGRAM_MODE_REF
number
default:32
Restauración Filtrada (Filtered Restoration)Value: 32Symbol: /RfDescription: Filtered restoration. Displays /Rf symbol on surface.Color: Layer-based (Red/Blue)
var ODONTOGRAM_MODE_REF = 32
ODONTOGRAM_MODE_NVT
number
default:4
Surco Profundo (Deep Groove)Value: 4Symbol: /SpDescription: Deep groove (surco profundo). Displays /Sp symbol on surface.Color: Layer-based (Red/Blue)
var ODONTOGRAM_MODE_NVT = 4

Whole Tooth Treatments

ODONTOGRAM_MODE_RCT
number
default:5
Root Canal TreatmentValue: 5Symbol: ▼ (filled triangle below tooth)Description: Root canal treatment (perawatan saluran akar). Displays filled triangle.Color: Layer-based (Red/Blue)
var ODONTOGRAM_MODE_RCT = 5
ODONTOGRAM_MODE_NON
number
default:6
Tooth Absent (Unknown)Value: 6Symbol: /S in centerDescription: Tooth not present, unknown if it ever existed.
var ODONTOGRAM_MODE_NON = 6
ODONTOGRAM_MODE_UNE
number
default:7
UneruptedValue: 7Symbol: Blue XDescription: Unerupted tooth. Displays X mark in blue (#0066FF).
var ODONTOGRAM_MODE_UNE = 7
Note: Always blue in visual
ODONTOGRAM_MODE_PRE
number
default:8
Periodontitis / ParadentosisValue: 8Symbol: PdDescription: Periodontitis. Displays Pd text.Color: Layer-based (Red/Blue)
var ODONTOGRAM_MODE_PRE = 8
ODONTOGRAM_MODE_ANO
number
default:9
AnomalyValue: 9Symbol: ANO textDescription: Tooth anomaly (peg-shaped, microdontia, fusion, etc.). Displays “ANO”.
var ODONTOGRAM_MODE_ANO = 9
ODONTOGRAM_MODE_CFR
number
default:11
Fracture / Extraction IndicatedValue: 11Symbol: =Description: Fractured tooth or indicated for extraction. Displays = in center.Color: Layer-based (Red/Blue)
var ODONTOGRAM_MODE_CFR = 11
ODONTOGRAM_MODE_FMC
number
default:12
Full Metal Crown / Removable ProsthesisValue: 12Symbol: □ (square border)Description: Full metal crown or removable prosthesis. Draws thick square border.Color: Layer-based (Red/Blue)
var ODONTOGRAM_MODE_FMC = 12
ODONTOGRAM_MODE_POC
number
default:13
Porcelain CrownValue: 13Symbol: ○ (circle)Description: Porcelain crown. Draws circle in tooth center.Color: Layer-based (Red/Blue)
var ODONTOGRAM_MODE_POC = 13
ODONTOGRAM_MODE_RRX
number
default:14
Root RemnantValue: 14Symbol: Angled linesDescription: Root remnant (sisa akar). Draws angled lines.
var ODONTOGRAM_MODE_RRX = 14
ODONTOGRAM_MODE_MIS
number
default:15
Missing ToothValue: 15Symbol: Red XDescription: Missing tooth. Displays X mark in red (#FF0000).
var ODONTOGRAM_MODE_MIS = 15
Note: Always red in visual
ODONTOGRAM_MODE_IPX
number
default:16
ImplantValue: 16Symbol: IMDescription: Implant with porcelain crown. Displays “IM” text.Color: Layer-based (Red/Blue)
var ODONTOGRAM_MODE_IPX = 16
ODONTOGRAM_MODE_FRM_ACR
number
default:17
Partial/Full Denture (Pivot)Value: 17Symbol: PDescription: Partial or full denture. Displays “P” text.Color: Layer-based (Red/Blue)
var ODONTOGRAM_MODE_FRM_ACR = 17
ODONTOGRAM_MODE_BRIDGE
number
default:18
BridgeValue: 18Symbol: Π (connected line between teeth)Description: Dental bridge connecting multiple teeth. Draws connecting lines.Color: Layer-based (Red/Blue)
var ODONTOGRAM_MODE_BRIDGE = 18
Usage: Click first tooth, then click second tooth to create bridge
ODONTOGRAM_MODE_ORT
number
default:30
OrthodonticsValue: 30Symbol: ~Description: Orthodontic treatment. Displays ~ symbol on top/bottom surfaces.Color: Layer-based (Red/Blue)
var ODONTOGRAM_MODE_ORT = 30

Arrow Indicators

ODONTOGRAM_MODE_ARROW_TOP_LEFT
number
default:19
Top-Left ArrowValue: 19Symbol: ← (arrow pointing left above tooth)
var ODONTOGRAM_MODE_ARROW_TOP_LEFT = 19
ODONTOGRAM_MODE_ARROW_TOP_RIGHT
number
default:20
Top-Right ArrowValue: 20Symbol: → (arrow pointing right above tooth)
var ODONTOGRAM_MODE_ARROW_TOP_RIGHT = 20
ODONTOGRAM_MODE_ARROW_TOP_TURN_LEFT
number
default:21
Top-Turn-Left ArrowValue: 21Symbol: ↰ (curved arrow turning left above tooth)
var ODONTOGRAM_MODE_ARROW_TOP_TURN_LEFT = 21
ODONTOGRAM_MODE_ARROW_TOP_TURN_RIGHT
number
default:22
Top-Turn-Right ArrowValue: 22Symbol: ↱ (curved arrow turning right above tooth)
var ODONTOGRAM_MODE_ARROW_TOP_TURN_RIGHT = 22
ODONTOGRAM_MODE_ARROW_BOTTOM_LEFT
number
default:23
Bottom-Left ArrowValue: 23Symbol: ← (arrow pointing left below tooth)
var ODONTOGRAM_MODE_ARROW_BOTTOM_LEFT = 23
ODONTOGRAM_MODE_ARROW_BOTTOM_RIGHT
number
default:24
Bottom-Right ArrowValue: 24Symbol: → (arrow pointing right below tooth)
var ODONTOGRAM_MODE_ARROW_BOTTOM_RIGHT = 24
ODONTOGRAM_MODE_ARROW_BOTTOM_TURN_LEFT
number
default:25
Bottom-Turn-Left ArrowValue: 25Symbol: ↲ (curved arrow turning left below tooth)
var ODONTOGRAM_MODE_ARROW_BOTTOM_TURN_LEFT = 25
ODONTOGRAM_MODE_ARROW_BOTTOM_TURN_RIGHT
number
default:26
Bottom-Turn-Right ArrowValue: 26Symbol: ↳ (curved arrow turning right below tooth)
var ODONTOGRAM_MODE_ARROW_BOTTOM_TURN_RIGHT = 26

Layer Color System

Most treatments support a dual-layer color system:
var LAYER_COLORS = {
  pre: '#FF0000',  // Red for pre-existing treatments
  req: '#0066FF'   // Blue for required treatments
}

Treatments Using Layer Colors

These treatments change color based on the current annotation layer:
  • AMF, COF, SIL, INC, REF, NVT
  • RCT, POC, FMC, IPX, FRM_ACR, CFR
  • BRIDGE, ORT, PRE

Treatments With Fixed Colors (Pathologies)

These treatments maintain their original colors regardless of layer:
  • CARIES: Blue (#6896ecff)
  • CARIES_UNTREATABLE: Amber (#FFC107)
  • RES: Red (#dc3545)
  • MIS: Red (#FF0000)
  • UNE: Blue (#0066FF)
  • FIS: Purple (#ed3bed)

Usage Example

From index.html:32-114 and dental-app.js:883-892:
<!-- HTML Buttons -->
<button type="button" id="ODONTOGRAM_MODE_AMF">
  <span class="symbol">/A</span>
  <span class="name">Amalgam Filling</span>
</button>

<button type="button" id="ODONTOGRAM_MODE_CARIES">
  <span class="symbol"></span>
  <span class="name">Caries</span>
</button>
// JavaScript Event Handlers
$('#ODONTOGRAM_MODE_AMF').click(function() {
  $('#odontogram').odontogram('setMode', ODONTOGRAM_MODE_AMF)
  $(this).addClass('active')
})

$('#ODONTOGRAM_MODE_CARIES').click(function() {
  $('#odontogram').odontogram('setMode', ODONTOGRAM_MODE_CARIES)
  $(this).addClass('active')
})

// Generic handler for all mode buttons
$('[id^="ODONTOGRAM_MODE_"]').click(function() {
  var modeName = $(this).attr('id')
  var modeValue = window[modeName]
  
  if (typeof modeValue !== 'undefined') {
    $('#odontogram').odontogram('setMode', modeValue)
  }
})

Quick Reference Table

ConstantValueSymbolColorCategory
ODONTOGRAM_MODE_DEFAULT0--Control
ODONTOGRAM_MODE_HAPUS100RedControl
ODONTOGRAM_MODE_AMF1/ALayerSurface
ODONTOGRAM_MODE_COF2/ObLayerSurface
ODONTOGRAM_MODE_FIS3FillPurpleSurface
ODONTOGRAM_MODE_CARIES10FillBlueSurface
ODONTOGRAM_MODE_CARIES_UNTREATABLE27FillAmberSurface
ODONTOGRAM_MODE_SIL28/SLayerSurface
ODONTOGRAM_MODE_INC29ILayerSurface
ODONTOGRAM_MODE_RES31FillRedSurface
ODONTOGRAM_MODE_REF32/RfLayerSurface
ODONTOGRAM_MODE_NVT4/SpLayerSurface
ODONTOGRAM_MODE_RCT5LayerWhole
ODONTOGRAM_MODE_UNE7XBlueWhole
ODONTOGRAM_MODE_PRE8PdLayerWhole
ODONTOGRAM_MODE_CFR11=LayerWhole
ODONTOGRAM_MODE_FMC12LayerWhole
ODONTOGRAM_MODE_POC13LayerWhole
ODONTOGRAM_MODE_MIS15XRedWhole
ODONTOGRAM_MODE_IPX16IMLayerWhole
ODONTOGRAM_MODE_FRM_ACR17PLayerWhole
ODONTOGRAM_MODE_BRIDGE18ΠLayerWhole
ODONTOGRAM_MODE_ORT30~LayerWhole

Next Steps

Plugin Overview

Learn about the plugin architecture

Methods

Explore available plugin methods

Build docs developers (and LLMs) love