Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

An experimental (work in progress) JavaScript-based plotting API for Data-Forge

License

NotificationsYou must be signed in to change notification settings

data-forge/data-forge-plot

Repository files navigation

The forgiving plotting API designed for use withData-Forge.

Data-Forge Plot is now a simple wrapper forthe Plot library.

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 bookData Wrangling with JavaScript.

Or check out my blog:The Data Wrangler.

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

Please join the conversation onGitter

Click here to support my work

Breaking changes

As of version 1.0.0 Data-Forge Plot has been gutted and reimplimented in terms of thePlot library (which is very similar). DFP is now just a wrapper for Plot to ease my maintence burden.

The functionexportWeb has been removed because it is to difficult to maintain.

If you want to use this in the browser please use thePlot library instead, e.g.:

constdataframe= ...constplotConfig={ ...};constaxisMap={ ...};import{plot}from"plot";import"@plotex/render-dom";plot(dataframe.toArray(),plotConfig,axisMap).renderDOM(document.getElementByID("a-chart");

--

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

TherenderImage 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 andrequired to access therenderImage 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 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 @plotex/render-image

Setup

constdataForge=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('@plotex/render-image');// Extends Data-Forge Plot with the 'renderImage' function.require('@plotex/render-dom');// Extends Data-Forge Plot with the 'renderDOM' function.

Rendering a chart from a CSV file to an image file

constdataFrame=awaitdataForge.readFile("my-data-file.csv").parseCSV();awaitdataFrame.plot().renderImage("my-chart.png");

Rendering a chart to a web page.

constdataArray=// ... acquire data, e.g. from a REST API ...constdataFrame=newDataFrame(dataArray);constchartElement=document.getElementById("chart");awaitdataFrame.plot().renderDOM(chartElement);

About

An experimental (work in progress) JavaScript-based plotting API for Data-Forge

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp