Skip to content

Instantly share code, notes, and snippets.

@corymaklin
Created December 17, 2018 03:00
Show Gist options
  • Select an option

  • Save corymaklin/305955e760a202208d0d9c647bcce904 to your computer and use it in GitHub Desktop.

Select an option

Save corymaklin/305955e760a202208d0d9c647bcce904 to your computer and use it in GitHub Desktop.

Revisions

  1. corymaklin created this gist Dec 17, 2018.
    16 changes: 16 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    import * as tfvis from '@tensorflow/tfjs-vis';

    const data = [
    { index: 0, value: 50 },
    { index: 1, value: 100 },
    { index: 2, value: 150 },
    ];

    // Get a surface
    const surface = tfvis.visor().surface({ name: 'Barchart', tab: 'Charts' });

    // Render a barchart on that surface
    tfvis.render.barchart(data, surface, {});

    const div = document.getElementById('container');
    div.appendChild(surface);