Hylograph.Internal.Attribute
- Package
- purescript-hylograph-selection
- Repository
- afcondon/purescript-hylograph-selection
DEPRECATED — moved to Hylograph.Attribute.
This module now re-exports the attribute vocabulary from its new public home.
It never should have lived under Internal: it is not an
implementation detail, it is vocabulary that every consumer needs.
It landed here by inheritance during an earlier refactor, and by the
time that was noticed several hundred imports across the ecosystem
already pointed at this path.
Nothing here is going away without warning — this shim exists so that
those imports keep working. New code should import Hylograph.Attribute,
and for ElementType in particular Hylograph.HATS now re-exports it,
so the common case needs no extra import at all.
Re-exports from Hylograph.Attribute
#Milliseconds Source
type Milliseconds = NumberTime in milliseconds for animation configuration
#EasingType Source
data EasingTypeEnumeration of easing types for animations
Note: This mirrors Hylograph.Transition.Easing.EasingType but is defined here to avoid circular dependencies. The Manager module will convert between them.
Constructors
LinearQuadInQuadOutQuadInOutCubicInCubicOutCubicInOutSinInSinOutSinInOutExpInExpOutExpInOutCircleInCircleOutCircleInOutBackInBackOutBackInOutElasticInElasticOutElasticInOutBounceInBounceOutBounceInOut
Instances
#AttributeValue Source
data AttributeValueAttribute values
We support the most common value types. The ADT ensures type safety when setting attributes.
Constructors
Instances
#AttributeName Source
newtype AttributeNameAttribute names (SVG/HTML properties)
We use a newtype to prevent typos and enable IDE autocomplete. The String inside is the actual DOM attribute name.
Constructors
Instances
#Attribute Source
data Attribute datumType-safe attribute with datum phantom type
Attributes can be:
- Static: Same value for all elements
- Data-driven: Value computed from datum (with source metadata)
- Indexed: Value computed from datum and index (with source metadata)
The phantom type datum ensures attributes are only applied
to selections with matching data types.
The AttrSource field enables interpreters to inspect attribute origins
without evaluating the functions.
Constructors
StaticAttr AttributeName AttributeValueDataAttr AttributeName AttrSource (datum -> AttributeValue)IndexedAttr AttributeName AttrSource (datum -> Int -> AttributeValue)AnimatedAttr { config :: AnimationConfig, fromValue :: Maybe (AnimatedValue datum), name :: AttributeName, toValue :: AnimatedValue datum }AnimatedCompound { config :: AnimationConfig, fromValues :: Array (AnimatedValue datum), generator :: Array Number -> String, name :: AttributeName, toValues :: Array (AnimatedValue datum) }
Instances
Show (Attribute datum)Contravariant AttributeContravariant instance for Attribute
Attributes consume data (they're data sinks), making them naturally contravariant. This enables attribute reuse via
cmap:-- Define attribute for specific type radiusAttr :: Attribute Number radiusAttr = DataAttr (AttributeName "r") NumberValue -- Adapt to work with richer type type Circle = { radius :: Number, x :: Number, y :: Number } circleRadiusAttr :: Attribute Circle circleRadiusAttr = cmap _.radius radiusAttrThe key insight:
cmapcomposes the projection function with the attribute's data accessor, allowing attributes written for simple types to work with complex types via field selection.
#AttrSource Source
data AttrSourceSource metadata for attributes
Describes where the attribute value comes from, enabling interpreters like MetaAST to show meaningful information about attribute bindings.
This is automatically captured when using the DSL (field, num, etc.)
but is UnknownSource for raw PureScript functions (escape hatches).
Constructors
Instances
#AnimationConfig Source
type AnimationConfig = { delay :: Milliseconds, duration :: Milliseconds, easing :: EasingType }Configuration for a single animated attribute
Specifies timing, easing, and delay for the animation.
#AnimatedValue Source
data AnimatedValue datumAnimated value specification
Describes where the animation value comes from:
- StaticAnimValue: Constant number
- DataAnimValue: Computed from datum
- IndexedAnimValue: Computed from datum and element index
Constructors
StaticAnimValue NumberDataAnimValue (datum -> Number)IndexedAnimValue (datum -> Int -> Number)
Instances
Show (AnimatedValue datum)
#defaultAnimationConfig Source
defaultAnimationConfig :: AnimationConfigDefault animation configuration: 300ms, QuadOut, no delay
- Modules
- Data.
DependencyGraph - Hylograph.
Attribute - Hylograph.
Behavior - Hylograph.
Behavior. Types - Hylograph.
Brush - Hylograph.
Brush. FFI - Hylograph.
Brush. Types - Hylograph.
Classify - Hylograph.
Data. Graph - Hylograph.
Data. Graph. Algorithms - Hylograph.
Data. Node - Hylograph.
Data. Tree - Hylograph.
Element. Types - 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.
Foreign. Types - 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.
Transition. Types - Hylograph.
Unified - Hylograph.
Unified. Attribute - Hylograph.
Unified. DataDSL - Hylograph.
Unified. Display - Hylograph.
Unified. Sugar
Animated compound attribute for paths and other generated strings
Animates multiple numeric values and calls a generator function to produce the final string value. Used for:
The generator receives interpolated values in the same order as fromValues/toValues.