A small Java library for producing nice looking text-based line-graphs and tables. (Not necessarily in ASCII).
Please view the Wiki! You'll find everything you need to get started using this library. :)
A small Java library for producing nice looking text-based line-graphs and tables.
License: Apache License 2.0
A small Java library for producing nice looking text-based line-graphs and tables. (Not necessarily in ASCII).
Please view the Wiki! You'll find everything you need to get started using this library. :)
Hi, I suggest some improvement for this great library.
In East Asian languages, including Japanese, characters are represented with a width twice that of ASCII. This is expressed as full width in Unicode.
This library seems to calculate the amount of padding simply by character count, so if input that includes full-width characters is given, the table display will be corrupted.
Since there are libraries that determine whether Unicode characters are full-width or not[1], it would be possible to render the table accurately by improving the algorithm that calculates the amount of padding.
Actual output:
Thanks!
I'm using this library mostly for debugging trading bots. The problem is that the prices never go to 0, but instead hang around, let's say, 8000. The charts force the zero to be in range of the Y axis, which flattens my chart to a point where I can't see movements anymore. Can you add an option to not force zero in range on the Y axis? Or better yet, allow us to determine our own ranges?
Could you please port some features of the UnicodePlots project?
Especially scatterplot
and lineplot
An NPE is thrown when some of the data cells are null. It would be good if these could be rendered in a special way (e.g. as "null" or configurable via a new method withNullValue(String)
) to differentiate them from empty strings.
Example to reproduce the NPE:
System.out.println(ASCIITable.fromData(new String[]{"ID", "Name"}, new String[][]{{"1", null},}).toString());
This results in:
Exception in thread "main" java.lang.NullPointerException
at com.mitchtalmadge.asciidata.table.ASCIITable.<init>(ASCIITable.java:79)
I appreciate that I could convert the data before passing it into ASCIITable, but having absent values is quite a common scenario and I think your library would be improved by handling this gracefully.
I would like an option to generate a table without a header. Sometimes there is no meaning to the columns of the table, so the header cells are empty. As a workaround, I strip the first two lines of the generated table and fix the corner and column separator characters.
For the tables, it would be really useful to have an option on the ASCIITable
class to set a column's justification, so that we can create tables with centered or right-aligned content. What do you think about it?
Instead of this:
╔═══════════╤══════════╗
║ FirstName │ LastName ║
╠═══════════╪══════════╣
║ Foo │ Bar ║
╟───────────┼──────────╢
║ Kit │ Kat ║
╚═══════════╧══════════╝
I sometimes prefer this:
╔═══════════╤══════════╗
║ FirstName │ LastName ║
╠═══════════╪══════════╣
║ Foo │ Bar ║
╟───────────┼──────────╢
║ Kit │ Kat ║
╚═══════════╧══════════╝
Escpecially when numbers are involved:
╔═══════════╤══════════╗
║ Name │ Score ║
╠═══════════╪══════════╣
║ Foo │ 5 ║
╟───────────┼──────────╢
║ Kit │ 123 ║
╚═══════════╧══════════╝
ASCIIGraph.fromSeries(new double[]{14280.0, 2.93811E8}).withNumRows(10).plot()
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at com.mitchtalmadge.asciidata.graph.ASCIIGraph.drawTicksAndAxis(ASCIIGraph.java:181)
at com.mitchtalmadge.asciidata.graph.ASCIIGraph.plot(ASCIIGraph.java:157)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.