Skip to content

Commit

Permalink
Merge pull request #83 from FezVrasta/light-export
Browse files Browse the repository at this point in the history
feat: new light export
  • Loading branch information
jourdain authored Oct 27, 2022
2 parents db5ba58 + a8c4fb9 commit f4de1ed
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 52 deletions.
14 changes: 14 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@
"main": "dist/umd/react-vtk.js",
"module": "dist/esm/index.js",
"source": "src/index.js",
"exports": {
".": {
"browser": "./dist/cjs/react-vtk.js",
"umd": "./dist/umd/react-vtk.js",
"import": "./dist/esm/index.js",
"package.json": "./package.json",
"default": "./dist/esm/index.js"
},
"./light": {
"import": "./dist/esm/light.js",
"default": "./dist/esm/light.js",
"package.json": "./package.json"
}
},
"dependencies": {
"@babel/runtime": "^7.12.5"
},
Expand Down
53 changes: 1 addition & 52 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,4 @@
// Ensure vtk.js classes available for Algorithm and Reader
import './AvailableClasses';

// Get React pieces
import Core from './core/index';
import Representations from './representations/index';

import {
ViewContext,
RepresentationContext,
DataSetContext,
FieldsContext,
DownstreamContext,
} from './core/View';

// Core
export const VolumeRepresentation = Core.VolumeRepresentation;
export const SliceRepresentation = Core.SliceRepresentation;
export const VolumeController = Core.VolumeController;
export const PointData = Core.PointData;
export const PolyData = Core.PolyData;
export const Reader = Core.Reader;
export const ShareDataSet = Core.ShareDataSet;
export const View = Core.View;
export const GeometryRepresentation = Core.GeometryRepresentation;
export const Geometry2DRepresentation = Core.Geometry2DRepresentation;
export const GlyphRepresentation = Core.GlyphRepresentation;
export const ImageData = Core.ImageData;
export const DataArray = Core.DataArray;
export const FieldData = Core.FieldData;
export const Algorithm = Core.Algorithm;
export const Calculator = Core.Calculator;
export const CellData = Core.CellData;
export const MultiViewRoot = Core.MultiViewRoot;

// Representations
export const PointCloudRepresentation =
Representations.PointCloudRepresentation;
export const VolumeDataRepresentation =
Representations.VolumeDataRepresentation;

// Context
export const Contexts = {
ViewContext,
RepresentationContext,
DataSetContext,
FieldsContext,
DownstreamContext,
};

export default {
Core,
Representations,
Contexts,
};
export * from './light';
52 changes: 52 additions & 0 deletions src/light.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Get React pieces
import Core from './core/index';
import Representations from './representations/index';

import {
ViewContext,
RepresentationContext,
DataSetContext,
FieldsContext,
DownstreamContext,
} from './core/View';

// Core
export const VolumeRepresentation = Core.VolumeRepresentation;
export const SliceRepresentation = Core.SliceRepresentation;
export const VolumeController = Core.VolumeController;
export const PointData = Core.PointData;
export const PolyData = Core.PolyData;
export const Reader = Core.Reader;
export const ShareDataSet = Core.ShareDataSet;
export const View = Core.View;
export const GeometryRepresentation = Core.GeometryRepresentation;
export const Geometry2DRepresentation = Core.Geometry2DRepresentation;
export const GlyphRepresentation = Core.GlyphRepresentation;
export const ImageData = Core.ImageData;
export const DataArray = Core.DataArray;
export const FieldData = Core.FieldData;
export const Algorithm = Core.Algorithm;
export const Calculator = Core.Calculator;
export const CellData = Core.CellData;
export const MultiViewRoot = Core.MultiViewRoot;

// Representations
export const PointCloudRepresentation =
Representations.PointCloudRepresentation;
export const VolumeDataRepresentation =
Representations.VolumeDataRepresentation;

// Context
export const Contexts = {
ViewContext,
RepresentationContext,
DataSetContext,
FieldsContext,
DownstreamContext,
};

export default {
Core,
Representations,
Contexts,
};

0 comments on commit f4de1ed

Please sign in to comment.