Fixes types.
This commit is contained in:
@@ -6,10 +6,7 @@ import {
|
||||
DataExtraction,
|
||||
ExtractionCollector,
|
||||
} from "./DataExtractorApi";
|
||||
import {
|
||||
VisualizationData,
|
||||
DataExtractorInfo,
|
||||
} from "../../DataExtractionResult";
|
||||
import { DataExtractorInfo } from "../../DataExtractionResult";
|
||||
import { registerDefaultExtractors } from "./default-extractors";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import {
|
||||
CommonDataTypes,
|
||||
EdgeGraphData,
|
||||
NodeGraphData,
|
||||
GraphEdge,
|
||||
GraphNode,
|
||||
GraphVisualizationData,
|
||||
} from "../../CommonDataTypes";
|
||||
|
||||
export type CreateGraphEdge<T> = { to: T } & Omit<EdgeGraphData, "from" | "to">;
|
||||
export type CreateGraphEdge<T> = { to: T } & Omit<GraphEdge, "from" | "to">;
|
||||
|
||||
/**
|
||||
* Given a list of roots, it creates a graph by following their edges recursively.
|
||||
@@ -17,10 +17,10 @@ export function createGraph<T>(
|
||||
) => {
|
||||
id?: string | number;
|
||||
edges: CreateGraphEdge<T>[];
|
||||
} & Omit<NodeGraphData, "id">,
|
||||
} & Omit<GraphNode, "id">,
|
||||
options: { maxSize?: number } = {}
|
||||
): CommonDataTypes.Graph {
|
||||
const r: CommonDataTypes.Graph = {
|
||||
): GraphVisualizationData {
|
||||
const r: GraphVisualizationData = {
|
||||
kind: {
|
||||
graph: true,
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { NodeGraphData, CommonDataTypes } from "../../CommonDataTypes";
|
||||
import { GraphNode, GraphVisualizationData } from "../../CommonDataTypes";
|
||||
import { CreateGraphEdge, createGraph } from "./createGraph";
|
||||
|
||||
/**
|
||||
@@ -12,8 +12,8 @@ export function createGraphFromPointers<T>(
|
||||
) => {
|
||||
id?: string | number;
|
||||
edges: CreateGraphEdge<T>[];
|
||||
} & Omit<NodeGraphData, "id">
|
||||
): CommonDataTypes.Graph {
|
||||
} & Omit<GraphNode, "id">
|
||||
): GraphVisualizationData {
|
||||
const marker = {};
|
||||
|
||||
interface Pointer {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { CommonDataTypes } from "../../CommonDataTypes";
|
||||
import { GridVisualizationData } from "../../CommonDataTypes";
|
||||
|
||||
export function markedGrid(
|
||||
arr: any[],
|
||||
marked: Record<string, number>
|
||||
): CommonDataTypes.Grid {
|
||||
): GridVisualizationData {
|
||||
return {
|
||||
kind: { array: true },
|
||||
kind: { grid: true },
|
||||
rows: [{ columns: arr.map(d => ({ tag: d })) }],
|
||||
markers: Object.entries(marked).map(([key, val]) => ({
|
||||
id: key,
|
||||
|
||||
Reference in New Issue
Block a user