Giter Club home page Giter Club logo

Comments (4)

Fil avatar Fil commented on May 14, 2024

We don't want to export all because it would be a mess to document, but we can think of a lighter call that returns the triangulation only. Maybe call it geoTriangulation, and it returns {delaunay, triangles, edges, find, neighbors }? It would also bring more performance to the geoContours I believe?

If you want to build a pull-request, please make it against #35 (I plan to merge it in main very soon).

from d3-geo-voronoi.

nemo9955 avatar nemo9955 commented on May 14, 2024

Feel like geoTriangulation would solve my problem specifically, not verry flexible if people want other parts extracted.

How about an optional parameter to existing geoDelaunay and geoVoronoi with a map string:bool which parameters to be computed ?
Or what would be the issue in exporting functions and documenting then in a bunch as Base functionality functions, for advanced use if needed. ?

from d3-geo-voronoi.

Fil avatar Fil commented on May 14, 2024

The issue is maintenance. If you want to take the code and do what you want with it, no problem, but if we offer an API it must (ideally!) be documented, tested and maintained.

It would be nice to see which of the functions really consume CPU. I would understand that computing all the circumcenters or the polygons is expensive, so it makes sense to stop before that.

Another approach maybe would be to rewrite all the methods as lazy functions that start computations only when needed. But I'm afraid it would introduce yet another API. This module already has 2, which is 1 too many :)

from d3-geo-voronoi.

nemo9955 avatar nemo9955 commented on May 14, 2024

Understandable about the maintenance issue, but the functions already exist and are part of main objects, so should already be tested and maintained indirectly.
And regarding documentation, they sort of are already, but it's not the function being documented, but it's return.

Maybe issue with 2 modules is that this lib should have as "convenience" functions just geoVoronoi and geoContour.
geoDelaunay be provided as the base functions of the library .
This way, people that rely on existing geoDelaunay can just implement it with 14-26 lines of code, using the base functions, if it becomes "deprecated".

As a tangent, for lots of points geoVoronoi is slow considering the preparation of the arrays beforehand, geoDelaunay is faster as it uses more direct array, could be faster with #7 (could be used with THREE.js *BufferAttribute ), but that is another discussion.

from d3-geo-voronoi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.