1.0.1 • Published 8 years ago

console-scatter-plot v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

console-scatter-plot

Simple scatter plot generator writing into browser/node console

npm install --save console-scatter-plot
import ScatterPlot from 'console-scatter-plot';

var option = {
  xAxis: {
    label: 'xLabel',
    color: 'red'
  },
  yAxis: {
    label: 'yLabel',
    color: 'blue'
  },
  points: [{x: 100, y: 30}]
};

var scatterPlot = new ScatterPlot(option);

var graph = scatterPlot.string(); // get graph as string (without color)
scatterPlot.print(); // print to console

snapshot

demo

option

paramdefault
xAxislabel'x'
min(auto)
max(auto)
length60
color
flipfalse
yAxislabel'y'
min(auto)
max(auto)
length20
color
flipfalse
points[]x(required)
y(required)
marker'*'
color

color option

  • Browser
    • CSS color style (#f00, rgb(255, 0, 0), red, ...)
  • Node.js
    • black
    • red
    • green
    • yellow
    • blue
    • magenta
    • cyan
    • white
    • gray
    • grey