-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from TLmaK0/feature/telemetry
Feature/telemetry
- Loading branch information
Showing
13 changed files
with
371 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,6 @@ Cargo.lock | |
# Vim | ||
*.swp | ||
*.swo | ||
|
||
# Fmt | ||
**/*.rs.bk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
svg { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
svg path { | ||
stroke: black; | ||
fill: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
var fitnessAxis = {}; | ||
function fitness_init(id){ | ||
var svg = d3.select('#' + id).append('svg'); | ||
svg.append('path'); | ||
|
||
fitnessAxis[id+"y"] = svg.append("g"); | ||
fitnessAxis[id+"x"] = svg.append("g"); | ||
} | ||
|
||
var fitnessData = {}; | ||
|
||
function fitness(id, value){ | ||
if (!fitnessData[id]){ | ||
fitnessData[id] = []; | ||
for(i = 0; i < 100; i++){ | ||
fitnessData[id].push(0); | ||
} | ||
} | ||
|
||
fitnessData[id].shift(); | ||
fitnessData[id].push(value); | ||
|
||
var data = fitnessData[id]; | ||
|
||
var svg = d3.select('#' + id).select('svg'); | ||
var path = svg.select('path'); | ||
|
||
var width = $('#' + id).children().width(), | ||
height = $('#' + id).children().height(); | ||
|
||
var y = d3.scaleLinear() | ||
.range([height, 0]) | ||
.domain([-1, 17]); | ||
|
||
var x = d3.scaleLinear() | ||
.range([0, width]) | ||
.domain([data.length, 0]); | ||
|
||
|
||
var lineChart = d3.line() | ||
.x(function(d, i){ return x(i) }) | ||
.y(function(d){ return y(d) }); | ||
|
||
var yAxis = d3.axisLeft(y); | ||
var xAxis = d3.axisBottom(x); | ||
|
||
fitnessAxis[id+'y'].attr("transform", "translate(30,0)").call(yAxis); | ||
fitnessAxis[id+'x'].attr("transform", "translate(30,"+ (height - 19) + ")").call(xAxis); | ||
|
||
path.attr("transform", "translate(30,0)").attr("d", lineChart(data)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.links line { | ||
stroke: #999; | ||
stroke-opacity: 0.6; | ||
} | ||
|
||
.nodes circle { | ||
stroke: #fff; | ||
stroke-width: 1.5px; | ||
} | ||
|
||
svg { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
Oops, something went wrong.