Giter Site home page Giter Site logo

node-gnuplot's People

Contributors

davvo avatar tyrasd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

node-gnuplot's Issues

add pause support

if you add 'pause', then running from command line can open x11 windows.

in gnuplot.js
['set', 'unset', 'plot', 'splot', 'replot','pause'].forEach(function (name) {

thanks.

Error handling?

Is there any error handling in this? What happens when an instruction (string) given to gnuplot creates and error and fails to produce a plot? I'm not seeing any obvious way to get feedback if something fails. Thanks!

Callback before image generation finish

Hi, I'm using gnuplot in order to create an image and send it in Telegram, the function it's like this:

function img_generation (result, callback) {

  let plot = gnuplot()
    .set('terminal png medium size 400,300')
    .set('output "out.png"')
    .set('title "Isotopic distribution"')
    .unset('key') // no legend
    .set('border 3')
    .set('xlabel "m/z (Da)"')
    .set('ylabel "Intensity (%)"')
    .set('ytics nomirror') // hide ticks left
    .set('xtics nomirror') // hide ticks top
    .set('grid xtics lw 1 lc rgb "#dddddd"')
    .set('grid ytics lw 1 lc rgb "#dddddd"')
    .set('xrange [' + result.chartXFrom + ':' + result.chartXTo + ']')
    .set('yrange [0:120]');

  result.xy.forEach( (point) => {
    plot.set('arrow from ' + point[0] + ',0 to ' + point[0] + ',' + point[1] * 100 + ' nohead lw 2 lc rgb "blue"');
  });
  plot.plot('sin(x) lc rgb "white"');
  plot.end( (err) => {
    if (err) console.error(err);

   // here I send the image
    bot.sendPhoto(fromId, 'out.png');
  });
}

The problem is that the image it's trying to be sended before it's generated, do you have any idea why it's that happening?

Thanks, I love your module ๐Ÿ‘

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.