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

Release/1.2.0 #487

Merged
merged 31 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
07f0c89
Merge pull request #454 from MetaCell/master
enicolasgomez Dec 16, 2022
f7c562d
#443 feat: Add ability to customize DicomViewer toolbar
afonsobspinto Dec 12, 2022
57e34ed
#442 feat: Update customToolbar styling strategy
afonsobspinto Dec 20, 2022
30421b9
#445 feat: Add ability to customize BigImageViewer toolbar
afonsobspinto Dec 12, 2022
1bccd83
#444 feat: Add loader to Dicom Viewer
afonsobspinto Dec 12, 2022
eaa1d7f
#446 fix: Fix connectivity viewer circular dependency on showcase
afonsobspinto Dec 20, 2022
a465f4c
Merge pull request #460 from MetaCell/feature/446
enicolasgomez Dec 20, 2022
57a40f5
Merge pull request #458 from MetaCell/features/443_444
enicolasgomez Dec 20, 2022
c222e10
#459 fix: Set draco decoder path to local node_modules
afonsobspinto Dec 20, 2022
f6f98f8
#459 feat: Add dracoDecoderPath prop
afonsobspinto Dec 21, 2022
3e41f8f
#459 feat: Update default draco decoder
afonsobspinto Dec 26, 2022
fdb3e35
#445 chore: Host big image viewer example
afonsobspinto Dec 28, 2022
5fcb537
#133 fix: Update VR Canvas to the latest engine mesh factory
afonsobspinto Dec 28, 2022
028a0a4
#133 fix: Remove deprecated/unused features from VR Canvas
afonsobspinto Dec 28, 2022
ecce8b3
Merge pull request #461 from MetaCell/feature/459
enicolasgomez Jan 10, 2023
2e7abab
added onRenderTabSet and custom icons extension
emekauja Jan 10, 2023
c899f13
added tabButtons extension
emekauja Jan 10, 2023
f19cf31
add extension to example app showcase
emekauja Jan 11, 2023
6ca3efb
added custom close icon
emekauja Jan 11, 2023
79f16b0
feature/467 fix: refine example apps & yalc
emekauja Jan 22, 2023
06ffe89
#467 moving dependencies to peer dependencies
ddelpiano Jan 25, 2023
28d5adc
fix: remove redundant setup script
emekauja Jan 26, 2023
d1bcb7e
#z-rotation fix: Add back some fixes to get Vector3D for
aranega Jan 26, 2023
daca493
#z-rotation feat: Add special tags to ease future three.js lib update
aranega Jan 26, 2023
9ac6b07
Merge pull request #471 from MetaCell/feature/467
ddelpiano Jan 30, 2023
04d724a
Merge branch 'development' of github.com:MetaCell/geppetto-meta into …
aranega Jan 30, 2023
1e9447d
#z-rotation fix: Force upate if Z axis rotation is applied
aranega Jan 30, 2023
8772b7d
Merge pull request #464 from MetaCell/feature/445
enicolasgomez Feb 8, 2023
20593f4
Merge pull request #465 from MetaCell/feature/133
enicolasgomez Feb 8, 2023
33b748c
Merge pull request #480 from MetaCell/fix/z-rotation
enicolasgomez Feb 8, 2023
7b90d65
Changes for 1.2.0
enicolasgomez Mar 21, 2023
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
6 changes: 3 additions & 3 deletions examples/redux-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"@fortawesome/react-fontawesome": "^0.1.9",
"@material-ui/core": "^4.9.14",
"@material-ui/icons": "^4.11.2",
"@metacell/geppetto-meta-client": "^1.1.0",
"@metacell/geppetto-meta-core": "^1.1.0",
"@metacell/geppetto-meta-ui": "^1.1.0",
"@metacell/geppetto-meta-client": "file:.yalc/@metacell/geppetto-meta-client",
"@metacell/geppetto-meta-core": "file:.yalc/@metacell/geppetto-meta-core",
"@metacell/geppetto-meta-ui": "file:.yalc/@metacell/geppetto-meta-ui",
"@nosferatu500/react-sortable-tree": "3.0.5",
"@pmmmwh/react-refresh-webpack-plugin": "0.4.3",
"@reduxjs/toolkit": "^1.5.1",
Expand Down
17 changes: 17 additions & 0 deletions examples/redux-react-app/src/app/icons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export const CloseIcon = (props) => (
<svg
width={8}
height={8}
fill="none"
stroke="currentColor"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path
d="m.75.75 6.5 6.5m0-6.5-6.5 6.5"
stroke="#000"
fillOpacity={0.2}
strokeWidth={1.5}
/>
</svg>
);
83 changes: 65 additions & 18 deletions examples/redux-react-app/src/app/showcase.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { getLayoutManagerInstance } from "@metacell/geppetto-meta-client/common/
import CircularProgress from '@material-ui/core/CircularProgress';
import { useStore } from 'react-redux';
import { makeStyles } from '@material-ui/core/styles';
import { Button } from '@material-ui/core';
import { CloseIcon } from './icons';

const useStyles = makeStyles({
layoutContainer: {
Expand All @@ -24,24 +26,69 @@ const MainLayout = () => {
const store = useStore();
const [Component, setComponent] = useState(undefined);

useEffect(() => {
// Workaround because getLayoutManagerInstance
// is undefined when calling it in global scope
// Need to wait until store is ready ...
// TODO: find better way to retrieve the LayoutManager component!
if (Component === undefined) {
const myManager = getLayoutManagerInstance();
if (myManager) {
setComponent(myManager.getComponent());
}
}
}, [store])
useEffect(() => {
// Workaround because getLayoutManagerInstance
// is undefined when calling it in global scope
// Need to wait until store is ready ...
// TODO: find better way to retrieve the LayoutManager component!
if (Component === undefined) {
const myManager = getLayoutManagerInstance();
if (myManager) {
setComponent(
myManager.getComponent(
{
icons: {
close: <CloseIcon />,
},
tabSetButtons: [
({ panel }) => {
return (
<Button
key={panel.getId()}
variant="outlined"
color="primary"
onClick={() => {
console.log('tab-set button')
}}
>
Add
</Button>
);
},
],
tabButtons: [
({ panel }) => {
return (
<Button
key={panel.getId()}
variant="filled"
color="secondary"
onClick={() => {
console.log('tab button')
}}
>
Minimize
</Button>
);
},
],
})
);
}
}
}, [Component, store]);
console.log(Component, 'Component');


return (
<div className={classes.layoutContainer}>
{Component === undefined ? <CircularProgress /> : <Component />}
</div>
);
}
return (
<div className={classes.layoutContainer}>
{Component === undefined ? (
<CircularProgress />
) : (
<Component />
)}
</div>
);
};

export default MainLayout;
3 changes: 3 additions & 0 deletions examples/redux-react-app/src/icons/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions geppetto-showcase/assets/brain_mri.dzi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><Image xmlns="http://schemas.microsoft.com/deepzoom/2008" TileSize="128" Overlap="2" Format="png"><Size Width="1000" Height="714"/></Image>
Binary file added geppetto-showcase/assets/brain_mri_files/0/0_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added geppetto-showcase/assets/brain_mri_files/1/0_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added geppetto-showcase/assets/brain_mri_files/10/0_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added geppetto-showcase/assets/brain_mri_files/10/0_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added geppetto-showcase/assets/brain_mri_files/10/0_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added geppetto-showcase/assets/brain_mri_files/10/1_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added geppetto-showcase/assets/brain_mri_files/10/1_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added geppetto-showcase/assets/brain_mri_files/10/2_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added geppetto-showcase/assets/brain_mri_files/10/6_0.png
Binary file added geppetto-showcase/assets/brain_mri_files/10/6_5.png
Binary file added geppetto-showcase/assets/brain_mri_files/10/7_0.png
Binary file added geppetto-showcase/assets/brain_mri_files/10/7_5.png
Binary file added geppetto-showcase/assets/brain_mri_files/2/0_0.png
Binary file added geppetto-showcase/assets/brain_mri_files/3/0_0.png
Binary file added geppetto-showcase/assets/brain_mri_files/4/0_0.png
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class SimpleInstancesExample extends Component {
onSelection={this.onSelection}
onMount={this.onMount}
onHoverListeners={{ 'hoverId':this.hoverHandler }}
dracoDecoderPath={'https://raw.githubusercontent.com/mrdoob/three.js/dev/examples/jsm/libs/draco/'}
/>
</>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ const styles = {
},
};

const data = 'https://s3.amazonaws.com/patient-hm-august-2017/Histology/HM_1243_FLIPPED_DZ_tif.dzi';
const data = `${window.location.origin}/assets/brain_mri.dzi`;

class BigImageViewerExample extends Component {

render () {
const { classes } = this.props;
return (
<div style={{ position: 'relative' }} className={classes.bigImageViewer}>
<BigImageViewer id="BigImageViewerContainer" data={data} />
<BigImageViewer id="BigImageViewerContainer" data={data}
toolbarOptions={{ innerDivStyles: { backgroundColor: 'rgb(0,0,0,0);' } }}/>
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { Component } from 'react';
import ModelFactory from '@metacell/geppetto-meta-core/ModelFactory';
import Manager from '@metacell/geppetto-meta-core/ModelManager';
import Resources from '@metacell/geppetto-meta-core/Resources';
import model from './model';
import { Force } from '@metacell/geppetto-meta-ui/connectivity-viewer/layouts/Force';
import ConnectivityComponent from '@metacell/geppetto-meta-ui/connectivity-viewer/ConnectivityComponent';
import { withStyles } from '@material-ui/core';
import ModelFactory from '@metacell/geppetto-meta-core/ModelFactory';
import Manager from '@metacell/geppetto-meta-core/ModelManager';
import Resources from '@metacell/geppetto-meta-core/Resources';

const styles = {
connectivity: {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default class DicomViewerExample extends Component {
onCtrlClick="toggleMode"
showDownloadButton={true}
onLoaded={this.onLoaded}
toolbarOptions={{ innerDivStyles: { backgroundColor: 'rgb(0,0,0,0);' } }}
/>
</div>
) : <Loader/>
Expand Down
10 changes: 6 additions & 4 deletions geppetto.js/geppetto-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metacell/geppetto-meta-client",
"version": "1.1.0",
"version": "1.2.0",
"description": "Geppetto web frontend. Geppetto is an open-source platform to build web-based tools to visualize and simulate neuroscience data and models.",
"keywords": [
"geppetto",
Expand All @@ -27,13 +27,11 @@
},
"dependencies": {
"@material-ui/core": "^4.1.3",
"@metacell/geppetto-meta-core": "1.1.0",
"@metacell/geppetto-meta-ui": "1.1.0",
"pako": "^1.0.3",
"react": "^17.0.2",
"react-redux": "^7.2.3",
"react-rnd": "^7.3.0",
"redux": "^4.1.0",
"react-redux": "^7.2.3",
"url-join": "^4.0.0"
},
"devDependencies": {
Expand All @@ -49,6 +47,10 @@
"jest": "^24.9.0",
"less": "^3.9.0"
},
"peerDepedencies": {
"@metacell/geppetto-meta-core": "1.2.0",
"@metacell/geppetto-meta-ui": "1.2.0"
},
"buildOptions": {
"emitEntryPoint": true,
"compile": {
Expand Down
71 changes: 59 additions & 12 deletions geppetto.js/geppetto-client/src/common/layout/LayoutManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as FlexLayout from '@metacell/geppetto-meta-ui/flex-layout/src/index';
import Actions from '@metacell/geppetto-meta-ui/flex-layout/src/model/Actions';
import DockLocation from '@metacell/geppetto-meta-ui/flex-layout/src/DockLocation';
import Model from '@metacell/geppetto-meta-ui/flex-layout/src/model/Model';
import { WidgetStatus, Widget, ComponentMap, TabsetPosition } from './model';
import { WidgetStatus, Widget, ComponentMap, TabsetPosition, IComponentConfig } from './model';
import { withStyles, createStyles } from '@material-ui/core/styles'
import WidgetFactory from "./WidgetFactory";
import TabsetIconFactory from "./TabsetIconFactory";
Expand Down Expand Up @@ -107,33 +107,80 @@ class LayoutManager {
*
* @param panel
* @param renderValues
* @param tabSetButtons
*/
onRenderTabSet = (panel, renderValues) => {
if (panel.getType() === "tabset" && this.enableMinimize) {
if (panel.getChildren().length > 0) {
renderValues.buttons.push(<div key={panel.getId()} className="fa fa-window-minimize customIconFlexLayout"
onClick={() => {
this.minimizeWidget(panel.getActiveNode().getId())
}} />);
onRenderTabSet = (panel, renderValues, tabSetButtons) => {
if (panel.getType() === 'tabset') {
if (this.enableMinimize) {
if (panel.getChildren().length > 0) {
renderValues.buttons.push(
<div
key={panel.getId()}
className="fa fa-window-minimize customIconFlexLayout"
onClick={() => {
this.minimizeWidget(panel.getActiveNode().getId());
}}
/>
);
}
}

if (Array.isArray(tabSetButtons) && tabSetButtons.length > 0) {
tabSetButtons.forEach(Button => {
renderValues.stickyButtons.push(
<Button key={panel.getId()} panel={panel} />
);
});
}
}
}
};

/**
* Handle rendering of tab set.
*
* @param panel
* @param renderValues
* @param tabButtons
*/
onRenderTab = (panel, renderValues, tabButtons) => {
if (panel.getType() === 'tab') {
if (Array.isArray(tabButtons) && tabButtons.length > 0) {
tabButtons.forEach(Button => {
renderValues.buttons.push(
<Button key={panel.getId()} panel={panel} />
);
});
}
}
};

/**
* Layout wrapper component
*
* @memberof Component
*
*/
Component = (layoutManager: LayoutManager) => ({ classes }) => (
Component = (layoutManager: LayoutManager, config?: IComponentConfig) => ({
classes,
}) => (
<div className={classes.container}>
<div className={classes.flexlayout}>
<FlexLayout.Layout
model={this.model}
factory={this.factory}
icons={config?.icons}
// iconFactory={layoutManager.iconFactory.bind(this)}
onAction={action => layoutManager.onAction(action)}
onRenderTab={(node, renderValues) => layoutManager.onRenderTabSet(node, renderValues)}
onRenderTab={(node, renderValues) =>
layoutManager.onRenderTab(node, renderValues, config?.tabButtons)
}
onRenderTabSet={(node, renderValues) => {
layoutManager.onRenderTabSet(
node,
renderValues,
config?.tabSetButtons
);
}}
/>
</div>
</div>
Expand All @@ -143,7 +190,7 @@ class LayoutManager {
* Get the layout component.
* @memberof Control
*/
getComponent = () => withStyles(styles)(this.Component(this));
getComponent = (config?: IComponentConfig) => withStyles(styles)(this.Component(this, config));

/**
* Create a new tab set.
Expand Down
Loading