Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #19

Merged
merged 13 commits into from
Jun 9, 2024
Merged

Dev #19

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified ontology-manager-client/public/favicon.ico
Binary file not shown.
3 changes: 2 additions & 1 deletion ontology-manager-client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
content="Empowering the research on plant-derived natural products for the treatment of diseases
using an advanced data collection, exchange and analysis platform, with focus on the flora and epidemiological needs of Latin-America"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
Expand Down
Binary file modified ontology-manager-client/public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ontology-manager-client/public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions ontology-manager-client/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "One Health",
"name": "Natural One Health",
"icons": [
{
"src": "favicon.ico",
Expand Down
11 changes: 10 additions & 1 deletion ontology-manager-client/src/Style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,18 @@
max-width: 0px;
}

.page-container {
.page-container-wide {
padding-top: 30px;
padding-left: 5%;
padding-right: 5%;
padding-bottom: 30px;
}

.page-container-narrow {
padding-top: 30px;
padding-left: 15%;
padding-right: 15%;
padding-bottom: 30px;
}

.one-health-panel {
Expand Down
12 changes: 12 additions & 0 deletions ontology-manager-client/src/assets/oh_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { DataView } from 'primereact/dataview';
import { IQueryGraph } from '../../../query-history/query-history-graph/graph-query';
import { MessageServiceContext } from '../../../shared/messages';
import { dependencyFactory } from '../../../shared/injection';
import { IEntityTypeService, IGeneralSearchService, IGraphVisualizationHistoryService, SERVICES } from '../../../../services';
import { IEntityService, IEntityTypeService, IGeneralSearchService, IGraphVisualizationHistoryService, SERVICES } from '../../../../services';
import { ISavedGraphVisualization } from '../visualization-history/models/saved-graph-visualization';
import { ConfirmDialog, confirmDialog } from 'primereact/confirmdialog';
import { Divider } from 'primereact/divider';
Expand All @@ -30,6 +30,7 @@ import { IconField } from "primereact/iconfield";
import { InputIcon } from "primereact/inputicon";
import { IEntityType } from '../../metadata/entity-types';
import { Checkbox } from 'primereact/checkbox';
import * as XLSX from 'xlsx';


const React = require('react');
Expand Down Expand Up @@ -62,6 +63,7 @@ const NeighborhoodExplorerComponent: React.FC<GraphExplorerProps> = ({graphServi


const myComponentRef : RefObject<CytoscapeInteractiveChartComponent> = useRef<CytoscapeInteractiveChartComponent>(null);
const entityService = dependencyFactory.get<IEntityService>(SERVICES.IEntityService);


const [elements, setElements] = useState<any>([]);
Expand Down Expand Up @@ -134,6 +136,20 @@ const NeighborhoodExplorerComponent: React.FC<GraphExplorerProps> = ({graphServi
)

const downloadOptions = [
{
label: 'XLXS',
command: async () => {

const results = await entityService.getGraphReferences(myComponentRef.current!.getNodes(), messageService!);


const ws = XLSX.utils.json_to_sheet(results);
const wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
XLSX.writeFile(wb, 'co-ocurrences.xlsx');

}
},
{
label: 'Cytoscape JSON',
command: () => {
Expand Down Expand Up @@ -463,6 +479,8 @@ const NeighborhoodExplorerComponent: React.FC<GraphExplorerProps> = ({graphServi
onClick={ async (e) => {
const elements = myComponentRef.current!.getElements();



savedVisualization = {
id: "",
name: "Untitled",
Expand All @@ -484,6 +502,17 @@ const NeighborhoodExplorerComponent: React.FC<GraphExplorerProps> = ({graphServi
model={downloadOptions}
tooltip="Download graph"
tooltipOptions={{position: 'bottom', showDelay: 1000}}
onClick={async () => {

const results = await entityService.getGraphReferences(myComponentRef.current!.getNodes(), messageService!);


const ws = XLSX.utils.json_to_sheet(results);
const wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
XLSX.writeFile(wb, 'co-ocurrences.xlsx');

}}

/>
</div>
Expand Down
16 changes: 0 additions & 16 deletions ontology-manager-client/src/features/pages/contact.component.tsx

This file was deleted.

This file was deleted.

49 changes: 0 additions & 49 deletions ontology-manager-client/src/features/pages/home-component.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions ontology-manager-client/src/features/pages/index.ts

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ class CytoscapeInteractiveChartComponent extends Component<CytoscapeInteractiveC
})
}

getNodes() {
const nodes = this.cytoscapeCore.elements().jsons()
.filter((x:any) => x.group==="nodes" && x.data.id !== HIGHLIGHT)
.map((x:any) => x.data.id);
return nodes;
}

getElements() {
const elements = this.cytoscapeCore.json().elements;
return JSON.stringify(elements);
Expand Down
2 changes: 1 addition & 1 deletion ontology-manager-client/src/layout/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

.content {
background-color: white;
padding-top: $app-header-height + 30px;
padding-top: $app-header-height;
padding-bottom: 80px;
max-width: 1920px;
flex: 1;
Expand Down
3 changes: 3 additions & 0 deletions ontology-manager-client/src/layout/footer.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@
position: fixed;
bottom: 0;
z-index: 1000;
width: 100%;
padding: 10px;
margin: 0;
}
Loading
Loading