Skip to content

Commit

Permalink
chore: remove slider component support
Browse files Browse the repository at this point in the history
Breaking change removing the slider component completely.
  • Loading branch information
oscarlorentzon committed Apr 8, 2022
1 parent 3ddc9c8 commit 3ac8f44
Show file tree
Hide file tree
Showing 35 changed files with 8 additions and 2,569 deletions.
136 changes: 0 additions & 136 deletions declarations/mapillary.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,6 @@ declare class Transform {
rotation: number[],
translation: number[],
image: HTMLImageElement,
textureScale?: number[],
cameraParameters?: number[],
cameraType?: CameraType
): this;
Expand Down Expand Up @@ -2303,91 +2302,6 @@ export type SequenceConfiguration = {
...
} & ComponentConfiguration;

/**
* Enumeration for slider mode.
* @enum {number} *
* @readonly
* @description Modes for specifying how transitions
* between images are performed in slider mode. Only
* applicable when the slider component determines
* that transitions with motion is possilble. When it
* is not, the stationary mode will be applied.
*/

declare var SliderConfigurationMode: {|
+Motion: 0, // 0
+Stationary: 1, // 1
|};

/**
* Interface for configuration of slider ids.
* @interface
*/
export interface SliderConfigurationIds {
/**
* Id for the image plane in the background.
*/
background: string;

/**
* Id for the image plane in the foreground.
*/
foreground: string;
}
/**
* Interface for configuration of slider component.
* @interface ```js
* var viewer = new Viewer({
* ...
* component: {
* slider: {
* initialPosition: 0.5,
* ids: {
* background: '<background-id>',
* foreground: '<foreground-id>',
* },
* sliderVisible: true,
* },
* },
* ...
* });
* ```
*/
export type SliderConfiguration = {
/**
* Initial position of the slider on the interval [0, 1].
* @description Configures the initial position of the slider.
* The inital position value will be used when the component
* is activated.
* @default 1
*/
initialPosition?: number,

/**
* Slider image ids.
* @description Configures the component to show the image
* planes for the supplied image ids in the foreground
* and the background.
*/
ids?: SliderConfigurationIds,

/**
* Value indicating whether the slider should be visible.
* @description Set the value controlling if the
* slider is visible.
* @default true
*/
sliderVisible?: boolean,

/**
* Mode used for image pair transitions.
* @description Configures the mode for transitions between
* image pairs.
*/
mode?: $Values<typeof SliderConfigurationMode>,
...
} & ComponentConfiguration;

declare var CameraVisualizationMode: {|
+Hidden: 0, // 0
+Homogeneous: 1, // 1
Expand Down Expand Up @@ -2689,13 +2603,6 @@ export interface ComponentOptions {
*/
sequence?: boolean | SequenceConfiguration;

/**
* Show a slider for transitioning between image planes.
* @description Requires WebGL support.
* @default false
*/
slider?: boolean | SliderConfiguration;

/**
* Enable an interface for showing spatial data in the viewer.
* @description Requires WebGL support.
Expand Down Expand Up @@ -3487,7 +3394,6 @@ export type ComponentName =
| "pointer"
| "popup"
| "sequence"
| "slider"
| "spatial"
| "tag"
| "zoom";
Expand Down Expand Up @@ -3957,9 +3863,6 @@ declare class Viewer implements IEventEmitter, IViewer {
* how the camera is controlled when the viewer
* receives pointer and keyboard input.
*
* Changing the camera control mode is not possible
* when the slider component is active and attempts
* to do so will be ignored.
* @param {$Values<
typeof
CameraControls>} controls - Camera control mode.
Expand Down Expand Up @@ -6519,44 +6422,7 @@ declare class SequenceComponent extends Component<SequenceConfiguration> {
_deactivate(): void;
_getDefaultConfiguration(): SequenceConfiguration;
}
/**
* @class SliderComponent
* @classdesc Component for comparing pairs of images. Renders
* a slider for adjusting the curtain of the first image.
*
* Deactivate the sequence, direction and image plane
* components when activating the slider component to avoid
* interfering UI elements.
*
* To retrive and use the slider component
* @example ```js
* var viewer = new Viewer({ ... });
*
* viewer.deactivateComponent("image");
* viewer.deactivateComponent("direction");
* viewer.deactivateComponent("sequence");
*
* viewer.activateComponent("slider");
*
* var sliderComponent = viewer.getComponent("slider");
* ```
*/
declare class SliderComponent extends Component<SliderConfiguration> {
static componentName: string;

/**
* @ignore
*/
constructor(
name: string,
container: Container,
navigator: Navigator,
viewportCoords?: ViewportCoords
): this;
_activate(): void;
_deactivate(): void;
_getDefaultConfiguration(): SliderConfiguration;
}
declare class SpatialComponent extends Component<SpatialConfiguration> {
static componentName: string;

Expand Down Expand Up @@ -8071,8 +7937,6 @@ declare export {
ScrollZoomHandler,
SequenceComponent,
SimpleMarker,
SliderComponent,
SliderConfigurationMode,
SpatialComponent,
SpotTag,
Tag,
Expand Down
19 changes: 0 additions & 19 deletions examples/debug/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,25 +140,6 @@
viewer.activateComponent("cache");
sequenceComponent.stop();
});

let sliderActive = false;
addButton("Slider", () => {
if (sliderActive) {
viewer.activateComponent("image");
viewer.activateComponent("direction");
viewer.activateComponent("sequence");
viewer.activateComponent("keyboard");
viewer.deactivateComponent("slider");
sliderActive = false;
} else {
viewer.activateComponent("slider");
viewer.deactivateComponent("image");
viewer.deactivateComponent("direction");
viewer.deactivateComponent("sequence");
viewer.deactivateComponent("keyboard");
sliderActive = true;
}
});
}
</script>
</body>
Expand Down
1 change: 0 additions & 1 deletion src/component/ComponentName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export type ComponentName =
| "pointer"
| "popup"
| "sequence"
| "slider"
| "spatial"
| "tag"
| "zoom";
116 changes: 0 additions & 116 deletions src/component/interfaces/SliderConfiguration.ts

This file was deleted.

36 changes: 0 additions & 36 deletions src/component/shaders/Shaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,24 @@ import { Shader } from "../interfaces/Shader";

import { sphericalFrag } from "./spherical.fragment.glsl";
import { sphericalVert } from "./spherical.vertex.glsl";
import { sphericalCurtainFrag } from "./spherical_curtain.fragment.glsl";
import { sphericalCurtainVert } from "./spherical_curtain.vertex.glsl";
import { fisheyeFrag } from "./fisheye.fragment.glsl";
import { fisheyeVert } from "./fisheye.vertex.glsl";
import { fisheyeCurtainFrag } from "./fisheye_curtain.fragment.glsl";
import { fisheyeCurtainVert } from "./fisheye_curtain.vertex.glsl";
import { perspectiveFrag } from "./perspective.fragment.glsl";
import { perspectiveVert } from "./perspective.vertex.glsl";
import { perspectiveCurtainFrag } from "./perspective_curtain.fragment.glsl";
import { perspectiveCurtainVert } from "./perspective_curtain.vertex.glsl";
import { perspectiveDistortedFrag } from "./perspective_distorted.fragment.glsl";
import { perspectiveDistortedVert } from "./perspective_distorted.vertex.glsl";
import { perspectiveDistortedCurtainFrag } from "./perspective_distorted_curtain.fragment.glsl";
import { perspectiveDistortedCurtainVert } from "./perspective_distorted_curtain.vertex.glsl";


export class Shaders {
public static fisheye: Shader = {
fragment: fisheyeFrag,
vertex: fisheyeVert,
};

public static fisheyeCurtain: Shader = {
fragment: fisheyeCurtainFrag,
vertex: fisheyeCurtainVert,
};

public static perspective: Shader = {
fragment: perspectiveFrag,
vertex: perspectiveVert,
};

public static perspectiveCurtain: Shader = {
fragment: perspectiveCurtainFrag,
vertex: perspectiveCurtainVert,
};

public static perspectiveDistorted: Shader = {
fragment: perspectiveDistortedFrag,
vertex: perspectiveDistortedVert,
};

public static perspectiveDistortedCurtain: Shader = {
fragment: perspectiveDistortedCurtainFrag,
vertex: perspectiveDistortedCurtainVert,
};

public static spherical: Shader = {
fragment: sphericalFrag,
vertex: sphericalVert,
};

public static sphericalCurtain: Shader = {
fragment: sphericalCurtainFrag,
vertex: sphericalCurtainVert,
};
}
Loading

0 comments on commit 3ac8f44

Please sign in to comment.