drawConv1 = (curLayerIndex, d, i, width, height,
  intermediateNodeMouseOverHandler, intermediateNodeMouseLeaveHandler,
  intermediateNodeClicked) => {
  // Compute the target location
  let targetX = nodeCoordinate[curLayerIndex - 1][0].x + 2 * nodeLength +
    2 * hSpaceAroundGap * gapRatio + plusSymbolRadius * 2;
  let intermediateGap = (hSpaceAroundGap * gapRatio * 2) / 3;
  let leftX = nodeCoordinate[curLayerIndex - 1][0].x;

  // Record the left x position for dynamic detial view positioning
  intermediateLayerPosition['conv_1_1'] = targetX + nodeLength;
  intermediateLayerPositionStore.set(intermediateLayerPosition);

  // Hide the edges
  svg.select('g.edge-group')
    .style('visibility', 'hidden');

  // Move the selected layer
  moveLayerX({layerIndex: curLayerIndex, targetX: targetX, disable: true,
    delay: 0, opacity: 0.15, specialIndex: i});

  // Compute the gap in the right shrink region
  let rightStart = targetX + nodeLength + hSpaceAroundGap * gapRatio;
  let rightGap = (width - rightStart - 10 * nodeLength) / 10;

  // Move the right layers
  for (let i = curLayerIndex + 1; i < numLayers; i++) {
    let curX = rightStart + (i - (curLayerIndex + 1)) * (nodeLength + rightGap);
    moveLayerX({layerIndex: i, targetX: curX, disable: true, delay: 0});
  }

  // Add an overlay gradient and rect
  let stops = [{offset: '0%', color: 'rgb(250, 250, 250)', opacity: 0.85},
  {offset: '50%', color: 'rgb(250, 250, 250)', opacity: 0.95},
  {offset: '100%', color: 'rgb(250, 250, 250)', opacity: 1}];
  addOverlayGradient('overlay-gradient', stops);

  addOverlayRect('overlay-gradient', rightStart - overlayRectOffset / 2,
  0, width - rightStart + overlayRectOffset,
  height + svgPaddings.top + svgPaddings.bottom);

  // Draw the intermediate layer
  let {intermediateLayer, intermediateMinMax, kernelRange, kernelMinMax} =
  drawIntermediateLayer(curLayerIndex, leftX, targetX, rightStart,
    intermediateGap, d, i, intermediateNodeMouseOverHandler,
    intermediateNodeMouseLeaveHandler, intermediateNodeClicked);
  addUnderneathRect(curLayerIndex, i, leftX, intermediateGap, 8,
    intermediateNodeMouseOverHandler, intermediateNodeMouseLeaveHandler,
    intermediateNodeClicked);

  // Compute the selected node's min max
  // Selected node
  let min = Infinity, max = -Infinity;
  let n = cnn[curLayerIndex][i];
  for (let r = 0; r < n.output.length; r++) {
  for (let c = 0; c < n.output[0].length; c++) {
    if (n.output[r][c] < min) { min = n.output[r][c]; }
    if (n.output[r][c] > max) { max = n.output[r][c]; }
  }
  }

  let finalMinMax = {
  min: Math.min(min, intermediateMinMax.min),
  max: Math.max(max, intermediateMinMax.max)
  }

  // Add annotation to the intermediate layer
  let intermediateLayerAnnotation = svg.append('g')
  .attr('class', 'intermediate-layer-annotation')
  .style('opacity', 0);

  drawIntermediateLayerAnnotation({
    leftX: leftX,
    curLayerIndex: curLayerIndex,
    group: intermediateLayerAnnotation,
    intermediateGap: intermediateGap,
    isFirstConv: true,
    i: i
  });

  let range = cnnLayerRanges.local[curLayerIndex];

  drawIntermediateLayerLegend({
    legendHeight: 5,
    curLayerIndex: curLayerIndex,
    range: 1,
    group: intermediateLayer,
    width: 2 * nodeLength + intermediateGap,
    isInput: true,
    x: leftX,
    y: svgPaddings.top + vSpaceAroundGap * (10) + vSpaceAroundGap + 
      nodeLength * 10 - 25
  });

  drawIntermediateLayerLegend({
    legendHeight: 5,
    curLayerIndex: curLayerIndex,
    range: range,
    minMax: finalMinMax,
    group: intermediateLayer,
    width: 2 * nodeLength + intermediateGap,
    x: nodeCoordinate[curLayerIndex - 1][2].x,
    y: svgPaddings.top + vSpaceAroundGap * (10) + vSpaceAroundGap + 
      nodeLength * 10
  });

  drawIntermediateLayerLegend({
    legendHeight: 5,
    curLayerIndex: curLayerIndex,
    range: kernelRange,
    minMax: kernelMinMax,
    group: intermediateLayer,
    width: 2 * nodeLength + intermediateGap,
    x: targetX + nodeLength - (2 * nodeLength + intermediateGap),
    y: svgPaddings.top + vSpaceAroundGap * (10) + vSpaceAroundGap + 
      nodeLength * 10,
    gradientAppendingName: 'kernelColorGradient',
    colorScale: layerColorScales.weight,
    gradientGap: 0.2
  });

  // Show everything
  svg.selectAll('g.intermediate-layer, g.intermediate-layer-annotation')
    .transition()
    .delay(500)
    .duration(500)
    .ease(d3.easeCubicInOut)
    .style('opacity', 1);
}
Draw the intermediate layer before conv_1_1
@param {number} curLayerIndex Index of the selected layer
@param {object} d Bounded d3 data
@param {number} i Index of the selected node
@param {number} width CNN group width
@param {number} height CNN group height
@param {function} intermediateNodeMouseOverHandler mouse over handler
@param {function} intermediateNodeMouseLeaveHandler mouse leave handler
@param {function} intermediateNodeClicked node clicking handler