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

Data opschonen

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

Data opschonen

Data vanuit de datavis-enquete opschonen --> kleur vd ogen?

Data vanuit SPARQL combinen --> twee files combineren dmv js en size aanpassen met node.sum

De size/values van de parents te bepalen op basis van de sum van diens children

node.sum(value)

Evaluates the specified value function for this node and each descendant in post-order traversal, and returns this node. The node.value property of each node is set to the numeric value returned by the specified function plus the combined value of all children. The function is passed the node’s data, and must return a non-negative number. The value accessor is evaluated for node and every descendant, including internal nodes; if you only want leaf nodes to have internal value, then return zero for any node with children. For example, as an alternative to node.count:

OPTIE 1

  • De twee datasets combinen --> laad beide in middels een aparte functie --> maak van beide een array (d3.stratify) --> combine arrays

OPTIE 2

  • Data van elke column inladen in een aparte array
  • Combinen in één array

--> eerst gekeken naar een package, niet voor gekozen uiteindelijk

  • De size bepalen op basis van diens children
  • Check repo van Eyob + Jennifer om te zien hoe zij met de data inladen omgaan

Replaced meuk

Inladen vanuit csv file

` Get the data from our CSV files d3.csv('catLabel_catBTLabel.csv', function(error, CsvData) { if (error) throw error;

    Data = d3.stratify()(CsvData);

    console.log(CsvData);
    drawViz(Data);
});

`

`

CsvData is de array
d3.csv("catLabel_catBTLabel.csv").then(function(CsvData) {
  Data = d3.stratify()(CsvData);
  console.log(CsvData);
  console.log(Data);
  drawViz(Data);
});

d3.csv("aantallen.csv").then(function(CsvData) {
  Data = d3.stratify()(CsvData);
  console.log(CsvData);
  // drawViz(Data);
});

merge two csv files Promise.all([ d3.csv("catLabel_catBTLabel.csv"), d3.csv("aantallen.csv") ]).then(function(allData) { console.log(d3.merge(allData)); }); `

Clone this wiki locally