In [30]:
import almond.interpreter.api._
val html = DisplayData.html("<div> Hello World </div>")
Out[30]:
In [31]:
display(html)
In [32]:
import scala.concurrent._
implicit val ec = ExecutionContext.global
Out[32]:
In [32]:
Future(diplay(html))
In [ ]:
In [3]:
val svgText = """<svg version="1.1"
baseProfile="full"
width="300" height="200"
xmlns="http://www.w3.org/2000/svg">
<rect width="100%" height="100%" fill="red" />
<circle cx="150" cy="100" r="80" fill="green" />
<text x="150" y="125" font-size="60" text-anchor="middle" fill="white">SVG</text>
</svg>"""
Out[3]:
In [4]:
val svg = DisplayData.svg(svgText)
Out[4]:
In [5]:
display(svg)
In [6]:
val latex = DisplayData.latex("x^2 + y^2 = 1")
Out[6]:
In [7]:
display(latex)
In [8]:
import $ivy.`io.github.siddhartha-gadgil::provingground-core-jvm:0.1.0`
Out[8]:
In [9]:
import provingground._, interface._
Out[9]:
In [10]:
val cvs = new SvgPlot(400, 200)
val plot = cvs
Out[10]:
In [11]:
val ax = cvs.plot(cvs.axes)
Out[11]:
In [12]:
display(DisplayData.html(ax.toString))
In [13]:
val svgAx = DisplayData.svg(s"""<svg version="1.1"
baseProfile="full"
width="300" height="200"
xmlns="http://www.w3.org/2000/svg">$ax</svg>""")
Out[13]:
In [14]:
display(svgAx)
In [15]:
plot.yval(0)
Out[15]:
In [16]:
plot.axes
Out[16]:
In [17]:
import cvs._
Out[17]:
In [18]:
axes
Out[18]:
In [ ]:
In [19]:
val pl = polyline((0, 0), (100, 100), (200, 100))
Out[19]:
In [20]:
display(DisplayData.html(plot(pl).toString))
In [21]:
val point = (1 to 100) map ((x) => (x : Double, math.max(x, 50): Double))
Out[21]:
In [22]:
val g = graph(point)
Out[22]:
In [23]:
val pg = plot(g)
Out[23]:
In [24]:
val svgPg = DisplayData.svg(s"""<svg version="1.1"
baseProfile="full"
width="300" height="200"
xmlns="http://www.w3.org/2000/svg">$pg</svg>""")
Out[24]:
In [25]:
display(svgPg)
In [26]:
val circ = circle(0, 0, 20, "red")
Out[26]:
In [27]:
val pic = plot(circ :: axes)
Out[27]:
In [28]:
display(DisplayData.html(pic.toString))