manim-web 0.28.0 → 0.29.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.
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/integrations/notebook.js +9 -9
- package/dist/integrations/react.js +16 -16
- package/dist/integrations/vue.js +13 -13
- package/dist/manim-web.browser.js +1412 -1032
- package/dist/mobjects/chemistry/MoleculeMobject.d.ts +64 -0
- package/dist/mobjects/chemistry/MoleculeMobject.d.ts.map +1 -0
- package/dist/mobjects/chemistry/chemistryTypes.d.ts +79 -0
- package/dist/mobjects/chemistry/chemistryTypes.d.ts.map +1 -0
- package/dist/mobjects/chemistry/cpkColors.d.ts +36 -0
- package/dist/mobjects/chemistry/cpkColors.d.ts.map +1 -0
- package/dist/mobjects/chemistry/index.d.ts +12 -0
- package/dist/mobjects/chemistry/index.d.ts.map +1 -0
- package/dist/mobjects/chemistry/molecules.d.ts +19 -0
- package/dist/mobjects/chemistry/molecules.d.ts.map +1 -0
- package/dist/mobjects/effects/dropShadow.d.ts +30 -0
- package/dist/mobjects/effects/dropShadow.d.ts.map +1 -0
- package/dist/mobjects/effects/index.d.ts +5 -0
- package/dist/mobjects/effects/index.d.ts.map +1 -0
- package/dist/{src-D7e_dgYz.js → src-CVtpypS8.js} +1394 -1014
- package/package.json +1 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { VGroup } from '../../core/VGroup';
|
|
2
|
+
import { Mobject, Vector3Tuple } from '../../core/Mobject';
|
|
3
|
+
import { AtomSpec, BondSpec, BondOrder, BondStyle, MoleculeOptions, AtomRender, BondRender } from './chemistryTypes';
|
|
4
|
+
export declare class MoleculeMobject extends VGroup {
|
|
5
|
+
/** The atom specs as given, scaled to world coordinates. */
|
|
6
|
+
protected _atomSpecs: AtomSpec[];
|
|
7
|
+
/** The bond specs as given. */
|
|
8
|
+
protected _bondSpecs: BondSpec[];
|
|
9
|
+
/** Resolved atoms, parallel to _atomSpecs. */
|
|
10
|
+
protected _atoms: AtomRender[];
|
|
11
|
+
/** Resolved bonds, parallel to _bondSpecs. */
|
|
12
|
+
protected _bonds: BondRender[];
|
|
13
|
+
protected _bondLength: number;
|
|
14
|
+
protected _colors: Record<string, string>;
|
|
15
|
+
protected _showCarbonLabels: boolean;
|
|
16
|
+
protected _labelFontSize: number;
|
|
17
|
+
protected _bondColor: string;
|
|
18
|
+
protected _bondSpacing: number;
|
|
19
|
+
/** The bond line mobjects, drawn behind the atoms. */
|
|
20
|
+
readonly bondsGroup: VGroup;
|
|
21
|
+
/** The atom label mobjects, drawn in front of the bonds. */
|
|
22
|
+
readonly atomsGroup: VGroup;
|
|
23
|
+
constructor(options: MoleculeOptions);
|
|
24
|
+
/** World position of an atom spec after the bond-length scale. */
|
|
25
|
+
protected _atomPosition(spec: AtomSpec): Vector3Tuple;
|
|
26
|
+
/** Whether an element should carry a label. Carbons are implicit by default. */
|
|
27
|
+
protected _hasLabel(element: string): boolean;
|
|
28
|
+
/** Resolve each atom spec into an AtomRender (position and color; label added later). */
|
|
29
|
+
protected _resolveAtoms(): void;
|
|
30
|
+
/** Create a label Text for every atom that needs one, and add it to atomsGroup. */
|
|
31
|
+
protected _buildAtomLabels(): void;
|
|
32
|
+
/** Build every bond and add its line mobjects to bondsGroup. */
|
|
33
|
+
protected _buildBonds(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Build the line mobjects for one bond.
|
|
36
|
+
*
|
|
37
|
+
* A bond that references a missing atom produces no lines (handled
|
|
38
|
+
* gracefully, no throw). A wedge or dash bond produces one mobject. A normal
|
|
39
|
+
* bond produces `order` parallel lines.
|
|
40
|
+
*/
|
|
41
|
+
protected _buildBondLines(spec: BondSpec, order: BondOrder, type: BondStyle): Mobject[];
|
|
42
|
+
/** Trim the bond endpoints inward at labeled atoms so the line clears the label. */
|
|
43
|
+
protected _trimForLabels(fromAtom: AtomRender, toAtom: AtomRender): [Vector3Tuple, Vector3Tuple];
|
|
44
|
+
/** Unit perpendicular to the segment, in the XY plane. */
|
|
45
|
+
protected _perpendicular(start: Vector3Tuple, end: Vector3Tuple): Vector3Tuple;
|
|
46
|
+
/** Build `order` parallel lines, evenly offset about the bond axis. */
|
|
47
|
+
protected _buildParallelLines(start: Vector3Tuple, end: Vector3Tuple, order: BondOrder): Mobject[];
|
|
48
|
+
/** Build a filled triangle wedge from `start` (point) to `end` (wide base). */
|
|
49
|
+
protected _buildWedge(start: Vector3Tuple, end: Vector3Tuple): Mobject;
|
|
50
|
+
/** Get all resolved atoms, in input order. */
|
|
51
|
+
getAtoms(): AtomRender[];
|
|
52
|
+
/** Get all resolved bonds, in input order. */
|
|
53
|
+
getBonds(): BondRender[];
|
|
54
|
+
/** Get the resolved atom at an index, or undefined. */
|
|
55
|
+
getAtom(index: number): AtomRender | undefined;
|
|
56
|
+
/** Get the resolved bond at an index, or undefined. */
|
|
57
|
+
getBond(index: number): BondRender | undefined;
|
|
58
|
+
/** The number of atoms. */
|
|
59
|
+
get numAtoms(): number;
|
|
60
|
+
/** The number of bonds. */
|
|
61
|
+
get numBonds(): number;
|
|
62
|
+
copy(): MoleculeMobject;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=MoleculeMobject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MoleculeMobject.d.ts","sourceRoot":"","sources":["../../../src/mobjects/chemistry/MoleculeMobject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAQ3D,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EACT,eAAe,EACf,UAAU,EACV,UAAU,EACX,MAAM,kBAAkB,CAAC;AAK1B,qBAAa,eAAgB,SAAQ,MAAM;IACzC,4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C,YAAY,EAAE,YAAY,CAAC;IAwBhG,0DAA0D;IAC1D,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,GAAG,YAAY;IAU9E,uEAAuE;IACvE,SAAS,CAAC,mBAAmB,CAC3B,KAAK,EAAE,YAAY,EACnB,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE,SAAS,GACf,OAAO,EAAE;IAwBZ,+EAA+E;IAC/E,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO;IAetE,8CAA8C;IAC9C,QAAQ,IAAI,UAAU,EAAE;IAIxB,8CAA8C;IAC9C,QAAQ,IAAI,UAAU,EAAE;IAIxB,uDAAuD;IACvD,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAI9C,uDAAuD;IACvD,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAI9C,2BAA2B;IAC3B,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,2BAA2B;IAC3B,IAAI,QAAQ,IAAI,MAAM,CAErB;IAEQ,IAAI,IAAI,eAAe;CAcjC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Vector3Tuple, Mobject } from '../../core/Mobject';
|
|
2
|
+
import { Text } from '../text/Text';
|
|
3
|
+
/** Bond multiplicity. 1 = single, 2 = double, 3 = triple. */
|
|
4
|
+
export type BondOrder = 1 | 2 | 3;
|
|
5
|
+
/**
|
|
6
|
+
* Bond drawing style.
|
|
7
|
+
* - 'normal' draws plain parallel lines by order.
|
|
8
|
+
* - 'wedge' draws a filled triangle (a bond toward the viewer).
|
|
9
|
+
* - 'dash' draws a dashed line (a bond away from the viewer).
|
|
10
|
+
*/
|
|
11
|
+
export type BondStyle = 'normal' | 'wedge' | 'dash';
|
|
12
|
+
/** One atom in the input: an element symbol and 2D coordinates. */
|
|
13
|
+
export interface AtomSpec {
|
|
14
|
+
/** Element symbol, e.g. 'C', 'O', 'Cl'. */
|
|
15
|
+
element: string;
|
|
16
|
+
/** X coordinate in bond-length units. */
|
|
17
|
+
x: number;
|
|
18
|
+
/** Y coordinate in bond-length units. */
|
|
19
|
+
y: number;
|
|
20
|
+
}
|
|
21
|
+
/** One bond in the input: two atom indices and an optional order/style. */
|
|
22
|
+
export interface BondSpec {
|
|
23
|
+
/** Index of the first atom in the atoms array. */
|
|
24
|
+
from: number;
|
|
25
|
+
/** Index of the second atom in the atoms array. */
|
|
26
|
+
to: number;
|
|
27
|
+
/** Bond order. Default: 1. */
|
|
28
|
+
order?: BondOrder;
|
|
29
|
+
/** Bond style. Default: 'normal'. */
|
|
30
|
+
type?: BondStyle;
|
|
31
|
+
}
|
|
32
|
+
/** Options for a {@link MoleculeMobject}. */
|
|
33
|
+
export interface MoleculeOptions {
|
|
34
|
+
/** The atoms of the molecule. */
|
|
35
|
+
atoms: AtomSpec[];
|
|
36
|
+
/** The bonds between atoms. Default: []. */
|
|
37
|
+
bonds?: BondSpec[];
|
|
38
|
+
/** Scale applied to every atom coordinate. Default: 1. */
|
|
39
|
+
bondLength?: number;
|
|
40
|
+
/** Per-element color overrides, e.g. { C: '#000000' }. Merged over the CPK palette. */
|
|
41
|
+
colors?: Record<string, string>;
|
|
42
|
+
/** Whether to draw a label on carbon atoms. Default: false (skeletal convention). */
|
|
43
|
+
showCarbonLabels?: boolean;
|
|
44
|
+
/** Font size for atom labels. Default: 28. */
|
|
45
|
+
labelFontSize?: number;
|
|
46
|
+
/** Color of the bond lines. Default: white. */
|
|
47
|
+
bondColor?: string;
|
|
48
|
+
/** Distance between the parallel lines of a double or triple bond. Default: 0.08. */
|
|
49
|
+
bondSpacing?: number;
|
|
50
|
+
}
|
|
51
|
+
/** A resolved atom: its element, world position, color and optional label. */
|
|
52
|
+
export interface AtomRender {
|
|
53
|
+
/** Element symbol. */
|
|
54
|
+
element: string;
|
|
55
|
+
/** Position after the bond-length scale. */
|
|
56
|
+
position: Vector3Tuple;
|
|
57
|
+
/** Resolved CPK (or overridden) color. */
|
|
58
|
+
color: string;
|
|
59
|
+
/** The label mobject, or null for an implicit (unlabeled) carbon. */
|
|
60
|
+
label: Text | null;
|
|
61
|
+
}
|
|
62
|
+
/** A resolved bond: its endpoints, order, style and line mobjects. */
|
|
63
|
+
export interface BondRender {
|
|
64
|
+
/** Index of the first atom. */
|
|
65
|
+
from: number;
|
|
66
|
+
/** Index of the second atom. */
|
|
67
|
+
to: number;
|
|
68
|
+
/** Bond order. */
|
|
69
|
+
order: BondOrder;
|
|
70
|
+
/** Bond style. */
|
|
71
|
+
type: BondStyle;
|
|
72
|
+
/**
|
|
73
|
+
* The mobjects that draw this bond. A normal bond of order N has N line
|
|
74
|
+
* mobjects; a wedge or dash bond has one. A bond that references a missing
|
|
75
|
+
* atom has none.
|
|
76
|
+
*/
|
|
77
|
+
lines: Mobject[];
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=chemistryTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chemistryTypes.d.ts","sourceRoot":"","sources":["../../../src/mobjects/chemistry/chemistryTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,6DAA6D;AAC7D,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAElC;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpD,mEAAmE;AACnE,MAAM,WAAW,QAAQ;IACvB,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,CAAC,EAAE,MAAM,CAAC;IACV,yCAAyC;IACzC,CAAC,EAAE,MAAM,CAAC;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CAAC;CAClB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CPK / Jmol color palette for chemical elements.
|
|
3
|
+
*
|
|
4
|
+
* The CPK coloring convention assigns a standard color to each element
|
|
5
|
+
* (oxygen red, nitrogen blue, and so on). These hex values follow the Jmol
|
|
6
|
+
* palette, which is the de-facto standard used by most molecular viewers.
|
|
7
|
+
*/
|
|
8
|
+
/** Fallback color for an element that is not in the palette. */
|
|
9
|
+
export declare const DEFAULT_ELEMENT_COLOR = "#DDDDDD";
|
|
10
|
+
/**
|
|
11
|
+
* Element symbol to hex color (CPK / Jmol convention).
|
|
12
|
+
*
|
|
13
|
+
* Carbon uses a visible mid-gray rather than pure black so it reads on a dark
|
|
14
|
+
* background; callers can override any element through MoleculeOptions.colors.
|
|
15
|
+
*/
|
|
16
|
+
export declare const CPK_COLORS: Readonly<Record<string, string>>;
|
|
17
|
+
/**
|
|
18
|
+
* Normalize an element symbol to its canonical case.
|
|
19
|
+
*
|
|
20
|
+
* A symbol is an uppercase first letter and a lowercase second letter, so
|
|
21
|
+
* 'cl', 'CL' and 'Cl' all resolve to 'Cl'. The input is trimmed first.
|
|
22
|
+
* @param element - The raw element symbol.
|
|
23
|
+
* @returns The canonical symbol.
|
|
24
|
+
*/
|
|
25
|
+
export declare function normalizeElement(element: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Resolve the color for an element.
|
|
28
|
+
*
|
|
29
|
+
* The lookup order is: caller overrides, then the CPK palette, then the
|
|
30
|
+
* default color. Overrides are matched on the canonical symbol.
|
|
31
|
+
* @param element - The element symbol (any case).
|
|
32
|
+
* @param overrides - Optional per-element color overrides.
|
|
33
|
+
* @returns The hex color string.
|
|
34
|
+
*/
|
|
35
|
+
export declare function cpkColor(element: string, overrides?: Record<string, string>): string;
|
|
36
|
+
//# sourceMappingURL=cpkColors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cpkColors.d.ts","sourceRoot":"","sources":["../../../src/mobjects/chemistry/cpkColors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,gEAAgE;AAChE,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAuBvD,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMxD;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAWpF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chemistry mobjects for manim-web.
|
|
3
|
+
*
|
|
4
|
+
* 2D skeletal molecule structures: atoms as element labels, bonds as
|
|
5
|
+
* single/double/triple lines with optional wedge/dash stereochemistry, plus
|
|
6
|
+
* prebuilt example molecules and the CPK color palette.
|
|
7
|
+
*/
|
|
8
|
+
export { MoleculeMobject } from './MoleculeMobject';
|
|
9
|
+
export { water, methane, benzene, ethanol, type MoleculeBuilderOptions } from './molecules';
|
|
10
|
+
export { cpkColor, normalizeElement, CPK_COLORS, DEFAULT_ELEMENT_COLOR } from './cpkColors';
|
|
11
|
+
export { type AtomSpec, type BondSpec, type BondOrder, type BondStyle, type MoleculeOptions, type AtomRender, type BondRender, } from './chemistryTypes';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mobjects/chemistry/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { MoleculeMobject } from './MoleculeMobject';
|
|
2
|
+
import { MoleculeOptions } from './chemistryTypes';
|
|
3
|
+
/** Style overrides a builder forwards to the MoleculeMobject (no atoms/bonds). */
|
|
4
|
+
export type MoleculeBuilderOptions = Partial<Omit<MoleculeOptions, 'atoms' | 'bonds'>>;
|
|
5
|
+
/** Water, H2O. An oxygen with two hydrogens at the bent 104.5 degree angle. */
|
|
6
|
+
export declare function water(options?: MoleculeBuilderOptions): MoleculeMobject;
|
|
7
|
+
/** Methane, CH4. A central carbon with four hydrogens; the carbon is labeled. */
|
|
8
|
+
export declare function methane(options?: MoleculeBuilderOptions): MoleculeMobject;
|
|
9
|
+
/**
|
|
10
|
+
* Benzene, C6H6. Six carbons in a regular hexagon ring with alternating single
|
|
11
|
+
* and double bonds (Kekule structure). Carbons stay implicit (skeletal).
|
|
12
|
+
*/
|
|
13
|
+
export declare function benzene(options?: MoleculeBuilderOptions): MoleculeMobject;
|
|
14
|
+
/**
|
|
15
|
+
* Ethanol, C2H5OH. Two carbons and a hydroxyl group, drawn skeletal: the
|
|
16
|
+
* carbons are implicit, the oxygen and its hydrogen are labeled.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ethanol(options?: MoleculeBuilderOptions): MoleculeMobject;
|
|
19
|
+
//# sourceMappingURL=molecules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"molecules.d.ts","sourceRoot":"","sources":["../../../src/mobjects/chemistry/molecules.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,kFAAkF;AAClF,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;AAEvF,+EAA+E;AAC/E,wBAAgB,KAAK,CAAC,OAAO,GAAE,sBAA2B,GAAG,eAAe,CAa3E;AAED,iFAAiF;AACjF,wBAAgB,OAAO,CAAC,OAAO,GAAE,sBAA2B,GAAG,eAAe,CAkB7E;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,OAAO,GAAE,sBAA2B,GAAG,eAAe,CAW7E;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,OAAO,GAAE,sBAA2B,GAAG,eAAe,CAe7E"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { VGroup } from '../../core/VGroup';
|
|
2
|
+
import { VMobject } from '../../core/VMobject';
|
|
3
|
+
/** Options for {@link withDropShadow}. */
|
|
4
|
+
export interface DropShadowOptions {
|
|
5
|
+
/** Shadow offset `[dx, dy]` in scene units. Default `[0.1, -0.1]` (down-right). */
|
|
6
|
+
offset?: [number, number];
|
|
7
|
+
/** Shadow color. Default black `#000000`. */
|
|
8
|
+
color?: string;
|
|
9
|
+
/** Shadow opacity of the strongest layer (0..1). Default `0.5`. */
|
|
10
|
+
opacity?: number;
|
|
11
|
+
/** Number of shadow copies. More copies fake a softer edge. Default `1`. */
|
|
12
|
+
layers?: number;
|
|
13
|
+
/** Extra outward spread of the outer layers, as a fraction of `offset`. */
|
|
14
|
+
blur?: number;
|
|
15
|
+
/** Uniform scale of each shadow copy about its center. Default `1`. */
|
|
16
|
+
scale?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Return a VGroup with a drop shadow behind `mobject`.
|
|
20
|
+
*
|
|
21
|
+
* The source is copied for every shadow layer, so it is never recolored,
|
|
22
|
+
* moved, or scaled. The returned group holds the shadow layers first (drawn
|
|
23
|
+
* behind) and the original last (drawn in front).
|
|
24
|
+
*
|
|
25
|
+
* @param mobject - Source VMobject (shape, text, group, ...)
|
|
26
|
+
* @param options - Shadow options; see {@link DropShadowOptions}
|
|
27
|
+
* @returns A VGroup = `[shadow layers..., original]`
|
|
28
|
+
*/
|
|
29
|
+
export declare function withDropShadow<T extends VMobject>(mobject: T, options?: DropShadowOptions): VGroup;
|
|
30
|
+
//# sourceMappingURL=dropShadow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropShadow.d.ts","sourceRoot":"","sources":["../../../src/mobjects/effects/dropShadow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,0CAA0C;AAC1C,MAAM,WAAW,iBAAiB;IAChC,mFAAmF;IACnF,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAsCD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,QAAQ,EAC/C,OAAO,EAAE,CAAC,EACV,OAAO,GAAE,iBAAsB,GAC9B,MAAM,CA4BR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mobjects/effects/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC"}
|