Better HN
topnewbestaskshowjobs
Log inSign up

chrisprice

84 karma · joined Sep 18, 2012 (14y ago) · 21 submissions

Submissions

1.

Mobiumata (a concatenation of Möbius strip and cellular automata)(blog.scottlogic.com ↗)

3 points · by chrisprice · 2y ago · discuss

comment 3y ago · link · parent

Just for a little bit of context lost in the HAD summary, this was not a serious build!

> ... what better way to show my appreciation to an infrequent Vim user, than to add another rarely useful peripheral to their bag!

> ... As much as I built the pedal for a joke, I can’t deny that there is something very satisfying about using it.

3.

Building a Rust-y Vim clutch with the Raspberry Pi 2040(blog.scottlogic.com ↗)

9 points · by chrisprice · 3y ago · discuss

4.

Efficiently loading D3 datasets using Apache Arrow(blog.scottlogic.com ↗)

2 points · by chrisprice · 5y ago · discuss

5.

Efficiently loading massive D3 datasets using Apache Arrow(blog.scottlogic.com ↗)

2 points · by chrisprice · 5y ago · discuss

6.

How the OpenAI Codex JavaScript Sandbox Works(blog.scottlogic.com ↗)

1 points · by chrisprice · 5y ago · discuss

comment 5y ago · link · parent

Here's another demo featuring the methods discussed in the paper https://d3fc.io/examples/sample/

comment 6y ago · link · parent

Thanks for the feedback. Depending upon the devicePixelRatio, interactions with the first chart would misbehave. I've just pushed a fix to the code, and updated the post, which should rattle through the various CDNs before too long.

9.

Fixing the D3-zoom API for my use-case(blog.scottlogic.com ↗)

13 points · by chrisprice · 6y ago · 5 comments

10.

Adding WebDriver tests to create-react-app generated projects(blog.scottlogic.com ↗)

2 points · by chrisprice · 9y ago · discuss

11.

Building components with D3 data join(blog.scottlogic.com ↗)

1 points · by chrisprice · 10y ago · discuss

comment 10y ago · link · parent

On a project I work on* we've found that this technique has worked well so far. We're slowly moving from v3 to v4 by splitting out groups of components into their own packages and upgrading them as we go. We've been heavily inspired by d3's approach e.g. with the use of rollup for bundling.

We're probably at about 60% of the library upgraded/split-out but we've yet to tackle the more tricky changes like d3-selection.

* https://github.com/d3fc

comment 10y ago · link · parent

What you see in the tweet is the code which runs in the animation loop. The animation loop is provided, along with all of the abbreviated function aliases, by this base file [1].

I've reproduced the guts of it below -

  d3.timer(function(t) {
    g.d([t]);
    if (window.tweet) {
      tweet(t);
    }
  });
The important bit is the t argument which is provided to the code you see in the tweet. Most of the animations are driven by this value, normally passed through a trigonometric function to provide some easing.

In the case of my Hello World example, the tweet code is as follows -

  // Perform a data-join [2] with the parent set to the root node provided 
  // by the base file, the data defaulting to [t] as above and with a 
  // built-in behavior of appending an SVG text element in the enter selection.
  T()
  // Set the following attributes on the text element -
  .a({
    // Affine transform the element using a sc-ale transform.
    // The scaling value is a function of the data item bound to the element (t).
    // s is an alias for Math.sin and 1e3 is just shorthand for 1000 (saves 1 character!)
    transform:d=>sc(4+s(d/1e3)),
    // Make use of another alias to offset the text based on the normalised mouse position.
    x:d=>mo[0]*10,
    y:d=>mo[1]*10
  })
  // Set the text content of the text element
  .t('Hello World')
This is by no means an exciting example but it should provide some clues as to how the more complex animations work.

[1] https://github.com/chrisprice/t-d3fc/blob/master/public/base... [2] http://bost.ocks.org/mike/join/

comment 10y ago · link · parent

The iframes load progressively as you scroll (vvo/lazyload). Every time one loads it requires you to click the back button an extra time (in Chrome at least).

comment 10y ago · link · parent

Yea I only spotted that this morning, must fix that one.

16.

How NSA and GCHQ Spied on the Cold War World(bbc.co.uk ↗)

36 points · by chrisprice · 11y ago · 6 comments

17.

5 things hip hop teaches us about UX Design(scottlogic.com ↗)

3 points · by chrisprice · 12y ago · discuss

18.

JSHint 3.0 drops style rules, JSCS to replace?(github.com ↗)

1 points · by chrisprice · 12y ago · discuss

19.

Knockout.js can now run natively in Node.js (without needing a DOM)(twitter.com ↗)

2 points · by chrisprice · 13y ago · discuss

20.

PropertyCross - Helping you select a cross-platform mobile framework(propertycross.com ↗)

11 points · by chrisprice · 13y ago · 5 comments

21.

Just what is the CSS 3D perspective property?(scottlogic.co.uk ↗)

2 points · by chrisprice · 14y ago · discuss