@khanacademy/perseus 48.0.0 → 48.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/svg-image.d.ts +0 -4
- package/dist/es/index.js +173 -171
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +174 -176
- package/dist/index.js.map +1 -1
- package/dist/util/graphie-utils.d.ts +35 -0
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Coord } from "../interactive2/types";
|
|
2
|
+
import type { CSSProperties } from "aphrodite";
|
|
3
|
+
/**
|
|
4
|
+
* A Graphie axis range.
|
|
5
|
+
*/
|
|
6
|
+
export type GraphieRange = [number, number];
|
|
7
|
+
/**
|
|
8
|
+
* A Graphie label.
|
|
9
|
+
*/
|
|
10
|
+
export type GraphieLabel = {
|
|
11
|
+
content: string;
|
|
12
|
+
alignment: number | "center" | "above" | "above right" | "right" | "below right" | "below" | "below left" | "left" | "above left";
|
|
13
|
+
coordinates: GraphieRange;
|
|
14
|
+
style: CSSProperties;
|
|
15
|
+
typesetAsMath: boolean;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The Graphie data (labels, etc.)
|
|
19
|
+
*/
|
|
20
|
+
export type GraphieData = {
|
|
21
|
+
range: [GraphieRange, GraphieRange];
|
|
22
|
+
labels: Array<GraphieLabel>;
|
|
23
|
+
};
|
|
24
|
+
export declare function getLocalizedDataUrl(url: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Parse JSONP for a web+graphie://... hash to extract Graphie data, or throw
|
|
27
|
+
* an error if invalid JSONP.
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseDataFromJSONP(graphieHash: string, graphieJSONP: string, errorCallback: (error?: any) => void): GraphieData | null;
|
|
30
|
+
type CacheEntry = {
|
|
31
|
+
labels: ReadonlyArray<any>;
|
|
32
|
+
range: [Coord, Coord];
|
|
33
|
+
};
|
|
34
|
+
export declare function loadGraphie(url: string, onDataLoaded: (data: CacheEntry, localized: boolean) => void): void;
|
|
35
|
+
export {};
|