Skip to content

Commit

Permalink
add(modules) widget module (#8016)
Browse files Browse the repository at this point in the history
* add(modules) widget module

* add(docs) widget overview
  • Loading branch information
chrisgervang authored Jul 25, 2023
1 parent 19114ef commit f368dea
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 3 deletions.
35 changes: 35 additions & 0 deletions docs/api-reference/widgets/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# @deck.gl/widgets

Widgets are UI components around the WebGL canvas to offer controls and information for a better user experience.

This module contains the following extensions:

- [FullscreenWidget](./fullscreen-widget.md)

## Installation

### Install from NPM

```bash
npm install deck.gl
# or
npm install @deck.gl/core @deck.gl/widgets
```

```js
import {FullscreenWidget} from '@deck.gl/widgets';
new FullscreenWidget({});
```

### Include the Standalone Bundle

```html
<script src="https://unpkg.com/deck.gl@^8.10.0/dist.min.js"></script>
<!-- or -->
<script src="https://unpkg.com/@deck.gl/core@^8.10.0/dist.min.js"></script>
<script src="https://unpkg.com/@deck.gl/widgets@^8.10.0/dist.min.js"></script>
```

```js
new deck.FullscreenWidget({});
```
1 change: 1 addition & 0 deletions modules/main/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export * from '@deck.gl/geo-layers';
export * from '@deck.gl/google-maps';
export * from '@deck.gl/mesh-layers';
export * from '@deck.gl/mapbox';
export * from '@deck.gl/widgets';

/* eslint-disable import/no-extraneous-dependencies */
/** h3-js is not bundled due to webpack's externals config
Expand Down
3 changes: 2 additions & 1 deletion modules/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"@deck.gl/layers": "8.10.0-alpha.1",
"@deck.gl/mapbox": "8.10.0-alpha.1",
"@deck.gl/mesh-layers": "8.10.0-alpha.1",
"@deck.gl/react": "8.10.0-alpha.1"
"@deck.gl/react": "8.10.0-alpha.1",
"@deck.gl/widgets": "8.10.0-alpha.1"
},
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
}
3 changes: 2 additions & 1 deletion modules/main/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
{"path": "../layers"},
{"path": "../mapbox"},
{"path": "../mesh-layers"},
{"path": "../react"}
{"path": "../react"},
{"path": "../widgets"}
]
}
5 changes: 5 additions & 0 deletions modules/widgets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# @deck.gl/widgets

UI widgets for deck.gl. Provides DOM-based controls and common UI components that seamlessly integrate with deck.gl.

See [deck.gl](http://deck.gl) for documentation.
3 changes: 3 additions & 0 deletions modules/widgets/bundle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from '../core/bundle/peer-dependency';

export * from './src';
39 changes: 39 additions & 0 deletions modules/widgets/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "@deck.gl/widgets",
"description": "UI widgets for deck.gl",
"license": "MIT",
"version": "8.10.0-alpha.1",
"publishConfig": {
"access": "public"
},
"keywords": [
"webgl",
"visualization",
"components",
"widgets"
],
"repository": {
"type": "git",
"url": "https://github.com/visgl/deck.gl.git"
},
"main": "dist/es5/index.js",
"module": "dist/esm/index.js",
"files": [
"dist",
"src",
"typed",
"dist.min.js"
],
"sideEffects": false,
"scripts": {
"build-bundle": "ocular-bundle ./bundle.ts",
"prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev"
},
"dependencies": {
"@babel/runtime": "^7.0.0"
},
"peerDependencies": {
"@deck.gl/core": "^8.0.0"
},
"gitHead": "13ace64fc2cee08c133afc882fc307253489a4e4"
}
Empty file added modules/widgets/src/index.ts
Empty file.
13 changes: 13 additions & 0 deletions modules/widgets/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "../../tsconfig.module.json",
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
"composite": true,
"rootDir": "src",
"outDir": "typed"
},
"references": [
{"path": "../core"}
]
}
3 changes: 2 additions & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
{"path": "modules/mapbox"},
{"path": "modules/mesh-layers"},
{"path": "modules/react"},
// {"path": "modules/test-utils"}
// {"path": "modules/test-utils"},
{"path": "modules/widgets"}
],
"include": [
"modules/core/src"
Expand Down

0 comments on commit f368dea

Please sign in to comment.