MINI Sh3ll

Path : /var/www/html/tollfree-tracker/global_assets/js/demo_pages/charts/d3/vis/
File Upload :
Current File : //var/www/html/tollfree-tracker/global_assets/js/demo_pages/charts/d3/vis/integrateIndex.js

// Vue component define
var demo = new Vue({
  el: '#table',
  data: {
    people_count: 200,
    scatterCategory: ['issue1', 'issue2', 'issue3', 'issue4', 'issue5', 'issue6', 'issue7', 'issue8', 'issue9', 'issue10', 'issue11', 'issue12', 'issue13', 'issue14', 'issue15'],
    selectScaCate: ['issue1', 'issue2', 'issue4', 'issue5', 'issue9'],
    sensorDockerFunc: null
  },
  methods: {
    displayMem: function () {
      var data = [
        {time: '10:01', used: 200, extra: 500, total: 1000},
        {time: '10:02', used: 620, extra: 600, total: 1000},
        {time: '10:03', used: 300, extra: 800, total: 1000},
        {time: '10:04', used: 440, extra: 700, total: 1000},
        {time: '10:05', used: 900, extra: 700, total: 1000},
        {time: '10:06', used: 300, extra: 700, total: 1000},
        {time: '10:07', used: 50, extra: 700, total: 1000},
        {time: '10:08', used: 350, extra: 700, total: 1000},
        {time: '10:09', used: 750, extra: 700, total: 1000}
      ];

      var category = ['used'];

      var hAxis = 10, mAxis = 10;

      //generation function
      function generate(data, id, axisNum) {
        var margin = {top: 20, right: 18, bottom: 35, left: 28},
            width = $(id).width() - margin.left - margin.right,
            height = $(id).height() - margin.top - margin.bottom;

        var parseDate = d3.time.format("%H:%M").parse;
        var formatPercent = d3.format(".0%");

        var legendSize = 10,
            legendColor = 'rgba(0, 160, 233, 0.7)';

        var x = d3.time.scale()
            .range([0, width]);

        var y = d3.scale.linear()
            .range([height, 0]);

        var xAxis = d3.svg.axis()
            .scale(x)
            .ticks(d3.time.minutes, Math.floor(data.length/axisNum))
            .tickSize(-height)
            .tickPadding([6])
            .orient("bottom");

        var yAxis = d3.svg.axis()
            .scale(y)
            .ticks(10)
            .tickSize(-width)
            .tickFormat(formatPercent)
            .orient("left");

        var ddata = (function() {
          var temp = [];

          for (var i=0; i<data.length; i++) {
            temp.push({'time': parseDate(data[i]['time']), 'used': data[i]['used'], 'extra': data[i]['extra'], 'total': data[i]['total']});
          }

          return temp;
        })();

        // console.log(ddata);

        x.domain(d3.extent(ddata, function(d) { return d.time; }));

        var area = d3.svg.area()
            .x(function(d) { return x(d.time); })
            .y0(height)
            .y1(function(d) { return y(d['used']/d['total']); })
            .interpolate("cardinal");

        d3.select('#svg-mem').remove();

        var svg = d3.select(id).append("svg")
            .attr("id", "svg-mem")
            .attr("width", width+margin.right+margin.left)
            .attr("height", height+margin.top+margin.bottom)
            .append("g")
            .attr("transform", "translate(" + margin.left + "," + margin.top + ")");

        svg.append("g")
            .attr("class", "x axis")
            .attr("id", "mem-x-axis")
            .attr("transform", "translate(0," + height + ")")
            .call(xAxis);

        svg.append("g")
            .attr("class", "y axis")
            .call(yAxis);

        var path = svg.append("svg:path")
            .datum(ddata)
            .attr("class", "areaM")
            .attr("d", area);

        var points = svg.selectAll(".gPoints")
            .data(ddata)
            .enter().append("g")
            .attr("class", "gPoints");

        //legend rendering
        var legend = svg.append('g')
            .attr('class', 'legend')
            .attr('transform', 'translate(0,'+ (height + margin.bottom - legendSize * 1.2) +')');

        legend.append('rect')
            .attr('width', legendSize)
            .attr('height', legendSize)
            .style('fill', legendColor);

        legend.append('text')
            .data(ddata)
            .attr('x', legendSize*1.2)
            .attr('y', legendSize/1.1)
            .text('used');

        points.selectAll(".memtipPoints")
            .data(ddata)
            .enter().append("circle")
            .attr("class", "memtipPoints")
            .attr("cx", function (d) {
              return x(d.time);
            })
            .attr("cy", function (d) {
              return y(d['used']/d['total']);
            })
            .attr("r", "6px")
            .on("mouseover", function (d) {
              console.log(this);

              d3.select(this).transition().duration(100).style("opacity", 1);

              svg.append("g")
                  .attr("class", "tipDot")
                  .append("line")
                  .attr("class", "tipDot")
                  .transition()
                  .duration(50)
                  .attr("x1", x(d['time']))
                  .attr("x2", x(d['time']))
                  .attr("y2", height);

              // svg.append("circle")
              //   .attr('class', 'tipDot')
              //   .attr("cx", x(d['time']))
              //   .attr("cy", y(0))
              //   .attr("r", "4px");

              // svg.append("circle")
              //   .attr('class', 'tipDot')
              //   .attr("cx", x(d['time']))
              //   .attr("cy", y(1))
              //   .attr("r", "4px");

              svg.append("polyline")      // attach a polyline
                  .attr("class", "tipDot")  // colour the line
                  .style("fill", "black")     // remove any fill colour
                  .attr("points", (x(d['time'])-3.5)+","+(y(1)-2.5)+","+x(d['time'])+","+(y(1)+6)+","+(x(d['time'])+3.5)+","+(y(1)-2.5));

              svg.append("polyline")      // attach a polyline
                  .attr("class", "tipDot")  // colour the line
                  .style("fill", "black")     // remove any fill colour
                  .attr("points", (x(d['time'])-3.5)+","+(y(0)+2.5)+","+x(d['time'])+","+(y(0)-6)+","+(x(d['time'])+3.5)+","+(y(0)+2.5));

              $(this).tooltip({
                'container': 'body',
                'placement': 'left',
                'title': 'Used' + ' | ' + formatPercent(d['used']/d['total']),
                'trigger': 'hover'
              })
                  .tooltip('show');
            })
            .on("mouseout",  function (d) {
              d3.select(this).transition().duration(100).style("opacity", 0);

              d3.selectAll('.tipDot').transition().duration(100).remove();

              $(this).tooltip('destroy');
            });

        this.getOpt = function() {
          var axisOpt = new Object();
          axisOpt['x'] = x;
          axisOpt['y'] = y;
          axisOpt['xAxis'] = xAxis;
          axisOpt['width'] = width;
          axisOpt['height'] = height;

          return axisOpt;
        }

        this.getSvg = function() {
          var svgD = new Object();
          svgD['svg'] = svg;
          svgD['points'] = points;
          svgD['area'] = area;
          svgD['path'] = path;

          return svgD;
        }
      }

      //redraw function
      function redraw(data, id, x, y, xAxis, svg, area, path, points, height, axisNum) {
        //format of time data
        var parseDate = d3.time.format("%H:%M").parse;
        var formatPercent = d3.format(".0%");

        var ddata = (function() {
          var temp = [];

          for (var i=0; i<data.length; i++) {
            temp.push({'time': parseDate(data[i]['time']), 'used': data[i]['used'], 'extra': data[i]['extra'], 'total': data[i]['total']});
          }

          return temp;
        })();

        x.domain(d3.extent(ddata, function(d) {
          return d['time'];
        }));

        xAxis.ticks(d3.time.minutes, Math.floor(data.length / axisNum));

        svg.select("#mem-x-axis")
            .transition()
            .duration(200)
            .ease("sin-in-out")
            .call(xAxis);

        //area line updating
        path.datum(ddata)
            .transition()
            .duration(200)
            .attr("class", "areaM")
            .attr("d", area);

        //circle updating
        points.selectAll(".memtipPoints")
            .data(ddata)
            .attr("class", "memtipPoints")
            .attr("cx", function (d) {
              return x(d.time);
            })
            .attr("cy", function (d) {
              return y(d['used']/d['total']);
            })
            .attr("r", "6px");

        //draw new dot
        points.selectAll(".memtipPoints")
            .data(ddata)
            .enter().append("circle")
            .attr("class", "memtipPoints")
            .attr("cx", function (d) {
              return x(d.time);
            })
            .attr("cy", function (d) {
              return y(d['used']/d['total']);
            })
            .attr("r", "6px")
            .on("mouseover", function (d) {
              d3.select(this).transition().duration(100).style("opacity", 1);

              svg.append("g")
                  .attr("class", "tipDot")
                  .append("line")
                  .attr("class", "tipDot")
                  .transition()
                  .duration(50)
                  .attr("x1", x(d['time']))
                  .attr("x2", x(d['time']))
                  .attr("y2", height);

              svg.append("polyline")      // attach a polyline
                  .attr("class", "tipDot")  // colour the line
                  .style("fill", "black")     // remove any fill colour
                  .attr("points", (x(d['time'])-3.5)+","+(y(1)-2.5)+","+x(d['time'])+","+(y(1)+6)+","+(x(d['time'])+3.5)+","+(y(1)-2.5));

              svg.append("polyline")      // attach a polyline
                  .attr("class", "tipDot")  // colour the line
                  .style("fill", "black")     // remove any fill colour
                  .attr("points", (x(d['time'])-3.5)+","+(y(0)+2.5)+","+x(d['time'])+","+(y(0)-6)+","+(x(d['time'])+3.5)+","+(y(0)+2.5));

              $(this).tooltip({
                'container': 'body',
                'placement': 'left',
                'title': 'Used' + ' | ' +formatPercent(d['used']/d['total']),
                'trigger': 'hover'
              })
                  .tooltip('show');
            })
            .on("mouseout",  function (d) {
              d3.select(this).transition().duration(100).style("opacity", 0);

              d3.selectAll('.tipDot').transition().duration(100).remove();

              $(this).tooltip('destroy');
            });

        //remove old dot
        points.selectAll(".memtipPoints")
            .data(ddata)
            .exit()
            .transition()
            .duration(200)
            .remove();

      }

      //inits chart
      var sca = new generate(data, "#sensor-mem-area-d3", 8);

      //dynamic data and chart update
      setInterval(function() {
        //update donut data
        data.push({time: hAxis + ":" + mAxis, used: Math.random()*200+400, extra: Math.random()*1000, total: 1000});

        // console.log(tAxis);
        if(mAxis === 59) {
          hAxis++;
          mAxis=0;
        }
        else {
          mAxis++;
        }

        if (Object.keys(data).length === 20) data.shift();

        // generate(data, "#sensor-mem-area-d3");
        redraw(data, "#sensor-mem-area-d3", sca.getOpt()['x'], sca.getOpt()['y'], sca.getOpt()['xAxis'], sca.getSvg()['svg'], sca.getSvg()['area'], sca.getSvg()['path'], sca.getSvg()['points'], sca.getOpt()['height'], 8);
      }, 3500);
    },
    displayDocker: function () {
      var self = this;

      var data = [
        {time:'10:00', issue1:15.1, issue2: 13, issue3: 2, issue4: 3, issue5: 10, issue6: 8, issue7: 4, issue8: 5, issue9: 6, issue10: 11, issue11:1, issue12: 15, issue13: 7, issue14: 9, issue15: 12, issue16: 18, issue17: 16, issue18: 19, issue19: 2, issue20: 16 },
        {time:'10:01', issue1:15.1, issue2: 13, issue3: 2, issue4: 3, issue5: 10, issue6: 8, issue7: 3, issue8: 2, issue9: 2, issue10: 8, issue11:14, issue12: 13, issue13: 12, issue14: 3, issue15: 10, issue16: 18, issue17: 3, issue18: 2, issue19: 2, issue20: 16 },
        {time:'10:02', issue1:15.1, issue2: 13, issue3: 2, issue4: 3, issue5: 10, issue6: 8, issue7: 3, issue8: 2, issue9: 2, issue10: 8, issue11:14, issue12: 13, issue13: 12, issue14: 3, issue15: 10, issue16: 18, issue17: 3, issue18: 2, issue19: 2, issue20: 16 },
        {time:'10:03', issue1:15.1, issue2: 13, issue3: 2, issue4: 3, issue5: 10, issue6: 8, issue7: 3, issue8: 2, issue9: 2, issue10: 8, issue11:14, issue12: 13, issue13: 12, issue14: 3, issue15: 10, issue16: 18, issue17: 3, issue18: 2, issue19: 2, issue20: 16 },
        {time:'10:04', issue1:15.1, issue2: 13, issue3: 2, issue4: 3, issue5: 10, issue6: 8, issue7: 3, issue8: 2, issue9: 2, issue10: 8, issue11:14, issue12: 13, issue13: 12, issue14: 3, issue15: 10, issue16: 18, issue17: 3, issue18: 2, issue19: 2, issue20: 16 },
        {time:'10:05', issue1:14, issue2: 13, issue3: 2, issue4: 3, issue5: 10, issue6: 8, issue7: 3, issue8: 2, issue9: 2, issue10: 8, issue11:14, issue12: 13, issue13: 12, issue14: 3, issue15: 10, issue16: 18, issue17: 3, issue18: 2, issue19: 2, issue20: 16 },
        {time:'10:06', issue1:14, issue2: 13, issue3: 2, issue4: 3, issue5: 10, issue6: 8, issue7: 3, issue8: 2, issue9: 2, issue10: 8, issue11:14, issue12: 13, issue13: 12, issue14: 3, issue15: 10, issue16: 18, issue17: 3, issue18: 2, issue19: 2, issue20: 16 },
        {time:'10:07', issue1:14, issue2: 13, issue3: 2, issue4: 3, issue5: 10, issue6: 8, issue7: 3, issue8: 2, issue9: 2, issue10: 8, issue11:14, issue12: 13, issue13: 12, issue14: 3, issue15: 10, issue16: 18, issue17: 3, issue18: 2, issue19: 2, issue20: 16 },
        {time:'10:08', issue1:14, issue2: 13, issue3: 2, issue4: 3, issue5: 10, issue6: 8, issue7: 3, issue8: 2, issue9: 2, issue10: 8, issue11:14, issue12: 13, issue13: 12, issue14: 3, issue15: 10, issue16: 18, issue17: 3, issue18: 2, issue19: 2, issue20: 16 }
      ];

      var hAxis = 10, mAxis = 9;

      //generation function
      function generate(data, id, axisNum) {
        var margin = {top: 14, right: 20, bottom: 60, left: 30},
            width = $(id).width() - margin.left - margin.right,
            height = $(id).height() - margin.top - margin.bottom;

        var parseDate = d3.time.format("%H:%M").parse;

        var legendSize = Math.floor(width / 27.5),
            color = d3.scale.category20();

        var x = d3.time.scale().range([0, width]),
            y = d3.scale.linear().rangeRound([height, 0]);

        //the radius of circle can be adjustable
        var r = d3.scale.linear()
            .domain([0, 20])
            .range([0, width / 45]);

        //deal with the datum, and store them into ddata
        var ddata = [];
        data.forEach(function(d) {
          for(var i=1; i<Object.keys(d).length; i++) {
            ddata.push({
              'time': parseDate(d['time']), 'issue': self.scatterCategory[i-1], 'num': d['issue'+i]
            });
          }
        });

        x.domain( d3.extent(ddata, function(d) { return d['time']; }) );
        y.domain([0,22]);

        var xAxis = d3.svg.axis()
            .scale(x)
            .orient("bottom")
            .ticks(d3.time.minutes, Math.floor(data.length / axisNum))
            .tickPadding([6])
            .tickSize(-height);

        var yAxis = d3.svg.axis()
            .scale(y)
            .orient("left")
            .ticks(10)
            .tickPadding([8])
            .tickSize(-width);

        d3.select('#svg-docker').remove();

        var svg = d3.select(id).append("svg")
            .attr('id', "#svg-docker")
            .attr("width", width+margin.left+margin.right)
            .attr("height", height+margin.top+margin.bottom)
            .append("g")
            .attr("transform", "translate(" + margin.left + "," + margin.top + ")");

        svg.append("g")
            .attr("class", "x axis")
            .attr("id", "docker-x-axis")
            .attr("transform", "translate(0, " + height + ")")
            .call(xAxis);

        svg.append("g")
            .attr("class", "y axis")
            .call(yAxis);

        var dots = svg.append("g")
            .attr("class", "scatter_dots");

        dots.selectAll(".scatter_circle")
            .data(ddata)
            .enter()
            .append("circle")
            .attr("class", function (d) { return "scatter_circle scatter_circle_" + d['issue']; })
            .attr("cx", function (d) { return x(d['time']); })
            .attr("cy", function (d) { return y(d['num']); })
            .attr("r", function (d) { return r(10); })
            .style("display", function (d) {
              //to check if the checkbox has been selected and decide whether to show it out
              //use display:none and display:inherit to control the display of scatter dots
              if ($("#"+d['issue']).prop("checked"))
                return 'inherit';
              else
                return 'none';
            })
            .style("fill", function (d) { return color(d['issue']) })
            .on("mouseover", function (d) {
              if ($("#"+d['issue']).prop("checked")) {
                $(this).tooltip({
                  'container': 'body',
                  'placement': 'left',
                  'title': d["issue"] + " | " +d['num'],
                  'trigger': 'hover'
                })
                    .tooltip('show');
              }
            })
            .on("mouseout", function(d) {
              $(this).tooltip('destroy');
            });

        d3.selectAll('.scatter_legend').remove();

        var legend = svg.append('g')
            .attr('class', 'scatter_legend');

        var singLegend = legend.selectAll('.docker_legend')
            .data(self.selectScaCate)
            .enter()
            .append('g')
            .attr('class', 'docker_legend')
            .attr('transform', function(d, i) {
              return 'translate(' + ((5 + (width-20) / 5) * i + 5) + ',' + (height + margin.bottom - legendSize - 15) + ')';
            });

        singLegend.append('g:rect')
            .attr('width', legendSize)
            .attr('height', legendSize)
            .style('fill', function(d) {
              return color(d);
            });

        singLegend.append('g:text')
            .attr('x', legendSize*1.4)
            .attr('y', legendSize/1.3)
            .attr('font-size', function() {
              if ($(id).width() > 415)
                return '.9em';
              else {
                return '.55em';
              }
            })
            .text(function(d) {
              return d;
            });

        //draw the rect for legends
        var rect = svg.append('g')
            .attr("class", 'legendOuter');

        rect.selectAll('.legendRect')
            .data(self.selectScaCate)
            .enter()
            .append('rect')
            .attr('class', 'legendRect')
            .attr('width', (width - 20) / 5)
            .attr('height', legendSize + 10)
            .attr('transform', function(d, i) {
              return 'translate(' + (i * (5 + (width-20) / 5)) + ',' + (height + margin.bottom - legendSize - 20) + ')';
            });

        this.getOpt = function() {
          var axisOpt = new Object();
          axisOpt['x'] = x;
          axisOpt['xAxis'] = xAxis;
          axisOpt['y'] = y;
          axisOpt['r'] = r;
          axisOpt['legendSize'] = legendSize;
          axisOpt['height'] = height;
          axisOpt['width'] = width;
          axisOpt['margin'] = margin;

          return axisOpt;
        }

        this.getSvg = function() {
          var svgD = new Object();
          svgD['svg'] = svg;
          svgD['dots'] = dots;
          svgD['color'] = color;
          svgD['legend'] = legend
          svgD['rect'] = rect;

          return svgD;
        }
      }

      //redraw function
      function redraw(data, id, svg, dots, color, x, xAxis, y, r, init, axisNum) {
        //update the axis
        var parseDate = d3.time.format("%H:%M").parse;

        //parse the data
        var ddata = [];
        data.forEach(function(d) {
          for(var i=1; i<Object.keys(d).length; i++) {
            ddata.push({
              'time': parseDate(d['time']),
              'issue': self.scatterCategory[i-1],
              'num': d['issue'+i]
            });
          }
        });

        x.domain( d3.extent(ddata, function(d) { return d['time']; }) );
        xAxis.ticks(d3.time.minutes, Math.floor(data.length / axisNum));

        //update the axis
        svg.select("#docker-x-axis")
            .transition()
            .duration(200)
            .ease("sin-in-out")
            .call(xAxis);

        //update the dot
        dots.selectAll(".scatter_circle")
            .data(ddata)
            .transition()
            .duration(200)
            .attr("cx", function (d) {
              return x(d['time']);
            })
            .style("display", function (d) {
              //to check if the checkbox has been selected and decide whether to show it out
              //use display:none and display:inherit to control the display of scatter dots
              if ($("#"+d['issue']).prop("checked"))
                return 'inherit';
              else
                return 'none';
            });
        //////////////////////////

        //draw new dot
        dots.selectAll(".scatter_circle")
            .data(ddata)
            .enter()
            .append("circle")
            .attr("class", function (d) { return "scatter_circle scatter_circle_" + d['issue']; })
            .attr("cx", function (d) { return x(d['time']); })
            .attr("cy", function (d) { return y(d['num']); })
            .attr("r", function (d) { return r(10); })
            .style("display", function (d) {
              //to check if the checkbox has been selected and decide whether to show it out
              //use display:none and display:inherit to control the display of scatter dots
              if ($("#"+d['issue']).prop("checked"))
                return 'inherit';
              else
                return 'none';
            })
            .style("fill", function (d) { return color(d['issue']) })
            .on("mouseover", function (d) {
              if ($("#"+d['issue']).prop("checked")) {
                $(this).tooltip({
                  'container': 'body',
                  'placement': 'left',
                  'title': d["issue"] + " | " +d['num'],
                  'trigger': 'hover'
                })
                    .tooltip('show');
              }
            })
            .on("mouseout", function(d) {
              $(this).tooltip('destroy');
            });

        //remove old dot
        dots.selectAll(".scatter_circle")
            .data(ddata)
            .exit()
            .transition()
            .duration(500)
            .remove();

        //redraw legend
        self.legendRedraw(self.selectScaCate, id, init.getSvg()['legend'], init.getSvg()['rect'], init.getOpt()['legendSize'], init.getOpt()['margin'], init.getOpt()['height'], init.getOpt()['width'], init.getSvg()['color']);
      }

      //inits chart
      self.sensorDockerFunc = new generate(data, "#sensor-docker-scatterplot-d3", 5);

      //dynamic data and chart update
      setInterval(function() {
        //update donut data
        data.push({
          time: hAxis + ":" + mAxis,
          issue1: Math.floor(Math.random()*20),
          issue2: Math.floor(Math.random()*20),
          issue3: Math.floor(Math.random()*20),
          issue4: Math.floor(Math.random()*20),
          issue5: Math.floor(Math.random()*20),
          issue6: Math.floor(Math.random()*20),
          issue7: Math.floor(Math.random()*20),
          issue8: Math.floor(Math.random()*20),
          issue9: Math.floor(Math.random()*20),
          issue10: Math.floor(Math.random()*20),
          issue11: Math.floor(Math.random()*20),
          issue12: Math.floor(Math.random()*20),
          issue13: Math.floor(Math.random()*20),
          issue14: Math.floor(Math.random()*20),
          issue15: Math.floor(Math.random()*20),
          issue16: Math.floor(Math.random()*20),
          issue17: Math.floor(Math.random()*20),
          issue18: Math.floor(Math.random()*20),
          issue19: Math.floor(Math.random()*20),
          issue20: Math.floor(Math.random()*20)
        });

        if(mAxis === 59) {
          hAxis++;
          mAxis=0;
        }
        else {
          mAxis++;
        }

        if (Object.keys(data).length === 15) data.shift();

        redraw(data, "#sensor-docker-scatterplot-d3", self.sensorDockerFunc.getSvg()['svg'], self.sensorDockerFunc.getSvg()['dots'], self.sensorDockerFunc.getSvg()['color'], self.sensorDockerFunc.getOpt()['x'], self.sensorDockerFunc.getOpt()['xAxis'], self.sensorDockerFunc.getOpt()['y'], self.sensorDockerFunc.getOpt()['r'], self.sensorDockerFunc, 5);
      }, 6000);
    },
    displayCPU: function () {
      var data = [
        { inits: 'A', value: 10 },
        { inits: 'B', value: 100 },
        { inits: 'C', value: 60 },
        { inits: 'D', value: 10 },
        { inits: 'E', value: 80 },
        { inits: 'F', value: 100 }
      ];

      var category = ['A', 'B', 'C', 'D', 'E', 'F'],
          cateColor = ["#fff799", "#ffee00" , "#0068b7", '#00b7ee', '#a5d4f3', '#eff9ff'];

      //generation function
      function generate(data, id) {
        var margin = {top: 20, right: 0, bottom: 40, left: 0},
            width = $(id).width() - margin.left - margin.right,
            height = $(id).height() - margin.top - margin.bottom;

        var radius = Math.min(width, height) / 2,
            innerRadius = radius * 0.25,
            outerRadius = radius * 0.75;

        var legendRectSize = radius/8,
            legendSpacing = radius/5;

        var color = d3.scale.ordinal()
            .domain(category)
            .range(cateColor);

        var formatPercent = d3.format(".0%");

        var pie = d3.layout.pie()
            .value(function(d) {return d.value; })
            .sort(null);

        var arc = d3.svg.arc()
            .innerRadius(innerRadius)
            .outerRadius(outerRadius);

        var svgX = (width+margin.right+margin.left) / 2,
            svgY = (radius*2 + margin.top*2) / 2;

        var svg = d3.select(id).append("svg")
            .attr("width", width+margin.right+margin.left)
            .attr("height", height+margin.top+margin.bottom)
            .append("g")
            .attr("transform", "translate(" + svgX + "," + svgY + ")");

        path = svg.datum(data).selectAll(".solidArc")
            .data(pie)
            .enter()
            .append("path")
            .attr("fill", function(d) {
              return color(d.data.inits);
            })
            .attr("class", "solidArc")
            .attr("stroke", "none")
            .attr("d", arc)
            .each(function(d) {
              this._current=d;
            })
            .on('mouseover', function(d) {
              console.log(d);

              d3.select(this).transition().duration(200).attr("d", arc.innerRadius(innerRadius).outerRadius(outerRadius / 0.75 * 0.9));

              //count the sum
              var count = 0;
              for (var i = 0; i < category.length; i++) {
                count += data[i]['value'];
              }

              svg.append("svg:text")
                  .attr("class", "donutCenterText")
                  .attr("dy", "-.3em")
                  .attr("text-anchor", "middle")
                  .transition().duration(200)
                  .text(d['data']['inits']);

              svg.append("svg:text")
                  .attr("class", "donutCenterText")
                  .attr("dy", ".8em")
                  .attr("text-anchor", "middle")
                  .transition().duration(200)
                  .text(formatPercent(d['value'] / count));

            })
            .on('mouseout', function(d) {
              d3.select(this).transition().duration(200).attr("d", arc.innerRadius(innerRadius).outerRadius(outerRadius));

              d3.selectAll('.donutCenterText').remove();
            });

        //legend rendering
        var legend = svg.selectAll('.legend')
            .data(color.domain())
            .enter()
            .append('g')
            .attr("id", function(d) {
              return "legend-" + d;
            })
            .attr('class', 'legend')
            .attr('transform', function(d, i) {
              var horz = (i-2.8)*(legendSpacing+legendRectSize);
              var vert =  radius + margin.bottom / 4;
              return 'translate(' + horz + ',' + vert + ')';
            });

        legend.append('rect')
            .attr('width', legendRectSize)
            .attr('height', legendRectSize)
            .style('fill', color)
            .style('stroke', color);

        legend.append('text')
            .data(data)
            .attr('x', legendRectSize*1.2)
            .attr('y', legendRectSize/1.3)
            .text(function(d) {
              //console.log(d);
              return d.inits; });

        this.getPath = function() {
          return path;
        }

        this.getArc = function() {
          return d3.svg.arc().innerRadius(innerRadius).outerRadius(outerRadius);
        }
      }

      //redraw function
      function redraw(data, path, arc) {
        //for the transition effect of donut chart
        var arcTween = function arcTween(a) {
          var i = d3.interpolate(this._current, a);
          this._current = i(0);
          return function(t) {
            return arc(i(t));
          };
        }

        var donut = d3.layout.pie()
            .value(function(d) {return d.value; })
            .sort(null);

        donut.value(function(d) { return d['value']; });
        path = path.datum(data).data(donut).attr("d", arc); // compute the new angles
        path.transition().duration(750).attrTween("d", arcTween);
      }

      //inits chart
      var sca = new generate(data, "#sensor-cpu-donut-d3");

      //dynamic data and chart update
      setInterval(function() {
        //update donut data
        for (var i=0; i<Object.keys(data).length; i++){
          data[i].value = Math.floor(Math.random()*100);
        }

        redraw(data, sca.getPath(), sca.getArc());
      }, 5000);
    },
    displayNet: function () {
      var data = [
        {time: '10:01', upload: 200, download: 500, total: 1000},
        {time: '10:02', upload: 620, download: 600, total: 1000},
        {time: '10:03', upload: 300, download: 800, total: 1000},
        {time: '10:04', upload: 440, download: 700, total: 1000},
        {time: '10:05', upload: 900, download: 900, total: 1000},
        {time: '10:06', upload: 300, download: 500, total: 1000},
        {time: '10:07', upload: 50, download: 300, total: 1000},
        {time: '10:08', upload: 350, download: 70, total: 1000},
        {time: '10:09', upload: 750, download: 200, total: 1000}
      ];

      var category = ['upload', 'download'];

      var hAxis = 10, mAxis = 10;

      //generation function
      function generate(data, id, lineType, axisNum) {
        var margin = {top: 20, right: 18, bottom: 35, left: 28},
            width = $(id).width() - margin.left - margin.right,
            height = $(id).height() - margin.top - margin.bottom;

        var parseDate = d3.time.format("%H:%M").parse;

        var legendSize = 10,
            legendColor = {'upload': 'rgba(0, 160, 233, 1)', 'download': 'rgba(34, 172, 56, 1)'};

        var x = d3.time.scale()
            .range([0, width]);

        var y = d3.scale.linear()
            .range([height, 0]);

        //data.length/10 is set for the garantte of timeseries's fitting effect in svg chart
        var xAxis = d3.svg.axis()
            .scale(x)
            .ticks(d3.time.minutes, Math.floor(data.length / axisNum))
            .tickSize(-height)
            .tickPadding([6])
            .orient("bottom");

        var yAxis = d3.svg.axis()
            .scale(y)
            .ticks(10)
            .tickSize(-width)
            .orient("left");

        var ddata = (function() {
          var temp = {}, seriesArr = [];

          category.forEach(function (name) {
            temp[name] = {category: name, values:[]};
            seriesArr.push(temp[name]);
          });

          data.forEach(function (d) {
            category.map(function (name) {
              temp[name].values.push({'category': name, 'time': parseDate(d['time']), 'num': d[name]});
            });
          });

          return seriesArr;
        })();

        // q = ddata;
        // console.log(ddata);

        x.domain( d3.extent(data, function(d) { return parseDate(d['time']); }) );

        y.domain([
          0,
          d3.max(ddata, function(c) { return d3.max(c.values, function(v) { return v['num']; }); })+100
        ]);

        var area = d3.svg.area()
            .x(function(d) { return x(d['time']); })
            .y0(height)
            .y1(function(d) { return y(d['num']); })
            .interpolate(lineType);

        d3.select('#svg-net').remove();

        var svg = d3.select(id).append("svg")
            .attr("id", "svg-net")
            .attr("width", width+margin.right+margin.left)
            .attr("height", height+margin.top+margin.bottom)
            .append("g")
            .attr("transform", "translate(" + margin.left + "," + margin.top + ")");

        svg.append("g")
            .attr("class", "x axis")
            .attr("id", "net-x-axis")
            .attr("transform", "translate(0," + height + ")")
            .call(xAxis);

        svg.append("g")
            .attr("class", "y axis")
            .call(yAxis);

        var path = svg.selectAll(".gPath")
            .data(ddata)
            .enter().append("g")
            .attr("class", "gPath");

        path.append("path")
            .attr("d", function(d) { return area(d['values']); })
            .attr("class", function(d) {
              if (d['category'] === 'upload')
                return 'areaU';
              else
                return 'areaD';
            });

        var legend = svg.selectAll('.legend')
            .data(category)
            .enter()
            .append('g')
            .attr('class', 'legend')
            .attr('transform', function(d, i) {
              return 'translate(' + (i * 10 * legendSize) + ',' + (height + margin.bottom - legendSize * 1.2) + ')';
            });

        legend.append('rect')
            .attr('width', legendSize)
            .attr('height', legendSize)
            .style('fill', function(d) { return legendColor[d]});

        legend.append('text')
            .data(category)
            .attr('x', legendSize*1.2)
            .attr('y', legendSize/1.1)
            .text(function(d) {
              return d;
            });

        var points = svg.selectAll(".seriesPoints")
            .data(ddata)
            .enter().append("g")
            .attr("class", "seriesPoints");

        points.selectAll(".tipNetPoints")
            .data(function (d) { return d['values']; })
            .enter().append("circle")
            .attr("class", "tipNetPoints")
            .attr("cx", function (d) { return x(d['time']); })
            .attr("cy", function (d) { return y(d['num']); })
            .text(function (d) { return d['num']; })
            .attr("r", "6px")
            .style("fill",function (d) { return legendColor[d['category']]; })
            .on("mouseover", function (d) {
              // console.log();
              var currentX = $(this)[0]['cx']['animVal']['value'],
                  currentY = $(this)[0]['cy']['animVal']['value'];

              d3.select(this).transition().duration(100).style("opacity", 1);

              var ret = $('.tipNetPoints').filter(function(index) {
                return ($(this)[0]['cx']['animVal']['value'] === currentX && $(this)[0]['cy']['animVal']['value'] !== currentY);
              });

              //to adjust tooltip'x content if upload and download data are the same
              var jud = ret.length;

              // console.log(ret.length);

              var mainCate = (function() {
                if (jud === 0)
                  return 'upload/download';
                else
                  return d['category'];
              })();

              var viceCate = (function() {
                if (category[0] === d['category'])
                  return category[1];
                else
                  return category[0];
              })();

              $.each(ret, function(index, val) {
                // console.log(mainCate + ' | ' + viceCate);

                $(val).animate({
                  opacity: "1"
                }, 100);

                $(val).tooltip({
                  'container': 'body',
                  'placement': 'left',
                  'title': viceCate + ' | ' + $(this)[0]['textContent'],
                  'trigger': 'hover'
                })
                    .tooltip('show');
              });

              svg.append("g")
                .attr("class", "tipDot")
                .append("line")
                .attr("class", "tipDot")
                .transition()
                .duration(50)
                .attr("x1", $(this)[0]['cx']['animVal']['value'])
                .attr("x2", $(this)[0]['cx']['animVal']['value'])
                .attr("y2", height);

              svg.append("polyline")
                .attr("class", "tipDot")
                .style("fill", "black")
                .attr("points", ($(this)[0]['cx']['animVal']['value']-3.5)+","+(0-2.5)+","+$(this)[0]['cx']['animVal']['value']+","+(0+6)+","+($(this)[0]['cx']['animVal']['value']+3.5)+","+(0-2.5));

              svg.append("polyline")
                .attr("class", "tipDot")
                .style("fill", "black")
                .attr("points", ($(this)[0]['cx']['animVal']['value']-3.5)+","+(y(0)+2.5)+","+$(this)[0]['cx']['animVal']['value']+","+(y(0)-6)+","+($(this)[0]['cx']['animVal']['value']+3.5)+","+(y(0)+2.5));

              $(this).tooltip({
                'container': 'body',
                'placement': 'left',
                'title': mainCate + ' | ' + d['num'],
                'trigger': 'hover'
              })
              .tooltip('show');
            })
            .on("mouseout",  function (d) {
              var currentX = $(this)[0]['cx']['animVal']['value'];

              d3.select(this).transition().duration(100).style("opacity", 0);

              var ret = $('.tipNetPoints').filter(function(index) {
                return ($(this)[0]['cx']['animVal']['value'] === currentX);
              });

              $.each(ret, function(index, val) {
                $(val).animate({
                  opacity: "0"
                }, 100);

                $(val).tooltip('destroy');
              });

              d3.selectAll('.tipDot').transition().duration(100).remove();

              $(this).tooltip('destroy');
            });

        this.getOpt = function() {
          var axisOpt = new Object();
          axisOpt['x'] = x;
          axisOpt['y'] = y;
          axisOpt['xAxis'] = xAxis;
          axisOpt['width'] = width;
          axisOpt['height'] = height;

          return axisOpt;
        }

        this.getSvg = function() {
          var svgD = new Object();
          svgD['svg'] = svg;
          svgD['points'] = points;
          svgD['area'] = area;
          svgD['path'] = path;
          svgD['legendColor'] = legendColor;

          return svgD;
        }
      }

      //redraw function
      function redraw(data, id, x, y, xAxis, svg, area, path, points, legendColor, height, axisNum) {
        //format of time data
        var parseDate = d3.time.format("%H:%M").parse;

        var ddata = (function() {
          var temp = {}, seriesArr = [];

          category.forEach(function (name) {
            temp[name] = {category: name, values:[]};
            seriesArr.push(temp[name]);
          });

          data.forEach(function (d) {
            category.map(function (name) {
              temp[name].values.push({'category': name, 'time': parseDate(d['time']), 'num': d[name]});
            });
          });

          return seriesArr;
        })();

        x.domain( d3.extent(data, function(d) { return parseDate(d['time']); }) );
        xAxis.ticks(d3.time.minutes, Math.floor(data.length / axisNum));

        svg.select("#net-x-axis")
            .transition()
            .duration(200)
            .ease("sin-in-out")
            .call(xAxis);

        //different area line updating

        path.select("path")
            .data(ddata)
            .transition()
            .duration(200)
            .attr("d", function(d) { return area(d['values']); })
            .attr("class", function(d) {
              if (d['category'] === 'upload')
                return 'areaU';
              else
                return 'areaD';
            });

        //circle updating

        points.selectAll(".tipNetPoints")
            .data(function (d) { return d['values']; })
            .attr("class", "tipNetPoints")
            .attr("cx", function (d) { return x(d['time']); })
            .attr("cy", function (d) { return y(d['num']); })
            .attr("r", "6px")
            .style("fill",function (d) { return legendColor[d['category']]; });

        // //draw new dot

        // console.log(ddata);
        points.data(ddata);

        points.selectAll(".tipNetPoints")
            .data(function (d) {
              return d['values'];
            })
            .enter().append("circle")
            .attr("class", "tipNetPoints")
            .attr("cx", function (d) { return x(d['time']); })
            .attr("cy", function (d) { return y(d['num']); })
            .text(function (d) { return d['num']; })
            .attr("r", "6px")
            .style("fill",function (d) { return legendColor[d['category']]; })
            .on("mouseover", function (d) {
              // console.log();
              var currentX = $(this)[0]['cx']['animVal']['value'],
                  currentY = $(this)[0]['cy']['animVal']['value'];

              d3.select(this).transition().duration(100).style("opacity", 1);

              var ret = $('.tipNetPoints').filter(function(index) {
                return ($(this)[0]['cx']['animVal']['value'] === currentX && $(this)[0]['cy']['animVal']['value'] !== currentY);
              });

              //to adjust tooltip'x content if upload and download data are the same
              var jud = ret.length;

              var mainCate = (function() {
                if (jud === 0)
                  return 'upload/download';
                else
                  return d['category'];
              })();

              var viceCate = (function() {
                if (category[0] === d['category'])
                  return category[1];
                else
                  return category[0];
              })();

              $.each(ret, function(index, val) {
                $(val).animate({
                  opacity: "1"
                }, 100);

                $(val).tooltip({
                  'container': 'body',
                  'placement': 'left',
                  'title': viceCate + ' | ' + $(this)[0]['textContent'],
                  'trigger': 'hover'
                })
                    .tooltip('show');
              });

              // console.log("the correct xaxis is: ", currentX, 'but the output is ', x(d['time']), '$this object is: ', $(this)[0]['cx']['animVal']['value']);

              svg.append("g")
                  .attr("class", "tipDot")
                  .append("line")
                  .attr("class", "tipDot")
                  .transition()
                  .duration(50)
                  .attr("x1", $(this)[0]['cx']['animVal']['value'])
                  .attr("x2", $(this)[0]['cx']['animVal']['value'])
                  .attr("y2", height);

              svg.append("polyline")
                  .attr("class", "tipDot")
                  .style("fill", "black")
                  .attr("points", ($(this)[0]['cx']['animVal']['value']-3.5)+","+(0-2.5)+","+$(this)[0]['cx']['animVal']['value']+","+(0+6)+","+($(this)[0]['cx']['animVal']['value']+3.5)+","+(0-2.5));

              svg.append("polyline")
                  .attr("class", "tipDot")
                  .style("fill", "black")
                  .attr("points", ($(this)[0]['cx']['animVal']['value']-3.5)+","+(y(0)+2.5)+","+$(this)[0]['cx']['animVal']['value']+","+(y(0)-6)+","+($(this)[0]['cx']['animVal']['value']+3.5)+","+(y(0)+2.5));

              $(this).tooltip({
                'container': 'body',
                'placement': 'left',
                'title': mainCate + ' | ' + d['num'],
                'trigger': 'hover'
              })
                  .tooltip('show');
            })
            .on("mouseout",  function (d) {
              var currentX = $(this)[0]['cx']['animVal']['value'];

              d3.select(this).transition().duration(100).style("opacity", 0);

              var ret = $('.tipNetPoints').filter(function(index) {
                return ($(this)[0]['cx']['animVal']['value'] === currentX);
              });

              $.each(ret, function(index, val) {
                $(val).animate({
                  opacity: "0"
                }, 100);

                $(val).tooltip('destroy');
              });

              d3.selectAll('.tipDot').transition().duration(100).remove();

              $(this).tooltip('destroy');
            });

        //remove old dot
        points.selectAll(".tipNetPoints")
            .data(function (d) { return d['values']; })
            .exit()
            .transition()
            .duration(200)
            .remove();

      }

      //inits chart
      var sca = new generate(data, "#sensor-net-area-d3", "linear", 6);

      //dynamic data and chart update
      setInterval(function() {
        //update donut data
        data.push({time: hAxis + ":" + mAxis, upload: Math.random()*200+400, download: Math.random()*400+200, total: 1000});

        // console.log(tAxis);
        if(mAxis === 59) {
          hAxis++;
          mAxis=0;
        }
        else {
          mAxis++;
        }

        if (Object.keys(data).length === 20) data.shift();

        redraw(data, "#sensor-net-area-d3", sca.getOpt()['x'], sca.getOpt()['y'], sca.getOpt()['xAxis'], sca.getSvg()['svg'], sca.getSvg()['area'], sca.getSvg()['path'], sca.getSvg()['points'], sca.getSvg()['legendColor'], sca.getOpt()['height'], 6);
      }, 3500);
    },
    displayDisk: function () {
      var data = [
        {time: '10:01', read: 200, write: 500, total: 1000},
        {time: '10:02', read: 620, write: 600, total: 1000},
        {time: '10:03', read: 300, write: 800, total: 1000},
        {time: '10:04', read: 440, write: 700, total: 1000},
        {time: '10:05', read: 900, write: 900, total: 1000},
        {time: '10:06', read: 300, write: 500, total: 1000},
        {time: '10:07', read: 50, write: 300, total: 1000},
        {time: '10:08', read: 350, write: 70, total: 1000},
        {time: '10:09', read: 750, write: 200, total: 1000}
      ];

      var category = ['read', 'write'];

      var drawLine = ['write'],
          drawArea = ['read'];

      var hAxis = 10, mAxis = 10;

      //generation function
      function generate(data, id, lineType, axisNum) {
        var margin = {top: 20, right: 18, bottom: 35, left: 28},
            width = $(id).width() - margin.left - margin.right,
            height = $(id).height() - margin.top - margin.bottom;

        var parseDate = d3.time.format("%H:%M").parse;

        var legendSize = 10,
            legendColor = {'read': 'rgba(0, 160, 233, 1)', 'write': 'rgba(255, 255, 255, 1)'};

        var x = d3.time.scale()
            .range([0, width]);

        var y = d3.scale.linear()
            .range([height, 0]);

        //data.length/10 is set for the garantte of timeseries's fitting effect in svg chart
        var xAxis = d3.svg.axis()
            .scale(x)
            .ticks(d3.time.minutes, Math.floor(data.length / axisNum))
            .tickSize(-height)
            .tickPadding([6])
            .orient("bottom");

        var yAxis = d3.svg.axis()
            .scale(y)
            .ticks(10)
            .tickSize(-width)
            .orient("left");

        var ddata = (function() {
          var temp = {}, seriesArr = [];

          category.forEach(function (name) {
            temp[name] = {category: name, values:[]};
            seriesArr.push(temp[name]);
          });

          data.forEach(function (d) {
            category.map(function (name) {
              temp[name].values.push({'category': name, 'time': parseDate(d['time']), 'num': d[name]});
            });
          });

          return seriesArr;
        })();

        var ldata = (function() {
          var temp = {}, seriesArr = [];

          temp[drawLine[0]] = {category: drawLine[0], values:[]};
          seriesArr.push(temp[drawLine]);

          data.forEach(function (d) {
            drawLine.map(function (name) {
              temp[name].values.push({'category': name, 'time': parseDate(d['time']), 'num': d[name]});
            });
          });

          return seriesArr;
        })();

        var adata = (function() {
          var temp = {}, seriesArr = [];

          temp[drawArea[0]] = {category: drawArea[0], values:[]};
          seriesArr.push(temp[drawArea]);

          data.forEach(function (d) {
            drawArea.map(function (name) {
              temp[name].values.push({'category': name, 'time': parseDate(d['time']), 'num': d[name]});
            });
          });

          return seriesArr;
        })();

        // q = ddata;
        // console.log(ddata);

        x.domain( d3.extent(data, function(d) { return parseDate(d['time']); }) );

        y.domain([
          0,
          d3.max(ddata, function(c) { return d3.max(c.values, function(v) { return v['num']; }); })+100
        ]);

        var area = d3.svg.area()
            .x(function(d) { return x(d['time']); })
            .y0(height)
            .y1(function(d) { return y(d['num']); })
            .interpolate(lineType);

        var line = d3.svg.line()
            .interpolate(lineType)
            .x(function(d) { return x(d['time']); })
            .y(function(d) { return y(d['num']); });

        d3.select('#svg-disk').remove();

        var svg = d3.select(id).append("svg")
            .attr("id", "svg-disk")
            .attr("width", width + margin.right + margin.left)
            .attr("height", height + margin.top + margin.bottom)
            .append("g")
            .attr("transform", "translate(" + margin.left + "," + margin.top + ")");

        svg.append("g")
            .attr("class", "x axis")
            .attr("id", "disk-x-axis")
            .attr("transform", "translate(0," + height + ")")
            .call(xAxis);

        svg.append("g")
            .attr("class", "y axis")
            .call(yAxis);

        var path = svg.selectAll(".gPath")
            .data(adata)
            .enter().append("g")
            .attr("class", "gPath");

        path.append("path")
            .attr("d", function(d) { return area(d['values']); })
            .attr("class", 'areaR');

        var lpath = svg.selectAll(".lpath")
            .data(ldata)
            .enter().append("g")
            .attr("class", "lpath");

        lpath.append("path")
            .attr("d", function(d) { return line(d['values']); })
            .attr("class", "areaW");

        var legend = svg.selectAll('.legend')
            .data(category)
            .enter()
            .append('g')
            .attr('class', 'legend')
            .attr('transform', function(d, i) {
              return 'translate(' + (i * 10 * legendSize) + ',' + (height + margin.bottom - legendSize * 1.2) + ')';
            });

        legend.append('rect')
            .attr('width', legendSize)
            .attr('height', legendSize)
            .style('fill', function(d) {
              return legendColor[d]
            })
            .style('stroke', function(d) {
              return legendColor['read'];
            });

        legend.append('text')
            .data(category)
            .attr('x', legendSize * 1.2)
            .attr('y', legendSize / 1.1)
            .text(function(d) {
              return d;
            });

        var points = svg.selectAll(".seriesPoints")
            .data(ddata)
            .enter().append("g")
            .attr("class", "seriesPoints");

        points.selectAll(".tipPoints")
            .data(function (d) { return d['values']; })
            .enter().append("circle")
            .attr("class", "tipPoints")
            .attr("cx", function (d) { return x(d['time']); })
            .attr("cy", function (d) { return y(d['num']); })
            .text(function (d) { return d['num']; })
            .attr("r", "6px")
            .style("fill",function (d) { return legendColor[d['category']]; })
            .style("stroke", function (d) {
              if (d['category'] === 'write')
                return legendColor['read'];
              else
                return legendColor['write'];
            })
            .on("mouseover", function (d) {
              // console.log();
              var currentX = $(this)[0]['cx']['animVal']['value'],
                  currentY = $(this)[0]['cy']['animVal']['value'];

              d3.select(this).transition().duration(100).style("opacity", 1);

              var ret = $('.tipPoints').filter(function(index) {
                return ($(this)[0]['cx']['animVal']['value'] === currentX && $(this)[0]['cy']['animVal']['value'] !== currentY);
              });

              //to adjust tooltip'x content if read and write data are the same
              var jud = ret.length;

              // console.log(ret.length);

              var mainCate = (function() {
                if (jud === 0)
                  return 'read/write';
                else
                  return d['category'];
              })();

              var viceCate = (function() {
                if (category[0] === d['category'])
                  return category[1];
                else
                  return category[0];
              })();

              $.each(ret, function(index, val) {
                // console.log(mainCate + ' | ' + viceCate);

                $(val).animate({
                  opacity: "1"
                }, 100);

                $(val).tooltip({
                  'container': 'body',
                  'placement': 'left',
                  'title': viceCate + ' | ' + $(this)[0]['textContent'],
                  'trigger': 'hover'
                })
                    .tooltip('show');
              });

              svg.append("g")
                .attr("class", "tipDot")
                .append("line")
                .attr("class", "tipDot")
                .transition()
                .duration(50)
                .attr("x1", currentX)
                .attr("x2", currentX)
                .attr("y2", height);

              svg.append("polyline")
                .attr("class", "tipDot")
                .style("fill", "black")
                .attr("points", (currentX-3.5)+","+(0-2.5)+","+currentX+","+(0+6)+","+(currentX+3.5)+","+(0-2.5));

              svg.append("polyline")
                .attr("class", "tipDot")
                .style("fill", "black")
                .attr("points", (currentX-3.5)+","+(y(0)+2.5)+","+currentX+","+(y(0)-6)+","+(currentX+3.5)+","+(y(0)+2.5));

              $(this).tooltip({
                'container': 'body',
                'placement': 'left',
                'title': mainCate + ' | ' + d['num'],
                'trigger': 'hover'
              })
              .tooltip('show');
            })
            .on("mouseout",  function (d) {
              var currentX = $(this)[0]['cx']['animVal']['value'];

              d3.select(this).transition().duration(100).style("opacity", 0);

              var ret = $('.tipPoints').filter(function(index) {
                return ($(this)[0]['cx']['animVal']['value'] === currentX);
              });

              $.each(ret, function(index, val) {
                $(val).animate({
                  opacity: "0"
                }, 100);

                $(val).tooltip('destroy');
              });

              d3.selectAll('.tipDot').transition().duration(100).remove();

              $(this).tooltip('destroy');
            });

        this.getOpt = function() {
          var axisOpt = new Object();
          axisOpt['x'] = x;
          axisOpt['y'] = y;
          axisOpt['xAxis'] = xAxis;
          axisOpt['width'] = width;
          axisOpt['height'] = height;

          return axisOpt;
        }

        this.getSvg = function() {
          var svgD = new Object();
          svgD['svg'] = svg;
          svgD['points'] = points;
          svgD['area'] = area;
          svgD['path'] = path;
          svgD['lpath'] = lpath;
          svgD['legendColor'] = legendColor;
          svgD['line'] = line;

          return svgD;
        }
      }

      //redraw function
      function redraw(data, id, x, y, xAxis, svg, area, line, path, lpath, points, legendColor, height, axisNum) {
        //format of time data
        var parseDate = d3.time.format("%H:%M").parse;

        var ddata = (function() {
          var temp = {}, seriesArr = [];

          category.forEach(function (name) {
            temp[name] = {category: name, values:[]};
            seriesArr.push(temp[name]);
          });

          data.forEach(function (d) {
            category.map(function (name) {
              temp[name].values.push({'category': name, 'time': parseDate(d['time']), 'num': d[name]});
            });
          });

          return seriesArr;
        })();

        var ldata = (function() {
          var temp = {}, seriesArr = [];

          temp[drawLine[0]] = {category: drawLine[0], values:[]};
          seriesArr.push(temp[drawLine]);

          data.forEach(function (d) {
            drawLine.map(function (name) {
              temp[name].values.push({'category': name, 'time': parseDate(d['time']), 'num': d[name]});
            });
          });

          return seriesArr;
        })();

        var adata = (function() {
          var temp = {}, seriesArr = [];

          temp[drawArea[0]] = {category: drawArea[0], values:[]};
          seriesArr.push(temp[drawArea]);

          data.forEach(function (d) {
            drawArea.map(function (name) {
              temp[name].values.push({'category': name, 'time': parseDate(d['time']), 'num': d[name]});
            });
          });

          return seriesArr;
        })();

        // console.log(ddata);
        // console.log(adata);
        // console.log(ldata);

        x.domain( d3.extent(data, function(d) { return parseDate(d['time']); }) );
        xAxis.ticks(d3.time.minutes, Math.floor(data.length / axisNum));

        svg.select("#disk-x-axis")
            .transition()
            .duration(200)
            .ease("sin-in-out")
            .call(xAxis);

        //different area line updating

        path.select("path")
            .data(adata)
            .transition()
            .duration(200)
            .attr("d", function(d) { return area(d['values']); })
            .attr("class", 'areaR');

        lpath.select("path")
            .data(ldata)
            .transition()
            .duration(200)
            .attr("d", function(d) { return line(d['values']); })
            .attr("class", 'areaW');

        //circle updating

        points.selectAll(".tipPoints")
            .data(function (d) { return d['values']; })
            .attr("class", "tipPoints")
            .attr("cx", function (d) { return x(d['time']); })
            .attr("cy", function (d) { return y(d['num']); });

        // //draw new dot

        // console.log(ddata);
        points.data(ddata);

        points.selectAll(".tipPoints")
            .data(function (d) {
              return d['values'];
            })
            .enter().append("circle")
            .attr("class", "tipPoints")
            .attr("cx", function (d) { return x(d['time']); })
            .attr("cy", function (d) { return y(d['num']); })
            .text(function (d) { return d['num']; })
            .attr("r", "6px")
            .style("fill",function (d) { return legendColor[d['category']]; })
            .style("stroke", function (d) {
              if (d['category'] === 'write')
                return legendColor['read'];
              else
                return legendColor['write'];
            })
            .on("mouseover", function (d) {
              // console.log();
              var currentX = $(this)[0]['cx']['animVal']['value'],
                  currentY = $(this)[0]['cy']['animVal']['value'];

              d3.select(this).transition().duration(100).style("opacity", 1);

              var ret = $('.tipPoints').filter(function(index) {
                return ($(this)[0]['cx']['animVal']['value'] === currentX && $(this)[0]['cy']['animVal']['value'] !== currentY);
              });

              //to adjust tooltip'x content if read and write data are the same
              var jud = ret.length;

              var mainCate = (function() {
                if (jud === 0)
                  return 'read/write';
                else
                  return d['category'];
              })();

              var viceCate = (function() {
                if (category[0] === d['category'])
                  return category[1];
                else
                  return category[0];
              })();

              $.each(ret, function(index, val) {
                $(val).animate({
                  opacity: "1"
                }, 100);

                $(val).tooltip({
                  'container': 'body',
                  'placement': 'left',
                  'title': viceCate + ' | ' + $(this)[0]['textContent'],
                  'trigger': 'hover'
                })
                    .tooltip('show');
              });

              svg.append("g")
                  .attr("class", "tipDot")
                  .append("line")
                  .attr("class", "tipDot")
                  .transition()
                  .duration(50)
                  .attr("x1", currentX)
                  .attr("x2", currentX)
                  .attr("y2", height);

              svg.append("polyline")
                  .attr("class", "tipDot")
                  .style("fill", "black")
                  .attr("points", (currentX-3.5)+","+(0-2.5)+","+currentX+","+(0+6)+","+(currentX+3.5)+","+(0-2.5));

              svg.append("polyline")
                  .attr("class", "tipDot")
                  .style("fill", "black")
                  .attr("points", (currentX-3.5)+","+(y(0)+2.5)+","+currentX+","+(y(0)-6)+","+(currentX+3.5)+","+(y(0)+2.5));

              $(this).tooltip({
                'container': 'body',
                'placement': 'left',
                'title': mainCate + ' | ' + d['num'],
                'trigger': 'hover'
              })
              .tooltip('show');
            })
            .on("mouseout",  function (d) {
              var currentX = $(this)[0]['cx']['animVal']['value'];

              d3.select(this).transition().duration(100).style("opacity", 0);

              var ret = $('.tipPoints').filter(function(index) {
                return ($(this)[0]['cx']['animVal']['value'] === currentX);
              });

              $.each(ret, function(index, val) {
                $(val).animate({
                  opacity: "0"
                }, 100);

                $(val).tooltip('destroy');
              });

              d3.selectAll('.tipDot').transition().duration(100).remove();

              $(this).tooltip('destroy');
            });

        //remove old dot
        points.selectAll("circle")
            .data(function (d) { return d['values']; })
            .exit()
            .transition()
            .duration(200)
            .remove();

      }

      //inits chart
      var sca = new generate(data, "#sensor-disk-multi-d3", "monotone", 6);

      //dynamic data and chart update
      setInterval(function() {
        //update donut data
        data.push({time: hAxis + ":" + mAxis, read: Math.random()*700+200, write: Math.random()*500+400, total: 1000});

        // console.log(tAxis);
        if(mAxis === 59) {
          hAxis++;
          mAxis=0;
        }
        else {
          mAxis++;
        }

        if (Object.keys(data).length === 20) data.shift();

        redraw(data, "#sensor-disk-multi-d3", sca.getOpt()['x'], sca.getOpt()['y'], sca.getOpt()['xAxis'], sca.getSvg()['svg'], sca.getSvg()['area'], sca.getSvg()['line'], sca.getSvg()['path'], sca.getSvg()['lpath'], sca.getSvg()['points'], sca.getSvg()['legendColor'], sca.getOpt()['height'], 6);
      }, 3000);
    },
    displayPeople: function () {
      var data = [];

      for(var i=1; i<=20; i++) {
        var x = Math.random() * 141.4 - 70.7;
        var y = Math.abs(x) + Math.random() * (Math.sqrt(10000- x*x) - Math.abs(x));
        data.push({"x": x, "y": y, "radius": Math.floor(Math.random()*20), "id": i});
      }

      //generation function
      function generate(data, id) {
        var margin = {top: 20, right: 5, bottom: 10, left: 5}, height, width;

        var wTemp = $(id).width() - margin.top - margin.bottom;
        var hTemp = $(id).height() - margin.left - margin.top;

        if (hTemp * 8 / 5 > wTemp) {
          width = wTemp;
          height = width * 5 / 8;
        } else {
          height = hTemp;
          width = height * 8 / 5;
        }

        var color = d3.scale.category20();

        var x = d3.scale.linear().rangeRound([0, width]),
            y = d3.scale.linear().rangeRound([height, 0]);

        x.domain([-75,85]);
        y.domain([0,100]);

        var xAxis = d3.svg.axis().scale(x).orient("top"),
            yAxis = d3.svg.axis().scale(y).orient("left");

        var outlineArc = d3.svg.arc()
            .startAngle(-Math.PI/4.0)
            .endAngle(Math.PI/4.0)
            .innerRadius(y(0))
            .outerRadius(y(0));

        var r = d3.scale.linear()
            .domain([0, 20])
            .range([0, $(id).width() / 33]);

        // svg.append("g")
        //     .attr("class", "scatter_axis")
        //     .attr("transform", "translate(0, "+height+")")
        //     .call(xAxis);

        // svg.append("g")
        //     .attr("class", "scatter_axis")
        //     .attr("transform", "translate("+width/2+", 0)")
        //     .call(yAxis);

        var svg = d3.select(id)
            .append("svg")
            .attr("width", width + margin.left + margin.right)
            .attr("height", height + margin.top + margin.bottom)
            .append("g")
            .attr("transform", "translate(" + margin.left + "," + margin.top + ")");

        //the outlines drawing of arcpie chart
        svg.append("line")
            .attr('class', 'moniOutlineXY')
            .attr({
              x1: x(0),
              y1: y(0),
              x2: x(Math.sqrt(5000)),
              y2: y(Math.sqrt(5000)),
              stroke: 'gray',
              "stroke-width": 1
            });

        svg.append("line")
            .attr('class', 'moniOutlineXY')
            .attr({
              x1: x(0),
              y1: y(0),
              x2: x(-Math.sqrt(5000)),
              y2: y(Math.sqrt(5000)),
              stroke: 'gray',
              "stroke-width": 1
            });

        var outerPath = svg.append("path")
            .attr("transform", "translate(" + (width * 15 / 32) + "," + height + ")")
            .attr("class", "moniOutlineArc")
            .attr("d", outlineArc);

        svg.selectAll(".monitorCircle")
            .data(data)
            .enter()
            .append("circle")
            .attr("class", "monitorCircle")
            .attr("cx", function (d) { return x(d['x']); })
            .attr("cy", function (d) { return y(d['y']); })
            .attr("r", function (d) { return r(18); })
            .style("fill", function (d) { return color(d['id'])})
            .on("mouseover", function(d) {
              $(this).tooltip({
                'container': 'body',
                'placement': 'top',
                'title': 'PEOPLE ' + d['id'],
                'trigger': 'hover'
              })
                  .tooltip('show');
            })
            .on("mouseout", function(d) {
              $(this).tooltip('destroy');
            });

        var legendhBase = height / 21 + 1;

        var legend = svg.selectAll(".moniLegend")
            .data(data)
            .enter().append("g")
            .attr("class", "moniLegend")
            .attr("transform", function(d, i) { return "translate(0," + i * legendhBase + ")"; });

        // draw legend colored rectangles
        legend.append("rect")
            .attr('class', 'singMoniLegend')
            .attr("x", width - legendhBase)
            .attr("width", legendhBase - 1)
            .attr("height", legendhBase - 1)
            .style("fill", function (d) { return color(d['id'])});

        // draw legend text
        legend.append("text")
            .attr("x", width - legendhBase * 1.4)
            .attr("y", legendhBase * 0.7)
          // .attr("dy", ".35em")
            .style("text-anchor", "end")
            .attr('font-size', '.6em')
            .text(function(d) { return d['id'];});

        this.getOpt = function() {
          var opt = new Object();

          opt['svg'] = svg;
          opt['x'] = x;
          opt['y'] = y;
          opt['r'] = r;
          opt['legend'] = legend;
          opt['height'] = height;
          opt['width'] = width;
          opt['legendhBase'] = legendhBase;
          opt['color'] = color;

          return opt;
        }

      }

      //redraw function
      function redraw(data, svg, legend, x, y, r, color, width, height, legendhBase) {
        //update the dot
        svg.selectAll(".monitorCircle")
            .data(data);

        //draw new dot
        svg.selectAll(".monitorCircle")
            .data(data)
            .enter()
            .append("circle")
          // .transition()
          // .duration(500)
            .attr("class", "monitorCircle")
            .attr("cx", function (d) { return x(d['x']); })
            .attr("cy", function (d) { return y(d['y']); })
            .attr("r", function (d) { return r(18); })
            .style("fill", function (d) { return color(d['id'])})
            .on("mouseover", function(d) {
              $(this).tooltip({
                'container': 'body',
                'placement': 'top',
                'title': 'PEOPLE ' + d['id'],
                'trigger': 'hover'
              })
                  .tooltip('show');
            })
            .on("mouseout", function(d) {
              $(this).tooltip('destroy');
            });

        //remove old data
        svg.selectAll(".monitorCircle")
            .data(data)
            .exit()
          // .transition()
          // .duration(500)
            .remove();

        //remove the old legend and redraw the new legend
        svg.selectAll(".moniLegend").remove();

        legend = svg.selectAll(".moniLegend")
            .data(data)
            .enter().append("g")
            .attr("class", "moniLegend")
            .attr("transform", function(d, i) { return "translate(0," + i * legendhBase + ")"; });

        // draw legend colored rectangles
        legend.append("rect")
            .attr('class', 'singMoniLegend')
            .attr("x", width - legendhBase)
            .attr("width", legendhBase - 1)
            .attr("height", legendhBase - 1)
            .style("fill", function (d) { return color(d['id'])});

        // draw legend text
        legend.append("text")
            .attr("x", width - legendhBase * 1.4)
            .attr("y", legendhBase * 0.7)
            .style("text-anchor", "end")
            .attr('font-size', '.6em')
            .text(function(d) { return d['id'];});
      }

      //inits chart
      var sca = new generate(data, "#sensor-moni-arcpie-d3");

      //dynamic data and chart update
      setInterval(function() {
        //update data
        data = [];
        for(var i = 1; i <= Math.random() * 16; i++) {
          //to confirm the circle in the arcpie scope
          var x = Math.random() * 141.4 - 70.7;
          var y = Math.abs(x) + Math.random() * (Math.sqrt(10000- x*x) - Math.abs(x));

          data.push({
            "x": x,
            "y": y,
            "radius": Math.floor(Math.random()*20),
            "id": i
          });
        }

        redraw(data, sca.getOpt()['svg'], sca.getOpt()['legend'], sca.getOpt()['x'], sca.getOpt()['y'], sca.getOpt()['r'], sca.getOpt()['color'], sca.getOpt()['width'], sca.getOpt()['height'], sca.getOpt()['legendhBase'], "#sensor-moni-arcpie-d3");
      }, 1000);
    },
    displayDisDur: function () {
      var data=[];

      var hAxis = 10, mAxis = 20, scaAxis = 20, id = 10;

      for (var i=0; i<10; i++) {
        data.push({
          "id": 'People-'+i,
          "time": hAxis + ":" + (i * 2),
          "distance": Math.floor(Math.random()*100),
          "duration": Math.floor(Math.random() * 2 + 4)
        });
      }

      function generate(data, id, axisNum) {
        var margin = {top: 20, right: 20, bottom: 20, left: 28},
            width = $(id).width() - margin.left - margin.right,
            height = $(id).height() - margin.top - margin.bottom;

        var parseDate = d3.time.format("%H:%M").parse;

        var x = d3.time.scale()
            .range([0, width]);

        var y = d3.scale.linear()
            .range([height, 0]);

        var xAxis = d3.svg.axis()
            .scale(x)
            .ticks(d3.time.minutes, Math.floor(data.length/axisNum))
            .tickSize(-height)
            .tickPadding([6])
            .orient("bottom");

        var yAxis = d3.svg.axis()
            .scale(y)
            .ticks(10)
            .tickSize(-width)
            .orient("left");

        var ddata = (function() {
          var temp = [];

          for (var i=0; i<data.length; i++) {
            temp.push({
              'id': data[i]['id'],
              'time': parseDate(data[i]['time']),
              'distance': data[i]['distance'],
              'duration': data[i]['duration']
            });
          }

          return temp;
        })();

        x.domain(d3.extent(ddata, function(d) {
          return d.time;
        }));

        y.domain([-2,102]);

        var minTime = d3.min(ddata, function(d) {
              return d.time;
            }),
            maxTime = d3.max(ddata, function(d) {
              return d.time;
            });

        var durTime;

        if (maxTime - minTime < 0)
          durTime = (maxTime - minTime + 43200000) / 60000;
        else
          durTime = (maxTime - minTime) / 60000;

        // console.log(durTime);

        d3.selectAll('.svg_timeline').remove();

        var svg = d3.select(id).append("svg")
            .attr('class', 'svg_timeline')
            .attr("width", width + margin.left + margin.right)
            .attr("height", height + margin.top + margin.bottom)
            .attr("id", "sensor-timeline")
            .append("g")
            .attr("transform", "translate(" + margin.left + "," + margin.top + ")");

        //append xaxis and yaxis lines
        svg.append("g")
            .attr("class", "axis y")
            .call(yAxis);

        //for the baseline of axis
        svg.append("g")
            .attr('id', 'timeline-x-axis')
            .attr("class", "axis x")
            .attr("transform", "translate(0," + height + ")")
            .call(xAxis);

        var bars = svg.selectAll(".timelineRect")
            .data(ddata)
            .enter().append("g")
            .attr('class', 'timelineRect')
            .attr("id", function(d) {
              return "timelineRect-"+d['id'];
            });

        bars.append("rect")
            .attr("class", "innertimeRect")
            .attr("height", 2)
            .attr("x", function(d) {
              var timeJud = d['time'] - minTime;
              if (timeJud < 0)
                timeJud = timeJud + 43200000;
              if (timeJud <= d['duration'] * 60000)
                return x(minTime);
              else
                return x(d['time']) - d['duration'] / durTime * width;
            })
            .attr("y", function(d) {
              return y(d['distance']) - 1;
            })
            .attr("width", function(d) {
              var timeJud = d['time'] - minTime;
              if (timeJud < 0)
                timeJud = timeJud + 43200000;
              if (timeJud > d['duration'] * 60000)
                return d['duration'] / durTime * width;
              else
                return x(d['time']);
            });

        bars.append("rect")
            .attr("class", "outertimeRect")
            .attr("height", 16)
            .attr("x", function(d) {
              var timeJud = d['time'] - minTime;
              if (timeJud < 0)
                timeJud = timeJud + 43200000;
              if (timeJud <= d['duration'] * 60000)
                return x(minTime);
              else
                return x(d['time']) - d['duration'] / durTime * width;
            })
            .attr("y", function(d) {
              return y(d['distance']) - 8;
            })
            .attr("width", function(d) {
              var timeJud = d['time'] - minTime;
              if (timeJud < 0)
                timeJud = timeJud + 43200000;
              if (timeJud > d['duration'] * 60000)
                return d['duration'] / durTime * width;
              else
                return x(d['time']);
            });

        bars.on("mouseover", function(d) {
          d3.selectAll('.timelineRect').transition().duration(0).style("opacity", .4);

          d3.select("#timelineRect-"+d['id']).transition().duration(50).style("opacity", 1);

          // tooltip.html('ID: '+d['id'] + '<br>Duration: ' + d['duration']+'mins<br>Time: '+d['time']+'clock<br>Distance: '+Math.floor(d['distance'])+' meters')

          $(this).popover({
            'container': 'body',
            'placement': 'right',
            'html': 'true',
            'title': d['id'],
            'content': 'Time | ' + d['time'].getDate() + "/" + (d['time'].getMonth() + 1) + "-" + d['time'].getHours() + ":" + d['time'].getMinutes() + '<br>Duration | ' + d['duration'] + '<br>Distance | ' + d['distance'],
            'trigger': 'hover'
          })
              .popover('show');

          console.log(d['time']);
        })
            .on("mouseout", function(d) {
              d3.selectAll('.timelineRect').transition().duration(300).style("opacity", 1);

              $(this).popover('destroy');
            });

        this.getData = function () {
          var svgD = new Object();
          svgD['bars'] = bars;
          svgD['xAxis'] = xAxis;
          svgD['x'] = x;
          svgD['y'] = y;
          svgD['width'] = width;
          svgD['svg'] = svg;

          return svgD;
        }
      }

      //redraw function
      function redraw(data, svg, bars, xAxis, x, y, width, axisNum) {
        var parseDate = d3.time.format("%H:%M").parse;

        var ddata = (function() {
          var temp = [];

          for (var i=0; i<data.length; i++) {
            temp.push({
              'id': data[i]['id'],
              'time': parseDate(data[i]['time']),
              'distance': data[i]['distance'],
              'duration': data[i]['duration']
            });
          }

          return temp;
        })();

        // console.log(ddata);

        x.domain(d3.extent(ddata, function(d) {
          // console.log(d['time']);
          return d.time;
        }));

        var minTime = d3.min(ddata, function(d) {
              return d.time;
            }),
            maxTime = d3.max(ddata, function(d) {
              return d.time;
            });

        var durTime;

        if (maxTime - minTime < 0)
          durTime = (maxTime - minTime + 43200000) / 60000;
        else
          durTime = (maxTime - minTime) / 60000;

        xAxis.ticks(d3.time.minutes, Math.floor(durTime / axisNum));

        svg.select('#timeline-x-axis')
            .transition()
            .duration(100)
            .ease("sin-in-out")
            .call(xAxis);

        bars = svg.selectAll(".timelineRect")
            .data(ddata);

        bars.select('.innertimeRect')
            .transition()
            .duration(0)
          // .ease("sin-in-out")
            .attr("x", function(d) {
              var timeJud = d['time'] - minTime;
              if (timeJud < 0)
                timeJud = timeJud + 43200000;
              if (timeJud <= d['duration'] * 60000)
                return x(minTime);
              else
                return x(d['time']) - d['duration'] / durTime * width;
            })
            .attr("y", function(d) {
              return y(d['distance']) - 1;
            })
            .attr("width", function(d) {
              var timeJud = d['time'] - minTime;
              if (timeJud < 0)
                timeJud = timeJud + 43200000;
              if (timeJud > d['duration'] * 60000)
                return d['duration'] / durTime * width;
              else
                return x(d['time']);
            });

        bars.select('.outertimeRect')
            .transition()
            .duration(0)
            .attr("x", function(d) {
              var timeJud = d['time'] - minTime;
              if (timeJud < 0)
                timeJud = timeJud + 43200000;
              if (timeJud <= d['duration'] * 60000)
                return x(minTime);
              else
                return x(d['time']) - d['duration'] / durTime * width;
            })
            .attr("y", function(d) {
              return y(d['distance']) - 8;
            })
            .attr("width", function(d) {
              var timeJud = d['time'] - minTime;
              if (timeJud < 0)
                timeJud = timeJud + 43200000;
              if (timeJud > d['duration'] * 60000)
                return d['duration'] / durTime * width;
              else
                return x(d['time']);
            });

        var singBar = svg.selectAll(".timelineRect")
            .data(ddata)
            .enter().append("g")
            .attr('class', 'timelineRect')
            .attr("id", function(d) {
              return "timelineRect-"+d['id'];
            });

        singBar.append("rect")
            .attr("class", "innertimeRect")
            .attr("height", 2)
            .attr("x", function(d) {
              var timeJud = d['time'] - minTime;
              if (timeJud < 0)
                timeJud = timeJud + 43200000;
              if (timeJud <= d['duration'] * 60000)
                return x(minTime);
              else
                return x(d['time']) - d['duration'] / durTime * width;
            })
            .attr("y", function(d) {
              return y(d['distance']) - 1;
            })
            .attr("width", function(d) {
              var timeJud = d['time'] - minTime;
              if (timeJud < 0)
                timeJud = timeJud + 43200000;
              if (timeJud > d['duration'] * 60000)
                return d['duration'] / durTime * width;
              else
                return x(d['time']);
            });

        singBar.append("rect")
            .attr("class", "outertimeRect")
            .attr("height", 16)
            .attr("x", function(d) {
              var timeJud = d['time'] - minTime;
              if (timeJud < 0)
                timeJud = timeJud + 43200000;
              if (timeJud <= d['duration'] * 60000)
                return x(minTime);
              else
                return x(d['time']) - d['duration'] / durTime * width;
            })
            .attr("y", function(d) {
              return y(d['distance']) - 8;
            })
            .attr("width", function(d) {
              var timeJud = d['time'] - minTime;
              if (timeJud < 0)
                timeJud = timeJud + 43200000;
              if (timeJud > d['duration'] * 60000)
                return d['duration'] / durTime * width;
              else
                return x(d['time']);
            });

        singBar.on("mouseover", function(d) {
          d3.selectAll('.timelineRect').transition().duration(0).style("opacity", .4);

          d3.select("#timelineRect-"+d['id']).transition().duration(50).style("opacity", 1);

          $(this).popover({
            'container': 'body',
            'placement': 'right',
            'html': 'true',
            'title': d['id'],
            'content': 'Time | ' + d['time'].getDate() + "/" + (d['time'].getMonth() + 1) + "-" + d['time'].getHours() + ":" + d['time'].getMinutes() + '<br>Duration | ' + d['duration'] + '<br>Distance | ' + d['distance'],
            'trigger': 'hover'
          })
              .popover('show');
        })
            .on("mouseout", function(d) {
              d3.selectAll('.timelineRect').transition().duration(300).style("opacity", 1);

              $(this).popover('destroy');
            });

        bars.selectAll('.timelineRect')
            .data(ddata)
            .exit()
            .transition()
            .duration(200)
            .remove();
      }

      //inits chart
      var sca = new generate(data, "#sensor-dis-dur-timeline-d3", 5);

      //dynamic data and chart update
      setInterval(function() {
        //throw the old data
        var loopJud = Object.keys(data).length, delNum = 0;

        var beginJud;

        if (mAxis - scaAxis < 0) {
          if (hAxis == 0)
            beginJud = '23:' + (60 + mAxis - scaAxis);
          else
            beginJud = (hAxis-1) + ':' + (60 + mAxis - scaAxis);
          // console.log(beginJud);
        } else {
          beginJud = hAxis + ':' + (mAxis - scaAxis);
        }

        if (scaAxis === 60) {
          for (var i=0; ; i++) {
            if ((i+delNum) === loopJud)
              break;

            // console('beginJud is '+beginJud + ', and time is' + data[i-delNum]['time']);

            //BUG
            console.log('beginJud is '+beginJud );

            if (data[i-delNum]['time'] === beginJud) {
              console.log('I AM DELETING DATA.');

              data.shift();
              delNum++;
            }
          }
        }

        // append new data into existing json dataset
        // var randNum = Math.floor(Math.random()*2);
        var randNum = 1;

        if (randNum) {
          for (var i=0; i<randNum; i++) {
            data.push({
              "id": 'people-' + id,
              "time": hAxis + ":" + mAxis,
              "distance": Math.floor(Math.random()*100),
              "duration": Math.floor(Math.random()*4+6)});

            id++;
          }
        }

        if(mAxis === 59) {
          hAxis++;
          mAxis=0;
        }
        else {
          mAxis++;
        }

        if (scaAxis < 60) scaAxis++;

        redraw(data, sca.getData()['svg'], sca.getData()['bars'], sca.getData()['xAxis'], sca.getData()['x'], sca.getData()['y'], sca.getData()['width'], 5);
      }, 6000);
    },
    displayDetec: function () {
      var data = [
        {label: "fall detection", value: 59, color: '#fff799'},
        {label: "lens detection", value: 75, color: '#ffee00'},
        {label: "violence_sos detection", value: 92, color: '#0068b7'},
        {label: "single money detection", value: 80, color: '#00b7ee'}
      ];

      var data2 = [
        {label: "task_scheduler", value: 59, color: '#fff799'},
        {label: "depth_MoG_background", value: 75, color: '#ffee00'},
        {label: "door_latch", value: 92, color: '#0068b7'},
        {label: "primesense_ringbuffer", value: 80, color: '#00b7ee'},
        {label: "plane_view", value: 59, color: '#a5d4f3'},
        {label: "detection_combination", value: 75, color: '#eff9ff'},
        {label: "object_tracker", value: 92, color: '#00a0e9'},
        {label: "global_event_vis", value: 80, color: '#ca02ab'},
        {label: "fall_detection", value: 59, color: '#f29c9f'},
        {label: "violence_sos_detection", value: 75, color: '#ff0000'},
        {label: "invalid_operation_detection", value: 92, color: '#22ac38'},
        {label: "cutboard", value: 80, color: '#FF8C00'}
      ];

      var category = [];

      //generation function
      function generate(data, id, mAxis) {
        var margin = {top: 15, right: 10, bottom: 5, left: 10},
            width = $(id).width() - margin.left - margin.right,
            height = $(id).height() - margin.top - margin.bottom;

        var radius = Math.min(width, height) / 2 - margin.bottom,
            innerRadius = 0.3 * radius;

        var pie = d3.layout.pie()
            .sort(null)
            .value(function (d) {
              return 50;
            });

        var arc = d3.svg.arc()
            .innerRadius(innerRadius)
            .outerRadius(function (d) {
              return (radius - innerRadius) * (d.data.value / mAxis) + innerRadius;
            });

        var outlineArc = d3.svg.arc()
            .innerRadius(innerRadius)
            .outerRadius(radius);

        var svg = d3.select(id).append('svg')
            .attr('class', 'aster_svg')
            .attr("width", width + margin.left + margin.right)
            .attr("height", height + margin.top + margin.bottom)
            .append("g")
            .attr("transform", "translate(" + (width / 2 + margin.left) + "," + ((height) / 2 +  margin.top) + ")");

        // svg.call(tip);

        var path = svg.selectAll(".solidAsterArc")
            .data(pie(data))
            .enter().append("path")
            .attr("fill", function(d) { return d.data.color; })
            .attr("class", "solidAsterArc")
            .attr("d", arc)
            .on("mouseover", function (d) {
              $(this).tooltip({
                'container': 'body',
                'placement': 'top',
                'title': d.data.label + " | " + d.data.value,
                'trigger': 'hover'
              })
                  .tooltip('show');
            })
            .on("mouseout", function(d) {
              $(this).tooltip('destroy');
            });

        var outerPath = svg.selectAll(".outlineAsterArc")
            .data(pie(data))
            .enter().append("path")
            .attr("class", "outlineAsterArc")
            .attr("d", outlineArc);

        svg.append("svg:text")
            .attr("class", "asterCenterText")
            .attr('dy', '.4em')
            .text('DEMO');

        this.getSvg = function () {
          var svgD = new Object();
          // svgD['svg'] = svg;
          svgD['path'] = path;
          svgD['pie'] = pie;
          svgD['arc'] = arc;
          svgD['r'] = radius;
          svgD['ir'] = innerRadius;

          return svgD;
        }
      }

      //redraw function
      function redraw(data, path, pie, arc, r, ir, mAxis) {
        // arc.outerRadius(function (d) {
        //   return (r - ir) * (d.data.value / mAxis) + ir;
        // });
        // console.log("I am updating the drawing work.");

        path.data(pie(data))
            .transition()
            .duration(200)
            .attr("d", arc.innerRadius(ir).outerRadius(function (d) {
              return (r - ir) * (d.data.value / mAxis) + ir;
            }));
      }

      //inits chart
      var sca = new generate(data, "#sensor-detec-aster-d3", 100),
          sca2 = new generate(data2, '#sensor-detec-aster2-d3', 100);

      //dynamic data and chart update
      setInterval(function() {
        //update donut data
        for (var i=0; i<data.length; i++) {
          data[i]['value'] = Math.floor(Math.random()*100);
        }

        for (var i=0; i<data2.length; i++) {
          data2[i]['value'] = Math.floor(Math.random()*100);
        }

        redraw(data, sca.getSvg()['path'], sca.getSvg()['pie'], sca.getSvg()['arc'], sca.getSvg()['r'], sca.getSvg()['ir'], 100);
        redraw(data2, sca2.getSvg()['path'], sca2.getSvg()['pie'], sca2.getSvg()['arc'], sca2.getSvg()['r'], sca2.getSvg()['ir'], 100);
      }, 5000);
    },
    displayCount: function () {
      var data = [
        {time: '10:01', 'in': 200, 'remain': 500, 'out': 1000},
        {time: '10:02', 'in': 620, 'remain': 600, 'out': 1000},
        {time: '10:03', 'in': 300, 'remain': 800, 'out': 1000},
        {time: '10:04', 'in': 440, 'remain': 700, 'out': 1000},
        {time: '10:05', 'in': 900, 'remain': 900, 'out': 1000},
        {time: '10:06', 'in': 300, 'remain': 500, 'out': 1000},
        {time: '10:07', 'in': 50, 'remain': 300, 'out': 1000},
        {time: '10:08', 'in': 350, 'remain': 70, 'out': 1000},
        {time: '10:09', 'in': 750, 'remain': 200, 'out': 1000}
      ];

      var category = ['in', 'remain', 'out'];

      var drawLine = ['write'],
          drawBar = ['in', 'out'];

      var hAxis = 10, mAxis = 10;

      //generation function
      function generate(data, id, lineType, axisNum, drawBar, category) {
        var margin = {top: 10, right: 70, bottom: 35, left: 32},
            width = $(id).width() - margin.left - margin.right,
            height = $(id).height() - margin.top - margin.bottom;

        var parseDate = d3.time.format("%H:%M").parse;

        var legendSize = 10,
            legendColor = {'in': 'rgba(0, 160, 233, .8)', 'out': 'rgba(0, 160, 233, .2)', 'remain': '#41DB00'};

        var x = d3.time.scale()
            .range([0, width]);
        // .rangeRoundBands([0, width], .1);

        var x1 = d3.scale.ordinal();

        var y = d3.scale.linear()
            .range([height, 0]);

        //data.length/10 is set for the garantte of timeseries's fitting effect in svg chart
        var xAxis = d3.svg.axis()
            .scale(x)
            .ticks(d3.time.minutes, Math.floor(data.length / axisNum))
            .tickPadding([6])
            .orient("bottom");

        var yAxis = d3.svg.axis()
            .scale(y)
            .ticks(10)
            .orient("left");

        var ddata = data;

        ddata.forEach(function(d) {
          d.ages = drawBar.map(function(name) { return {name: name, value: +d[name]}; });
        });

        x.domain( d3.extent(ddata, function(d) { return parseDate(d['time']); }) );

        // console.log(x(parseDate(10:10))-x(parseDate(10:09)));

        var tranLength = (x(parseDate('00:10'))-x(parseDate('00:09'))) / 4;

        x1.domain(drawBar).rangeRoundBands([0, tranLength * 2]);

        y.domain([
          0,
          d3.max(ddata, function(d) { return d3.max([d['in'], d['out'], d['remain']]); }) + 50
        ]);

        var line = d3.svg.line()
            .interpolate(lineType)
            .x(function(d) { return xTransLen(d['time']); })
            .y(function(d) { return y(d['remain']); });

        d3.select('#svg-count').remove();

        var svg = d3.select(id).append("svg")
            .attr("id", "svg-count")
            .attr("width", width + margin.right + margin.left)
            .attr("height", height + margin.top + margin.bottom)
            .append("g")
            .attr("transform", "translate(" + margin.left + "," + margin.top + ")");

        svg.append("g")
            .attr("class", "x axis")
            .attr("id", "count-x-axis")
            .attr("transform", "translate(" + tranLength + "," + height + ")")
            .call(xAxis);

        svg.append("g")
            .attr("class", "y axis")
            .call(yAxis);

        var stat = svg.selectAll(".countBpath")
            .data(ddata)
            .enter().append("g")
            .attr("class", "countBpath")
            .attr("transform", function(d) { return "translate(" + x(parseDate(d['time'])) + ",0)"; });

        stat.selectAll(".countIORect")
            .data(function(d) { return d.ages; })
            .enter().append("rect")
            .attr('class', 'countIORect')
            .attr("width", x1.rangeBand())
            .attr("x", function(d) { return x1(d['name']); })
            .attr("y", function(d) { return y(d['value']); })
            .attr("height", function(d) { return height - y(d['value']); })
            .style("fill", function(d) { return legendColor[d['name']]; });

        var path = svg.append("g")
            .attr("class", "countPath");

        path.append("path")
            .attr("d", line(ddata))
            .attr("class", 'countRemainPath')
            .attr('stroke', legendColor['remain']);

        var legend = svg.selectAll('.countLegend')
            .data(category)
            .enter()
            .append('g')
            .attr('class', 'countLegend')
            .attr('transform', function(d, i) {
              return 'translate(' + (i * 10 * legendSize) + ',' + (height + margin.bottom - legendSize * 1.2) + ')';
            });

        legend.append('rect')
            .attr('width', legendSize)
            .attr('height', legendSize)
            .style('fill', function(d) {
              return legendColor[d];
            });

        legend.append('text')
            .data(category)
            .attr('x', legendSize * 1.2)
            .attr('y', legendSize / 1.1)
            .text(function(d) {
              return d;
            });

        var points = svg.append("g")
            .attr("class", "countPoints");

        points.selectAll(".tipCountPoints")
            .data(ddata)
            .enter().append("circle")
            .attr("class", "tipCountPoints")
            .attr("cx", function (d) { return xTransLen(d['time']); })
            .attr("cy", function (d) { return y(d['remain']); })
            .attr("r", "6px")
            .on("mouseover", function (d) {
              d3.select(this).transition().duration(100).attr("r", '8px');

              // svg.append("g")
              //   .append("line")
              //   .attr("class", "tipDot")
              //   .transition()
              //   .duration(50)
              //   .attr("x1", xTransLen(d['time']))
              //   .attr("x2", xTransLen(d['time']))
              //   .attr("y2", height);

              // svg.append("polyline")
              //   .attr("class", "tipDot")
              //   .style("fill", "black")
              //   .attr("points", (xTransLen(d['time'])-3.5)+","+(0-2.5)+","+xTransLen(d['time'])+","+(0+6)+","+(xTransLen(d['time'])+3.5)+","+(0-2.5));

              // svg.append("polyline")
              //   .attr("class", "tipDot")
              //   .style("fill", "black")
              //   .attr("points", (xTransLen(d['time'])-3.5)+","+(y(0)+2.5)+","+xTransLen(d['time'])+","+(y(0)-6)+","+(xTransLen(d['time'])+3.5)+","+(y(0)+2.5));

              $(this).popover({
                'container': 'body',
                'placement': 'top',
                'html': 'true',
                'title': d['time'],
                'content': '<table><tr><td>' + 'TIME' + '</td><td> | ' + d['time'] + '</td></tr>' + '<tr><td>' + 'REMAIN' + '</td><td> | ' + d['remain'] + '</td></tr>' + '<tr><td>' + 'IN' + '</td><td> | ' + d['in'] + '</td></tr>' + '<tr><td>' + 'OUT' + '</td><td> | ' + d['out'] + '</td></tr></table>',
                'trigger': 'hover'
              })
                  .popover('show');
            })
            .on("mouseout",  function (d) {
              d3.select(this).transition().duration(100).attr("r", '6px');

              d3.selectAll('.tipDot').transition().duration(100).remove();

              $(this).popover('destroy');
            });

        function xTransLen(t) {
          return x(parseDate(t)) + tranLength;
        }

        this.getOpt = function() {
          var axisOpt = new Object();
          axisOpt['x'] = x;
          axisOpt['x1'] = x;
          axisOpt['y'] = y;
          axisOpt['xAxis'] = xAxis;
          axisOpt['height'] = height;
          axisOpt['axisNum'] = axisNum;
          axisOpt['drawBar'] = drawBar;

          return axisOpt;
        }

        this.getSvg = function() {
          var svgD = new Object();
          svgD['svg'] = svg;
          svgD['points'] = points;
          svgD['stat'] = stat;
          svgD['path'] = path;
          svgD['line']  =line;
          svgD['legendColor'] = legendColor;

          return svgD;
        }
      }

      //redraw function
      function redraw(data, id, x, y, xAxis, svg, stat, path, line, points, legendColor, height, axisNum, drawBar) {
        //format of time data
        var parseDate = d3.time.format("%H:%M").parse;

        var ddata = data;

        ddata.forEach(function(d) {
          d.ages = drawBar.map(function(name) { return {name: name, value: +d[name]}; });
        });

        x.domain( d3.extent(ddata, function(d) { return parseDate(d['time']); }) );

        var tranLength = (x(parseDate('00:10'))-x(parseDate('00:09'))) / 4;

        var x1 = d3.scale.ordinal();

        x1.domain(drawBar).rangeRoundBands([0, tranLength * 2]);

        xAxis.ticks(d3.time.minutes, Math.floor(data.length / axisNum));

        line.x(function(d) { return xTransLen(d['time']); });

        svg.select("#count-x-axis")
            .transition()
            .duration(200)
            .ease("sin-in-out")
            .call(xAxis);

        //update the stat bar
        stat = svg.selectAll(".countBpath")
            .data(ddata)
            .attr("transform", function(d) { return "translate(" + x(parseDate(d['time'])) + ",0)"; });

        stat.selectAll(".countIORect")
            .data(function(d) { return d.ages; })
            .attr("width", x1.rangeBand())
            .attr("x", function(d) { return x1(d['name']); })
            .attr("y", function(d) { return y(d['value']); })
            .attr("height", function(d) { return height - y(d['value']); })
            .style("fill", function(d) { return legendColor[d['name']]; });

        //append new bar
        stat = svg.selectAll(".countBpath")
            .data(ddata)
            .enter().append("g")
            .attr("class", "countBpath")
            .attr("transform", function(d) { return "translate(" + x(parseDate(d['time'])) + ",0)"; });

        stat.selectAll(".countIORect")
            .data(function(d) { return d.ages; })
            .enter().append("rect")
            .attr('class', 'countIORect')
            .attr("width", x1.rangeBand())
            .attr("x", function(d) { return x1(d['name']); })
            .attr("y", function(d) { return y(d['value']); })
            .attr("height", function(d) { return height - y(d['value']); })
            .style("fill", function(d) { return legendColor[d['name']]; });

        //remove the old bar
        stat.selectAll(".countIORect")
            .data(function(d) { return d.ages; })
            .exit()
            .transition()
            .duration(200)
            .remove();

        //remove the path and redraw it, in order to confirm it display in front of other elements
        d3.selectAll('.countPath').remove();

        var path = svg.append("g")
            .attr("class", "countPath");

        path.append("path")
            .attr("d", line(ddata))
            .attr("class", 'countRemainPath')
            .attr('stroke', legendColor['remain']);

        //update the path line
        // path.selectAll('.countRemainPath')
        //   .data(ddata)
        //   .transition()
        //   .duration(200)
        //   .attr("d", line(ddata))
        //   .attr("class", 'countRemainPath')
        //   .attr('stroke', legendColor['remain']);

        //circle updating
        // points.selectAll(".tipCountPoints")
        //   .data(ddata)
        //   .attr("class", "tipCountPoints")
        //   .attr("cx", function (d) { return xTransLen(d['time']); })
        //   .attr("cy", function (d) { return y(d['remain']); });

        //remove all the points and append new points
        d3.selectAll('.countPoints').remove();

        points = svg.append("g")
            .attr("class", "countPoints");

        points.selectAll(".tipCountPoints")
            .data(ddata)
            .enter().append("circle")
            .attr("class", "tipCountPoints")
            .attr("cx", function (d) { return xTransLen(d['time']); })
            .attr("cy", function (d) { return y(d['remain']); })
            .attr("r", "6px")
            .on("mouseover", function (d) {
              d3.select(this).transition().duration(100).attr("r", '8px');

              $(this).popover({
                'container': 'body',
                'placement': 'top',
                'html': 'true',
                'title': d['time'],
                'content': '<table><tr><td>' + 'TIME' + '</td><td> | ' + d['time'] + '</td></tr>' + '<tr><td>' + 'REMAIN' + '</td><td> | ' + d['remain'] + '</td></tr>' + '<tr><td>' + 'IN' + '</td><td> | ' + d['in'] + '</td></tr>' + '<tr><td>' + 'OUT' + '</td><td> | ' + d['out'] + '</td></tr></table>',
                'trigger': 'hover'
              })
                  .popover('show');
            })
            .on("mouseout",  function (d) {
              d3.select(this).transition().duration(100).attr("r", '6px');

              d3.selectAll('.tipDot').transition().duration(100).remove();

              $(this).popover('destroy');
            });

        //remove old dot
        // points.selectAll(".tipCountPoints")
        //   .data(ddata)
        //   .exit()
        //   .transition()
        //   .duration(200)
        //   .remove();

        function xTransLen(t) {
          return x(parseDate(t)) + tranLength;
        }

      }

      //inits chart
      var sca = new generate(data, "#sensor-count-multi-d3", "monotone", 5, drawBar, category);

      //dynamic data and chart update
      setInterval(function() {
        //update donut data
        data.push({time: hAxis + ":" + mAxis, 'in': Math.random()*700+200, 'out': Math.random()*500+400, 'remain': Math.random()*700+200});

        // console.log(tAxis);
        if(mAxis === 59) {
          hAxis++;
          mAxis=0;
        }
        else {
          mAxis++;
        }

        if (Object.keys(data).length === 18) data.shift();

        redraw(data, "#sensor-disk-multi-d3", sca.getOpt()['x'], sca.getOpt()['y'], sca.getOpt()['xAxis'], sca.getSvg()['svg'], sca.getSvg()['stat'], sca.getSvg()['path'], sca.getSvg()['line'], sca.getSvg()['points'], sca.getSvg()['legendColor'], sca.getOpt()['height'], sca.getOpt()['axisNum'], sca.getOpt()['drawBar']);
      }, 3000);
    },
    checkOpt: function (e) {
      var self = this;

      //check the Scatter Choice and Refresh the charts
      var count = 0;
      for (var i=0; i < self.scatterCategory.length; i++) {
        if ($("#" + self.scatterCategory[i]).prop("checked"))
          count++;
      }

      //judge if the checked checkbox reach the max limitation
      if (count>5) {
        alert("NOTICE: The MAXIMUM selection should be FIVE.");
        e.target.checked = false;
      }

      self.selectScaCate = [];

      for (var i=0; i<self.scatterCategory.length; i++) {
        if ($("#"+self.scatterCategory[i]).prop("checked")) {
          self.selectScaCate.push(self.scatterCategory[i]);
          d3.selectAll(".scatter_circle_"+self.scatterCategory[i]).transition().duration(300).style("display", 'inherit');
        }
        else
          d3.selectAll(".scatter_circle_"+self.scatterCategory[i]).transition().duration(300).style("display", 'none');
      }

      //redraw the legend and chart
      this.legendRedraw(self.selectScaCate, "#sensor-docker-scatterplot-d3", self.sensorDockerFunc.getSvg()['legend'], self.sensorDockerFunc.getSvg()['rect'], self.sensorDockerFunc.getOpt()['legendSize'], self.sensorDockerFunc.getOpt()['margin'], self.sensorDockerFunc.getOpt()['height'], self.sensorDockerFunc.getOpt()['width'], self.sensorDockerFunc.getSvg()['color']);
    },
    legendRedraw: function (selectCate, id, legend, rect, legendSize, margin, height, width, color) {
      //update the scatter plot legend
      legend.selectAll('.docker_legend')
          .data(selectCate)
        // .transition()
        // .duration(200)
          .attr('transform', function(d, i) {
            return 'translate(' + ((5 + (width-20) / 5) * i + 5) + ',' + (height + margin.bottom - legendSize - 15) + ')';
          })

      legend.selectAll('rect')
          .data(selectCate)
          .style('fill', function(d) {
            return color(d);
          });

      legend.selectAll('text')
          .data(selectCate)
          .attr('x', legendSize*1.4)
          .attr('y', legendSize/1.3)
          .attr('font-size', function() {
            if ($(id).width() > 415)
              return '.9em';
            else {
              return '.55em';
            }
          })
          .text(function(d) {
            return d;
          });

      //create new legends
      var singLegend = legend.selectAll('.docker_legend')
          .data(selectCate)
          .enter()
          .append('g')
          .attr('class', 'docker_legend')
          .attr('transform', function(d, i) {
            return 'translate(' + ((5 + (width-20) / 5) * i + 5) + ',' + (height + margin.bottom - legendSize - 15) + ')';
          });

      singLegend.append('rect')
          .attr('width', legendSize)
          .attr('height', legendSize)
          .style('fill', function(d) {
            return color(d);
          });

      singLegend.append('text')
          .attr('x', legendSize*1.4)
          .attr('y', legendSize/1.3)
          .attr('font-size', function() {
            if ($(id).width() > 415)
              return '.9em';
            else {
              return '.55em';
            }
          })
          .text(function(d) {
            return d;
          });

      //remove the old legends
      legend.selectAll('.docker_legend')
          .data(selectCate)
          .exit()
          .remove();

      //redraw the rect around the legend
      rect.selectAll('.legendRect')
          .data(selectCate)
          .attr('transform', function(d, i) {
            return 'translate(' + ((5 + (width-20) / 5) * i) + ',' + (height + margin.bottom - legendSize - 20) + ')';
          });

      rect.selectAll('.legendRect')
          .data(selectCate)
          .enter()
          .append('rect')
          .attr('class', 'legendRect')
          .attr('width', (width - 20) / 5)
          .attr('height', legendSize + 10)
          .attr('transform', function(d, i) {
            return 'translate(' + ((5 + (width-20) / 5) * i) + ',' + (height + margin.bottom - legendSize - 20) + ')';
          });

      rect.selectAll('.legendRect')
          .data(selectCate)
          .exit()
          .remove();
    },
    displayDCPU: function () {
      var data = 55;

      //generation function
      function generate(data, id) {
        var margin = {top: 45, right: 10, bottom: 10, left: 10},
            width = $(id).width() - margin.left - margin.right,
            height = $(id).height() - margin.top - margin.bottom;

        var svg = d3.select(id).append("svg")
            .attr("width", width+margin.right+margin.left)
            .attr("height", height+margin.top+margin.bottom)
            .append("g")
            .attr("transform", "translate(" + margin.left + "," + margin.top + ")");

        for (var i=0; i<20; i++) {
          svg.append('rect')
              .attr("width", (width - 84) / 20)
              .attr("height", height * 0.55)
              .attr('id', 'docker_cpu_rect_' + (i+1))
              .attr('transform', "translate(" + (i * (width - 4) / 20) + ",0)" );
        }

        var i=0;
        var temp = Math.floor(data / 5);
        if (temp === 0 && data !== 0)
          temp =1;

        for ( ; i < temp; i++) {
          svg.select('#docker_cpu_rect_' + (i+1)).style('fill', '#00afff');
        }

        for ( ; i<20; i++) {
          svg.select('#docker_cpu_rect_' + (i+1)).style('fill', '#f3f3f3');
        }

        svg.selectAll('.dockerCpuText').remove();

        svg.append('text')
            .attr('class', 'dockerCpuText')
            .attr('x', 0)
            .attr('y', height * 0.8 + margin.top)
            .text(data + '%');
      }

      //redraw function
      function redraw(data) {
        //format of time data
        var i=0;
        var temp = Math.floor(data / 5);
        if (temp === 0 && data !== 0)
          temp =1;

        for ( ; i < temp; i++) {
          d3.select('#docker_cpu_rect_' + (i+1)).style('fill', '#00afff');
        }

        for ( ; i<20; i++) {
          d3.select('#docker_cpu_rect_' + (i+1)).style('fill', '#f3f3f3');
        }

        d3.select('.dockerCpuText').text(data + '%');
      }

      //inits chart
      var sca = new generate(data, "#docker-cpu-rect-d3");

      //dynamic data and chart update
      setInterval(function() {
        //update donut data
        data = Math.floor(Math.random() * 100);

        redraw(data);
      }, 1500);
    },
    displayDMem: function () {
      var data = [
        {time: '10:01', used: 200, extra: 500, total: 1000},
        {time: '10:02', used: 620, extra: 600, total: 1000},
        {time: '10:03', used: 300, extra: 800, total: 1000},
        {time: '10:04', used: 440, extra: 700, total: 1000},
        {time: '10:05', used: 900, extra: 700, total: 1000},
        {time: '10:06', used: 300, extra: 700, total: 1000},
        {time: '10:07', used: 50, extra: 700, total: 1000},
        {time: '10:08', used: 350, extra: 700, total: 1000},
        {time: '10:09', used: 750, extra: 700, total: 1000}
      ];

      var category = ['used'];

      var hAxis = 10, mAxis = 10;

      //generation function
      function generate(data, id, axisNum) {
        var margin = {top: 20, right: 18, bottom: 35, left: 28},
            width = $(id).width() - margin.left - margin.right,
            height = $(id).height() - margin.top - margin.bottom;

        var parseDate = d3.time.format("%H:%M").parse;
        var formatPercent = d3.format(".0%");

        var legendSize = 10,
            legendColor = 'rgba(0, 160, 233, 0.7)';

        var x = d3.time.scale()
            .range([0, width]);

        var y = d3.scale.linear()
            .range([height, 0]);

        var xAxis = d3.svg.axis()
            .scale(x)
            .ticks(d3.time.minutes, Math.floor(data.length/axisNum))
            .tickSize(-height)
            .tickPadding([6])
            .orient("bottom");

        var yAxis = d3.svg.axis()
            .scale(y)
            .ticks(10)
            .tickSize(-width)
            .tickFormat(formatPercent)
            .orient("left");

        var ddata = (function() {
          var temp = [];

          for (var i=0; i<data.length; i++) {
            temp.push({'time': parseDate(data[i]['time']), 'used': data[i]['used'], 'extra': data[i]['extra'], 'total': data[i]['total']});
          }

          return temp;
        })();

        // console.log(ddata);

        x.domain(d3.extent(ddata, function(d) { return d.time; }));

        var area = d3.svg.area()
            .x(function(d) { return x(d.time); })
            .y0(height)
            .y1(function(d) { return y(d['used']/d['total']); })
            .interpolate("cardinal");

        d3.select('#svg-memD').remove();

        var svg = d3.select(id).append("svg")
            .attr("id", "svg-memD")
            .attr("width", width+margin.right+margin.left)
            .attr("height", height+margin.top+margin.bottom)
            .append("g")
            .attr("transform", "translate(" + margin.left + "," + margin.top + ")");

        svg.append("g")
            .attr("class", "x axis")
            .attr("id", "memD-x-axis")
            .attr("transform", "translate(0," + height + ")")
            .call(xAxis);

        svg.append("g")
            .attr("class", "y axis")
            .call(yAxis);

        var path = svg.append("svg:path")
            .datum(ddata)
            .attr("class", "areaDM")
            .attr("d", area);

        var points = svg.selectAll(".gPoints")
            .data(ddata)
            .enter().append("g")
            .attr("class", "gPoints");

        //legend rendering
        var legend = svg.append('g')
            .attr('class', 'legend')
            .attr('transform', 'translate(0,'+ (height + margin.bottom - legendSize * 1.2) +')');

        legend.append('rect')
            .attr('width', legendSize)
            .attr('height', legendSize)
            .style('fill', legendColor);

        legend.append('text')
            .data(ddata)
            .attr('x', legendSize*1.2)
            .attr('y', legendSize/1.1)
            .text('used');

        points.selectAll(".circle")
            .data(ddata)
            .enter().append("circle")
            .attr("class", "memtipDPoints")
            .attr("cx", function (d) {
              return x(d.time);
            })
            .attr("cy", function (d) {
              return y(d['used']/d['total']);
            })
            .attr("r", "6px")
            .on("mouseover", function (d) {
              console.log(this);

              d3.select(this).transition().duration(100).style("opacity", 1);

              svg.append("g")
                  .attr("class", "tipDot")
                  .append("line")
                  .attr("class", "tipDot")
                  .transition()
                  .duration(50)
                  .attr("x1", x(d['time']))
                  .attr("x2", x(d['time']))
                  .attr("y2", height);

              svg.append("polyline")      // attach a polyline
                  .attr("class", "tipDot")  // colour the line
                  .style("fill", "black")     // remove any fill colour
                  .attr("points", (x(d['time'])-3.5)+","+(y(1)-2.5)+","+x(d['time'])+","+(y(1)+6)+","+(x(d['time'])+3.5)+","+(y(1)-2.5));

              svg.append("polyline")      // attach a polyline
                  .attr("class", "tipDot")  // colour the line
                  .style("fill", "black")     // remove any fill colour
                  .attr("points", (x(d['time'])-3.5)+","+(y(0)+2.5)+","+x(d['time'])+","+(y(0)-6)+","+(x(d['time'])+3.5)+","+(y(0)+2.5));

              $(this).tooltip({
                'container': 'body',
                'placement': 'left',
                'title': 'Used' + ' | ' + formatPercent(d['used']/d['total']),
                'trigger': 'hover'
              })
                  .tooltip('show');
            })
            .on("mouseout",  function (d) {
              d3.select(this).transition().duration(100).style("opacity", 0);

              d3.selectAll('.tipDot').transition().duration(100).remove();

              $(this).tooltip('destroy');
            });

        this.getOpt = function() {
          var axisOpt = new Object();
          axisOpt['x'] = x;
          axisOpt['y'] = y;
          axisOpt['xAxis'] = xAxis;
          axisOpt['width'] = width;
          axisOpt['height'] = height;

          return axisOpt;
        }

        this.getSvg = function() {
          var svgD = new Object();
          svgD['svg'] = svg;
          svgD['points'] = points;
          svgD['area'] = area;
          svgD['path'] = path;

          return svgD;
        }
      }

      //redraw function
      function redraw(data, id, x, y, xAxis, svg, area, path, points, height, axisNum) {
        //format of time data
        var parseDate = d3.time.format("%H:%M").parse;
        var formatPercent = d3.format(".0%");

        var ddata = (function() {
          var temp = [];

          for (var i=0; i<data.length; i++) {
            temp.push({'time': parseDate(data[i]['time']), 'used': data[i]['used'], 'extra': data[i]['extra'], 'total': data[i]['total']});
          }

          return temp;
        })();

        // svg.attr("width", $(id).width())
        //   .attr("height", $(id).height());

        x.domain(d3.extent(ddata, function(d) {
          return d['time'];
        }));

        xAxis.ticks(d3.time.minutes, Math.floor(data.length / axisNum));

        svg.select("#memD-x-axis")
            .transition()
            .duration(200)
            .ease("sin-in-out")
            .call(xAxis);

        //area line updating
        path.datum(ddata)
            .transition()
            .duration(200)
            .attr("class", "areaDM")
            .attr("d", area);

        //circle updating
        points.selectAll(".memtipDPoints")
            .data(ddata)
            .attr("class", "memtipDPoints")
            .attr("cx", function (d) {
              return x(d.time);
            })
            .attr("cy", function (d) {
              return y(d['used']/d['total']);
            })
            .attr("r", "6px");

        //draw new dot
        points.selectAll(".memtipDPoints")
            .data(ddata)
            .enter().append("circle")
            .attr("class", "memtipDPoints")
            .attr("cx", function (d) {
              return x(d.time);
            })
            .attr("cy", function (d) {
              return y(d['used']/d['total']);
            })
            .attr("r", "6px")
            .on("mouseover", function (d) {
              d3.select(this).transition().duration(100).style("opacity", 1);

              svg.append("g")
                  .attr("class", "tipDot")
                  .append("line")
                  .attr("class", "tipDot")
                  .transition()
                  .duration(50)
                  .attr("x1", x(d['time']))
                  .attr("x2", x(d['time']))
                  .attr("y2", height);

              svg.append("polyline")      // attach a polyline
                  .attr("class", "tipDot")  // colour the line
                  .style("fill", "black")     // remove any fill colour
                  .attr("points", (x(d['time'])-3.5)+","+(y(1)-2.5)+","+x(d['time'])+","+(y(1)+6)+","+(x(d['time'])+3.5)+","+(y(1)-2.5));

              svg.append("polyline")      // attach a polyline
                  .attr("class", "tipDot")  // colour the line
                  .style("fill", "black")     // remove any fill colour
                  .attr("points", (x(d['time'])-3.5)+","+(y(0)+2.5)+","+x(d['time'])+","+(y(0)-6)+","+(x(d['time'])+3.5)+","+(y(0)+2.5));

              $(this).tooltip({
                'container': 'body',
                'placement': 'left',
                'title': 'Used' + ' | ' +formatPercent(d['used']/d['total']),
                'trigger': 'hover'
              })
                  .tooltip('show');
            })
            .on("mouseout",  function (d) {
              d3.select(this).transition().duration(100).style("opacity", 0);

              d3.selectAll('.tipDot').transition().duration(100).remove();

              $(this).tooltip('destroy');
            });

        //remove old dot
        points.selectAll(".memtipDPoints")
            .data(ddata)
            .exit()
            .transition()
            .duration(200)
            .remove();

      }

      //inits chart
      var sca = new generate(data, "#docker-mem-area-d3", 8);

      //dynamic data and chart update
      setInterval(function() {
        //update donut data
        data.push({time: hAxis + ":" + mAxis, used: Math.random()*200+400, extra: Math.random()*1000, total: 1000});

        // console.log(tAxis);
        if(mAxis === 59) {
          hAxis++;
          mAxis=0;
        }
        else {
          mAxis++;
        }

        if (Object.keys(data).length === 20) data.shift();

        // generate(data, "#docker-mem-area-d3");
        redraw(data, "#docker-mem-area-d3", sca.getOpt()['x'], sca.getOpt()['y'], sca.getOpt()['xAxis'], sca.getSvg()['svg'], sca.getSvg()['area'], sca.getSvg()['path'], sca.getSvg()['points'], sca.getOpt()['height'], 8);
      }, 3500);
    }
  },
  compiled: function () {
    var self = this;

    self.displayMem();
    self.displayDocker();
    self.displayCPU();
    self.displayNet();
    self.displayDisk();

    self.displayPeople();
    self.displayDisDur();
    self.displayDetec();
    self.displayCount();

    self.displayDCPU();
    self.displayDMem();

    setInterval(function () {
      self.people_count = Math.floor( Math.random() * 1000 );
    }, 2000);
  }
});

OHA YOOOO
����JFIF��� ( %!1!%)+...383-7(-.+  ---+--------------------+-----7------+-7-----+---++����"����M!1AQaq�"2���Rr��#3Bb�s����CSc��$4���D���TdE������'1!AQ"2q�a���� ?�Z�L�[�����=D�6]�T mѰx$�6��@ۣ`�Itl �"��(6�Dst�2:��Fk���x���4��K�h}�l �?r��@��!�Q��Y��?��-� =��O�����(6����<A�x%B��<A�x%B��<(6�@��.���*%���$e�m��T�wi��~H�]F�Ѱx"�`�Ul��ꃁ���RPl�6�UIA�x(���#�B��zy%�<�L���mvN �ԭ6�Y$Qk �S��䮰�K6ף�x�+�T��L4���>�C=j�������p�|J�ǥ���b=���Y�6g9��F1��Y�vݩ�`��塏��>� � �ݨ,�����A�o�=W*���"��>����� \ �"݄(꧈�y���9�m���d�aAD�u&�T��D �@$BITU�"��D�D!BH�� � �UTu� �^c�?�[ND�K�`�\F'�jf��<�G�G��B�q]�����!tl�6�]\4mѰx"��<�6��B�֊�o4.�Ah�8QM,�y�����%cLh��y�c����!�8Tb���h�!p�q�t����EIA�x'Pl �KT N h6�J�P7�6Ԩ�6恰&��� �� � ����R���)m�`8�nC�J���E��%H� D�"T �n��W�s+���x���+g�?t��@�����;�>�o��0�����|Ћ0�����|"�J�%EBBBB!X�����|��X��̟s��Ӭ��H獎ŏ m׷�0���—���2q����s�'q]�����7�%����hp8EAYy�Ӗc��9%�A� _g�ٙ���}ӯ�Ul�Ƽl Ѓ�a�ۮ9�i�*��R"�*������:��j�zE+�H ����kB�2�e��~��Zd# ��0Vr�T�ev������Y�����-8]o��x�~)�9��}W:RF֟��P�A�� ���G+hH�P6�����:���Ԁ��I�O{Y�F��$U"H�#2��*J����L��L�B�*��T`���(�-:�R�H Z��"�B�Ihh��B�B�����urP�%� ��9��7v",�!�A�b�X�V6F��� ���^K�+��f��qm^��'�9�K� �����o��! ��P�%B����E��}Xo�U��(BXJ󥯢t��u�&�}Xj +%�7+�c� �\��t�9t p*)��L�Z��T��KTC�NGT�PH pQ�� ɚ^qB ��8!�*��� P��"T iHS���n��W�s+���x���,mtG��@��D~���� } tY������Y���4����!!@!@!@!@�a�^h��R���*��|!���Us;����n:��#���4-h�chW꼝���%�+Z�kA��E%��4“M$�����@y�q˓��ʽ�� $U��������eH�-;�a�ކ�&����*IB� �Z�w��;c��|�3JZ@��-��w�k������Q�Ϊ �g�d���I��G����8�N�G�����(R)�2�_�]3;]z7]�2�w�r����I�Iĭ=15���b~ 2�{cuO�'෎V�nyI)��1s�� ����i�lT*�ݠ�������H��p��^j�C�Q�B*(������(m�Wb ���Z�)P*D$EGimZU�ViZ��┵\�P�L���IW���Eh����[榚V�R8+l��zV<�B�M�j�V�pw�%�*�UKYǒ}�J�% ���(�����HM��NQ�S�toԝ�ܪZd�ল���,UP�J�=�Z m�T��-]��y��*k+���:�%J��V���X�i�o6�D38�h�=� �'G�$�@��X��H�P�~��X��e�Ã�����4���WS��x�3���q�˓V�S��k'�K�w�N�w�eb��,��bcw�1�� �ȃ�%����͖��Bd�J��*V�Y��.;Kh�� �*���1 X���-�� �OJ��$ sCU��H�Zj���N��e�m�zT�"T��%���8�(Q�4 雐��d8���j�$NH�'$@�� �a�< ᴖ��K��W ��5}��{��-�����w�}�,Y����䴣�,��S�|�R��BT D!�R ^��I *I4m%Gk�2&�y�m$�k;�7m��sW���:�q��!汖s��]�i�;(��ƣ�7_�Ve�o\㛜K�y���T/.yܝ�2! �AB(BD��ꦽ� �EX�w2��\�����^{Nɥ�=����lB�V���y ��t||�K$�v��Ȃ>* D��Q��z$�y��F�MqD��(���鍵M2 �G� ;[r*4�T�Rd�oV#�t+���P�A-��v�*�>��PhU ���-QJ��Y�mE;k�"�F�?%���R��&������G�ӳhx;�i��h���5��+�Cr��8���B�:�+BI�Ϯ�LOٳ��=�~��,��b�t�C�6p\����x ��«�!{�ҽhh��7<� ĊW���<�CNw�ai�@��ںf����j#^�Ny���\^rRU9�1u`�RC% T)SCM��VtR��U溢�f���i�|��Y/SpWF�V ��*�A�5)%T9����'B��O "�TTTQZTm�Dv] �����U����������R�����5�/B^�.�/���"rE�8B)�"�P�D!Km�<W��y�� |�[�m���,Y\A�]��7��f����ѻ,H�Zj[���eh� (N+P�U"N�*���ء6L� 뛐�������"T D!BBT�"�#��I~%�͑�W ���Q���w��] ���.���.��<���O��Zl�,��S�|���%F��9"H�Cj�66��4Wy��NTR��i Y��� '����|���c<�fژ��E�����\>.�|hH�Yem��&��"h!!*lehjӼ �s�HQ�b���� pi�Η|h�'�Rh��SP3 ۽�$0��P X?�w�-;5���4h�{� ���/U�v ���ְ\2o��e�����@(��+�u���Ē�����B^��&�M]�B� �"��D��@!@!@!,�lΖF��W=���^����da�cehi�����_��#d��[ 9_=�]�Ù^�$!�-p8�u�(B�/� ��A�!�����\�F4q��3����:�[�>�w�ك�[���]��<��[�3�'��M+�yMH�R D�P��(�P��AJ�b Qq�F�bq�ߪ:J�$j��8�-5 ��z@�#��K� ڕ�N ԺKړ�^y߉�Ԭ.�tv��n9��w���n�|s�Z��;q"{���9�! �BJ��BMe��=�`���֍�&�Ba�{� ���v ���@�> ���lp�6������uRh�"�i�,ɯ�79o�*�� ��V�&�[\v��:�bq k�|���\͒��1��]q��C �xi")��*0w��{��0�c��������߸ɢj�X�MQ����Y�R%B�D�P��!�$@$J��J��K�����r^�V~�� p�KWg���.��m 뛶���L�Z Bã� U; �H7�V�A��+�B��r R7!�%\���!�!�!�� �a��W�����+��Z�cw���]�C�D��}˽��]��g���>KM���?���� G�4HI&����i=,�Ge��*��o���ׯ r�c�RZ����$� ����fӿ.:��q'\j�M\㼕j�g�߃rh�� � S\ ��g���d%UkY� ��?Nn>�Y$ &�,�[/I�ZC��>�a��S�K��p ��� �Ƭ�QY�X��h!M�m�h�8]p���y%� C/gt����ڭX��� c�iW\�;'�i�� �atd���ā�7(6L`��]�=��hP��.�ss��X�9�X��ji�;��t��\��V���0f�87�U�?k��ww3W�|��=L@� ���OG��bv�Z���uj��AD�BEjubӨ&����F�Wgb�G���:�uT1��ni���y|�X�Etu������n�k�D��q57���g�A�n ��X]&����+����sD%�0�p��<��Vtm�����Z���9�^�Y*�(�{�/��j���sn}uz�����_n����������MErjΎ��[#N-5�5�a\��cu]m��M�WN�b�_ p�t�q�~ '��H�- y�@7%Oj�h�y/B��d�k�-{o�,-5��i�4toWx꘳�_�(E�LJ�í�m;�]t��V�^23I�{�h�g�43-zJ�ֽ��g�Z "'!N��:� N������Qku�8�3�n^���s,�6(� �nv��.�),��eƷK�\K����IPO�A��������e�K���ڌ6����yW�)֋��Z}�m{쾙��x���{hyn+/EY�l�W!-�$�U.��I��� ��� �� �/M�;��Pݎx�"~+��Ή1�&ѯ���=����#�ыv�$�[�"�R��To�v~)�U�˨ x0^q��S���^�d����ʠ�W� ��5�B���dy"��&�õ���c��g�+��9��ugh�ޖG���7������ �곗Hz;f�L��`8���{"��؛f�1��&�)J[�I������!n��v��b�Ik{�������ŋ���qo�s\��}ɛ\*KO<=h�L�2�U��Z� ���v���[O��8�@7$t����4S2r�ʬm���)18op�?��]1%�<��&71�k�.�s$.?-��s�ïZ� C�DjFC�w֠r+�@U4U��xY2����N�w�S�\S+�� P�0D��� ����R�>*D�3�֎m�Fu��v^k��,�9�-�V����M�k���Rw֏�Z�[Y�=���q:Aů%�>�����O�0�pmӅC�^뇍6��+E��N�f>29^L����=e�gi�-0�����e�W5��U�E�x�і��(ZKH�F(�Y�mrA;Gf\�H�z�G��iw� �^�r�y������-.��9��2|�%���ÌR�����J��� x��ab��KD�꾏!�k��D�s4o���F/9�2��fv��?y���z;WLC�T�*���l�"�b[�qi��A� ����Vf�җ�W'fA������� ¢�#h?%.�҆�lߊ�_��w� 6�uA�*V�;M�y�*�OY����1MZ6��g1�PsWiv�e���%B����@�B"�@$�TQF�т@p�q֫9��+��F��bF� VljWx�B�%���L����ۗ$��˒r������ � � d�p:KZ����+��Z�c{��r��D�ކ}˿h}��"be�I !���-[��n�{ft�J`�ь7f#�\c�{rڱ����T0уQ~���Q��h�����9���;��Ֆr�Ts�Y�dt��L�ٳx�R�i�<�B�g�=��^caؤs�EI��SAEɤ6�\��b�pn_�Z�U�u�� c\}Z�a��y��B�PZ���'�Ya���Ʈ��N�� ��I�C��,Vp��+A^Y,��,h*��[P�!�|�����I-,nn��& �x��u )�T�o��%��]8-x�m�dh́�sz]�/�#�}�{� �uq*͚��1=��g27�4�l�;���Rn�v�G�zܑ`�Z9���j� �ᲈ�X̜�]�$���OYɊT��2� %BAJ����� �:�uԮU�j_� z'�48d�T'��F�g�rI�Ƹ��+ :��p� '$涨�䳶J5�k�48Tk�[;c��K=��zՕXʛuS��"��Q�8l �m��ˋ��k+���ᴇ��$V _�%$g��k��]��GZ�t�^ʹ�쮣��k��m�2V:9׊8c෎v%�8O�&}�����]�\�G4?��3F ,�6I9�k��^�����m���TЕm � J�P� ��}�� ��Y���2��}�&���{��|(Y�o���J���v�qܶ��EAA����BG�o<�Y1�K+�����۽���^�dŹ���-�v�����P��It���sh�VŦ���ޫ.H�4+�9m�ώ�Q �H���%D�@�!@�%@AFkK��B�&hCm��8'&7.A9y�P�$J�B�P�*BJp< �t���͑�W�����E- ��#�h�8��� {K�s���Zgu���m=IU�v���;!�cϴ� ��J�"r\ 0 p��+�8T��e]ĵy�rߧ\'�4s\�ep����� <�ޑ}ƶ!��9�V�Mk]R;1���4L���'2j���B��F@c���f���e=�k�t�n�?X��2W����j����&��Ꜩ�n�WԮ�5� �����G���|h�m�(ݹ��@Z��VY$?�6�qy$�'���l�z��Õ��I���pK_ny�Tlq��<��.#��)��&���0�)#;s�`k��xn5ʞ�4�-�Y� ���'�kFe���k%������=�{c9���u�L�Ut��,�`g���iS)Z��Z@���l8B��P1�y��Z�ѩ�\�㏲Vk���&K,��I4����iX!��U,���7‰l����`t��E�I��ʺN�P�(����k!�}֒�\q��-m'%؝CBh����aTn[�%Z}�C��0P>bs$�)�4���x��9E�&�^EQf��!�mt�z��8��ձhR�Rw�ͨ��{>g��(��c�C���p�� �޺ S��n� l���$lgn�ۂ����I�{݉$�XnM��-{��Z��E-����n��*Si/`s?%��8��6�<����� \7A��WZR#���Ǔi�˹ V2*��B�� �� T�=3n�&юA�� ���%��_O� ->���G�EgJ�C��a?��tl@����6��m��Q���p�s(^���*�� � �Tfi :�b��Ed���׀�|c���8^a���F�[J�~7*@n�3��2��j��mik^��NyF�J�g�������6���*@��Pg�珢�C�g��*=5���R��g�=U_��;G�~)&��M���\<�F,�]�&��<\o�L�]����g �� r޿��������$kk��i(�!�ݥE�V�E�;ͨ���헮�����5���TiTM�z��+N����Ī��J�e{ݺ6 �n$�q<�Y�!�1�yAs����.�@��U�%+�έ��u\]J�`�Mdփ��C���;3��:&�^��7NK ���øS��]��'�7v�M;�ä\BD�1�P:�J#i��u��e���mZ���<���X?eew'8��� �=��փ��.����Ԯe�c�e�O)�KZ9 rW,�����a#[���U[�03\ޚ�\QU�3���L<⵶Zv�dP2���4d5����\f���f�b���н�~��x��e�I��J��e�M2���d��oݴ���\|2M��6U�.��RYt|���O~�Q��pV���։c��C����E:�9��q@��N�D�;� �y�;M�Z�3���BԷڒ� ���Sm>�t��q�O@��=��s�6����H���EAi����e��;��ղ� p�<1T�&��79�ǽ�1#�5��'xµ��eODB��Z^;@7o5���"����xZ+�!S6�<�&�5��z���xa�.������73k�6��Yc@@ � ���D� ��� �f����438D75�/?��.�%����� � ?�7�L�)�u�����ٙ�S�]��s+���?��r.�G��e���sBBB!Y�4]��) G���g OҴʡi�͐�6QԼ�' �2wT�~��p嬙�z�q��ˆ8a�-��f^ˆҀ���L����E4�GX^�5�(�R�a���>���F�v"! �5�~>�]�,�~*2��n�M���>�i�A �B1U����<�R&��ϊz2�*FV�ѵ����Fm������Z5���~�r�T-�=� �1�7���pP��N �otg���dǟGo޶D�l�U����T��hp8��ε���n#ӊ�[y98��(�N!![p5 P�D! �� $8��r�#r�/;� �ȪD rTԨ�J��f�y��i.w�#�n ��k��V���#�b7]���|�^l61�w�ܼO�\�=�:`��s:=3��H��zJ3ʾJ*�Ղ�f����V�8�c0�pV[�u�!5��*ZRJFw�|�(�Ù���{���5$�8p �d$�A�J��rI���4��Gm������V�2����#2��Y N ��C��zy���+e-���q��H�]<�9�W{��%&��g��2���[���sq �U���f�Ӎ�<.���@�e=�$h�y��r��� ��vޢ���1���{.�%E�I�6�����L,��s���F�e`�Z�w5�� ��?� ���uzR��0U��?́o�i#���t��)�u[#�{M�9�q��劘�?�OdqOџv8���q>�}�c��Y�:E��U��tj/�i��#�7�yQl�����4��vUg�~;�h�� �@'�\�09�9���S�Z�Ӕ�K]��KE�8�l{�?V��ܪ��{ւ�ٱ�ԕ��zd�U�tD��~�*.j��[Du0=��w'�kR�q��z5 x: Dߘ���k��WYh�Y�OUg ���t�w*�>u��du�L'P�����O%���iuմ���=�JpvnZcm�^��OٱC%܌�`�����Ee�L�u���غ�^�owȭ�<2�����W���v�����[�KK_P*�_i�ͮ\A�Fl��h ŭ��K��r�E��;FB�qSUs�'�W�'v�ߴp?tës��`�bm;b��H�bN���q�A���u���ki�Ԕ4A�J���"Ƌ��36C[�sLM�k���⺖��/����z�(J+{���+�|��8Q��\����͎���g��ޫ#-s\�F@�d��CR��4;��Y,⍾[4m�1��m�>��4�9B�� .�%�WTm�w�����Z։n��+�vD! :�ZO��7����t�.�\����u0 x��K>Et61�g$�B�!@!@!T ���%�̭/ ��]Ȁy+)IF>�����Ů����;�+Y�p��xzqY�3��!r|�L����͛��O�ތ�G�{��snV/9���v{Cd˲�~JE�*T�Q����[�G���z?{� �T��pg�H�;��ϊzBHP�m�6��`�>�n>��V�G� qEh��S� ��h�rZ߭�ю+$g�� ����xU:3�4��M{�f���^'�ܰ�}�7�y$�u�V��R�s@z�Z05��4d�i�&�Эe-��6�5���]�v�a# %dU']\|��vv���~����TuN`u ��I�gn'������C\#�|j�>�t��"�3�� ��$��̈́��1��K�yƤ��;�'⦉�A ��4�B1*�J���ft{I}fɓ�� �n��n!>ۦ!���\�n�i��& �s���+>]%yŐ]�����G�8f(�m,v6�{s=� `�8:�`�G�;�à����6��`��?S(V�"6觼}��WW�lQ�p��J�l�ST]��0V��LX?��j�,��ԝc}��O�;C�)�v���,toe/�Ԩ�D��hhFí] K&��H륎l�b�+'�.��Hޛl�> j�c�woI�����`+�Jݶ�D���z'S�÷/�r�_�[A�i��7v��w/��@ ~��T�pɼ� ^�)�z34��$D ��R=�l�[�j�a��FGT&�ŧ6��V��H�S�ttY]%o�3��y O�Y�4ⴹ�����D��F���94�zx���]{ܾ+7��*;P�nX�E I7t�XW���4�KD��i���epS��B72U{)B3cZ`nc;����բ��F�<�72Bמ������\k��F��?��$-�F�� ��Z,�fHۯhsM*�4��FY��@цbP�\�ÎW:s@JE�.�������b��N�D�$d��w�]49oi��Z|Ŏu���+}�WC�6b| Ǵ�P[��ps��Q��`�����=�G6�c� �R]N&�&�Fƣ������u�� i�Yњ[�������n���eu� ~,�=�k�4d��Bז�������;���Q�˴Ѱ1����()�yT}4�5�pd&�i5��n�ZvN������eÔ�br�~^�6�����v�m���:���Q=�8���O���Pw8��汴gL,Ґ�(�]{K��<�G�����+,o��3^�暃]��j �E �i#;�Դ v�iz3ƃ� Ap&X.Iڤч~�vNBAMy�uf [��u@�v��3�5��$�V���5�����9��i?�72:ր7U����S~�"y$��Rv�C�+�5�NЋh������ �mt�+�4��*$Ұ!�1�����z��:*��3�l�sX�1���h�J�g��`{NTj#h#Q���yL�y�ڜ1,}d��h�qh�p�Eq��g,�f�����(���]'�E]�����S?y���O��G˽G� ��?�͓�$�Ew�4{���I�i=��o#�Ը�(��Ru��[�L�ܾ݉���e��������_�g��?�\oY������U�}'����A� ��������DU�e�����M�o��/.S��o�aVsd��H��a�2v8�����V琽셤� .q�"m/P�$����u/i���V�;��:���­�2��W��.�{uÖ����>���ô1���'2w�i L2 �W(�}d�9����� H�A�= �!�) �d�\D�������ԥ�f���j F�AA�p 䴖u�G��XHd����L����xb7�Ly5�X�����׳�G������a�����4���t9=KjIµ+���c�x7�Q���ߊ�!T*��� :ߣ��nb)�h+E�����̓�k�k��+MU�X� ���=�Л�Է&����ݽ����;��]��Xwj:���b��C�Z�i�>9��sRf��h����� ��y�NF��%Mn\���*TԵD*Tڥ@�SP��SR�Ir< ാ��=���|��$��\&����ʟ� ���].=�������ĴsX���U�6�����*�]q�T���s�]¾�%��> Ș������غ�C)[�x$���WL�(,P�6�m�� mķ�5��MJ`QU����3A��k�W�6 ��� �����p8��5�G��ߑ�8�8�㹠rZ�hm nM��\�/��R�D�45�Z(� 70�B��Ktu�/=uƨ�:n;�y[�)�4���Hʂ6�[yƙō?�4��P��;��Ini���l�CJ��_I��j�,m��A�)N ;o�?�o�+�ש���BQ]t�i�h�RQKu!��j.�HIu�D�W�'�EٴT�il�}YV�>�{[��������uV?Gض���.>�Ol�/�+�݌@�;� ��Kr#��yͮ N��R��b�4��f�+�N�������q���๮��'Z�hid/-m�/�����y+)���4��,�X��p0dC^��A��jk�h�|.��6݆�lu2?T��р�55�MJ�3lWL]U���C�g ��o �W���~���˯P�@H��H�۲�(rjD��OE��E�����˻L�9r��J�q�����hΝ?�b�)9�%2��׍k�(��p��D��l��8„�m 3�J�U��b���� 鵝��C+����p��;���Ŧ��L�J�6��VF���_�U�z���ϴ���I�U��"�������.�@f�I��f��8�R.��i��6�X�V���Ү�Yg�u&GK,.oU#X�H܉qp7{�h����@)�$����j���`�I��5�lQ����⊪�y f� �CҤJ��!%�\��o�:#�V�DkpVI=���h9�n�� ˾�gcm20�����u�p�kȯSj���姫�z�N �և�K�lg}�a�ⴴ��8_#�Ɨ8�h�y�EzGz�#d�Z]V{��o1�6�2;nG�4� ��[�Ⴐ����$�W1�� cƾEJ��'��S��[��Z�(i=��j�skq����1�mOF�,� �h�ܕ��0��1�P�v�a��6�N��ӆI���Ln�1�1���滑�x�l�x7�v���y���X���-�)���W�]�uN�P� � ��y�(U� a���m h&k�����(������gk� �1��M(]��7�v� �xi�K,a„,y"������j��<6V���Wm�' �c[]N ����@ܹ'U1���R��@�SR�T$�J�� &G�\5�}��� �Z�w�O�yfy��7�\O�\�n���=��(�.��v�OK��:�����2Q�q�� x�.ӦhC��=IU�ƙ��h��' �)��R��E�g��cuG!�i�}X� [K*����+�m+���F-=a�H難�����5� �p�U\���fd��#��Nh!fݪT׶�*" adL����edr8��߼�d��PKt�{\ ^�{.i��P��$l)�[�Ǎi�j�Y���8 5>��e�p'�D,8G����C������Ň�5ql���+u � ����Tv7�`;FK�� c��Tƫ�zQ�>�3�;���1�V��N>R�Ň�G'/�?�ƚZ�ˍI$�IQT�NB�2>m�6�o�K��rU�!��Ev�BiT�"�BH� � \ڧ!w2�VSKVt�D��k��p$�L��F�<QoG�� �����׍�9�Ts^���̞&L��Esx5��4�E�0�����VX�u~6�t<��sṷ~�t����O ������xR����Ů�\��Qk��� �'<��jpx���Go��R\�S.���Ë�ӯ#�: ���~�0'���t��ׁtsK��hd��4����=���^��{Z����i�EAS<|j㗔Q�E� �� b4���<��-KL�_��J6юÛoj�\�b�2m�9��Y��G�_������m�/�B����lo�H�aR93�o �=����Y#|�IBZ�h�c�5�a����sՈek���F �*N��$`sH ��2 �U7���?w+��:�!�t\�p�CP]x��c(�A)��Sj��qm> ���0:�c\�=��|����V��1�Q� ��j:�1 9c*�tx:�i�hAe p"��i��k�T�no�;�)Ri�w��WF�upJ��@�SR�pB@��6�j�R�Bˑ�W�WHv����o�v�8�uO��G`W3W.7����}:q�i=*�GĀ�,�7%(6��I�ݓ����xM�`8)����$��$�WfY,���64��4h�����^;(u$��^rf�ơ�3䎉�u�V_xg��9����N�р��ʐ59Q���4V[�4��M��X�L� 4纥5J� ����k�r4vdh����O*U�"�!����3C$�"��+G㌟6�G  �����Yt�Վ��2sN���ɉq�@#.�暁#?)��j5)[°�S1I��#��p�C�KKi#��'ǵ�^���/��LK[�7� �s�9�;ҭ�J���x�J)^�U�{'��EI����T4T�}�k�+ �~#��{j=�ﭑ��t�����\�A�/g�;���k��O��V��훧-Ή�k0|��� s����y.|G��W8���<έ�-��BKc�e�;��[_�+%g'���o��i�*V�@�#�TM��Ց�9��6��w ���ed��R l�N��M�)J������G�V�L�k?UQPK�#��(�/F᳓!d��dpȜ(���n��E���t� qX�"��Y#��t�}�`��v����FY�=҂ )`4|���]��xS. ȥr��ZFI�t�>�ƍMh��%{x0���͗� P�B�� � JS$U*B ���@!@!@!@QB!6��� ��-ςVM/F�µ��A�� �4�,�Yt�}k���X��6^�P�{��ӆV�&��u�F�v�Qmtg���g0��-.0�ݺ���jk��{�'j���H�W=�{��8ԯ.vd�$�Ҭkݺ%-ls�����|�Яn�A����dx9�g�x�Y��Ln$���)Z�sV4�cO�Y�F<~G��b��~�?� ���m%��w�џvH�)��bgH��,��f�%��B^�}��O�o�)��ү�����e�}۟Խ���.�c�$p������H�׆��u���5�x K#��.��P��i�vG0y4+��~�?�<1߳�O�~��-k�^�!|lq���q�HJZ�AT/S�Np�UgDXoG��E>;Q�y;_=�Xsy��C!��a�v�u��'9���k8v9�#��n���4 qћ���q x�nz��|���b�,�i�� ����x�we��R�EB!@$)Rn������z�x�F�-�pBF�8%E BD� �J��J��9%�<���.�Uͅ��Y)Y�$��j���b�7=�;qB���y�o �u�sV�^���qǷZF�t@�}nA�D�� ��!�k����6�C!Ƅސ���c��$/b� ֆ�ZA�P�t�yS��!e��!�!�!�!U )a�s($��7�sc�+�+��W�6y��Z�s]�k�k��P��Nٺ�[� ������zZ��X�PZ?) ��;u�\_K#w�~8�N�+A»n��lQ�]��$���]�IIC��#�kN ^�����C�<�i36���~ � ͺ?�Y�չ$o�� �Ů����^�����@ � �ZG�S�a��� m k�w �0�AA)�Ǔ,z�8�&�>��V0�Ƶw�ܵ����(7%U��-%��c�l�u�C{��&Yܻ^L�f���sZ֊�8�� 䬷[m���O�i�?x�\�L�g.{�+��1���\Ʀ�@ i�NB�s ��龝F�Yfi�� )���Cy\���\d��{��s�4��O*�N⤞�u�j.uMv⚄/���|ܮ�P�*���R � �!P$J���PMN@!*D��� �!%�D"��}��:�f�R��E�z�х�}RFS+�w1�� �x/7�O[v��^�������J�).���`����Hm�ROz'1���0�\���S٧��Q��g?W��ub{i��]ą��Ykhu�����c}���]|�*�'��ix�϶h|�*7�����!|��X�<2��H�g��k���=����8��4k1[v C/N���{Z p�ؘ�Mݧk�-��4������9B�v��y9r�^ɡt�v������4�� �V�^S�+��z�:��\�.�w�1�}X�ö���j�3ӿ��t��O!�_��C����&]����o��4 �����+���ľ�&Jw�X> �KO"��`��V �n=�a\{k?�UT�8%_F>aP�"�R ��@���P �P�B (Q�)�Oc��ÁBi ��� � � T!�R �F4�՟ q!����MN �w"|��Jr��j�7Wol�����C���R���1����[�x�B$?_����c�*n���i�W��������/(�ұ���ͻ#���q�H�� �L��V��u��/�^Ž8�Q���s�t���Zߎ�&�������y5ɖ�eA�f�7B� Y'xP�CBq`��C0ƻT�{��G�,�M� �B �#%�=�_Z��l��6<;�W�^$һߣM'G>�Nl~�x��T�5�z*AN ��Q�v~*D( d�ge���:³J��Pv&�\ ��j�F��4ێ��;A�9;楆F����ӟ-�{��-Mk@� ��*]�n��+ pp�MB�L��x�ɻ��Tdؾ���d���Fv�T��*;BBBD T!UҖ��3kG�L<胗^.q�r��^7��Wkh�3SX����U��v���7K�8��}h�̖��=K7G<�%���KJ������}^�T��/����d�c�f�*rBBBBB ��A�zF� �HBT �zi�ʗZ"���ƽkxH�v�? �C��%y�Mz1�8�aoٻ�h~ONƹ;$�^#�u�6!5��^���O�W1�.�]7F�`H��bw��\�GԮ�ݛ�p��]"�x{.�o�� �R5�S�i���څo��+��X;���Z2�M�*����FѬs^�l��9㓼�P����9���*E��cHQ�k�f�ٸs�Ժe���� ���\/N����>n?%��t���3��ަ-������´TV��1ߕ�� �=����؎ �(��} z|�T! �BD��E�4�d�\��T�R%Z@�!�* p�@�P� ���f��HF�/ԦM�&���! P"���T�A�У�g?����5^ �m� ��w#�����ndδ>9�m�����Ƹm����{z�o�;E�G��ݐ�g�>��`^Ch��^9�I�q>k��}%2��;Ee��q �i�� Y��8Uk� {g�=�2Q�pAM��Gխl|26X��y�8�TsUKT���z3�Yl��E�4�FV�]��A�~J�{��Od`9����}�q#kA����su��{.���Nװ�5��#"4\,Ӵ�qb9�=hZ� hv]�k�5���0�x�հ�+)2 R!C,�vNН��Ɂ��G��J�#� ���5�-f�=��{l�o`EA�*�2^��S�e� ��8!W6��4a��#��%Mn\���P�*)P�*D U��Ii`�I94�>M�Z�����6�k$y�KCԳ��5gl��dv�s$���W�~3�B?t���xooL�WC�z�tm���>�;G�i�z��}��M,�}�a���S��5�M q�:r�`!@!@!@!@!@!@!@��E�8q'!�=2��՝���Լ�=K���:�e�aX�A�489�c�j����^����EA0B��t}�I/�������a����<�r�9-6j�:��������+9�,"�� �������D������F{�=������t���P>�s=�?�Wn ����1�;T�Ŵ���j3�8|v��E����OS�Z�� �����-i�p��׆֓Q�Nn?/qǃ��껅���m� ��.�9�p �dAȮ?���B��0��ג=�L�6X�G.���Uev���$v����U/N]�:�T�uB�8_O��g�B�*D�6L�`��Dȃ.k?*�*D-!P� � D�F D�(���P��b�:��KI����#��+l��TB �B繬cK��5�hĹ�4s)��~��.jt��p �P�MGjPb��;ݹL���Α�&�|Խj���Y/:�/7�`] .��j+�y�^��"�[,���i�fY�s�ye��66��$V��;�W��蟭۠�f��d����R÷�;�X�.�:�����7���p�+�ccs�m ���(��fM�m���[,P0E ��|&)#!���� W"3"���aӯ��~� ����������hk�7�.f����*RK�����ߢ�IK~Z��]- G�TDӫi9�����o�Me�ء�9�Dz�$�8z��`@��k#�2� �^�C��Ѥ:�F�ܤ�� u�E��C������_m H� ��v?�m��W���.���8C��w�q澴��������$�T��Q��D�kFƁ�:E�g���u�GP�����;���yu�at.+�(�0s�y�?���{*G:��*k�E@�Ȃ����47N�J��UƐ�/�i#ۈ9�{��W��~.��Y�](׀施�[MU��Xu��7� B�T!"BD T!!!�Al�2F:7�9��X�qS��V� �m��$�2{.��89������,�������#d�#��]�����"tR �ÛN�4�!p�j7� l���G,&7bЇ��G G�'X�e��e���i9��x��#��D&�G`q�qR�|x+C��L��C�ѵ�7�#�1��:��F�fR�Ni��,�� TҔ��v)-�@�dto&�:��x���5�J�^^^?{�g.櫝R�M,���'b�r�c_?%�&��O]�H�D3R��5�����OBT����P�(�R �f�P�D*�,d�>7�NrUB�'jICِ��63����&��J�QD�J�E�e릊��t��xҍ���ܫU�I},�G >�����äu�Hb���#m���c7�$M &����Y;��دH�9饭���m��fN�/�5�`Z{ з���%�=� _[�u�{�{Ndv����kk�M6�p�'8H�ėd�%K��{F��>��9ͺ�lkh��n�N׹� ��.��h#G��� ��o��j�<ׇ &���0���R�3+�N���� ��4��kE�5~��:��5���A8�k!�c�c���i4�4T8ePuQ3E}� ~���GՏZ޺id��n!ΒS�2�٧|n��D�E#�}6^iY�O$���z�<�L��@VcQ�} t�i;`|U������H ���KC������Z��[\�7������^�����87ch��4��V��mC��y� ����81�������SPv?C�^8-��G Lmc 4k]V����` kj��cm|�2="���Z&��ZZ�� Mpk�ZV��Լ������7n ]�6���]���ˡԢ����.��M ���4{��V9��Z] d�ɥ#'�P Ay��ю�M�2e{#�ѭ܅M7*q���MN�v��I�HsIii����FE\q��諒*�-� f4� �5,�G�ZN׹� v��ql�#���G��=�|�t�q�U�$�¤�P��z7n�Ŗ)+RX���]� �5�;A�\ѕ��RBOݼ=����O����g�y�ˤ�f^�u8X-�fk�Zj�H�j��7��[uSr��]е��6,�M�ё�渐�iZjä�'d�\3�[�{��\���Б ��H���}㸡%�����i��R���U����P R!���?O�H u�[�Ok�C�=nŠ{O`�PO�+WN�YX�a�狍��5�+*|^����?Լ��n���I�v�vC�W�N�wh���u�6�^���H�� �`+UP������B?�+�n!"TFu�:;�*�ԴCxo,�q��&�4���ne>����L릏��#}���g�$�W�d����O�ZkC��;�г��;�dZ�aݶ�J`���=�c0���=��if����oٵ��Ӭs�. �sIk�X�=�0~#X:��q�yG�� Sh�[���u� -5i�GQ�E��вZE�Dq�ym��ਨߗ���+0��d����h:�|��F^�Qg�Ϡc\�a�^k�+�tz����f��U����q+ج�6F۱��h�Ɔ��'�Ayv�o���=��U�Y鹅��U�5��4{\ñ�->}�����##N��8x�sX�x�;��)�鯣�,��+g~�U�-9r!y�����~�>�h$e]��4^�9�qˎ�:l��Lb*�஻s�f,��ZL{Z�-�D%BH�R!*PN�j�)� �,X���D�.m,Œz�褕�[��:6WW$m�P�*U� �Ϊա�DJ,�J�!@�ZU�1VV�J� Hn��=Vq�KUa�*��U��aP�*���iCf��O�M��8��XK٘���S�=��lK��P ����,�ס"U�� �p�r#"3 #�J�>� $��,��ٚ�h!TB :����[���P���! 8"�!�M�T ��@�H�i;A��R���}��|�PaO)|�?Q����;#Оj�A2��kO�T�2�Cv o* �5����=��Axr��N3Qab�v��ඊ�N�����f��q��B��hWV��o��[p�B�U�`�F�YB��#��-4�p޳Ee٥c��ֶ�?j{QKќ����I�t��\e!�`����H�$��J��ؽ���q�.�|~_�˗�c�v�tf�k�b����iFKOgaܷ!���y�`��Nd� ���њe�Q��jy���������' ��|����Ci�T�)�"��PF�U�=��;�pۭ��u A�*2T!!!! �+I��v� �=D�`%$TBH� �񦲵t����K^�#�r;]�w��Y�lk&�Ĝ�㋜w�S�T>8�E�� ���FPIJ��M(�J�PR%B)r� p ��7�*D���;;8�_+}��?G�e�G��_�v(Ve~��}<���^�����`� �0�賭?Gv����s�m<׬ ��˔�f��^'i腽�ٞ�?�1�ɦ�*�a�<$�H��9��{�������T.��/�c�G�F4۫ܭ��K߳Ŏ���w�hV�����b�X�J�:5�ɟ,����$]�����߻|3x����y�+wG�p�%�V�����څ�r�~\�Q��%��չYѥ HH�*�1MS���Z�HJ��� P�6(�T))�@%H��!Q,L�h�q�P�U*˕U��<.��>#B�e ����:+�M���F��\��X� xK H¦SmK��֧,��[��,Rk�u��{.��5����@!@ �n?h�)Sm�x�(Zi�ܒ� VZB* Z��?/r?i���X0�"����t��y��F?N'��r\�.��c7UmN��a{ ���<�YF7 aZl'<�v�SO�w����ixރ^�v����޶}۽ҹ�Ci\J�^�:�h�g�5k,�>�X���/�ෂۅBBR�V���ɴV�� KLiN�]e#�@91�۷l�2�4�R�Ay�cuos�4.Y�|�"�\Mf����ku2��N<<�ޓ�?��H�ok#�&���@r ��(8���+N=ƴ4T묝�G%�ڨ}W���ݩ�NsH�Q5m��o|��ä́� ���ݑݚ�,V�L��5�9�c�����tn��\#2{�5�~T\98e�;z8��>�N��r�b� ��as#K6qB J������{��֣$#"�vYu^�YM��B�g��w��[�EB�@BHUEz�I��;@��H1�O�B���+Zi[C�?�w��`�B�{}���A�@7�P�@4���ɒ�r�d�D\Ƽ6[v�c�T V��s�*+te����Xk�r�f����������� hoXt��v{��{�q�Z|���)����-�y��� ����������鈕��)�� q:SQ$��5��8c�x���E�„l$� m/�J�"��Z�֙���1܆�oV�ު��N�J^+��z�:�����gY٭n�Vz���_�ӄ�+�����n��I,�[o����� Y��5��\m�b��1/cĮ��1� sh�I�Գ����.�Թw�n�K���Wڻ���XGS�:�\cv�-��%gYtV�&�v �rc��Gy[���U�5��.�4pc��M� �Fgvc h��G�FG�޹p۴u���۷kZ�V�������Q�u��S��ҧ�i����[��)~�ޏ_��Z�~>2��N���S?[O ��y�jk��8�lƮ|���#���T]lт'{�X��E�@{����c���dk:�M� ��|6Ԧb6QX��! �!*D��Ui�*�, R!eVXj�0�R�t�BsR�Q��FS��#=���}A]��Ϣٱ���w��%罽��QB� u��� -�x�(Zm}��ђ*��ڢ�9"Kȼ���q�q�-.<�W17q�����j�2V�������ǀ}��w�9��Nfh��ƃ̯?5�v�&ݭ����/�` g�<�Ȟ�qh�(�s��� �Q�M&~���q���.{ޱ;Gp�\J�N��z��G��}�:��Ē7���Ի+�i�(ro����6��(�RP`�4�����:�h�f� ��Z䫎� �-�g���8��~ �����q�ʮYLq�9,��Ӏ�FPǍݧ?2v-;4 ����$�gz��g m5�����V�c#Ŗ[�T�u=�YV�mq&�qZeb�08 w��RX�t�����mܝ�( iy��#0ѫ��֛M+��7X/�6��V�5�2�=�8�F Iߏ%cGC� ���м�������i�oX�M�aROy����vn.Y�����ol���f������ra��c�Ifsy����p���pW肼�e�w^�p��PT�N[�XY.���i��&�����8+V;[%e���� � Yi��vEH�é�� �S�0���+�Ll������i���M%�Xv:R+��^Y�@ޖ���!���Ni�/���4d��T$�@�M��ȣ�n�"��0斜������h�̔ޕ�i]u��%�7��� ����|�:���+xr���sϋ ���0�#�ˢ���@��,;�1�cZoґ���Z�WmV[�1�rD潍����o4���M֍�Ecv����_�q��g�(h��#� �X����A1a]s�3�U�,f�M�1��ch{��\��s�vF e��u���Q�7o�W.|򚩏���6� �ݩoi�P��p{Mx�,��@�flvGL�5βFe��ը5ִ����(��Ȭ�˖V���?�"�w�c��d��#�|�����GZ��9�vx��������/�X�+ a%��^>AX�[�ȥ�[�ȫy���x0�����D"7�q8��>��7��A sZ^{�n_-�ڇ�� �¸��'ZݾE'ZݾE\���j��a��= �kv�u���Wd� D�����$0ct1{�ɣd id���..�h$�p��YQ�<��hq���f�N�uQ\f�9]E���B\��<������ �V�e�ȠJݾEzdy�=7�n�"���|�!h�����ȣ�n�"�?Ih+5�Rx"�{�/��x�;L}��٤|S]Yb>=��W�u���Q}�|����n��΋�`�pVF�"��0�������+Mtf�k��]������Ϊ̇��$+�4�с�$��������y���HX�C����*�y�E�v+%H��R�$����Z�FBUWaP����~G���=�*�,BT�ZTX�෋5"�GjNs���R��A�'ih?����Ay��DB���X�ʏ?�!����Bm��Šz/�_ ���%���A�[��;����� N���