You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kibble.apache.org by hu...@apache.org on 2019/06/11 18:25:45 UTC

[kibble] branch master updated (d878317 -> c67a817)

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/kibble.git.


    from d878317  clean up, rearrange
     new 53fdf88  follow specified sort order if any
     new d81daae  specify sort order for evolution charts
     new c67a817  regen JS

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 api/pages/code/evolution.py          |  1 +
 ui/js/coffee/charts_linechart.coffee | 12 ++++++++++--
 ui/js/kibble.v1.js                   | 20 ++++++++++++++------
 3 files changed, 25 insertions(+), 8 deletions(-)


[kibble] 01/03: follow specified sort order if any

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kibble.git

commit 53fdf881686c800b3d0a4083546947313f42275c
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Jun 11 20:24:52 2019 +0200

    follow specified sort order if any
---
 ui/js/coffee/charts_linechart.coffee | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/ui/js/coffee/charts_linechart.coffee b/ui/js/coffee/charts_linechart.coffee
index 3a6fe8d..441a3a2 100644
--- a/ui/js/coffee/charts_linechart.coffee
+++ b/ui/js/coffee/charts_linechart.coffee
@@ -67,8 +67,15 @@ charts_linechart = (obj, data, options) ->
                     if xts[k] == undefined
                         xts[k] = []
                     xts[k].push(v)
-
-        for key, val of xts
+        # If API specifies sort order in charts, follow it
+        keys = []
+        if data.sortOrder
+            keys = data.sortOrder
+        else
+            keys = Object.keys(xts)
+        
+        for key in keys
+            val = xts[key]
             xx = [key]
             for el in val
                 xx.push(el)
@@ -97,6 +104,7 @@ charts_linechart = (obj, data, options) ->
     config = {
         bindto: obj,
         data: {
+          order: null,
           x: if data.timeseries then 'x' else null,
           #xFormat: '%s',
           columns: asDataArray,


[kibble] 03/03: regen JS

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kibble.git

commit c67a8172f39a5c771895b589bb9f12dfdf842d2b
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Jun 11 20:25:29 2019 +0200

    regen JS
---
 ui/js/kibble.v1.js | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/ui/js/kibble.v1.js b/ui/js/kibble.v1.js
index b064c16..cbadb54 100644
--- a/ui/js/kibble.v1.js
+++ b/ui/js/kibble.v1.js
@@ -238,7 +238,7 @@ charts_linechart_stacked = (function(_this) {
 })(this);
 
 charts_linechart = function(obj, data, options) {
-  var a, asDataArray, asList, asTypes, axisData, c, config, dataPoint, dateFormat, el, i1, k, key, len, len1, len2, linetype, ndate, q, ref, ref1, stacked, tmpArray, ts, u, v, val, xts, xx;
+  var a, asDataArray, asList, asTypes, axisData, c, config, dataPoint, dateFormat, el, i1, j1, k, key, keys, len, len1, len2, len3, linetype, ndate, q, ref, ref1, stacked, tmpArray, ts, u, v, val, xts, xx;
   linetype = (options && options.linetype) ? options.linetype : 'line';
   stacked = (options && options.stacked) ? options.stacked : false;
   if (options && options.filled && linetype === "line") {
@@ -299,11 +299,18 @@ charts_linechart = function(obj, data, options) {
         }
       }
     }
-    for (key in xts) {
+    keys = [];
+    if (data.sortOrder) {
+      keys = data.sortOrder;
+    } else {
+      keys = Object.keys(xts);
+    }
+    for (u = 0, len1 = keys.length; u < len1; u++) {
+      key = keys[u];
       val = xts[key];
       xx = [key];
-      for (u = 0, len1 = val.length; u < len1; u++) {
-        el = val[u];
+      for (i1 = 0, len2 = val.length; i1 < len2; i1++) {
+        el = val[i1];
         xx.push(el);
       }
       ts.push(xx);
@@ -324,8 +331,8 @@ charts_linechart = function(obj, data, options) {
       asTypes[k] = 'bar';
       tmpArray = [k];
       if (isArray(v)) {
-        for (i1 = 0, len2 = v.length; i1 < len2; i1++) {
-          dataPoint = v[i1];
+        for (j1 = 0, len3 = v.length; j1 < len3; j1++) {
+          dataPoint = v[j1];
           tmpArray.push(dataPoint);
         }
       } else {
@@ -338,6 +345,7 @@ charts_linechart = function(obj, data, options) {
   config = {
     bindto: obj,
     data: {
+      order: null,
       x: data.timeseries ? 'x' : null,
       columns: asDataArray,
       types: asTypes,


[kibble] 02/03: specify sort order for evolution charts

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kibble.git

commit d81daae4322b056f36eb4d3517692d990d1f1be7
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Jun 11 20:25:22 2019 +0200

    specify sort order for evolution charts
---
 api/pages/code/evolution.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/api/pages/code/evolution.py b/api/pages/code/evolution.py
index f852457..593bd47 100644
--- a/api/pages/code/evolution.py
+++ b/api/pages/code/evolution.py
@@ -167,6 +167,7 @@ def run(API, environ, indata, session):
             'stack': True
         },
         'timeseries': timeseries,
+        'sortOrder': ['code', 'comments', 'blanks'],
         'okay': True,
         'responseTime': time.time() - now
     }