nglviewer / ngl

WebGL protein viewer
http://nglviewer.org/ngl/
MIT License
667 stars 170 forks source link

how to run the new versin correctly? #178

Closed albumns closed 8 years ago

albumns commented 8 years ago

Hello:

I noticed that we have to use command line

python -m http.server

to set up the local NGL sever. However, when I open:

http://localhost:8000

I cannot find the "html" folder in NGL directory which was present in the old 0.6 version.

I am just wondering shall we build NGL in local machine first?

I found the following test:

`Building

Gulp is used as a build tool. The necessary dependencies can be installed with npm install. A non-minified build (build/js/ngl.js) can be created with gulp build. A minified file for distribution (dist/ngl.js) can be created with gulp. For development gulp watch can be called to watch source files and trigger a rebuild upon changes to them.

A smaller build can be created by using three-jsnext. To enable this clone the three-jsnext repository to be a sibling directory of the ngl repository and then change the import from line at the end of lib/three.es6.js to point to three-jsnext-import.js. Finally, rebuild. `

However, I don't find the command line "gulp" in my local machine.

Thanks a lot

albumns commented 8 years ago

could anybody give me some sugguestions?

thx a lot

hainm commented 8 years ago

you can try

cd ngl
python -m http.server

then open

http://localhost:8000/examples/webapp.html

(replace webapp.html by embedded.html or any html file in that example folder)

albumns commented 8 years ago

Hello:

I tried your sugguested command line, and open all the related .html file in the example folder. Unfortunately, all of them only show a blank page....

Here is the information I obtained from termina:

127.0.0.1 - - [10/Aug/2016 23:24:23] code 404, message File not found 127.0.0.1 - - [10/Aug/2016 23:24:23] "GET /build/js/ngl.js HTTP/1.1" 404 - 127.0.0.1 - - [10/Aug/2016 23:24:23] "GET /examples/js/lib/signals.min.js HTTP/1.1" 200 - 127.0.0.1 - - [10/Aug/2016 23:24:23] "GET /examples/js/lib/tether.min.js HTTP/1.1" 200 - 127.0.0.1 - - [10/Aug/2016 23:24:23] "GET /examples/js/lib/colorpicker.min.js HTTP/1.1" 200 - 127.0.0.1 - - [10/Aug/2016 23:24:23] "GET /examples/js/ui/ui.js HTTP/1.1" 200 - 127.0.0.1 - - [10/Aug/2016 23:24:23] "GET /examples/js/ui/ui.ngl.js HTTP/1.1" 200 - 127.0.0.1 - - [10/Aug/2016 23:24:23] "GET /examples/js/ui/ui.extra.js HTTP/1.1" 200 - 127.0.0.1 - - [10/Aug/2016 23:24:23] "GET /examples/js/gui.js HTTP/1.1" 200 - 127.0.0.1 - - [10/Aug/2016 23:24:23] "GET /examples/js/plugins.js HTTP/1.1" 200 - 127.0.0.1 - - [10/Aug/2016 23:24:23] "GET /examples/js/examples.js HTTP/1.1" 200 - 127.0.0.1 - - [10/Aug/2016 23:24:23] code 404, message File not found 127.0.0.1 - - [10/Aug/2016 23:24:23] "GET /favicon.ico HTTP/1.1" 404 - 127.0.0.1 - - [10/Aug/2016 23:24:23] code 404, message File not found 127.0.0.1 - - [10/Aug/2016 23:24:23] "GET /favicon.ico HTTP/1.1" 404 -

Thx again

hainm commented 8 years ago

can you try refreshing? or git pull to make sure you have updated code.

Also, just make sure to run the server in the ngl root folder)

$ ls .
CHANGELOG.md  data  DEVELOPMENT.md  dist  doc  examples  gulpfile.js  lib  LICENSE  package.json  README.md  scripts  src  test
haichit@krakow ~/programs/3d/ngl (master) $ python -m http.server
Serving HTTP on 0.0.0.0 port 8000 ...
hainm commented 8 years ago

127.0.0.1 - - [10/Aug/2016 23:24:23] code 404, message File not found 127.0.0.1 - - [10/Aug/2016 23:24:23] "GET /build/js/ngl.js HTTP/1.1" 404 -

I think this indicates that you don't have ./build/js/ngl.js file.

fredludlow commented 8 years ago

Sorry not on appropriate box to actually check commands at the moment but if you've got node and npm installed (assuming you're on linux/OSX) you should be able to do something like

cd /path/to/ngl
npm install
npm install -g gulp # Installs gulp globally
gulp build

That will create the ./build/js/ngl.js file (among others)

albumns commented 8 years ago

thx a lot for the comments.

Finally it works.

arose commented 8 years ago

Finally it works.

great!

Updated https://github.com/arose/ngl/blob/master/DEVELOPMENT.md with more instructions