Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Q on efficiently showing large BLT vectors in tabular format

3 views
Skip to first unread message

Bryan Oakley

unread,
May 21, 2007, 12:42:02 PM5/21/07
to
I've got a BLT graph using several BLT vectors, each with as much as
86,000+ values. I want to see the textual form of this information in a
tabular format.

What I don't want is to duplicate the data (read: copy each vector's
data into a list variable and use a listbox for each vector, for
example). I'm looking for something similar to hugelist [1] or
virtuallist [2] but tuned specifically for BLT vectors.

Does anyone know of such a beast?

[1] http://wiki.tcl.tk/6784
[2] http://wiki.tcl.tk/10035

Thanks.

--
Bryan Oakley
http://www.tclscripting.com

Bryan Oakley

unread,
May 23, 2007, 2:27:44 PM5/23/07
to
Nobody had a reply, but for those who may stumble onto this thread in
the future...

The solution was pretty simple. I just wrote my own custom
scrollbar-handling code and tied it to a tablelist widget. Admittedly it
took half a day or so to get it right but in the end it's only 60 lines
of code or so, and I could probably cut that in half if I had the time.

The idea is to take the scrollbar values (two numbers between 0.0 and
1.0) and use those to compute the range of elements in the vector(s) to
be displayed. Using features from the tablelist, I'm able to grab the
data with [$vector range $top $bottom] and just drop it in the tablelist
one column at a time. And, of course, as I add data to the vectors I
have to update the scrollbars so they are relative to the total amount
of data available.

As an aside, this is the second time in about as many years that I've
had a need to use BLT, and I'm again reminded of just how powerful the
BLT graph and vector functionality is. If you've not used it before, I
don't think it's an understatement to say that it does way more than you
might imagine it does.

Bruce Hartweg

unread,
May 24, 2007, 9:17:03 AM5/24/07
to
Bryan Oakley wrote:
> Nobody had a reply, but for those who may stumble onto this thread in
> the future...
>
> The solution was pretty simple. I just wrote my own custom
> scrollbar-handling code and tied it to a tablelist widget. Admittedly it
> took half a day or so to get it right but in the end it's only 60 lines
> of code or so, and I could probably cut that in half if I had the time.
>
don't ya' love Tcl ;)

> The idea is to take the scrollbar values (two numbers between 0.0 and
> 1.0) and use those to compute the range of elements in the vector(s) to
> be displayed. Using features from the tablelist, I'm able to grab the
> data with [$vector range $top $bottom] and just drop it in the tablelist
> one column at a time. And, of course, as I add data to the vectors I
> have to update the scrollbars so they are relative to the total amount
> of data available.


>
> As an aside, this is the second time in about as many years that I've
> had a need to use BLT, and I'm again reminded of just how powerful the
> BLT graph and vector functionality is. If you've not used it before, I
> don't think it's an understatement to say that it does way more than you
> might imagine it does.
>

I'll have to second that, it is very simple to do some very nice things,
incredibly powerful & *fast*

Bruce

rene

unread,
May 24, 2007, 9:57:55 AM5/24/07
to

Bryan Oakley schrieb:

> Nobody had a reply, but for those who may stumble onto this thread in
> the future...
>
> The solution was pretty simple. I just wrote my own custom
> scrollbar-handling code and tied it to a tablelist widget. Admittedly it
> took half a day or so to get it right but in the end it's only 60 lines
> of code or so, and I could probably cut that in half if I had the time.
may be you convince george howlett to include this in blt.
According to the cvs-changes he is working again on blt.
I hope he can make it TEA compatible :)


rene

Bryan Oakley

unread,
May 24, 2007, 12:50:11 PM5/24/07
to
Bruce Hartweg wrote:
> Bryan Oakley wrote:
>> Nobody had a reply, but for those who may stumble onto this thread in
>> the future...
>>
>> The solution was pretty simple. I just wrote my own custom
>> scrollbar-handling code and tied it to a tablelist widget. Admittedly
>> it took half a day or so to get it right but in the end it's only 60
>> lines of code or so, and I could probably cut that in half if I had
>> the time.
>>
> don't ya' love Tcl ;)

As a matter of fact, yes!

I was in high-praise mode just this morning while talking to a
co-worker, marveling about the foresight JO had in designing Tk. His
designs have really stood the test of time.

To be able to take vectors from BLT, a megawidget for displaying tables
of information, and a stock scrollbar, and make them all work together
seamlessly (with zero performance problems) is a testament to good
design by all those involved.

Eric Boudaillier

unread,
May 24, 2007, 1:59:55 PM5/24/07
to
Hello Bryan,

> Nobody had a reply, but for those who may stumble onto this thread in
> the future...

I am not used to write (anymore) in newsgroups, and I thought the
answer was obvious.
Am I the only one to play with Tktable? Using Tktable with -command is
exactly what you want.
I use it everyday with SQLite, displaying queries of approx. 25000
rows. in less than a second.

--
-eric

Bryan Oakley

unread,
May 24, 2007, 2:34:52 PM5/24/07
to

I've toyed with tktable, but in all the years I've done Tk programming
I've only once or twice ever needed to display tables of data so it's
not part of my normal toolchest.

We don't use tktable in our product so I wouldn't have considered it
unless it was the only solution. Fortunately I've proven it isn't. My
ultimate solution required only about 80 lines of code in its currently
un-optimized state.

Thanks anyway!

0 new messages