0.0.3 • Published 4 years ago

vegaexp v0.0.3

Weekly downloads
64
License
ISC
Repository
github
Last release
4 years ago

vegaEXP

vega expressions is a super simple way to turn graph equations into lines for vega!!

vega expressions was made for the original use of my discord bot but later decided to be posted :D

Most Recent Update Notes:

  • 0.0.2a => Added random, use {rand} in the string to signify random! And opts value randLevel = array min, max for random (Default: 0,10)
  • 0.0.2 => Added absolute value support ("|#|")

Simple setup

const vegaEXP = require('vegaexp');
new vegaEXP('2x+3').then((canvas) =>{ // Put the equation in here, this is also a promise that returns the canvas vega usually gives ya! :p
    // If you want to interact with the canvas as usual you can here!
    //Do what you want with this, in this example I'm just going to write the file
    fs.writeFileSync('./coolimage.png', canvas.toBuffer()) // Just look up Canvas documentation if you want to use these properly!
})

And now we have a picture!

./coolimage.png:

Image

Exponent support is here, and we have many more plans like: 1. Optimized graph visualization 2. Better customizability

Customizing

At the moment customizing isn't very easy! But definitely planned!! If you want to customize the look of your graph you can either: 1. Edit ./node_modules/vegaexp/base-template.json 2. When making a new vegaEXP you can do vegaEXP(EXP, {file: YOUR_OWN_FILE.json}) (Full path). More customization will come soon but for no you need to learn the way vega customizes their visualization in JSON

Links

NPM Package

GitHub

Discord (For Support)

0.0.3

4 years ago

0.0.2-c

5 years ago

0.0.2-b

5 years ago

0.0.2-a

5 years ago

0.0.2

5 years ago

0.0.1-f

5 years ago

0.0.1-e

5 years ago

0.0.1-d-qf

5 years ago

0.0.1-d

5 years ago

0.0.1-c

5 years ago

0.0.1-b

5 years ago

0.0.1-a

5 years ago

0.0.1

5 years ago