function earlyUpdate()

in src/core/configurableTL.ts [2118:2243]


function earlyUpdate(transition, tl_layout, prev_tl_layout, tl_representation, prev_tl_representation, tl_scale, prev_tl_scale) {
  /**
  ---------------------------------------------------------------------------------------
  update rect elements for non-radial representations
  ---------------------------------------------------------------------------------------
  **/

  transition.select("rect.event_span")
    .style("opacity", function (d) {
      return initialOpacity(d, tl_layout, prev_tl_layout, tl_representation, prev_tl_representation, tl_scale, prev_tl_scale, true);
    })
    .style("pointer-events", function () {
      return "none";
    })
    .style("fill", eventColorMapping);

  /**
  ---------------------------------------------------------------------------------------
  update bar (rect) elements for interim_duration scale
  ---------------------------------------------------------------------------------------
  **/

  // draw elapsed time as bar below the sequence, offset between events
  transition.select(".time_elapsed")
    .attr("height", 0)
    .style("opacity", 0);

  /**
  ---------------------------------------------------------------------------------------
  update path elements for radial representations
  ---------------------------------------------------------------------------------------
  **/

  transition.select("path.event_span")
    .style("opacity", function (d) {
      return initialOpacity(d, tl_layout, prev_tl_layout, tl_representation, prev_tl_representation, tl_scale, prev_tl_scale, false);
    })
    .style("pointer-events", function () {
      return "none";
    })
    .style("fill", eventColorMapping);

  /**
  ---------------------------------------------------------------------------------------
  span updates: rect elements for non-radial timelines
  ---------------------------------------------------------------------------------------
  **/

  transition.selectAll("rect.event_span_component")
    .style("opacity", function () {
      if (tl_layout !== "Segmented" || prev_tl_layout !== "Segmented" || (tl_representation === "Radial" && prev_tl_representation === "Radial")) {
        return 0;
      } else if (globals.prev_active_event_list.indexOf(d3.select(this.parentNode).datum().event_id) === -1 || globals.active_event_list.indexOf(d3.select(this.parentNode).datum().event_id) === -1) {
        if (globals.filter_type === "Hide") {
          return 0;
        } else if (globals.filter_type === "Emphasize") {
          if (globals.active_event_list.indexOf(d3.select(this.parentNode).datum().event_id) === -1) {
            return 0.1;
          }

          return 1;
        }
      } else if (globals.active_event_list.indexOf(d3.select(this.parentNode).datum().event_id) !== -1 && d3.select(this.parentNode).datum().selected) {
        return 1;
      } else if (globals.active_event_list.indexOf(d3.select(this.parentNode).datum().event_id) !== -1) {
        if (tl_scale !== prev_tl_scale || tl_layout !== prev_tl_layout || tl_representation !== prev_tl_representation) {
          return 0.5;
        }

        return 1;
      } else {
        return 0.1;
      }
    })
    .style("pointer-events", function () {
      return "none";
    })
    .style("fill", eventSpanColorMapping);

  /**
  ---------------------------------------------------------------------------------------
  span updates: path/arc elements for non-radial timelines
  ---------------------------------------------------------------------------------------
  **/

  transition.selectAll("path.event_span_component")
    .style("opacity", function () {
      if ((tl_layout !== "Segmented" || prev_tl_layout !== "Segmented") || (tl_representation !== "Radial" && prev_tl_representation !== "Radial")) {
        return 0;
      } else if (globals.prev_active_event_list.indexOf(d3.select(this.parentNode).datum().event_id) === -1 || globals.active_event_list.indexOf(d3.select(this.parentNode).datum().event_id) === -1) {
        if (globals.filter_type === "Hide") {
          return 0;
        } else if (globals.filter_type === "Emphasize") {
          if (globals.active_event_list.indexOf(d3.select(this.parentNode).datum().event_id) === -1) {
            return 0.1;
          }

          return 1;
        }
      } else if (globals.active_event_list.indexOf(d3.select(this.parentNode).datum().event_id) !== -1 && d3.select(this.parentNode).datum().selected) {
        return 1;
      } else if (globals.active_event_list.indexOf(d3.select(this.parentNode).datum().event_id) !== -1) {
        if (tl_scale !== prev_tl_scale || tl_layout !== prev_tl_layout || tl_representation !== prev_tl_representation) {
          return 0.5;
        }

        return 1;
      } else {
        return 0.1;
      }
    })
    .style("pointer-events", function () {
      if (prev_tl_layout !== "Segmented" || (tl_representation !== "Radial" && prev_tl_representation !== "Radial")) {
        return "none";
      } else if (globals.prev_active_event_list.indexOf(d3.select(this.parentNode).datum().event_id) !== -1 && globals.active_event_list.indexOf(d3.select(this.parentNode).datum().event_id) !== -1) {
        return "inherit";
      }

      return "none";
    })
    .style("fill", eventSpanColorMapping);

  transition.select(".path_end_indicator")
    .style("opacity", 0)
    .style("pointer-events", "none");
}