Git Product home page Git Product logo

data-forge-plot's Introduction

data-forge-plot

The forgiving plotting API designed for use with Data-Forge.

Use Data-Forge Plot to quickly and conveniently render charts from your data in JavaScript or TypeScript. It is an abstraction layer that connects Data-Forge with JavaScript visualization libraries so that it's easy to plot charts from your data.

Why not do your data wrangling, analysis and visualization entirely in JavaScript? To support my effort please buy or help promote my book Data Wrangling with JavaScript.

Or check out my blog: The Data Wrangler.

Do your prototyping and exploratory data analysis in JavaScript with Data-Forge Notebook.

Please join the conversation on Gitter

Breaking changes

As of version 0.4.0 the Nightmare/Electron depenency has been removed along with the renderImage function.

The renderImage function has been moved to the separate library @data-forge-plot/render. This has been removed due to the size that the Electron dependency adds to this package. In the future you you will have to install the separate package to render a plot to an image.

Please note that the sample code below to see how the new library is installed and required to access the renderImage function.

Project Goals

  • To simply and conveniently from a series or dataframe to chart.
  • To create charts and visualizations in Node.js and the browser.
  • To export web-based interactive charts that can easily be hosted under a web-server.
  • To be able to serialize a chart to JSON and then reinstantiate it from the JSON in a web-app.
  • To separate configuration and data definition to make it easy to reuse charts.
  • To configure charts in JSON or fluent API.

Usage

Some instructions for using Data-Forge Plot. These instructions are for JavaScript, but this library also works in TypeScript.

Install

npm install --save data-forge data-forge-plot @data-forge-plot/render

Setup

    const dataForge = require('data-forge');
    require('data-forge-fs'); // Extends Data-Forge with 'readFile' function.
    require('data-forge-plot'); // Extends Data-Forge with the 'plot' function.
    require('@data-forge-plot/render'); // Extends Data-Forge Plot with the 'renderImage' function.

Rendering a chart from a CSV file to an image file

    const dataFrame = await dataForge.readFile("my-data-file.csv").parseCSV();
    await dataFrame.plot().renderImage("my-chart.png");

Exporting a chart from a CSV file to an interactive web visualization

    const dataFrame = await dataForge.readFile("my-data-file.csv").parseCSV();
    await dataFrame.plot().exportWeb("./output-path");

More docs coming soon

It's early days for DFP. I'll be working on more docs soon.

To see examples of API usage please see my blog posts:

There's also a first example of DFP here (JavaScript):

https://github.com/data-forge/data-forge-plot-first-example

And a bunch of examples in this repo:

https://github.com/data-forge/data-forge-plot-examples

data-forge-plot's People

Contributors

ashleydavis avatar btruhand avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.