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

Sorting mappings in UI #3864

Merged
merged 6 commits into from
Mar 11, 2019
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md).
- webKnossos now comes with a list of sample datasets that can be automatically downloaded and imported from the menu. [#3725](https://github.com/scalableminds/webknossos/pull/3725)
- Added a shortcut (Q) and button in the actions dropdown to screenshot the tracing views. The screenshots will contain everything that is visible in the tracing views, so feel free to disable the crosshairs in the settings or toggle the tree visibility using the (1) and (2) shortcuts before triggering the screenshot. [#3834](https://github.com/scalableminds/webknossos/pull/3834)
- The dataset settings within the tracing view allow to select between different loading strategies now ("best quality first" and "progressive quality"). Additionally, the rendering can use different magnifications as a fallback (instead of only one magnification). [#3801](https://github.com/scalableminds/webknossos/pull/3801)
- The mapping selection dropbown is now sorted alphabetically. [#3864](https://github.com/scalableminds/webknossos/pull/3864)

### Changed
- Tweaked the highlighting of the active node. The inner node looks exactly as a non-active node and is not round, anymore. An active node is circled by a "halo". In arbitrary mode, the halo is hidden and the active node is round. [#3868](https://github.com/scalableminds/webknossos/pull/3868)
Expand Down
15 changes: 9 additions & 6 deletions frontend/javascripts/oxalis/view/right-menu/mapping_info_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { setMappingEnabledAction } from "oxalis/model/actions/settings_actions";
import Cube from "oxalis/model/bucket_data_handling/data_cube";
import Model from "oxalis/model";
import message from "messages";
import * as Utils from "libs/utils";

const { Option } = Select;

Expand Down Expand Up @@ -234,7 +235,6 @@ class MappingInfoView extends React.Component<Props, State> {
if (!hasSegmentation()) {
return "No segmentation available";
}

const availableMappings =
this.props.segmentationLayer != null && this.props.segmentationLayer.mappings != null
? this.props.segmentationLayer.mappings
Expand Down Expand Up @@ -279,11 +279,14 @@ class MappingInfoView extends React.Component<Props, State> {
onChange={this.handleChangeMapping}
notFoundContent="No mappings found."
>
{availableMappings.map(mapping => (
<Option key={mapping} value={mapping}>
{mapping}
</Option>
))}
{availableMappings
.slice()
.sort(Utils.localeCompareBy(([]: Array<string>), mapping => mapping))
.map(mapping => (
<Option key={mapping} value={mapping}>
{mapping}
</Option>
))}
</Select>
) : null}
</div>
Expand Down