Skip to content

Commit

Permalink
fix: Preferentially choose x dimension as non region for column
Browse files Browse the repository at this point in the history
  • Loading branch information
ptbrowne committed Sep 27, 2022
1 parent d338c3f commit 0566a9e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion app/charts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ascending, group } from "d3";
import produce from "immer";
import get from "lodash/get";
import groupBy from "lodash/groupBy";
import sortBy from "lodash/sortBy";

import { DEFAULT_SYMBOL_LAYER_COLORS } from "@/charts/map/constants";
import {
Expand Down Expand Up @@ -34,6 +35,8 @@ import {
getCategoricalDimensions,
getGeoDimensions,
getTimeDimensions,
isGeoCoordinatesDimension,
isGeoShapesDimension,
} from "../domain/data";
import { DimensionMetadataFragment } from "../graphql/query-hooks";
import { DataCubeMetadata } from "../graphql/types";
Expand Down Expand Up @@ -166,7 +169,9 @@ export const getInitialConfig = ({
fields: {
x: {
componentIri: findPreferredDimension(
dimensions,
sortBy(dimensions, (x) =>
isGeoCoordinatesDimension(x) || isGeoShapesDimension(x) ? 1 : -1
),
"TemporalDimension"
).iri,
sorting: DEFAULT_SORTING,
Expand Down
3 changes: 1 addition & 2 deletions cypress/integration/filters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ describe("Filters", () => {
cy.findByText("1. production region");
cy.findByText("2. stand structure");
cy.findByText("3. evaluation type");
cy.findByText("4. Inventory");
cy.findByText("5. unit of evaluation");
cy.findByText("4. unit of evaluation");
});

selectors.edition
Expand Down

0 comments on commit 0566a9e

Please sign in to comment.