Zur Beschreibungsseite auf Commons

Datei:BrownCabinet.svg

aus Wikipedia, der freien Enzyklopädie
Zur Navigation springen Zur Suche springen

Originaldatei(SVG-Datei, Basisgröße: 512 × 789 Pixel, Dateigröße: 13 KB)

Diese Datei und die Informationen unter dem roten Trennstrich werden aus dem zentralen Medienarchiv Wikimedia Commons eingebunden.

Zur Beschreibungsseite auf Commons


Beschreibung

Beschreibung
English: Graphical representation of the Gordon Brown cabinet.
Datum
Quelle Eigenes Werk
Urheber TimR
SVG‑Erstellung
InfoField
 
Der Quelltext dieser SVG-Datei ist W3C-invalid wegen 2 Fehlern.
 
Dieses W3C-invalide Chart wurde mit einem anderen SVG-Editor erstellt.
 
 Dieses Chart verwendet Text-Einbettung, die mit einem Texteditor leicht übersetzbar ist.
Quelltext
InfoField

SVG code

This is the source code for generating this image. It is made available under the terms of the GNU General Public License, Version 3.
#!/usr/bin/perl -w

############################################################################
# Version 1.1, 3 October 2009
#
# Copyright 2009 TimR. All rights reserved.
############################################################################

############################################################################
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
############################################################################

use strict;

my @colours = qw(
  blue
  blueviolet
  brown
  burlywood
  cadetblue
  chartreuse
  crimson
  darkblue
  darkcyan
  darkgreen
  darkgrey
  darkmagenta
  darkorange
  deepskyblue
  dimgrey
  forestgreen
  gold
  goldenrod
  hotpink
  indianred
  indigo
  khaki
  lawngreen
  lightblue
  lightcoral
  lightgreen
  lightgrey
  lightpink
  lightsalmon
  lightskyblue
  lightslategrey
  lightsteelblue
  lime
  limegreen
  magenta
  maroon
  mediumblue
  mediumorchid
  mediumpurple
  mediumseagreen
  mediumslateblue
  mediumspringgreen
  mediumturquoise
  mediumvioletred
  mistyrose
  moccasin
  navajowhite
  navy
  oldlace
  olive
  olivedrab
  orange
  orangered
  orchid
  palegoldenrod
  palegreen
  paleturquoise
  palevioletred
  papayawhip
  peachpuff
  peru
  pink
  plum
  powderblue
  purple
  red
  rosybrown
  royalblue
  saddlebrown
  salmon
  sandybrown
  seagreen
  seashell
  sienna
  silver
  skyblue
  slateblue
  slategray
  slategrey
  snow
  springgreen
  steelblue
  tan
  teal
  thistle
  tomato
  turquoise
  violet
  wheat
  white
  whitesmoke
  yellow
  yellowgreen
);

my @headers =                 ("Jun 07",  "Jan 08",  "Oct 08",  "Jun 09");
                            
my @rawdata = (             
  [ "Lord Adonis",          qw(-          -          -          trans      )],
  [ "Bob Ainsworth",        qw(-          -          -          defence    )],
  [ "Douglas Alexander",    qw(id         id         id         id         )],
  [ "Valerie Amos",         qw(-          -          -          -          )],
  [ "Hilary Armstrong",     qw(-          -          -          -          )],
  [ "Lady Ashton",          qw(lhol       -          -          -          )],
  [ "Margaret Beckett",     qw(-          -          house      -          )],
  [ "Ed Balls",             qw(csf        csf        csf        csf        )],
  [ "Hilary Benn",          qw(efra       efra       efra       efra       )],
  [ "Tony Blair",           qw(-          -          -          -          )],
  [ "Hazel Blears",         qw(clg        clg        clg        -          )],
  [ "David Blunkett",       qw(-          -          -          -          )],
  [ "Paul Boateng",         qw(-          -          -          -          )],
  [ "Ben Bradshaw",         qw(-          -          -          cms        )],
  [ "Gordon Brown",         qw(pm         pm         pm         pm         )],
  [ "Nick Brown",           qw(-          -          whip       whip       )],
  [ "Des Browne",           qw(defence    defence    -          -          )],
  [ "Andy Burnham",         qw(treas      cms        cms        health     )],
  [ "Liam Byrne",           qw(-          cab        cab        treas      )],
  [ "Charles Clarke",       qw(-          -          -          -          )],
  [ "Yvette Cooper",        qw(house      treas      treas      work       )],
  [ "Alistair Darling",     qw(chan       chan       chan       chan       )],
  [ "John Denham",          qw(ius        ius        ius        clg        )],
  [ "Charles Falconer",     qw(-          -          -          -          )],
  [ "Caroline Flint",       qw(-          house      europe     -          )],
  [ "Peter Hain",           qw(work       -          -          wales      )],
  [ "Harriet Harman",       qw(lhoc       lhoc       lhoc       lhoc       )],
  [ "Patricia Hewett",      qw(-          -          -          -          )],
  [ "Geoff Hoon",           qw(whip       whip       trans      -          )],
  [ "John Hutton",          qw(bis        bis        defence    -          )],
  [ "Alan Johnson",         qw(health     health     health     home       )],
  [ "Tessa Jowell",         qw(-          olymp      olymp      cab        )],
  [ "Ruth Kelly",           qw(trans      trans      -          -          )],
  [ "Lady Kinnock",         qw(-          -          -          europe     )],
  [ "Dennis MacShane",      qw(-          -          -          -          )],
  [ "Lord Mandelson",       qw(-          -          bis        bis        )],
  [ "David Miliband",       qw(fs         fs         fs         fs         )],
  [ "Ed Miliband",          qw(cab        energy     energy     energy     )],
  [ "Jim Murphy",           qw(europe     europe     -          scot       )],
  [ "Paul Murphy",          qw(-          wales      wales      -          )],
  [ "James Purnell",        qw(cms        work       work       -          )],
  [ "John Reid",            qw(-          -          -          -          )],
  [ "Lady Royall",          qw(-          lhol       lhol       lhol       )],
  [ "Chris Smith",          qw(-          -          -          -          )],
  [ "Jacqui Smith",         qw(home       home       home       -          )],
  [ "Jack Straw",           qw(lchan      lchan      lchan      lchan      )],
  [ "Stephen Timms",        qw(-          -          -          -          )],
  [ "Shaun Woodward",       qw(ni         ni         ni         ni         )],
);

my @cats = (
  pm      => "Prime Minister",
  lhoc    => "Leader of the House of Commons",
  chan    => "Chancellor",
  fs      => "Foreign Secretary",
  lchan   => "Lord Chancellor",
  home    => "Home Secretary",
  efra    => "Environment, Food and Rural Affairs",
  id      => "International Development",
  clg     => "Communities and Local Government",
  ius     => "Innovation, Universities and Skills",
  csf     => "Children, Schools and Families",
  energy  => "Energy and Climate Change",
  health  => "Health",
  ni      => "Northern Ireland",
  lhol    => "Leader of the House of Lords",
  cab     => "Cabinet Office",
  olymp   => "Olympics",
  scot    => "Scotland",
  work    => "Work and Pensions",
  cms     => "Culture, Media and Sport",
  treas   => "Chief Secretary to the Treasury",
  wales   => "Wales",
  bis     => "Business, Innovation and Skills",
  defence => "Defence",
  trans   => "Transport",
  europe  => "Europe",
);

my %cats;
my @catmap;
for (my $n=0; $n*2<@cats; $n++) {
  my $tag = $cats[$n*2];
  $cats{$tag} = {
                  tag    => $tag,
                  index  => $n,
                  name   => $cats[$n*2+1],
                };
  $catmap[$n] = $cats{$tag};
}

my @data = map {
                 {
                   name   => $_->[0],
                   positions => [ map { $cats{$_}->{index} }
                                      @{$_}[1 .. @$_-1]
                                ],
                 }
               } @rawdata;

$_->{colour} = shift @colours
  foreach @data;

my $numbercolumns;
my $numberrows;
my $minposition;
my $maxposition;

foreach (@data) {
  $numbercolumns = @{$_->{positions} }
    if !defined $numbercolumns ┃┃
       $numbercolumns < @{$_->{positions} };

  foreach (@{$_->{positions} }) {
    $minposition = $_
      if defined $_ &&
         (!defined $minposition ┃┃
          $_ < $minposition);
    $maxposition = $_
      if defined $_ &&
         (!defined $maxposition ┃┃
          $_ > $maxposition);
  }
}
$numberrows = $maxposition - $minposition + 1;

my $leftmargin        = 10;
my $rightmargin       = 10;
my $topmargin         = 10;
my $bottommargin      = 10;
my $spacer            = 20;
my $lefttextboxwidth  = 480;
my $righttextboxwidth = 300;
my $colwidth          = 120;
my $rowheight         = 70;
my $lefttextvoffset   = 8;
my $textvoffset       = -8;
my $blobradius        = 10;
my $linewidth         = 10;
my $headerheight      = 40;

my $chartxoffset = $leftmargin + $lefttextboxwidth + $spacer;
my $chartyoffset = $topmargin + $headerheight;

my $chartwidth = $blobradius +
                 ($numbercolumns - 1) * $colwidth +
                 $blobradius;
my $totalwidth = $leftmargin + $lefttextboxwidth + $spacer +
                 $blobradius +
                 ($numbercolumns - 1) * $colwidth +
                 $blobradius +
                 $spacer +
                 $righttextboxwidth + $rightmargin;
my $totalheight = $topmargin +
                  $headerheight +
                  $numberrows * $rowheight +
                  $bottommargin;

print <<EOF;
<?xml version='1.0'?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 
  'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg xwidth='5cm' xheight='4cm'
     version='1.1'
     xmlns='http://www.w3.org/2000/svg'
     viewBox='0 0 $totalwidth $totalheight'>
  <desc>Cabinet chart</desc>



  <rect x='0' y='0' width='$totalwidth' height='$totalheight'
        fill='white' stroke='none' stroke-width='2'/>

EOF

########################################################################
# Print grid
########################################################################
print "  <g fill='none' stroke='grey' stroke-width='1'>\n";
for (my $i=0; $i<$numberrows; $i++) {
  printf "    <line x1='%s' y1='%s' x2='%s' y2='%s'/>\n",
        0, $chartyoffset + $i * $rowheight,
        $totalwidth, $chartyoffset + $i * $rowheight;
}
printf "    <line x1='%s' y1='%s' x2='%s' y2='%s'/>\n",
      0, $chartyoffset + $numberrows * $rowheight,
      $totalwidth, $chartyoffset + $numberrows * $rowheight;
print "  </g>\n";
print "\n";

########################################################################
# Print headers
########################################################################
print "  <g font-size='20' fill='black' font-family='sans-serif'>\n";
for (my $i=0; $i<@headers; $i++) {
  printf "    <text x='%s' y='%s'>%s</text>\n",
         $chartxoffset + $blobradius + $i * $colwidth - 20,
         $headerheight - 10,
         $headers[$i];
}
print "  </g>\n";
print "\n";

########################################################################
# Calculate segments
########################################################################
my @newsegments;
for (my $i=@data-1; $i>=0; $i--) {
  my $item = $data[$i];

  for (my $start=0; $start<$numbercolumns; $start++) {
    if (defined $item->{positions}[$start]) {
      my $end = $start;
      while ($end+1<$numbercolumns &&
             defined $item->{positions}[$end+1]) {
        $end ++;
      }

      my @coords;
      foreach ($start .. $end) {
        push @coords, $chartxoffset + $blobradius + $colwidth * $_,
                      $chartyoffset +
                      ($item->{positions}[$_] - $minposition) * $rowheight +
                      $rowheight/2 + 10;
      }

      push @newsegments, {
                           item   => $item,
                           start  => $start,
                           end    => $end,
                           coords => \@coords,
                         };
      $start = $end + 1;
    }
  }
}

########################################################################
# Print lines, blobs
########################################################################
print "  <g stroke-width='$linewidth' stroke-linecap='round' fill='none'>\n";
foreach my $segment (@newsegments) {
    my @coords = @{$segment->{coords} };
    my @points = @coords;
    push @points, $chartxoffset + $chartwidth + $spacer + $righttextboxwidth,
                  $points[-1]
      if $segment->{end} == $numbercolumns-1;

    printf "    <polyline stroke='%s' points='%s'/>\n",
           $segment->{item}{colour},
           join(" ", @points);

    while (@coords > 1) {
      my $x = shift @coords;
      my $y = shift @coords;
      printf "    <circle cx='%s' cy='%s' r='%s' fill='%s'/>\n",
            $x, $y, $blobradius, $segment->{item}{colour};
    }
}
print "  </g>\n";
print "\n";

########################################################################
# Print labels
########################################################################
print "  <g font-size='24' fill='black' font-family='sans-serif' font-weight='bold'>\n";
foreach my $segment (@newsegments) {
    my @coords = @{$segment->{coords} };
    my ($x, $y);
    if ($segment->{end} == $numbercolumns-1) {
      $x = $coords[-2] + 60;
      $y = $coords[-1] - 15;
    } else {
      $x = $coords[0] - 10;
      $y = $coords[1] - 20;
    }

    printf "    <text x='%s' y='%s'>%s</text>\n",
          $x, $y, $segment->{item}{name} #. " " .  $segment->{item}{colour}
          ;
}
print "  </g>\n";
print "\n";

########################################################################
# Print text columns
########################################################################
print "  <g font-size='24' fill='black' font-family='sans-serif' font-weight='bold'>\n";

for (my $i=0; $i<$numberrows; $i++) {
  printf "    <text x='%s' y='%s'>%s</text>\n",
        $leftmargin,
        $chartyoffset + $i * $rowheight + $rowheight/2 + $lefttextvoffset,
        $catmap[$i]->{name} #. " " .  $catmap[$i]->{tag}
        ;
}
print "  </g>\n";

print <<EOF;
</svg>
EOF

To show the perl source code there, several || and }} had to be replaced. See User:TimR/BrownCabinetSVGSourcecode for the correct sourcecode.

Lizenz

Ich, der Urheberrechtsinhaber dieses Werkes, veröffentliche es hiermit unter der folgenden Lizenz:
w:de:Creative Commons
Namensnennung Weitergabe unter gleichen Bedingungen
Dieses Werk darf von dir
  • verbreitet werden – vervielfältigt, verbreitet und öffentlich zugänglich gemacht werden
  • neu zusammengestellt werden – abgewandelt und bearbeitet werden
Zu den folgenden Bedingungen:
  • Namensnennung – Du musst angemessene Urheber- und Rechteangaben machen, einen Link zur Lizenz beifügen und angeben, ob Änderungen vorgenommen wurden. Diese Angaben dürfen in jeder angemessenen Art und Weise gemacht werden, allerdings nicht so, dass der Eindruck entsteht, der Lizenzgeber unterstütze gerade dich oder deine Nutzung besonders.
  • Weitergabe unter gleichen Bedingungen – Wenn du das Material wiedermischst, transformierst oder darauf aufbaust, musst du deine Beiträge unter der gleichen oder einer kompatiblen Lizenz wie das Original verbreiten.
GNU head Es ist erlaubt, die Datei unter den Bedingungen der GNU-Lizenz für freie Dokumentation, Version 1.2 oder einer späteren Version, veröffentlicht von der Free Software Foundation, zu kopieren, zu verbreiten und/oder zu modifizieren; es gibt keine unveränderlichen Abschnitte, keinen vorderen und keinen hinteren Umschlagtext.

Der vollständige Text der Lizenz ist im Kapitel GNU-Lizenz für freie Dokumentation verfügbar.

Du darfst es unter einer der obigen Lizenzen deiner Wahl verwenden.

Kurzbeschreibungen

Ergänze eine einzeilige Erklärung, was diese Datei darstellt.

In dieser Datei abgebildete Objekte

Motiv

image/svg+xml

6f60e5e9ee316c2923c19817506b04e108246bec

13.652 Byte

789 Pixel

512 Pixel

Dateiversionen

Klicke auf einen Zeitpunkt, um diese Version zu laden.

Version vomVorschaubildMaßeBenutzerKommentar
aktuell21:12, 18. Jun. 2009Vorschaubild der Version vom 21:12, 18. Jun. 2009512 × 789 (13 KB)WereonAndy Burnham (if Balls and Miliband can have "Ed"...)
21:06, 18. Jun. 2009Vorschaubild der Version vom 21:06, 18. Jun. 2009512 × 789 (13 KB)Wereonpeerage titles
13:20, 7. Jun. 2009Vorschaubild der Version vom 13:20, 7. Jun. 2009512 × 789 (13 KB)TimRLord Adonis -> Andrew Adonis; wider to improve text layout
13:17, 7. Jun. 2009Vorschaubild der Version vom 13:17, 7. Jun. 2009512 × 859 (13 KB)TimRWhite background
13:15, 7. Jun. 2009Vorschaubild der Version vom 13:15, 7. Jun. 2009512 × 859 (13 KB)TimRRemoved helvetica; white background
13:09, 7. Jun. 2009Vorschaubild der Version vom 13:09, 7. Jun. 2009512 × 859 (13 KB)TimR{{Information |Description={{en|1=Graphical representation of the wikipedia:Gordon Brown cabinet.}} |Source=Own work by uploader |Author=TimR |Date=2009-06-07 |Permission= |other_versions= }} <!--{{ImageUpload|full}}--> [[Category:Gover

Keine Seiten verwenden diese Datei.

Globale Dateiverwendung

Die nachfolgenden anderen Wikis verwenden diese Datei:

Metadaten