ts-maps 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +284 -0
  2. package/dist/apply-transform.d.ts +47 -0
  3. package/dist/base-element.d.ts +5 -0
  4. package/dist/base.d.ts +19 -0
  5. package/dist/brasil.d.ts +1 -0
  6. package/dist/canada.d.ts +1 -0
  7. package/dist/canvas-element.d.ts +8 -0
  8. package/dist/coords-to-point.d.ts +26 -0
  9. package/dist/create-lines.d.ts +39 -0
  10. package/dist/create-markers.d.ts +51 -0
  11. package/dist/create-regions.d.ts +19 -0
  12. package/dist/create-series.d.ts +20 -0
  13. package/dist/data-visualization.d.ts +99 -0
  14. package/dist/deep-merge.d.ts +44 -0
  15. package/dist/event-handler.d.ts +12 -0
  16. package/dist/events.d.ts +14 -0
  17. package/dist/get-inset-for-point.d.ts +24 -0
  18. package/dist/get-marker-position.d.ts +15 -0
  19. package/dist/image-element.d.ts +7 -0
  20. package/dist/index.d.ts +12 -0
  21. package/dist/index.js +2027 -0
  22. package/dist/interactable.d.ts +7 -0
  23. package/dist/italy.d.ts +1 -0
  24. package/dist/legend.d.ts +6 -0
  25. package/dist/line.d.ts +29 -0
  26. package/dist/map.d.ts +422 -0
  27. package/dist/marker.d.ts +31 -0
  28. package/dist/options.d.ts +5 -0
  29. package/dist/ordinal-scale.d.ts +32 -0
  30. package/dist/projection.d.ts +18 -0
  31. package/dist/region.d.ts +21 -0
  32. package/dist/reposition-labels.d.ts +27 -0
  33. package/dist/reposition-lines.d.ts +32 -0
  34. package/dist/reposition-markers.d.ts +26 -0
  35. package/dist/resize.d.ts +5 -0
  36. package/dist/series.d.ts +4 -0
  37. package/dist/set-focus.d.ts +58 -0
  38. package/dist/set-scale.d.ts +80 -0
  39. package/dist/setup-container-events.d.ts +48 -0
  40. package/dist/setup-container-touch-events.d.ts +68 -0
  41. package/dist/setup-element-events.d.ts +125 -0
  42. package/dist/setup-zoom-buttons.d.ts +21 -0
  43. package/dist/shape-element.d.ts +10 -0
  44. package/dist/spain.d.ts +1 -0
  45. package/dist/text-element.d.ts +1 -0
  46. package/dist/tooltip.d.ts +80 -0
  47. package/dist/types.d.ts +398 -0
  48. package/dist/update-size.d.ts +6 -0
  49. package/dist/us-aea-en.d.ts +266 -0
  50. package/dist/us-lcc-en.d.ts +266 -0
  51. package/dist/us-merc-en.d.ts +266 -0
  52. package/dist/us-mill-en.d.ts +266 -0
  53. package/dist/utils.d.ts +21 -0
  54. package/dist/vector-map.d.ts +15 -0
  55. package/dist/world-merc.d.ts +1 -0
  56. package/dist/world.d.ts +1 -0
  57. package/package.json +57 -0
@@ -0,0 +1,14 @@
1
+ declare interface Events {
2
+ onLoaded: string
3
+ onViewportChange: string
4
+ onRegionClick: string
5
+ onMarkerClick: string
6
+ onRegionSelected: string
7
+ onMarkerSelected: string
8
+ onRegionTooltipShow: string
9
+ onMarkerTooltipShow: string
10
+ onDestroyed: string
11
+ }
12
+ declare const events: Events;
13
+
14
+ export default events;
@@ -0,0 +1,24 @@
1
+ declare interface Point {
2
+ x: number
3
+ y: number
4
+ }
5
+ declare interface Inset {
6
+ bbox: [Point, Point]
7
+ width: number
8
+ height: number
9
+ left: number
10
+ top: number
11
+ [key: string]: any
12
+ }
13
+
14
+ export default function getInsetForPoint(this: MapInterface, x: number, y: number): Inset | undefined {
15
+ const insets = Map.maps[this.params.map.name].insets
16
+
17
+ for (let index = 0; index < insets.length; index++) {
18
+ const [start, end] = insets[index].bbox
19
+
20
+ if (x > start.x && x < end.x && y > start.y && y < end.y) {
21
+ return insets[index]
22
+ }
23
+ }
24
+ };
@@ -0,0 +1,15 @@
1
+ declare interface Point {
2
+ x: number
3
+ y: number
4
+ }
5
+
6
+ export default function getMarkerPosition(this: MapInterface, { coords }: MarkerConfig): Point | false {
7
+ if (Map.maps[this.params.map.name].projection) {
8
+ return this.coordsToPoint(...coords)
9
+ }
10
+
11
+ return {
12
+ x: coords[0] * this.scale + this.transX * this.scale,
13
+ y: coords[1] * this.scale + this.transY * this.scale,
14
+ }
15
+ };
@@ -0,0 +1,7 @@
1
+ declare interface ImageConfig {
2
+ url?: string
3
+ offset?: [number, number]
4
+ }
5
+ declare const config: unknown;
6
+
7
+ export default SVGImageElement;
@@ -0,0 +1,12 @@
1
+ import { VectorMap } from './vector-map';
2
+
3
+
4
+ export { VectorMap }
5
+
6
+ export * from './types'
7
+
8
+ if (typeof window !== 'undefined') {
9
+ window.VectorMap = VectorMap
10
+ }
11
+
12
+ export default VectorMap;