Maintainer | Toshio Ito <debug.ito@gmail.com> |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
This module defines tools to serialize a SnapshotGraph
into
GraphML
format.
Since: 0.3.1.0
Synopsis
- writeGraphML :: (ToNodeID n, ToAttributes na, ToAttributes la) => SnapshotGraph n na la -> Text
- writeGraphMLWith :: (ToNodeID n, ToAttributes na, ToAttributes la) => WriteOption -> SnapshotGraph n na la -> Text
- data WriteOption
- defWriteOption :: WriteOption
- woptDefaultDirected :: WriteOption -> Bool
- type NodeID = Text
- class ToNodeID a where
- nodeIDByShow :: Show a => a -> NodeID
- type AttributeKey = Text
- data AttributeValue
- class ToAttributes a where
- toAttributes :: a -> [(AttributeKey, AttributeValue)]
- valueFromAeson :: Value -> Maybe AttributeValue
- attributesFromAeson :: Value -> Maybe [(AttributeKey, AttributeValue)]
Functions
writeGraphML :: (ToNodeID n, ToAttributes na, ToAttributes la) => SnapshotGraph n na la -> Text Source #
writeGraphMLWith
the default options.
writeGraphMLWith :: (ToNodeID n, ToAttributes na, ToAttributes la) => WriteOption -> SnapshotGraph n na la -> Text Source #
Show the SnapshotGraph
into GraphML format. WriteOption
controls the conversion.
Options
data WriteOption Source #
Options to write GraphML. Use defWriteOption
to get the default
values.
Instances
Eq WriteOption Source # | |
Defined in NetSpider.GraphML.Writer (==) :: WriteOption -> WriteOption -> Bool # (/=) :: WriteOption -> WriteOption -> Bool # | |
Ord WriteOption Source # | |
Defined in NetSpider.GraphML.Writer compare :: WriteOption -> WriteOption -> Ordering # (<) :: WriteOption -> WriteOption -> Bool # (<=) :: WriteOption -> WriteOption -> Bool # (>) :: WriteOption -> WriteOption -> Bool # (>=) :: WriteOption -> WriteOption -> Bool # max :: WriteOption -> WriteOption -> WriteOption # min :: WriteOption -> WriteOption -> WriteOption # | |
Show WriteOption Source # | |
Defined in NetSpider.GraphML.Writer showsPrec :: Int -> WriteOption -> ShowS # show :: WriteOption -> String # showList :: [WriteOption] -> ShowS # |
accessors for WriteOption
NodeID
class ToNodeID a where Source #
Type that can be converted to NodeID
.
Instances
Attributes
type AttributeKey = Text Source #
Key of attribute.
data AttributeValue Source #
Typed value of attribute.
Instances
class ToAttributes a where Source #
Type that can be converted to list of attributes.
toAttributes :: a -> [(AttributeKey, AttributeValue)] Source #
Instances
ToAttributes () Source # | |
Defined in NetSpider.GraphML.Writer toAttributes :: () -> [(AttributeKey, AttributeValue)] Source # | |
ToAttributes [(AttributeKey, AttributeValue)] Source # | |
Defined in NetSpider.GraphML.Writer toAttributes :: [(AttributeKey, AttributeValue)] -> [(AttributeKey, AttributeValue)] Source # | |
ToAttributes a => ToAttributes (Maybe a) Source # |
|
Defined in NetSpider.GraphML.Writer toAttributes :: Maybe a -> [(AttributeKey, AttributeValue)] Source # | |
(PropertyMap m, Property p) => ToAttributes (m p AttributeValue) Source # | |
Defined in NetSpider.GraphML.Writer toAttributes :: m p AttributeValue -> [(AttributeKey, AttributeValue)] Source # |
valueFromAeson :: Value -> Maybe AttributeValue Source #
Make AttributeValue
from aeson's Value
. It returns
Nothing
, if the input is null, an object or an array. If the
input is a number, the output uses AttrDouble
.
attributesFromAeson :: Value -> Maybe [(AttributeKey, AttributeValue)] Source #
Make attributes from aeson's Value
. It assumes the input
is an object, and its values can be converted by
valueFromAeson
. Otherwise, it returns Nothing
.