Comments (2)
Correct it's the normalization, the width is the overall width and not necessarily what it will draw, just what it tries to fit the data in to.
I think to get consistent widths from call to call it will need a normalization factor passed in, so it treats data the same across calls.
from termgraph.
I'm also experiencing this on the CLI. EG:
$ termgraph --version
termgraph v0.5.3
$ cat data.txt
2024-07-23T12:48:01-04:00 2.27 97.73
2024-07-23T14:48:01-04:00 9.3 90.7
2024-07-23T16:48:01-04:00 12.93 87.07
2024-07-23T18:48:01-04:00 19.72 80.28
2024-07-23T20:48:01-04:00 23.6 76.4
2024-07-23T22:48:01-04:00 29.82 70.18
2024-07-24T00:48:01-04:00 31.33 68.67
$ cat data.txt | termgraph --stacked
2024-07-23T12:48:01-04:00: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100.00
2024-07-23T14:48:01-04:00: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100.00
2024-07-23T16:48:01-04:00: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100.00
2024-07-23T18:48:01-04:00: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100.00
2024-07-23T20:48:01-04:00: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100.00
2024-07-23T22:48:01-04:00: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100.00
2024-07-24T00:48:01-04:00: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100.00
![Screenshot 2024-07-29 at 11 01 27 AM](https://private-user-images.githubusercontent.com/1323808/353124756-102aa0e6-9459-4669-a8dd-b475456d53c9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUwNzk1NzEsIm5iZiI6MTcyNTA3OTI3MSwicGF0aCI6Ii8xMzIzODA4LzM1MzEyNDc1Ni0xMDJhYTBlNi05NDU5LTQ2NjktYThkZC1iNDc1NDU2ZDUzYzkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgzMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MzFUMDQ0MTExWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OGZiNjY3MjZlZWEwZmFhMTgzZGU2MzBiNDZlMzc5MzdlNzgwYWE5MzM0MzUxYzYyMzg3YTM1MWNlMTlhZjUzMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.0RLVqN0NjbTNSURiysZVwWChMe7N5g0WdHEC2B2rL0Q)
If I truncate the decimals, essentially turning the floats into integers, the problem goes away:
$ cat data2.txt
2024-07-23T12:48:01-04:00 2 97
2024-07-23T14:48:01-04:00 9 90
2024-07-23T16:48:01-04:00 12 87
2024-07-23T18:48:01-04:00 19 80
2024-07-23T20:48:01-04:00 23 76
2024-07-23T22:48:01-04:00 29 70
2024-07-24T00:48:01-04:00 31 68
$ cat data2.txt | termgraph --stacked
2024-07-23T12:48:01-04:00: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 99.00
2024-07-23T14:48:01-04:00: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 99.00
2024-07-23T16:48:01-04:00: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 99.00
2024-07-23T18:48:01-04:00: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 99.00
2024-07-23T20:48:01-04:00: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 99.00
2024-07-23T22:48:01-04:00: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 99.00
2024-07-24T00:48:01-04:00: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 99.00
from termgraph.
Related Issues (20)
- Include darker colors for color output
- does not work properly when opened using subprocess.call(), subprocess.run() or similar commands in python script
- Custom ticks for multi-variable chart
- Color formatting of "0" values spills over to the next line
- Explanation of automatic dimming of labels
- "T" suffixes in displayed values HOT 2
- Feature request: provide a static scale option
- Making entry points in python
- --no-values doesn't work when combined with --stacked
- Three unnecessary blank lines
- TICK in Windows 10 (power shell) looks like small question marks ? HOT 1
- Cannot import API module HOT 3
- Progressive Graph on Reading Each Data
- ValueError: math domain error if value == 0 HOT 1
- Could there be a support for pie-charts in termgraph?
- Line after 0 grayed out
- A flag to swap labels and values in the input (Unix "uniq" compatibility) HOT 1
- Documentation to use termgraph as python module within python script
- Smoother rendering in Windows? HOT 1
- disabling "cvt_to_readable" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from termgraph.