diff --git a/docs/build.sh b/docs/build.sh index c02b2257c5..611e42d08d 100755 --- a/docs/build.sh +++ b/docs/build.sh @@ -1,3 +1,4 @@ #!/usr/bin/env bash rm -r _build make html +cp -r _build/html/ ../../panoramix-docs/ diff --git a/panoramix/static/panoramix.js b/panoramix/static/panoramix.js index 4d6c1a7a7a..fadae8e454 100644 --- a/panoramix/static/panoramix.js +++ b/panoramix/static/panoramix.js @@ -3,6 +3,22 @@ var px = (function() { var visualizations = {}; var dashboard = undefined; + var bnbColors = [ + //rausch hackb kazan babu lima beach barol + '#ff5a5f', '#7b0051', '#007A87', '#00d1c1', '#8ce071', '#ffb400', '#b4a76c', + '#ff8083', '#cc0086', '#00a1b3', '#00ffeb', '#bbedab', '#ffd266', '#cbc29a', + '#ff3339', '#ff1ab1', '#005c66', '#00b3a5', '#55d12e', '#b37e00', '#988b4e', + ]; + function colorBnb() { + // Color factory + var seen = {}; + return function(s){ + if(seen[s] === undefined) + seen[s] = Object.keys(seen).length; + return bnbColors[seen[s] % bnbColors.length]; + }; + } + function UTC(dttm){ return v = new Date(dttm.getUTCFullYear(), dttm.getUTCMonth(), dttm.getUTCDate(), dttm.getUTCHours(), dttm.getUTCMinutes(), dttm.getUTCSeconds()); } @@ -27,10 +43,6 @@ var px = (function() { return f(d); }; } - colors = [ - "#FF5A5F", "#007A87", "#7B0051", "#00D1C1", "#8CE071", "#FFB400", - "#FFAA91", "#B4A76C", "#9CA299", "#565A5C" - ]; var Slice = function(data, dashboard){ var timer; @@ -474,7 +486,8 @@ var px = (function() { initExploreView: initExploreView, initDashboardView: initDashboardView, formatDate: formatDate, - colors: colors, timeFormatFactory: timeFormatFactory, + colorBnb: colorBnb, + bnbColors: bnbColors, } })(); diff --git a/panoramix/static/widgets/viz_wordcloud.js b/panoramix/static/widgets/viz_wordcloud.js index c4c92d217a..af7a049ca7 100644 --- a/panoramix/static/widgets/viz_wordcloud.js +++ b/panoramix/static/widgets/viz_wordcloud.js @@ -27,7 +27,7 @@ px.registerViz('word_cloud', function(slice) { scale = d3.scale.linear() .range(range) .domain(d3.extent(data, function(d) { return d.size; })); - var fill = d3.scale.category20(); + var fill = px.colorBnb(); var layout = d3.layout.cloud() .size(size) .words(data) diff --git a/panoramix/utils.py b/panoramix/utils.py index f8eda5c46b..9ac8bfa404 100644 --- a/panoramix/utils.py +++ b/panoramix/utils.py @@ -107,26 +107,13 @@ class JSONEncodedDict(TypeDecorator): class ColorFactory(object): BNB_COLORS = [ - "#007A87", - "#00D1C1", - "#565A5C", - "#7B0051", - "#898C8C", - "#8CE071", - "#4EDED2", - "#4FA3AB", - "#9CA299", - "#A14D83", - "#B4A76C", - "#C9BF97", - "#FF5A5F", - "#FFAA91", - "#FFB400", - "#FFC4B3", - "#FFCA4F", + #rausch hackb kazan babu lima beach barol + '#ff5a5f', '#7b0051', '#007A87', '#00d1c1', '#8ce071', '#ffb400', '#b4a76c', + '#ff8083', '#cc0086', '#00a1b3', '#00ffeb', '#bbedab', '#ffd266', '#cbc29a', + '#ff3339', '#ff1ab1', '#005c66', '#00b3a5', '#55d12e', '#b37e00', '#988b4e', ] - def __init__(self, hash_based=True): + def __init__(self, hash_based=False): self.d = {} self.hash_based = hash_based diff --git a/panoramix/viz.py b/panoramix/viz.py index 1ffffa33bc..dfdd3f5269 100644 --- a/panoramix/viz.py +++ b/panoramix/viz.py @@ -845,6 +845,7 @@ class DistributionBarViz(DistributionPieViz): df = self.get_df() series = df.to_dict('series') chart_data = [] + cf = utils.ColorFactory() for name, ys in series.items(): if df[name].dtype.kind not in "biufc": continue @@ -855,7 +856,6 @@ class DistributionBarViz(DistributionPieViz): series_title = ", ".join(name) else: series_title = ", ".join(name[1:]) - cf = utils.ColorFactory() d = { "key": series_title, "color": cf.get(series_title),