From fd69e74ff66a1d7300e1acb161be142abb05d64f Mon Sep 17 00:00:00 2001 From: goyalarchit Date: Wed, 15 Dec 2021 01:21:01 +0530 Subject: [PATCH] Fixed a bug in Render.StandardDrawers.Attributes --- elm.json | 2 +- src/Render/StandardDrawers.elm | 26 ++++++++++++++++++++++- src/Render/StandardDrawers/Attributes.elm | 8 +++---- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/elm.json b/elm.json index 12b07c2..c7de2f2 100644 --- a/elm.json +++ b/elm.json @@ -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", diff --git a/src/Render/StandardDrawers.elm b/src/Render/StandardDrawers.elm index e7e73e9..2c4407e 100644 --- a/src/Render/StandardDrawers.elm +++ b/src/Render/StandardDrawers.elm @@ -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_ -} diff --git a/src/Render/StandardDrawers/Attributes.elm b/src/Render/StandardDrawers/Attributes.elm index bea8d3a..86e5d3f 100644 --- a/src/Render/StandardDrawers/Attributes.elm +++ b/src/Render/StandardDrawers/Attributes.elm @@ -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