-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathunsupportedFeature.kt
46 lines (40 loc) · 1.32 KB
/
unsupportedFeature.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import space.kscience.dataforge.meta.Meta
import space.kscience.dataforge.meta.configure
import space.kscience.dataforge.meta.invoke
import space.kscience.dataforge.meta.set
import space.kscience.dataforge.values.ListValue
import space.kscience.dataforge.values.asValue
import space.kscience.plotly.Plotly
import space.kscience.plotly.makeFile
import space.kscience.plotly.models.Trace
import space.kscience.plotly.models.invoke
fun main() {
val x = (0..5)
val y = x.map { it * it }
val trace = Trace.invoke(x, y) {
name = "sin"
/* The hover text definition is currently not supported.
* We are applying it directly to configuration.
* It is still observable in the same way as other properties but is not type safe.
*/
meta["text"] = x.map { "label for $it".asValue() }
}
val plot = Plotly.plot {
traces(trace)
layout {
title = "Plot with labels"
xaxis {
title = "x axis name"
configure {
"rangebreaks" putIndexed listOf(
Meta {
"values" put ListValue(2.0, 3.0)
}
)
}
}
yaxis { title = "y axis name" }
}
}
plot.makeFile()
}