Posts

Showing posts with the label D3JS

D3Js Exploding Pie Chart Part 1

With one of my current projects I have been worked on creating a way for users to click on individual pieces of a pie chart and slight pull out that portion of the pie. It's a small and pointless feature, something I like to call eye candy in the frontend world.  For people some people it illustrates the content better. To be honest I found myself interesting for the UX. Its fun for me to recreate in d3js since the problem is challenging.

Problem
   This isn't a math problem but more of svg drawing problem, at the point where d3js draws out the pie chart there is some calculations to the index to see it out of order but if I can understand the method being used then I can modify it to include the exploding property.

var explode =function(x,index){var offset =80;var angle =(x.startAngle + x.endAngle)/2;var xOff =Math.sin(angle)*offset;var yOff =-Math.cos(angle)*offset;return"translate("+xOff+","+yOff+")";} g.append("path").attr("…

Web/Game Development - Math Isn't going to be a Problem

When I was in college I wondered how much math I would need to become a game developer. Just for one of my associate degrees I had to take calc 2 which honestly wasn't that bad, I think the physics based calc was more of a challenge but that's in the past now. The real work begins is in my career and a lot of times my math isn't what it needs to be to create a proper solution. When I was building penguins-rising I didn't have any problems with coding just solving some algebra. So I went out of my way after that project to study what I could.
Terms & Studies
GeometricsOrientation (vector space)Making a Rotation Matrix From Scratch - YouTubeTexturesPhong reflection modelhttp://cs.jsu.edu/~leathrum/Mathlets/parapath.htmlcreated by a student that shows how graphs can be modified.Fuzzy setAlgebra (of course)VerticesVectors? Just going off my knowledge with C++ This is just a few things I've come across over the years as a developer, I think its interesting how web…

Project: Raft Draft for Data-Steamer

Image
The purpose of this project is to wrap a set of d3js "graphics" and make them easier to create for non-javascript developers. The second reason is to standarize interactions and styles that are acceptable to the site and types of graphs needed. The final result of this project will simple be a wrapper for d3js with well defined graphs that can be marked up withhtml or with model binding (razor syntax).

P.S. this Project will be located here!

Details:
There are currently four types of graphs, a line-chart, side-chart, pie-chart and bar-chart. All are used within a div tag and used as an attribute. Styling is always handled with the css (if it can be helps) and compliant with the css libraries like bootstrap. The coloring is based on a base color scheme provided by 3d but I might also base it on whatever css library is being used. From example bootstrap's primary color but I'm just thinking out load on this.
Example:
      <div line-chart></div> or for razor…

Make d3js Responsive

Image
This is probably the most popular quesition I see and is somewhat my main concern as far as things go with one of my projects. Now this isn't a perfect solution but its doesn't depend on jquery or anything else. So it keeps things in the d3js scope which is really what I want since I don't always include jquery in all of my projects.
function resize() { //Top Nav has a bottom padding for 50px's width = window.innerWidth, height = window.innerHeight; svg.attr("width", width).attr("height", height); force.size([width, height]).resume(); } window.addEventListener('resize', resize()); var svg = d3.select("body").append("svg") //.attr("viewBox", "0 0 " + width + " " + height) //.attr("preserveAspectRatio", "xMidYMid meet");
     I didn't include the comments in my project but I think others might and I feel they are v…