według biblioteki d3-hexbin.js wywołując funkcje centers(); jest zwracana tablica z środkami pól hexagonów.
Mój kod
Kod
// Tworzenie siatki hexagonów
var hexLayout = d3_hexbin();
this._hexLayout = hexLayout
.radius(this.options.radius)
.x(function(d) { return d.point[0]; })
.y(function(d) { return d.point[1]; });
// Inicjalizacja danych
this._data = [];
var tab = [];
tab = hexLayout.centers();
var hexLayout = d3_hexbin();
this._hexLayout = hexLayout
.radius(this.options.radius)
.x(function(d) { return d.point[0]; })
.y(function(d) { return d.point[1]; });
// Inicjalizacja danych
this._data = [];
var tab = [];
tab = hexLayout.centers();
Może miał ktoś styczność z tą biblioteką ? Link do niej https://github.com/d3/d3-hexbin
Z kodu powyżej funkcja zwraca mi tylko [0,0].