How to use the d3-scale-chromatic.schemeBlues function in d3-scale-chromatic

To help you get started, we’ve selected a few d3-scale-chromatic examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github john-guerra / navio / shipyard / src / components / playground / navio-container / NavioContainer.jsx View on Github external
setupNavio2 = () => {
    this.nn = new Navio(this.target, 600).updateCallback(this.props.updateFilteredData);
    for (var i = 0; i < this.props.attributes.length; i++) {
        let d = this.props.attributes[i];
            if (d.checked) {
        if (d.type === cat) {
          this.nn.addCategoricalAttrib(d.name, 
            d3.scaleOrdinal(d3.schemeCategory10));
        } else if (d.type === seq) {
          if (d.data === 'date') {
            this.nn.addSequentialAttrib(d.name,
              d3.scaleTime(d3_chromatic.schemeBlues))
                // .domain(d.min, d.max)
                // .range([d3_chromatic.interpolatePurples(0), d3_chromatic.interpolatePurples(1)]))
          }
          else {
            console.log(d3)
            console.log(d3_chromatic)
            this.nn.addSequentialAttrib(d.name) 
              // d3.scaleLinear()
              //   // .base(Math.E)
              //   .domain(d.min, d.max)
              //   .range([0,600]))
          }
        }
      }
    }
    this.nn.data(this.props.data);
github john-guerra / navio / shipyard / src / components / playground / navio-container / NavioContainer.jsx View on Github external
getScaleOrdinalColor = (color) => {
    switch (color) {
      case 'blue':
        return d3.scaleOrdinal(d3_chromatic.schemeBlues);
      case 'purple':
        return d3.scaleOrdinal(d3_chromatic.schemePurples);
      case 'red':
        return d3.scaleOrdinal(d3_chromatic.schemeReds);
      case 'green':
        return d3.scaleOrdinal(d3_chromatic.schemeGreens);
      case 'gray':
        return d3.scaleOrdinal(d3_chromatic.schemeGreys);
      case 'orange':
        return d3.scaleOrdinal(d3_chromatic.schemeOranges);
      default:
        // purple
        console.log('default', color);
        return d3.scaleLinear(d3_chromatic.schemeOranges);
        
    }
github john-guerra / navio / shipyard / src / components / playground / navio-container / NavioContainer.jsx View on Github external
getScaleTimeColor = (color) => {
    switch (color) {
      case 'blue':
        return d3.scaleTime(d3_chromatic.schemeBlues);
      case 'purple':
        return d3.scaleTime(d3_chromatic.schemePurples);
      case 'red':
        return d3.scaleTime(d3_chromatic.schemeReds);
      case 'green':
        return d3.scaleTime(d3_chromatic.schemeGreens);
      case 'gray':
        return d3.scaleTime(d3_chromatic.schemeGreys);
      case 'orange':
        return d3.scaleTime(d3_chromatic.schemeOranges);
      default:
        // purple
        console.log('default!!!!!!!!!!!!!!!!!')
        // color = null;
        return d3.scaleTime(d3_chromatic.schemeGreys);
    }
github wikimedia / analytics-dashiki / src / components / visualizers / worldmap / bindings.js View on Github external
update: function (element, valueAccessor) {
            var values = ko.unwrap(valueAccessor());
            var data = values.data;
            var date = values.date;
            var buckets = 9;
            var palette = d3_color.schemeBlues[buckets];
            removeErrorBox(element);
            try {
                var currentData = getDataValues(data, date);
                drawMap(element, currentData, buckets, palette);
            } catch (error) {
                showError(element, error);
            }
        }
    };