<commit_before>Numero-log: Lavacharts
======================

[![Build Status](https://img.shields.io/travis/NamelessCoder/numerolog-lavacharts.svg?style=flat-square&label=package)](https://travis-ci.org/NamelessCoder/numerolog-lavacharts) [![Coverage Status](https://img.shields.io/coveralls/NamelessCoder/numerolog-lavacharts/master.svg?style=flat-square)](https://coveralls.io/r/NamelessCoder/numerolog-lavacharts)

Thin client to access Numerolog counters and render then as graphs using the Lavacharts
library (https://github.com/kevinkhill/lavacharts) which in turn uses Google's powerful
Charts package (https://developers.google.com/chart/interactive/docs). The client pulls
values from a Numerolog package using a token, then renders the data sets as a nice
chart. All graph types and options of Google Charts are supported.

Being Javascript based, this charting package is obviously limited to browser-based use.

Installation
------------

Use composer:

```bash
composer require namelesscoder/numerolog-lavacharts
```

Usage
-----

Then either integrate from anywhere by calling methods manually with an array as input:

```php
$query = new \NamelessCoder\NumerologLavacharts\ChartQuery($_GET);
$chart = new \NamelessCoder\NumerologLavacharts\NumerologChart();
echo $chart->renderGraphQuery($query);
```

Alternatively, do the same but configure the ChartQuery manually:

```php
$query = new \NamelessCoder\NumerologLavacharts\ChartQuery();
$query->setChartLabel('My special chart');
$query->setChartHeight(400);
$query->setChartWidth(800);
$chart = new \NamelessCoder\NumerologLavacharts\NumerologChart();
echo $chart->renderGraphQuery($query);
```

The output will include both the `<div>` that will contain the graph as well as every
dependency required by Google Charts to render the graph. Graph data is converted to a
JavaScript array that is embedded in the HTML.

Integration
-----------
<commit_msg>[DOC] Adjust code example<commit_after>Numero-log: Lavacharts
======================

[![Build Status](https://img.shields.io/travis/NamelessCoder/numerolog-lavacharts.svg?style=flat-square&label=package)](https://travis-ci.org/NamelessCoder/numerolog-lavacharts) [![Coverage Status](https://img.shields.io/coveralls/NamelessCoder/numerolog-lavacharts/master.svg?style=flat-square)](https://coveralls.io/r/NamelessCoder/numerolog-lavacharts)

Thin client to access Numerolog counters and render then as graphs using the Lavacharts
library (https://github.com/kevinkhill/lavacharts) which in turn uses Google's powerful
Charts package (https://developers.google.com/chart/interactive/docs). The client pulls
values from a Numerolog package using a token, then renders the data sets as a nice
chart. All graph types and options of Google Charts are supported.

Being Javascript based, this charting package is obviously limited to browser-based use.

Installation
------------

Use composer:

```bash
composer require namelesscoder/numerolog-lavacharts
```

Usage
-----

Then either integrate from anywhere by calling methods manually with an array as input:

```php
$query = new \NamelessCoder\NumerologLavacharts\ChartQuery($_GET);
$chart = new \NamelessCoder\NumerologLavacharts\NumerologChart();
echo $chart->renderChartQuery($query);
```

Alternatively, do the same but configure the ChartQuery manually:

```php
$query = new \NamelessCoder\NumerologLavacharts\ChartQuery();
$query->setChartLabel('My special chart');
$query->setChartHeight(400);
$query->setChartWidth(800);
$chart = new \NamelessCoder\NumerologLavacharts\NumerologChart();
echo $chart->renderChartQuery($query);
```

The output will include both the `<div>` that will contain the graph as well as every
dependency required by Google Charts to render the graph. Graph data is converted to a
JavaScript array that is embedded in the HTML.

Integration
-----------

{'fraction_non_alphanumeric': 0.12558380902957966, 'fraction_numerical': 0.0031136481577581734, 'mean_word_length': 5.533898305084746, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7069174', 'n_tokens_mistral': 1184, 'n_tokens_neox': 1110, 'n_words': 337}