We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54b4b30 commit ef459faCopy full SHA for ef459fa
almond/src/main/scala/plotly/Almond.scala
@@ -10,6 +10,10 @@ import plotly.layout._
10
11
object Almond {
12
13
+ object Internal {
14
+ @volatile var initialized = false
15
+ }
16
+
17
def init(offline: Boolean = false)(implicit publish: OutputHandler): Unit = {
18
19
// offline mode like in plotly-python
@@ -77,6 +81,14 @@ object Almond {
77
81
publish: OutputHandler
78
82
): String = {
79
83
84
+ if (!Internal.initialized)
85
+ Internal.synchronized {
86
+ if (!Internal.initialized) {
87
+ init()
88
+ Internal.initialized = true
89
90
91
80
92
val div0 =
93
if (div.isEmpty)
94
randomDiv()
0 commit comments