|
|
@ -36,8 +36,8 @@ def create_app(): |
|
|
|
def index(): |
|
|
|
def index(): |
|
|
|
return render_template('index.jinja2') |
|
|
|
return render_template('index.jinja2') |
|
|
|
|
|
|
|
|
|
|
|
@app.route("/all-<type>-<style>.svg") |
|
|
|
@app.route("/all-<type>-<style>(fill=<fill>).svg") |
|
|
|
def all_svg(type, style): |
|
|
|
def all_svg(type, style, fill): |
|
|
|
data = random.randrange(1, 10) |
|
|
|
data = random.randrange(1, 10) |
|
|
|
order = random.randrange(1, 10) |
|
|
|
order = random.randrange(1, 10) |
|
|
|
max = 10 ** order |
|
|
|
max = 10 ** order |
|
|
@ -45,6 +45,7 @@ def create_app(): |
|
|
|
config = Config() |
|
|
|
config = Config() |
|
|
|
config.width = 600 |
|
|
|
config.width = 600 |
|
|
|
config.height = 400 |
|
|
|
config.height = 400 |
|
|
|
|
|
|
|
config.fill = fill == 'True' |
|
|
|
config.style = styles[style] |
|
|
|
config.style = styles[style] |
|
|
|
if type != 'Pie': |
|
|
|
if type != 'Pie': |
|
|
|
config.x_labels = [random_label() for i in range(data)] |
|
|
|
config.x_labels = [random_label() for i in range(data)] |
|
|
@ -68,8 +69,9 @@ def create_app(): |
|
|
|
@app.route("/all") |
|
|
|
@app.route("/all") |
|
|
|
def all(): |
|
|
|
def all(): |
|
|
|
width, height = 600, 400 |
|
|
|
width, height = 600, 400 |
|
|
|
svgs = [url_for('all_svg', type=type, style=style) |
|
|
|
svgs = [url_for('all_svg', type=type, style=style, fill=fill) |
|
|
|
for style in styles |
|
|
|
for style in styles |
|
|
|
|
|
|
|
for fill in (False, True) |
|
|
|
for type in ('Bar', 'Line', 'XY', 'Pie', 'StackedBar', |
|
|
|
for type in ('Bar', 'Line', 'XY', 'Pie', 'StackedBar', |
|
|
|
'HorizontalBar', 'HorizontalStackedBar', 'Radar')] |
|
|
|
'HorizontalBar', 'HorizontalStackedBar', 'Radar')] |
|
|
|
return render_template('svgs.jinja2', |
|
|
|
return render_template('svgs.jinja2', |
|
|
|