Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
7d4c8790
Commit
7d4c8790
authored
Aug 27, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[graph] correctly make screenshot of multiple canvases in sigma
parent
8ba2cb0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
Button.purs
src/Gargantext/Components/GraphExplorer/Button.purs
+0
-1
Sigma.js
src/Gargantext/Hooks/Sigmax/Sigma.js
+7
-1
No files found.
src/Gargantext/Components/GraphExplorer/Button.purs
View file @
7d4c8790
...
...
@@ -55,7 +55,6 @@ cameraButton session id sigmaRef = simpleButton {
let sigma = R.readRef sigmaRef
Sigmax.dependOnSigma sigma "[cameraButton] sigma: Nothing" $ \s -> do
screen <- Sigma.takeScreenshot s
log2 "[cameraButton] screenshot" screen
launchAff_ $ do
uploadArbitraryDataURL session id (Just "screenshot.png") screen
, text: "Screenshot"
...
...
src/Gargantext/Hooks/Sigmax/Sigma.js
View file @
7d4c8790
...
...
@@ -191,7 +191,13 @@ function bindMouseSelectorPlugin(left, right, sig) {
function
bind
(
sigma
,
event
,
handler
)
{
sigma
.
bind
(
event
,
handler
);
}
function
takeScreenshot
(
sigma
)
{
return
sigma
.
renderers
[
0
].
container
.
lastChild
.
toDataURL
();
let
c
=
sigma
.
renderers
[
0
].
container
;
let
edges
=
c
.
getElementsByClassName
(
'sigma-edges'
)[
0
];
let
scene
=
c
.
getElementsByClassName
(
'sigma-scene'
)[
0
];
let
sceneCtx
=
scene
.
getContext
(
'2d'
);
sceneCtx
.
globalAlpha
=
1
;
sceneCtx
.
drawImage
(
edges
,
0
,
0
);
return
scene
.
toDataURL
(
'image/png'
);
}
exports
.
_sigma
=
_sigma
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment