function draw_highlighted()

in src/plotxy.tsx [445:499]


    function draw_highlighted() {
      if (!me.isEnabled()) {
        return;
      }
      const highlighted = me.props.rows_highlighted;
      highlights.clearRect(0, 0, me.state.width, me.state.height);
      d3.select(me.canvas_highlighted_ref.current).style("opacity", "0");
      d3.select(me.canvas_lines_ref.current).style("opacity", "1.0");
      if (!highlighted.length) {  // Stop highlight
        return;
      }
      d3.select(me.canvas_highlighted_ref.current).style("opacity", "1.0");
      d3.select(me.canvas_lines_ref.current).style("opacity", "0.5");
      childrenLookup = {};
      if (me.state.highlightType == HIGHLIGHT_CHILDREN) {
        // Pre-compute graph of children - TODO: maybe we could cache that
        me.props.rows_filtered.forEach(function(dp) {
          if (dp.from_uid !== null) {
            if (childrenLookup[dp.from_uid] === undefined) {
              childrenLookup[dp.from_uid] = [dp];
            } else {
              childrenLookup[dp.from_uid].push(dp);
            }
          }
        });
      }
      const lookupNextDp: (dp: Datapoint) => Datapoint[] = {
        [HIGHLIGHT_CHILDREN]: lookupChildren,
        [HIGHLIGHT_PARENT]: lookupParent,
      }[me.state.highlightType];

      // Find all runs + parents
      var todo = new Set(highlighted);
      var allHighlighted = new Set<Datapoint>();
      while (todo.size) {
        const oldTodo = todo;
        todo = new Set();
        oldTodo.forEach(function(dp) {
          if (allHighlighted.has(dp)) {
            return;
          }
          allHighlighted.add(dp);
          lookupNextDp(dp).forEach(function(newDp) { todo.add(newDp); });
        });
      }
      allHighlighted.forEach(function(dp) {
        var color = me.props.get_color_for_row(dp, 1.0).split(',');
        render_dp(dp, highlights, {
          'lines_color': [color[0], color[1], color[2], 1.0 + ')'].join(','),
          'lines_width': 4,
          'dots_color': [color[0], color[1], color[2], 0.8 + ')'].join(','),
          'dots_thickness': me.props.dots_highlighed_thickness,
        });
      });
    }