Github user pwendell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5843#discussion_r30203168
  
    --- Diff: 
core/src/main/resources/org/apache/spark/ui/static/timeline-view.js ---
    @@ -133,6 +133,70 @@ function drawJobTimeline(groupArray, eventObjArray, 
startTime) {
       });
     }
     
    +function drawTaskAssignmentTimeline(groupArray, eventObjArray, 
minLaunchTime, zoomMax) {
    +  var groups = new vis.DataSet(groupArray);
    +  var items = new vis.DataSet(eventObjArray);
    +  var container = $("#task-assignment-timeline")[0]
    +  var options = {
    +    groupOrder: function(a, b) {
    +      return a.value - b.value
    +    },
    +    editable: false,
    +    align: 'left',
    +    selectable: false,
    +    showCurrentTime: false,
    +    min: minLaunchTime,
    +    zoomable: false,
    +    zoomMax: zoomMax
    +  };
    +
    +  var taskTimeline = new vis.Timeline(container)
    +  taskTimeline.setOptions(options);
    +  taskTimeline.setGroups(groups);
    +  taskTimeline.setItems(items);
    +  var curEnd = taskTimeline.getWindow()["end"].getTime();
    +  if (curEnd - minLaunchTime > zoomMax) {
    +    curEnd = minLaunchTime + zoomMax;
    +  }
    +  taskTimeline.setWindow(minLaunchTime, curEnd);
    +  setupZoomable('#task-assignment-timeline-zoom-lock', taskTimeline);
    +
    +  function setupTaskEventAction() {
    +    $(".item.range.task.task-assignment-timeline-object").each(function() {
    +      var getSelectorForTaskEntry = function(baseElem) {
    +        var taskIdxText = 
$(baseElem).find(".task-assignment-timeline-content").attr("data-title");
    +        var taskIdx = taskIdxText.match("Task (\\d+)\\(")[1];
    +        return "#task-" + taskIdx;
    +      };
    +
    +      $(this).hover(
    +        function() {
    +          
$(getSelectorForTaskEntry(this)).addClass("corresponding-item-hover");
    +          
$($(this).find("div.task-assignment-timeline-content")[0]).tooltip("show");
    +        },
    +        function() {
    +          
$(getSelectorForTaskEntry(this)).removeClass("corresponding-item-hover");
    +          $($(this).find("div.task-assignment-timeline-content")[0])
    +          .tooltip("hide");
    +        }
    +      );
    +    });
    +  }
    +
    +  setupTaskEventAction();
    --- End diff --
    
    Doing this redrawing every time could d be expensive. It might be good to 
profile this also.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to