@khanacademy/perseus 22.0.2 → 22.1.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/components/info-tip/info-tip.d.ts +2 -10
- package/dist/es/index.css +14 -1
- package/dist/es/index.js +169 -152
- package/dist/es/index.js.map +1 -1
- package/dist/index.css +14 -1
- package/dist/index.js +171 -148
- package/dist/index.js.map +1 -1
- package/dist/widgets/interactive-graph.d.ts +3 -3
- package/dist/widgets/interactive-graphs/axis-labels.d.ts +2 -0
- package/dist/widgets/interactive-graphs/graphs/components/arrowhead.d.ts +2 -2
- package/dist/widgets/interactive-graphs/graphs/components/movable-line.d.ts +1 -0
- package/dist/widgets/interactive-graphs/graphs/use-transform.d.ts +9 -2
- package/dist/widgets/interactive-graphs/graphs/utils.d.ts +6 -4
- package/dist/widgets/interactive-graphs/mafs-graph.d.ts +1 -0
- package/dist/widgets/interactive-graphs/reducer/use-graph-config.d.ts +4 -0
- package/package.json +2 -2
|
@@ -103,8 +103,8 @@ declare class LegacyInteractiveGraph extends React.Component<Props, State> {
|
|
|
103
103
|
addAngleControls: () => void;
|
|
104
104
|
removeAngleControls: () => void;
|
|
105
105
|
toggleShowSides: () => void;
|
|
106
|
-
getUserInput
|
|
107
|
-
simpleValidate
|
|
106
|
+
getUserInput(): PerseusGraphType;
|
|
107
|
+
simpleValidate(rubric: Rubric): PerseusScore;
|
|
108
108
|
focus: () => void;
|
|
109
109
|
render(): React.ReactNode;
|
|
110
110
|
}
|
|
@@ -113,7 +113,7 @@ declare class InteractiveGraph extends React.Component<Props, State> {
|
|
|
113
113
|
mafsRef: React.RefObject<Widget>;
|
|
114
114
|
static defaultProps: DefaultProps;
|
|
115
115
|
getUserInput: Widget["getUserInput"];
|
|
116
|
-
simpleValidate
|
|
116
|
+
simpleValidate(rubric: Rubric): PerseusScore;
|
|
117
117
|
render(): JSX.Element;
|
|
118
118
|
static getQuadraticCoefficients(coords: ReadonlyArray<Coord>): QuadraticCoefficient;
|
|
119
119
|
static getSinusoidCoefficients(coords: ReadonlyArray<Coord>): SineCoefficient;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
import { vec } from "mafs";
|
|
2
|
-
export
|
|
1
|
+
import { type Interval, vec } from "mafs";
|
|
2
|
+
export type GraphDimensions = {
|
|
3
|
+
range: [Interval, Interval];
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function vectorsToPixels(vectors: vec.Vector2[], graphState: GraphDimensions, translation?: vec.Vector2): vec.Vector2[];
|
|
8
|
+
export declare function pointToPixel(point: vec.Vector2, graphState: GraphDimensions): vec.Vector2;
|
|
9
|
+
export declare const useTransformVectorsToPixels: (...vectors: vec.Vector2[]) => vec.Vector2[];
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { CollinearTuple } from "../../../perseus-types";
|
|
2
2
|
import type { Interval, vec } from "mafs";
|
|
3
3
|
/**
|
|
4
|
-
* Given
|
|
5
|
-
*
|
|
6
|
-
* @param
|
|
4
|
+
* Given a ray and a rectangular box, find the point where the ray intersects
|
|
5
|
+
* the edge of the box. Assumes the `initialPoint` is inside the box.
|
|
6
|
+
* @param initialPoint - The starting point of the ray.
|
|
7
|
+
* @param throughPoint - A point that the ray passes through. Must be different from initialPoint.
|
|
8
|
+
* @param box - The box with which to intersect the ray, in the form [[xMin, xMax], [yMin, yMax]]
|
|
7
9
|
*/
|
|
8
|
-
export declare const
|
|
10
|
+
export declare const getIntersectionOfRayWithBox: (initialPoint: vec.Vector2, throughPoint: vec.Vector2, box: [x: Interval, y: Interval]) => [number, number];
|
|
9
11
|
export declare const getLines: (points: readonly vec.Vector2[]) => CollinearTuple[];
|
|
@@ -17,6 +17,7 @@ export type Props = {
|
|
|
17
17
|
markings: InteractiveGraphProps["markings"];
|
|
18
18
|
onChange: InteractiveGraphProps["onChange"];
|
|
19
19
|
showTooltips: Required<InteractiveGraphProps["showTooltips"]>;
|
|
20
|
+
labels: InteractiveGraphProps["labels"];
|
|
20
21
|
};
|
|
21
22
|
export declare const StatefulMafsGraph: React.ForwardRefExoticComponent<Props & React.RefAttributes<Partial<Widget>>>;
|
|
22
23
|
type MafsGraphProps = Props & {
|
|
@@ -5,6 +5,10 @@ type GraphConfig = {
|
|
|
5
5
|
snapStep: vec.Vector2;
|
|
6
6
|
markings: "graph" | "grid" | "none";
|
|
7
7
|
showTooltips: boolean;
|
|
8
|
+
graphDimensionsInPixels: vec.Vector2;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
labels: readonly string[];
|
|
8
12
|
};
|
|
9
13
|
export declare const GraphConfigContext: React.Context<GraphConfig>;
|
|
10
14
|
export default function useGraphConfig(): GraphConfig;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Core Perseus API (includes renderers and widgets)",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "22.0
|
|
6
|
+
"version": "22.1.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@khanacademy/kas": "^0.3.9",
|
|
43
43
|
"@khanacademy/kmath": "^0.1.12",
|
|
44
|
-
"@khanacademy/math-input": "^18.0.
|
|
44
|
+
"@khanacademy/math-input": "^18.0.1",
|
|
45
45
|
"@khanacademy/perseus-core": "1.4.2",
|
|
46
46
|
"@khanacademy/perseus-linter": "^0.3.12",
|
|
47
47
|
"@khanacademy/pure-markdown": "^0.3.2",
|