-
Notifications
You must be signed in to change notification settings - Fork 36
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
Documentation and delta-ui update #8
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c4598ff
Update delta config documentation
danielfdsilva ddee198
Update delta-ui submodule
danielfdsilva 0a3e94a
Update content
danielfdsilva 5404d35
Update documentation
danielfdsilva 00c2919
Add documentation for scrollytelling
danielfdsilva 791913c
Update deploy url to visex.surge.sh
danielfdsilva 5c20750
Add missing mapbox token
danielfdsilva a3bedee
Update delta-ui submodule
danielfdsilva File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule ui
updated
from 90d9e9 to 023a64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,105 +1,15 @@ | ||
# Delta config | ||
# Welcome to Delta | ||
|
||
This repo contains all the content and configuration needed to setup your own instance of [delta-ui](https:/NASA-IMPACT/delta-ui). | ||
Delta is a dashboard to explore data. | ||
|
||
The `delta-config` relies on the `delta-ui` submodule. Use `--recursive` flag when cloning `delta-config`, or initialize the submodules with: | ||
``` | ||
git submodule update --init --recursive | ||
``` | ||
Delta is organized around the concept of Thematic areas. Each thematic area explores a topic in detail via datasets and discoveries. | ||
A Dataset represents a piece of geo-referenced data displayed as a set of related layers on a map. | ||
Discoveries are long form pieces of content that tell a story about some interesting portion of the data. | ||
|
||
## Installation | ||
To set up the development environment for this website, you'll need to install the following on your system: | ||
## Getting started | ||
|
||
- [Node](http://nodejs.org/) v16 (To manage multiple node versions we recommend [nvm](https:/creationix/nvm)) | ||
- [Yarn](https://yarnpkg.com/) Package manager | ||
1) Check [SETUP](./docs/SETUP.md) to see how you can run the project locally. (You'll need this to preview content.) | ||
2) Check [CONFIGURATION](./docs/CONFIGURATION.md) to see a list of configuration options for Delta. | ||
3) Check [CONTENT](./docs/CONTENT.md) for how to structure the content pieces. | ||
|
||
If you use [`nvm`](https:/creationix/nvm), activate the desired Node version: | ||
|
||
``` | ||
nvm install | ||
``` | ||
|
||
Setup the project | ||
``` | ||
./.delta/setup | ||
``` | ||
|
||
## Configuration | ||
|
||
The base properties used by Delta are set through the `.env` file. This includes values like the application title, and contact email. These values are then used throughout the app. | ||
|
||
## Content | ||
|
||
Delta is divided into Thematic Areas, Datasets, and Discoveries. | ||
Each piece of content is written in [MDX](https://mdxjs.com/docs/what-is-mdx/#what-is-mdx) with configuration frontmatter between a set of `---`. | ||
A file will look something like: | ||
``` | ||
--- | ||
id: theme1 | ||
name: Thematic area 1 | ||
--- | ||
|
||
# About theme 1 | ||
|
||
<WidgetMdx prop='example' /> | ||
``` | ||
|
||
After adding some content we need to tell Delta where to find it using the `delta.config.js` file. | ||
It assumes the following as defaults: | ||
``` | ||
thematics: './thematic/*.thematic.mdx' | ||
datasets: './datasets/*.data.mdx' | ||
discoveries: './discoveries/*.discoveries.mdx' | ||
``` | ||
But the content can be stored wherever you'd like. | ||
|
||
### Thematic Areas | ||
TODO: info | ||
|
||
### Datasets | ||
TODO: info | ||
|
||
### Discoveries | ||
TODO: info | ||
|
||
# Development | ||
There's not much development to be done in the config repo. The UI part of Delta is stored at [delta-ui](https:/NASA-IMPACT/delta-ui), and connected to the config via a git submodule. | ||
|
||
**To avoid breaking changes, the version of `delta-ui` is pinned to a specific commit making use of a [git-submodule](https://www.atlassian.com/git/tutorials/git-submodule).** This allows development to continue without breaking existent instances. | ||
You can see the version running: | ||
``` | ||
./.delta/delta --info | ||
``` | ||
|
||
The commit you may want to pin the `delta-ui` to will depend, but to get the latest changes from the `main` branch you could do: | ||
``` | ||
# Go into the submodule | ||
cd .delta/ui | ||
|
||
# Update the submodule info | ||
git fetch | ||
|
||
# Switch to the branch you want. | ||
# You can also choose a specific tag. | ||
git switch main | ||
|
||
# Get the latest changes | ||
git pull | ||
|
||
# Get back to the root directory | ||
cd - | ||
``` | ||
|
||
At this point you will have changed the commit the submodule is pointed to. | ||
If you run a diff on the submodule `git diff .delta/ui` you'll see that the commit changed. | ||
```diff | ||
diff --git a/.delta/ui b/.delta/ui | ||
index 67c68c4..57d18a1 160000 | ||
--- a/.delta/ui | ||
+++ b/.delta/ui | ||
@@ -1 +1 @@ | ||
-Subproject commit 67c68c4115283a76fe8f3e0921fcd43ad281077a | ||
+Subproject commit 57d18a12a4c17eaf436e128bd06904cba75f3e4a | ||
``` | ||
|
||
The only thing left to do is to commit this change like you'd normally do. | ||
If you plan to add features to `delta-config` check [DEVELOPMENT](./docs/DEVELOPMENT.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
module.exports = { | ||
/** | ||
* Glob path for the thematic areas. | ||
*/ | ||
thematics: './thematic/*.thematic.mdx', | ||
|
||
/** | ||
* Glob path for the datasets. | ||
*/ | ||
datasets: './datasets/*.data.mdx', | ||
|
||
/** | ||
* Glob path for the discoveries. | ||
*/ | ||
discoveries: './discoveries/*.discoveries.mdx' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Configuration | ||
|
||
The base properties used by Delta are set through the `.env` file. | ||
This includes values like the application title, and contact email. These values are then used throughout the app. | ||
|
||
The `.env` file contains a list of all available variables and comments explaining what they are used for. | ||
|
||
## delta.config.js | ||
|
||
The `delta.config.js` file is an additional configuration file for delta. | ||
It is through this file that you specify how the Delta content can be found. | ||
|
||
This is done by providing a glob path for each one of the [content types](./CONTENT.md). (Thematic areas, Datasets, Discoveries). | ||
The default configuration is: | ||
```js | ||
thematics: './thematic/*.thematic.mdx' | ||
datasets: './datasets/*.data.mdx' | ||
discoveries: './discoveries/*.discoveries.mdx' | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this safe to commit to the code base? (The repo might be private, but the build will be publicly accessible, right?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the token is going to be exposed inevitably (user can see it through network request) but Mapbox token can be protected through url restriction (which can be set up through their dashboards.) I can't confirm how this key is set up now, but this is the same one in the ui repo https:/NASA-IMPACT/delta-ui/blob/main/.env#L13 so I don't think it necessarily decreases the safety, but we probably can find a better place for these keys like somewhere in ci pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. As long as it's not a security issue I'll merge this and then we can address it later