Skip to content

Commit 7741ae9

Browse files
committed
Merge pull request #22 from 10gen/minichart-fixes
More fine-tuning on minicharts
2 parents 2445fda + cdc4264 commit 7741ae9

File tree

5 files changed

+33
-10
lines changed

5 files changed

+33
-10
lines changed

scout-ui/src/home/index.less

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
}
134134

135135
}
136-
.schema-field-type-list{
136+
.schema-field-type-list {
137137
border-radius: 1px;
138138
// background: @gray6;
139139

@@ -143,7 +143,6 @@
143143

144144
.schema-field-type {
145145
height: 5px;
146-
width: 100%;
147146
margin-right: 2px;
148147
background: @gray1;
149148
}

scout-ui/src/minicharts/d3fns/date.js

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ var d3 = require('d3');
22
var _ = require('lodash');
33
var moment = require('moment');
44
var shared = require('./shared');
5-
var debug = require('debug')('scout-ui:minicharts:date');
65
var many = require('./many');
6+
var debug = require('debug')('scout-ui:minicharts:date');
77

88
require('d3-tip')(d3);
99

1010
function generateDefaults(n) {
1111
var doc = {};
1212
_.each(_.range(n), function(d) {
13-
doc[d] = 0;
13+
doc[d] = [];
1414
});
1515
return doc;
1616
}
@@ -134,6 +134,7 @@ module.exports = function(opts) {
134134
});
135135

136136
var weekdayContainer = svg.append('g');
137+
137138
many(weekdays, weekdayContainer, width / (upperRatio + 1) - upperMargin, upperBarBottom, {
138139
bgbars: true,
139140
labels: {
@@ -144,6 +145,17 @@ module.exports = function(opts) {
144145
}
145146
});
146147

148+
// calendar icon
149+
weekdayContainer.append('text')
150+
.attr('class', 'date-icon fa-fw')
151+
.attr('x', 0)
152+
.attr('dx', '-0.6em')
153+
.attr('y', 0)
154+
.attr('dy', '1em')
155+
.attr('text-anchor', 'end')
156+
.attr('font-family', 'FontAwesome')
157+
.text('\uf133');
158+
147159
var hourContainer = svg.append('g')
148160
.attr('transform', 'translate(' + (width / (upperRatio + 1) + upperMargin) + ', 0)');
149161

@@ -156,5 +168,16 @@ module.exports = function(opts) {
156168
}
157169
});
158170

171+
// clock icon
172+
hourContainer.append('text')
173+
.attr('class', 'date-icon fa-fw')
174+
.attr('x', 0)
175+
.attr('dx', '-0.6em')
176+
.attr('y', 0)
177+
.attr('dy', '1em')
178+
.attr('text-anchor', 'end')
179+
.attr('font-family', 'FontAwesome')
180+
.text('\uf017');
181+
159182
};
160183

scout-ui/src/minicharts/d3fns/many.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ module.exports = function(data, g, width, height, options) {
7878
.attr('y', height)
7979
.attr('dy', '0.3em')
8080
.attr('text-anchor', 'end')
81-
.text('99.9%');
81+
.text('0%');
8282

8383
legend.append('line')
8484
.attr('class', 'bg legend')

scout-ui/src/minicharts/d3fns/number.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module.exports = function(opts) {
2020

2121
// Generate a histogram using approx. twenty uniformly-spaced bins
2222
var ticks = x.ticks(20);
23+
2324
var hist = d3.layout.histogram()
2425
.bins(ticks);
2526

scout-ui/src/minicharts/index.less

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// minicharts
22
@mc-blue0: #43B1E5;
3-
@mc-blue1: lighten(@mc-blue0, 10%);
4-
@mc-blue2: lighten(@mc-blue0, 20%);
5-
@mc-blue3: lighten(@mc-blue0, 30%);
6-
@mc-blue4: lighten(@mc-blue0, 40%);
7-
@mc-blue5: lighten(@mc-blue0, 50%);
3+
@mc-blue1: lighten(@mc-blue0, 7.5%);
4+
@mc-blue2: lighten(@mc-blue0, 15%);
5+
@mc-blue3: lighten(@mc-blue0, 22.5%);
6+
@mc-blue4: lighten(@mc-blue0, 30%);
7+
@mc-blue5: lighten(@mc-blue0, 37.5%);
88

99
@mc-bg: #F2F4F5;
1010
@mc-fg: @mc-blue0;

0 commit comments

Comments
 (0)