Skip to content

Commit

Permalink
readme documented. Stable version
Browse files Browse the repository at this point in the history
  • Loading branch information
Jkutkut committed Sep 5, 2022
1 parent 43aa4dd commit bac89d7
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,46 @@

My own implementation of a graph generator using ascii characters.

![big](res/img/2plots-big.png)

## Usage:

Use the method ```AsciiGraph.plot```. You can customize the graph following this logic:

```
AsciiGraph.plot(
plots: list,
keys: list,
dy: int = 1,
dx: int = 1,
min_value_overlap_axis: bool = False,
hide_horizontal_axis: bool = True
) -> str:
```

- ```plots```: Array of dictionaries with the values and the color of the plot. Keep in mind that the length of all the values arrays must be the same.
```python
plots = [
{
'values': [1, 2, ..., n],
'color': 'color_as_string',
},
...
]
```

- ```keys```: Array of elements to be used as values for the horizontal axis. Keep in mind that the length of this array must be equal to the length of the values array in each plot.
```python
keys = ['1', '2', ..., 'n']
```

- ```dy```: Separation between values in the vertical axis. Default: 1
- ```dx```: Separation between values in the horizontal axis. Default: 1
- ```min_value_overlap_axis```: If True, the minimum value collides with the horizontal axis. If False, the minimum value is placed above the horizontal axis. Default: False
- ```hide_horizontal_axis```: If True, the horizontal axis is not shown. Default: True

![medium](res/img/2plots-medium.png)

## Note:

Idea taken from the [asciigraph](https://github.com/guptarohit/asciigraph) library.
Binary file added res/img/2plots-big.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/img/2plots-medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bac89d7

Please sign in to comment.