« wikipediaのパーサを書いている | main | まるごとYAPC »

pretty print test

google-code-prettyfyを入れてみたのでテスト。
内容はeXpandaのサンプルスクリプト。

#!/usr/bin/perl
use warnings;
use strict;
use eXpanda;


# eXpanda Demo Script No 8
# "Visualizing Social network."

my $str = do 'sns_net.str';
bless $str, 'eXpanda';

### Analysis ####
$str->Analyze(
-method =>"degree",
);

### Initialize graphics ####
$str->Apply(
-object => 'node:graohics:fill',
-value => '#d39800',
);

$str->Apply(
-object => 'node:graohics:w',
-value => '15',
);

$str->Apply(
-object => 'edge:graohics:stroke',
-value => '#c3d825',
);

$str->Apply(
-object => 'edge:graohics:width-stroke',
-value => '#c3d825',
);

### Apply Score to Graohics ###
$str->Apply(
-object => 'node:graohics:fill',
-from => 'node:score:degree',
-value => {'#f39800' => '#e2041b'},
);

$str->Apply(
-object => 'node:graohics:w',
-from => 'node:score:degree',
-value => {'15' => '40'},
);

### Output ###
$str->out("sample08.svg",-no_node_label=>1,);

トラックバック

このエントリーのトラックバックURL:
http://polog.org/mt-tb.cgi/348

コメントを投稿

Powered by
Movable Type 3.34