SlideShare una empresa de Scribd logo
1 de 52
“this is going to be AWESOME!"
& Data Visualization
Why   ?
complex
 interactive
exploratory
    novel
1. Get the data into Processing
1. Get the data into Processing
2. Parse the data into useful Objects
1. Get the data into Processing
2. Parse the data into useful Objects
3. Render the objects on screen
CSV, JSON, XML
1. Get the data into Processing
JSON
               XML
                CSV
   Flexible
Structured
      Easy
CSV (Comma-Separated Values)
  • Values (columns) are typically delimited by commas
  • Rows are typically delimited by carriage returns
  • Works for most data that can go
    in a simple spreadsheet
  • Not good for any kind of complex or relational data
  • Processing doesn’t have built in support for CSV
    but we can use JAVA libraries like opencsv
4,14,26,17,98,35,128,362,9,18,45

       dave,28,male,no
       erica,28,female,no
       roger,52,male,yes
XML (eXtensible Markup Language)
  • Data is stored in nested nodes
  • Structure of data is extremely flexible to define
    but not as flexible to change
  • Processing has built-in support for XML
  • Many APIs will return data in XML format
<patients>
 <patient name=”dave” age=28 gender=”male” smoker=”no”/>
 <patient name=”erica” age=28 gender=”female” smoker=”no”/>
 <patient name=”roger” age=52 gender=”male” smoker=”yes”/>
</patients>
JSON (JavaScript Object Notation)
   • Data is as JavaScript Objects
   • Extraordinarily flexible and lightweight
   • Lack of named structures can make stored data
     difficult to understand
   • JAVA and JavaScript do not play as nicely as you
     might think
{
    patients:[
       {name:”dave”, age:28, gender:”male”, smoker:false},
       {name:”erica”, age:28, gender:”female”, smoker:false},
       {name:”roger”, age:52, gender:”male”, true}
       ]
}
{
     Curly Braces - OBJECT
};
[ Square Brackets - ARRAY ]
{
     name:”Peter”,
     age:18,
     smoker:false,
     friends:[“April”, “Ron”, “Valerie”]
};
{
     name:”Peter”,
     age:18,
     smoker:false,
     friends:[“April”, “Ron”, “Valerie”]
};



        myJSONObject.age
{
     name:”Peter”,
     age:18,
     smoker:false,
     friends:[“April”, “Ron”, “Valerie”]
};



     myJSONObject.friends[1]
{
     name:”Peter”,
     age:18,
     smoker:false,
     friends:[“April”, “Ron”, “Valerie”]
};



     myJSONObject.getInt(“age”);
{
          name:”Peter”,
          age:18,
          smoker:false,
          friends:[“April”, “Ron”, “Valerie”]
     };


JSONArray a = myJSONObject.getJSONArray[“friends”];
a.getString(1);
myJSONObject = new JSONObject(stringData);
JSONArray a = myJSONObject.getJSONArray[“friends”];
println(a.getString(1));
try {
  myJSONObject = new JSONObject(stringData);
  JSONArray a = myJSONObject.getJSONArray[“friends”];
  println(a.getString(1));
} catch (Exception e) {
  println(“JSON LOAD FAILED.”);
}
try {
   String url = “http://test.com/?getStuff”;
  String stringData = join(loadStrings(url), “”);
  myJSONObject = new JSONObject(stringData);
  JSONArray a = myJSONObject.getJSONArray[“friends”];
  println(a.getString(1));
} catch (Exception e) {
  println(“JSON LOAD FAILED.”);
}
http://www.blprnt.com/processing/json.zip
2. Parse the data into useful Objects
class Patient {

 XML        String name;
            int age;
JSON        String gender;    ArrayList<Patient> patientList
            boolean smoker;
  CSV
            Patient();
        }
ArrayList: Store lists of objects
HashMap: Keep counts of categories
Arrays vs. ArrayLists
Arrays
           fast
       easy to use
good for known quantities
ArrayLists
          flexible
       full-featured
good for changing quantities
Basic ArrayLists
    ArrayList myList = new ArrayList();
    CheeseBurger cb = new CheeseBurger();
    myList.add(cb);
Basic ArrayLists

    CheeseBurger cb = myList.get(0);
    cb.eat();
Basic ArrayLists

    CheeseBurger cb = myList.get(0);
X   cb.eat();
Basic ArrayLists

    CheeseBurger cb = (CheeseBurger) myList.get(0);
    cb.eat();
ArrayLists w/ Generics
    ArrayList<CheeseBurger> myList = new ArrayList();
    CheeseBurger cb = new CheeseBurger();
    myList.add(cb);
ArrayLists w/ Generics

    CheeseBurger cb = myList.get(0);
√   cb.eat();
HashMaps
HashMaps
Store objects by a key
Helpful for keeping counts of categories
Useful for keeping checklists
HashMaps
HashMap<keyType, valueType>
myMap = new HashMap();

CustomObject o = new CustomObject();
myMap.put(key, o);

CustomObject o = myMap.get(key)
3. Render the objects on screen
<insert wisdom here>
position
      size
#    colour
    rotation
     sound
        ?
position
              size
#   map()    colour
            rotation
             sound
                ?
map(5,0,10,0,100)   50
map(5,0,10,0,1000)   500
map(5,0,10,20,30)   25
Processing & Dataviz
Processing & Dataviz

Más contenido relacionado

La actualidad más candente

Coffee, Danish & Search: Presented by Alan Woodward & Charlie Hull, Flax
Coffee, Danish & Search: Presented by Alan Woodward & Charlie Hull, FlaxCoffee, Danish & Search: Presented by Alan Woodward & Charlie Hull, Flax
Coffee, Danish & Search: Presented by Alan Woodward & Charlie Hull, FlaxLucidworks
 
Building Next-Generation Web APIs with JSON-LD and Hydra
Building Next-Generation Web APIs with JSON-LD and HydraBuilding Next-Generation Web APIs with JSON-LD and Hydra
Building Next-Generation Web APIs with JSON-LD and HydraMarkus Lanthaler
 
06. ElasticSearch : Mapping and Analysis
06. ElasticSearch : Mapping and Analysis06. ElasticSearch : Mapping and Analysis
06. ElasticSearch : Mapping and AnalysisOpenThink Labs
 
PHP file
PHP  filePHP  file
PHP filetumetr1
 
RESTing with the new Yandex.Disk API, Clemens Аuer
RESTing with the new Yandex.Disk API, Clemens АuerRESTing with the new Yandex.Disk API, Clemens Аuer
RESTing with the new Yandex.Disk API, Clemens АuerYandex
 
SH 1 - SES 3 - 3.6-Overview-Tel-Aviv.pptx
SH 1 - SES 3 - 3.6-Overview-Tel-Aviv.pptxSH 1 - SES 3 - 3.6-Overview-Tel-Aviv.pptx
SH 1 - SES 3 - 3.6-Overview-Tel-Aviv.pptxMongoDB
 
Dictionary part 1
Dictionary part 1Dictionary part 1
Dictionary part 1RishuKaul2
 

La actualidad más candente (11)

Coffee, Danish & Search: Presented by Alan Woodward & Charlie Hull, Flax
Coffee, Danish & Search: Presented by Alan Woodward & Charlie Hull, FlaxCoffee, Danish & Search: Presented by Alan Woodward & Charlie Hull, Flax
Coffee, Danish & Search: Presented by Alan Woodward & Charlie Hull, Flax
 
Building Next-Generation Web APIs with JSON-LD and Hydra
Building Next-Generation Web APIs with JSON-LD and HydraBuilding Next-Generation Web APIs with JSON-LD and Hydra
Building Next-Generation Web APIs with JSON-LD and Hydra
 
06. ElasticSearch : Mapping and Analysis
06. ElasticSearch : Mapping and Analysis06. ElasticSearch : Mapping and Analysis
06. ElasticSearch : Mapping and Analysis
 
1.1 motivation
1.1 motivation1.1 motivation
1.1 motivation
 
PHP - Introduction to PHP MySQL Joins and SQL Functions
PHP -  Introduction to PHP MySQL Joins and SQL FunctionsPHP -  Introduction to PHP MySQL Joins and SQL Functions
PHP - Introduction to PHP MySQL Joins and SQL Functions
 
PHP file
PHP  filePHP  file
PHP file
 
RESTing with the new Yandex.Disk API, Clemens Аuer
RESTing with the new Yandex.Disk API, Clemens АuerRESTing with the new Yandex.Disk API, Clemens Аuer
RESTing with the new Yandex.Disk API, Clemens Аuer
 
3. javascript bangla tutorials
3. javascript bangla tutorials3. javascript bangla tutorials
3. javascript bangla tutorials
 
Setup testdata
Setup testdataSetup testdata
Setup testdata
 
SH 1 - SES 3 - 3.6-Overview-Tel-Aviv.pptx
SH 1 - SES 3 - 3.6-Overview-Tel-Aviv.pptxSH 1 - SES 3 - 3.6-Overview-Tel-Aviv.pptx
SH 1 - SES 3 - 3.6-Overview-Tel-Aviv.pptx
 
Dictionary part 1
Dictionary part 1Dictionary part 1
Dictionary part 1
 

Destacado

Emergence
EmergenceEmergence
Emergenceblprnt
 
ITP Data Rep - Class3
ITP Data Rep - Class3ITP Data Rep - Class3
ITP Data Rep - Class3blprnt
 
Shibuya.js Lightning Talks
Shibuya.js Lightning TalksShibuya.js Lightning Talks
Shibuya.js Lightning Talksjeresig
 
Data Representation - Day 2
Data Representation - Day 2Data Representation - Day 2
Data Representation - Day 2blprnt
 
Hacking The Newsroom
Hacking The NewsroomHacking The Newsroom
Hacking The Newsroomblprnt
 
Learn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing LanguageLearn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing Languageshelfrog
 
Processing and Processing.js
Processing and Processing.jsProcessing and Processing.js
Processing and Processing.jsjeresig
 

Destacado (7)

Emergence
EmergenceEmergence
Emergence
 
ITP Data Rep - Class3
ITP Data Rep - Class3ITP Data Rep - Class3
ITP Data Rep - Class3
 
Shibuya.js Lightning Talks
Shibuya.js Lightning TalksShibuya.js Lightning Talks
Shibuya.js Lightning Talks
 
Data Representation - Day 2
Data Representation - Day 2Data Representation - Day 2
Data Representation - Day 2
 
Hacking The Newsroom
Hacking The NewsroomHacking The Newsroom
Hacking The Newsroom
 
Learn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing LanguageLearn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing Language
 
Processing and Processing.js
Processing and Processing.jsProcessing and Processing.js
Processing and Processing.js
 

Similar a Processing & Dataviz

Native json in the Cache' ObjectScript 2016.*
Native json in the Cache' ObjectScript 2016.*Native json in the Cache' ObjectScript 2016.*
Native json in the Cache' ObjectScript 2016.*Timur Safin
 
Web Technology - PHP Arrays
Web Technology - PHP ArraysWeb Technology - PHP Arrays
Web Technology - PHP ArraysTarang Desai
 
Indexing with MongoDB
Indexing with MongoDBIndexing with MongoDB
Indexing with MongoDBlehresman
 
CREATE INDEX … USING VODKA. VODKA CONNECTING INDEXES, Олег Бартунов, Александ...
CREATE INDEX … USING VODKA. VODKA CONNECTING INDEXES, Олег Бартунов, Александ...CREATE INDEX … USING VODKA. VODKA CONNECTING INDEXES, Олег Бартунов, Александ...
CREATE INDEX … USING VODKA. VODKA CONNECTING INDEXES, Олег Бартунов, Александ...Ontico
 
NoSQL для PostgreSQL: Jsquery — язык запросов
NoSQL для PostgreSQL: Jsquery — язык запросовNoSQL для PostgreSQL: Jsquery — язык запросов
NoSQL для PostgreSQL: Jsquery — язык запросовCodeFest
 
Validating JSON -- Percona Live 2021 presentation
Validating JSON -- Percona Live 2021 presentationValidating JSON -- Percona Live 2021 presentation
Validating JSON -- Percona Live 2021 presentationDave Stokes
 
GDI Seattle - Intro to JavaScript Class 2
GDI Seattle - Intro to JavaScript Class 2GDI Seattle - Intro to JavaScript Class 2
GDI Seattle - Intro to JavaScript Class 2Heather Rock
 
json.ppt download for free for college project
json.ppt download for free for college projectjson.ppt download for free for college project
json.ppt download for free for college projectAmitSharma397241
 
JAVASCRIPT OBJECTS.pdf
JAVASCRIPT OBJECTS.pdfJAVASCRIPT OBJECTS.pdf
JAVASCRIPT OBJECTS.pdfcherop41618145
 
Open Source Search: An Analysis
Open Source Search: An AnalysisOpen Source Search: An Analysis
Open Source Search: An AnalysisJustin Finkelstein
 

Similar a Processing & Dataviz (20)

Potential Friend Finder
Potential Friend FinderPotential Friend Finder
Potential Friend Finder
 
Json the-x-in-ajax1588
Json the-x-in-ajax1588Json the-x-in-ajax1588
Json the-x-in-ajax1588
 
Native json in the Cache' ObjectScript 2016.*
Native json in the Cache' ObjectScript 2016.*Native json in the Cache' ObjectScript 2016.*
Native json in the Cache' ObjectScript 2016.*
 
quick json parser
quick json parserquick json parser
quick json parser
 
Web Technology - PHP Arrays
Web Technology - PHP ArraysWeb Technology - PHP Arrays
Web Technology - PHP Arrays
 
Indexing with MongoDB
Indexing with MongoDBIndexing with MongoDB
Indexing with MongoDB
 
CREATE INDEX … USING VODKA. VODKA CONNECTING INDEXES, Олег Бартунов, Александ...
CREATE INDEX … USING VODKA. VODKA CONNECTING INDEXES, Олег Бартунов, Александ...CREATE INDEX … USING VODKA. VODKA CONNECTING INDEXES, Олег Бартунов, Александ...
CREATE INDEX … USING VODKA. VODKA CONNECTING INDEXES, Олег Бартунов, Александ...
 
NoSQL для PostgreSQL: Jsquery — язык запросов
NoSQL для PostgreSQL: Jsquery — язык запросовNoSQL для PostgreSQL: Jsquery — язык запросов
NoSQL для PostgreSQL: Jsquery — язык запросов
 
Advanced Json
Advanced JsonAdvanced Json
Advanced Json
 
Validating JSON -- Percona Live 2021 presentation
Validating JSON -- Percona Live 2021 presentationValidating JSON -- Percona Live 2021 presentation
Validating JSON -- Percona Live 2021 presentation
 
Json
JsonJson
Json
 
GDI Seattle - Intro to JavaScript Class 2
GDI Seattle - Intro to JavaScript Class 2GDI Seattle - Intro to JavaScript Class 2
GDI Seattle - Intro to JavaScript Class 2
 
Oh, that ubiquitous JSON !
Oh, that ubiquitous JSON !Oh, that ubiquitous JSON !
Oh, that ubiquitous JSON !
 
4.1 PHP Arrays
4.1 PHP Arrays4.1 PHP Arrays
4.1 PHP Arrays
 
Json
JsonJson
Json
 
Java 8 Examples
Java 8 ExamplesJava 8 Examples
Java 8 Examples
 
json.ppt download for free for college project
json.ppt download for free for college projectjson.ppt download for free for college project
json.ppt download for free for college project
 
JAVASCRIPT OBJECTS.pdf
JAVASCRIPT OBJECTS.pdfJAVASCRIPT OBJECTS.pdf
JAVASCRIPT OBJECTS.pdf
 
Open Source Search: An Analysis
Open Source Search: An AnalysisOpen Source Search: An Analysis
Open Source Search: An Analysis
 
JSON
JSONJSON
JSON
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Último (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Processing & Dataviz

  • 1.
  • 2. “this is going to be AWESOME!"
  • 4. Why ?
  • 6. 1. Get the data into Processing
  • 7. 1. Get the data into Processing 2. Parse the data into useful Objects
  • 8. 1. Get the data into Processing 2. Parse the data into useful Objects 3. Render the objects on screen
  • 10. 1. Get the data into Processing
  • 11. JSON XML CSV Flexible Structured Easy
  • 12. CSV (Comma-Separated Values) • Values (columns) are typically delimited by commas • Rows are typically delimited by carriage returns • Works for most data that can go in a simple spreadsheet • Not good for any kind of complex or relational data • Processing doesn’t have built in support for CSV but we can use JAVA libraries like opencsv
  • 13. 4,14,26,17,98,35,128,362,9,18,45 dave,28,male,no erica,28,female,no roger,52,male,yes
  • 14. XML (eXtensible Markup Language) • Data is stored in nested nodes • Structure of data is extremely flexible to define but not as flexible to change • Processing has built-in support for XML • Many APIs will return data in XML format
  • 15. <patients> <patient name=”dave” age=28 gender=”male” smoker=”no”/> <patient name=”erica” age=28 gender=”female” smoker=”no”/> <patient name=”roger” age=52 gender=”male” smoker=”yes”/> </patients>
  • 16. JSON (JavaScript Object Notation) • Data is as JavaScript Objects • Extraordinarily flexible and lightweight • Lack of named structures can make stored data difficult to understand • JAVA and JavaScript do not play as nicely as you might think
  • 17. { patients:[ {name:”dave”, age:28, gender:”male”, smoker:false}, {name:”erica”, age:28, gender:”female”, smoker:false}, {name:”roger”, age:52, gender:”male”, true} ] }
  • 18. { Curly Braces - OBJECT };
  • 19. [ Square Brackets - ARRAY ]
  • 20. { name:”Peter”, age:18, smoker:false, friends:[“April”, “Ron”, “Valerie”] };
  • 21. { name:”Peter”, age:18, smoker:false, friends:[“April”, “Ron”, “Valerie”] }; myJSONObject.age
  • 22. { name:”Peter”, age:18, smoker:false, friends:[“April”, “Ron”, “Valerie”] }; myJSONObject.friends[1]
  • 23. { name:”Peter”, age:18, smoker:false, friends:[“April”, “Ron”, “Valerie”] }; myJSONObject.getInt(“age”);
  • 24. { name:”Peter”, age:18, smoker:false, friends:[“April”, “Ron”, “Valerie”] }; JSONArray a = myJSONObject.getJSONArray[“friends”]; a.getString(1);
  • 25. myJSONObject = new JSONObject(stringData); JSONArray a = myJSONObject.getJSONArray[“friends”]; println(a.getString(1));
  • 26. try { myJSONObject = new JSONObject(stringData); JSONArray a = myJSONObject.getJSONArray[“friends”]; println(a.getString(1)); } catch (Exception e) { println(“JSON LOAD FAILED.”); }
  • 27. try { String url = “http://test.com/?getStuff”; String stringData = join(loadStrings(url), “”); myJSONObject = new JSONObject(stringData); JSONArray a = myJSONObject.getJSONArray[“friends”]; println(a.getString(1)); } catch (Exception e) { println(“JSON LOAD FAILED.”); }
  • 29. 2. Parse the data into useful Objects
  • 30. class Patient { XML String name; int age; JSON String gender; ArrayList<Patient> patientList boolean smoker; CSV Patient(); }
  • 31. ArrayList: Store lists of objects HashMap: Keep counts of categories
  • 33. Arrays fast easy to use good for known quantities
  • 34. ArrayLists flexible full-featured good for changing quantities
  • 35. Basic ArrayLists ArrayList myList = new ArrayList(); CheeseBurger cb = new CheeseBurger(); myList.add(cb);
  • 36. Basic ArrayLists CheeseBurger cb = myList.get(0); cb.eat();
  • 37. Basic ArrayLists CheeseBurger cb = myList.get(0); X cb.eat();
  • 38. Basic ArrayLists CheeseBurger cb = (CheeseBurger) myList.get(0); cb.eat();
  • 39. ArrayLists w/ Generics ArrayList<CheeseBurger> myList = new ArrayList(); CheeseBurger cb = new CheeseBurger(); myList.add(cb);
  • 40. ArrayLists w/ Generics CheeseBurger cb = myList.get(0); √ cb.eat();
  • 42. HashMaps Store objects by a key Helpful for keeping counts of categories Useful for keeping checklists
  • 43. HashMaps HashMap<keyType, valueType> myMap = new HashMap(); CustomObject o = new CustomObject(); myMap.put(key, o); CustomObject o = myMap.get(key)
  • 44. 3. Render the objects on screen
  • 46. position size # colour rotation sound ?
  • 47. position size # map() colour rotation sound ?

Notas del editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n