Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @nteract/transform-vega with all npm packages installed. Try it out:

require("react/package.json"); // react is a peer dependency. var transformVega = require("@nteract/transform-vega")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@nteract/transform-vega v7.0.10

Vega Transform

@nteract/transform-vega

This package contains a React component for rendering interactive visualizations using Vega.

Installation

$ yarn add @nteract/transform-vega
$ npm install --save @nteract/transform-vega

Usage

The example below shows how we can use this package to render a scatterplot.

import { Vega3 } from "@nteract/transform-vega";

export default () => {
  return (
    <Vega3
      data={{
        description: "A scatterplot showing horsepower and miles per gallons.",
        data: {
          values: cars
        },
        mark: "point",
        encoding: {
          x: { field: "Horsepower", type: "quantitative" },
          y: { field: "Miles_per_Gallon", type: "quantitative" },
          color: { field: "Origin", type: "nominal" },
          shape: { field: "Origin", type: "nominal" }
        }
      }}
    />
  );
};

Documentation

We're working on adding more documentation for this component. Stay tuned by watching this repository!

Support

If you experience an issue while using this package or have a feature request, please file an issue on the issue board and add the pkg:transform-vega label.

License

BSD-3-Clause

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free