Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data ER = ER {}
- data Entity = Entity {}
- data Attribute = Attribute {}
- type Options = Map String Option
- mergeOpts :: Options -> Options -> Options
- optionsTo :: (Option -> Maybe a) -> Options -> [a]
- data Option
- = Label String
- | BgColor Color
- | Color Color
- | FontFace Text
- | FontSize Double
- | Border Word8
- | BorderColor Color
- | CellSpacing Word8
- | CellBorder Word8
- | CellPadding Word8
- | TextAlignment Align
- optionByName :: String -> String -> Either String Option
- optToFont :: Option -> Maybe Attribute
- optToHtml :: Option -> Maybe Attribute
- optToLabel :: Option -> Maybe Text
- data Relation = Relation {}
- data Cardinality
- cardByName :: Char -> Maybe Cardinality
- defaultAttrOpts :: Options
- defaultTitleOpts :: Options
- defaultEntityOpts :: Options
- defaultHeaderOpts :: Options
- defaultRelOpts :: Options
Documentation
Represents a single schema.
Represents a single entity in a schema.
Represents a single attribute in a particular entity.
type Options = Map String Option Source #
Represents any number of options for an item in an ER diagram. An item may be the graph title, an entity, an entity header or a relationship between entities. Keys are options as specified in ER files.
Note that a set of options may include a label for any item.
mergeOpts :: Options -> Options -> Options Source #
Given two sets of options, merge the second into first, where elements in the first take precedence.
optionsTo :: (Option -> Maybe a) -> Options -> [a] Source #
Given a set of options and a selector function, return the list of
only those options which matched. Examples of the selector function are
optToFont
, optToHtml
and optToLabel
.
A restricted subset of options in GraphViz that can be configured in an ER file.
Label String | |
BgColor Color | |
Color Color | |
FontFace Text | |
FontSize Double | |
Border Word8 | |
BorderColor Color | |
CellSpacing Word8 | |
CellBorder Word8 | |
CellPadding Word8 | |
TextAlignment Align |
optionByName :: String -> String -> Either String Option Source #
Given an option name and a string representation of its value,
optionByName
will attempt to parse the string as a value corresponding
to the option. If the option doesn't exist or there was a problem parsing
the value, an error is returned.
optToFont :: Option -> Maybe Attribute Source #
Selects an option if and only if it corresponds to a font attribute.
optToHtml :: Option -> Maybe Attribute Source #
Selects an option if and only if it corresponds to an HTML attribute. In particular, for tables or table cells.
optToLabel :: Option -> Maybe Text Source #
Selects an option if and only if it corresponds to a label.
Represents a relationship between exactly two entities. After parsing,
each rel
is guaranteed to correspond to an entity defined in the same
ER file.
Each relationship has one of four cardinalities specified for both entities. Those cardinalities are: 0 or 1, exactly 1, 0 or more and 1 or more.
data Cardinality Source #
Instances
Eq Cardinality Source # | |
Defined in Erd.ER (==) :: Cardinality -> Cardinality -> Bool # (/=) :: Cardinality -> Cardinality -> Bool # | |
Show Cardinality Source # | |
Defined in Erd.ER showsPrec :: Int -> Cardinality -> ShowS # show :: Cardinality -> String # showList :: [Cardinality] -> ShowS # |
cardByName :: Char -> Maybe Cardinality Source #
Maps a string representation to a particular relationship cardinality.
defaultTitleOpts :: Options Source #
Hard-coded default options for all graph titles.
defaultEntityOpts :: Options Source #
Hard-coded default options for all entities.
defaultHeaderOpts :: Options Source #
Hard-coded default options for all entity headers.
defaultRelOpts :: Options Source #
Hard-coded default options for all relationships.