Removes SampleTreeVisualizer

This commit is contained in:
Henning Dieterichs
2019-08-07 17:49:07 +02:00
parent ec664bad91
commit d1b6a55381
2 changed files with 0 additions and 39 deletions

View File

@@ -1,38 +0,0 @@
import { TreeViewModel, TreeNodeViewModel, TreeWithPathView } from "./Views";
import React = require("react");
export function SampleTreeVisualizer() {
interface SampleTreeNode {
parentPropertyName: string | undefined;
name: string;
children: SampleTreeNode[];
}
const data = require("./sample-input.json") as SampleTreeNode;
const m = new TreeViewModel();
m.root = createModel(data, m);
m.root.children[0].children[4].children[1].children[0].isMarked = true;
function createModel(
root: SampleTreeNode,
viewModel: TreeViewModel
): TreeNodeViewModel {
const children: TreeNodeViewModel[] = root.children.map(c =>
createModel(c, viewModel)
);
const model = new TreeNodeViewModel(
viewModel,
root.parentPropertyName,
root.name,
undefined,
children
);
for (const c of children) {
c.parent = model;
}
return model;
}
return <TreeWithPathView model={m} />;
}

File diff suppressed because one or more lines are too long