Skip to content

Commit 7c8b810

Browse files
committed
Initial structure
0 parents  commit 7c8b810

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1190
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.eslintrc.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
extends: 'airbnb',
3+
rules: {
4+
'max-len': [1, 160, 4, {"ignoreUrls": true}],
5+
'no-console': 0,
6+
'no-multi-spaces': [2, { exceptions: { "ImportDeclaration": true } }],
7+
'no-param-reassign': [2, { props: false }],
8+
'no-unused-vars': [2, { args: 'none' }],
9+
}
10+
};

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.DS_Store
2+
*.swp
3+
.npm-packages
4+
.npmrc
5+
npm-debug.log
6+
node_modules

.npmignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
.gitmodules
3+
.npmrc
4+
.sass-cache
5+
.travis.yml
6+
Documentation/www
7+
npm-debug.log

CONTRIBUTING.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
Contributing to VTK-JS
2+
======================
3+
4+
This page documents at a very high level how to contribute to VTK-JS.
5+
Please check our [developer instructions] for a more detailed guide to
6+
developing and contributing to the project, and our [VTK-JS Git README]
7+
for additional information.
8+
9+
1. The VTK-JS source is maintained on Github
10+
at https://github.com/kitware/vtk-js<br/>
11+
12+
2. [Fork VTK] into your user's namespace on Github.
13+
14+
3. Follow the [download instructions] to create a
15+
local clone of the main VTK repository:
16+
17+
$ git clone https://github.com/kitware/vtk-js.git VTK
18+
$ cd vtk-js
19+
The main repository will be configured as your `origin` remote.
20+
21+
For more information see: [Setup]
22+
23+
4. Run the [developer setup script] to prepare your VTK-JS work tree:
24+
25+
$ npm install
26+
27+
5. Edit files and create commits (repeat as needed):
28+
29+
$ edit file1 file2 file3
30+
$ git add file1 file2 file3
31+
$ git cz
32+
33+
For more information see: [Create a Topic]
34+
35+
6. Push commits in your topic branch to your fork in Github:
36+
37+
$ git push
38+
39+
For more information see: [Share a Topic]
40+
41+
7. Visit your fork in Github, browse to the "**Merge Requests**" link on the
42+
left, and use the "**New Merge Request**" button in the upper right to
43+
create a Merge Request.
44+
45+
For more information see: [Create a Merge Request]
46+
47+
48+
VTK uses Github for code review and Travis-CI to test proposed
49+
patches before they are merged.
50+
51+
Our [DevSite] is used to document features, flesh out designs and host other
52+
documentation as well as API. We have several [Mailing Lists]
53+
to coordinate development and to provide support.
54+
55+
[VTK Git README]: Documentation/dev/git/README.md
56+
[developer instructions]: Documentation/dev/git/develop.md
57+
[Create an account]: https://gitlab.kitware.com/users/sign_in
58+
[Fork VTK]: https://gitlab.kitware.com/vtk/vtk/fork/new
59+
[download instructions]: Documentation/dev/git/download.md#clone
60+
[developer setup script]: /Utilities/SetupForDevelopment.sh
61+
[Setup]: Documentation/dev/git/develop.md#Setup
62+
[Create a Topic]: Documentation/dev/git/develop.md#create-a-topic
63+
[Share a Topic]: Documentation/dev/git/develop.md#share-a-topic
64+
[Create a Merge Request]: Documentation/dev/git/develop.md#create-a-merge-request
65+
66+
[DevSite]: http://kitware.github.io/vtk-js
67+
[Mailing Lists]: http://www.vtk.org/VTK/help/mailing.html

Copyright.txt

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*=========================================================================
2+
3+
Program: Visualization Toolkit - JS
4+
Module: Copyright.txt
5+
6+
Copyright (c) 2016 Ken Martin, Will Schroeder, Bill Lorensen
7+
All rights reserved.
8+
9+
Redistribution and use in source and binary forms, with or without
10+
modification, are permitted provided that the following conditions are met:
11+
12+
* Redistributions of source code must retain the above copyright notice,
13+
this list of conditions and the following disclaimer.
14+
15+
* Redistributions in binary form must reproduce the above copyright notice,
16+
this list of conditions and the following disclaimer in the documentation
17+
and/or other materials provided with the distribution.
18+
19+
* Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
20+
of any contributors may be used to endorse or promote products derived
21+
from this software without specific prior written permission.
22+
23+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
24+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
27+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33+
34+
=========================================================================*/

Documentation/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build-tmp

Documentation/config.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
cname: 'kitware.github.io',
3+
baseUrl: '/vtk-js',
4+
work: './build-tmp',
5+
target: './www',
6+
api: ['../Sources'],
7+
examples: ['../Sources'],
8+
config: {
9+
title: 'VTK.js',
10+
description: '"Visualization Toolkit for the Web."',
11+
subtitle: '"Enable scientific visualization to the Web."',
12+
author: 'Kitware Inc.',
13+
timezone: 'UTC',
14+
url: 'https://kitware.github.io/vtk-js',
15+
root: '/vtk-js/',
16+
github: 'kitware/vtk-js',
17+
},
18+
};

Documentation/content/api/index.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
title: API
2+
---
3+
4+
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.
5+
+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
title: Contributing
2+
---
3+
## Development
4+
5+
We welcome you to join the development of VTK-js. This document will help you through the process.
6+
7+
### Before You Start
8+
9+
Please follow the coding style:
10+
11+
- Follow [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript).
12+
- Use soft-tabs with a two space indent.
13+
- Don't put commas first.
14+
15+
### Workflow
16+
17+
1. Fork [kitware/vtk-js].
18+
2. Clone the repository to your computer and install dependencies.
19+
20+
{% code %}
21+
$ git clone https://github.com/<username>/vtk-js.git
22+
$ cd vtk-js
23+
$ npm install
24+
$ npm install -g commitizen
25+
{% endcode %}
26+
27+
3. Create a feature branch.
28+
29+
{% code %}
30+
$ git checkout -b new_feature
31+
{% endcode %}
32+
33+
4. Start hacking.
34+
5. Use Commitizen for commit message
35+
36+
{% code %}
37+
$ git cz
38+
{% endcode %}
39+
40+
6. Push the branch:
41+
42+
{% code %}
43+
$ git push origin new_feature
44+
{% endcode %}
45+
46+
6. Create a pull request and describe the change.
47+
48+
### Notice
49+
50+
- Don't modify version number in `package.json`.
51+
- Your pull request will only get merged when tests passed. Don't forget to run tests before submission.
52+
53+
{% code %}
54+
$ npm test
55+
{% endcode %}
56+
57+
## Updating Documentation
58+
59+
The VTK.js documentation is part of the code repository.
60+
61+
## Reporting Issues
62+
63+
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.

Documentation/content/docs/index.md

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
title: Documentation
2+
---
3+
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).
4+
5+
## What is vtk-js?
6+
7+
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.
8+
9+
## Installation
10+
11+
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.
12+
13+
### Requirements
14+
15+
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:
16+
17+
- [Node.js](http://nodejs.org/)
18+
- [Git](http://git-scm.com/)
19+
20+
If your computer already has these, congratulations! Just install vtk-js with npm:
21+
22+
``` bash
23+
$ npm install vtk.js --save
24+
```
25+
26+
If not, please follow the following instructions to install all the requirements.
27+
28+
{% note warn For Mac users %}
29+
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.
30+
{% endnote %}
31+
32+
### Install Git
33+
34+
- Windows: Download & install [git](https://git-scm.com/download/win).
35+
- Mac: Install it with [Homebrew](http://mxcl.github.com/homebrew/), [MacPorts](http://www.macports.org/) or [installer](http://sourceforge.net/projects/git-osx-installer/).
36+
- Linux (Ubuntu, Debian): `sudo apt-get install git-core`
37+
- Linux (Fedora, Red Hat, CentOS): `sudo yum install git-core`
38+
39+
### Install Node.js
40+
41+
The best way to install Node.js is with [nvm](https://github.com/creationix/nvm).
42+
43+
cURL:
44+
45+
``` bash
46+
$ curl https://raw.github.com/creationix/nvm/master/install.sh | sh
47+
```
48+
49+
Wget:
50+
51+
``` bash
52+
$ wget -qO- https://raw.github.com/creationix/nvm/master/install.sh | sh
53+
```
54+
55+
Once nvm is installed, restart the terminal and run the following command to install Node.js.
56+
57+
``` bash
58+
$ nvm install 4
59+
```
60+
61+
Alternatively, download and run [the installer](http://nodejs.org/).
62+
63+
### Install vtk-js
64+
65+
``` bash
66+
$ npm install vtk.js --save
67+
```
68+
69+
### Getting vtk-js source code for contributing
70+
71+
``` bash
72+
$ git clone https://github.com/kitware/vtk-js.git
73+
$ cd vtk-js
74+
$ npm install
75+
```

Documentation/content/docs/setup.md

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
title: Setup
2+
---
3+
This documentation will explain how to create a new Web project that can leverage vtk-js.
4+
5+
``` bash
6+
$ mkdir MyWebProject
7+
$ cd MyWebProject
8+
$ npm init
9+
$ npm install vtk.js --save-dev
10+
$ npm install kw-web-suite --save-dev
11+
```
12+
13+
### Webpack config
14+
15+
``` js webpack.config.js
16+
var path = require('path'),
17+
webpack = require('webpack'),
18+
loaders = require('./node_modules/vtk.js/Utilities/config/webpack.loaders.js'),
19+
plugins = [];
20+
21+
if(process.env.NODE_ENV === 'production') {
22+
console.log('==> Production build');
23+
plugins.push(new webpack.DefinePlugin({
24+
"process.env": {
25+
NODE_ENV: JSON.stringify("production"),
26+
},
27+
}));
28+
}
29+
30+
module.exports = {
31+
plugins: plugins,
32+
entry: './src/index.js',
33+
output: {
34+
path: './dist',
35+
filename: 'MyWebApp.js',
36+
},
37+
module: {
38+
preLoaders: [{
39+
test: /\.js$/,
40+
loader: "eslint-loader",
41+
exclude: /node_modules/,
42+
}],
43+
loaders: [
44+
{ test: require.resolve("./src/index.js"), loader: "expose?MyWebApp" },
45+
].concat(loaders),
46+
},
47+
postcss: [
48+
require('autoprefixer')({ browsers: ['last 2 versions'] }),
49+
],
50+
eslint: {
51+
configFile: '.eslintrc.js',
52+
},
53+
};
54+
55+
```
56+
57+
### package.json
58+
59+
You should extend the generated **package.json** file with the following set of scripts.
60+
61+
``` json package.json
62+
{
63+
[...]
64+
"scripts": {
65+
"build": "webpack",
66+
"build:debug": "webpack --display-modules",
67+
"build:release": "export NODE_ENV=production && webpack -p",
68+
69+
"commit": "git cz",
70+
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
71+
},
72+
}
73+
```

0 commit comments

Comments
 (0)