Luke is better, and it's Christmas! Fix up the case where there aren't 200 words.
authorBenjamin Smedberg <>
Fri, 12 Dec 2008 16:53:51 -0500
changeset 12 e50e4b275149fcb0093c0171167440b8c14ebdb7
parent 11 1d79c88c68bbc0d2310699753197e7e07df619bb
child 13 51e58ba88e409185a36c704ce41ad1e00b5738f5
push id2
push dateFri, 12 Dec 2008 22:00:40 +0000
Luke is better, and it's Christmas! Fix up the case where there aren't 200 words.
--- a/wordmap.html
+++ b/wordmap.html
@@ -17,80 +17,256 @@
   &lt;canvas&gt; element</a> and
   <p>Note: currently requires Firefox 3.1. If you'd like to host it
   yourself, or hack it, <a
   the code here</a>.
+  <textarea id="inputtext" cols="80" rows="10">
+Inasmuch as many have undertaken to compile a narrative of the things which have been accomplished among us,
+just as they were delivered to us by those who from the beginning were eyewitnesses and ministers of the word,
+it seemed good to me also, having followed all things closely for some time past, to write an orderly account for you, most excellent The-oph'ilus,
+that you may know the truth concerning the things of which you have been informed.
+In the days of Herod, king of Judea, there was a priest named Zechari'ah, of the division of Abi'jah; and he had a wife of the daughters of Aaron, and her name was Elizabeth.
+And they were both righteous before God, walking in all the commandments and ordinances of the Lord blameless.
+But they had no child, because Elizabeth was barren, and both were advanced in years.
+Now while he was serving as priest before God when his division was on duty,
+according to the custom of the priesthood, it fell to him by lot to enter the temple of the Lord and burn incense.
+And the whole multitude of the people were praying outside at the hour of incense.
+And there appeared to him an angel of the Lord standing on the right side of the altar of incense.
+And Zechari'ah was troubled when he saw him, and fear fell upon him.
+But the angel said to him, "Do not be afraid, Zechari'ah, for your prayer is heard, and your wife Elizabeth will bear you a son, and you shall call his name John.
+And you will have joy and gladness,
+and many will rejoice at his birth;
+for he will be great before the Lord,
+and he shall drink no wine nor strong drink,
+and he will be filled with the Holy Spirit,
+even from his mother's womb.
+And he will turn many of the sons of Israel to the Lord their God,
+and he will go before him in the spirit and power of Eli'jah,
+to turn the hearts of the fathers to the children,
+and the disobedient to the wisdom of the just,
+to make ready for the Lord a people prepared."
+And Zechari'ah said to the angel, "How shall I know this? For I am an old man, and my wife is advanced in years."
+And the angel answered him, "I am Gabriel, who stand in the presence of God; and I was sent to speak to you, and to bring you this good news.
+And behold, you will be silent and unable to speak until the day that these things come to pass, because you did not believe my words, which will be fulfilled in their time."
+And the people were waiting for Zechari'ah, and they wondered at his delay in the temple.
+And when he came out, he could not speak to them, and they perceived that he had seen a vision in the temple; and he made signs to them and remained dumb.
+And when his time of service was ended, he went to his home.
+After these days his wife Elizabeth conceived, and for five months she hid herself, saying,
+"Thus the Lord has done to me in the days when he looked on me, to take away my reproach among men."
+In the sixth month the angel Gabriel was sent from God to a city of Galilee named Nazareth,
+to a virgin betrothed to a man whose name was Joseph, of the house of David; and the virgin's name was Mary.
+And he came to her and said, "Hail, O favored one, the Lord is with you!"
+But she was greatly troubled at the saying, and considered in her mind what sort of greeting this might be.
+And the angel said to her, "Do not be afraid, Mary, for you have found favor with God.
+And behold, you will conceive in your womb and bear a son, and you shall call his name Jesus.
+He will be great, and will be called the Son of the Most High;
+and the Lord God will give to him the throne of his father David,
+and he will reign over the house of Jacob for ever;
+and of his kingdom there will be no end."
+And Mary said to the angel, "How shall this be, since I have no husband?"
+And the angel said to her, "The Holy Spirit will come upon you,
+and the power of the Most High will overshadow you;
+therefore the child to be born will be called holy,
+the Son of God.
+And behold, your kinswoman Elizabeth in her old age has also conceived a son; and this is the sixth month with her who was called barren.
+For with God nothing will be impossible."
+And Mary said, "Behold, I am the handmaid of the Lord; let it be to me according to your word." And the angel departed from her.
+In those days Mary arose and went with haste into the hill country, to a city of Judah,
+and she entered the house of Zechari'ah and greeted Elizabeth.
+And when Elizabeth heard the greeting of Mary, the babe leaped in her womb; and Elizabeth was filled with the Holy Spirit
+and she exclaimed with a loud cry, "Blessed are you among women, and blessed is the fruit of your womb!
+And why is this granted me, that the mother of my Lord should come to me?
+For behold, when the voice of your greeting came to my ears, the babe in my womb leaped for joy.
+And blessed is she who believed that there would be a fulfilment of what was spoken to her from the Lord."
+And Mary said, "My soul magnifies the Lord,
+and my spirit rejoices in God my Savior,
+for he has regarded the low estate of his handmaiden.
+For behold, henceforth all generations will call me blessed;
+for he who is mighty has done great things for me,
+and holy is his name.
+And his mercy is on those who fear him
+from generation to generation.
+He has shown strength with his arm,
+he has scattered the proud in the imagination of their hearts,
+he has put down the mighty from their thrones,
+and exalted those of low degree;
+he has filled the hungry with good things,
+and the rich he has sent empty away.
+He has helped his servant Israel,
+in remembrance of his mercy,
+as he spoke to our fathers,
+to Abraham and to his posterity for ever."
+And Mary remained with her about three months, and returned to her home.
+Now the time came for Elizabeth to be delivered, and she gave birth to a son.
+And her neighbors and kinsfolk heard that the Lord had shown great mercy to her, and they rejoiced with her.
+And on the eighth day they came to circumcise the child; and they would have named him Zechari'ah after his father,
+but his mother said, "Not so; he shall be called John."
+And they said to her, "None of your kindred is called by this name."
+And they made signs to his father, inquiring what he would have him called.
+And he asked for a writing tablet, and wrote, "His name is John." And they all marveled.
+And immediately his mouth was opened and his tongue loosed, and he spoke, blessing God.
+And fear came on all their neighbors. And all these things were talked about through all the hill country of Judea;
+and all who heard them laid them up in their hearts, saying, "What then will this child be?" For the hand of the Lord was with him.
+And his father Zechari'ah was filled with the Holy Spirit, and prophesied, saying,
+"Blessed be the Lord God of Israel,
+for he has visited and redeemed his people,
+and has raised up a horn of salvation for us
+in the house of his servant David,
+as he spoke by the mouth of his holy prophets from of old,
+that we should be saved from our enemies,
+and from the hand of all who hate us;
+to perform the mercy promised to our fathers,
+and to remember his holy covenant,
+the oath which he swore to our father Abraham,
+to grant us that we, being delivered from the hand of our enemies,
+might serve him without fear,
+in holiness and righteousness before him all the days of our life.
+And you, child, will be called the prophet of the Most High;
+for you will go before the Lord to prepare his ways,
+to give knowledge of salvation to his people
+in the forgiveness of their sins,
+through the tender mercy of our God,
+when the day shall dawn upon us from on high
+to give light to those who sit in darkness and in the shadow of
+to guide our feet into the way of peace."
+And the child grew and became strong in spirit, and he was in the wilderness till the day of his manifestation to Israel.
+In those days a decree went out from Caesar Augustus that all the world should be enrolled.
+This was the first enrollment, when Quirin'i-us was governor of Syria.
+And all went to be enrolled, each to his own city.
+And Joseph also went up from Galilee, from the city of Nazareth, to Judea, to the city of David, which is called Bethlehem, because he was of the house and lineage of David,
+to be enrolled with Mary, his betrothed, who was with child.
+And while they were there, the time came for her to be delivered.
+And she gave birth to her first-born son and wrapped him in swaddling cloths, and laid him in a manger, because there was no place for them in the inn.
+And in that region there were shepherds out in the field, keeping watch over their flock by night.
+And an angel of the Lord appeared to them, and the glory of the Lord shone around them, and they were filled with fear.
+And the angel said to them, "Be not afraid; for behold, I bring you good news of a great joy which will come to all the people;
+for to you is born this day in the city of David a Savior, who is Christ the Lord.
+And this will be a sign for you: you will find a babe wrapped in swaddling cloths and lying in a manger."
+And suddenly there was with the angel a multitude of the heavenly host praising God and saying,
+"Glory to God in the highest,
+and on earth peace among men with whom he is pleased!"
+When the angels went away from them into heaven, the shepherds said to one another, "Let us go over to Bethlehem and see this thing that has happened, which the Lord has made known to us."
+And they went with haste, and found Mary and Joseph, and the babe lying in a manger.
+And when they saw it they made known the saying which had been told them concerning this child;
+and all who heard it wondered at what the shepherds told them.
+But Mary kept all these things, pondering them in her heart.
+And the shepherds returned, glorifying and praising God for all they had heard and seen, as it had been told them.
+And at the end of eight days, when he was circumcised, he was called Jesus, the name given by the angel before he was conceived in the womb.
+And when the time came for their purification according to the law of Moses, they brought him up to Jerusalem to present him to the Lord
+(as it is written in the law of the Lord, "Every male that opens the womb shall be called holy to the Lord")
+and to offer a sacrifice according to what is said in the law of the Lord, "a pair of turtledoves, or two young pigeons."
+Now there was a man in Jerusalem, whose name was Simeon, and this man was righteous and devout, looking for the consolation of Israel, and the Holy Spirit was upon him.
+And it had been revealed to him by the Holy Spirit that he should not see death before he had seen the Lord's Christ.
+And inspired by the Spirit he came into the temple; and when the parents brought in the child Jesus, to do for him according to the custom of the law,
+he took him up in his arms and blessed God and said,
+"Lord, now lettest thou thy servant depart in peace,
+according to thy word;
+for mine eyes have seen thy salvation
+which thou hast prepared in the presence of all peoples,
+a light for revelation to the Gentiles,
+and for glory to thy people Israel."
+And his father and his mother marveled at what was said about him;
+and Simeon blessed them and said to Mary his mother, "Behold, this child is set for the fall and rising of many in
+and for a sign that is spoken against
+(and a sword will pierce through your own soul also),
+that thoughts out of many hearts may be revealed."
+And there was a prophetess, Anna, the daughter of Phan'u-el, of the tribe of Asher; she was of a great age, having lived with her husband seven years from her virginity,
+and as a widow till she was eighty-four. She did not depart from the temple, worshiping with fasting and prayer night and day.
+And coming up at that very hour she gave thanks to God, and spoke of him to all who were looking for the redemption of Jerusalem.
+And when they had performed everything according to the law of the Lord, they returned into Galilee, to their own city, Nazareth.
+And the child grew and became strong, filled with wisdom; and the favor of God was upon him.
+Now his parents went to Jerusalem every year at the feast of the Passover.
+And when he was twelve years old, they went up according to custom;
+and when the feast was ended, as they were returning, the boy Jesus stayed behind in Jerusalem. His parents did not know it,
+but supposing him to be in the company they went a day's journey, and they sought him among their kinsfolk and acquaintances;
+and when they did not find him, they returned to Jerusalem, seeking him.
+After three days they found him in the temple, sitting among the teachers, listening to them and asking them questions;
+and all who heard him were amazed at his understanding and his answers.
+And when they saw him they were astonished; and his mother said to him, "Son, why have you treated us so? Behold, your father and I have been looking for you anxiously."
+And he said to them, "How is it that you sought me? Did you not know that I must be in my Father's house?"
+And they did not understand the saying which he spoke to them.
+And he went down with them and came to Nazareth, and was obedient to them; and his mother kept all these things in her heart.
+And Jesus increased in wisdom and in stature, and in favor with God
+and man.
+  </textarea>
+  <input type="button" onclick="asyncTextMap()" value="Generate
+  wordmap from this Text">
   <input type="button" value="Wordmap of BSBlog" onclick="asyncFeedMap()">
   Choose a font:
   <input type="text" value="Papyrus, URW Palladio L" id="font" onchange="setFont()">
-  Status: <span id="status"></span>
-  <input type="button" value="Stop" onclick="cancel()">
+  <div>
+    Status: <span id="status"></span>
+    <input type="button" value="Stop" onclick="cancel()">
+  </div>
   <canvas width="800" height="800" id="cc"
     style="border: 1px solid black; display: block"></canvas>
-  <textarea id="inputtext" cols="80" rows="20">
- In the beginning God created the heavens and the earth.
- The earth was without form and void, and darkness was upon the face of the deep; and the Spirit of God was moving over the face of the waters.
- And God said, "Let there be light"; and there was light.
- And God saw that the light was good; and God separated the light from the darkness.
- God called the light Day, and the darkness he called Night. And there was evening and there was morning, one day.
-And God said, "Let there be a firmament in the midst of the waters, and let it separate the waters from the waters."
- And God made the firmament and separated the waters which were under the firmament from the waters which were above the firmament. And it was so.
- And God called the firmament Heaven. And there was evening and there was morning, a second day.
-And God said, "Let the waters under the heavens be gathered together into one place, and let the dry land appear." And it was so.
- God called the dry land Earth, and the waters that were gathered together he called Seas. And God saw that it was good.
- And God said, "Let the earth put forth vegetation, plants yielding seed, and fruit trees bearing fruit in which is their seed, each according to its kind, upon the earth." And it was so.
- The earth brought forth vegetation, plants yielding seed according to their own kinds, and trees bearing fruit in which is their seed, each according to its kind. And God saw that it was good.
- And there was evening and there was morning, a third day.
-And God said, "Let there be lights in the firmament of the heavens to separate the day from the night; and let them be for signs and for seasons and for days and years,
- and let them be lights in the firmament of the heavens to give light upon the earth." And it was so.
- And God made the two great lights, the greater light to rule the day, and the lesser light to rule the night; he made the stars also.
- And God set them in the firmament of the heavens to give light upon the earth,
- to rule over the day and over the night, and to separate the light from the darkness. And God saw that it was good.
- And there was evening and there was morning, a fourth day.
-And God said, "Let the waters bring forth swarms of living creatures, and let birds fly above the earth across the firmament of the heavens."
- So God created the great sea monsters and every living creature that moves, with which the waters swarm, according to their kinds, and every winged bird according to its kind. And God saw that it was good.
- And God blessed them, saying, "Be fruitful and multiply and fill the waters in the seas, and let birds multiply on the earth."
- And there was evening and there was morning, a fifth day.
-And God said, "Let the earth bring forth living creatures according to their kinds: cattle and creeping things and beasts of the earth according to their kinds." And it was so.
- And God made the beasts of the earth according to their kinds and the cattle according to their kinds, and everything that creeps upon the ground according to its kind. And God saw that it was good.
-Then God said, "Let us make man in our image, after our likeness; and let them have dominion over the fish of the sea, and over the birds of the air, and over the cattle, and over all the earth, and over every creeping thing that creeps upon the earth."
- So God created man in his own image, in the image of God he created him; male and female he created them.
- And God blessed them, and God said to them, "Be fruitful and multiply, and fill the earth and subdue it; and have dominion over the fish of the sea and over the birds of the air and over every living thing that moves upon the earth."
- And God said, "Behold, I have given you every plant yielding seed which is upon the face of all the earth, and every tree with seed in its fruit; you shall have them for food.
- And to every beast of the earth, and to every bird of the air, and to everything that creeps on the earth, everything that has the breath of life, I have given every green plant for food." And it was so.
- And God saw everything that he had made, and behold, it was very good. And there was evening and there was morning, a sixth day.
-  </textarea>
-  <input type="button" onclick="asyncTextMap()" value="Generate
-  wordmap from this Text">
   <canvas width="800" height="800" id="chidden" style="display: none"></canvas>
   <iframe src="about:blank" id="i" style="display: none"></iframe>
   <script type="application/javascript;version=1.8" src="wordmap.js">
--- a/wordmap.js
+++ b/wordmap.js
@@ -383,17 +383,17 @@ function draw(text)
   vertical = Math.random() < kVerticalRatio;
   [wdata, wshadow] = drawWord(cx, word, size, vertical);
   x = normalInt(0, kWidth - wdata.width, 2);
   y = normalInt(0, kHeight - wdata.height, 2);
   merge(imgdata, wdata, x, y);
   usercx.putImageData(imgdata, 0, 0);
-  for (let i = 1; i < 200; ++i) {
+  for (let i = 1; i < totalcount; ++i) {
     let [word, size] = words[i];
     setStatus("Placing word '" + word + "': " + (i + 1) + "/" + totalcount);
     vertical = Math.random() < kVerticalRatio;
     [wdata, wshadow] = drawWord(cx, word, size, vertical);