23/03/2018 - Big data analisys - Introduction to Final project
Hello,
In the previous lectures, we have been briefed about our final project and taught how to link an API and Json files to a code in JS.
We need to create an artistically interesting piece that uses live data.
We are thinking about using the Cryptocurrencies API to show how the market varies, portraying the 5 biggest Cryptos as bubbles, and make their dimension to change based on that or based on historical data. So we made our first experiment with Json files around the Final assignment.
For now, I coded this:
The ellipses are already linked to the API and already represent the 5 main cryptos: Bitcoin, Ethereoum, Ripple, Bitcoin Cash and Lite coin. (The code is at the end of the page)
We also had a reading to do, as usual, and I found very interesting this bit:
' In a popular book on the history of software, one of the developers of FORTRAN is characterized as “an extraordinary programmer who could ‘execute’ a program in his head, as a machine would, and then write error-free code with remarkable frequency.” [7] Actually, all programmers must do this to some extent, using some internal model of what code will do. Just as understanding what a program does, and why, is critical on a practical level for the programmer, it is important to the aesthetics of code as well. Because code functions, “the aesthetic value of code lies in its execution, not simply its written form. To appreciate it fully we need to 'see' the code to fully grasp what it is we are experiencing and to build an understanding of the code's actions.” '
from A Box, Darkly: Obfuscation, Weird Languages, and Code Aesthetics by Michael Mateas and Nick Montfort.
To my understanding, it states that all humans are capable to mentally execute a program, to some extent, but, because we are humans, we do also have to see what the code represents to really grasp its aesthetics.
I could also add that the real beauty is to be able to get the aesthetics of a certain thing, and this is something that computers have still to learn.
Ciaoo,
Eleonora
Code following:
var myCrypto;
var marketcapBTC;
var marketcapETH;
var marketcapXRP;
var marketcapBCH;
var marketcapLTC;
function setup() {
createCanvas(400, 400);
loadJSON('https://api.coinmarketcap.com/v1/ticker/?convert=EUR&limit=10', gotData);
}
function gotData(data) {
//println(data);
myCrypto = data;
if (myCrypto){
marketcapBTC = myCrypto[0].market_cap_usd;
console.log(marketcapBTC);
marketcapETH = myCrypto[1].market_cap_usd;
console.log(marketcapETH);
marketcapXRP = myCrypto[2].market_cap_usd;
console.log(marketcapXRP);
marketcapBCH = myCrypto[3].market_cap_usd;
console.log(marketcapBCH);
marketcapLTC = myCrypto[4].market_cap_usd;
console.log(marketcapLTC);
}
}
function draw() {
background(204, 120);
fill(0);
// console.log(crypto);
// textSize(32);
// text(crypto[0].id, width/2,height/2);
ellipse(100, 100, marketcapBTC/1000000000, marketcapBTC/1000000000);
ellipse(300, 100, marketcapETH/1000000000, marketcapETH/1000000000);
ellipse(100, 300, marketcapXRP/1000000000, marketcapXRP/1000000000);
ellipse(200, 250, marketcapBCH/1000000000, marketcapBCH/1000000000);
ellipse(300, 300, marketcapLTC/1000000000, marketcapLTC/1000000000);
// ellipse(300, 100, 80, 80);
}
In the previous lectures, we have been briefed about our final project and taught how to link an API and Json files to a code in JS.
We need to create an artistically interesting piece that uses live data.
We are thinking about using the Cryptocurrencies API to show how the market varies, portraying the 5 biggest Cryptos as bubbles, and make their dimension to change based on that or based on historical data. So we made our first experiment with Json files around the Final assignment.
For now, I coded this:
The ellipses are already linked to the API and already represent the 5 main cryptos: Bitcoin, Ethereoum, Ripple, Bitcoin Cash and Lite coin. (The code is at the end of the page)
We also had a reading to do, as usual, and I found very interesting this bit:
' In a popular book on the history of software, one of the developers of FORTRAN is characterized as “an extraordinary programmer who could ‘execute’ a program in his head, as a machine would, and then write error-free code with remarkable frequency.” [7] Actually, all programmers must do this to some extent, using some internal model of what code will do. Just as understanding what a program does, and why, is critical on a practical level for the programmer, it is important to the aesthetics of code as well. Because code functions, “the aesthetic value of code lies in its execution, not simply its written form. To appreciate it fully we need to 'see' the code to fully grasp what it is we are experiencing and to build an understanding of the code's actions.” '
from A Box, Darkly: Obfuscation, Weird Languages, and Code Aesthetics by Michael Mateas and Nick Montfort.
To my understanding, it states that all humans are capable to mentally execute a program, to some extent, but, because we are humans, we do also have to see what the code represents to really grasp its aesthetics.
I could also add that the real beauty is to be able to get the aesthetics of a certain thing, and this is something that computers have still to learn.
Ciaoo,
Eleonora
Code following:
var myCrypto;
var marketcapBTC;
var marketcapETH;
var marketcapXRP;
var marketcapBCH;
var marketcapLTC;
function setup() {
createCanvas(400, 400);
loadJSON('https://api.coinmarketcap.com/v1/ticker/?convert=EUR&limit=10', gotData);
}
function gotData(data) {
//println(data);
myCrypto = data;
if (myCrypto){
marketcapBTC = myCrypto[0].market_cap_usd;
console.log(marketcapBTC);
marketcapETH = myCrypto[1].market_cap_usd;
console.log(marketcapETH);
marketcapXRP = myCrypto[2].market_cap_usd;
console.log(marketcapXRP);
marketcapBCH = myCrypto[3].market_cap_usd;
console.log(marketcapBCH);
marketcapLTC = myCrypto[4].market_cap_usd;
console.log(marketcapLTC);
}
}
function draw() {
background(204, 120);
fill(0);
// console.log(crypto);
// textSize(32);
// text(crypto[0].id, width/2,height/2);
ellipse(100, 100, marketcapBTC/1000000000, marketcapBTC/1000000000);
ellipse(300, 100, marketcapETH/1000000000, marketcapETH/1000000000);
ellipse(100, 300, marketcapXRP/1000000000, marketcapXRP/1000000000);
ellipse(200, 250, marketcapBCH/1000000000, marketcapBCH/1000000000);
ellipse(300, 300, marketcapLTC/1000000000, marketcapLTC/1000000000);
// ellipse(300, 100, 80, 80);
}
Comments
Post a Comment