JShow for kdb+
Sunday, October 23rd, 2005I’ve decided to make jshow freely available.
Jshow is a multiplatform table viewer for kdb+.
It runs as a daemon on a users workstation. kdb+ servers can connect to it and send it tables for displaying on the workstation screen.
It is a java application, and as such it should be invoked as
java -jar jshow.jar [port]
and the port defaults to 9999 if not specified.
At a kdb+ console, you can then send tables to JShow for display on your workstation. You need only to open a connection to JShow in the following manner
js:neg H:hopen`$”:mypc.mycompany.com:9999″
and from then on invoked from k or q as
js table
or
js(`tableName;table)
The table will then appear on the user’s display. It is important to use the async msg, i.e. neg h, as jshow does not currently send any response to the server. If you try to use a sync msg you will hang your server, and the only way to recover from that will be to kill the jshow java daemon process.
If you specify a table name, jshow will resuse any existing frame with that title created from that handle.
Issuing
js`cls
will clear all windows created by that handle.
Closing the handle will also close all windows created by that handle.
Further functions can be created based upon js. E.g., to show the last 100 rows of a nested table
jsln:{js (x;-100#`time xasc ungroup value x)}
jsln `trade
Charting
jshow can also do primitive time series charting of data in tables. The first column must be of a time type, e.g. date, time, datetime, month, minute or second, and the other columns must be numeric. One series gets plotted for each column.
Right-clicking on the chart at runtime pops up a menu which allows the title, legends and colors to be changed. The chart can also be printed or saved to file in png format.
Usage
Tables of upto 20000 rows cab be sorted by clicking on the column header. Compound sorting can be achieved through ctrl-clicking additional column headers.
Download
The software is distributed without warranty and under license.
The download consists of a single jar file. You must accept these license terms before downloading. Click here to download.
To install, download the jar file and save it somewhere convenient, e.g. c:k4.
Jshow requires a Java runtime environment, at least version 1.4. This can be downloaded from www.javasoft.com.
Configuration
There is no configuration other than being able to specify the port that JShow should listen on.
To view very large tables, you may need to allocate more memory to java. This can be done at the command line as
java -Xmx512M -jar jshow.jar [port]
If you prefer a different look and feel to the application, you can set the look and feel at the command line. Windows users can invoke as
java -Dswing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel -jar jshow.jar [port]
More infomation on setting look and feel can be found at suns website.
Troubleshooting
Problem: JShow is not displaying any tables
Possible cause: It may be that a firewall is stopping q connecting to where JShow is running.