Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
01cb23f5
Unverified
Commit
01cb23f5
authored
2 years ago
by
David Sehnal
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
add setFSModule (#755)
parent
fe8a9799
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
src/examples/image-renderer/index.ts
+3
-0
3 additions, 0 deletions
src/examples/image-renderer/index.ts
src/mol-util/data-source.ts
+9
-6
9 additions, 6 deletions
src/mol-util/data-source.ts
with
13 additions
and
6 deletions
CHANGELOG.md
+
1
−
0
View file @
01cb23f5
...
@@ -16,6 +16,7 @@ Note that since we don't clearly distinguish between a public and private interf
...
@@ -16,6 +16,7 @@ Note that since we don't clearly distinguish between a public and private interf
-
Add exposure parameter to renderer
-
Add exposure parameter to renderer
-
Only trigger marking when mouse is directly over canvas
-
Only trigger marking when mouse is directly over canvas
-
Fix blurry occlusion in screenshots
-
Fix blurry occlusion in screenshots
-
[breaking] Add
`setFSModule`
to
`mol-util/data-source`
instead of trying to trick WebPack
## [v3.31.4] - 2023-02-24
## [v3.31.4] - 2023-02-24
...
...
This diff is collapsed.
Click to expand it.
src/examples/image-renderer/index.ts
+
3
−
0
View file @
01cb23f5
...
@@ -19,8 +19,11 @@ import { StructureRepresentation3D } from '../../mol-plugin-state/transforms/rep
...
@@ -19,8 +19,11 @@ import { StructureRepresentation3D } from '../../mol-plugin-state/transforms/rep
import
{
HeadlessPluginContext
}
from
'
../../mol-plugin/headless-plugin-context
'
;
import
{
HeadlessPluginContext
}
from
'
../../mol-plugin/headless-plugin-context
'
;
import
{
DefaultPluginSpec
}
from
'
../../mol-plugin/spec
'
;
import
{
DefaultPluginSpec
}
from
'
../../mol-plugin/spec
'
;
import
{
STYLIZED_POSTPROCESSING
}
from
'
../../mol-plugin/util/headless-screenshot
'
;
import
{
STYLIZED_POSTPROCESSING
}
from
'
../../mol-plugin/util/headless-screenshot
'
;
import
{
setFSModule
}
from
'
../../mol-util/data-source
'
;
setFSModule
(
fs
);
interface
Args
{
interface
Args
{
pdbId
:
string
,
pdbId
:
string
,
outDirectory
:
string
outDirectory
:
string
...
...
This diff is collapsed.
Click to expand it.
src/mol-util/data-source.ts
+
9
−
6
View file @
01cb23f5
...
@@ -300,14 +300,17 @@ function ajaxGetInternal<T extends DataType>(title: string | undefined, url: str
...
@@ -300,14 +300,17 @@ function ajaxGetInternal<T extends DataType>(title: string | undefined, url: str
});
});
}
}
// NOTE: lazy imports cannot be used here because WebPack complains since this
// NOTE: a workaround for using this in Node.js
// is part of the "browser" build.
let
_fs
:
(
typeof
import
(
'
fs
'
))
|
undefined
=
undefined
;
let
_fs
:
(
typeof
import
(
'
fs
'
))
|
undefined
=
undefined
;
function
getFS
()
{
function
getFS
()
{
if
(
_fs
)
return
_fs
!
;
if
(
!
_fs
)
{
const
req
=
require
;
// To fool webpack
throw
new
Error
(
'
When running in Node.js and reading from files, call mol-util/data-source
\'
s setFSModule function first.
'
);
_fs
=
req
(
'
fs
'
);
}
return
_fs
!
;
return
_fs
;
}
export
function
setFSModule
(
fs
:
typeof
import
(
'
fs
'
))
{
_fs
=
fs
;
}
}
/** Alternative implementation of ajaxGetInternal (because xhr2 does not support file:// protocol) */
/** Alternative implementation of ajaxGetInternal (because xhr2 does not support file:// protocol) */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment