The question is not quite on the topic, but it is partially connected with programming.

I am looking for a service that accepts js code at the textarea input, for example:

return (x) => x * x; 

Or:

 return [ (x) => x * x, (x) => x * 2, ]; 

Or:

 const func = (x) => x * x; return func; 

And at the output he draws a graph (s), based on what returns return.

In short, I am looking for a graph builder with full JS support.

PS I understand that this can be done on your own, but it is a matter of time and cycling. Perhaps there is a ready-made solution that I can not find.

PSS Any Google search simply leads to the JS library.


In theory, the link is simple: we pull the data out of the field, execute the extracted code and get the function , use any library to build the graphs, apply the function to it. Maybe someone already did it and did it better than I would have.

Closed due to the fact that the essence of the question is not clear to the participants of Darth , ߊߚߤߘ , cheops , andreymal , ilyaplot 30 Oct '17 at 12:23 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • And what's stopping you to take the library and make such a service. since no one has done it yet? This is not a complicated service at all. - Darth
  • one
    From the reference : Questions on the topic that you shouldn't ask anyway: ... Questions about where to find programs, libraries, tutorials on programming and administration. - окт
  • @Arhad anyway, I can't do anything now. Would remove, but does not give. I usually do not ask stupid questions. It just so happened) - Vitaly Zaslavsky

1 answer 1

I personally used this library, quite convenient:

http://gionkunz.imtqy.com/chartist-js/

A couple of others:

http://www.cotrino.com/2013/05/starpaths/

http://www.chartjs.org/docs/latest/

https://nxsheet.com/sheets/56d0a87264e47ee60a95f652

Here you can search simply from tons of different options:

https://github.com/d3/d3/wiki/Gallery

Here you need to draw the axis yourself:

http://sigmajs.org/

  • The task is not to find a suitable library. The task in constructing graphics online, using the usual JS function. Among other things, almost all of these libraries work on the principle of "data array => graph", and I need a "function => graph" with all the consequences (especially scaling) - Vitaly Zaslavsky
  • @VitaliyZaslavsky what's the problem, having a function, to generate an array of data? These are two or three lines. - Darth
  • You can also mention a very powerful lib rrag.imtqy.com/react-stockcharts but not sure that it will fit the topic here - Sasha Borichevsky
  • @Vitaly Zaslavsky I understood that perfectly. But it’s not accepted to solve problems for others, it’s customary to help. Show your skills, how you tried to do it and it didn’t work for you and they will definitely help you. These libraries essentially solve 90% of your question. - Telion