Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
b3617d72
Commit
b3617d72
authored
12 years ago
by
cramakri
Browse files
Options
Downloads
Patches
Plain Diff
LMS-2881 Refactored toggleDisplayedVisualizations.
SVN: 24941
parent
0f144f69
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
eu_basynthec/source/html/browser/basynthec-browser.js
+46
-17
46 additions, 17 deletions
eu_basynthec/source/html/browser/basynthec-browser.js
with
46 additions
and
17 deletions
eu_basynthec/source/html/browser/basynthec-browser.js
+
46
−
17
View file @
b3617d72
...
@@ -53,11 +53,15 @@ StrainWrapper.prototype = new AbstractThingWrapper();
...
@@ -53,11 +53,15 @@ StrainWrapper.prototype = new AbstractThingWrapper();
StrainWrapper
.
prototype
.
constructor
=
StrainWrapper
;
StrainWrapper
.
prototype
.
constructor
=
StrainWrapper
;
StrainWrapper
.
prototype
.
isStrain
=
function
()
{
return
true
;
}
StrainWrapper
.
prototype
.
isStrain
=
function
()
{
return
true
;
}
var
presenterModeTypeDataSet
=
"
DATA_SET
"
,
presenterModeTypeStrain
=
"
STRAIN
"
;
/**
/**
* An object responsible for managing the view
* An object responsible for managing the view
*/
*/
function
AppPresenter
()
{
function
AppPresenter
()
{
this
.
didCreateVis
=
false
;
this
.
didCreateVis
=
false
;
this
.
presenterMode
=
presenterModeTypeDataSet
;
this
.
visualizationContainers
=
[];
}
}
/** Hides the explanation and shows the element to display the explanation again */
/** Hides the explanation and shows the element to display the explanation again */
...
@@ -75,39 +79,47 @@ AppPresenter.prototype.showExplanation = function() {
...
@@ -75,39 +79,47 @@ AppPresenter.prototype.showExplanation = function() {
/** Show the data sets grouped by type */
/** Show the data sets grouped by type */
AppPresenter
.
prototype
.
switchToDataSetTypeView
=
function
()
AppPresenter
.
prototype
.
switchToDataSetTypeView
=
function
()
{
{
this
.
presenterMode
=
presenterModeTypeDataSet
;
this
.
hideExplanation
();
this
.
hideExplanation
();
this
.
toggleDisplayedVisualizations
(
dataSetTypeVis
,
strainVis
);
this
.
toggleDisplayedVisualizations
(
dataSetTypeVis
);
inspectorView
.
updateView
();
}
}
/** Show the data sets by strain*/
/** Show the data sets by strain*/
AppPresenter
.
prototype
.
switchToStrainView
=
function
()
AppPresenter
.
prototype
.
switchToStrainView
=
function
()
{
{
this
.
presenterMode
=
presenterModeTypeDataSet
;
this
.
hideExplanation
();
this
.
hideExplanation
();
this
.
toggleDisplayedVisualizations
(
strainVis
,
dataSetTypeVis
);
this
.
toggleDisplayedVisualizations
(
strainVis
);
inspectorView
.
updateView
();
}
}
/** Show the data sets by strains with OD600 data*/
/** Show the data sets by strains with OD600 data*/
AppPresenter
.
prototype
.
switchToOD600View
=
function
()
AppPresenter
.
prototype
.
switchToOD600View
=
function
()
{
{
this
.
presenterMode
=
presenterModeTypeStrain
;
this
.
hideExplanation
();
this
.
hideExplanation
();
this
.
toggleDisplayedVisualizations
(
strainVis
,
dataSetTypeVis
);
this
.
toggleDisplayedVisualizations
(
strainVis
);
inspectorView
.
removeAll
(
250
);
}
}
/** Utility function to gracefully switch from one visualization to another */
/** Utility function to gracefully switch from one visualization to another */
AppPresenter
.
prototype
.
toggleDisplayedVisualizations
=
function
(
visToShow
,
visToHide
)
AppPresenter
.
prototype
.
toggleDisplayedVisualizations
=
function
(
visToShow
)
{
{
// TODO: Only include visToShow and hide all other visualizations, since we know what they are
this
.
visualizationContainers
.
forEach
(
function
(
vis
)
{
visToShow
if
(
vis
==
visToShow
)
{
.
style
(
"
display
"
,
"
inline
"
)
vis
.
style
(
"
display
"
,
"
inline
"
)
.
transition
()
.
transition
()
.
duration
(
1000
)
.
duration
(
1000
)
.
style
(
"
opacity
"
,
1
);
.
style
(
"
opacity
"
,
1
);
}
else
{
visToHide
vis
.
transition
()
.
transition
()
.
duration
(
1000
)
.
duration
(
1000
)
.
style
(
"
opacity
"
,
0
)
.
style
(
"
opacity
"
,
0
)
.
style
(
"
display
"
,
"
none
"
);
.
style
(
"
display
"
,
"
none
"
)
}
});
}
}
/**
/**
...
@@ -182,6 +194,8 @@ AppPresenter.prototype.createVis = function()
...
@@ -182,6 +194,8 @@ AppPresenter.prototype.createVis = function()
strainVis
.
style
(
"
width
"
,
w
+
"
px
"
);
strainVis
.
style
(
"
width
"
,
w
+
"
px
"
);
strainView
=
new
StrainView
();
strainView
=
new
StrainView
();
this
.
visualizationContainers
=
[
dataSetTypeVis
,
strainVis
];
inspectorView
=
new
InspectorView
();
inspectorView
=
new
InspectorView
();
this
.
didCreateVis
=
true
;
this
.
didCreateVis
=
true
;
...
@@ -189,7 +203,12 @@ AppPresenter.prototype.createVis = function()
...
@@ -189,7 +203,12 @@ AppPresenter.prototype.createVis = function()
AppPresenter
.
prototype
.
updateInspectors
=
function
(
duration
)
AppPresenter
.
prototype
.
updateInspectors
=
function
(
duration
)
{
{
inspectorView
.
updateView
(
duration
);
if
(
this
.
presenterMode
==
presenterModeTypeDataSet
)
{
inspectorView
.
updateView
(
duration
);
}
else
{
// Do nothing.
}
}
}
/** Download a file referenced in a table. */
/** Download a file referenced in a table. */
...
@@ -607,6 +626,16 @@ InspectorView.prototype.updateView = function(duration)
...
@@ -607,6 +626,16 @@ InspectorView.prototype.updateView = function(duration)
.
remove
();
.
remove
();
}
}
/** Removes all nodes from the view, without affecting the model */
InspectorView
.
prototype
.
removeAll
=
function
(
duration
)
{
var
inspector
=
inspectors
.
selectAll
(
"
div.inspector
"
).
data
([]);
inspector
.
exit
().
transition
()
.
duration
(
duration
)
.
style
(
"
opacity
"
,
"
0
"
)
.
remove
();
}
function
dataSetLabel
(
d
)
{
return
d
.
bis
.
dataSetTypeCode
+
"
registered on
"
+
timeformat
(
new
Date
(
d
.
bis
.
registrationDetails
.
registrationDate
));
}
function
dataSetLabel
(
d
)
{
return
d
.
bis
.
dataSetTypeCode
+
"
registered on
"
+
timeformat
(
new
Date
(
d
.
bis
.
registrationDetails
.
registrationDate
));
}
function
downloadTableFile
(
d
)
{
presenter
.
downloadTableFile
(
d
)
}
function
downloadTableFile
(
d
)
{
presenter
.
downloadTableFile
(
d
)
}
...
...
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