<commit_before>jsbayes-viz
===========

This JavaScript library is a Bayesian Belief Network (BBN) visualization and interaction tool. It is built on the following projects.

* [d3](https://github.com/mbostock/d3)
* [dagre](https://github.com/cpettitt/dagre)
* [jsbayes](https://github.com/vangj/jsbayes)

# How do I use jsbayes-viz?

You should only be using this library on the client-side (e.g. with a browser). You may install this library using [bower](http://bower.io).

`bower install jsbayes-viz --save`

Since there are third party dependencies, you need to reference them in your HTML in the following order. Assuming you have used bower to install the library (and its dependencies), you may reference the libaries as the following.

```
<script src="bower_components/d3/d3.js"></script>
<script src="bower_components/lodash/lodash.js"></script>
<script src="bower_components/graphlib/dist/graphlib.core.js"></script>
<script src="bower_components/dagre/dist/dagre.core.js"></script>
<script src="bower_components/jsbayes/jsbayes.js"></script>
<script src="bower_components/jsbayes-viz/jsbayes-viz.js"></script>
```

jsbayes is the inference engine, so to use jsbayes-viz, first create a jsbayes graph.

```
var graph = jsbayes.newGraph();
var n1 = graph.addNode('n1', ['t', 'f']);
var n2 = graph.addNode('n2', ['t', 'f']);
var n3 = graph.addNode('n3', ['t', 'f']);
var n4 = graph.addNode('n4', ['t', 'f']);<commit_msg>change from bower to npm<commit_after>jsbayes-viz
===========

This JavaScript library is a Bayesian Belief Network (BBN) visualization and interaction tool. It is built on the following projects.

* [d3](https://github.com/mbostock/d3)
* [dagre](https://github.com/cpettitt/dagre)
* [jsbayes](https://github.com/vangj/jsbayes)

# How do I use jsbayes-viz?

You should only be using this library on the client-side (e.g. with a browser). You may install this library using npm.

`npm install jsbayes-viz --save`

Since there are third party dependencies, you need to reference them in your HTML in the following order. Assuming you have used bower to install the library (and its dependencies), you may reference the libaries as the following.

```
<script src="node_modules/d3/d3.js"></script>
<script src="node_modules/lodash/lodash.js"></script>
<script src="node_modules/graphlib/dist/graphlib.core.js"></script>
<script src="node_modules/dagre/dist/dagre.core.js"></script>
<script src="node_modules/jsbayes/jsbayes.js"></script>
<script src="node_modules/jsbayes-viz/jsbayes-viz.js"></script>
```

jsbayes is the inference engine, so to use jsbayes-viz, first create a jsbayes graph.

```
var graph = jsbayes.newGraph();
var n1 = graph.addNode('n1', ['t', 'f']);
var n2 = graph.addNode('n2', ['t', 'f']);
var n3 = graph.addNode('n3', ['t', 'f']);
var n4 = graph.addNode('n4', ['t', 'f']);
{'fraction_non_alphanumeric': 0.16076487252124647, 'fraction_numerical': 0.0084985835694051, 'mean_word_length': 5.088362068965517, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 6, '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': '2158343', 'n_tokens_mistral': 1001, 'n_tokens_neox': 961, 'n_words': 285}