Peak map: Visualize the elevation of any area using a ridgeline chart
github.com
github.com
This is one of my favorite spots on the map. The mountainrange is dividing a big part of the north from southern region called Westphalia. Only one river breaks through it allowing for an easy way across the mountains. The citys name at that spot is Porta Westfalica which is Latin and means "gate to Westphalia". I think this visualization illustrates the reason behind the name very well.
From my speculative chair, it looks like the river existed before the ranges.
-- https://en.wikipedia.org/wiki/Water_gap
-- https://onlinelibrary.wiley.com/doi/book/10.1002/97814443042...
-- Rohde P, 1994. Weser und Leine am Berglandrand zur Ober- und Mittelterrassen-Zeit E&G Quaternary Science Journal 44(1): 106–133, DOI 10.3285/eg.44.1.10.
Earth Primer is a science book for playful people. Discover how Earth works through play—on your iPad. Join a guided tour of how Earth works, with the forces of nature at your fingertips. Visit volcanoes, glaciers, sand dunes. Play with them, look inside, and see how they work.
Earth Primer defies existing genres, combining aspects of science books, toys, simulations, and games. It is a new kind of interactive experience which joins the guided quality of a book with open ended simulation play.
Features:
• Discover how Earth works through play.
• The forces of nature are at your fingertips— make volcanoes, shape sand dunes, form glaciers, sculpt mountains, push around tectonic plates, paint with wind, heat up magma—and more!
• 20 different tools to unlock.
• Richly interactive geological simulations.
• Sandbox mode.
https://en.wikipedia.org/wiki/Chaim_Gingold
https://www.wired.com/2015/02/a-sandbox-for-the-anthropocene...
(Also, oh wow, it's actually you!)
[0] https://www.cbgfamilienamen.nl/nfb/detail_naam.php?gba_lcnaa...
Did you know you can enter your first name into Wolfram Alpha and it will guess your age, based on US birth statistics. So it's a shot in the dark with Dutch names.
https://www.wolframalpha.com/input/?i=kees&assumption=%7B%22...
A better example, it guesses "Gertrude" is probably 86 years old:
(now I wonder how you knew that "Kees" is a Dutch name)
Just wanted to chime in and say thank you for the sharing and love!
Have a wonderful start of the year!
I'm assuming its a reference to Joy Division's iconic Unknown Pleasures cover [0] by Peter Saville?
[0] https://www.radiox.co.uk/artists/joy-division/cover-joy-divi...
[0] https://www.esri.com/arcgis-blog/products/arcgis-pro/mapping...
Pretty cool that the album was inspired by the visual representation of the first discovered pulsar!
Apologizes if your link already says that. I cannot open it due to work filters I think :/
Edit: Just noticed it's called a "joy plot" in the repo.
I never knew the name of the band was that dark. For a dark band, there's a certain logic, but yeah... will definitely be using 'ridgeline' from now on.
Thanks for the info. Genuinely appreciated.
https://news.ycombinator.com/item?id=21757484
(But then again, since when did IBM ever shy away from selling their products to Nazis?)
It's specifically that the band "Joy Division" was named intentionally after a regrettable piece of history, and "joy plots" are named because of a Joy Division album cover.
Words aren't bad -- it's the meaning and derivation behind them. Etymology matters.
https://news.ycombinator.com/item?id=21870821
https://en.wikipedia.org/wiki/Control_Strip
>The Control Strip is a user interface component introduced in the "classic" System 7 Macintosh operating system. It currently exists as part of the Touch Bar interface in macOS.
https://en.wikipedia.org/wiki/Fortifications_of_the_inner_Ge...
>In the West, the control strip became known as the "death strip" (Todesstreifen) because of the shoot-to-kill orders given to the border guards. The East Germans preferred to call it by the more euphemistic name of the "action strip" (Handlungsstreifen). It was also nicknamed the Pieck-Allee ("Pieck Avenue") after East Germany's president Wilhelm Pieck (1949–60).
Instead of it clearly just being a literal strip of controls.
Clearly you're not going to find any.
This is my point. Etymology and history matters.
Also, gratuitous genital analogies don't help to make anyone's case here.
Clearly you're not going to find any evidence that the R community named the plots after the Freudenabteilung.
Instead of it clearly just being an innocent literal reference to the name of the band who produced a famous album cover that inspired the plots.
If your point is that etymology and history matter, then why are you saying that it matters for the R community, but not Apple?
By your inconsistent logic, it's not OK to criticize Apple for naming the Control Strip even through they may not have realized the historical meaning of Kontrollstreifen at the time, but it's OK to criticize the R community for naming Joy Plots after the name of a band instead of Freudenabteilung. Why the Widerspruch und Doppelmoral?
Your own words contradict your point: 'This isn't about "cancelling". It's about something being in bad taste in the first place, even if the originator hadn't been aware of it.' Yet now you're saying that because Apple was not aware of the dark meaning of "Control Strip", it's wrong to criticize that name. Pick a lane, and stick with it.
My point is that IBM declined to name the input device that Ted Selker invented the "Joy Button", even though that's what he originally wanted to call it (if not the "Keyboard Clitoris" or "Control Knob"), so they named it the "Trackpoint" instead. And that was most likely to avoid any sexual connotations, not about Nazi allusions.
Yet IBM has an unabashed well documented history of marketing and selling computing machinery to Nazi Germany that facilitated the Holocaust, which substantially enabled them to identify, round up, and murder many Jews and other persecuted minorities (not to mention their contracts with the US Government to help round up Japanese people into internment camps). So by IBM management's logic, Nazi are fine upstanding customers, but sexual references in product names are a no-no.
Please be a Joy Button, not a Control Knob!
Huh? Joy plots were named after Joy Division (because of their album cover), which was named for what happened in the Holocaust.
The chain of derivation is crystal clear and 100% undisputed.
The Control Strip is named after a strip of controls. There's zero evidence of derivation from something else.
End of story.
I don't know why you're continuing to talk about genitals or IBM. They have zero to do with this.
It's exhausting catering to these people who fixate on dredging up and removing any hint of bitterness from words. We need to start treating picky speakers like picky eaters instead of continually acquiescing to the tyranny of the minority. No more fucking chicken nuggets, we are adults here.
It would be cool to make the lines rotate and translate and scan around over the map like Max Headroom's background!
https://www.youtube.com/watch?v=6epzmRZk6UU
I wonder how you could go about implementing it as a high performance shader?
let fY = y - Math.floor(scale * (height - minHeight) / heightRange) - r * tilt * 0.1;
Of course, this creates blank space at the bottom, but I think it makes things a little more interesting without fudging too much with the scale and getting sharp peaks.When I find more free time, I can flesh it out and make a PR, but I love this idea. Thanks for sharing it!
CanvasRenderingContext2D has save() and restore() methods you can call to re-use partial paths. So instead of making the path and closing it to fill, then making it again without closing it to stroke, you can make it once without closing, save the graphics state, close the path, then fill, restore the graphics state, then stroke! That is a classic idiom from PostScript (draw, gsave, fill, grestore, stroke).
That should save a bunch of JavaScript looping and spooning points through the 2d context api. (It's the individual lineTo calls that are expensive, because of all the overhead of JavaScript<=>C bindings, not stroking or filling the actual lines. And there's no way to provide an array of points all at once, like with WebGL.
(At least SVG made the right decision, inspired by VML, to put all the points of a path in one attribute string, instead of using individual XML elements for each point.)
https://developer.mozilla.org/en-US/docs/Web/SVG/Element/pat...
Once you get into native code, it's fast even if there's a lot to do (i.e. calling ctx.stroke once), but jumping in and out of native code a lot (i.e. calling ctx.lineTo a thousand times) is slow.)
Thanks for sharing the code, it's inspired me! (I'm trying to figure out how to rotate and otherwise generally transform the direction that the lines scan across the depth map and screen, to get a Max Headroom effect! Maybe somebody with deep shader-fu could suggest an out-of-the-box way to render it in hardware with WebGL, to apply to live video!)
Come to think of it, you could just draw the ridges directly as polygons with WebGL, and that would be quite flexible and performant!
I haven't tested it yet, but here's the new drawPolyLine from createHeightMapRenderer.js:
Original:
https://github.com/anvaka/peak-map/blob/master/src/lib/creat...
Optimized:
/**
* Draws filled polyline.
*/
function drawPolyLine(points) {
if (points.length < 3) return;
let smoothRange = getSmoothRange(points, smoothSteps);
points = smoothRange.points;
// Create the unclosed path.
ctx.beginPath();
ctx.moveTo(points[0], points[1]);
for (let i = 2; i < points.length; i += 2) {
ctx.lineTo(points[i], points[i + 1]);
}
// If line's height is greater than 2 pixels, let's save
// the graphics state, finish and close the path, fill it,
// then restore the graphics state:
if (smoothRange.max - smoothRange.min > 2) {
ctx.save();
ctx.lineTo(points[points.length - 2], smoothRange.max);
ctx.lineTo(points[0], smoothRange.max);
ctx.closePath();
ctx.fillStyle = lineFill;
ctx.fill();
ctx.restore();
}
// Now finally stroke the unclosed path.
ctx.strokeStyle = lineStroke;
ctx.stroke();
}
There was a classic "Grandfather Clock" posting from Glenn Reid at Adobe (author of the "Green Book" on PostScript language program design) to comp.lang.postscript that really opened my eyes about writing code in interpreted languages like PostScript (and JavaScript, while JIT'ed at runtime, still makes calling native code expensive), and balancing optimization with readability:Here's Glenn's "Green Book", which was like a bible to me, and still is quite relevant to canvas 2d context programming -- see especially page 9, section 1.5, Program Design Guidelines, page 72, section 4.6, Optimizing Translator Output, and page 99, chapter 7, The Mechanics of Setting Text:
https://www-cdf.fnal.gov/offline/PostScript/GREENBK.PDF
>page 9: 1.5 Program Design Guidelines
>There are a few items that may be kept in mind while implementing a driver for a PostScript device. As with most software development, the most difficult part of writing programs in the PostScript language is the design of the program. If the design is good, implementing it is easy. If the design is poor, it may not even be possible to correctly implement it. Below are some helpful items to keep in mind when writing your software. All of them are explained more fully within the text of this book; this is only an attempt to prime the pump before you start reading:
>• Use the operand stack efficiently. Pay particular attention to the order of the elements on the stack and how they are used.
(Using the stack efficiently by designing fluent words that chain and dovetail together elegantly in pipelines (and systematically writing line-by-line stack comments) instead of using named variables in dictionaries is good idiomatic PostScript and Forth, aka tacit programming or point-free style, the stack-based equivalent of fluent interfaces.)
https://en.wikipedia.org/wiki/Tacit_programming
https://en.wikipedia.org/wiki/Fluent_interface
>• Avoid unnecessary redundancy. When a program is produced, check for many repetitive steps that perhaps could be condensed. Keep identifiers short if they are to be transmitted many times.
(Only create paths once!)
>• Use the PostScript imaging model effectively. When printing, a document must be translated into the language of the printer. This includes a philosophical adjustment to the nature of the PostScript imaging model.
(Use the graphics state stack!)
>• It is better to translate into the PostScript imaging model than to maintain another set of graphics primitives using the PostScript language for emulation.
(The hardest problem I ever tried (and failed) to solve properly with PostScript was making a printer driver for rendering user interfaces drawn with X11 using a combination of bitmaps and lines. Because of X11 "half open" pixel rounding rules versus PostScript's "stencil paint" model, they just don't line up right when you zoom into them, and there's no fudge or compromise that works in all cases. Here is my commented-out failed attempt:)
https://github.com/mmontone/garnet/blob/1652af38f76b1c4efb19...
line-color line-cap line-join dash-pattern
thickness
% dup -1 ne { .5 add } if % fudge outline width thicker
StrokeShape
Half Open:https://www.sciencedirect.com/science/article/pii/B978008050...
Stencil Paint:
http://www.chilton-computing.org.uk/inf/literature/books/wm/...
>page 100: Note: There is one principle to keep in mind when deciding upon an algorithm for setting text. The longer the string presented to one of the show operators, the more efficient the system is likely to be. This is because the PostScript language built-in operators, such as show, widthshow, and ashow, operate essentially at compiled speed once they have been invoked. Each moveto or div operation performed must first be interpreted, which is significantly slower.
Glenn's post in a comp.lang.postscript discussion about PostScript programming style and optimization:
https://groups.google.com/forum/#!search/%22glenn$20reid%22$...
From: Glenn Reid (Abode Systems)
Newsgroup: comp.lang.postscript
Subject: Re: An Idea to Help Make Postscript Easier to Read (and Write)
Date: 10 Sep 88 17:26:24 GMT
You people tend to forget that the PostScript language is interpreted.
It is well and good to use tools to convert to and from PostScript,
but it is not quite as "transparent" as we all might think.
I like to think of a big grandfather clock, with the pendulum swinging.
Each time pendulum swings, the PostScript interpreter gets to do one
operation. The "granularity" of the clock is nowhere near the speed
of a microprocessor instruction set, and any comparison with assembly
languages doesn't make sense.
The difference between:
0 0 moveto
and
0 0 /arg2 exch def /arg1 exch def arg1 arg2 moveto
can sort of be measured in "ticks" of the interpreter's clock. It's
not quite this simple, since simply pushing a literal is faster than
executing a real PostScript operator, but it is a rough rule of thumb.
It will take about three times as long to execute the second of these
in a tight loop, and about five times as long if it is transmitted and
scanned each time. My rule of thumb is that if you have roughly the
same number of tokens in your stack approach as you do with your 'exch
def' approach, the 'exch def' is likely to be much more readable and
better. Otherwise, I usually go with the stack approach.
One other thing of note is that if you have too much stack manipulation
going on, it may well be symptomatic of a problem in the original program
design.
Also, most procedures don't do any stack manipulation at all, they
simply use their arguments directly from the stack. In this situation,
it is especially wasteful (and confusing, I think) to declare
intermediate variables.
Compare:
% sample procedure call:
(Text) 100 100 12 /Times-Roman SETTEXT
% approach 1:
/SETTEXT { %def
findfont exch scalefont setfont moveto show
} def
% approach 2:
/SETTEXT { %def
/arg5 exch def
/arg4 exch def
/arg3 exch def
/arg2 exch def
/arg1 exch def
arg5 findfont arg4 scalefont setfont
arg2 arg3 moveto arg1 show
} def
Which of these is easier for you to understand?
Anyway, I think the discussion is a good one, but let's not forget
that PostScript it is an interpreted language. And I don't think
it is terribly hard to use and understand, if it is written well.
Glenn Reid
Adobe SystemsWhich causes the bottom closing line to appear where it shouldn't. Here is a simple jsbin to reproduce: https://jsbin.com/luzatuteha/1/edit?html,js,output
NeWS's dialect of PostScript (but not standard Adobe PostScript) had currentpath / setpath operators to save and restore the current path as a first class object, so you could use it any number of times later in different contexts. I wish the canvas 2d api had that too, plus some set operations on regions.
http://bitsavers.trailing-edge.com/pdf/sun/NeWS/NeWS_1.1_Man...
It'd be fun and worth coding up a WebGL renderer, I think! Then you can pass all the points in one big chunk of memory, and draw it from any direction, with lighting and shadows!
[edit]:
Here are the alps, quite nicely rendered (kind of reminds me of a Tolkien map of middle earth).
https://anvaka.github.io/peak-map/#6.31/46.111/10.14
But here's a zoomed in rendering (of Sudtirol / Dolomites), no so great IMO:
After tweaking a little bit of settings (reducing height settings to low), get a very interesting graphics for Asia+Europe - quite a few majestic mountain ranges there.
Coffee cup result:
https://www.zazzle.com/map_mug-168739066664861503?t_map_iid=...
Typing that out made me think I might have made a mistake by hiding print functionality too far. I just didn't want to be too aggressive showing this option
https://www.zazzle.com/map_mug-168739066664861503?t_map_iid=...
I wonder what happened to Greenland, though? It's just... not there.
Also -- especially for printing -- an "export to SVG" option would be amazing.
The data has a few bugs, I shouted out to the data provider here:
https://twitter.com/anvaka/status/1214222926070730758?s=19
Hopefully they will find time to fix it
1. Feels like almost all the mountain ranges are almost joined up.
2. These large Islands are much more mountainous than one would naturally expect.
I think I did terrible job here by hiding it too far. For me it is a struggle between usefulness of the feature and level of annoyance it could bring to those who are not interested
If it is that map then the point is that it looks way better with the height map as you can actually visualize the height of mountain range relative to others. This isn't really discernible with the original map.
Are these joy plots more accessible to novice viewers somehow? To me, contour lines provide a very clear understanding of terrain but I admit I am pretty fluent in reading them. They bunch up to show steep slopes and cliffs, but give a much clearer sense of slope direction and more subtle topography like bowls, saddles, and stream beds.
I cannot really recall how I first experienced them as a novice. I was a child looking at USGS quadrant maps of the Sierra Nevada.
Also it's just cool. I'll talk to my friend who does this type of thing professionally and ask his opinion. He is on vacation though. I was trained to read contour lines in boy scouts and I hike a lot since I live in the mountains, so I am quite comfortable with them too. I think this one is just a cool way to represent the data. I think the only time it is better is showing of height and height on a massive scale that are simply too big for other types of maps to be easily understood at a glimpse.
I'll challenge you to find a good map showing off the height of the Appalachian region, as I can't find one and really want to after seeing this. The one those tool can provide is quite cool in comparison to every one I can find. My friend would probably be a good person to ask in that regard.
Our eyes are not great at detecting the difference between 80% and 82% grayscale, but they easily see the difference between adjacent shapes 80px and 82px tall.
Similarly, it's incredibly difficult for us to compare the difference between 80% and 82%, against 82% and 86%. Whereas with a line, it's trivial to see that the angle increased dramatically on the second one.
Grayscale and color maps are well-known for only being able to provide a "big-picture" overview because our eyes can only vaguely distinguish subtle differences in color/intensity. This type of plot addresses that partly.