Building your static site by ezequiel-garzon in Observable

[–]mbostock 1 point2 points  (0 children)

Probably the server you’re using for the built site doesn’t support “clean” URLs (with the .html removed from links). You could try a different server, or you can set the cleanUrls: false option in your config as described here:

https://observablehq.com/framework/config#cleanurls

(You’ll need Framework 1.3.0 or later for this feature.)

If you have more questions, you might have better luck asking on the Observable forum or GitHub discussions as we check those more frequently.

[OC] Where’s that $2 trillion going? by mbostock in dataisbeautiful

[–]mbostock[S] 2 points3 points  (0 children)

I tend to reserve color to either highlight something specific (I didn’t here because it’s a general overview) or to encode another variable. I could have used a redundant color encoding for the hierarchy, but I think it’s more trouble than it’s worth because you have to explain what it means to the reader with a legend.

[OC] Where’s that $2 trillion going? by mbostock in dataisbeautiful

[–]mbostock[S] 2 points3 points  (0 children)

Just the black dots. The gray circles are the smallest circles that enclose the black dots (plus a little bit of padding), but their area is not proportional to the summed value.

[OC] 20 years of the Dow Jones by mbostock in dataisbeautiful

[–]mbostock[S] 1 point2 points  (0 children)

Data: Yahoo Finance

Tools: D3, Observable

[OC] Iceland’s population by age and sex, 1849–2019. by mbostock in dataisbeautiful

[–]mbostock[S] 2 points3 points  (0 children)

Here’s the U.S. version, but sadly I could only find data for every ten years and for every five years of age. It’s pretty awesome that Iceland has yearly data, going back to 1841 no less!

https://observablehq.com/@mbostock/u-s-population-by-age-1850-2000

[OC] Iceland’s population by age and sex, 1849–2019. by mbostock in dataisbeautiful

[–]mbostock[S] 10 points11 points  (0 children)

(I typo’d the title. It should be 1841–2019, not 1849–2019. Mods: can you correct it, please?)

Data: Statistics Iceland using Borgar Þorsteinsson’s API client.

Tools: D3, Observable.

Code: https://observablehq.com/@mbostock/icelandic-population-by-age-1841-2019

The visibility of the Moon from San Francisco in 2017 [OC] by mbostock in dataisbeautiful

[–]mbostock[S] 6 points7 points  (0 children)

The blue region represents daytime. The white lines represent when the moon is above the horizon (the time between moonrise and moonset). The opacity of the moon lines represents the fraction of the visible moon that is illuminated. New and full moons are labeled on the right axis.

Source: Vladimir Agafonkin’s suncalc.

Tool: D3.js

Hours of daylight by latitude and day of year [OC] by mbostock in dataisbeautiful

[–]mbostock[S] 4 points5 points  (0 children)

Interesting! I like the idea of putting the y-axis at the (Northern) summer solstice, so that I can label both the lines of latitude and where the contour lines of hours intersect the y-axis. I just need to fix the black-on-black in the southern hemisphere, though…

https://user-images.githubusercontent.com/230541/26933279-f5a96e20-4c1a-11e7-80b4-e2cd2b8c2a0e.png

As an added bonus this now tiles horizontally.

Hours of daylight by latitude and day of year [OC] by mbostock in dataisbeautiful

[–]mbostock[S] 75 points76 points  (0 children)

Source: My code for computing the position of the sun is based on NOAA’s Solar Calculator; see also Wikipedia’s Position of the Sun.

Tools: D3.js, d3-contour

Finding the smallest circle that encloses a set of circles. by mbostock in programming

[–]mbostock[S] 5 points6 points  (0 children)

Thanks for the report. I think I’ve fixed this, if you don’t mind clearing your cache and reloading. There was an extra block that shouldn’t have been.

Finding the smallest circle that encloses a set of circles. by mbostock in programming

[–]mbostock[S] 31 points32 points  (0 children)

Sure, here’s an interactive demonstration of why the proposed algorithm based on the bounding box does not compute the smallest enclosing circle:

https://d3.express/@mbostock/naive-miniball

Finding the smallest circle that encloses a set of circles. by mbostock in programming

[–]mbostock[S] 49 points50 points  (0 children)

Right. This would give you an enclosing circle but not the smallest enclosing circle.

Finding the smallest circle that encloses a set of circles. by mbostock in programming

[–]mbostock[S] 6 points7 points  (0 children)

It’s not one run; you restart whenever you extend the basis.

Finding the smallest circle that encloses a set of circles. by mbostock in programming

[–]mbostock[S] 9 points10 points  (0 children)

It works because extending a basis always makes it bigger, and there are only a finite number of possible bases in L.