As mentioned in yesterday's meeting, i've been revising the ColorBrewer
class to make it a bit easier to use. It still lacks elegance, but it
gets the job done.
Initially the ColorBrewer object contained only the contents of a single
XML file. This was annoying as anyone wanting to display a complete
list of palettes would need to navigate several ColorBrewer objects.
Now you have the option of loading whatever palettes you like into a
ColorBrewer object (including external XML files as an InputStream), and
can easily filter down the list. As a result, the following change was
applied to the loading of a palette:
where ColorBrewer.SEQUENTIAL = "SEQUENTIAL"
we now use:
where ColorBrewer.SEQUENTIAL = PaletteType(true, false, "SEQUENTIAL")
alternatively, you may continue using the old method by reverting to the
old string value:
Please note this is deprecated and will soon be removed.
ColorBrewer.ALL = all 3 legend types (sequential, diverging, qualtitative)
SUITABLE_RANGED = sequential + diverging + custom
SUITABLE_UNIQUE = qualitative + custom
The main benefit of "PaletteTypes" is that we can now filter our results
using these objects:
Filtering by suitability, etc (ex: 6 color schemes which are good for
LCD and projector displays) still to come...
We may want to add more data to our XML files so we don't have to
manually add the suitable for ranged value (numerical) and suitable for
uniques (strings) upon loading...
I've also made BrewerPalette a subclass of ColorPalette -- trying to
make the ColorPalette a more generic object, but this is yet unused.
Anyways, it's a work in progress... anyone have any input/concerns?
The next challenge on the plate: how do we translate XML files within