Hylograph.Scale.FP
- Package
- purescript-hylograph-selection
- Repository
- afcondon/purescript-hylograph-selection
Hylograph.Scale.FP - Functional Programming Abstractions for Scales
Higher-level functional programming idioms built on top of Scale.Pure. No FFI or D3 dependency.
Scale Modifiers
Scale modifiers compose:
niceAndClamped = combineModifiers [niceModifier, clampModifier]
myScale = linear # niceAndClamped # domain [...] # range [...]
Sampling
gradient = sample 100 viridisColorScale
#ScaleModifier Source
type ScaleModifier = ContinuousScale -> ContinuousScaleA scale modifier transforms a scale while preserving its type
#niceModifier Source
niceModifier :: ScaleModifierModifier that makes the domain nice (rounds to clean values)
#clampModifier Source
clampModifier :: ScaleModifierModifier that enables clamping
#roundModifier Source
roundModifier :: ScaleModifierModifier that enables rounding
#combineModifiers Source
combineModifiers :: Array ScaleModifier -> ScaleModifierCombine multiple modifiers (apply left to right)
#sample Source
sample :: Int -> ContinuousScale -> Array NumberSample a scale at n evenly-spaced points in [0, 1]
#sampleRange Source
sampleRange :: Int -> Number -> Number -> ContinuousScale -> Array NumberSample within a specific range
#sampleWithDomain Source
sampleWithDomain :: Int -> ContinuousScale -> Array (Tuple Number Number)Sample and return both domain and range values
#tickPositions Source
tickPositions :: Int -> ContinuousScale -> Array NumberGet tick positions as pixel coordinates
#tickLabels Source
tickLabels :: Int -> String -> ContinuousScale -> Array StringGet formatted tick labels
#ticksWithLabels Source
ticksWithLabels :: Int -> String -> ContinuousScale -> Array { label :: String, position :: Number }Get ticks with both position and label
#blendInterpolators Source
blendInterpolators :: Number -> Interpolator String -> Interpolator String -> Interpolator StringBlend two interpolators together
#reverseInterpolator Source
reverseInterpolator :: forall a. Interpolator a -> Interpolator aReverse an interpolator (1-t instead of t)
#clampInterpolator Source
clampInterpolator :: forall a. Interpolator a -> Interpolator aClamp interpolator input to [0, 1]
#cycleInterpolator Source
cycleInterpolator :: forall a. Interpolator a -> Interpolator aMake an interpolator cycle (values outside [0,1] wrap)
#normalize Source
normalize :: Number -> Number -> ContinuousScaleCreate a normalizing scale (maps domain to [0, 1])
#quantize Source
quantize :: forall a. NonEmptyArray a -> Number -> Number -> Number -> aCreate a quantizing scale (continuous -> discrete buckets)
#threshold Source
threshold :: forall a. Array Number -> NonEmptyArray a -> Number -> aCreate a threshold scale with custom breakpoints
#scaleExtent Source
scaleExtent :: ContinuousScale -> { max :: Number, min :: Number }Get the extent (min, max) of a scale's output for inputs in [0, 1]
#scaleMidpoint Source
scaleMidpoint :: ContinuousScale -> NumberGet the midpoint of a scale
#scaleInRange Source
scaleInRange :: ContinuousScale -> Number -> BooleanCheck if a value is within a scale's output range
- Modules
- Data.
DependencyGraph - Hylograph.
Brush - Hylograph.
Brush. FFI - Hylograph.
Brush. Types - Hylograph.
Classify - Hylograph.
Data. Graph - Hylograph.
Data. Graph. Algorithms - Hylograph.
Data. Node - Hylograph.
Data. Tree - Hylograph.
Expr. Animation - Hylograph.
Expr. Attr - Hylograph.
Expr. Datum - Hylograph.
Expr. Expr - Hylograph.
Expr. Friendly - Hylograph.
Expr. Integration - Hylograph.
Expr. Interpreter. CodeGen - Hylograph.
Expr. Interpreter. Eval - Hylograph.
Expr. Interpreter. Meta - Hylograph.
Expr. Interpreter. PureSVG - Hylograph.
Expr. Interpreter. SVG - Hylograph.
Expr. Path - Hylograph.
Expr. Path. Generators - Hylograph.
Expr. Sugar - Hylograph.
Expr. Units - Hylograph.
HATS - Hylograph.
HATS. Friendly - Hylograph.
HATS. InterpreterTick - Hylograph.
HATS. Transitions - Hylograph.
Interaction. Brush - Hylograph.
Interaction. Coordinated - Hylograph.
Interaction. Pointer - Hylograph.
Interaction. Zoom - Hylograph.
Internal. Attribute - Hylograph.
Internal. Behavior. FFI - Hylograph.
Internal. Behavior. Types - Hylograph.
Internal. Element. Operations - Hylograph.
Internal. Element. Types - Hylograph.
Internal. FFI - Hylograph.
Internal. Transition. FFI - Hylograph.
Internal. Transition. Manager - Hylograph.
Internal. Transition. Scene - Hylograph.
Internal. Transition. Types - Hylograph.
Internal. Types - Hylograph.
Interpreter. English - Hylograph.
Interpreter. Mermaid - Hylograph.
Interpreter. MetaHATS - Hylograph.
Interpreter. SemiQuine - Hylograph.
Interpreter. SemiQuine. TreeToCode - Hylograph.
Interpreter. SemiQuine. Types - Hylograph.
Scale - Hylograph.
Scale. ColorSchemes - Hylograph.
Scale. FP - Hylograph.
Scale. Interpolation - Hylograph.
Scale. Pure - Hylograph.
Scale. Sequential - Hylograph.
Shape. Arc - Hylograph.
Shape. Pie - Hylograph.
Shape. Polygon - Hylograph.
Tooltip - Hylograph.
Transform - Hylograph.
Unified - Hylograph.
Unified. Attribute - Hylograph.
Unified. DataDSL - Hylograph.
Unified. Display - Hylograph.
Unified. Sugar