GithubHelp home page GithubHelp logo

gswp5.js-code's Introduction

gswp5.js-code

gswp5.js code examples

gswp5.js-code's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gswp5.js-code's Issues

Bug in Ex_12_03.js 29,740 Cities Code

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);
}

Missing media files

The following files are missing in the media folder:

  • SourceCodePro-Regular.ttf which is used in Ex_07_11.js
  • robot3.svg which is used in Robot05_Media.js
  • alpine.png which is used in Robot05_Media.js
  • ortiz.csv which is used in Ex_12_01.js
  • cities.csv which is used in Ex_12_03.js
  • film.json which is used in Ex_12_04.js
  • films.json which is used in Ex_12_05.js
  • cincinnati.json which is used in Ex_12_06.js
  • blip.wav which is used in Ex_13_01.js

Data examples issue

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

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.