Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 1 addition & 10 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@
"vee-validate": "^2.2.15",
"vue": "^2.6.10",
"vue-router": "^3.4.3",
"vuex": "^3.5.1",
"zlibjs": "^0.1.7"
"vuex": "^3.5.1"
},
"engines": {
"node": "^18.0.0"
Expand Down
13 changes: 7 additions & 6 deletions client/src/js/modules/dc/views/mapmodelview.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
define(['marionette',
'uglymol', 'gzip',
'uglymol',
'modules/dc/collections/downstreams',
'modules/dc/collections/dimplepeaks',
'modules/dc/views/dimplepeaktable',
'templates/dc/mapmodelview.html',
"./uglymolhelper"
], function(Marionette, Uglymol, zlib,
], function(Marionette, Uglymol,
DownStreams, DIMPLEPeaks, DIMPLEPeakTable, template, defaultViewerOptions) {

return Marionette.LayoutView.extend({
Expand Down Expand Up @@ -42,14 +42,15 @@ define(['marionette',
doLoadMaps: function(id, cb) {
var self = this
var xhr = this.xhrWithStatus('Downloading Map '+id)
xhr.onload = function() {
xhr.onload = async function() {
if (xhr.status == 0 || xhr.status != 200) {
this.onerror(xhr.status)

} else {
var gunzip = new zlib.Zlib.Gunzip(new Uint8Array(this.response))
var plain = gunzip.decompress()
self.viewer.load_map_from_buffer(plain.buffer, { format: 'ccp4', diff_map: id == 2 })
const ds = new DecompressionStream('gzip')
const stream = new Response(this.response).body.pipeThrough(ds)
const plain = await new Response(stream).arrayBuffer()
self.viewer.load_map_from_buffer(plain, { format: 'ccp4', diff_map: id == 2 })
}

self.mapsLoaded++
Expand Down
19 changes: 9 additions & 10 deletions client/src/js/modules/dc/views/reciprocalview.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
define(['marionette',
'collections/attachments',
'uglymol', 'gzip',
'uglymol',
'templates/dc/mapmodelview.html',
"./uglymolhelper"], function(Marionette, Attachments, Uglymol, zlib,
"./uglymolhelper"], function(Marionette, Attachments, Uglymol,
template, defaultViewerOptions) {

return Marionette.LayoutView.extend({
Expand All @@ -23,7 +23,6 @@ define(['marionette',
res: 'select[name=residue]',
},


loadData: function() {
if (!this.attachments.length) {
this.ui.hud.text('No reciprocal space data for this datacollection')
Expand All @@ -32,14 +31,14 @@ define(['marionette',

var xhr = this.xhrWithStatus('Downloading Reciprocal Space Data')
var self = this

xhr.onload = function() {
var gunzip = new zlib.Zlib.Gunzip(new Uint8Array(this.response))
var plain = gunzip.decompress()
var url = URL.createObjectURL(new Blob([plain], {type: 'text'}))

xhr.onload = async function () {
const ds = new DecompressionStream('gzip')
const stream = new Response(this.response).body.pipeThrough(ds)
const plain = await new Response(stream).arrayBuffer()
const url = URL.createObjectURL(new Blob([plain], {type: 'text'}))
self.viewer.load_data(url)
}


var attachment = this.attachments.at(0)
xhr.open('GET', app.apiurl+'/download/attachment/id/'+this.model.get('ID')+'/aid/'+attachment.get('DATACOLLECTIONFILEATTACHMENTID'))
Expand Down Expand Up @@ -76,4 +75,4 @@ define(['marionette',
})


})
})
4 changes: 0 additions & 4 deletions client/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ module.exports = (env, argv) => ({
// heatmap in npm has dependency on canvas/node-gyp... so use old one for now
heatmap: 'vendor/hmap',

// gunzip is actually the zlib library
// https://npm.taobao.org/package/zlibjs
gzip: 'zlibjs/bin/gunzip.min',

markdown: 'markdown/lib/markdown',

// Vue packages from npm (vee-validate requires promise polyfill - also npm)
Expand Down
Loading