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

Latest commit

 

History

History
26 lines (19 loc) · 734 Bytes

README.md

File metadata and controls

26 lines (19 loc) · 734 Bytes

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)} />;
}