Skip to content

Commit ef2d731

Browse files
committed
make max number of plots configurable
1 parent 5e5b50d commit ef2d731

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/plots/pane.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ export default class PlotPane extends PaneItem {
116116
}
117117
}
118118

119-
show (view) {
119+
show (view, {maxSize: maxSize} = {maxSize: MAX_SIZE}) {
120120
if (view) {
121121
this.ids.push(this.counter += 1)
122122
this.items.push(view)
123-
this.prune()
123+
this.prune(maxSize)
124124
this.activateItem(this.items.length - 1)
125125
}
126126
etch.update(this, false)
@@ -139,11 +139,11 @@ export default class PlotPane extends PaneItem {
139139
}
140140
}
141141

142-
prune () {
142+
prune (maxSize) {
143143
const numItems = this.items.length
144-
if (numItems <= MAX_SIZE) return
144+
if (numItems <= maxSize) return
145145

146-
const startInd = numItems - MAX_SIZE
146+
const startInd = numItems - maxSize
147147
this.items.forEach((item, ind) => {
148148
if (ind < startInd && item.teardown) {
149149
item.teardown()

0 commit comments

Comments
 (0)