Skip to content

Commit d395fd2

Browse files
Merge branch 'master' into master
2 parents 22e3107 + 334122d commit d395fd2

File tree

5 files changed

+18
-19
lines changed

5 files changed

+18
-19
lines changed

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ It is published for both scala 2.12 and 2.13.
3030

3131
Add the `org.plotly-scala::plotly-almond:0.8.1` dependency to the notebook. (Latest version: [![Maven Central](https://img.shields.io/maven-central/v/org.plotly-scala/plotly-render_2.13.svg)](https://maven-badges.herokuapp.com/maven-central/org.plotly-scala/plotly-render_2.13))
3232
Then initialize plotly-scala, and use it, like
33+
3334
```scala
3435
import $ivy.`org.plotly-scala::plotly-almond:0.8.1`
3536

@@ -48,9 +49,9 @@ Bar(x, y).plot()
4849
```
4950

5051
#### JupyterLab
51-
If you're using [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/), you have to install the [plotly-extension](https://github.com/jupyterlab/jupyter-renderers/tree/master/packages/plotly-extension) to enable support for rendering Plotly charts:
52+
If you're using [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/), you have to install [jupyterlab-plotly](https://plotly.com/python/getting-started/#jupyterlab-support-python-35) to enable support for rendering Plotly charts:
5253
```bash
53-
jupyter labextension install @jupyterlab/plotly-extension
54+
jupyter labextension install jupyterlab-plotly
5455
```
5556

5657
### From scala-js
@@ -68,24 +69,20 @@ import plotly._, element._, layout._, Plotly._
6869

6970
Then define plots like
7071
```scala
71-
val x = 0.0 to 10.0 by 0.1
72+
val x = (0 to 100).map(_ * 0.1)
7273
val y1 = x.map(d => 2.0 * d + util.Random.nextGaussian())
7374
val y2 = x.map(math.exp)
7475

7576
val plot = Seq(
76-
Scatter(
77-
x, y1, name = "Approx twice"
78-
),
79-
Scatter(
80-
x, y2, name = "Exp"
81-
)
77+
Scatter(x, y1).withName("Approx twice"),
78+
Scatter(x, y2).withName("Exp")
8279
)
8380
```
8481
and plot them with
82+
8583
```scala
86-
plot.plot(
87-
title = "Curves"
88-
)
84+
val lay = Layout().withTitle("Curves")
85+
plot.plot("plot", lay) // attaches to div element with id 'plot'
8986
```
9087

9188

@@ -94,6 +91,7 @@ plot.plot(
9491
Load the corresponding dependency, and some imports, like
9592
```scala
9693
import $ivy.`org.plotly-scala::plotly-render:0.8.1`
94+
9795
import plotly._, element._, layout._, Plotly._
9896
```
9997

project/Deps.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ object Deps {
99

1010
def almondScalaApi = "sh.almond" %% "jupyter-api" % "0.10.9"
1111
def argonautShapeless = setting("com.github.alexarchambault" %%% "argonaut-shapeless_6.2" % "1.2.0")
12-
def dataClass = "io.github.alexarchambault" %% "data-class" % "0.2.3"
13-
def jodaTime = "joda-time" % "joda-time" % "2.10.7"
12+
def dataClass = "io.github.alexarchambault" %% "data-class" % "0.2.5"
13+
def jodaTime = "joda-time" % "joda-time" % "2.10.10"
1414
def rhino = "org.mozilla" % "rhino" % "1.7.13"
1515
def shapeless = setting("com.chuusai" %%% "shapeless" % "2.3.3")
1616
def scalacheckShapeless = setting("com.github.alexarchambault" %%% "scalacheck-shapeless_1.14" % "1.2.0-1")
1717
def scalajsDom = setting("org.scala-js" %%% "scalajs-dom" % "1.1.0")
18-
def scalatags = setting("com.lihaoyi" %%% "scalatags" % "0.9.2")
19-
def scalaTest = "org.scalatest" %% "scalatest" % "3.2.2"
18+
def scalatags = setting("com.lihaoyi" %%% "scalatags" % "0.9.3")
19+
def scalaTest = "org.scalatest" %% "scalatest" % "3.2.4"
2020
def utest = setting("com.lihaoyi" %%% "utest" % "0.6.6")
2121

2222
}

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.4.1
1+
sbt.version=1.4.7

project/plugins.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.3")
1+
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.5")
22
addSbtPlugin("io.github.alexarchambault.sbt" % "sbt-compatibility" % "0.0.8")
33
addSbtPlugin("io.github.alexarchambault.sbt" % "sbt-eviction-rules" % "0.2.0")
44
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.8.1")
5-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.3.0")
5+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.5.0")
66
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
77
addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.2")
88
addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.0.0")

render/jvm/src/main/scala/plotly/Plotly.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ object Plotly {
144144
s"""<!DOCTYPE html>
145145
|<html>
146146
|<head>
147+
|<meta charset="UTF-8">
147148
|<title>${layout.title.getOrElse("plotly chart")}</title>
148149
|$plotlyHeader
149150
|</head>

0 commit comments

Comments
 (0)