Smart Component 23
Fairway distance arcs.
Fairway distance arcs turns a set of ground radii into curved cross-fairway stations. Green-center mode communicates distance remaining; tee mode communicates distance traveled. Each radius intersects the protected centerline, selects that connected fairway polygon, and is clipped to the outermost edge crossings around that centerline. The default label is the native distance, and an optional secondary label can show signed elevation, distance from tee, or the direct fairway-edge width.
Usage
Add the fairway distance arcs 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: "fairway-distance-arcs",
origin: "green-center",
yardages: [75, 100, 125, 150],
fairwayBuffer: { distance: 15, unit: "yards" },
labels: { primary: "distance", secondary: "elevation-delta" },
style: {
strokeStyle: "alternating",
strokeColor: "#5A7A5C",
alternateStrokeColor: "#FFFFFF",
labelPosition: "auto",
showLegend: true,
},
},
{
id: "client-plan",
type: "fairway-distance-arcs",
origin: "tee",
stations: [
{ distanceYards: 150, primaryLabel: "8i", secondaryLabel: "Preferred layup" },
],
labels: { primary: "custom", secondary: "custom" },
},
]);Defaults
Built-in presentation.
Component options
Configure behavior and presentation.
| Option | Type | Default | Description |
|---|---|---|---|
| type | "fairway-distance-arcs" | Required | Requests fairway-clipped distance arcs for a Hole or Green 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. |
| origin | "green-center" | "tee" | "green-center" | The center of every radius. Green center measures distance remaining; tee measures distance traveled. |
| from | string | Furthest tee | Tee origin or distance-from-tee reference: a WGS 84 longitude,latitude pair or case-insensitive tee id, name, or color. |
| yardages | number[] | Automatic | One through 12 unique whole-yard radii from 10 through 800. Do not combine with stations. |
| stations | FairwayDistanceArcStation[] | — | Explicit distanceYards geometry with optional primaryLabel and secondaryLabel client text. Do not combine with yardages. |
| fairwayBuffer | { distance: number; unit?: "yards" | "meters" } | No buffer | Applies a signed -100 through 100 yard or meter offset before resolving radial intersections. Positive expands every edge and negative contracts every edge. Unit defaults to yards; source course geometry is never mutated. |
| labels.primary | "distance" | "custom" | "none" | "distance" | Native yardage, client station text, or no primary label. |
| labels.secondary | "elevation-delta" | "distance-from-tee" | "fairway-width" | "custom" | "none" | "none" | Signed ground elevation, accumulated centerline distance from a selected tee, direct fairway-edge width, client station text, or no secondary label. |
| labels.distanceFromTeePrecision | "rounded" | "exact" | "rounded" | Rounds distance-from-tee labels to the nearest 5 yards by default. Exact preserves nearest-whole-yard labels. |
| labels.distanceFromTeeMeasurement | "arc-midpoint" | "centerline" | "arc-midpoint" | Measures direct distance from the selected tee to the protected unbuffered 50% arc point by default. Display buffering does not change this point. Centerline preserves accumulated route distance. |
| labels.fairwayWidthPrecision | "rounded" | "exact" | "exact" | Uses the nearest whole-yard straight-line distance between the two arc edge intersections by default. Rounded snaps to the nearest 5 yards. |
| style.strokeStyle | "alternating" | "solid" | "dashed" | "dotted" | "dash-dot" | "alternating" | Alternating assigns the primary and contrast colors to complementary dash segments with no continuous under-stroke. |
| style.strokeColor | GraphicColor | "#5A7A5C" | Primary arc, leader, endpoint, and default label color. |
| style.alternateStrokeColor | GraphicColor | "#FFFFFF" | Contrast color used for the complementary alternating arc and leader segments and around endpoint dots. |
| style.strokeWidth | number | 2 | Non-scaling line width from 0.5 through 16 image pixels. |
| style.strokeOpacity | number | [number, number, number] | [1, 1, 1] | One opacity for every stroke, or [left leader, complete center arc, right leader] values such as [0.5, 1, 0.5]. Endpoint markers inherit their corresponding leader opacity; no gradient is applied within the curved arc. |
| style.showEndpoints | boolean | true | Shows small dots at both clipped fairway edges. |
| style.showMiddleMarker | boolean | false | Shows the true 50% point of the unbuffered fairway arc. A positive or negative fairwayBuffer changes the visible arc and endpoints without moving this marker. |
| style.middleMarkerShape | "circle" | "triangle" | "square" | "diamond" | "circle" | Changes the midpoint symbol. Polygon markers follow the tee-to-green direction: away from a tee origin or toward a green-center origin. Diamonds add 45 degrees to that bearing. |
| style.middleMarkerSize | number | 8 | Middle-marker diameter from 1 through 64 image pixels. |
| style.middleMarkerColor | GraphicColor | Arc color | Middle-marker fill color. Defaults to strokeColor. |
| style.middleMarkerOutlineColor | GraphicColor | Alternate arc color | Middle-marker outline color. Defaults to alternateStrokeColor. |
| style.middleMarkerOutlineWidth | number | min(2, strokeWidth ÷ 2) | Middle-marker outline width from 0 through 12 image pixels. |
| style.showPrimaryLabels | boolean | true | Shows valid primary labels without recalculating geometry. |
| style.showSecondaryLabels | boolean | true | Shows valid secondary labels on the opposite edge. |
| style.labelPosition | "auto" | "left" | "right" | "auto" | Chooses one shared primary-label edge from available image whitespace or pins it left or right. Secondary labels use the opposite edge. |
| style.labelFontWeight | integer | 500 | Numeric CSS font weight from 100 through 900 for both primary and secondary labels. |
| style.labelOutlineWidth | number | 4 | Label contrast-stroke width from 0 through 16 image pixels. |
| style.minimumLabelSpacing | number | 18 | Minimum vertical separation in image pixels. Colliding labels are thinned while every arc remains visible. |
| style.leaderLabelGap | number | 8 | Minimum clear space between each leader and the measured label text plus its outline. Leaders shorten automatically as label sizes, strings, or outlines grow. |
| style.showLegend | boolean | false | Shows a rotated descriptor beside the primary yardage-label column. |
| style.legendText | string | null | "YARDS TO GREEN" | Custom printable primary text up to 80 characters. An empty string reserves the legend lane without drawing text. Null or omitted uses the origin-specific default, and tee-origin arcs default to YARDS FROM TEE. |
| style.showSecondaryLegend | boolean | false | Shows a rotated descriptor beside the secondary-label column. |
| style.secondaryLegendText | string | null | Data-specific | Custom printable secondary text up to 80 characters. An empty string reserves the legend lane without drawing text. Null or omitted uses FAIRWAY WIDTH for fairway-width labels and YARDS FROM TEE otherwise. |
| style.legendSize | number | 55% of label size | Legend text size, with an 8px minimum. |
| style.legendFontWeight | integer | 500 | Numeric CSS font weight from 100 through 900. |
| style.legendColor | GraphicColor | Label color | Rotated legend text color. |
| style.legendOutlineColor | GraphicColor | Label outline | Contrast outline behind the legend. |
| style.legendOutlineWidth | number | ⅔ label outline | Legend outline width from 0 through 12 image pixels. |
| style.legendInset | number | 8 | Clear space from the image edge to the legend. |
| style.legendGap | number | 8 | Clear space between the legend and the primary label column. |
| style.legendLetterSpacing | number | 1 | Additional spacing between legend characters. |
Behavior
Important implementation details.
- Automatic green-center yardages follow the measured tee-to-green distance; automatic tee yardages use 200, 250, and 300 yards.
- Elevation delta is sampled at each arc's protected centerline crossing and compared with sampled ground elevation at the origin. It does not represent ball flight or adjusted playing distance.
- Distance from tee defaults to direct metric distance from the selected tee to the same protected 50% arc point used by the middle marker. It does not subtract the approach radius from scorecard yardage. The centerline option instead measures accumulated route distance and remains useful for dogleg progress.
- Fairway width is the straight endpoint chord between the two protected fairway-edge intersections. It is measured in metric course space and never follows the longer curved arc path.
- Custom labels never control geometry: distanceYards remains the authoritative radius. This lets a client add clubs, strategy, or personalized guidance without sending course geometry.
- Auto chooses one consistent primary-label side from the image whitespace across all arcs. Secondary labels occupy the opposite side. Collision handling preserves the nearest station and attempts to retain the farthest station.
- When enabled, the legend follows the primary label side, rotates −90° on the left or +90° on the right, and reserves its own edge column so yardage labels do not overlap it.
- Leader endpoints are computed from the current label string, font size, letter spacing, and outline width so dashed lines stop before the characters instead of passing underneath them.
- Changing appearance or visibility is local. Changing origin, from, radii, label sources, or custom station text requests fresh protected placement against the cached artifact.
- The response contains only final arc pixels, clipped endpoints, the centerline crossing pixel, distanceYards, and safe display strings. Fairway polygons, source elevations, tee identities, geographic coordinates, transforms, and the render sidecar remain server-side.