Грех и ересь
На работе вместо работы получаю ачивки htmlacademy.ru
Вот заебут меня все, стану фронтенд разработчиком. Буду наверстовать упущенное
это важно
а я как считаю - любишь кататься люби и саночки возить
там аспиранты что нибудь откроют и их по телевидению покажут. а в офисе как был тухляк так он всегда тухляком и будет
читатель диареи, Мне нравится читать внутренние диалоги людей со мной, когда меня как человека не существует. Мне осталось немного тут посидеть и я буду заниматься чем хочу. Но тебе то лично, любые мои занятия кажутся бесполезной хуйней.
var chart = base.append("canvas") .attr("width", 400) .attr("height", 300);
var context = chart.node().getContext("2d");
var dataContainer = base.append("custom");
function drawCustom(data) {
var scale = d3.scale.linear() .range([10, 390]) .domain(d3.extent(data));
var dataBinding = dataContainer.selectAll("custom.rect")
.data(data, function(d) { return d; });
alert("custom.rect")
alert(dataContainer.selectAll("custom.rect"))
alert("databinding")
alert(dataBinding)
dataBinding
.attr("size", 15)
.attr("fillStyle", "green");
dataBinding.enter()
.append("custom")
.classed("rect", true)
.attr("x", scale)
.attr("y", 120)
.attr("size", 8)
.attr("fillStyle", "red");
alert(this)
alert("databinding2")
alert(dataBinding.attr.fillStyle)
dataBinding.exit()
//
.attr("size", 5)
.attr("fillStyle", "lightgrey");
alert("databinding3")
alert(dataBinding)
drawCanvas();
}
function drawCanvas() {
// clear canvas
context.fillStyle = "#fff";
context.rect(0,0,chart.attr("width"),chart.attr("height"));
context.fill();
var elements = dataContainer.selectAll("custom.rect");
elements.each(function(d) {
var node = d3.select(this);
context.beginPath();
context.fillStyle = node.attr("fillStyle");
context.rect(node.attr("x"), node.attr("y"), node.attr("size"), node.attr("size"));
context.fill();
context.closePath();
})
}
drawCustom([5,10,15,20,25]);
drawCustom([5,10,15,8,16]);
d3.select("body").selectAll("p")
and you’d be right, but there’s a catch: The paragraphs we want to select don’t exist yet. And this gets at one of the most common points of confusion with D3: How can we select elements that don’t yet exist? Bear with me, as the answer may require bending your mind a bit.
The answer lies with enter(), a truly magical method. Here’s our final code for this example, which I’ll explain:
d3.select("body").selectAll("p")
.data(dataset)
.enter()
.append("p")
.text("New paragraph!");
Now look at what that code does on this demo page. You see five new paragraphs, each with the same content. Here’s what’s happening.
d3.select("body") — Finds the body in the DOM and hands a reference off to the next step in the chain.
.selectAll("p") — Selects all paragraphs in the DOM. Since none exist yet, this returns an empty selection. Think of this empty selection as representing the paragraphs that will soon exist.
.data(dataset) — Counts and parses our data values. There are five values in our data set, so everything past this point is executed five times, once for each value.
.enter() — To create new, data-bound elements, you must use enter(). This method looks at the DOM, and then at the data being handed to it. If there are more data values than corresponding DOM elements, then enter() creates a new placeholder element on which you may work your magic. It then hands off a reference to this new placeholder to the next step in the chain.
.append("p") — Takes the placeholder selection created by enter() and inserts a p element into the DOM. Hooray! Then it hands off a reference to the element it just created to the next step in the chain.
.text("New paragraph!") — Takes the reference to the newly created p and inserts a text value.
1) в чём суть вашей работы?
2) как вы относитесь к перспективе сидеть до пенсии в тухлом офисе?
вот почитай, тебе очень пригодится в вебдизайне
bost.ocks.org/mike/join/
будешь работать космонавтом в CSSSR
хз чо такого в офисе, в моём офисе нормально
аспирантура - вот чего я хочу