title: d3.js how to get minimum value of scale's domain when using nice()
body: <p>I have a scatter plot where I am trying to plot a reference point that should appear directly on the x-axis, but I am creating the y-axis like so:</p>
  
  <pre><code>   // give ourselves some space
      yMin = yMin * 0.9;
      yMax = yMax * 1.1;
  
      // set up y
      var yValue = function (d) {
              return d.price;
          },
          yScale = d3.scale.linear()
              .domain([yMin, yMax])
              .range([height, 0])
              .nice(),
          yAxis = d3.svg.axis()
              .scale(yScale)
              .orient("left");
  </code></pre>
  
  <p>The issue is that I want to plot a reference point directly on the x-axis. If I don't use .nice(), I can easily plot the reference point like so:</p>
  
  <pre><code>        var reference = svg.append('g').attr("class", "grid-reference");
          reference.append("circle").attr("id", "some-reference-value")
              .attr("class", "dot")
              .attr("r", 9)
              .attr("cx", xScale(someReferenceValue))
              .attr("cy", yScale(yMin))
              .style("fill", "grey")
              .style("opacity", 1);
  </code></pre>
  
  <p>but I can't seem to figure out how to do this when using .nice(). Is there another way I could go about this such as somehow getting the y-coordinate of the x-axis line?</p>
  
  <p>I started digging through the d3 code to see how I could calculate the nice value and I understand the code, but it seems wasteful to calculate the value again not to mention the unnecessary maintenance of duplicate code - especially considering I also have reference points I will need to plot along the y-axis and I am using a logarithmic scale for my x-axis (the logarithmic nice() function is different from the linear nice() function so this would mean additional duplicate code and unnecessary maintenance).</p>
  
  <p>Ideas?</p>