本文整理汇总了TypeScript中@argdown/core.ArgdownApplication类的典型用法代码示例。如果您正苦于以下问题:TypeScript ArgdownApplication类的具体用法?TypeScript ArgdownApplication怎么用?TypeScript ArgdownApplication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ArgdownApplication类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: ArgdownApplication
ArgdownApplication,
ParserPlugin,
ModelPlugin,
PreselectionPlugin,
StatementSelectionPlugin,
ArgumentSelectionPlugin,
DataPlugin,
MapPlugin,
GroupPlugin,
ColorPlugin,
DotExportPlugin
} from "@argdown/core";
import { VizJsMap, DagreMap } from "../src/index";
import "babel-polyfill";
const app = new ArgdownApplication();
const parserPlugin = new ParserPlugin();
app.addPlugin(parserPlugin, "parse-input");
app.addPlugin(new DataPlugin(), "build-model");
const modelPlugin = new ModelPlugin();
app.addPlugin(modelPlugin, "build-model");
const preselectionPlugin = new PreselectionPlugin();
app.addPlugin(preselectionPlugin, "create-map");
const statementSelectionPlugin = new StatementSelectionPlugin();
app.addPlugin(statementSelectionPlugin, "create-map");
const argumentSelectionPlugin = new ArgumentSelectionPlugin();
app.addPlugin(argumentSelectionPlugin, "create-map");
const mapPlugin = new MapPlugin();
app.addPlugin(mapPlugin, "create-map");
const groupPlugin = new GroupPlugin();
app.addPlugin(groupPlugin, "create-map");
开发者ID:christianvoigt,项目名称:argdown,代码行数:31,代码来源:index.ts
示例2: it
it("sanity test", function() {
const source = `[T1]: Hello World`;
const result = app.run({
process: ["parse-input", "build-model", "export-symbols"],
input: source,
logLevel: "error"
});
expect(result.documentSymbols).to.exist;
expect(result.documentSymbols!.length).to.equal(1);
expect(result.documentSymbols![0].name).to.equal("[T1]");
});
开发者ID:christianvoigt,项目名称:argdown,代码行数:11,代码来源:DocumentSymbolPlugin.spec.ts
示例3: VizJsMap
const createVizJsMap = (container: HTMLElement) => {
container.innerHTML = "";
const vizJsMap = new VizJsMap(container, "/full.render.js");
const response = app.run({
input: `
# G1
<a1>
- <a2>
`,
process: exportDot
});
vizJsMap.render({ dot: response.dot! });
};
开发者ID:christianvoigt,项目名称:argdown,代码行数:14,代码来源:index.ts
示例4: DagreMap
const createDagreMap = (container: HTMLElement) => {
container.innerHTML = "";
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
svg.setAttribute("style", "width: 100%; height: 100%;");
container.appendChild(svg);
const dagreMap = new DagreMap(svg);
const response = app.run({
input: `
# G1
<a1>
- <a2>
`,
process: exportMap
});
dagreMap.render({ settings: {}, map: response.map!, tags: response.tags! });
};
开发者ID:christianvoigt,项目名称:argdown,代码行数:17,代码来源:index.ts
注:本文中的@argdown/core.ArgdownApplication类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论