Skip to content

Commit

Permalink
Update the styling of map container
Browse files Browse the repository at this point in the history
- Add isChromatic to update animation parameters
  • Loading branch information
tnagorra committed Nov 17, 2023
1 parent b2cb5bd commit 42e8ce8
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 15 deletions.
3 changes: 3 additions & 0 deletions storybook/.storybook/preview-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
window.global = window;
</script>
<style>
.html, .body, #root {
height: 100%
}
* {
box-sizing: border-box;
}
Expand Down
1 change: 1 addition & 0 deletions storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@mapbox/mapbox-gl-draw": "^1.4.3",
"@togglecorp/fujs": "^2.0.0",
"@togglecorp/re-map": "^0.3.0",
"chromatic": "^9.0.0",
"immer": "^10.0.3",
"maplibre-gl": "^3.5.2",
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion storybook/stories/BubbleMap.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ export function Default() {

export default {
title: 'Type/Bubble Map',
parameters: { delay: 500 },
parameters: { delay: 1000 },
};
2 changes: 1 addition & 1 deletion storybook/stories/ChoroplethMap.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,5 +187,5 @@ export function Default() {

export default {
title: 'Type/Choropleth Map',
parameters: { delay: 500 },
parameters: { delay: 1000 },
};
5 changes: 3 additions & 2 deletions storybook/stories/FitBounds.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import isChromatic from 'chromatic/isChromatic';
import Map, {
MapContainer,
MapBounds,
Expand Down Expand Up @@ -27,13 +28,13 @@ export function Default() {
<MapBounds
bounds={bounds}
padding={10}
duration={1000}
duration={isChromatic() ? 0 : 1000}
/>
</Map>
);
}

export default {
title: 'Basic/Fit Bounds',
parameters: { delay: 500 },
parameters: { delay: 1000 },
};
5 changes: 3 additions & 2 deletions storybook/stories/FlyToLocation.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import isChromatic from 'chromatic/isChromatic';
import Map, {
MapContainer,
MapCenter,
Expand All @@ -25,7 +26,7 @@ export function Default() {
]}
centerOptions={{
zoom: 4,
duration: 1000,
duration: isChromatic() ? 0 : 1000,
}}
/>
</Map>
Expand All @@ -34,5 +35,5 @@ export function Default() {

export default {
title: 'Basic/Fly to Location',
parameters: { delay: 500 },
parameters: { delay: 1000 },
};
2 changes: 1 addition & 1 deletion storybook/stories/GeoJSONMap.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ export function Default() {

export default {
title: 'Source/GeoJSON Source',
parameters: { delay: 500 },
parameters: { delay: 1000 },
};
1 change: 0 additions & 1 deletion storybook/stories/MbtilesMap.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ export function Default() {

export default {
title: 'Source/Mbtiles Source',
parameters: { delay: 500 },
};
1 change: 0 additions & 1 deletion storybook/stories/PmtilesMap.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ export function Default() {

export default {
title: 'Source/Pmtiles Source',
parameters: { delay: 500 },
};
2 changes: 1 addition & 1 deletion storybook/stories/SimpleMap.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ export function Default() {

export default {
title: 'Basic/Simple Map',
parameters: { delay: 500 },
parameters: { delay: 1000 },
};
1 change: 0 additions & 1 deletion storybook/stories/WithClickInteraction.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ export function Default() {

export default {
title: 'Basic/With Click Interaction',
parameters: { delay: 500 },
};
1 change: 0 additions & 1 deletion storybook/stories/WithClickInteractionAndPopup.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ export function Default() {

export default {
title: 'Basic/With Click Interaction and Popup',
parameters: { delay: 500 },
};
2 changes: 1 addition & 1 deletion storybook/stories/WithDragInteraction.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,5 @@ export function Default() {

export default {
title: 'Basic/With Drag Interaction',
parameters: { delay: 500 },
parameters: { delay: 1000 },
};
2 changes: 1 addition & 1 deletion storybook/stories/WithHoverInteractionAndPopup.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,5 @@ export function Default() {

export default {
title: 'Basic/With Hover Interaction and Popup',
parameters: { delay: 500 },
parameters: { delay: 1000 },
};
2 changes: 1 addition & 1 deletion storybook/stories/WithHoverInteractive.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,5 @@ export function Default() {

export default {
title: 'Basic/With Hover Interaction',
parameters: { delay: 500 },
parameters: { delay: 1000 },
};
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4943,6 +4943,11 @@ chownr@^2.0.0:
resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece"
integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==

chromatic@^9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/chromatic/-/chromatic-9.0.0.tgz#0b429b5b171428495a39e7dcbaeaa56b06f055e6"
integrity sha512-PczbWYOfqsf/SM0yIzI3ZOpFznEyf9Fc96EkxoYkhztFaA9CEOcpA9nk8zpmNgPUQWmIWNyG7z4xEK40sApFzw==

chrome-trace-event@^1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac"
Expand Down

0 comments on commit 42e8ce8

Please sign in to comment.