Smart Component 24
Approach fairway arcs.
Approach fairway arcs accepts normalized club targets and resolves every distanceYards value as a true metric radius around the green. The protected resolver selects the first outward centerline crossing, the fairway polygon containing that crossing, and the outermost boundary intersections bracketing the centerline. Club and plays-like values are display-only and never alter geometry.
Usage
Add the approach fairway 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.
await view.setSmartComponents([
{
type: "approach-fairway-arcs",
targets: [
{ club: "9i", distanceYards: 120, playsLikeYards: 123 },
{ club: "7i", distanceYards: 140, playsLikeYards: 143 },
],
fairwayBuffer: { distance: 15, unit: "yards" },
selection: {
interval: 2,
preserveShortest: true,
preserveLongest: true,
minimumLabelSpacing: 18,
},
labels: { clubSide: "auto", playsLikeSide: "opposite" },
},
]);Defaults
Built-in presentation.
Component options
Configure behavior and presentation.
| Option | Type | Default | Description |
|---|---|---|---|
| type | "approach-fairway-arcs" | Required | Requests protected club approach 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. |
| targets | ApproachFairwayArcTarget[] | Required | One through 12 already-normalized club targets. distanceYards controls the physical radius; playsLikeYards is optional display-only text. |
| 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. |
| selection.interval | number | 2 | Retains every nth distance-sorted club after always considering the shortest and longest preservation rules. |
| selection.preserveShortest | boolean | true | Retains the shortest approach reference. |
| selection.preserveLongest | boolean | true | Replaces the final selected intermediate club when necessary to retain the longest club. |
| selection.minimumLabelSpacing | number | 18 | Minimum same-side label separation at the 350px reference width. Collision thinning preserves the shortest and attempts to retain the longest arc. |
| labels.clubSide | "auto" | "left" | "right" | "auto" | Uses one shared club-label side. Auto compares median left and right endpoint clearance and resolves exact ties to the right. |
| labels.playsLikeSide | "opposite" | "opposite" | Places each available plays-like value on the edge opposite the club label. |
| style.strokeColor | GraphicColor | "#5A7A5C" | Dark segment, leader, endpoint, and label color. |
| style.alternateStrokeColor | GraphicColor | "rgba(255, 255, 255, 0.96)" | Contrast color used for complementary dash segments between the primary-color segments; no continuous under-stroke is drawn. |
| style.strokeWidth | number | 1.55 | Stroke width at the 350px reference width; it scales uniformly with graphic width. |
| style.dashLength | number | 2.6 | One shared dash length for every arc and leader at the 350px reference width. |
| style.dashGap | number | 2.6 | One shared dash gap for every arc and leader at the 350px reference width. |
| style.endpoint | "dot" | "none" | "dot" | Shows or hides the small fairway/leader junction dots. |
| style.labelSize | number | 14.5 | Club and plays-like label size at the 350px reference width. |
| style.labelColor | GraphicColor | "#5A7A5C" | Club and plays-like label fill. |
| style.labelOutlineColor | GraphicColor | "rgba(255, 255, 255, 0.96)" | Substantial contrast outline behind both label types. |
| style.labelOutlineWidth | number | 4.25 | Label contrast-stroke width from 0 through 16 image pixels at the 350px reference width. |
Behavior
Important implementation details.
- Supply already-normalized targets. If strategy samples are aggregated upstream, distanceYards should be the median direct green-centered ground distance per lowercase club and playsLikeYards should be the rounded mean of valid adjusted values.
- The renderer never uses playsLikeYards as the circle radius. Elevation, weather, or other adjustments remain presentation-only.
- The protected response contains only artifact-bound arc pixels, centerline crossings, endpoints, resolved label sides, ground radii, and safe labels. Fairway polygons, source coordinates, and transforms stay server-side.
- All line, dash, endpoint, leader, and typography dimensions scale from the same 350px reference width; dash cadence never depends on local fairway width or arc length.