Spaces:
Paused
Paused
Download node_modules/@plotly/mapbox-gl/src/ui/anchor.js from Leon4gr45/UserSyncFrontend: direct link, hf CLI and curl.
- Browser
- Download file 876 Bytes
-
https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40plotly/mapbox-gl/src/ui/anchor.js
- Command line
-
hf download hf://spaces/Leon4gr45/UserSyncFrontend/node_modules/@plotly/mapbox-gl/src/ui/anchor.js
-
curl -L -o anchor.js https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40plotly/mapbox-gl/src/ui/anchor.js
876 Bytes
| // @flow | |
| export type Anchor = | |
| | 'center' | |
| | 'top' | |
| | 'bottom' | |
| | 'left' | |
| | 'right' | |
| | 'top-left' | |
| | 'top-right' | |
| | 'bottom-left' | |
| | 'bottom-right'; | |
| export const anchorTranslate: {[_: Anchor]: string} = { | |
| 'center': 'translate(-50%,-50%)', | |
| 'top': 'translate(-50%,0)', | |
| 'top-left': 'translate(0,0)', | |
| 'top-right': 'translate(-100%,0)', | |
| 'bottom': 'translate(-50%,-100%)', | |
| 'bottom-left': 'translate(0,-100%)', | |
| 'bottom-right': 'translate(-100%,-100%)', | |
| 'left': 'translate(0,-50%)', | |
| 'right': 'translate(-100%,-50%)' | |
| }; | |
| export function applyAnchorClass(element: HTMLElement, anchor: Anchor, prefix: string) { | |
| const classList = element.classList; | |
| for (const key in anchorTranslate) { | |
| classList.remove(`mapboxgl-${prefix}-anchor-${key}`); | |
| } | |
| classList.add(`mapboxgl-${prefix}-anchor-${anchor}`); | |
| } | |