Config
One config block per file, at the top level. Every entry maps to a Desmos calculator setting, so this is where the graph’s chrome, axes and behaviour are set rather than any single expression’s. Entries go one to a line, as here, or share one with a ; between them.
config { // Which Desmos calculator draws the graph: GRAPHING, GEOMETRY or // GRAPHING_3D. The other two draw everything the graphing one does. calculator: GRAPHING
// Angles degreeMode: false
// Grid and axes showGrid: true showXAxis: true showYAxis: true xAxisNumbers: true yAxisNumbers: true xAxisLabel: "time (s)" yAxisLabel: "height (m)" xAxisStep: 1 yAxisStep: 2 xAxisMinorSubdivisions: 2 yAxisMinorSubdivisions: 2 xAxisArrowMode: POSITIVE yAxisArrowMode: POSITIVE
// The viewport - the rectangle of graph the calculator opens on. Desmos // keeps these in the graph's state rather than in its calculator options, // so they are the one part of a config block that setState carries and // updateSettings does not. xmin: -1 xmax: 6 ymin: -5 ymax: 25 squareAxes: false
// Coordinate system polarMode: false
// Interface - Axis leaves the settings menu, the zoom buttons and the // border off by default and starts the expression list collapsed, so a // graph is just the picture. Everything here asks for the full calculator // back. expressions: true expressionsCollapsed: false settingsMenu: true zoomButtons: true keypad: true border: true lockViewport: false trace: true pointsOfInterest: true
// Theming backgroundColor: #ffffff textColor: #222222 fontSize: 16
// Features actions: true sliders: true folders: true notes: true images: true graphpaper: true}
"Config"
"Everything above is calculator setup: axis labels, grid steps, theme, and which parts of the Desmos interface appear."
h(t) = 20t - 4.9t ^ 2 @ color: RED, lineWidth: 3
// A colour worked out once and used twice - 14-colors.axis has more.C = rgb(177, 75, 75)
"Peak of the flight."
(2.04, 20.4) @ color: C, pointSize: 16, label: "apex", showLabel, labelOrientation: above
"Ground level."
y = 0 @ color: C, lineOpacity: 0.4
folder "The viewport, read back" { "width and height are the viewport in graph units, so an expression can size itself to the window." y = height / 4 @ color: GREEN, lineStyle: DASHED "A point that stays a fifth of the way in from the left." (-width / 2 + width / 5, height / 4) @ color: GREEN, pointSize: 14}Open in playground →