Skip to content

Commit

Permalink
Framework for next post
Browse files Browse the repository at this point in the history
  • Loading branch information
kurrik committed Apr 14, 2017
1 parent fb24d8a commit 4fccd5c
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 2 deletions.
4 changes: 3 additions & 1 deletion blog.roomanna.com/src/javascript/package.json
Expand Up @@ -18,14 +18,16 @@
"bootstrap": "^3.3.7",
"chai": "^3.5.0",
"css-loader": "^0.26.1",
"d3": "^4.3.0",
"d3": "^4.7.4",
"exports-loader": "^0.6.3",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.11.1",
"icanhaz": "^0.10.3",
"imports-loader": "^0.6.5",
"jquery": "^3.1.1",
"mocha": "^3.1.2",
"photoswipe": "^4.1.1",
"seedrandom": "^2.4.2",
"style-loader": "^0.13.1",
"url-loader": "^0.5.8",
"webpack": "^1.13.3"
Expand Down
Empty file.
24 changes: 24 additions & 0 deletions blog.roomanna.com/src/javascript/src/post039/main.js
@@ -0,0 +1,24 @@
import './main.css';
import 'seedrandom';
import * as d3 from 'd3';

Math.seedrandom('hello.');
console.log('foo', d3);
console.log(d3.randomExponential(1/40)());

const tweetCountGenerator = d3.randomNormal(20, 10.0);
const impressionCountGenerator = d3.randomNormal(100, 10.0);
const impressionTimestampGenerator = d3.randomExponential(1/40);

let points = [];
const tweetCount = Math.round(tweetCountGenerator());
for (let i = 0; i < tweetCount; i++) {
const impressionCount = Math.round(impressionCountGenerator());
points.push([]);
for (let j = 0; j < impressionCount; j++) {
const timestamp = impressionTimestampGenerator();
points[i].push(timestamp);
}
}

console.log('points', points);
3 changes: 2 additions & 1 deletion blog.roomanna.com/src/javascript/webpack.config.js
Expand Up @@ -10,7 +10,8 @@ var config = {
'post031': './src/post031/main.js',
'post032': './src/post032/main.js',
'post035': './src/post035/main.js',
'post038': './src/post038/main.js'
'post038': './src/post038/main.js',
'post039': './src/post039/main.js'
},
output: {
path: path.join(__dirname, '../../build/content/static'),
Expand Down
5 changes: 5 additions & 0 deletions blog.roomanna.com/src/site/posts/039-timebox/body.md
@@ -0,0 +1,5 @@
This is the post snippet.

<!--BREAK-->

This is content after the break.
10 changes: 10 additions & 0 deletions blog.roomanna.com/src/site/posts/039-timebox/meta.yaml
@@ -0,0 +1,10 @@
date: 04-13-2017
slug: timebox
title: Timebox
tags:
- twitter
- product
scripts:
- /static/js/post039.js
styles:
- /static/css/post039.css

0 comments on commit 4fccd5c

Please sign in to comment.