<commit_before># 2016-primaries-smt

This is a graphic that displays live state-wide primary results table on election night. It works at various widths starting at 171px:

![tables](https://cloud.githubusercontent.com/assets/370976/12398677/26b21142-bde3-11e5-81db-211142430e65.png)

- [How to create a new table](#how-to-create-a-new-table)
- [Developer setup](#setup)

## Producers

#### How to create a new table

We're going to create a table for the Iowa Democratic caucuses. Create a new *.jpt* with the following content, and modify accordingly.

```html
<!-- MODIFY: the id field in the following line-->
<div class='election-results-wrapper'>

	<div id='bg-primaries-smt-caucuses-democratic-iowa' style='margin: 20px 0;'></div>
	<div class='see-all-election-results'><a href='https://dev.apps.bostonglobe.com/election-results/2016/caucuses/republican/iowa/'>See all results</a></div>

</div>

<style>
	.election-results-wrapper { position: relative; }
	.see-all-election-results { position: absolute: bottom: 9px; right: 0; font-family: Helvetica, Arial, sans-serif; font-size: 13px; }
</style>

<script src='https://apps.bostonglobe.com/common/js/pym/pym-0.4.5.min.js'></script>
<script>

	// MODIFY: these three variables
	var raceType  = 'caucuses';   // e.g. caucuses, primary
	var party     = 'democratic'; // e.g. democratic, republican
	var state     = 'iowa';       // e.g. new hampshire, alaska

	// MODIFY: make sure this is the same as the id field in the first line
	var uniqueId  = 'bg-primaries-smt-caucuses-democratic-iowa';

	var baseurl   = 'http://dev.apps.bostonglobe.com/graphics/2016/02/state-results-small-table';
	var url       = [baseurl, '?raceType=', raceType, '&party=', party, '&state=', state].join('');
	var pymParent = new pym.Parent(uniqueId, url, {});
</script>
```

**Note:** make sure that the id field is unique in the page. In other words, make sure there are no other elements with that id or the graphic won't work.

Slot the *.jpt* in your article or section front and you're done.

## Developers

#### Setup

- `npm i`

<commit_msg>Fix wrong instructions<commit_after># 2016-primaries-smt

This is a graphic that displays live state-wide primary results table on election night. It works at various widths starting at 171px:

![tables](https://cloud.githubusercontent.com/assets/370976/12398677/26b21142-bde3-11e5-81db-211142430e65.png)

- [How to create a new table](#how-to-create-a-new-table)
- [Developer setup](#setup)

## Producers

#### How to create a new table

We're going to create a table for the Iowa Democratic caucuses. Create a new *.jpt* with the following content, and modify accordingly.

```html
<div class='story election-results-wrapper'>

	<!-- MODIFY: the id field in the following line-->
    <div id='bg-primaries-smt-caucuses-democratic-iowa' style='margin: 0;'></div>

    <!-- MODIFY: the url in the link-->
    <div class='see-all-election-results'><a href='http://dev.apps.bostonglobe.com/election-results/2016/caucuses/democratic/iowa/'>See all results</a></div>

</div>

<style>
    .story.election-results-wrapper { position: relative; }
    .see-all-election-results { position: absolute; bottom: 0.5em; right: 0; font-family: Helvetica, Arial, sans-serif; font-size: 13px; }
    .see-all-election-results a { text-decoration: underline; }
</style>

<script src='https://apps.bostonglobe.com/common/js/pym/pym-0.4.5.min.js'></script>
<script>

    // MODIFY: these three variables
    var raceType  = 'caucuses';   // e.g. caucuses, primary
    var party     = 'democratic'; // e.g. democratic, republican
    var state     = 'iowa';       // e.g. new hampshire, alaska

    // MODIFY: make sure this is the same as the id field in the first line
    var uniqueId  = 'bg-primaries-smt-caucuses-democratic-iowa';

    var baseurl   = 'http://dev.apps.bostonglobe.com/graphics/2016/02/state-results-small-table';
    var url       = [baseurl, '?raceType=', raceType, '&party=', party, '&state=', state].join('');
    var pymParent = new pym.Parent(uniqueId, url, {});
</script>
```

**Note:** make sure that the id field is unique in the page. In other words, make sure there are no other elements with that id or the graphic won't work.

Slot the *.jpt* in your article or section front and you're done.

## Developers

#### Setup

- `npm i`


{'fraction_non_alphanumeric': 0.14764325323475047, 'fraction_numerical': 0.029805914972273567, 'mean_word_length': 3.7467105263157894, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 34, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1903041', 'n_tokens_mistral': 1576, 'n_tokens_neox': 1446, 'n_words': 432}