dirtree 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +6 -3
- data/lib/dirtree/version.rb +1 -1
- data/templates/flame.html.erb +61 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2c07d741f3a998cae4643b1ea2e3c7c306539e155873ecbc1fe5b81e270fa5e6
|
4
|
+
data.tar.gz: 73f49b3206c649108c064394755239847b2cd7b3ac6e70e0c0229d0f56d124c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14eaaa731a105bdeda87c2632783d5dbfa67a91461ae485c4d3e2745d167272e0170ff355888c329d94cc51ab090bfa7077186865c17392cb8918651b3a4bdc7
|
7
|
+
data.tar.gz: 9d5280491911a31a9c0a7524c4f57109a49696289b545ff269a6c7f586eccafd37c43bce29e82d26febfec4102369411b44b8b7a83cefe7c56140c48bb2fb80c
|
data/README.md
CHANGED
@@ -7,6 +7,9 @@ Dirtree visualizes an list of file paths into a tree graph, printed as HTML page
|
|
7
7
|
## Tree template
|
8
8
|

|
9
9
|
|
10
|
+
## Flame Graph template
|
11
|
+

|
12
|
+
|
10
13
|
## Circles template
|
11
14
|

|
12
15
|
|
@@ -22,7 +25,7 @@ Dirtree visualizes an list of file paths into a tree graph, printed as HTML page
|
|
22
25
|
-h, --help Show this help text
|
23
26
|
-l, --local-dependencies Use saved JavaScript libraries instead of downloading them
|
24
27
|
-o, --output=File.html Specify a path to write output, if not specified output will be printed to STDOUT
|
25
|
-
-t, --template=TemplateName Specify the template name, available templates ["circles", "tree"]
|
28
|
+
-t, --template=TemplateName Specify the template name, available templates ["circles", "tree", "flame"]
|
26
29
|
|
27
30
|
|
28
31
|
## Examples
|
@@ -72,11 +75,11 @@ $ ag -l | dirtree -o output.html
|
|
72
75
|
|
73
76
|
## Conjunctions
|
74
77
|
|
75
|
-
* [lsgh](https://www.github.com/
|
78
|
+
* [lsgh](https://www.github.com/emad-elsaid/lsgh) Draw a tree for a github user/org and open pull requests.
|
76
79
|
|
77
80
|
## Contributing
|
78
81
|
|
79
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
82
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/emad-elsaid/dirtree.
|
80
83
|
|
81
84
|
## License
|
82
85
|
|
data/lib/dirtree/version.rb
CHANGED
@@ -0,0 +1,61 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
|
5
|
+
<meta charset="utf-8">
|
6
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/spiermar/d3-flame-graph@1.0.4/dist/d3.flameGraph.min.css">
|
7
|
+
<style>
|
8
|
+
html, body{
|
9
|
+
height: 100%;
|
10
|
+
margin: 0;
|
11
|
+
padding: 0;
|
12
|
+
font-size: 14px;
|
13
|
+
}
|
14
|
+
</style>
|
15
|
+
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.10.0/d3.min.js"></script>
|
16
|
+
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3-tip/0.7.1/d3-tip.min.js"></script>
|
17
|
+
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/spiermar/d3-flame-graph@1.0.4/dist/d3.flameGraph.min.js"></script>
|
18
|
+
|
19
|
+
</head>
|
20
|
+
<body>
|
21
|
+
|
22
|
+
<div class="container">
|
23
|
+
<div id="chart">
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
<script>
|
27
|
+
// Uses D3js flamegraph: https://github.com/spiermar/d3-flame-graph
|
28
|
+
var flameGraph = d3.flameGraph()
|
29
|
+
.width(window.innerWidth)
|
30
|
+
.cellHeight(18)
|
31
|
+
.transitionDuration(750)
|
32
|
+
.transitionEase(d3.easeCubic)
|
33
|
+
.sort(true)
|
34
|
+
.title("");
|
35
|
+
|
36
|
+
var tip = d3.tip()
|
37
|
+
.direction("s")
|
38
|
+
.offset([8, 0])
|
39
|
+
.attr('class', 'd3-flame-graph-tip')
|
40
|
+
.html(function(d) { return "name: " + d.data.name + ", value: " + d.data.value; });
|
41
|
+
|
42
|
+
flameGraph.tooltip(tip);
|
43
|
+
|
44
|
+
function setValue(d) {
|
45
|
+
var val = 0;
|
46
|
+
for( var i=0; i<d.children.length; i++){
|
47
|
+
setValue(d.children[i]);
|
48
|
+
val += d.children[i].value;
|
49
|
+
}
|
50
|
+
d.value = val == 0 ? 1 : val;
|
51
|
+
}
|
52
|
+
|
53
|
+
root = <%= tree.to_json %>;
|
54
|
+
setValue(root)
|
55
|
+
d3.select("#chart")
|
56
|
+
.datum(root)
|
57
|
+
.call(flameGraph);
|
58
|
+
</script>
|
59
|
+
|
60
|
+
</body>
|
61
|
+
</html>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dirtree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emad Elsaid
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -57,6 +57,7 @@ files:
|
|
57
57
|
- lib/dirtree/node.rb
|
58
58
|
- lib/dirtree/version.rb
|
59
59
|
- templates/circles.html.erb
|
60
|
+
- templates/flame.html.erb
|
60
61
|
- templates/tree.html.erb
|
61
62
|
homepage: https://www.github.com/blazeeboy/dirtree
|
62
63
|
licenses:
|
@@ -78,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
79
|
version: '0'
|
79
80
|
requirements: []
|
80
81
|
rubyforge_project:
|
81
|
-
rubygems_version: 2.
|
82
|
+
rubygems_version: 2.7.3
|
82
83
|
signing_key:
|
83
84
|
specification_version: 4
|
84
85
|
summary: display list of file paths as an interactive tree
|