Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update meshio format #40

Merged
merged 2 commits into from
Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ module.exports = {
'@typescript-eslint/naming-convention': [
'error',
{
'selector': 'interface',
'format': ['PascalCase'],
'custom': {
'regex': '^I[A-Z]',
'match': true
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: true
}
}
],
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

### Enhancements made

- Read mesh files using MeshIO [#34](https://github.com/trungleduc/jupyterview/pull/34) ([@trungleduc](https://github.com/trungleduc))
- Read mesh files using MeshIO [#34](https://github.com/trungleduc/jupyterview/pull/34) ([@trungleduc](https://github.com/trungleduc))
- Install `jupyterlite` from PyPI [#31](https://github.com/trungleduc/jupyterview/pull/31) ([@jtpio](https://github.com/jtpio))

### Other merged PRs
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

<h2 align="center"> VTK Data visualization extension for JupyterLab</h2>


**jupyterview** is an extension that adds the `VTK` data visualization capability to JupyterLab.

Powered by Kitware's `vtk.js` and `itk-wasm` library, **jupyterview** is a pure frontend extension, it does not require any kernel to operate and fully supports the Real-Time Collaboration feature of JupyterLab.
Expand Down Expand Up @@ -35,7 +34,7 @@ https://user-images.githubusercontent.com/4451292/173418573-1839d689-763f-42ba-a

## Requirements

* JupyterLab >= 3.0
- JupyterLab >= 3.0

## Install

Expand All @@ -44,6 +43,7 @@ To install the extension, execute:
```bash
pip install jupyterview
```

or with mamba/conda

```bash
Expand Down Expand Up @@ -103,7 +103,9 @@ folder is located. Then you can remove the symlink named `jupyterview` within th
See [RELEASE](RELEASE.md)

## Thanks

The following libraries / open-source projects were used or inspired in the development of jupyterview:
* [vtk.js](https://github.com/Kitware/vtk-js)
* [itk-wasm](https://github.com/InsightSoftwareConsortium/itk-wasm)
* [paraview-glance](https://github.com/Kitware/paraview-glance)

- [vtk.js](https://github.com/Kitware/vtk-js)
- [itk-wasm](https://github.com/InsightSoftwareConsortium/itk-wasm)
- [paraview-glance](https://github.com/Kitware/paraview-glance)
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Python package. Before generating a package, we first need to install `build`.
pip install build twine
```

To create a Python source package (``.tar.gz``) and the binary package (`.whl`) in the `dist/` directory, do:
To create a Python source package (`.tar.gz`) and the binary package (`.whl`) in the `dist/` directory, do:

```bash
python -m build
Expand Down
6 changes: 3 additions & 3 deletions extension.webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function copyPluginPatterns(fileList) {
}));
}

const itkConfig = path.resolve(__dirname, 'lib', 'itkConfig.js')
const itkConfig = path.resolve(__dirname, 'lib', 'itkConfig.js');
module.exports = {
module: {
rules: [
Expand All @@ -43,7 +43,7 @@ module.exports = {
'VTKXMLFileReaderWasm.wasm',
'VTKLegacyFileReader.js',
'VTKLegacyFileReaderWasm.js',
'VTKLegacyFileReaderWasm.wasm',
'VTKLegacyFileReaderWasm.wasm'
]),
{
from: path.join(__dirname, 'node_modules', 'itk', 'WebWorkers'),
Expand All @@ -64,5 +64,5 @@ module.exports = {
},
optimization: {
minimize: false
},
}
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"clean:labextension": "rimraf jupyterview/labextension",
"clean:all": "jlpm run clean:lib && jlpm run clean:labextension",
"eslint": "eslint . --ext .ts,.tsx --fix",
"prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
"eslint:check": "eslint . --ext .ts,.tsx",
"install:extension": "jlpm run build",
"watch": "run-p watch:src watch:labextension",
Expand Down
5 changes: 3 additions & 2 deletions samples/mesh/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Mesh files are taken from:
Mesh files are taken from:

- https://github.com/nschloe/meshio/tree/main/tests/meshes
- https://github.com/victorsndvg/FEconv/tree/master/examples
- https://fenicsproject.org/pub/data/meshes/
- https://fenicsproject.org/pub/data/meshes/
1 change: 1 addition & 0 deletions src/panelview/panelview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export default class MainView extends React.Component<IProps, IStates> {
controlViewState.selectedColor = controlViewState.selectedColor ?? ':';
controlViewState.modifiedDataRange =
controlViewState.modifiedDataRange ?? mainViewState.dataRange;
controlViewState.displayMode = controlViewState.displayMode ?? '1:2:0';
return {
...old,
mainViewState,
Expand Down
41 changes: 40 additions & 1 deletion src/reader/meshioParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,46 @@ import { KernelExecutor } from '../kernel';
import { IJupyterViewParser, IParserResult } from './types';

export class MeshIOParser implements IJupyterViewParser {
readonly supportedType: string[] = ['inp', 'msh', 'vol', 'med', 'xml'];
readonly supportedType: string[] = [
'msh',
'f3grid',
'mdpa',
'ply',
'stl',
'xdmf',
'xmf',
'cgns',
'h5m',
'inp',
'avs',
'xml',
'e',
'exo',
'ex2',
'hmf',
'med',
'mesh',
'meshb',
'bdf',
'fem',
'nas',
'vol',
'vol.gz',
'obj',
'off',
'post',
'post.gz',
'dato',
'dato.gz',
'su2',
'svg',
'dat',
'tec',
'ele',
'node',
'ugrid',
'wkt'
];
nativeSupport: false;
readFile(
fileContent: string,
Expand Down
2 changes: 0 additions & 2 deletions src/svg.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

declare module '*.svg' {
const value: string; // @ts-ignore
export default value;
}

4 changes: 2 additions & 2 deletions style/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
border: none;
background-color: var(--jp-layout-color2);
color: var(--jp-content-font-color1);
min-width: 60px
min-width: 60px;
}
.jpview-button:hover {
background-color: var(--jp-layout-color3);
Expand Down Expand Up @@ -202,4 +202,4 @@
display: flex;
justify-content: center;
align-items: center;
}
}