[racket] Small Inline Visualizations In DrRacket's REPL

From: Laurent (laurent.orseau at gmail.com)
Date: Thu May 10 02:13:23 EDT 2012

Hi,

Here (attached) is another small lib to display tables in text format.
Sample output:
╭────┬┬────────┬────╮
│i   ││f1      │f2  │
├────┼┼────────┼────┤
├────┼┼────────┼────┤
│a   ││b       │c   │
├────┼┼────────┼────┤
│x   ││y       │z   │
╰────┴┴────────┴────╯

Unfortunately, my version of DrRacket displays one too many pixel.
If you enhance it, let me know ;)

Laurent

On Thu, May 10, 2012 at 5:31 AM, Ray Racine <ray.racine at gmail.com> wrote:

> I was forwarded a nice working sample from Grant Rettke.  From a high
> level, just build a snip% and display it.
>
>
> On Wed, May 9, 2012 at 10:14 PM, Ray Racine <ray.racine at gmail.com> wrote:
>
>> Say I have a modestly complex set of data contained in a standard Racket
>> structure, e.g.  (struct: Data ([...])).  I'd like to define some sort of
>> specialized pretty print (visualization) capability to be used withing
>> DrRacket at the REPL level.
>>
>> So I'm working with some code in Dr Racket in the REPL.
>>
>> > (define data (Data ....)) ;; create a structure of data
>>
>> > (pretty-visualize data) ;; Either pops up some dialog with
>> text/graphical visualization or is rendered by the REPL immediately below.
>> ==================
>> |  Text
>> |   or 2-d Canvas
>> |   rendering here.
>> |
>> |
>> ==================
>>
>> > |
>>
>> Say something along the lines one can see in the Professional Tables here.
>> http://en.wikibooks.org/wiki/LaTeX/Tables
>>
>> I've been poking around in the DrRacket manual but haven't found any
>> place to gain traction on something like this.   Any pointers on here I
>> should start reading?
>>
>> Thanks in advance.
>>
>>
>
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120510/017c460b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: text-table.rkt
Type: application/octet-stream
Size: 2935 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20120510/017c460b/attachment-0001.obj>

Posted on the users mailing list.