Skip to content
This repository has been archived by the owner on Aug 28, 2017. It is now read-only.

nteract/transformime-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

transformime-react

This package has been deprecated in favor of @nteract/transforms.

The usage is similar:

import { richestMimetype, standardTransforms } from '@nteract/transforms';
import Immutable from 'immutable';

// Jupyter style MIME bundle
const bundle = new Immutable.Map({
  'text/plain': 'This is great',
  'image/png': 'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'
});

// Find out which mimetype is the richest
const mimetype = richestMimetype(bundle); 

// Get the matching React.Component for that mimetype
let Transform = transforms.get(mimetype);

if(Transform) {
  return <Transform data={bundle.get(mimetype)} />;
}