Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions bazaarci/server/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

from flask import Flask

def create_app(config=None):
app = Flask(__name__, template_folder='assets/html', static_folder='assets')

from .views import graph
app.register_blueprint(graph.bp)

return app

8 changes: 8 additions & 0 deletions bazaarci/server/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from . import create_app

if __name__ == "__main__":
app = create_app(config="Production/LocalRun/etc")
app.run()


5 changes: 5 additions & 0 deletions bazaarci/server/assets/css/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore all files that aren't css
*
!.gitignore
!*.css
!*/
5 changes: 5 additions & 0 deletions bazaarci/server/assets/html/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore all files that aren't css
*
!.gitignore
!*.html
!*/
26 changes: 26 additions & 0 deletions bazaarci/server/assets/html/graph.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--link rel="stylesheet" href="{{ ASSET_URL }}"-->
<title>BazaarCI</title>
</head>
<body>
<!-- Banner Section -->
<div>
<h2>BazaarCI</h2>
</div>

<!-- Display Section -->
<div id="graph" style="text-align: center;"></div>

</body>

<!--script type="text/javascript" src="{{ ASSET_URL }}"></script-->
<script src="//d3js.org/d3.v4.min.js"></script>
<script src="https://unpkg.com/viz.js@1.8.0/viz.js" type="javascript/worker"></script>
<script src="https://unpkg.com/d3-graphviz@1.3.1/build/d3-graphviz.min.js"></script>
<script src="{{ url_for('static', filename="js/gvd3demo.js")}}"></script>
</html>
5 changes: 5 additions & 0 deletions bazaarci/server/assets/js/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore all files that aren't css
*
!.gitignore
!*.js
!*/
122 changes: 122 additions & 0 deletions bazaarci/server/assets/js/gvd3demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@

var dotIndex = 0;
var graphviz = d3.select("#graph").graphviz()
.transition(function () {
return d3.transition("main")
.ease(d3.easeLinear)
.delay(500)
.duration(1500);
})
.logEvents(true)
.on("initEnd", render);

function render() {
var dotLines = dots[dotIndex];
var dot = dotLines.join('');
graphviz
.renderDot(dot)
.on("end", function () {
dotIndex = (dotIndex + 1) % dots.length;
render();
});
}

var dots = [
[
'digraph {',
' node [style="filled"]',
' a [fillcolor="#d62728"]',
' b [fillcolor="#1f77b4"]',
' a -> b',
'}'
],
[
'digraph {',
' node [style="filled"]',
' a [fillcolor="#d62728"]',
' c [fillcolor="#2ca02c"]',
' b [fillcolor="#1f77b4"]',
' a -> b',
' a -> c',
'}'
],
[
'digraph {',
' node [style="filled"]',
' a [fillcolor="#d62728"]',
' b [fillcolor="#1f77b4"]',
' c [fillcolor="#2ca02c"]',
' a -> b',
' a -> c',
'}'
],
[
'digraph {',
' node [style="filled"]',
' a [fillcolor="#d62728", shape="box"]',
' b [fillcolor="#1f77b4", shape="parallelogram"]',
' c [fillcolor="#2ca02c", shape="pentagon"]',
' a -> b',
' a -> c',
' b -> c',
'}'
],
[
'digraph {',
' node [style="filled"]',
' a [fillcolor="yellow", shape="star"]',
' b [fillcolor="yellow", shape="star"]',
' c [fillcolor="yellow", shape="star"]',
' a -> b',
' a -> c',
' b -> c',
'}'
],
[
'digraph {',
' node [style="filled"]',
' a [fillcolor="#d62728", shape="triangle"]',
' b [fillcolor="#1f77b4", shape="diamond"]',
' c [fillcolor="#2ca02c", shape="trapezium"]',
' a -> b',
' a -> c',
' b -> c',
'}'
],
[
'digraph {',
' node [style="filled"]',
' a [fillcolor="#d62728", shape="box"]',
' b [fillcolor="#1f77b4", shape="parallelogram"]',
' c [fillcolor="#2ca02c", shape="pentagon"]',
' a -> b',
' a -> c',
' b -> c',
'}'
],
[
'digraph {',
' node [style="filled"]',
' a [fillcolor="#d62728"]',
' b [fillcolor="#1f77b4"]',
' c [fillcolor="#2ca02c"]',
' a -> b',
' a -> c',
' c -> b',
'}'
],
[
'digraph {',
' node [style="filled"]',
' b [fillcolor="#1f77b4"]',
' c [fillcolor="#2ca02c"]',
' c -> b',
'}'
],
[
'digraph {',
' node [style="filled"]',
' b [fillcolor="#1f77b4"]',
'}'
],
];
Empty file.
10 changes: 10 additions & 0 deletions bazaarci/server/views/graph.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

from flask import Blueprint, render_template, request

bp = Blueprint('graph', __name__)

@bp.route('/')
def index():
return render_template('graph.html')


1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
packages=[
'bazaarci',
'bazaarci.runner',
'bazaarci.server',
],
)