Skip to content

Commit

Permalink
Added support for new block types in Unicode 13 and 16.
Browse files Browse the repository at this point in the history
  • Loading branch information
tdulcet committed Dec 17, 2024
1 parent ed5d06d commit 3c97ad9
Show file tree
Hide file tree
Showing 7 changed files with 237 additions and 154 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
name: Linux C++

runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.cxx == 'clang++' && matrix.os == 'ubuntu-20.04' }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
Expand Down Expand Up @@ -68,7 +69,7 @@ jobs:
python3 -m pip install --upgrade pip
python3 -m pip install ruff
- name: Script
run: ruff check --output-format=github --target-version py37 --select F,E4,E7,E9,W,I,D,UP,YTT,ANN,S,BLE,B,A,COM819,C4,T10,EM,EXE,ISC,ICN,G,PIE,PYI,Q,RSE,RET,SLF,SLOT,SIM,TID,TCH,ARG,PGH,PL,TRY,FLY,PERF,FURB,LOG,RUF --preview --ignore W191,D211,D213,D401,PLR09,PLR1702,PLR2004,FURB101,FURB167,RUF001,RUF002,RUF003,RUF023 .
run: ruff check --output-format=github --target-version py37 --select F,E4,E7,E9,W,I,D,UP,YTT,ANN,S,BLE,B,A,COM819,C4,T10,EM,EXE,ISC,ICN,G,PIE,PYI,Q,RSE,RET,SLF,SLOT,SIM,TID,TC,ARG,PGH,PL,TRY,FLY,PERF,FURB,LOG,RUF --preview --ignore W191,D211,D213,D401,PLR09,PLR1702,PLR2004,FURB101,FURB167,RUF001,RUF002,RUF003,RUF023 .
continue-on-error: true

Python:
Expand Down
44 changes: 25 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ Other compilers should work as well, but are not (yet) tested.

Run with: `./graphs`

If `height` is `0`, it will be set to the current height of the terminal (number of rows times four). If `width` is `0`, it will be set to the current width of the terminal (number of columns times two).
If `height` is `0`, it will be set to the current height of the terminal (number of rows). If `width` is `0`, it will be set to the current width of the terminal (number of columns).

#### Output array as histogram

Expand All @@ -557,8 +557,8 @@ using namespace std;

int main()
{
size_t height = 160;
size_t width = 160;
size_t height = 40;
size_t width = 80;

long double xmin = -20;
long double xmax = 20;
Expand Down Expand Up @@ -588,8 +588,8 @@ using namespace std;

int main()
{
size_t height = 160;
size_t width = 160;
size_t height = 40;
size_t width = 80;

long double xmin = -20;
long double xmax = 20;
Expand Down Expand Up @@ -623,8 +623,8 @@ using namespace std;

int main()
{
size_t height = 160;
size_t width = 160;
size_t height = 40;
size_t width = 80;

long double xmin = -20;
long double xmax = 20;
Expand Down Expand Up @@ -654,8 +654,8 @@ using namespace std;

int main()
{
size_t height = 160;
size_t width = 160;
size_t height = 40;
size_t width = 80;

long double xmin = -20;
long double xmax = 20;
Expand Down Expand Up @@ -696,8 +696,8 @@ double afunction(double x)

int main()
{
size_t height = 160;
size_t width = 160;
size_t height = 40;
size_t width = 80;

long double xmin = -20;
long double xmax = 20;
Expand All @@ -719,8 +719,8 @@ using namespace std;
int main()
{
size_t height = 160;
size_t width = 160;
size_t height = 40;
size_t width = 80;
long double xmin = -20;
long double xmax = 20;
Expand Down Expand Up @@ -759,8 +759,8 @@ double function2(double x)

int main()
{
size_t height = 160;
size_t width = 160;
size_t height = 40;
size_t width = 80;

long double xmin = -20;
long double xmax = 20;
Expand All @@ -787,8 +787,8 @@ using namespace std;
int main()
{
size_t height = 160;
size_t width = 160;
size_t height = 40;
size_t width = 80;
long double xmin = -20;
long double xmax = 20;
Expand Down Expand Up @@ -874,10 +874,16 @@ Values:

1. `type_braille`: Braille (default)
![](images/type%20braille%20graph.png)
2. `type_block`: Block
2. `type_block_quadrant`: Block quadrant
![](images/type%20block%20graph.png)
3. `type_separated_block_quadrant`: Separated block quadrant
4. `type_block_sextant`: Block sextant
5. `type_separated_block_sextant`: Separated block sextant
6. `type_block_octant`: Block octant

The Braille type has the highest resolution of 2×4 pixels per character, while the block type uses 2×2. This option is only used for plots and graphs. Histograms use 1×8 pixels per character.
The Braille and block octant types have the highest density of 2×4 pixels per character, while the two block sextant types use 2×3 and the two block quadrant types use 2×2. This option is only used for plots and graphs. Histograms use 1×8 pixels per character.

The block sextant type requires support for Unicode 13.0, while the separated block quadrant, separated block sextant and block octant types require support for Unicode 16.0.

#### Mark type

Expand Down
4 changes: 2 additions & 2 deletions graphs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ constexpr long double function5(long double x)

int main()
{
const size_t height = 160;
const size_t width = 160;
const size_t height = 40;
const size_t width = 80;

const long double xmin = -20;
const long double xmax = 20;
Expand Down
Loading

0 comments on commit 3c97ad9

Please sign in to comment.