How to use nomnoml - 10 common examples

To help you get started, we’ve selected a few nomnoml examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xm-online / xm-webapp / src / app / admin-config / specification-mng / config-visualizer-dialog / config-visualizer-dialog.component.ts View on Github external
public sourceChanged(): void {
        const canvasElement = document.getElementById('canvas');
        try {
            const superSampling = window.devicePixelRatio || 1;
            const scale = superSampling * Math.exp(this.zoomLevel / 10);
            nomnoml.draw(canvasElement, this.source, scale);
            this.positionCanvas(canvasElement, superSampling, this.offset);
        } catch (e) {
            console.log(e); // tslint:disable-line
        }
    }
github videojs / http-streaming / scripts / create-docs-images.js View on Github external
build() {
    const files = fs.readdirSync(nomnomlSourceDir);

    while (files.length > 0) {
      const file = path.resolve(nomnomlSourceDir, files.shift());
      const basename = path.basename(file, 'txt');

      if (/.nomnoml/.test(basename)) {
        const fileContents = fs.readFileSync(file, 'utf-8');
        const generated = nomnoml.renderSvg(fileContents);
        const newFilePath = path.join(docImageDir, basename) + 'svg';
        const outFile = fs.createWriteStream(newFilePath);

        console.log(`wrote file ${newFilePath}`);
        outFile.write(generated);
      }
    }
  }
};
github yuzutech / kroki / nomnoml / index.js View on Github external
function convert () {
  const source = data.toString(encoding)
  if (source === '') {
    return
  }
  console.log(nomnoml.renderSvg(source))
}
github nasa / openmct / docs / gendocs.js View on Github external
function renderNomnoml(source, target) {
        var canvas =
            new Canvas(CONSTANTS.DIAGRAM_WIDTH, CONSTANTS.DIAGRAM_HEIGHT);
        nomnoml.draw(canvas, source, 1.0);
        canvas.pngStream().pipe(fs.createWriteStream(target));
    }
github skanaar / nomnoml / webapp / StoreLocal.ts View on Github external
async files(): Promise {
    return JSON.parse(localStorage['nomnoml.file_index'] || '[]') as FileEntry[]
  }
  async read(name: string): Promise {
github skanaar / nomnoml / webapp / StoreLocal.ts View on Github external
async insert(name: string, source: string): Promise {
    var entry: FileEntry = {
      date: (new Date()).toISOString(),
      collaborators: [],
      name: name,
      revision: 0,
    }
    var index = await this.files()
    if (!nomnoml.skanaar.find(index, e => e.name === name)) {
      index.push(entry)
      index.sort((a,b) => a.name.localeCompare(b.name))
      localStorage['nomnoml.file_index'] = JSON.stringify(index)
    }
    localStorage[this.prefix+name] = source
  }
  async save(name: string, source: string): Promise {
github skanaar / nomnoml / webapp / StoreUrl.ts View on Github external
async files(): Promise {
    return JSON.parse(localStorage['nomnoml.file_index'] || '[]') as FileEntry[]
  }
  async read(name: string): Promise { return this.source }
github skanaar / nomnoml / webapp / FileSystem.ts View on Github external
files(): FileEntry[] {
    return JSON.parse(localStorage['nomnoml.file_index'] || '[]') as FileEntry[]
  }
  setFiles(index: FileEntry[]): void {
github skanaar / nomnoml / webapp / StoreDefaultBuffer.ts View on Github external
async files(): Promise {
    return JSON.parse(localStorage['nomnoml.file_index'] || '[]') as FileEntry[]
  }
  async read(name: string): Promise { return localStorage[this.storageKey] }
github doctorrustynelson / vscode-nomnoml / src / extension.ts View on Github external
private generateDiagram( text: string ): string {
            let svg : string;
            let backgroundColor : string = undefined;

            try {
                svg = nomnoml.renderSvg( text );
                let result = /\#bgColor\:\s?(\S*)/.exec( text );
                if( result && result[ 1 ] )
                    backgroundColor = result[ 1 ];
            } catch( exception ){
                return this.errorSnippet( exception );
            }
            
            return `
                <div style="width: 100%; height: 100%; overflow: scroll;">
                ${ svg }
                </div> 

nomnoml

The sassy UML renderer that generates diagrams from text

MIT
Latest version published 8 days ago

Package Health Score

73 / 100
Full package analysis