Add clear chart button and improve chart menu look&feel

This commit is contained in:
Thomas Nordquist
2019-07-17 12:59:25 +02:00
parent 1c52aced63
commit 8ae1528064
10 changed files with 122 additions and 48 deletions

View File

@@ -1,15 +1,15 @@
interface Lengthwise {
export interface MemoryConsumptionExpressedByLength {
length: number
}
export class RingBuffer<T extends Lengthwise> {
private capacity: number
private maxItems: number
export class RingBuffer<T extends MemoryConsumptionExpressedByLength> {
public capacity: number
public maxItems: number
public compactionFactor: number
protected items: Array<T> = []
protected start: number = 0
protected end: number = 0
private usage: number = 0
private items: Array<T> = []
private start: number = 0
private end: number = 0
private compactionFactor: number
constructor(capacity: number, maxItems = Infinity, compactionFactor: number = 10, ringBuffer?: RingBuffer<T>) {
this.capacity = capacity

View File

@@ -52,10 +52,6 @@ export class TreeNode<ViewModel extends Destroyable> {
return this.sourceEdge ? this.sourceEdge.source || undefined : undefined
}
public hasMessage() {
return this.message && this.message.value && this.message.value.length !== 0
}
private isTopicEmptyLeaf() {
return !this.hasMessage() && this.isLeaf()
}
@@ -108,6 +104,10 @@ export class TreeNode<ViewModel extends Destroyable> {
}
}
public hasMessage() {
return this.message && this.message.value && this.message.value.length !== 0
}
public destroy() {
this.onDestroy.dispatch(this)
this.onDestroy.removeAllListeners()