Ternary Plot

Category: Charts

Live preview
Soil samples by texture
Sand
20%
20%
20%
40%
40%
40%
60%
60%
60%
80%
80%
80%
Silt
Clay
Gridlines every 20%: Sand counts up the left edge, Silt along the bottom edge towards the left, Clay counts down the right edge towards its corner.
PointSandSiltClay
Field 162%25%13%
Field 235%40%25%
Field 318%52%30%
Field 412%20%68%
Field 545%15%40%

Shows what share each of three parts makes up of a whole, one dot per observation, on an equilateral triangle: a point's distance from a corner is how little of that part it has, and the corners are pure A, pure B and pure C. Values are normalised to shares that sum to 100%, gridlines run every 20% on all three axes with their percentages printed on the edges, and an optional dashed line joins the points in the order given. The axis ticks come from d3-scale's linear ticks and the placing is plain trigonometry, computed on the server, so there is no script. A hidden table gives every point's three shares. Static, settled picture; each point fades in through --k from --p (build progress 0 to 1, default 1).

Surfaces
webgoogle-apps-script-webmcp-appsandroid
Degraded on
SurfaceNote
pdfPrints the finished picture; no motion
Fields
FieldTypeRequired
titlestring (optional, max 80).optional
a_labelstring (optional, max 20, default "A"). Names the part at the top corner.optional
b_labelstring (optional, max 20, default "B"). Names the part at the bottom left corner.optional
c_labelstring (optional, max 20, default "C"). Names the part at the bottom right corner.optional
pointsarray (required, 1 to 200) of {label (string or number, max 30, default "Point n"), a, b, c (non-negative numbers up to 1e12 in size, not all zero)}. A point whose a, b or c is missing, not a finite number, negative or too large, or that sums to 0, and an entry that is not a point, is left out and counted in a note. Points beyond the first 200 are noted and not drawn.required
connectboolean (optional, default false). Only true switches it on. Draws a dashed line through the points in the given order.optional
versioninteger (optional, default 1). The ternary_plot contract the payload was written for. Only version 1 exists; a higher whole number is drawn as version 1 with a note.optional
Example payload
{
  "type": "ternary_plot"
}
ARD catalog entry
{
  "identifier": "urn:air:a2uicatalog.ai:atom:ternary_plot",
  "displayName": "Ternary Plot",
  "type": "application/vnd.a2ui.atom+json",
  "url": "https://a2uicatalog.ai/atoms/ternary_plot/",
  "capabilities": [
    "web",
    "google-apps-script-web",
    "mcp-apps",
    "android"
  ],
  "description": "Shows what share each of three parts makes up of a whole, one dot per observation, on an equilateral triangle: a point's distance from a corner is how little of that part it has, and the corners are pure A, pure B and pure C. Values are normalised to shares that sum to 100%, gridlines run every 20% on all three axes with their percentages printed on the edges, and an optional dashed line joins the points in the order given. The axis ticks come from d3-scale's linear ticks and the placing is plain trigonometry, computed on the server, so there is no script. A hidden table gives every point's three shares. Static, settled picture; each point fades in through --k from --p (build progress 0 to 1, default 1).",
  "representativeQueries": [
    "show a ternary_plot: three-part mixes as points on a triangle",
    "shows what share each of three parts makes up of a whole, one dot per observation, on an equilateral",
    "render a ternary plot"
  ]
}
← Full ARD catalog
Deploy your own Google Apps Script renderer

The renderer is an open-source Google Apps Script web app. Deploy your own instance in 4 commands — you own the URL, no dependency on the demo endpoint.

git clone https://github.com/a2uicatalog/a2ui
cd a2ui/apps-script-surface/gas-wired-renderer
clasp push && clasp deploy
Full deploy guide →