Smart Component 16

Fairway widths.

Fairway widths draws canonical edge-to-edge cross-sections. Tee-shot bearing is the default and uses every available station from the selected tee's straight-shot perspective, currently 220 through 260 carry yards where measured. Full profile retains every fairway-following 10-yard sample. The furthest tee is the default start point; a case-insensitive tee name or valid longitude/latitude pair can replace it.

type: "fairway-widths"component: caddie-fairway-widthsProtected placement

Usage

Add the fairway widths 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-widths",
    measurement: "bearing", // Or "profile" for the full fairway-following set.
    // Omit yardages to show every available measured station.
    yardages: "240, 270",
    from: "Blue", // Or "-83.100005, 39.991001".
    style: {
      strokeColor: "#FFFFFF",
      strokeWidth: 3,
      pointSize: 10,
      pointColor: "#FFFFFF",
      pointOutlineColor: "#07110D",
      showLabels: true,
      labelPosition: "right",
      labelPrecision: "rounded",
    },
  },
]);

view.setSmartComponentStyle({
  type: "fairway-widths",
  style: { strokeColor: "#00D5FF", pointColor: "#00D5FF" },
});

Defaults

Built-in presentation.

SubjectHole
MeasurementTee-shot bearing · 220–260 carry yards
StationsAll available measured widths
OriginFurthest tee
GeometryAuthored edge-to-edge cross-sections
Points10px · both fairway edges
LabelsRounded width · right dot · vertically centered

Component options

Configure behavior and presentation.

OptionTypeDefaultDescription
type"fairway-widths"RequiredRequests measured fairway cross-sections for a Hole graphic.
idstringAutomaticOptional stable 1–64 character instance ID using letters, numbers, underscores, or hyphens. Use IDs to independently control repeated Smart Components of the same type.
measurement"bearing" | "profile""bearing"Bearing uses the selected tee's straight-shot cross-sections at 220–260 carry yards. Profile uses every fairway-following 10-yard sample.
yardagesnumber[] | stringAll stationsUp to 12 whole-yard targets from 1 through 800, as an array or comma-delimited list. Each target selects its nearest measured station; repeated matches collapse.
fromstringFurthest teeA valid WGS 84 longitude,latitude string or case-insensitive tee name. Coordinate parsing runs before tee-name matching.
style.strokeColor#RRGGBB"#FFFFFF"Cross-section line color applied locally.
style.strokeWidthnumber3Non-scaling line width from 1 through 16 image pixels.
style.strokeStyle"solid" | "dashed" | "dotted" | "dash-dot""solid"Visible SVG line pattern.
style.pointSizenumber10Diameter of both fairway-edge points from 4 through 32 image pixels.
style.pointColor#RRGGBB"#FFFFFF"Fairway-edge point fill color.
style.pointOutlineColor#RRGGBB"#07110D"Fairway-edge point outline color.
style.showLabelsbooleantrueShows or hides the measured width labels.
style.labelPosition"left" | "right" | "alternate""right"Places each pill horizontally beside the image-left or image-right edge dot. Alternate starts right and switches sides by station.
style.labelPrecision"rounded" | "measured""rounded"Shows whole yards by default. Measured retains one decimal place when the stored width is not a whole number.
style.labelSizenumber16Positive whole-number width-label text size in image pixels with no upper limit.
style.labelColor#RRGGBB"#FFFFFF"Width-label text color.
style.labelBackgroundColor#RRGGBB"#07110D"Width-label pill color.
style.labelXPaddingnumber8Horizontal label padding from 0 through 32 image pixels.
style.labelYPaddingnumber6Vertical label padding from 0 through 20 image pixels.
style.labelGapnumber8Horizontal gap from the selected edge dot from 0 through 40 image pixels.

Behavior

Important implementation details.

  • Bearing uses every available canonical station perpendicular to the selected tee's straight-shot bearing, including future distances as data is added. Profile uses the dense canonical samples perpendicular to the local fairway direction.
  • The selected tee or coordinate is the configuration start point. Bearing uses its authored carry yardages; profile ranks stations by straight-line ground distance from that start. The resolver never interpolates or invents a station.
  • Labels default to rounded whole yards and stay vertically centered beside the selected edge dots. Measured precision restores one decimal when available. Precision and side changes are local and do not request new protected placement.
  • The origin string is parsed first as longitude,latitude with optional spaces. If it is not a valid coordinate pair, it is matched exactly against normalized tee and tee-color names without case sensitivity.
  • The default origin is the tee location with the greatest scorecard yardage for the hole, with the canonical hole tee as a safe fallback. A custom coordinate can use Bearing only when it matches a measured tee; Profile supports any valid coordinate.
  • Line, point, label, and visibility changes update immediately in the local SVG. Changing yardages, measurement set, or origin requests a new protected station selection against the cached artifact.
  • The response contains final edge pixels, measured width values, start-relative station distances, and safe label directions. It excludes tee names, source cross-sections, longitude, latitude, projection transforms, and the sidecar.
  • Par-3 holes and other holes without canonical fairway width stations fail explicitly instead of synthesizing a value.
Protected course dataThe response contains only final fairway-edge pixels, visible width values, origin-relative station distances, and safe outward label directions. Tee names, source cross-sections, fairway geometry, longitude, latitude, affine transforms, and the internal render sidecar remain server-side.