<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Zchen15</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Zchen15"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Zchen15"/>
	<updated>2026-05-16T18:44:16Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=97075</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=97075"/>
		<updated>2015-05-03T20:48:40Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Bar Charthttp://googlevisualr.herokuapp.com/examples/interactive/bar_chart */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
The goal of this project is to present the the data in Expertiza in a more convenient way. Through the use of charts and graphs to enhance certain pages, such as the student's scores page and the instructor's scores page, and allow for the users to get an at-a-glance analysis of the data without having to dive into the tables.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this project is to add a visualization element to some of the data collected in expertiza. The aim of this is to provide a more intuitive “at-a-glance” idea of the data, some examples would be: how a student is doing on his/her assignments, or how their work compares to that of their classmates. On a less functional angle, it also enhances the aesthetics of the pages, taking the drab tables and giving them a more appealing look.&lt;br /&gt;
&lt;br /&gt;
=Overview of Approach=&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
option = { width: 400, height: 240, title: 'Company Performance' }&amp;lt;br/&amp;gt;&lt;br /&gt;
@chart = GoogleVisualr::Interactive::AreaChart.new(data_table, option)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id='chart'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;%= render_chart @chart, 'chart' %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Chart Examples====&lt;br /&gt;
=====Area Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/area_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/areachart.html#Example&lt;br /&gt;
  def area_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['2004', 1000, 400],&lt;br /&gt;
      ['2005', 1170, 460],&lt;br /&gt;
      ['2006', 660, 1120],&lt;br /&gt;
      ['2007', 1030, 540]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts   = { width: 400, height: 240, title: 'Company Performance', hAxis: {title: 'Year', titleTextStyle: {color: '#FF0000'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::AreaChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Bar Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bar_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/barchart.html#Example&lt;br /&gt;
  def bar_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows(4)&lt;br /&gt;
    data_table.set_cell(0, 0, '2004')&lt;br /&gt;
    data_table.set_cell(0, 1, 1000)&lt;br /&gt;
    data_table.set_cell(0, 2, 400)&lt;br /&gt;
    data_table.set_cell(1, 0, '2005')&lt;br /&gt;
    data_table.set_cell(1, 1, 1170)&lt;br /&gt;
    data_table.set_cell(1, 2, 460)&lt;br /&gt;
    data_table.set_cell(2, 0, '2006')&lt;br /&gt;
    data_table.set_cell(2, 1, 660)&lt;br /&gt;
    data_table.set_cell(2, 2, 1120)&lt;br /&gt;
    data_table.set_cell(3, 0, '2007')&lt;br /&gt;
    data_table.set_cell(3, 1, 1030)&lt;br /&gt;
    data_table.set_cell(3, 2, 540)&lt;br /&gt;
&lt;br /&gt;
    opts   = { :width =&amp;gt; 400, :height =&amp;gt; 240, :title =&amp;gt; 'Company Performance', vAxis: {title: 'Year', titleTextStyle: {color: 'red'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BarChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Bubble Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bubble_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/bubblechart.html&lt;br /&gt;
  def bubble_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'ID')&lt;br /&gt;
    data_table.new_column('number', 'Life Expectancy')&lt;br /&gt;
    data_table.new_column('number', 'Fertility Rate')&lt;br /&gt;
    data_table.new_column('string', 'Region')&lt;br /&gt;
    data_table.new_column('number', 'Population')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['CAN',    80.66,              1.67,      'North America',  33739900],&lt;br /&gt;
      ['DEU',    79.84,              1.36,      'Europe',         81902307],&lt;br /&gt;
      ['DNK',    78.6,               1.84,      'Europe',         5523095],&lt;br /&gt;
      ['EGY',    72.73,              2.78,      'Middle East',    79716203],&lt;br /&gt;
      ['GBR',    80.05,              2,         'Europe',         61801570],&lt;br /&gt;
      ['IRN',    72.49,              1.7,       'Middle East',    73137148],&lt;br /&gt;
      ['IRQ',    68.09,              4.77,      'Middle East',    31090763],&lt;br /&gt;
      ['ISR',    81.55,              2.96,      'Middle East',    7485600],&lt;br /&gt;
      ['RUS',    68.6,               1.54,      'Europe',         141850000],&lt;br /&gt;
      ['USA',    78.09,              2.05,      'North America',  307007000]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts    = {&lt;br /&gt;
      :width =&amp;gt; 800, :height =&amp;gt; 500,&lt;br /&gt;
      :title =&amp;gt; 'Correlation between life expectancy, fertility rate and population of some world countries (2010)',&lt;br /&gt;
      :hAxis =&amp;gt; { :title =&amp;gt; 'Life Expectancy' },&lt;br /&gt;
      :vAxis =&amp;gt; { :title =&amp;gt; 'Fertility Rate'  },&lt;br /&gt;
      :bubble =&amp;gt; { :textStyle =&amp;gt; { :fontSize =&amp;gt; 11 } }&lt;br /&gt;
    }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BubbleChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BubbleChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
simple line chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:data =&amp;gt; [0, 40, 10, 70, 20])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Simplechart.png]]&lt;br /&gt;
&lt;br /&gt;
bar chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [300, 100, 30, 200])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Barchart.png]]&lt;br /&gt;
&lt;br /&gt;
multiple bars chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [[300, 100, 30, 200], [100, 200, 300, 10]], :bar_colors =&amp;gt; ['FF0000', '00FF00'])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Multbarschart.png]]&lt;br /&gt;
&lt;br /&gt;
pie chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.pie(:data =&amp;gt; [20, 35, 45])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Piechart.png]]&lt;br /&gt;
&lt;br /&gt;
These usages come from http://googlecharts.rubyforge.org/. If you want to see more usages, go and visit this site.&lt;br /&gt;
&lt;br /&gt;
===gchartrb===&lt;br /&gt;
gchartrb&amp;lt;ref&amp;gt;http://code.google.com/p/gchartrb/&amp;lt;/ref&amp;gt; is a Ruby wrapper around the Google chart API&amp;lt;ref&amp;gt;http://code.google.com/apis/chart/&amp;lt;/ref&amp;gt;. In our project, we use gchartrb to generate all the bar charts in the visualization. &lt;br /&gt;
&lt;br /&gt;
====installing====&lt;br /&gt;
Installing gchartrb is simple, just include the gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'gchartrb', :require =&amp;gt; 'google_chart'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
=====Bar Chart=====&lt;br /&gt;
The following example code would generate a bar chart.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Bar Chart&lt;br /&gt;
    GoogleChart::BarChart.new('800x200', &amp;quot;Bar Chart&amp;quot;, :vertical, false) do |bc|&lt;br /&gt;
      bc.data &amp;quot;Trend 1&amp;quot;, [5,4,3,1,3,5], '0000ff'&lt;br /&gt;
      bc.data &amp;quot;Trend 2&amp;quot;, [1,2,3,4,5,6], 'ff0000'&lt;br /&gt;
      bc.data &amp;quot;Trend 3&amp;quot;, [6,5,4,4,5,6], '00ff00'&lt;br /&gt;
      puts &amp;quot;\nBar Chart&amp;quot;&lt;br /&gt;
      puts bc.to_url&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The bar chart would look like below.&lt;br /&gt;
[[File:BarChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
=====Line Chart=====&lt;br /&gt;
The following example code would generate a line chart.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Line Chart&lt;br /&gt;
    GoogleChart::LineChart.new('320x200', &amp;quot;Line Chart&amp;quot;, false) do |lc|&lt;br /&gt;
      lc.data &amp;quot;Trend 1&amp;quot;, [5,4,3,1,3,5,6], '0000ff'&lt;br /&gt;
      lc.show_legend = true&lt;br /&gt;
      lc.data &amp;quot;Trend 2&amp;quot;, [1,2,3,4,5,6], '00ff00'&lt;br /&gt;
      lc.data &amp;quot;Trend 3&amp;quot;, [6,5,4,3,2,1], 'ff0000'&lt;br /&gt;
      lc.axis :y, :range =&amp;gt; [0,6], :color =&amp;gt; 'ff00ff', :font_size =&amp;gt; 16, :alignment =&amp;gt; :center&lt;br /&gt;
      lc.axis :x, :range =&amp;gt; [0,6], :color =&amp;gt; '00ffff', :font_size =&amp;gt; 16, :alignment =&amp;gt; :center&lt;br /&gt;
      lc.grid :x_step =&amp;gt; 100.0/6.0, :y_step =&amp;gt; 100.0/6.0, :length_segment =&amp;gt; 1, :length_blank =&amp;gt; 0&lt;br /&gt;
      puts &amp;quot;\nLine Chart&amp;quot;&lt;br /&gt;
      puts lc.to_url&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The bar chart would look like below.&lt;br /&gt;
[[File:AeraChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
===Circles===&lt;br /&gt;
&lt;br /&gt;
=Visualization in Expertiza=&lt;br /&gt;
This section describes where in Expertiza we can use these visualizations to provide a better user experience. &lt;br /&gt;
The 'Review Score' view of the assignments can be enhanced using these visualization.&lt;br /&gt;
&lt;br /&gt;
We can see by the image below that currently the scores views includes only a large table. From a user experience perspective having a more prioritized view of the scores would be beneficial. Having all the data available for the user to peruse in a table is informative, but when the user wants only to get a quick idea of how they did in an assignment, it would be helpful to have some sort of visualization.&lt;br /&gt;
&lt;br /&gt;
[[File:score_view.png.jpeg]]&lt;br /&gt;
&lt;br /&gt;
The above scoring which is in tabular form can be enhanced with charts.&lt;br /&gt;
&lt;br /&gt;
=Graphical Score Dashboard=&lt;br /&gt;
The scores page was augmented with bar graphs displaying the distributions of each column, as well as a circle icon for the average score for that column. This will allow for easily determining what the reviewers thought of the work, as well as what the range of scores given. The circle graphs with the averages provide a visual for the quality of the work in each of the categories.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_chart.png]]&lt;br /&gt;
&lt;br /&gt;
==New View==&lt;br /&gt;
&lt;br /&gt;
We created a new view under the grades views, called participant_charts. This view is included as a partial in the grades/view_my_scores view. This allows us to not modify any of the existing views and keep the code modular.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Bar Charts==&lt;br /&gt;
&lt;br /&gt;
For the bar charts we constructed a method that, given the score and the type of bar chart, populates an instance variable that contains the charts. The code was included in the grades controller (grades_controller.rb file) and is shown below&lt;br /&gt;
&lt;br /&gt;
    def bar_chart(scores, type)&lt;br /&gt;
        GoogleChart::BarChart.new(&amp;quot;100x100&amp;quot;, &amp;quot; &amp;quot;, :vertical, false) do |bc|&lt;br /&gt;
          data = scores&lt;br /&gt;
          bc.data &amp;quot;Line green&amp;quot;, data, '990000'&lt;br /&gt;
          #bc.axis :x, :positions =&amp;gt; [0, data.size], :range =&amp;gt; [0,100]&lt;br /&gt;
          bc.axis :y, :range =&amp;gt; [0, data.max] ,:positions =&amp;gt; [data.min, data.max]&lt;br /&gt;
          bc.show_legend = false&lt;br /&gt;
          bc.stacked = false&lt;br /&gt;
          bc.width_spacing_options({:bar_width =&amp;gt; 70/(data.size+1),:bar_spacing =&amp;gt; 1, :group_spacing =&amp;gt; 1})&lt;br /&gt;
          bc.data_encoding = :extended&lt;br /&gt;
          @grades_bar_charts[type.to_sym] = (bc.to_url)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
The width of the bars is dependent on the number of scores to show. Assignments with many reviews to show, require smaller bars. This is accomplished by tying the bar_width parameter, to the size of the data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Circle Charts==&lt;br /&gt;
&lt;br /&gt;
For the circle charts showing the averages of the columns we used a javascript library, circle.js. By simply passing the scores to the .js code in the grades view as shown in the code below. The circle is then rendered automatically in a div block elsewhere in the view named the same as the id: tag below&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;% ['review', 'metareview', 'feedback', 'teammate'].each do |type| %&amp;gt;&lt;br /&gt;
      &amp;lt;% if @pscore[type.to_sym][:scores][:avg]%&amp;gt;&lt;br /&gt;
        var myCircle = Circles.create({&lt;br /&gt;
      id:           '&amp;lt;%= &amp;quot;#{type}-circle&amp;quot; %&amp;gt;',&lt;br /&gt;
      radius:       25,&lt;br /&gt;
      value:        &amp;lt;%= @pscore[type.to_sym][:scores][:avg].to_i %&amp;gt;,&lt;br /&gt;
      maxValue:     100,&lt;br /&gt;
      width:        7,&lt;br /&gt;
      text:         '&amp;lt;%=@pscore[type.to_sym][:scores][:avg].to_i%&amp;gt;',&lt;br /&gt;
      colors:       ['#FFEB99', '#FFCC00'],&lt;br /&gt;
      duration:       700,&lt;br /&gt;
      textClass:      'circles-text'&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
==Show / Hide stats==&lt;br /&gt;
&lt;br /&gt;
The user might want to hide the stats, with that in mind we included a button to toggle the visibility of the charts. Making use of an existing function, toggleElement, we added a link above the charts table that when clicked hides/shows the charts. The code to accomplish this is shown below&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;a href=&amp;quot;#&amp;quot; name='score-chartLink' onClick=&amp;quot;toggleElement('score-chart', 'stats');return false;&amp;quot;&amp;gt;hide stats&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Reliability Metric=&lt;br /&gt;
Based on the uniformity of the review scores, we compiled a reliability metric. This metric encapsulates the level of agreement between the reviews, and should provide a quick at a glance notion of whether reviewers agree on the scoring for the particular assignment, or whether there is a high variance in the scores given. A good reliability score indicates that the grade given to the assignment by the reviewers is to be trusted, whereas a poor reliability score indicates that there was a high level of disagreement in the reviewers and the instructors should perhaps take a closer look at the participant's assignment.&lt;br /&gt;
This reliability score is computed from the standard deviation of the review scores. A standard deviation that's less than 10 will award a good reliability score. A standard deviation between 10 and 20 will award a medium reliability score, whereas a standard deviation greater than 20 will give a poor reliability score.&lt;br /&gt;
===Different Icon colors===&lt;br /&gt;
[[File:Green_icon.png]]&lt;br /&gt;
&lt;br /&gt;
The color of the three bars Icon, and the number of filled bars is representative of the reliability of the reviews.&lt;br /&gt;
Take the case of the green sample icon in the image above, the reviews mostly all agree. Whereas in the following two images, the icon is yellow and red respectively to signify increasingly worrying levels of disparity in review scores.&lt;br /&gt;
&lt;br /&gt;
[[File:Yellow_icon.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Red_icon.png]]&lt;br /&gt;
&lt;br /&gt;
A similar method to the one used for the bar charts was used. In this case, a horizontal bar chart was created, and the data was dictated by the qualitative score that was passed into the method. This score could be 'good', 'medium' or 'bad'. Based on this string argument the graph is created with the correct number of bars and the correct color.&lt;br /&gt;
&lt;br /&gt;
    def reliability_chart(score,type)&lt;br /&gt;
        GoogleChart::BarChart.new(&amp;quot;25x20&amp;quot;, &amp;quot; &amp;quot;, :horizontal, false) do |bc|&lt;br /&gt;
          if score == 'good'&lt;br /&gt;
            data = [1,1,1]&lt;br /&gt;
            color = '00ff00'&lt;br /&gt;
          elsif score == 'medium'&lt;br /&gt;
            data = [1,1]&lt;br /&gt;
            color = 'FFCC00'&lt;br /&gt;
          else&lt;br /&gt;
            data = [1]&lt;br /&gt;
            color = '990000'&lt;br /&gt;
          end&lt;br /&gt;
          bc.data &amp;quot;Reliability Symbol&amp;quot;, data, color&lt;br /&gt;
          bc.show_legend = false&lt;br /&gt;
          bc.stacked = false&lt;br /&gt;
          bc.width_spacing_options({:bar_width =&amp;gt; 5,:bar_spacing =&amp;gt; 10, :group_spacing =&amp;gt; 1})&lt;br /&gt;
          bc.data_encoding = :extended&lt;br /&gt;
          @grades_bar_charts[type.to_sym] = (bc.to_url)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=97074</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=97074"/>
		<updated>2015-05-03T20:48:28Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Area Charthttp://googlevisualr.herokuapp.com/examples/interactive/area_chart */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
The goal of this project is to present the the data in Expertiza in a more convenient way. Through the use of charts and graphs to enhance certain pages, such as the student's scores page and the instructor's scores page, and allow for the users to get an at-a-glance analysis of the data without having to dive into the tables.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this project is to add a visualization element to some of the data collected in expertiza. The aim of this is to provide a more intuitive “at-a-glance” idea of the data, some examples would be: how a student is doing on his/her assignments, or how their work compares to that of their classmates. On a less functional angle, it also enhances the aesthetics of the pages, taking the drab tables and giving them a more appealing look.&lt;br /&gt;
&lt;br /&gt;
=Overview of Approach=&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
option = { width: 400, height: 240, title: 'Company Performance' }&amp;lt;br/&amp;gt;&lt;br /&gt;
@chart = GoogleVisualr::Interactive::AreaChart.new(data_table, option)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id='chart'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;%= render_chart @chart, 'chart' %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Chart Examples====&lt;br /&gt;
=====Area Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/area_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/areachart.html#Example&lt;br /&gt;
  def area_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['2004', 1000, 400],&lt;br /&gt;
      ['2005', 1170, 460],&lt;br /&gt;
      ['2006', 660, 1120],&lt;br /&gt;
      ['2007', 1030, 540]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts   = { width: 400, height: 240, title: 'Company Performance', hAxis: {title: 'Year', titleTextStyle: {color: '#FF0000'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::AreaChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Bar Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bar_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/barchart.html#Example&lt;br /&gt;
  def bar_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows(4)&lt;br /&gt;
    data_table.set_cell(0, 0, '2004')&lt;br /&gt;
    data_table.set_cell(0, 1, 1000)&lt;br /&gt;
    data_table.set_cell(0, 2, 400)&lt;br /&gt;
    data_table.set_cell(1, 0, '2005')&lt;br /&gt;
    data_table.set_cell(1, 1, 1170)&lt;br /&gt;
    data_table.set_cell(1, 2, 460)&lt;br /&gt;
    data_table.set_cell(2, 0, '2006')&lt;br /&gt;
    data_table.set_cell(2, 1, 660)&lt;br /&gt;
    data_table.set_cell(2, 2, 1120)&lt;br /&gt;
    data_table.set_cell(3, 0, '2007')&lt;br /&gt;
    data_table.set_cell(3, 1, 1030)&lt;br /&gt;
    data_table.set_cell(3, 2, 540)&lt;br /&gt;
&lt;br /&gt;
    opts   = { :width =&amp;gt; 400, :height =&amp;gt; 240, :title =&amp;gt; 'Company Performance', vAxis: {title: 'Year', titleTextStyle: {color: 'red'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BarChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BarChart.png|center]]&lt;br /&gt;
=====Bubble Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bubble_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/bubblechart.html&lt;br /&gt;
  def bubble_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'ID')&lt;br /&gt;
    data_table.new_column('number', 'Life Expectancy')&lt;br /&gt;
    data_table.new_column('number', 'Fertility Rate')&lt;br /&gt;
    data_table.new_column('string', 'Region')&lt;br /&gt;
    data_table.new_column('number', 'Population')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['CAN',    80.66,              1.67,      'North America',  33739900],&lt;br /&gt;
      ['DEU',    79.84,              1.36,      'Europe',         81902307],&lt;br /&gt;
      ['DNK',    78.6,               1.84,      'Europe',         5523095],&lt;br /&gt;
      ['EGY',    72.73,              2.78,      'Middle East',    79716203],&lt;br /&gt;
      ['GBR',    80.05,              2,         'Europe',         61801570],&lt;br /&gt;
      ['IRN',    72.49,              1.7,       'Middle East',    73137148],&lt;br /&gt;
      ['IRQ',    68.09,              4.77,      'Middle East',    31090763],&lt;br /&gt;
      ['ISR',    81.55,              2.96,      'Middle East',    7485600],&lt;br /&gt;
      ['RUS',    68.6,               1.54,      'Europe',         141850000],&lt;br /&gt;
      ['USA',    78.09,              2.05,      'North America',  307007000]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts    = {&lt;br /&gt;
      :width =&amp;gt; 800, :height =&amp;gt; 500,&lt;br /&gt;
      :title =&amp;gt; 'Correlation between life expectancy, fertility rate and population of some world countries (2010)',&lt;br /&gt;
      :hAxis =&amp;gt; { :title =&amp;gt; 'Life Expectancy' },&lt;br /&gt;
      :vAxis =&amp;gt; { :title =&amp;gt; 'Fertility Rate'  },&lt;br /&gt;
      :bubble =&amp;gt; { :textStyle =&amp;gt; { :fontSize =&amp;gt; 11 } }&lt;br /&gt;
    }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BubbleChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BubbleChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
simple line chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:data =&amp;gt; [0, 40, 10, 70, 20])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Simplechart.png]]&lt;br /&gt;
&lt;br /&gt;
bar chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [300, 100, 30, 200])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Barchart.png]]&lt;br /&gt;
&lt;br /&gt;
multiple bars chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [[300, 100, 30, 200], [100, 200, 300, 10]], :bar_colors =&amp;gt; ['FF0000', '00FF00'])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Multbarschart.png]]&lt;br /&gt;
&lt;br /&gt;
pie chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.pie(:data =&amp;gt; [20, 35, 45])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Piechart.png]]&lt;br /&gt;
&lt;br /&gt;
These usages come from http://googlecharts.rubyforge.org/. If you want to see more usages, go and visit this site.&lt;br /&gt;
&lt;br /&gt;
===gchartrb===&lt;br /&gt;
gchartrb&amp;lt;ref&amp;gt;http://code.google.com/p/gchartrb/&amp;lt;/ref&amp;gt; is a Ruby wrapper around the Google chart API&amp;lt;ref&amp;gt;http://code.google.com/apis/chart/&amp;lt;/ref&amp;gt;. In our project, we use gchartrb to generate all the bar charts in the visualization. &lt;br /&gt;
&lt;br /&gt;
====installing====&lt;br /&gt;
Installing gchartrb is simple, just include the gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'gchartrb', :require =&amp;gt; 'google_chart'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
=====Bar Chart=====&lt;br /&gt;
The following example code would generate a bar chart.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Bar Chart&lt;br /&gt;
    GoogleChart::BarChart.new('800x200', &amp;quot;Bar Chart&amp;quot;, :vertical, false) do |bc|&lt;br /&gt;
      bc.data &amp;quot;Trend 1&amp;quot;, [5,4,3,1,3,5], '0000ff'&lt;br /&gt;
      bc.data &amp;quot;Trend 2&amp;quot;, [1,2,3,4,5,6], 'ff0000'&lt;br /&gt;
      bc.data &amp;quot;Trend 3&amp;quot;, [6,5,4,4,5,6], '00ff00'&lt;br /&gt;
      puts &amp;quot;\nBar Chart&amp;quot;&lt;br /&gt;
      puts bc.to_url&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The bar chart would look like below.&lt;br /&gt;
[[File:BarChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
=====Line Chart=====&lt;br /&gt;
The following example code would generate a line chart.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Line Chart&lt;br /&gt;
    GoogleChart::LineChart.new('320x200', &amp;quot;Line Chart&amp;quot;, false) do |lc|&lt;br /&gt;
      lc.data &amp;quot;Trend 1&amp;quot;, [5,4,3,1,3,5,6], '0000ff'&lt;br /&gt;
      lc.show_legend = true&lt;br /&gt;
      lc.data &amp;quot;Trend 2&amp;quot;, [1,2,3,4,5,6], '00ff00'&lt;br /&gt;
      lc.data &amp;quot;Trend 3&amp;quot;, [6,5,4,3,2,1], 'ff0000'&lt;br /&gt;
      lc.axis :y, :range =&amp;gt; [0,6], :color =&amp;gt; 'ff00ff', :font_size =&amp;gt; 16, :alignment =&amp;gt; :center&lt;br /&gt;
      lc.axis :x, :range =&amp;gt; [0,6], :color =&amp;gt; '00ffff', :font_size =&amp;gt; 16, :alignment =&amp;gt; :center&lt;br /&gt;
      lc.grid :x_step =&amp;gt; 100.0/6.0, :y_step =&amp;gt; 100.0/6.0, :length_segment =&amp;gt; 1, :length_blank =&amp;gt; 0&lt;br /&gt;
      puts &amp;quot;\nLine Chart&amp;quot;&lt;br /&gt;
      puts lc.to_url&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The bar chart would look like below.&lt;br /&gt;
[[File:AeraChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
===Circles===&lt;br /&gt;
&lt;br /&gt;
=Visualization in Expertiza=&lt;br /&gt;
This section describes where in Expertiza we can use these visualizations to provide a better user experience. &lt;br /&gt;
The 'Review Score' view of the assignments can be enhanced using these visualization.&lt;br /&gt;
&lt;br /&gt;
We can see by the image below that currently the scores views includes only a large table. From a user experience perspective having a more prioritized view of the scores would be beneficial. Having all the data available for the user to peruse in a table is informative, but when the user wants only to get a quick idea of how they did in an assignment, it would be helpful to have some sort of visualization.&lt;br /&gt;
&lt;br /&gt;
[[File:score_view.png.jpeg]]&lt;br /&gt;
&lt;br /&gt;
The above scoring which is in tabular form can be enhanced with charts.&lt;br /&gt;
&lt;br /&gt;
=Graphical Score Dashboard=&lt;br /&gt;
The scores page was augmented with bar graphs displaying the distributions of each column, as well as a circle icon for the average score for that column. This will allow for easily determining what the reviewers thought of the work, as well as what the range of scores given. The circle graphs with the averages provide a visual for the quality of the work in each of the categories.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_chart.png]]&lt;br /&gt;
&lt;br /&gt;
==New View==&lt;br /&gt;
&lt;br /&gt;
We created a new view under the grades views, called participant_charts. This view is included as a partial in the grades/view_my_scores view. This allows us to not modify any of the existing views and keep the code modular.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Bar Charts==&lt;br /&gt;
&lt;br /&gt;
For the bar charts we constructed a method that, given the score and the type of bar chart, populates an instance variable that contains the charts. The code was included in the grades controller (grades_controller.rb file) and is shown below&lt;br /&gt;
&lt;br /&gt;
    def bar_chart(scores, type)&lt;br /&gt;
        GoogleChart::BarChart.new(&amp;quot;100x100&amp;quot;, &amp;quot; &amp;quot;, :vertical, false) do |bc|&lt;br /&gt;
          data = scores&lt;br /&gt;
          bc.data &amp;quot;Line green&amp;quot;, data, '990000'&lt;br /&gt;
          #bc.axis :x, :positions =&amp;gt; [0, data.size], :range =&amp;gt; [0,100]&lt;br /&gt;
          bc.axis :y, :range =&amp;gt; [0, data.max] ,:positions =&amp;gt; [data.min, data.max]&lt;br /&gt;
          bc.show_legend = false&lt;br /&gt;
          bc.stacked = false&lt;br /&gt;
          bc.width_spacing_options({:bar_width =&amp;gt; 70/(data.size+1),:bar_spacing =&amp;gt; 1, :group_spacing =&amp;gt; 1})&lt;br /&gt;
          bc.data_encoding = :extended&lt;br /&gt;
          @grades_bar_charts[type.to_sym] = (bc.to_url)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
The width of the bars is dependent on the number of scores to show. Assignments with many reviews to show, require smaller bars. This is accomplished by tying the bar_width parameter, to the size of the data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Circle Charts==&lt;br /&gt;
&lt;br /&gt;
For the circle charts showing the averages of the columns we used a javascript library, circle.js. By simply passing the scores to the .js code in the grades view as shown in the code below. The circle is then rendered automatically in a div block elsewhere in the view named the same as the id: tag below&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;% ['review', 'metareview', 'feedback', 'teammate'].each do |type| %&amp;gt;&lt;br /&gt;
      &amp;lt;% if @pscore[type.to_sym][:scores][:avg]%&amp;gt;&lt;br /&gt;
        var myCircle = Circles.create({&lt;br /&gt;
      id:           '&amp;lt;%= &amp;quot;#{type}-circle&amp;quot; %&amp;gt;',&lt;br /&gt;
      radius:       25,&lt;br /&gt;
      value:        &amp;lt;%= @pscore[type.to_sym][:scores][:avg].to_i %&amp;gt;,&lt;br /&gt;
      maxValue:     100,&lt;br /&gt;
      width:        7,&lt;br /&gt;
      text:         '&amp;lt;%=@pscore[type.to_sym][:scores][:avg].to_i%&amp;gt;',&lt;br /&gt;
      colors:       ['#FFEB99', '#FFCC00'],&lt;br /&gt;
      duration:       700,&lt;br /&gt;
      textClass:      'circles-text'&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
==Show / Hide stats==&lt;br /&gt;
&lt;br /&gt;
The user might want to hide the stats, with that in mind we included a button to toggle the visibility of the charts. Making use of an existing function, toggleElement, we added a link above the charts table that when clicked hides/shows the charts. The code to accomplish this is shown below&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;a href=&amp;quot;#&amp;quot; name='score-chartLink' onClick=&amp;quot;toggleElement('score-chart', 'stats');return false;&amp;quot;&amp;gt;hide stats&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Reliability Metric=&lt;br /&gt;
Based on the uniformity of the review scores, we compiled a reliability metric. This metric encapsulates the level of agreement between the reviews, and should provide a quick at a glance notion of whether reviewers agree on the scoring for the particular assignment, or whether there is a high variance in the scores given. A good reliability score indicates that the grade given to the assignment by the reviewers is to be trusted, whereas a poor reliability score indicates that there was a high level of disagreement in the reviewers and the instructors should perhaps take a closer look at the participant's assignment.&lt;br /&gt;
This reliability score is computed from the standard deviation of the review scores. A standard deviation that's less than 10 will award a good reliability score. A standard deviation between 10 and 20 will award a medium reliability score, whereas a standard deviation greater than 20 will give a poor reliability score.&lt;br /&gt;
===Different Icon colors===&lt;br /&gt;
[[File:Green_icon.png]]&lt;br /&gt;
&lt;br /&gt;
The color of the three bars Icon, and the number of filled bars is representative of the reliability of the reviews.&lt;br /&gt;
Take the case of the green sample icon in the image above, the reviews mostly all agree. Whereas in the following two images, the icon is yellow and red respectively to signify increasingly worrying levels of disparity in review scores.&lt;br /&gt;
&lt;br /&gt;
[[File:Yellow_icon.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Red_icon.png]]&lt;br /&gt;
&lt;br /&gt;
A similar method to the one used for the bar charts was used. In this case, a horizontal bar chart was created, and the data was dictated by the qualitative score that was passed into the method. This score could be 'good', 'medium' or 'bad'. Based on this string argument the graph is created with the correct number of bars and the correct color.&lt;br /&gt;
&lt;br /&gt;
    def reliability_chart(score,type)&lt;br /&gt;
        GoogleChart::BarChart.new(&amp;quot;25x20&amp;quot;, &amp;quot; &amp;quot;, :horizontal, false) do |bc|&lt;br /&gt;
          if score == 'good'&lt;br /&gt;
            data = [1,1,1]&lt;br /&gt;
            color = '00ff00'&lt;br /&gt;
          elsif score == 'medium'&lt;br /&gt;
            data = [1,1]&lt;br /&gt;
            color = 'FFCC00'&lt;br /&gt;
          else&lt;br /&gt;
            data = [1]&lt;br /&gt;
            color = '990000'&lt;br /&gt;
          end&lt;br /&gt;
          bc.data &amp;quot;Reliability Symbol&amp;quot;, data, color&lt;br /&gt;
          bc.show_legend = false&lt;br /&gt;
          bc.stacked = false&lt;br /&gt;
          bc.width_spacing_options({:bar_width =&amp;gt; 5,:bar_spacing =&amp;gt; 10, :group_spacing =&amp;gt; 1})&lt;br /&gt;
          bc.data_encoding = :extended&lt;br /&gt;
          @grades_bar_charts[type.to_sym] = (bc.to_url)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=97073</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=97073"/>
		<updated>2015-05-03T20:46:24Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
The goal of this project is to present the the data in Expertiza in a more convenient way. Through the use of charts and graphs to enhance certain pages, such as the student's scores page and the instructor's scores page, and allow for the users to get an at-a-glance analysis of the data without having to dive into the tables.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this project is to add a visualization element to some of the data collected in expertiza. The aim of this is to provide a more intuitive “at-a-glance” idea of the data, some examples would be: how a student is doing on his/her assignments, or how their work compares to that of their classmates. On a less functional angle, it also enhances the aesthetics of the pages, taking the drab tables and giving them a more appealing look.&lt;br /&gt;
&lt;br /&gt;
=Overview of Approach=&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
option = { width: 400, height: 240, title: 'Company Performance' }&amp;lt;br/&amp;gt;&lt;br /&gt;
@chart = GoogleVisualr::Interactive::AreaChart.new(data_table, option)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id='chart'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;%= render_chart @chart, 'chart' %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Chart Examples====&lt;br /&gt;
=====Area Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/area_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/areachart.html#Example&lt;br /&gt;
  def area_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['2004', 1000, 400],&lt;br /&gt;
      ['2005', 1170, 460],&lt;br /&gt;
      ['2006', 660, 1120],&lt;br /&gt;
      ['2007', 1030, 540]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts   = { width: 400, height: 240, title: 'Company Performance', hAxis: {title: 'Year', titleTextStyle: {color: '#FF0000'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::AreaChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:AeraChart.png|center]]&lt;br /&gt;
=====Bar Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bar_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/barchart.html#Example&lt;br /&gt;
  def bar_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows(4)&lt;br /&gt;
    data_table.set_cell(0, 0, '2004')&lt;br /&gt;
    data_table.set_cell(0, 1, 1000)&lt;br /&gt;
    data_table.set_cell(0, 2, 400)&lt;br /&gt;
    data_table.set_cell(1, 0, '2005')&lt;br /&gt;
    data_table.set_cell(1, 1, 1170)&lt;br /&gt;
    data_table.set_cell(1, 2, 460)&lt;br /&gt;
    data_table.set_cell(2, 0, '2006')&lt;br /&gt;
    data_table.set_cell(2, 1, 660)&lt;br /&gt;
    data_table.set_cell(2, 2, 1120)&lt;br /&gt;
    data_table.set_cell(3, 0, '2007')&lt;br /&gt;
    data_table.set_cell(3, 1, 1030)&lt;br /&gt;
    data_table.set_cell(3, 2, 540)&lt;br /&gt;
&lt;br /&gt;
    opts   = { :width =&amp;gt; 400, :height =&amp;gt; 240, :title =&amp;gt; 'Company Performance', vAxis: {title: 'Year', titleTextStyle: {color: 'red'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BarChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BarChart.png|center]]&lt;br /&gt;
=====Bubble Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bubble_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/bubblechart.html&lt;br /&gt;
  def bubble_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'ID')&lt;br /&gt;
    data_table.new_column('number', 'Life Expectancy')&lt;br /&gt;
    data_table.new_column('number', 'Fertility Rate')&lt;br /&gt;
    data_table.new_column('string', 'Region')&lt;br /&gt;
    data_table.new_column('number', 'Population')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['CAN',    80.66,              1.67,      'North America',  33739900],&lt;br /&gt;
      ['DEU',    79.84,              1.36,      'Europe',         81902307],&lt;br /&gt;
      ['DNK',    78.6,               1.84,      'Europe',         5523095],&lt;br /&gt;
      ['EGY',    72.73,              2.78,      'Middle East',    79716203],&lt;br /&gt;
      ['GBR',    80.05,              2,         'Europe',         61801570],&lt;br /&gt;
      ['IRN',    72.49,              1.7,       'Middle East',    73137148],&lt;br /&gt;
      ['IRQ',    68.09,              4.77,      'Middle East',    31090763],&lt;br /&gt;
      ['ISR',    81.55,              2.96,      'Middle East',    7485600],&lt;br /&gt;
      ['RUS',    68.6,               1.54,      'Europe',         141850000],&lt;br /&gt;
      ['USA',    78.09,              2.05,      'North America',  307007000]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts    = {&lt;br /&gt;
      :width =&amp;gt; 800, :height =&amp;gt; 500,&lt;br /&gt;
      :title =&amp;gt; 'Correlation between life expectancy, fertility rate and population of some world countries (2010)',&lt;br /&gt;
      :hAxis =&amp;gt; { :title =&amp;gt; 'Life Expectancy' },&lt;br /&gt;
      :vAxis =&amp;gt; { :title =&amp;gt; 'Fertility Rate'  },&lt;br /&gt;
      :bubble =&amp;gt; { :textStyle =&amp;gt; { :fontSize =&amp;gt; 11 } }&lt;br /&gt;
    }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BubbleChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BubbleChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
simple line chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:data =&amp;gt; [0, 40, 10, 70, 20])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Simplechart.png]]&lt;br /&gt;
&lt;br /&gt;
bar chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [300, 100, 30, 200])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Barchart.png]]&lt;br /&gt;
&lt;br /&gt;
multiple bars chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [[300, 100, 30, 200], [100, 200, 300, 10]], :bar_colors =&amp;gt; ['FF0000', '00FF00'])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Multbarschart.png]]&lt;br /&gt;
&lt;br /&gt;
pie chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.pie(:data =&amp;gt; [20, 35, 45])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Piechart.png]]&lt;br /&gt;
&lt;br /&gt;
These usages come from http://googlecharts.rubyforge.org/. If you want to see more usages, go and visit this site.&lt;br /&gt;
&lt;br /&gt;
===gchartrb===&lt;br /&gt;
gchartrb&amp;lt;ref&amp;gt;http://code.google.com/p/gchartrb/&amp;lt;/ref&amp;gt; is a Ruby wrapper around the Google chart API&amp;lt;ref&amp;gt;http://code.google.com/apis/chart/&amp;lt;/ref&amp;gt;. In our project, we use gchartrb to generate all the bar charts in the visualization. &lt;br /&gt;
&lt;br /&gt;
====installing====&lt;br /&gt;
Installing gchartrb is simple, just include the gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'gchartrb', :require =&amp;gt; 'google_chart'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
=====Bar Chart=====&lt;br /&gt;
The following example code would generate a bar chart.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Bar Chart&lt;br /&gt;
    GoogleChart::BarChart.new('800x200', &amp;quot;Bar Chart&amp;quot;, :vertical, false) do |bc|&lt;br /&gt;
      bc.data &amp;quot;Trend 1&amp;quot;, [5,4,3,1,3,5], '0000ff'&lt;br /&gt;
      bc.data &amp;quot;Trend 2&amp;quot;, [1,2,3,4,5,6], 'ff0000'&lt;br /&gt;
      bc.data &amp;quot;Trend 3&amp;quot;, [6,5,4,4,5,6], '00ff00'&lt;br /&gt;
      puts &amp;quot;\nBar Chart&amp;quot;&lt;br /&gt;
      puts bc.to_url&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The bar chart would look like below.&lt;br /&gt;
[[File:BarChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
=====Line Chart=====&lt;br /&gt;
The following example code would generate a line chart.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Line Chart&lt;br /&gt;
    GoogleChart::LineChart.new('320x200', &amp;quot;Line Chart&amp;quot;, false) do |lc|&lt;br /&gt;
      lc.data &amp;quot;Trend 1&amp;quot;, [5,4,3,1,3,5,6], '0000ff'&lt;br /&gt;
      lc.show_legend = true&lt;br /&gt;
      lc.data &amp;quot;Trend 2&amp;quot;, [1,2,3,4,5,6], '00ff00'&lt;br /&gt;
      lc.data &amp;quot;Trend 3&amp;quot;, [6,5,4,3,2,1], 'ff0000'&lt;br /&gt;
      lc.axis :y, :range =&amp;gt; [0,6], :color =&amp;gt; 'ff00ff', :font_size =&amp;gt; 16, :alignment =&amp;gt; :center&lt;br /&gt;
      lc.axis :x, :range =&amp;gt; [0,6], :color =&amp;gt; '00ffff', :font_size =&amp;gt; 16, :alignment =&amp;gt; :center&lt;br /&gt;
      lc.grid :x_step =&amp;gt; 100.0/6.0, :y_step =&amp;gt; 100.0/6.0, :length_segment =&amp;gt; 1, :length_blank =&amp;gt; 0&lt;br /&gt;
      puts &amp;quot;\nLine Chart&amp;quot;&lt;br /&gt;
      puts lc.to_url&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The bar chart would look like below.&lt;br /&gt;
[[File:AeraChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
===Circles===&lt;br /&gt;
&lt;br /&gt;
=Visualization in Expertiza=&lt;br /&gt;
This section describes where in Expertiza we can use these visualizations to provide a better user experience. &lt;br /&gt;
The 'Review Score' view of the assignments can be enhanced using these visualization.&lt;br /&gt;
&lt;br /&gt;
We can see by the image below that currently the scores views includes only a large table. From a user experience perspective having a more prioritized view of the scores would be beneficial. Having all the data available for the user to peruse in a table is informative, but when the user wants only to get a quick idea of how they did in an assignment, it would be helpful to have some sort of visualization.&lt;br /&gt;
&lt;br /&gt;
[[File:score_view.png.jpeg]]&lt;br /&gt;
&lt;br /&gt;
The above scoring which is in tabular form can be enhanced with charts.&lt;br /&gt;
&lt;br /&gt;
=Graphical Score Dashboard=&lt;br /&gt;
The scores page was augmented with bar graphs displaying the distributions of each column, as well as a circle icon for the average score for that column. This will allow for easily determining what the reviewers thought of the work, as well as what the range of scores given. The circle graphs with the averages provide a visual for the quality of the work in each of the categories.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_chart.png]]&lt;br /&gt;
&lt;br /&gt;
==New View==&lt;br /&gt;
&lt;br /&gt;
We created a new view under the grades views, called participant_charts. This view is included as a partial in the grades/view_my_scores view. This allows us to not modify any of the existing views and keep the code modular.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Bar Charts==&lt;br /&gt;
&lt;br /&gt;
For the bar charts we constructed a method that, given the score and the type of bar chart, populates an instance variable that contains the charts. The code was included in the grades controller (grades_controller.rb file) and is shown below&lt;br /&gt;
&lt;br /&gt;
    def bar_chart(scores, type)&lt;br /&gt;
        GoogleChart::BarChart.new(&amp;quot;100x100&amp;quot;, &amp;quot; &amp;quot;, :vertical, false) do |bc|&lt;br /&gt;
          data = scores&lt;br /&gt;
          bc.data &amp;quot;Line green&amp;quot;, data, '990000'&lt;br /&gt;
          #bc.axis :x, :positions =&amp;gt; [0, data.size], :range =&amp;gt; [0,100]&lt;br /&gt;
          bc.axis :y, :range =&amp;gt; [0, data.max] ,:positions =&amp;gt; [data.min, data.max]&lt;br /&gt;
          bc.show_legend = false&lt;br /&gt;
          bc.stacked = false&lt;br /&gt;
          bc.width_spacing_options({:bar_width =&amp;gt; 70/(data.size+1),:bar_spacing =&amp;gt; 1, :group_spacing =&amp;gt; 1})&lt;br /&gt;
          bc.data_encoding = :extended&lt;br /&gt;
          @grades_bar_charts[type.to_sym] = (bc.to_url)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
The width of the bars is dependent on the number of scores to show. Assignments with many reviews to show, require smaller bars. This is accomplished by tying the bar_width parameter, to the size of the data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Circle Charts==&lt;br /&gt;
&lt;br /&gt;
For the circle charts showing the averages of the columns we used a javascript library, circle.js. By simply passing the scores to the .js code in the grades view as shown in the code below. The circle is then rendered automatically in a div block elsewhere in the view named the same as the id: tag below&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;% ['review', 'metareview', 'feedback', 'teammate'].each do |type| %&amp;gt;&lt;br /&gt;
      &amp;lt;% if @pscore[type.to_sym][:scores][:avg]%&amp;gt;&lt;br /&gt;
        var myCircle = Circles.create({&lt;br /&gt;
      id:           '&amp;lt;%= &amp;quot;#{type}-circle&amp;quot; %&amp;gt;',&lt;br /&gt;
      radius:       25,&lt;br /&gt;
      value:        &amp;lt;%= @pscore[type.to_sym][:scores][:avg].to_i %&amp;gt;,&lt;br /&gt;
      maxValue:     100,&lt;br /&gt;
      width:        7,&lt;br /&gt;
      text:         '&amp;lt;%=@pscore[type.to_sym][:scores][:avg].to_i%&amp;gt;',&lt;br /&gt;
      colors:       ['#FFEB99', '#FFCC00'],&lt;br /&gt;
      duration:       700,&lt;br /&gt;
      textClass:      'circles-text'&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
==Show / Hide stats==&lt;br /&gt;
&lt;br /&gt;
The user might want to hide the stats, with that in mind we included a button to toggle the visibility of the charts. Making use of an existing function, toggleElement, we added a link above the charts table that when clicked hides/shows the charts. The code to accomplish this is shown below&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;a href=&amp;quot;#&amp;quot; name='score-chartLink' onClick=&amp;quot;toggleElement('score-chart', 'stats');return false;&amp;quot;&amp;gt;hide stats&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Reliability Metric=&lt;br /&gt;
Based on the uniformity of the review scores, we compiled a reliability metric. This metric encapsulates the level of agreement between the reviews, and should provide a quick at a glance notion of whether reviewers agree on the scoring for the particular assignment, or whether there is a high variance in the scores given. A good reliability score indicates that the grade given to the assignment by the reviewers is to be trusted, whereas a poor reliability score indicates that there was a high level of disagreement in the reviewers and the instructors should perhaps take a closer look at the participant's assignment.&lt;br /&gt;
This reliability score is computed from the standard deviation of the review scores. A standard deviation that's less than 10 will award a good reliability score. A standard deviation between 10 and 20 will award a medium reliability score, whereas a standard deviation greater than 20 will give a poor reliability score.&lt;br /&gt;
===Different Icon colors===&lt;br /&gt;
[[File:Green_icon.png]]&lt;br /&gt;
&lt;br /&gt;
The color of the three bars Icon, and the number of filled bars is representative of the reliability of the reviews.&lt;br /&gt;
Take the case of the green sample icon in the image above, the reviews mostly all agree. Whereas in the following two images, the icon is yellow and red respectively to signify increasingly worrying levels of disparity in review scores.&lt;br /&gt;
&lt;br /&gt;
[[File:Yellow_icon.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Red_icon.png]]&lt;br /&gt;
&lt;br /&gt;
A similar method to the one used for the bar charts was used. In this case, a horizontal bar chart was created, and the data was dictated by the qualitative score that was passed into the method. This score could be 'good', 'medium' or 'bad'. Based on this string argument the graph is created with the correct number of bars and the correct color.&lt;br /&gt;
&lt;br /&gt;
    def reliability_chart(score,type)&lt;br /&gt;
        GoogleChart::BarChart.new(&amp;quot;25x20&amp;quot;, &amp;quot; &amp;quot;, :horizontal, false) do |bc|&lt;br /&gt;
          if score == 'good'&lt;br /&gt;
            data = [1,1,1]&lt;br /&gt;
            color = '00ff00'&lt;br /&gt;
          elsif score == 'medium'&lt;br /&gt;
            data = [1,1]&lt;br /&gt;
            color = 'FFCC00'&lt;br /&gt;
          else&lt;br /&gt;
            data = [1]&lt;br /&gt;
            color = '990000'&lt;br /&gt;
          end&lt;br /&gt;
          bc.data &amp;quot;Reliability Symbol&amp;quot;, data, color&lt;br /&gt;
          bc.show_legend = false&lt;br /&gt;
          bc.stacked = false&lt;br /&gt;
          bc.width_spacing_options({:bar_width =&amp;gt; 5,:bar_spacing =&amp;gt; 10, :group_spacing =&amp;gt; 1})&lt;br /&gt;
          bc.data_encoding = :extended&lt;br /&gt;
          @grades_bar_charts[type.to_sym] = (bc.to_url)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=97072</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=97072"/>
		<updated>2015-05-03T20:44:00Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* usage in the project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
The goal of this project is to present the the data in Expertiza in a more convenient way. Through the use of charts and graphs to enhance certain pages, such as the student's scores page and the instructor's scores page, and allow for the users to get an at-a-glance analysis of the data without having to dive into the tables.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this project is to add a visualization element to some of the data collected in expertiza. The aim of this is to provide a more intuitive “at-a-glance” idea of the data, some examples would be: how a student is doing on his/her assignments, or how their work compares to that of their classmates. On a less functional angle, it also enhances the aesthetics of the pages, taking the drab tables and giving them a more appealing look.&lt;br /&gt;
&lt;br /&gt;
=Overview of Approach=&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
option = { width: 400, height: 240, title: 'Company Performance' }&amp;lt;br/&amp;gt;&lt;br /&gt;
@chart = GoogleVisualr::Interactive::AreaChart.new(data_table, option)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id='chart'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;%= render_chart @chart, 'chart' %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Chart Examples====&lt;br /&gt;
=====Area Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/area_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/areachart.html#Example&lt;br /&gt;
  def area_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['2004', 1000, 400],&lt;br /&gt;
      ['2005', 1170, 460],&lt;br /&gt;
      ['2006', 660, 1120],&lt;br /&gt;
      ['2007', 1030, 540]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts   = { width: 400, height: 240, title: 'Company Performance', hAxis: {title: 'Year', titleTextStyle: {color: '#FF0000'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::AreaChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:AeraChart.png|center]]&lt;br /&gt;
=====Bar Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bar_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/barchart.html#Example&lt;br /&gt;
  def bar_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows(4)&lt;br /&gt;
    data_table.set_cell(0, 0, '2004')&lt;br /&gt;
    data_table.set_cell(0, 1, 1000)&lt;br /&gt;
    data_table.set_cell(0, 2, 400)&lt;br /&gt;
    data_table.set_cell(1, 0, '2005')&lt;br /&gt;
    data_table.set_cell(1, 1, 1170)&lt;br /&gt;
    data_table.set_cell(1, 2, 460)&lt;br /&gt;
    data_table.set_cell(2, 0, '2006')&lt;br /&gt;
    data_table.set_cell(2, 1, 660)&lt;br /&gt;
    data_table.set_cell(2, 2, 1120)&lt;br /&gt;
    data_table.set_cell(3, 0, '2007')&lt;br /&gt;
    data_table.set_cell(3, 1, 1030)&lt;br /&gt;
    data_table.set_cell(3, 2, 540)&lt;br /&gt;
&lt;br /&gt;
    opts   = { :width =&amp;gt; 400, :height =&amp;gt; 240, :title =&amp;gt; 'Company Performance', vAxis: {title: 'Year', titleTextStyle: {color: 'red'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BarChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BarChart.png|center]]&lt;br /&gt;
=====Bubble Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bubble_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/bubblechart.html&lt;br /&gt;
  def bubble_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'ID')&lt;br /&gt;
    data_table.new_column('number', 'Life Expectancy')&lt;br /&gt;
    data_table.new_column('number', 'Fertility Rate')&lt;br /&gt;
    data_table.new_column('string', 'Region')&lt;br /&gt;
    data_table.new_column('number', 'Population')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['CAN',    80.66,              1.67,      'North America',  33739900],&lt;br /&gt;
      ['DEU',    79.84,              1.36,      'Europe',         81902307],&lt;br /&gt;
      ['DNK',    78.6,               1.84,      'Europe',         5523095],&lt;br /&gt;
      ['EGY',    72.73,              2.78,      'Middle East',    79716203],&lt;br /&gt;
      ['GBR',    80.05,              2,         'Europe',         61801570],&lt;br /&gt;
      ['IRN',    72.49,              1.7,       'Middle East',    73137148],&lt;br /&gt;
      ['IRQ',    68.09,              4.77,      'Middle East',    31090763],&lt;br /&gt;
      ['ISR',    81.55,              2.96,      'Middle East',    7485600],&lt;br /&gt;
      ['RUS',    68.6,               1.54,      'Europe',         141850000],&lt;br /&gt;
      ['USA',    78.09,              2.05,      'North America',  307007000]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts    = {&lt;br /&gt;
      :width =&amp;gt; 800, :height =&amp;gt; 500,&lt;br /&gt;
      :title =&amp;gt; 'Correlation between life expectancy, fertility rate and population of some world countries (2010)',&lt;br /&gt;
      :hAxis =&amp;gt; { :title =&amp;gt; 'Life Expectancy' },&lt;br /&gt;
      :vAxis =&amp;gt; { :title =&amp;gt; 'Fertility Rate'  },&lt;br /&gt;
      :bubble =&amp;gt; { :textStyle =&amp;gt; { :fontSize =&amp;gt; 11 } }&lt;br /&gt;
    }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BubbleChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BubbleChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
simple line chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:data =&amp;gt; [0, 40, 10, 70, 20])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Simplechart.png]]&lt;br /&gt;
&lt;br /&gt;
bar chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [300, 100, 30, 200])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Barchart.png]]&lt;br /&gt;
&lt;br /&gt;
multiple bars chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [[300, 100, 30, 200], [100, 200, 300, 10]], :bar_colors =&amp;gt; ['FF0000', '00FF00'])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Multbarschart.png]]&lt;br /&gt;
&lt;br /&gt;
pie chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.pie(:data =&amp;gt; [20, 35, 45])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Piechart.png]]&lt;br /&gt;
&lt;br /&gt;
These usages come from http://googlecharts.rubyforge.org/. If you want to see more usages, go and visit this site.&lt;br /&gt;
&lt;br /&gt;
===gchartrb===&lt;br /&gt;
gchartrb&amp;lt;ref&amp;gt;http://code.google.com/p/gchartrb/&amp;lt;/ref&amp;gt; is a Ruby wrapper around the Google chart API&amp;lt;ref&amp;gt;http://code.google.com/apis/chart/&amp;lt;/ref&amp;gt;. In our project, we use gchartrb to generate all the bar charts in the visualization. &lt;br /&gt;
&lt;br /&gt;
====installing====&lt;br /&gt;
Installing gchartrb is simple, just include the gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'gchartrb', :require =&amp;gt; 'google_chart'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
=====Bar Chart=====&lt;br /&gt;
The following example code would generate a bar chart.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Bar Chart&lt;br /&gt;
    GoogleChart::BarChart.new('800x200', &amp;quot;Bar Chart&amp;quot;, :vertical, false) do |bc|&lt;br /&gt;
      bc.data &amp;quot;Trend 1&amp;quot;, [5,4,3,1,3,5], '0000ff'&lt;br /&gt;
      bc.data &amp;quot;Trend 2&amp;quot;, [1,2,3,4,5,6], 'ff0000'&lt;br /&gt;
      bc.data &amp;quot;Trend 3&amp;quot;, [6,5,4,4,5,6], '00ff00'&lt;br /&gt;
      puts &amp;quot;\nBar Chart&amp;quot;&lt;br /&gt;
      puts bc.to_url&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The bar chart would look like below.&lt;br /&gt;
[[File:BarChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
===Circles===&lt;br /&gt;
&lt;br /&gt;
=Visualization in Expertiza=&lt;br /&gt;
This section describes where in Expertiza we can use these visualizations to provide a better user experience. &lt;br /&gt;
The 'Review Score' view of the assignments can be enhanced using these visualization.&lt;br /&gt;
&lt;br /&gt;
We can see by the image below that currently the scores views includes only a large table. From a user experience perspective having a more prioritized view of the scores would be beneficial. Having all the data available for the user to peruse in a table is informative, but when the user wants only to get a quick idea of how they did in an assignment, it would be helpful to have some sort of visualization.&lt;br /&gt;
&lt;br /&gt;
[[File:score_view.png.jpeg]]&lt;br /&gt;
&lt;br /&gt;
The above scoring which is in tabular form can be enhanced with charts.&lt;br /&gt;
&lt;br /&gt;
=Graphical Score Dashboard=&lt;br /&gt;
The scores page was augmented with bar graphs displaying the distributions of each column, as well as a circle icon for the average score for that column. This will allow for easily determining what the reviewers thought of the work, as well as what the range of scores given. The circle graphs with the averages provide a visual for the quality of the work in each of the categories.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_chart.png]]&lt;br /&gt;
&lt;br /&gt;
==New View==&lt;br /&gt;
&lt;br /&gt;
We created a new view under the grades views, called participant_charts. This view is included as a partial in the grades/view_my_scores view. This allows us to not modify any of the existing views and keep the code modular.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Bar Charts==&lt;br /&gt;
&lt;br /&gt;
For the bar charts we constructed a method that, given the score and the type of bar chart, populates an instance variable that contains the charts. The code was included in the grades controller (grades_controller.rb file) and is shown below&lt;br /&gt;
&lt;br /&gt;
    def bar_chart(scores, type)&lt;br /&gt;
        GoogleChart::BarChart.new(&amp;quot;100x100&amp;quot;, &amp;quot; &amp;quot;, :vertical, false) do |bc|&lt;br /&gt;
          data = scores&lt;br /&gt;
          bc.data &amp;quot;Line green&amp;quot;, data, '990000'&lt;br /&gt;
          #bc.axis :x, :positions =&amp;gt; [0, data.size], :range =&amp;gt; [0,100]&lt;br /&gt;
          bc.axis :y, :range =&amp;gt; [0, data.max] ,:positions =&amp;gt; [data.min, data.max]&lt;br /&gt;
          bc.show_legend = false&lt;br /&gt;
          bc.stacked = false&lt;br /&gt;
          bc.width_spacing_options({:bar_width =&amp;gt; 70/(data.size+1),:bar_spacing =&amp;gt; 1, :group_spacing =&amp;gt; 1})&lt;br /&gt;
          bc.data_encoding = :extended&lt;br /&gt;
          @grades_bar_charts[type.to_sym] = (bc.to_url)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
The width of the bars is dependent on the number of scores to show. Assignments with many reviews to show, require smaller bars. This is accomplished by tying the bar_width parameter, to the size of the data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Circle Charts==&lt;br /&gt;
&lt;br /&gt;
For the circle charts showing the averages of the columns we used a javascript library, circle.js. By simply passing the scores to the .js code in the grades view as shown in the code below. The circle is then rendered automatically in a div block elsewhere in the view named the same as the id: tag below&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;% ['review', 'metareview', 'feedback', 'teammate'].each do |type| %&amp;gt;&lt;br /&gt;
      &amp;lt;% if @pscore[type.to_sym][:scores][:avg]%&amp;gt;&lt;br /&gt;
        var myCircle = Circles.create({&lt;br /&gt;
      id:           '&amp;lt;%= &amp;quot;#{type}-circle&amp;quot; %&amp;gt;',&lt;br /&gt;
      radius:       25,&lt;br /&gt;
      value:        &amp;lt;%= @pscore[type.to_sym][:scores][:avg].to_i %&amp;gt;,&lt;br /&gt;
      maxValue:     100,&lt;br /&gt;
      width:        7,&lt;br /&gt;
      text:         '&amp;lt;%=@pscore[type.to_sym][:scores][:avg].to_i%&amp;gt;',&lt;br /&gt;
      colors:       ['#FFEB99', '#FFCC00'],&lt;br /&gt;
      duration:       700,&lt;br /&gt;
      textClass:      'circles-text'&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
==Show / Hide stats==&lt;br /&gt;
&lt;br /&gt;
The user might want to hide the stats, with that in mind we included a button to toggle the visibility of the charts. Making use of an existing function, toggleElement, we added a link above the charts table that when clicked hides/shows the charts. The code to accomplish this is shown below&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;a href=&amp;quot;#&amp;quot; name='score-chartLink' onClick=&amp;quot;toggleElement('score-chart', 'stats');return false;&amp;quot;&amp;gt;hide stats&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Reliability Metric=&lt;br /&gt;
Based on the uniformity of the review scores, we compiled a reliability metric. This metric encapsulates the level of agreement between the reviews, and should provide a quick at a glance notion of whether reviewers agree on the scoring for the particular assignment, or whether there is a high variance in the scores given. A good reliability score indicates that the grade given to the assignment by the reviewers is to be trusted, whereas a poor reliability score indicates that there was a high level of disagreement in the reviewers and the instructors should perhaps take a closer look at the participant's assignment.&lt;br /&gt;
This reliability score is computed from the standard deviation of the review scores. A standard deviation that's less than 10 will award a good reliability score. A standard deviation between 10 and 20 will award a medium reliability score, whereas a standard deviation greater than 20 will give a poor reliability score.&lt;br /&gt;
===Different Icon colors===&lt;br /&gt;
[[File:Green_icon.png]]&lt;br /&gt;
&lt;br /&gt;
The color of the three bars Icon, and the number of filled bars is representative of the reliability of the reviews.&lt;br /&gt;
Take the case of the green sample icon in the image above, the reviews mostly all agree. Whereas in the following two images, the icon is yellow and red respectively to signify increasingly worrying levels of disparity in review scores.&lt;br /&gt;
&lt;br /&gt;
[[File:Yellow_icon.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Red_icon.png]]&lt;br /&gt;
&lt;br /&gt;
A similar method to the one used for the bar charts was used. In this case, a horizontal bar chart was created, and the data was dictated by the qualitative score that was passed into the method. This score could be 'good', 'medium' or 'bad'. Based on this string argument the graph is created with the correct number of bars and the correct color.&lt;br /&gt;
&lt;br /&gt;
    def reliability_chart(score,type)&lt;br /&gt;
        GoogleChart::BarChart.new(&amp;quot;25x20&amp;quot;, &amp;quot; &amp;quot;, :horizontal, false) do |bc|&lt;br /&gt;
          if score == 'good'&lt;br /&gt;
            data = [1,1,1]&lt;br /&gt;
            color = '00ff00'&lt;br /&gt;
          elsif score == 'medium'&lt;br /&gt;
            data = [1,1]&lt;br /&gt;
            color = 'FFCC00'&lt;br /&gt;
          else&lt;br /&gt;
            data = [1]&lt;br /&gt;
            color = '990000'&lt;br /&gt;
          end&lt;br /&gt;
          bc.data &amp;quot;Reliability Symbol&amp;quot;, data, color&lt;br /&gt;
          bc.show_legend = false&lt;br /&gt;
          bc.stacked = false&lt;br /&gt;
          bc.width_spacing_options({:bar_width =&amp;gt; 5,:bar_spacing =&amp;gt; 10, :group_spacing =&amp;gt; 1})&lt;br /&gt;
          bc.data_encoding = :extended&lt;br /&gt;
          @grades_bar_charts[type.to_sym] = (bc.to_url)&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=97067</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=97067"/>
		<updated>2015-05-03T20:33:00Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* usage in the project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
The goal of this project is to present the the data in Expertiza in a more convenient way. Through the use of charts and graphs to enhance certain pages, such as the student's scores page and the instructor's scores page, and allow for the users to get an at-a-glance analysis of the data without having to dive into the tables.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this project is to add a visualization element to some of the data collected in expertiza. The aim of this is to provide a more intuitive “at-a-glance” idea of the data, some examples would be: how a student is doing on his/her assignments, or how their work compares to that of their classmates. On a less functional angle, it also enhances the aesthetics of the pages, taking the drab tables and giving them a more appealing look.&lt;br /&gt;
&lt;br /&gt;
=Overview of Approach=&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
option = { width: 400, height: 240, title: 'Company Performance' }&amp;lt;br/&amp;gt;&lt;br /&gt;
@chart = GoogleVisualr::Interactive::AreaChart.new(data_table, option)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id='chart'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;%= render_chart @chart, 'chart' %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Chart Examples====&lt;br /&gt;
=====Area Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/area_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/areachart.html#Example&lt;br /&gt;
  def area_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['2004', 1000, 400],&lt;br /&gt;
      ['2005', 1170, 460],&lt;br /&gt;
      ['2006', 660, 1120],&lt;br /&gt;
      ['2007', 1030, 540]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts   = { width: 400, height: 240, title: 'Company Performance', hAxis: {title: 'Year', titleTextStyle: {color: '#FF0000'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::AreaChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:AeraChart.png|center]]&lt;br /&gt;
=====Bar Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bar_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/barchart.html#Example&lt;br /&gt;
  def bar_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows(4)&lt;br /&gt;
    data_table.set_cell(0, 0, '2004')&lt;br /&gt;
    data_table.set_cell(0, 1, 1000)&lt;br /&gt;
    data_table.set_cell(0, 2, 400)&lt;br /&gt;
    data_table.set_cell(1, 0, '2005')&lt;br /&gt;
    data_table.set_cell(1, 1, 1170)&lt;br /&gt;
    data_table.set_cell(1, 2, 460)&lt;br /&gt;
    data_table.set_cell(2, 0, '2006')&lt;br /&gt;
    data_table.set_cell(2, 1, 660)&lt;br /&gt;
    data_table.set_cell(2, 2, 1120)&lt;br /&gt;
    data_table.set_cell(3, 0, '2007')&lt;br /&gt;
    data_table.set_cell(3, 1, 1030)&lt;br /&gt;
    data_table.set_cell(3, 2, 540)&lt;br /&gt;
&lt;br /&gt;
    opts   = { :width =&amp;gt; 400, :height =&amp;gt; 240, :title =&amp;gt; 'Company Performance', vAxis: {title: 'Year', titleTextStyle: {color: 'red'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BarChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BarChart.png|center]]&lt;br /&gt;
=====Bubble Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bubble_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/bubblechart.html&lt;br /&gt;
  def bubble_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'ID')&lt;br /&gt;
    data_table.new_column('number', 'Life Expectancy')&lt;br /&gt;
    data_table.new_column('number', 'Fertility Rate')&lt;br /&gt;
    data_table.new_column('string', 'Region')&lt;br /&gt;
    data_table.new_column('number', 'Population')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['CAN',    80.66,              1.67,      'North America',  33739900],&lt;br /&gt;
      ['DEU',    79.84,              1.36,      'Europe',         81902307],&lt;br /&gt;
      ['DNK',    78.6,               1.84,      'Europe',         5523095],&lt;br /&gt;
      ['EGY',    72.73,              2.78,      'Middle East',    79716203],&lt;br /&gt;
      ['GBR',    80.05,              2,         'Europe',         61801570],&lt;br /&gt;
      ['IRN',    72.49,              1.7,       'Middle East',    73137148],&lt;br /&gt;
      ['IRQ',    68.09,              4.77,      'Middle East',    31090763],&lt;br /&gt;
      ['ISR',    81.55,              2.96,      'Middle East',    7485600],&lt;br /&gt;
      ['RUS',    68.6,               1.54,      'Europe',         141850000],&lt;br /&gt;
      ['USA',    78.09,              2.05,      'North America',  307007000]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts    = {&lt;br /&gt;
      :width =&amp;gt; 800, :height =&amp;gt; 500,&lt;br /&gt;
      :title =&amp;gt; 'Correlation between life expectancy, fertility rate and population of some world countries (2010)',&lt;br /&gt;
      :hAxis =&amp;gt; { :title =&amp;gt; 'Life Expectancy' },&lt;br /&gt;
      :vAxis =&amp;gt; { :title =&amp;gt; 'Fertility Rate'  },&lt;br /&gt;
      :bubble =&amp;gt; { :textStyle =&amp;gt; { :fontSize =&amp;gt; 11 } }&lt;br /&gt;
    }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BubbleChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BubbleChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
simple line chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:data =&amp;gt; [0, 40, 10, 70, 20])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Simplechart.png]]&lt;br /&gt;
&lt;br /&gt;
bar chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [300, 100, 30, 200])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Barchart.png]]&lt;br /&gt;
&lt;br /&gt;
multiple bars chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [[300, 100, 30, 200], [100, 200, 300, 10]], :bar_colors =&amp;gt; ['FF0000', '00FF00'])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Multbarschart.png]]&lt;br /&gt;
&lt;br /&gt;
pie chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.pie(:data =&amp;gt; [20, 35, 45])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Piechart.png]]&lt;br /&gt;
&lt;br /&gt;
These usages come from http://googlecharts.rubyforge.org/. If you want to see more usages, go and visit this site.&lt;br /&gt;
&lt;br /&gt;
===gchartrb===&lt;br /&gt;
gchartrb&amp;lt;ref&amp;gt;http://code.google.com/p/gchartrb/&amp;lt;/ref&amp;gt; is a Ruby wrapper around the Google chart API&amp;lt;ref&amp;gt;http://code.google.com/apis/chart/&amp;lt;/ref&amp;gt;. In our project, we use gchartrb to generate all the bar charts in the visualization. &lt;br /&gt;
&lt;br /&gt;
====installing====&lt;br /&gt;
Installing gchartrb is simple, just include the gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'gchartrb', :require =&amp;gt; 'google_chart'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====usage in the project====&lt;br /&gt;
In the project, all bar charts and reliability charts are implemented by gchartrb, as is shown below.&lt;br /&gt;
[[File:All_charts.png|center]]&lt;br /&gt;
&lt;br /&gt;
The bar chart shows the score of each individual review or feedback. To generate the chart, the score data is first extracted using method &amp;lt;code&amp;gt;get_scores_for_chart.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Circles===&lt;br /&gt;
&lt;br /&gt;
=Visualization in Expertiza=&lt;br /&gt;
This section describes where in Expertiza we can use these visualizations to provide a better user experience. &lt;br /&gt;
The 'Review Score' view of the assignments can be enhanced using these visualization.&lt;br /&gt;
&lt;br /&gt;
We can see by the image below that currently the scores views includes only a large table. From a user experience perspective having a more prioritized view of the scores would be beneficial. Having all the data available for the user to peruse in a table is informative, but when the user wants only to get a quick idea of how they did in an assignment, it would be helpful to have some sort of visualization.&lt;br /&gt;
&lt;br /&gt;
[[File:score_view.png.jpeg]]&lt;br /&gt;
&lt;br /&gt;
The above scoring which is in tabular form can be enhanced with charts.&lt;br /&gt;
&lt;br /&gt;
=Graphical Score Dashboard=&lt;br /&gt;
The scores page was augmented with bar graphs displaying the distributions of each column, as well as a circle icon for the average score for that column. This will allow for easily determining what the reviewers thought of the work, as well as what the range of scores given. The circle graphs with the averages provide a visual for the quality of the work in each of the categories.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_chart.png]]&lt;br /&gt;
&lt;br /&gt;
==New View==&lt;br /&gt;
&lt;br /&gt;
We created a new view under the grades views, called participant_charts. This view is included as a partial in the grades/view_my_scores view. This allows us to not modify any of the existing views and keep the code modular.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Bar Charts==&lt;br /&gt;
&lt;br /&gt;
For the bar charts we constructed a method that, given the score and the type of bar chart, populates an instance variable that contains the charts. The code was included in the grades controller (grades_controller.rb file) and is shown below&lt;br /&gt;
&lt;br /&gt;
    def bar_chart(scores, type)&lt;br /&gt;
        GoogleChart::BarChart.new(&amp;quot;100x100&amp;quot;, &amp;quot; &amp;quot;, :vertical, false) do |bc|&lt;br /&gt;
          data = scores&lt;br /&gt;
          bc.data &amp;quot;Line green&amp;quot;, data, '990000'&lt;br /&gt;
          #bc.axis :x, :positions =&amp;gt; [0, data.size], :range =&amp;gt; [0,100]&lt;br /&gt;
          bc.axis :y, :range =&amp;gt; [0, data.max] ,:positions =&amp;gt; [data.min, data.max]&lt;br /&gt;
          bc.show_legend = false&lt;br /&gt;
          bc.stacked = false&lt;br /&gt;
          bc.width_spacing_options({:bar_width =&amp;gt; 70/(data.size+1),:bar_spacing =&amp;gt; 1, :group_spacing =&amp;gt; 1})&lt;br /&gt;
          bc.data_encoding = :extended&lt;br /&gt;
          @grades_bar_charts[type.to_sym] = (bc.to_url)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
The width of the bars is dependent on the number of scores to show. Assignments with many reviews to show, require smaller bars. This is accomplished by tying the bar_width parameter, to the size of the data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Circle Charts==&lt;br /&gt;
&lt;br /&gt;
For the circle charts showing the averages of the columns we used a javascript library, circle.js. By simply passing the scores to the .js code in the grades view as shown in the code below. The circle is then rendered automatically in a div block elsewhere in the view named the same as the id: tag below&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;% ['review', 'metareview', 'feedback', 'teammate'].each do |type| %&amp;gt;&lt;br /&gt;
      &amp;lt;% if @pscore[type.to_sym][:scores][:avg]%&amp;gt;&lt;br /&gt;
        var myCircle = Circles.create({&lt;br /&gt;
      id:           '&amp;lt;%= &amp;quot;#{type}-circle&amp;quot; %&amp;gt;',&lt;br /&gt;
      radius:       25,&lt;br /&gt;
      value:        &amp;lt;%= @pscore[type.to_sym][:scores][:avg].to_i %&amp;gt;,&lt;br /&gt;
      maxValue:     100,&lt;br /&gt;
      width:        7,&lt;br /&gt;
      text:         '&amp;lt;%=@pscore[type.to_sym][:scores][:avg].to_i%&amp;gt;',&lt;br /&gt;
      colors:       ['#FFEB99', '#FFCC00'],&lt;br /&gt;
      duration:       700,&lt;br /&gt;
      textClass:      'circles-text'&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
==Show / Hide stats==&lt;br /&gt;
&lt;br /&gt;
The user might want to hide the stats, with that in mind we included a button to toggle the visibility of the charts. Making use of an existing function, toggleElement, we added a link above the charts table that when clicked hides/shows the charts. The code to accomplish this is shown below&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;a href=&amp;quot;#&amp;quot; name='score-chartLink' onClick=&amp;quot;toggleElement('score-chart', 'stats');return false;&amp;quot;&amp;gt;hide stats&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Reliability Metric=&lt;br /&gt;
Based on the uniformity of the review scores, we will compile a reliability metric. This metric encapsulates the level of agreement between the reviews, and should provide a quick at a glance notion of whether reviewers agree on the scoring for the particular assignment, or whether there is a high variance in the scores given. A good reliability score indicates that the grade given to the assignment by the reviewers is to be trusted, whereas a poor reliability score indicates that there was a high level of disagreement in the reviewers and the instructors should perhaps take a closer look at the participant's assignment.&lt;br /&gt;
This reliability score is computed from the standard deviation of the review scores. A standard deviation that's less than 10 will award a good reliability score. A standard deviation between 10 and 20 will award a medium reliability score, whereas a standard deviation greater than 20 will give a poor reliability score.&lt;br /&gt;
===Different Icon colors===&lt;br /&gt;
[[File:MockupG.png]]&lt;br /&gt;
&lt;br /&gt;
The color of the three bars Icon, and the number of filled bars is representative of the reliability of the reviews.&lt;br /&gt;
Take the case of the green sample icon in the image above, the reviews mostly all agree. Whereas in the following two images, the icon is yellow and red respectively to signify increasingly worrying levels of disparity in review scores.&lt;br /&gt;
[[File:MockupY.png]]&lt;br /&gt;
[[File:MockupR.png]]&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=97065</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=97065"/>
		<updated>2015-05-03T20:30:57Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* usage in the project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Project Description=&lt;br /&gt;
The goal of this project is to present the the data in Expertiza in a more convenient way. Through the use of charts and graphs to enhance certain pages, such as the student's scores page and the instructor's scores page, and allow for the users to get an at-a-glance analysis of the data without having to dive into the tables.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this project is to add a visualization element to some of the data collected in expertiza. The aim of this is to provide a more intuitive “at-a-glance” idea of the data, some examples would be: how a student is doing on his/her assignments, or how their work compares to that of their classmates. On a less functional angle, it also enhances the aesthetics of the pages, taking the drab tables and giving them a more appealing look.&lt;br /&gt;
&lt;br /&gt;
=Overview of Approach=&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
option = { width: 400, height: 240, title: 'Company Performance' }&amp;lt;br/&amp;gt;&lt;br /&gt;
@chart = GoogleVisualr::Interactive::AreaChart.new(data_table, option)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id='chart'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;%= render_chart @chart, 'chart' %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Chart Examples====&lt;br /&gt;
=====Area Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/area_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/areachart.html#Example&lt;br /&gt;
  def area_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['2004', 1000, 400],&lt;br /&gt;
      ['2005', 1170, 460],&lt;br /&gt;
      ['2006', 660, 1120],&lt;br /&gt;
      ['2007', 1030, 540]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts   = { width: 400, height: 240, title: 'Company Performance', hAxis: {title: 'Year', titleTextStyle: {color: '#FF0000'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::AreaChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:AeraChart.png|center]]&lt;br /&gt;
=====Bar Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bar_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/barchart.html#Example&lt;br /&gt;
  def bar_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows(4)&lt;br /&gt;
    data_table.set_cell(0, 0, '2004')&lt;br /&gt;
    data_table.set_cell(0, 1, 1000)&lt;br /&gt;
    data_table.set_cell(0, 2, 400)&lt;br /&gt;
    data_table.set_cell(1, 0, '2005')&lt;br /&gt;
    data_table.set_cell(1, 1, 1170)&lt;br /&gt;
    data_table.set_cell(1, 2, 460)&lt;br /&gt;
    data_table.set_cell(2, 0, '2006')&lt;br /&gt;
    data_table.set_cell(2, 1, 660)&lt;br /&gt;
    data_table.set_cell(2, 2, 1120)&lt;br /&gt;
    data_table.set_cell(3, 0, '2007')&lt;br /&gt;
    data_table.set_cell(3, 1, 1030)&lt;br /&gt;
    data_table.set_cell(3, 2, 540)&lt;br /&gt;
&lt;br /&gt;
    opts   = { :width =&amp;gt; 400, :height =&amp;gt; 240, :title =&amp;gt; 'Company Performance', vAxis: {title: 'Year', titleTextStyle: {color: 'red'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BarChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BarChart.png|center]]&lt;br /&gt;
=====Bubble Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bubble_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/bubblechart.html&lt;br /&gt;
  def bubble_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'ID')&lt;br /&gt;
    data_table.new_column('number', 'Life Expectancy')&lt;br /&gt;
    data_table.new_column('number', 'Fertility Rate')&lt;br /&gt;
    data_table.new_column('string', 'Region')&lt;br /&gt;
    data_table.new_column('number', 'Population')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['CAN',    80.66,              1.67,      'North America',  33739900],&lt;br /&gt;
      ['DEU',    79.84,              1.36,      'Europe',         81902307],&lt;br /&gt;
      ['DNK',    78.6,               1.84,      'Europe',         5523095],&lt;br /&gt;
      ['EGY',    72.73,              2.78,      'Middle East',    79716203],&lt;br /&gt;
      ['GBR',    80.05,              2,         'Europe',         61801570],&lt;br /&gt;
      ['IRN',    72.49,              1.7,       'Middle East',    73137148],&lt;br /&gt;
      ['IRQ',    68.09,              4.77,      'Middle East',    31090763],&lt;br /&gt;
      ['ISR',    81.55,              2.96,      'Middle East',    7485600],&lt;br /&gt;
      ['RUS',    68.6,               1.54,      'Europe',         141850000],&lt;br /&gt;
      ['USA',    78.09,              2.05,      'North America',  307007000]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts    = {&lt;br /&gt;
      :width =&amp;gt; 800, :height =&amp;gt; 500,&lt;br /&gt;
      :title =&amp;gt; 'Correlation between life expectancy, fertility rate and population of some world countries (2010)',&lt;br /&gt;
      :hAxis =&amp;gt; { :title =&amp;gt; 'Life Expectancy' },&lt;br /&gt;
      :vAxis =&amp;gt; { :title =&amp;gt; 'Fertility Rate'  },&lt;br /&gt;
      :bubble =&amp;gt; { :textStyle =&amp;gt; { :fontSize =&amp;gt; 11 } }&lt;br /&gt;
    }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BubbleChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BubbleChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
simple line chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:data =&amp;gt; [0, 40, 10, 70, 20])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Simplechart.png]]&lt;br /&gt;
&lt;br /&gt;
bar chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [300, 100, 30, 200])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Barchart.png]]&lt;br /&gt;
&lt;br /&gt;
multiple bars chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [[300, 100, 30, 200], [100, 200, 300, 10]], :bar_colors =&amp;gt; ['FF0000', '00FF00'])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Multbarschart.png]]&lt;br /&gt;
&lt;br /&gt;
pie chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.pie(:data =&amp;gt; [20, 35, 45])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Piechart.png]]&lt;br /&gt;
&lt;br /&gt;
These usages come from http://googlecharts.rubyforge.org/. If you want to see more usages, go and visit this site.&lt;br /&gt;
&lt;br /&gt;
===gchartrb===&lt;br /&gt;
gchartrb&amp;lt;ref&amp;gt;http://code.google.com/p/gchartrb/&amp;lt;/ref&amp;gt; is a Ruby wrapper around the Google chart API&amp;lt;ref&amp;gt;http://code.google.com/apis/chart/&amp;lt;/ref&amp;gt;. In our project, we use gchartrb to generate all the bar charts in the visualization. &lt;br /&gt;
&lt;br /&gt;
====installing====&lt;br /&gt;
Installing gchartrb is simple, just include the gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'gchartrb', :require =&amp;gt; 'google_chart'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====usage in the project====&lt;br /&gt;
In the project, all bar charts and reliability charts are implemented by gchartrb, as is shown below.&lt;br /&gt;
[[File:All_charts.png|center]]&lt;br /&gt;
&lt;br /&gt;
The bar chart shows the score of each individual review or feedback.&lt;br /&gt;
&lt;br /&gt;
===Circles===&lt;br /&gt;
&lt;br /&gt;
=Visualization in Expertiza=&lt;br /&gt;
This section describes where in Expertiza we can use these visualizations to provide a better user experience. &lt;br /&gt;
The 'Review Score' view of the assignments can be enhanced using these visualization.&lt;br /&gt;
&lt;br /&gt;
We can see by the image below that currently the scores views includes only a large table. From a user experience perspective having a more prioritized view of the scores would be beneficial. Having all the data available for the user to peruse in a table is informative, but when the user wants only to get a quick idea of how they did in an assignment, it would be helpful to have some sort of visualization.&lt;br /&gt;
&lt;br /&gt;
[[File:score_view.png.jpeg]]&lt;br /&gt;
&lt;br /&gt;
The above scoring which is in tabular form can be enhanced with charts.&lt;br /&gt;
&lt;br /&gt;
=Graphical Score Dashboard=&lt;br /&gt;
The scores page was augmented with bar graphs displaying the distributions of each column, as well as a circle icon for the average score for that column. This will allow for easily determining what the reviewers thought of the work, as well as what the range of scores given. The circle graphs with the averages provide a visual for the quality of the work in each of the categories.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_chart.png]]&lt;br /&gt;
&lt;br /&gt;
==New View==&lt;br /&gt;
&lt;br /&gt;
We created a new view under the grades views, called participant_charts. This view is included as a partial in the grades/view_my_scores view. This allows us to not modify any of the existing views and keep the code modular.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Bar Charts==&lt;br /&gt;
&lt;br /&gt;
For the bar charts we constructed a method that, given the score and the type of bar chart, populates an instance variable that contains the charts. The code was included in the grades controller (grades_controller.rb file) and is shown below&lt;br /&gt;
&lt;br /&gt;
    def bar_chart(scores, type)&lt;br /&gt;
        GoogleChart::BarChart.new(&amp;quot;100x100&amp;quot;, &amp;quot; &amp;quot;, :vertical, false) do |bc|&lt;br /&gt;
          data = scores&lt;br /&gt;
          bc.data &amp;quot;Line green&amp;quot;, data, '990000'&lt;br /&gt;
          #bc.axis :x, :positions =&amp;gt; [0, data.size], :range =&amp;gt; [0,100]&lt;br /&gt;
          bc.axis :y, :range =&amp;gt; [0, data.max] ,:positions =&amp;gt; [data.min, data.max]&lt;br /&gt;
          bc.show_legend = false&lt;br /&gt;
          bc.stacked = false&lt;br /&gt;
          bc.width_spacing_options({:bar_width =&amp;gt; 70/(data.size+1),:bar_spacing =&amp;gt; 1, :group_spacing =&amp;gt; 1})&lt;br /&gt;
          bc.data_encoding = :extended&lt;br /&gt;
          @grades_bar_charts[type.to_sym] = (bc.to_url)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
The width of the bars is dependent on the number of scores to show. Assignments with many reviews to show, require smaller bars. This is accomplished by tying the bar_width parameter, to the size of the data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Circle Charts==&lt;br /&gt;
&lt;br /&gt;
For the circle charts showing the averages of the columns we used a javascript library, circle.js. By simply passing the scores to the .js code in the grades view as shown in the code below. The circle is then rendered automatically in a div block elsewhere in the view named the same as the id: tag below&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;% ['review', 'metareview', 'feedback', 'teammate'].each do |type| %&amp;gt;&lt;br /&gt;
      &amp;lt;% if @pscore[type.to_sym][:scores][:avg]%&amp;gt;&lt;br /&gt;
        var myCircle = Circles.create({&lt;br /&gt;
      id:           '&amp;lt;%= &amp;quot;#{type}-circle&amp;quot; %&amp;gt;',&lt;br /&gt;
      radius:       25,&lt;br /&gt;
      value:        &amp;lt;%= @pscore[type.to_sym][:scores][:avg].to_i %&amp;gt;,&lt;br /&gt;
      maxValue:     100,&lt;br /&gt;
      width:        7,&lt;br /&gt;
      text:         '&amp;lt;%=@pscore[type.to_sym][:scores][:avg].to_i%&amp;gt;',&lt;br /&gt;
      colors:       ['#FFEB99', '#FFCC00'],&lt;br /&gt;
      duration:       700,&lt;br /&gt;
      textClass:      'circles-text'&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
==Show / Hide stats==&lt;br /&gt;
&lt;br /&gt;
The user might want to hide the stats, with that in mind we included a button to toggle the visibility of the charts. Making use of an existing function, toggleElement, we added a link above the charts table that when clicked hides/shows the charts. The code to accomplish this is shown below&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;a href=&amp;quot;#&amp;quot; name='score-chartLink' onClick=&amp;quot;toggleElement('score-chart', 'stats');return false;&amp;quot;&amp;gt;hide stats&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Reliability Metric=&lt;br /&gt;
Based on the uniformity of the review scores, we will compile a reliability metric. This metric encapsulates the level of agreement between the reviews, and should provide a quick at a glance notion of whether reviewers agree on the scoring for the particular assignment, or whether there is a high variance in the scores given. A good reliability score indicates that the grade given to the assignment by the reviewers is to be trusted, whereas a poor reliability score indicates that there was a high level of disagreement in the reviewers and the instructors should perhaps take a closer look at the participant's assignment.&lt;br /&gt;
This reliability score is computed from the standard deviation of the review scores. A standard deviation that's less than 10 will award a good reliability score. A standard deviation between 10 and 20 will award a medium reliability score, whereas a standard deviation greater than 20 will give a poor reliability score.&lt;br /&gt;
===Different Icon colors===&lt;br /&gt;
[[File:MockupG.png]]&lt;br /&gt;
&lt;br /&gt;
The color of the three bars Icon, and the number of filled bars is representative of the reliability of the reviews.&lt;br /&gt;
Take the case of the green sample icon in the image above, the reviews mostly all agree. Whereas in the following two images, the icon is yellow and red respectively to signify increasingly worrying levels of disparity in review scores.&lt;br /&gt;
[[File:MockupY.png]]&lt;br /&gt;
[[File:MockupR.png]]&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:All_charts.png&amp;diff=97061</id>
		<title>File:All charts.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:All_charts.png&amp;diff=97061"/>
		<updated>2015-05-03T20:26:05Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=97053</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=97053"/>
		<updated>2015-05-03T20:19:56Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* gchartrb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
The goal of this project is to present the the data in Expertiza in a more convenient way. Through the use of charts and graphs to enhance certain pages, such as the student's scores page and the instructor's scores page, and allow for the users to get an at-a-glance analysis of the data without having to dive into the tables.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this project is to add a visualization element to some of the data collected in expertiza. The aim of this is to provide a more intuitive “at-a-glance” idea of the data, some examples would be: how a student is doing on his/her assignments, or how their work compares to that of their classmates. On a less functional angle, it also enhances the aesthetics of the pages, taking the drab tables and giving them a more appealing look.&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
option = { width: 400, height: 240, title: 'Company Performance' }&amp;lt;br/&amp;gt;&lt;br /&gt;
@chart = GoogleVisualr::Interactive::AreaChart.new(data_table, option)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id='chart'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;%= render_chart @chart, 'chart' %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Chart Examples====&lt;br /&gt;
=====Area Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/area_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/areachart.html#Example&lt;br /&gt;
  def area_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['2004', 1000, 400],&lt;br /&gt;
      ['2005', 1170, 460],&lt;br /&gt;
      ['2006', 660, 1120],&lt;br /&gt;
      ['2007', 1030, 540]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts   = { width: 400, height: 240, title: 'Company Performance', hAxis: {title: 'Year', titleTextStyle: {color: '#FF0000'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::AreaChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:AeraChart.png|center]]&lt;br /&gt;
=====Bar Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bar_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/barchart.html#Example&lt;br /&gt;
  def bar_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows(4)&lt;br /&gt;
    data_table.set_cell(0, 0, '2004')&lt;br /&gt;
    data_table.set_cell(0, 1, 1000)&lt;br /&gt;
    data_table.set_cell(0, 2, 400)&lt;br /&gt;
    data_table.set_cell(1, 0, '2005')&lt;br /&gt;
    data_table.set_cell(1, 1, 1170)&lt;br /&gt;
    data_table.set_cell(1, 2, 460)&lt;br /&gt;
    data_table.set_cell(2, 0, '2006')&lt;br /&gt;
    data_table.set_cell(2, 1, 660)&lt;br /&gt;
    data_table.set_cell(2, 2, 1120)&lt;br /&gt;
    data_table.set_cell(3, 0, '2007')&lt;br /&gt;
    data_table.set_cell(3, 1, 1030)&lt;br /&gt;
    data_table.set_cell(3, 2, 540)&lt;br /&gt;
&lt;br /&gt;
    opts   = { :width =&amp;gt; 400, :height =&amp;gt; 240, :title =&amp;gt; 'Company Performance', vAxis: {title: 'Year', titleTextStyle: {color: 'red'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BarChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BarChart.png|center]]&lt;br /&gt;
=====Bubble Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bubble_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/bubblechart.html&lt;br /&gt;
  def bubble_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'ID')&lt;br /&gt;
    data_table.new_column('number', 'Life Expectancy')&lt;br /&gt;
    data_table.new_column('number', 'Fertility Rate')&lt;br /&gt;
    data_table.new_column('string', 'Region')&lt;br /&gt;
    data_table.new_column('number', 'Population')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['CAN',    80.66,              1.67,      'North America',  33739900],&lt;br /&gt;
      ['DEU',    79.84,              1.36,      'Europe',         81902307],&lt;br /&gt;
      ['DNK',    78.6,               1.84,      'Europe',         5523095],&lt;br /&gt;
      ['EGY',    72.73,              2.78,      'Middle East',    79716203],&lt;br /&gt;
      ['GBR',    80.05,              2,         'Europe',         61801570],&lt;br /&gt;
      ['IRN',    72.49,              1.7,       'Middle East',    73137148],&lt;br /&gt;
      ['IRQ',    68.09,              4.77,      'Middle East',    31090763],&lt;br /&gt;
      ['ISR',    81.55,              2.96,      'Middle East',    7485600],&lt;br /&gt;
      ['RUS',    68.6,               1.54,      'Europe',         141850000],&lt;br /&gt;
      ['USA',    78.09,              2.05,      'North America',  307007000]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts    = {&lt;br /&gt;
      :width =&amp;gt; 800, :height =&amp;gt; 500,&lt;br /&gt;
      :title =&amp;gt; 'Correlation between life expectancy, fertility rate and population of some world countries (2010)',&lt;br /&gt;
      :hAxis =&amp;gt; { :title =&amp;gt; 'Life Expectancy' },&lt;br /&gt;
      :vAxis =&amp;gt; { :title =&amp;gt; 'Fertility Rate'  },&lt;br /&gt;
      :bubble =&amp;gt; { :textStyle =&amp;gt; { :fontSize =&amp;gt; 11 } }&lt;br /&gt;
    }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BubbleChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BubbleChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
simple line chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:data =&amp;gt; [0, 40, 10, 70, 20])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Simplechart.png]]&lt;br /&gt;
&lt;br /&gt;
bar chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [300, 100, 30, 200])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Barchart.png]]&lt;br /&gt;
&lt;br /&gt;
multiple bars chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [[300, 100, 30, 200], [100, 200, 300, 10]], :bar_colors =&amp;gt; ['FF0000', '00FF00'])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Multbarschart.png]]&lt;br /&gt;
&lt;br /&gt;
pie chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.pie(:data =&amp;gt; [20, 35, 45])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Piechart.png]]&lt;br /&gt;
&lt;br /&gt;
These usages come from http://googlecharts.rubyforge.org/. If you want to see more usages, go and visit this site.&lt;br /&gt;
&lt;br /&gt;
===gchartrb===&lt;br /&gt;
gchartrb&amp;lt;ref&amp;gt;http://code.google.com/p/gchartrb/&amp;lt;/ref&amp;gt; is a Ruby wrapper around the Google chart API&amp;lt;ref&amp;gt;http://code.google.com/apis/chart/&amp;lt;/ref&amp;gt;. In our project, we use gchartrb to generate all the bar charts in the visualization. &lt;br /&gt;
&lt;br /&gt;
====installing====&lt;br /&gt;
Installing gchartrb is simple, just include the gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem 'gchartrb', :require =&amp;gt; 'google_chart'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====usage in the project====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Circles===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
This section describes where in Expertiza we can use these visualizations to provide a better user experience. &lt;br /&gt;
The 'Review Score' view of the assignments can be enhanced using these visualization.&lt;br /&gt;
&lt;br /&gt;
We can see by the image below that currently the scores views includes only a large table. From a user experience perspective having a more prioritized view of the scores would be beneficial. Having all the data available for the user to peruse in a table is informative, but when the user wants only to get a quick idea of how they did in an assignment, it would be helpful to have some sort of visualization.&lt;br /&gt;
&lt;br /&gt;
[[File:score_view.png.jpeg]]&lt;br /&gt;
&lt;br /&gt;
The above scoring which is in tabular form can be enhanced with charts.&lt;br /&gt;
&lt;br /&gt;
==Graphical Score Dashboard==&lt;br /&gt;
The scores page was augmented with bar graphs displaying the distributions of each column, as well as a circle icon for the average score for that column. This will allow for easily determining what the reviewers thought of the work, as well as what the range of scores given. The circle graphs with the averages provide a visual for the quality of the work in each of the categories.&lt;br /&gt;
&lt;br /&gt;
[[File:Mockup2.png]]&lt;br /&gt;
&lt;br /&gt;
==Reliability Metric==&lt;br /&gt;
Based on the uniformity of the review scores, we will compile a reliability metric. This metric encapsulates the level of agreement between the reviews, and should provide a quick at a glance notion of whether reviewers agree on the scoring for the particular assignment, or whether there is a high variance in the scores given. A good reliability score indicates that the grade given to the assignment by the reviewers is to be trusted, whereas a poor reliability score indicates that there was a high level of disagreement in the reviewers and the instructors should perhaps take a closer look at the participant's assignment.&lt;br /&gt;
This reliability score is computed from the standard deviation of the review scores. A standard deviation that's less than 10 will award a good reliability score. A standard deviation between 10 and 20 will award a medium reliability score, whereas a standard deviation greater than 20 will give a poor reliability score.&lt;br /&gt;
===Different Icon colors===&lt;br /&gt;
[[File:MockupG.png]]&lt;br /&gt;
&lt;br /&gt;
The color of the three bars Icon, and the number of filled bars is representative of the reliability of the reviews.&lt;br /&gt;
Take the case of the green sample icon in the image above, the reviews mostly all agree. Whereas in the following two images, the icon is yellow and red respectively to signify increasingly worrying levels of disparity in review scores.&lt;br /&gt;
[[File:MockupY.png]]&lt;br /&gt;
[[File:MockupR.png]]&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=97049</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=97049"/>
		<updated>2015-05-03T20:11:06Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Overview of Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
The goal of this project is to present the the data in Expertiza in a more convenient way. Through the use of charts and graphs to enhance certain pages, such as the student's scores page and the instructor's scores page, and allow for the users to get an at-a-glance analysis of the data without having to dive into the tables.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The purpose of this project is to add a visualization element to some of the data collected in expertiza. The aim of this is to provide a more intuitive “at-a-glance” idea of the data, some examples would be: how a student is doing on his/her assignments, or how their work compares to that of their classmates. On a less functional angle, it also enhances the aesthetics of the pages, taking the drab tables and giving them a more appealing look.&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
option = { width: 400, height: 240, title: 'Company Performance' }&amp;lt;br/&amp;gt;&lt;br /&gt;
@chart = GoogleVisualr::Interactive::AreaChart.new(data_table, option)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id='chart'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;%= render_chart @chart, 'chart' %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Chart Examples====&lt;br /&gt;
=====Area Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/area_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/areachart.html#Example&lt;br /&gt;
  def area_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['2004', 1000, 400],&lt;br /&gt;
      ['2005', 1170, 460],&lt;br /&gt;
      ['2006', 660, 1120],&lt;br /&gt;
      ['2007', 1030, 540]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts   = { width: 400, height: 240, title: 'Company Performance', hAxis: {title: 'Year', titleTextStyle: {color: '#FF0000'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::AreaChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:AeraChart.png|center]]&lt;br /&gt;
=====Bar Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bar_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/barchart.html#Example&lt;br /&gt;
  def bar_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows(4)&lt;br /&gt;
    data_table.set_cell(0, 0, '2004')&lt;br /&gt;
    data_table.set_cell(0, 1, 1000)&lt;br /&gt;
    data_table.set_cell(0, 2, 400)&lt;br /&gt;
    data_table.set_cell(1, 0, '2005')&lt;br /&gt;
    data_table.set_cell(1, 1, 1170)&lt;br /&gt;
    data_table.set_cell(1, 2, 460)&lt;br /&gt;
    data_table.set_cell(2, 0, '2006')&lt;br /&gt;
    data_table.set_cell(2, 1, 660)&lt;br /&gt;
    data_table.set_cell(2, 2, 1120)&lt;br /&gt;
    data_table.set_cell(3, 0, '2007')&lt;br /&gt;
    data_table.set_cell(3, 1, 1030)&lt;br /&gt;
    data_table.set_cell(3, 2, 540)&lt;br /&gt;
&lt;br /&gt;
    opts   = { :width =&amp;gt; 400, :height =&amp;gt; 240, :title =&amp;gt; 'Company Performance', vAxis: {title: 'Year', titleTextStyle: {color: 'red'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BarChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BarChart.png|center]]&lt;br /&gt;
=====Bubble Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bubble_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/bubblechart.html&lt;br /&gt;
  def bubble_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'ID')&lt;br /&gt;
    data_table.new_column('number', 'Life Expectancy')&lt;br /&gt;
    data_table.new_column('number', 'Fertility Rate')&lt;br /&gt;
    data_table.new_column('string', 'Region')&lt;br /&gt;
    data_table.new_column('number', 'Population')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['CAN',    80.66,              1.67,      'North America',  33739900],&lt;br /&gt;
      ['DEU',    79.84,              1.36,      'Europe',         81902307],&lt;br /&gt;
      ['DNK',    78.6,               1.84,      'Europe',         5523095],&lt;br /&gt;
      ['EGY',    72.73,              2.78,      'Middle East',    79716203],&lt;br /&gt;
      ['GBR',    80.05,              2,         'Europe',         61801570],&lt;br /&gt;
      ['IRN',    72.49,              1.7,       'Middle East',    73137148],&lt;br /&gt;
      ['IRQ',    68.09,              4.77,      'Middle East',    31090763],&lt;br /&gt;
      ['ISR',    81.55,              2.96,      'Middle East',    7485600],&lt;br /&gt;
      ['RUS',    68.6,               1.54,      'Europe',         141850000],&lt;br /&gt;
      ['USA',    78.09,              2.05,      'North America',  307007000]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts    = {&lt;br /&gt;
      :width =&amp;gt; 800, :height =&amp;gt; 500,&lt;br /&gt;
      :title =&amp;gt; 'Correlation between life expectancy, fertility rate and population of some world countries (2010)',&lt;br /&gt;
      :hAxis =&amp;gt; { :title =&amp;gt; 'Life Expectancy' },&lt;br /&gt;
      :vAxis =&amp;gt; { :title =&amp;gt; 'Fertility Rate'  },&lt;br /&gt;
      :bubble =&amp;gt; { :textStyle =&amp;gt; { :fontSize =&amp;gt; 11 } }&lt;br /&gt;
    }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BubbleChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BubbleChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
simple line chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:data =&amp;gt; [0, 40, 10, 70, 20])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Simplechart.png]]&lt;br /&gt;
&lt;br /&gt;
bar chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [300, 100, 30, 200])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Barchart.png]]&lt;br /&gt;
&lt;br /&gt;
multiple bars chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [[300, 100, 30, 200], [100, 200, 300, 10]], :bar_colors =&amp;gt; ['FF0000', '00FF00'])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Multbarschart.png]]&lt;br /&gt;
&lt;br /&gt;
pie chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.pie(:data =&amp;gt; [20, 35, 45])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Piechart.png]]&lt;br /&gt;
&lt;br /&gt;
These usages come from http://googlecharts.rubyforge.org/. If you want to see more usages, go and visit this site.&lt;br /&gt;
&lt;br /&gt;
===gchartrb===&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
This section describes where in Expertiza we can use these visualizations to provide a better user experience. &lt;br /&gt;
The 'Review Score' view of the assignments can be enhanced using these visualization.&lt;br /&gt;
&lt;br /&gt;
We can see by the image below that currently the scores views includes only a large table. From a user experience perspective having a more prioritized view of the scores would be beneficial. Having all the data available for the user to peruse in a table is informative, but when the user wants only to get a quick idea of how they did in an assignment, it would be helpful to have some sort of visualization.&lt;br /&gt;
&lt;br /&gt;
[[File:score_view.png.jpeg]]&lt;br /&gt;
&lt;br /&gt;
The above scoring which is in tabular form can be enhanced with charts.&lt;br /&gt;
&lt;br /&gt;
==Graphical Score Dashboard==&lt;br /&gt;
The scores page was augmented with bar graphs displaying the distributions of each column, as well as a circle icon for the average score for that column. This will allow for easily determining what the reviewers thought of the work, as well as what the range of scores given. The circle graphs with the averages provide a visual for the quality of the work in each of the categories.&lt;br /&gt;
&lt;br /&gt;
[[File:Mockup2.png]]&lt;br /&gt;
&lt;br /&gt;
==Reliability Metric==&lt;br /&gt;
Based on the uniformity of the review scores, we will compile a reliability metric. This metric encapsulates the level of agreement between the reviews, and should provide a quick at a glance notion of whether reviewers agree on the scoring for the particular assignment, or whether there is a high variance in the scores given. A good reliability score indicates that the grade given to the assignment by the reviewers is to be trusted, whereas a poor reliability score indicates that there was a high level of disagreement in the reviewers and the instructors should perhaps take a closer look at the participant's assignment.&lt;br /&gt;
This reliability score is computed from the standard deviation of the review scores. A standard deviation that's less than 10 will award a good reliability score. A standard deviation between 10 and 20 will award a medium reliability score, whereas a standard deviation greater than 20 will give a poor reliability score.&lt;br /&gt;
===Different Icon colors===&lt;br /&gt;
[[File:MockupG.png]]&lt;br /&gt;
&lt;br /&gt;
The color of the three bars Icon, and the number of filled bars is representative of the reliability of the reviews.&lt;br /&gt;
Take the case of the green sample icon in the image above, the reviews mostly all agree. Whereas in the following two images, the icon is yellow and red respectively to signify increasingly worrying levels of disparity in review scores.&lt;br /&gt;
[[File:MockupY.png]]&lt;br /&gt;
[[File:MockupR.png]]&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015&amp;diff=96485</id>
		<title>CSC/ECE 517 Spring 2015</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015&amp;diff=96485"/>
		<updated>2015-04-05T20:35:32Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Final Project Design Document */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Writing Assignment 1==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 17 WL]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 5 ZX]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 6 TZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 4 RW]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 7 SA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 9 RA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 14 RI]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 1 DZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 20 HA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 3 RF]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 12 LS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 13 MA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 2 WA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 21 QW]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 23 MS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 10 GL]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 27 VC]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 22 SF]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 15 SH]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 18 AS]]&lt;br /&gt;
&lt;br /&gt;
==Writing Assignment 2==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1502 wwj]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/oss E1508 MRS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1504 IMV]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1505 xzl]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1509 lds]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1510 FLP]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1506 SYZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss S1504 AAC]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1507 DG]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss M1502 GVJ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss M1503 EDT]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1503 RSA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1501 YWS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss S1501 OA]]&lt;br /&gt;
&lt;br /&gt;
==Final Project Design Document==&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1526 MPRI]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 S1503 LWJZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 S1524 FSZZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 M1503 EDTS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1529 GLDS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1525 TIAA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1522 Visualization]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1527 SWAR]]&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015&amp;diff=96484</id>
		<title>CSC/ECE 517 Spring 2015</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015&amp;diff=96484"/>
		<updated>2015-04-05T20:20:07Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Final Project Design Document */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Writing Assignment 1==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 17 WL]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 5 ZX]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 6 TZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 4 RW]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 7 SA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 9 RA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 14 RI]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 1 DZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 20 HA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 3 RF]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 12 LS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 13 MA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 2 WA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 21 QW]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 23 MS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 10 GL]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 27 VC]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 22 SF]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 15 SH]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 18 AS]]&lt;br /&gt;
&lt;br /&gt;
==Writing Assignment 2==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1502 wwj]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/oss E1508 MRS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1504 IMV]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1505 xzl]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1509 lds]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1510 FLP]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1506 SYZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss S1504 AAC]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1507 DG]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss M1502 GVJ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss M1503 EDT]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1503 RSA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1501 YWS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss S1501 OA]]&lt;br /&gt;
&lt;br /&gt;
==Final Project Design Document==&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1526 MPRI]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 S1503 LWJZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 S1524 FSZZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 M1503 EDTS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1529 GLDS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1525 TIAA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1522 VISU]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1527 SWAR]]&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96406</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96406"/>
		<updated>2015-04-01T14:17:29Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* GoogleVisualr */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
option = { width: 400, height: 240, title: 'Company Performance' }&amp;lt;br/&amp;gt;&lt;br /&gt;
@chart = GoogleVisualr::Interactive::AreaChart.new(data_table, option)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id='chart'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;%= render_chart @chart, 'chart' %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Chart Examples====&lt;br /&gt;
=====Area Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/area_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/areachart.html#Example&lt;br /&gt;
  def area_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['2004', 1000, 400],&lt;br /&gt;
      ['2005', 1170, 460],&lt;br /&gt;
      ['2006', 660, 1120],&lt;br /&gt;
      ['2007', 1030, 540]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts   = { width: 400, height: 240, title: 'Company Performance', hAxis: {title: 'Year', titleTextStyle: {color: '#FF0000'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::AreaChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:AeraChart.png|center]]&lt;br /&gt;
=====Bar Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bar_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/barchart.html#Example&lt;br /&gt;
  def bar_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows(4)&lt;br /&gt;
    data_table.set_cell(0, 0, '2004')&lt;br /&gt;
    data_table.set_cell(0, 1, 1000)&lt;br /&gt;
    data_table.set_cell(0, 2, 400)&lt;br /&gt;
    data_table.set_cell(1, 0, '2005')&lt;br /&gt;
    data_table.set_cell(1, 1, 1170)&lt;br /&gt;
    data_table.set_cell(1, 2, 460)&lt;br /&gt;
    data_table.set_cell(2, 0, '2006')&lt;br /&gt;
    data_table.set_cell(2, 1, 660)&lt;br /&gt;
    data_table.set_cell(2, 2, 1120)&lt;br /&gt;
    data_table.set_cell(3, 0, '2007')&lt;br /&gt;
    data_table.set_cell(3, 1, 1030)&lt;br /&gt;
    data_table.set_cell(3, 2, 540)&lt;br /&gt;
&lt;br /&gt;
    opts   = { :width =&amp;gt; 400, :height =&amp;gt; 240, :title =&amp;gt; 'Company Performance', vAxis: {title: 'Year', titleTextStyle: {color: 'red'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BarChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BarChart.png|center]]&lt;br /&gt;
=====Bubble Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bubble_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/bubblechart.html&lt;br /&gt;
  def bubble_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'ID')&lt;br /&gt;
    data_table.new_column('number', 'Life Expectancy')&lt;br /&gt;
    data_table.new_column('number', 'Fertility Rate')&lt;br /&gt;
    data_table.new_column('string', 'Region')&lt;br /&gt;
    data_table.new_column('number', 'Population')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['CAN',    80.66,              1.67,      'North America',  33739900],&lt;br /&gt;
      ['DEU',    79.84,              1.36,      'Europe',         81902307],&lt;br /&gt;
      ['DNK',    78.6,               1.84,      'Europe',         5523095],&lt;br /&gt;
      ['EGY',    72.73,              2.78,      'Middle East',    79716203],&lt;br /&gt;
      ['GBR',    80.05,              2,         'Europe',         61801570],&lt;br /&gt;
      ['IRN',    72.49,              1.7,       'Middle East',    73137148],&lt;br /&gt;
      ['IRQ',    68.09,              4.77,      'Middle East',    31090763],&lt;br /&gt;
      ['ISR',    81.55,              2.96,      'Middle East',    7485600],&lt;br /&gt;
      ['RUS',    68.6,               1.54,      'Europe',         141850000],&lt;br /&gt;
      ['USA',    78.09,              2.05,      'North America',  307007000]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts    = {&lt;br /&gt;
      :width =&amp;gt; 800, :height =&amp;gt; 500,&lt;br /&gt;
      :title =&amp;gt; 'Correlation between life expectancy, fertility rate and population of some world countries (2010)',&lt;br /&gt;
      :hAxis =&amp;gt; { :title =&amp;gt; 'Life Expectancy' },&lt;br /&gt;
      :vAxis =&amp;gt; { :title =&amp;gt; 'Fertility Rate'  },&lt;br /&gt;
      :bubble =&amp;gt; { :textStyle =&amp;gt; { :fontSize =&amp;gt; 11 } }&lt;br /&gt;
    }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BubbleChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BubbleChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
simple line chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:data =&amp;gt; [0, 40, 10, 70, 20])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Simplechart.png]]&lt;br /&gt;
&lt;br /&gt;
bar chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [300, 100, 30, 200])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Barchart.png]]&lt;br /&gt;
&lt;br /&gt;
multiple bars chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [[300, 100, 30, 200], [100, 200, 300, 10]], :bar_colors =&amp;gt; ['FF0000', '00FF00'])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Multbarschart.png]]&lt;br /&gt;
&lt;br /&gt;
pie chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.pie(:data =&amp;gt; [20, 35, 45])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Piechart.png]]&lt;br /&gt;
&lt;br /&gt;
These usages come from http://googlecharts.rubyforge.org/. If you want to see more usages, go and visit this site.&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96378</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96378"/>
		<updated>2015-04-01T03:28:46Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Chart Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
option = { width: 400, height: 240, title: 'Company Performance' }&amp;lt;br/&amp;gt;&lt;br /&gt;
@chart = GoogleVisualr::Interactive::AreaChart.new(data_table, option)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id='chart'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;%= render_chart @chart, 'chart' %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Chart Examples====&lt;br /&gt;
=====Area Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/area_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/areachart.html#Example&lt;br /&gt;
  def area_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['2004', 1000, 400],&lt;br /&gt;
      ['2005', 1170, 460],&lt;br /&gt;
      ['2006', 660, 1120],&lt;br /&gt;
      ['2007', 1030, 540]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts   = { width: 400, height: 240, title: 'Company Performance', hAxis: {title: 'Year', titleTextStyle: {color: '#FF0000'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::AreaChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:AeraChart.png|center]]&lt;br /&gt;
=====Bar Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bar_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/barchart.html#Example&lt;br /&gt;
  def bar_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows(4)&lt;br /&gt;
    data_table.set_cell(0, 0, '2004')&lt;br /&gt;
    data_table.set_cell(0, 1, 1000)&lt;br /&gt;
    data_table.set_cell(0, 2, 400)&lt;br /&gt;
    data_table.set_cell(1, 0, '2005')&lt;br /&gt;
    data_table.set_cell(1, 1, 1170)&lt;br /&gt;
    data_table.set_cell(1, 2, 460)&lt;br /&gt;
    data_table.set_cell(2, 0, '2006')&lt;br /&gt;
    data_table.set_cell(2, 1, 660)&lt;br /&gt;
    data_table.set_cell(2, 2, 1120)&lt;br /&gt;
    data_table.set_cell(3, 0, '2007')&lt;br /&gt;
    data_table.set_cell(3, 1, 1030)&lt;br /&gt;
    data_table.set_cell(3, 2, 540)&lt;br /&gt;
&lt;br /&gt;
    opts   = { :width =&amp;gt; 400, :height =&amp;gt; 240, :title =&amp;gt; 'Company Performance', vAxis: {title: 'Year', titleTextStyle: {color: 'red'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BarChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BarChart.png|center]]&lt;br /&gt;
=====Bubble Chart&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/examples/interactive/bubble_chart&amp;lt;/ref&amp;gt;=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/bubblechart.html&lt;br /&gt;
  def bubble_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'ID')&lt;br /&gt;
    data_table.new_column('number', 'Life Expectancy')&lt;br /&gt;
    data_table.new_column('number', 'Fertility Rate')&lt;br /&gt;
    data_table.new_column('string', 'Region')&lt;br /&gt;
    data_table.new_column('number', 'Population')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['CAN',    80.66,              1.67,      'North America',  33739900],&lt;br /&gt;
      ['DEU',    79.84,              1.36,      'Europe',         81902307],&lt;br /&gt;
      ['DNK',    78.6,               1.84,      'Europe',         5523095],&lt;br /&gt;
      ['EGY',    72.73,              2.78,      'Middle East',    79716203],&lt;br /&gt;
      ['GBR',    80.05,              2,         'Europe',         61801570],&lt;br /&gt;
      ['IRN',    72.49,              1.7,       'Middle East',    73137148],&lt;br /&gt;
      ['IRQ',    68.09,              4.77,      'Middle East',    31090763],&lt;br /&gt;
      ['ISR',    81.55,              2.96,      'Middle East',    7485600],&lt;br /&gt;
      ['RUS',    68.6,               1.54,      'Europe',         141850000],&lt;br /&gt;
      ['USA',    78.09,              2.05,      'North America',  307007000]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts    = {&lt;br /&gt;
      :width =&amp;gt; 800, :height =&amp;gt; 500,&lt;br /&gt;
      :title =&amp;gt; 'Correlation between life expectancy, fertility rate and population of some world countries (2010)',&lt;br /&gt;
      :hAxis =&amp;gt; { :title =&amp;gt; 'Life Expectancy' },&lt;br /&gt;
      :vAxis =&amp;gt; { :title =&amp;gt; 'Fertility Rate'  },&lt;br /&gt;
      :bubble =&amp;gt; { :textStyle =&amp;gt; { :fontSize =&amp;gt; 11 } }&lt;br /&gt;
    }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BubbleChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BubbleChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
simple line chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:data =&amp;gt; [0, 40, 10, 70, 20])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Simplechart.png]]&lt;br /&gt;
&lt;br /&gt;
bar chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [300, 100, 30, 200])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Barchart.png]]&lt;br /&gt;
&lt;br /&gt;
multiple bars chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [[300, 100, 30, 200], [100, 200, 300, 10]], :bar_colors =&amp;gt; ['FF0000', '00FF00'])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Multbarschart.png]]&lt;br /&gt;
&lt;br /&gt;
pie chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.pie(:data =&amp;gt; [20, 35, 45])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Piechart.png]]&lt;br /&gt;
&lt;br /&gt;
These usages come from http://googlecharts.rubyforge.org/. If you want to see more usages, go and visit this site.&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96377</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96377"/>
		<updated>2015-04-01T03:23:27Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Chart Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
option = { width: 400, height: 240, title: 'Company Performance' }&amp;lt;br/&amp;gt;&lt;br /&gt;
@chart = GoogleVisualr::Interactive::AreaChart.new(data_table, option)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id='chart'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;%= render_chart @chart, 'chart' %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Chart Examples====&lt;br /&gt;
=====Area Chart=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/areachart.html#Example&lt;br /&gt;
  def area_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['2004', 1000, 400],&lt;br /&gt;
      ['2005', 1170, 460],&lt;br /&gt;
      ['2006', 660, 1120],&lt;br /&gt;
      ['2007', 1030, 540]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts   = { width: 400, height: 240, title: 'Company Performance', hAxis: {title: 'Year', titleTextStyle: {color: '#FF0000'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::AreaChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:AeraChart.png|center]]&lt;br /&gt;
=====Bar Chart=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/barchart.html#Example&lt;br /&gt;
  def bar_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows(4)&lt;br /&gt;
    data_table.set_cell(0, 0, '2004')&lt;br /&gt;
    data_table.set_cell(0, 1, 1000)&lt;br /&gt;
    data_table.set_cell(0, 2, 400)&lt;br /&gt;
    data_table.set_cell(1, 0, '2005')&lt;br /&gt;
    data_table.set_cell(1, 1, 1170)&lt;br /&gt;
    data_table.set_cell(1, 2, 460)&lt;br /&gt;
    data_table.set_cell(2, 0, '2006')&lt;br /&gt;
    data_table.set_cell(2, 1, 660)&lt;br /&gt;
    data_table.set_cell(2, 2, 1120)&lt;br /&gt;
    data_table.set_cell(3, 0, '2007')&lt;br /&gt;
    data_table.set_cell(3, 1, 1030)&lt;br /&gt;
    data_table.set_cell(3, 2, 540)&lt;br /&gt;
&lt;br /&gt;
    opts   = { :width =&amp;gt; 400, :height =&amp;gt; 240, :title =&amp;gt; 'Company Performance', vAxis: {title: 'Year', titleTextStyle: {color: 'red'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BarChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BarChart.png|center]]&lt;br /&gt;
=====Bubble Chart=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/bubblechart.html&lt;br /&gt;
  def bubble_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'ID')&lt;br /&gt;
    data_table.new_column('number', 'Life Expectancy')&lt;br /&gt;
    data_table.new_column('number', 'Fertility Rate')&lt;br /&gt;
    data_table.new_column('string', 'Region')&lt;br /&gt;
    data_table.new_column('number', 'Population')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['CAN',    80.66,              1.67,      'North America',  33739900],&lt;br /&gt;
      ['DEU',    79.84,              1.36,      'Europe',         81902307],&lt;br /&gt;
      ['DNK',    78.6,               1.84,      'Europe',         5523095],&lt;br /&gt;
      ['EGY',    72.73,              2.78,      'Middle East',    79716203],&lt;br /&gt;
      ['GBR',    80.05,              2,         'Europe',         61801570],&lt;br /&gt;
      ['IRN',    72.49,              1.7,       'Middle East',    73137148],&lt;br /&gt;
      ['IRQ',    68.09,              4.77,      'Middle East',    31090763],&lt;br /&gt;
      ['ISR',    81.55,              2.96,      'Middle East',    7485600],&lt;br /&gt;
      ['RUS',    68.6,               1.54,      'Europe',         141850000],&lt;br /&gt;
      ['USA',    78.09,              2.05,      'North America',  307007000]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts    = {&lt;br /&gt;
      :width =&amp;gt; 800, :height =&amp;gt; 500,&lt;br /&gt;
      :title =&amp;gt; 'Correlation between life expectancy, fertility rate and population of some world countries (2010)',&lt;br /&gt;
      :hAxis =&amp;gt; { :title =&amp;gt; 'Life Expectancy' },&lt;br /&gt;
      :vAxis =&amp;gt; { :title =&amp;gt; 'Fertility Rate'  },&lt;br /&gt;
      :bubble =&amp;gt; { :textStyle =&amp;gt; { :fontSize =&amp;gt; 11 } }&lt;br /&gt;
    }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BubbleChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BubbleChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
simple line chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:data =&amp;gt; [0, 40, 10, 70, 20])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Simplechart.png]]&lt;br /&gt;
&lt;br /&gt;
bar chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [300, 100, 30, 200])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Barchart.png]]&lt;br /&gt;
&lt;br /&gt;
multiple bars chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [[300, 100, 30, 200], [100, 200, 300, 10]], :bar_colors =&amp;gt; ['FF0000', '00FF00'])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Multbarschart.png]]&lt;br /&gt;
&lt;br /&gt;
pie chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.pie(:data =&amp;gt; [20, 35, 45])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Piechart.png]]&lt;br /&gt;
&lt;br /&gt;
These usages come from http://googlecharts.rubyforge.org/. If you want to see more usages, go and visit this site.&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96375</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96375"/>
		<updated>2015-04-01T03:22:25Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Chart Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
option = { width: 400, height: 240, title: 'Company Performance' }&amp;lt;br/&amp;gt;&lt;br /&gt;
@chart = GoogleVisualr::Interactive::AreaChart.new(data_table, option)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id='chart'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;%= render_chart @chart, 'chart' %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Chart Examples====&lt;br /&gt;
=====Area Chart=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/areachart.html#Example&lt;br /&gt;
  def area_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['2004', 1000, 400],&lt;br /&gt;
      ['2005', 1170, 460],&lt;br /&gt;
      ['2006', 660, 1120],&lt;br /&gt;
      ['2007', 1030, 540]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts   = { width: 400, height: 240, title: 'Company Performance', hAxis: {title: 'Year', titleTextStyle: {color: '#FF0000'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::AreaChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:AeraChart.png|center]]&lt;br /&gt;
=====Bar Chart=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/barchart.html#Example&lt;br /&gt;
  def bar_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows(4)&lt;br /&gt;
    data_table.set_cell(0, 0, '2004')&lt;br /&gt;
    data_table.set_cell(0, 1, 1000)&lt;br /&gt;
    data_table.set_cell(0, 2, 400)&lt;br /&gt;
    data_table.set_cell(1, 0, '2005')&lt;br /&gt;
    data_table.set_cell(1, 1, 1170)&lt;br /&gt;
    data_table.set_cell(1, 2, 460)&lt;br /&gt;
    data_table.set_cell(2, 0, '2006')&lt;br /&gt;
    data_table.set_cell(2, 1, 660)&lt;br /&gt;
    data_table.set_cell(2, 2, 1120)&lt;br /&gt;
    data_table.set_cell(3, 0, '2007')&lt;br /&gt;
    data_table.set_cell(3, 1, 1030)&lt;br /&gt;
    data_table.set_cell(3, 2, 540)&lt;br /&gt;
&lt;br /&gt;
    opts   = { :width =&amp;gt; 400, :height =&amp;gt; 240, :title =&amp;gt; 'Company Performance', vAxis: {title: 'Year', titleTextStyle: {color: 'red'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::BarChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:BarChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
simple line chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:data =&amp;gt; [0, 40, 10, 70, 20])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Simplechart.png]]&lt;br /&gt;
&lt;br /&gt;
bar chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [300, 100, 30, 200])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Barchart.png]]&lt;br /&gt;
&lt;br /&gt;
multiple bars chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [[300, 100, 30, 200], [100, 200, 300, 10]], :bar_colors =&amp;gt; ['FF0000', '00FF00'])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Multbarschart.png]]&lt;br /&gt;
&lt;br /&gt;
pie chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.pie(:data =&amp;gt; [20, 35, 45])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Piechart.png]]&lt;br /&gt;
&lt;br /&gt;
These usages come from http://googlecharts.rubyforge.org/. If you want to see more usages, go and visit this site.&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96374</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96374"/>
		<updated>2015-04-01T03:21:25Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Chart Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
option = { width: 400, height: 240, title: 'Company Performance' }&amp;lt;br/&amp;gt;&lt;br /&gt;
@chart = GoogleVisualr::Interactive::AreaChart.new(data_table, option)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id='chart'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;%= render_chart @chart, 'chart' %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Chart Examples====&lt;br /&gt;
=====Area Chart=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/areachart.html#Example&lt;br /&gt;
  def area_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['2004', 1000, 400],&lt;br /&gt;
      ['2005', 1170, 460],&lt;br /&gt;
      ['2006', 660, 1120],&lt;br /&gt;
      ['2007', 1030, 540]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts   = { width: 400, height: 240, title: 'Company Performance', hAxis: {title: 'Year', titleTextStyle: {color: '#FF0000'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::AreaChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:AeraChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
simple line chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:data =&amp;gt; [0, 40, 10, 70, 20])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Simplechart.png]]&lt;br /&gt;
&lt;br /&gt;
bar chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [300, 100, 30, 200])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Barchart.png]]&lt;br /&gt;
&lt;br /&gt;
multiple bars chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [[300, 100, 30, 200], [100, 200, 300, 10]], :bar_colors =&amp;gt; ['FF0000', '00FF00'])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Multbarschart.png]]&lt;br /&gt;
&lt;br /&gt;
pie chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.pie(:data =&amp;gt; [20, 35, 45])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Piechart.png]]&lt;br /&gt;
&lt;br /&gt;
These usages come from http://googlecharts.rubyforge.org/. If you want to see more usages, go and visit this site.&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96373</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96373"/>
		<updated>2015-04-01T03:21:07Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Chart Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
option = { width: 400, height: 240, title: 'Company Performance' }&amp;lt;br/&amp;gt;&lt;br /&gt;
@chart = GoogleVisualr::Interactive::AreaChart.new(data_table, option)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id='chart'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;%= render_chart @chart, 'chart' %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Chart Examples====&lt;br /&gt;
=====Area Chart=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/areachart.html#Example&lt;br /&gt;
  def area_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['2004', 1000, 400],&lt;br /&gt;
      ['2005', 1170, 460],&lt;br /&gt;
      ['2006', 660, 1120],&lt;br /&gt;
      ['2007', 1030, 540]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts   = { width: 400, height: 240, title: 'Company Performance', hAxis: {title: 'Year', titleTextStyle: {color: '#FF0000'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::AreaChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart looks like below.&lt;br /&gt;
[[File:AreaChart.png|center]]&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
simple line chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:data =&amp;gt; [0, 40, 10, 70, 20])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Simplechart.png]]&lt;br /&gt;
&lt;br /&gt;
bar chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [300, 100, 30, 200])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Barchart.png]]&lt;br /&gt;
&lt;br /&gt;
multiple bars chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [[300, 100, 30, 200], [100, 200, 300, 10]], :bar_colors =&amp;gt; ['FF0000', '00FF00'])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Multbarschart.png]]&lt;br /&gt;
&lt;br /&gt;
pie chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.pie(:data =&amp;gt; [20, 35, 45])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Piechart.png]]&lt;br /&gt;
&lt;br /&gt;
These usages come from http://googlecharts.rubyforge.org/. If you want to see more usages, go and visit this site.&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:BubbleChart.png&amp;diff=96372</id>
		<title>File:BubbleChart.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:BubbleChart.png&amp;diff=96372"/>
		<updated>2015-04-01T03:19:20Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:BarChart.png&amp;diff=96371</id>
		<title>File:BarChart.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:BarChart.png&amp;diff=96371"/>
		<updated>2015-04-01T03:19:11Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: uploaded a new version of &amp;amp;quot;File:BarChart.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:AeraChart.png&amp;diff=96370</id>
		<title>File:AeraChart.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:AeraChart.png&amp;diff=96370"/>
		<updated>2015-04-01T03:18:58Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96368</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96368"/>
		<updated>2015-04-01T03:18:37Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Chart Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
option = { width: 400, height: 240, title: 'Company Performance' }&amp;lt;br/&amp;gt;&lt;br /&gt;
@chart = GoogleVisualr::Interactive::AreaChart.new(data_table, option)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id='chart'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;%= render_chart @chart, 'chart' %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Chart Examples====&lt;br /&gt;
=====Area Chart=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/areachart.html#Example&lt;br /&gt;
  def area_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['2004', 1000, 400],&lt;br /&gt;
      ['2005', 1170, 460],&lt;br /&gt;
      ['2006', 660, 1120],&lt;br /&gt;
      ['2007', 1030, 540]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts   = { width: 400, height: 240, title: 'Company Performance', hAxis: {title: 'Year', titleTextStyle: {color: '#FF0000'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::AreaChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The resulting chart&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
simple line chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:data =&amp;gt; [0, 40, 10, 70, 20])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Simplechart.png]]&lt;br /&gt;
&lt;br /&gt;
bar chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [300, 100, 30, 200])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Barchart.png]]&lt;br /&gt;
&lt;br /&gt;
multiple bars chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [[300, 100, 30, 200], [100, 200, 300, 10]], :bar_colors =&amp;gt; ['FF0000', '00FF00'])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Multbarschart.png]]&lt;br /&gt;
&lt;br /&gt;
pie chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.pie(:data =&amp;gt; [20, 35, 45])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Piechart.png]]&lt;br /&gt;
&lt;br /&gt;
These usages come from http://googlecharts.rubyforge.org/. If you want to see more usages, go and visit this site.&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96365</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96365"/>
		<updated>2015-04-01T03:14:33Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* GoogleVisualr */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
option = { width: 400, height: 240, title: 'Company Performance' }&amp;lt;br/&amp;gt;&lt;br /&gt;
@chart = GoogleVisualr::Interactive::AreaChart.new(data_table, option)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id='chart'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;%= render_chart @chart, 'chart' %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Chart Examples====&lt;br /&gt;
=====Area Chart=====&lt;br /&gt;
The following code presents the example of area chart.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# http://code.google.com/apis/chart/interactive/docs/gallery/areachart.html#Example&lt;br /&gt;
  def area_chart&lt;br /&gt;
&lt;br /&gt;
    data_table = GoogleVisualr::DataTable.new&lt;br /&gt;
    data_table.new_column('string', 'Year')&lt;br /&gt;
    data_table.new_column('number', 'Sales')&lt;br /&gt;
    data_table.new_column('number', 'Expenses')&lt;br /&gt;
    data_table.add_rows( [&lt;br /&gt;
      ['2004', 1000, 400],&lt;br /&gt;
      ['2005', 1170, 460],&lt;br /&gt;
      ['2006', 660, 1120],&lt;br /&gt;
      ['2007', 1030, 540]&lt;br /&gt;
    ])&lt;br /&gt;
&lt;br /&gt;
    opts   = { width: 400, height: 240, title: 'Company Performance', hAxis: {title: 'Year', titleTextStyle: {color: '#FF0000'}} }&lt;br /&gt;
    @chart = GoogleVisualr::Interactive::AreaChart.new(data_table, opts)&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
simple line chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:data =&amp;gt; [0, 40, 10, 70, 20])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Simplechart.png]]&lt;br /&gt;
&lt;br /&gt;
bar chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [300, 100, 30, 200])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Barchart.png]]&lt;br /&gt;
&lt;br /&gt;
multiple bars chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.bar(:data =&amp;gt; [[300, 100, 30, 200], [100, 200, 300, 10]], :bar_colors =&amp;gt; ['FF0000', '00FF00'])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Multbarschart.png]]&lt;br /&gt;
&lt;br /&gt;
pie chart:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.pie(:data =&amp;gt; [20, 35, 45])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[File:Piechart.png]]&lt;br /&gt;
&lt;br /&gt;
These usages come from http://googlecharts.rubyforge.org/. If you want to see more usages, go and visit this site.&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96350</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96350"/>
		<updated>2015-04-01T03:02:40Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Work Flow */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
option = { width: 400, height: 240, title: 'Company Performance' }&amp;lt;br/&amp;gt;&lt;br /&gt;
@chart = GoogleVisualr::Interactive::AreaChart.new(data_table, option)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;div id='chart'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;%= render_chart @chart, 'chart' %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96349</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96349"/>
		<updated>2015-04-01T03:02:25Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Work Flow */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
option = { width: 400, height: 240, title: 'Company Performance' }&amp;lt;br/&amp;gt;&lt;br /&gt;
  @chart = GoogleVisualr::Interactive::AreaChart.new(data_table, option)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;div id='chart'&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
  &amp;lt;%= render_chart @chart, 'chart' %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96347</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96347"/>
		<updated>2015-04-01T03:01:21Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Work Flow */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add Column Headers&lt;br /&gt;
  data_table.new_column('string', 'Year' )&lt;br /&gt;
  data_table.new_column('number', 'Sales')&lt;br /&gt;
  data_table.new_column('number', 'Expenses')&lt;br /&gt;
  # Add Rows and Values&lt;br /&gt;
  data_table.add_rows([&lt;br /&gt;
    ['2004', 1000, 400],&lt;br /&gt;
    ['2005', 1170, 460],&lt;br /&gt;
    ['2006', 660, 1120],&lt;br /&gt;
    ['2007', 1030, 540]&lt;br /&gt;
  ])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96345</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96345"/>
		<updated>2015-04-01T03:00:42Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* GoogleVisualr */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
And in the Rails layout, load Google Ajax API in the head tag, at the very top.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script src='http://www.google.com/jsapi'&amp;gt;&amp;lt;/script&amp;gt;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96341</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96341"/>
		<updated>2015-04-01T02:51:11Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* GoogleVisualr */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&lt;br /&gt;
====Installing====&lt;br /&gt;
Installing GoogleVisualr is pretty simple. Just include the following gem in the Gemfile.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;google_visualr&amp;quot;, &amp;quot;~&amp;gt; 2.1.0&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96328</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96328"/>
		<updated>2015-04-01T02:46:49Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Work Flow */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*In your model or controller, write Ruby code to create your chart (e.g. Area Chart, Bar Chart, even Spark Lines etc).&lt;br /&gt;
*Configure your chart with any of the options as listed in Google Chart Tools' API Docs.&lt;br /&gt;
*In your view, invoke a chart.to_js(div_id) method and that will magically generate and insert JavaScript into the final HTML output.&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96327</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96327"/>
		<updated>2015-04-01T02:44:02Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Work Flow */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
**asdfad&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96326</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96326"/>
		<updated>2015-04-01T02:43:54Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Work Flow */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
*asdfad&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96325</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96325"/>
		<updated>2015-04-01T02:43:40Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Work Flow */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
(1)asdfad&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96317</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96317"/>
		<updated>2015-04-01T02:33:07Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* GoogleVisualr */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
====Work Flow====&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96316</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96316"/>
		<updated>2015-04-01T02:32:28Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* GoogleVisualr */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts &amp;lt;ref&amp;gt;http://googlecharts.rubyforge.org/&amp;lt;/ref&amp;gt; and GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt;.  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr is a a wrapper around the Google Chart Tools&amp;lt;ref&amp;gt;https://developers.google.com/chart/&amp;lt;/ref&amp;gt; which allows users to create beautiful charts with just Ruby, instead of writing JavaScript if using the Google Chart Tools directly.&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96302</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96302"/>
		<updated>2015-04-01T02:23:09Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Overview of Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts (http://googlecharts.rubyforge.org/) and GoogleVisualr (http://googlevisualr.herokuapp.com/).  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt; is a&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96300</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96300"/>
		<updated>2015-04-01T02:21:42Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* GoogleVisualr */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts (http://googlecharts.rubyforge.org/) and GoogleVisualr (http://googlecharts.rubyforge.org/).  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt; is a&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
=====Installing=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Example in Ruby on Rails=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [1, 2, 3, 4, 5])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Basic Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====Detail Usages=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96297</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96297"/>
		<updated>2015-04-01T02:21:03Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* GoogleVisualr */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts (http://googlecharts.rubyforge.org/) and GoogleVisualr (http://googlecharts.rubyforge.org/).  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
 GoogleVisualr &amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt; is a&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
====Installing====&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Example in Ruby on Rails====&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [0, 40, 10, 70, 20])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Basic Usages====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Detail Usages====&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96295</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96295"/>
		<updated>2015-04-01T02:20:36Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* GoogleVisualr */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts (http://googlecharts.rubyforge.org/) and GoogleVisualr (http://googlecharts.rubyforge.org/).  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
 GoogleVisualr&amp;lt;ref&amp;gt;http://googlevisualr.herokuapp.com/&amp;lt;/ref&amp;gt; is a&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.&lt;br /&gt;
&lt;br /&gt;
===='''Usage'''====&lt;br /&gt;
====Installing====&lt;br /&gt;
&amp;lt;pre&amp;gt;gem install googlecharts&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Example in Ruby on Rails====&lt;br /&gt;
'''Controller''':  &amp;lt;pre&amp;gt;@line_chart = Gchart.line(:data =&amp;gt; [0, 40, 10, 70, 20])&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''View''': &amp;lt;pre&amp;gt; &amp;lt;%= image_tag(@line_chart) %&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Basic Usages====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require ‘gchart’&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gchart.line(:size =&amp;gt; ‘200*200’,&lt;br /&gt;
:title =&amp;gt; “title”,&lt;br /&gt;
:bg =&amp;gt; ‘efefef’,&lt;br /&gt;
:legend =&amp;gt; &lt;br /&gt;
:data =&amp;gt; [1, 2, 3, 4, 5])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====Detail Usages====&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96265</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96265"/>
		<updated>2015-04-01T02:06:57Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Overview of Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts (http://googlecharts.rubyforge.org/) and GoogleVisualr (http://googlecharts.rubyforge.org/).  These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96263</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96263"/>
		<updated>2015-04-01T02:06:26Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Overview of Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts (http://googlecharts.rubyforge.org/) and GoogleVisualr (http://googlecharts.rubyforge.org/).  These gems made use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96262</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96262"/>
		<updated>2015-04-01T02:06:18Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Overview of Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts (http://googlecharts.rubyforge.org/) and GoogleVisualr (http://googlecharts.rubyforge.org/).  These gems made use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96259</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96259"/>
		<updated>2015-04-01T02:05:46Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;br /&gt;
&lt;br /&gt;
==Visualization in Expertiza==&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96256</id>
		<title>CSC/ECE 517 Spring 2015 E1522 Visualization</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015_E1522_Visualization&amp;diff=96256"/>
		<updated>2015-04-01T02:05:08Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: Created page with &amp;quot;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;  ==Project Description== In this project, the data in Expertiza would be presented in a more convenient and instinct way....&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Visualization &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
In this project, the data in Expertiza would be presented in a more convenient and instinct way.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
&lt;br /&gt;
==Overview of Approach==&lt;br /&gt;
&lt;br /&gt;
===GoogleVisualr===&lt;br /&gt;
&lt;br /&gt;
===GoogleCharts===&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015&amp;diff=96246</id>
		<title>CSC/ECE 517 Spring 2015</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015&amp;diff=96246"/>
		<updated>2015-04-01T01:58:19Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Final Project Design Document */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Writing Assignment 1==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 17 WL]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 5 ZX]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 6 TZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 4 RW]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 7 SA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 9 RA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 14 RI]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 1 DZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 20 HA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 3 RF]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 12 LS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 13 MA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1a 2 WA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 21 QW]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 23 MS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 10 GL]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 27 VC]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 22 SF]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 15 SH]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/ch1b 18 AS]]&lt;br /&gt;
&lt;br /&gt;
==Writing Assignment 2==&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1502 wwj]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2014/oss E1508 MRS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1504 IMV]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1505 xzl]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1509 lds]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1510 FLP]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1506 SYZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss S1504 AAC]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1507 DG]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss M1502 GVJ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss M1503 EDT]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1503 RSA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss E1501 YWS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015/oss S1501 OA]]&lt;br /&gt;
&lt;br /&gt;
==Final Project Design Document==&lt;br /&gt;
&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1526 MPRI]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 S1503 LWJZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 S1524 FSZZ]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 M1503 EDTS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1529 GLDS]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1525 TIAA]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2015 E1522 Visualization]]&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015/oss_E1510_FLP&amp;diff=95663</id>
		<title>CSC/ECE 517 Spring 2015/oss E1510 FLP</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015/oss_E1510_FLP&amp;diff=95663"/>
		<updated>2015-03-23T17:01:39Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* _assignment_actions.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Fix Instructor Login Performance Issue &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities.&amp;lt;ref&amp;gt;[https://github.com/expertiza/expertiza Expertiza on GitHub]&amp;lt;/ref&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
Currently when an Instructor logs into Expertiza,there a lot of select* from assignments queries being fired on database which would have an adverse effect on performance. We analyzed the source of this issue and made some changes, which reduced the number of select queries executed. The performance is high improved.&lt;br /&gt;
The mission involved is tracing the source of the issue and modify the code to fix the issue.&lt;br /&gt;
&lt;br /&gt;
===Performance issue before modification===&lt;br /&gt;
Before we made the improvement, each time an instructore logs into the Expertiza, there would be several database queries, which are more than needed and take it longer to render the view. Below is the console outputs when an instructor logs in.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Assignment Load (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/_row_header.html.erb (17.4ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Assignment Load (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_shared_actions.html.erb (2.6ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  SignUpTopic Load (0.1ms)  SELECT  `sign_up_topics`.* FROM `sign_up_topics`  WHERE (assignment_id = 1)  ORDER BY `sign_up_topics`.`id` ASC LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_assignments_actions.html.erb (8.8ms)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
we can see that there are 7 assignment queries after load &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt;, 3 assignment queries after load &amp;lt;code&amp;gt;_shared_actions.html.erb&amp;lt;/code&amp;gt;, 3 assignment queries after load &amp;lt;code&amp;gt;_assignments_actions&amp;lt;/code&amp;gt;. All these have an adverse effect on the performance.&lt;br /&gt;
&lt;br /&gt;
==Locate bug==&lt;br /&gt;
To locate the files that generate the bug, we use a Gem called QueryReviewer&amp;lt;ref&amp;gt;https://github.com/nesquena/query_reviewer&amp;lt;/ref&amp;gt; to help trace the datebase queries.&lt;br /&gt;
===Install query_reviewer===&lt;br /&gt;
Installing query_reviewer is simple. Just install it by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install query_reviewer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and add it to your &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;query_reviewer&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
QueryReviewer is an advanced SQL query analyzer&amp;lt;ref&amp;gt;https://github.com/nesquena/query_reviewer&amp;lt;/ref&amp;gt;. After installing and running this Gem on the Rails application, it would pop-up database query information on the webpage, as is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:QueryReviewer trace.png]]&lt;br /&gt;
&lt;br /&gt;
===Analyze code===&lt;br /&gt;
We log into Expertiza as an instructor with the QueryReviewer activate and watch the output of QueryReviewer. [figure *] shows the tracing result of the QueryReviewer and it tells us that we should pay more attention to the three files: assignment_node.rb, _row_header.html.erb and _entry.html.erb. &lt;br /&gt;
==== &amp;lt;code&amp;gt;_assignment_actions.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
In file &amp;lt;code&amp;gt;_assignment_actions.html.erb&amp;lt;/code&amp;gt;, we can find in 3 places use &amp;lt;code&amp;gt;Assignment.find(node.node_object_id)&amp;lt;/code&amp;gt;, which is actually a database query request.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1  &amp;lt;% owner_id = Object.const_get('Assignment').find(node.node_object_id).instructor_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
11 &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
52 &amp;lt;% if Assignment.find(node.node_object_id).course_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
In &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
26  &amp;lt;% if parent_node.get_name == 'Courses'&amp;amp;&amp;amp; session[:user].role_id == 6 %&amp;gt;&lt;br /&gt;
27  &amp;lt;%else%&amp;gt;&lt;br /&gt;
28    &amp;lt;%= parent_node.get_name %&amp;gt;&lt;br /&gt;
29    &amp;lt;% if parent_node.get_directory != nil%&amp;gt;&lt;br /&gt;
30      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Directory:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_directory %&amp;gt;&lt;br /&gt;
31    &amp;lt;% end %&amp;gt;&lt;br /&gt;
32    &amp;lt;% if parent_node.get_creation_date != nil %&amp;gt;&lt;br /&gt;
33      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Creation Date:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_creation_date %&amp;gt;&lt;br /&gt;
34    &amp;lt;% end %&amp;gt;&lt;br /&gt;
35    &amp;lt;% if parent_node.get_modified_date != nil %&amp;gt;&lt;br /&gt;
36      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Updated Date:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_modified_date %&amp;gt;&lt;br /&gt;
37    &amp;lt;% end %&amp;gt;&lt;br /&gt;
38  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
we can see in this view, &amp;lt;code&amp;gt;parent_node&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;AssignmentNode&amp;lt;/code&amp;gt; object, it execute:&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_name&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_directory&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_creation_date&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_modified_date&amp;lt;/code&amp;gt; method&lt;br /&gt;
However, in &amp;lt;code&amp;gt;assignment_node.rb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
6  class AssignmentNode &amp;lt; Node&lt;br /&gt;
   ...   &lt;br /&gt;
58   # Gets the name from the associated object&lt;br /&gt;
59   def get_name&lt;br /&gt;
60     Assignment.find(self.node_object_id).name&lt;br /&gt;
61   end&lt;br /&gt;
62 &lt;br /&gt;
63   # Gets the directory_path from the associated object&lt;br /&gt;
64   def get_directory&lt;br /&gt;
65     Assignment.find(self.node_object_id).directory_path&lt;br /&gt;
66   end&lt;br /&gt;
67 &lt;br /&gt;
68   # Gets the created_at from the associated object&lt;br /&gt;
69   def get_creation_date&lt;br /&gt;
70     Assignment.find(self.node_object_id).created_at&lt;br /&gt;
71   end&lt;br /&gt;
72&lt;br /&gt;
73   # Gets the updated_at from the associated object&lt;br /&gt;
74   def get_modified_date&lt;br /&gt;
75     Assignment.find(self.node_object_id).updated_at&lt;br /&gt;
76   end&lt;br /&gt;
   ...&lt;br /&gt;
82 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We find all these method called &amp;lt;code&amp;gt;Assignment.find(self.node_object_id)&amp;lt;/code&amp;gt; method, which is actually a database query request. These 'find's are actually redundant for a specific Assignment instance. So we will figure out a way to eliminate those redundant method calls.&lt;br /&gt;
&lt;br /&gt;
==Modifications==&lt;br /&gt;
&lt;br /&gt;
===_assignment_actions.html.erb===&lt;br /&gt;
An instance variable @assignment is used here instead of multiple times of calling .find method, thus reducing database queries.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
- &amp;lt;% owner_id = Object.const_get('Assignment').find(node.node_object_id).instructor_id %&amp;gt;&lt;br /&gt;
+ &amp;lt;% owner_id = @assignment.instructor_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
- &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
- &amp;lt;% if Assignment.find(node.node_object_id).course_id %&amp;gt;&lt;br /&gt;
+ &amp;lt;% if @assignment.course_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===assignment_node.rb===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class AssignmentNode &amp;lt; Node&lt;br /&gt;
# Gets the name from the associated object&lt;br /&gt;
  def get_name&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the directory_path from the associated object&lt;br /&gt;
  def get_directory&lt;br /&gt;
    #Assignment.find(self.node_object_id).directory_path&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.directory_path&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the created_at from the associated object&lt;br /&gt;
  def get_creation_date&lt;br /&gt;
    #Assignment.find(self.node_object_id).created_at&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.created_at&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the updated_at from the associated object&lt;br /&gt;
  def get_modified_date&lt;br /&gt;
    #Assignment.find(self.node_object_id).updated_at&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
   	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.updated_at&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Performance Improvment==&lt;br /&gt;
Originally there are 13 queries after loading these related pages, and now there are only 5 of them, as can been seen from the console output result below. Thus the performance is improved and the total rendering time consumption is reduced.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Assignment Load (1.7ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  Rendered tree_display/_row_header.html.erb (3.0ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Assignment Load (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_shared_actions.html.erb (4.0ms)&lt;br /&gt;
&lt;br /&gt;
  SignUpTopic Load (0.1ms)  SELECT  `sign_up_topics`.* FROM `sign_up_topics`  WHERE (assignment_id = 1)  ORDER BY `sign_up_topics`.`id` ASC LIMIT 1&lt;br /&gt;
  Rendered tree_display/actions/_assignments_actions.html.erb (11.9ms)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015/oss_E1510_FLP&amp;diff=95662</id>
		<title>CSC/ECE 517 Spring 2015/oss E1510 FLP</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015/oss_E1510_FLP&amp;diff=95662"/>
		<updated>2015-03-23T17:00:08Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Install query_reviewer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Fix Instructor Login Performance Issue &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities.&amp;lt;ref&amp;gt;[https://github.com/expertiza/expertiza Expertiza on GitHub]&amp;lt;/ref&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
Currently when an Instructor logs into Expertiza,there a lot of select* from assignments queries being fired on database which would have an adverse effect on performance. We analyzed the source of this issue and made some changes, which reduced the number of select queries executed. The performance is high improved.&lt;br /&gt;
The mission involved is tracing the source of the issue and modify the code to fix the issue.&lt;br /&gt;
&lt;br /&gt;
===Performance issue before modification===&lt;br /&gt;
Before we made the improvement, each time an instructore logs into the Expertiza, there would be several database queries, which are more than needed and take it longer to render the view. Below is the console outputs when an instructor logs in.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Assignment Load (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/_row_header.html.erb (17.4ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Assignment Load (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_shared_actions.html.erb (2.6ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  SignUpTopic Load (0.1ms)  SELECT  `sign_up_topics`.* FROM `sign_up_topics`  WHERE (assignment_id = 1)  ORDER BY `sign_up_topics`.`id` ASC LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_assignments_actions.html.erb (8.8ms)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
we can see that there are 7 assignment queries after load &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt;, 3 assignment queries after load &amp;lt;code&amp;gt;_shared_actions.html.erb&amp;lt;/code&amp;gt;, 3 assignment queries after load &amp;lt;code&amp;gt;_assignments_actions&amp;lt;/code&amp;gt;. All these have an adverse effect on the performance.&lt;br /&gt;
&lt;br /&gt;
==Locate bug==&lt;br /&gt;
To locate the files that generate the bug, we use a Gem called QueryReviewer&amp;lt;ref&amp;gt;https://github.com/nesquena/query_reviewer&amp;lt;/ref&amp;gt; to help trace the datebase queries.&lt;br /&gt;
===Install query_reviewer===&lt;br /&gt;
Installing query_reviewer is simple. Just install it by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem install query_reviewer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and add it to your &amp;lt;code&amp;gt;Gemfile&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gem &amp;quot;query_reviewer&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
QueryReviewer is an advanced SQL query analyzer&amp;lt;ref&amp;gt;https://github.com/nesquena/query_reviewer&amp;lt;/ref&amp;gt;. After installing and running this Gem on the Rails application, it would pop-up database query information on the webpage, as is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:QueryReviewer trace.png]]&lt;br /&gt;
&lt;br /&gt;
===Analyze code===&lt;br /&gt;
We log into Expertiza as an instructor with the QueryReviewer activate and watch the output of QueryReviewer. [figure *] shows the tracing result of the QueryReviewer and it tells us that we should pay more attention to the three files: assignment_node.rb, _row_header.html.erb and _entry.html.erb. &lt;br /&gt;
==== &amp;lt;code&amp;gt;_assignment_actions.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
In file &amp;lt;code&amp;gt;_assignment_actions.html.erb&amp;lt;/code&amp;gt;, we can find in 3 places use &amp;lt;code&amp;gt;Assignment.find(node.node_object_id)&amp;lt;/code&amp;gt;, which is actually a database query request.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1  &amp;lt;% owner_id = Object.const_get('Assignment').find(node.node_object_id).instructor_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
11 &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
52 &amp;lt;% if Assignment.find(node.node_object_id).course_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
In &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
26  &amp;lt;% if parent_node.get_name == 'Courses'&amp;amp;&amp;amp; session[:user].role_id == 6 %&amp;gt;&lt;br /&gt;
27  &amp;lt;%else%&amp;gt;&lt;br /&gt;
28    &amp;lt;%= parent_node.get_name %&amp;gt;&lt;br /&gt;
29    &amp;lt;% if parent_node.get_directory != nil%&amp;gt;&lt;br /&gt;
30      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Directory:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_directory %&amp;gt;&lt;br /&gt;
31    &amp;lt;% end %&amp;gt;&lt;br /&gt;
32    &amp;lt;% if parent_node.get_creation_date != nil %&amp;gt;&lt;br /&gt;
33      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Creation Date:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_creation_date %&amp;gt;&lt;br /&gt;
34    &amp;lt;% end %&amp;gt;&lt;br /&gt;
35    &amp;lt;% if parent_node.get_modified_date != nil %&amp;gt;&lt;br /&gt;
36      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Updated Date:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_modified_date %&amp;gt;&lt;br /&gt;
37    &amp;lt;% end %&amp;gt;&lt;br /&gt;
38  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
we can see in this view, &amp;lt;code&amp;gt;parent_node&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;AssignmentNode&amp;lt;/code&amp;gt; object, it execute:&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_name&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_directory&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_creation_date&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_modified_date&amp;lt;/code&amp;gt; method&lt;br /&gt;
However, in &amp;lt;code&amp;gt;assignment_node.rb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
6  class AssignmentNode &amp;lt; Node&lt;br /&gt;
   ...   &lt;br /&gt;
58   # Gets the name from the associated object&lt;br /&gt;
59   def get_name&lt;br /&gt;
60     Assignment.find(self.node_object_id).name&lt;br /&gt;
61   end&lt;br /&gt;
62 &lt;br /&gt;
63   # Gets the directory_path from the associated object&lt;br /&gt;
64   def get_directory&lt;br /&gt;
65     Assignment.find(self.node_object_id).directory_path&lt;br /&gt;
66   end&lt;br /&gt;
67 &lt;br /&gt;
68   # Gets the created_at from the associated object&lt;br /&gt;
69   def get_creation_date&lt;br /&gt;
70     Assignment.find(self.node_object_id).created_at&lt;br /&gt;
71   end&lt;br /&gt;
72&lt;br /&gt;
73   # Gets the updated_at from the associated object&lt;br /&gt;
74   def get_modified_date&lt;br /&gt;
75     Assignment.find(self.node_object_id).updated_at&lt;br /&gt;
76   end&lt;br /&gt;
   ...&lt;br /&gt;
82 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We find all these method called &amp;lt;code&amp;gt;Assignment.find(self.node_object_id)&amp;lt;/code&amp;gt; method, which is actually a database query request. These 'find's are actually redundant for a specific Assignment instance. So we will figure out a way to eliminate those redundant method calls.&lt;br /&gt;
&lt;br /&gt;
==Modifications==&lt;br /&gt;
&lt;br /&gt;
===_assignment_actions.html.erb===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
- &amp;lt;% owner_id = Object.const_get('Assignment').find(node.node_object_id).instructor_id %&amp;gt;&lt;br /&gt;
+ &amp;lt;% owner_id = @assignment.instructor_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
- &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
- &amp;lt;% if Assignment.find(node.node_object_id).course_id %&amp;gt;&lt;br /&gt;
+ &amp;lt;% if @assignment.course_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===assignment_node.rb===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class AssignmentNode &amp;lt; Node&lt;br /&gt;
# Gets the name from the associated object&lt;br /&gt;
  def get_name&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the directory_path from the associated object&lt;br /&gt;
  def get_directory&lt;br /&gt;
    #Assignment.find(self.node_object_id).directory_path&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.directory_path&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the created_at from the associated object&lt;br /&gt;
  def get_creation_date&lt;br /&gt;
    #Assignment.find(self.node_object_id).created_at&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.created_at&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the updated_at from the associated object&lt;br /&gt;
  def get_modified_date&lt;br /&gt;
    #Assignment.find(self.node_object_id).updated_at&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
   	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.updated_at&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Performance Improvment==&lt;br /&gt;
Originally there are 13 queries after loading these related pages, and now there are only 5 of them, as can been seen from the console output result below. Thus the performance is improved and the total rendering time consumption is reduced.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Assignment Load (1.7ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  Rendered tree_display/_row_header.html.erb (3.0ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Assignment Load (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_shared_actions.html.erb (4.0ms)&lt;br /&gt;
&lt;br /&gt;
  SignUpTopic Load (0.1ms)  SELECT  `sign_up_topics`.* FROM `sign_up_topics`  WHERE (assignment_id = 1)  ORDER BY `sign_up_topics`.`id` ASC LIMIT 1&lt;br /&gt;
  Rendered tree_display/actions/_assignments_actions.html.erb (11.9ms)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015/oss_E1510_FLP&amp;diff=95660</id>
		<title>CSC/ECE 517 Spring 2015/oss E1510 FLP</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015/oss_E1510_FLP&amp;diff=95660"/>
		<updated>2015-03-23T16:55:34Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Performance Improvment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Fix Instructor Login Performance Issue &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities.&amp;lt;ref&amp;gt;[https://github.com/expertiza/expertiza Expertiza on GitHub]&amp;lt;/ref&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
Currently when an Instructor logs into Expertiza,there a lot of select* from assignments queries being fired on database which would have an adverse effect on performance. We analyzed the source of this issue and made some changes, which reduced the number of select queries executed. The performance is high improved.&lt;br /&gt;
The mission involved is tracing the source of the issue and modify the code to fix the issue.&lt;br /&gt;
&lt;br /&gt;
===Performance issue before modification===&lt;br /&gt;
Before we made the improvement, each time an instructore logs into the Expertiza, there would be several database queries, which are more than needed and take it longer to render the view. Below is the console outputs when an instructor logs in.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Assignment Load (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/_row_header.html.erb (17.4ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Assignment Load (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_shared_actions.html.erb (2.6ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  SignUpTopic Load (0.1ms)  SELECT  `sign_up_topics`.* FROM `sign_up_topics`  WHERE (assignment_id = 1)  ORDER BY `sign_up_topics`.`id` ASC LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_assignments_actions.html.erb (8.8ms)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
we can see that there are 7 assignment queries after load &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt;, 3 assignment queries after load &amp;lt;code&amp;gt;_shared_actions.html.erb&amp;lt;/code&amp;gt;, 3 assignment queries after load &amp;lt;code&amp;gt;_assignments_actions&amp;lt;/code&amp;gt;. All these have an adverse effect on the performance.&lt;br /&gt;
&lt;br /&gt;
==Locate bug==&lt;br /&gt;
To locate the files that generate the bug, we use a Gem called QueryReviewer&amp;lt;ref&amp;gt;https://github.com/nesquena/query_reviewer&amp;lt;/ref&amp;gt; to help trace the datebase queries.&lt;br /&gt;
===Install query_reviewer===&lt;br /&gt;
QueryReviewer is an advanced SQL query analyzer&amp;lt;ref&amp;gt;https://github.com/nesquena/query_reviewer&amp;lt;/ref&amp;gt;. After installing and running this Gem on the Rails application, it would pop-up database query information on the webpage, as is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:QueryReviewer trace.png]]&lt;br /&gt;
&lt;br /&gt;
===Analyze code===&lt;br /&gt;
We log into Expertiza as an instructor with the QueryReviewer activate and watch the output of QueryReviewer. [figure *] shows the tracing result of the QueryReviewer and it tells us that we should pay more attention to the three files: assignment_node.rb, _row_header.html.erb and _entry.html.erb. &lt;br /&gt;
==== &amp;lt;code&amp;gt;_assignment_actions.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
In file &amp;lt;code&amp;gt;_assignment_actions.html.erb&amp;lt;/code&amp;gt;, we can find in 3 places use &amp;lt;code&amp;gt;Assignment.find(node.node_object_id)&amp;lt;/code&amp;gt;, which is actually a database query request.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1  &amp;lt;% owner_id = Object.const_get('Assignment').find(node.node_object_id).instructor_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
11 &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
52 &amp;lt;% if Assignment.find(node.node_object_id).course_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
In &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
26  &amp;lt;% if parent_node.get_name == 'Courses'&amp;amp;&amp;amp; session[:user].role_id == 6 %&amp;gt;&lt;br /&gt;
27  &amp;lt;%else%&amp;gt;&lt;br /&gt;
28    &amp;lt;%= parent_node.get_name %&amp;gt;&lt;br /&gt;
29    &amp;lt;% if parent_node.get_directory != nil%&amp;gt;&lt;br /&gt;
30      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Directory:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_directory %&amp;gt;&lt;br /&gt;
31    &amp;lt;% end %&amp;gt;&lt;br /&gt;
32    &amp;lt;% if parent_node.get_creation_date != nil %&amp;gt;&lt;br /&gt;
33      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Creation Date:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_creation_date %&amp;gt;&lt;br /&gt;
34    &amp;lt;% end %&amp;gt;&lt;br /&gt;
35    &amp;lt;% if parent_node.get_modified_date != nil %&amp;gt;&lt;br /&gt;
36      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Updated Date:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_modified_date %&amp;gt;&lt;br /&gt;
37    &amp;lt;% end %&amp;gt;&lt;br /&gt;
38  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
we can see in this view, &amp;lt;code&amp;gt;parent_node&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;AssignmentNode&amp;lt;/code&amp;gt; object, it execute:&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_name&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_directory&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_creation_date&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_modified_date&amp;lt;/code&amp;gt; method&lt;br /&gt;
However, in &amp;lt;code&amp;gt;assignment_node.rb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
6  class AssignmentNode &amp;lt; Node&lt;br /&gt;
   ...   &lt;br /&gt;
58   # Gets the name from the associated object&lt;br /&gt;
59   def get_name&lt;br /&gt;
60     Assignment.find(self.node_object_id).name&lt;br /&gt;
61   end&lt;br /&gt;
62 &lt;br /&gt;
63   # Gets the directory_path from the associated object&lt;br /&gt;
64   def get_directory&lt;br /&gt;
65     Assignment.find(self.node_object_id).directory_path&lt;br /&gt;
66   end&lt;br /&gt;
67 &lt;br /&gt;
68   # Gets the created_at from the associated object&lt;br /&gt;
69   def get_creation_date&lt;br /&gt;
70     Assignment.find(self.node_object_id).created_at&lt;br /&gt;
71   end&lt;br /&gt;
72&lt;br /&gt;
73   # Gets the updated_at from the associated object&lt;br /&gt;
74   def get_modified_date&lt;br /&gt;
75     Assignment.find(self.node_object_id).updated_at&lt;br /&gt;
76   end&lt;br /&gt;
   ...&lt;br /&gt;
82 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We find all these method called &amp;lt;code&amp;gt;Assignment.find(self.node_object_id)&amp;lt;/code&amp;gt; method, which is actually a database query request. These 'find's are actually redundant for a specific Assignment instance. So we will figure out a way to eliminate those redundant method calls.&lt;br /&gt;
&lt;br /&gt;
==Modifications==&lt;br /&gt;
&lt;br /&gt;
===_assignment_actions.html.erb===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
- &amp;lt;% owner_id = Object.const_get('Assignment').find(node.node_object_id).instructor_id %&amp;gt;&lt;br /&gt;
+ &amp;lt;% owner_id = @assignment.instructor_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
- &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
- &amp;lt;% if Assignment.find(node.node_object_id).course_id %&amp;gt;&lt;br /&gt;
+ &amp;lt;% if @assignment.course_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===assignment_node.rb===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class AssignmentNode &amp;lt; Node&lt;br /&gt;
# Gets the name from the associated object&lt;br /&gt;
  def get_name&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the directory_path from the associated object&lt;br /&gt;
  def get_directory&lt;br /&gt;
    #Assignment.find(self.node_object_id).directory_path&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.directory_path&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the created_at from the associated object&lt;br /&gt;
  def get_creation_date&lt;br /&gt;
    #Assignment.find(self.node_object_id).created_at&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.created_at&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the updated_at from the associated object&lt;br /&gt;
  def get_modified_date&lt;br /&gt;
    #Assignment.find(self.node_object_id).updated_at&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
   	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.updated_at&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Performance Improvment==&lt;br /&gt;
Originally there are 13 queries after loading these related pages, and now there are only 5 of them, as can been seen from the console output result below. Thus the performance is improved and the total rendering time consumption is reduced.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Assignment Load (1.7ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  Rendered tree_display/_row_header.html.erb (3.0ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Assignment Load (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_shared_actions.html.erb (4.0ms)&lt;br /&gt;
&lt;br /&gt;
  SignUpTopic Load (0.1ms)  SELECT  `sign_up_topics`.* FROM `sign_up_topics`  WHERE (assignment_id = 1)  ORDER BY `sign_up_topics`.`id` ASC LIMIT 1&lt;br /&gt;
  Rendered tree_display/actions/_assignments_actions.html.erb (11.9ms)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015/oss_E1510_FLP&amp;diff=95659</id>
		<title>CSC/ECE 517 Spring 2015/oss E1510 FLP</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015/oss_E1510_FLP&amp;diff=95659"/>
		<updated>2015-03-23T16:54:47Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Performance Improvment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Fix Instructor Login Performance Issue &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities.&amp;lt;ref&amp;gt;[https://github.com/expertiza/expertiza Expertiza on GitHub]&amp;lt;/ref&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
Currently when an Instructor logs into Expertiza,there a lot of select* from assignments queries being fired on database which would have an adverse effect on performance. We analyzed the source of this issue and made some changes, which reduced the number of select queries executed. The performance is high improved.&lt;br /&gt;
The mission involved is tracing the source of the issue and modify the code to fix the issue.&lt;br /&gt;
&lt;br /&gt;
===Performance issue before modification===&lt;br /&gt;
Before we made the improvement, each time an instructore logs into the Expertiza, there would be several database queries, which are more than needed and take it longer to render the view. Below is the console outputs when an instructor logs in.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Assignment Load (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/_row_header.html.erb (17.4ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Assignment Load (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_shared_actions.html.erb (2.6ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  SignUpTopic Load (0.1ms)  SELECT  `sign_up_topics`.* FROM `sign_up_topics`  WHERE (assignment_id = 1)  ORDER BY `sign_up_topics`.`id` ASC LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_assignments_actions.html.erb (8.8ms)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
we can see that there are 7 assignment queries after load &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt;, 3 assignment queries after load &amp;lt;code&amp;gt;_shared_actions.html.erb&amp;lt;/code&amp;gt;, 3 assignment queries after load &amp;lt;code&amp;gt;_assignments_actions&amp;lt;/code&amp;gt;. All these have an adverse effect on the performance.&lt;br /&gt;
&lt;br /&gt;
==Locate bug==&lt;br /&gt;
To locate the files that generate the bug, we use a Gem called QueryReviewer&amp;lt;ref&amp;gt;https://github.com/nesquena/query_reviewer&amp;lt;/ref&amp;gt; to help trace the datebase queries.&lt;br /&gt;
===Install query_reviewer===&lt;br /&gt;
QueryReviewer is an advanced SQL query analyzer&amp;lt;ref&amp;gt;https://github.com/nesquena/query_reviewer&amp;lt;/ref&amp;gt;. After installing and running this Gem on the Rails application, it would pop-up database query information on the webpage, as is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:QueryReviewer trace.png]]&lt;br /&gt;
&lt;br /&gt;
===Analyze code===&lt;br /&gt;
We log into Expertiza as an instructor with the QueryReviewer activate and watch the output of QueryReviewer. [figure *] shows the tracing result of the QueryReviewer and it tells us that we should pay more attention to the three files: assignment_node.rb, _row_header.html.erb and _entry.html.erb. &lt;br /&gt;
==== &amp;lt;code&amp;gt;_assignment_actions.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
In file &amp;lt;code&amp;gt;_assignment_actions.html.erb&amp;lt;/code&amp;gt;, we can find in 3 places use &amp;lt;code&amp;gt;Assignment.find(node.node_object_id)&amp;lt;/code&amp;gt;, which is actually a database query request.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1  &amp;lt;% owner_id = Object.const_get('Assignment').find(node.node_object_id).instructor_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
11 &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
52 &amp;lt;% if Assignment.find(node.node_object_id).course_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
In &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
26  &amp;lt;% if parent_node.get_name == 'Courses'&amp;amp;&amp;amp; session[:user].role_id == 6 %&amp;gt;&lt;br /&gt;
27  &amp;lt;%else%&amp;gt;&lt;br /&gt;
28    &amp;lt;%= parent_node.get_name %&amp;gt;&lt;br /&gt;
29    &amp;lt;% if parent_node.get_directory != nil%&amp;gt;&lt;br /&gt;
30      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Directory:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_directory %&amp;gt;&lt;br /&gt;
31    &amp;lt;% end %&amp;gt;&lt;br /&gt;
32    &amp;lt;% if parent_node.get_creation_date != nil %&amp;gt;&lt;br /&gt;
33      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Creation Date:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_creation_date %&amp;gt;&lt;br /&gt;
34    &amp;lt;% end %&amp;gt;&lt;br /&gt;
35    &amp;lt;% if parent_node.get_modified_date != nil %&amp;gt;&lt;br /&gt;
36      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Updated Date:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_modified_date %&amp;gt;&lt;br /&gt;
37    &amp;lt;% end %&amp;gt;&lt;br /&gt;
38  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
we can see in this view, &amp;lt;code&amp;gt;parent_node&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;AssignmentNode&amp;lt;/code&amp;gt; object, it execute:&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_name&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_directory&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_creation_date&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_modified_date&amp;lt;/code&amp;gt; method&lt;br /&gt;
However, in &amp;lt;code&amp;gt;assignment_node.rb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
6  class AssignmentNode &amp;lt; Node&lt;br /&gt;
   ...   &lt;br /&gt;
58   # Gets the name from the associated object&lt;br /&gt;
59   def get_name&lt;br /&gt;
60     Assignment.find(self.node_object_id).name&lt;br /&gt;
61   end&lt;br /&gt;
62 &lt;br /&gt;
63   # Gets the directory_path from the associated object&lt;br /&gt;
64   def get_directory&lt;br /&gt;
65     Assignment.find(self.node_object_id).directory_path&lt;br /&gt;
66   end&lt;br /&gt;
67 &lt;br /&gt;
68   # Gets the created_at from the associated object&lt;br /&gt;
69   def get_creation_date&lt;br /&gt;
70     Assignment.find(self.node_object_id).created_at&lt;br /&gt;
71   end&lt;br /&gt;
72&lt;br /&gt;
73   # Gets the updated_at from the associated object&lt;br /&gt;
74   def get_modified_date&lt;br /&gt;
75     Assignment.find(self.node_object_id).updated_at&lt;br /&gt;
76   end&lt;br /&gt;
   ...&lt;br /&gt;
82 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We find all these method called &amp;lt;code&amp;gt;Assignment.find(self.node_object_id)&amp;lt;/code&amp;gt; method, which is actually a database query request. These 'find's are actually redundant for a specific Assignment instance. So we will figure out a way to eliminate those redundant method calls.&lt;br /&gt;
&lt;br /&gt;
==Modifications==&lt;br /&gt;
&lt;br /&gt;
===_assignment_actions.html.erb===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
- &amp;lt;% owner_id = Object.const_get('Assignment').find(node.node_object_id).instructor_id %&amp;gt;&lt;br /&gt;
+ &amp;lt;% owner_id = @assignment.instructor_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
- &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
- &amp;lt;% if Assignment.find(node.node_object_id).course_id %&amp;gt;&lt;br /&gt;
+ &amp;lt;% if @assignment.course_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===assignment_node.rb===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class AssignmentNode &amp;lt; Node&lt;br /&gt;
# Gets the name from the associated object&lt;br /&gt;
  def get_name&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the directory_path from the associated object&lt;br /&gt;
  def get_directory&lt;br /&gt;
    #Assignment.find(self.node_object_id).directory_path&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.directory_path&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the created_at from the associated object&lt;br /&gt;
  def get_creation_date&lt;br /&gt;
    #Assignment.find(self.node_object_id).created_at&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.created_at&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the updated_at from the associated object&lt;br /&gt;
  def get_modified_date&lt;br /&gt;
    #Assignment.find(self.node_object_id).updated_at&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
   	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.updated_at&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Performance Improvment==&lt;br /&gt;
Originally there are 13 queries after loading these related pages, and now there are only 5 of them, as can been seen from the console output result below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Assignment Load (1.7ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  Rendered tree_display/_row_header.html.erb (3.0ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Assignment Load (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_shared_actions.html.erb (4.0ms)&lt;br /&gt;
&lt;br /&gt;
  SignUpTopic Load (0.1ms)  SELECT  `sign_up_topics`.* FROM `sign_up_topics`  WHERE (assignment_id = 1)  ORDER BY `sign_up_topics`.`id` ASC LIMIT 1&lt;br /&gt;
  Rendered tree_display/actions/_assignments_actions.html.erb (11.9ms)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015/oss_E1510_FLP&amp;diff=95658</id>
		<title>CSC/ECE 517 Spring 2015/oss E1510 FLP</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015/oss_E1510_FLP&amp;diff=95658"/>
		<updated>2015-03-23T16:50:43Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* _row_header.html.erb and assignment_node.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Fix Instructor Login Performance Issue &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities.&amp;lt;ref&amp;gt;[https://github.com/expertiza/expertiza Expertiza on GitHub]&amp;lt;/ref&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
Currently when an Instructor logs into Expertiza,there a lot of select* from assignments queries being fired on database which would have an adverse effect on performance. We analyzed the source of this issue and made some changes, which reduced the number of select queries executed. The performance is high improved.&lt;br /&gt;
The mission involved is tracing the source of the issue and modify the code to fix the issue.&lt;br /&gt;
&lt;br /&gt;
===Performance issue before modification===&lt;br /&gt;
Before we made the improvement, each time an instructore logs into the Expertiza, there would be several database queries, which are more than needed and take it longer to render the view. Below is the console outputs when an instructor logs in.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Assignment Load (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/_row_header.html.erb (17.4ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Assignment Load (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_shared_actions.html.erb (2.6ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  SignUpTopic Load (0.1ms)  SELECT  `sign_up_topics`.* FROM `sign_up_topics`  WHERE (assignment_id = 1)  ORDER BY `sign_up_topics`.`id` ASC LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_assignments_actions.html.erb (8.8ms)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
we can see that there are 7 assignment queries after load &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt;, 3 assignment queries after load &amp;lt;code&amp;gt;_shared_actions.html.erb&amp;lt;/code&amp;gt;, 3 assignment queries after load &amp;lt;code&amp;gt;_assignments_actions&amp;lt;/code&amp;gt;. All these have an adverse effect on the performance.&lt;br /&gt;
&lt;br /&gt;
==Locate bug==&lt;br /&gt;
To locate the files that generate the bug, we use a Gem called QueryReviewer&amp;lt;ref&amp;gt;https://github.com/nesquena/query_reviewer&amp;lt;/ref&amp;gt; to help trace the datebase queries.&lt;br /&gt;
===Install query_reviewer===&lt;br /&gt;
QueryReviewer is an advanced SQL query analyzer&amp;lt;ref&amp;gt;https://github.com/nesquena/query_reviewer&amp;lt;/ref&amp;gt;. After installing and running this Gem on the Rails application, it would pop-up database query information on the webpage, as is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:QueryReviewer trace.png]]&lt;br /&gt;
&lt;br /&gt;
===Analyze code===&lt;br /&gt;
We log into Expertiza as an instructor with the QueryReviewer activate and watch the output of QueryReviewer. [figure *] shows the tracing result of the QueryReviewer and it tells us that we should pay more attention to the three files: assignment_node.rb, _row_header.html.erb and _entry.html.erb. &lt;br /&gt;
==== &amp;lt;code&amp;gt;_assignment_actions.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
In file &amp;lt;code&amp;gt;_assignment_actions.html.erb&amp;lt;/code&amp;gt;, we can find in 3 places use &amp;lt;code&amp;gt;Assignment.find(node.node_object_id)&amp;lt;/code&amp;gt;, which is actually a database query request.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1  &amp;lt;% owner_id = Object.const_get('Assignment').find(node.node_object_id).instructor_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
11 &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
52 &amp;lt;% if Assignment.find(node.node_object_id).course_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
In &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
26  &amp;lt;% if parent_node.get_name == 'Courses'&amp;amp;&amp;amp; session[:user].role_id == 6 %&amp;gt;&lt;br /&gt;
27  &amp;lt;%else%&amp;gt;&lt;br /&gt;
28    &amp;lt;%= parent_node.get_name %&amp;gt;&lt;br /&gt;
29    &amp;lt;% if parent_node.get_directory != nil%&amp;gt;&lt;br /&gt;
30      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Directory:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_directory %&amp;gt;&lt;br /&gt;
31    &amp;lt;% end %&amp;gt;&lt;br /&gt;
32    &amp;lt;% if parent_node.get_creation_date != nil %&amp;gt;&lt;br /&gt;
33      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Creation Date:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_creation_date %&amp;gt;&lt;br /&gt;
34    &amp;lt;% end %&amp;gt;&lt;br /&gt;
35    &amp;lt;% if parent_node.get_modified_date != nil %&amp;gt;&lt;br /&gt;
36      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Updated Date:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_modified_date %&amp;gt;&lt;br /&gt;
37    &amp;lt;% end %&amp;gt;&lt;br /&gt;
38  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
we can see in this view, &amp;lt;code&amp;gt;parent_node&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;AssignmentNode&amp;lt;/code&amp;gt; object, it execute:&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_name&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_directory&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_creation_date&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_modified_date&amp;lt;/code&amp;gt; method&lt;br /&gt;
However, in &amp;lt;code&amp;gt;assignment_node.rb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
6  class AssignmentNode &amp;lt; Node&lt;br /&gt;
   ...   &lt;br /&gt;
58   # Gets the name from the associated object&lt;br /&gt;
59   def get_name&lt;br /&gt;
60     Assignment.find(self.node_object_id).name&lt;br /&gt;
61   end&lt;br /&gt;
62 &lt;br /&gt;
63   # Gets the directory_path from the associated object&lt;br /&gt;
64   def get_directory&lt;br /&gt;
65     Assignment.find(self.node_object_id).directory_path&lt;br /&gt;
66   end&lt;br /&gt;
67 &lt;br /&gt;
68   # Gets the created_at from the associated object&lt;br /&gt;
69   def get_creation_date&lt;br /&gt;
70     Assignment.find(self.node_object_id).created_at&lt;br /&gt;
71   end&lt;br /&gt;
72&lt;br /&gt;
73   # Gets the updated_at from the associated object&lt;br /&gt;
74   def get_modified_date&lt;br /&gt;
75     Assignment.find(self.node_object_id).updated_at&lt;br /&gt;
76   end&lt;br /&gt;
   ...&lt;br /&gt;
82 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We find all these method called &amp;lt;code&amp;gt;Assignment.find(self.node_object_id)&amp;lt;/code&amp;gt; method, which is actually a database query request. These 'find's are actually redundant for a specific Assignment instance. So we will figure out a way to eliminate those redundant method calls.&lt;br /&gt;
&lt;br /&gt;
==Modifications==&lt;br /&gt;
&lt;br /&gt;
===_assignment_actions.html.erb===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
- &amp;lt;% owner_id = Object.const_get('Assignment').find(node.node_object_id).instructor_id %&amp;gt;&lt;br /&gt;
+ &amp;lt;% owner_id = @assignment.instructor_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
- &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
- &amp;lt;% if Assignment.find(node.node_object_id).course_id %&amp;gt;&lt;br /&gt;
+ &amp;lt;% if @assignment.course_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===assignment_node.rb===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class AssignmentNode &amp;lt; Node&lt;br /&gt;
# Gets the name from the associated object&lt;br /&gt;
  def get_name&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the directory_path from the associated object&lt;br /&gt;
  def get_directory&lt;br /&gt;
    #Assignment.find(self.node_object_id).directory_path&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.directory_path&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the created_at from the associated object&lt;br /&gt;
  def get_creation_date&lt;br /&gt;
    #Assignment.find(self.node_object_id).created_at&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.created_at&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the updated_at from the associated object&lt;br /&gt;
  def get_modified_date&lt;br /&gt;
    #Assignment.find(self.node_object_id).updated_at&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
   	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.updated_at&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Performance Improvment==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Assignment Load (1.7ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  Rendered tree_display/_row_header.html.erb (3.0ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Assignment Load (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_shared_actions.html.erb (4.0ms)&lt;br /&gt;
&lt;br /&gt;
  SignUpTopic Load (0.1ms)  SELECT  `sign_up_topics`.* FROM `sign_up_topics`  WHERE (assignment_id = 1)  ORDER BY `sign_up_topics`.`id` ASC LIMIT 1&lt;br /&gt;
  Rendered tree_display/actions/_assignments_actions.html.erb (11.9ms)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015/oss_E1510_FLP&amp;diff=95655</id>
		<title>CSC/ECE 517 Spring 2015/oss E1510 FLP</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015/oss_E1510_FLP&amp;diff=95655"/>
		<updated>2015-03-23T16:29:00Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Install query_reviewer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Fix Instructor Login Performance Issue &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities.&amp;lt;ref&amp;gt;[https://github.com/expertiza/expertiza Expertiza on GitHub]&amp;lt;/ref&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
Currently when an Instructor logs into Expertiza,there a lot of select* from assignments queries being fired on database which would have an adverse effect on performance. We analyzed the source of this issue and made some changes, which reduced the number of select queries executed. The performance is high improved.&lt;br /&gt;
The mission involved is tracing the source of the issue and modify the code to fix the issue.&lt;br /&gt;
&lt;br /&gt;
===Performance issue before modification===&lt;br /&gt;
Before we made the improvement, each time an instructore logs into the Expertiza, there would be several database queries, which are more than needed and take it longer to render the view. Below is the console outputs when an instructor logs in.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Assignment Load (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/_row_header.html.erb (17.4ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Assignment Load (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_shared_actions.html.erb (2.6ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  SignUpTopic Load (0.1ms)  SELECT  `sign_up_topics`.* FROM `sign_up_topics`  WHERE (assignment_id = 1)  ORDER BY `sign_up_topics`.`id` ASC LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_assignments_actions.html.erb (8.8ms)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
we can see that there are 7 assignment queries after load &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt;, 3 assignment queries after load &amp;lt;code&amp;gt;_shared_actions.html.erb&amp;lt;/code&amp;gt;, 3 assignment queries after load &amp;lt;code&amp;gt;_assignments_actions&amp;lt;/code&amp;gt;. All these have an adverse effect on the performance.&lt;br /&gt;
&lt;br /&gt;
==Locate bug==&lt;br /&gt;
To locate the files that generate the bug, we use a Gem called QueryReviewer&amp;lt;ref&amp;gt;https://github.com/nesquena/query_reviewer&amp;lt;/ref&amp;gt; to help trace the datebase queries.&lt;br /&gt;
===Install query_reviewer===&lt;br /&gt;
QueryReviewer is an advanced SQL query analyzer&amp;lt;ref&amp;gt;https://github.com/nesquena/query_reviewer&amp;lt;/ref&amp;gt;. After installing and running this Gem on the Rails application, it would pop-up database query information on the webpage, as is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:QueryReviewer trace.png]]&lt;br /&gt;
&lt;br /&gt;
===Analyze code===&lt;br /&gt;
We log into Expertiza as an instructor with the QueryReviewer activate and watch the output of QueryReviewer. [figure *] shows the tracing result of the QueryReviewer and it tells us that we should pay more attention to the three files: assignment_node.rb, _row_header.html.erb and _entry.html.erb. &lt;br /&gt;
==== &amp;lt;code&amp;gt;_assignment_actions.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
In file &amp;lt;code&amp;gt;_assignment_actions.html.erb&amp;lt;/code&amp;gt;, we can find in 3 places use &amp;lt;code&amp;gt;Assignment.find(node.node_object_id)&amp;lt;/code&amp;gt;, which is actually a database query request.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1  &amp;lt;% owner_id = Object.const_get('Assignment').find(node.node_object_id).instructor_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
11 &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
52 &amp;lt;% if Assignment.find(node.node_object_id).course_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
In &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
26  &amp;lt;% if parent_node.get_name == 'Courses'&amp;amp;&amp;amp; session[:user].role_id == 6 %&amp;gt;&lt;br /&gt;
27  &amp;lt;%else%&amp;gt;&lt;br /&gt;
28    &amp;lt;%= parent_node.get_name %&amp;gt;&lt;br /&gt;
29    &amp;lt;% if parent_node.get_directory != nil%&amp;gt;&lt;br /&gt;
30      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Directory:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_directory %&amp;gt;&lt;br /&gt;
31    &amp;lt;% end %&amp;gt;&lt;br /&gt;
32    &amp;lt;% if parent_node.get_creation_date != nil %&amp;gt;&lt;br /&gt;
33      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Creation Date:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_creation_date %&amp;gt;&lt;br /&gt;
34    &amp;lt;% end %&amp;gt;&lt;br /&gt;
35    &amp;lt;% if parent_node.get_modified_date != nil %&amp;gt;&lt;br /&gt;
36      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Updated Date:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_modified_date %&amp;gt;&lt;br /&gt;
37    &amp;lt;% end %&amp;gt;&lt;br /&gt;
38  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
we can see in this view, &amp;lt;code&amp;gt;parent_node&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;AssignmentNode&amp;lt;/code&amp;gt; object, it execute:&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_name&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_directory&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_creation_date&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_modified_date&amp;lt;/code&amp;gt; method&lt;br /&gt;
However, in &amp;lt;code&amp;gt;assignment_node.rb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
6  class AssignmentNode &amp;lt; Node&lt;br /&gt;
   ...   &lt;br /&gt;
58   # Gets the name from the associated object&lt;br /&gt;
59   def get_name&lt;br /&gt;
60     Assignment.find(self.node_object_id).name&lt;br /&gt;
61   end&lt;br /&gt;
62 &lt;br /&gt;
63   # Gets the directory_path from the associated object&lt;br /&gt;
64   def get_directory&lt;br /&gt;
65     Assignment.find(self.node_object_id).directory_path&lt;br /&gt;
66   end&lt;br /&gt;
67 &lt;br /&gt;
68   # Gets the created_at from the associated object&lt;br /&gt;
69   def get_creation_date&lt;br /&gt;
70     Assignment.find(self.node_object_id).created_at&lt;br /&gt;
71   end&lt;br /&gt;
72&lt;br /&gt;
73   # Gets the updated_at from the associated object&lt;br /&gt;
74   def get_modified_date&lt;br /&gt;
75     Assignment.find(self.node_object_id).updated_at&lt;br /&gt;
76   end&lt;br /&gt;
   ...&lt;br /&gt;
82 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We find all these method called &amp;lt;code&amp;gt;Assignment.find(self.node_object_id)&amp;lt;/code&amp;gt; method, which is actually a database query request.&lt;br /&gt;
&lt;br /&gt;
==Modifications==&lt;br /&gt;
&lt;br /&gt;
===_assignment_actions.html.erb===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
- &amp;lt;% owner_id = Object.const_get('Assignment').find(node.node_object_id).instructor_id %&amp;gt;&lt;br /&gt;
+ &amp;lt;% owner_id = @assignment.instructor_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
- &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
- &amp;lt;% if Assignment.find(node.node_object_id).course_id %&amp;gt;&lt;br /&gt;
+ &amp;lt;% if @assignment.course_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===assignment_node.rb===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class AssignmentNode &amp;lt; Node&lt;br /&gt;
# Gets the name from the associated object&lt;br /&gt;
  def get_name&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the directory_path from the associated object&lt;br /&gt;
  def get_directory&lt;br /&gt;
    #Assignment.find(self.node_object_id).directory_path&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.directory_path&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the created_at from the associated object&lt;br /&gt;
  def get_creation_date&lt;br /&gt;
    #Assignment.find(self.node_object_id).created_at&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.created_at&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the updated_at from the associated object&lt;br /&gt;
  def get_modified_date&lt;br /&gt;
    #Assignment.find(self.node_object_id).updated_at&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
   	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.updated_at&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Performance Improvment==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Assignment Load (1.7ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  Rendered tree_display/_row_header.html.erb (3.0ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Assignment Load (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_shared_actions.html.erb (4.0ms)&lt;br /&gt;
&lt;br /&gt;
  SignUpTopic Load (0.1ms)  SELECT  `sign_up_topics`.* FROM `sign_up_topics`  WHERE (assignment_id = 1)  ORDER BY `sign_up_topics`.`id` ASC LIMIT 1&lt;br /&gt;
  Rendered tree_display/actions/_assignments_actions.html.erb (11.9ms)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015/oss_E1510_FLP&amp;diff=95653</id>
		<title>CSC/ECE 517 Spring 2015/oss E1510 FLP</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2015/oss_E1510_FLP&amp;diff=95653"/>
		<updated>2015-03-23T16:26:24Z</updated>

		<summary type="html">&lt;p&gt;Zchen15: /* Install query_reviewer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;font size=&amp;quot;6&amp;quot;&amp;gt;&amp;lt;b&amp;gt; Expertiza - Fix Instructor Login Performance Issue &amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities.&amp;lt;ref&amp;gt;[https://github.com/expertiza/expertiza Expertiza on GitHub]&amp;lt;/ref&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
Currently when an Instructor logs into Expertiza,there a lot of select* from assignments queries being fired on database which would have an adverse effect on performance. We analyzed the source of this issue and made some changes, which reduced the number of select queries executed. The performance is high improved.&lt;br /&gt;
The mission involved is tracing the source of the issue and modify the code to fix the issue.&lt;br /&gt;
&lt;br /&gt;
===Performance issue before modification===&lt;br /&gt;
Before we made the improvement, each time an instructore logs into the Expertiza, there would be several database queries, which are more than needed and take it longer to render the view. Below is the console outputs when an instructor logs in.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Assignment Load (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/_row_header.html.erb (17.4ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Assignment Load (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_shared_actions.html.erb (2.6ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  SignUpTopic Load (0.1ms)  SELECT  `sign_up_topics`.* FROM `sign_up_topics`  WHERE (assignment_id = 1)  ORDER BY `sign_up_topics`.`id` ASC LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_assignments_actions.html.erb (8.8ms)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
we can see that there are 7 assignment queries after load &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt;, 3 assignment queries after load &amp;lt;code&amp;gt;_shared_actions.html.erb&amp;lt;/code&amp;gt;, 3 assignment queries after load &amp;lt;code&amp;gt;_assignments_actions&amp;lt;/code&amp;gt;. All these have an adverse effect on the performance.&lt;br /&gt;
&lt;br /&gt;
==Locate bug==&lt;br /&gt;
To locate the files that generate the bug, we use a Gem called QueryReviewer&amp;lt;ref&amp;gt;https://github.com/nesquena/query_reviewer&amp;lt;/ref&amp;gt; to help trace the datebase queries.&lt;br /&gt;
===Install query_reviewer===&lt;br /&gt;
QueryReviewer is an advanced SQL query analyzer&amp;lt;ref&amp;gt;https://github.com/nesquena/query_reviewer&amp;lt;/ref&amp;gt;. After installing and running this Gem on the Rails application, it would pop-up database query information on the webpage, as is shown below.&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt; [[ {{File:QueryReviewer trace.png?maxwidth=600 }}]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Analyze code===&lt;br /&gt;
We log into Expertiza as an instructor with the QueryReviewer activate and watch the output of QueryReviewer. [figure *] shows the tracing result of the QueryReviewer and it tells us that we should pay more attention to the three files: assignment_node.rb, _row_header.html.erb and _entry.html.erb. &lt;br /&gt;
==== &amp;lt;code&amp;gt;_assignment_actions.html.erb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
In file &amp;lt;code&amp;gt;_assignment_actions.html.erb&amp;lt;/code&amp;gt;, we can find in 3 places use &amp;lt;code&amp;gt;Assignment.find(node.node_object_id)&amp;lt;/code&amp;gt;, which is actually a database query request.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1  &amp;lt;% owner_id = Object.const_get('Assignment').find(node.node_object_id).instructor_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
11 &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
52 &amp;lt;% if Assignment.find(node.node_object_id).course_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_node.rb&amp;lt;/code&amp;gt; ====&lt;br /&gt;
In &amp;lt;code&amp;gt;_row_header.html.erb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
26  &amp;lt;% if parent_node.get_name == 'Courses'&amp;amp;&amp;amp; session[:user].role_id == 6 %&amp;gt;&lt;br /&gt;
27  &amp;lt;%else%&amp;gt;&lt;br /&gt;
28    &amp;lt;%= parent_node.get_name %&amp;gt;&lt;br /&gt;
29    &amp;lt;% if parent_node.get_directory != nil%&amp;gt;&lt;br /&gt;
30      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Directory:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_directory %&amp;gt;&lt;br /&gt;
31    &amp;lt;% end %&amp;gt;&lt;br /&gt;
32    &amp;lt;% if parent_node.get_creation_date != nil %&amp;gt;&lt;br /&gt;
33      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Creation Date:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_creation_date %&amp;gt;&lt;br /&gt;
34    &amp;lt;% end %&amp;gt;&lt;br /&gt;
35    &amp;lt;% if parent_node.get_modified_date != nil %&amp;gt;&lt;br /&gt;
36      &amp;lt;BR/&amp;gt;&amp;lt;I&amp;gt;Updated Date:&amp;lt;/I&amp;gt; &amp;lt;%= parent_node.get_modified_date %&amp;gt;&lt;br /&gt;
37    &amp;lt;% end %&amp;gt;&lt;br /&gt;
38  &amp;lt;%end%&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
we can see in this view, &amp;lt;code&amp;gt;parent_node&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;AssignmentNode&amp;lt;/code&amp;gt; object, it execute:&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_name&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_directory&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_creation_date&amp;lt;/code&amp;gt; method&lt;br /&gt;
* &amp;lt;code&amp;gt;parent_node.get_modified_date&amp;lt;/code&amp;gt; method&lt;br /&gt;
However, in &amp;lt;code&amp;gt;assignment_node.rb&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
6  class AssignmentNode &amp;lt; Node&lt;br /&gt;
   ...   &lt;br /&gt;
58   # Gets the name from the associated object&lt;br /&gt;
59   def get_name&lt;br /&gt;
60     Assignment.find(self.node_object_id).name&lt;br /&gt;
61   end&lt;br /&gt;
62 &lt;br /&gt;
63   # Gets the directory_path from the associated object&lt;br /&gt;
64   def get_directory&lt;br /&gt;
65     Assignment.find(self.node_object_id).directory_path&lt;br /&gt;
66   end&lt;br /&gt;
67 &lt;br /&gt;
68   # Gets the created_at from the associated object&lt;br /&gt;
69   def get_creation_date&lt;br /&gt;
70     Assignment.find(self.node_object_id).created_at&lt;br /&gt;
71   end&lt;br /&gt;
72&lt;br /&gt;
73   # Gets the updated_at from the associated object&lt;br /&gt;
74   def get_modified_date&lt;br /&gt;
75     Assignment.find(self.node_object_id).updated_at&lt;br /&gt;
76   end&lt;br /&gt;
   ...&lt;br /&gt;
82 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We find all these method called &amp;lt;code&amp;gt;Assignment.find(self.node_object_id)&amp;lt;/code&amp;gt; method, which is actually a database query request.&lt;br /&gt;
&lt;br /&gt;
==Modifications==&lt;br /&gt;
&lt;br /&gt;
===_assignment_actions.html.erb===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
+ &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
- &amp;lt;% owner_id = Object.const_get('Assignment').find(node.node_object_id).instructor_id %&amp;gt;&lt;br /&gt;
+ &amp;lt;% owner_id = @assignment.instructor_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
- &amp;lt;% @assignment = Assignment.find(node.node_object_id) %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
- &amp;lt;% if Assignment.find(node.node_object_id).course_id %&amp;gt;&lt;br /&gt;
+ &amp;lt;% if @assignment.course_id %&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===assignment_node.rb===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class AssignmentNode &amp;lt; Node&lt;br /&gt;
# Gets the name from the associated object&lt;br /&gt;
  def get_name&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the directory_path from the associated object&lt;br /&gt;
  def get_directory&lt;br /&gt;
    #Assignment.find(self.node_object_id).directory_path&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.directory_path&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the created_at from the associated object&lt;br /&gt;
  def get_creation_date&lt;br /&gt;
    #Assignment.find(self.node_object_id).created_at&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
    	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.created_at&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Gets the updated_at from the associated object&lt;br /&gt;
  def get_modified_date&lt;br /&gt;
    #Assignment.find(self.node_object_id).updated_at&lt;br /&gt;
    unless @assign_node&lt;br /&gt;
   	@assign_node = Assignment.find(self.node_object_id)&lt;br /&gt;
    end&lt;br /&gt;
    @assign_node.updated_at&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Performance Improvment==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Assignment Load (1.7ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  Rendered tree_display/_row_header.html.erb (3.0ms)&lt;br /&gt;
&lt;br /&gt;
  CACHE (0.1ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Assignment Load (0.2ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1&lt;br /&gt;
  CACHE (0.0ms)  SELECT  `assignments`.* FROM `assignments`  WHERE `assignments`.`id` = 1 LIMIT 1  [[&amp;quot;id&amp;quot;, 1]]&lt;br /&gt;
  Rendered tree_display/actions/_shared_actions.html.erb (4.0ms)&lt;br /&gt;
&lt;br /&gt;
  SignUpTopic Load (0.1ms)  SELECT  `sign_up_topics`.* FROM `sign_up_topics`  WHERE (assignment_id = 1)  ORDER BY `sign_up_topics`.`id` ASC LIMIT 1&lt;br /&gt;
  Rendered tree_display/actions/_assignments_actions.html.erb (11.9ms)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zchen15</name></author>
	</entry>
</feed>