@khanacademy/perseus-editor 31.2.3 → 31.3.0
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.
- package/dist/es/index.js +5 -3
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/widgets/interactive-graph-editor/components/axis-tick-switches.d.ts +9 -0
- package/dist/widgets/interactive-graph-editor/components/interactive-graph-settings.d.ts +12 -1
- package/dist/widgets/interactive-graph-editor/interactive-graph-editor.d.ts +8 -1
- package/package.json +8 -8
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ShowAxisTicks } from "@khanacademy/perseus-core";
|
|
3
|
+
interface AxisTickSwitchesProps {
|
|
4
|
+
showAxisTicks: ShowAxisTicks;
|
|
5
|
+
onChange: (axis: keyof ShowAxisTicks) => void;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
}
|
|
8
|
+
export default function AxisTickSwitches(props: AxisTickSwitchesProps): React.JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { Changeable } from "@khanacademy/perseus";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
|
|
7
|
-
import type { AxisLabelLocation, ShowAxisArrows, MarkingsType, PerseusImageBackground } from "@khanacademy/perseus-core";
|
|
7
|
+
import type { AxisLabelLocation, ShowAxisArrows, ShowAxisTicks, MarkingsType, PerseusImageBackground } from "@khanacademy/perseus-core";
|
|
8
8
|
type ChangeFn = typeof Changeable.change;
|
|
9
9
|
type Range = [min: number, max: number];
|
|
10
10
|
type Props = {
|
|
@@ -31,6 +31,10 @@ type Props = {
|
|
|
31
31
|
* Whether the graph is bounded (no axis arrows) on the x and y axes.
|
|
32
32
|
*/
|
|
33
33
|
showAxisArrows: ShowAxisArrows;
|
|
34
|
+
/**
|
|
35
|
+
* Whether to show tick marks and tick numbers per axis.
|
|
36
|
+
*/
|
|
37
|
+
showAxisTicks: ShowAxisTicks;
|
|
34
38
|
/**
|
|
35
39
|
* How far apart the tick marks on the axes are in the x and y
|
|
36
40
|
* directions.
|
|
@@ -81,6 +85,7 @@ type State = {
|
|
|
81
85
|
stepTextbox: [x: number, y: number];
|
|
82
86
|
rangeTextbox: [x: Range, y: Range];
|
|
83
87
|
showAxisArrowsSwitches: ShowAxisArrows;
|
|
88
|
+
showAxisTicksSwitches: ShowAxisTicks;
|
|
84
89
|
backgroundImage: PerseusImageBackground;
|
|
85
90
|
};
|
|
86
91
|
declare class InteractiveGraphSettings extends React.Component<Props, State> {
|
|
@@ -96,6 +101,7 @@ declare class InteractiveGraphSettings extends React.Component<Props, State> {
|
|
|
96
101
|
stepTextbox: [x: number, y: number];
|
|
97
102
|
rangeTextbox: [x: Range, y: Range];
|
|
98
103
|
showAxisArrowsSwitches: ShowAxisArrows;
|
|
104
|
+
showAxisTicksSwitches: ShowAxisTicks;
|
|
99
105
|
backgroundImage: {
|
|
100
106
|
url?: string | null;
|
|
101
107
|
width?: number;
|
|
@@ -130,6 +136,10 @@ declare class InteractiveGraphSettings extends React.Component<Props, State> {
|
|
|
130
136
|
yMin: boolean;
|
|
131
137
|
yMax: boolean;
|
|
132
138
|
};
|
|
139
|
+
showAxisTicks: {
|
|
140
|
+
x: boolean;
|
|
141
|
+
y: boolean;
|
|
142
|
+
};
|
|
133
143
|
};
|
|
134
144
|
componentDidMount(): void;
|
|
135
145
|
UNSAFE_componentWillReceiveProps(nextProps: any): void;
|
|
@@ -147,6 +157,7 @@ declare class InteractiveGraphSettings extends React.Component<Props, State> {
|
|
|
147
157
|
changeLabel: (i: any, e: any) => void;
|
|
148
158
|
changeRange: (i: any, values: any) => void;
|
|
149
159
|
changeShowAxisArrows: (axis: keyof ShowAxisArrows) => void;
|
|
160
|
+
changeShowAxisTicks: (axis: keyof ShowAxisTicks) => void;
|
|
150
161
|
changeStepsBasedOnRange: () => void;
|
|
151
162
|
changeStep: (step: any) => void;
|
|
152
163
|
changeSnapStep: (snapStep: any) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type LockedFigure, type PerseusImageBackground, type PerseusInteractiveGraphWidgetOptions, type PerseusGraphType, type MarkingsType, type InteractiveGraphDefaultWidgetOptions, type AxisLabelLocation, type ShowAxisArrows } from "@khanacademy/perseus-core";
|
|
1
|
+
import { type LockedFigure, type PerseusImageBackground, type PerseusInteractiveGraphWidgetOptions, type PerseusGraphType, type MarkingsType, type InteractiveGraphDefaultWidgetOptions, type AxisLabelLocation, type ShowAxisArrows, type ShowAxisTicks } from "@khanacademy/perseus-core";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import type { APIOptionsWithDefaults } from "@khanacademy/perseus";
|
|
4
4
|
import type { PropsFor } from "@khanacademy/wonder-blocks-core";
|
|
@@ -24,6 +24,7 @@ declare const InteractiveGraph: {
|
|
|
24
24
|
rulerTicks?: number;
|
|
25
25
|
range: import("@khanacademy/perseus-core").GraphRange;
|
|
26
26
|
showAxisArrows: ShowAxisArrows;
|
|
27
|
+
showAxisTicks: ShowAxisTicks;
|
|
27
28
|
correct?: PerseusGraphType;
|
|
28
29
|
lockedFigures: LockedFigure[];
|
|
29
30
|
fullGraphAriaLabel?: string;
|
|
@@ -496,6 +497,7 @@ declare const InteractiveGraph: {
|
|
|
496
497
|
rulerTicks?: number;
|
|
497
498
|
range: import("@khanacademy/perseus-core").GraphRange;
|
|
498
499
|
showAxisArrows: ShowAxisArrows;
|
|
500
|
+
showAxisTicks: ShowAxisTicks;
|
|
499
501
|
correct?: PerseusGraphType;
|
|
500
502
|
lockedFigures: LockedFigure[];
|
|
501
503
|
fullGraphAriaLabel?: string;
|
|
@@ -953,6 +955,7 @@ declare const InteractiveGraph: {
|
|
|
953
955
|
labelLocation: import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props["labelLocation"];
|
|
954
956
|
range: import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props["range"];
|
|
955
957
|
showAxisArrows: import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props["showAxisArrows"];
|
|
958
|
+
showAxisTicks: import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props["showAxisTicks"];
|
|
956
959
|
step: import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props["step"];
|
|
957
960
|
backgroundImage: import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props["backgroundImage"];
|
|
958
961
|
markings: import("../../../../perseus/src/widgets/interactive-graphs/interactive-graph").Props["markings"];
|
|
@@ -985,6 +988,10 @@ export type Props = {
|
|
|
985
988
|
* Whether the graph is bounded on the x and y axes.
|
|
986
989
|
*/
|
|
987
990
|
showAxisArrows: ShowAxisArrows;
|
|
991
|
+
/**
|
|
992
|
+
* Whether to show tick marks and tick numbers per axis.
|
|
993
|
+
*/
|
|
994
|
+
showAxisTicks: ShowAxisTicks;
|
|
988
995
|
/**
|
|
989
996
|
* How far apart the tick marks on the axes are in the x and y
|
|
990
997
|
* directions.
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Perseus editors",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "31.
|
|
6
|
+
"version": "31.3.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"mafs": "^0.19.0",
|
|
37
37
|
"tiny-invariant": "1.3.1",
|
|
38
38
|
"@khanacademy/kas": "2.2.3",
|
|
39
|
-
"@khanacademy/keypad-context": "3.2.
|
|
40
|
-
"@khanacademy/kmath": "2.4.
|
|
41
|
-
"@khanacademy/math-input": "26.4.
|
|
42
|
-
"@khanacademy/perseus": "77.
|
|
43
|
-
"@khanacademy/perseus-core": "26.
|
|
44
|
-
"@khanacademy/perseus-linter": "5.0.
|
|
45
|
-
"@khanacademy/perseus-score": "8.9.
|
|
39
|
+
"@khanacademy/keypad-context": "3.2.51",
|
|
40
|
+
"@khanacademy/kmath": "2.4.9",
|
|
41
|
+
"@khanacademy/math-input": "26.4.23",
|
|
42
|
+
"@khanacademy/perseus": "77.6.0",
|
|
43
|
+
"@khanacademy/perseus-core": "26.2.0",
|
|
44
|
+
"@khanacademy/perseus-linter": "5.0.6",
|
|
45
|
+
"@khanacademy/perseus-score": "8.9.2",
|
|
46
46
|
"@khanacademy/perseus-utils": "2.1.5"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|