Giter Site home page Giter Site logo

Support Canvas. about d3-hexbin HOT 2 OPEN

d3 avatar d3 commented on May 1, 2024
Support Canvas.

from d3-hexbin.

Comments (2)

 avatar commented on May 1, 2024

Sorry for the delay in replying to this pull request.

Here's what I think so far (subject to major revisions):

  • Should hexbin.hexagon implement the symbol type interface? -- I don't think so since I can't imagine a situation where it would be useful in an ordinal scale like all the other symbols (if there is such a use case, let me know). As you mentioned above, converting from a size to radius might require some arithmetic that could get tricky.
  • Should the hexagon method take a context? -- I'm not sure exactly what this question means, could you please clarify?
  • Should the hexbin take a context? And then render like a shape? -- I feel the answers to these are yes and yes in order to maintain maximum compatibility with d3-shape as well as allow rendering to either SVG or Canvas web interfaces.

Would love to hear your thoughts. Also, I may be wrong on any/all of this, so please feel free to correct any errors.

from d3-hexbin.

syntagmatic avatar syntagmatic commented on May 1, 2024

A v3 version of d3-hexbin that takes a Canvas context here: http://bl.ocks.org/syntagmatic/002ef2fb5c1dc2df5821

My opinion is d3-hexbin shouldn't deal directly with Canvas or SVG path strings. It should output arrays of coordinates. Turning that array into a path string or a Canvas subroutine should be a convenience method or a separate utility like d3-path.

But practically since the plugin already supported SVG, adding a convenient way to render to Canvas instead would be nice. In this case, the API should be similar to d3.geoPath. A method to access the raw coordinates would still be useful.

from d3-hexbin.

Related Issues (17)

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.