Skip to content

Commit 8859e97

Browse files
authored
[Interactive Graph] Update the axis labels to be TeX by default again (#3028)
## Summary: It looks like these are defaulting to `x` and `y` instead of `$x$` and `$y$`. Changing them to be `$x$` and `$y$` as requested by content authors. Issue: none Test plan: `pnpm jest packages/perseus/src/widgets/interactive-graphs/serialize-interactive-graph.test.ts` Storybook - Go to `/?path=/story/editors-editorpage--demo` - Add a new interactive graph - Scroll to the common settings - Confirm that the axis labels are `$x$` and `$y$` | Before | After | | --- | --- | | <img width="376" height="283" alt="Screenshot 2025-11-12 at 11 45 40 AM" src="https://github.com/user-attachments/assets/5b194b25-5857-4a80-ba85-026f52b6ccb6" /> | <img width="377" height="278" alt="Screenshot 2025-11-12 at 11 45 44 AM" src="https://github.com/user-attachments/assets/dfe844cc-3e10-46b0-98b1-61141d9a4189" /> | Author: nishasy Reviewers: mark-fitzgerald Required Reviewers: Approved By: mark-fitzgerald Checks: ⏹️ 7 checks were cancelled, ✅ 3 checks were successful Pull Request URL: #3028
1 parent 1354351 commit 8859e97

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

.changeset/twenty-turkeys-lay.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@khanacademy/perseus": patch
3+
"@khanacademy/perseus-core": patch
4+
---
5+
6+
[Interactive Graph] Update the axis labels to be TeX by default again

packages/perseus-core/src/parse-perseus-json/regression-tests/__snapshots__/parse-perseus-json-regression.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9733,8 +9733,8 @@ exports[`parseAndMigratePerseusItem given interactive-graph-missing-labels.ts re
97339733
},
97349734
"labelLocation": "onAxis",
97359735
"labels": [
9736-
"x",
9737-
"y",
9736+
"$x$",
9737+
"$y$",
97389738
],
97399739
"lockedFigures": [],
97409740
"markings": "none",

packages/perseus-core/src/widgets/interactive-graph/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export type InteractiveGraphDefaultWidgetOptions = Pick<
2323
>;
2424

2525
const defaultWidgetOptions: InteractiveGraphDefaultWidgetOptions = {
26-
labels: ["x", "y"],
26+
labels: ["$x$", "$y$"],
2727
labelLocation: "onAxis",
2828
range: [
2929
[-10, 10],

packages/perseus/src/widgets/interactive-graphs/interactive-graph.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ class InteractiveGraph extends React.Component<Props, State> {
265265
mafsRef = React.createRef<StatefulMafsGraphType>();
266266

267267
static defaultProps: DefaultProps = {
268-
labels: ["x", "y"],
268+
labels: ["$x$", "$y$"],
269269
labelLocation: "onAxis",
270270
range: [
271271
[-10, 10],

packages/perseus/src/widgets/interactive-graphs/serialize-interactive-graph.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ describe("InteractiveGraph serialization", () => {
117117
"interactive-graph 1": {
118118
alignment: "default",
119119
static: false,
120-
labels: ["x", "y"],
120+
labels: ["$x$", "$y$"],
121121
labelLocation: "onAxis",
122122
range: [
123123
[-10, 10],

0 commit comments

Comments
 (0)