Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Advice on how to dynamically generate 3-D graphs from user input?

I need advice on how to dynamically create scatter graphs that can be viewed in 3-dimensional space based on user input.

Basically I created a form that the user will fill out. It consists of: -12 checkboxes -24 individual questions each containing 5 radio buttons

*Input from the "radio button" portion of the form will generate x, y, and z coordinates on a graph (hopefully). *Input from the 12 checkboxes will rotate the graph ( up, down, left, right ) according to values determined by each input. *It is important that I have some level of control as far as the styling is concerned. I am looking to create something fairly specific. *Once the form is submitted another .php page will open with a graph section displaying the individual user's data.

I have found many plug-ins that generate a graph, but most are 2-dimensional. I am hoping to avoid creating an image or .png for every possible combination (there would we hundreds) and instead generate an image dynamically.

You can view my website (so far) at www.fugitivelove.com. Once you scroll down to the "Dig" and "Dig Deeper" content you will see a graph to the right. This is just a place holder for another image, so ignore this. You will see the background image which is the form I would like user's to fill out.

Has anyone come across something similar? I am new to web design and programming but am eager to learn.

3 Answers

Hey Kristofor, was trying to look for something that would help you out, but I'm not entirely sure what your end chart needs to look like. Is this the type of chart you're trying to accomplish? Something like that can be done with JavaScript, and some solutions even let you move the camera around.

Sort of. I'm looking for something a little more basic and hopefully something I can rotate (think early computers or the technical plans for the Death Star in the Star Wars episode IV). I want the user to input information, and have the answers transform into a point on the graph. I have looked into Processing.js recently and there seems to be some prospects there. Still searching...

Thanks.

Yeah I saw processing mentioned here, along with canvasexpress. Doing it in 3d on your own (canvas/js) would be time consuming, but you'll be more limited building upon existing solutions when it comes to the aesthetics. Also see three.js mentioned a bit, but it looks a bit over my head.