graphite-dev team mailing list archive
-
graphite-dev team
-
Mailing list archive
-
Message #00859
[Merge] lp:~katzj/graphite/connected-line-mode into lp:graphite
Jeremy Katz has proposed merging lp:~katzj/graphite/connected-line-mode into lp:graphite.
Requested reviews:
graphite-dev (graphite-dev)
For more details, see:
https://code.launchpad.net/~katzj/graphite/connected-line-mode/+merge/60624
This adds a new line mode of "connected" which is a connect the dots style graph for data points which occur less frequently but where keepLastValue isn't really appropriate.
--
https://code.launchpad.net/~katzj/graphite/connected-line-mode/+merge/60624
Your team graphite-dev is requested to review the proposed merge of lp:~katzj/graphite/connected-line-mode into lp:graphite.
=== modified file 'webapp/content/js/composer_widgets.js'
--- webapp/content/js/composer_widgets.js 2011-04-02 21:07:25 +0000
+++ webapp/content/js/composer_widgets.js 2011-05-11 13:20:16 +0000
@@ -984,6 +984,14 @@
menuRadioItem("area", "All", "areaMode", "all")
]
});
+
+ var lineMenu = new Ext.menu.Menu({
+ items: [
+ menuRadioItem("line", "Slope Line (default)", "lineMode", ""),
+ menuRadioItem("line", "Staircase Line", "lineMode", "staircase"),
+ menuRadioItem("line", "Connected Line", "lineMode", "connected"),
+ ]
+ });
var displayMenu = new Ext.menu.Menu({
items: [
@@ -1017,8 +1025,8 @@
{text: "Y Axis", menu: yAxisMenu},
menuInputItem("Line Thickness", "lineWidth"),
{text: "Area Mode", menu: areaMenu},
+ {text: "Line Mode", menu: lineMenu},
menuCheckItem("Alpha Masking", "template", "alphas"),
- menuCheckItem("Staircase Line", "lineMode", "staircase"),
{text: "Canvas Color", menu: createColorMenu('bgcolor')},
{text: "Display", menu: displayMenu},
{text: "Font", menu: fontMenu}
=== modified file 'webapp/graphite/render/glyph.py'
--- webapp/graphite/render/glyph.py 2011-04-20 20:10:56 +0000
+++ webapp/graphite/render/glyph.py 2011-05-11 13:20:16 +0000
@@ -326,7 +326,7 @@
'graphOnly','yMin','yMax','yLimit','yStep','areaMode', \
'areaAlpha','drawNullAsZero','tz', 'yAxisSide','pieMode', \
'yUnitSystem', 'logBase')
- validLineModes = ('staircase','slope')
+ validLineModes = ('staircase','slope','connected')
validAreaModes = ('none','first','all','stacked')
validPieModes = ('maximum', 'minimum', 'average')
@@ -537,32 +537,19 @@
x += series.xStep
continue
- if self.lineMode == 'staircase':
- if fromNone:
-
+ if fromNone:
if self.areaMode != 'none':
self.ctx.move_to(x,self.area['ymax'])
self.ctx.line_to(x,y)
else:
- self.ctx.move_to(x,y)
-
- else:
+ if self.lineMode != 'connected':
+ self.ctx.move_to(x,y)
+ else:
+ if self.lineMode == 'staircase':
self.ctx.line_to(x,y)
- x += series.xStep
- self.ctx.line_to(x,y)
-
- elif self.lineMode == 'slope':
- if fromNone:
-
- if self.areaMode != 'none':
- self.ctx.move_to(x,self.area['ymax'])
- self.ctx.line_to(x,y)
- else:
- self.ctx.move_to(x,y)
-
- x += series.xStep
- self.ctx.line_to(x,y)
+ x += series.xStep
+ self.ctx.line_to(x,y)
fromNone = False