Skip to content
This repository was archived by the owner on Oct 11, 2023. It is now read-only.

Commit 48a0a51

Browse files
committed
Allow plot.save(...) instead of creating Document manually
1 parent 2829ffd commit 48a0a51

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bokeh/src/main/scala/package.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,10 @@ package object bokeh extends PrettyTypedTag with TagImplicits {
3030
implicit class ListOps[T](list: List[T]) {
3131
def *(n: Int): List[T] = (0 until n).flatMap(_ => list).toList
3232
}
33+
34+
implicit class ComponentOps[T <: Component](component: T) {
35+
def save(path: String, resources: Resources = Res.default): HTMLFile = {
36+
new Document(component).save(path, resources)
37+
}
38+
}
3339
}

0 commit comments

Comments
 (0)