Is there an easy way to make a GLM table column right-justified?
I have some numeric columns and I think they would be easier to read if right-justified.
I am also still looking for a way to use a fixed-width font for various glamorous components like lists, tables, and text. This would help me to present semi-structured data that doesn't *quite* fit into uniform columns in a readable way. Is there a way to do that?
Thanks! -Luke
Hi,
By default there is no support for right-justified columns in Glamour. But have a look at the glamour presentation based on fast table. With that presentation the #column:evaluated: method can also return a morph, not just a string. It might be possible to return a morph that aligns the content to the right.
What do you mean by fixed-width font? Do you have an example of what you'd like to do?
Cheers, Andrei
On Fri, Mar 30, 2018 at 12:58 PM, Luke Gorrie luke@snabb.co wrote:
Is there an easy way to make a GLM table column right-justified?
I have some numeric columns and I think they would be easier to read if right-justified.
I am also still looking for a way to use a fixed-width font for various glamorous components like lists, tables, and text. This would help me to present semi-structured data that doesn't *quite* fit into uniform columns in a readable way. Is there a way to do that?
Thanks! -Luke
Moose-dev mailing list Moose-dev@list.inf.unibe.ch https://www.list.inf.unibe.ch/listinfo/moose-dev
On 30 March 2018 at 22:11, Andrei Chis chisvasileandrei@gmail.com wrote:
Hi,
By default there is no support for right-justified columns in Glamour. But have a look at the glamour presentation based on fast table. With that presentation the #column:evaluated: method can also return a morph, not just a string. It might be possible to return a morph that aligns the content to the right.
Thanks for that tip!
What do you mean by fixed-width font? Do you have an example of what you'd like to do?
If you have HTML enabled in your email client then I can demonstrate right here.
I would like to be able to format semi-structured text in a fixed-width font for neat alignment like this:
---- TRACE 1 start stdin:1 0006 MULVN 0 0 1 ; -3 0007 FORL 1 => 0006 ---- TRACE 1 IR .... SNAP #0 [ ---- ] 0001 rbp int SLOAD #2 CI 0002 xmm7 > num SLOAD #1 T 0003 xmm7 + num MUL 0002 -3 0004 rbp + int ADD 0001 +1 .... SNAP #1 [ ---- 0003 ] 0005 > int LE 0004 +1000 .... SNAP #2 [ ---- 0003 0004 ---- ---- 0004 ] 0006 ------------ LOOP ------------ 0007 xmm7 + num MUL 0003 -3 0008 rbp + int ADD 0004 +1 .... SNAP #3 [ ---- 0007 ]
and I would like to avoid presenting it with a variable-width font and wonky alignment like this:
---- TRACE 1 start stdin:1 0006 MULVN 0 0 1 ; -3 0007 FORL 1 => 0006 ---- TRACE 1 IR .... SNAP #0 [ ---- ] 0001 rbp int SLOAD #2 CI 0002 xmm7 > num SLOAD #1 T 0003 xmm7 + num MUL 0002 -3 0004 rbp + int ADD 0001 +1 .... SNAP #1 [ ---- 0003 ] 0005 > int LE 0004 +1000 .... SNAP #2 [ ---- 0003 0004 ---- ---- 0004 ] 0006 ------------ LOOP ------------ 0007 xmm7 + num MUL 0003 -3 0008 rbp + int ADD 0004 +1 .... SNAP #3 [ ---- 0007 ]
I realize that I could parse the structure of this text and e.g. present it with a fastTreeTable but I suspect this won't work very well when the structure of the data is not entirely uniform between rows.
A big +1 on being able to select a monospace typeface *anywhere* I want to display in a GT Inspector tab, e.g. both as part of a list/tree or as an extra tab for a bytestring.
I am starting to look at code in languages where x-offset is crucial and I have not looked at this in detail yet. I guess it should be possible, since GT uses a monospace font in its source code pane of the 'Meta' tab.
-- Johan Fabry, Senior Software Engineer. johan@raincode.commailto:johan@raincode.com | Email too brief? Here's why! http://emailcharter.orghttp://emailcharter.org/
From: Moose-dev [mailto:moose-dev-bounces@list.inf.unibe.ch] On Behalf Of Luke Gorrie Sent: Wednesday, April 4, 2018 9:53 AM To: Moose-related development moose-dev@list.inf.unibe.ch Subject: [Moose-dev] Re: Right-justified table column?
On 30 March 2018 at 22:11, Andrei Chis <chisvasileandrei@gmail.commailto:chisvasileandrei@gmail.com> wrote: Hi,
By default there is no support for right-justified columns in Glamour. But have a look at the glamour presentation based on fast table. With that presentation the #column:evaluated: method can also return a morph, not just a string. It might be possible to return a morph that aligns the content to the right.
Thanks for that tip!
What do you mean by fixed-width font? Do you have an example of what you'd like to do?
If you have HTML enabled in your email client then I can demonstrate right here.
I would like to be able to format semi-structured text in a fixed-width font for neat alignment like this:
---- TRACE 1 start stdin:1 0006 MULVN 0 0 1 ; -3 0007 FORL 1 => 0006 ---- TRACE 1 IR .... SNAP #0 [ ---- ] 0001 rbp int SLOAD #2 CI 0002 xmm7 > num SLOAD #1 T 0003 xmm7 + num MUL 0002 -3 0004 rbp + int ADD 0001 +1 .... SNAP #1 [ ---- 0003 ] 0005 > int LE 0004 +1000 .... SNAP #2 [ ---- 0003 0004 ---- ---- 0004 ] 0006 ------------ LOOP ------------ 0007 xmm7 + num MUL 0003 -3 0008 rbp + int ADD 0004 +1 .... SNAP #3 [ ---- 0007 ] and I would like to avoid presenting it with a variable-width font and wonky alignment like this:
---- TRACE 1 start stdin:1 0006 MULVN 0 0 1 ; -3 0007 FORL 1 => 0006 ---- TRACE 1 IR .... SNAP #0 [ ---- ] 0001 rbp int SLOAD #2 CI 0002 xmm7 > num SLOAD #1 T 0003 xmm7 + num MUL 0002 -3 0004 rbp + int ADD 0001 +1 .... SNAP #1 [ ---- 0003 ] 0005 > int LE 0004 +1000 .... SNAP #2 [ ---- 0003 0004 ---- ---- 0004 ] 0006 ------------ LOOP ------------ 0007 xmm7 + num MUL 0003 -3 0008 rbp + int ADD 0004 +1 .... SNAP #3 [ ---- 0007 ]
I realize that I could parse the structure of this text and e.g. present it with a fastTreeTable but I suspect this won't work very well when the structure of the data is not entirely uniform between rows.