10BC0 Vtk/vtk improvements by xavArtley · Pull Request #2826 · holoviz/panel · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
dead code, bokeh define syntax, code formatting
  • Loading branch information
xavArtley committed Oct 15, 2021
commit adb1d94332e3ddf51d37973a4f4545b405e16028
30 changes: 10 additions & 20 deletions panel/models/vtk/vtksynchronized.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as p from "@bokehjs/core/properties"
import { clone } from "@bokehjs/core/util/object"
import {clone} from "@bokehjs/core/util/object"

import {AbstractVTKView, AbstractVTKPlot} from "./vtklayout"

Expand All @@ -16,7 +16,6 @@ export class VTKSynchronizedPlotView extends AbstractVTKView {
protected _decoded_arrays: any
protected _pending_arrays: any
protected _promises: Promise<any>[]
public getArray: CallableFunction
public registerArray: CallableFunction

initialize(): void {
Expand All @@ -26,16 +25,7 @@ export class VTKSynchronizedPlotView extends AbstractVTKView {
this._arrays = {}
this._decoded_arrays = {}
this._pending_arrays = {}
// Internal closures
this.getArray = (hash: string) => {
if (this._arrays[hash]) {
return Promise.resolve(this._arrays[hash])
}

return new Promise((resolve, reject) => {
this._pending_arrays[hash] = {resolve, reject}
})
}

this.registerArray = (hash: string, array: any) => {
this._arrays[hash] = array
Expand Down Expand Up @@ -106,7 +96,7 @@ export class VTKSynchronizedPlotView extends AbstractVTKView {
.loadAsync(atob(arrays[key]))
.then((zip: any) => zip.file("data/" + key))
.then((zipEntry: any) => zipEntry.async("arraybuffer"))
.then((arraybuffer: any) => registerArray(key, arraybuffer))
.then((arraybuffer: any) => registerArray(key, arraybuffer))
.then(() => {
arrays_processed.push(key)
model.properties.arrays_processed.change.emit()
Expand Down Expand Up @@ -200,14 +190,14 @@ export class VTKSynchronizedPlot extends AbstractVTKPlot {
static init_VTKSynchronizedPlot(): void {
this.prototype.default_view = VTKSynchronizedPlotView

this.define<VTKSynchronizedPlot.Props>({
arrays: [ p.Any, {} ],
arrays_processed: [ p.Array, [] ],
enable_keybindings: [ p.Boolean, false ],
one_time_reset: [ p.Boolean ],
rebuild: [ p.Boolean, false ],
scene: [ p.Any, {} ],
})
this.define<VTKSynchronizedPlot.Props>(({Any, Array, Boolean, String}) => ({
arrays: [ Any, {} ],
arrays_processed: [ Array(String), [] ],
enable_keybindings: [ Boolean, false ],
one_time_reset: [ Boolean ],
rebuild: [ Boolean, false ],
scene: [ Any, {} ],
}))

this.override<VTKSynchronizedPlot.Props>({
height: 300,
Expand Down
0