Skip to content
This repository was archived by the owner on Jan 5, 2021. It is now read-only.

Functional Programming Object Oriented Programming

Deanna Bosschert edited this page Nov 28, 2019 · 3 revisions

Functional programming

tl;dr je houdt je variabelen binnen de functies, cluttered daarmee niet de global scope en zorgt er zo voor dat je code alleen bestaat uit blokken die al geprocessede info eruit yeeten. =minder spaghetticode=minder 'onopvallende invloeden op andere stukken code'=minder bugs

Bronnen

Dingen die ik geprobeerd heb, niet alles werkte dus niet alles zit ook in mn uiteindelijke code (even uit al mn geopende tabjes)

Voorbeelden om mee te starten

https://www.d3-graph-gallery.com/graph/bubble_legend.html

Data inladen

https://www.tutorialsteacher.com/d3js/loading-data-from-file-in-d3js

Data parsen

Data uit csv naar hierarchie: https://observablehq.com/@d3/d3-stratify https://beta.vizhub.com/Razpudding/2b231e4f093b411bbb259115019e02ea?edit=files&file=index.js

Data transformeren

Data uit twee datasets combinen: http://learnjsdata.com/combine_data.html https://github.com/cmda-tt/course-19-20/tree/master/examples/functional-patterns https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat https://googlechrome.github.io/samples/object-assign-es6/

https://developer.mozilla.org/nl/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach https://developer.mozilla.org/nl/docs/Web/JavaScript/Reference/Global_Objects/Array/map https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys

Data uit de twee arrays combinen: https://stackoverflow.com/questions/17500312/is-there-some-way-i-can-join-the-contents-of-two-javascript-arrays-much-like-i/17500836#17500836

Functional dingen

https://github.com/cmda-tt/course-19-20/blob/master/examples/functional-patterns/impure.md https://www.w3schools.com/js/js_functions.asp arrow functions https://www.freecodecamp.org/news/when-and-why-you-should-use-es6-arrow-functions-and-when-you-shouldnt-3d851d7f0b26/

Sizes van children optellen bij de parent

https://books.google.nl/books?id=a1qWDwAAQBAJ&pg=PA404&lpg=PA404&dq=js+count+descendants&source=bl&ots=KjbC66ltQj&sig=ACfU3U2v0BILdOKEOWXfTeCfrbpNIgDigw&hl=nl&sa=X&ved=2ahUKEwisqZ2A1ozmAhVFaFAKHRqjDd4Q6AEwA3oECAkQAQ#v=onepage&q=js%20count%20descendants&f=false

Clone this wiki locally