@@ -211,11 +211,6 @@ class Voronoi extends Mark {
211211 }
212212}
213213
214- function voronoiof ( delaunay , dimensions ) {
215- const { width, height, marginTop, marginRight, marginBottom, marginLeft} = dimensions ;
216- return delaunay . voronoi ( [ marginLeft , marginTop , width - marginRight , height - marginBottom ] ) ;
217- }
218-
219214class VoronoiMesh extends DelaunayMesh {
220215 constructor ( data , options ) {
221216 super ( data , options , voronoiMeshDefaults ) ;
@@ -225,7 +220,12 @@ class VoronoiMesh extends DelaunayMesh {
225220 }
226221}
227222
228- export function delaunayMark ( DelaunayMark , data , { x, y, ...options } = { } ) {
223+ function voronoiof ( delaunay , dimensions ) {
224+ const { width, height, marginTop, marginRight, marginBottom, marginLeft} = dimensions ;
225+ return delaunay . voronoi ( [ marginLeft , marginTop , width - marginRight , height - marginBottom ] ) ;
226+ }
227+
228+ function delaunayMark ( DelaunayMark , data , { x, y, ...options } = { } ) {
229229 ( [ x , y ] = maybeTuple ( x , y ) ) ;
230230 return new DelaunayMark ( data , { ...options , x, y} ) ;
231231}
@@ -242,7 +242,6 @@ export function hull(data, options) {
242242 return delaunayMark ( Hull , data , options ) ;
243243}
244244
245- // TODO voronoiX, voronoiY?
246245export function voronoi ( data , options ) {
247246 return delaunayMark ( Voronoi , data , options ) ;
248247}
0 commit comments