Skip to content

Commit

Permalink
Fixed a bug in Render.StandardDrawers.Attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
goyalarchit committed Dec 14, 2021
1 parent 10f7666 commit fd69e74
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
2 changes: 1 addition & 1 deletion elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "goyalarchit/elm-dagre",
"summary": "Sugiyama Style graph drawing in pure elm.",
"license": "BSD-3-Clause",
"version": "1.0.1",
"version": "2.0.0",
"exposed-modules": [
"Render",
"Render.Types",
Expand Down
26 changes: 25 additions & 1 deletion src/Render/StandardDrawers.elm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,31 @@ default drawers for the draw function.
## Standard Configurations
-- Todo
### Edge Drawer
1. arrowHead = None
2. strokeColor = Color.darkGrey
3. strokeWidth = 3px
4. title = Edge.from → Edge.to
5. linkStyle = Spline
6. alpha = 0.5
7. orientLabelAlongEdge = False
_Note: All missing attributes don't have any preset values_
### NodeDrawer
1. label = Node.id
2. shape = Ellipse
3. strokeColor = Color.blue
4. strokeWidth = 1px
5. fill = #b2ebf2
6. title = Node.id
7.xLabelPos = ( (w / 2) + 1, (-h / 2) - 1 )
_Note: All missing attributes don't have any preset values_
-}

Expand Down
8 changes: 4 additions & 4 deletions src/Render/StandardDrawers/Attributes.elm
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,18 @@ strokeWidth f =

{-| To set the stroke dash array of a node/edge
-}
strokeDashArray : (a -> String) -> Attribute { c | strokeDashArray : Maybe (a -> String) }
strokeDashArray : (a -> String) -> Attribute { c | strokeDashArray : a -> String }
strokeDashArray f =
\edc ->
{ edc | strokeDashArray = Just f }
{ edc | strokeDashArray = f }


{-| To add any inline css to path element of the edge, or polygon of node.
-}
style : (a -> String) -> Attribute { c | style : Maybe (a -> String) }
style : (a -> String) -> Attribute { c | style : a -> String }
style f =
\edc ->
{ edc | style = Just f }
{ edc | style = f }


{-| To set the title (appears as a tooltip) of a node/edge
Expand Down

0 comments on commit fd69e74

Please sign in to comment.