@khanacademy/perseus 56.2.0 → 57.0.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.
@@ -1,5 +1,10 @@
1
+ import { vec } from "mafs";
1
2
  import React from "react";
2
3
  import type { I18nContextType } from "../../../components/i18n-context";
4
+ import type { GraphConfig } from "../reducer/use-graph-config";
5
+ import type { GraphDimensions } from "../types";
6
+ export declare const fontSize = 14;
3
7
  export default function AxisLabels({ i18n }: {
4
8
  i18n: I18nContextType;
5
9
  }): React.JSX.Element;
10
+ export declare const getLabelPosition: (graphInfo: GraphDimensions, labelLocation: GraphConfig["labelLocation"]) => vec.Vector2[];
@@ -1,7 +1,7 @@
1
1
  import { vec } from "mafs";
2
2
  import type { SnapTo } from "./types";
3
3
  import type { Coord } from "../../interactive2/types";
4
- import type { CollinearTuple, LockedFigureColor, LockedFigureFillType, LockedLineStyle, MarkingsType, PerseusRenderer } from "@khanacademy/perseus-core";
4
+ import type { AxisLabelLocation, CollinearTuple, LockedFigureColor, LockedFigureFillType, LockedLineStyle, MarkingsType, PerseusRenderer } from "@khanacademy/perseus-core";
5
5
  export type LockedFunctionOptions = {
6
6
  color?: LockedFigureColor;
7
7
  strokeStyle?: LockedLineStyle;
@@ -23,6 +23,7 @@ declare class InteractiveGraphQuestionBuilder {
23
23
  private backgroundImage?;
24
24
  private gridStep;
25
25
  private labels;
26
+ private labelLocation;
26
27
  private markings;
27
28
  private xRange;
28
29
  private yRange;
@@ -47,6 +48,7 @@ declare class InteractiveGraphQuestionBuilder {
47
48
  }): InteractiveGraphQuestionBuilder;
48
49
  withGridStep(x: number, y: number): InteractiveGraphQuestionBuilder;
49
50
  withAxisLabels(x: string, y: string): InteractiveGraphQuestionBuilder;
51
+ withLabelLocation(labelLocation: AxisLabelLocation): InteractiveGraphQuestionBuilder;
50
52
  withMarkings(markings: MarkingsType): InteractiveGraphQuestionBuilder;
51
53
  withXRange(min: number, max: number): InteractiveGraphQuestionBuilder;
52
54
  withYRange(min: number, max: number): InteractiveGraphQuestionBuilder;
@@ -15,6 +15,7 @@ export type MafsGraphProps = {
15
15
  showTooltips: Required<InteractiveGraphProps["showTooltips"]>;
16
16
  showProtractor: boolean;
17
17
  labels: ReadonlyArray<string>;
18
+ labelLocation?: InteractiveGraphProps["labelLocation"];
18
19
  fullGraphAriaLabel?: InteractiveGraphProps["fullGraphAriaLabel"];
19
20
  fullGraphAriaDescription?: InteractiveGraphProps["fullGraphAriaDescription"];
20
21
  state: InteractiveGraphState;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import type { MarkingsType } from "@khanacademy/perseus-core";
2
+ import type { AxisLabelLocation, MarkingsType } from "@khanacademy/perseus-core";
3
3
  import type { Interval, vec } from "mafs";
4
4
  export type GraphConfig = {
5
5
  range: [Interval, Interval];
@@ -12,6 +12,7 @@ export type GraphConfig = {
12
12
  width: number;
13
13
  height: number;
14
14
  labels: readonly string[];
15
+ labelLocation?: AxisLabelLocation;
15
16
  disableKeyboardInteraction?: boolean;
16
17
  interactiveColor?: string;
17
18
  };
@@ -23,6 +23,7 @@ export type StatefulMafsGraphProps = {
23
23
  showTooltips: Required<InteractiveGraphProps["showTooltips"]>;
24
24
  showProtractor: boolean;
25
25
  labels: ReadonlyArray<string>;
26
+ labelLocation?: InteractiveGraphProps["labelLocation"];
26
27
  fullGraphAriaLabel?: InteractiveGraphProps["fullGraphAriaLabel"];
27
28
  fullGraphAriaDescription?: InteractiveGraphProps["fullGraphAriaDescription"];
28
29
  readOnly: boolean;
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": "56.2.0",
6
+ "version": "57.0.0",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -41,12 +41,12 @@
41
41
  "mafs": "0.19.0",
42
42
  "uuid": "^10.0.0",
43
43
  "@khanacademy/kas": "0.5.0",
44
- "@khanacademy/keypad-context": "1.1.2",
45
- "@khanacademy/kmath": "0.4.2",
46
- "@khanacademy/math-input": "23.0.1",
47
- "@khanacademy/perseus-core": "5.1.0",
48
- "@khanacademy/perseus-linter": "1.3.2",
49
- "@khanacademy/perseus-score": "2.3.2",
44
+ "@khanacademy/keypad-context": "1.1.3",
45
+ "@khanacademy/kmath": "0.4.3",
46
+ "@khanacademy/math-input": "23.0.2",
47
+ "@khanacademy/perseus-core": "5.2.0",
48
+ "@khanacademy/perseus-linter": "1.3.3",
49
+ "@khanacademy/perseus-score": "2.3.3",
50
50
  "@khanacademy/pure-markdown": "0.4.0",
51
51
  "@khanacademy/simple-markdown": "0.14.0"
52
52
  },