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.
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment