SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 

Dernier (20)

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 

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 ?

Notes de l'éditeur

  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