Posts by Gonçalo Peres 龚燿禄 • 153 points
5 posts
-
0
votes4
answers696
viewsA: How to create hexadecimal colors randomly?
There are several ways to solve this problem. $aleatorio = mt_rand(0, 16777215); $cor = "#" . dechex($aleatorio); Then, assuming you want to change the background color of the tag div, add:…
-
1
votes1
answer38
viewsA: D3.js: Change imported file through a slider
Solved using Async/Await const slider = d3.select('.slider') .append('input') .attr('type', 'range') .attr('min', 2009) .attr('max', 2013) .attr('step', 1) .on('input', function () { const value =…
-
1
votes0
answers79
viewsQ: D3.js Caption does not display text/label
I’m creating a caption for a Choropleth map, inspired by the caption of this visualization. To that end, where the date is being loaded, I added the following: const g = svg.append("g") .attr(…
-
1
votes1
answer38
viewsQ: D3.js: Change imported file through a slider
I’m creating a slider for a view, a choropleth map on D3.js. To do this, I added it to the app.js file: function update(year){ slider.property("value", year); d3.select(".year").text(year); //…
-
1
votes1
answer30
viewsQ: D3.JS: Variable with getElementById default value
I am creating a visualization in D3.js, in which I am importing the date through a dynamic string that requires a variable, which I named honeystring. Variable var honeyyear =…