server/public/javascripts/activity.js
function render(activities, highlight) {
    // Top verbs plus 'other'.
    var verbs = topVerbs(activities);

    var selection = d3.select(selector)
      .selectAll("li")
      .data(filterVerbs(activities), function(activity) { return activity.id });
    var li = selection.enter().append("li");

    li.html(function(activity) {
        return activity.html.replace(/(<time.*>).*(<\/time>)/, function(_, head, tail) {
          var date = Date.create(activity.published)
            .format("{Weekday}, {Mon} {d} {h}:{mm} {TT}");
          return head + date + tail;
        })
      });
    li.selectAll("div")
      .append("span").attr("class", "color");
    if (highlight)
      li.attr("class", "highlight").transition()
        .delay(1).attr("class", "");
    selection.exit().remove();
    // Set the color of each activity based on its verb.
    selection.select(".color")
      .style("background-color", function(d) { return verbColor(verbs, d.verb); })
    selection.order();

    renderVerbs(verbs);
  }
function render(activities, highlight) {
    // Top verbs plus 'other'.
    var verbs = topVerbs(activities);

    var selection = d3.select(selector)
      .selectAll("li")
      .data(filterVerbs(activities), function(activity) { return activity.id });
    var li = selection.enter().append("li");

    li.html(function(activity) {
        return activity.html.replace(/(<time.*>).*(<\/time>)/, function(_, head, tail) {
          var date = Date.create(activity.published)
            .format("{Weekday}, {Mon} {d} {h}:{mm} {TT}");
          return head + date + tail;
        })
      });
    li.selectAll("div")
      .append("span").attr("class", "color");
    if (highlight)
      li.attr("class", "highlight").transition()
        .delay(1).attr("class", "");
    selection.exit().remove();
    // Set the color of each activity based on its verb.
    selection.select(".color")
      .style("background-color", function(d) { return verbColor(verbs, d.verb); })
    selection.order();

    renderVerbs(verbs);
  }
function render ( activities , highlight ) { // Top verbs plus 'other'. var verbs = topVerbs ( activities ) ; var selection = d3 . select ( selector ) . selectAll ( "li" ) . data ( filterVerbs ( activities ) , function ( activity ) { return activity . id } ) ; var li = selection . enter ( ) . append ( "li" ) ; li . html ( function ( activity ) { return activity . html . replace ( / (<time.*>).*(<\/time>) / , function ( _ , head , tail ) { var date = Date . create ( activity . published ) . format ( "{Weekday}, {Mon} {d} {h}:{mm} {TT}" ) ; return head + date + tail ; } ) } ) ; li . selectAll ( "div" ) . append ( "span" ) . attr ( "class" , "color" ) ; if ( highlight ) li . attr ( "class" , "highlight" ) . transition ( ) . delay ( 1 ) . attr ( "class" , "" ) ; selection . exit ( ) . remove ( ) ; // Set the color of each activity based on its verb. selection . select ( ".color" ) . style ( "background-color" , function ( d ) { return verbColor ( verbs , d . verb ) ; } ) selection . order ( ) ; renderVerbs ( verbs ) ; }
Render activities.  activities - Array with activities highlight  - True to highlight added activities
Render activities . activities - Array with activities highlight - True to highlight added activities