S
S
semki0962020-02-11 18:13:21
Laravel
semki096, 2020-02-11 18:13:21

How to work with data for D3js using Laravel as an example?

I'm looking at an example of plotting in which data is taken from the data.tsv file and parsed into an array of objects. In D3js

const promiseMSFT = fetch("https://.../data.tsv")
    .then(response => response.text())
    .then(data => tsvParse(data))
...

and then the library builds a graph based on this data.

Question. In Laravel, I do not have a data.tsv file, and the data is taken from the database, I create a route that gives data for plotting. How can I give them if I give them in the form of a json array - this is not what I need, as I understand it, an array of objects. I would be grateful for help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Kulaxyz, 2020-02-12
@semki096

https://github.com/niksell/d3js-mysql

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question