-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
146 additions
and
367 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
.js/src/test/scala/io/github/scala_tessella/tessella/conversion/ConverterSVGSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package io.github.scala_tessella.tessella | ||
package conversion | ||
|
||
import Geometry.Box | ||
import SharedML.addAttributes | ||
import SVG.* | ||
|
||
import org.scalatest.* | ||
import org.scalatest.flatspec.* | ||
import org.scalatest.matchers.* | ||
|
||
import scala.xml.Elem | ||
|
||
class ConverterSVGSpec extends AnyFlatSpec with should.Matchers { | ||
|
||
val box: Box = | ||
Box(-2.0, 10.0, -2.0, 10.0) | ||
|
||
"An SVG element" can "be created" in { | ||
val e: Elem = | ||
svg(box) | ||
prettyPrinter.format(e) shouldBe | ||
"""<svg viewBox="-125 -125 650 650" xmlns="http://www.w3.org/2000/svg"></svg>""" | ||
} | ||
|
||
it can "have attributes added" in { | ||
val e: Elem = | ||
svg(box).addAttributes(rdfAttributes *) | ||
prettyPrinter.format(e) shouldBe | ||
"""<svg xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" viewBox="-125 -125 650 650" xmlns="http://www.w3.org/2000/svg"></svg>""" | ||
} | ||
|
||
"A rect element" can "be created from a Box2D" in { | ||
val e: Elem = | ||
rect(box) | ||
prettyPrinter.format(e) shouldBe | ||
"""<rect width="600" height="600" x="-100" y="-100"></rect>""" | ||
} | ||
|
||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...essella/conversion/SVGAnimationSpec.scala → ...essella/conversion/SVGAnimationSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,23 +12,33 @@ ThisBuild / semanticdbVersion := scalafixSemanticdb.revision | |
lazy val root: Project = | ||
project | ||
.in(file(".")) | ||
.aggregate(tessella.js, tessella.jvm) | ||
.settings( | ||
name := "tessella", | ||
description := "Tilings by regular polygons", | ||
licenses := Seq("APL2" -> url("https://www.apache.org/licenses/LICENSE-2.0.txt")), | ||
sonatypeProjectHosting := Some(GitHubHosting("scala-tessella", "tessella", "[email protected]")), | ||
sonatypeCredentialHost := "s01.oss.sonatype.org", | ||
publishTo := sonatypePublishToBundle.value, | ||
git.remoteRepo := sonatypeProjectHosting.value.get.scmUrl, | ||
ghpagesNoJekyll := true, | ||
libraryDependencies ++= Seq( | ||
"io.github.iltotore" %% "iron" % "2.5.0", | ||
"org.scala-lang.modules" %% "scala-xml" % "2.3.0", | ||
"io.github.scala-tessella" %% "ring-seq" % "0.5.1", | ||
"org.scalatest" %% "scalatest" % "3.2.18" % "test", | ||
"org.scalacheck" %% "scalacheck" % "1.17.1" % "test" | ||
), | ||
SiteScaladoc / siteSubdirName := "api", | ||
paradoxProperties += ("scaladoc.base_url" -> "api"), | ||
scalacOptions += "-deprecation" | ||
) | ||
|
||
lazy val tessella = | ||
crossProject(JSPlatform, JVMPlatform) | ||
.crossType(CrossType.Pure) | ||
.in(file(".")) | ||
.settings( | ||
name := "tessella", | ||
description := "Tilings by regular polygons", | ||
licenses := Seq("APL2" -> url("https://www.apache.org/licenses/LICENSE-2.0.txt")), | ||
libraryDependencies ++= Seq( | ||
"io.github.scala-tessella" %%% "ring-seq" % "0.6.2", | ||
"io.github.iltotore" %%% "iron" % "2.5.0", | ||
"org.scala-lang.modules" %%% "scala-xml" % "2.3.0", | ||
"org.scalatest" %%% "scalatest" % "3.2.18" % "test", | ||
"org.scalacheck" %%% "scalacheck" % "1.17.1" % "test", | ||
) | ||
) | ||
.jvmSettings() | ||
.jsSettings() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.