gramene-search 1.6.32 → 1.6.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gramene-search",
3
- "version": "1.6.32",
3
+ "version": "1.6.34",
4
4
  "description": "search wrapper for gramene",
5
5
  "source": "src/index.js",
6
6
  "main": "dist/index.js",
@@ -35,6 +35,7 @@ const Detail = props => {
35
35
  const [atlasExperiment, setAtlasExperiment] = useState(null);
36
36
  const [atlasExperimentList, setAtlasExperimentList] = useState([]);
37
37
  const [isLocal, setIsLocal] = useState(false);
38
+ const [activeTab, setActiveTab] = useState('gene');
38
39
 
39
40
  const handleLocalAPIChange = (event) => {
40
41
  setIsLocal(event.target.checked);
@@ -45,7 +46,11 @@ const Detail = props => {
45
46
  let eList = props.expressionStudies[tid];
46
47
  if (props.searchResult.hasOwnProperty('expressed_in_gxa_attr_ss')) {
47
48
  const in_gxa = new Set(props.searchResult.expressed_in_gxa_attr_ss);
48
- eList = props.expressionStudies[tid].filter(e => in_gxa.has(e._id));
49
+ eList = props.expressionStudies[tid].filter(e => in_gxa.has(e._id)).sort((a,b) => {
50
+ const a_name = `${a.type}:${a.description || a._id}`;
51
+ const b_name = `${b.type}:${b.description || b._id}`;
52
+ return a_name < b_name ? -1 : 1;
53
+ })
49
54
  }
50
55
  setAtlasExperimentList(eList);
51
56
 
@@ -73,7 +78,7 @@ const Detail = props => {
73
78
  if (paralogs.length > 1 && atlasExperiment) {
74
79
  paralogs_url= `https://dev.gramene.org/static/atlasWidget.html?genes=${paralogs.join(' ')}&experiment=${atlasExperiment}&localAPI=${isLocal}`;
75
80
  }
76
- return <Tabs>
81
+ return <Tabs activeKey={activeTab} onSelect={(k) => setActiveTab(k)}>
77
82
  {paralogs_url &&
78
83
  <Tab tabClassName="gxa" eventKey="paralogs" title={`Paralogs`} key="gxaparalogs">
79
84
  <Form.Select aria-label='experiment selector'
@@ -83,7 +88,7 @@ const Detail = props => {
83
88
  <option key={idx} value={e._id}>{e.type}: {e.description || e._id}</option>
84
89
  )}
85
90
  </Form.Select>
86
- <DynamicIframe url={paralogs_url}/>
91
+ {activeTab === "paralogs" && <DynamicIframe url={paralogs_url}/> }
87
92
  </Tab>
88
93
  }
89
94
  <Tab tabClassName="gxa" eventKey="gene" title="All Studies" key="gxa">
@@ -94,7 +99,7 @@ const Detail = props => {
94
99
  {/* checked={isLocal}*/}
95
100
  {/* onChange={handleLocalAPIChange}*/}
96
101
  {/*/>*/}
97
- <DynamicIframe url={gene_url}/>
102
+ {activeTab === "gene" && <DynamicIframe url={gene_url}/> }
98
103
  </Tab>
99
104
  {haveBAR(gene) &&
100
105
  <Tab tabClassName="eFP" eventKey="eFP" title="eFP Browser" key="bar"><BAR gene={gene}/></Tab>