Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 76fa6e5

Browse files
committed
create D3 path generator constants
1 parent f0667e2 commit 76fa6e5

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed

app/_constants/path-generators.js

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
import * as topojson from "topojson-client";
2+
import {
3+
geoPath,
4+
geoAzimuthalEqualArea,
5+
geoAzimuthalEquidistant,
6+
geoGnomonic,
7+
geoOrthographic,
8+
geoStereographic,
9+
geoConicConformal,
10+
geoConicEqualArea,
11+
geoConicEquidistant,
12+
geoAlbers,
13+
geoAlbersUsa,
14+
geoEquirectangular,
15+
geoMercator,
16+
geoTransverseMercator,
17+
geoEqualEarth,
18+
geoNaturalEarth1,
19+
} from "d3";
20+
21+
// -- Azimuthal Projections
22+
export const geoAzimuthalEqualAreaPathGenerator = () => {
23+
const projection = geoAzimuthalEqualArea();
24+
return geoPath(projection);
25+
};
26+
27+
export const geoAzimuthalEquidistantPathGenerator = () => {
28+
const projection = geoAzimuthalEquidistant();
29+
return geoPath(projection);
30+
};
31+
32+
export const geoGnomonicPathGenerator = () => {
33+
const projection = geoGnomonic();
34+
return geoPath(projection);
35+
};
36+
37+
export const geoOrthographicPathGenerator = () => {
38+
const projection = geoOrthographic();
39+
return geoPath(projection);
40+
};
41+
42+
export const geoStereographicPathGenerator = () => {
43+
const projection = geoStereographic();
44+
return geoPath(projection);
45+
};
46+
47+
// -- Conic Projections
48+
export const geoConicConformalPathGenerator = () => {
49+
const projection = geoConicConformal();
50+
return geoPath(projection);
51+
};
52+
53+
export const geoConicEqualAreaPathGenerator = () => {
54+
const projection = geoConicEqualArea();
55+
return geoPath(projection);
56+
};
57+
58+
export const geoConicEquidistantPathGenerator = () => {
59+
const projection = geoConicEquidistant();
60+
return geoPath(projection);
61+
};
62+
63+
export const geoAlbersPathGenerator = () => {
64+
const projection = geoAlbers();
65+
return geoPath(projection);
66+
};
67+
68+
export const geoAlbersUsaPathGenerator = () => {
69+
const projection = geoAlbersUsa();
70+
return geoPath(projection);
71+
};
72+
73+
// -- Cylindrical Projections
74+
export const geoEquirectangularPathGenerator = () => {
75+
const projection = geoEquirectangular();
76+
return geoPath(projection);
77+
};
78+
79+
export const geoMercatorPathGenerator = () => {
80+
const projection = geoMercator();
81+
return geoPath(projection);
82+
};
83+
84+
export const geoTransverseMercatorPathGenerator = () => {
85+
const projection = geoTransverseMercator();
86+
return geoPath(projection);
87+
};
88+
89+
export const geoEqualEarthPathGenerator = () => {
90+
const projection = geoEqualEarth();
91+
return geoPath(projection);
92+
};
93+
94+
export const geoNaturalEarth1PathGenerator = () => {
95+
const projection = geoNaturalEarth1();
96+
return geoPath(projection);
97+
};

0 commit comments

Comments
 (0)