forked from Kitware/vtk-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7c8b810
Showing
75 changed files
with
1,190 additions
and
0 deletions.
There are no files selected for viewing
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,13 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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,10 @@ | ||
module.exports = { | ||
extends: 'airbnb', | ||
rules: { | ||
'max-len': [1, 160, 4, {"ignoreUrls": true}], | ||
'no-console': 0, | ||
'no-multi-spaces': [2, { exceptions: { "ImportDeclaration": true } }], | ||
'no-param-reassign': [2, { props: false }], | ||
'no-unused-vars': [2, { args: 'none' }], | ||
} | ||
}; |
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,6 @@ | ||
.DS_Store | ||
*.swp | ||
.npm-packages | ||
.npmrc | ||
npm-debug.log | ||
node_modules |
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,7 @@ | ||
.DS_Store | ||
.gitmodules | ||
.npmrc | ||
.sass-cache | ||
.travis.yml | ||
Documentation/www | ||
npm-debug.log |
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,67 @@ | ||
Contributing to VTK-JS | ||
====================== | ||
|
||
This page documents at a very high level how to contribute to VTK-JS. | ||
Please check our [developer instructions] for a more detailed guide to | ||
developing and contributing to the project, and our [VTK-JS Git README] | ||
for additional information. | ||
|
||
1. The VTK-JS source is maintained on Github | ||
at https://github.com/kitware/vtk-js<br/> | ||
|
||
2. [Fork VTK] into your user's namespace on Github. | ||
|
||
3. Follow the [download instructions] to create a | ||
local clone of the main VTK repository: | ||
|
||
$ git clone https://github.com/kitware/vtk-js.git VTK | ||
$ cd vtk-js | ||
The main repository will be configured as your `origin` remote. | ||
|
||
For more information see: [Setup] | ||
|
||
4. Run the [developer setup script] to prepare your VTK-JS work tree: | ||
|
||
$ npm install | ||
|
||
5. Edit files and create commits (repeat as needed): | ||
|
||
$ edit file1 file2 file3 | ||
$ git add file1 file2 file3 | ||
$ git cz | ||
|
||
For more information see: [Create a Topic] | ||
|
||
6. Push commits in your topic branch to your fork in Github: | ||
|
||
$ git push | ||
|
||
For more information see: [Share a Topic] | ||
|
||
7. Visit your fork in Github, browse to the "**Merge Requests**" link on the | ||
left, and use the "**New Merge Request**" button in the upper right to | ||
create a Merge Request. | ||
|
||
For more information see: [Create a Merge Request] | ||
|
||
|
||
VTK uses Github for code review and Travis-CI to test proposed | ||
patches before they are merged. | ||
|
||
Our [DevSite] is used to document features, flesh out designs and host other | ||
documentation as well as API. We have several [Mailing Lists] | ||
to coordinate development and to provide support. | ||
|
||
[VTK Git README]: Documentation/dev/git/README.md | ||
[developer instructions]: Documentation/dev/git/develop.md | ||
[Create an account]: https://gitlab.kitware.com/users/sign_in | ||
[Fork VTK]: https://gitlab.kitware.com/vtk/vtk/fork/new | ||
[download instructions]: Documentation/dev/git/download.md#clone | ||
[developer setup script]: /Utilities/SetupForDevelopment.sh | ||
[Setup]: Documentation/dev/git/develop.md#Setup | ||
[Create a Topic]: Documentation/dev/git/develop.md#create-a-topic | ||
[Share a Topic]: Documentation/dev/git/develop.md#share-a-topic | ||
[Create a Merge Request]: Documentation/dev/git/develop.md#create-a-merge-request | ||
|
||
[DevSite]: http://kitware.github.io/vtk-js | ||
[Mailing Lists]: http://www.vtk.org/VTK/help/mailing.html |
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,34 @@ | ||
/*========================================================================= | ||
|
||
Program: Visualization Toolkit - JS | ||
Module: Copyright.txt | ||
|
||
Copyright (c) 2016 Ken Martin, Will Schroeder, Bill Lorensen | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, | ||
this list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
* Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names | ||
of any contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
=========================================================================*/ |
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 @@ | ||
build-tmp |
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,18 @@ | ||
module.exports = { | ||
cname: 'kitware.github.io', | ||
baseUrl: '/vtk-js', | ||
work: './build-tmp', | ||
target: './www', | ||
api: ['../Sources'], | ||
examples: ['../Sources'], | ||
config: { | ||
title: 'VTK.js', | ||
description: '"Visualization Toolkit for the Web."', | ||
subtitle: '"Enable scientific visualization to the Web."', | ||
author: 'Kitware Inc.', | ||
timezone: 'UTC', | ||
url: 'https://kitware.github.io/vtk-js', | ||
root: '/vtk-js/', | ||
github: 'kitware/vtk-js', | ||
}, | ||
}; |
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,5 @@ | ||
title: API | ||
--- | ||
|
||
This documentation provides more detailed information about the API and will be particularly helpful for people who want to use VTK.js into their application. | ||
|
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,63 @@ | ||
title: Contributing | ||
--- | ||
## Development | ||
|
||
We welcome you to join the development of VTK-js. This document will help you through the process. | ||
|
||
### Before You Start | ||
|
||
Please follow the coding style: | ||
|
||
- Follow [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript). | ||
- Use soft-tabs with a two space indent. | ||
- Don't put commas first. | ||
|
||
### Workflow | ||
|
||
1. Fork [kitware/vtk-js]. | ||
2. Clone the repository to your computer and install dependencies. | ||
|
||
{% code %} | ||
$ git clone https://github.com/<username>/vtk-js.git | ||
$ cd vtk-js | ||
$ npm install | ||
$ npm install -g commitizen | ||
{% endcode %} | ||
|
||
3. Create a feature branch. | ||
|
||
{% code %} | ||
$ git checkout -b new_feature | ||
{% endcode %} | ||
|
||
4. Start hacking. | ||
5. Use Commitizen for commit message | ||
|
||
{% code %} | ||
$ git cz | ||
{% endcode %} | ||
|
||
6. Push the branch: | ||
|
||
{% code %} | ||
$ git push origin new_feature | ||
{% endcode %} | ||
|
||
6. Create a pull request and describe the change. | ||
|
||
### Notice | ||
|
||
- Don't modify version number in `package.json`. | ||
- Your pull request will only get merged when tests passed. Don't forget to run tests before submission. | ||
|
||
{% code %} | ||
$ npm test | ||
{% endcode %} | ||
|
||
## Updating Documentation | ||
|
||
The VTK.js documentation is part of the code repository. | ||
|
||
## Reporting Issues | ||
|
||
When you encounter some problems when using ParaViewWeb, you can find the solutions in [Troubleshooting](troubleshooting.html) or ask me on [GitHub](https://github.com/kitware/vtk-js/issues) or [Mailing list](http://www.vtk.org/mailman/listinfo/vtk). If you can't find the answer, please report it on GitHub. |
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,75 @@ | ||
title: Documentation | ||
--- | ||
Welcome to the vtk-js documentation. If you encounter any problems when using vtk-js, have a look at the [troubleshooting guide](troubleshooting.html), raise an issue on [GitHub](https://github.com/kitware/vtk-js/issues) or start a topic on the [Mailing list](http://www.vtk.org/mailman/listinfo/vtk). | ||
|
||
## What is vtk-js? | ||
|
||
vtk-js is a rendering library made for Scientific Visualization on the Web. It leverages VTK structure and expertise to bring high performance rendering into your browser. | ||
|
||
## Installation | ||
|
||
It only takes few minutes to set up VTK-js. If you encounter a problem and can't find the solution here, please [submit a GitHub issue](https://github.com/kitware/vtk-js/issues) and I'll try to solve it. | ||
|
||
### Requirements | ||
|
||
Installing vtk-js as a dependency inside your Web project is quite easy. However, you do need to have a couple of other things installed first: | ||
|
||
- [Node.js](http://nodejs.org/) | ||
- [Git](http://git-scm.com/) | ||
|
||
If your computer already has these, congratulations! Just install vtk-js with npm: | ||
|
||
``` bash | ||
$ npm install vtk.js --save | ||
``` | ||
|
||
If not, please follow the following instructions to install all the requirements. | ||
|
||
{% note warn For Mac users %} | ||
You may encounter some problems when compiling. Please install Xcode from App Store first. After Xcode is installed, open Xcode and go to **Preferences -> Download -> Command Line Tools -> Install** to install command line tools. | ||
{% endnote %} | ||
|
||
### Install Git | ||
|
||
- Windows: Download & install [git](https://git-scm.com/download/win). | ||
- Mac: Install it with [Homebrew](http://mxcl.github.com/homebrew/), [MacPorts](http://www.macports.org/) or [installer](http://sourceforge.net/projects/git-osx-installer/). | ||
- Linux (Ubuntu, Debian): `sudo apt-get install git-core` | ||
- Linux (Fedora, Red Hat, CentOS): `sudo yum install git-core` | ||
|
||
### Install Node.js | ||
|
||
The best way to install Node.js is with [nvm](https://github.com/creationix/nvm). | ||
|
||
cURL: | ||
|
||
``` bash | ||
$ curl https://raw.github.com/creationix/nvm/master/install.sh | sh | ||
``` | ||
|
||
Wget: | ||
|
||
``` bash | ||
$ wget -qO- https://raw.github.com/creationix/nvm/master/install.sh | sh | ||
``` | ||
|
||
Once nvm is installed, restart the terminal and run the following command to install Node.js. | ||
|
||
``` bash | ||
$ nvm install 4 | ||
``` | ||
|
||
Alternatively, download and run [the installer](http://nodejs.org/). | ||
|
||
### Install vtk-js | ||
|
||
``` bash | ||
$ npm install vtk.js --save | ||
``` | ||
|
||
### Getting vtk-js source code for contributing | ||
|
||
``` bash | ||
$ git clone https://github.com/kitware/vtk-js.git | ||
$ cd vtk-js | ||
$ npm install | ||
``` |
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,73 @@ | ||
title: Setup | ||
--- | ||
This documentation will explain how to create a new Web project that can leverage vtk-js. | ||
|
||
``` bash | ||
$ mkdir MyWebProject | ||
$ cd MyWebProject | ||
$ npm init | ||
$ npm install vtk.js --save-dev | ||
$ npm install kw-web-suite --save-dev | ||
``` | ||
|
||
### Webpack config | ||
|
||
``` js webpack.config.js | ||
var path = require('path'), | ||
webpack = require('webpack'), | ||
loaders = require('./node_modules/vtk.js/Utilities/config/webpack.loaders.js'), | ||
plugins = []; | ||
|
||
if(process.env.NODE_ENV === 'production') { | ||
console.log('==> Production build'); | ||
plugins.push(new webpack.DefinePlugin({ | ||
"process.env": { | ||
NODE_ENV: JSON.stringify("production"), | ||
}, | ||
})); | ||
} | ||
|
||
module.exports = { | ||
plugins: plugins, | ||
entry: './src/index.js', | ||
output: { | ||
path: './dist', | ||
filename: 'MyWebApp.js', | ||
}, | ||
module: { | ||
preLoaders: [{ | ||
test: /\.js$/, | ||
loader: "eslint-loader", | ||
exclude: /node_modules/, | ||
}], | ||
loaders: [ | ||
{ test: require.resolve("./src/index.js"), loader: "expose?MyWebApp" }, | ||
].concat(loaders), | ||
}, | ||
postcss: [ | ||
require('autoprefixer')({ browsers: ['last 2 versions'] }), | ||
], | ||
eslint: { | ||
configFile: '.eslintrc.js', | ||
}, | ||
}; | ||
|
||
``` | ||
|
||
### package.json | ||
|
||
You should extend the generated **package.json** file with the following set of scripts. | ||
|
||
``` json package.json | ||
{ | ||
[...] | ||
"scripts": { | ||
"build": "webpack", | ||
"build:debug": "webpack --display-modules", | ||
"build:release": "export NODE_ENV=production && webpack -p", | ||
|
||
"commit": "git cz", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post" | ||
}, | ||
} | ||
``` |
Oops, something went wrong.