Frühere | Chronologischer Index | Spätere | ||
Vorherige | Thematischer Index | Nächste |
Moin moin, man kann die kostbare Computeralgebra auch einmal anderweitig verwenden, Lukas 1.39 Maria aber machte sich auf in diesen Tagen und reiste rasch in das Bergland, in eine Stadt in Juda,
40 und sie kam in das Haus des Zacharias und begrüßte Elisabeth. und sprach das Magnificat: Clear[vf1, vf2, magnifiCat]; vf1[{xc_, yc_}, name_, {w_, h_}] := Block[{ws = w + StringLength[name]/(8. 72.)}, Rectangle[{xc - ws, yc - h}, {xc + ws, yc + h}, RoundingRadius -> h/4.] ] vf2[{xc_, yc_}, name_, {w_, h_}] := Text[Style[name, "Affiliation", Background -> Lighter[RandomSample[ColorData[103, "ColorList"], 1][[1]], 4/5]], {xc, yc}, {0, 0}] magnifiCat[o_Integer?Positive] := Block[{mag = {{1 (* id *), "Meine" (* char *), 1 (* sentence *)}, {2, "Seele", 1}, {3, "preist", 1}, {4, "die", 1}, {5, "Größe", 1}, {6, "des", 1}, {7, "Herrn", 1}, (* zeile 2 *) {8, "und", 2}, {9, "mein", 2}, {10, "Geist", 2}, {11, "jubelt", 2}, {12, "über", 2}, {13, "Gott", 2}, {14, ",", 2}, {15, "meinen", 2}, {16, "Retter", 2}, {17, ".", 2}, (* zeile 3 *) {18, "Denn", 3}, {19, "auf", 3}, {20, "die", 3}, {21, "Niedrigkeit", 3}, {22, "seiner", 3}, {23, "Magd", 3}, {24, "hat", 3}, {25, "er", 3}, {26, "geschaut", 3}, {27, ".", 3}, (* zeile 4 *){28, "Siehe", 4}, {29, ",", 4}, {30, "von", 4}, {31, "nun", 4}, {32, "an", 4}, {33, "preisen", 4}, {34, "mich", 4}, {35, "selig", 4}, {36, "alle", 4}, {37, "Geschlechter", 4}, {38, ".", 4}, (* zeile 5 *) {39, "Denn", 5}, {40, "der", 5}, {41, "Mächtige", 5}, {42, "hat", 5}, {43, "Großes", 5}, {44, "an", 5}, {45, "mir", 5}, {46, "getan", 5}, {47, "und", 5}, {48, "sein", 5}, {49, "Name "(*!*), 5}, {50, "ist", 5}, {51, "heilig", 5}, {52, ".", 5}, (* zeile 6 *) {53, "Er", 6}, {54, "erbarmt", 6}, {55, "sich", 6}, {56, "von", 6}, {57, "Geschlecht", 6}, {58, "zu", 6}, {59, "Geschlecht", 6}, {60, "über", 6}, {61, "alle", 6}, {62, ",", 6}, {63, "die", 6}, {64, "ihn", 6}, {65, "fürchten", 6}, {66, ".", 6}, (* zeile 7 *){67, "Er", 7}, {68, "vollbringt", 7}, {69, "mit", 7}, {70, "seinem", 7}, {71, "Arm", 7}, {72, "machtvolle", 7}, {73, "Taten", 7}, {74, ":", 7}, (* zeile 8 *) {75, "Er", 8}, {76, "zerstreut", 8}, {77, ",", 8}, {78, "die", 8}, {79, "im", 8}, {80, "Herzen", 8}, {81, "voll", 8}, {82, "Hochmut", 8}, {83, "sind", 8}, {84, ";", 8}, (* zeile 9 *) {85, "er", 9}, {86, "stürzt", 9}, {87, "die", 9}, {88, "Mächtigen", 9}, {89, "vom", 9}, {90, "Thron", 9}, {91, "und", 9}, {92, "erhöht", 9}, {93, "die", 9}, {94, "Niedrigen", 9}, {95, ".", 9}, (* zeile 10 *) {96, "Die", 10}, {97, "Hungernden", 10}, {98, "beschenkt", 10}, {99, "er", 10}, {100, "mit", 10}, {101, "seinen", 10}, {102, "Gaben", 10}, {103, "und", 10}, {104, "lässt", 10}, {105, "die", 10}, {106, "Reichen", 10}, {107, "leer", 10}, {108, "ausgehen", 10}, {109, ".", 10}, (* zeile 11 *) {110, "Er", 11}, {111, "nimmt", 11}, {112, "sich", 11}, {113, "seines", 11}, {114, "Knechtes", 11}, {115, "Israel", 11}, {116, "an", 11}, {117, "und", 11}, {118, "denkt", 11}, {119, "an", 11}, {120, "sein", 11}, {121, "Erbarmen", 11}, {122, ",", 11}, (* zeile 12 *){123, "das", 12}, {124, "er", 12}, {125, "unsern", 12}, {126, "Vätern", 12}, {127, "verheißen", 12}, {128, "hat", 12}, {129, ",", 12}, {130, "Abraham", 12}, {131, "und", 12}, {132, "seinen", 12}, {133, "Nachkommen", 12}, {134, "auf", 12}, {135, "ewig", 12}}, colorListNr = 103, pfeiL = {{.021, .91}}, kantenStil = {}, k0 = {}, k1 = {}, k2 = {}, kantenKennung = {}, eckenStil = {}}, If[ArrayQ[mag], If[Range[Length[mag]] == mag[[All, 1]], If[Range[Length[Union[mag[[All, 3]]]]] == Union[mag[[All, 3]]], If[ Length[ColorData[colorListNr, "ColorList"]] < Length[Union[mag[[All, 3]]]], Print["Some colors will appear twice. colorListNr = ", colorListNr, " | #sentences = ", Length[Union[map[[All, 3]]]]] ], (* else *) Print["Row numbers not in sequence. Bye."]; Return[$Failed] ],(* else *) Print["Identities not in range. Bye."]; Return[$Failed] ], (* else *) Print["Data loading error. Bye."]; Return[$Failed] ]; If[o == 5 \[Or] o == 6, (* inside a sentence *) For[oo = 1, oo <= Length[Union[mag[[All, 3]]]], ++oo, k0 = First[Transpose[ Select[mag[[All, 2 ;; 3]], (Last[#] == oo) &]]]; k1 = DirectedEdge @@@ Partition[k0, 2, 1]; AppendTo[kantenKennung, Rule[#, oo] & /@ k1]; AppendTo[kantenStil, Rule[#, {ColorData[colorListNr, oo], Thick, Arrowheads[pfeiL]}] & /@ k1]; If[oo > 1,(* between the sentences *) AppendTo[ kantenStil, {Rule[ DirectedEdge[Last[k2], First[k0]], {Gray, Dashed, Thick, Arrowheads[pfeiL]}]}] ]; k2 = k0; ] ]; If[o == 7, eckenStil = {} ]; Which[o == 1, mag[[All, 1]] (* id *), o == 2, mag[[All, 2]] (* characters *), o == 3, mag[[All, 3]] (* sentences *), o == 4, DirectedEdge @@@ Partition[mag[[All, 2]], 2, 1], o == 5, Flatten[kantenStil], o == 6, Flatten[kantenKennung], o == 7, eckenStil, True, Indeterminate ] ] /; o <= 7die Wirkung hängt stark von der Einbettung des Graphen ab, das GravityEmbedding lässt an eine gothische Fensterrose denken (siehe das Bildchen),
Graph[magnifiCat[4], VertexShape -> Inherited, VertexShapeFunction -> vf2, VertexSize -> .8, GraphLayout -> {"VertexLayout" -> "GravityEmbedding", "EdgeLayout" -> "HierarchicalEdgeBundling", "PackingLayout" -> "ClosestPackingCenter"},(* SpringElectricalEmbedding seems to be \ the default VertexLayout; GravityEmbedding is beautiful *) EdgeStyle -> magnifiCat[5], EdgeLabels -> magnifiCat[6]] während das SpringElectricalEmbedding Graph[magnifiCat[4], VertexShapeFunction -> "RoundedRectangle", VertexSize -> {.28, .07}, VertexLabels -> Placed["Name", Center], VertexStyle -> Hue[0.125, 0.7, 0.9], GraphLayout -> {"VertexLayout" -> "SpringElectricalEmbedding", "EdgeLayout" -> "HierarchicalEdgeBundling", "PackingLayout" -> "ClosestPackingCenter"}, VertexLabelStyle -> Directive[FontFamily -> "Arial", 12], EdgeShapeFunction -> ({Arrowheads[{{.012, .7}}], Arrow[#]} &), EdgeStyle -> magnifiCat[5], EdgeLabels -> magnifiCat[6] ]einen ganz anderen Eindruck vermittelt, bei dem der Hochmut und die machtvollen Taten herausschwingen.
Mit den besten Grüssen Udo.
magnificat-gravity.png
Description: PNG image
_______________________________________________ DMUG Deutschsprachiges Mathematica-Forum demug@XXXXXXX.ch http://www.mathematica.ch/mailman/listinfo/demug Archiv: http://www.mathematica.ch/archiv.html
Frühere | Chronologischer Index | Spätere | ||
Vorherige | Thematischer Index | Nächste |
DMUG-Archiv, http://www.mathematica.ch/archiv.html