Saturday, July 31, 2010

wumpus-basic

Copperbox revision 1546.

Initial work on line-line and line-plane intersection.

This is needed for radial anchors on polygons, and radial anchors on polygons are needed for decent tree drawing and "blob" diagrams i.e. graph diagrams where the node is some graphic.

I haven't got a good formulation of line-plane intersection which is a problem as thats the one I really need. Currently I'm generating a line representing the plane but there's a bug in my method and I'm doing it wrong.

Friday, July 30, 2010

zmidi-core-0.1.0

Copperbox revision 1545.

Tidying up for a release - minor docs added to the pretty printer, the example Test01.hs is renamed to MidiCopy.hs.

zmidi-core

Copperbox revision 1544.

I've added a pretty printer, so ZMidi-Core is now about ready for Hackage. I'll just have to test it a bit...

Thursday, July 29, 2010

zmidi-core

Copperbox revision 1543.

I've reworked the Haddock docs for the Datatypes module.

The three modules are now "done" - but at the moment I don't have any worthwhile examples, and maybe I need a pretty printer. Finally it would be useful to support generating MIDI directly without building the syntax tree - this would be useful for the PortMIDI binding for example.

zmidi-core

Copperbox revision 1542.

I've made the code in WriteMidi more prosaic, that's to say I've changed from using my own combinators to ones from Binary.Put where possible. This should make the code a bit clearer to other people - using putWord8 is actually longer but more idiomatic.

zmidi-core

Copperbox revision 1541.

I've added a new combinator for error reporting to the parser monad (I'll probably add it to Kangaroo in due course). With error elaboration via the new combinator in place, I've been able to track down the outstanding bug in the parser.

zmidi-core

Copperbox revision 1540.

I've added constructors for SysCommon and SysRealTime events. Now all the values a tag byte can have should be accounted for - so there shouldn't be any matching failures in parsing.

This doesn't mean the parser is robust (yet). Currently there is one parser error than I have a test file for and there might be others.

Wednesday, July 28, 2010

zmidi-core

Copperbox revision 1538.

I've redone the varlen handling. The original code had a bug that might have been in for years - or was maybe introduced when I switched to use Kangaroo (though now I've replaced Kangaroo).

Edit - CopperBox revision 1539 - I've fixed a couple of bugs in the output code, where events weren't emitting their code number.

zmidi-core

Copperbox revision 1537.

The parser now seems to work - thought error handling could be better. Also I've changed the outputting to use Data.Binary.Put rather than build a Hughes list.

Tuesday, July 27, 2010

zmidi-core

Copperbox revision 1536.

I've started a new package to supersede the old ZMidi. This one won't have the half-hearted bits - e.g. the Construction module, nor will it depend on Kangaroo.

wumpus-timing

Copperbox revision 1535.

Work on a revised implementation where transitions are as import as commands in the representation. Sadly it is still very complicated (and drawing is not yet implemented).

Monday, July 26, 2010

wumpus

Copperbox revision 1534.

I've changed blankG in Wumpus.Basic.Graphic to emptyG. This has cascaded changes to PSC, plus there may be more that I haven't picked up yet.

Sunday, July 25, 2010

wumpus-timing

Copperbox revision 1533.

More work on drawing timing diagrams. There is now enough code in place to draw simple timing diagrams - though only lines can be draw at the moment, not data packets, spaces or metastasis.

wumpus-timing

Copperbox revision 1532.

Initial commit of a new library to draw timing diagrams.

I have worked on this before, but hadn't committed anything. The transitions in timing diagrams make their drawing particularly involved...

Saturday, July 24, 2010

poor small chart

Copperbox revision 1531.

I think I've finally worked out a composition mechanism for chart elements - axes, border, grids and of course the data.

type BivariateGraphic ux uy = Bivariate ux uy -> DGraphic

This type is basically equivalent of the GraphicF type in Wumpus-Basic:

type GraphicF u = Point2 u -> Graphic u

But the BivariateGraphic type supplies the scaling context rather than just the initial point.

poor small chart

Copperbox revision 1530.

I've simplified the scaling onto the drawing rectangle with a new module and datatype - Bivariate. I've also removed the dependencies on the ScaleRectMonad, which Bivariate supersedes.

Friday, July 23, 2010

poor small chart

Copperbox revision 1529.

More work on axis drawing - though I haven't even got to working with the hylomorphism from the last commit.

wumpus

Copperbox revision 1528.

Minor changes to get Wumpus-Clave and Wumpus-Shapes in step with Wumpus-Basic.

Initial work on revising axis drawing in PSC. I'm speculating that drawing axes may be simpler if I consider the operations - generating points and drawing the points to accumulate a Graphic - as a type-specialized hylomorphism.

Thursday, July 22, 2010

wumpus

Copperbox revision 1527.

I've move the RectangleLoc data type from PSC to Wumpus-Basic.

poor small chart

Copperbox revision 1526.

Some tidying up. Although PSC is still prototypical, unfortunately code frequently gets out of step.

poor small chart

Copperbox revision 1525.

I've specialised the output unit type of the ScaleRectM to Double. This leads to neater type signatures at the loss of some generality - in practice all Wumpus pictures have Double as the unit type even though the unit type is parametric.

poor small chart

Copperbox revision 1524.

The axis drawing code now uses the ScaleRectM monad and the scatter plot example has been updated to work with it.

Wednesday, July 21, 2010

poor small chart

Copperbox revision 1523.

I've updated the SparkLine module to use the new monad - ScaleRectMonad. This monad handles both the unit scaling of input data (i.e bivariate data points) and the scaling within an output rectangle of the spark line or scatter plot.

wumpus-core

Copperbox revision 1522.

I've exported the PSUnit type class. Generally I've made pictures with the unit fixed to Double, so I hadn't noticed until now that I couldn't write some polymorphic signatures due to this class being hidden.

wumpus

Copperbox revision 1521.

I've renamed the ScaleMonad module to CoordScaleMonad - so that the module name matches the monad it exports. This has cascaded some changes in Poor Small Chart.

wumpus

Copperbox revision 1520.

I've moved the ScaleMonad into Wumpus-basic from Poor Small Chart.

poor small chart

Copperbox revision 1519.

Text labels on the y-axis are now drawn with right justification.

Tuesday, July 20, 2010

poor small chart

Copperbox revision 1518.

Work on re-implementing axis drawing. Except for problems with orienting the text labels, the scatter plot example draws its axis labels again.

The re-implementation currently draws labels with-respect-to their center, however this doesn't work for y-axis labels which should be right justified.

poor small chart

Copperbox revision 1517.

Revisions to scatter plot to work with the new ScaleMonad.

Note - some code may no longer compile. The scatter plot demo will run but it no longer prints the axes as the axis code needs revising. Other examples - particularly the IrisMultiPlot might not work.

Monday, July 19, 2010

poor small chart

Copperbox revision 1516.

I'm experimenting with a Scaling Monad - a reader monad that stores the configuration to map between the coordinates of that data and Wumpus's coordinates.

If the Scaling Monad is valuable it will go into Wumpus-Basic.

Sunday, July 18, 2010

wumpus-basic

Copperbox revision 1515.

Some tidying up and Haddock docs - even I was finding it hard to remember argument orders to some of the functions, and I wrote the code...

Also I've updated Wumpus-clave to use the grid from Wumpus.Basic.Graphic.

wumpus-basic

Copperbox revision 1514.

I've added support for drawing grids and started a new module for generating lists of points - Wumpus.Basic.Graphic.PointSupply.

Wumpus-Extra has some code for e.g. making calendar grids, that will be added to this module.

wumpus

Copperbox revision 1513.

Updates to the dependent libraries - PSC, Clave, Microprint, Shapes - to account for changes to rectangle drawing (the supplied point to draw a rectangle is now its center rather than its bottom left corner).

Saturday, July 17, 2010

wumpus-basic

Copperbox revision 1512.

I've now re-coded all the dots from the original Wumpus-Extra module.

wumpus-basic

Copperbox revision 1511.

I've added the dot / plot-mark drawing code from Wumpus-Extra and started updating it to use the GraphicF type rather than make Pictures for each dot.

Also, I've changed the rectangle drawing Basic.Graphic so the supplied point is the center rather than the bottom-left corner. Thus is the way TikZ does it, and as circles and shapes in Wumpus use the center it seems better to unify to that. textline is an exception as it takes the supplied point as baseline-left (matching PostScript's behaviour), I will keep it operating in this way but add another operation that makes text from the center.

Friday, July 16, 2010

poor small chart

Copperbox revisions 1509 & 1510.

I've changed the module name hierarchy so that modules are under the top level name Wumpus rather than Graphics.

wumpus

Copperbox revision 1508.

Wumpus-basic - I changed the name of the function circle to disk in the last commit. This commit amends the change in the dependent libraries.

wumpus

Copperbox revision 1507.

I've moved the Anchor classes from Wumpus-Shapes to Wumpus-Basic. It looks like they will be needed for Wumpus-Tree and I don't want Wumpus-Tree to depend on Wumpus-Shapes.

Some minor changes - added strokedCircle and filledCircle to Basic.Graphic and renamed the previous circle drawing function to disk.

Thursday, July 15, 2010

wumpus-tree

Copperbox revision 1506.

I've changed the tree drawing algorithm to uses absolute extents rather than relative ones.

The code code was previously taken verbatim from Andrew Kennedy's "Functional Pearls: Drawing Trees" with a bit of Haskell golf sprinkled on top - adding a Monoid instance for Extent and using a Hughes list to avoid one reverse. I was unhappy about using someone else's code wholesale, but I wanted to get to actually drawing pictures quickly to see if the project would be worthwhile.

As I got up to picture drawing yesterday, today I thought I'd see if I could adapt the algorithm to use absolute extents (suggested as an exercise in the paper). I think I've done this - I'm not 100 percent sure my version is correct, but it works for my limited test cases. Also while I'm indebted to Andrew Kennedy for the original code and the paper explaining it, I think the code in Wumpus-tree is now sufficiently independent that I can publish it on Hackage if and when the larger library is good enough.

Many thanks to Andrew Kennedy for a remarkably clear paper and code - it was a pleasure working through it.

Wednesday, July 14, 2010

wumpus-tree

Copperbox revision 1505.

The bug that was causing nodes to be overlapped has been found and fixed.

wumpus-tree

Copperbox revision 1504.

I've started a new library for tree drawing. Currently it is very primitive and the output has a bug - some nodes are merge at the same point when they should be spaced.

Tuesday, July 13, 2010

wumpus-shapes

Copperbox revision 1503.

I've added a new shape - Ellipse. Plus, I've changed the AddLabel class, although I don't like it conceptually and eventually it will be replaced entirely.

Monday, July 12, 2010

wumpus-shapes

Copperbox revision 1502.

I've added to more shapes from Wumpus-Extra: Diamond and FreeLabel (a text label without an enclosing shape).

wumpus-shapes

Copperbox revision 1501.

I've revised the CTM datatype - it now contains x and y displacement - equivalent to the origin of a an affine frame or the center of a shape.

Added a Coordinate shape, which is just a point with no label.

Sunday, July 11, 2010

wumpus-shapes

Copperbox revision 1500.

Adding a module to draw circles.

Plus minor modification to Wumpus-core - I've changed the names of the field labels for PrimCTM and stopped the export of CTM(..) from the Wumpus.Core top-level import module.

wumpus-shapes

Copperbox revision 1499.

Work on rotation and other transformations.

I've decided to make shapes instances of the affine transformation classes: Rotate, Scale and Translate. Like Primitives, shapes don't exist in an affine frame until they are lifted to Pictures, however having distinct names for each transformation on each shape (rotateRectangle, etc.) would not be pleasant.

Because shapes are not in an affine frame I won't be making them instances of the RotateAbout class.

wumpus-core

Copperbox revision 1498.

Finished revising the FontSize API and documentation.

wumpus-core

Copperbox revision 1497.

First round of work improving the FontSize code - adding more documentation plus making the names in the interface use a better terminology (derived from Edward Tutfe's Visual Explanations). I've added a new example FontMetrics.hs to visually illustrate how what the constants in the interface represent (height, numeral_height, descender_depth, ...).

wumpus

Copperbox revision 1496.

Minor updates - Wumpus-Basic changed the name of the text function to textline, text is too common a word to use for this function name. Updated Poor Small Chart to use latest Wumpus-Basic.

Saturday, July 10, 2010

wumpus-shapes

Copperbox revision 1495.

I've extracted the shape code from Wumpus-extra into a new library Wumpus-shapes. So far I have only looked at rectangle which will draw, but rotation is now yet implemented.

Like Primitives in Wumpus-core, Shapes don't exist in an affine frame (until they are lifted to Pictures) so I'll have to be careful about the interface I give them for transformations.

wumpus-core-0.21.0, wumpus-basic-0.2.0, wumpus-microprint-0.2.0

Copperbox revision 1494.

New releases of Wumpus-core, Wumpus-basic and Wumpus-microprint.

The main point is that Wumpus-core removes the problematic affine instances for Primitives and adds specific transformation functions (rather than instances).

Friday, July 9, 2010

wumpus-clave

Copperbox revision 1493.

Work on djembe characters. All the ones implemented now draw correctly, though the implementations are perhaps not very compositional.

wumpus

Copperbox revision 1492.

Added the colour chart examples from Wumpus-extra to Wumpus-basic. Removed the Ord constraint on some of Picture classes in Wumpus-core (Stroke, Fill) and their derived operations.

Thursday, July 8, 2010

wumpus

Copperbox revision 1491.

I've updated Wumpus-basic to be font size neutral and added a new drawing style to Wumpus-microprint:

http://www.flickr.com/photos/44929957@N03/4774223930/

wumpus-core

Copperbox revision 1490.

I've updated the examples and guide so that I can make a release some time soon of Wumpus-core.

Wednesday, July 7, 2010

wumpus-core

Copperbox revision 1489.

SVG output now works for the transformed Primitives. The example files Scaled.hs, Rotated.hs and Translated.hs all work as expected.

Tuesday, July 6, 2010

wumpus-core

Copperbox revision 1488.

A new, and hopefully final, formulation of transformations on Primitives.

Bounding box calculation and PostScript output work, SVG output is outstanding. SVG is a bit more complicated than PostScript here because it also needs to track the coordinate-frame transformation due to SVG having the origin at the top-left rather than bottom-left like Wumpus and PostScript.

wumpus-core

Copperbox revision 1487.

More rework transforming Primitives. The current solution has a problem that with Primitive being an opaque type, there is no way for a user to apply the new transformations (scalePath, rotateLabel etc.).

... I should have noticed this earlier. At least I've now got the PostScript output working correctly again.

wumpus-core

Copperbox revision 1486.

More reworking / rethinking transformations on Primitives...

I've removed the Affine instances as the transformations aren't affine, but exported the transformations instead (rotatePath, scalePath, rotateText...). I've simplified Label and Ellipse again, removing the CTM - this is because Labels will only support rotation - Labels can be any point size at construction time[1], so they don't really need a scaling transformation. Ellipse doesn't support rotation currently but it might do if I can work out fully how it should work on Labels.


[1] This contradicts a belief I was working under that PostScript could not use scalefont to arbitrary point sizes - it can.

Monday, July 5, 2010

wumpus-core

Copperbox revision 1485.

Work on giving the PrimEllipse and Label transformations the same interpretation as Prim Paths.

Unfortunately, I'm concerned that I'm adding special cases - the new 2x2 matrix plus Point representation makes printing SVG and PostScript more complicated. At least I can revert changes if it all goes overboard.

wumpus-core

Copperbox revision 1484.

I've re-implemented the affine transformations on Paths. Paths are not in an affine space / affine frame - so manipulating them cannot really follow the interpretations of affine geometry (notionally Paths have a zero point that stands as an origin, but they don't have basis vectors).

As they can't follow the affine interpretation, the allowed transformations (translate, rotate, scale) follow what one might expect visually. Rotate - rotates about the start point. Scale - scales with respect to the start point. Translate - simply displaces by the supplied vector.

For standard affine translations, Paths and Primitives should always be lifted to Pictures where transformations respect the affine frame. However for efficiency reasons having some (non-affine) transformations on Paths and Primitives is valuable.

Sunday, July 4, 2010

wumpus-core

Copperbox revision 1483.

This is a new and more sensible implementation of the affine transformations on Primitives.

I've decided not to support rotateAbout and "matrix / scalar mutiplication" transformation. I don't know that these have a tangible semantics with Primitives not really being in an affine frame.

TikZ seems to only support scale, rotate and (probably) translate on nodes. The full set of affine transformations are available on pictures.

wumpus-core

Copperbox revision 1482.

Preliminary reworking for the Primitive affine transformations code...

The instances of the affine classes (Scale, Rotate...) that I added for Primitives in version 0.18.0 turn out to be unworkable. This is perhaps not surprising as transforming Primitives doesn't really take place in an affine frame / affine space, but I had overlooked this and the code doesn't work properly.

This revision was a quick attempt at rectifying the problems, but it is unsatisfactory, and I will roll back most of the changes here. I committing it so the HEAD will at least include an acknowledgement that there is a problem.

Saturday, July 3, 2010

wumpus-clave

Copperbox revision 1481.

Work on "flam" which draws a drum note together with a superscript. This is highlighting quite a few problems that I hadn't thought about - affine transformations don't work on Hughes lists of primitives and the scaling transformation is changing the "origin" in a way I haven't worked out.

wumpus-clave

Copperbox revision 1480.

Initial work to add djembe notation, see http://drumtidam.info/djembe/pdf/BOX_Book.pdf.

Friday, July 2, 2010

wumpus

Copperbox revision 1479.

I've made Wumpus-Clave and Poor Small Chart use the types and operations from Basic.Graphic. Previously they had their own versions of this code.

wumpus

Copperbox revision 1478.

I've added the module Graphic to Wumpus-Basic this uses Hughes lists to compose Primitives. Composing Primitives rather than composing Pictures can generate more efficient PostScript as there are no extra affine frame changes.

I've also looked at the UndecidableInstances in Wumpus-Core, something I meant to do for the last release... Core.Geometry has a need for UndecidableInstances that I can't easily replace, so Wumpus will continue to use them. The file PictureInternal.hs had a pragma for UndeicidableInstances but it wasn't actually needed, so that has been removed.

wumpus-clave, poor-small-chart

Copperbox revision 1477.

I've updated both Wumpus-Clave and Poor Small Chart to use Wumpus-Basic.

Thursday, July 1, 2010

wumpus-basic-0.1.1, wumpus-microprint-0.1.1

Copperbox revision 1476.

I've made new releases of Wumpus-Basic and Wumpus-Microprint. Both archives now have LICENSE files and change logs.

wumpus-core-0.20.0

Copperbox revision 1474.

A new release of Wumpus-Core. This commit also had archives of Wumpus-Basic and Wumpus-Microprint, but...

Copperbox revision 1475.

I've deleted the Wumpsu-Basic and Wumpus-Microprint releases as they didn't have LICENSE files included in the archives.

wumpus-microprint

Copperbox revision 1473.

I've updated MicroPrint to use Wumpus-Basic.

wumpus-core

Copperbox revision 1472.

I've removed the "Extra" modules from Wumpus-Core except for Extra.Picture language that is deprecated but won't be replaced soon. These extra modules are now in Wumpus-Basic.

Also I've updated the user guide to reflect this and changed the function name trace from Core.BoundingBox to traceBoundary. Trace was to good a verb to waste on this particular use.

wumpus-basic

Copperbox revision 1471.

I've started a new package wumpus-basic to replace wumpus-extra. Wumpus-extra has a lot of under-developed code, whereas some of the code common to wumpus-clave, wumpus-microprint and poor-small-chart is approaching a fairly stable state. Currently these projects each have their own forks of the code. Wumpus-basic brings the common modules together.

wumpus

Copperbox revision 1470.

I've moved all the Wumpus related projects into a new top level directory in the repository called wumpus. Next I'll make a start at making wumpus-clave, wumpus-microprint, etc. share the same code. The first step to do this will be to add a new project wumpus-basic that will replace wumpus-extra. Wumpus-basic will get the turtle monad and similar code. The under-developed stuff in wumpus-extra will have to go into a new project, name pending.

Blog Archive

About Me

My photo
Disambiguating biog as there are a few Stephen Tetley's in the world. I'm neither a cage fighter or yachtsman. I studied Fine Art in the nineties (foundation Bradford 1992, degree Cheltenham 1992 - 95) then Computing part-time at Leeds Met graduating in 2003. I'm the Stephen Tetley on Haskell Cafe and Stackoverflow.