gswp5.js code examples
lmccart / gswp5.js-code Goto Github PK
View Code? Open in Web Editor NEWgswp5.js code examples
gswp5.js code examples
Not sure if this is a bug in the code, or if it is how the current version of P5.js is working. Took me awhile to get the 29,740 Ciites code to work. I put a push() after line 14 and a pop() after line 22. Here is the code that works...
var cities;
function preload() {
cities = loadTable("cities.csv", "header");
}
function setup() {
createCanvas(480, 240);
fill(255, 150);
noStroke();
}
function draw() {
background(0);
push();
var xoffset = map(mouseX, 0, width, -width*3, -width);
translate(xoffset, -600);
scale(10);
for (var i = 0; i < cities.getRowCount(); i++) {
var latitude = cities.getNum(i, "lat");
var longitude = cities.getNum(i, "lng");
setXY(latitude, longitude);
}
pop();
}
function setXY(lat, lng) {
var x = map(lng, -180, 180, 0, width);
var y = map(lat, 90, -90, 0, height);
ellipse(x, y, 0.25, 0.25);
}
The following files are missing in the media folder:
In a film JSON example 12.5 in a for loops you're trying to find length of film variable which is objects with film.length method, and because of that whole script it's not working. To make example work the length of film object should be found by using this method: Object.keys(film).length
And another issue is in the example 12.4. Script is not working until you specify which element of film object you wanna print i.e. instead of var title = film.title; it should be ... = film[0].title;
and to print information about all the films there should be a loop
where is it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.