Skip to content

Commit

Permalink
Improve the showing of the msa viewer.
Browse files Browse the repository at this point in the history
  • Loading branch information
yjcyxky committed Mar 27, 2024
1 parent 8c3c695 commit 4f1cd17
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion studio/src/NodeInfoPanel/AlignmentViewer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { AlignmentViewer as ReactAlignmentViewer } from 'react-alignment-viewer'
import type { AlignmentData } from '../index.t';
import biomsa from 'biomsa';
import { expectedSpeciesOrder } from '@/components/util';
import { Select } from 'antd';

const { Option } = Select;

import './index.less';

Expand Down Expand Up @@ -71,6 +74,7 @@ const AlignmentViewer: React.FC<AlignmentViewerProps> = (props) => {
const [dataset, setDataset] = React.useState<string>("");
const [errorMsg, setErrorMsg] = React.useState<string>("No data");
const [loading, setLoading] = React.useState<boolean>(false);
const [tileHeight, setTileHeight] = React.useState<string>('20');

useEffect(() => {
if (props.data && props.data.length > 0) {
Expand Down Expand Up @@ -113,7 +117,21 @@ const AlignmentViewer: React.FC<AlignmentViewerProps> = (props) => {
<Spin spinning={loading}>
<Empty description={errorMsg} />
</Spin> :
<ReactAlignmentViewer data={dataset} height={"500px"} />
<>
<Row style={{ display: 'flex', justifyContent: 'flex-start', alignItems: 'center', marginBottom: '10px' }}>
If you see the alignment is not properly displayed, you can adjust the tile height:
<Select defaultValue={tileHeight} style={{ width: 80, marginLeft: '10px' }} onChange={(value) => {
setTileHeight(value);
}}>
<Option value="20">20px</Option>
<Option value="30">30px</Option>
<Option value="40">40px</Option>
<Option value="50">50px</Option>
<Option value="60">60px</Option>
</Select>
</Row>
<ReactAlignmentViewer data={dataset} tileheight={tileHeight} height={null} key={tileHeight} />
</>
}
</Row>
}
Expand Down

0 comments on commit 4f1cd17

Please sign in to comment.