{"action":"created","issue":{"url":"https://api.github.com/repos/d3/d3-delaunay/issues/27","repository_url":"https://api.github.com/repos/d3/d3-delaunay","labels_url":"https://api.github.com/repos/d3/d3-delaunay/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/d3/d3-delaunay/issues/27/comments","events_url":"https://api.github.com/repos/d3/d3-delaunay/issues/27/events","html_url":"https://github.com/d3/d3-delaunay/issues/27","id":308085178,"number":27,"title":"Support flat array input format.","user":{"login":"mbostock","id":230541,"avatar_url":"https://avatars2.githubusercontent.com/u/230541?v=4","gravatar_id":"","url":"https://api.github.com/users/mbostock","html_url":"https://github.com/mbostock","followers_url":"https://api.github.com/users/mbostock/followers","following_url":"https://api.github.com/users/mbostock/following{/other_user}","gists_url":"https://api.github.com/users/mbostock/gists{/gist_id}","starred_url":"https://api.github.com/users/mbostock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbostock/subscriptions","organizations_url":"https://api.github.com/users/mbostock/orgs","repos_url":"https://api.github.com/users/mbostock/repos","events_url":"https://api.github.com/users/mbostock/events{/privacy}","received_events_url":"https://api.github.com/users/mbostock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-23T15:55:38Z","updated_at":"2018-03-23T16:28:47Z","closed_at":null,"author_association":"OWNER","body":"Now that mapbox/delaunator#17 is fixed, we should support the same API for the Delaunay constructor. Or, if we want to retain the current private copy constructor API, we’d need to expose a new factory method. Delaunay.of(*array*) comes to mind, but that seems like a bad idea—that should be reserved for Delaunay.of(*…values*) for consistency with Array.of. So some options:\r\n\r\n1. Remove the copy constructor and just do new Delaunay(*array*). Pros: simple. Cons: copying a Delaunay instance would then require Object.create, but I don’t really anticipate this being a common pattern anyway; requires the `new` operator.\r\n\r\n2. Rename Delaunay.from to Delaunay.fromPoints and introduce a new Delaunay.from that takes the flat array. Pros: retains copy constructor. Cons: confusing terminology, as both constructors accept “points”.\r\n\r\n3. Add Delaunay.fromFlat(*array*), and keep existing constructor and Delaunay.from. Pros: does everything. Cons: fromFlat is the ugliest name for the use case we want to encourage.\r\n\r\n4. Detect in Delaunay.from whether the given *array* is flat or not. Pros: “just works”. Cons: sometimes it doesn’t, and overloading by type is icky.\r\n\r\nFeels like the first option is the “obvious” choice, but wanted to consider the others."},"comment":{"url":"https://api.github.com/repos/d3/d3-delaunay/issues/comments/375723103","html_url":"https://github.com/d3/d3-delaunay/issues/27#issuecomment-375723103","issue_url":"https://api.github.com/repos/d3/d3-delaunay/issues/27","id":375723103,"user":{"login":"mourner","id":25395,"avatar_url":"https://avatars1.githubusercontent.com/u/25395?v=4","gravatar_id":"","url":"https://api.github.com/users/mourner","html_url":"https://github.com/mourner","followers_url":"https://api.github.com/users/mourner/followers","following_url":"https://api.github.com/users/mourner/following{/other_user}","gists_url":"https://api.github.com/users/mourner/gists{/gist_id}","starred_url":"https://api.github.com/users/mourner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mourner/subscriptions","organizations_url":"https://api.github.com/users/mourner/orgs","repos_url":"https://api.github.com/users/mourner/repos","events_url":"https://api.github.com/users/mourner/events{/privacy}","received_events_url":"https://api.github.com/users/mourner/received_events","type":"User","site_admin":false},"created_at":"2018-03-23T16:28:47Z","updated_at":"2018-03-23T16:28:47Z","author_association":"CONTRIBUTOR","body":"How about ditching the private copy constructor and simply exposing the original Delaunator class with an augmented prototype (adding methods like `voronoi`)?"}}
{"actor":{"display_login":"mourner"}}