How to use the d3-contour.contours function in d3-contour

To help you get started, we’ve selected a few d3-contour 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 ethantran / react-native-examples / src / components / AnimatedSvgD3Contour.js View on Github external
function createGenerator(props, generator?: Contours): Contours {
    generator = generator || d3.contours();
    return args.reduce((acc: Contours, arg) => {
        const prop = props[arg];
        if (prop) {
            return acc[arg](prop);
        }
        return acc;
    }, generator);
}
github pissang / papercut-box-art / src / simplexCuts.js View on Github external
function create(img) {
        return contours()
            .size([m, n])
            .thresholds(thresholds)(values)
            .map(function (contour) {
                var canvas = document.createElement('canvas');
                var ctx = canvas.getContext('2d');
                canvas.width = 2048;
                canvas.height = 2048;
                var path = geoPath(null, ctx);
                if (img) {
                    var pattern = ctx.createPattern(img, 'repeat');
                    ctx.fillStyle = pattern;
                }
                else {
                    ctx.fillStyle = '#fff';
                }
                ctx.fillRect(0, 0, canvas.width, canvas.height);

d3-contour

Compute contour polygons using marching squares.

ISC
Latest version published 1 year ago

Package Health Score

71 / 100
Full package analysis