@khanacademy/perseus-editor 27.2.0 → 27.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import type { ShowAxisArrows } from "@khanacademy/perseus-core";
3
+ interface AxisArrowSwitchesProps {
4
+ showAxisArrows: ShowAxisArrows;
5
+ onChange: (axis: keyof ShowAxisArrows) => void;
6
+ }
7
+ export default function AxisArrowSwitches(props: AxisArrowSwitchesProps): React.JSX.Element;
8
+ export {};
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { Changeable } from "@khanacademy/perseus";
5
5
  import * as React from "react";
6
- import type { AxisLabelLocation, MarkingsType, PerseusImageBackground } from "@khanacademy/perseus-core";
6
+ import type { AxisLabelLocation, ShowAxisArrows, MarkingsType, PerseusImageBackground } from "@khanacademy/perseus-core";
7
7
  type ChangeFn = typeof Changeable.change;
8
8
  type Range = [min: number, max: number];
9
9
  type Props = {
@@ -26,6 +26,10 @@ type Props = {
26
26
  * The range of the graph.
27
27
  */
28
28
  range: [x: Range, y: Range];
29
+ /**
30
+ * Whether the graph is bounded (no axis arrows) on the x and y axes.
31
+ */
32
+ showAxisArrows: ShowAxisArrows;
29
33
  /**
30
34
  * How far apart the tick marks on the axes are in the x and y
31
35
  * directions.
@@ -74,6 +78,7 @@ type State = {
74
78
  snapStepTextbox: [x: number, y: number];
75
79
  stepTextbox: [x: number, y: number];
76
80
  rangeTextbox: [x: Range, y: Range];
81
+ showAxisArrowsSwitches: ShowAxisArrows;
77
82
  backgroundImage: PerseusImageBackground;
78
83
  };
79
84
  declare class InteractiveGraphSettings extends React.Component<Props, State> {
@@ -88,6 +93,7 @@ declare class InteractiveGraphSettings extends React.Component<Props, State> {
88
93
  snapStepTextbox: [x: number, y: number];
89
94
  stepTextbox: [x: number, y: number];
90
95
  rangeTextbox: [x: Range, y: Range];
96
+ showAxisArrowsSwitches: ShowAxisArrows;
91
97
  backgroundImage: {
92
98
  url?: string | null;
93
99
  width?: number;
@@ -116,6 +122,12 @@ declare class InteractiveGraphSettings extends React.Component<Props, State> {
116
122
  markings: string;
117
123
  showProtractor: boolean;
118
124
  showTooltips: boolean;
125
+ showAxisArrows: {
126
+ xMin: boolean;
127
+ xMax: boolean;
128
+ yMin: boolean;
129
+ yMax: boolean;
130
+ };
119
131
  };
120
132
  componentDidMount(): void;
121
133
  UNSAFE_componentWillReceiveProps(nextProps: any): void;
@@ -132,6 +144,7 @@ declare class InteractiveGraphSettings extends React.Component<Props, State> {
132
144
  validateGraphSettings: (range: any, step: any, gridStep: any, snapStep: any, image: any) => any;
133
145
  changeLabel: (i: any, e: any) => void;
134
146
  changeRange: (i: any, values: any) => void;
147
+ changeShowAxisArrows: (axis: keyof ShowAxisArrows) => void;
135
148
  changeStepsBasedOnRange: () => void;
136
149
  changeStep: (step: any) => void;
137
150
  changeSnapStep: (snapStep: any) => void;