Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Salam-Dalloul committed May 15, 2024
2 parents 95aff1d + 784e922 commit e042665
Show file tree
Hide file tree
Showing 25 changed files with 927 additions and 262 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: psf/black@stable
with:
src: "./applications/visualizer/backend"
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build Frontend

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 21.7
- name: Install dependencies
working-directory: applications/visualizer/frontend
run: yarn install --frozen-lockfile
- name: Build App
working-directory: applications/visualizer/frontend
run: npm run build
6 changes: 3 additions & 3 deletions applications/visualizer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ ENV APP_DIR=/app
WORKDIR ${APP_DIR}
COPY frontend/package.json ${APP_DIR}
COPY frontend/yarn.lock ${APP_DIR}
RUN yarn install --production --frozen-lockfile
RUN yarn install --frozen-lockfile

COPY frontend ${APP_DIR}
RUN npm run build

#####

# FROM $CLOUDHARNESS_DJANGO
ARG NO_SOURCEMAP
FROM python:3.11

ENV MODULE_NAME=backend
ENV PORT=8080
ENV WORKERS=2
ENV APP_DIR=/usr/src/app

ENV NO_SOURCEMAP=${NO_SOURCEMAP}
ENV PRODUCTION=true

WORKDIR ${APP_DIR}
Expand Down
251 changes: 251 additions & 0 deletions applications/visualizer/api/openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
components:
schemas:
Dataset:
properties:
axes:
anyOf:
- type: object
- type: 'null'
title: Axes
collection:
maxLength: 20
title: Collection
type: string
description:
title: Description
type: string
id:
title: Id
type: string
name:
maxLength: 50
title: Name
type: string
time:
title: Time
type: number
type:
maxLength: 50
title: Type
type: string
visualTime:
title: Visual Time
type: number
required:
- id
- collection
- name
- description
- time
- visualTime
- type
title: Dataset
type: object
ErrorMessage:
properties:
detail:
title: Detail
type: string
required:
- detail
title: ErrorMessage
type: object
Input:
properties:
page:
default: 1
minimum: 1
title: Page
type: integer
title: Input
type: object
Neuron:
properties:
embryonic:
default: false
title: Embryonic
type: boolean
inhead:
default: false
title: Inhead
type: boolean
intail:
default: false
title: Intail
type: boolean
name:
title: Name
type: string
nclass:
maxLength: 30
title: Nclass
type: string
neurotransmitter:
maxLength: 10
title: Neurotransmitter
type: string
type:
maxLength: 10
title: Type
type: string
required:
- name
- nclass
- neurotransmitter
- type
title: Neuron
type: object
PagedNeuron:
properties:
count:
title: Count
type: integer
items:
items:
$ref: '#/components/schemas/Neuron'
title: Items
type: array
required:
- items
- count
title: PagedNeuron
type: object
info:
description: ''
title: C. Elegans Visualizer
version: 1.0.0
openapi: 3.1.0
paths:
/api/cells:
get:
description: Returns all the cells (neurons) from the DB
operationId: get_all_cells
parameters:
- in: query
name: page
required: false
schema:
default: 1
minimum: 1
title: Page
type: integer
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PagedNeuron'
description: OK
summary: Get All Cells
tags:
- neurons
/api/datasets:
get:
description: Returns all the datasets from the DB
operationId: get_all_datasets
parameters: []
responses:
'200':
content:
application/json:
schema:
items:
$ref: '#/components/schemas/Dataset'
title: Response
type: array
description: OK
summary: Get All Datasets
tags:
- datasets
/api/datasets/{dataset}:
get:
description: Returns a specific dataset
operationId: get_dataset
parameters:
- in: path
name: dataset
required: true
schema:
title: Dataset
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Dataset'
description: OK
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
description: Not Found
summary: Get Dataset
tags:
- datasets
/api/datasets/{dataset}/neurons:
get:
description: Returns all the neurons of a dedicated dataset
operationId: get_dataset_neurons
parameters:
- in: path
name: dataset
required: true
schema:
title: Dataset
type: string
responses:
'200':
content:
application/json:
schema:
items:
$ref: '#/components/schemas/Neuron'
title: Response
type: array
description: OK
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
description: Not Found
summary: Get Dataset Neurons
tags:
- datasets
/api/live:
get:
description: Test if application is healthy
operationId: live
parameters: []
responses:
'200':
description: OK
summary: Live
tags:
- healthcheck
/api/ping:
get:
description: test the application is up
operationId: ping
parameters: []
responses:
'200':
description: OK
summary: Ping
tags:
- healthcheck
/api/ready:
get:
description: Test if application is ready to take requests
operationId: ready
parameters: []
responses:
'200':
description: OK
summary: Ready
tags:
- healthcheck
servers: []

6 changes: 6 additions & 0 deletions applications/visualizer/frontend/additional.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare module '*.svg' {
import React = require('react');
export const ReactComponent: React.FC<React.SVGProps<SVGSVGElement>>;
const src: string;
export default src;
}
6 changes: 3 additions & 3 deletions applications/visualizer/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "c-elegans-app",
"private": true,
"version": "0.0.0",
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -25,7 +25,7 @@
"@react-three/drei": "^9.105.4",
"@react-three/fiber": "^8.16.2",
"@reduxjs/toolkit": "^2.2.3",
"@types/three": "^0.163.0",
"@types/three": "^0.164.0",
"file-saver": "^2.0.5",
"react": "^18.2.0",
"react-color": "^2.19.3",
Expand All @@ -47,4 +47,4 @@
"typescript": "^5.2.2",
"vite": "^5.2.0"
}
}
}
7 changes: 5 additions & 2 deletions applications/visualizer/frontend/settings/threeDSettings.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { Vector3 } from "three";


export const CAMERA_FOV = 50
export const CAMERA_POSITION = [0, 0, 50]
export const CAMERA_POSITION = new Vector3(0, 0, 50)
export const CAMERA_NEAR = 0.1
export const CAMERA_FAR = 2000

export const LIGHT_1_COLOR = 0x404040
export const LIGHT_2_COLOR = 0xccccff
export const LIGHT_2_POSITION = [-1, 0.75, -0.5]
export const LIGHT_2_POSITION = new Vector3(-1, 0.75, -0.5)

export const SCENE_BACKGROUND = '0xd9d8d4'

Expand Down
Loading

0 comments on commit e042665

Please sign in to comment.