Skip to content

Commit

Permalink
Preview for the HCS images (#2489) - Data Sharing Service: z-plate & …
Browse files Browse the repository at this point in the history
…time point selectors
  • Loading branch information
rodichenko committed Feb 22, 2022
1 parent 11818ec commit 3a41916
Show file tree
Hide file tree
Showing 13 changed files with 420 additions and 124 deletions.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -20,57 +20,56 @@ import {Icon} from 'antd';
import Channel from './channel';
import styles from './hcs-image-controls.css';

@inject('hcsViewerState')
@observer
class HcsImageChannelsControl extends React.Component {
render () {
const {hcsViewerState = {}} = this.props;
const {
channels = [],
pending
} = hcsViewerState;
if (pending && channels.length === 0) {
return (
<div className={styles.channels}>
<i className="cp-text-not-important">Loading channels...</i>
</div>
);
}
if (channels.length === 0) {
return null;
}
function HcsImageChannelsControl (
{
hcsViewerState
}
) {
const {
channels = [],
pending
} = hcsViewerState || {};
if (pending && channels.length === 0) {
return (
<div className={styles.channels}>
<div className={styles.header}>
Channels:
{pending && (<Icon type="loading" style={{marginLeft: 5}} />)}
</div>
{
channels.map(channel => (
<Channel
key={channel.identifier}
identifier={channel.identifier}
name={channel.name}
visible={channel.visible}
color={channel.color}
domain={channel.domain}
contrastLimits={channel.contrastLimits}
loading={pending}
onVisibilityChanged={
(visible) => hcsViewerState.changeChannelVisibility(channel, visible)
}
onContrastLimitsChanged={
(limits) => hcsViewerState.changeChannelContrastLimits(channel, limits)
}
onColorChanged={
(color) => hcsViewerState.changeChannelColor(channel, color)
}
/>
))
}
<i className="cp-text-not-important">Loading channels...</i>
</div>
);
}
if (channels.length === 0) {
return null;
}
return (
<div className={styles.channels}>
<div className={styles.header}>
Channels:
{pending && (<Icon type="loading" style={{marginLeft: 5}} />)}
</div>
{
channels.map(channel => (
<Channel
key={channel.identifier}
identifier={channel.identifier}
name={channel.name}
visible={channel.visible}
color={channel.color}
domain={channel.domain}
contrastLimits={channel.contrastLimits}
loading={pending}
onVisibilityChanged={
(visible) => hcsViewerState.changeChannelVisibility(channel, visible)
}
onContrastLimitsChanged={
(limits) => hcsViewerState.changeChannelContrastLimits(channel, limits)
}
onColorChanged={
(color) => hcsViewerState.changeChannelColor(channel, color)
}
/>
))
}
</div>
);
}

export default HcsImageChannelsControl;
export default inject('hcsViewerState')(observer(HcsImageChannelsControl));
Loading

0 comments on commit 3a41916

Please sign in to comment.