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

Show voxel size in details sidebar in new datasets tab #6755

Merged
merged 2 commits into from
Jan 17, 2023
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
8 changes: 6 additions & 2 deletions frontend/javascripts/dashboard/folders/details_sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { Result, Spin, Tag, Tooltip } from "antd";
import { stringToColor } from "libs/format_utils";
import { pluralize } from "libs/utils";
import _ from "lodash";
import { DatasetExtentRow } from "oxalis/view/right-border-tabs/dataset_info_tab_view";
import {
DatasetExtentRow,
VoxelSizeRow,
} from "oxalis/view/right-border-tabs/dataset_info_tab_view";
import React, { useEffect } from "react";
import { APIMaybeUnimportedDataset, Folder } from "types/api_flow_types";
import { DatasetLayerTags, DatasetTags, TeamTags } from "../advanced_dataset/dataset_table";
Expand Down Expand Up @@ -78,13 +81,14 @@ function DatasetDetails({ selectedDataset }: { selectedDataset: APIMaybeUnimport
{selectedDataset.isActive && (
<div>
<span className="sidebar-label">Voxel Size & Extent</span>
<div className="info-tab-block" style={{ marginTop: -6 }}>
<div className="info-tab-block" style={{ marginTop: -3 }}>
<table
style={{
fontSize: 14,
}}
>
<tbody>
<VoxelSizeRow dataset={selectedDataset} />
<DatasetExtentRow dataset={selectedDataset} />
</tbody>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,24 @@ export function DatasetExtentRow({ dataset }: { dataset: APIDataset }) {
);
}

export function VoxelSizeRow({ dataset }: { dataset: APIDataset }) {
return (
<Tooltip title="Dataset voxel size" placement="left">
<tr>
<td
style={{
paddingRight: 4,
verticalAlign: "top",
}}
>
<img className="info-tab-icon" src="/assets/images/icon-voxelsize.svg" alt="Voxel size" />
</td>
<td>{formatScale(dataset.dataSource.scale)}</td>
</tr>
</Tooltip>
);
}

class DatasetInfoTabView extends React.PureComponent<Props, State> {
state: State = {
showJobsDetailsModal: null,
Expand Down Expand Up @@ -608,23 +626,7 @@ class DatasetInfoTabView extends React.PureComponent<Props, State> {
}}
>
<tbody>
<Tooltip title="Dataset voxel size" placement="left">
<tr>
<td
style={{
paddingRight: 4,
verticalAlign: "top",
}}
>
<img
className="info-tab-icon"
src="/assets/images/icon-voxelsize.svg"
alt="Voxel size"
/>
</td>
<td>{formatScale(this.props.dataset.dataSource.scale)}</td>
</tr>
</Tooltip>
<VoxelSizeRow dataset={dataset} />
<DatasetExtentRow dataset={dataset} />
{resolutionInfo}

Expand Down