Javafx ("DataViz")

All the posts i show here in javafx  are my learning process in javafx. Since i started building data viz projects have learned a lot about javafx and yet to learn a lot more and loving it.
As i have observed as the data gets bigger the more am shifting to using Streams(Java 8) as compared to Collections.
2006 and 2010 counties grade frequency

That said another javafx dataviz project,the data here.

Streams really make it simple to query data as compared to Collections,with the data i wanted to find the summation of a grade frequency for each county in Kenya for years 2006 and 2010 and from schools that are in 2006 and 2010 for better comparison.

My query

for(county loop){
     String county_name=county;

     for(grade loop){
         for(year loop){

             Optional<Integer> sum=
                 .filter(s->s.split(",")[0].equals(year) && s.split(",")  [3].equalsIgnoreCase(county_name)                       && s.split(",")[8].equals(grade))
Drawing the circles is really simple, below is an example of how i did it.

   AnchorPane root = new AnchorPane();

     Rectangle rect=new Rectangle(10,10);

      Text grade=new Text("A");
      Node x_axis_node=root.lookup("#Baringo");
      Node y_axis_node=root.lookup("#A");
      Circle circle=new Circle(5);

I had to create another file that contains only year 2006 and 2010 ,cause the original data takes about 10 minutes to complete it has 273,867 records.
The radius of the circle is the sum total of a grade frequency the largest circle with a radius of 20 and a grade frequency of 3308.
Producing 2006 performance in a separate image with 2010 it was had to see the difference like ...

Okay,i thought of calculating the difference but most of the values were really small for visualization,the last attempt was to draw the circles in one image with different strokes and transparent fill,and this is it
2006 and 2010 counties grade frequency


Popular Posts