Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save corymaklin/cefa036f5022595dca99b4e435999ebb 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