Skip to content

Commit

Permalink
Merge pull request #446 from visualize-admin/updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ptbrowne authored Mar 9, 2022
2 parents 25036c0 + 2fffee7 commit 7d74a74
Show file tree
Hide file tree
Showing 23 changed files with 2,078 additions and 2,075 deletions.
1 change: 1 addition & 0 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ jobs:
- run: yarn lint
- run: yarn typecheck
- run: yarn test
- run: yarn build:npm
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ node_modules
/app/locales/_build
/app/locales/**/*.js
/app/locales/**/*.mjs
/app/locales/**/*.ts
/app/public/dist/**/*.js
/packages/**/dist
/app/dist
.now

.env*.local

__diff_output__
__diff_output__
28 changes: 28 additions & 0 deletions app/browser/dataset-browser.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { AppLayout } from "../components/layout";
import { SelectDatasetStep } from "../configurator/components/select-dataset-step";
import { ConfiguratorStateProvider } from "../src";

export type BrowseParams = {
type?: "theme" | "organization" | "dataset";
subtype?: "theme" | "organization";
iri?: string;
subiri?: string;
topic?: string;
search?: string;
order?: string;
includeDrafts?: boolean;
dataset?: string;
};

// Generic component for all browse subpages
export const DatasetBrowser = () => {
return (
<AppLayout>
<ConfiguratorStateProvider chartId="new" allowDefaultRedirect={false}>
<SelectDatasetStep />
</ConfiguratorStateProvider>
</AppLayout>
);
};

export default DatasetBrowser;
1 change: 1 addition & 0 deletions app/browser/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as DatasetBrowser } from "./dataset-browser";
1 change: 0 additions & 1 deletion app/charts/shared/brush.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { bisector, brushX, select, Selection, Transition } from "d3";
import "d3-transition";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { useFormatFullDateAuto } from "../../configurator/components/ui-helpers";
import { Observation } from "../../domain/data";
Expand Down
2 changes: 1 addition & 1 deletion app/charts/shared/chart-helpers.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { InternMap } from "d3-array";
import { InternMap } from "d3";
import { merge } from "lodash";
import { LineConfig } from "../../configurator";
import { FIELD_VALUE_NONE } from "../../configurator/constants";
Expand Down
2 changes: 1 addition & 1 deletion app/charts/shared/imputation.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { interpolate } from "d3-interpolate";
import { interpolate } from "d3";
import { ChartConfig, isAreaConfig } from "../../configurator";

export const interpolateZerosValue = () => {
Expand Down
3 changes: 1 addition & 2 deletions app/components/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import VisuallyHidden from "@reach/visually-hidden";
import { ChangeEvent, ReactNode, useCallback, useMemo } from "react";
import { DayPickerInputProps, DayPickerProps } from "react-day-picker";
import DayPickerInput from "react-day-picker/DayPickerInput";
import "react-day-picker/lib/style.css";
import {
Box,
Button,
Expand Down Expand Up @@ -485,7 +484,7 @@ export const FieldSetLegend = ({
fontWeight: "regular",
fontSize: [1, 2, 2],
mb: 1,
color: "monochrome600",
color: "monochrome800",
}}
as="legend"
>
Expand Down
2 changes: 1 addition & 1 deletion app/configurator/components/dataset-browse.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DataCubeOrganization, DataCubeTheme } from "../../graphql/query-hooks";
import { BrowseParams } from "../../pages/browse";
import { BrowseParams } from "../../browser/dataset-browser";
import { getFiltersFromParams } from "./dataset-browse";

const ctx = {
Expand Down
2 changes: 1 addition & 1 deletion app/configurator/components/dataset-browse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import SvgIcCategories from "../../icons/components/IcCategories";
import SvgIcClose from "../../icons/components/IcClose";
import SvgIcOrganisations from "../../icons/components/IcOrganisations";
import { useLocale } from "../../locales/use-locale";
import { BrowseParams } from "../../pages/browse";
import { BrowseParams } from "../../browser/dataset-browser";
import isAttrEqual from "../../utils/is-attr-equal";
import truthy from "../../utils/truthy";
import Tag from "./Tag";
Expand Down
1 change: 0 additions & 1 deletion app/configurator/components/field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { t } from "@lingui/macro";
import { extent, TimeLocaleObject, timeParse } from "d3";
import get from "lodash/get";
import { ChangeEvent, ReactNode, useCallback, useMemo, useState } from "react";
import "react-day-picker/lib/style.css";
import { Flex } from "theme-ui";
import {
Option,
Expand Down
3 changes: 2 additions & 1 deletion app/configurator/components/ui-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ import {
timeSecond,
timeWeek,
timeYear,
TimeLocaleObject,
timeParse,
} from "d3";
import { TimeLocaleObject, timeParse } from "d3-time-format";
import { memoize } from "lodash";
import { useMemo } from "react";
import { ChartProps } from "../../charts/shared/use-chart-state";
Expand Down
1 change: 0 additions & 1 deletion app/configurator/interactive-filters/editor-time-brush.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Trans } from "@lingui/macro";
import { bisector, brushX, scaleTime, select, Selection } from "d3";
import "d3-transition";
import React, { useCallback, useEffect, useRef } from "react";
import { Flex, Box, Text } from "theme-ui";
import { Label } from "../../components/form";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
select,
Selection,
} from "d3";
import "d3-transition";
import React, { useCallback, useEffect, useRef } from "react";
import { Box, Flex, Text } from "theme-ui";
import { Label } from "../../components/form";
Expand Down
2 changes: 1 addition & 1 deletion app/docs/color-ramp.docs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { markdown } from "catalog";
import { interpolateBrBG, interpolateOranges } from "d3-scale-chromatic";
import { interpolateBrBG, interpolateOranges } from "d3";
import { Box } from "theme-ui";
import { ColorRamp } from "../configurator/components/chart-controls/color-ramp";

Expand Down
7 changes: 6 additions & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@interactivethings/visualize-app",
"version": "0.5.0",
"version": "3.4.9",
"publishConfig": {
"access": "public"
},
Expand All @@ -21,7 +21,9 @@
"@deck.gl/layers": "8.6.7",
"@deck.gl/mesh-layers": "8.6.7",
"@deck.gl/react": "8.6.7",
"@emotion/react": "11.4.0",
"@juggle/resize-observer": "^3.2.0",
"@lingui/core": "3.10.4",
"@lingui/react": "^3.2.3",
"@mdx-js/react": "^1.6.22",
"@next/bundle-analyzer": "^11.0.1",
Expand All @@ -44,6 +46,8 @@
"core-js": "^3.15.1",
"cors": "^2.8.5",
"d3": "^6.7.0",
"d3-format": "2.0.0",
"d3-time-format": "3.0.0",
"dataloader": "^2.0.0",
"downshift": "^6.0.6",
"file-saver": "^2.0.2",
Expand All @@ -61,6 +65,7 @@
"isomorphic-unfetch": "^3.0.0",
"lodash": "^4.17.20",
"lunr": "^2.3.9",
"make-plural": "6.2.2",
"maplibre-gl": "^2.1.6",
"micro-cors": "^0.1.1",
"nanoid": "^3.1.12",
Expand Down
5 changes: 3 additions & 2 deletions app/pages/browse/[type].tsx
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import { GenericBrowse } from "./index";
export default GenericBrowse;
import { DatasetBrowser } from "../../browser";

export default DatasetBrowser;
5 changes: 2 additions & 3 deletions app/pages/browse/[type]/[iri].tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { GenericBrowse } from "../index";
import { GetServerSideProps } from "next";
import { queryLatestPublishedCubeFromUnversionedIri } from "../../../rdf/query-cube-metadata";
import { defaultLocale } from "../../../src";
export default GenericBrowse;

import { DatasetBrowser } from "../../../browser";
export default DatasetBrowser;
/**
* Heuristic to check if a dataset IRI is versioned.
* Versioned iris look like https://blabla/<number/
Expand Down
4 changes: 2 additions & 2 deletions app/pages/browse/[type]/[iri]/[subtype]/[subiri].tsx
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import { GenericBrowse } from "../../../index";
export default GenericBrowse;
import { DatasetBrowser } from "../../../../../browser";
export default DatasetBrowser;
34 changes: 2 additions & 32 deletions app/pages/browse/index.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
import React from "react";
import { AppLayout } from "../../components/layout";
import { SelectDatasetStep } from "../../configurator/components/select-dataset-step";
import { ConfiguratorStateProvider } from "../../src";
import { DatasetBrowser } from "../../browser";

export type BrowseParams = {
type?: "theme" | "organization" | "dataset";
subtype?: "theme" | "organization";
iri?: string;
subiri?: string;
topic?: string;
search?: string;
order?: string;
includeDrafts?: boolean;
dataset?: string;
};

// Generic component for all browse subpages
export const GenericBrowse = () => {
return (
<AppLayout>
<ConfiguratorStateProvider chartId="new" allowDefaultRedirect={false}>
<SelectDatasetStep />
</ConfiguratorStateProvider>
</AppLayout>
);
};

const IndexBrowse = () => {
return <GenericBrowse />;
};

export default IndexBrowse;
export default DatasetBrowser;
1 change: 1 addition & 0 deletions app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export {
ConfiguratorStateProvider,
useConfiguratorState,
} from "../configurator";
export { DatasetBrowser } from "../browser";
export { LocaleProvider, useLocale } from "../locales/use-locale";
export {
i18n,
Expand Down
2 changes: 1 addition & 1 deletion lingui.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
},
],
format: "po",
compileNamespace: "cjs",
compileNamespace: "ts",
sourceLocale: "en",
fallbackLocales: {
default: "en",
Expand Down
Loading

0 comments on commit 7d74a74

Please sign in to comment.