toolkit/javascript/d3/src/scale/category.js
changeset 47 c0b4a8b5a012
equal deleted inserted replaced
46:efd9c589177a 47:c0b4a8b5a012
       
     1 /*
       
     2  * This product includes color specifications and designs developed by Cynthia
       
     3  * Brewer (http://colorbrewer.org/). See lib/colorbrewer for more information.
       
     4  */
       
     5 
       
     6 d3.scale.category10 = function() {
       
     7   return d3.scale.ordinal().range(d3_category10);
       
     8 };
       
     9 
       
    10 d3.scale.category20 = function() {
       
    11   return d3.scale.ordinal().range(d3_category20);
       
    12 };
       
    13 
       
    14 d3.scale.category20b = function() {
       
    15   return d3.scale.ordinal().range(d3_category20b);
       
    16 };
       
    17 
       
    18 d3.scale.category20c = function() {
       
    19   return d3.scale.ordinal().range(d3_category20c);
       
    20 };
       
    21 
       
    22 var d3_category10 = [
       
    23   "#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd",
       
    24   "#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf"
       
    25 ];
       
    26 
       
    27 var d3_category20 = [
       
    28   "#1f77b4", "#aec7e8",
       
    29   "#ff7f0e", "#ffbb78",
       
    30   "#2ca02c", "#98df8a",
       
    31   "#d62728", "#ff9896",
       
    32   "#9467bd", "#c5b0d5",
       
    33   "#8c564b", "#c49c94",
       
    34   "#e377c2", "#f7b6d2",
       
    35   "#7f7f7f", "#c7c7c7",
       
    36   "#bcbd22", "#dbdb8d",
       
    37   "#17becf", "#9edae5"
       
    38 ];
       
    39 
       
    40 var d3_category20b = [
       
    41   "#393b79", "#5254a3", "#6b6ecf", "#9c9ede",
       
    42   "#637939", "#8ca252", "#b5cf6b", "#cedb9c",
       
    43   "#8c6d31", "#bd9e39", "#e7ba52", "#e7cb94",
       
    44   "#843c39", "#ad494a", "#d6616b", "#e7969c",
       
    45   "#7b4173", "#a55194", "#ce6dbd", "#de9ed6"
       
    46 ];
       
    47 
       
    48 var d3_category20c = [
       
    49   "#3182bd", "#6baed6", "#9ecae1", "#c6dbef",
       
    50   "#e6550d", "#fd8d3c", "#fdae6b", "#fdd0a2",
       
    51   "#31a354", "#74c476", "#a1d99b", "#c7e9c0",
       
    52   "#756bb1", "#9e9ac8", "#bcbddc", "#dadaeb",
       
    53   "#636363", "#969696", "#bdbdbd", "#d9d9d9"
       
    54 ];