D3 uden data binding

Man plejer som regel at bruge D3 data binding for at lave koden afkoblet.

Data binding er vigtig fordi:

  1. Det gør koden mindre. For eksempel som der blev vist i forrige artikel kan man lave en cirkel men en ligne. Uden data binding bruger man 4 ligner for en cirkel(Se eksempel nedenfor)
  2. Når man han data ligende et sted dkal man kun ændre et sted, i stedet for alle mulige steder i koden
  3. Hvis man har al funktionalitet liggende i et program har fejl støre sansynlighed for at trække det hele ned.

Uden data binding behøves man ikke at starte en python server.

<!DOCTYPE html>
<body></body>
<script src="d3.v3.min.js"></script>
<script>
    var svg = d3.select("body").append("svg")
        .attr("width", 500)
        .attr("height", 500);

svg.append("circle")
    .attr("cx", 150)
    .attr("cy", 100)
    .attr("r", 70);

svg.append("circle")
    .attr("cx", 100)
    .attr("cy", 200)
    .attr("r", 40);

svg.append("circle")
    .attr("cx", 300)
    .attr("cy", 200)
    .attr("r", 50);

 d3.selectAll("circle")
    .attr("fill", "RoyalBlue" )

</script>

Introduktion til D3

I denne artikelserie vil jeg vise jer hvordan D3 fungerer.

D3 er et Javascript bibliotek som bliver brugt til at lave visuailseringer.

Visualiseringer af data er vigtige, fordi det gør det lettere at forstå sammenhæng, som dataene viser.

D3 er et godt værktøj, fordi man let kan læse data ind og derefter lave grafer og illustrationer .

Koden nedenfor viser et simpelt lille program, som tegner cirkler ud fra de data, som  findes i csv filen circles.csv

<!DOCTYPE HTML>
<body></body>
<script src="d3.v3.min.js"></script>
<script>
d3.csv("circles.csv", function (error, data){
    var svg = d3.select("body").append("svg")
        .attr("width", 500)
        .attr("height", 500);
    svg.selectAll("circle")
        .data(data).enter()
        .append("circle")
            .attr("cx", function(d) {return d.x})
            .attr("cy", function(d) {return d.y})
            .attr("r", function(d) {return d.r})
            .attr("fill", "none")
            .attr("stroke", function(d) {return d.c})
            .attr("stroke-width",9);
});
</script>
Indhold af circles.csv
x,y,r,c
400,300,90,Green
100,90,80,Blue
200,200,70,Red
250,200,60,Yellow
200,400,50,Black
90,200,40,Magenta
200,200,30,Pink
200,400,20,RoyalBlue
20,150,10,Gold
Her er det endelige resultat:

D3Circles

For at eksekvere koden skal man starte en python server i en terminal. Her er kommandoen:

python -m SimpleHTTPServer
Og pege browseren på localhost:8000

Det her er påkrævet får at html-filen skal have adgang til csv-filen.

Laver man ren html og Javascript, kan man åbne filen direkte fra browseren.

Halloween 2016

Halloween 2016

Happy Halloween -_-

Den Dansk-franske skole

Vi (elever) har skrevet nogle tekster om Halloween.

Der står om Halloweens historie, Stingy Jack og endda en opskrift til en ”græskar tærte”. Alt sammen på både dansk og engelsk.

Allehelgensaften er aftenen før allehelgensdag, som altid falder den første søndag i november.

Ifølge folketroen er allehelgensaften den aften, hvor hekse, genfærd og mørkets magter slipper løs for at håne de helgener, der festligholdes på allehelgensdag. Du vil læse lidt mere om ”Allehelgensdag” senere.

Halloween, der kommer fra de engelsksprogede lande er næsten magen til Allehelgensaften. Helligdagen fejres efter traditionen den 31. oktober. Men man er begyndt at fejre Allehelgensaften den selv samme dag som Halloween. Allehelgensaften hed oprindeligtSam Hain. Allehelgensdag også kaldt ”HellemisseDagen er for at mindes om alle kristne helgener og martyrer. Ordet “Halloween” er kort for “All Hallows’ Eve”. På Halloween går uhyggeligt påklædte børn og måske voksne rundt fra hus til hus og spørger om slik. Det er en tradition at sige ”Slik eller ballade” når døren bliver åbnet, på engelsk “Trick or Treat”. Nogle folk dekorerer også deres hus med uhyggelige græskar som også bliver kaldt ”Jack’O Lanterns”. Ifølge Keltisk tradition udskærer man sukkerroer, rødbeder, store kartofler og græskar med uhyggelige ansigter, for at skræmme spøgelser væk.

Skrevet af: Basile

Source: Wikipedia

 

Paganism

Paganism is the name for a heathen, a person with pagan beliefs that is, a person who is not a Christian jew or Muslim. The word is often considered synonymous for infidel. Once the Abrahamic religions started to become more widely adopted (in processes known as Christianization and Islamization), various names to describe those who did not adhere to them started to develop; some of these included Hellene, pagan, and heathen, and at times these names were used as slurs.

Research by: Sacha

Source: Wikipedia

 

Pumpkins in fall  Carved Pumkins

Why are Halloween colors black and orange? Quick answer: Orange is the most prevalent color in fall, when the holiday occurs, and black is the color of death, which is why these are the most common colors for Halloween. The Celtics may have been the first to use this color combination for Halloween.

Full answer: Besides being the color of autumn, orange signifies endurance and strength. Some people believe this strength and endurance was needed during the harvest season and the Celtics adopted the color to give them strength during battle.

Because Halloween was and, in some cultures, still is a way to celebrate the dead, and death is associated with an absence of light, black has become a color associated with death and, in turn, Halloween.

Research by: Alma Source: Reference

 

 

Jeg tror det siger sig selv ;D

All Hallows Eve is an altered version of an already existing holiday called “Samhain”.

It was invented by the Christians who didn’t like Samhain and thought that it was a ceremony for the evil spirits and demons.

In the beginning the Christians simply ignored Samhain and told others to do the same.

But when they realized, that people didn’t listen to them, and celebrated Samhain regardless of what they had been told, the Christians thought of another idea.

They made their own holiday with similar activities to Samhain but instead of celebrating the so called “evil spirits” it celebrated the good spirits.

The new holiday called “All Hallows Eve” quickly gained popularity throughout the lands and eventually overtook Samhain as the late October holiday. Trick or Treating used to be very different from what it is today.

It wasn’t originally children who went out to collect candy, it was actually old people.

And they collected all kinds of food instead of just candy.

Around medieval times, peasants began to come to people’s homes and ask for soul cakes (now known as cross buns) and would eat the cakes while praying for the dead.

Eventually Trick or Treating became a tradition for children to earn candy and have fun.

The tradition hasn’t changed since.

Written by: Louis

Source: ShareFaith

 

 

Toussaint's

Toussaint’s (All Saints day France)

Many Christians visit special church services on All Saints’ Day. They may also visit cemeteries and place flowers on the graves of deceased family members and close friends. It is customary to leave chrysanthemums or wreaths of artificial flowers on or close to the graves.

All Saints’ Day is also an opportunity for many people to spend time with family members and close friends. This holiday falls during the autumn (fall) school holidays it is a popular time for families to take a short vacation or to visit relatives living in other areas.

Public life in France is generally very quiet on All Saints’ Day. Post offices, banks, stores and other businesses are closed. Outside of tourist areas, restaurants and cafes may also be closed for one or more days. However, some stores in Paris, as well as at airport are open. A lot of people go to the graveyard to the visit dead people.

Research by: Alix

Source: Timeanddate

 

Pumpkin Pie 2                  Pumpkin Pie

Pumpkin Recipe: Ingredients:

 

  • 1 (15 ounce) can pumpkin puree
  • 3 egg yolks
  • 1 large egg
  • 1 (14 ounce) can sweetened condensed milk
  • 1 teaspoon ground cinnamon
  • 1/2 teaspoon ground ginger
  • 1/2 teaspoon fine salt
  • 1/4 teaspoon freshly grated nutmeg
  • 1 teaspoon of cardamom
  • 1 9-inch unbaked pie crust

 

 

Directions

  • Prep 15 m
  • Cook 45 m
  • Ready in 1 h
  1. Preheat oven to 425 degrees F (220 degrees C).
  2. Whisk together pumpkin puree, egg yolks, and egg in a large bowl until smooth. Add sweetened condensed milk, cinnamon, ginger, salt, nutmeg, and Chinese 5-spice powder; whisk until thoroughly combined.
  3. Fit pie crust in a 9-inch pie plate and crimp edges.
  4. Pour filling into the pie shell and lightly tap on the work surface to release any air bubbles.
  5. Bake in the preheated oven for 15 minutes.
  6. Reduce heat to 350 degrees F (175 degrees C) and bake until just set in the middle, 30 to 40 more minutes. A paring knife inserted into the filling, 1 inch from the crust, should come out clean. Allow to cool completely before serving.

THE LEGEND OF “STINGY JACK”

People have been making jack-o’-lanterns at Halloween for centuries. The practice originated from an Irish myth about a man nicknamed “Stingy Jack.” According to the story, Stingy Jack invited the Devil to have a drink with him. True to his name, Stingy Jack didn’t want to pay for his drink, so he convinced the Devil to turn himself into a coin that Jack could use to buy their drinks. Once the Devil did so, Jack decided to keep the money and put it into his pocket next to a silver cross, which prevented the Devil from changing back into his original form. Jack eventually freed the Devil, under the condition that he would not bother Jack for one year and that, should Jack die, he would not claim his soul. The next year, Jack again tricked the Devil into climbing into a tree to pick a piece of fruit. While he was up in the tree, Jack carved a sign of the cross into the tree’s bark so that the Devil could not come down until the Devil promised Jack not to bother him for ten more years.

Soon after, Jack died. As the legend goes, God would not allow such an unsavory figure into heaven. The Devil, upset by the trick Jack had played on him and keeping his word not to claim his soul, would not allow Jack into hell. He sent Jack off into the dark night with only a burning coal to light his way. Jack put the coal into a carved-out turnip and has been roaming the Earth with ever since. The Irish began to refer to this ghostly figure as “Jack of the Lantern,” and then, simply “Jack O’Lantern.”

In Ireland and Scotland, people began to make their own versions of Jack’s lanterns by carving scary faces into turnips or potatoes and placing them into windows or near doors to frighten away Stingy Jack and other wandering evil spirits. In England, large beets are used. Immigrants from these countries brought the jack o’lantern tradition with them when they came to the United States. They soon found that pumpkins, a fruit native to America, make perfect jack-o’-lanterns.

Source: History

Illustration down below:

 

Stingy Jack

“Illustration based on the original story of the Jack’ O Lantern.” Picture by: JAZZLANDSCAPES

 

 

 

Trick or Treat Trick or treating is an activity for children and adults on or around Halloween in which they proceed from house to house in costumes asking for treats. We are celebrating Halloween to commemorate the dead. And just a funny fact: Some people believes that the answer to why we are making scary pumpkins is that the pumpkins are keeping the bad ghosts away.

Text 2. About the day of the dead.

The Day of the Dead celebrations might seem to be very similar to Halloween. In both celebrations people dress up in costumes, there are a lot of skeletons everywhere, and there are special sweet treats and candies given out. Also people spend a lot of time in graveyards and death imagery is everywhere. But there are some big differences between the holiday that promotes fear of the dead and the holiday that celebrates the dead. The Day of the Dead holiday is about celebrating the dead, not being afraid of the dead. It’s a holiday for people to honor their ancestors and loved ones who have passed away and invite those spirits back into their homes to be part of the family once more. It’s a celebration of family and a show of respect for those who have passed away. And Halloween is a celebration where you commemorate the dead.

Written by: Nesa Source: Wikipedia

 

Day of the Dead

 

 

 

 

Demeter: The Goddess of Harvest

In Greek Religion and Greek mythology, Demeter is the goddess of the harvest and agriculture, who presided over grains and the fertility of the earth. Her cult titles include Sito, “she of the Grain”, as the giver of food or grain, and divine order, unwritten law bringer, (bearer), “Law-Bringer,” as a mark of the civilized existence of agricultural society.

Though Demeter is often described simply as the goddess of the harvest, she presided also over the sacred law, and the cycle of life and death. She and her daughter Persephone were the central figures of the Eleusinian Mysteries that predated the Olympian pantheon. In the Linear B Mycenean Greek tablets of circa 1400–1200 BC found at Pylos, the “two mistresses and the king” may be related with Demeter, Persephone and Poseidon. Her Roman equivalent is Ceres

Research by: Noah

Source: Wikipedia

Demeter.Goddess of Harvest 2Demeter.Goddess of Harvest

 

 

 

 

 

 

 

 

Woohooo ;)

Disse tekster og billeder er sat sammen og sat op på bloggen af Basile. -_-

 

 

Æble Kage

I onsdags var vi ude at plukke æbler.

Vores lærer Mirjam og skolens kok (Rob) er taget os med ud til skolehaverne hvor vi plukkede en masse æbler. Vi havde et par spande med derhen og de blev hurtigt fyldt op med æbler som vi alle havde været med til at plukke. Morvarid tog dog lidt flere billeder end æbler. Vi fik også et godt overblik over hvordan skolehaverne så ud. Vi plukkede også nogle spiselige blomster til at dekorere kagerne med, det var pigernes ide. Der var også nogle få dyr. Mens vi plukkede æbler så vi nogle bikuber, de fleste af os fik et chok siden der cirkulerede en masse bier omkring dem. Heldigvis var der ingen der blev stukket.

Og ca. efter tre kvarter i skolehaverne tog vi tilbage til skolen hvor vi både dekorede og smagte (måske lidt for meget) på vores lækre nybagte hjemmelavede forskellige æbledesserter.

Alt i alt havde vi en skøn dag.

Skrevet af Basile og Nesa

IMG_2253 IMG_2257

 IMG_2258 IMG_2256

Viktor, Noah, Louis, Sacha & Almas gruppe:

Vi har arbejdet med et projekt som handlede om at man skulle plukke æbler og bage en kage. Vores gruppe valgte så at lave en engelsk kage som hedder en ”Apple crumble”. Her er så vores opskrift:

Den nederste bund af kagen: 300g æbler 30g usaltet smør 30g sukker ¼tsk kanel ?g mandler

Toppen af kagen: 120g mel 60g sukker 60g usaltet smør

= Apple Crumble

 

IMG_2271  IMG_2262

Gisli, Marianna, Alborz & Nesa gruppe:

Ingredienser:

Æblerne hakkes i tern og koges med vanilje, kardemome & kanel.

Makroner og rasp knuses & blandes.

Fløde piskes med vaniljesukker og derefter lægges i lag i glasskål.

IMG_2261 IMG_2265 IMG_2270

 

Morvarid, Basile, Alix & Vilhelm:

(Opskrift kommer senere)

 

IMG_2263 IMG_2264 IMG_2266

IMG_2267 IMG_2269