Skip to content

Commit 558f3b0

Browse files
committed
Update fonts
1 parent d3fdc68 commit 558f3b0

2 files changed

Lines changed: 108 additions & 108 deletions

File tree

javascripts/main.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,18 @@ function loadNewData(event) {
8080

8181
function draw(data){
8282
//Layout data
83+
let font = "Arial";
8384
let interpolation = "cardinal";
8485
let axisPadding = 10;
8586
let margins = {left: 20, top: 20, right: 10, bottom: 30};
8687
let ws = d3.layout.wordStream()
8788
.size([width, height])
8889
.interpolate(interpolation)
89-
//.fontScale(d3.scale.pow().exponent(2))
9090
.fontScale(d3.scale.linear())
9191
.minFontSize(4)
9292
.maxFontSize(36)
93-
.data(data);
93+
.data(data)
94+
.font(font);
9495
let boxes = ws.boxes();
9596

9697
//Display data
@@ -169,15 +170,13 @@ function draw(data){
169170
}).append('text')
170171
.text(function(d){return d.text;})
171172
.attr({
172-
'font-family': 'Impact',
173+
'font-family': font,
173174
'font-size': function(d){return d.fontSize;},
174-
//fill: function(d){return topicColorMap(d.topic);},
175-
//fill: function(d, i){return color(i);},
176175
fill: function(d, i){return termColorMap(d.text);},
177176
'text-anchor': 'middle',
178177
'alignment-baseline': 'middle',
179178
topic: function(d){return d.topic;},
180-
visibility: function(d, i){ return d.placed ? (placed? "visible": "hidden"): (placed? "hidden": "visible");}
179+
visibility: function(d){ return d.placed ? (placed? "visible": "hidden"): (placed? "hidden": "visible");}
181180
});
182181
//Try
183182
let prevColor;

0 commit comments

Comments
 (0)