diff --git a/temporal-diagrams-demo/src/main/scala/com/htmlism/temporaldiagrams/demo/DemoDsl.scala b/temporal-diagrams-demo/src/main/scala/com/htmlism/temporaldiagrams/demo/DemoDsl.scala index 77a54c18..8ba5dcb9 100644 --- a/temporal-diagrams-demo/src/main/scala/com/htmlism/temporaldiagrams/demo/DemoDsl.scala +++ b/temporal-diagrams-demo/src/main/scala/com/htmlism/temporaldiagrams/demo/DemoDsl.scala @@ -47,9 +47,7 @@ object DemoDsl: 1, Link.Weight.Normal, Link.Direction.Single(Link.Head.Arrow), - text = None, - NonEmptyList.one(dest), - style = None + NonEmptyList.one(dest) ) ) ) diff --git a/temporal-diagrams-mermaid/src/main/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/FlowchartDsl.scala b/temporal-diagrams-mermaid/src/main/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/FlowchartDsl.scala index 86d1f8a0..1699caf7 100644 --- a/temporal-diagrams-mermaid/src/main/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/FlowchartDsl.scala +++ b/temporal-diagrams-mermaid/src/main/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/FlowchartDsl.scala @@ -262,11 +262,11 @@ object FlowchartDsl: length: Int, weight: Weight, direction: Direction, - text: Option[String], destinations: NonEmptyList[String], - style: Option[StyleSpec] + text: Option[String] = None, + style: Option[StyleSpec] = None ) - case Invisible(length: Int, destinations: NonEmptyList[String], style: Option[StyleSpec]) + case Invisible(length: Int, destinations: NonEmptyList[String], style: Option[StyleSpec] = None) enum Weight: case Normal diff --git a/temporal-diagrams-mermaid/src/main/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/LinkEncoder.scala b/temporal-diagrams-mermaid/src/main/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/LinkEncoder.scala index 50dac25e..43ea8956 100644 --- a/temporal-diagrams-mermaid/src/main/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/LinkEncoder.scala +++ b/temporal-diagrams-mermaid/src/main/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/LinkEncoder.scala @@ -68,7 +68,7 @@ object LinkEncoder: ampersand(destinations) ) -> style - case Segment.Visible(length, weight, direction, oText, destinations, style) => + case Segment.Visible(length, weight, direction, destinations, oText, style) => val (leftHead, rightHead) = (weight, direction) match case (Weight.Normal, Direction.Open) => diff --git a/temporal-diagrams-mermaid/src/test/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/FlowchartSuite.scala b/temporal-diagrams-mermaid/src/test/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/FlowchartSuite.scala index 2391da1d..f37f069b 100644 --- a/temporal-diagrams-mermaid/src/test/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/FlowchartSuite.scala +++ b/temporal-diagrams-mermaid/src/test/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/FlowchartSuite.scala @@ -293,9 +293,7 @@ object FlowchartSuite extends FunSuite: 1, Link.Weight.Normal, Link.Direction.Open, - text = None, - NonEmptyList.one("beta"), - style = None + NonEmptyList.one("beta") ), Link .Segment @@ -303,9 +301,7 @@ object FlowchartSuite extends FunSuite: 2, Link.Weight.Normal, Link.Direction.Open, - text = None, - NonEmptyList.one("gamma"), - style = None + NonEmptyList.one("gamma") ) ) ) @@ -331,9 +327,7 @@ object FlowchartSuite extends FunSuite: 1, Link.Weight.Normal, Link.Direction.Single(Link.Head.Arrow), - text = None, - NonEmptyList.one("bar"), - style = None + NonEmptyList.one("bar") ) ) ) @@ -359,9 +353,7 @@ object FlowchartSuite extends FunSuite: 1, Link.Weight.Normal, Link.Direction.Multi(Link.Head.Arrow), - text = None, - NonEmptyList.one("bar"), - style = None + NonEmptyList.one("bar") ) ) ) @@ -387,9 +379,8 @@ object FlowchartSuite extends FunSuite: 1, Link.Weight.Normal, Link.Direction.Open, - text = Some("hello"), NonEmptyList.one("bar"), - style = None + text = Some("hello") ) ) ) @@ -413,15 +404,13 @@ object FlowchartSuite extends FunSuite: .Segment .Invisible( 1, - NonEmptyList.one("bar"), - style = None + NonEmptyList.one("bar") ), Link .Segment .Invisible( 2, - NonEmptyList.one("baz"), - style = None + NonEmptyList.one("baz") ) ) ) @@ -447,9 +436,7 @@ object FlowchartSuite extends FunSuite: 1, Link.Weight.Dotted, Link.Direction.Open, - text = None, - NonEmptyList.one("two"), - style = None + NonEmptyList.one("two") ), Link .Segment @@ -457,9 +444,7 @@ object FlowchartSuite extends FunSuite: 2, Link.Weight.Dotted, Link.Direction.Open, - text = None, - NonEmptyList.one("three"), - style = None + NonEmptyList.one("three") ) ) ) @@ -485,9 +470,8 @@ object FlowchartSuite extends FunSuite: 1, Link.Weight.Dotted, Link.Direction.Open, - text = Some("foo"), NonEmptyList.one("two"), - style = None + text = Some("foo") ), Link .Segment @@ -495,9 +479,8 @@ object FlowchartSuite extends FunSuite: 2, Link.Weight.Dotted, Link.Direction.Open, - text = Some("bar"), NonEmptyList.one("three"), - style = None + text = Some("bar") ) ) ) @@ -524,8 +507,8 @@ object FlowchartSuite extends FunSuite: 1, Link.Weight.Normal, Link.Direction.Single(Link.Head.Arrow), - text = Some("this has style"), NonEmptyList.one("two"), + text = Some("this has style"), style = NonEmptyList .of( StyleDeclaration("stroke", "#ff3"), @@ -561,9 +544,8 @@ object FlowchartSuite extends FunSuite: 1, Link.Weight.Normal, Link.Direction.Single(Link.Head.Arrow), - text = Some("foo"), NonEmptyList.one("two"), - style = None + text = Some("foo") ), Link .Segment @@ -571,8 +553,8 @@ object FlowchartSuite extends FunSuite: 2, Link.Weight.Normal, Link.Direction.Single(Link.Head.Arrow), - text = Some("bar"), NonEmptyList.one("three"), + text = Some("bar"), style = NonEmptyList .of( StyleDeclaration("stroke", "#3ff"), @@ -610,9 +592,8 @@ object FlowchartSuite extends FunSuite: 1, Link.Weight.Normal, Link.Direction.Single(Link.Head.Arrow), - text = Some("foo"), NonEmptyList.one("two"), - style = None + text = Some("foo") ), Link .Segment @@ -620,9 +601,8 @@ object FlowchartSuite extends FunSuite: 2, Link.Weight.Normal, Link.Direction.Single(Link.Head.Arrow), - text = Some("bar"), NonEmptyList.one("three"), - style = None + text = Some("bar") ) ) ), @@ -635,8 +615,8 @@ object FlowchartSuite extends FunSuite: 1, Link.Weight.Normal, Link.Direction.Single(Link.Head.Arrow), - text = None, NonEmptyList.one("styledEnd"), + text = None, style = NonEmptyList .of( StyleDeclaration("stroke", "#3ff"), diff --git a/temporal-diagrams-mermaid/src/test/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/PrintCurveStyles.scala b/temporal-diagrams-mermaid/src/test/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/PrintCurveStyles.scala index 77a44688..cfe0dc43 100644 --- a/temporal-diagrams-mermaid/src/test/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/PrintCurveStyles.scala +++ b/temporal-diagrams-mermaid/src/test/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/PrintCurveStyles.scala @@ -51,9 +51,7 @@ object PrintCurveStyles extends IOApp.Simple: 2, FlowchartDsl.Link.Weight.Normal, FlowchartDsl.Link.Direction.Single(Head.Arrow), - text = None, - NonEmptyList.one("destinationA"), - None + NonEmptyList.one("destinationA") ) ) ), @@ -69,9 +67,7 @@ object PrintCurveStyles extends IOApp.Simple: 2, FlowchartDsl.Link.Weight.Normal, FlowchartDsl.Link.Direction.Single(Head.Arrow), - text = None, - NonEmptyList.one("destinationB"), - None + NonEmptyList.one("destinationB") ) ) ) diff --git a/temporal-diagrams-mermaid/src/test/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/StyleSuite.scala b/temporal-diagrams-mermaid/src/test/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/StyleSuite.scala index 9ec52124..cd99e6be 100644 --- a/temporal-diagrams-mermaid/src/test/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/StyleSuite.scala +++ b/temporal-diagrams-mermaid/src/test/scala/com/htmlism/temporaldiagrams/mermaid/flowchart/StyleSuite.scala @@ -34,9 +34,7 @@ object StyleSuite extends FunSuite: 1, Link.Weight.Normal, Link.Direction.Single(Link.Head.Arrow), - text = None, - NonEmptyList.one("id2"), - style = None + NonEmptyList.one("id2") ) ) )