<commit_before># d3-mesh

Create a mesh of SVG elements the d3 way

## Installing

If you use NPM, `npm install d3-mesh`. Otherwise, download the [latest release](https://github.com/rwakulszowa/d3-mesh/releases/latest).
If you are super lazy, I also keep the non-minified source in
`https://raw.githubusercontent.com/rwakulszowa/d3-mesh/v0.0.1/examples/d3-mesh.js`
which you can probably copy-paste into your script.

## API Reference

<a href="#d3_mesh" name="d3_mesh">#</a> <i>d3</t>.<b>mesh</b>()

Constructs a new mesh with default values.

<a href="#mesh" name="mesh">#</a> <b>mesh</b>(indices)

Returns an object `{'d0': [start, end], 'd1': [start, end], 'dn'...}` occupying position indices[0], indices[1], indices[n]... on a mesh. Position in each dimension is calculated using formula 
```js
[dims[n](indices[n]/divs[n]), dims[n](indices[n+1]/divs[n])
```

```js
var mesh = d3.mesh()
    .divs([4, 4])
    .dims([
        function(x) { return 100 * x; },
        function(x) { return 60 * x; }
    ])

mesh([0, 0]);  // {'d0': [0, 25], 'd1': [0, 15]}
mesh([2, 3]);  // {'d0': [30, 45], 'd1': [45, 60]}
```
It is assumed that `indices.length == dims.length`
<commit_msg>Fixed <i> tag, added an image<commit_after># d3-mesh

Create a mesh of SVG elements the d3 way

![alt tag](https://cloud.githubusercontent.com/assets/10756296/15933899/de013c76-2e61-11e6-88ad-3d0fef83af32.png)

## Installing

If you use NPM, `npm install d3-mesh`. Otherwise, download the [latest release](https://github.com/rwakulszowa/d3-mesh/releases/latest).
If you are super lazy, I also keep the non-minified source in
`https://raw.githubusercontent.com/rwakulszowa/d3-mesh/v0.0.1/examples/d3-mesh.js`
which you can probably copy-paste into your script.

## API Reference

<a href="#d3_mesh" name="d3_mesh">#</a> <i>d3</i>.<b>mesh</b>()

Constructs a new mesh with default values.

<a href="#mesh" name="mesh">#</a> <b>mesh</b>(indices)

Returns an object `{'d0': [start, end], 'd1': [start, end], 'dn'...}` occupying position indices[0], indices[1], indices[n]... on a mesh. Position in each dimension is calculated using formula 
```js
[dims[n](indices[n]/divs[n]), dims[n](indices[n+1]/divs[n])
```

```js
var mesh = d3.mesh()
    .divs([4, 4])
    .dims([
        function(x) { return 100 * x; },
        function(x) { return 60 * x; }
    ])

mesh([0, 0]);  // {'d0': [0, 25], 'd1': [0, 15]}
mesh([2, 3]);  // {'d0': [30, 45], 'd1': [45, 60]}
```
It is assumed that `indices.length == dims.length`

{'fraction_non_alphanumeric': 0.20587052673904302, 'fraction_numerical': 0.05186972255729795, 'mean_word_length': 3.995983935742972, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '694930', 'n_tokens_mistral': 1026, 'n_tokens_neox': 957, 'n_words': 263}