fonction permettant d'afficher un tableau de photo par exemple avec un commentaire qui sera align� dans la ligne suivante du tableau
544736
public function addValuesFromArrayLinked($arrayValues,$nbColonnes=3,$styleCellHaut='',$styleCellBas='')
	{
		
		$nbValsTotal = count($arrayValues);

		$i=1;
		$tabTemp = array();
		$indice = 0;
		$nbCols= $nbColonnes;
		$ligneCourante = 1;
		
		for($s=0 ; $s<$nbValsTotal ; $s++)
		{
		
			$this->addValue($arrayValues[$s]['celluleHaut'],$styleCellHaut);
			
			$tabTemp[$indice] = $arrayValues[$s]['celluleBas'];
			
			
			if(($i%$nbColonnes==0 || $i==$nbValsTotal))
			{
			
				if(($nbColonnes-count($tabTemp))>0)
				{
					// il y a moins de photos que le max de la ligne
					$nbACompleter = $nbColonnes-count($tabTemp);
					for($iComplet=0 ; $iComplet < $nbACompleter ; $iComplet++)
					{
						$this->addValue('&nbsp;');
					}
				}
			
				for($j=0 ; $j<$nbColonnes ; $j++)
				{
					if(isset($tabTemp[$j]))
					{
						$this->addValue($tabTemp[$j],$styleCellBas);
					}
					else
					{
						$this->addValue('&nbsp;');
					}
				}
				$tabTemp=array();
				$indice=0;
			}
			else
			{
				$indice++;
			}
			
			$i++;
		}
	}
1312938
def collage(img_spec,
            num_rows=2,
            num_cols=6,
            rescale_method='global',
            cmap='gray',
            annot=None,
            padding=5,
            bkground_thresh=None,
            output_path=None,
            figsize=None,
            **kwargs):
    ""

    num_rows, num_cols, padding = check_params(num_rows, num_cols, padding)

    img = read_image(img_spec, bkground_thresh=bkground_thresh)
    img = crop_image(img, padding)

    img, (min_value, max_value) = check_rescaling_collage(img, rescale_method,
                                                          return_extrema=True)
    num_slices_per_view = num_rows * num_cols
    slices = pick_slices(img, num_slices_per_view)

    plt.style.use('dark_background')

    num_axes = 3
    if figsize is None:
        figsize = [3 * num_axes * num_rows, 3 * num_cols]
    fig, ax = plt.subplots(num_axes * num_rows, num_cols, figsize=figsize)

    # displaying some annotation text if provided
    if annot is not None:
        fig.suptitle(annot, backgroundcolor='black', color='g')

    display_params = dict(interpolation='none', cmap=cmap,
                          aspect='equal', origin='lower',
                          vmin=min_value, vmax=max_value)

    ax = ax.flatten()
    ax_counter = 0
    for dim_index in range(3):
        for slice_num in slices[dim_index]:
            plt.sca(ax[ax_counter])
            ax_counter = ax_counter + 1
            slice1 = get_axis(img, dim_index, slice_num)
            # slice1 = crop_image(slice1, padding)
            plt.imshow(slice1, **display_params)
            plt.axis('off')

    fig.tight_layout()

    if output_path is not None:
        output_path = output_path.replace(' ', '_')
        fig.savefig(output_path + '.png', bbox_inches='tight')

    # plt.close()

    return fig
705584
function _getNeighborPixels(coord, imgSize, imgCols) {
    var res = [], pos;

    if (coord.x > 0 && coord.y > 0) { // tlPx
        pos = {
            x: coord.x - 1,
            y: coord.y - 1
        };
        res.push({
            coord: pos,
            color: _getColorByXY(pos, imgSize, imgCols)
        });
    }

    if (coord.y > 0) { // tPx
        pos = {
            x: coord.x,
            y: coord.y - 1
        };
        res.push({
            coord: pos,
            color: _getColorByXY(pos, imgSize, imgCols)
        });
    }

    if (coord.x < imgSize.w && coord.y > 0) { // trPx
        pos = {
            x: coord.x + 1,
            y: coord.y - 1
        };
        res.push({
            coord: pos,
            color: _getColorByXY(pos, imgSize, imgCols)
        });
    }

    if (coord.x < imgSize.w) { // rPx
        pos = {
            x: coord.x + 1,
            y: coord.y
        };
        res.push({
            coord: pos,
            color: _getColorByXY(pos, imgSize, imgCols)
        });
    }

    if (coord.x < imgSize.w && coord.y < imgSize.h) { // brPx
        pos = {
            x: coord.x + 1,
            y: coord.y + 1
        };
        res.push({
            coord: pos,
            color: _getColorByXY(pos, imgSize, imgCols)
        });
    }

    if (coord.y < imgSize.h) { // bPx
        pos = {
            x: coord.x,
            y: coord.y + 1
        };
        res.push({
            coord: pos,
            color: _getColorByXY(pos, imgSize, imgCols)
        });
    }

    if (coord.x > 0 && coord.y < imgSize.h) { // blPx
        pos = {
            x: coord.x - 1,
            y: coord.y + 1
        };
        res.push({
            coord: pos,
            color: _getColorByXY(pos, imgSize, imgCols)
        });
    }

    if (coord.x > 0) { // lPx
        pos = {
            x: coord.x - 1,
            y: coord.y
        };
        res.push({
            coord: pos,
            color: _getColorByXY(pos, imgSize, imgCols)
        });
    }

    return res;
}
1160069
def estimateFromImages(imgs1, imgs2=None, mn_mx=None, nbins=100):
    '''
    
    '''
    if imgs2 is None:
        imgs2 = [None] * len(imgs1)
    else:
        assert len(imgs1) == len(imgs2)

    y_vals = np.empty((len(imgs1), nbins))
    w_vals = np.zeros((len(imgs1), nbins))

    if mn_mx is None:
        print('estimating min and max image value')
        mn = 1e6
        mx = -1e6
        # get min and max image value checking all first images:
        for n, i1 in enumerate(imgs1):
            print('%s/%s' % (n + 1, len(imgs1)))
            i1 = imread(i1)
            mmn, mmx = _getMinMax(i1)
            mn = min(mn, mmn)
            mx = mx = max(mx, mmx)
        print('--> min(%s), max(%s)' % (mn, mx))
    else:
        mn, mx = mn_mx

    x = None
    print('get noise level function')
    for n, (i1, i2) in enumerate(zip(imgs1, imgs2)):
        print('%s/%s' % (n + 1, len(imgs1)))

        i1 = imread(i1)
        if i2 is not None:
            i2 = imread(i2)

        x, y, weights, _ = calcNLF(i1, i2, mn_mx_nbins=(mn, mx, nbins), x=x)
        y_vals[n] = y
        w_vals[n] = weights

    # filter empty places:
    filledPos = np.sum(w_vals, axis=0) != 0
    w_vals = w_vals[:, filledPos]
    y_vals = y_vals[:, filledPos]
    x = x[filledPos]

    y_avg = np.average(np.nan_to_num(y_vals),
                       weights=w_vals,
                       axis=0)
    w_vals = np.sum(w_vals, axis=0)
    w_vals /= w_vals.sum()

    fitParams, fn, i = _evaluate(x, y_avg, w_vals)
    return x, fn, y_avg, y_vals, w_vals, fitParams, i
609234
void computeRawDescriptor(double c_x, double c_y, double sigma, double orientation, TupleDesc_F64 descriptor) {
		double c = Math.cos(orientation);
		double s = Math.sin(orientation);

		float fwidthSubregion = widthSubregion;
		int sampleWidth = widthGrid*widthSubregion;
		double sampleRadius = sampleWidth/2;

		double sampleToPixels = sigma*sigmaToPixels;

		Deriv image = (Deriv)imageDerivX.getImage();

		for (int sampleY = 0; sampleY < sampleWidth; sampleY++) {
			float subY = sampleY/fwidthSubregion;
			double y = sampleToPixels*(sampleY-sampleRadius);

			for (int sampleX = 0; sampleX < sampleWidth; sampleX++) {
				// coordinate of samples in terms of sub-region.  Center of sample point, hence + 0.5f
				float subX = sampleX/fwidthSubregion;
				// recentered local pixel sample coordinate
				double x = sampleToPixels*(sampleX-sampleRadius);

				// pixel coordinate in the image that is to be sampled.  Note the rounding
				// If the pixel coordinate is -1 < x < 0 then it will round to 0 instead of -1, but the rounding
				// method below is WAY faster than Math.round() so this is a small loss.
				int pixelX = (int)(x*c - y*s + c_x + 0.5);
				int pixelY = (int)(x*s + y*c + c_y + 0.5);

				// skip pixels outside of the image
				if( image.isInBounds(pixelX,pixelY) ) {
					// spacial image derivative at this point
					float spacialDX = imageDerivX.unsafe_getF(pixelX, pixelY);
					float spacialDY = imageDerivY.unsafe_getF(pixelX, pixelY);

					double adjDX =  c*spacialDX + s*spacialDY;
					double adjDY = -s*spacialDX + c*spacialDY;

					double angle = UtilAngle.domain2PI(Math.atan2(adjDY,adjDX));

					float weightGaussian = gaussianWeight[sampleY*sampleWidth+sampleX];
					float weightGradient = (float)Math.sqrt(spacialDX*spacialDX + spacialDY*spacialDY);

					// trilinear interpolation intro descriptor
					trilinearInterpolation(weightGaussian*weightGradient,subX,subY,angle, descriptor);
				}
			}
		}
	}
248629
def modifiedLaplacian(img):
    '''''''
    M = np.array([-1, 2, -1])
    G = cv2.getGaussianKernel(ksize=3, sigma=-1)
    Lx = cv2.sepFilter2D(src=img, ddepth=cv2.CV_64F, kernelX=M, kernelY=G)
    Ly = cv2.sepFilter2D(src=img, ddepth=cv2.CV_64F, kernelX=G, kernelY=M)
    FM = np.abs(Lx) + np.abs(Ly)
    return cv2.mean(FM)[0]
1366247
function(labels, direction, step, start_offset, font_offsets, extra_font_options) {
    function x_offset(value) {
      return value * direction[0];
    }
    
    function y_offset(value) {
      return value * direction[1];
    }
    
    /* Start at the origin */
    var x = this.x_padding_left - 1 + x_offset(start_offset),
        y = this.options.height - this.y_padding_bottom + y_offset(start_offset),
        pathString = '',
        i,
        font_options = {};
    Helpers.extend(font_options, this.font_options);
    Helpers.extend(font_options, extra_font_options || {});

    for (i = 0; i < labels.length; i++) {
      pathString += 'M' + x + ',' + y;
      if (typeof labels[i] !== 'undefined' && (labels[i] + '').length > 0) {
        pathString += 'L' + (x + y_offset(5)) + ',' + (y + x_offset(5));
        this.paper.text(x + font_offsets[0], y - font_offsets[1], labels[i]).attr(font_options).toFront();
      }
      x = x + x_offset(step);
      y = y + y_offset(step);
    }

    this.paper.path(pathString).attr({ stroke: this.options.label_colour });
  }
824065
def dImage_wrt_2dVerts_bnd(observed, visible, visibility, barycentric, image_width, image_height, num_verts, f, bnd_bool):
    """"""

    n_channels = np.atleast_3d(observed).shape[2]
    shape = visibility.shape

    # Step 1: get the structure ready, ie the IS and the JS
    IS = np.tile(col(visible), (1, 2*f.shape[1])).ravel()
    JS = col(f[visibility.ravel()[visible]].ravel())
    JS = np.hstack((JS*2, JS*2+1)).ravel()

    pxs = np.asarray(visible % shape[1], np.int32)
    pys = np.asarray(np.floor(np.floor(visible) / shape[1]), np.int32)

    if n_channels > 1:
        IS = np.concatenate([IS*n_channels+i for i in range(n_channels)])
        JS = np.concatenate([JS for i in range(n_channels)])

    # Step 2: get the data ready, ie the actual values of the derivatives
    ksize = 1
    bndf = bnd_bool.astype(np.float64)
    nbndf = np.logical_not(bnd_bool).astype(np.float64)
    sobel_normalizer = cv2.Sobel(np.asarray(np.tile(row(np.arange(10)), (10, 1)), np.float64), cv2.CV_64F, dx=1, dy=0, ksize=ksize)[5,5]

    bnd_nan = bndf.reshape((observed.shape[0], observed.shape[1], -1)).copy()
    bnd_nan.ravel()[bnd_nan.ravel()>0] = np.nan
    bnd_nan += 1
    obs_nonbnd = np.atleast_3d(observed) * bnd_nan

    ydiffnb, xdiffnb = nangradients(obs_nonbnd)

    observed = np.atleast_3d(observed)

    if observed.shape[2] > 1:
        ydiffbnd, xdiffbnd, _ = np.gradient(observed)
    else:
        ydiffbnd, xdiffbnd = np.gradient(observed.squeeze())
        ydiffbnd = np.atleast_3d(ydiffbnd)
        xdiffbnd = np.atleast_3d(xdiffbnd)

    # This corrects for a bias imposed boundary differences begin spread over two pixels
    # (by np.gradients or similar) but only counted once (since OpenGL's line
    # drawing spans 1 pixel)
    xdiffbnd *= 2.0
    ydiffbnd *= 2.0

    xdiffnb = -xdiffnb
    ydiffnb = -ydiffnb
    xdiffbnd = -xdiffbnd
    ydiffbnd = -ydiffbnd
    # ydiffnb *= 0
    # xdiffnb *= 0

    if False:
        import matplotlib.pyplot as plt
        plt.figure()
        plt.subplot(121)
        plt.imshow(xdiffnb)
        plt.title('xdiffnb')
        plt.subplot(122)
        plt.imshow(xdiffbnd)
        plt.title('xdiffbnd')
        import pdb; pdb.set_trace()

    idxs = np.isnan(xdiffnb.ravel())
    xdiffnb.ravel()[idxs] = xdiffbnd.ravel()[idxs]

    idxs = np.isnan(ydiffnb.ravel())
    ydiffnb.ravel()[idxs] = ydiffbnd.ravel()[idxs]

    if True: # should be right thing
        xdiff = xdiffnb
        ydiff = ydiffnb
    else:  #should be old way
        xdiff = xdiffbnd
        ydiff = ydiffbnd


    # TODO: NORMALIZER IS WRONG HERE
    # xdiffnb = -cv2.Sobel(obs_nonbnd, cv2.CV_64F, dx=1, dy=0, ksize=ksize) / np.atleast_3d(cv2.Sobel(row(np.arange(obs_nonbnd.shape[1])).astype(np.float64), cv2.CV_64F, dx=1, dy=0, ksize=ksize))
    # ydiffnb = -cv2.Sobel(obs_nonbnd, cv2.CV_64F, dx=0, dy=1, ksize=ksize) / np.atleast_3d(cv2.Sobel(col(np.arange(obs_nonbnd.shape[0])).astype(np.float64), cv2.CV_64F, dx=0, dy=1, ksize=ksize))
    #
    # xdiffnb.ravel()[np.isnan(xdiffnb.ravel())] = 0.
    # ydiffnb.ravel()[np.isnan(ydiffnb.ravel())] = 0.
    # xdiffnb.ravel()[np.isinf(xdiffnb.ravel())] = 0.
    # ydiffnb.ravel()[np.isinf(ydiffnb.ravel())] = 0.

    # xdiffnb = np.atleast_3d(xdiffnb)
    # ydiffnb = np.atleast_3d(ydiffnb)
    #
    # xdiffbnd = -cv2.Sobel(observed, cv2.CV_64F, dx=1, dy=0, ksize=ksize) / sobel_normalizer
    # ydiffbnd = -cv2.Sobel(observed, cv2.CV_64F, dx=0, dy=1, ksize=ksize) / sobel_normalizer
    #
    # xdiff = xdiffnb * np.atleast_3d(nbndf)
    # xdiff.ravel()[np.isnan(xdiff.ravel())] = 0
    # xdiff += xdiffbnd*np.atleast_3d(bndf)
    #
    # ydiff = ydiffnb * np.atleast_3d(nbndf)
    # ydiff.ravel()[np.isnan(ydiff.ravel())] = 0
    # ydiff += ydiffbnd*np.atleast_3d(bndf)

    #import pdb; pdb.set_trace()

    #xdiff = xdiffnb
    #ydiff = ydiffnb

    #import pdb; pdb.set_trace()

    datas = []

    # The data is weighted according to barycentric coordinates
    bc0 = col(barycentric[pys, pxs, 0])
    bc1 = col(barycentric[pys, pxs, 1])
    bc2 = col(barycentric[pys, pxs, 2])
    for k in range(n_channels):
        dxs = xdiff[pys, pxs, k]
        dys = ydiff[pys, pxs, k]
        if f.shape[1] == 3:
            datas.append(np.hstack((col(dxs)*bc0,col(dys)*bc0,col(dxs)*bc1,col(dys)*bc1,col(dxs)*bc2,col(dys)*bc2)).ravel())
        else:
            datas.append(np.hstack((col(dxs)*bc0,col(dys)*bc0,col(dxs)*bc1,col(dys)*bc1)).ravel())

    data = np.concatenate(datas)

    ij = np.vstack((IS.ravel(), JS.ravel()))
    result = sp.csc_matrix((data, ij), shape=(image_width*image_height*n_channels, num_verts*2))

    return result
384522
def prewitt(image, mask=None):
    '''
    '''
    return np.sqrt(hprewitt(image,mask)**2 + vprewitt(image,mask)**2)
917328
function getBackgroundPosition(image) {
	var logicValue = image.isSVG ? 1 : -1;
	var x = logicValue * (image.ratio > 1 ? image.coordinates.x / image.ratio : image.coordinates.x);
	var y = logicValue * (image.ratio > 1 ? image.coordinates.y / image.ratio : image.coordinates.y);
	var template = _.template('<%= (x ? x + "px" : x) %> <%= (y ? y + "px" : y) %>');
	return template({x: x, y: y});
}
250901
private double[] calculateMaximumSlope( BitMatrix analizedMatrix, RandomIter pitRandomIter, WritableRandomIter tcaRandomIter,
            int col, int row ) {
        double[] maxSlopeData = new double[10];
        int n = 1, m = 1;

        double dirmax = 0f, e1min = -9999f, e2min = -9999f;

        analizedMatrix.mark(col, row);
        tcaRandomIter.setSample(col, row, 0, 1);
        double pendmax = 0f;
        maxSlopeData[3] = pitRandomIter.getSampleDouble(col, row, 0);
        /*
         * per ogni triangolo calcolo la pendenza massima e la direzione di
         * deflusso reale.
         */
        for( int j = 0; j <= 7; j++ ) {
            n = tri[j][0];
            m = tri[j][1];

            maxSlopeData[4] = pitRandomIter.getSampleDouble(col + order[n][1], row + order[n][0], 0);
            maxSlopeData[5] = pitRandomIter.getSampleDouble(col + order[m][1], row + order[m][0], 0);
            /*
             * verifico che i punti attorno al pixel considerato non siano
             * novalue. In questo caso trascuro il triangolo.
             */
            if (!isNovalue(maxSlopeData[4]) && !isNovalue(maxSlopeData[5])) {
                calculateMaxSlopeAndDirection4Triangles(maxSlopeData);
                if (maxSlopeData[1] > pendmax) {
                    dirmax = maxSlopeData[2];
                    pendmax = maxSlopeData[1];
                    /* - direzione cardinale */
                    maxSlopeData[7] = tri[j][0];
                    /* - direzione diagonale */
                    maxSlopeData[8] = tri[j][1];
                    /* - segno del triangolo */
                    maxSlopeData[9] = tri[j][2];
                    /*
                     * - quote del triangolo avente pendenza
                     * maggiore
                     */
                    e1min = maxSlopeData[4];
                    /*
                     * non necessariamente sono le quote
                     * minime.
                     */
                    e2min = maxSlopeData[5];
                }
            }
        }
        maxSlopeData[1] = pendmax;
        maxSlopeData[2] = dirmax;
        maxSlopeData[4] = e1min;
        maxSlopeData[5] = e2min;

        return maxSlopeData;
    }
674632
function addAlignment(x, y) {
    var i;

    frameBuffer[x + width * y] = 1;

    for (i = -2; i < 2; i++) {
      frameBuffer[(x + i)     + width * (y - 2)]     = 1;
      frameBuffer[(x - 2)     + width * (y + i + 1)] = 1;
      frameBuffer[(x + 2)     + width * (y + i)]     = 1;
      frameBuffer[(x + i + 1) + width * (y + 2)]     = 1;
    }

    for (i = 0; i < 2; i++) {
      setMask(x - 1, y + i);
      setMask(x + 1, y - i);
      setMask(x - i, y - 1);
      setMask(x + i, y + 1);
    }
  }
21778
function coordsChar(cm, x, y) {
    var doc = cm.doc;
    y += cm.display.viewOffset;
    if (y < 0) return PosWithInfo(doc.first, 0, true, -1);
    var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;
    if (lineNo > last)
      return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);
    if (x < 0) x = 0;

    for (;;) {
      var lineObj = getLine(doc, lineNo);
      var found = coordsCharInner(cm, lineObj, lineNo, x, y);
      var merged = collapsedSpanAtEnd(lineObj);
      var mergedPos = merged && merged.find();
      if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))
        lineNo = mergedPos.to.line;
      else
        return found;
    }
  }
1129576
function (text, color, x, y, width) {
                        ctx.fillStyle = color;
                        var metric = ctx.measureText(text);
                        if (metric.width > width) {
                            while (text !== "") {
                                metric = ctx.measureText(text + "...");
                                if (metric.width <= width) {
                                    text += "...";
                                    break;
                                }
                                text = text.substr(0, text.length - 1);
                            }
                        }
                        ctx.fillText(text, x, y, width);
                    }
1313994
boolean computeRectifyH( double f1 , double f2 , DMatrixRMaj P2, DMatrixRMaj H ) {

		estimatePlaneInf.setCamera1(f1,f1,0,0,0);
		estimatePlaneInf.setCamera2(f2,f2,0,0,0);

		if( !estimatePlaneInf.estimatePlaneAtInfinity(P2,planeInf) )
			return false;

		// TODO add a cost for distance from nominal and scale other cost by focal length fx for each view
//		RefineDualQuadraticConstraint refine = new RefineDualQuadraticConstraint();
//		refine.setZeroSkew(true);
//		refine.setAspectRatio(true);
//		refine.setZeroPrinciplePoint(true);
//		refine.setKnownIntrinsic1(true);
//		refine.setFixedCamera(false);
//
//		CameraPinhole intrinsic = new CameraPinhole(f1,f1,0,0,0,0,0);
//		if( !refine.refine(normalizedP.toList(),intrinsic,planeInf))
//			return false;

		K1.zero();
		K1.set(0,0,f1);
		K1.set(1,1,f1);
		K1.set(2,2,1);
		MultiViewOps.createProjectiveToMetric(K1,planeInf.x,planeInf.y,planeInf.z,1,H);

		return true;
	}
697833
private void trackFeatures(Image input, RectangleRotate_F64 region) {
		pairs.reset();

		currentImage.process(input);
		for( int i = 0; i < currentImage.getNumLayers(); i++ ) {
			Image layer = currentImage.getLayer(i);
			gradient.process(layer,currentDerivX[i],currentDerivY[i]);
		}

		// convert to float to avoid excessive conversions from double to float
		float cx = (float)region.cx;
		float cy = (float)region.cy;

		float height = (float)(region.height);
		float width = (float)(region.width);

		float c = (float)Math.cos(region.theta);
		float s = (float)Math.sin(region.theta);

		float p = 1.0f/(config.numberOfSamples-1);
		for( int i = 0; i < config.numberOfSamples; i++ ) {
			float y = (p*i-0.5f)*height;
			for( int j = 0; j < config.numberOfSamples; j++ ) {
				float x = (p*j - 0.5f)*width;
				float xx = cx + x*c - y*s;
				float yy = cy + x*s + y*c;

				// track in the forward direction
				track.x = xx;
				track.y = yy;

				klt.setImage(previousImage,previousDerivX,previousDerivY);
				if( !klt.setDescription(track) ) {
					continue;
				}

				klt.setImage(currentImage,currentDerivX,currentDerivY);
				KltTrackFault fault = klt.track(track);
				if( fault != KltTrackFault.SUCCESS ) {
					continue;
				}

				float xc = track.x;
				float yc = track.y;

				// validate by tracking backwards
				if( !klt.setDescription(track) ) {
					continue;
				}
				klt.setImage(previousImage,previousDerivX,previousDerivY);
				fault = klt.track(track);
				if( fault != KltTrackFault.SUCCESS ) {
					continue;
				}

				float error = UtilPoint2D_F32.distanceSq(track.x, track.y, xx, yy);

				if( error > maximumErrorFB ) {
					continue;
				}

				// create a list of the observations
				AssociatedPair a = pairs.grow();

				a.p1.x = xx;
				a.p1.y = yy;
				a.p2.x = xc;
				a.p2.y = yc;
			}
		}
	}
543735
function(text) {

    var salign = vars.labels.valign.value === "bottom" ? "top" : "bottom";

    text
      .attr("font-weight",vars.labels.font.weight)
      .attr("font-family",vars.labels.font.family.value)
      .attr("stroke", "none")
      .attr("pointer-events",function(t){
        return t.mouse ? "auto": "none";
      })
      .attr("fill", function(t){

        if ( t.color ) return t.color;

        var color = shapeColor(t.parent,vars),
            legible = textColor(color),
            opacity = t.text ? 0.15 : 1;

        return mix( color , legible , 0.2 , opacity );

      })
      .each(function(t){

        if (t.resize instanceof Array) {
          var min = t.resize[0], max = t.resize[1];
        }

        var size = t.resize, resize = true;

        if (t.text) {

          if ( !(size instanceof Array) ) {
            size = [9, 50];
            resize = t.resize;
          }

          var y = t.y - t.h*scale[1]/2 + t.padding/2;
          if (salign === "bottom") y += (t.h * scale[1])/2;

          textWrap()
            .align("center")
            .container(d3.select(this))
            .height((t.h * scale[1])/2)
            .padding(t.padding/2)
            .resize(resize)
            .size(size)
            .text(vars.format.value(t.text*100,{"key": "share", "vars": vars}))
            .width(t.w * scale[1])
            .valign(salign)
            .x(t.x - t.w*scale[1]/2 + t.padding/2)
            .y(y)
            .draw();

        }
        else {

          if ( !(t.resize instanceof Array) ) {
            size = [7, 40*(scale[1]/scale[0])];
            resize = t.resize;
          }

          var yOffset = vars.labels.valign.value === "bottom" ? t.share : 0;

          textWrap()
            .align(t.anchor || vars.labels.align.value)
            .container( d3.select(this) )
            .height(t.h * scale[1] - t.share)
            .padding(t.padding/2)
            .resize( resize )
            .size( size )
            .shape(t.shape || "square")
            .text( t.names )
            .valign(vars.labels.valign.value)
            .width(t.w * scale[1])
            .x(t.x - t.w*scale[1]/2 + t.padding/2)
            .y(t.y - t.h*scale[1]/2 + t.padding/2 + yOffset)
            .draw();

        }

      })
      .attr("transform",function(t){
        var translate = d3.select(this).attr("transform") || "";
        var a = t.angle || 0,
            x = t.translate && t.translate.x ? t.translate.x : 0,
            y = t.translate && t.translate.y ? t.translate.y : 0;

        if (translate.length) {
          translate = translate.split(")").slice(-3).join(")");
        }
        return "rotate("+a+","+x+","+y+")scale("+1/scale[1]+")translate("+(t.x*scale[1]-t.x)+","+(t.y*scale[1]-t.y)+")" + translate;

      });

  }