Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mbostock
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
14 ms
·
121.
▲
by
mbostock
7y ago
If you edit the line that sets the x.domain in the chart cell, you can see it run with a fixed scale: x.domain([0, d3.max(keyframes, ([, data]) => d3.max(data, d => d.value))])
122.
▲
by
mbostock
7y ago
The alternatives I’d consider are a line chart and a bump chart. https://observablehq.com/@d3/multi-line-chart https://observablehq.com/@jonsadka/scatterplot A bar chart race is in many ways “wo
123.
▲
by
mbostock
7y ago
This tutorial was inspired by John Burn-Murdoch’s popular bar chart race from earlier this year. There have been a couple thousand transitive forks of John’s notebook! Our hope with Observable is that reactive notebooks, as a form of litera
124.
▲
Bar Chart Race, Explained
(observablehq.com)
134 points
by
mbostock
7y ago
|
21 comments
125.
▲
by
mbostock
7y ago
I wrote one for working with newline-delimited JSON and JavaScript expressions: https://github.com/mbostock/ndjson-cli
126.
▲
by
mbostock
7y ago
Here’s a JavaScript implementation of the lookup table and polynomial approximation: https://observablehq.com/@mbostock/turbo
127.
▲
by
mbostock
7y ago
I sent Yuri a suggestion to fix this. (The problem is that Firefox doesn’t resolve relative links from the textPath to the path element because of the page’s base element, so you need absolute links instead.)
128.
▲
by
mbostock
7y ago
I know this is cheating and missing the point, but using d3-array: d3.mean(victorianSlang, d => d.popularity) This implicitly ignores invalid values (null, NaN or undefined) after coercing to a number.
129.
▲
by
mbostock
7y ago
Got it. We use CodeMirror and are considering the vim bindings, but it’d probably be something we launch at the same time as user-configurable key bindings. https://codemirror.net/demo/vim.html
130.
▲
by
mbostock
7y ago
By default it is acyclic: any circular definitions will thrown an error. (I added an example to the notebook.) But you can opt-in to circular relationships using mutables or side-effects.
131.
▲
by
mbostock
7y ago
We did just launch a big improvement to keyboard controls this week that mirrors vim’s “Normal Mode”: https://observablehq.com/@observablehq/cell-shortcuts
132.
▲
Hillshader
(observablehq.com)
1 points
by
mbostock
8y ago
|
0 comments
133.
▲
by
mbostock
8y ago
Shameless plug, but here’s a live Graphviz editor in Observable: https://beta.observablehq.com/@mbostock/graph-o-matic And here’s a demo of dot tagged template literals: https://beta.observablehq.com/@m
134.
▲
Suggestions and Comments: Collaborate on Observable Notebooks
(beta.observablehq.com)
3 points
by
mbostock
8y ago
|
0 comments
135.
▲
SQL 3d engine (interactive preview)
(beta.observablehq.com)
6 points
by
mbostock
8y ago
|
1 comments
136.
▲
by
mbostock
8y ago
It’s nice that JavaScript has arbitrary-precision integers now. 9999999999999999n - 9999999999999998n === 1n
137.
▲
Let’s Try t-SNE
(beta.observablehq.com)
77 points
by
mbostock
8y ago
|
13 comments
138.
▲
by
mbostock
8y ago
That was the initial behavior, but I’ve changed it to ignore missing intermediate parents. Your example would be (a (b c)). See the “Handling ambiguity” section I added to the notebook. The nice property of this design is that you can use w
139.
▲
by
mbostock
8y ago
Heh, thanks for the feedback! What you’re seeing at the end here is the implementation of the parser itself. You might not be interested in how the parser is implemented; more likely you only care about the design and usage of the proposed
140.
▲
by
mbostock
8y ago
The parser has well-defined behavior for malformed whitespace, and it’s not to throw a syntax error: if you advance the indentation by more than one space on a following line, the extra spaces are ignored.
141.
▲
by
mbostock
8y ago
Parinfer is very cool! If you’re willing to use a custom editor for trees, you can clearly offer better usability than a standard text editor. But having a usable data format for standard text editors is also nice.
142.
▲
by
mbostock
8y ago
Use whatever you like. There’s not one data format that will be perfect in all situations. While S-expressions are more explicit, they also make it more likely that you’ll get a syntax error because of mismatched parentheses. The purpose of
143.
▲
by
mbostock
8y ago
The thread I linked describes the limitations of the approach you suggest, in particular, the ability to associate metadata not just with leaf nodes but also internal nodes, and not requiring the names of children to be unique. Of course yo
144.
▲
by
mbostock
8y ago
Your suggestion requires a fixed-depth hierarchy (such as three levels in your example), and then it requires a lot of redundancy. Here, I want to eliminate the redundancy not primarily for performance reasons, but to make it easier to edit
145.
▲
by
mbostock
8y ago
Yes. YAML would be more verbose and require more precise (error-prone) syntax. See this thread: https://twitter.com/mbostock/status/1075135178014482432
146.
▲
Comma-Separated Tree
(observablehq.com)
153 points
by
mbostock
8y ago
|
61 comments
147.
▲
by
mbostock
8y ago
Thank you for the encouragement!
148.
▲
by
mbostock
8y ago
Thanks! The ability to reuse code across notebooks—making notebooks analogous to ES modules—I hope is one of the most powerful and interesting features of Observable. You can see a few more examples of reusable notebooks here: https:/
149.
▲
by
mbostock
8y ago
We deployed it yesterday and announced it today.
150.
▲
Observable Playground
(beta.observablehq.com)
152 points
by
mbostock
8y ago
|
15 comments
More ›