@antv/g2 5.1.7 → 5.1.8

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 (185) hide show
  1. package/dist/g2.full.min.js +1 -1
  2. package/dist/g2.lite.min.js +1 -1
  3. package/dist/g2.min.js +1 -1
  4. package/esm/component/axis.js +1 -5
  5. package/esm/component/axis.js.map +1 -1
  6. package/esm/component/index.d.ts +0 -1
  7. package/esm/component/index.js +0 -1
  8. package/esm/component/index.js.map +1 -1
  9. package/esm/component/legendContinuous.js +1 -1
  10. package/esm/component/legendContinuous.js.map +1 -1
  11. package/esm/coordinate/index.d.ts +0 -2
  12. package/esm/coordinate/index.js +0 -1
  13. package/esm/coordinate/index.js.map +1 -1
  14. package/esm/exports.d.ts +5 -1
  15. package/esm/exports.js +3 -0
  16. package/esm/exports.js.map +1 -1
  17. package/esm/index.d.ts +114 -114
  18. package/esm/index.js +2 -2
  19. package/esm/index.js.map +1 -1
  20. package/esm/lib/builtinlib.d.ts +7 -7
  21. package/esm/lib/core.d.ts +32 -32
  22. package/esm/lib/index.d.ts +0 -1
  23. package/esm/lib/index.js +0 -1
  24. package/esm/lib/index.js.map +1 -1
  25. package/esm/lib/lite.d.ts +18 -18
  26. package/esm/lib/std.d.ts +56 -56
  27. package/esm/mark/index.d.ts +0 -3
  28. package/esm/mark/index.js +0 -3
  29. package/esm/mark/index.js.map +1 -1
  30. package/esm/mark/liquid.js +2 -1
  31. package/esm/mark/liquid.js.map +1 -1
  32. package/esm/runtime/component.js +1 -3
  33. package/esm/runtime/component.js.map +1 -1
  34. package/esm/runtime/types/component.d.ts +1 -6
  35. package/esm/shape/index.d.ts +0 -4
  36. package/esm/shape/index.js +0 -4
  37. package/esm/shape/index.js.map +1 -1
  38. package/esm/spec/coordinate.d.ts +1 -4
  39. package/esm/spec/mark.d.ts +1 -3
  40. package/esm/transform/filter.js +3 -1
  41. package/esm/transform/filter.js.map +1 -1
  42. package/esm/transform/maybeTitle.js +6 -1
  43. package/esm/transform/maybeTitle.js.map +1 -1
  44. package/esm/utils/dateFormat.d.ts +1 -0
  45. package/esm/utils/dateFormat.js +18 -0
  46. package/esm/utils/dateFormat.js.map +1 -0
  47. package/esm/utils/number.d.ts +4 -0
  48. package/esm/utils/number.js +8 -0
  49. package/esm/utils/number.js.map +1 -1
  50. package/lib/component/axis.js +3 -7
  51. package/lib/component/axis.js.map +1 -1
  52. package/lib/component/index.d.ts +0 -1
  53. package/lib/component/index.js +1 -3
  54. package/lib/component/index.js.map +1 -1
  55. package/lib/component/legendContinuous.js +1 -1
  56. package/lib/component/legendContinuous.js.map +1 -1
  57. package/lib/coordinate/index.d.ts +0 -2
  58. package/lib/coordinate/index.js +1 -3
  59. package/lib/coordinate/index.js.map +1 -1
  60. package/lib/exports.d.ts +5 -1
  61. package/lib/exports.js +7 -1
  62. package/lib/exports.js.map +1 -1
  63. package/lib/index.d.ts +114 -114
  64. package/lib/index.js +1 -2
  65. package/lib/index.js.map +1 -1
  66. package/lib/lib/builtinlib.d.ts +7 -7
  67. package/lib/lib/core.d.ts +32 -32
  68. package/lib/lib/index.d.ts +0 -1
  69. package/lib/lib/index.js +1 -3
  70. package/lib/lib/index.js.map +1 -1
  71. package/lib/lib/lite.d.ts +18 -18
  72. package/lib/lib/std.d.ts +56 -56
  73. package/lib/mark/index.d.ts +0 -3
  74. package/lib/mark/index.js +1 -7
  75. package/lib/mark/index.js.map +1 -1
  76. package/lib/mark/liquid.js +2 -1
  77. package/lib/mark/liquid.js.map +1 -1
  78. package/lib/runtime/component.js +2 -4
  79. package/lib/runtime/component.js.map +1 -1
  80. package/lib/runtime/types/component.d.ts +1 -6
  81. package/lib/shape/index.d.ts +0 -4
  82. package/lib/shape/index.js +6 -14
  83. package/lib/shape/index.js.map +1 -1
  84. package/lib/spec/coordinate.d.ts +1 -4
  85. package/lib/spec/mark.d.ts +1 -3
  86. package/lib/transform/filter.js +3 -1
  87. package/lib/transform/filter.js.map +1 -1
  88. package/lib/transform/maybeTitle.js +6 -1
  89. package/lib/transform/maybeTitle.js.map +1 -1
  90. package/lib/utils/dateFormat.d.ts +1 -0
  91. package/lib/utils/dateFormat.js +22 -0
  92. package/lib/utils/dateFormat.js.map +1 -0
  93. package/lib/utils/number.d.ts +4 -0
  94. package/lib/utils/number.js +10 -1
  95. package/lib/utils/number.js.map +1 -1
  96. package/package.json +46 -49
  97. package/src/component/axis.ts +1 -5
  98. package/src/component/index.ts +0 -1
  99. package/src/component/legendContinuous.ts +1 -1
  100. package/src/coordinate/index.ts +0 -2
  101. package/src/exports.ts +16 -2
  102. package/src/index.ts +2 -2
  103. package/src/lib/index.ts +0 -1
  104. package/src/mark/index.ts +0 -3
  105. package/src/mark/liquid.ts +2 -1
  106. package/src/runtime/component.ts +1 -4
  107. package/src/runtime/types/component.ts +2 -9
  108. package/src/shape/index.ts +0 -4
  109. package/src/spec/coordinate.ts +0 -5
  110. package/src/spec/mark.ts +0 -3
  111. package/src/transform/filter.ts +3 -1
  112. package/src/transform/maybeTitle.ts +8 -1
  113. package/src/utils/dateFormat.ts +22 -0
  114. package/src/utils/number.ts +8 -0
  115. package/CHANGELOG.md +0 -429
  116. package/esm/component/axisZ.d.ts +0 -8
  117. package/esm/component/axisZ.js +0 -14
  118. package/esm/component/axisZ.js.map +0 -1
  119. package/esm/coordinate/cartesian3D.d.ts +0 -7
  120. package/esm/coordinate/cartesian3D.js +0 -6
  121. package/esm/coordinate/cartesian3D.js.map +0 -1
  122. package/esm/lib/threed.d.ts +0 -7
  123. package/esm/lib/threed.js +0 -13
  124. package/esm/lib/threed.js.map +0 -1
  125. package/esm/mark/interval3D.d.ts +0 -8
  126. package/esm/mark/interval3D.js +0 -65
  127. package/esm/mark/interval3D.js.map +0 -1
  128. package/esm/mark/line3D.d.ts +0 -7
  129. package/esm/mark/line3D.js +0 -65
  130. package/esm/mark/line3D.js.map +0 -1
  131. package/esm/mark/point3D.d.ts +0 -9
  132. package/esm/mark/point3D.js +0 -76
  133. package/esm/mark/point3D.js.map +0 -1
  134. package/esm/shape/interval3D/cube.d.ts +0 -6
  135. package/esm/shape/interval3D/cube.js +0 -71
  136. package/esm/shape/interval3D/cube.js.map +0 -1
  137. package/esm/shape/line3D/line.d.ts +0 -3
  138. package/esm/shape/line3D/line.js +0 -30
  139. package/esm/shape/line3D/line.js.map +0 -1
  140. package/esm/shape/point3D/cube.d.ts +0 -6
  141. package/esm/shape/point3D/cube.js +0 -70
  142. package/esm/shape/point3D/cube.js.map +0 -1
  143. package/esm/shape/point3D/sphere.d.ts +0 -6
  144. package/esm/shape/point3D/sphere.js +0 -70
  145. package/esm/shape/point3D/sphere.js.map +0 -1
  146. package/lib/component/axisZ.d.ts +0 -8
  147. package/lib/component/axisZ.js +0 -19
  148. package/lib/component/axisZ.js.map +0 -1
  149. package/lib/coordinate/cartesian3D.d.ts +0 -7
  150. package/lib/coordinate/cartesian3D.js +0 -10
  151. package/lib/coordinate/cartesian3D.js.map +0 -1
  152. package/lib/lib/threed.d.ts +0 -7
  153. package/lib/lib/threed.js +0 -17
  154. package/lib/lib/threed.js.map +0 -1
  155. package/lib/mark/interval3D.d.ts +0 -8
  156. package/lib/mark/interval3D.js +0 -69
  157. package/lib/mark/interval3D.js.map +0 -1
  158. package/lib/mark/line3D.d.ts +0 -7
  159. package/lib/mark/line3D.js +0 -69
  160. package/lib/mark/line3D.js.map +0 -1
  161. package/lib/mark/point3D.d.ts +0 -9
  162. package/lib/mark/point3D.js +0 -80
  163. package/lib/mark/point3D.js.map +0 -1
  164. package/lib/shape/interval3D/cube.d.ts +0 -6
  165. package/lib/shape/interval3D/cube.js +0 -75
  166. package/lib/shape/interval3D/cube.js.map +0 -1
  167. package/lib/shape/line3D/line.d.ts +0 -3
  168. package/lib/shape/line3D/line.js +0 -34
  169. package/lib/shape/line3D/line.js.map +0 -1
  170. package/lib/shape/point3D/cube.d.ts +0 -6
  171. package/lib/shape/point3D/cube.js +0 -74
  172. package/lib/shape/point3D/cube.js.map +0 -1
  173. package/lib/shape/point3D/sphere.d.ts +0 -6
  174. package/lib/shape/point3D/sphere.js +0 -74
  175. package/lib/shape/point3D/sphere.js.map +0 -1
  176. package/src/component/axisZ.ts +0 -25
  177. package/src/coordinate/cartesian3D.ts +0 -11
  178. package/src/lib/threed.ts +0 -13
  179. package/src/mark/interval3D.ts +0 -100
  180. package/src/mark/line3D.ts +0 -81
  181. package/src/mark/point3D.ts +0 -90
  182. package/src/shape/interval3D/cube.ts +0 -69
  183. package/src/shape/line3D/line.ts +0 -29
  184. package/src/shape/point3D/cube.ts +0 -68
  185. package/src/shape/point3D/sphere.ts +0 -68
@@ -1,81 +0,0 @@
1
- import { group } from 'd3-array';
2
- import { Mark, MarkComponent as MC, SingleMark, Vector3 } from '../runtime';
3
- import { LineMark } from '../spec';
4
- import { Line3DShape } from '../shape';
5
- import { MaybeSeries } from '../transform';
6
- import {
7
- baseGeometryChannels,
8
- basePostInference,
9
- basePreInference,
10
- tooltip3d,
11
- } from './utils';
12
-
13
- const shape = {
14
- line: Line3DShape,
15
- };
16
-
17
- export type LineOptions = Omit<LineMark, 'type'>;
18
-
19
- const line: Mark = (index, scale, value, coordinate) => {
20
- const { series: S, x: X, y: Y, z: Z } = value;
21
- const { x, y, z } = scale;
22
-
23
- // Because x and y channel is not strictly required in Line.props,
24
- // it should throw error with empty x, y or z channels.
25
- if (X === undefined || Y === undefined || Z === undefined) {
26
- throw new Error('Missing encode for x, y or z channel.');
27
- }
28
-
29
- // Group data into series.
30
- // There is only one series without specified series encode.
31
- const series = S ? Array.from(group(index, (i) => S[i]).values()) : [index];
32
- const I = series.map((group) => group[0]).filter((i) => i !== undefined);
33
-
34
- // A group of data corresponds to one line.
35
- const xoffset = (x?.getBandWidth?.() || 0) / 2;
36
- const yoffset = (y?.getBandWidth?.() || 0) / 2;
37
- const zoffset = (z?.getBandWidth?.() || 0) / 2;
38
- const P = Array.from(series, (I) => {
39
- return I.map((i) =>
40
- coordinate.map([
41
- (+X[i] || 0) + xoffset,
42
- (+Y[i] || 0) + yoffset,
43
- (+Z[i] || 0) + zoffset,
44
- ]),
45
- ) as Vector3[];
46
- });
47
- return [I, P, series];
48
- };
49
-
50
- /**
51
- * Convert value for each channel to line shapes.
52
- */
53
- export const Line3D: MC<LineOptions> = () => {
54
- return (index, scale, value, coordinate) => {
55
- const mark = line;
56
- return (mark as SingleMark)(index, scale, value, coordinate);
57
- };
58
- };
59
-
60
- Line3D.props = {
61
- defaultShape: 'line',
62
- defaultLabelShape: 'label',
63
- composite: false,
64
- shape,
65
- channels: [
66
- ...baseGeometryChannels({ shapes: Object.keys(shape) }),
67
- { name: 'x' },
68
- { name: 'y' },
69
- { name: 'z' },
70
- { name: 'position', independent: true },
71
- { name: 'size' },
72
- { name: 'series', scale: 'identity' },
73
- ],
74
- preInference: [...basePreInference(), { type: MaybeSeries }],
75
- postInference: [...basePostInference(), ...tooltip3d()],
76
- interaction: {
77
- shareTooltip: false,
78
- seriesTooltip: false,
79
- crosshairs: false,
80
- },
81
- };
@@ -1,90 +0,0 @@
1
- import { Coordinate3D } from '@antv/coord';
2
- import { MarkComponent as MC, Vector3 } from '../runtime';
3
- import { PointMark } from '../spec';
4
- import { MaybeZeroX, MaybeZeroY, MaybeZeroZ, MaybeSize } from '../transform';
5
- import { Sphere, Cube } from '../shape';
6
- import {
7
- baseGeometryChannels,
8
- basePostInference,
9
- basePreInference,
10
- tooltip3d,
11
- } from './utils';
12
-
13
- export type PointOptions = Omit<PointMark, 'type'>;
14
-
15
- /**
16
- * Convert value for each channel to point shapes.
17
- * Calc the bbox of each point based on x, y and r.
18
- * This is for allowing their radius can be affected by coordinate(e.g. fisheye).
19
- */
20
- export const Point3D: MC<PointOptions> = (options) => {
21
- return (index, _, value, coordinate) => {
22
- const { x: X, y: Y, z: Z, size: S, dx: DX, dy: DY, dz: DZ } = value;
23
- const [width, height, depth] = (
24
- coordinate as unknown as Coordinate3D
25
- ).getSize();
26
- const xyz: (i: number) => Vector3 = (i) => {
27
- const dx = +(DX?.[i] || 0);
28
- const dy = +(DY?.[i] || 0);
29
- const dz = +(DZ?.[i] || 0);
30
- const x = +X[i];
31
- const y = +Y[i];
32
- const z = +Z[i];
33
- const cx = x + dx;
34
- const cy = y + dy;
35
- const cz = z + dz;
36
- return [cx, cy, cz];
37
- };
38
- const P = S
39
- ? Array.from(index, (i) => {
40
- const [cx, cy, cz] = xyz(i);
41
- const r = +S[i];
42
- const a = r / width;
43
- const b = r / height;
44
- const c = r / depth;
45
- const p1: Vector3 = [cx - a, cy - b, cz - c];
46
- const p2: Vector3 = [cx + a, cy + b, cz + c];
47
- return [
48
- (coordinate as unknown as Coordinate3D).map([...p1, cz]),
49
- (coordinate as unknown as Coordinate3D).map([...p2, cz]),
50
- ] as Vector3[];
51
- })
52
- : Array.from(index, (i) => {
53
- const [cx, cy, cz] = xyz(i);
54
- return [
55
- (coordinate as unknown as Coordinate3D).map([cx, cy, cz]),
56
- ] as Vector3[];
57
- });
58
- return [index, P];
59
- };
60
- };
61
-
62
- const shape = {
63
- sphere: Sphere,
64
- cube: Cube,
65
- };
66
-
67
- Point3D.props = {
68
- defaultShape: 'cube',
69
- defaultLabelShape: 'label',
70
- composite: false,
71
- shape,
72
- channels: [
73
- ...baseGeometryChannels({ shapes: Object.keys(shape) }),
74
- { name: 'x', required: true },
75
- { name: 'y', required: true },
76
- { name: 'z', required: true },
77
- { name: 'series', scale: 'band' },
78
- { name: 'size', quantitative: 'sqrt' },
79
- { name: 'dx', scale: 'identity' },
80
- { name: 'dy', scale: 'identity' },
81
- { name: 'dz', scale: 'identity' },
82
- ],
83
- preInference: [
84
- ...basePreInference(),
85
- { type: MaybeZeroX },
86
- { type: MaybeZeroY },
87
- { type: MaybeZeroZ },
88
- ],
89
- postInference: [...basePostInference(), { type: MaybeSize }, ...tooltip3d()],
90
- };
@@ -1,69 +0,0 @@
1
- import { MeshLambertMaterial, CubeGeometry, Mesh } from '@antv/g-plugin-3d';
2
- import { applyStyle, getOrigin, toOpacityKey } from '../utils';
3
- import { ShapeComponent as SC, Vector3 } from '../../runtime';
4
- import { select } from '../../utils/selection';
5
-
6
- export type CubeOptions = Record<string, any>;
7
-
8
- /**
9
- * @see https://g.antv.antgroup.com/api/3d/geometry#cubegeometry
10
- */
11
- export const Cube: SC<CubeOptions> = (options, context) => {
12
- // Render border only when colorAttribute is stroke.
13
- const { ...style } = options;
14
-
15
- // @ts-ignore
16
- if (!context.cubeGeometry) {
17
- const renderer = context.canvas.getConfig().renderer;
18
- const plugin = renderer.getPlugin('device-renderer');
19
- const device = plugin.getDevice();
20
- // create a cube geometry
21
- // @ts-ignore
22
- context.cubeGeometry = new CubeGeometry(device, {
23
- width: 1,
24
- height: 1,
25
- depth: 1,
26
- });
27
- // create a material with Lambert lighting model
28
- // @ts-ignore
29
- context.cubeMaterial = new MeshLambertMaterial(device);
30
- }
31
-
32
- return (_points, value, defaults) => {
33
- const points = _points as unknown as Vector3[];
34
- const { color: defaultColor } = defaults;
35
- const { color = defaultColor, transform, opacity } = value;
36
- const [cx, cy, cz] = getOrigin(points);
37
-
38
- const width = Math.abs(points[1][0] - points[0][0]);
39
- const height = Math.abs(points[1][1] - points[0][1]);
40
- const depth = Math.abs(points[1][2] - points[0][2]);
41
-
42
- const cube = new Mesh({
43
- style: {
44
- x: cx,
45
- y: cy,
46
- z: cz,
47
- // @ts-ignore
48
- geometry: context.cubeGeometry,
49
- // @ts-ignore
50
- material: context.cubeMaterial,
51
- },
52
- });
53
- cube.setOrigin(0, 0, 0);
54
- cube.scale([width, height, depth]);
55
-
56
- const selection = select(cube)
57
- .call(applyStyle, defaults)
58
- .style('fill', color)
59
- .style('transform', transform)
60
- .style(toOpacityKey(options), opacity)
61
- .call(applyStyle, style)
62
- .node();
63
- return selection;
64
- };
65
- };
66
-
67
- Cube.props = {
68
- defaultMarker: 'cube',
69
- };
@@ -1,29 +0,0 @@
1
- import { Polyline } from '@antv/g';
2
- import { applyStyle } from '../utils';
3
- import { ShapeComponent as SC } from '../../runtime';
4
- import { select } from '../../utils/selection';
5
-
6
- export type LineOptions = Record<string, any>;
7
-
8
- export const Line: SC<LineOptions> = (options, context) => {
9
- return (P, value, defaults) => {
10
- const { color: defaultColor, lineWidth: defaultSize, ...rest } = defaults;
11
- const { color = defaultColor, size = defaultSize } = value;
12
- const stroke = color;
13
- const finalStyle = {
14
- isBillboard: true,
15
- ...rest,
16
- ...(stroke && { stroke }),
17
- ...(size && { lineWidth: size }),
18
- };
19
-
20
- return select(new Polyline())
21
- .style('points', P)
22
- .call(applyStyle, finalStyle)
23
- .node();
24
- };
25
- };
26
-
27
- Line.props = {
28
- defaultMarker: 'line',
29
- };
@@ -1,68 +0,0 @@
1
- import { MeshLambertMaterial, CubeGeometry, Mesh } from '@antv/g-plugin-3d';
2
- import { applyStyle, getOrigin, toOpacityKey } from '../utils';
3
- import { ShapeComponent as SC } from '../../runtime';
4
- import { select } from '../../utils/selection';
5
-
6
- const GEOMETRY_SIZE = 5;
7
-
8
- export type CubeOptions = Record<string, any>;
9
-
10
- /**
11
- * @see https://g.antv.antgroup.com/api/3d/geometry#cubegeometry
12
- */
13
- export const Cube: SC<CubeOptions> = (options, context) => {
14
- // Render border only when colorAttribute is stroke.
15
- const { ...style } = options;
16
-
17
- // @ts-ignore
18
- if (!context.cubeGeometry) {
19
- const renderer = context.canvas.getConfig().renderer;
20
- const plugin = renderer.getPlugin('device-renderer');
21
- const device = plugin.getDevice();
22
- // create a sphere geometry
23
- // @ts-ignore
24
- context.cubeGeometry = new CubeGeometry(device, {
25
- width: GEOMETRY_SIZE * 2,
26
- height: GEOMETRY_SIZE * 2,
27
- depth: GEOMETRY_SIZE * 2,
28
- });
29
- // create a material with Phong lighting model
30
- // @ts-ignore
31
- context.cubeMaterial = new MeshLambertMaterial(device);
32
- }
33
-
34
- return (points, value, defaults) => {
35
- const { color: defaultColor } = defaults;
36
- const { color = defaultColor, transform, opacity } = value;
37
- const [cx, cy, cz] = getOrigin(points);
38
- const r = value.size;
39
- const finalRadius = r || style.r || defaults.r;
40
-
41
- const cube = new Mesh({
42
- style: {
43
- x: cx,
44
- y: cy,
45
- z: cz,
46
- // @ts-ignore
47
- geometry: context.cubeGeometry,
48
- // @ts-ignore
49
- material: context.cubeMaterial,
50
- },
51
- });
52
- cube.setOrigin(0, 0, 0);
53
- const scaling = finalRadius / GEOMETRY_SIZE;
54
- cube.scale(scaling);
55
-
56
- return select(cube)
57
- .call(applyStyle, defaults)
58
- .style('fill', color)
59
- .style('transform', transform)
60
- .style(toOpacityKey(options), opacity)
61
- .call(applyStyle, style)
62
- .node();
63
- };
64
- };
65
-
66
- Cube.props = {
67
- defaultMarker: 'cube',
68
- };
@@ -1,68 +0,0 @@
1
- import { MeshLambertMaterial, SphereGeometry, Mesh } from '@antv/g-plugin-3d';
2
- import { applyStyle, getOrigin, toOpacityKey } from '../utils';
3
- import { ShapeComponent as SC } from '../../runtime';
4
- import { select } from '../../utils/selection';
5
-
6
- export type SphereOptions = Record<string, any>;
7
-
8
- const GEOMETRY_SIZE = 5;
9
-
10
- /**
11
- * @see https://g.antv.antgroup.com/api/3d/geometry#spheregeometry
12
- */
13
- export const Sphere: SC<SphereOptions> = (options, context) => {
14
- // Render border only when colorAttribute is stroke.
15
- const { ...style } = options;
16
-
17
- // @ts-ignore
18
- if (!context.sphereGeometry) {
19
- const renderer = context.canvas.getConfig().renderer;
20
- const plugin = renderer.getPlugin('device-renderer');
21
- const device = plugin.getDevice();
22
- // create a sphere geometry
23
- // @ts-ignore
24
- context.sphereGeometry = new SphereGeometry(device, {
25
- radius: GEOMETRY_SIZE,
26
- latitudeBands: 32,
27
- longitudeBands: 32,
28
- });
29
- // create a material with Phong lighting model
30
- // @ts-ignore
31
- context.sphereMaterial = new MeshLambertMaterial(device);
32
- }
33
-
34
- return (points, value, defaults) => {
35
- const { color: defaultColor } = defaults;
36
- const { color = defaultColor, transform, opacity } = value;
37
- const [cx, cy, cz] = getOrigin(points);
38
- const r = value.size;
39
- const finalRadius = r || style.r || defaults.r;
40
-
41
- const sphere = new Mesh({
42
- style: {
43
- x: cx,
44
- y: cy,
45
- z: cz,
46
- // @ts-ignore
47
- geometry: context.sphereGeometry,
48
- // @ts-ignore
49
- material: context.sphereMaterial,
50
- },
51
- });
52
- sphere.setOrigin(0, 0, 0);
53
- const scaling = finalRadius / GEOMETRY_SIZE;
54
- sphere.scale(scaling);
55
-
56
- return select(sphere)
57
- .call(applyStyle, defaults)
58
- .style('fill', color)
59
- .style('transform', transform)
60
- .style(toOpacityKey(options), opacity)
61
- .call(applyStyle, style)
62
- .node();
63
- };
64
- };
65
-
66
- Sphere.props = {
67
- defaultMarker: 'sphere',
68
- };