Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use json instead of google doc #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,9 @@ This repository shares:

## Cool. How can I make my own?

Create a Google doc with the following columns:

* **Technology** (e.g. "Hystrix")
* **Quadrant** (Needs to be exactly and at least one of each quadrants: "Platforms & Infrastructure", "Data Mgt", "Languages", "Techniques; Frameworks & Tools")
* *[optional] Comments (e.g. "lib for fault tolerance")*
* **Score** as a float between 2.0 and -2.0 (e.g. "1.8")
* *[optional] Number of votes, for internal bookkeeping*
* *[optional] Consensus score, for internal bookkeeping*
* **Skip** — set to true if entry should not be visualized on chart
* Add a new json file in the data folder
* (Best copy the most recent one)
* Add all tech stack components including quadrant and score information

Then follow the instructions below.

Expand Down
32 changes: 32 additions & 0 deletions data/2017_02.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[
{
"name": "PHP5.5",
"quadrant": "Languages",
"comment": "Old PHP version",
"rating": "-2"
},
{
"name": "PHP7.1",
"quadrant": "Languages",
"comment": "New PHP version",
"rating": "1.8"
},
{
"name": "Puppet",
"quadrant": "Platforms & Infrastructure",
"comment": "",
"rating": "-2"
},
{
"name": "AWS S3",
"quadrant": "Data Mgt",
"comment": "",
"rating": "2"
},
{
"name": "Symfony2",
"quadrant": "Techniques; Frameworks & Tools",
"comment": "Outdated",
"rating": "-2"
}
]
6 changes: 0 additions & 6 deletions data/2017_02.tsv

This file was deleted.

32 changes: 32 additions & 0 deletions data/2017_05.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[
{
"name": "PHP5.5",
"quadrant": "Languages",
"comment": "Old PHP version",
"rating": -2
},
{
"name": "PHP7.1",
"quadrant": "Languages",
"comment": "New PHP version",
"rating": 1.8
},
{
"name": "Puppet",
"quadrant": "Platforms & Infrastructure",
"comment": "",
"rating": -2
},
{
"name": "AWS S3",
"quadrant": "Data Mgt",
"comment": "",
"rating": 2
},
{
"name": "Symfony2",
"quadrant": "Techniques; Frameworks & Tools",
"comment": "Outdated",
"rating": -2
}
]
6 changes: 0 additions & 6 deletions data/2017_05.tsv

This file was deleted.

42 changes: 17 additions & 25 deletions radar_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,12 @@ var radar_data = [
"color" : "#8FA227",
"items" : [
{
"name": "Symfony 3.2",
"name": "Symfony2",
"pc": {
"r": 58,
"t": 152
"r": 326,
"t": 142
},
"movement": "t"
},
{
"name": "Symfony 2",
"pc": {
"r": 350,
"t": 94
},
"movement": "t"
"movement": "c"
}
]
},
Expand All @@ -70,10 +62,10 @@ var radar_data = [
{
"name": "AWS S3",
"pc": {
"r": 97,
"t": 10
"r": 120,
"t": 23
},
"movement": "t"
"movement": "c"
}
]
},
Expand All @@ -86,10 +78,10 @@ var radar_data = [
{
"name": "Puppet",
"pc": {
"r": 351,
"t": 184
"r": 382,
"t": 240
},
"movement": "t"
"movement": "c"
}
]
},
Expand All @@ -100,20 +92,20 @@ var radar_data = [
"top" : (h/2 + 38),
"items" : [
{
"name": "PHP7",
"name": "PHP7.1",
"pc": {
"r": 113,
"t": 345
"r": 104,
"t": 280
},
"movement": "t"
"movement": "c"
},
{
"name": "PHP5.5",
"pc": {
"r": 368,
"t": 354
"r": 334,
"t": 298
},
"movement": "t"
"movement": "c"
}
]
}
Expand Down
11 changes: 6 additions & 5 deletions transform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,20 +137,21 @@ def render
# parse tab-separated data (exported from google doc)
def self.parse(path)
blips = {}
open(path).each do |line|
cols = line.split("\t")
name, quadrant, score, skip = cols[0], cols[1], cols[3], cols[6]
file = File.read(path)
JSON.parse(file).each do |row|
name, quadrant, score, skip = row["name"], row["quadrant"], row["rating"], row["skip"]

raise "PLEASE DELETE HEADER LINE: #{path}" if score == "AVG"
next if skip == "TRUE"
next if score.nil? || score.strip.empty?
next if score.nil?
blip = Blip.new(name, quadrant, score.to_f)
blips[blip.name] = blip
end
blips
end
end

files = Dir["data/*.tsv"]
files = Dir["data/*.json"]
radar = Radar.new(files.pop)
previous = files.pop
radar.track_moves(Radar.new(previous)) if previous
Expand Down