Skip to content

Commit

Permalink
Merge pull request #6 from negin513/datetime-fix
Browse files Browse the repository at this point in the history
Datetime fix
  • Loading branch information
negin513 authored Apr 10, 2024
2 parents 9d838ef + ce8dcef commit f25932b
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__pycache__/
.ipynb_checkpoints
build/
__pycache__/
neon_dashboard/__pycache__/
.venv
.vscode/
106 changes: 60 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,47 @@
# πŸ“š Neon Dashboard Readme πŸ“š
# πŸ“š NCAR-NEON Dashboard Readme πŸ“š

Neon Dashboard is a web-based visualization tool for exploring and analyzing neon data. It was created as part of the research project outlined in the paper (** add link).
**To access the NEON Dashboard, please visit the following link: [Neon Dashboard](https://ncar.nationalsciencedatafabric.org/neon-demo/v1/).

The NCAR-NEON Dashboard provides an interactive visualization interface for visualizing and analyzing data collected by the [National Ecological Observatory Network (NEON)](https://www.neonscience.org/) and compare it with with the Community Terrestrial System Model (CTSM) simulations at those points. It was created as part of the research project outlined in [this paper](https://gmd.copernicus.org/articles/16/5979/2023/gmd-16-5979-2023.pdf).

This dashboard enables users from anywhere in the world to explore and interact with model outputs and observations on the fly without any requirements for advanced computational resouces. This tool allows users to generate graphs and statistical summaries comparing CTSM simulations and observational data for NEON sites without downloading the observational data or running the model. Users access a Graphical User Interface (GUI) to select individual NEON sites, variables, and output frequencies to visualize. The tool offers different types of interactive visualizations and statistical summaries based on user selections. This interactive visualization dashboard does not require specialist knowledge to operate; therefore, it can be used for educational outreach activities and in classrooms. Moreover, users
can interact with the dashboard using a browser, so it is possible to interact with the plots via a tablet or smartphone.

Users can customize the plots by selecting different data sources, time periods, and geographic regions. This dashboard is currently hosted on [the National Science Data Fabric (NSDF)](https://nationalsciencedatafabric.org/) and is publicly accessibler

Besides using the above link to access the NEON Dashboard, you can also run the application on your local machine. This README provides instructions on how to run the NEON Dashboard application using a Docker container or without using a Docker container.

--------------------------------------------------

## How to run the NEON Dashboard application yourself?

There are many ways to run this application on your local machine:

## πŸš€ Easiest Method: How to Clone Docker Image and Start the Bokeh Application from Docker Hub πŸ“¦
### πŸš€ Easiest Method: Using Docker Image Directly! πŸ“¦

To quickly get started with the Neon Dashboard Bokeh application, you can use the easiest method by pulling the pre-built Docker image from Docker Hub. πŸ“¦
To get started with the NEON Dashboard Bokeh application, you can use the easiest method by pulling the pre-built Docker image from Docker Hub. πŸ“¦

Open a terminal or command prompt and run the following command to pull the image:

```bash
docker pull negin513/neon-app
docker pull negin513/NEON-app
```

Once the image is pulled successfully, run the Bokeh application in a Docker container with the following command. This will forward the port `8080`, making the application publicly available: πŸš€

```bash
docker run -p 8080:5006 negin513/neon-app
docker run -p 8080:5006 negin513/NEON-app
```

The Bokeh application should now be up and running inside the Docker container. You can access it in your web browser at http://localhost:8080. πŸŽ‰πŸŽ‰πŸŽ‰

### How to Run this Application without Docker Container? (using Conda) πŸƒ

## πŸš€ How to Run with Container? πŸš€

To run Neon Dashboard using Docker container, follow these steps:

1. Make sure you have Docker installed on your system.

2. Clone or download the Neon Dashboard repository from https://github.com/negin513/neon_dashboard.
```
git clone https://github.com/negin513/neon_dashboard
```
3. Navigate to the root directory of the cloned/downloaded repository.
```
cd neon_dashboard
```
4. Build the Docker image using the provided Dockerfile:
```
docker build -t neon-app .
```
5. Once the image is built, run the container with port mapping:
```
docker run -p 5006:5006 neon-app
```
6. The Neon Dashboard should now be accessible in your web browser at `http://localhost:5006`.
Sure! Here's an additional section on how to run Neon Dashboard without using a Docker container, using Conda for managing the Python environment.
To run NEON Dashboard without using a Docker container, you'll need to have Conda and Python installed on your system. Follow these steps:

## πŸƒ How to Run with Conda (Without Docker Container)? πŸƒ
To run Neon Dashboard without using a Docker container, you'll need to have Conda and Python installed on your system. Follow these steps:
1. lone or download the Neon Dashboard repository from https://github.com/negin513/neon_dashboard.
1. lone or download the NEON Dashboard repository from https://github.com/negin513/NEON_dashboard.
```
git clone https://github.com/negin513/neon_dashboard
git clone https://github.com/negin513/NEON_dashboard
```
2. Create a Conda environment and install the required Python packages:
Expand All @@ -72,7 +53,7 @@ To run Neon Dashboard without using a Docker container, you'll need to have Cond
The first command creates a new Conda environment named "neon-env". The second command activates the environment. The third command installs Bokeh and its required dependencies, while the fourth command installs any additional Python packages listed in the requirements.txt file.
3. Once the dependencies are installed, navigate to the root directory of the Neon Dashboard repository and activate the `ncar-env` environment:
3. Once the dependencies are installed, navigate to the root directory of the NEON Dashboard repository and activate the `ncar-env` environment:
```
conda activate neon-env
cd neon_dashboard
Expand All @@ -85,12 +66,45 @@ To run Neon Dashboard without using a Docker container, you'll need to have Cond
The `--allow-websocket-origin` flag is used to enable connections from the local host.
5. The Neon Dashboard should now be accessible in your web browser at `http://localhost:5006`.
5. The NEON Dashboard should now be accessible in your web browser at `http://localhost:5006`.
### ### πŸš€ How to Run with Container? πŸš€
To run NEON Dashboard using Docker container, follow these steps:
1. Make sure you have Docker installed on your system.
2. Clone or download the NEON Dashboard repository from https://github.com/negin513/neon_dashboard.
```
git clone https://github.com/negin513/neon_dashboard
```
3. Navigate to the root directory of the cloned/downloaded repository.
```
cd neon_dashboard
```
4. Build the Docker image using the provided Dockerfile:
```
docker build -t neon-app .
```
5. Once the image is built, run the container with port mapping:
```
docker run -p 5006:5006 neon-app
```
6. The NEON Dashboard should now be accessible in your web browser at `http://localhost:5006`.
Sure! Here's an additional section on how to run NEON Dashboard without using a Docker container, using Conda for managing the Python environment.
## πŸ“„ Citing the Paper πŸ“„
If you use Neon Dashboard in your research or work and want to cite the original paper, please use the following citation format [***].
If you use NEON Dashboard in your research or work and want to cite the original paper, please use the following citation format [***].
πŸŽ‰πŸŽ‰πŸŽ‰ Have fun exploring your neon data with Neon Dashboard! πŸŽ‰πŸŽ‰πŸŽ‰
πŸŽ‰πŸŽ‰πŸŽ‰ Have fun exploring your NEON data with NEON Dashboard! πŸŽ‰πŸŽ‰πŸŽ‰
Binary file removed neon_dashboard/__pycache__/data_utils.cpython-39.pyc
Binary file not shown.
21 changes: 14 additions & 7 deletions neon_dashboard/models/download.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
function table_to_csv(source) {
const columns = Object.keys(source.data)
const nrows = source.get_length()
const lines = [columns.join(',')]
const columns = Object.keys(source.data);
const nrows = source.get_length();
const lines = [columns.join(',')];

for (let i = 0; i < nrows; i++) {
let row = [];
for (let j = 0; j < columns.length; j++) {
const column = columns[j]
row.push(source.data[column][i].toString())
const column = columns[j];
let cellValue = source.data[column][i];
// Check if the column name suggests it's a time/date column
// Adjust the condition to fit your specific column naming
if (column.toLowerCase().includes('time') || column.toLowerCase().includes('date')) {
// Assuming UNIX timestamp in milliseconds, adjust accordingly
cellValue = new Date(cellValue).toISOString();
}
row.push(cellValue.toString());
}
lines.push(row.join(','))
lines.push(row.join(','));
}
return lines.join('\n').concat('\n')
return lines.join('\n').concat('\n');
}


Expand Down

0 comments on commit f25932b

Please sign in to comment.