[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Business Graphics
From: |
Ralph Corderoy |
Subject: |
Re: [Groff] Business Graphics |
Date: |
Sun, 24 May 2015 12:53:07 +0100 |
Hi Deri,
> Its purpose is to provide inline "business type" graphs for groff. I
> know we have grap which seems to be aimed at the more mathematical end
> of graphs, I'm aiming for the sort of graphs which a typical office
> spreadsheet might produce.
Interesting. I dislike 3D-ness being added as it seems fluff and
clutter to me, but I realise it's sought after by some (hind) quarters.
:-) Keeping it on topic, Bell Labs were amongst those to criticise pie
charts generally compared to other representations.
https://en.wikipedia.org/wiki/Pie_chart#Use.2C_effectiveness_and_visual_perception
On a related note, I found this an interesting read recently.
Beyond Bar and Line Graphs: Time for a New Data Presentation
Paradigm
Papers rarely included scatterplots, box plots, and histograms that
allow readers to critically evaluate continuous data. Most papers
presented continuous data in bar and line graphs. This is
problematic, as many different data distributions can lead to the
same bar or line graph. The full data may suggest different
conclusions from the summary statistics
http://journals.plos.org/plosbiology/article?id=10.1371/journal.pbio.1002128
PDF available.
> If you have time please have a look and if you have any good ideas for
> improvements or additions, post them back to the list.
I think most preprocessors pass on their bracketing pseudo macros to
their output so the author has the option of defining them?
I spotted a few minor things on a quick look, e.g. not stealing my
.BGSIWASHEREFIRST. Patch below.
Cheers, Ralph.
diff -ru busgrap-20150523.orig/busgrap.pl busgrap-20150523/busgrap.pl
--- busgrap-20150523.orig/busgrap.pl 2015-05-23 16:40:39.000000000 +0100
+++ busgrap-20150523/busgrap.pl 2015-05-24 12:48:48.000000000 +0100
@@ -643,7 +643,7 @@
chomp;
s/\r$//;
- if (m'^\.\s*BGS\s*(\w*)')
+ if (m'^\.\s*BGS(?:\s+(\w+))?')
{
my $type=($1)?$1:'pi';
$InBG=1;
@@ -720,7 +720,7 @@
}
else
{
- Log(0,$ln,"Redefined command '$cmd'") if exists($grph{$cmd});
+ Log(0,"$ln: Redefined command '$cmd'") if exists($grph{$cmd});
address@hidden;
}
}
@@ -804,7 +804,7 @@
}
else
{
- Log(0,"Colour names ($v) not found");
+ Log(0,"Colour not found: $v");
}
if ($cmd eq 'SCOLOURS')
@@ -1189,7 +1189,7 @@
}
else
{
- Log(1,$ln,"Unknown scaling factor '$unit'");
+ Log(1,"$ln: Unknown scaling factor '$unit'");
}
}
@@ -1209,7 +1209,7 @@
my $shadh=int($shadv/2);
my $usey=$grph{FRAME}->[1];
my $usex=$grph{FRAME}->[0];
- Log(1,0,"No Series data found") if $#data == -1;
+ Log(1,"No Series data found") if $#data == -1;
my (@wdgs)=(@data);
@@ -2600,4 +2600,4 @@
my $t=$$v1;
$$v1=$$v2;
$$v2=$t;
-}
\ No newline at end of file
+}
diff -ru busgrap-20150523.orig/Introduction.trf
busgrap-20150523/Introduction.trf
--- busgrap-20150523.orig/Introduction.trf 2015-05-23 16:40:39.000000000
+0100
+++ busgrap-20150523/Introduction.trf 2015-05-24 12:40:04.000000000 +0100
@@ -48,7 +48,7 @@
.HD Introduction
The busgrap pre-processor is intended to let you embed business type graphics
within the flow of your groff document. All the graphics are produced using
groff's native drawing primitives, so the results are pure vector based
drawings, no bit mapped graphics.
..sp .5
-Each graph quires you to embed a call to macro ".BGS" followed by a set of
parameters, described below, which are terminated by a call to ".BGE". Between
these two macro calls only busgrap parameters are expected, any normal groff
language will cause an error.
+Each graph requires you to embed a call to macro ".BGS" followed by a set of
parameters, described below, which are terminated by a call to ".BGE". Between
these two macro calls only busgrap parameters are expected, any normal groff
language will cause an error.
..sp .5
The format of the ".BGS" parameter is:-
.CODE
@@ -56,8 +56,6 @@
.ENDCODE
Where 'name' can be "pi" or "graph". The difference determines whether the
graph will be a pie chart or a line/bar chart.
.sp .5
-In order to place a graph in the document you need to specify a "frame" which
will contain the actual graph when it is generated.
-.sp .5
.HD The Frame
In order to place a graph in the document you need to specify a "frame" which
will contain the actual graph when it is generated. Busgrap will try to fit
your graph within the given frame, but it is not very intelligent so it may not
be successful in keeping within the frame, if this happens, increase the size
of the frame until it is successful, or reduce the size of labels, etc..
.sp .5