Can you post a link to your draft notebook where the data is failing to load? (You can get a link to draft notebooks using the ‘Share Link’ option under the ‘. . .’ at the top of the screen.)
Your example is interesting (even if I don’t know how to use the return of your loadData function as a base to d3.csv) but I wouldn’t know how to embed my notebook on a personal webpage and passing a variable to it…
oh, I c. You are trying to embed a number of notebooks into your personal site with same graph? and only data part is different? Sorry, I missed that part.
I’d just create a bunch of small notebooks using your base chart notebook with loadData() example and embed them that way.
Hope that helps. @fil migh have more insight on notebook embeds. he’s done some work with that.
I plan to have multiple monthly graphs… so I’d prefer to generate automatically the charts, based on a simple variable.
Thanks @RandomFractals and I hope to have a way to achieve this.
Or I could use just d3js but I don’t see how to transform the “DOM” input used in this part (and other parts):
g.append(“clipPath”)
.attr(“id”, d => (d.clip = DOM.uid(“clip”)).id)
.append(“rect”)
.attr(“width”, width)
.attr(“height”, step);
I hope you know observable js notebooks are proper es6 js modules.
You can just import your exported notebook code that way, or even get more crafty and put your data in the global space for the notebook and your page to fill and reference.
actually, no, not done yet. You can just have your notebook loadData() get your data pointer from page url query or anchor fragment. I am sure there is some pattern and base url for your monthly data load.