codementum / experimentr

Backend (Node.js, redis), frontend (js), and analysis (R) for web-based visualization studies.
29 stars 16 forks source link

Do we wanna update to d3.v...4?5? #74

Open Fumeng-Yang opened 6 years ago

Fumeng-Yang commented 6 years ago

I tried both today. I think we can update to v4 with some minor changes. However, in d3.v5, "HTML parsing requires a global document and relies on DOM Ranges, which are not supported by JSDOM as of version 8.3, thus, this method is supported in browsers but not in Node". We need to find another way to load HTML pages.

codementum commented 6 years ago

Couldn't we still do v5, however, since the main d3.html call comes from the client?

Fumeng-Yang commented 6 years ago

👋hmmm... I didn't get it. Could you be more specific?

codementum commented 6 years ago

"HTML parsing requires a global document and relies on DOM Ranges, which are not supported by JSDOM as of version 8.3, thus, this method is supported in browsers but not in Node".

^ It looks like you can still do HTML parsing in the browser, which is where we call it, but not in node. We don't use d3.html in node so we should be fine. (Unless I'm missing something...)

Fumeng-Yang commented 6 years ago

I tried this morning.

-> d3.html() I don't think you used (=the initial version) it in node.js. Unless I miss something, isn't experimentr.js a native js file... -> Calling d3.html() in the browser still doesn't work. Nothing happened. I don't know what I missed. -> We can still do native js code, which does less for us, or JQuery. However, I'm scared of including too many libraries and messing up the current neat structure.

Fumeng-Yang commented 6 years ago

Ignore the first point above. Stupid Fumeng before the morning coffee. Anyway, I hope we can keep the current architecture. It is neat and flexible.

codementum commented 6 years ago

Ah, well if you've tried it and it doesn't work with v5, then maybe one of us will have to sit down one day and debug until we figure out which part is going wrong.

I agree 100% that avoiding other libraries (jquery) is desirable.

Fumeng-Yang commented 6 years ago

Ha. On my todos list, I will find a day to spend a few more hours on it. If I can't figure it out, I will leave it to you. P.S. d3 v4 works properly and I am using the highest version of d3 v4 now. The only change to the original version is to rename a function call.

Fumeng-Yang commented 6 years ago

I did some work for v5 today. I think I can parse the html page and append them to the current page now. However, I don't think why Githubissues.

  • Githubissues is a development platform for aggregating issues.