diff --git a/packages/docs-nextra/components/doenet-example.tsx b/packages/docs-nextra/components/doenet-example.tsx new file mode 100644 index 000000000..8a21dfd71 --- /dev/null +++ b/packages/docs-nextra/components/doenet-example.tsx @@ -0,0 +1,24 @@ +import React from "react"; +import { DoenetViewer } from "./doenet"; +import { Tabs } from "nextra/components"; + +/** + * Render DoenetML as an example in documentation. + */ +export function DoenetExample({ + source, + children, +}: React.PropsWithChildren<{ source: string }>) { + return ( +
+ + +
+ +
+
+ {children} +
+
+ ); +} diff --git a/packages/docs-nextra/components/doenet.tsx b/packages/docs-nextra/components/doenet.tsx index f778044e7..37f4b9f7c 100644 --- a/packages/docs-nextra/components/doenet.tsx +++ b/packages/docs-nextra/components/doenet.tsx @@ -1,6 +1,38 @@ import React from "react"; -import dynamic from "next/dynamic"; +import { + DoenetViewer as DoenetViewerOrig, + DoenetEditor as DoenetEditorOrig, +} from "@doenet/doenetml-iframe"; +import "@doenet/virtual-keyboard/style.css"; -export const DoenetML = dynamic(() => import("./doenetInternal"), { - ssr: false, -}); +/** + * Render DoenetML in an iframe so that its styling/state is completely isolated from the page. + */ +export function DoenetViewer({ + source, +}: React.PropsWithChildren<{ source: string }>) { + return ; +} + +export function DoenetEditor({ + source, + showFormatter = false, + viewerLocation = "right", + height = "500px", +}: React.PropsWithChildren<{ + source: string; + showFormatter?: boolean; + viewerLocation?: "left" | "right" | "top" | "bottom"; + height?: string; +}>) { + return ( +
+ +
+ ); +} diff --git a/packages/docs-nextra/components/doenetInternal.tsx b/packages/docs-nextra/components/doenetInternal.tsx deleted file mode 100644 index 93789240d..000000000 --- a/packages/docs-nextra/components/doenetInternal.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from "react"; - -//import { renderDoenetToContainer } from "doenet-standalone-test"; -declare module window { - function renderDoenetToContainer( - domNode: HTMLElement, - content: string, - ): void; -} - -export function DoenetInternal({ children }: React.PropsWithChildren<{}>) { - return ( -
{ - if (domNode) { - console.log("rendering the doenet"); - window.renderDoenetToContainer( - domNode, - String(children || ""), - ); - } - }} - >
- ); -} - -export default DoenetInternal; diff --git a/packages/docs-nextra/components/doenetml-example.tsx b/packages/docs-nextra/components/doenetml-example.tsx deleted file mode 100644 index 4985f4061..000000000 --- a/packages/docs-nextra/components/doenetml-example.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import React from "react"; -import { IframeDoenetML } from "./iframe-doenetml"; -import { Tabs } from "nextra/components"; - -/** - * Render DoenetML as an example in documentation. - */ -export function DoenetMLExample({ children }: React.PropsWithChildren<{}>) { - if (typeof children !== "string") { - console.error( - "Error with DoenetML component. Expected a string child containing DoenetML source code, but found", - children, - ); - return ( -
- Error with DoenetML component. Expected a string child - containing DoenetML source code, but found {typeof children}. - Check the console for details -
- ); - } - const source = children.trim(); - return ( -
- - -
- {source} -
-
- -
{source}
-
-
-
- ); -} diff --git a/packages/docs-nextra/components/iframe-doenetml.tsx b/packages/docs-nextra/components/iframe-doenetml.tsx deleted file mode 100644 index 7677965fc..000000000 --- a/packages/docs-nextra/components/iframe-doenetml.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import React from "react"; -import { DoenetViewer } from "@doenet/doenetml-iframe"; -import "@doenet/virtual-keyboard/style.css"; - -/** - * Render DoenetML in an iframe so that its styling/state is completely isolated from the page. - */ -export function IframeDoenetML({ children }: React.PropsWithChildren<{}>) { - if (typeof children !== "string") { - console.error( - "Error with DoenetML component. Expected a string child containing DoenetML source code, but found", - children, - ); - return ( -
- Error with DoenetML component. Expected a string child - containing DoenetML source code, but found {typeof children}. - Check the console for details -
- ); - } - return ; -} diff --git a/packages/docs-nextra/components/index.ts b/packages/docs-nextra/components/index.ts index b9c1ce464..cfcddad52 100644 --- a/packages/docs-nextra/components/index.ts +++ b/packages/docs-nextra/components/index.ts @@ -1,2 +1,3 @@ -export * from "./doenetml-example"; +export * from "./doenet-example"; export * from "./props-display"; +export * from "./doenet"; diff --git a/packages/docs-nextra/next.config.mjs b/packages/docs-nextra/next.config.mjs index 76671ee12..1c8b2108e 100644 --- a/packages/docs-nextra/next.config.mjs +++ b/packages/docs-nextra/next.config.mjs @@ -1,5 +1,11 @@ import nextraConfig from "nextra"; -import { autoInsertAttrPropDescriptions } from "./dist/index.js"; +import { + autoInsertAttrPropDescriptions, + wrapDoenetExample, + wrapDoenetEditor, + wrapDoenetEditorHorizontal, + wrapDoenetViewer, +} from "./dist/index.js"; import { getHighlighter, bundledLanguages, bundledThemes } from "shiki"; import fs from "node:fs"; @@ -58,7 +64,13 @@ const withNextra = nextraConfig({ return await highlighter; }, }, - remarkPlugins: [autoInsertAttrPropDescriptions], + remarkPlugins: [ + autoInsertAttrPropDescriptions, + wrapDoenetExample, + wrapDoenetEditor, + wrapDoenetEditorHorizontal, + wrapDoenetViewer, + ], rehypePlugins: [ /** * Add any data in `extraSearchData` to `structurizedData` so that it shows up in the search box. diff --git a/packages/docs-nextra/pages/reference/doenetML_components/abs.mdx b/packages/docs-nextra/pages/reference/doenetML_components/abs.mdx index f8840be15..76f572011 100644 --- a/packages/docs-nextra/pages/reference/doenetML_components/abs.mdx +++ b/packages/docs-nextra/pages/reference/doenetML_components/abs.mdx @@ -1,4 +1,4 @@ -import { DoenetML} from "../../../components/doenet" +import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components" # `` @@ -18,7 +18,7 @@ The `` component has no attibutes or properties. ### Example: Render the absolute value of a math expression -```html +```doenet |5 - 8| = 5 - 8 ``` The `` component is used to render the absolute value of a math expression. Test code [here](https://www.doenet.org/portfolioeditor/_J1J2N530LyIvVWx64xB8V/_AgzWwqGV6Yy9DfqMyGlFm). @@ -26,7 +26,7 @@ The `` component is used to render the absolute value of a math expression. ### Example: Absolute value of `` -```html +```doenet

Type any number:

|$userN| = $userN

``` @@ -34,7 +34,7 @@ The `` component is used to render the absolute value of a named ` ### Example: Absolute value of numerical properties -```html {5} +```doenet {5}

Move the point in the third quadrant.

(-5,-5) @@ -47,7 +47,7 @@ Children of the `` component can include references to `` values ### Example: Absolute value of a function -```html {4} +```doenet {4} (1/4)x^2 - 4 diff --git a/packages/docs-nextra/pages/reference/doenetML_components/alert.mdx b/packages/docs-nextra/pages/reference/doenetML_components/alert.mdx index 18ff90417..d7a018266 100644 --- a/packages/docs-nextra/pages/reference/doenetML_components/alert.mdx +++ b/packages/docs-nextra/pages/reference/doenetML_components/alert.mdx @@ -1,4 +1,4 @@ -import { DoenetML} from "../../../components/doenet" +import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components" # `` @@ -10,14 +10,11 @@ The `` component has no attributes or properties. ### Example: Basic use -```html +```doenet

Take the right turn.

``` ### Test Code - -{` - - -`} - \ No newline at end of file +```doenet-editor + +``` \ No newline at end of file diff --git a/packages/docs-nextra/pages/reference/doenetML_components/and.mdx b/packages/docs-nextra/pages/reference/doenetML_components/and.mdx index 8bf372e83..311cf6d65 100644 --- a/packages/docs-nextra/pages/reference/doenetML_components/and.mdx +++ b/packages/docs-nextra/pages/reference/doenetML_components/and.mdx @@ -1,4 +1,4 @@ -import { DoenetML} from "../../../components/doenet" +import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components" # `` @@ -15,7 +15,7 @@ The `` component has no attributes or properties. ### Example: `` in a `` -```html {10} +```doenet {10}

Enter a number between 5 and 10, excluding 7:

@@ -33,7 +33,7 @@ The `` component functions as the boolean operator `and` or `&`, and checks ### Example: `` in an `` -```html {18} +```doenet {18}

Move the point to the intersection of the circle and the line in the first quadrant. (Scroll down to check work.)

@@ -69,7 +69,7 @@ An `` component is used to construct a compound boolean from three referenc ### Example: An alternative to `` -```html {9} +```doenet {9}

Enter a number between 5 and 10, excluding 7:

@@ -85,9 +85,6 @@ The word `and` may be typed directly within any component that takes a boolean e ### Test Code - -{` - - -`} - \ No newline at end of file +```doenet-editor + +``` \ No newline at end of file diff --git a/packages/docs-nextra/pages/reference/doenetML_components/angle.mdx b/packages/docs-nextra/pages/reference/doenetML_components/angle.mdx index b1e8f2466..01ae5de29 100644 --- a/packages/docs-nextra/pages/reference/doenetML_components/angle.mdx +++ b/packages/docs-nextra/pages/reference/doenetML_components/angle.mdx @@ -1,4 +1,4 @@ -import { DoenetML} from "../../../components/doenet" +import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components" import { AttrDisplay, PropDisplay } from "../../../components" # `{:dn}` diff --git a/packages/docs-nextra/pages/reference/doenetML_components/animateFromSequence.mdx b/packages/docs-nextra/pages/reference/doenetML_components/animateFromSequence.mdx index 83895aa6d..1fcb76035 100644 --- a/packages/docs-nextra/pages/reference/doenetML_components/animateFromSequence.mdx +++ b/packages/docs-nextra/pages/reference/doenetML_components/animateFromSequence.mdx @@ -1,7 +1,6 @@ -import { DoenetML} from "../../../components/doenet" +import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components" - -{` +```doenet-viewer
<tage>animateFromSequence</tage> @@ -344,5 +343,4 @@ n = 0
-`} -
+``` \ No newline at end of file diff --git a/packages/docs-nextra/pages/reference/doenetML_components/answer.mdx b/packages/docs-nextra/pages/reference/doenetML_components/answer.mdx index f4df42996..18a0b1d68 100644 --- a/packages/docs-nextra/pages/reference/doenetML_components/answer.mdx +++ b/packages/docs-nextra/pages/reference/doenetML_components/answer.mdx @@ -1,4 +1,4 @@ -import { DoenetML} from "../../../components/doenet" +import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components" # `` @@ -8,13 +8,10 @@ import { DoenetML} from "../../../components/doenet" ## Basic usage examples ### Example: - -{` - +```doenet-editor

stuff inside

-`} -
+``` brief expo. diff --git a/packages/docs-nextra/pages/reference/doenetML_components/aside.mdx b/packages/docs-nextra/pages/reference/doenetML_components/aside.mdx index f4df42996..e189815ac 100644 --- a/packages/docs-nextra/pages/reference/doenetML_components/aside.mdx +++ b/packages/docs-nextra/pages/reference/doenetML_components/aside.mdx @@ -1,4 +1,4 @@ -import { DoenetML} from "../../../components/doenet" +import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components" # `` @@ -8,13 +8,11 @@ import { DoenetML} from "../../../components/doenet" ## Basic usage examples ### Example: - -{` - +```doenet-editor

stuff inside

-`} -
+``` + brief expo. diff --git a/packages/docs-nextra/pages/reference/doenetML_components/boolean.mdx b/packages/docs-nextra/pages/reference/doenetML_components/boolean.mdx index 98c1cdaf1..5e2b83b98 100644 --- a/packages/docs-nextra/pages/reference/doenetML_components/boolean.mdx +++ b/packages/docs-nextra/pages/reference/doenetML_components/boolean.mdx @@ -1,4 +1,4 @@ -import { DoenetMLExample } from "../../../components" +import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components" # `` @@ -9,24 +9,18 @@ The `` component renders the boolean value of `true` or `false` of the ### Example: Check if an equation is `true` or `false` - -{` - +```doenet-editor

The following equation is 1 + 1 = $input.

1 + 1 = -
-`} -
+``` A `` component is used to render whether an equation is `true` or `false` for a user-supplied response. ### Example: Boolean value of a geometric property - -{` - +```doenet-editor

The slope of the line is greater than or equal to 1: $line1.slope >= 1

@@ -34,9 +28,7 @@ A `` component is used to render whether an equation is `true` or `fals (-4,-4)
- -`} - +``` A `` component is used to render whether a statement regarding the geometric slope of a named `` is `true` or `false`. Drag the point to adjust the slope of the line which in turn will affect the value of the ``. @@ -44,9 +36,7 @@ A `` component is used to render whether a statement regarding the geom ### Example: Constructing compound booleans - -{` - +```doenet-editor

Enter a number that is less than 100, greater than 20, and divisible by 3.

@@ -58,9 +48,7 @@ A `` component is used to render whether a statement regarding the geom

$userNumber could be the number... $lessThan100 and $greaterThan20 and $divisibleBy3 !

-
-`} -
+``` References to `boolean` components can be combined with logical operators to create more complex boolean expressions. @@ -83,15 +71,11 @@ References to `boolean` components can be combined with logical operators to cre ### Example: `symbolicEquality` attribute - -{` - +```doenet-editor

Enter x^2 + 2x + 1 exactly:

$mi = x^2 + 2x + 1

Now, enter (x + 1)^2 instead...

-
-`} -
+``` Comparing two values with the `symbolicEquality` attribute switches the default comparison method to one which demands exact syntactical equality. Without this attribute, a value of `true` would be returned both for `x^2 + 2x + 1` as well as `(x + 1)^2`. @@ -99,14 +83,10 @@ switches the default comparison method to one which demands exact syntactical eq ### Example: `expandOnCompare` attribute - -{` - +```doenet-editor

Enter (x + 1)^2:

$mi = x^2 + 2x + 1 -
-`} -
+``` Comparing two values with the `expandOnCompare` and `symbolicEquality` attributes allows expressions that are @@ -115,15 +95,11 @@ equivalent after expanding to evaluate to `true`. It is a partial relaxation of ### Example: `simplifyOnCompare` attribute - -{` - +```doenet-editor

Enter x*x + x + x + 1:

$mi = x^2 + 2x + 1 -
-`} -
+``` Comparing two values with the `simplifyOnCompare` and `symbolicEquality` attributes allows expressions that are @@ -131,51 +107,39 @@ equivalent after simplifying to evaluate to `true`. It is a partial relaxation o ### Example: `unorderedCompare` attribute - -{` - +```doenet-editor

Enter 1,2,3,4,5 in that exact order:

$mi = 1 2 3 4 5

Enter 1,2,3,4,5 in mixed-up order:

$mi2 = 1 2 3 4 5

-
-`} -
+``` When multiple values are compared within a single ``tag, the default behavior is to match the order of the listed values. If order is irrelevant, use the `unorderedCompare` attribute. ### Example: `matchByExactPositions` attribute - -{` - +```doenet-editor

Enter 1,2,3 in that exact order: , ,

($mi1, $mi2, $mi3) = (1, 2, 3)

Now, observe what happens when you switch the order

-
-`} -
+``` When multiple responses are evaluated by comparison with a vector of correct values inside a ``, the `matchByExactPositions` attribute enforces a strict order onto the validation. Only correct values in the correct answer blanks will allow the `` to evaluate to `true`. ### Example: `allowedErrorInNumbers` and `allowedErrorIsAbsolute` attributes - -{` - +```doenet-editor

Enter a number within 10\% of 100:

$mi1 = 100

Enter a number within 0.1 of 100:

$mi2 = 100 -
-`} -
+``` The `allowedErrorInNumbers` attribute may be used to specify the acceptable error of an approximate response when comparing numerical values. By default, the error is specified as a fractional value. @@ -184,17 +148,13 @@ To specify an allowed error with a specific numerical value (rather than as a fr ### Example: `caseInsensitiveMatch` attribute - -{` - +```doenet-editor

Enter tTkLp:

tTkLp = $ti1

Enter tTkLp with any capitalization:

tTkLp = $ti2 -
-`} -
+``` Use the `caseInsensitiveMatch` attribute if capitalization is not relevant for comparison. @@ -202,18 +162,14 @@ is not relevant for comparison. ### Example: `matchBlanks` attribute - -{` - +```doenet-editor

Compare two expressions with blanks

= /x

$mi = /x

Comparing without the matchBlanks attribute:

$mi = /x

-
-`} -
+``` Use the `matchBlanks` attribute to accurately compare two expressions containing blanks. @@ -228,39 +184,29 @@ Use the `matchBlanks` attribute to accurately compare two expressions containing ### Example: `text` property - -{` - +```doenet-editor

Enter "1" for true, not "1" for false:

1 = $mi

text = $bool.text

-
-`} -
+``` The `text` property of a named `` returns the value of "true" or "false" as a string. ### Example: `value` property - -{` - +```doenet-editor

Enter "1" for true, not "1" for false:

1 = $mi

value = $bool.value

-
-`} -
+``` The `value` property of a named `` returns its value of `true` or `false`. ### Example: Attributes as properties - -{` - +```doenet-editor x^2 + 2x + 1 = (x + 1)(x + 1) @@ -273,9 +219,7 @@ value of `true` or `false`.

simplifyOnCompare = $bool.simplifyOnCompare

unorderedCompare = $bool.unorderedCompare

matchByExactPositions = $bool.matchByExactPositions

-
-`} -
+``` All attributes of a `` are also available as properties. diff --git a/packages/docs-nextra/pages/reference/doenetML_components/componentIndex.mdx b/packages/docs-nextra/pages/reference/doenetML_components/componentIndex.mdx index 4285d6de1..3c4550ca3 100644 --- a/packages/docs-nextra/pages/reference/doenetML_components/componentIndex.mdx +++ b/packages/docs-nextra/pages/reference/doenetML_components/componentIndex.mdx @@ -1,4 +1,4 @@ -import { DoenetML} from "../../../components/doenet" +import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components" # Alphabetical Component Index diff --git a/packages/docs-nextra/pages/reference/doenetML_components/mathInput.mdx b/packages/docs-nextra/pages/reference/doenetML_components/mathInput.mdx index 168af5292..d92f77004 100644 --- a/packages/docs-nextra/pages/reference/doenetML_components/mathInput.mdx +++ b/packages/docs-nextra/pages/reference/doenetML_components/mathInput.mdx @@ -1,4 +1,4 @@ -import { DoenetML} from "../../../components/doenet" +import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components" # `` @@ -41,7 +41,7 @@ In addition, a `` cannot function if nested within any [Display Math ### Example: Assign a name to user-input math expression -```html {2} +```doenet {2}

Type x^2 + sqrt4 - 1/y:

You've typed: $userExpression

@@ -50,7 +50,7 @@ A `` renders an input field for storing and naming user-provided mat ### Example: Do some math with user-input -```html {3} +```doenet {3}

Enter pi/4:

sin($userAngle) = @@ -62,7 +62,7 @@ A named `` can be referenced within a `` for computations. Tes ### Example: `` with structured prefill -```html {4} +```doenet {4}

Simplify.

2/10 = diff --git a/packages/docs-nextra/pages/reference/essentialConcepts.mdx b/packages/docs-nextra/pages/reference/essentialConcepts.mdx index ab8ad8db4..1a64821ff 100644 --- a/packages/docs-nextra/pages/reference/essentialConcepts.mdx +++ b/packages/docs-nextra/pages/reference/essentialConcepts.mdx @@ -11,7 +11,7 @@ DoenetML is a **markup language** much like HTML. When creating content in Doene * **Properties** - information stored internally relating to a component that may be accessed by referencing the component by name, followed by the name of the property. -```html +```doenet

This is a graphical component: (1,2)

@@ -74,7 +74,7 @@ Components can communicate information between one another by means of reference When you need to access the value of the named component or one of its stored properties, use the notation `$componentName` to create a reference to the component itself, and use the notation `$componentName.propertyName` to create a reference to one of its properties. -```html +```doenet

Referencing the line component on a graph:

diff --git a/packages/docs-nextra/pages/style.css b/packages/docs-nextra/pages/style.css index 33ba85d58..bfcc10307 100644 --- a/packages/docs-nextra/pages/style.css +++ b/packages/docs-nextra/pages/style.css @@ -1,6 +1,12 @@ -.doenetml-example-container { - border: 2px dashed black; +.doenet-example-container { + border: 2px solid rgb(229, 231, 235); border-radius: 10px; + padding: 0px; + margin-top: 1.5rem; +} + +.doenet-editor-container { + margin-top: 1.5rem; } .attr-table, diff --git a/packages/docs-nextra/pages/testExDoenetML.mdx b/packages/docs-nextra/pages/testExDoenetML.mdx index 746106e9d..1864797c0 100644 --- a/packages/docs-nextra/pages/testExDoenetML.mdx +++ b/packages/docs-nextra/pages/testExDoenetML.mdx @@ -1,25 +1,21 @@ -import { DoenetML} from "../components/doenet" +import { DoenetViewer, DoenetEditor, DoenetExample } from "../components" # Welcome to Nextra Hello, world! - -{` +```doenet-viewer -`} - +``` ```html foo ``` - -{` +```doenet-viewer

The value of the slider is

$a -`} -
\ No newline at end of file +``` \ No newline at end of file diff --git a/packages/docs-nextra/pages/tutorials/intermediateTutorial/iT2-1-cartesian.mdx b/packages/docs-nextra/pages/tutorials/intermediateTutorial/iT2-1-cartesian.mdx index e64725a29..7ea3519d6 100644 --- a/packages/docs-nextra/pages/tutorials/intermediateTutorial/iT2-1-cartesian.mdx +++ b/packages/docs-nextra/pages/tutorials/intermediateTutorial/iT2-1-cartesian.mdx @@ -1,11 +1,11 @@ -import { DoenetMLExample } from "../../../components" +import { DoenetViewer, DoenetEditor, DoenetExample } from "../../../components" # Cartesian Grids and Function Graphs One of the most powerful features of DoenetML is the ability to create complicated graphics with a few lines of code. This section covers the basics of the `` tag and its attributes, and shows you how to graph a function $y = f(x)$. Later sections will demonstrate how to graph points, lines, polygons, circles, and other objects. By default, the following code creates the Cartesian grid, which goes from -10 to 10 in both the $x$ and $y$ directions. -```html +```doenet ``` Test code [here](https://www.doenet.org/portfolioeditor/_J1J2N530LyIvVWx64xB8V/_AgzWwqGV6Yy9DfqMyGlFm). @@ -22,8 +22,7 @@ DoenetML has attributes to adjust various features of a graph: the range of $x$ Rather that listing out all of the possible attributes and values, documentation-style, you can learn these options by experimenting with the controls below. Try adjusting values and see how the graph changes. Doenet also provides you with the corresponding code to create the graph; you can copy and paste that code into your own documents. - -{` +```doenet-example xmin= @@ -88,8 +87,7 @@ Rather that listing out all of the possible attributes and values, documentation showNavigation="$showControls" showBorder="$showBorder" horizontalAlign="$alignChoice"/> -`} - +``` Notice that the `` code above includes `grid` (which is equivalent to `grid="true"`) when you check the grid box, but the tag does not include `grid="false"` if the grid is turned off. That's because `false` is the default value for `grid`; hence the attribute doesn't need to be included in that case. Similarly, the other attributes are suppressed if their default values are chosen: @@ -101,14 +99,14 @@ Notice that the `` code above includes `grid` (which is equivalen One additional attribute which was not demonstrated above is `identicalAxisScales`. By default, Deonet will always display a square graph. If you adjust the ranges of $x$ and $y$, that often means the axes are scaled differently. That's true in the following graph; $x$ ranges from -10 to 10, but $y$ only stretches from -4 to 4. -```html +```doenet ``` By including the `identicalAxisScales` attribute (equivalent to `identicalAxisScales="true"`), we force Doenet to use the same scaling for both axes, which results in a rectangular graph. -```html +```doenet ``` Test code [here](https://www.doenet.org/portfolioeditor/_J1J2N530LyIvVWx64xB8V/_AgzWwqGV6Yy9DfqMyGlFm). @@ -117,7 +115,7 @@ Test code [here](https://www.doenet.org/portfolioeditor/_J1J2N530LyIvVWx64xB8V/_ By default, the axes in Doenet graphs are unlabeled. You can adjust this behavior, but not with an attribute. Similar to the `