{"id":"0953ebf24e8ce5be","slug":"emoji-storm","trashed":false,"description":"","likes":44,"publish_level":"public","forks":3,"fork_of":null,"has_importers":false,"update_time":"2022-03-01T05:51:08.907Z","first_public_version":null,"paused_version":null,"publish_time":"2019-11-13T17:30:39.455Z","publish_version":177,"latest_version":177,"thumbnail":"3749fcfad2cf9c72cd45efe2ee3e2265a1ebac48f977eeaa9a572f9a80b7c3cd","default_thumbnail":"b207a46d713edfb8e6a880abbfdf1bb0fcf369414928dbf9045796c9fb87b659","roles":[],"sharing":null,"owner":{"id":"c8b34d926b5d440d","avatar_url":"https://avatars.observableusercontent.com/avatar/433f8326248db53a8d1ead342dfc4d46c845f915b422b6e7f6690ced0f18abd2","login":"rlesser","name":"Robert Lesser","bio":"MBA Candidate at Columbia, Software Engineer, Former Managing Web Editor @ The Michigan Daily. Building things I can see.","home_url":"https://twitter.com/RobertLesser_","type":"team","tier":"starter_2024"},"creator":{"id":"2a6984a21bf6bf27","avatar_url":"https://avatars.observableusercontent.com/avatar/433f8326248db53a8d1ead342dfc4d46c845f915b422b6e7f6690ced0f18abd2","login":"rlesser","name":"Robert Lesser","bio":"Product Engineer at Nomic AI | Building ways to see what's around us","home_url":"https://twitter.com/RobertLesser_","tier":"pro"},"authors":[{"id":"2a6984a21bf6bf27","avatar_url":"https://avatars.observableusercontent.com/avatar/433f8326248db53a8d1ead342dfc4d46c845f915b422b6e7f6690ced0f18abd2","name":"Robert Lesser","login":"rlesser","bio":"Product Engineer at Nomic AI | Building ways to see what's around us","home_url":"https://twitter.com/RobertLesser_","tier":"pro","approved":true,"description":""}],"collections":[],"files":[],"comments":[],"commenting_lock":null,"suggestion_from":null,"suggestions_to":[],"version":177,"title":"Emoji Storm ☔️","license":"isc","copyright":"Copyright 2020 Robert Lesser","nodes":[{"id":0,"value":"md`# Emoji Storm ☔️`","pinned":false,"mode":"js","data":null,"name":null},{"id":26,"value":"md`Every Emoji being used on twitter, in real time.`","pinned":false,"mode":"js","data":null,"name":null},{"id":137,"value":"svg = d3.create(\"svg\").attr(\"viewBox\", [0, 0, width, height]).node()","pinned":false,"mode":"js","data":null,"name":null},{"id":94,"value":"viewof mode = radio({\n  title: \"Mode\",\n  options: [{ label: 'Rain', value: 'rain' }, { label: 'Fade', value: 'fade' }],\n  value: 'rain'\n})","pinned":false,"mode":"js","data":null,"name":null},{"id":119,"value":"md`Credit to [Mike Bostock](https://observablehq.com/@mbostock) for [Wikipedia Recent Changes](https://observablehq.com/@mbostock/wikipedia-recent-changes) and [Matthew Rothenberg](https://twitter.com/mroth) for [emojitracker](http://emojitracker.com/).`","pinned":false,"mode":"js","data":null,"name":null},{"id":11,"value":"emojis = Generators.observe(notify => {\n  const source = new EventSource(\"https://stream.emojitracker.com/subscribe/eps\");\n  source.onmessage = message => notify(JSON.parse(message.data));\n  return () => source.close();\n})","pinned":true,"mode":"js","data":null,"name":null},{"id":16,"value":"update = Object.keys(emojis).forEach(mode === \"rain\" ? rain : fade)","pinned":true,"mode":"js","data":null,"name":null},{"id":132,"value":"function rain(k) {\n  d3.select(svg)\n    .append(\"text\")\n    .style(\"font\", \"25px sans-serif\")\n    .attr(\"x\", width * Math.random())\n    .attr(\"y\", -10 - Math.random() * 300)\n    .attr(\"dy\", \"0.35em\")\n    .attr(\"text-anchor\", \"middle\")\n    .attr(\"fill\", \"black\")\n    .attr(\"opacity\", 1)\n    .text(String.fromCodePoint(parseInt(k, 16)))\n    .transition()\n    .duration(4000)\n    .ease(t => (t < .8 ? d3.easeBounce(t) : 0))\n    .attr(\"y\", height - 10)\n    .remove();\n}","pinned":true,"mode":"js","data":null,"name":null},{"id":131,"value":"function fade(k) {\n  d3.select(svg)\n    .append(\"text\")\n    .style(\"font\", \"25px sans-serif\")\n    .attr(\"x\", width * Math.random())\n    .attr(\"y\", height * Math.random())\n    .attr(\"dy\", \"0.35em\")\n    .attr(\"text-anchor\", \"middle\")\n    .attr(\"fill\", \"black\")\n    .attr(\"opacity\", 1)\n    .text(String.fromCodePoint(parseInt(k, 16)))\n    .transition()\n    .duration(5000)\n    .ease(d3.easeLinear)\n    .attr(\"opacity\", 0)\n    .remove();\n}","pinned":true,"mode":"js","data":null,"name":null},{"id":130,"value":"height = 500","pinned":true,"mode":"js","data":null,"name":null},{"id":89,"value":"import {radio} from \"@jashkenas/inputs\"","pinned":true,"mode":"js","data":null,"name":null},{"id":5,"value":"d3 = require('d3@5')","pinned":true,"mode":"js","data":null,"name":null},{"id":149,"value":"import { footer } from \"@rlesser/footer\"","pinned":false,"mode":"js","data":null,"name":null},{"id":150,"value":"footer(\"emoji-storm\")","pinned":false,"mode":"js","data":null,"name":null}],"resolutions":[],"schedule":null,"last_view_time":null}