Fixes marked grid.
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
import { GridVisualizationData } from "../../CommonDataTypes";
|
||||
|
||||
export function markedGrid(
|
||||
arr: any[],
|
||||
marked: Record<string, number>
|
||||
arr: unknown[],
|
||||
marked: Record<string, number | undefined>
|
||||
): GridVisualizationData {
|
||||
return {
|
||||
kind: { grid: true },
|
||||
rows: [{ columns: arr.map(d => ({ tag: d })) }],
|
||||
markers: Object.entries(marked).map(([key, val]) => ({
|
||||
id: key,
|
||||
row: 0,
|
||||
column: val,
|
||||
})),
|
||||
rows: [{ columns: arr.map(d => ({ content: "" + d, tag: "" + d })) }],
|
||||
markers: Object.entries(marked)
|
||||
.map(([key, val]) => ({
|
||||
id: "" + key,
|
||||
row: 0,
|
||||
column: val!,
|
||||
}))
|
||||
.filter(c => c.column !== undefined),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user