mindmapviz 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3d3094df1015c796e9ab311254546da0d8f79536
4
+ data.tar.gz: 5e0e9f644787c9969faf037da50e400e5270a2d6
5
+ SHA512:
6
+ metadata.gz: 33d8fa004836dc30f1e80abce531bc009f846b2a950b59035eb2e1ce7190330ce747a5e4a1bc537de27ff9b97c36641841c633607fa7e6cd3a2ba4821e81080f
7
+ data.tar.gz: 2998e29d4e906e1ccc746a1a43a3d6279a5252b2631bea157a896e8243ee6dc786cc17ea3de61c924ca561d83154876c3289033fc2e13d754930a8a78fc73061
checksums.yaml.gz.sig ADDED
Binary file
data.tar.gz.sig ADDED
Binary file
data/lib/mindmapviz.rb ADDED
@@ -0,0 +1,113 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: mindmapviz.rb
4
+
5
+ require 'requestor'
6
+
7
+ code = Requestor.read('http://rorbuilder.info/r/ruby') do |x|
8
+ x.require 'pxgraphviz'
9
+ end
10
+
11
+ eval code
12
+
13
+ =begin
14
+ notes:
15
+
16
+ coloured box for central point
17
+ box for nodes
18
+ text for leaves
19
+
20
+ or
21
+ ellipse for central point
22
+ text for nodes and leaves
23
+
24
+ or
25
+
26
+ coloure dellipse for central point
27
+ text for nodes and leaves
28
+ - larger text and thicker connections for more important things
29
+ coloured branches for different nodes
30
+
31
+ For text only use shape: 'none'
32
+ =end
33
+
34
+ # inspired by https://github.com/bingwei/ruby-graphviz-mindmap
35
+
36
+
37
+ class Mindmapviz
38
+
39
+ attr_reader :raw_doc
40
+
41
+ def initialize(s, fields: %w(label shape), delimiter: ' # ',
42
+ style: default_stylesheet())
43
+
44
+
45
+
46
+ @raw_doc=<<EOF
47
+ <?polyrex schema='items[type, layout]/item[#{fields.join(', ')}]' delimiter='#{delimiter}'?>
48
+ type: graph
49
+ layout: neato
50
+ #{s}
51
+ EOF
52
+
53
+ @pxg = PxGraphViz.new(@raw_doc, style: style)
54
+
55
+ end
56
+
57
+ def export(file='gvml.xml')
58
+ File.write file, @pxg.to_doc.xml(pretty: true)
59
+ end
60
+
61
+ alias export_as export
62
+
63
+ def save(s)
64
+ File.write filename, @raw_doc
65
+ end
66
+
67
+ def to_dot()
68
+ @pxg.to_dot
69
+ end
70
+
71
+ # writes to a PNG file (not a PNG blob)
72
+ #
73
+ def to_png(filename)
74
+ @pxg.to_png filename
75
+ end
76
+
77
+ # writes to a SVG file (not an SVG blob)
78
+ #
79
+ def to_svg(filename)
80
+ @pxg.to_svg filename
81
+ 'SVG file written'
82
+ end
83
+
84
+
85
+ private
86
+
87
+ def default_stylesheet()
88
+
89
+ <<STYLE
90
+ node {
91
+ color: #ddaa66;
92
+ fillcolor: #ccffcc;
93
+ fontcolor: #330055;
94
+ fontname: Trebuchet MS;
95
+ fontsize: 8;
96
+ margin: 0.0;
97
+ penwidth: 1;
98
+ style: filled;
99
+ }
100
+
101
+ edge {
102
+ arrowsize: 0.5;
103
+ color: #999999;
104
+ fontcolor: #444444;
105
+ fontname: Verdana;
106
+ fontsize: 8;
107
+ #{@type == :digraph ? 'dir: forward;' : 'dir: none;'}
108
+ weight: 1;
109
+ }
110
+ STYLE
111
+
112
+ end
113
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mindmapviz
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - James Robertson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
+ YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
+ 8ixkARkWAmV1MB4XDTE3MDkwNDE3NTg1NFoXDTE4MDkwNDE3NTg1NF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72eSSJ+moAHzciNKJ9iP3GwZK
32
+ xwzVLef/qNXmag==
33
+ -----END CERTIFICATE-----
34
+ date: 2017-09-04 00:00:00.000000000 Z
35
+ dependencies:
36
+ - !ruby/object:Gem::Dependency
37
+ name: pxgraphviz
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '0.3'
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 0.3.2
46
+ type: :runtime
47
+ prerelease: false
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '0.3'
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 0.3.2
56
+ description:
57
+ email: james@jamesrobertson.eu
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - lib/mindmapviz.rb
63
+ homepage: https://github.com/jrobertson/mindmapviz
64
+ licenses:
65
+ - MIT
66
+ metadata: {}
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ requirements: []
82
+ rubyforge_project:
83
+ rubygems_version: 2.6.8
84
+ signing_key:
85
+ specification_version: 4
86
+ summary: Uses Graphviz to make a mindmap.
87
+ test_files: []
metadata.gz.sig ADDED
@@ -0,0 +1,4 @@
1
+ 8�<�&��q+���?���uu�\,Z��wΆfl{dT���� ��"� ��?{J���)�kt�Ӥ����脥��?U�-2�/~��H�̔����؋� {ς.�am
2
+ �a�
3
+ ��EBFaj�_f�����FߪNN��ǝ, ����F�Zir7ݻO l�7}d2�q�C\ ~]�m�!<������K#���S*��� ��j o�t���ؑ �����K8^����(u�&����c
4
+ Ԫr�eW��w�����Q���0>^'�_n�