Smart Component 15
Tee adjustments.
Tee adjustments privately matches mapped tee pixels to the scorecard and selects an origin tee. Scorecard mode subtracts listed per-hole yardages. Yardage mode measures every tee to the same unbuffered fairway-arc midpoint (250 yards, then 230 or 270) and uses green center on Par 3s. It returns only final marker pixels, colors, signed differences, and display labels.
Usage
Add the tee adjustments to a graphic.
Include the component in the initial mount call, reconcile it through view.setSmartComponents, or append it with view.addSmartComponent. Types may repeat. Give repeated instances stable id values to style, show, hide, move, reset, or remove one instance independently. The selected Smart Component type, instance ID, render receipt, and protected selection options such as yardages, grid spacing, coverage, measured origin, buffer distance, detail, limits, or targets are sent to the overlay service. Marker-image origins, images, presentation styles, supported labels, and movement remain local.
const view = await caddie.mount(container, graphicRequest, [{
type: "tee-adjustments",
from: "Green",
measurement: "yardage",
selection: {
minimumAdjustmentYards: -60,
maximumAdjustmentYards: 60,
minimumSeparationYards: 10,
},
labels: { direction: "right", originText: "T", adjustmentFormat: "signed" },
style: {
strokeColor: "#5A7A5CCC",
alternateStrokeColor: "#FFFFFFF5",
comparisonMarkerSize: 18,
comparisonMarkerFillColor: "#202020",
comparisonMarkerOutlineColor: "#FFFFFF",
comparisonMarkerOutlineWidth: 5,
labelLetterSpacing: 0.65,
},
}]);Defaults
Built-in presentation.
Component options
Configure behavior and presentation.
| Option | Type | Default | Description |
|---|---|---|---|
| type | "tee-adjustments" | Required | Requests tee comparisons for a Hole graphic. |
| id | string | Automatic | Optional stable 1–64 character instance ID using letters, numbers, underscores, or hyphens. Use IDs to independently control repeated Smart Components of the same type. |
| from | string | null | null | Case-insensitive tee id, name, or color. Null, omitted, and unmatched values fall back to the furthest tee. |
| measurement | "scorecard" | "yardage" | "scorecard" | Scorecard subtracts listed hole yardages. Yardage compares direct distances to one shared fairway target; Par 3s use green center. |
| selection.minimumAdjustmentYards | number | -60 | Inclusive lower signed-yardage bound. |
| selection.maximumAdjustmentYards | number | 60 | Inclusive upper signed-yardage bound. |
| selection.minimumSeparationYards | number | 10 | Suppresses a candidate closer than this to a previously retained adjustment, with nearest-to-origin priority. Configured marker and label dimensions also prevent visual overlap. |
| labels.direction | "right" | "left" | "right" | Sticky edge for every leader and label. |
| labels.originText | string | null | "T" | Reference prefix for comparison labels; null and omitted values use T. |
| labels.adjustmentFormat | "absolute" | "signed" | "signed" | Signed renders T -85y or T +85y; absolute renders T 85y. The selected tee has no leader or edge label. |
| style.markerSize | number | 18 | Marker diameter from 8 through 128 image pixels. |
| style.comparisonMarkerSize | number | markerSize | Diameter for every non-origin comparison marker, from 4 through 128 image pixels. |
| style.comparisonMarkerFillColor | GraphicColor | markerFillColor / tee color | Optional fill override for non-origin comparison markers; null or omission preserves the fallback. |
| style.comparisonMarkerOutlineColor | GraphicColor | markerOutlineColor | Optional outline-color override for non-origin comparison markers. |
| style.comparisonMarkerOutlineWidth | number | markerOutlineWidth | Optional outline-width override for non-origin comparison markers, from 0 through 12 image pixels. |
| style.strokeColor | GraphicColor | "#5A7A5C" | Primary dash color; supports #RRGGBBAA and rgba(...). |
| style.alternateStrokeColor | GraphicColor | "#FFFFFF" | Continuous under-stroke shown in the primary dash gaps; supports #RRGGBBAA and rgba(...). |
| style.strokeWidth | number | 2 | Dashed leader width from 0.5 through 16 image pixels. |
| style.labelSize | number | 16 | Positive whole-number sticky signed-label size in image pixels with no upper limit. |
| style.labelLetterSpacing | number | 0.65 | Character tracking shared by label layout measurement and final SVG text. |
| style.labelFontWeight | number | 500 | Numeric CSS label weight from 100 through 900. |
| style.labelOutlineColor | GraphicColor | "#FFFFFF" | Contrast stroke behind each sticky label. |
| style.labelOutlineWidth | number | 4 | Label contrast-stroke width from 0 through 16 image pixels. |
Behavior
Important implementation details.
- The origin is always retained as a standalone T marker with no leader or edge label, even when zero falls outside a caller-supplied range.
- Alternatives are considered nearest to the origin first. Candidates inside the minimum yardage separation, with overlapping configured marker circles, or with colliding configured label heights are suppressed.
- Tee-adjustment leaders deliberately use a continuous alternate-color contrast under-stroke plus a primary dashed stroke. Both colors accept #RRGGBBAA and rgba(...) values.
- The response excludes tee identities, names, source coordinates, scorecard rows, course geometry, and transforms.