From 818751a9af76b41cfdea020a9dff06bf409c6fac Mon Sep 17 00:00:00 2001 From: anton-slashm <128032471+anton-slashm@users.noreply.github.com> Date: Mon, 17 Apr 2023 21:17:29 +0200 Subject: [PATCH] chore: Updating documentation (#7815) --- docs/api-reference/core/controller.md | 43 ++++++++------------------- 1 file changed, 12 insertions(+), 31 deletions(-) diff --git a/docs/api-reference/core/controller.md b/docs/api-reference/core/controller.md index 41e5df7b364..fd47424bf49 100644 --- a/docs/api-reference/core/controller.md +++ b/docs/api-reference/core/controller.md @@ -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} @@ -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']; }