Giter VIP home page Giter VIP logo

tsol3d's Introduction

TSOL3D System Maintenance Guide

Building the library

command to build webpack: (from modules directory)

~/node_modules/.bin/webpack tsol3d.js  ../build/assembledTsol3d.js --output-library '$tsol3d'

can add --optimize-minimize to generate minimized / optimized version

dev mode for build - monitor files and rebuild when they are saved:

~/node_modules/.bin/webpack tsol3d.js  ../build/assembledTsol3d.js --output-library '$tsol3d'  --progress --watch

setting up the development environment

  1. install git, setup github account
  2. install node (tested with version 7.4.0)
  3. check out the code from github git clone [email protected]:dllahr/tsol3d.git
  4. from a terminal / command line, cd into where you cloned the above and do the following from there
  5. install http-server with npm npm install -g http-server
  6. run the http server: http-server .
  7. try things out:
    1. open http://127.0.0.1:8080 in your browser
    2. navigate to "tests", then choose e.g. "test_TIM_6mer_fragment_A73_I78.html"
    3. try to rotate, zoom, click the buttons etc.
  8. install webpack npm install -g webpack
  9. run webpack in development mode (it will monitor for file changes and rebuild the library):
    1. cd into the "modules" subdirectory
    2. run webpack:
    3. ~/node_modules/.bin/webpack tsol3d.js ../build/assembledTsol3d.js --output-library '$tsol3d' --progress --watch
  10. try it out:
    1. edit the file modules/tim6merFragmentA73I78.js, change one of the entries in the line that assigns "button_values" e.g. "stick" to "stick hello world"
    2. notice that in the terminal where you ran the webpack command it has produced some output indicating the changed file it noticed, and that the new library was produced
    3. refresh the browser (make sure caching is off), notice that the button text you edited has changed (e.g. from "stick" to "stick hello world")

using the simple template

In this example we'll make a rendering of the structure of glucose.

  1. create new module
    1. in modules, copy simpleTemplate.js to glucose.js
    2. rename the module in the file - do a find / replace of simpleTemplate --> glucose
  2. add the structure pdb file to data directory (in this case, added glucose.pdb)
  3. reference the new module in tsol3d.js - edit tsol3d.js (also in modules directory)
    1. copy all simpleTemplate or simple_template entries and make an analogous entry for glucose
      1. e.g. "import glucose from './glucose'"
      2. export const export_glucose = glucose;
      3. etc.
      4. important note: when editing the builderMap to add an entry, need to add a comma to the end of the previous line
  4. create the test
    1. in tests, copy test_simple_template.html to test_glucose.html
    2. edit the <h2> (header level 2) line to say "Glucose" instead of "Simple Template"
    3. edit the line in the script that calls $tsol3d
      1. change it to call export_glucose instead of export_simpleTemplate
      2. change the location of the data to be ../data/glucose.pdb
  5. try it out in your local browser
  6. if it is working, add it to your git repo / github repository
    1. check which files were modified: git status
      1. should be modules/tsol3d.js
      2. untracked should be:
        1. modules/glucose.js
        2. tests/test_glucose.html
    2. update your repository
      1. git fetch
      2. git pull
    3. add files to be committed
      1. git add modules/glucose.js
      2. git add tests/test_glucose.html
      3. git add modules/tsol3d.js
    4. commit: git commit -m "added view of glucose"
      • (with a message relevant to the view you've added)
    5. push to github: git push

tsol3d's People

Stargazers

Patrick McCarren avatar

Watchers

Dave Lahr avatar Patrick McCarren 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.