Skip to content

Commit

Permalink
chore: Updating documentation (#7815)
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-slashm committed Apr 17, 2023
1 parent babf87d commit 818751a
Showing 1 changed file with 12 additions and 31 deletions.
43 changes: 12 additions & 31 deletions docs/api-reference/core/controller.md
Expand Up @@ -35,39 +35,20 @@ The base Controller class supports the following options:
import {Controller} from 'deck.gl';

class MyController extends Controller {
constructor(options = {}) {
super(MyViewState, options);
constructor(props) {
super(props);
}
}
```

The constructor takes two arguments:

* `ViewState` - a class that implements the following methods:
- `getViewportProps()` - returns an object that describes the view state
- `getInteractiveState()` - returns an object that contains the internal state of the ongoing interaction
- `shortestPathFrom(viewState)` - returns an object that describes another view state that is closest to this view state. This is used by viewport transition when there are multiple equivalent ways to define a view state (e.g. `bearing: 240` and `bearing: -120`)
- methods that return a new ViewState with updated props:
+ `panStart`
+ `pan`
+ `panEnd`
+ `rotateStart`
+ `rotate`
+ `rotateEnd`
+ `zoomStart`
+ `zoom`
+ `zoomEnd`
+ `zoomIn`
+ `zoomOut`
+ `moveLeft`
+ `moveRight`
+ `moveUp`
+ `moveDown`
+ `rotateLeft`
+ `rotateRight`
+ `rotateUp`
+ `rotateDown`
* `options` (Object) - options and view state props
The constructor takes one argument:

* `props` (Object) - contains the following options:
* `eventManager`- handles events subscriptions
* `makeViewPort (viewState)` - creates new `Viewport` based on provided `ViewState`, and current view's `width` and `height`
* `onStateChange` callback function
* `onViewStateChange` callback function
* `timeline` - an instance of `luma.gl` [animation timeline class](https://github.com/visgl/luma.gl/blob/d5bd93ef6bd0a0ff4af7880424286bda269e29a8/dev-docs/RFCs/v7.1/animation-timeline-rfc.md)


##### `handleEvent(event)` {#handleevent}
Expand Down Expand Up @@ -123,8 +104,8 @@ Returns `true` if the user is dragging the view.
import {Controller} from 'deck.gl';

class MyController extends Controller{
constructor(options = {}) {
super(MyViewState, options);
constructor(props) {
super(props);
this.events = ['pointermove'];
}

Expand Down

0 comments on commit 818751a

Please sign in to comment.