Plotly contour plot from CSV file

Hi,
I need some help ! Of course I’m a newbie so sorry if my questions are basic.
But I would like to plot a contour plot using a plotly template that fits my need. I manage to render the graph when he data is included in the script but I dont’t manage to make it work from a csv file. Here is the link of my project.


Thank you for your help.
R.

Hello! Here is one way to make it work…

This a summary of the changes I did to your code:

  • I used d3.csv() to import the CSV file
  • I wrapped the data processing and visualization code inside .then()
  • Since the data are now coming into a data object, I used .map() to extract the X, Y, Z variables
  • I changed your data variable into vizData to avoid conflict with the data object created from the CSV import

If anything in the code is new to you, feel free to ask about it.

2 Likes