-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/npm_and_yarn/types/proj4-2.5.6
- Loading branch information
Showing
36 changed files
with
499 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,11 @@ const preview = { | |
date: /Date$/, | ||
}, | ||
}, | ||
docs: { | ||
story: { | ||
height: "500px", | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
|
Binary file added
BIN
+6.97 KB
__snapshots__/chromium_extensions-path-texture-extension--extruded-path.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.11 KB
__snapshots__/chromium_extensions-path-texture-extension--path-layer-texture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.83 KB
__snapshots__/chromium_extensions-path-texture-extension--profile-width.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.73 KB
__snapshots__/chromium_extensions-path-texture-extension--undefined-texture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.69 KB
__snapshots__/chromium_extensions-path-texture-extension--vertical-scale.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+580 KB
__snapshots__/chromium_extensions-path-texture-extension--with-map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.19 KB
__snapshots__/chromium_extensions-path-texture-extension--zero-length-segment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.69 KB
(110%)
__snapshots__/chromium_layers-profile-layer--phong-shading.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.21 KB
(110%)
__snapshots__/chromium_layers-profile-layer--profile-color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.7 KB
(110%)
__snapshots__/chromium_layers-profile-layer--profile-layer-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5.96 KB
(99%)
__snapshots__/chromium_layers-profile-layer--profile-layer-with-map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.55 KB
(110%)
__snapshots__/chromium_layers-profile-layer--profile-texture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.54 KB
(110%)
__snapshots__/chromium_layers-profile-layer--profile-width.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+637 Bytes
(100%)
__snapshots__/chromium_layers-profile-layer--vertical-scale.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.3 KB
__snapshots__/webkit_extensions-path-texture-extension--extruded-path.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.62 KB
__snapshots__/webkit_extensions-path-texture-extension--path-layer-texture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.16 KB
__snapshots__/webkit_extensions-path-texture-extension--profile-width.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.19 KB
__snapshots__/webkit_extensions-path-texture-extension--undefined-texture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.19 KB
__snapshots__/webkit_extensions-path-texture-extension--vertical-scale.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.53 KB
__snapshots__/webkit_extensions-path-texture-extension--zero-length-segment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.99 KB
(120%)
__snapshots__/webkit_layers-profile-layer--phong-shading.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.44 KB
(120%)
__snapshots__/webkit_layers-profile-layer--profile-layer-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+68.3 KB
(110%)
__snapshots__/webkit_layers-profile-layer--profile-layer-with-map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3.23 KB
(120%)
__snapshots__/webkit_layers-profile-layer--profile-texture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2.71 KB
(120%)
__snapshots__/webkit_layers-profile-layer--profile-width.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
227 changes: 227 additions & 0 deletions
227
src/extensions/path-texture-extension/path-texture-extension.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,227 @@ | ||
import { | ||
ExtrudedPathLayer, | ||
type ExtrudedPathLayerProps, | ||
} from "../../layers/extruded-path-layer/extruded-path-layer"; | ||
import { DeckGL } from "@deck.gl/react"; | ||
import * as React from "react"; | ||
import type { StoryObj } from "@storybook/react"; | ||
import { StreetLayer } from "../../layers/street-layer"; | ||
import { SYNTHETIC_DATA, SYNTHETIC_VIEW_STATE } from "../../constant.stories"; | ||
import { Matrix4 } from "@math.gl/core"; | ||
import { PathTextureExtension } from "./path-texture-extension"; | ||
import { createGradientTexture } from "../../util.stories"; | ||
import { PathLayer } from "@deck.gl/layers"; | ||
|
||
export default { | ||
title: "Extensions / Path Texture Extension", | ||
tags: ["autodocs"], | ||
}; | ||
|
||
const DEFAULT_PROPS = { | ||
data: SYNTHETIC_DATA, | ||
id: "extruded-path-layer", | ||
getWidth: 3000, | ||
extensions: [new PathTextureExtension()], | ||
texture: createGradientTexture(), | ||
}; | ||
|
||
export const UndefinedTexture: StoryObj = { | ||
render: () => { | ||
const layerProps = { | ||
...DEFAULT_PROPS, | ||
texture: undefined, | ||
}; | ||
const layer = new ExtrudedPathLayer({ ...layerProps }); | ||
|
||
return ( | ||
<DeckGL | ||
layers={[layer]} | ||
initialViewState={SYNTHETIC_VIEW_STATE} | ||
controller | ||
></DeckGL> | ||
); | ||
}, | ||
parameters: { | ||
docs: { | ||
description: { | ||
story: "Show the effect of an undefined texture (default).", | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const PathLayerTexture: StoryObj = { | ||
render: () => { | ||
const profile = new PathLayer({ ...DEFAULT_PROPS }); | ||
|
||
return ( | ||
<DeckGL | ||
layers={[profile]} | ||
initialViewState={SYNTHETIC_VIEW_STATE} | ||
controller | ||
></DeckGL> | ||
); | ||
}, | ||
parameters: { | ||
docs: { | ||
description: { | ||
story: "Apply the Texture Extension to PathLayer.", | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const ExtrudedPath: StoryObj = { | ||
render: () => { | ||
const profile = new ExtrudedPathLayer({ ...DEFAULT_PROPS }); | ||
|
||
return ( | ||
<DeckGL | ||
layers={[profile]} | ||
initialViewState={SYNTHETIC_VIEW_STATE} | ||
controller | ||
></DeckGL> | ||
); | ||
}, | ||
parameters: { | ||
docs: { | ||
description: { | ||
story: "Apply the Texture Extension to ExtrudedPathLayer.", | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const WithMap: StoryObj = { | ||
render: () => { | ||
const profile = new ExtrudedPathLayer({ ...DEFAULT_PROPS }); | ||
const base = new StreetLayer(); | ||
|
||
return ( | ||
<DeckGL | ||
layers={[base, profile]} | ||
initialViewState={SYNTHETIC_VIEW_STATE} | ||
controller | ||
></DeckGL> | ||
); | ||
}, | ||
}; | ||
|
||
export const ZeroLengthSegment: StoryObj = { | ||
render: () => { | ||
const path = [ | ||
[7.29, 61.45, 10000], | ||
[8.3, 62.26, 0], | ||
[8.3, 62.26, 0], | ||
[8.51, 62.17, 7000], | ||
[9.51, 61.1, 8000], | ||
]; | ||
|
||
const data = [{ path }]; | ||
|
||
const props = { | ||
...DEFAULT_PROPS, | ||
data, | ||
}; | ||
|
||
const layer = new ExtrudedPathLayer({ ...props }); | ||
|
||
return ( | ||
<DeckGL | ||
layers={[layer]} | ||
initialViewState={SYNTHETIC_VIEW_STATE} | ||
controller | ||
></DeckGL> | ||
); | ||
}, | ||
parameters: { | ||
docs: { | ||
description: { | ||
story: "Handle zero length segments.", | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const VerticalScale: StoryObj< | ||
ExtrudedPathLayerProps<unknown> & { verticalScale: number } | ||
> = { | ||
args: { | ||
verticalScale: 5, | ||
}, | ||
argTypes: { | ||
verticalScale: { | ||
control: { | ||
type: "range", | ||
min: -1, | ||
max: 10, | ||
step: 0.1, | ||
}, | ||
}, | ||
}, | ||
render: ({ verticalScale }) => { | ||
const modelMatrix = new Matrix4(); | ||
modelMatrix.scale([1, 1, verticalScale]); | ||
|
||
const props = { | ||
...DEFAULT_PROPS, | ||
modelMatrix, | ||
}; | ||
|
||
const profile = new ExtrudedPathLayer({ ...props }); | ||
|
||
return ( | ||
<DeckGL | ||
layers={[profile]} | ||
initialViewState={SYNTHETIC_VIEW_STATE} | ||
controller | ||
></DeckGL> | ||
); | ||
}, | ||
parameters: { | ||
docs: { | ||
description: { | ||
story: "Vertical scaling of profiles.", | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const ProfileWidth: StoryObj<{ width: number }> = { | ||
args: { | ||
width: 1000, | ||
}, | ||
argTypes: { | ||
width: { | ||
control: { | ||
type: "range", | ||
min: -1, | ||
max: 10000, | ||
step: 1, | ||
}, | ||
}, | ||
}, | ||
render: ({ width }) => { | ||
const props = { | ||
...DEFAULT_PROPS, | ||
getWidth: width, | ||
}; | ||
|
||
const profile = new ExtrudedPathLayer({ ...props }); | ||
|
||
return ( | ||
<DeckGL | ||
layers={[profile]} | ||
initialViewState={SYNTHETIC_VIEW_STATE} | ||
controller | ||
></DeckGL> | ||
); | ||
}, | ||
parameters: { | ||
docs: { | ||
description: { | ||
story: "Adjusting lateral width of profiles.", | ||
}, | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.