Skip to content

Commit

Permalink
Merge pull request #30 from cytoscape/development
Browse files Browse the repository at this point in the history
v1.2 release.
  • Loading branch information
keiono authored Jul 22, 2021
2 parents 114f196 + 311ba48 commit b0609df
Show file tree
Hide file tree
Showing 29 changed files with 4,911 additions and 3,639 deletions.
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@
"react-ga": "^2.5.7",
"react-google-login": "^5.0.4",
"react-linkify": "^1.0.0-alpha",
"react-map-interaction": "^2.0.0",
"react-redux": "^7.1.0",
"react-router-dom": "^5.0.1",
"react-split": "^2.0.4",
"react-zoom-pan-pinch": "^2.0.2",
"redux": "^4.0.4",
"redux-actions": "^2.6.5",
"redux-saga": "^1.1.1",
Expand Down Expand Up @@ -68,7 +70,9 @@
"test": "react-scripts test",
"eject": "react-scripts eject",
"predeploy": "yarn build",
"deploy": "gh-pages -d build"
"deploy": "gh-pages -d build",
"devdeploy": "scp -r `pwd`/build/* ec2-user@search-dev.ndexbio.org:/var/www/html/",
"stagedeploy": "scp -r `pwd`/build/* ec2-user@search-staging.ndexbio.org:/var/www/search-staging.ndexbio.org/html/"
},
"eslintConfig": {
"extends": "react-app",
Expand All @@ -81,5 +85,6 @@
"not dead",
"not ie <= 11",
"not op_mini all"
]
],
"homepage": "./"
}
57 changes: 32 additions & 25 deletions src/actions/uiState.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,52 @@
import { createAction } from 'redux-actions'
import { createAction } from 'redux-actions';

/**
* Global state for the application UI
*
* @type {string}
*/
export const SET_SETTINGS_OPEN = 'SET_SETTINGS_OPEN'
export const setSettingsOpen = createAction(SET_SETTINGS_OPEN)
export const SET_SETTINGS_OPEN = 'SET_SETTINGS_OPEN';
export const setSettingsOpen = createAction(SET_SETTINGS_OPEN);

export const SET_CYTOSCAPE_STATUS = 'SET_CYTOSCAPE_STATUS'
export const setCytoscapeStatus = createAction(SET_CYTOSCAPE_STATUS)
export const SET_CYTOSCAPE_STATUS = 'SET_CYTOSCAPE_STATUS';
export const setCytoscapeStatus = createAction(SET_CYTOSCAPE_STATUS);

export const SET_SERVICES_LIST_OPEN = 'SET_SERVICES_LIST_OPEN'
export const setServicesListOpen = createAction(SET_SERVICES_LIST_OPEN)
export const SET_SERVICES_LIST_OPEN = 'SET_SERVICES_LIST_OPEN';
export const setServicesListOpen = createAction(SET_SERVICES_LIST_OPEN);

export const SET_HIGHLIGHTS = 'SET_HIGHLIGHTS'
export const setHighlights = createAction(SET_HIGHLIGHTS)
export const SET_HIGHLIGHTS = 'SET_HIGHLIGHTS';
export const setHighlights = createAction(SET_HIGHLIGHTS);

// Selected tab
export const SET_SELECTED_SOURCE = 'SET_SELECTED_SOURCE'
export const setSelectedSource = createAction(SET_SELECTED_SOURCE)
export const SET_SELECTED_SOURCE = 'SET_SELECTED_SOURCE';
export const setSelectedSource = createAction(SET_SELECTED_SOURCE);

export const SET_PATHWAY_FIGURE = 'SET_PATHWAY_FIGURE';
export const setPathwayFigure = createAction(SET_PATHWAY_FIGURE);
export const SET_PATHWAY_FIGURE_SOURCE = 'SET_PATHWAY_FIGURE_SOURCE';
export const setPathwayFigureSource = createAction(SET_PATHWAY_FIGURE_SOURCE);
export const SET_FIT_PATHWAY_FIGURE = 'SET_FIT_PATHWAY_FIGURE';
export const setFitPathwayFigure = createAction(SET_FIT_PATHWAY_FIGURE);

// Sort settings
export const SET_SORT_OPTIONS = 'SET_SORT_OPTIONS'
export const SET_SORT_BY = 'SET_SORT_BY'
export const setSortOptions = createAction(SET_SORT_OPTIONS)
export const setSortBy = createAction(SET_SORT_BY)
export const SET_SORT_OPTIONS = 'SET_SORT_OPTIONS';
export const SET_SORT_BY = 'SET_SORT_BY';
export const setSortOptions = createAction(SET_SORT_OPTIONS);
export const setSortBy = createAction(SET_SORT_BY);

//Layout
export const SET_LAYOUT = 'SET_LAYOUT'
export const SET_LAYOUTS = 'SET_LAYOUTS'
export const setLayout = createAction(SET_LAYOUT)
export const setLayouts = createAction(SET_LAYOUTS)
export const SET_LAYOUT = 'SET_LAYOUT';
export const SET_LAYOUTS = 'SET_LAYOUTS';
export const setLayout = createAction(SET_LAYOUT);
export const setLayouts = createAction(SET_LAYOUTS);

//Annotations
export const SET_ANNOTATIONS = 'SET_ANNOTATIONS'
export const setAnnotations = createAction(SET_ANNOTATIONS)
export const SET_ANNOTATIONS = 'SET_ANNOTATIONS';
export const setAnnotations = createAction(SET_ANNOTATIONS);

//Fit
export const FIT_NETWORK_VIEW = 'FIT_NETWORK_VIEW'
export const fitNetworkView = createAction(FIT_NETWORK_VIEW)
export const FIT_NETWORK_VIEW = 'FIT_NETWORK_VIEW';
export const fitNetworkView = createAction(FIT_NETWORK_VIEW);

export const UPDATE = 'UPDATE'
export const update = createAction(UPDATE)
export const UPDATE = 'UPDATE';
export const update = createAction(UPDATE);
21 changes: 16 additions & 5 deletions src/api/apiConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,36 @@ export const METHOD_POST = 'POST';
export const METHOD_GET = 'GET';

/* public */

/*
//Server URL
export const SERVICE_SERVER_URL = 'http://public.ndexbio.org/';
export const SERVICE_SERVER_URL = 'https://public.ndexbio.org/';
//Its endpoint
export const BASE_URL = SERVICE_SERVER_URL + 'integratedsearch/v1/';
//Save to NDEx google SSO client ID
export const GOOGLE_CLIENT_ID =
'802839698598-8rsr8va0bd0e6lmi0ghemtrvldk9rnla.apps.googleusercontent.com';
*/
/* test */
/*
//Server URL
export const SERVICE_SERVER_URL = 'https://test.ndexbio.org/';
//Its endpoint
export const BASE_URL = SERVICE_SERVER_URL + 'integratedsearch/v1/';
//Save to NDEx google SSO client ID
export const GOOGLE_CLIENT_ID =
'802839698598-shh458t46bo9v2v5iolcvk1h443hid6n.apps.googleusercontent.com';
*/

/* dev */
/*

//Server URL
export const SERVICE_SERVER_URL = 'http://dev.ndexbio.org/';
export const SERVICE_SERVER_URL = 'https://dev.ndexbio.org/';
//Its endpoint
export const BASE_URL = SERVICE_SERVER_URL + 'integratedsearch/v1/';
//Save to NDEx google SSO client ID
export const GOOGLE_CLIENT_ID =
'802839698598-mrrd3iq3jl06n6c2fo1pmmc8uugt9ukq.apps.googleusercontent.com';
*/

/* local */
/*
//Server URL
Expand Down
2 changes: 1 addition & 1 deletion src/api/mygene.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { METHOD_POST } from './apiConstants'

const MYGENE_BASE_URL = 'http://mygene.info/v3/query'
const MYGENE_BASE_URL = 'https://mygene.info/v3/query'

/**
* Client for MyGene.info
Expand Down
7 changes: 6 additions & 1 deletion src/components/InputPanel/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,18 @@ const InputPanel = (props) => {
}
}
}

return (
<div className='input-container'>
<div className='input-wrapper'>
<div className={'gene-list-title'}>
Query Genes{' '}
{props.search.results && props.search.results.genes
? '(' + props.search.results.genes.size + ')'
? '(' +
props.network.hitGenes.length +
'/' +
props.search.results.genes.size +
')'
: null}
</div>
<GeneList geneToNodeMap={geneToNodeMap} {...props} />
Expand Down
83 changes: 48 additions & 35 deletions src/components/Results/CytoscapeViewer/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ const CytoscapeViewer = (props) => {
animate: false,
positions: function(node) {
const id = node[0]._private.data.id;
const analog = originalElements.filter((elem) => {
return elem.data.id.toString() === id.toString();
});
const analog = originalElements
? originalElements.filter((elem) => {
return elem.data.id.toString() === id.toString();
})
: [{ position: null }];
const position = analog[0].position;
return position;
},
Expand Down Expand Up @@ -206,7 +208,6 @@ const CytoscapeViewer = (props) => {
resolve();
}).then(() => {
props.uiStateActions.update({
highlights: true,
layouts: propLayouts,
layout: propLayout,
});
Expand All @@ -230,31 +231,39 @@ const CytoscapeViewer = (props) => {
const selected = cyInstance.elements('node[name = "' + targets[0] + '"]');

if (selected.length !== 0) {
cyInstance.animate(
{
zoom: 2,
center: {
eles: selected[0],
try {
cyInstance.animate(
{
zoom: 2,
center: {
eles: selected[0],
},
},
},
{
duration: 500,
}
);
{
duration: 500,
}
);
} catch (err) {
console.log('Caught cyInstance animate error ', err);
}
}

if (targets.length === 0) {
cyInstance.animate(
{
fit: {
eles: cyInstance.elements(),
padding: 6,
try {
cyInstance.animate(
{
fit: {
eles: cyInstance.elements(),
padding: 6,
},
},
},
{
duration: 500,
}
);
{
duration: 500,
}
);
} catch (err) {
console.log('Caught cyInstance animate error', err);
}
}
}, [props.search.selectedGenes]);

Expand Down Expand Up @@ -292,7 +301,7 @@ const CytoscapeViewer = (props) => {
}
}, [props.uiState.layout]);

if (originalElements.length > MAX_NETWORK_SIZE) {
if (originalElements && originalElements.length > MAX_NETWORK_SIZE) {
return <Warning {...props} />;
}

Expand All @@ -314,17 +323,21 @@ const CytoscapeViewer = (props) => {
if (layout === COSE_LAYOUT || layout === CONCENTRIC_LAYOUT) {
layout.stop = () => {
setTimeout(() => {
cyInstance.animate(
{
fit: {
eles: cyInstance.elements(),
padding: 6,
try {
cyInstance.animate(
{
fit: {
eles: cyInstance.elements(),
padding: 6,
},
},
},
{
duration: 0,
}
);
{
duration: 0,
}
);
} catch (err) {
console.log('Caught cyInstance animate error ', err);
}
}, 0);
};
}
Expand Down
1 change: 1 addition & 0 deletions src/components/Results/Empty.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const Empty = props => (
<div className="results-container">
<div className="message">
<Typography variant="h3">{props.message}</Typography>
{ props.details && <Typography variant="h4">{props.details}</Typography>}
</div>
</div>
)
Expand Down
37 changes: 23 additions & 14 deletions src/components/Results/HoverTab.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
import React from 'react'
import Tab from '@material-ui/core/Tab'
import { withStyles } from '@material-ui/core/styles'
import React from 'react';
import Tab from '@material-ui/core/Tab';
import { withStyles } from '@material-ui/core/styles';
import { Tooltip } from '@material-ui/core';

const HoverTab = props => {
//const { backgroundColor, ...other } = props

const Hover = withStyles(theme => ({
const HoverTab = (props) => {
const Hover = withStyles((theme) => ({
root: {
minHeight: props.minheight,
height: props.height,
'&:hover': {
backgroundColor: props.backgroundcolor,
opacity: 1
}
}
}))(props => <Tab {...props} />)
return <Hover {...props} />
}
opacity: 1,
},
},
}))((props) =>
props.tooltip ? (
<Tooltip title={props.tooltip}>
<Tab {...props} />
</Tooltip>
) : (
<Tab {...props} />
)
);
return <Hover {...props} />;
};

export default HoverTab
export default HoverTab;
3 changes: 2 additions & 1 deletion src/components/Results/Ndex/InfoModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const iconStyle = {
height: '0.7em',
width: '0.7em',
position: 'relative',
bottom: '2px'
bottom: '2px',
color: '#3576BE'
}

const PaperComponent = props => {
Expand Down
3 changes: 2 additions & 1 deletion src/components/Results/Ndex/NetworkList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const NetworkList = (props) => {
first.hitGenes
);
if (first.url != null) {
props.networkActions.setOriginalNetworkUrl('http://' + first.url);
props.networkActions.setOriginalNetworkUrl('https://' + first.url);
}
} else {
props.networkActions.networkClear();
Expand Down Expand Up @@ -194,6 +194,7 @@ const NetworkList = (props) => {

function handleListItemClick(event, index) {
props.networkActions.changeListIndex(index);
props.uiStateActions.setPathwayFigure(true);
}

const selectedIndex = props.network.listIndex;
Expand Down
Loading

0 comments on commit b0609df

Please sign in to comment.