@khanacademy/perseus 20.4.0 → 20.5.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 +61 -12
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +62 -12
- package/dist/index.js.map +1 -1
- package/dist/perseus-types.d.ts +1 -1
- package/dist/widgets/interactive-graphs/graphs/index.d.ts +1 -0
- package/dist/widgets/interactive-graphs/graphs/ray.d.ts +5 -0
- package/dist/widgets/interactive-graphs/graphs/types.d.ts +2 -2
- package/dist/widgets/interactive-graphs/types.d.ts +5 -2
- package/package.json +1 -1
package/dist/perseus-types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { Interval, vec } from "mafs";
|
|
|
3
3
|
export type Range = Interval;
|
|
4
4
|
export type Size = [number, number];
|
|
5
5
|
export type CollinearTuple = readonly [vec.Vector2, vec.Vector2];
|
|
6
|
-
type StyleParams = {
|
|
6
|
+
export type StyleParams = {
|
|
7
7
|
fill?: string;
|
|
8
8
|
stroke?: string;
|
|
9
9
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { CollinearTuple } from "../../../perseus-types";
|
|
2
|
-
import type { vec } from "mafs";
|
|
2
|
+
import type { Interval, vec } from "mafs";
|
|
3
3
|
export interface InteractiveLineProps {
|
|
4
4
|
collinearPair: Readonly<CollinearTuple>;
|
|
5
5
|
snaps: [number, number];
|
|
6
|
-
range: [
|
|
6
|
+
range: [x: Interval, y: Interval];
|
|
7
7
|
onMovePoint: (endpointIndex: number, destination: vec.Vector2) => unknown;
|
|
8
8
|
onMoveLine: (delta: vec.Vector2) => unknown;
|
|
9
9
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InteractiveGraphAction } from "./interactive-graph-action";
|
|
2
|
-
import type { PerseusGraphTypeLinearSystem, PerseusGraphTypeSegment, PerseusInteractiveGraphWidgetOptions } from "../../perseus-types";
|
|
2
|
+
import type { CollinearTuple, PerseusGraphTypeLinearSystem, PerseusGraphTypeRay, PerseusGraphTypeSegment, PerseusInteractiveGraphWidgetOptions } from "../../perseus-types";
|
|
3
3
|
import type { WidgetProps } from "../../types";
|
|
4
4
|
import type { Interval, vec } from "mafs";
|
|
5
5
|
export type InteractiveGraphProps = WidgetProps<PerseusInteractiveGraphWidgetOptions, PerseusInteractiveGraphWidgetOptions>;
|
|
@@ -7,7 +7,7 @@ export type MafsGraphProps<T extends InteractiveGraphState> = {
|
|
|
7
7
|
graphState: T;
|
|
8
8
|
dispatch: (action: InteractiveGraphAction) => unknown;
|
|
9
9
|
};
|
|
10
|
-
export type InteractiveGraphState = SegmentGraphState | LinearGraphState;
|
|
10
|
+
export type InteractiveGraphState = SegmentGraphState | LinearGraphState | RayGraphState;
|
|
11
11
|
export interface InteractiveGraphStateCommon {
|
|
12
12
|
hasBeenInteractedWith: boolean;
|
|
13
13
|
range: [Interval, Interval];
|
|
@@ -17,3 +17,6 @@ export type SegmentGraphState = InteractiveGraphStateCommon & Pick<PerseusGraphT
|
|
|
17
17
|
export type LinearGraphState = InteractiveGraphStateCommon & Pick<PerseusGraphTypeLinearSystem, "coords"> & {
|
|
18
18
|
type: "linear" | "linear-system";
|
|
19
19
|
};
|
|
20
|
+
export type RayGraphState = InteractiveGraphStateCommon & Pick<PerseusGraphTypeRay, "type"> & {
|
|
21
|
+
coords: readonly CollinearTuple[];
|
|
22
|
+
};
|