1 patch for repository http://www.dockerz.net/repos/chart: Wed May 25 11:44:24 CEST 2011 Stefan Kersten * Add renderLayout1Matrix renderLayout1Matrix renders a matrix of Layout1's so that their axes and axis labels are aligned horizontally and vertically. New patches: [Add renderLayout1Matrix Stefan Kersten **20110525094424 Ignore-this: a8ecd21471ce279f01854d47f7636c59 renderLayout1Matrix renders a matrix of Layout1's so that their axes and axis labels are aligned horizontally and vertically. ] { hunk ./Graphics/Rendering/Chart/Layout.hs 65 layout1_legend, layout1_grid_last, + renderLayout1Matrix, renderLayout1sStacked, AnyLayout1(), withAnyOrdinate hunk ./Graphics/Rendering/Chart/Layout.hs 85 import Data.Accessor import Data.Colour import Data.Colour.Names (white) +import Data.List (transpose) -- | A @MAxisFn@ is a function that generates an (optional) axis -- given the points plotted against that axis. hunk ./Graphics/Rendering/Chart/Layout.hs 193 lm = margin l1 +-- | Render several layouts with the same axis types in a grid so that their +-- origins and axis titles are aligned horizontally and vertically with +-- respect to each other. The exterior margins and background are taken +-- from the argument. +-- +-- The returned 'PickFn' tags the 'Layout1Pick' data with a @(row, column)@ +-- index pair. +renderLayout1Matrix :: (Ord x, Ord y) => Layout1 x y -> [[Maybe (Layout1 x y)]] -> Renderable (((Int, Int), Layout1Pick x y)) +renderLayout1Matrix _ [] = emptyRenderable +renderLayout1Matrix l1 rows = gridToRenderable g + where + g = fullOverlayUnder (fillBackground (layout1_background_ l1) emptyRenderable) + $ addMarginsToGrid (lm,lm,lm,lm) + $ besideN $ [ + aboveN [ maybe (tval emptyRenderable) + (\l -> fmap (mapPickFn ((,) (rowIndex, colIndex))) $ + fullRowAbove (layout1TitleToRenderable l) 0 $ + fullRowBelow (layout1LegendsToRenderable l) 0 $ + layout1PlotAreaToGrid l) + ml + | (rowIndex, ml) <- zip [0..] col ] + | (colIndex, col) <- zip [0..] (transpose rows) ] + lm = layout1_margin_ l1 + addMarginsToGrid :: (Double,Double,Double,Double) -> Grid (Renderable a) -> Grid (Renderable a) addMarginsToGrid (t,b,l,r) g = aboveN [ } Context: [Fix pattern match failure in Layout1 pickfn tim@dockerz.net**20101207234823 Ignore-this: ed75d650d2c438c52d07b74c23acdc0d ] [TAG CHART_0_14 tim@dockerz.net**20110112040427 Ignore-this: f1a0b387c76ed2003997f428e7da7732 ] [Allow LocalTime labels to be aligned either with the ticks, or at the centre of intervals. tim@dockerz.net**20101027114144 Ignore-this: 820e2909e15161e0b04366f63b05f1bd This merges the following, resolving conflicts: | Mon Oct 25 21:37:06 CDT 2010 tim@dockerz.net | * Context labels are always shown between intervals | | Also simplifies and reduces some duplication in the | LocalTime Axis implementation. | | Tue Oct 12 06:33:26 CDT 2010 Eugene Kirpichov | * Support for sub-second time axes and configurable placement of labels (between / under ticks) ] [Fix for auto scaling when all values are equal and are of large magnitude tim@dockerz.net**20101224133619 Ignore-this: 9a440b489478238dbd06b94516012189 ] [Use showFFloat for Double axis labels. malcolm.wallace@me.com**20101203191135 Ignore-this: 57377de8cd063fc2fb1daa6514cfa6bb ] [Resolve conflicts tim@dockerz.net**20101025225910 Ignore-this: b7f9f2ba7c9a041544ecb91473099217 ] [Generalised the axis context labels tim@dockerz.net**20101025124117 Ignore-this: 25c0c544141a3dbac537f9f16a40269e Previously two "layers" of labels were supported, the normal ones, and a secondary set to provide extra contextual information. This change generalises this so that a list of label sets is provided, each being shown one row/column further away from the axis. ] [require horizontal buffer half a label's width between it and the next matt@softmechanics.net**20101023171116 Ignore-this: f2c05959f6af29f20794e48850639e39 ] [prevent overlapping axis_context_ labels matt@softmechanics.net**20101023162710 Ignore-this: c9479f253b079fbd87cc8dad8a39bd24 ] [prevent overlapping labels part 3 matt@softmechanics.net**20101023161347 Ignore-this: af3c4569d0f033c5340b399d43e58af0 To ensure uniformity of label positions, generate candidate label sets by taking each nth label for n = [1 .. length labels]. Draw the first label set that has no overlapping labels. ] [prevent overlapping axis labels matt@softmechanics.net**20101022072052 Ignore-this: d832b21ff23f51b22ad18c2ee7c41593 ] [Export createRenderableWindow and updateCanvas from Gtk module tim@dockerz.net**20101022231903 Ignore-this: d044e7192d75f6375df5e72fafa3a057 ] [Added in missing Plot.hs, that aggregates the import for all plot types tim@dockerz.net**20101021103314 Ignore-this: 2ccb7ca016dd491565958632789a6a1d ] [Documentation cleanup and additions tim@dockerz.net**20101021015640 Ignore-this: 683e52782da321ba489fda1247a4bfdd ] [Including missing test in source distribution tim@dockerz.net**20101020130105 Ignore-this: 71be843f04e1c7a9829794afa8ad4c0e ] [Updated cabal version to 0.14 tim@dockerz.net**20101020121417 Ignore-this: 10376f79945c5645cf6e58125857cac3 ] [Refactored types of plots into a file hierarchy tim@dockerz.net**20101020121143 Ignore-this: 15b172aee177e50c7c9ca61550ac680c ] [Split Axis.hs into 6 separate files, based upon the types of the axes tim@dockerz.net**20101015122820 Ignore-this: d43fa821db2d70f98f48d563c465c608 ] [Adjust test13 to demonstrate multi-line annotations. malcolm.wallace@me.com**20101011171937 Ignore-this: 2be04a924670d279dbad1510890dc749 ] [Allow multi-line text in Annotation Plots. malcolm.wallace@me.com**20101011170450 Ignore-this: 7ae803ce4a237cd779df90b82884bdec * Vertical anchoring now means the entire text box (for VTA_Top, VTA_Centre, and VTA_Bottom), or for VTA_BaseLine, just the baseline of the first line of text. * Horizontal anchoring now also implies justification (in the same direction). In theory, justification and anchoring could be separated, but that would require new options to be added. * The new multi-line text renderer could also be used for other kinds of labels, e.g. titles and axis labels, but this patch does not change those. For now, it applies to annotation plots only. ] [Add a test for candle plots. malcolm.wallace@me.com**20101012100532 Ignore-this: 460984493a44d0939835b6f13ffff183 ] [Candle Plots should have two complementary fill styles. malcolm.wallace@me.com**20101011090237 Ignore-this: 9655e50e1eb9795394b740c6bab90969 One is for rising prices and another for falling. ] [Add Candle plots. malcolm.wallace@me.com**20100929160837 Ignore-this: b75ca804ec3865578ea2d507a5486a65 ] [Print the name of the each test as it is run tim@dockerz.net**20101010051036 Ignore-this: ad9a089efcd99e15cec51001c34a7d67 ] [Contextual axis labels for time series. malcolm.wallace@me.com**20100726205206 Ignore-this: 179700aba6e0e60ec87559af465a782f An axis can now have two set of labels, not just one. The outer set is for contextual information. If no context labels are defined, no extra whitespace is left for them. The autoTimeAxis now uses the context labels to show the next sensible granularity of time enclosing the more detailed labels and ticks. For example, labels showing minutes have an hour context, hours have a day context, days a month context, etc. ] [Lots of visual tests for new two-layered time axis. (test2[a-w]) malcolm.wallace@me.com**20100726132817 Ignore-this: b4b7871b040ebcd0252d15d6b78e1e86 Tries to exercise all of the different time granularities, including close to the boundaries where the axis display changes from one format to another. ] [Fix up all tests to cope with new return type of renderableToPNGFile. malcolm.wallace@me.com**20100723111217 Ignore-this: caefe80de905abf7e2d1f5151e9c0672 ] [Extended Layout1Pick type to have cases for titles and axis titles, also a fix for legend picking tim@dockerz.net**20100721234717 Ignore-this: 198747147640111c0495a27f8a26a51b ] [Add a gtk flag to .cabal file. Building with Gtk is now optional. Malcolm.Wallace@cs.york.ac.uk**20100716200334 Ignore-this: 802d7da21e73c49c997cbec44252506e The cairo package is still necessary, but cairo and gtk are no longer packaged together upstream. ] [Return a PickFn after rendering to a PNG file. malcolm.wallace@me.com**20100716200023 Ignore-this: 4e17b9cd600b102b311f283a3fff59d7 ] [Allow titles to be pickable, like legends. malcolm.wallace@me.com**20100716195903 Ignore-this: d11830ae4b4236ac555b616c19cb6578 ] [Initial support for picking tim@dockerz.net**20100714034226 Ignore-this: f61ac66905ac07de9d714046f44d49b7 This builds upon the patches from Malcolm Wallace, and supports picking inside the plot region and along the axes. A sample script is provided that prints the pick results which the chart is clicked upon. ] [fixed uninitiased warnings in all_tests.hs script tim@dockerz.net**20100712233958 Ignore-this: 28222438cbbea9d5985c1faf68e6e76f ] [Fix calibration of pickFn when inside a grid. Malcolm.Wallace@cs.york.ac.uk**20100707124657 Ignore-this: 754640fdbb5b6ca6f717451598376948 ] [A Percent type for use on axes. Malcolm.Wallace@cs.york.ac.uk**20100630144135 Ignore-this: 5f0ec76f90be9c04a4ed08381e89eb6b ] [Inverse mapping from output image coordinates to values. Malcolm.Wallace@cs.york.ac.uk**20100629130113 Ignore-this: 6852a485374a372bac0ed1896ab60072 This is useful for interactive manipulation of the output, e.g. for zooming or selecting. ] [Fix Prelude.undefined bug. Malcolm.Wallace@cs.york.ac.uk**20100630144642 Ignore-this: 5d27b01acec25891302eb21994632748 ] [Added AreaSpots4D test to all_tests.hs harness tim@dockerz.net**20100708133257 Ignore-this: 7631e5c2594de214606a1e6ecaee6599 ] [Test for AreaSpots4D. Malcolm.Wallace@cs.york.ac.uk**20100521131637 Ignore-this: 57b50241834dc6a827d6ad857979ee69 ] [New: AreaSpots4D; shows (x,y,z,t) using coords, spot area, and colour. Malcolm.Wallace@cs.york.ac.uk**20100521131139 Ignore-this: fb2563fc3fcd3bd900a725cc11bc83a0 In addition to 2D position, and spot area for the z value, the colour to represent the fourth dimension is chosen from a supplied palette. A palette is just a list of available colours - values are mapped to the palette linearly, with truncation. (There is no blending of intermediate colours.) ] [If title is empty, don't create space for it in the top margin. Malcolm.Wallace@cs.york.ac.uk**20100507131529 Ignore-this: cdc6a737b11171cf76e0660e8ae0d3e5 ] [upgraded version to 0.13.1 tim@dockerz.net**20100526142148 Ignore-this: 9800a2d19171d4d2190e9d321e36dc5a ] [Improved parametric test appearance tim@dockerz.net**20100526142110 Ignore-this: 94fcd2e223de9354f2d567a6b2becf55 ] [Fixes to suit gtk2hs 0.11.0 tim@dockerz.net**20100526141957 Ignore-this: 53673595ce055aa3dbd65f57491583de ] [TAG CHART_0_13 tim@dockerz.net**20100330122247 Ignore-this: 92a0f773bf03c589fbfbfc28baf01308 ] Patch bundle hash: 555671ce7cf4af55e5fe9225337c5cc82311e7ae