1

Prettify code

This commit is contained in:
Alex Yatskov 2014-11-05 16:48:54 +09:00
parent f45f5b14dc
commit 45501e6667

View File

@ -148,50 +148,32 @@
_elements.gradient = _canvas.gradient(decimateHints()); _elements.gradient = _canvas.gradient(decimateHints());
_elements.backdrop = _canvas.rect( _elements.backdrop = _canvas.rect(
_tickSize, _tickSize, 0, _width - (_densitySize + _tickSize), _height - _panelSize
0,
_width - (_densitySize + _tickSize),
_height - _panelSize
).attr({'stroke': '#d3d7cf', 'fill': '#eeeeec'}); ).attr({'stroke': '#d3d7cf', 'fill': '#eeeeec'});
var range = computeIndicatorRange();
_elements.indicator = _canvas.rect(
_tickSize,
range.start,
_width - (_densitySize + _tickSize),
(range.end - range.start)
).attr({'fill': computeFillColor()});
_elements.density = _canvas.rect( _elements.density = _canvas.rect(
_width - _densitySize, _width - _densitySize, 0, _densitySize, _height - _panelSize
0,
_densitySize,
_height - _panelSize
).attr({'stroke': '#d3d7cf', 'fill': _elements.gradient}); ).attr({'stroke': '#d3d7cf', 'fill': _elements.gradient});
if (_range.contains(0.0)) { _elements.panel = _canvas.rect( _tickSize,
var origin = valueToIndicator(0.0); _height - _panelSize, _width - _tickSize, _panelSize
_elements.tick = _canvas.line(
0,
origin,
_tickSize,
origin
).attr({'stroke': '#888a85'});
}
_elements.panel = _canvas.rect(
_tickSize,
_height - _panelSize,
_width - _tickSize,
_panelSize
).attr({'fill': '#d3d7cf'}); ).attr({'fill': '#d3d7cf'});
_elements.label = _canvas.text( _elements.label = _canvas.text(
_tickSize + (_width - _tickSize) / 2, _tickSize + (_width - _tickSize) / 2, _height - _panelSize / 2, _name
_height - _panelSize / 2,
_name
).attr({'dominant-baseline': 'middle', 'text-anchor': 'middle'}); ).attr({'dominant-baseline': 'middle', 'text-anchor': 'middle'});
var range = computeIndicatorRange();
_elements.indicator = _canvas.rect(
_tickSize, range.start, _width - (_densitySize + _tickSize), (range.end - range.start)
).attr({'fill': computeFillColor()});
if (_range.contains(0.0)) {
var origin = valueToIndicator(0.0);
_elements.tick = _canvas.line( 0, origin, _tickSize, origin
).attr({'stroke': '#888a85'});
}
_elements.group = _canvas.group( _elements.group = _canvas.group(
_elements.backdrop, _elements.backdrop,
_elements.indicator, _elements.indicator,