scalafiddle / scalafiddle-core

Source code for the scalafiddle.io compilation service
https://scalafiddle.io
Apache License 2.0
101 stars 37 forks source link

Can't refactor use of scalatag SVG #32

Closed Lasering closed 6 years ago

Lasering commented 6 years ago

This fiddle works.

Now I want to refactor the t value to create circles with different radius fiddle of it.

Seems like its an impossible job!

Without any return type annotation on the draw method, I get:

ScalaFiddle.scala:27: error: type mismatch;
 found   : collection.this.Seq[scalatags.this.JsDom.TypedTag[raw.this.SVGElement with raw.this.SVGTransformable with raw.this.SVGStylable with raw.this.SVGTests with raw.this.SVGExternalResourcesRequired with raw.this.SVGLangSpace{}]]
 required: .this.scalatags.JsDom.all.Modifier
    (which expands to)  generic.this.Modifier[raw.this.Element]
  Fiddle.print(draw(25))
                   ^

Since the imports are

import scalatags.JsDom.implicits._
import scalatags.JsDom.svgAttrs._
import scalatags.JsDom.svgTags._

seems like there is no way of returning a .this.scalatags.JsDom.all.Modifier.

scalatags.JsDom.all does not include SVG tags.

ochrons commented 6 years ago

These issues are only intended for bug reports on Scalafiddle itself. Please use the Gitter chat rooms (for example scala-js/scala-js) for discussion.