How to use the d3-scale.schemeCategory10 function in d3-scale

To help you get started, we’ve selected a few d3-scale 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 DefinitelyTyped / DefinitelyTyped / d3-scale / d3-scale-tests.ts View on Github external
outputNumberMaybe = pointScaleString('neutral');

outputNumberMaybe = pointScaleCoercible(new StringCoercible('negative'));

// copy(...) -----------------------------------------------------------------

let copiedPointScale: d3Scale.ScalePoint = pointScaleCoercible.copy();

// -------------------------------------------------------------------------------
// Categorical Color Schemas for Ordinal Scales
// -------------------------------------------------------------------------------

let colorStrings: string[];

colorStrings = d3Scale.schemeCategory10;

colorStrings = d3Scale.schemeCategory20;

colorStrings = d3Scale.schemeCategory20b;

colorStrings = d3Scale.schemeCategory20c;
github babsey / nest-desktop / src / network-layout.js View on Github external
"use strict"

const d3Color = require("d3-color");
const d3Drag = require('d3-drag')
const d3Force = require('d3-force')
const d3Selection = require('d3-selection')
const d3Scale = require('d3-scale')

var colors = d3Scale.schemeCategory10;

var pathColor = {
    inh: '#b34846',
    exc: '#467ab3'
};

// mouse event vars
window.selected_node = null;
window.selected_link = null;
window.mousedown_link = null;
window.mousedown_node = null;
window.mouseup_node = null;

function resetMouseVars() {
    mousedown_node = null;
    mouseup_node = null;
github ethantran / react-native-examples / src / screens / SvgAnimation.js View on Github external
translateY={descendant.y}
                    fill={descendant.children ? 'blue' : 'orange'}
                    fillOpacity={descendant.children ? 0.5 : 1}
                />,
            translate: 0
        };

        // D3HierarchyPartition
        const partitionDataRoot = d3Hierarchy
            .stratify()
            .parentId(d => d.id.substring(0, d.id.lastIndexOf('.')))(
            hierarchyData
        )
            .sum(d => d.value)
            .sort((a, b) => b.height - a.height || b.value - a.value);
        const partitionColor = d3Scale.scaleOrdinal(d3Scale.schemeCategory10);
        normalPropsForType.D3HierarchyPartition = {
            root: partitionDataRoot,
            size: [height, width],
            padding: 1,
            round: true,
            renderDescendant: descendant => {
                let d = descendant;
                while (d.depth > 1) {
                    d = d.parent;
                }
                return (
github pbeshai / d3-scale-interactive / src / ScaleProxy.js View on Github external
import readFromScale from './readFromScale';
import { asString as colorInterpolatorAsString } from './d3ColorInterpolators';
import { asString as interpolatorAsString } from './d3Interpolators';
import { asString as colorSchemeAsString } from './d3ColorSchemes';

const Events = {
  // when we change the scale, update is fired
  update: 'update',

  // any time a setter is called on the scale, proxySet is fired
  proxySet: 'proxy-set',
};

// needed for on change scale by type to ensure we have valid initial settings
const defaultScales = {
  scaleOrdinal: d3Scale.scaleOrdinal(d3Scale.schemeCategory10),
  scaleSequential: d3Scale.scaleSequential(d3Scale.interpolateMagma),
  scalePow: d3Scale.scalePow().exponent(10),
};

// list of continuous scales
const continuousScales = ['scaleLinear', 'scalePow', 'scaleLog', 'scaleTime', 'scaleUtc', 'scaleIdentity'];
const ordinalScales = ['scaleOrdinal', 'scalePoint', 'scaleBand'];
const timeScales = ['scaleTime', 'scaleUtc'];

/**
 * Class for proxying a d3 scale so it can change type and keep stats
 * without changing its reference or interface.
 */
export default class ScaleProxy {

  /**
github quantmind / giotto / src / plugins / scales.js View on Github external
rangeFunctions.set('category10', function () {
    return d3.scaleOrdinal(d3.schemeCategory10);
});