This contains all the transforms that nteract uses, which extends all those
supported by Jupyter frontends from @nteract/transforms
while adding on
- GeoJSON
- Plotly
- Vega
It's likely you don't need to use this package directly and can instead use a release of the display area (:soon:).
npm install @nteract/transforms-full
Note: React is a peer dependencies you'll have to install yourself.
import {
richestMimetype,
transforms,
displayOrder,
} from '@nteract/transforms-full'
// Jupyter style MIME bundle
const bundle = {
'text/plain': 'This is great',
'image/png': 'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'
}
// Find out which mimetype is the richest
const mimetype = richestMimetype(bundle, transforms)
// Get the matching React.Component for that mimetype
let Transform = transforms[mimetype]
// Create a React element
return <Transform data={bundle[mimetype]} />
import {
richestMimetype,
registerTransform,
transforms,
displayOrder,
} from '@nteract/transforms-full'
import someCustomTransform from 'somewhere';
let registry = { transforms, displayOrder };
registry = registerTransform(registry, someCustomTransform);
...
const Transform = registry.transforms[mimetype];