// Find the highest-resolution mipmap whose number of data points
// that lie within the plot domain is <= maxDataPoints.
final int maxDrawableDataPoints = overviewMode ? (int) plot.getPlotLayer()
.getWidth() : getMaxDrawableDataPoints(drawableDataset);
MipMapRegion bestMipMapRegion = dataSet
.getBestMipMapForInterval(plotDomain, overviewMode ? 2000 : maxDrawableDataPoints,
overviewMode ? 0 : ((DefaultXYPlot)plot).isAnimating() ? -1 : 0);
MipMap bestMipMap = bestMipMapRegion.getMipMap();
if (drawableDataset.currMipMap.getLevel() != bestMipMap.getLevel()) {
drawableDataset.currMipMap = bestMipMap;
plot.getHoverPoints()[datasetIdx] = DefaultXYPlot.NO_SELECTION;
}
int domainStartIdx = bestMipMapRegion.getStartIndex();
int domainEndIdx = bestMipMapRegion.getEndIndex();
domainStartIdx = Math.max(0, domainStartIdx - 1);
domainEndIdx = Math.min(domainEndIdx, dataSet.getNumSamples()-1);
drawableDataset.visDomainStartIndex = domainStartIdx;
drawableDataset.visDomainEndIndex = domainEndIdx;