Giter Site home page Giter Site logo

wetlandtraitdriver's Introduction

Wetland Trait Driver

This repository serves as a open source scientific platform on research linking environmental drivers and change to wetland processes and ecosystem services. A live version of the figure!

Data

The main data for the project is hosted on a public google sheet. While google sheets provides versioning, we still have one "frozen" version to see here. You can for example, make a copy of this oor the revised one linked below, work through some changes and then send us a link to the updated document with some explanations for the changes. We can then upgrade the figure (we will keep one version with the original to provide a static version corresponding to the version at the time of the publication)

The main working document is here.

Working with the document needs some care due to the way the nodes and links interact:

1) links in the links "sheet" can only occur between nodes registered on teh "nodes" sheet
2) links cannot go "backwards" this will break the graph algorithm

Due to this we suggest to test major structural changes yourself according to the procedure below. Smaller edits are fine in the live document. Note however that the final figure is not automatically updated, but needs to be processed manually to produce an updated output.

Also, any improvements to the process of working and generating the figure or the figure javascript code is greatly appreciated.

Processing of data to generate file for visualization

Once changes have been made in the google Data sheets, the file can be downloaded by exporting as excel file. Then do the following in python:

import pandas as pd
import numpy.random as np
import sys
import json
import os
ExcelFile=r'PathToYourFile/Downloads/DriverTraitProcessData.xlsx'
links=pd.read_excel(ExcelFile,sheetname=1 )
nodes=pd.read_excel(ExcelFile,sheetname=0 )
linksjson=links.to_json(orient="records")
nodesjson=nodes.to_json(orient="records")
with open('PathToLiveFigureFolder/WetlandTraitDriver.json','w') as outfile:
    outfile.write('{"links":')
    outfile.write(links.to_json(orient="records"))
    outfile.write(',"nodes":')
    outfile.write(nodes.to_json(orient="records"))
    outfile.write('}')

Note: I will check to see if its possible to get the data directly from google without manual download.

Look at the figure

make sure the path in the figure.html file points to the newly created json file:

d3.json("PathToJsonFile/WetlandTraitDriver.json", function(error, graph) {

Due to the fact that most browsers like to load local files on a webpage you now need to either:

1) open a terminal, cd to the folder and type ```python -m http.server 8000``` and then open localhost:8000 in a browser, or
2) put the folder where you can access it via a http request

If everything works you should now be able to see the figure

wetlandtraitdriver's People

Contributors

zahachtah avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.