mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: Support LaTeX and AsciiMath via MathJax on stem.excalidraw.com
This commit is contained in:
parent
c8370b394c
commit
86f5c2ebcf
84 changed files with 8331 additions and 289 deletions
|
@ -1,5 +1,6 @@
|
|||
import {
|
||||
Spreadsheet,
|
||||
sortSpreadsheet,
|
||||
tryParseCells,
|
||||
tryParseNumber,
|
||||
VALID_SPREADSHEET,
|
||||
|
@ -118,4 +119,29 @@ describe("charts", () => {
|
|||
expect(values).toEqual([61, -60, 85, -67, 54, 95]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("sortSpreadsheet", () => {
|
||||
it("sorts strictly numerical labels columns in ascending order", () => {
|
||||
const spreadsheet = [
|
||||
["x", "y"],
|
||||
["1°", "1"],
|
||||
["9°", "2"],
|
||||
["3°", "3"],
|
||||
["6°", "4"],
|
||||
];
|
||||
|
||||
const result = tryParseCells(spreadsheet);
|
||||
|
||||
expect(result.type).toBe(VALID_SPREADSHEET);
|
||||
|
||||
const { title, labels, values } = sortSpreadsheet(
|
||||
(result as { type: typeof VALID_SPREADSHEET; spreadsheet: Spreadsheet })
|
||||
.spreadsheet,
|
||||
);
|
||||
|
||||
expect(title).toEqual("y");
|
||||
expect(labels).toEqual(["1°", "3°", "6°", "9°"]);
|
||||
expect(values).toEqual([1, 3, 4, 2]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue