Hylograph.Unified.Examples
- Package
- purescript-hylograph-selection
- Repository
- afcondon/purescript-hylograph-selection
PSD3.Unified.Examples - Examples of the Unified DSL
This module demonstrates how to use the unified DSL and shows that old and new styles work together seamlessly.
Highlights
- DataDSL: Unified computations for spreadsheet and viz
- Display: Profunctor-based non-destructive formatting
- AST Joins: Data binding patterns for visualization
#newStyleCircle Source
newStyleCircle :: DataPoint -> Array (Attribute DataPoint)New-style visualization using Display profunctor
#newStyleCircleFormatted Source
newStyleCircleFormatted :: DataPoint -> Array (Attribute DataPoint)With more sophisticated formatting
#computeProfit Source
computeProfit :: forall repr. DataDSL repr => repr (Array QuarterData) -> repr (Array Number)Quarterly profit computation
#totalProfit Source
totalProfit :: forall repr. DataDSL repr => repr (Array QuarterData) -> repr NumberTotal profit (works in sheet or viz)
#currencyDisplay Source
currencyDisplay :: Display Number StringCurrency display: 1234.56 -> "$1,234.56"
#profitDisplay Source
profitDisplay :: Display Number StringProfit display (with sign): -100 -> "(100)", 100 -> "100"
#compactDisplay Source
compactDisplay :: Display Number StringCompact display for large numbers: 1500000 -> "1.5M"
#showAsPercent Source
showAsPercent :: Number -> StringUsing displays
#showAsCurrency Source
showAsCurrency :: Number -> String#quarterGrowthDisplay Source
quarterGrowthDisplay :: Display QuarterData StringAdapt percentage display to work with QuarterData
#revenueDisplay Source
revenueDisplay :: Display QuarterData StringAdapt to extract different fields
#newStyleViz Source
newStyleViz :: Array DataPoint -> Tree DataPointA visualization using the new style throughout
#myComputation Source
myComputation :: forall repr. DataDSL repr => repr (Array Number) -> repr NumberDefine computation abstractly
#formatLabel Source
formatLabel :: QuarterData -> StringExample of creating a label with display formatting
#formatGrowthLabel Source
formatGrowthLabel :: QuarterData -> StringOr with percentage growth:
#simpleJoinExample Source
simpleJoinExample :: Array DataPoint -> Tree DataPointSimple data join
Use joinData for one-shot renders where elements don't update.
For dynamic updates, use updateJoin with a keyFn.
#joinWithGUPExample Source
joinWithGUPExample :: Array DataPoint -> Tree DataPointJoin with GUP (General Update Pattern) - enter/update/exit
For dynamic updates, use updateJoin with a keyFn to identify elements.
The keyFn extracts a unique string identifier from each datum.
#nestedJoinExample Source
nestedJoinExample :: SceneData -> Tree SceneDataNested join with type decomposition
The scene data contains an array of points.
nestedJoin extracts the inner array for joining.
Use this for one-shot renders with type decomposition.
For dynamic updates with decomposition, use updateNestedJoin.
- Modules
- Data.
DependencyGraph - Hylograph.
AST - Hylograph.
Axis. Axis - 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. Capabilities. Selection - Hylograph.
Internal. Capabilities. Transition - Hylograph.
Internal. FFI - Hylograph.
Internal. Selection. Join - Hylograph.
Internal. Selection. Operations - Hylograph.
Internal. Selection. Operations. Conversions - Hylograph.
Internal. Selection. Operations. Helpers - Hylograph.
Internal. Selection. Operations. Selection - Hylograph.
Internal. Selection. Query - Hylograph.
Internal. Selection. Types - Hylograph.
Internal. Transition. FFI - Hylograph.
Internal. Transition. Manager - Hylograph.
Internal. Transition. Scene - Hylograph.
Internal. Transition. Types - Hylograph.
Internal. Types - Hylograph.
Interpreter. D3 - Hylograph.
Interpreter. English - Hylograph.
Interpreter. Mermaid - Hylograph.
Interpreter. MetaAST - Hylograph.
Interpreter. SemiQuine - Hylograph.
Interpreter. SemiQuine. TreeToCode - Hylograph.
Interpreter. SemiQuine. Types - Hylograph.
Render - Hylograph.
Scale - Hylograph.
Scale. FP - Hylograph.
Shape. Arc - Hylograph.
Shape. Pie - Hylograph.
Shape. Polygon - Hylograph.
Tooltip - Hylograph.
Transform - Hylograph.
TreeDSL - Hylograph.
TreeDSL. ShapeTree - Hylograph.
Unified - Hylograph.
Unified. Attribute - Hylograph.
Unified. DataDSL - Hylograph.
Unified. Display - Hylograph.
Unified. Examples - Hylograph.
Unified. Join - Hylograph.
Unified. Sugar