manim-web 0.14.0 → 0.15.1

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.
@@ -0,0 +1,72 @@
1
+ import { Group } from '../../core/Group';
2
+ import { Mobject } from '../../core/Mobject';
3
+ import { Polygon } from '../geometry/Polygon';
4
+ import { GeoFeature, GeoFeatureCollection } from './geojson';
5
+ import { GeoProjection } from './projections';
6
+ import { ColorScale } from './colorScale';
7
+ /**
8
+ * Reads the value a feature should be colored by. Return `null`/`undefined`
9
+ * (or a non-finite number) to color the feature with the no-data color.
10
+ */
11
+ export type ChoroplethValueAccessor = (feature: GeoFeature, index: number) => number | null | undefined;
12
+ /** Options for a {@link ChoroplethMap}. */
13
+ export interface ChoroplethMapOptions {
14
+ /** The GeoJSON feature collection to render. */
15
+ geojson: GeoFeatureCollection;
16
+ /** Reads the numeric value per feature. */
17
+ value: ChoroplethValueAccessor;
18
+ /** Reference colors for the fill scale (interpolated). Default: a blue ramp. */
19
+ colorScale?: string[];
20
+ /** Fixed value domain `[min, max]`. Default: computed from the data. */
21
+ domain?: [number, number];
22
+ /** Fill opacity from 0 to 1. Default: 1. */
23
+ fillOpacity?: number;
24
+ /** Fill color used when a feature has no value. Default: Manim gray. */
25
+ noDataColor?: string;
26
+ /** Border (stroke) color. Default: '#1b263b'. */
27
+ borderColor?: string;
28
+ /** Border width in pixels. 0 hides the border. Default: 1. */
29
+ borderWidth?: number;
30
+ /** Projection from lon/lat to 2D. Default: equirectangular(). */
31
+ projection?: GeoProjection;
32
+ }
33
+ /**
34
+ * ChoroplethMap - a value-colored 2D map built from GeoJSON polygons.
35
+ *
36
+ * @example
37
+ * ```typescript
38
+ * const map = new ChoroplethMap({
39
+ * geojson: worldFeatureCollection,
40
+ * value: (feature) => feature.properties?.gdp as number,
41
+ * colorScale: ['#f7fbff', '#08306b'],
42
+ * borderWidth: 1,
43
+ * });
44
+ * map.scale(2);
45
+ * scene.add(map);
46
+ * ```
47
+ */
48
+ export declare class ChoroplethMap extends Group {
49
+ private _projection;
50
+ private _colorScale;
51
+ private _regions;
52
+ private _regionColors;
53
+ private _regionPolygons;
54
+ constructor(options: ChoroplethMapOptions);
55
+ private _buildRegion;
56
+ private _buildPolygon;
57
+ /** Get the per-feature region mobjects (one entry per feature). */
58
+ getRegions(): Mobject[];
59
+ /** Get the number of regions (equals the number of input features). */
60
+ getRegionCount(): number;
61
+ /** Get the fill color assigned to a feature's region. */
62
+ getRegionColor(index: number): string;
63
+ /** Get the polygons that make up a feature's region (one per exterior ring). */
64
+ getRegionPolygons(index: number): Polygon[];
65
+ /** Get the projection used to place lon/lat. */
66
+ getProjection(): GeoProjection;
67
+ /** Get the color scale mapping values to fill colors. */
68
+ getColorScale(): ColorScale;
69
+ }
70
+ /** Alias: some callers prefer the shorter `GeoMap` name. */
71
+ export declare const GeoMap: typeof ChoroplethMap;
72
+ //# sourceMappingURL=ChoroplethMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChoroplethMap.d.ts","sourceRoot":"","sources":["../../../src/mobjects/geo/ChoroplethMap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,oBAAoB,EAE1B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,CACpC,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,MAAM,KACV,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAE/B,2CAA2C;AAC3C,MAAM,WAAW,oBA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3
+ import { Sphere } from '../three-d/Sphere';
4
+ import { TexturedSurface } from '../three-d/TexturedSurface';
5
+ import { Dot3D } from '../three-d/ThreeDExtensions';
6
+ import { Polygon } from '../geometry/Polygon';
7
+ /** A `[latitude, longitude]` pair in decimal degrees. */
8
+ export type LatLon = [number, number];
9
+ /** Options for a {@link Globe}. */
10
+ export interface GlobeOptions {
11
+ /** Sphere radius. Default: 1. */
12
+ radius?: number;
13
+ /** Center position `[x, y, z]`. Default: `[0, 0, 0]`. */
14
+ center?: Vector3Tuple;
15
+ /** Texture image URL. When set, the globe uses a textured sphere. */
16
+ textureUrl?: string;
17
+ /** Optional dark/night texture URL, blended by light direction. */
18
+ darkTextureUrl?: string;
19
+ /** Sphere color when untextured. Default: '#2a6f97'. */
20
+ color?: string;
21
+ /** Opacity from 0 to 1. Default: 1. */
22
+ opacity?: number;
23
+ /** Sphere mesh resolution. Default: 64. */
24
+ resolution?: number;
25
+ }
26
+ /** Options for a plotted point marker. */
27
+ export interface GlobePointOptions {
28
+ /** Marker radius in scene units. Default: radius * 0.03. */
29
+ size?: number;
30
+ /** Marker color. Default: '#ffd166'. */
31
+ color?: string;
32
+ }
33
+ /** Options for a great-circle arc. */
34
+ export interface GlobeArcOptions {
35
+ /** Number of segments along the arc. Default: 64. */
36
+ segments?: number;
37
+ /** Line color. Default: '#ef476f'. */
38
+ color?: string;
39
+ /** Line width in pixels. Default: 2. */
40
+ lineWidth?: number;
41
+ /** Fraction of the sphere radius to lift the arc off the surface. Default: 0. */
42
+ altitude?: number;
43
+ }
44
+ /** Options for a graticule (lat/long grid). */
45
+ export interface GlobeGraticuleOptions {
46
+ /** Spacing between parallels in degrees. Default: 30. */
47
+ latStep?: number;
48
+ /** Spacing between meridians in degrees. Default: 30. */
49
+ lonStep?: number;
50
+ /** Samples per grid line. Default: 48. */
51
+ segments?: number;
52
+ /** Line color. Default: '#8d99ae'. */
53
+ color?: string;
54
+ /** Line width in pixels. Default: 1. */
55
+ lineWidth?: number;
56
+ }
57
+ /**
58
+ * Globe - a 3D sphere with geographic plotting helpers.
59
+ *
60
+ * @example
61
+ * ```typescript
62
+ * const globe = new Globe({ radius: 2, textureUrl: '/textures/earth.jpg' });
63
+ * globe.plotPoint(48.85, 2.35); // Paris
64
+ * globe.arc([48.85, 2.35], [40.71, -74.0]); // Paris -> New York
65
+ * globe.graticule({ latStep: 30, lonStep: 30 });
66
+ * scene.add(globe);
67
+ * ```
68
+ */
69
+ export declare class Globe extends Group {
70
+ private _radius;
71
+ private _center;
72
+ private _sphere;
73
+ private _plottedPoints;
74
+ constructor(options?: GlobeOptions);
75
+ /** Get the underlying sphere mobject (plain or textured). */
76
+ getSphere(): Sphere | TexturedSurface;
77
+ /** Get the sphere radius. */
78
+ getRadius(): number;
79
+ /**
80
+ * Convert a latitude/longitude (degrees) to a point on the sphere surface,
81
+ * in scene coordinates (center offset included).
82
+ *
83
+ * @param lat - Latitude in degrees (north positive).
84
+ * @param lon - Longitude in degrees (east positive).
85
+ * @returns The `[x, y, z]` surface point.
86
+ */
87
+ latLonToPoint(lat: number, lon: number): Vector3Tuple;
88
+ /**
89
+ * Plot a marker at a latitude/longitude. The marker is added as a child so it
90
+ * transforms with the globe.
91
+ *
92
+ * @param lat - Latitude in degrees.
93
+ * @param lon - Longitude in degrees.
94
+ * @param options - Marker size and color.
95
+ * @returns The created {@link Dot3D} marker.
96
+ */
97
+ plotPoint(lat: number, lon: number, options?: GlobePointOptions): Dot3D;
98
+ /** Get the markers added via {@link plotPoint}. */
99
+ getPlottedPoints(): Dot3D[];
100
+ /**
101
+ * Draw the great-circle (shortest-path) arc between two lat/long points. The
102
+ * arc is sampled with spherical linear interpolation, so every vertex lies on
103
+ * the sphere. The arc is added as a child.
104
+ *
105
+ * @param from - Start `[lat, lon]` in degrees.
106
+ * @param to - End `[lat, lon]` in degrees.
107
+ * @param options - Segment count, color, width and optional altitude.
108
+ * @returns The created {@link Polygon} polyline.
109
+ */
110
+ arc(from: LatLon, to: LatLon, options?: GlobeArcOptions): Polygon;
111
+ /**
112
+ * Build a graticule (lat/long grid) as a group of polylines, added as a
113
+ * child. Meridians run pole to pole; parallels circle the globe.
114
+ *
115
+ * @param options - Grid spacing, resolution and style.
116
+ * @returns The created {@link Group} of grid lines.
117
+ */
118
+ graticule(options?: GlobeGraticuleOptions): Group;
119
+ private _gridLine;
120
+ private _surfacePoint;
121
+ }
122
+ //# sourceMappingURL=Globe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Globe.d.ts","sourceRoot":"","sources":["../../../src/mobjects/geo/Globe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAkB,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAI9C,yDAAyD;AACzD,MAAM,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEtC,mCAAmC;AACnC,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,0CAA0C;AAC1C,MAAM,WAAW,iBAAiB;IAChC,4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ACH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO;IA0BrE;;;;;;OAMG;IACH,SAAS,CAAC,OAAO,GAAE,qBAA0B,GAAG,KAAK;IAiBrD,OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,aAAa;CAQtB"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * A sequential color scale: maps a numeric value in a domain to a color by
3
+ * sampling a gradient built from reference colors.
4
+ *
5
+ * Reuses {@link colorGradient} (the same helper behind
6
+ * `VMobject.setColorByGradient`) so choropleth colors match the rest of the
7
+ * library. Values are normalized over the domain, clamped to `[0, 1]`, and
8
+ * indexed into a pre-sampled palette.
9
+ */
10
+ /** Options for a {@link ColorScale}. */
11
+ export interface ColorScaleOptions {
12
+ /** Reference colors to interpolate (at least one). Default: a blue ramp. */
13
+ colors?: string[];
14
+ /** Value domain `[min, max]`. Default: `[0, 1]`, or set from data later. */
15
+ domain?: [number, number];
16
+ /** Number of palette samples. Higher is smoother. Default: 256. */
17
+ samples?: number;
18
+ }
19
+ /**
20
+ * Maps numeric values to `#rrggbb` colors across a domain.
21
+ */
22
+ export declare class ColorScale {
23
+ private _palette;
24
+ private _domain;
25
+ constructor(options?: ColorScaleOptions);
26
+ /**
27
+ * Set the domain from a list of values (its min and max). Non-finite values
28
+ * are ignored. Leaves the domain unchanged when no finite value is present.
29
+ *
30
+ * @param values - The data values.
31
+ * @returns this for chaining.
32
+ */
33
+ setDomainFromValues(values: number[]): this;
34
+ /** Get the current domain `[min, max]`. */
35
+ getDomain(): [number, number];
36
+ /**
37
+ * Map a value to a color. Values outside the domain clamp to the endpoints.
38
+ * A zero-width domain maps everything to the first palette color.
39
+ *
40
+ * @param value - The value to map.
41
+ * @returns A `#rrggbb` color string.
42
+ */
43
+ colorFor(value: number): string;
44
+ }
45
+ //# sourceMappingURL=colorScale.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colorScale.d.ts","sourceRoot":"","sources":["../../../src/mobjects/geo/colorScale.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,wCAAwC;AACxC,MAAM,WAAW,iBAAiB;IAChC,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,OAAO,CAAmB;gBAEtB,OAAO,GAAE,iBAAsB;IAO3C;;;;;;OAMG;IACH,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI;IAc3C,2CAA2C;IAC3C,SAAS,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;IAI7B;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAQhC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Minimal GeoJSON type definitions (RFC 7946 subset) for the geo module.
3
+ *
4
+ * Only the pieces the choropleth map needs are modeled: positions, Polygon and
5
+ * MultiPolygon geometries, features and feature collections. Typing these
6
+ * precisely avoids `any` while keeping the dependency surface at zero (no
7
+ * `@types/geojson` needed).
8
+ */
9
+ /**
10
+ * A single coordinate as `[longitude, latitude]` in decimal degrees. A third
11
+ * altitude element is allowed by the spec and ignored by this module.
12
+ */
13
+ export type GeoPosition = [number, number] | [number, number, number];
14
+ /** A linear ring: an array of positions. The first ring of a polygon is its
15
+ * exterior; any further rings are holes (not punched out in V1). */
16
+ export type GeoLinearRing = GeoPosition[];
17
+ /** A Polygon geometry: an array of linear rings (exterior first). */
18
+ export interface GeoPolygon {
19
+ type: 'Polygon';
20
+ coordinates: GeoLinearRing[];
21
+ }
22
+ /** A MultiPolygon geometry: an array of polygons. */
23
+ export interface GeoMultiPolygon {
24
+ type: 'MultiPolygon';
25
+ coordinates: GeoLinearRing[][];
26
+ }
27
+ /** The geometry types this module renders. */
28
+ export type GeoGeometry = GeoPolygon | GeoMultiPolygon;
29
+ /** Arbitrary per-feature properties. */
30
+ export type GeoProperties = Record<string, unknown> | null;
31
+ /** A GeoJSON Feature carrying a polygonal geometry and properties. */
32
+ export interface GeoFeature {
33
+ type: 'Feature';
34
+ geometry: GeoGeometry;
35
+ properties?: GeoProperties;
36
+ id?: string | number;
37
+ }
38
+ /** A GeoJSON FeatureCollection. */
39
+ export interface GeoFeatureCollection {
40
+ type: 'FeatureCollection';
41
+ features: GeoFeature[];
42
+ }
43
+ /**
44
+ * Return the exterior rings of a feature's geometry.
45
+ *
46
+ * A Polygon yields its first ring. A MultiPolygon yields the first ring of each
47
+ * contained polygon. Interior rings (holes) are dropped: the choropleth fills
48
+ * exterior rings only in V1.
49
+ *
50
+ * @param geometry - The feature geometry.
51
+ * @returns One linear ring per exterior boundary.
52
+ */
53
+ export declare function exteriorRings(geometry: GeoGeometry): GeoLinearRing[];
54
+ //# sourceMappingURL=geojson.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geojson.d.ts","sourceRoot":"","sources":["../../../src/mobjects/geo/geojson.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEtE;oEACoE;AACpE,MAAM,MAAM,aAAa,GAAG,WAAW,EAAE,CAAC;AAE1C,qEAAqE;AACrE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,aAAa,EAAE,CAAC;CAC9B;AAED,qDAAqD;AACrD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,cAAc,CAAC;IACrB,WAAW,EAAE,aAAa,EAAE,EAAE,CAAC;CAChC;AAED,8CAA8C;AAC9C,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,eAAe,CAAC;AAEvD,wCAAwC;AACxC,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;AAE3D,sEAAsE;AACtE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,WAAW,CAAC;IACtB,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACtB;AAED,mCAAmC;AACnC,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,EAAE,UAAU,EAAE,CAAC;CACxB;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,WAAW,GAAG,aAAa,EAAE,CAWpE"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Geographical maps module for manim-web.
3
+ *
4
+ * Provides a 2D choropleth map ({@link ChoroplethMap}) and a 3D globe
5
+ * ({@link Globe}) built from GeoJSON. See each class for coordinate
6
+ * conventions and covered projections.
7
+ */
8
+ export { exteriorRings, type GeoPosition, type GeoLinearRing, type GeoPolygon, type GeoMultiPolygon, type GeoGeometry, type GeoProperties, type GeoFeature, type GeoFeatureCollection, } from './geojson';
9
+ export { equirectangular, mercator, type GeoProjection, type EquirectangularOptions, type MercatorOptions, } from './projections';
10
+ export { ColorScale, type ColorScaleOptions } from './colorScale';
11
+ export { ChoroplethMap, GeoMap, type ChoroplethMapOptions, type ChoroplethValueAccessor, } from './ChoroplethMap';
12
+ export { Globe, type LatLon, type GlobeOptions, type GlobePointOptions, type GlobeArcOptions, type GlobeGraticuleOptions, } from './Globe';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mobjects/geo/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,oBAAoB,GAC1B,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,eAAe,EACf,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,GACrB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGlE,OAAO,EACL,aAAa,EACb,MAAM,EACN,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,GAC7B,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,KAAK,EACL,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,qBAAqB,GAC3B,MAAM,SAAS,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { GeoPosition } from './geojson';
2
+ /**
3
+ * A projection maps a lon/lat position (degrees) to a 2D scene point.
4
+ */
5
+ export type GeoProjection = (position: GeoPosition) => [number, number];
6
+ /** Options for the equirectangular (plate carrée) projection. */
7
+ export interface EquirectangularOptions {
8
+ /** Scene-unit scale applied to the radian coordinates. Default: 1. */
9
+ radius?: number;
10
+ /** Central meridian in degrees; subtracted from each longitude. Default: 0. */
11
+ centerLon?: number;
12
+ /** Central parallel in degrees; subtracted from each latitude. Default: 0. */
13
+ centerLat?: number;
14
+ /**
15
+ * Standard parallel in degrees. Its cosine scales the horizontal axis so the
16
+ * map is undistorted along that latitude. Default: 0 (cosine 1).
17
+ */
18
+ standardParallel?: number;
19
+ }
20
+ /**
21
+ * Build an equirectangular projection.
22
+ *
23
+ * `x = radius * cos(standardParallel) * (lon - centerLon)` and
24
+ * `y = radius * (lat - centerLat)`, with all angles in radians.
25
+ *
26
+ * @param options - Projection parameters.
27
+ * @returns A projection function.
28
+ */
29
+ export declare function equirectangular(options?: EquirectangularOptions): GeoProjection;
30
+ /** Options for the Web Mercator projection. */
31
+ export interface MercatorOptions {
32
+ /** Scene-unit scale applied to the radian coordinates. Default: 1. */
33
+ radius?: number;
34
+ /** Central meridian in degrees; subtracted from each longitude. Default: 0. */
35
+ centerLon?: number;
36
+ /**
37
+ * Latitude cutoff in degrees. Latitudes beyond this are clamped so `y` stays
38
+ * finite. Default: 85.05112878 (the standard Web Mercator limit).
39
+ */
40
+ maxLatitude?: number;
41
+ }
42
+ /**
43
+ * Build a Web Mercator projection.
44
+ *
45
+ * `x = radius * (lon - centerLon)` and
46
+ * `y = radius * ln(tan(PI/4 + lat/2))`, with angles in radians and latitude
47
+ * clamped to `maxLatitude`.
48
+ *
49
+ * @param options - Projection parameters.
50
+ * @returns A projection function.
51
+ */
52
+ export declare function mercator(options?: MercatorOptions): GeoProjection;
53
+ //# sourceMappingURL=projections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projections.d.ts","sourceRoot":"","sources":["../../../src/mobjects/geo/projections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAI7C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,WAAW,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAExE,iEAAiE;AACjE,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBA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+ * Canvas-texture helpers for the raster Text mobject and its subclasses.
3
+ *
4
+ * A Text draws its glyphs to an off-screen 2D canvas and shows that canvas as a
5
+ * `THREE.CanvasTexture` on a plane. When the string changes length the canvas is
6
+ * resized, and three.js keeps the GPU texture at its first allocated size: a
7
+ * resized CanvasTexture re-uploaded in place is clipped to the old size (issue
8
+ * #607, a growing click counter froze at "9"). These helpers create the texture
9
+ * with the standard settings and recreate it when the canvas changes size, which
10
+ * forces a fresh GPU allocation.
11
+ *
12
+ * The canvas size each texture was allocated for is kept here, in a WeakMap keyed
13
+ * by the texture, so the caller does not have to track it. Entries disappear when
14
+ * the texture is garbage-collected.
15
+ */
16
+ import * as THREE from 'three';
17
+ /**
18
+ * Create a CanvasTexture for a text backing canvas with the standard settings,
19
+ * and record the canvas size it was allocated for.
20
+ */
21
+ export declare function createTextCanvasTexture(canvas: HTMLCanvasElement): THREE.CanvasTexture;
22
+ /**
23
+ * Recreate the texture when the backing canvas changed size.
24
+ *
25
+ * Returns the new texture, or null when nothing was done: an input is missing,
26
+ * the size matches the texture's allocation, or the material is not a
27
+ * `MeshBasicMaterial`. On a change the new texture becomes `material.map`, the
28
+ * material is flagged for re-upload, and the previous texture is disposed. A
29
+ * texture with no recorded size (e.g. adopted in a transform handoff) counts as
30
+ * a size mismatch, so it is replaced by a fresh texture for the current canvas.
31
+ */
32
+ export declare function reallocateTextureIfResized(mesh: THREE.Mesh | null, canvas: HTMLCanvasElement | null, texture: THREE.Texture | null): THREE.CanvasTexture | null;
33
+ //# sourceMappingURL=textTexture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textTexture.d.ts","sourceRoot":"","sources":["../../../src/mobjects/text/textTexture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAOtF;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,KAAK,CAAC,IAAI,GAAG,IAAI,EACvB,MAAM,EAAE,iBAAiB,GAAG,IAAI,EAChC,OAAO,EAAE,KAAK,CAAC,OAAO,GAAG,IAAI,GAC5B,KAAK,CAAC,aAAa,GAAG,IAAI,CAiB5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"spring.d.ts","sourceRoot":"","sources":["../../src/rate-functions/spring.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA6ED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,YAapD,CAAC"}
1
+ {"version":3,"file":"spring.d.ts","sourceRoot":"","sources":["../../src/rate-functions/spring.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAgFD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,YAapD,CAAC"}