Re: 20000802: Scales

Hi Don,

This is an excellent idea.  You have done a good job of
describing the required functionality, although it would
be interesting to see if there are other suggestions.

Note that currently "ordinal position" (I assume this is
the same as axis_ordinal inside ScalarMap) is determined
in the DisplayRenderer (which is global over all
ScalarMaps in the DisplayImpl).  Providing this as a
application-settable parameter could be a bit tricky.

I hope you do get a chance to implement this.  The good
news is that the changes can probably be localized to  It should just be a question of
ScalarMap.makeScale() constructing an appropriate
VisADLineArray passed to DisplayRenderer.setScale().


> Louise's question is timely as I was just contemplating how to make
> custom scales in VisAD.  This question comes up frequently on the VisAD
> list, and the reply has never really been satisfactory (create a
> VisADLineArray, use ShapeControl).
> I was looking into this the other day and think that VisAD needs a
> higher level (than VisADLineArray) Scale component which can be used to
> create custom scales. Looking at the makeScale method in ScalarMap,
> it seems like that logic could be encapsulated and enhanced in a new
> class and have makeScale enhanced to pass a Scale object to the display
> renderer. I have not tried this yet, but I thought the properties of a
> Scale should be:
>     Color               - color of the scale
>     Font                - font used (Bill, can this be done now that
>                                      you've added font support to 
> TextControl?)
>     Major Tick Spacing  - Tick mark spacing used for major Ticks
>     Minor Ticks Spacing - Tick mark spacing used for minor ticks
>     Tick Mark visibility - whether ticks are visible or not
>     Tick Labels         - which ticks are labeled
>     Min/Max values      - min/max of values
>     (The five above are like what a JSlider has for settable properties)
>     Label               - Axis label
>     Position            - X, Y or X axis
>     Ordinal position    - position on the axis (first, second, third, etc)
>     CoordinateSystem    - CS used to convert values to linear positions on the
>                           scale.  For example, if you wanted to have a logP
>                           axis, you would provide the CS to create the 
> position
>                           of the non-linear spacing of the pressure values on
>                           the axis
> Are there others?  Internally, the actual scale would be a VisADLineArray
> akin to what makeScale creates now.  I'm not sure when I'd get around
> to this, but if anyone else wants to run with this and contribute
> it to the cause, be my guest.  Like I said, I just started looking at
> this, so haven't thought it through to much.  Additional input would
> be appreciated.  I think this would be a valuable enhancement to
> VisAD given the number of times this question has come up and would
> make the scale creation more object oriented (and easier to deal with).

Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738

  • 2000 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: