From a1d03309acdf3b93c7e40c4ab04a96c995f3f009 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Mon, 31 Jan 2022 15:25:54 +0100 Subject: [PATCH 01/21] refactor: Extract OnOffControlTabField to a separate component --- .../components/chart-controls/control-tab.tsx | 36 ++++++++++++++ app/configurator/components/field.tsx | 39 +++++++++++++-- .../interactive-filters-configurator.tsx | 49 +++++++------------ 3 files changed, 90 insertions(+), 34 deletions(-) diff --git a/app/configurator/components/chart-controls/control-tab.tsx b/app/configurator/components/chart-controls/control-tab.tsx index f80f83ae9..2368be7fb 100644 --- a/app/configurator/components/chart-controls/control-tab.tsx +++ b/app/configurator/components/chart-controls/control-tab.tsx @@ -49,6 +49,42 @@ export const ControlTab = ({ ); }; +export const OnOffControlTab = ({ + value, + label, + icon, + checked, + active, + onClick, +}: { + value: string; + label: ReactNode; + icon: string; + checked?: boolean; + active?: boolean; + onClick: (x: string) => void; +}) => { + return ( + + + + + + ); +}; + export const AnnotatorTab = ({ value, checked, diff --git a/app/configurator/components/field.tsx b/app/configurator/components/field.tsx index ecf0a53ea..4f1f10fbe 100644 --- a/app/configurator/components/field.tsx +++ b/app/configurator/components/field.tsx @@ -2,6 +2,7 @@ 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, @@ -14,11 +15,11 @@ import { } from ".."; import { Checkbox, + DayPickerField, Input, Label, Radio, Select, - DayPickerField, } from "../../components/form"; import { DimensionMetaDataFragment, TimeUnit } from "../../graphql/query-hooks"; import { DataCubeMetadata } from "../../graphql/types"; @@ -33,14 +34,17 @@ import { } from "../config-form"; import { FIELD_VALUE_NONE } from "../constants"; import { ColorPickerMenu } from "./chart-controls/color-picker"; -import { AnnotatorTab, ControlTab } from "./chart-controls/control-tab"; +import { + AnnotatorTab, + ControlTab, + OnOffControlTab, +} from "./chart-controls/control-tab"; import { getPalette, getTimeIntervalFormattedSelectOptions, getTimeIntervalWithProps, useTimeFormatLocale, } from "./ui-helpers"; -import "react-day-picker/lib/style.css"; export const ControlTabField = ({ component, @@ -68,6 +72,33 @@ export const ControlTabField = ({ ); }; +export const OnOffControlTabField = ({ + value, + label, + icon, + active, +}: { + value: string; + label: ReactNode; + icon: string; + active?: boolean; +}) => { + const { checked, onClick } = useActiveFieldField({ + value, + }); + + return ( + + ); +}; + export const DataFilterSelect = ({ dimensionIri, label, @@ -754,3 +785,5 @@ export const ChartOptionSelectField = ({ > ); }; + +export const OnOffTabField = () => {}; diff --git a/app/configurator/interactive-filters/interactive-filters-configurator.tsx b/app/configurator/interactive-filters/interactive-filters-configurator.tsx index 33b21417c..a9def523b 100644 --- a/app/configurator/interactive-filters/interactive-filters-configurator.tsx +++ b/app/configurator/interactive-filters/interactive-filters-configurator.tsx @@ -1,22 +1,17 @@ import { Trans } from "@lingui/macro"; import get from "lodash/get"; import { ReactNode, useCallback } from "react"; -import { Box } from "theme-ui"; import { getFieldComponentIri } from "../../charts"; import { chartConfigOptionsUISpec } from "../../charts/chart-config-ui-options"; import { Loading } from "../../components/hint"; import { useDataCubeMetadataWithComponentValuesQuery } from "../../graphql/query-hooks"; import { useLocale } from "../../locales/use-locale"; -import { - ControlTabButton, - ControlTabButtonInner, -} from "../components/chart-controls/control-tab"; +import { OnOffControlTab } from "../components/chart-controls/control-tab"; import { ControlSection, ControlSectionContent, SectionTitle, } from "../components/chart-controls/section"; -import { getIconName } from "../components/ui-helpers"; import { ConfiguratorStateDescribingChart } from "../config-types"; import { useConfiguratorState } from "../configurator-state"; @@ -47,12 +42,14 @@ export const InteractiveFiltersConfigurator = ({ ); // Can chart type have these filter options? - const canFilterLegend = chartConfigOptionsUISpec[ - state.chartConfig.chartType - ].interactiveFilters.includes("legend"); - const canFilterTime = chartConfigOptionsUISpec[ - state.chartConfig.chartType - ].interactiveFilters.includes("time"); + const canFilterLegend = + chartConfigOptionsUISpec[ + state.chartConfig.chartType + ].interactiveFilters.includes("legend"); + const canFilterTime = + chartConfigOptionsUISpec[ + state.chartConfig.chartType + ].interactiveFilters.includes("time"); const canFilterData = Object.keys(state.chartConfig.filters).length > 0; return ( - - - - + ); }; From fb7b75f7e1961ac15099403fdff2dc12ff5c3bdd Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Mon, 31 Jan 2022 15:26:39 +0100 Subject: [PATCH 02/21] feat: Use OnOffControlTabField for BaseLayer in maps --- .../components/chart-configurator.tsx | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/app/configurator/components/chart-configurator.tsx b/app/configurator/components/chart-configurator.tsx index b9caf4327..e95fc2da4 100644 --- a/app/configurator/components/chart-configurator.tsx +++ b/app/configurator/components/chart-configurator.tsx @@ -5,14 +5,15 @@ import * as React from "react"; import { useCallback } from "react"; import { DragDropContext, - Droppable, Draggable, + Droppable, OnDragEndResponder, } from "react-beautiful-dnd"; import { Box, Button, Spinner } from "theme-ui"; import { ChartConfig, ConfiguratorStateConfiguringChart, + isMapConfig, useConfiguratorState, } from ".."; import { getFieldComponentIris } from "../../charts"; @@ -40,6 +41,7 @@ import { DataFilterSelect, DataFilterSelectDay, DataFilterSelectTime, + OnOffControlTabField, } from "./field"; import MoveDragButtons from "./move-drag-buttons"; @@ -424,15 +426,23 @@ const ChartFields = ({ return ( <> {chartConfigOptionsUISpec[chartType].encodings.map((encoding) => { - const encodingField = encoding.field; - - return ( + return isMapConfig(chartConfig) && encoding.field === "baseLayer" ? ( + Base Layer} + active={ + chartConfig.baseLayer.showLakes || + chartConfig.baseLayer.showRelief + } + /> + ) : ( d.iri === - (chartConfig.fields as any)[encodingField]?.componentIri + (chartConfig.fields as any)[encoding.field]?.componentIri )} value={encoding.field} labelId={`${chartConfig.chartType}.${encoding.field}`} From d7a97e79de34f7597bd6dfcc6a7c133f9f6e4650 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Mon, 31 Jan 2022 15:26:59 +0100 Subject: [PATCH 03/21] fix: Make baseLayer and symbolLayer mandatory in econdings --- app/charts/chart-config-ui-options.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/charts/chart-config-ui-options.ts b/app/charts/chart-config-ui-options.ts index 357f29b32..8c0996c24 100644 --- a/app/charts/chart-config-ui-options.ts +++ b/app/charts/chart-config-ui-options.ts @@ -277,7 +277,7 @@ export const chartConfigOptionsUISpec: ChartSpecs = { encodings: [ { field: "baseLayer", - optional: true, + optional: false, values: [], filters: false, }, @@ -289,7 +289,7 @@ export const chartConfigOptionsUISpec: ChartSpecs = { }, { field: "symbolLayer", - optional: true, + optional: false, values: ["Measure"], filters: false, }, From 83fd526ca30139d4dcc307468d94957202a0a939 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Mon, 31 Jan 2022 21:44:37 +0100 Subject: [PATCH 04/21] feat: Update translations for maps --- .../components/chart-configurator.tsx | 2 +- .../components/chart-options-selector.tsx | 2 +- app/configurator/components/ui-helpers.ts | 24 +- app/configurator/map/map-chart-options.tsx | 86 ++++-- app/locales/de/messages.po | 252 ++++++++---------- app/locales/en/messages.po | 252 ++++++++---------- app/locales/fr/messages.po | 252 ++++++++---------- app/locales/it/messages.po | 252 ++++++++---------- 8 files changed, 534 insertions(+), 588 deletions(-) diff --git a/app/configurator/components/chart-configurator.tsx b/app/configurator/components/chart-configurator.tsx index e95fc2da4..e6d692a54 100644 --- a/app/configurator/components/chart-configurator.tsx +++ b/app/configurator/components/chart-configurator.tsx @@ -430,7 +430,7 @@ const ChartFields = ({ Base Layer} + label={Base Layer} active={ chartConfig.baseLayer.showLakes || chartConfig.baseLayer.showRelief diff --git a/app/configurator/components/chart-options-selector.tsx b/app/configurator/components/chart-options-selector.tsx index 55b7b59ca..468e99471 100644 --- a/app/configurator/components/chart-options-selector.tsx +++ b/app/configurator/components/chart-options-selector.tsx @@ -173,7 +173,7 @@ const EncodingOptionsPanel = ({ const getFieldLabelHint = { x: t({ id: "controls.select.dimension", message: "Select a dimension" }), y: t({ id: "controls.select.measure", message: "Select a measure" }), - baseLayer: t({ id: "controls.map.baseLayer", message: "Base layer" }), + baseLayer: t({ id: "chart.map.layers.base", message: "Base Layer" }), areaLayer: t({ id: "controls.select.measure", message: "Select a measure", diff --git a/app/configurator/components/ui-helpers.ts b/app/configurator/components/ui-helpers.ts index 757502d72..38dfafeec 100644 --- a/app/configurator/components/ui-helpers.ts +++ b/app/configurator/components/ui-helpers.ts @@ -410,17 +410,17 @@ const fieldLabels = { id: "controls.column.grouped", message: "Grouped", }), - "controls.map.baseLayer": defineMessage({ - id: "controls.map.baseLayer", - message: "Base layer", + "chart.map.layers.base": defineMessage({ + id: "chart.map.layers.base", + message: "Base Layer", }), - "controls.map.areaLayer": defineMessage({ - id: "controls.map.areaLayer", - message: "Area layer", + "chart.map.layers.area": defineMessage({ + id: "chart.map.layers.area", + message: "Areas", }), - "controls.map.symbolLayer": defineMessage({ - id: "controls.map.symbolLayer", - message: "Symbol layer", + "chart.map.layers.symbol": defineMessage({ + id: "chart.map.layers.symbol", + message: "Symbols", }), "controls.sorting.sortBy": defineMessage({ id: "controls.sorting.sortBy", @@ -553,11 +553,11 @@ export function getFieldLabel(field: string): string { case "segment": return i18n._(fieldLabels["controls.color"]); case "map.baseLayer": - return i18n._(fieldLabels["controls.map.baseLayer"]); + return i18n._(fieldLabels["chart.map.layers.base"]); case "map.areaLayer": - return i18n._(fieldLabels["controls.map.areaLayer"]); + return i18n._(fieldLabels["chart.map.layers.area"]); case "map.symbolLayer": - return i18n._(fieldLabels["controls.map.symbolLayer"]); + return i18n._(fieldLabels["chart.map.layers.symbol"]); case "title": return i18n._(fieldLabels["controls.title"]); case "description": diff --git a/app/configurator/map/map-chart-options.tsx b/app/configurator/map/map-chart-options.tsx index 3b1c5b18b..1987de26a 100644 --- a/app/configurator/map/map-chart-options.tsx +++ b/app/configurator/map/map-chart-options.tsx @@ -56,12 +56,12 @@ export const BaseLayersSettings = memo(() => { return ( - Settings + Settings { /> - Settings + Settings - Geographical dimension + {t({ + id: "controls.dimension.geographical", + message: "Geographical dimension", + })} - Hierarchy level + + {t({ id: "controls.hierarchy", message: "Hierarchy level" })} + id="areaLayer.hierarchyLevel" - label="Select a hierarchy level (1 - lowest)" + label={t({ + id: "controls.hierarchy.select", + message: "Select a hierarchy level", + })} field={activeField} path="hierarchyLevel" options={hierarchyLevelOptions} @@ -196,11 +207,16 @@ export const AreaLayerSettings = memo( - Measure + + {t({ id: "controls.measure", message: "Measure" })} + - Color scale + + {t({ id: "controls.color", message: "Color" })} + - + = 3 && ( - Settings + Settings - Geographical dimension + {t({ + id: "controls.dimension.geographical", + message: "Geographical dimension", + })} - Measure + + {t({ id: "controls.measure", message: "Measure" })} + - Color + + {t({ id: "controls.color", message: "Color" })} + <1>Diese Grafik nicht für Berichte verwenden." -#: app/components/chart-published.tsx:70 +#: app/components/chart-published.tsx:62 msgid "dataset.publicationStatus.expires.warning" msgstr "Achtung, dieser Datensatz ist abgelaufen.<0/><1>Diese Grafik nicht für Berichte verwenden." @@ -745,14 +729,6 @@ msgstr "Luftzug" msgid "datatable.showing.first.rows" msgstr "Die ersten 10 Zeilen werden angezeigt" -#: app/configurator/map/map-chart-options.tsx:162 -msgid "fields.areaLayer.show" -msgstr "" - -#: app/configurator/map/map-chart-options.tsx:333 -msgid "fields.symbolLayer.show" -msgstr "" - #: app/components/footer.tsx:66 msgid "footer.institution.name" msgstr "Bundesamt für Umwelt BAFU" @@ -761,11 +737,11 @@ msgstr "Bundesamt für Umwelt BAFU" msgid "footer.institution.url" msgstr "https://www.bafu.admin.ch/bafu/de/home.html" -#: app/components/hint.tsx:197 +#: app/components/hint.tsx:199 msgid "hint.chartunexpected.message" msgstr "" -#: app/components/hint.tsx:194 +#: app/components/hint.tsx:196 msgid "hint.chartunexpected.title" msgstr "" @@ -773,11 +749,11 @@ msgstr "" msgid "hint.create.your.own.chart" msgstr "Sie können diese Visualisierung kopieren oder mit Schweizer Open Government Data eine neue Visualisierung erstellen." -#: app/components/hint.tsx:171 +#: app/components/hint.tsx:173 msgid "hint.dataloadingerror.message" msgstr "Die Daten konnten nicht geladen werden." -#: app/components/hint.tsx:168 +#: app/components/hint.tsx:170 msgid "hint.dataloadingerror.title" msgstr "Daten-Ladefehler" @@ -793,7 +769,7 @@ msgstr "Lade Daten …" msgid "hint.no.visualization.with.dataset" msgstr "Mit dem ausgewählten Datensatz kann keine Visualisierung erstellt werden." -#: app/components/hint.tsx:146 +#: app/components/hint.tsx:148 msgid "hint.nodata.message" msgstr "Bitte versuchen Sie es mit einer anderen Filterkombination." @@ -801,15 +777,15 @@ msgstr "Bitte versuchen Sie es mit einer anderen Filterkombination." msgid "hint.nodata.title" msgstr "Keine Daten für die aktuelle Filterauswahl" -#: app/components/hint.tsx:223 +#: app/components/hint.tsx:225 msgid "hint.only.negative.data.message" msgstr "Negative Datenwerte können mit diesem Diagrammtyp nicht dargestellt werden." -#: app/components/hint.tsx:220 +#: app/components/hint.tsx:222 msgid "hint.only.negative.data.title" msgstr "Negative Werte" -#: app/components/hint.tsx:248 +#: app/components/hint.tsx:250 msgid "hint.publication.success" msgstr "Die Visualisierung ist jetzt veröffentlicht. Sie können sie teilen oder einbetten, indem Sie die URL kopieren oder das Menü unten verwenden." diff --git a/app/locales/en/messages.po b/app/locales/en/messages.po index 5dc3ceefd..c2ef787d7 100644 --- a/app/locales/en/messages.po +++ b/app/locales/en/messages.po @@ -13,19 +13,23 @@ msgstr "" "Language-Team: \n" "Plural-Forms: \n" +#: app/configurator/components/chart-configurator.tsx:389 +msgid "Add filter" +msgstr "Add filter" + #: app/components/search-autocomplete.tsx:69 msgid "Browse {0}" msgstr "Browse {0}" -#: app/configurator/components/chart-configurator.tsx:337 +#: app/configurator/components/chart-configurator.tsx:345 msgid "Drag filters to reorganize" msgstr "Drag filters to reorganize" -#: app/configurator/components/chart-configurator.tsx:334 +#: app/configurator/components/chart-configurator.tsx:342 msgid "Move filter down" msgstr "Move filter down" -#: app/configurator/components/chart-configurator.tsx:331 +#: app/configurator/components/chart-configurator.tsx:339 msgid "Move filter up" msgstr "Move filter up" @@ -37,11 +41,11 @@ msgstr "No results" msgid "Search “{0}”" msgstr "Search “{0}”" -#: app/components/chart-preview.tsx:97 +#: app/components/chart-preview.tsx:79 msgid "annotation.add.description" msgstr "[ No Description ]" -#: app/components/chart-preview.tsx:81 +#: app/components/chart-preview.tsx:63 msgid "annotation.add.title" msgstr "[ No Title ]" @@ -110,37 +114,25 @@ msgstr "Publish" msgid "button.share" msgstr "Share" -#: app/charts/map/chart-map-prototype.tsx:246 -#~ msgid "chart.map.control.data.filters" -#~ msgstr "Data Filters" - -#: app/charts/map/chart-map-prototype.tsx:203 -#~ msgid "chart.map.control.layers" -#~ msgstr "Layers" - -#: app/charts/map/chart-map-prototype.tsx:222 -#~ msgid "chart.map.layers.area" -#~ msgstr "Areas" - -#: app/charts/map/prototype-right-controls.tsx:76 -#~ msgid "chart.map.layers.area.add.data" -#~ msgstr "Show data areas" +#: app/configurator/components/ui-helpers.ts:417 +msgid "chart.map.layers.area" +msgstr "Areas" #: app/charts/map/prototype-right-controls.tsx:110 #~ msgid "chart.map.layers.area.color.palette" #~ msgstr "Color palette" -#: app/charts/map/prototype-right-controls.tsx:133 -#~ msgid "chart.map.layers.area.discretization.continuous" -#~ msgstr "Continuous" +#: app/configurator/map/map-chart-options.tsx:237 +msgid "chart.map.layers.area.discretization.continuous" +msgstr "Continuous" -#: app/charts/map/prototype-right-controls.tsx:153 -#~ msgid "chart.map.layers.area.discretization.discrete" -#~ msgstr "Discrete" +#: app/configurator/map/map-chart-options.tsx:250 +msgid "chart.map.layers.area.discretization.discrete" +msgstr "Discrete" -#: app/charts/map/prototype-right-controls.tsx:186 -#~ msgid "chart.map.layers.area.discretization.jenks" -#~ msgstr "Jenks (natural breaks)" +#: app/configurator/map/map-chart-options.tsx:298 +msgid "chart.map.layers.area.discretization.jenks" +msgstr "Jenks (natural breaks)" #: app/charts/map/prototype-right-controls.tsx:140 #~ msgid "chart.map.layers.area.discretization.linear" @@ -150,45 +142,50 @@ msgstr "Share" #~ msgid "chart.map.layers.area.discretization.number.class" #~ msgstr "Number of classes" -#: app/charts/map/prototype-right-controls.tsx:173 -#~ msgid "chart.map.layers.area.discretization.quantiles" -#~ msgstr "Quantiles (equal distribution of values)" +#: app/configurator/map/map-chart-options.tsx:291 +msgid "chart.map.layers.area.discretization.quantiles" +msgstr "Quantiles (equal distribution of values)" -#: app/charts/map/prototype-right-controls.tsx:160 -#~ msgid "chart.map.layers.area.discretization.quantize" -#~ msgstr "Quantize (equal intervals)" +#: app/configurator/map/map-chart-options.tsx:284 +msgid "chart.map.layers.area.discretization.quantize" +msgstr "Quantize (equal intervals)" -#: app/charts/map/prototype-right-controls.tsx:91 -#~ msgid "chart.map.layers.area.select.measure" -#~ msgstr "Select a measure" - -#: app/charts/map/chart-map-prototype.tsx:210 -#~ msgid "chart.map.layers.base" -#~ msgstr "Base Layer" +#: app/configurator/components/chart-configurator.tsx:433 +#: app/configurator/components/chart-options-selector.tsx:176 +#: app/configurator/components/ui-helpers.ts:413 +msgid "chart.map.layers.base" +msgstr "Base Layer" -#: app/charts/map/prototype-right-controls.tsx:59 -#~ msgid "chart.map.layers.base.lakes" -#~ msgstr "Lakes" +#: app/configurator/map/map-chart-options.tsx:71 +msgid "chart.map.layers.base.show.lakes" +msgstr "Show lakes" -#: app/charts/map/prototype-right-controls.tsx:48 -#~ msgid "chart.map.layers.base.relief" -#~ msgstr "Relief" +#: app/configurator/map/map-chart-options.tsx:63 +msgid "chart.map.layers.base.show.relief" +msgstr "Show relief" #: app/charts/map/prototype-right-controls.tsx:263 #~ msgid "chart.map.layers.no.selected" #~ msgstr "Select a layer to edit in the left panel." -#: app/charts/map/chart-map-prototype.tsx:234 -#~ msgid "chart.map.layers.symbol" -#~ msgstr "Symbols" +#: app/configurator/map/map-chart-options.tsx:159 +#: app/configurator/map/map-chart-options.tsx:366 +msgid "chart.map.layers.show" +msgstr "Show layer" + +#: app/configurator/components/ui-helpers.ts:421 +msgid "chart.map.layers.symbol" +msgstr "Symbols" #: app/charts/map/prototype-right-controls.tsx:228 #~ msgid "chart.map.layers.symbol.add.symbols" #~ msgstr "Show proportional symbols" -#: app/charts/map/prototype-right-controls.tsx:243 -#~ msgid "chart.map.layers.symbol.select.measure" -#~ msgstr "Select a measure" +#: app/configurator/map/map-chart-options.tsx:59 +#: app/configurator/map/map-chart-options.tsx:155 +#: app/configurator/map/map-chart-options.tsx:362 +msgid "chart.map.settings" +msgstr "Settings" #: app/charts/map/chart-map-prototype.tsx:274 #~ msgid "chart.map.warning.prototype" @@ -239,14 +236,6 @@ msgstr "Horizontal Axis" msgid "controls.axis.vertical" msgstr "Vertical Axis" -#: app/configurator/map/map-chart-options.tsx:76 -msgid "controls.baseLayer.showLakes" -msgstr "Show lakes" - -#: app/configurator/map/map-chart-options.tsx:68 -msgid "controls.baseLayer.showRelief" -msgstr "Show relief" - #: app/configurator/components/ui-helpers.ts:489 msgid "controls.chart.type.area" msgstr "Areas" @@ -280,6 +269,8 @@ msgid "controls.chart.type.table" msgstr "Table" #: app/configurator/components/ui-helpers.ts:399 +#: app/configurator/map/map-chart-options.tsx:226 +#: app/configurator/map/map-chart-options.tsx:418 msgid "controls.color" msgstr "Color" @@ -288,20 +279,20 @@ msgid "controls.color.add" msgstr "Add ..." #: app/configurator/components/chart-controls/color-palette.tsx:78 -#: app/configurator/components/chart-controls/color-ramp.tsx:106 +#: app/configurator/components/chart-controls/color-ramp.tsx:128 msgid "controls.color.palette" msgstr "Color palette" #: app/configurator/components/chart-controls/color-ramp.tsx:147 -msgid "controls.color.palette.diverging" -msgstr "Diverging" +#~ msgid "controls.color.palette.diverging" +#~ msgstr "Diverging" -#: app/configurator/components/chart-controls/color-palette.tsx:257 -#: app/configurator/components/chart-controls/color-palette.tsx:263 +#: app/configurator/components/chart-controls/color-palette.tsx:237 +#: app/configurator/components/chart-controls/color-palette.tsx:243 msgid "controls.color.palette.reset" msgstr "Reset color palette" -#: app/configurator/components/chart-controls/color-ramp.tsx:161 +#: app/configurator/components/chart-controls/color-ramp.tsx:163 msgid "controls.color.palette.sequential" msgstr "Sequential" @@ -321,26 +312,30 @@ msgstr "Stacked" msgid "controls.description" msgstr "Description" -#: app/configurator/components/field.tsx:629 +#: app/configurator/map/map-chart-options.tsx:378 +msgid "controls.dimension.geographical" +msgstr "Geographical dimension" + +#: app/configurator/components/field.tsx:660 msgid "controls.dimension.none" msgstr "None" #: app/charts/shared/chart-data-filters.tsx:194 -#: app/configurator/components/field.tsx:90 -#: app/configurator/components/field.tsx:144 -#: app/configurator/components/field.tsx:240 +#: app/configurator/components/field.tsx:121 +#: app/configurator/components/field.tsx:175 +#: app/configurator/components/field.tsx:271 msgid "controls.dimensionvalue.none" msgstr "No Filter" -#: app/configurator/components/filters.tsx:64 +#: app/configurator/components/filters.tsx:65 msgid "controls.filter.nb-elements" msgstr "{0} of {1}" -#: app/configurator/components/filters.tsx:47 +#: app/configurator/components/filters.tsx:48 msgid "controls.filter.select.all" msgstr "Select all" -#: app/configurator/components/filters.tsx:56 +#: app/configurator/components/filters.tsx:57 msgid "controls.filter.select.none" msgstr "Select none" @@ -348,6 +343,14 @@ msgstr "Select none" msgid "controls.filters.time.range" msgstr "Time Range" +#: app/configurator/map/map-chart-options.tsx:189 +msgid "controls.hierarchy" +msgstr "Hierarchy level" + +#: app/configurator/map/map-chart-options.tsx:194 +msgid "controls.hierarchy.select" +msgstr "Select a hierarchy level" + #: app/configurator/components/empty-right-panel.tsx:23 msgid "controls.hint.configuring.chart" msgstr "Select a design element or a data dimension to modify its options." @@ -361,22 +364,22 @@ msgid "controls.imputation" msgstr "Imputation type" #: app/configurator/components/chart-options-selector.tsx:490 -#: app/configurator/components/ui-helpers.ts:465 +#: app/configurator/components/ui-helpers.ts:473 msgid "controls.imputation.type.linear" msgstr "Linear interpolation" #: app/configurator/components/chart-options-selector.tsx:483 #: app/configurator/components/chart-options-selector.tsx:495 -#: app/configurator/components/ui-helpers.ts:457 +#: app/configurator/components/ui-helpers.ts:465 msgid "controls.imputation.type.none" msgstr "-" #: app/configurator/components/chart-options-selector.tsx:485 -#: app/configurator/components/ui-helpers.ts:461 +#: app/configurator/components/ui-helpers.ts:469 msgid "controls.imputation.type.zeros" msgstr "Zeros" -#: app/configurator/interactive-filters/interactive-filters-configurator.tsx:92 +#: app/configurator/interactive-filters/interactive-filters-configurator.tsx:89 msgid "controls.interactive.filters.dataFilter" msgstr "Data Filters" @@ -412,44 +415,29 @@ msgstr "German" msgid "controls.language.italian" msgstr "Italian" -#: app/configurator/components/ui-helpers.ts:417 -msgid "controls.map.areaLayer" -msgstr "Area layer" - -#: app/configurator/components/chart-options-selector.tsx:176 -#: app/configurator/components/ui-helpers.ts:413 -msgid "controls.map.baseLayer" -msgstr "Base layer" - -#: app/configurator/components/ui-helpers.ts:421 -msgid "controls.map.symbolLayer" -msgstr "Symbol layer" - #: app/configurator/components/ui-helpers.ts:391 +#: app/configurator/map/map-chart-options.tsx:208 +#: app/configurator/map/map-chart-options.tsx:400 msgid "controls.measure" msgstr "Measure" -#: app/configurator/components/chart-controls/control-tab.tsx:249 +#: app/configurator/components/chart-controls/control-tab.tsx:285 msgid "controls.option.isActive" msgstr "On" -#: app/configurator/components/chart-controls/control-tab.tsx:245 +#: app/configurator/components/chart-controls/control-tab.tsx:281 msgid "controls.option.isNotActive" msgstr "Off" -#: app/components/form.tsx:447 +#: app/configurator/map/map-chart-options.tsx:230 +msgid "controls.scale.type" +msgstr "Scale type" + +#: app/components/form.tsx:453 msgid "controls.search.clear" msgstr "Clear search field" -#: app/configurator/map/map-chart-options.tsx:158 -msgid "controls.section.areaLayer" -msgstr "Settings" - -#: app/configurator/map/map-chart-options.tsx:64 -msgid "controls.section.baseLayer" -msgstr "Settings" - -#: app/configurator/components/chart-configurator.tsx:258 +#: app/configurator/components/chart-configurator.tsx:264 msgid "controls.section.chart.options" msgstr "Chart Options" @@ -461,7 +449,7 @@ msgstr "Columns" msgid "controls.section.columnstyle" msgstr "Column Style" -#: app/configurator/components/chart-configurator.tsx:273 +#: app/configurator/components/chart-configurator.tsx:279 msgid "controls.section.data.filters" msgstr "Filters" @@ -490,7 +478,7 @@ msgstr "Missing values" msgid "controls.section.imputation.explanation" msgstr "For this chart type, replacement values should be assigned to missing values. Decide on the imputation logic or switch to another chart type." -#: app/configurator/interactive-filters/interactive-filters-configurator.tsx:63 +#: app/configurator/interactive-filters/interactive-filters-configurator.tsx:60 msgid "controls.section.interactive.filters" msgstr "Interactive Filters" @@ -502,10 +490,6 @@ msgstr "Data Filters" msgid "controls.section.sorting" msgstr "Sort" -#: app/configurator/map/map-chart-options.tsx:329 -msgid "controls.section.symbolLayer" -msgstr "Settings" - #: app/configurator/table/table-chart-options.tsx:469 msgid "controls.section.tableSettings" msgstr "Table Settings" @@ -561,26 +545,26 @@ msgstr "Text Style" #: app/configurator/components/chart-options-selector.tsx:174 #: app/configurator/components/chart-options-selector.tsx:185 +#: app/configurator/map/map-chart-options.tsx:176 +#: app/configurator/map/map-chart-options.tsx:387 msgid "controls.select.dimension" msgstr "Select a dimension" #: app/configurator/components/chart-options-selector.tsx:175 #: app/configurator/components/chart-options-selector.tsx:177 #: app/configurator/components/chart-options-selector.tsx:181 +#: app/configurator/map/map-chart-options.tsx:213 +#: app/configurator/map/map-chart-options.tsx:405 msgid "controls.select.measure" msgstr "Select a measure" -#: app/configurator/components/field.tsx:95 -#: app/configurator/components/field.tsx:149 -#: app/configurator/components/field.tsx:245 -#: app/configurator/components/field.tsx:634 +#: app/configurator/components/field.tsx:126 +#: app/configurator/components/field.tsx:180 +#: app/configurator/components/field.tsx:276 +#: app/configurator/components/field.tsx:665 msgid "controls.select.optional" msgstr "optional" -#: app/configurator/components/chart-options-selector.tsx:176 -#~ msgid "controls.settings" -#~ msgstr "Settings" - #: app/configurator/table/table-chart-sorting-options.tsx:234 msgid "controls.sorting.addDimension" msgstr "Add dimension" @@ -675,7 +659,7 @@ msgstr "Back to the datasets" msgid "dataset-selector.choose-another-dataset" msgstr "Choose another dataset" -#: app/components/chart-published.tsx:81 +#: app/components/chart-published.tsx:73 msgid "dataset.hasImputedValues" msgstr "Some data in this dataset is missing and has been interpolated to fill the gaps." @@ -715,13 +699,13 @@ msgstr "Relevance" msgid "dataset.order.title" msgstr "Title" -#: app/components/chart-preview.tsx:58 -#: app/components/chart-published.tsx:59 +#: app/components/chart-preview.tsx:40 +#: app/components/chart-published.tsx:51 #: app/configurator/components/dataset-preview.tsx:36 msgid "dataset.publicationStatus.draft.warning" msgstr "Careful, this dataset is only a draft.<0/><1>Don't use for reporting!" -#: app/components/chart-published.tsx:70 +#: app/components/chart-published.tsx:62 msgid "dataset.publicationStatus.expires.warning" msgstr "Careful, the data for this chart has expired.<0/><1>Don't use for reporting!" @@ -745,14 +729,6 @@ msgstr "Draft" msgid "datatable.showing.first.rows" msgstr "Showing first 10 rows" -#: app/configurator/map/map-chart-options.tsx:162 -msgid "fields.areaLayer.show" -msgstr "Show layer" - -#: app/configurator/map/map-chart-options.tsx:333 -msgid "fields.symbolLayer.show" -msgstr "Show layer" - #: app/components/footer.tsx:66 msgid "footer.institution.name" msgstr "Federal Office for the Environment FOEN" @@ -761,11 +737,11 @@ msgstr "Federal Office for the Environment FOEN" msgid "footer.institution.url" msgstr "https://www.bafu.admin.ch/bafu/en/home.html" -#: app/components/hint.tsx:197 +#: app/components/hint.tsx:199 msgid "hint.chartunexpected.message" msgstr "An unexpected error occurred while displaying this chart." -#: app/components/hint.tsx:194 +#: app/components/hint.tsx:196 msgid "hint.chartunexpected.title" msgstr "Unexpected error" @@ -773,11 +749,11 @@ msgstr "Unexpected error" msgid "hint.create.your.own.chart" msgstr "Create your own version of this visualization by copying it, or start from scratch and make a new visualization using Swiss Open Government Data." -#: app/components/hint.tsx:171 +#: app/components/hint.tsx:173 msgid "hint.dataloadingerror.message" msgstr "The data could not be loaded." -#: app/components/hint.tsx:168 +#: app/components/hint.tsx:170 msgid "hint.dataloadingerror.title" msgstr "Data loading error" @@ -793,7 +769,7 @@ msgstr "Loading data..." msgid "hint.no.visualization.with.dataset" msgstr "No visualization can be created with the selected dataset." -#: app/components/hint.tsx:146 +#: app/components/hint.tsx:148 msgid "hint.nodata.message" msgstr "Please try with another combination of filters." @@ -801,15 +777,15 @@ msgstr "Please try with another combination of filters." msgid "hint.nodata.title" msgstr "No data available for current filter selection" -#: app/components/hint.tsx:223 +#: app/components/hint.tsx:225 msgid "hint.only.negative.data.message" msgstr "Negative data values cannot be displayed with this chart type." -#: app/components/hint.tsx:220 +#: app/components/hint.tsx:222 msgid "hint.only.negative.data.title" msgstr "Negative Values" -#: app/components/hint.tsx:248 +#: app/components/hint.tsx:250 msgid "hint.publication.success" msgstr "Your visualization is now published. Share it by copying the URL or use the Embed menu below." diff --git a/app/locales/fr/messages.po b/app/locales/fr/messages.po index d656d1fd2..a554af23c 100644 --- a/app/locales/fr/messages.po +++ b/app/locales/fr/messages.po @@ -13,19 +13,23 @@ msgstr "" "Language-Team: \n" "Plural-Forms: \n" +#: app/configurator/components/chart-configurator.tsx:389 +msgid "Add filter" +msgstr "" + #: app/components/search-autocomplete.tsx:69 msgid "Browse {0}" msgstr "Parcourir {0}" -#: app/configurator/components/chart-configurator.tsx:337 +#: app/configurator/components/chart-configurator.tsx:345 msgid "Drag filters to reorganize" msgstr "Faites glisser les filtres pour les réorganiser" -#: app/configurator/components/chart-configurator.tsx:334 +#: app/configurator/components/chart-configurator.tsx:342 msgid "Move filter down" msgstr "Déplacer le filtre vers le bas" -#: app/configurator/components/chart-configurator.tsx:331 +#: app/configurator/components/chart-configurator.tsx:339 msgid "Move filter up" msgstr "Déplacer le filtre vers le haut" @@ -37,11 +41,11 @@ msgstr "Aucun résultat" msgid "Search “{0}”" msgstr "Chercher “{0}”" -#: app/components/chart-preview.tsx:97 +#: app/components/chart-preview.tsx:79 msgid "annotation.add.description" msgstr "[ Pas de description ]" -#: app/components/chart-preview.tsx:81 +#: app/components/chart-preview.tsx:63 msgid "annotation.add.title" msgstr "[ Pas de titre ]" @@ -110,37 +114,25 @@ msgstr "Publier" msgid "button.share" msgstr "Partager" -#: app/charts/map/chart-map-prototype.tsx:246 -#~ msgid "chart.map.control.data.filters" -#~ msgstr "Filtres de données" - -#: app/charts/map/chart-map-prototype.tsx:203 -#~ msgid "chart.map.control.layers" -#~ msgstr "Couches" - -#: app/charts/map/chart-map-prototype.tsx:222 -#~ msgid "chart.map.layers.area" -#~ msgstr "Aplats de couleur" - -#: app/charts/map/prototype-right-controls.tsx:76 -#~ msgid "chart.map.layers.area.add.data" -#~ msgstr "Ajouter des données" +#: app/configurator/components/ui-helpers.ts:417 +msgid "chart.map.layers.area" +msgstr "Zones" #: app/charts/map/prototype-right-controls.tsx:110 #~ msgid "chart.map.layers.area.color.palette" #~ msgstr "Palette de couleurs" -#: app/charts/map/prototype-right-controls.tsx:133 -#~ msgid "chart.map.layers.area.discretization.continuous" -#~ msgstr "Continue" +#: app/configurator/map/map-chart-options.tsx:237 +msgid "chart.map.layers.area.discretization.continuous" +msgstr "Continue" -#: app/charts/map/prototype-right-controls.tsx:153 -#~ msgid "chart.map.layers.area.discretization.discrete" -#~ msgstr "Discrète" +#: app/configurator/map/map-chart-options.tsx:250 +msgid "chart.map.layers.area.discretization.discrete" +msgstr "Discrète" -#: app/charts/map/prototype-right-controls.tsx:186 -#~ msgid "chart.map.layers.area.discretization.jenks" -#~ msgstr "Jenks (intervalles naturels)" +#: app/configurator/map/map-chart-options.tsx:298 +msgid "chart.map.layers.area.discretization.jenks" +msgstr "Jenks (intervalles naturels)" #: app/charts/map/prototype-right-controls.tsx:140 #~ msgid "chart.map.layers.area.discretization.linear" @@ -150,45 +142,50 @@ msgstr "Partager" #~ msgid "chart.map.layers.area.discretization.number.class" #~ msgstr "Nombre de classes" -#: app/charts/map/prototype-right-controls.tsx:173 -#~ msgid "chart.map.layers.area.discretization.quantiles" -#~ msgstr "Quantiles (distribution homogène des valeurs)" +#: app/configurator/map/map-chart-options.tsx:291 +msgid "chart.map.layers.area.discretization.quantiles" +msgstr "Quantiles (distribution homogène des valeurs)" -#: app/charts/map/prototype-right-controls.tsx:160 -#~ msgid "chart.map.layers.area.discretization.quantize" -#~ msgstr "Intervalles égaux" +#: app/configurator/map/map-chart-options.tsx:284 +msgid "chart.map.layers.area.discretization.quantize" +msgstr "Intervalles égaux" -#: app/charts/map/prototype-right-controls.tsx:91 -#~ msgid "chart.map.layers.area.select.measure" -#~ msgstr "Sélectionner une variable" - -#: app/charts/map/chart-map-prototype.tsx:210 -#~ msgid "chart.map.layers.base" -#~ msgstr "Couche de base" +#: app/configurator/components/chart-configurator.tsx:433 +#: app/configurator/components/chart-options-selector.tsx:176 +#: app/configurator/components/ui-helpers.ts:413 +msgid "chart.map.layers.base" +msgstr "Couche de base" -#: app/charts/map/prototype-right-controls.tsx:59 -#~ msgid "chart.map.layers.base.lakes" -#~ msgstr "Lacs" +#: app/configurator/map/map-chart-options.tsx:71 +msgid "chart.map.layers.base.show.lakes" +msgstr "Afficher les lacs" -#: app/charts/map/prototype-right-controls.tsx:48 -#~ msgid "chart.map.layers.base.relief" -#~ msgstr "Relief" +#: app/configurator/map/map-chart-options.tsx:63 +msgid "chart.map.layers.base.show.relief" +msgstr "Afficher le relief" #: app/charts/map/prototype-right-controls.tsx:263 #~ msgid "chart.map.layers.no.selected" #~ msgstr "Sélectionner une couche à modifier dans le panneau de gauche." -#: app/charts/map/chart-map-prototype.tsx:234 -#~ msgid "chart.map.layers.symbol" -#~ msgstr "Symboles proportionnels" +#: app/configurator/map/map-chart-options.tsx:159 +#: app/configurator/map/map-chart-options.tsx:366 +msgid "chart.map.layers.show" +msgstr "Afficher la couche" + +#: app/configurator/components/ui-helpers.ts:421 +msgid "chart.map.layers.symbol" +msgstr "Symboles" #: app/charts/map/prototype-right-controls.tsx:228 #~ msgid "chart.map.layers.symbol.add.symbols" #~ msgstr "Ajouter des cercles proportionnels" -#: app/charts/map/prototype-right-controls.tsx:243 -#~ msgid "chart.map.layers.symbol.select.measure" -#~ msgstr "Sélectionner une variable" +#: app/configurator/map/map-chart-options.tsx:59 +#: app/configurator/map/map-chart-options.tsx:155 +#: app/configurator/map/map-chart-options.tsx:362 +msgid "chart.map.settings" +msgstr "Paramètres" #: app/charts/map/chart-map-prototype.tsx:274 #~ msgid "chart.map.warning.prototype" @@ -239,14 +236,6 @@ msgstr "Axe horizontal" msgid "controls.axis.vertical" msgstr "Axe vertical" -#: app/configurator/map/map-chart-options.tsx:76 -msgid "controls.baseLayer.showLakes" -msgstr "" - -#: app/configurator/map/map-chart-options.tsx:68 -msgid "controls.baseLayer.showRelief" -msgstr "" - #: app/configurator/components/ui-helpers.ts:489 msgid "controls.chart.type.area" msgstr "Surfaces" @@ -280,6 +269,8 @@ msgid "controls.chart.type.table" msgstr "Tableau" #: app/configurator/components/ui-helpers.ts:399 +#: app/configurator/map/map-chart-options.tsx:226 +#: app/configurator/map/map-chart-options.tsx:418 msgid "controls.color" msgstr "Couleur" @@ -288,20 +279,20 @@ msgid "controls.color.add" msgstr "Ajouter…" #: app/configurator/components/chart-controls/color-palette.tsx:78 -#: app/configurator/components/chart-controls/color-ramp.tsx:106 +#: app/configurator/components/chart-controls/color-ramp.tsx:128 msgid "controls.color.palette" msgstr "Couleurs" #: app/configurator/components/chart-controls/color-ramp.tsx:147 -msgid "controls.color.palette.diverging" -msgstr "Divergent" +#~ msgid "controls.color.palette.diverging" +#~ msgstr "Divergent" -#: app/configurator/components/chart-controls/color-palette.tsx:257 -#: app/configurator/components/chart-controls/color-palette.tsx:263 +#: app/configurator/components/chart-controls/color-palette.tsx:237 +#: app/configurator/components/chart-controls/color-palette.tsx:243 msgid "controls.color.palette.reset" msgstr "Réinitialiser la palette de couleurs" -#: app/configurator/components/chart-controls/color-ramp.tsx:161 +#: app/configurator/components/chart-controls/color-ramp.tsx:163 msgid "controls.color.palette.sequential" msgstr "Séquentielle" @@ -321,26 +312,30 @@ msgstr "empilées" msgid "controls.description" msgstr "Description" -#: app/configurator/components/field.tsx:629 +#: app/configurator/map/map-chart-options.tsx:378 +msgid "controls.dimension.geographical" +msgstr "Dimension géographique" + +#: app/configurator/components/field.tsx:660 msgid "controls.dimension.none" msgstr "Aucune" #: app/charts/shared/chart-data-filters.tsx:194 -#: app/configurator/components/field.tsx:90 -#: app/configurator/components/field.tsx:144 -#: app/configurator/components/field.tsx:240 +#: app/configurator/components/field.tsx:121 +#: app/configurator/components/field.tsx:175 +#: app/configurator/components/field.tsx:271 msgid "controls.dimensionvalue.none" msgstr "Aucune filtre" -#: app/configurator/components/filters.tsx:64 +#: app/configurator/components/filters.tsx:65 msgid "controls.filter.nb-elements" msgstr "{0} sur {1}" -#: app/configurator/components/filters.tsx:47 +#: app/configurator/components/filters.tsx:48 msgid "controls.filter.select.all" msgstr "Tout sélectionner" -#: app/configurator/components/filters.tsx:56 +#: app/configurator/components/filters.tsx:57 msgid "controls.filter.select.none" msgstr "Tout déselectionner" @@ -348,6 +343,14 @@ msgstr "Tout déselectionner" msgid "controls.filters.time.range" msgstr "Intervalle de temps" +#: app/configurator/map/map-chart-options.tsx:189 +msgid "controls.hierarchy" +msgstr "Niveau hiérarchique" + +#: app/configurator/map/map-chart-options.tsx:194 +msgid "controls.hierarchy.select" +msgstr "Sélectionner le niveau hiérarchique" + #: app/configurator/components/empty-right-panel.tsx:23 msgid "controls.hint.configuring.chart" msgstr "Sélectionnez un élément de design ou une dimension du jeu de données pour modifier leurs options." @@ -361,22 +364,22 @@ msgid "controls.imputation" msgstr "Type d'imputation" #: app/configurator/components/chart-options-selector.tsx:490 -#: app/configurator/components/ui-helpers.ts:465 +#: app/configurator/components/ui-helpers.ts:473 msgid "controls.imputation.type.linear" msgstr "Interpolation linéaire" #: app/configurator/components/chart-options-selector.tsx:483 #: app/configurator/components/chart-options-selector.tsx:495 -#: app/configurator/components/ui-helpers.ts:457 +#: app/configurator/components/ui-helpers.ts:465 msgid "controls.imputation.type.none" msgstr "-" #: app/configurator/components/chart-options-selector.tsx:485 -#: app/configurator/components/ui-helpers.ts:461 +#: app/configurator/components/ui-helpers.ts:469 msgid "controls.imputation.type.zeros" msgstr "Zéros" -#: app/configurator/interactive-filters/interactive-filters-configurator.tsx:92 +#: app/configurator/interactive-filters/interactive-filters-configurator.tsx:89 msgid "controls.interactive.filters.dataFilter" msgstr "Filtres de données" @@ -412,44 +415,29 @@ msgstr "Allemand" msgid "controls.language.italian" msgstr "Italien" -#: app/configurator/components/ui-helpers.ts:417 -msgid "controls.map.areaLayer" -msgstr "" - -#: app/configurator/components/chart-options-selector.tsx:176 -#: app/configurator/components/ui-helpers.ts:413 -msgid "controls.map.baseLayer" -msgstr "" - -#: app/configurator/components/ui-helpers.ts:421 -msgid "controls.map.symbolLayer" -msgstr "" - #: app/configurator/components/ui-helpers.ts:391 +#: app/configurator/map/map-chart-options.tsx:208 +#: app/configurator/map/map-chart-options.tsx:400 msgid "controls.measure" msgstr "Variable mesurée" -#: app/configurator/components/chart-controls/control-tab.tsx:249 +#: app/configurator/components/chart-controls/control-tab.tsx:285 msgid "controls.option.isActive" msgstr "Actif" -#: app/configurator/components/chart-controls/control-tab.tsx:245 +#: app/configurator/components/chart-controls/control-tab.tsx:281 msgid "controls.option.isNotActive" msgstr "Inactif" -#: app/components/form.tsx:447 +#: app/configurator/map/map-chart-options.tsx:230 +msgid "controls.scale.type" +msgstr "Type d'échelle" + +#: app/components/form.tsx:453 msgid "controls.search.clear" msgstr "Effacer la recherche" -#: app/configurator/map/map-chart-options.tsx:158 -msgid "controls.section.areaLayer" -msgstr "" - -#: app/configurator/map/map-chart-options.tsx:64 -msgid "controls.section.baseLayer" -msgstr "" - -#: app/configurator/components/chart-configurator.tsx:258 +#: app/configurator/components/chart-configurator.tsx:264 msgid "controls.section.chart.options" msgstr "Paramètres graphiques" @@ -461,7 +449,7 @@ msgstr "Colonnes" msgid "controls.section.columnstyle" msgstr "Style de la colonne" -#: app/configurator/components/chart-configurator.tsx:273 +#: app/configurator/components/chart-configurator.tsx:279 msgid "controls.section.data.filters" msgstr "Filtres" @@ -490,7 +478,7 @@ msgstr "Valeurs manquantes" msgid "controls.section.imputation.explanation" msgstr "En raison du type de graphique sélectionné, les valeurs manquantes doivent être remplies. Décidez de la logique d'imputation ou choisissez un autre type de graphique." -#: app/configurator/interactive-filters/interactive-filters-configurator.tsx:63 +#: app/configurator/interactive-filters/interactive-filters-configurator.tsx:60 msgid "controls.section.interactive.filters" msgstr "Filtres interactifs" @@ -502,10 +490,6 @@ msgstr "Filtres de données" msgid "controls.section.sorting" msgstr "Trier" -#: app/configurator/map/map-chart-options.tsx:329 -msgid "controls.section.symbolLayer" -msgstr "" - #: app/configurator/table/table-chart-options.tsx:469 msgid "controls.section.tableSettings" msgstr "Paramètres du tableau" @@ -561,26 +545,26 @@ msgstr "Style du texte" #: app/configurator/components/chart-options-selector.tsx:174 #: app/configurator/components/chart-options-selector.tsx:185 +#: app/configurator/map/map-chart-options.tsx:176 +#: app/configurator/map/map-chart-options.tsx:387 msgid "controls.select.dimension" msgstr "Sélectionner une dimension" #: app/configurator/components/chart-options-selector.tsx:175 #: app/configurator/components/chart-options-selector.tsx:177 #: app/configurator/components/chart-options-selector.tsx:181 +#: app/configurator/map/map-chart-options.tsx:213 +#: app/configurator/map/map-chart-options.tsx:405 msgid "controls.select.measure" msgstr "Sélectionner une variable" -#: app/configurator/components/field.tsx:95 -#: app/configurator/components/field.tsx:149 -#: app/configurator/components/field.tsx:245 -#: app/configurator/components/field.tsx:634 +#: app/configurator/components/field.tsx:126 +#: app/configurator/components/field.tsx:180 +#: app/configurator/components/field.tsx:276 +#: app/configurator/components/field.tsx:665 msgid "controls.select.optional" msgstr "optionnel" -#: app/configurator/components/chart-options-selector.tsx:176 -#~ msgid "controls.settings" -#~ msgstr "" - #: app/configurator/table/table-chart-sorting-options.tsx:234 msgid "controls.sorting.addDimension" msgstr "Ajouter une dimension" @@ -675,7 +659,7 @@ msgstr "Revenir aux jeux de données" msgid "dataset-selector.choose-another-dataset" msgstr "Choisir un autre jeu de données" -#: app/components/chart-published.tsx:81 +#: app/components/chart-published.tsx:73 msgid "dataset.hasImputedValues" msgstr "Certaines données de cet ensemble de données sont manquantes et ont été interpolées pour combler les lacunes." @@ -715,13 +699,13 @@ msgstr "Pertinence" msgid "dataset.order.title" msgstr "Titre" -#: app/components/chart-preview.tsx:58 -#: app/components/chart-published.tsx:59 +#: app/components/chart-preview.tsx:40 +#: app/components/chart-published.tsx:51 #: app/configurator/components/dataset-preview.tsx:36 msgid "dataset.publicationStatus.draft.warning" msgstr "Attention, ce jeu de données est à l'état d'ébauche.<0/><1>Ne l'utilisez pas pour une publication!" -#: app/components/chart-published.tsx:70 +#: app/components/chart-published.tsx:62 msgid "dataset.publicationStatus.expires.warning" msgstr "Attention, ce jeu de données est expiré.<0/><1>Ne l'utilisez pas pour une publication!" @@ -745,14 +729,6 @@ msgstr "Brouillon" msgid "datatable.showing.first.rows" msgstr "Seules les 10 premières lignes sont affichées" -#: app/configurator/map/map-chart-options.tsx:162 -msgid "fields.areaLayer.show" -msgstr "" - -#: app/configurator/map/map-chart-options.tsx:333 -msgid "fields.symbolLayer.show" -msgstr "" - #: app/components/footer.tsx:66 msgid "footer.institution.name" msgstr "Office fédéral de l'environnement OFEV" @@ -761,11 +737,11 @@ msgstr "Office fédéral de l'environnement OFEV" msgid "footer.institution.url" msgstr "https://www.bafu.admin.ch/bafu/fr/home.html" -#: app/components/hint.tsx:197 +#: app/components/hint.tsx:199 msgid "hint.chartunexpected.message" msgstr "" -#: app/components/hint.tsx:194 +#: app/components/hint.tsx:196 msgid "hint.chartunexpected.title" msgstr "" @@ -773,11 +749,11 @@ msgstr "" msgid "hint.create.your.own.chart" msgstr "Créez votre propre visualisation à partir de celle-ci en la copiant, ou bien créez une nouvelle visualisation avec les données ouvertes de l'administration publique suisse." -#: app/components/hint.tsx:171 +#: app/components/hint.tsx:173 msgid "hint.dataloadingerror.message" msgstr "Les données n'ont pas pu être téléchargées." -#: app/components/hint.tsx:168 +#: app/components/hint.tsx:170 msgid "hint.dataloadingerror.title" msgstr "Problème de téléchargement des données" @@ -793,7 +769,7 @@ msgstr "Chargement des données..." msgid "hint.no.visualization.with.dataset" msgstr "Aucune visualisation ne peut être créée avec le jeu de données sélectionné." -#: app/components/hint.tsx:146 +#: app/components/hint.tsx:148 msgid "hint.nodata.message" msgstr "Veuillez essayer avec une autre combinaison de filtres." @@ -801,15 +777,15 @@ msgstr "Veuillez essayer avec une autre combinaison de filtres." msgid "hint.nodata.title" msgstr "Il n'y a pas de données correspondant aux filtres sélectionnés" -#: app/components/hint.tsx:223 +#: app/components/hint.tsx:225 msgid "hint.only.negative.data.message" msgstr "Ce type de graphique ne permet pas de représenter des données négatives." -#: app/components/hint.tsx:220 +#: app/components/hint.tsx:222 msgid "hint.only.negative.data.title" msgstr "Valeurs négatives" -#: app/components/hint.tsx:248 +#: app/components/hint.tsx:250 msgid "hint.publication.success" msgstr "Votre visualisation est à présent publiée. Partagez-là en copiant l'URL ou en utilisant les options d'intégration." diff --git a/app/locales/it/messages.po b/app/locales/it/messages.po index c9e9e5ea5..c99552bf3 100644 --- a/app/locales/it/messages.po +++ b/app/locales/it/messages.po @@ -13,19 +13,23 @@ msgstr "" "Language-Team: \n" "Plural-Forms: \n" +#: app/configurator/components/chart-configurator.tsx:389 +msgid "Add filter" +msgstr "" + #: app/components/search-autocomplete.tsx:69 msgid "Browse {0}" msgstr "Sfoglia {0}" -#: app/configurator/components/chart-configurator.tsx:337 +#: app/configurator/components/chart-configurator.tsx:345 msgid "Drag filters to reorganize" msgstr "Trascina i filtri per riorganizzarli" -#: app/configurator/components/chart-configurator.tsx:334 +#: app/configurator/components/chart-configurator.tsx:342 msgid "Move filter down" msgstr "Sposta il filtro in basso" -#: app/configurator/components/chart-configurator.tsx:331 +#: app/configurator/components/chart-configurator.tsx:339 msgid "Move filter up" msgstr "Sposta il filtro in alto" @@ -37,11 +41,11 @@ msgstr "Nessun risultato" msgid "Search “{0}”" msgstr "Cerca “{0}”" -#: app/components/chart-preview.tsx:97 +#: app/components/chart-preview.tsx:79 msgid "annotation.add.description" msgstr "[ Nessuna descrizione ]" -#: app/components/chart-preview.tsx:81 +#: app/components/chart-preview.tsx:63 msgid "annotation.add.title" msgstr "[ Nessun titolo ]" @@ -110,37 +114,25 @@ msgstr "Pubblica" msgid "button.share" msgstr "Condividi" -#: app/charts/map/chart-map-prototype.tsx:246 -#~ msgid "chart.map.control.data.filters" -#~ msgstr "Filtri di dati" - -#: app/charts/map/chart-map-prototype.tsx:203 -#~ msgid "chart.map.control.layers" -#~ msgstr "Livelli" - -#: app/charts/map/chart-map-prototype.tsx:222 -#~ msgid "chart.map.layers.area" -#~ msgstr "Aree" - -#: app/charts/map/prototype-right-controls.tsx:76 -#~ msgid "chart.map.layers.area.add.data" -#~ msgstr "Mostra le aree" +#: app/configurator/components/ui-helpers.ts:417 +msgid "chart.map.layers.area" +msgstr "Aree" #: app/charts/map/prototype-right-controls.tsx:110 #~ msgid "chart.map.layers.area.color.palette" #~ msgstr "Palette di colore" -#: app/charts/map/prototype-right-controls.tsx:133 -#~ msgid "chart.map.layers.area.discretization.continuous" -#~ msgstr "Continuo" +#: app/configurator/map/map-chart-options.tsx:237 +msgid "chart.map.layers.area.discretization.continuous" +msgstr "Continuo" -#: app/charts/map/prototype-right-controls.tsx:153 -#~ msgid "chart.map.layers.area.discretization.discrete" -#~ msgstr "Discreto" +#: app/configurator/map/map-chart-options.tsx:250 +msgid "chart.map.layers.area.discretization.discrete" +msgstr "Discreto" -#: app/charts/map/prototype-right-controls.tsx:186 -#~ msgid "chart.map.layers.area.discretization.jenks" -#~ msgstr "Jenks (interruzioni naturali)" +#: app/configurator/map/map-chart-options.tsx:298 +msgid "chart.map.layers.area.discretization.jenks" +msgstr "Jenks (interruzioni naturali)" #: app/charts/map/prototype-right-controls.tsx:140 #~ msgid "chart.map.layers.area.discretization.linear" @@ -150,45 +142,50 @@ msgstr "Condividi" #~ msgid "chart.map.layers.area.discretization.number.class" #~ msgstr "Numero di classi" -#: app/charts/map/prototype-right-controls.tsx:173 -#~ msgid "chart.map.layers.area.discretization.quantiles" -#~ msgstr "Quantili (distribuzione omogenea dei valori)" - -#: app/charts/map/prototype-right-controls.tsx:160 -#~ msgid "chart.map.layers.area.discretization.quantize" -#~ msgstr "Intervalli uguali" +#: app/configurator/map/map-chart-options.tsx:291 +msgid "chart.map.layers.area.discretization.quantiles" +msgstr "Quantili (distribuzione omogenea dei valori)" -#: app/charts/map/prototype-right-controls.tsx:91 -#~ msgid "chart.map.layers.area.select.measure" -#~ msgstr "Seleziona una variabile" +#: app/configurator/map/map-chart-options.tsx:284 +msgid "chart.map.layers.area.discretization.quantize" +msgstr "Intervalli uguali" -#: app/charts/map/chart-map-prototype.tsx:210 -#~ msgid "chart.map.layers.base" -#~ msgstr "Livello di base" +#: app/configurator/components/chart-configurator.tsx:433 +#: app/configurator/components/chart-options-selector.tsx:176 +#: app/configurator/components/ui-helpers.ts:413 +msgid "chart.map.layers.base" +msgstr "Livello di base" -#: app/charts/map/prototype-right-controls.tsx:59 -#~ msgid "chart.map.layers.base.lakes" -#~ msgstr "Laghi" +#: app/configurator/map/map-chart-options.tsx:71 +msgid "chart.map.layers.base.show.lakes" +msgstr "Mostra i laghi" -#: app/charts/map/prototype-right-controls.tsx:48 -#~ msgid "chart.map.layers.base.relief" -#~ msgstr "Rilievo" +#: app/configurator/map/map-chart-options.tsx:63 +msgid "chart.map.layers.base.show.relief" +msgstr "Mostra il rilievo" #: app/charts/map/prototype-right-controls.tsx:263 #~ msgid "chart.map.layers.no.selected" #~ msgstr "Seleziona un livello da editare nel pannello di sinistra." -#: app/charts/map/chart-map-prototype.tsx:234 -#~ msgid "chart.map.layers.symbol" -#~ msgstr "Simboli" +#: app/configurator/map/map-chart-options.tsx:159 +#: app/configurator/map/map-chart-options.tsx:366 +msgid "chart.map.layers.show" +msgstr "Mostra il livello" + +#: app/configurator/components/ui-helpers.ts:421 +msgid "chart.map.layers.symbol" +msgstr "Simboli" #: app/charts/map/prototype-right-controls.tsx:228 #~ msgid "chart.map.layers.symbol.add.symbols" #~ msgstr "Mostra simboli proporzionali" -#: app/charts/map/prototype-right-controls.tsx:243 -#~ msgid "chart.map.layers.symbol.select.measure" -#~ msgstr "Seleziona una variabile" +#: app/configurator/map/map-chart-options.tsx:59 +#: app/configurator/map/map-chart-options.tsx:155 +#: app/configurator/map/map-chart-options.tsx:362 +msgid "chart.map.settings" +msgstr "Opzioni" #: app/charts/map/chart-map-prototype.tsx:274 #~ msgid "chart.map.warning.prototype" @@ -239,14 +236,6 @@ msgstr "Asse orizzontale" msgid "controls.axis.vertical" msgstr "Asse verticale" -#: app/configurator/map/map-chart-options.tsx:76 -msgid "controls.baseLayer.showLakes" -msgstr "" - -#: app/configurator/map/map-chart-options.tsx:68 -msgid "controls.baseLayer.showRelief" -msgstr "" - #: app/configurator/components/ui-helpers.ts:489 msgid "controls.chart.type.area" msgstr "Aree" @@ -280,6 +269,8 @@ msgid "controls.chart.type.table" msgstr "Tabella" #: app/configurator/components/ui-helpers.ts:399 +#: app/configurator/map/map-chart-options.tsx:226 +#: app/configurator/map/map-chart-options.tsx:418 msgid "controls.color" msgstr "Colore" @@ -288,20 +279,20 @@ msgid "controls.color.add" msgstr "Aggiungi ..." #: app/configurator/components/chart-controls/color-palette.tsx:78 -#: app/configurator/components/chart-controls/color-ramp.tsx:106 +#: app/configurator/components/chart-controls/color-ramp.tsx:128 msgid "controls.color.palette" msgstr "Palette di colori" #: app/configurator/components/chart-controls/color-ramp.tsx:147 -msgid "controls.color.palette.diverging" -msgstr "Divergente" +#~ msgid "controls.color.palette.diverging" +#~ msgstr "Divergente" -#: app/configurator/components/chart-controls/color-palette.tsx:257 -#: app/configurator/components/chart-controls/color-palette.tsx:263 +#: app/configurator/components/chart-controls/color-palette.tsx:237 +#: app/configurator/components/chart-controls/color-palette.tsx:243 msgid "controls.color.palette.reset" msgstr "Ripristina la tavolozza dei colori" -#: app/configurator/components/chart-controls/color-ramp.tsx:161 +#: app/configurator/components/chart-controls/color-ramp.tsx:163 msgid "controls.color.palette.sequential" msgstr "Sequenziale" @@ -321,26 +312,30 @@ msgstr "impilate" msgid "controls.description" msgstr "Descrizione" -#: app/configurator/components/field.tsx:629 +#: app/configurator/map/map-chart-options.tsx:378 +msgid "controls.dimension.geographical" +msgstr "Dimensione geografica" + +#: app/configurator/components/field.tsx:660 msgid "controls.dimension.none" msgstr "Nessuno" #: app/charts/shared/chart-data-filters.tsx:194 -#: app/configurator/components/field.tsx:90 -#: app/configurator/components/field.tsx:144 -#: app/configurator/components/field.tsx:240 +#: app/configurator/components/field.tsx:121 +#: app/configurator/components/field.tsx:175 +#: app/configurator/components/field.tsx:271 msgid "controls.dimensionvalue.none" msgstr "Nessun filtro" -#: app/configurator/components/filters.tsx:64 +#: app/configurator/components/filters.tsx:65 msgid "controls.filter.nb-elements" msgstr "{0} di {1}" -#: app/configurator/components/filters.tsx:47 +#: app/configurator/components/filters.tsx:48 msgid "controls.filter.select.all" msgstr "Seleziona tutti" -#: app/configurator/components/filters.tsx:56 +#: app/configurator/components/filters.tsx:57 msgid "controls.filter.select.none" msgstr "Deseleziona tutto" @@ -348,6 +343,14 @@ msgstr "Deseleziona tutto" msgid "controls.filters.time.range" msgstr "intervallo di tempo" +#: app/configurator/map/map-chart-options.tsx:189 +msgid "controls.hierarchy" +msgstr "Livello gerarchico" + +#: app/configurator/map/map-chart-options.tsx:194 +msgid "controls.hierarchy.select" +msgstr "Selezionare un livello gerarchico" + #: app/configurator/components/empty-right-panel.tsx:23 msgid "controls.hint.configuring.chart" msgstr "Seleziona un elemento di design o una dimensione dei dati per modificarne le opzioni." @@ -361,22 +364,22 @@ msgid "controls.imputation" msgstr "Tipo di imputazione" #: app/configurator/components/chart-options-selector.tsx:490 -#: app/configurator/components/ui-helpers.ts:465 +#: app/configurator/components/ui-helpers.ts:473 msgid "controls.imputation.type.linear" msgstr "Interpolazione lineare" #: app/configurator/components/chart-options-selector.tsx:483 #: app/configurator/components/chart-options-selector.tsx:495 -#: app/configurator/components/ui-helpers.ts:457 +#: app/configurator/components/ui-helpers.ts:465 msgid "controls.imputation.type.none" msgstr "-" #: app/configurator/components/chart-options-selector.tsx:485 -#: app/configurator/components/ui-helpers.ts:461 +#: app/configurator/components/ui-helpers.ts:469 msgid "controls.imputation.type.zeros" msgstr "Zeri" -#: app/configurator/interactive-filters/interactive-filters-configurator.tsx:92 +#: app/configurator/interactive-filters/interactive-filters-configurator.tsx:89 msgid "controls.interactive.filters.dataFilter" msgstr "Filtri di dati" @@ -412,44 +415,29 @@ msgstr "Tedesco" msgid "controls.language.italian" msgstr "Italiano" -#: app/configurator/components/ui-helpers.ts:417 -msgid "controls.map.areaLayer" -msgstr "" - -#: app/configurator/components/chart-options-selector.tsx:176 -#: app/configurator/components/ui-helpers.ts:413 -msgid "controls.map.baseLayer" -msgstr "" - -#: app/configurator/components/ui-helpers.ts:421 -msgid "controls.map.symbolLayer" -msgstr "" - #: app/configurator/components/ui-helpers.ts:391 +#: app/configurator/map/map-chart-options.tsx:208 +#: app/configurator/map/map-chart-options.tsx:400 msgid "controls.measure" msgstr "Misura" -#: app/configurator/components/chart-controls/control-tab.tsx:249 +#: app/configurator/components/chart-controls/control-tab.tsx:285 msgid "controls.option.isActive" msgstr "Attivo" -#: app/configurator/components/chart-controls/control-tab.tsx:245 +#: app/configurator/components/chart-controls/control-tab.tsx:281 msgid "controls.option.isNotActive" msgstr "Inattivo" -#: app/components/form.tsx:447 +#: app/configurator/map/map-chart-options.tsx:230 +msgid "controls.scale.type" +msgstr "Tipo di scala" + +#: app/components/form.tsx:453 msgid "controls.search.clear" msgstr "Cancella la ricerca" -#: app/configurator/map/map-chart-options.tsx:158 -msgid "controls.section.areaLayer" -msgstr "" - -#: app/configurator/map/map-chart-options.tsx:64 -msgid "controls.section.baseLayer" -msgstr "" - -#: app/configurator/components/chart-configurator.tsx:258 +#: app/configurator/components/chart-configurator.tsx:264 msgid "controls.section.chart.options" msgstr "Opzioni del grafico" @@ -461,7 +449,7 @@ msgstr "Colonne" msgid "controls.section.columnstyle" msgstr "Stile della colonna" -#: app/configurator/components/chart-configurator.tsx:273 +#: app/configurator/components/chart-configurator.tsx:279 msgid "controls.section.data.filters" msgstr "Filtri" @@ -490,7 +478,7 @@ msgstr "Valori mancanti" msgid "controls.section.imputation.explanation" msgstr "Per questo tipo di grafico, i valori di sostituzione devono essere assegnati ai valori mancanti. Decidi la logica di imputazione o passa a un altro tipo di grafico." -#: app/configurator/interactive-filters/interactive-filters-configurator.tsx:63 +#: app/configurator/interactive-filters/interactive-filters-configurator.tsx:60 msgid "controls.section.interactive.filters" msgstr "Filtri interattivi" @@ -502,10 +490,6 @@ msgstr "Filtri di dati" msgid "controls.section.sorting" msgstr "Ordina" -#: app/configurator/map/map-chart-options.tsx:329 -msgid "controls.section.symbolLayer" -msgstr "" - #: app/configurator/table/table-chart-options.tsx:469 msgid "controls.section.tableSettings" msgstr "Impostazioni della tabella" @@ -561,26 +545,26 @@ msgstr "Stile del testo" #: app/configurator/components/chart-options-selector.tsx:174 #: app/configurator/components/chart-options-selector.tsx:185 +#: app/configurator/map/map-chart-options.tsx:176 +#: app/configurator/map/map-chart-options.tsx:387 msgid "controls.select.dimension" msgstr "Seleziona una dimensione" #: app/configurator/components/chart-options-selector.tsx:175 #: app/configurator/components/chart-options-selector.tsx:177 #: app/configurator/components/chart-options-selector.tsx:181 +#: app/configurator/map/map-chart-options.tsx:213 +#: app/configurator/map/map-chart-options.tsx:405 msgid "controls.select.measure" msgstr "Seleziona una misura" -#: app/configurator/components/field.tsx:95 -#: app/configurator/components/field.tsx:149 -#: app/configurator/components/field.tsx:245 -#: app/configurator/components/field.tsx:634 +#: app/configurator/components/field.tsx:126 +#: app/configurator/components/field.tsx:180 +#: app/configurator/components/field.tsx:276 +#: app/configurator/components/field.tsx:665 msgid "controls.select.optional" msgstr "facoltativo" -#: app/configurator/components/chart-options-selector.tsx:176 -#~ msgid "controls.settings" -#~ msgstr "" - #: app/configurator/table/table-chart-sorting-options.tsx:234 msgid "controls.sorting.addDimension" msgstr "Aggiungi una dimensione" @@ -675,7 +659,7 @@ msgstr "Torna ai set di dati" msgid "dataset-selector.choose-another-dataset" msgstr "Scegli un altro set di dati" -#: app/components/chart-published.tsx:81 +#: app/components/chart-published.tsx:73 msgid "dataset.hasImputedValues" msgstr "In questo set di dati mancano alcuni dati. Questi sono stati interpolati per colmare le lacune.." @@ -715,13 +699,13 @@ msgstr "Rilevanza" msgid "dataset.order.title" msgstr "Titolo" -#: app/components/chart-preview.tsx:58 -#: app/components/chart-published.tsx:59 +#: app/components/chart-preview.tsx:40 +#: app/components/chart-published.tsx:51 #: app/configurator/components/dataset-preview.tsx:36 msgid "dataset.publicationStatus.draft.warning" msgstr "Attenzione, questo set di dati è una bozza.<0/><1>Non utilizzare questo grafico per un rapporto!" -#: app/components/chart-published.tsx:70 +#: app/components/chart-published.tsx:62 msgid "dataset.publicationStatus.expires.warning" msgstr "Attenzione, questo set di dati è scaduto.<0/><1>Non utilizzare questo grafico per un rapporto!" @@ -745,14 +729,6 @@ msgstr "Bozza" msgid "datatable.showing.first.rows" msgstr "Sono mostrate soltanto le prime 10 righe" -#: app/configurator/map/map-chart-options.tsx:162 -msgid "fields.areaLayer.show" -msgstr "" - -#: app/configurator/map/map-chart-options.tsx:333 -msgid "fields.symbolLayer.show" -msgstr "" - #: app/components/footer.tsx:66 msgid "footer.institution.name" msgstr "Ufficio federale dell'ambiente UFAM" @@ -761,11 +737,11 @@ msgstr "Ufficio federale dell'ambiente UFAM" msgid "footer.institution.url" msgstr "https://www.bafu.admin.ch/bafu/it/home.html" -#: app/components/hint.tsx:197 +#: app/components/hint.tsx:199 msgid "hint.chartunexpected.message" msgstr "" -#: app/components/hint.tsx:194 +#: app/components/hint.tsx:196 msgid "hint.chartunexpected.title" msgstr "" @@ -773,11 +749,11 @@ msgstr "" msgid "hint.create.your.own.chart" msgstr "Crea la tua versione di questa visualizzazione copiandola, oppure inizia da zero e crea una nuova visualizzazione utilizzando i dati aperti dell’amministrazione pubblica svizzera." -#: app/components/hint.tsx:171 +#: app/components/hint.tsx:173 msgid "hint.dataloadingerror.message" msgstr "I dati non possono essere caricati." -#: app/components/hint.tsx:168 +#: app/components/hint.tsx:170 msgid "hint.dataloadingerror.title" msgstr "Problema di caricamento dei dati" @@ -793,7 +769,7 @@ msgstr "Caricamento dei dati..." msgid "hint.no.visualization.with.dataset" msgstr "Nessuna visualizzazione può essere creata con il dataset selezionato." -#: app/components/hint.tsx:146 +#: app/components/hint.tsx:148 msgid "hint.nodata.message" msgstr "Prova con un'altra combinazione di filtri." @@ -801,15 +777,15 @@ msgstr "Prova con un'altra combinazione di filtri." msgid "hint.nodata.title" msgstr "Non ci sono dati corrispondenti ai filtri selezionati" -#: app/components/hint.tsx:223 +#: app/components/hint.tsx:225 msgid "hint.only.negative.data.message" msgstr "Dati con valori negativi non possono essere visualizzati con questo tipo di grafico." -#: app/components/hint.tsx:220 +#: app/components/hint.tsx:222 msgid "hint.only.negative.data.title" msgstr "Valori negativi" -#: app/components/hint.tsx:248 +#: app/components/hint.tsx:250 msgid "hint.publication.success" msgstr "La tua visualizzazione è ora pubblicata. Condividila copiando l'URL o utilizzando le opzioni di incorporamento." From d527cf08f893d55a4ced12f1a8dea4a118cd237a Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Mon, 31 Jan 2022 23:10:05 +0100 Subject: [PATCH 05/21] feat: Add urql devtools to development env --- app/graphql/context.tsx | 11 +++- app/package.json | 1 + yarn.lock | 121 +++++++++++++++++++++++++++++----------- 3 files changed, 98 insertions(+), 35 deletions(-) diff --git a/app/graphql/context.tsx b/app/graphql/context.tsx index 19034e0e8..1c06396af 100644 --- a/app/graphql/context.tsx +++ b/app/graphql/context.tsx @@ -1,9 +1,16 @@ +import { devtoolsExchange } from "@urql/devtools"; import { ReactNode, useCallback } from "react"; -import { createClient, Provider } from "urql"; +import { createClient, defaultExchanges, Provider } from "urql"; import { GRAPHQL_ENDPOINT } from "../domain/env"; import { useLocale } from "../src"; -const client = createClient({ url: GRAPHQL_ENDPOINT }); +const client = createClient({ + url: GRAPHQL_ENDPOINT, + exchanges: + process.env.NODE_ENV === "development" + ? [devtoolsExchange, ...defaultExchanges] + : [...defaultExchanges], +}); export const GraphqlProvider = ({ children }: { children: ReactNode }) => { const locale = useLocale(); diff --git a/app/package.json b/app/package.json index 3c4b985da..17d70efc5 100644 --- a/app/package.json +++ b/app/package.json @@ -127,6 +127,7 @@ "@types/sparql-http-client": "^2.2.5", "@types/topojson-server": "^3.0.1", "@types/wellknown": "^0.5.1", + "@urql/devtools": "^2.0.3", "babel-core": "^7.0.0-bridge.0", "jest": "^27.3.0", "react-inspector": "^5.1.1", diff --git a/yarn.lock b/yarn.lock index 4ce83d533..258801c97 100644 --- a/yarn.lock +++ b/yarn.lock @@ -103,7 +103,29 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.8.tgz#31560f9f29fdf1868de8cb55049538a1b9732a60" integrity sha512-m7OkX0IdKLKPpBlJtF561YJal5y/jyI5fNfWbPxh2D/nbzzGI4qRyrD8xO2jB24u7l+5I2a43scCG2IrfjC50Q== -"@babel/core@7.12.9", "@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.12.9", "@babel/core@^7.14.6", "@babel/core@^7.7.2", "@babel/core@^7.7.5", "@babel/core@^7.7.7": +"@babel/core@7.12.9": + version "7.12.9" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.9.tgz#fd450c4ec10cdbb980e2928b7aa7a28484593fc8" + integrity sha512-gTXYh3M5wb7FRXQy+FErKFAv90BnlOuNn1QkCK2lREoPAjrQCO49+HVSrFoe5uakFAF5eenS75KbO2vQiLrTMQ== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/generator" "^7.12.5" + "@babel/helper-module-transforms" "^7.12.1" + "@babel/helpers" "^7.12.5" + "@babel/parser" "^7.12.7" + "@babel/template" "^7.12.7" + "@babel/traverse" "^7.12.9" + "@babel/types" "^7.12.7" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.1" + json5 "^2.1.2" + lodash "^4.17.19" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + +"@babel/core@^7.0.0", "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.12.9", "@babel/core@^7.7.2", "@babel/core@^7.7.5", "@babel/core@^7.7.7": version "7.16.12" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.12.tgz#5edc53c1b71e54881315923ae2aedea2522bb784" integrity sha512-dK5PtG1uiN2ikk++5OzSYsitZKny4wOCD0nrO4TqnW4BVBTQ2NGS3NgilvT/TEyxTST7LNyWV/T4tXDoD3fOgg== @@ -133,7 +155,7 @@ jsesc "^2.5.1" source-map "^0.5.0" -"@babel/generator@^7.16.8": +"@babel/generator@^7.12.5", "@babel/generator@^7.16.8": version "7.16.8" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.8.tgz#359d44d966b8cd059d543250ce79596f792f2ebe" integrity sha512-1ojZwE9+lOXzcWdWmO6TbUzDfqLD39CmEhN8+2cX9XkDo5yW1OpgfejfliysR2AWLpMamTiOiAp/mtroaymhpw== @@ -255,6 +277,20 @@ dependencies: "@babel/types" "^7.16.7" +"@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz#7665faeb721a01ca5327ddc6bba15a5cb34b6a41" + integrity sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng== + dependencies: + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-module-imports" "^7.16.7" + "@babel/helper-simple-access" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" + "@babel/helper-validator-identifier" "^7.16.7" + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.16.7" + "@babel/types" "^7.16.7" + "@babel/helper-module-transforms@^7.14.5": version "7.15.8" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.8.tgz#d8c0e75a87a52e374a8f25f855174786a09498b2" @@ -269,20 +305,6 @@ "@babel/traverse" "^7.15.4" "@babel/types" "^7.15.6" -"@babel/helper-module-transforms@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz#7665faeb721a01ca5327ddc6bba15a5cb34b6a41" - integrity sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng== - dependencies: - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-module-imports" "^7.16.7" - "@babel/helper-simple-access" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/helper-validator-identifier" "^7.16.7" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.16.7" - "@babel/types" "^7.16.7" - "@babel/helper-optimise-call-expression@^7.14.5", "@babel/helper-optimise-call-expression@^7.15.4": version "7.15.4" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz#f310a5121a3b9cc52d9ab19122bd729822dee171" @@ -365,7 +387,7 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== -"@babel/helpers@^7.16.7": +"@babel/helpers@^7.12.5", "@babel/helpers@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.16.7.tgz#7e3504d708d50344112767c3542fc5e357fffefc" integrity sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw== @@ -392,7 +414,12 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@7.12.16", "@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.11.5", "@babel/parser@^7.12.13", "@babel/parser@^7.14.6", "@babel/parser@^7.14.7", "@babel/parser@^7.15.4", "@babel/parser@^7.16.10", "@babel/parser@^7.16.12", "@babel/parser@^7.16.7", "@babel/parser@^7.7.2": +"@babel/parser@7.12.16": + version "7.12.16" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.16.tgz#cc31257419d2c3189d394081635703f549fc1ed4" + integrity sha512-c/+u9cqV6F0+4Hpq01jnJO+GLp2DdT63ppz9Xa+6cHaajM9VFzK/iDXiKK65YtpeVwu+ctfS6iqlMqRgQRzeCw== + +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.11.5", "@babel/parser@^7.12.13", "@babel/parser@^7.12.7", "@babel/parser@^7.14.7", "@babel/parser@^7.15.4", "@babel/parser@^7.16.10", "@babel/parser@^7.16.12", "@babel/parser@^7.16.7", "@babel/parser@^7.7.2": version "7.16.12" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.12.tgz#9474794f9a650cf5e2f892444227f98e28cdf8b6" integrity sha512-VfaV15po8RiZssrkPweyvbGVSe4x2y+aciFCgn0n0/SJMR22cwofRV1mtnJQYcSB1wUTaA/X1LnA3es66MCO5A== @@ -714,6 +741,15 @@ resolved "https://registry.yarnpkg.com/@babel/standalone/-/standalone-7.14.6.tgz#9070bd3cc2bb997d42e14bdf3b0d24a11b00242b" integrity sha512-oAoSp82jhJFnXKybKTOj5QF04XxiDRyiiqrFToiU1udlBXuZoADlPmmnOcuqBrZxSNNUjzJIVK8vt838Qoqjxg== +"@babel/template@^7.12.7", "@babel/template@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" + integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w== + dependencies: + "@babel/code-frame" "^7.16.7" + "@babel/parser" "^7.16.7" + "@babel/types" "^7.16.7" + "@babel/template@^7.15.4", "@babel/template@^7.3.3": version "7.15.4" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.15.4.tgz#51898d35dcf3faa670c4ee6afcfd517ee139f194" @@ -723,15 +759,6 @@ "@babel/parser" "^7.15.4" "@babel/types" "^7.15.4" -"@babel/template@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" - integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/parser" "^7.16.7" - "@babel/types" "^7.16.7" - "@babel/traverse@7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.13.tgz#689f0e4b4c08587ad26622832632735fb8c4e0c0" @@ -762,7 +789,7 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/traverse@^7.16.10", "@babel/traverse@^7.16.7": +"@babel/traverse@^7.12.9", "@babel/traverse@^7.16.10", "@babel/traverse@^7.16.7": version "7.16.10" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.10.tgz#448f940defbe95b5a8029975b051f75993e8239f" integrity sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw== @@ -803,7 +830,7 @@ "@babel/helper-validator-identifier" "^7.14.9" to-fast-properties "^2.0.0" -"@babel/types@^7.16.7", "@babel/types@^7.16.8": +"@babel/types@^7.12.7", "@babel/types@^7.16.7", "@babel/types@^7.16.8": version "7.16.8" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.8.tgz#0ba5da91dd71e0a4e7781a30f22770831062e3c1" integrity sha512-smN2DQc5s4M7fntyjGtyIPbRJv6wW4rU/94fmYJ7PKQuZkC0qGMHXJbg6sNGt12JmVr4k5YaptI/XtiLJBnmIg== @@ -4299,6 +4326,13 @@ "@graphql-typed-document-node/core" "^3.1.0" wonka "^4.0.14" +"@urql/devtools@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@urql/devtools/-/devtools-2.0.3.tgz#780998c37386c72af9402a8f88c1b388e62f28cd" + integrity sha512-TktPLiBS9LcBPHD6qcnb8wqOVcg3Bx0iCtvQ80uPpfofwwBGJmqnQTjUdEFU6kwaLOFZULQ9+Uo4831G823mQw== + dependencies: + wonka ">= 4.0.9" + "@wry/context@^0.6.0": version "0.6.0" resolved "https://registry.yarnpkg.com/@wry/context/-/context-0.6.0.tgz#f903eceb89d238ef7e8168ed30f4511f92d83e06" @@ -7867,7 +7901,7 @@ fwd-stream@^1.0.4: dependencies: readable-stream "~1.0.26-4" -gensync@^1.0.0-beta.2: +gensync@^1.0.0-beta.1, gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== @@ -8819,6 +8853,13 @@ is-core-module@^2.2.0, is-core-module@^2.4.0: dependencies: has "^1.0.3" +is-core-module@^2.8.1: + version "2.8.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" + integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== + dependencies: + has "^1.0.3" + is-date-object@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.4.tgz#550cfcc03afada05eea3dd30981c7b09551f73e5" @@ -11432,7 +11473,7 @@ path-key@^3.0.0, path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== -path-parse@^1.0.6: +path-parse@^1.0.6, path-parse@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== @@ -12538,6 +12579,15 @@ resolve@^1.10.0, resolve@^1.11.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.1 is-core-module "^2.2.0" path-parse "^1.0.6" +resolve@^1.3.2: + version "1.22.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" + integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== + dependencies: + is-core-module "^2.8.1" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + resolve@^2.0.0-next.3: version "2.0.0-next.3" resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.3.tgz#d41016293d4a8586a39ca5d9b5f15cbea1f55e46" @@ -12763,7 +12813,7 @@ semver-compare@^1.0.0: resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= -"semver@2 || 3 || 4 || 5", semver@^5.6.0: +"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -13520,6 +13570,11 @@ supports-hyperlinks@^2.0.0: has-flag "^4.0.0" supports-color "^7.0.0" +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + svg-parser@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/svg-parser/-/svg-parser-2.0.4.tgz#fdc2e29e13951736140b76cb122c8ee6630eb6b5" @@ -14568,7 +14623,7 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -wonka@^4.0.14: +"wonka@>= 4.0.9", wonka@^4.0.14: version "4.0.15" resolved "https://registry.yarnpkg.com/wonka/-/wonka-4.0.15.tgz#9aa42046efa424565ab8f8f451fcca955bf80b89" integrity sha512-U0IUQHKXXn6PFo9nqsHphVCE5m3IntqZNB9Jjn7EB1lrR7YTDY3YWgFvEvwniTzXSvOH/XMzAZaIfJF/LvHYXg== From 9ba7ad8ca6effde5faa0eca9b17b7ec9b072f0d1 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Mon, 31 Jan 2022 23:36:18 +0100 Subject: [PATCH 06/21] fix: Duplicated CubeObservationsQuery for maps --- app/charts/map/chart-map.tsx | 5 ++- app/components/data-download.tsx | 33 ++++++++++++++----- .../components/chart-options-selector.tsx | 5 +++ 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/app/charts/map/chart-map.tsx b/app/charts/map/chart-map.tsx index 4d262b5fb..9416ee99f 100644 --- a/app/charts/map/chart-map.tsx +++ b/app/charts/map/chart-map.tsx @@ -55,7 +55,10 @@ export const ChartMapVisualization = ({ variables: { locale, iri: dataSetIri, - measures: [areaDimensionIri, symbolDimensionIri], + measures: [ + chartConfig.fields.areaLayer.measureIri, + chartConfig.fields.symbolLayer.measureIri, + ], filters: queryFilters, }, }); diff --git a/app/components/data-download.tsx b/app/components/data-download.tsx index c535f1581..245f967d9 100644 --- a/app/components/data-download.tsx +++ b/app/components/data-download.tsx @@ -4,7 +4,12 @@ import { saveAs } from "file-saver"; import { memo, ReactNode, useMemo } from "react"; import { Box, Button, Link } from "theme-ui"; import { useQueryFilters } from "../charts/shared/chart-helpers"; -import { ChartConfig, ChartFields, isTableConfig } from "../configurator"; +import { + ChartConfig, + ChartFields, + isMapConfig, + isTableConfig, +} from "../configurator"; import { Observation } from "../domain/data"; import { DimensionMetaDataFragment, @@ -25,14 +30,24 @@ export const DataDownload = memo( chartConfig: ChartConfig; }) => { const locale = useLocale(); - const measures = - "y" in chartConfig.fields - ? [chartConfig.fields.y.componentIri] - : isTableConfig(chartConfig) - ? Object.values(chartConfig.fields).flatMap((f) => - f.componentType === "Measure" && !f.isHidden ? [f.componentIri] : [] - ) - : []; + const measures = useMemo( + () => + "y" in chartConfig.fields + ? [chartConfig.fields.y.componentIri] + : isTableConfig(chartConfig) + ? Object.values(chartConfig.fields).flatMap((f) => + f.componentType === "Measure" && !f.isHidden + ? [f.componentIri] + : [] + ) + : isMapConfig(chartConfig) + ? [ + chartConfig.fields.areaLayer.measureIri, + chartConfig.fields.symbolLayer.measureIri, + ] + : [], + [chartConfig] + ); const filters = useQueryFilters({ chartConfig, }); diff --git a/app/configurator/components/chart-options-selector.tsx b/app/configurator/components/chart-options-selector.tsx index 468e99471..d757e3879 100644 --- a/app/configurator/components/chart-options-selector.tsx +++ b/app/configurator/components/chart-options-selector.tsx @@ -57,6 +57,11 @@ export const ChartOptionsSelector = ({ ? Object.values(state.chartConfig.fields).flatMap((f) => f.componentType === "Measure" && !f.isHidden ? [f.componentIri] : [] ) + : isMapConfig(state.chartConfig) + ? [ + state.chartConfig.fields.areaLayer.measureIri, + state.chartConfig.fields.symbolLayer.measureIri, + ] : [], [state.chartConfig] ); From c7c2038f0b01ab74e6fc009a13e24d1b12fcda32 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Tue, 1 Feb 2022 09:21:37 +0100 Subject: [PATCH 07/21] refactor: Stop fetching geoCoordinates on each filter change --- app/charts/map/chart-map.tsx | 23 ++++++++++--- app/graphql/queries/data-cubes.graphql | 23 +++++++++++-- app/graphql/query-hooks.ts | 45 ++++++++++++++++++++++---- app/graphql/resolver-types.ts | 28 ++++++++++------ app/graphql/schema.graphql | 10 ++++-- 5 files changed, 105 insertions(+), 24 deletions(-) diff --git a/app/charts/map/chart-map.tsx b/app/charts/map/chart-map.tsx index 9416ee99f..d2e21115c 100644 --- a/app/charts/map/chart-map.tsx +++ b/app/charts/map/chart-map.tsx @@ -21,9 +21,9 @@ import { import { DimensionMetaDataFragment, useDataCubeObservationsQuery, + useGeoCoordinatesByDimensionIriQuery, } from "../../graphql/query-hooks"; import { useLocale } from "../../locales/use-locale"; -import { GeoCoordinates } from "../../rdf/query-geo-coordinates"; import { QueryFilters } from "../shared/chart-helpers"; import { ChartContainer } from "../shared/containers"; import { MapComponent } from "./map"; @@ -69,6 +69,21 @@ export const ChartMapVisualization = ({ | Observation[] | undefined; + const [{ data: fetchedGeoCoordinates }] = + useGeoCoordinatesByDimensionIriQuery({ + variables: { + dataCubeIri: dataSetIri, + locale, + dimensionIri: symbolDimensionIri, + }, + }); + + const geoCoordinates = + fetchedGeoCoordinates?.dataCubeByIri?.dimensionByIri?.__typename === + "GeoCoordinatesDimension" + ? fetchedGeoCoordinates.dataCubeByIri.dimensionByIri.geoCoordinates + : null; + const areaLayer: AreaLayer | undefined = useMemo(() => { const dimension = dimensions?.find((d) => d.iri === areaDimensionIri); @@ -99,8 +114,8 @@ export const ChartMapVisualization = ({ const symbolLayer: SymbolLayer | undefined = useMemo(() => { const dimension = dimensions?.find((d) => d.iri === symbolDimensionIri); - if (isGeoCoordinatesDimension(dimension)) { - const points = (dimension.geoCoordinates as GeoCoordinates[]).map( + if (isGeoCoordinatesDimension(dimension) && geoCoordinates) { + const points = geoCoordinates.map( (d) => ({ coordinates: [d.longitude, d.latitude], @@ -125,7 +140,7 @@ export const ChartMapVisualization = ({ return { points }; } } - }, [areaLayer, dimensions, observations, symbolDimensionIri]); + }, [areaLayer, dimensions, observations, symbolDimensionIri, geoCoordinates]); useEffect(() => { const loadLakes = async () => { diff --git a/app/graphql/queries/data-cubes.graphql b/app/graphql/queries/data-cubes.graphql index 63e305cb2..73346f569 100644 --- a/app/graphql/queries/data-cubes.graphql +++ b/app/graphql/queries/data-cubes.graphql @@ -38,9 +38,6 @@ fragment dimensionMetaData on Dimension { isKeyDimension values(filters: $filters) unit - ... on GeoCoordinatesDimension { - geoCoordinates - } ... on GeoShapesDimension { geoShapes } @@ -141,6 +138,26 @@ query DimensionValues( } } +query GeoCoordinatesByDimensionIri( + $dataCubeIri: String! + $dimensionIri: String! + $latest: Boolean + $locale: String! +) { + dataCubeByIri(iri: $dataCubeIri, locale: $locale, latest: $latest) { + dimensionByIri(iri: $dimensionIri) { + ... on GeoCoordinatesDimension { + geoCoordinates { + iri + label + latitude + longitude + } + } + } + } +} + query TemporalDimensionValues( $dataCubeIri: String! $dimensionIri: String! diff --git a/app/graphql/query-hooks.ts b/app/graphql/query-hooks.ts index 8f8ee682a..2b425d9c8 100644 --- a/app/graphql/query-hooks.ts +++ b/app/graphql/query-hooks.ts @@ -14,7 +14,6 @@ export type Scalars = { Float: number; DimensionValue: any; Filters: any; - GeoCoordinates: any; GeoShapes: any; Observation: any; RawObservation: any; @@ -111,6 +110,13 @@ export type DimensionValuesArgs = { +export type GeoCoordinates = { + __typename: 'GeoCoordinates'; + iri: Scalars['String']; + label: Scalars['String']; + latitude: Scalars['Float']; + longitude: Scalars['Float']; +}; export type GeoCoordinatesDimension = Dimension & { __typename: 'GeoCoordinatesDimension'; @@ -120,7 +126,7 @@ export type GeoCoordinatesDimension = Dimension & { scaleType?: Maybe; isKeyDimension: Scalars['Boolean']; values: Array; - geoCoordinates: Scalars['GeoCoordinates']; + geoCoordinates?: Maybe>; }; @@ -292,7 +298,7 @@ export type DataCubesQueryVariables = Exact<{ export type DataCubesQuery = { __typename: 'Query', dataCubes: Array<{ __typename: 'DataCubeResult', highlightedTitle?: Maybe, highlightedDescription?: Maybe, dataCube: { __typename: 'DataCube', iri: string, title: string, description?: Maybe, publicationStatus: DataCubePublicationStatus, datePublished?: Maybe, creator?: Maybe<{ __typename: 'DataCubeOrganization', iri: string, label?: Maybe }>, themes: Array<{ __typename: 'DataCubeTheme', iri: string, label?: Maybe }> } }> }; -type DimensionMetaData_GeoCoordinatesDimension_Fragment = { __typename: 'GeoCoordinatesDimension', geoCoordinates: any, iri: string, label: string, isKeyDimension: boolean, values: Array, unit?: Maybe }; +type DimensionMetaData_GeoCoordinatesDimension_Fragment = { __typename: 'GeoCoordinatesDimension', iri: string, label: string, isKeyDimension: boolean, values: Array, unit?: Maybe }; type DimensionMetaData_GeoShapesDimension_Fragment = { __typename: 'GeoShapesDimension', geoShapes: any, iri: string, label: string, isKeyDimension: boolean, values: Array, unit?: Maybe }; @@ -416,6 +422,16 @@ export type DimensionValuesQuery = { __typename: 'Query', dataCubeByIri?: Maybe< & DimensionMetaData_TemporalDimension_Fragment )> }> }; +export type GeoCoordinatesByDimensionIriQueryVariables = Exact<{ + dataCubeIri: Scalars['String']; + dimensionIri: Scalars['String']; + latest?: Maybe; + locale: Scalars['String']; +}>; + + +export type GeoCoordinatesByDimensionIriQuery = { __typename: 'Query', dataCubeByIri?: Maybe<{ __typename: 'DataCube', dimensionByIri?: Maybe<{ __typename: 'GeoCoordinatesDimension', geoCoordinates?: Maybe> } | { __typename: 'GeoShapesDimension' } | { __typename: 'Measure' } | { __typename: 'NominalDimension' } | { __typename: 'OrdinalDimension' } | { __typename: 'TemporalDimension' }> }> }; + export type TemporalDimensionValuesQueryVariables = Exact<{ dataCubeIri: Scalars['String']; dimensionIri: Scalars['String']; @@ -500,9 +516,6 @@ export const DimensionMetaDataFragmentDoc = gql` isKeyDimension values(filters: $filters) unit - ... on GeoCoordinatesDimension { - geoCoordinates - } ... on GeoShapesDimension { geoShapes } @@ -640,6 +653,26 @@ export const DimensionValuesDocument = gql` export function useDimensionValuesQuery(options: Omit, 'query'> = {}) { return Urql.useQuery({ query: DimensionValuesDocument, ...options }); }; +export const GeoCoordinatesByDimensionIriDocument = gql` + query GeoCoordinatesByDimensionIri($dataCubeIri: String!, $dimensionIri: String!, $latest: Boolean, $locale: String!) { + dataCubeByIri(iri: $dataCubeIri, locale: $locale, latest: $latest) { + dimensionByIri(iri: $dimensionIri) { + ... on GeoCoordinatesDimension { + geoCoordinates { + iri + label + latitude + longitude + } + } + } + } +} + `; + +export function useGeoCoordinatesByDimensionIriQuery(options: Omit, 'query'> = {}) { + return Urql.useQuery({ query: GeoCoordinatesByDimensionIriDocument, ...options }); +}; export const TemporalDimensionValuesDocument = gql` query TemporalDimensionValues($dataCubeIri: String!, $dimensionIri: String!, $locale: String!, $latest: Boolean, $filters: Filters) { dataCubeByIri(iri: $dataCubeIri, locale: $locale, latest: $latest) { diff --git a/app/graphql/resolver-types.ts b/app/graphql/resolver-types.ts index 7dc259493..6458ef5de 100644 --- a/app/graphql/resolver-types.ts +++ b/app/graphql/resolver-types.ts @@ -19,7 +19,6 @@ export type Scalars = { Float: number; DimensionValue: DimensionValue; Filters: Filters; - GeoCoordinates: any; GeoShapes: any; Observation: Observation; RawObservation: RawObservation; @@ -116,6 +115,13 @@ export type DimensionValuesArgs = { +export type GeoCoordinates = { + __typename?: 'GeoCoordinates'; + iri: Scalars['String']; + label: Scalars['String']; + latitude: Scalars['Float']; + longitude: Scalars['Float']; +}; export type GeoCoordinatesDimension = Dimension & { __typename?: 'GeoCoordinatesDimension'; @@ -125,7 +131,7 @@ export type GeoCoordinatesDimension = Dimension & { scaleType?: Maybe; isKeyDimension: Scalars['Boolean']; values: Array; - geoCoordinates: Scalars['GeoCoordinates']; + geoCoordinates?: Maybe>; }; @@ -367,7 +373,7 @@ export type ResolversTypes = ResolversObject<{ Boolean: ResolverTypeWrapper; DimensionValue: ResolverTypeWrapper; Filters: ResolverTypeWrapper; - GeoCoordinates: ResolverTypeWrapper; + GeoCoordinates: ResolverTypeWrapper; GeoCoordinatesDimension: ResolverTypeWrapper; GeoShapes: ResolverTypeWrapper; GeoShapesDimension: ResolverTypeWrapper; @@ -397,7 +403,7 @@ export type ResolversParentTypes = ResolversObject<{ Boolean: Scalars['Boolean']; DimensionValue: Scalars['DimensionValue']; Filters: Scalars['Filters']; - GeoCoordinates: Scalars['GeoCoordinates']; + GeoCoordinates: GeoCoordinates; GeoCoordinatesDimension: ResolvedDimension; GeoShapes: Scalars['GeoShapes']; GeoShapesDimension: ResolvedDimension; @@ -476,9 +482,13 @@ export interface FiltersScalarConfig extends GraphQLScalarTypeConfig { - name: 'GeoCoordinates'; -} +export type GeoCoordinatesResolvers = ResolversObject<{ + iri?: Resolver; + label?: Resolver; + latitude?: Resolver; + longitude?: Resolver; + __isTypeOf?: IsTypeOfResolverFn; +}>; export type GeoCoordinatesDimensionResolvers = ResolversObject<{ iri?: Resolver; @@ -487,7 +497,7 @@ export type GeoCoordinatesDimensionResolvers, ParentType, ContextType>; isKeyDimension?: Resolver; values?: Resolver, ParentType, ContextType, RequireFields>; - geoCoordinates?: Resolver; + geoCoordinates?: Resolver>, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }>; @@ -582,7 +592,7 @@ export type Resolvers = ResolversObject<{ Dimension?: DimensionResolvers; DimensionValue?: GraphQLScalarType; Filters?: GraphQLScalarType; - GeoCoordinates?: GraphQLScalarType; + GeoCoordinates?: GeoCoordinatesResolvers; GeoCoordinatesDimension?: GeoCoordinatesDimensionResolvers; GeoShapes?: GraphQLScalarType; GeoShapesDimension?: GeoShapesDimensionResolvers; diff --git a/app/graphql/schema.graphql b/app/graphql/schema.graphql index ee0fcb2b2..40ba94af3 100644 --- a/app/graphql/schema.graphql +++ b/app/graphql/schema.graphql @@ -2,7 +2,6 @@ scalar Observation scalar DimensionValue scalar RawObservation scalar Filters -scalar GeoCoordinates scalar GeoShapes type ObservationsQuery { @@ -54,6 +53,13 @@ interface Dimension { values(filters: Filters): [DimensionValue!]! } +type GeoCoordinates { + iri: String! + label: String! + latitude: Float! + longitude: Float! +} + type GeoCoordinatesDimension implements Dimension { iri: String! label: String! @@ -61,7 +67,7 @@ type GeoCoordinatesDimension implements Dimension { scaleType: String isKeyDimension: Boolean! values(filters: Filters): [DimensionValue!]! - geoCoordinates: GeoCoordinates! + geoCoordinates: [GeoCoordinates!] } type GeoShapesDimension implements Dimension { From 698cc513059403b909d53df49c752918d7080a47 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Tue, 1 Feb 2022 10:03:13 +0100 Subject: [PATCH 08/21] refactor: Stop fetching geoShapes on each filter change --- app/charts/map/chart-map.tsx | 40 ++++++++++++++++++---- app/charts/map/map-state.tsx | 16 ++++++--- app/configurator/map/map-chart-options.tsx | 33 +++++++++++------- app/graphql/queries/data-cubes.graphql | 20 ++++++++--- app/graphql/query-hooks.ts | 36 +++++++++++++++---- app/graphql/resolver-types.ts | 4 +-- app/graphql/schema.graphql | 2 +- 7 files changed, 114 insertions(+), 37 deletions(-) diff --git a/app/charts/map/chart-map.tsx b/app/charts/map/chart-map.tsx index d2e21115c..cff31d648 100644 --- a/app/charts/map/chart-map.tsx +++ b/app/charts/map/chart-map.tsx @@ -22,6 +22,7 @@ import { DimensionMetaDataFragment, useDataCubeObservationsQuery, useGeoCoordinatesByDimensionIriQuery, + useGeoShapesByDimensionIriQuery, } from "../../graphql/query-hooks"; import { useLocale } from "../../locales/use-locale"; import { QueryFilters } from "../shared/chart-helpers"; @@ -73,8 +74,8 @@ export const ChartMapVisualization = ({ useGeoCoordinatesByDimensionIriQuery({ variables: { dataCubeIri: dataSetIri, - locale, dimensionIri: symbolDimensionIri, + locale, }, }); @@ -82,13 +83,27 @@ export const ChartMapVisualization = ({ fetchedGeoCoordinates?.dataCubeByIri?.dimensionByIri?.__typename === "GeoCoordinatesDimension" ? fetchedGeoCoordinates.dataCubeByIri.dimensionByIri.geoCoordinates - : null; + : undefined; + + const [{ data: fetchedGeoShapes }] = useGeoShapesByDimensionIriQuery({ + variables: { + dataCubeIri: dataSetIri, + dimensionIri: areaDimensionIri, + locale, + }, + }); + + const geoShapes = + fetchedGeoShapes?.dataCubeByIri?.dimensionByIri?.__typename === + "GeoShapesDimension" + ? (fetchedGeoShapes.dataCubeByIri.dimensionByIri.geoShapes as GeoShapes) + : undefined; const areaLayer: AreaLayer | undefined = useMemo(() => { const dimension = dimensions?.find((d) => d.iri === areaDimensionIri); - if (isGeoShapesDimension(dimension) && observations) { - const { topology } = dimension.geoShapes as GeoShapes; + if (isGeoShapesDimension(dimension) && geoShapes && observations) { + const { topology } = geoShapes; const topojson = topojsonFeature( topology, @@ -109,12 +124,16 @@ export const ChartMapVisualization = ({ mesh: topojsonMesh(topology, topology.objects.shapes), }; } - }, [areaDimensionIri, dimensions, observations]); + }, [areaDimensionIri, dimensions, observations, geoShapes]); const symbolLayer: SymbolLayer | undefined = useMemo(() => { const dimension = dimensions?.find((d) => d.iri === symbolDimensionIri); - if (isGeoCoordinatesDimension(dimension) && geoCoordinates) { + if ( + isGeoCoordinatesDimension(dimension) && + geoCoordinates && + observations + ) { const points = geoCoordinates.map( (d) => ({ @@ -122,7 +141,7 @@ export const ChartMapVisualization = ({ properties: { iri: d.iri, label: d.label, - observation: observations?.find( + observation: observations.find( (o) => o[symbolDimensionIri] === d.label ), }, @@ -170,6 +189,7 @@ export const ChartMapVisualization = ({ measures={measures} dimensions={dimensions} baseLayer={chartConfig.baseLayer} + geoShapes={geoShapes} /> ); } else if (geoData.state === "fetching" || fetching) { @@ -188,6 +208,7 @@ export const ChartMapPrototype = ({ measures, dimensions, baseLayer, + geoShapes, }: { observations: Observation[]; features: GeoData; @@ -195,6 +216,7 @@ export const ChartMapPrototype = ({ measures: DimensionMetaDataFragment[]; dimensions: DimensionMetaDataFragment[]; baseLayer: BaseLayer; + geoShapes?: GeoShapes; }) => { return ( @@ -205,6 +227,7 @@ export const ChartMapPrototype = ({ measures={measures} dimensions={dimensions} baseLayer={baseLayer} + geoShapes={geoShapes} /> ); @@ -218,6 +241,7 @@ export const ChartMap = memo( measures, dimensions, baseLayer, + geoShapes, }: { features: GeoData; observations: Observation[]; @@ -225,6 +249,7 @@ export const ChartMap = memo( dimensions: DimensionMetaDataFragment[]; fields: MapFields; baseLayer: BaseLayer; + geoShapes?: GeoShapes; }) => { return ( diff --git a/app/charts/map/map-state.tsx b/app/charts/map/map-state.tsx index f8daf6281..c2e5f0a46 100644 --- a/app/charts/map/map-state.tsx +++ b/app/charts/map/map-state.tsx @@ -30,6 +30,7 @@ import { import { GeoData, GeoFeature, + GeoShapes, isGeoShapesDimension, Observation, } from "../../domain/data"; @@ -142,10 +143,12 @@ const useMapState = ({ measures, dimensions, baseLayer, + geoShapes, }: Pick & { features: GeoData; fields: MapFields; baseLayer: BaseLayer; + geoShapes?: GeoShapes; }): MapState => { const width = useWidth(); const { areaLayer, symbolLayer } = fields; @@ -169,10 +172,9 @@ const useMapState = ({ const dimension = dimensions.find((d) => d.iri === geoDimensionIri); // Right now hierarchies are only created for geoShapes - if (isGeoShapesDimension(dimension)) { + if (isGeoShapesDimension(dimension) && geoShapes) { const hierarchyLabels = ( - (dimension.geoShapes as any).topology.objects.shapes - .geometries as GeoFeature[] + (geoShapes as any).topology.objects.shapes.geometries as GeoFeature[] ) .filter((d) => d.properties.hierarchyLevel === hierarchyLevel) .map((d) => d.properties.label); @@ -182,7 +184,7 @@ const useMapState = ({ return data; }, - [data, dimensions] + [data, dimensions, geoShapes] ); const areaData = useMemo( @@ -313,12 +315,14 @@ const MapChartProvider = ({ measures, dimensions, baseLayer, + geoShapes, children, }: Pick & { features: GeoData; children: ReactNode; fields: MapFields; baseLayer: BaseLayer; + geoShapes?: GeoShapes; }) => { const state = useMapState({ data, @@ -327,6 +331,7 @@ const MapChartProvider = ({ measures, dimensions, baseLayer, + geoShapes, }); return ( {children} @@ -340,11 +345,13 @@ export const MapChart = ({ measures, dimensions, baseLayer, + geoShapes, children, }: Pick & { features: GeoData; fields: MapFields; baseLayer: BaseLayer; + geoShapes?: GeoShapes; children: ReactNode; }) => { return ( @@ -357,6 +364,7 @@ export const MapChart = ({ fields={fields} measures={measures} dimensions={dimensions} + geoShapes={geoShapes} baseLayer={baseLayer} > {children} diff --git a/app/configurator/map/map-chart-options.tsx b/app/configurator/map/map-chart-options.tsx index 1987de26a..2ddf08d4c 100644 --- a/app/configurator/map/map-chart-options.tsx +++ b/app/configurator/map/map-chart-options.tsx @@ -8,8 +8,9 @@ import { getGeoDimensions, getGeoShapesDimensions, } from "../../domain/data"; -import { GeoShapesDimension } from "../../graphql/query-hooks"; +import { useGeoShapesByDimensionIriQuery } from "../../graphql/query-hooks"; import { DataCubeMetadata } from "../../graphql/types"; +import { useLocale } from "../../src"; import { ColorRampField } from "../components/chart-controls/color-ramp"; import { ControlSection, @@ -88,6 +89,7 @@ export const AreaLayerSettings = memo( chartConfig: MapConfig; metaData: DataCubeMetadata; }) => { + const locale = useLocale(); const activeField = "areaLayer"; const geoShapesDimensions = useMemo( () => getGeoShapesDimensions(metaData.dimensions), @@ -101,21 +103,31 @@ export const AreaLayerSettings = memo( })), [geoShapesDimensions] ); - const dimension = geoShapesDimensions.find( - (d) => d.iri === chartConfig.fields.areaLayer.componentIri - ) as GeoShapesDimension; + + const [{ data: fetchedGeoShapes }] = useGeoShapesByDimensionIriQuery({ + variables: { + dataCubeIri: metaData.iri, + dimensionIri: chartConfig.fields.areaLayer.componentIri, + locale, + }, + }); + + const geoShapes = + fetchedGeoShapes?.dataCubeByIri?.dimensionByIri?.__typename === + "GeoShapesDimension" + ? (fetchedGeoShapes.dataCubeByIri.dimensionByIri.geoShapes as any) + : undefined; const hierarchyLevelOptions = useMemo( () => [ ...new Set( ( - (dimension?.geoShapes as any)?.topology?.objects?.shapes - ?.geometries as GeoFeature[] + geoShapes?.topology?.objects?.shapes?.geometries as GeoFeature[] )?.map((d) => d.properties.hierarchyLevel) ), ]?.map((d) => ({ value: d, label: `${d}` })), - [dimension?.geoShapes] + [geoShapes] ); const measuresOptions = useMemo( @@ -127,11 +139,8 @@ export const AreaLayerSettings = memo( [metaData.measures] ); - const numberOfGeoShapes = ( - dimension - ? dimension.geoShapes.topology.objects.shapes.geometries.length - : 0 - ) as number; + const numberOfGeoShapes = (geoShapes?.topology?.objects?.shapes?.geometries + ?.length || 0) as number; const numberOfColorScaleClasses = useMemo( () => diff --git a/app/graphql/queries/data-cubes.graphql b/app/graphql/queries/data-cubes.graphql index 73346f569..a10dc5e60 100644 --- a/app/graphql/queries/data-cubes.graphql +++ b/app/graphql/queries/data-cubes.graphql @@ -38,9 +38,6 @@ fragment dimensionMetaData on Dimension { isKeyDimension values(filters: $filters) unit - ... on GeoShapesDimension { - geoShapes - } ... on TemporalDimension { timeUnit timeFormat @@ -141,8 +138,8 @@ query DimensionValues( query GeoCoordinatesByDimensionIri( $dataCubeIri: String! $dimensionIri: String! - $latest: Boolean $locale: String! + $latest: Boolean ) { dataCubeByIri(iri: $dataCubeIri, locale: $locale, latest: $latest) { dimensionByIri(iri: $dimensionIri) { @@ -158,6 +155,21 @@ query GeoCoordinatesByDimensionIri( } } +query GeoShapesByDimensionIri( + $dataCubeIri: String! + $dimensionIri: String! + $locale: String! + $latest: Boolean +) { + dataCubeByIri(iri: $dataCubeIri, locale: $locale, latest: $latest) { + dimensionByIri(iri: $dimensionIri) { + ... on GeoShapesDimension { + geoShapes + } + } + } +} + query TemporalDimensionValues( $dataCubeIri: String! $dimensionIri: String! diff --git a/app/graphql/query-hooks.ts b/app/graphql/query-hooks.ts index 2b425d9c8..f19029ef8 100644 --- a/app/graphql/query-hooks.ts +++ b/app/graphql/query-hooks.ts @@ -143,7 +143,7 @@ export type GeoShapesDimension = Dimension & { scaleType?: Maybe; isKeyDimension: Scalars['Boolean']; values: Array; - geoShapes: Scalars['GeoShapes']; + geoShapes?: Maybe; }; @@ -300,7 +300,7 @@ export type DataCubesQuery = { __typename: 'Query', dataCubes: Array<{ __typenam type DimensionMetaData_GeoCoordinatesDimension_Fragment = { __typename: 'GeoCoordinatesDimension', iri: string, label: string, isKeyDimension: boolean, values: Array, unit?: Maybe }; -type DimensionMetaData_GeoShapesDimension_Fragment = { __typename: 'GeoShapesDimension', geoShapes: any, iri: string, label: string, isKeyDimension: boolean, values: Array, unit?: Maybe }; +type DimensionMetaData_GeoShapesDimension_Fragment = { __typename: 'GeoShapesDimension', iri: string, label: string, isKeyDimension: boolean, values: Array, unit?: Maybe }; type DimensionMetaData_Measure_Fragment = { __typename: 'Measure', iri: string, label: string, isKeyDimension: boolean, values: Array, unit?: Maybe }; @@ -425,13 +425,23 @@ export type DimensionValuesQuery = { __typename: 'Query', dataCubeByIri?: Maybe< export type GeoCoordinatesByDimensionIriQueryVariables = Exact<{ dataCubeIri: Scalars['String']; dimensionIri: Scalars['String']; - latest?: Maybe; locale: Scalars['String']; + latest?: Maybe; }>; export type GeoCoordinatesByDimensionIriQuery = { __typename: 'Query', dataCubeByIri?: Maybe<{ __typename: 'DataCube', dimensionByIri?: Maybe<{ __typename: 'GeoCoordinatesDimension', geoCoordinates?: Maybe> } | { __typename: 'GeoShapesDimension' } | { __typename: 'Measure' } | { __typename: 'NominalDimension' } | { __typename: 'OrdinalDimension' } | { __typename: 'TemporalDimension' }> }> }; +export type GeoShapesByDimensionIriQueryVariables = Exact<{ + dataCubeIri: Scalars['String']; + dimensionIri: Scalars['String']; + locale: Scalars['String']; + latest?: Maybe; +}>; + + +export type GeoShapesByDimensionIriQuery = { __typename: 'Query', dataCubeByIri?: Maybe<{ __typename: 'DataCube', dimensionByIri?: Maybe<{ __typename: 'GeoCoordinatesDimension' } | { __typename: 'GeoShapesDimension', geoShapes?: Maybe } | { __typename: 'Measure' } | { __typename: 'NominalDimension' } | { __typename: 'OrdinalDimension' } | { __typename: 'TemporalDimension' }> }> }; + export type TemporalDimensionValuesQueryVariables = Exact<{ dataCubeIri: Scalars['String']; dimensionIri: Scalars['String']; @@ -516,9 +526,6 @@ export const DimensionMetaDataFragmentDoc = gql` isKeyDimension values(filters: $filters) unit - ... on GeoShapesDimension { - geoShapes - } ... on TemporalDimension { timeUnit timeFormat @@ -654,7 +661,7 @@ export function useDimensionValuesQuery(options: Omit({ query: DimensionValuesDocument, ...options }); }; export const GeoCoordinatesByDimensionIriDocument = gql` - query GeoCoordinatesByDimensionIri($dataCubeIri: String!, $dimensionIri: String!, $latest: Boolean, $locale: String!) { + query GeoCoordinatesByDimensionIri($dataCubeIri: String!, $dimensionIri: String!, $locale: String!, $latest: Boolean) { dataCubeByIri(iri: $dataCubeIri, locale: $locale, latest: $latest) { dimensionByIri(iri: $dimensionIri) { ... on GeoCoordinatesDimension { @@ -673,6 +680,21 @@ export const GeoCoordinatesByDimensionIriDocument = gql` export function useGeoCoordinatesByDimensionIriQuery(options: Omit, 'query'> = {}) { return Urql.useQuery({ query: GeoCoordinatesByDimensionIriDocument, ...options }); }; +export const GeoShapesByDimensionIriDocument = gql` + query GeoShapesByDimensionIri($dataCubeIri: String!, $dimensionIri: String!, $locale: String!, $latest: Boolean) { + dataCubeByIri(iri: $dataCubeIri, locale: $locale, latest: $latest) { + dimensionByIri(iri: $dimensionIri) { + ... on GeoShapesDimension { + geoShapes + } + } + } +} + `; + +export function useGeoShapesByDimensionIriQuery(options: Omit, 'query'> = {}) { + return Urql.useQuery({ query: GeoShapesByDimensionIriDocument, ...options }); +}; export const TemporalDimensionValuesDocument = gql` query TemporalDimensionValues($dataCubeIri: String!, $dimensionIri: String!, $locale: String!, $latest: Boolean, $filters: Filters) { dataCubeByIri(iri: $dataCubeIri, locale: $locale, latest: $latest) { diff --git a/app/graphql/resolver-types.ts b/app/graphql/resolver-types.ts index 6458ef5de..eb1388323 100644 --- a/app/graphql/resolver-types.ts +++ b/app/graphql/resolver-types.ts @@ -148,7 +148,7 @@ export type GeoShapesDimension = Dimension & { scaleType?: Maybe; isKeyDimension: Scalars['Boolean']; values: Array; - geoShapes: Scalars['GeoShapes']; + geoShapes?: Maybe; }; @@ -512,7 +512,7 @@ export type GeoShapesDimensionResolvers, ParentType, ContextType>; isKeyDimension?: Resolver; values?: Resolver, ParentType, ContextType, RequireFields>; - geoShapes?: Resolver; + geoShapes?: Resolver, ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn; }>; diff --git a/app/graphql/schema.graphql b/app/graphql/schema.graphql index 40ba94af3..56cdbdcf9 100644 --- a/app/graphql/schema.graphql +++ b/app/graphql/schema.graphql @@ -77,7 +77,7 @@ type GeoShapesDimension implements Dimension { scaleType: String isKeyDimension: Boolean! values(filters: Filters): [DimensionValue!]! - geoShapes: GeoShapes! + geoShapes: GeoShapes } type NominalDimension implements Dimension { From 716a1f901815ec147b656e74c8177a44ebb7c615 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Tue, 1 Feb 2022 12:17:57 +0100 Subject: [PATCH 09/21] chore: Support urql devtools and conditionally import based on NODE_ENV --- app/graphql/context.tsx | 3 ++- app/graphql/devtools.dev.ts | 3 +++ app/graphql/devtools.prod.ts | 3 +++ app/next.config.js | 3 ++- app/package.json | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 app/graphql/devtools.dev.ts create mode 100644 app/graphql/devtools.prod.ts diff --git a/app/graphql/context.tsx b/app/graphql/context.tsx index 1c06396af..1b6d194a1 100644 --- a/app/graphql/context.tsx +++ b/app/graphql/context.tsx @@ -1,8 +1,9 @@ -import { devtoolsExchange } from "@urql/devtools"; import { ReactNode, useCallback } from "react"; import { createClient, defaultExchanges, Provider } from "urql"; import { GRAPHQL_ENDPOINT } from "../domain/env"; import { useLocale } from "../src"; +// @ts-ignore - dynamic package import based on NODE_ENV +import { devtoolsExchange } from "./devtools"; const client = createClient({ url: GRAPHQL_ENDPOINT, diff --git a/app/graphql/devtools.dev.ts b/app/graphql/devtools.dev.ts new file mode 100644 index 000000000..da3ddb383 --- /dev/null +++ b/app/graphql/devtools.dev.ts @@ -0,0 +1,3 @@ +import { devtoolsExchange } from "@urql/devtools"; + +export { devtoolsExchange }; diff --git a/app/graphql/devtools.prod.ts b/app/graphql/devtools.prod.ts new file mode 100644 index 000000000..f15b29c38 --- /dev/null +++ b/app/graphql/devtools.prod.ts @@ -0,0 +1,3 @@ +const devtoolsExchange = undefined; + +export { devtoolsExchange }; diff --git a/app/next.config.js b/app/next.config.js index 7604e1d2d..698322f98 100644 --- a/app/next.config.js +++ b/app/next.config.js @@ -82,7 +82,8 @@ module.exports = withPreconstruct( } } } - + + config.resolve.extensions.push(dev ? '.dev.ts' : '.prod.ts') // For some reason these need to be ignored for serverless target config.plugins.push(new IgnorePlugin(/^(pg-native|vue)$/)); diff --git a/app/package.json b/app/package.json index 17d70efc5..917da2556 100644 --- a/app/package.json +++ b/app/package.json @@ -35,6 +35,7 @@ "@tpluscode/sparql-builder": "^0.3.17", "@types/react-inspector": "^4.0.2", "@types/topojson-client": "^3.0.0", + "@urql/devtools": "^2.0.3", "apollo-server-micro": "^2.25.2", "catalog": "^4.0.1-canary.2", "clipboard-polyfill": "^3.0.1", @@ -127,7 +128,6 @@ "@types/sparql-http-client": "^2.2.5", "@types/topojson-server": "^3.0.1", "@types/wellknown": "^0.5.1", - "@urql/devtools": "^2.0.3", "babel-core": "^7.0.0-bridge.0", "jest": "^27.3.0", "react-inspector": "^5.1.1", From fdf9c907b2e45294aa551f886e79653cc70acdc7 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Tue, 1 Feb 2022 12:18:44 +0100 Subject: [PATCH 10/21] feat: Remove border top from map legend --- app/charts/map/map-legend.tsx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/charts/map/map-legend.tsx b/app/charts/map/map-legend.tsx index 279011762..9bd29b108 100644 --- a/app/charts/map/map-legend.tsx +++ b/app/charts/map/map-legend.tsx @@ -73,14 +73,7 @@ export const MapLegend = () => { const { areaLayer, symbolLayer } = useChartState() as MapState; return ( - + {areaLayer.show && ( {areaLayer.measureLabel && ( From 350617e0d062f052f6feebe39dccdd391fc8895a Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Tue, 1 Feb 2022 13:01:11 +0100 Subject: [PATCH 11/21] feat: Update dimension values only on filter reorder --- app/configurator/components/chart-configurator.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/configurator/components/chart-configurator.tsx b/app/configurator/components/chart-configurator.tsx index e6d692a54..3661e2b4c 100644 --- a/app/configurator/components/chart-configurator.tsx +++ b/app/configurator/components/chart-configurator.tsx @@ -2,7 +2,7 @@ import { t, Trans } from "@lingui/macro"; import { Menu, MenuButton, MenuItem, MenuList } from "@reach/menu-button"; import { sortBy } from "lodash"; import * as React from "react"; -import { useCallback } from "react"; +import { useCallback, useEffect } from "react"; import { DragDropContext, Draggable, @@ -135,7 +135,7 @@ export const ChartConfigurator = ({ // are the same while the order of the keys has changed. // If this is not present, we'll have outdated dimension // values after we change the filter order - date: new Date(), + filterKeys: Object.keys(state.chartConfig.filters).join(", "), }), [state, locale] ); @@ -171,14 +171,13 @@ export const ChartConfigurator = ({ [data?.dataCubeByIri?.dimensions, dispatch, metaData, state.chartConfig] ); - React.useEffect(() => { + useEffect(() => { executeQuery({ - requestPolicy: "network-only", variables, }); }, [variables, executeQuery]); - React.useEffect(() => { + useEffect(() => { if (!metaData || !data || !data.dataCubeByIri) { return; } From 0594a7a837b8c637304556e932ae89aca1c4a525 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Tue, 1 Feb 2022 13:17:47 +0100 Subject: [PATCH 12/21] feat: Update applying of shape color for undefined values --- app/charts/map/map.tsx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/app/charts/map/map.tsx b/app/charts/map/map.tsx index ec447af3e..9ed6ef0e7 100644 --- a/app/charts/map/map.tsx +++ b/app/charts/map/map.tsx @@ -237,13 +237,19 @@ export const MapComponent = () => { updateTriggers={{ getFillColor: [areaLayer.getValue, areaLayer.getColor], }} - getFillColor={(d: GeoFeature) => - d.properties.observation - ? areaLayer.getColor( - areaLayer.getValue(d.properties.observation) - ) - : [33, 33, 33, 33] - } + getFillColor={(d: GeoFeature) => { + const { observation } = d.properties; + + if (observation) { + const value = areaLayer.getValue(observation); + + if (value) { + return areaLayer.getColor(value); + } + } + + return [222, 222, 222, 255]; + }} /> Date: Tue, 1 Feb 2022 14:17:18 +0100 Subject: [PATCH 13/21] chore: Update deck.gl --- app/package.json | 12 +- yarn.lock | 527 ++++++++++++++++++++++++++--------------------- 2 files changed, 303 insertions(+), 236 deletions(-) diff --git a/app/package.json b/app/package.json index 917da2556..1295c0d2b 100644 --- a/app/package.json +++ b/app/package.json @@ -14,12 +14,12 @@ }, "dependencies": { "@babel/standalone": "^7.11.6", - "@deck.gl/core": "^8.4.8", - "@deck.gl/extensions": "^8.4.10", - "@deck.gl/geo-layers": "^8.4.10", - "@deck.gl/layers": "^8.4.8", - "@deck.gl/mesh-layers": "^8.4.10", - "@deck.gl/react": "^8.4.8", + "@deck.gl/core": "8.6.7", + "@deck.gl/extensions": "8.6.7", + "@deck.gl/geo-layers": "8.6.7", + "@deck.gl/layers": "8.6.7", + "@deck.gl/mesh-layers": "8.6.7", + "@deck.gl/react": "8.6.7", "@juggle/resize-observer": "^3.2.0", "@lingui/react": "^3.2.3", "@mdx-js/react": "^1.6.22", diff --git a/yarn.lock b/yarn.lock index 258801c97..8bacaed2f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -917,67 +917,68 @@ debug "^3.1.0" lodash.once "^4.1.1" -"@deck.gl/core@^8.4.8": - version "8.4.17" - resolved "https://registry.yarnpkg.com/@deck.gl/core/-/core-8.4.17.tgz#28ad4cc0198787c2f7604100966fa62c4ca00f85" - integrity sha512-YJ2s0LxiE6ySKACyqeh5XluAFZ2XKYx6QBwvrNx/HtWsFlOqB/k0ibvCn8SQQzly5r8Y0jbylROA5aDuns/rSw== - dependencies: - "@loaders.gl/core" "^2.3.13" - "@loaders.gl/images" "^2.3.13" - "@luma.gl/core" "^8.4.1" - "@math.gl/web-mercator" "^3.4.2" +"@deck.gl/core@8.6.7": + version "8.6.7" + resolved "https://registry.yarnpkg.com/@deck.gl/core/-/core-8.6.7.tgz#9e53ac5cd0b152b6346d837927048e1ccf0f819f" + integrity sha512-QaIbyi4PlbJsKQMrSlbwbMjXJKFFRzkx5HGy3aSpDBQxMtj7zp3BHlZ3V7bAMatG9zq/ZMqDLgAMia0dcv1BJA== + dependencies: + "@loaders.gl/core" "^3.1.5" + "@loaders.gl/images" "^3.1.5" + "@luma.gl/core" "^8.5.10" + "@math.gl/web-mercator" "^3.5.6" gl-matrix "^3.0.0" - math.gl "^3.4.2" + math.gl "^3.5.4" mjolnir.js "^2.5.0" - probe.gl "^3.2.1" - -"@deck.gl/extensions@^8.4.10": - version "8.4.17" - resolved "https://registry.yarnpkg.com/@deck.gl/extensions/-/extensions-8.4.17.tgz#ac4606e2d81863efa84c54ef3a5d956fbe1e7ce5" - integrity sha512-ok3BIpSAkoII0PGKCcPQVYqci0jCSWT7KIVcfQzz+lEOREqxN/wTQMtDn76RbMHwhplA9SNHWh8D67UWXWvQIw== - dependencies: - "@luma.gl/shadertools" "^8.4.1" - -"@deck.gl/geo-layers@^8.4.10": - version "8.4.17" - resolved "https://registry.yarnpkg.com/@deck.gl/geo-layers/-/geo-layers-8.4.17.tgz#c5f98344413f49452312f783f26078999292f5ae" - integrity sha512-RFyHkOgpsG5BoZ6HNafuC2U2lf4f1mPLNfIymZspsCgiIRZZoJbt+2XJIrRj19d+71kEQeMqGSfLVmz65ZnSLg== - dependencies: - "@loaders.gl/3d-tiles" "^2.3.13" - "@loaders.gl/gis" "^2.3.13" - "@loaders.gl/loader-utils" "^2.3.13" - "@loaders.gl/mvt" "^2.3.13" - "@loaders.gl/terrain" "^2.3.13" - "@loaders.gl/tiles" "^2.3.13" - "@math.gl/culling" "^3.4.2" - "@math.gl/web-mercator" "^3.4.2" + probe.gl "^3.4.0" + +"@deck.gl/extensions@8.6.7": + version "8.6.7" + resolved "https://registry.yarnpkg.com/@deck.gl/extensions/-/extensions-8.6.7.tgz#e04391070a87ed220821de1156a8db92ce1e349d" + integrity sha512-kLlL+/HUmTDK9iRbfsJycY0Tx1OsYyUgreXk6qWZDS9hOdktZz8RIdn/JM5AmO1RFpxheUoOcyXbM3M9AtWdSQ== + dependencies: + "@luma.gl/shadertools" "^8.5.10" + +"@deck.gl/geo-layers@8.6.7": + version "8.6.7" + resolved "https://registry.yarnpkg.com/@deck.gl/geo-layers/-/geo-layers-8.6.7.tgz#5ba4bd18bb9331f88ef5f74c85c56123cf9f516b" + integrity sha512-ZNOwlj1O0FGZ+P9EOk1l0to+cYj3Nl4G8SjnH3c//zyOv+hlL2+zhjcic8TjaQhe7pK/nV0IxfX/eFsQzMcvFg== + dependencies: + "@loaders.gl/3d-tiles" "^3.1.5" + "@loaders.gl/gis" "^3.1.5" + "@loaders.gl/loader-utils" "^3.1.5" + "@loaders.gl/mvt" "^3.1.5" + "@loaders.gl/terrain" "^3.1.5" + "@loaders.gl/tiles" "^3.1.5" + "@luma.gl/experimental" "^8.5.10" + "@math.gl/culling" "^3.5.6" + "@math.gl/web-mercator" "^3.5.6" h3-js "^3.6.0" long "^3.2.0" - math.gl "^3.4.2" + math.gl "^3.5.6" -"@deck.gl/layers@^8.4.8": - version "8.4.17" - resolved "https://registry.yarnpkg.com/@deck.gl/layers/-/layers-8.4.17.tgz#ad1d0990e82d38d447042d0156e9c5e8fa416ab1" - integrity sha512-a9Y/FxPpkcgaHjaWqiWzH7sRwsJGnxrItbzpbioKMHuzEWZk8vc6SOgGiarygmQPhkt78wxJwBflASC5OIjmkA== +"@deck.gl/layers@8.6.7": + version "8.6.7" + resolved "https://registry.yarnpkg.com/@deck.gl/layers/-/layers-8.6.7.tgz#8bf9a7ee2dbdf76351321bf51f5212f2605a6e9e" + integrity sha512-UJSfWi/bE51uttb9MAUwUC4dCx7MADhwgZktS/p7e6COEX/4fUCEY9++jca7gSutdBEmBPIwmsII36OEn2kPQA== dependencies: - "@loaders.gl/images" "^2.3.13" + "@loaders.gl/images" "^3.1.5" "@mapbox/tiny-sdf" "^1.1.0" - "@math.gl/polygon" "^3.4.2" + "@math.gl/polygon" "^3.5.6" earcut "^2.0.6" -"@deck.gl/mesh-layers@^8.4.10": - version "8.4.17" - resolved "https://registry.yarnpkg.com/@deck.gl/mesh-layers/-/mesh-layers-8.4.17.tgz#54b88d00f36316ac34fdc52b82c93d1cdc735c11" - integrity sha512-oHZ9dpWgT9y6mIr11nJRLjYDzTPoq+1GkbM+9CDYIDutRIj6tt7IHjk5xh3BWxSYmgNprFRJImo9ZjZ/Crw6UA== +"@deck.gl/mesh-layers@8.6.7": + version "8.6.7" + resolved "https://registry.yarnpkg.com/@deck.gl/mesh-layers/-/mesh-layers-8.6.7.tgz#3d60f83288d73a17117f4f1bafb78219f0e5fe0c" + integrity sha512-Vt67l1K+zkBkL4YwmKl9edQMISGffTbd+6b9g0HAfYJB2c6ga+kBrLablgOC7/eksvZShbApNuq32xmtK35lhg== dependencies: - "@loaders.gl/gltf" "^2.3.13" - "@luma.gl/experimental" "^8.4.1" - "@luma.gl/shadertools" "^8.4.1" + "@loaders.gl/gltf" "^3.1.5" + "@luma.gl/experimental" "^8.5.10" + "@luma.gl/shadertools" "^8.5.10" -"@deck.gl/react@^8.4.8": - version "8.4.17" - resolved "https://registry.yarnpkg.com/@deck.gl/react/-/react-8.4.17.tgz#180f6a85c3e040888462629de4ccb6526682dcf4" - integrity sha512-0hU0h3m4Xf6cbhFeIEszVFAIJ9HgLxaIs5VOYwKrdwIFBA9A6tg5B+JKN8dC8vw7xVu5pyB3+HaGYnGb45VJYQ== +"@deck.gl/react@8.6.7": + version "8.6.7" + resolved "https://registry.yarnpkg.com/@deck.gl/react/-/react-8.6.7.tgz#44ad331ccf9254b16055ca334412a3889df946e9" + integrity sha512-iZCI6Bi2c8pX8mD3J/3sdm7ZyzxKguU/J/gx6Zc1lIjC852U2r/Utfzywlcr2vjJYhUb2H9KnemuV0nU0lXTQA== dependencies: prop-types "^15.6.0" @@ -2230,180 +2231,211 @@ "@babel/runtime" "^7.11.2" "@lingui/core" "^3.10.2" -"@loaders.gl/3d-tiles@^2.3.13": - version "2.3.13" - resolved "https://registry.yarnpkg.com/@loaders.gl/3d-tiles/-/3d-tiles-2.3.13.tgz#7b304423d42e76ecc4e7ee4339174a29f2c364ae" - integrity sha512-WccDTlv/AJo5GJFEa6MIjk1H0294hTs8zhmEDq5mmdQ4B7la+4aWKmIfJmgCcIv8vWUkzQIuRIHTgxi0ShmUTw== - dependencies: - "@loaders.gl/core" "2.3.13" - "@loaders.gl/draco" "2.3.13" - "@loaders.gl/gltf" "2.3.13" - "@loaders.gl/loader-utils" "2.3.13" - "@loaders.gl/math" "2.3.13" - "@loaders.gl/tiles" "2.3.13" - "@math.gl/core" "^3.3.0" - "@math.gl/geospatial" "^3.3.0" - "@probe.gl/stats" "^3.3.0" - -"@loaders.gl/core@2.3.13", "@loaders.gl/core@^2.3.13": - version "2.3.13" - resolved "https://registry.yarnpkg.com/@loaders.gl/core/-/core-2.3.13.tgz#093fe965cfab0a72c902a63d461282ae1ed55dc2" - integrity sha512-Hjm8eJjS/OUnaHrOSgXtE+qDg5V4Do0jIpp2u0Dv3CMxPrtd2TpwkDfAyZWmmbZew9rzqPoAVMINejS/ItWUeg== +"@loaders.gl/3d-tiles@^3.1.5": + version "3.1.7" + resolved "https://registry.yarnpkg.com/@loaders.gl/3d-tiles/-/3d-tiles-3.1.7.tgz#cd5fbdb12af879d9db2ec4eb6f99f9e4505a4653" + integrity sha512-cogL/V82TFNtjjCtFh+C+jqBYdpcepL05o2p0uChQBdOZzCZUmUsqig4N/T3NywOwsmlJcDcvfTC6CtUzHcDtg== dependencies: - "@babel/runtime" "^7.3.1" - "@loaders.gl/loader-utils" "2.3.13" + "@loaders.gl/draco" "3.1.7" + "@loaders.gl/gltf" "3.1.7" + "@loaders.gl/loader-utils" "3.1.7" + "@loaders.gl/math" "3.1.7" + "@loaders.gl/tiles" "3.1.7" + "@math.gl/core" "^3.5.1" + "@math.gl/geospatial" "^3.5.1" -"@loaders.gl/draco@2.3.13": - version "2.3.13" - resolved "https://registry.yarnpkg.com/@loaders.gl/draco/-/draco-2.3.13.tgz#fcc08c0a3b438e3d7ed099dbafc1f83205b5f41b" - integrity sha512-rePkoM/xpvNyjO2vvBRQ39Aa3tCpBFCWf/jheka4bFXnLJzy8X7ZGNXojZEsrdT0lAiHM+QrCeAWvtyDEujURA== +"@loaders.gl/core@^3.1.5": + version "3.1.7" + resolved "https://registry.yarnpkg.com/@loaders.gl/core/-/core-3.1.7.tgz#c1eee4212c14ddd2b2886b84485201c1f643af46" + integrity sha512-mJRAIFZB1PBQ6ed7RhIIL9Sr7RDHwbof//5W2wVz1xyiMwyDMyIN41PNGX06oYwZMEnN2cel8HLpexr5kShH7A== dependencies: "@babel/runtime" "^7.3.1" - "@loaders.gl/loader-utils" "2.3.13" - draco3d "^1.3.6" + "@loaders.gl/loader-utils" "3.1.7" + "@loaders.gl/worker-utils" "3.1.7" + "@probe.gl/log" "^3.5.0" + probe.gl "^3.4.0" -"@loaders.gl/gis@2.3.13", "@loaders.gl/gis@^2.3.13": - version "2.3.13" - resolved "https://registry.yarnpkg.com/@loaders.gl/gis/-/gis-2.3.13.tgz#b80cda7e8f709efd0a5a9badf7daf9c68b6b0409" - integrity sha512-i+hot7QeW53GhRwnvF5H65lsZYv4/ESbFuGtNy5TKivPaTIqn1oIFtLOku9Ntw5xTfky9qNNlbMPcsDMoniavQ== +"@loaders.gl/draco@3.1.7": + version "3.1.7" + resolved "https://registry.yarnpkg.com/@loaders.gl/draco/-/draco-3.1.7.tgz#12c26bbdc2bfda581ecb2a594b223091e2cbcf80" + integrity sha512-FAKSGJgwlVYelX2Wx2JJDuWBbfsw/r3z7ZKg5PTOM+6LMkI+ffIBBP/rt/kF19Fy+dmBhG9HmV5SGfSFVKfFIA== dependencies: - "@loaders.gl/loader-utils" "2.3.13" + "@babel/runtime" "^7.3.1" + "@loaders.gl/loader-utils" "3.1.7" + "@loaders.gl/schema" "3.1.7" + "@loaders.gl/worker-utils" "3.1.7" + draco3d "1.4.1" + +"@loaders.gl/gis@3.1.7", "@loaders.gl/gis@^3.1.5": + version "3.1.7" + resolved "https://registry.yarnpkg.com/@loaders.gl/gis/-/gis-3.1.7.tgz#3c13c09d1dde4b6da9a184cf5e514e913dbf4296" + integrity sha512-CmGK4tNAsKKbJEQ9sjwLPKqvyzEZmjMm1YAJ9vWwIo72Bzt+/VhniwkrpgDYTTfiXe2uhMa1tfJRU4w1/7wP5A== + dependencies: + "@loaders.gl/loader-utils" "3.1.7" + "@loaders.gl/schema" "3.1.7" "@mapbox/vector-tile" "^1.3.1" + "@math.gl/polygon" "^3.5.1" pbf "^3.2.1" -"@loaders.gl/gltf@2.3.13", "@loaders.gl/gltf@^2.3.13": - version "2.3.13" - resolved "https://registry.yarnpkg.com/@loaders.gl/gltf/-/gltf-2.3.13.tgz#4207ee05232b089a9cafa0254cae6812f7ac351b" - integrity sha512-V/GUMe1Gm8cEfKnp899l0Nu6rKycEbLidO9WYhlwbB5avcwrxltWRqoWvQKFKNCqJyH5neJbl8vDmaaeeELD3w== +"@loaders.gl/gltf@3.1.7", "@loaders.gl/gltf@^3.1.5": + version "3.1.7" + resolved "https://registry.yarnpkg.com/@loaders.gl/gltf/-/gltf-3.1.7.tgz#750e68ff3f27c4ea13b7c5297532f0ec81fa6329" + integrity sha512-GoDHgPCoIaO9SXqCiHlweotjt7qi3uxXoFQKsi/snDNMJVMXZqgCkdAHqa5+7ZaAtasak7E8RRabCjKqOvBGZA== dependencies: - "@loaders.gl/core" "2.3.13" - "@loaders.gl/draco" "2.3.13" - "@loaders.gl/images" "2.3.13" - "@loaders.gl/loader-utils" "2.3.13" + "@loaders.gl/draco" "3.1.7" + "@loaders.gl/images" "3.1.7" + "@loaders.gl/loader-utils" "3.1.7" + "@loaders.gl/textures" "3.1.7" -"@loaders.gl/images@2.3.13", "@loaders.gl/images@^2.3.13": - version "2.3.13" - resolved "https://registry.yarnpkg.com/@loaders.gl/images/-/images-2.3.13.tgz#3b827cf1e8d31c8f1adf85136c7fd53c08dbb0a8" - integrity sha512-BBgLf17udhRnYwvsObAOM7jEeLBaeU3di1NyLhpTMa7WbG3jAnDlmy1BRue8wYfgVpWnmk18YubZtX6vCRrJnA== +"@loaders.gl/images@3.1.7", "@loaders.gl/images@^3.1.5": + version "3.1.7" + resolved "https://registry.yarnpkg.com/@loaders.gl/images/-/images-3.1.7.tgz#821217ddf76132f1379bdf115b7d6f44a5f0c663" + integrity sha512-sXpPSKRnLf8KsIUZfXsLXgMXva2jle9ppxiiH2EH8J0wc4Z9nl0D+3MVkc+RuKLWZHZMhjjHdxLDNMM26Xm3LQ== dependencies: - "@loaders.gl/loader-utils" "2.3.13" + "@loaders.gl/loader-utils" "3.1.7" -"@loaders.gl/loader-utils@2.3.13", "@loaders.gl/loader-utils@^2.3.13": - version "2.3.13" - resolved "https://registry.yarnpkg.com/@loaders.gl/loader-utils/-/loader-utils-2.3.13.tgz#5cf6403b1c19b2fe5abacbd89e6252b8ca50db96" - integrity sha512-vXzH5CWG8pWjUEb7hUr6CM4ERj4NVRpA60OxvVv/OaZZ7hNN63+9/tSUA5IXD9QArWPWrFBnKnvE+5gg4WNqTg== +"@loaders.gl/loader-utils@3.1.7", "@loaders.gl/loader-utils@^3.1.5": + version "3.1.7" + resolved "https://registry.yarnpkg.com/@loaders.gl/loader-utils/-/loader-utils-3.1.7.tgz#51b4e255f5cc99be61b66a7812f9b77b6d8e45d5" + integrity sha512-bovBX/RUakwh/R51eRzVIFMgr/FcSyf02Guaouz+OXgNl0ngzu8i+B5lFDVUoYG6rhfmuMIDcpiEdgnPTXtU4A== dependencies: "@babel/runtime" "^7.3.1" - "@probe.gl/stats" "^3.3.0" + "@loaders.gl/worker-utils" "3.1.7" + "@probe.gl/stats" "^3.5.0" + +"@loaders.gl/math@3.1.7": + version "3.1.7" + resolved "https://registry.yarnpkg.com/@loaders.gl/math/-/math-3.1.7.tgz#3a588ec35a2d547f663465fb6b964a5bb7a816bc" + integrity sha512-nevgooLEG+Y8WwlgkUBP65WhuQd+PU1e6WUZIoOxjfOJu0BSPCF+Faw4vVrSmM5wwvqvtClymWF5T5HvGZOXwA== + dependencies: + "@loaders.gl/images" "3.1.7" + "@loaders.gl/loader-utils" "3.1.7" + "@math.gl/core" "^3.5.1" + +"@loaders.gl/mvt@^3.1.5": + version "3.1.7" + resolved "https://registry.yarnpkg.com/@loaders.gl/mvt/-/mvt-3.1.7.tgz#a99b81ebf0102c4ebfedc720d95199844a1755e0" + integrity sha512-WtmSi3pf4y6Ea4NrefPv99/r3xHjjvP/KdazhWVfZnY7IGLbYZoGkIbRcJn7DgUOjbqKxcy7yZ0SvlXdlS4YyQ== + dependencies: + "@loaders.gl/gis" "3.1.7" + "@loaders.gl/loader-utils" "3.1.7" + "@loaders.gl/schema" "3.1.7" + "@math.gl/polygon" "^3.5.1" + pbf "^3.2.1" -"@loaders.gl/math@2.3.13": - version "2.3.13" - resolved "https://registry.yarnpkg.com/@loaders.gl/math/-/math-2.3.13.tgz#500173a7b2202ca09ee07e68f617ec45e8f3bfd9" - integrity sha512-ewlpk+5NR+DWSDx7OIptcd+KaPRmwgOlSg/54p+pjw1oO0rqs7y8tv7s+KfYJX66rN7i9MiBaJ0JwfC0lrB09A== +"@loaders.gl/schema@3.1.7": + version "3.1.7" + resolved "https://registry.yarnpkg.com/@loaders.gl/schema/-/schema-3.1.7.tgz#8bb4cbec97a5938e4e50a4acea6e7a648d481fd0" + integrity sha512-BSMvXQGHzyB/dHMxwgriII1bXR4nSSHh+vljnyyGTeiprg5OZ7SylyDYtwsZ5T4e4EBzF1St+NrTQ+sm95M0mw== dependencies: - "@loaders.gl/images" "2.3.13" - "@loaders.gl/loader-utils" "2.3.13" - "@math.gl/core" "^3.3.0" + "@types/geojson" "^7946.0.7" -"@loaders.gl/mvt@^2.3.13": - version "2.3.13" - resolved "https://registry.yarnpkg.com/@loaders.gl/mvt/-/mvt-2.3.13.tgz#87cf43f017446f5c996f13c874b6d6b601498c72" - integrity sha512-Zi1Gc6XzxTY05tVbxMITvy6zUiBhMpMWvhPkaCcOfktblDMnhQTkIb9fVnhv7ioe4hId4rvuXDIUXhtrBTJEKQ== +"@loaders.gl/terrain@^3.1.5": + version "3.1.7" + resolved "https://registry.yarnpkg.com/@loaders.gl/terrain/-/terrain-3.1.7.tgz#38bbe9d3d26c2c0d3b998fa72f119e9f67c55ef4" + integrity sha512-YrlLtbdQ26xy6WBvE8xchXIpZPM2vSYhgKMnPe8mC2lRaOFcimamCnfhrsE+klw2baM1LEH5hj1svAwrHcbZIQ== dependencies: - "@loaders.gl/gis" "2.3.13" - "@loaders.gl/loader-utils" "2.3.13" - "@mapbox/point-geometry" "~0.1.0" - "@mapbox/vector-tile" "^1.3.1" - pbf "^3.2.1" + "@babel/runtime" "^7.3.1" + "@loaders.gl/loader-utils" "3.1.7" + "@loaders.gl/schema" "3.1.7" + "@mapbox/martini" "^0.2.0" -"@loaders.gl/terrain@^2.3.13": - version "2.3.13" - resolved "https://registry.yarnpkg.com/@loaders.gl/terrain/-/terrain-2.3.13.tgz#84f9d332f05fbd453caed3a9c9b8c9d6caaf2c4a" - integrity sha512-sZi/CMcNxKbcv7F8pk0PLX5P0o11Sy8DzOk4MB0mRe4XM1ITeiaXf8L6JZkOC3HBdBOzNlId6N3f32fK9OHPnw== +"@loaders.gl/textures@3.1.7": + version "3.1.7" + resolved "https://registry.yarnpkg.com/@loaders.gl/textures/-/textures-3.1.7.tgz#8829964978f32c8ca4295a6348cfadff9b0cc2a6" + integrity sha512-l05IInvFoROcu0tTcVGJ8ZUSH95gqO1SIcrQIcfSc8vwnGqudHD8yrOFaL/ZtUs3Qx6HOX8ZP03v5m/eZ1Jiqw== + dependencies: + "@loaders.gl/images" "3.1.7" + "@loaders.gl/loader-utils" "3.1.7" + "@loaders.gl/worker-utils" "3.1.7" + ktx-parse "^0.0.4" + texture-compressor "^1.0.2" + +"@loaders.gl/tiles@3.1.7", "@loaders.gl/tiles@^3.1.5": + version "3.1.7" + resolved "https://registry.yarnpkg.com/@loaders.gl/tiles/-/tiles-3.1.7.tgz#b1840266a6045b4e1cd8281e1bf23c609c8d0ba2" + integrity sha512-TBantuL8gq3+EJeYIWSMUY6zHWK8Y9IEuiReIK8UjVZbf6rVRl9edX/zkfoGSZqBY7x53eUMMMKKOCfO1WKYrQ== + dependencies: + "@loaders.gl/loader-utils" "3.1.7" + "@loaders.gl/math" "3.1.7" + "@math.gl/core" "^3.5.1" + "@math.gl/culling" "^3.5.1" + "@math.gl/geospatial" "^3.5.1" + "@math.gl/web-mercator" "^3.5.1" + "@probe.gl/stats" "^3.5.0" + +"@loaders.gl/worker-utils@3.1.7": + version "3.1.7" + resolved "https://registry.yarnpkg.com/@loaders.gl/worker-utils/-/worker-utils-3.1.7.tgz#31d78de788522ac250469778aee91f93aa9bc359" + integrity sha512-OkE2xg/CrEAD0Vl59UGerL5D4n3bcafNpNO7nTebq9HRxmbCp0ngt/nyiHDsrHcovAdK/cNWWFtknoaZHQX3Tg== dependencies: "@babel/runtime" "^7.3.1" - "@loaders.gl/loader-utils" "2.3.13" - "@mapbox/martini" "^0.2.0" -"@loaders.gl/tiles@2.3.13", "@loaders.gl/tiles@^2.3.13": - version "2.3.13" - resolved "https://registry.yarnpkg.com/@loaders.gl/tiles/-/tiles-2.3.13.tgz#470f5f46d35699ad7063445d1ba142e3ce4dabf0" - integrity sha512-3ZSlMgcPTo5lCnvKw/is5dvTayzvX+wi6n1u4lEe4gt8Ml9KYp/e45hOqp6qXR6SckO2+ohBXOzQP2e8ZhRxXQ== - dependencies: - "@loaders.gl/core" "2.3.13" - "@loaders.gl/loader-utils" "2.3.13" - "@loaders.gl/math" "2.3.13" - "@math.gl/core" "^3.3.0" - "@math.gl/culling" "^3.3.0" - "@math.gl/geospatial" "^3.3.0" - "@math.gl/web-mercator" "^3.3.0" - "@probe.gl/stats" "^3.3.0" - -"@luma.gl/constants@8.4.5": - version "8.4.5" - resolved "https://registry.yarnpkg.com/@luma.gl/constants/-/constants-8.4.5.tgz#561829898393b8a06342b5084f168f1c0bce625b" - integrity sha512-TKQJ/sktJ8KHS18hnY30EiLIeTfKo0bc7ECNpUrEWQdls9nZRC5mF+JDSfPv1JlDFWvNXwXR0k3D2X8J/tg3VA== - -"@luma.gl/core@^8.4.1": - version "8.4.5" - resolved "https://registry.yarnpkg.com/@luma.gl/core/-/core-8.4.5.tgz#a4eadc4375c7f7dac0b698cf83d25c8fe8f6df29" - integrity sha512-J5fc35Bo8OpFTLQpeacYRtprjIMbgxNlPddnHLzBT3Q2pBrO4yHaA9NEZHEoXULUcuIgIpI/tSk62fc/bFrjiA== +"@luma.gl/constants@8.5.10": + version "8.5.10" + resolved "https://registry.yarnpkg.com/@luma.gl/constants/-/constants-8.5.10.tgz#dd8b5ed786e372582a1a28e79c20481e363b4b50" + integrity sha512-0OZnNbb8hF+ogr/Exr5KFEnSMQdCgjrbO2ZYeNIGO0UVMTu4oTSLfRcBxKUs1NzxG5RogyV8dL6ETQbkP5VAZw== + +"@luma.gl/core@^8.5.10": + version "8.5.10" + resolved "https://registry.yarnpkg.com/@luma.gl/core/-/core-8.5.10.tgz#a4fdb8656e249b72b84addb0a9412ab91a65fc15" + integrity sha512-NzzMnSgzPta3gMu8vSM/kWiY09HypHRXt4zw/xFX4geLeX4iXm7Jnm+eeaNpc/QH/yJ51+4bpvZml0P5NIukfQ== dependencies: "@babel/runtime" "^7.0.0" - "@luma.gl/constants" "8.4.5" - "@luma.gl/engine" "8.4.5" - "@luma.gl/gltools" "8.4.5" - "@luma.gl/shadertools" "8.4.5" - "@luma.gl/webgl" "8.4.5" + "@luma.gl/constants" "8.5.10" + "@luma.gl/engine" "8.5.10" + "@luma.gl/gltools" "8.5.10" + "@luma.gl/shadertools" "8.5.10" + "@luma.gl/webgl" "8.5.10" -"@luma.gl/engine@8.4.5": - version "8.4.5" - resolved "https://registry.yarnpkg.com/@luma.gl/engine/-/engine-8.4.5.tgz#ee788b4ceab1288d5fd3915df5f3b6198ea76234" - integrity sha512-PhQ66ty8cww1pyJOFHv/jdaoIRKHeFgTPm1QMJ8w3iG9fkfjXN7yzzoZ3AvkkwXI4zdmC01kODMOMSgOjmJyGQ== +"@luma.gl/engine@8.5.10": + version "8.5.10" + resolved "https://registry.yarnpkg.com/@luma.gl/engine/-/engine-8.5.10.tgz#4e8cdd8ffb0bd5e13e4e521f4e0b05c21a9805a6" + integrity sha512-W3cPlabMl1g6dfAio4yGD9GohoMULXqsBm9P9WOh0KypQBw5pFlE2C/njY43YhfvnpMPDMUjjraYrEXa1fhaig== dependencies: "@babel/runtime" "^7.0.0" - "@luma.gl/constants" "8.4.5" - "@luma.gl/gltools" "8.4.5" - "@luma.gl/shadertools" "8.4.5" - "@luma.gl/webgl" "8.4.5" - "@math.gl/core" "^3.4.2" - probe.gl "^3.2.1" - -"@luma.gl/experimental@^8.4.1": - version "8.4.5" - resolved "https://registry.yarnpkg.com/@luma.gl/experimental/-/experimental-8.4.5.tgz#64e1c581c5dd2c6e8f9b8643a9d8f29e12b4b1ab" - integrity sha512-SZuz6P+Oxz0SpJhfgueo6PT8JilOBAPd6KtfqUG5J8t+ZUAbpTG65O7rY+dja5gMhTyyNuNgTwzKgvjXvEMiVQ== - dependencies: - "@luma.gl/constants" "8.4.5" - "@math.gl/core" "^3.4.1" + "@luma.gl/constants" "8.5.10" + "@luma.gl/gltools" "8.5.10" + "@luma.gl/shadertools" "8.5.10" + "@luma.gl/webgl" "8.5.10" + "@math.gl/core" "^3.5.0" + probe.gl "^3.4.0" + +"@luma.gl/experimental@^8.5.10": + version "8.5.10" + resolved "https://registry.yarnpkg.com/@luma.gl/experimental/-/experimental-8.5.10.tgz#103a2873e9a390a272480d22685b98875d615cab" + integrity sha512-1Ldq2DEor9qWHoRetcAz4BID1pwp+5x67F2mfe2UtjEpDY0Modi7t8C94PR8cviyjRIu3DErxX7o8HxJ4JXxpQ== + dependencies: + "@luma.gl/constants" "8.5.10" + "@math.gl/core" "^3.5.0" earcut "^2.0.6" -"@luma.gl/gltools@8.4.5": - version "8.4.5" - resolved "https://registry.yarnpkg.com/@luma.gl/gltools/-/gltools-8.4.5.tgz#0c764a17d5885de3e72316e5eb1a1653d28af699" - integrity sha512-uFmFLFOLUBTMcLC3R5zgDjE1AlytIZA7gv521zla3zNJNnzI/XJ2v56XwIDBjNiwZDPSBKEdT5xOUrCf6qcGaA== +"@luma.gl/gltools@8.5.10": + version "8.5.10" + resolved "https://registry.yarnpkg.com/@luma.gl/gltools/-/gltools-8.5.10.tgz#be47f64f215d97e8d5896ab14060078bd04fd12e" + integrity sha512-XQFocLXvSYfkW2xL1I50nYrPwgyt1jvmzmood3RQBQMiBcgU1JFW2w4tU+V/C5QXcAWWVzm8aIBkuQsCo34zrQ== dependencies: "@babel/runtime" "^7.0.0" - "@luma.gl/constants" "8.4.5" - probe.gl "^3.2.1" + "@luma.gl/constants" "8.5.10" + probe.gl "^3.4.0" -"@luma.gl/shadertools@8.4.5", "@luma.gl/shadertools@^8.4.1": - version "8.4.5" - resolved "https://registry.yarnpkg.com/@luma.gl/shadertools/-/shadertools-8.4.5.tgz#cfbb0606a0bb3800be0ddef7c6b5bdd938c5eee1" - integrity sha512-XToDDXRfzI3mqcPu36sSABq5AOHXDUHndckNnDlaDMrIpKMzJaqe4RqEL2/j/kuv85ssctTQLl/BmhrGJ/ij8g== +"@luma.gl/shadertools@8.5.10", "@luma.gl/shadertools@^8.5.10": + version "8.5.10" + resolved "https://registry.yarnpkg.com/@luma.gl/shadertools/-/shadertools-8.5.10.tgz#37a22f99298f917a2bddf4452f04eaec7066bf27" + integrity sha512-Va/e7fHFI7ZWu03obtNlXN7noIUF1u9U3Pm6PVqeVi3Z24yWl/pFbb5/O1gn66LQZF6fpwoLGN7m4NGk2YyHyA== dependencies: "@babel/runtime" "^7.0.0" - "@math.gl/core" "^3.4.2" + "@math.gl/core" "^3.5.0" -"@luma.gl/webgl@8.4.5": - version "8.4.5" - resolved "https://registry.yarnpkg.com/@luma.gl/webgl/-/webgl-8.4.5.tgz#091ad16cbc138e20e119f502eae4e13d9677c429" - integrity sha512-U01W8ElqydtAO3Efcp8TfTbIPMZrCIW9X0fgV+teAaPg3OHqqm21GtHaiQXtURCW0q2ACfI83cUaYK7tHFGKUw== +"@luma.gl/webgl@8.5.10": + version "8.5.10" + resolved "https://registry.yarnpkg.com/@luma.gl/webgl/-/webgl-8.5.10.tgz#8e39137978692c5695a2138a403837ad51a780a2" + integrity sha512-8cCJ6aoKmVKvrYoPC6G1jHqMsfTGyn50YMmRkrk2Q79nBe531LZr+6EYXlqx2+AR9obKwTnhTPlxjKg5gR4rYg== dependencies: "@babel/runtime" "^7.0.0" - "@luma.gl/constants" "8.4.5" - "@luma.gl/gltools" "8.4.5" - probe.gl "^3.2.1" + "@luma.gl/constants" "8.5.10" + "@luma.gl/gltools" "8.5.10" + probe.gl "^3.4.0" "@mapbox/martini@^0.2.0": version "0.2.0" @@ -2427,46 +2459,46 @@ dependencies: "@mapbox/point-geometry" "~0.1.0" -"@math.gl/core@3.4.3", "@math.gl/core@^3.3.0", "@math.gl/core@^3.4.1", "@math.gl/core@^3.4.2": - version "3.4.3" - resolved "https://registry.yarnpkg.com/@math.gl/core/-/core-3.4.3.tgz#a0e9449b680ddeb689a2e5c8be58899143175915" - integrity sha512-gWAuVkNi8cS4+ejZnhkMjTcKHFSYUSCTSXyCY3ReLIOknyy1QEucecOCyl3xpubRwCzPgCOiQ0yFvEdIFPpH6Q== +"@math.gl/core@3.5.7", "@math.gl/core@^3.5.0", "@math.gl/core@^3.5.1": + version "3.5.7" + resolved "https://registry.yarnpkg.com/@math.gl/core/-/core-3.5.7.tgz#41145f214c36f20a6bf32e4c25551e97c6828e99" + integrity sha512-EtMS3Nzv//nc6gAVcmvVsZAkf8+sVNruPcWEaBh95h82T7GroMLLf1WBgOhtOBOvCh6vInxjcYDsJOn7RY5oqg== dependencies: "@babel/runtime" "^7.12.0" - gl-matrix "^3.0.0" + gl-matrix "~3.3.0" -"@math.gl/culling@^3.3.0", "@math.gl/culling@^3.4.2": - version "3.4.3" - resolved "https://registry.yarnpkg.com/@math.gl/culling/-/culling-3.4.3.tgz#e85141ccdf5d34a2618728e0b1c8b0cdd45dd777" - integrity sha512-110pCxuzu3IUMaYFeiKVvVB/NMMkNXTph2x8U5FFOUgyDbLqKKH/l1ZRoK9JyZ5qbYJZzYr6v++bxcnc5uHOIg== +"@math.gl/culling@^3.5.1", "@math.gl/culling@^3.5.6": + version "3.5.7" + resolved "https://registry.yarnpkg.com/@math.gl/culling/-/culling-3.5.7.tgz#bb5c75df96facbb5f3b64176220911a493cd5d0e" + integrity sha512-wQlcnT05/u2ByHX8xjjo2pQUE8O2zghpBL19S1Rzzn3Zloj1eL5okIXecTnQCGghpt5lSP1I4W91x7PhV7YU7Q== dependencies: "@babel/runtime" "^7.12.0" - "@math.gl/core" "3.4.3" - gl-matrix "^3.0.0" + "@math.gl/core" "3.5.7" + gl-matrix "~3.3.0" -"@math.gl/geospatial@^3.3.0": - version "3.4.3" - resolved "https://registry.yarnpkg.com/@math.gl/geospatial/-/geospatial-3.4.3.tgz#47c611e1c9249aaa91e93227d37ae9d7aeb1c6fb" - integrity sha512-5IG85T0WkjxQD8xumcxQypWCw6OscvCAh7IH7E3G6P6r5et2UYUPXFtjXI1ZIdUS/SjD3Jd9Sr4ZKeVSAigt6w== +"@math.gl/geospatial@^3.5.1": + version "3.5.7" + resolved "https://registry.yarnpkg.com/@math.gl/geospatial/-/geospatial-3.5.7.tgz#bf7feabd519eb7cb5bdfab22802bce70647d4be5" + integrity sha512-q0h2YAppH12M6mIYPyB1FPfxYCD+vGwt8IcFZB3KN0bisg+Yuzgv00cq9jhxPgaVRrtBCOa1J4gJfM+5B9gxmw== dependencies: "@babel/runtime" "^7.12.0" - "@math.gl/core" "3.4.3" - gl-matrix "^3.0.0" + "@math.gl/core" "3.5.7" + gl-matrix "~3.3.0" -"@math.gl/polygon@^3.4.2": - version "3.4.3" - resolved "https://registry.yarnpkg.com/@math.gl/polygon/-/polygon-3.4.3.tgz#1c54a4cad2df8db41a980c03c1833fb5fc241e09" - integrity sha512-ZhccVGn0PgwsN/SNT1jlPPOydkY8bW0YDDWOK4eH70zypLVYSorAyxWEwefqBjZxCkgbQU3WnpxHNSMLr+jVCQ== +"@math.gl/polygon@^3.5.1", "@math.gl/polygon@^3.5.6": + version "3.5.7" + resolved "https://registry.yarnpkg.com/@math.gl/polygon/-/polygon-3.5.7.tgz#6ddab215552919a2f784e8ea746fe582475c1e33" + integrity sha512-fTi9Vfs7+LQ5Cn5ABSp0i+rfRec2fFuPhUE+Xpvg3dELQP+YMSw7FeR5SvUBgt3UY86qLmrkmxz3WwffcJA/eg== dependencies: - "@math.gl/core" "3.4.3" + "@math.gl/core" "3.5.7" -"@math.gl/web-mercator@^3.3.0", "@math.gl/web-mercator@^3.4.2": - version "3.4.3" - resolved "https://registry.yarnpkg.com/@math.gl/web-mercator/-/web-mercator-3.4.3.tgz#6bcb262a92453399229b173bc9a825ebd3356f38" - integrity sha512-wfT1ku2b0k9MmaesFev60PXCCqqDvCR9batcY99ob/nMRXcQ/F5yVChS07OIqjUJseK6+6Gep9iYXiflPyPR2Q== +"@math.gl/web-mercator@^3.5.1", "@math.gl/web-mercator@^3.5.6": + version "3.5.7" + resolved "https://registry.yarnpkg.com/@math.gl/web-mercator/-/web-mercator-3.5.7.tgz#180a1057ea622bd857c6931f67268c2e98f174c6" + integrity sha512-i0w6AcV2b5+yeUQOA/KdnnzTYMUZvEKzHbbxI+ZyCuFs3p9S/IUt/EWVw4KGGOjVbf3UrGFlWSM70Th+0KyrsA== dependencies: "@babel/runtime" "^7.12.0" - gl-matrix "^3.0.0" + gl-matrix "~3.3.0" "@mdx-js/loader@^1.6.22": version "1.6.22" @@ -2684,10 +2716,25 @@ resolved "https://registry.yarnpkg.com/@preconstruct/next/-/next-3.0.0.tgz#71781cbaecd011f43e456a149817094a43e4755f" integrity sha512-G90cyJX9w4Zr3Bt/j2fURgDhsJb5+agqf4YUgrvDe3Dyvbbssy9a6d0tzLH0ehfa2Osxw/EEhQb+W4X+v/x06A== -"@probe.gl/stats@3.3.1", "@probe.gl/stats@^3.3.0": - version "3.3.1" - resolved "https://registry.yarnpkg.com/@probe.gl/stats/-/stats-3.3.1.tgz#6119c4ce978420ea08464aaf1773d983d4ad9c66" - integrity sha512-7ekl4qYndDgmCzZMNhicgJpIzApyjdqo67qv1zKx8hmAgC+AeCk6LE8sdiTauddd8+FDViAkxhrr271KwOgHfw== +"@probe.gl/env@3.5.0": + version "3.5.0" + resolved "https://registry.yarnpkg.com/@probe.gl/env/-/env-3.5.0.tgz#c6d8fbf414fda3eba7b3813cc274e76245216fe0" + integrity sha512-YdlpZZshhyYxvWDBmZ5RIW2pTR14Pw4p9czMlt/v7F6HbFzWfAdmH7q6xVwFRYxUpQLwhWensWyv4aFysiWl4g== + dependencies: + "@babel/runtime" "^7.0.0" + +"@probe.gl/log@3.5.0", "@probe.gl/log@^3.5.0": + version "3.5.0" + resolved "https://registry.yarnpkg.com/@probe.gl/log/-/log-3.5.0.tgz#6589822ab771eadf77787ffc6ecf73e59d181c64" + integrity sha512-nW/qz2X1xY08WU/TsmJP6/6IPNcaY5fS/vLjpC4ahJuE2Mezga4hGM/R2X5JWE/nkPc+BsC5GnAnD13rwAxS7g== + dependencies: + "@babel/runtime" "^7.0.0" + "@probe.gl/env" "3.5.0" + +"@probe.gl/stats@3.5.0", "@probe.gl/stats@^3.5.0": + version "3.5.0" + resolved "https://registry.yarnpkg.com/@probe.gl/stats/-/stats-3.5.0.tgz#774495772f06e898aae28c1d315c9edac07f3425" + integrity sha512-IH2M+F3c8HR1DTroBARePUFG7wIewumtKA0UFqx51Z7S4hKrD60wFbpMmg0AcF4FvHAXMBoC+kYi1UKW9XbAOw== dependencies: "@babel/runtime" "^7.0.0" @@ -3792,6 +3839,11 @@ resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.7.tgz#c8fa532b60a0042219cdf173ca21a975ef0666ad" integrity sha512-wE2v81i4C4Ol09RtsWFAqg3BUitWbHSpSlIo+bNdsCJijO9sjme+zm+73ZMCa/qMC8UEERxzGbvmr1cffo2SiQ== +"@types/geojson@^7946.0.7": + version "7946.0.8" + resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.8.tgz#30744afdb385e2945e22f3b033f897f76b1f12ca" + integrity sha512-1rkryxURpr6aWP7R786/UQOkJ3PcpQiWkAXBmdWc7ryFWqN6a4xfK7BtjXvFBKO9LjQ+MWQSWxYeZX1OApnArA== + "@types/graceful-fs@^4.1.2": version "4.1.5" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" @@ -6948,7 +7000,7 @@ downshift@^6.0.6: prop-types "^15.7.2" react-is "^17.0.2" -draco3d@^1.3.6: +draco3d@1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/draco3d/-/draco3d-1.4.1.tgz#2abdcf7b59caaac50f7e189aec454176c57146b2" integrity sha512-9Rxonc70xiovBC+Bq1h57SNZIHzWTibU1VfIGp5z3Xx8dPtv4yT5uGhiH7P5uvJRR2jkrvHafRxR7bTANkvfpg== @@ -7972,7 +8024,7 @@ github-slugger@^1.1.3: dependencies: emoji-regex ">=6.0.0 <=6.1.1" -gl-matrix@^3.0.0: +gl-matrix@^3.0.0, gl-matrix@~3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/gl-matrix/-/gl-matrix-3.3.0.tgz#232eef60b1c8b30a28cbbe75b2caf6c48fd6358b" integrity sha512-COb7LDz+SXaHtl/h4LeaFcNdJdAQSDeVqjiIihSXNrkWObZLhDI4hIkZC11Aeqp7bcE72clzB0BnDXr2SmslRA== @@ -8610,7 +8662,7 @@ image-size@1.0.0: dependencies: queue "6.0.2" -image-size@^0.7.2: +image-size@^0.7.2, image-size@^0.7.4: version "0.7.5" resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.7.5.tgz#269f357cf5797cb44683dfa99790e54c705ead04" integrity sha512-Hiyv+mXHfFEP7LzUL/llg9RwFxxY+o9N3JVLIeG5E7iFIFAalxvRU9UZthBdYDEVnzHMgjnKJPPpay5BWf1g9g== @@ -9964,6 +10016,11 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== +ktx-parse@^0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/ktx-parse/-/ktx-parse-0.0.4.tgz#6fd3eca82490de8a1e48cb8367a9980451fa1ac4" + integrity sha512-LY3nrmfXl+wZZdPxgJ3ZmLvG+wkOZZP3/dr4RbQj1Pk3Qwz44esOOSFFVQJcNWpXAtiNIC66WgXufX/SYgYz6A== + language-subtag-registry@~0.3.2: version "0.3.21" resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.21.tgz#04ac218bea46f04cb039084602c6da9e788dd45a" @@ -10468,12 +10525,12 @@ matcher@^3.0.0: dependencies: escape-string-regexp "^4.0.0" -math.gl@^3.4.2: - version "3.4.3" - resolved "https://registry.yarnpkg.com/math.gl/-/math.gl-3.4.3.tgz#8e73db7900dec6a5eb0c2c54af7429793b95e7b8" - integrity sha512-GSX4GQUVbEQtFnQryDIJVx35WO4HP55NbnIP18/a9G7e5jbTj7QqR2pHKkdlvP5D3jDHP09o39cXMcx0YxqUSA== +math.gl@^3.5.4, math.gl@^3.5.6: + version "3.5.7" + resolved "https://registry.yarnpkg.com/math.gl/-/math.gl-3.5.7.tgz#533c7dd30baf419015493a5d70f23b2df838f86f" + integrity sha512-WS633GusobHd5L7+4aiMVRZL3MYQk59futWsKvEvSEtrd5UnBa+y6xMpgn0VGlYmr7VXYqmvcRh/PnfMPN2tpw== dependencies: - "@math.gl/core" "3.4.3" + "@math.gl/core" "3.5.7" md5.js@^1.3.4: version "1.3.5" @@ -11784,13 +11841,15 @@ prismjs@^1.14.0: resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.25.0.tgz#6f822df1bdad965734b310b315a23315cf999756" integrity sha512-WCjJHl1KEWbnkQom1+SzftbtXMKQoezOCYs5rECqMN+jP+apI7ftoflyqigqzopSO3hMhTEb0mFClA8lkolgEg== -probe.gl@^3.2.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/probe.gl/-/probe.gl-3.3.1.tgz#4d60d0e896aa7eee6a6b1bfe4d59120f7d247f7a" - integrity sha512-RI6gxvEyTEdRMzT1np8HvbBOFNYQ0HwE3kZvK790tg/ldwFy7Qvs7cllz4MDT84QG2IMDUu7EsTXQX3qtzdx3w== +probe.gl@^3.4.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/probe.gl/-/probe.gl-3.5.0.tgz#084c0ef3a233e1c055cd8a88efb67abb11eba483" + integrity sha512-KWj8u0PNytr/rVwcQFcN7O8SK7n/ITOsUZ91l4fSX95oHhKvVCI7eadrzFUzFRlXkFfBWpMWZXFHITsHHHUctw== dependencies: "@babel/runtime" "^7.0.0" - "@probe.gl/stats" "3.3.1" + "@probe.gl/env" "3.5.0" + "@probe.gl/log" "3.5.0" + "@probe.gl/stats" "3.5.0" process-es6@^0.11.2: version "0.11.6" @@ -13689,6 +13748,14 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= +texture-compressor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/texture-compressor/-/texture-compressor-1.0.2.tgz#b5a54a9e5f9eb884d7c33b149f1f23a429465cd4" + integrity sha512-dStVgoaQ11mA5htJ+RzZ51ZxIZqNOgWKAIvtjLrW1AliQQLCmrDqNzQZ8Jh91YealQ95DXt4MEduLzJmbs6lig== + dependencies: + argparse "^1.0.10" + image-size "^0.7.4" + theme-ui@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/theme-ui/-/theme-ui-0.10.0.tgz#4fce8fbe7ad008ec07b383eaf5f468b0317fcfa1" From aeb6c2d74d4595963e03a1f19aeac45463e66cb4 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Tue, 1 Feb 2022 14:18:44 +0100 Subject: [PATCH 14/21] feat: Enable tiles caching so zooming is not as flickering --- app/charts/map/map.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/charts/map/map.tsx b/app/charts/map/map.tsx index 9ed6ef0e7..f0788cb04 100644 --- a/app/charts/map/map.tsx +++ b/app/charts/map/map.tsx @@ -181,7 +181,7 @@ export const MapComponent = () => { pickable={false} minZoom={2} maxZoom={16} - tileSize={256} + maxCacheSize={512} renderSubLayers={(props: { tile: TileData; data: $FixMe }) => { const { bbox: { west, south, east, north }, From afc6bded400fd939e2932358012a23e3b244eecf Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Tue, 1 Feb 2022 14:19:07 +0100 Subject: [PATCH 15/21] chore: Update WebMarcatorViewport type --- app/typings/deckgl.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/typings/deckgl.d.ts b/app/typings/deckgl.d.ts index 25f7ee783..9af35e555 100644 --- a/app/typings/deckgl.d.ts +++ b/app/typings/deckgl.d.ts @@ -8,6 +8,8 @@ declare module "@deck.gl/core" { export class FlyToInterpolator {} export class WebMercatorViewport { constructor(viewState: $FixMe); + width: number; + height: number; project(lonlat: [number, number]): [number, number]; unproject(xy: [number, number]): [number, number]; fitBounds( From 3235c6c621d2290d363eb63971b1b385afc696fc Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Tue, 1 Feb 2022 14:19:41 +0100 Subject: [PATCH 16/21] fix: Make sure a map is rendered when trying to constrain zoom --- app/charts/map/map.tsx | 53 +++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/app/charts/map/map.tsx b/app/charts/map/map.tsx index f0788cb04..2ee597de8 100644 --- a/app/charts/map/map.tsx +++ b/app/charts/map/map.tsx @@ -34,8 +34,8 @@ const INITIAL_VIEW_STATE = { type BBox = [[number, number], [number, number]]; const CH_BBOX: BBox = [ - [5.956800664952974, 45.81912371940225], - [10.493446773955753, 47.80741209797084], + [6.02260949059, 45.7769477403], + [10.4427014502, 47.8308275417], ]; /** @@ -55,35 +55,40 @@ const constrainZoom = ( const { width, height, zoom, longitude, latitude } = viewState; - const [x, y] = vp.project([longitude, latitude]); - const [x0, y1] = vp.project(bbox[0]); - const [x1, y0] = vp.project(bbox[1]); + // Make sure the map is rendered before trying to project & fitBounds + if (vp.width > 1 && vp.height > 1) { + const [x, y] = vp.project([longitude, latitude]); + const [x0, y1] = vp.project(bbox[0]); + const [x1, y0] = vp.project(bbox[1]); - const fitted = vp.fitBounds(bbox, { padding }); + const fitted = vp.fitBounds(bbox, { padding }); - const [cx, cy] = vp.project([fitted.longitude, fitted.latitude]); + const [cx, cy] = vp.project([fitted.longitude, fitted.latitude]); - const h = height - padding * 2; - const w = width - padding * 2; + const h = height - padding * 2; + const w = width - padding * 2; - const h2 = h / 2; - const w2 = w / 2; + const h2 = h / 2; + const w2 = w / 2; - const y2 = - y1 - y0 < h ? cy : y - h2 < y0 ? y0 + h2 : y + h2 > y1 ? y1 - h2 : y; - const x2 = - x1 - x0 < w ? cx : x - w2 < x0 ? x0 + w2 : x + w2 > x1 ? x1 - w2 : x; + const y2 = + y1 - y0 < h ? cy : y - h2 < y0 ? y0 + h2 : y + h2 > y1 ? y1 - h2 : y; + const x2 = + x1 - x0 < w ? cx : x - w2 < x0 ? x0 + w2 : x + w2 > x1 ? x1 - w2 : x; - const p = vp.unproject([x2, y2]); + const p = vp.unproject([x2, y2]); - return { - ...viewState, - transitionDuration: 0, - transitionInterpolator: null, - zoom: Math.max(zoom, fitted.zoom), - longitude: p[0], - latitude: p[1], - }; + return { + ...viewState, + transitionDuration: 0, + transitionInterpolator: null, + zoom: Math.max(zoom, fitted.zoom), + longitude: p[0], + latitude: p[1], + }; + } else { + return viewState; + } }; export const MapComponent = () => { From 009979250f44d204c933033e2be3379399a474ef Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Tue, 1 Feb 2022 14:55:25 +0100 Subject: [PATCH 17/21] fix: Firing event when clicking on disabled days in DayPicker --- app/components/form.tsx | 40 ++++++++++++++++----------- app/configurator/components/field.tsx | 2 +- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/app/components/form.tsx b/app/components/form.tsx index 0a5bc0456..7b1d21d3d 100644 --- a/app/components/form.tsx +++ b/app/components/form.tsx @@ -1,5 +1,10 @@ import { Trans } from "@lingui/macro"; +import { useId } from "@reach/auto-id"; 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, @@ -11,16 +16,11 @@ import { Select as TUISelect, SelectProps, } from "theme-ui"; -import { ChangeEvent, ReactNode, useCallback, useMemo } from "react"; import { FieldProps, Option } from "../configurator"; -import { Icon } from "../icons"; -import { useId } from "@reach/auto-id"; -import { useLocale } from "../locales/use-locale"; -import { DayPickerInputProps, DayPickerProps } from "react-day-picker"; -import DayPickerInput from "react-day-picker/DayPickerInput"; -import "react-day-picker/lib/style.css"; import { useTimeFormatUnit } from "../configurator/components/ui-helpers"; import { TimeUnit } from "../graphql/query-hooks"; +import { Icon } from "../icons"; +import { useLocale } from "../locales/use-locale"; export const Label = ({ label, @@ -307,6 +307,7 @@ export const DayPickerField = ({ label, name, value, + isDayDisabled, onChange, disabled, controls, @@ -314,21 +315,27 @@ export const DayPickerField = ({ }: { name: string; value: Date; + isDayDisabled: (day: Date) => boolean; onChange: (event: ChangeEvent) => void; controls?: ReactNode; label?: string | ReactNode; disabled?: boolean; -} & Omit) => { +} & Omit) => { const handleDayClick = useCallback( (day: Date) => { - const ev = { - currentTarget: { - value: day.toISOString().slice(0, 10), - }, - } as ChangeEvent; - onChange(ev); + const isDisabled = isDayDisabled(day); + + if (!isDisabled) { + const ev = { + currentTarget: { + value: day.toISOString().slice(0, 10), + }, + } as ChangeEvent; + + onChange(ev); + } }, - [onChange] + [isDayDisabled, onChange] ); const formatDateAuto = useTimeFormatUnit(); const inputProps = useMemo(() => { @@ -357,9 +364,10 @@ export const DayPickerField = ({ const dayPickerProps = useMemo(() => { return { onDayClick: handleDayClick, + disabledDays: isDayDisabled, ...props.dayPickerProps, } as DayPickerProps; - }, [handleDayClick, props.dayPickerProps]); + }, [handleDayClick, isDayDisabled, props.dayPickerProps]); return ( ); From 048d2414fd647c26dcb341bb3169efd7fb586e61 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Tue, 1 Feb 2022 15:11:17 +0100 Subject: [PATCH 18/21] feat: Update icons and title for base, area and symbol layers --- .../components/chart-options-selector.tsx | 19 ++++++------------- app/configurator/map/map-chart-options.tsx | 14 +++++++------- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/app/configurator/components/chart-options-selector.tsx b/app/configurator/components/chart-options-selector.tsx index d757e3879..34530820e 100644 --- a/app/configurator/components/chart-options-selector.tsx +++ b/app/configurator/components/chart-options-selector.tsx @@ -178,19 +178,12 @@ const EncodingOptionsPanel = ({ const getFieldLabelHint = { x: t({ id: "controls.select.dimension", message: "Select a dimension" }), y: t({ id: "controls.select.measure", message: "Select a measure" }), - baseLayer: t({ id: "chart.map.layers.base", message: "Base Layer" }), - areaLayer: t({ - id: "controls.select.measure", - message: "Select a measure", - }), - symbolLayer: t({ - id: "controls.select.measure", - message: "Select a measure", - }), - segment: t({ - id: "controls.select.dimension", - message: "Select a dimension", - }), + // FIXME: encoding types, so we don't need these there (chart options are + // handled in a separate file) + baseLayer: "", + areaLayer: "", + symbolLayer: "", + segment: "", }; useEffect(() => { diff --git a/app/configurator/map/map-chart-options.tsx b/app/configurator/map/map-chart-options.tsx index 2ddf08d4c..cefece149 100644 --- a/app/configurator/map/map-chart-options.tsx +++ b/app/configurator/map/map-chart-options.tsx @@ -57,7 +57,7 @@ export const BaseLayersSettings = memo(() => { return ( - Settings + Base Layer - - Settings + + Areas - + {t({ id: "controls.dimension.geographical", message: "Geographical dimension", @@ -370,8 +370,8 @@ export const SymbolLayerSettings = memo( return ( <> - - Settings + + Symbols - + {t({ id: "controls.dimension.geographical", message: "Geographical dimension", From 2aaede86de48fe060808927073df33e6fde036da Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Tue, 1 Feb 2022 16:34:06 +0100 Subject: [PATCH 19/21] feat: Add select a color translation --- app/configurator/map/map-chart-options.tsx | 5 ++++- app/locales/de/messages.po | 6 +++++- app/locales/en/messages.po | 6 +++++- app/locales/fr/messages.po | 6 +++++- app/locales/it/messages.po | 6 +++++- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/app/configurator/map/map-chart-options.tsx b/app/configurator/map/map-chart-options.tsx index b83b20329..1d844037b 100644 --- a/app/configurator/map/map-chart-options.tsx +++ b/app/configurator/map/map-chart-options.tsx @@ -434,7 +434,10 @@ export const SymbolLayerSettings = memo( Date: Tue, 1 Feb 2022 16:51:22 +0100 Subject: [PATCH 20/21] docs: Add OnOffControlTab --- app/docs/controls.docs.tsx | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/app/docs/controls.docs.tsx b/app/docs/controls.docs.tsx index c7f37368b..abb3ca01e 100644 --- a/app/docs/controls.docs.tsx +++ b/app/docs/controls.docs.tsx @@ -1,18 +1,19 @@ import { markdown, ReactSpecimen } from "catalog"; -import { ControlList } from "../configurator/components/chart-controls/list"; -import { - ControlSection, - SectionTitle, -} from "../configurator/components/chart-controls/section"; +import { useState } from "react"; +import { Box } from "theme-ui"; import { Checkbox, Input, Radio, Select } from "../components/form"; import { ColorPicker, ColorPickerMenu, } from "../configurator/components/chart-controls/color-picker"; -import { getPalette } from "../configurator/components/ui-helpers"; -import { useState } from "react"; -import { Box } from "theme-ui"; +import { OnOffControlTab } from "../configurator/components/chart-controls/control-tab"; +import { ControlList } from "../configurator/components/chart-controls/list"; +import { + ControlSection, + SectionTitle, +} from "../configurator/components/chart-controls/section"; import { ChartTypeSelectionButton } from "../configurator/components/chart-type-selector"; +import { getPalette } from "../configurator/components/ui-helpers"; // const vegaPalettes: Array<{ id: vega.ColorScheme; values: Array }> = [ // { id: "category10", values: vega.scheme("category10") }, @@ -57,6 +58,22 @@ const ControlsDoc = () => { )} +## OnOffControlTab +OnOffControlTab (and OnOffControlTabField) are elements which are supposed to be used on the left panel in the app as category "switches" +(like for BaseLayer in case of maps or InteractiveFilters for... interactive filters). They display either "on" or "off" to indicate component state. + + + ${( + + Test} + icon="settings" + onClick={() => {}} + /> + + )} + ## Controls section A section is a styling container, it has a title and a note (displayed on the right). Any component can be given as child component. ${( From 7733eb191ac0e8e1d1121b3894455c21d3a0e9c9 Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Tue, 1 Feb 2022 17:26:10 +0100 Subject: [PATCH 21/21] chore: Add missing translation --- app/locales/fr/messages.po | 2 +- app/locales/it/messages.po | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/locales/fr/messages.po b/app/locales/fr/messages.po index 514864cb3..cd0dfce64 100644 --- a/app/locales/fr/messages.po +++ b/app/locales/fr/messages.po @@ -304,7 +304,7 @@ msgstr "Séquentielle" #: app/configurator/map/map-chart-options.tsx:437 msgid "controls.color.select" -msgstr "Couleur sélectionner" +msgstr "Sélectionner une couleur" #: app/configurator/components/chart-controls/color-picker.tsx:158 msgid "controls.colorpicker.open" diff --git a/app/locales/it/messages.po b/app/locales/it/messages.po index 246b81b3a..cb2f36daa 100644 --- a/app/locales/it/messages.po +++ b/app/locales/it/messages.po @@ -304,7 +304,7 @@ msgstr "Sequenziale" #: app/configurator/map/map-chart-options.tsx:437 msgid "controls.color.select" -msgstr "" +msgstr "Seleziona un colore" #: app/configurator/components/chart-controls/color-picker.tsx:158 msgid "controls.colorpicker.open"