Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improper data source detection #1018

Open
kbidata opened this issue Apr 6, 2022 · 1 comment
Open

Improper data source detection #1018

kbidata opened this issue Apr 6, 2022 · 1 comment

Comments

@kbidata
Copy link

kbidata commented Apr 6, 2022

Dygraphs automatically detects if a CSV is the data source by means of checking the file name for a line break. If a line break isn't present, then it decides it's a CSV and looks for the file on the system.

Instead of having this automatic detection, it would make more sense to specify the data source.

This would make it possible to use JavaScript strings containing CSV data as a data source. Currently these variables are treated as files rather than strings and are searched for on the system. (returning 404)

@danvk
Copy link
Owner

danvk commented Apr 6, 2022

Can you provide an example where a multiline CSV is being treated as a file name? dygraphs should work in the way you describe:

it('testOneCSV', function() {
var opts = {
width: 480,
height: 320
};
var data = "X,Y\n" +
"0,-1\n" +
"1,0\n" +
"2,1\n" +
"3,0\n"
;
var graph = document.getElementById("graph");
var g = new Dygraph(graph, data, opts);
assert.deepEqual(['0', '1', '2'], getXLabels());
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant