Comments (5)
@NightMachinary you could have the chat in a separate blessed window and redraw it when your data changes. In other words, you need to locate your chart in your output and redraw it, by overwriting it.
from asciichart.
Hi! What's your programming language?
from asciichart.
hello @kroitor I am using Javascript
from asciichart.
@alextran1502 assuming you can read the data points from your stream, you can add them to the set of most recent maxLength elements in your array of data upon reading, and then redraw the chart using the most recent elements. In the simplest form it would look like:
const maxLength = 80
const numbers = []
while (true) {
const number = readFromStream () // your reading logic here
if (numbers.length >= maxLength) {
numbers.shift ()
}
numbers.push (number)
console.log (plot (numbers))
}
Let me know if that does not answer the question. Feel free to reopen this if needed or just ask further questions, if any.
from asciichart.
@kroitor commented on Feb 28, 2020, 10:13 AM GMT+3:30:
@alextran1502 assuming you can read the data points from your stream, you can add them to the set of most recent maxLength elements in your array of data upon reading, and then redraw the chart using the most recent elements. In the simplest form it would look like:
const maxLength = 80 const numbers = [] while (true) { const number = readFromStream () // your reading logic here if (numbers.length >= maxLength) { numbers.shift () } numbers.push (number) console.log (plot (numbers)) }Let me know if that does not answer the question. Feel free to reopen this if needed or just ask further questions, if any.
I want to just plot the streaming data (each new line being the updated value) from stdin. How do I do that?
from asciichart.
Related Issues (20)
- Python crashes on empty charts HOT 2
- Monospace formatting issues on web browsers HOT 15
- [Python] height off-by-one bug? HOT 1
- Bricks/boxes instead of lines HOT 10
- broken chart with a big array HOT 1
- Fixed y-axis HOT 2
- Failure with very long series HOT 13
- Description at pypi.org is wrong HOT 5
- Graph characters not clearing on row change (asciichartpy)? HOT 7
- Way of labeling x axis HOT 7
- Live Updating HOT 6
- Chart not showing lines. Maybe im missing a font? HOT 6
- readme disagrees with license HOT 5
- Small values all turns into 0s
- print out to png HOT 1
- Python Port Docs HOT 1
- . HOT 1
- color config doesn't work in python code on my mac terminal HOT 2
- can this tool plot real-time data?
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 asciichart.