Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

Commit

Permalink
updated data and more lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Skinner authored and photodow committed Feb 22, 2017
1 parent d22bbd1 commit 9bf2dfa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
8 changes: 7 additions & 1 deletion packages/charts-vanilla-radar/src/scripts/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ const data = [
{axis:'Memory', value:0.54},
{axis:'CPU', value:0.38},
{axis:'Disk', value:0.23},
{axis:'Network', value:0.23},
{axis:'Heap', value:0.16},
],
[//Samsung
{axis:'Apdex', value:0.80},
{axis:'Apdex', value:0.58},
{axis:'Alerts', value:0.66},
{axis:'Request Volume', value:0.35},
{axis:'Memory', value:0.23},
{axis:'CPU', value:0.36},
{axis:'Disk', value:0.13},
{axis:'Network', value:0.11},
{axis:'Heap', value:0.35},
],
[//Nokia Smartphone
{axis:'Apdex', value:0.26},
Expand All @@ -22,5 +26,7 @@ const data = [
{axis:'Memory', value:0.14},
{axis:'CPU', value:0.22},
{axis:'Disk', value:0.04},
{axis:'Network', value:0.23},
{axis:'Heap', value:0.41},
],
];
26 changes: 13 additions & 13 deletions packages/charts-vanilla-radar/src/scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Radar {
let g = blobs.append('g').attr('class', 'blob-' + i);
g.append('path').datum(data[i]).attrs({
'stroke-width': 1.5,
'd' : a.line,
'd' : this.line,
'fill': () => { return this.color(i); },
});

Expand Down Expand Up @@ -101,7 +101,7 @@ class Radar {

// draws the axis
if (this.cfg.axisStyle) {
this.axisGroup = globalGroup.append('g').attr('class','axis-lines');
this.axisGroup = globalGroup.append('g').attr('class', 'axis-lines');
this.axisGroup.selectAll('.axis-line').data(this.axis.names).enter().append('line')
.attrs({
'x1': 0,
Expand All @@ -121,7 +121,7 @@ class Radar {
if (this.cfg.shape == 'circle') {
//draw rings
let ringInterval = this.cfg.max / this.cfg.levels;
var ringRadiusValues = d3.range(ringInterval, this.cfg.max + 1, ringInterval).reverse() //add 1 so you include the MAX
let ringRadiusValues = d3.range(ringInterval, this.cfg.max + 1, ringInterval).reverse();

let g = globalGroup.append('g').attr('class', 'grid-circle');
g.append('g').attr('class', 'rings')
Expand Down Expand Up @@ -197,16 +197,16 @@ class Radar {
//Wraps SVG text
wrap(text, width) {
text.each(function() {
var text = d3.select(this),
words = text.text().split(/\s+/).reverse(),
word,
line = [],
lineNumber = 0,
lineHeight = 1.4, // ems
y = text.attr('y'),
x = text.attr('x'),
dy = parseFloat(text.attr('dy')) || 0,
tspan = text.text(null).append('tspan').attr('x', x).attr('y', y).attr('dy', dy + 'em');
let text = d3.select(this);
let words = text.text().split(/\s+/).reverse();
let word;
let line = [];
let lineNumber = 0;
let lineHeight = 1.4; // ems
let y = text.attr('y');
let x = text.attr('x');
let dy = parseFloat(text.attr('dy')) || 0;
let tspan = text.text(null).append('tspan').attr('x', x).attr('y', y).attr('dy', dy + 'em');

while (word = words.pop()) {
line.push(word);
Expand Down

0 comments on commit 9bf2dfa

Please sign in to comment.