diff --git a/packages/visualizations-react/stories/Map/StudioChoropleth.stories.tsx b/packages/visualizations-react/stories/Map/StudioChoropleth.stories.tsx index e80c526c..01d42bf5 100644 --- a/packages/visualizations-react/stories/Map/StudioChoropleth.stories.tsx +++ b/packages/visualizations-react/stories/Map/StudioChoropleth.stories.tsx @@ -397,4 +397,32 @@ const StudioChoroplethPreventWorldCopiesArgs: Props = { + data: { + loading: false, + value: [ + { x: 'France', y: 60 }, + { x: 'Île de France', y: 35 }, + { x: 'Corsica', y: 95 }, + ], + }, + options: { + shapes, + emptyValueColor: 'red', + tooltip: { + formatter: defaultLabelCallback, + }, + aspectRatio: 1, + attribution: 'Testing attribution', + description: 'Accessible description', + cooperativeGestures: { + windowsHelpText: 'Use Ctrl + scroll to zoom the map', + macHelpText: 'Use ⌘ + scroll to zoom the map', + mobileHelpText: 'Use two fingers to move the map', + }, + }, +}; +StudioChoroplethCooperativeGestures.args = StudioChoroplethCooperativeGesturesArgs; \ No newline at end of file diff --git a/packages/visualizations-react/stories/Map/StudioChoroplethVector.stories.tsx b/packages/visualizations-react/stories/Map/StudioChoroplethVector.stories.tsx index 635ff8a1..cc080767 100644 --- a/packages/visualizations-react/stories/Map/StudioChoroplethVector.stories.tsx +++ b/packages/visualizations-react/stories/Map/StudioChoroplethVector.stories.tsx @@ -65,6 +65,7 @@ const StudioChoroplethVectorGradientArgs: Props = { + data: { + loading: false, + value: dataReg, + }, + options: { + shapesTiles, + colorScale: { + type: ColorScaleTypes.Gradient, + colors: { + start: '#bcf5f9', + end: '#0229bf', + }, + }, + legend: { + title: 'I Am Legend', + }, + aspectRatio: 1, + activeShapes: ['11', '93'], + emptyValueColor: 'red', + tooltip: { + formatter: defaultLabelCallback, + }, + bbox: [-17.529298, 38.79776, 23.889159, 52.836618], + navigationMaps: [...makeMiniMaps(15),], + sourceLink: defaultSource, + cooperativeGestures: { + windowsHelpText: 'Use Ctrl + scroll to zoom the map', + macHelpText: 'Use ⌘ + scroll to zoom the map', + mobileHelpText: 'Use two fingers to move the map', + }, + }, +}; +StudioChoroplethVectorCooperativeGestures.args = StudioChoroplethVectorCooperativeGesturesArgs; + /* The next story was used for the demo, but its too big for chromatic, keeping it hear for future ref on loading/wathever */ // const LoaderTemplate: ComponentStory = (args, { loaded: { data } }) => ( //
= Template.bind({}); const PoiMapMinMaxZoomsArgs = { data: { value: { layers: [{ ...layer1, colorMatch: citiesColorMatch }, layer2], sources } }, - options: { + options: { ...options, legend, minZoom: 3, @@ -185,3 +185,21 @@ const PoiMapMinMaxZoomsArgs = { }, }; PoiMapMinMaxZooms.args = PoiMapMinMaxZoomsArgs; + +/** + * STORY: with cooperative gestures + */ +export const PoiMapCooperativeGestures: ComponentStory = Template.bind({}); +const PoiMapCooperativeGesturesArgs = { + data: { value: { layers: [{ ...layer1, colorMatch: citiesColorMatch }, layer2], sources } }, + options: { + ...options, + legend, + cooperativeGestures: { + windowsHelpText: 'Use Ctrl + scroll to zoom the map', + macHelpText: 'Use ⌘ + scroll to zoom the map', + mobileHelpText: 'Use two fingers to move the map', + }, + }, +}; +PoiMapCooperativeGestures.args = PoiMapCooperativeGesturesArgs; diff --git a/packages/visualizations/package-lock.json b/packages/visualizations/package-lock.json index 5f24c50f..8be137d1 100644 --- a/packages/visualizations/package-lock.json +++ b/packages/visualizations/package-lock.json @@ -21,7 +21,7 @@ "immutability-helper": "^3.1.1", "lodash": "^4.17.21", "luxon": "^2.5.0", - "maplibre-gl": "2.1.9", + "maplibre-gl": "2.2.1", "markdown-it": "^12.0.4", "markdown-it-link-attributes": "^3.0.0", "markdown-it-mark": "^3.0.1", @@ -1721,12 +1721,12 @@ } }, "node_modules/@mapbox/geojson-rewind": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@mapbox/geojson-rewind/-/geojson-rewind-0.5.1.tgz", - "integrity": "sha512-eL7fMmfTBKjrb+VFHXCGv9Ot0zc3C0U+CwXo1IrP+EPwDczLoXv34Tgq3y+2mPSFNVUXgU42ILWJTC7145KPTA==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@mapbox/geojson-rewind/-/geojson-rewind-0.5.2.tgz", + "integrity": "sha512-tJaT+RbYGJYStt7wI3cq4Nl4SXxG8W7JDG5DMJu97V25RnbNg3QtQtf+KD+VLjNpWKYsRvXDNmNrBgEETr1ifA==", "dependencies": { "get-stream": "^6.0.1", - "minimist": "^1.2.5" + "minimist": "^1.2.6" }, "bin": { "geojson-rewind": "geojson-rewind" @@ -3377,9 +3377,9 @@ } }, "node_modules/earcut": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.3.tgz", - "integrity": "sha512-iRDI1QeCQIhMCZk48DRDMVgQSSBDmbzzNhnxIo+pwx3swkfjMh6vh0nWLq1NdvGHLKH6wIrAM3vQWeTj6qeoug==" + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", + "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==" }, "node_modules/electron-to-chromium": { "version": "1.3.846", @@ -5120,32 +5120,32 @@ } }, "node_modules/maplibre-gl": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-2.1.9.tgz", - "integrity": "sha512-pnWJmILeZpgA5QSI7K7xFK3yrkyYTd9srw3fCi2Ca52Phm78hsznPwUErEQcZLfxXKn/1h9t8IPdj0TH0NBNbg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-2.2.1.tgz", + "integrity": "sha512-5WSzGRwbxcIkZ/DRDI+A3/o69IoLKFN80jtVqiqUuw0y1u24ZwVvqSr2fqLslUa0Yig1Z50w+wWdnER3JNOzPQ==", "hasInstallScript": true, "dependencies": { - "@mapbox/geojson-rewind": "^0.5.1", + "@mapbox/geojson-rewind": "^0.5.2", "@mapbox/jsonlint-lines-primitives": "^2.0.2", "@mapbox/mapbox-gl-supported": "^2.0.1", "@mapbox/point-geometry": "^0.1.0", - "@mapbox/tiny-sdf": "^2.0.4", + "@mapbox/tiny-sdf": "^2.0.5", "@mapbox/unitbezier": "^0.0.1", "@mapbox/vector-tile": "^1.3.1", "@mapbox/whoots-js": "^3.1.0", - "@types/geojson": "^7946.0.8", + "@types/geojson": "^7946.0.10", "@types/mapbox__point-geometry": "^0.1.2", "@types/mapbox__vector-tile": "^1.3.0", "@types/pbf": "^3.0.2", "csscolorparser": "~1.0.3", - "earcut": "^2.2.3", + "earcut": "^2.2.4", "geojson-vt": "^3.2.1", "gl-matrix": "^3.4.3", "murmurhash-js": "^1.0.0", "pbf": "^3.2.1", "potpack": "^1.0.2", "quickselect": "^2.0.0", - "supercluster": "^7.1.4", + "supercluster": "^7.1.5", "tinyqueue": "^2.0.3", "vt-pbf": "^3.1.3" } @@ -9169,12 +9169,12 @@ } }, "@mapbox/geojson-rewind": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@mapbox/geojson-rewind/-/geojson-rewind-0.5.1.tgz", - "integrity": "sha512-eL7fMmfTBKjrb+VFHXCGv9Ot0zc3C0U+CwXo1IrP+EPwDczLoXv34Tgq3y+2mPSFNVUXgU42ILWJTC7145KPTA==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@mapbox/geojson-rewind/-/geojson-rewind-0.5.2.tgz", + "integrity": "sha512-tJaT+RbYGJYStt7wI3cq4Nl4SXxG8W7JDG5DMJu97V25RnbNg3QtQtf+KD+VLjNpWKYsRvXDNmNrBgEETr1ifA==", "requires": { "get-stream": "^6.0.1", - "minimist": "^1.2.5" + "minimist": "^1.2.6" } }, "@mapbox/jsonlint-lines-primitives": { @@ -10384,9 +10384,9 @@ } }, "earcut": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.3.tgz", - "integrity": "sha512-iRDI1QeCQIhMCZk48DRDMVgQSSBDmbzzNhnxIo+pwx3swkfjMh6vh0nWLq1NdvGHLKH6wIrAM3vQWeTj6qeoug==" + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", + "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==" }, "electron-to-chromium": { "version": "1.3.846", @@ -11686,31 +11686,31 @@ } }, "maplibre-gl": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-2.1.9.tgz", - "integrity": "sha512-pnWJmILeZpgA5QSI7K7xFK3yrkyYTd9srw3fCi2Ca52Phm78hsznPwUErEQcZLfxXKn/1h9t8IPdj0TH0NBNbg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-2.2.1.tgz", + "integrity": "sha512-5WSzGRwbxcIkZ/DRDI+A3/o69IoLKFN80jtVqiqUuw0y1u24ZwVvqSr2fqLslUa0Yig1Z50w+wWdnER3JNOzPQ==", "requires": { - "@mapbox/geojson-rewind": "^0.5.1", + "@mapbox/geojson-rewind": "^0.5.2", "@mapbox/jsonlint-lines-primitives": "^2.0.2", "@mapbox/mapbox-gl-supported": "^2.0.1", "@mapbox/point-geometry": "^0.1.0", - "@mapbox/tiny-sdf": "^2.0.4", + "@mapbox/tiny-sdf": "^2.0.5", "@mapbox/unitbezier": "^0.0.1", "@mapbox/vector-tile": "^1.3.1", "@mapbox/whoots-js": "^3.1.0", - "@types/geojson": "^7946.0.8", + "@types/geojson": "^7946.0.10", "@types/mapbox__point-geometry": "^0.1.2", "@types/mapbox__vector-tile": "^1.3.0", "@types/pbf": "^3.0.2", "csscolorparser": "~1.0.3", - "earcut": "^2.2.3", + "earcut": "^2.2.4", "geojson-vt": "^3.2.1", "gl-matrix": "^3.4.3", "murmurhash-js": "^1.0.0", "pbf": "^3.2.1", "potpack": "^1.0.2", "quickselect": "^2.0.0", - "supercluster": "^7.1.4", + "supercluster": "^7.1.5", "tinyqueue": "^2.0.3", "vt-pbf": "^3.1.3" } diff --git a/packages/visualizations/package.json b/packages/visualizations/package.json index 26d181f4..6462bd30 100644 --- a/packages/visualizations/package.json +++ b/packages/visualizations/package.json @@ -101,7 +101,7 @@ "immutability-helper": "^3.1.1", "lodash": "^4.17.21", "luxon": "^2.5.0", - "maplibre-gl": "2.1.9", + "maplibre-gl": "2.2.1", "markdown-it": "^12.0.4", "markdown-it-link-attributes": "^3.0.0", "markdown-it-mark": "^3.0.1", diff --git a/packages/visualizations/src/components/Map/WebGl/ChoroplethGeoJson.svelte b/packages/visualizations/src/components/Map/WebGl/ChoroplethGeoJson.svelte index 65284d7b..6bf9c993 100644 --- a/packages/visualizations/src/components/Map/WebGl/ChoroplethGeoJson.svelte +++ b/packages/visualizations/src/components/Map/WebGl/ChoroplethGeoJson.svelte @@ -1,6 +1,6 @@