<commit_before>schemaviz
=========

Visually represent every table in your database schema, and the foreign key relationships (and more) between these tables, using [d3.js](http://d3js.org/ "d3.js home page").

# 0. If You're in A Hurry

The quickest way to get things up and running is to clone this repository, and start an HTTP server in the repository directory:

```
$ git clone https://github.com/shashank025/schemaviz.git
$ cd schemaviz/
```

Python 2:

```
$ python -m SimpleHTTPServer 5009 &
```

Python 3:

```
$ python3 -m http.server 5009
```

You can then access the visualization with the default schema by pointing your browser at the following url:

```
http://localhost:5009/index.html
```

The `index.html` suffix is optional, of course. You can modify any parameters of your visualization by editing [viz.js](viz.js) directly.

You can also see an example at the [Schemaviz Github project page](http://shashank025.github.io/schemaviz/).

# 1. HOWTO

We use d3's [force directed layout scheme](https://github.com/mbostock/d3/wiki/Force-Layout) to produce an SVG image where each relation (table) in your schema is rendered as a node. A directed edge is added from node A to node B if some columns in A refer to some columns in B:

```
    A ---> B
```


Use the provided [schema.csv](schema.csv) file to tell schemaviz what your schema looks like. This file should contain comma-separated records of the form:

```<commit_msg>update README to reflect new reality<commit_after>schemaviz
=========

Visually represent every table in your database schema, and the foreign key relationships (and more) between these tables, using [d3.js](http://d3js.org/ "d3.js home page").

# 0. If You're in A Hurry

**Prerequisite:** **Yarn** (installation instructions)

The quickest way to get things up and running is to clone this repository, and start an HTTP server in the repository directory:

```
$ git clone https://github.com/shashank025/schemaviz.git
$ cd schemaviz/
$ yarn start
```

You can access the visualization with the provided default schema by pointing your browser at the following url:

```
http://localhost:8080/
```

You can also see an example at the [Schemaviz Github project page](http://shashank025.github.io/schemaviz/).

# 1. HOWTO

We use d3's [force directed layout scheme](https://github.com/mbostock/d3/wiki/Force-Layout) to produce an SVG image where each relation (table) in your schema is rendered as a node. A directed edge is added from node A to node B if some columns in A refer to some columns in B:

```
    A ---> B
```


Use the provided [schema.csv](schema.csv) file to tell schemaviz what your schema looks like. This file should contain comma-separated records of the form:

```
{'fraction_non_alphanumeric': 0.10223525100769512, 'fraction_numerical': 0.016489556614144377, 'mean_word_length': 4.150943396226415, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '1132484', 'n_tokens_mistral': 859, 'n_tokens_neox': 785, 'n_words': 364}