A collection of tweet-sized D3 creations – to add yours, just tweet the code
t.d3fc.io
t.d3fc.io
Producing a "selfie" is, by definition, working within an artistic constraint, and when I read your post I had to assume that we had already seen many "selfie artists", which seems to be the case:
http://www.huffingtonpost.com/entry/10-artists-who-use-selfi...
https://en.wikipedia.org/wiki/File:Raffaello_Sanzio.jpg
No selfies in the canon here:
https://en.wikipedia.org/wiki/File:Kirchner_1919_portrait.jp...
Utterly unimaginable:
https://en.wikipedia.org/wiki/File:Muybridge_disk_step_walk....
The benefits of limitation is an old theme in discussion of creativity. But in this case, the arbitrary constraint also provides the inspiration. I mean, 140 characters is an enticing challenge, an excuse to shield yourself from self-criticism, and a less intimidating scope when you're deciding to start a project.
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/
Makes me want to learn d3 finally.
Edit: Some Ctrl+F resulted in "console.log("halp"); alert("you've been XSSd");" from "Harrison Shoebridge". Naff.
I ran a 'write a game in a tweet' challenge last year, was super fun and had heaps of creative entries (mostly javascript). https://twitter.com/eigenbom/status/614783132391247872
All: Before responding to new work with swipes, dismissals, or nitpicks, try mentally multiplying their effect by 10x. That seems to be about the magnitude by which we underestimate how such stuff comes across. Adjust accordingly, and then you can offer criticisms and corrections without adding air pollution.
One thing we've learned is that you can't judge this phenomenon accurately by upvotes. Indignation of any kind reliably gets more upvotes than anything else, by a large margin.