Implements Grid extractors/visualizer and sorting demo.

This commit is contained in:
Henning Dieterichs
2020-02-22 13:41:50 +01:00
parent 9f3c0ead67
commit e3808e5009
8 changed files with 535 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
export * from "./createGraph";
export * from "./createGraphFromPointers";
export * from "./tryEval";
export * from "./markedGrid";

View File

@@ -0,0 +1,16 @@
import { CommonDataTypes } from "../../CommonDataTypes";
export function markedGrid(
arr: any[],
marked: Record<string, number>
): CommonDataTypes.Grid {
return {
kind: { array: true },
rows: [{ columns: arr.map(d => ({ tag: d })) }],
markers: Object.entries(marked).map(([key, val]) => ({
id: key,
row: 0,
column: val,
})),
};
}