(site) Fix incorrect plugins in quake example
This commit is contained in:
parent
19ed44d67b
commit
1764ee07f7
@ -191,16 +191,20 @@
|
|||||||
// Plugin to resize the canvas to fill the window and to
|
// Plugin to resize the canvas to fill the window and to
|
||||||
// automatically center the planet when the window size changes
|
// automatically center the planet when the window size changes
|
||||||
function autocenter(options) {
|
function autocenter(options) {
|
||||||
|
options = options || {};
|
||||||
var needsCentering = false;
|
var needsCentering = false;
|
||||||
|
var globe = null;
|
||||||
|
|
||||||
var resize = function() {
|
var resize = function() {
|
||||||
var width = window.innerWidth + (options.extraWidth || 0);
|
var width = window.innerWidth + (options.extraWidth || 0);
|
||||||
var height = window.innerHeight + (options.extraHeight || 0);
|
var height = window.innerHeight + (options.extraHeight || 0);
|
||||||
planet.canvas.width = width;
|
globe.canvas.width = width;
|
||||||
planet.canvas.height = height;
|
globe.canvas.height = height;
|
||||||
planet.projection.translate([width / 2, height / 2]);
|
globe.projection.translate([width / 2, height / 2]);
|
||||||
};
|
};
|
||||||
|
|
||||||
return function(planet) {
|
return function(planet) {
|
||||||
|
globe = planet;
|
||||||
planet.onInit(function() {
|
planet.onInit(function() {
|
||||||
needsCentering = true;
|
needsCentering = true;
|
||||||
d3.select(window).on('resize', function() {
|
d3.select(window).on('resize', function() {
|
||||||
@ -217,6 +221,7 @@
|
|||||||
// Plugin to automatically scale the planet's projection based
|
// Plugin to automatically scale the planet's projection based
|
||||||
// on the window size when the planet is initialized
|
// on the window size when the planet is initialized
|
||||||
function autoscale(options) {
|
function autoscale(options) {
|
||||||
|
options = options || {};
|
||||||
return function(planet) {
|
return function(planet) {
|
||||||
planet.onInit(function() {
|
planet.onInit(function() {
|
||||||
var width = window.innerWidth + (options.extraWidth || 0);
|
var width = window.innerWidth + (options.extraWidth || 0);
|
||||||
|
|||||||
@ -161,16 +161,20 @@
|
|||||||
// Plugin to resize the canvas to fill the window and to
|
// Plugin to resize the canvas to fill the window and to
|
||||||
// automatically center the planet when the window size changes
|
// automatically center the planet when the window size changes
|
||||||
function autocenter(options) {
|
function autocenter(options) {
|
||||||
|
options = options || {};
|
||||||
var needsCentering = false;
|
var needsCentering = false;
|
||||||
|
var globe = null;
|
||||||
|
|
||||||
var resize = function() {
|
var resize = function() {
|
||||||
var width = window.innerWidth + (options.extraWidth || 0);
|
var width = window.innerWidth + (options.extraWidth || 0);
|
||||||
var height = window.innerHeight + (options.extraHeight || 0);
|
var height = window.innerHeight + (options.extraHeight || 0);
|
||||||
planet.canvas.width = width;
|
globe.canvas.width = width;
|
||||||
planet.canvas.height = height;
|
globe.canvas.height = height;
|
||||||
planet.projection.translate([width / 2, height / 2]);
|
globe.projection.translate([width / 2, height / 2]);
|
||||||
};
|
};
|
||||||
|
|
||||||
return function(planet) {
|
return function(planet) {
|
||||||
|
globe = planet;
|
||||||
planet.onInit(function() {
|
planet.onInit(function() {
|
||||||
needsCentering = true;
|
needsCentering = true;
|
||||||
d3.select(window).on('resize', function() {
|
d3.select(window).on('resize', function() {
|
||||||
@ -187,6 +191,7 @@
|
|||||||
// Plugin to automatically scale the planet's projection based
|
// Plugin to automatically scale the planet's projection based
|
||||||
// on the window size when the planet is initialized
|
// on the window size when the planet is initialized
|
||||||
function autoscale(options) {
|
function autoscale(options) {
|
||||||
|
options = options || {};
|
||||||
return function(planet) {
|
return function(planet) {
|
||||||
planet.onInit(function() {
|
planet.onInit(function() {
|
||||||
var width = window.innerWidth + (options.extraWidth || 0);
|
var width = window.innerWidth + (options.extraWidth || 0);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user