Skip to content

Commit

Permalink
Merge pull request #39 from chentex/graph-color-schema
Browse files Browse the repository at this point in the history
Adds color schema for graphs
  • Loading branch information
chentex authored Jul 12, 2021
2 parents 1c06b20 + e6194bc commit 2ce294b
Showing 1 changed file with 35 additions and 4 deletions.
39 changes: 35 additions & 4 deletions automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def generate_graphs(directory):
regex = re.compile(r'[\w-]+_([\w-]+).(\w.+)')
matches = regex.match(filename)

if 'reports' not in root and regex.match(filename) and \
if 'summaries' not in root and regex.match(filename) and \
matches.group(2) == 'json':
print('Generating graph for: {}'.format(matches.group(1)))

Expand Down Expand Up @@ -97,7 +97,22 @@ def generate_graphs(directory):
'mode': 'markers',
'transforms': [{
'type': 'groupby',
'groups': df['code']
'groups': df['code'],
'color': 'code',
'styles': [
{'target': '0',
'value': {'marker': {'color': 'coral',
'symbol': 'triangle-down'}}},
{'target': '200',
'value': {'marker': {'color': 'LightSkyBlue'}}},
{'target': '201',
'value': {'marker': {'color': 'LightSkyBlue'}}},
{'target': '400',
'value': {'marker': {'color': 'crimsom',
'symbol': 'diamond'}}},
{'target': '500',
'value': {'marker': {'color': 'darkred',
'symbol': 'diamond-tall'}}}]
}]
}]

Expand Down Expand Up @@ -163,8 +178,24 @@ def show_graphs(directory, filename):
'mode': 'markers',
'transforms': [
{'type': 'groupby',
'groups': df['code']}]
}]
'groups': df['code'],
'color': 'code',
'styles': [
{'target': '0',
'value': {'marker': {'color': 'coral',
'symbol': 'triangle-down'}}},
{'target': '200',
'value': {'marker': {'color': 'LightSkyBlue'}}},
{'target': '201',
'value': {'marker': {'color': 'LightSkyBlue'}}},
{'target': '400',
'value': {'marker': {'color': 'crimsom',
'symbol': 'diamond'}}},
{'target': '500',
'value': {'marker': {'color': 'darkred',
'symbol': 'diamond-tall'}}}]
}]
}]

layout = {
'title': '<b>Latency per Request: {}</b>'.format(matches.group(2)),
Expand Down

0 comments on commit 2ce294b

Please sign in to comment.