haskell-chart icon indicating copy to clipboard operation
haskell-chart copied to clipboard

Proposal: allow also absolute spot scaling for AreaSpots?

Open mpilgrem opened this issue 6 years ago • 0 comments

Currently, AreaSpots allows the relative scaling of the size of spots through:

 _area_spots_max_radius :: Double  -- the largest size of spot

I found myself needing to scale the size of spots in absolute terms (so that the size of spots in different plots was consistent). I have done that in a fork, with a change to the API. Would that be of interest? If yes, I'll make a pull request.

I introduce:

_area_spots_scale :: [z] -> z -> Double -- a function that maps a z value to the radius of the spot

and two functions:

areaSpotsScaleMaxRadius :: PlotValue z
                        => Double  -- the largest radius of spot
                        -> [z] -> z -> Double

(which replicates what _area_spots_max_radius provides) and:

areaSpotsScale :: PlotValue z
               => Double  -- the scaling factor from toValue z to the radius of spot
               -> [z] -> z -> Double

(where the first argument is an absolute scaling factor).

The default of 'areaSpotsScaleMaxRadius 20.0' is retained.

mpilgrem avatar Aug 22 '19 22:08 mpilgrem