forked from sashin/sashinexists
run npm install to generate a package lock
This commit is contained in:
3
node_modules/graphviz-wasm/dist/constants.d.ts
generated
vendored
Normal file
3
node_modules/graphviz-wasm/dist/constants.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
declare const DEFAULT_ENGINE = "dot";
|
||||
declare const DEFAULT_FORMAT = "svg";
|
||||
export { DEFAULT_ENGINE, DEFAULT_FORMAT };
|
||||
5
node_modules/graphviz-wasm/dist/constants.js
generated
vendored
Normal file
5
node_modules/graphviz-wasm/dist/constants.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/* MAIN */
|
||||
const DEFAULT_ENGINE = 'dot';
|
||||
const DEFAULT_FORMAT = 'svg';
|
||||
/* EXPORT */
|
||||
export { DEFAULT_ENGINE, DEFAULT_FORMAT };
|
||||
6
node_modules/graphviz-wasm/dist/generate.d.ts
generated
vendored
Normal file
6
node_modules/graphviz-wasm/dist/generate.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { Engine, Format } from './types';
|
||||
declare const generate: (GRAPHVIZ_BASE64: string) => {
|
||||
loadWASM: () => Promise<void>;
|
||||
layout: (source: string, format?: Format, engine?: Engine) => string;
|
||||
};
|
||||
export default generate;
|
||||
30
node_modules/graphviz-wasm/dist/generate.js
generated
vendored
Normal file
30
node_modules/graphviz-wasm/dist/generate.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/* IMPORT */
|
||||
import decode from 'decode-base64';
|
||||
import once from 'function-once';
|
||||
import wrapper from '../graphviz/wrapper.js';
|
||||
import { DEFAULT_ENGINE, DEFAULT_FORMAT } from './constants.js';
|
||||
/* MAIN */
|
||||
const generate = (GRAPHVIZ_BASE64) => {
|
||||
const Graphviz = {
|
||||
/* LIFECYCLE API */
|
||||
loadWASM: once(async () => {
|
||||
const GRAPHVIZ_BUFFER = decode(GRAPHVIZ_BASE64);
|
||||
const instance = await wrapper({ wasmBinary: GRAPHVIZ_BUFFER });
|
||||
Graphviz.layout = (source, format = DEFAULT_FORMAT, engine = DEFAULT_ENGINE) => {
|
||||
const graphviz = new instance.Graphviz();
|
||||
const result = graphviz.layout(source, format, engine);
|
||||
instance.destroy(graphviz);
|
||||
if (!result)
|
||||
throw new Error(instance.Graphviz.prototype.lastError());
|
||||
return result;
|
||||
};
|
||||
}),
|
||||
/* API */
|
||||
layout: (source, format = DEFAULT_FORMAT, engine = DEFAULT_ENGINE) => {
|
||||
throw new Error('[graphviz] You need to call and await "graphviz.loadWASM" first');
|
||||
}
|
||||
};
|
||||
return Graphviz;
|
||||
};
|
||||
/* EXPORT */
|
||||
export default generate;
|
||||
7
node_modules/graphviz-wasm/dist/index.d.ts
generated
vendored
Normal file
7
node_modules/graphviz-wasm/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { Engine, Format } from './types';
|
||||
declare const Graphviz: {
|
||||
loadWASM: () => Promise<void>;
|
||||
layout: (source: string, format?: Format, engine?: Engine) => string;
|
||||
};
|
||||
export default Graphviz;
|
||||
export type { Engine, Format };
|
||||
7
node_modules/graphviz-wasm/dist/index.js
generated
vendored
Normal file
7
node_modules/graphviz-wasm/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/* IMPORT */
|
||||
import GRAPHVIZ_BASE64 from '../graphviz/graphviz.js';
|
||||
import generate from './generate.js';
|
||||
/* MAIN */
|
||||
const Graphviz = generate(GRAPHVIZ_BASE64);
|
||||
/* EXPORT */
|
||||
export default Graphviz;
|
||||
3
node_modules/graphviz-wasm/dist/types.d.ts
generated
vendored
Normal file
3
node_modules/graphviz-wasm/dist/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
type Engine = 'circo' | 'dot' | 'fdp' | 'neato' | 'osage' | 'patchwork' | 'sfdp' | 'twopi';
|
||||
type Format = 'dot_json' | 'dot' | 'json' | 'plain-ext' | 'plain' | 'svg' | 'xdot_json';
|
||||
export type { Engine, Format };
|
||||
2
node_modules/graphviz-wasm/dist/types.js
generated
vendored
Normal file
2
node_modules/graphviz-wasm/dist/types.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/* MAIN */
|
||||
export {};
|
||||
Reference in New Issue
Block a user