Vishal Vishal - 1 year ago 318
HTML Question

d3.js to show a popup window with a form on click of image

My requirement is to show a popup window on click of some image (similar to this How to create a popup window with a form?). The popup window will contain some text fields and submit button. Upon searching, I could see that jquery already provides that feature, but i'm not quite sure if jquery and d3.js works together. Do anyone know this kind of libarries or example source code in d3.js?

Appreciate your help.

Update: I tried integrating the above example with jquery, but then sine d3.js uses svg to draw my objects and login form is inside a div as in example (How to create a popup window with a form?), the window scrolls down looking very bad.

Appreciate any help here.

Answer Source

Yes Jquery can "work together" in the sense that you can mix the code (ie: use jQuery in a d3.js callback for instance).

Your question is quite vague however, maybe you could precise what you have in mind or have a code snippet? I invite you to consult: and look for within the numerous D3.js examples see if you find something similar to what you want to achieve.

The way to open a popup would be something like using the D3.js selector, and then using whatever jquery code in the callback function

var svg ="YourD3Canvas")
            .on("click", function(d) { js or jquery code,  etc... });
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download