How to use the d3-transition.transition.prototype function in d3-transition

To help you get started, we’ve selected a few d3-transition 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 quantmind / d3-canvas-transition / src / tween.js View on Github external
import {pen} from './path';


const originalAttr = transition.prototype.attr;


function tweenAttr (name, value) {
    var node = this.node();
    if (node instanceof CanvasElement && pen.test(name, value)) {
        return transition.prototype.attrTween.call(this, name, wrapPath(value));
    }
    else
        return originalAttr.call(this, name, value);
}

transition.prototype.attr = tweenAttr;


export default tweenAttr;


function wrapPath (p) {
    return function (d, i) {
        return function (t) {
            return pen(p, t, d, i);
        };
    };
}
github gka / d3-jetpack / index.js View on Github external
import {selection} from "d3-selection";
import {transition} from "d3-transition";

import translateSelection from "./src/translate-selection";
import append from "./src/append";
import insert from "./src/insert";
import parent from "./src/parent";
import selectAppend from "./src/selectAppend";
import tspans from "./src/tspans";
import appendMany from "./src/appendMany";
import at from "./src/at";
import st from "./src/st";

selection.prototype.translate = translateSelection;
transition.prototype.translate = translateSelection;
selection.prototype.append = append;
selection.prototype.insert = insert;
selection.prototype.parent = parent;
selection.prototype.selectAppend = selectAppend;
selection.prototype.tspans = tspans;
selection.prototype.appendMany = appendMany;
selection.prototype.at = at;
selection.prototype.st = st;
transition.prototype.at = at;
transition.prototype.st = st;
selection.prototype.prop = selection.prototype.property;

export {default as wordwrap} from "./src/wordwrap";
export {default as parseAttributes} from "./src/parseAttributes";
export {default as f} from "./src/f";
export {default as ascendingKey} from "./src/ascendingKey";
github 1wheel / d3-jetpack-module / index.js View on Github external
import {selection} from "d3-selection";
import {transition} from "d3-transition";

import translateSelection from "./src/translate-selection";
import append from "./src/append";
import parent from "./src/parent";
import selectAppend from "./src/selectAppend";
import tspans from "./src/tspans";
import appendMany from "./src/appendMany";
import at from "./src/at";
import st from "./src/st";

selection.prototype.translate = translateSelection;
transition.prototype.translate = translateSelection;
selection.prototype.append = append;
selection.prototype.parent = parent;
selection.prototype.selectAppend = selectAppend;
selection.prototype.tspans = tspans;
selection.prototype.appendMany = appendMany;
selection.prototype.at = at;
selection.prototype.st = st;
transition.prototype.at = at;
transition.prototype.st = st;
selection.prototype.prop = selection.prototype.property;

export {default as wordwrap} from "./src/wordwrap";
export {default as parseAttributes} from "./src/parseAttributes";
export {default as f} from "./src/f";
export {default as ascendingKey} from "./src/ascendingKey";
export {default as descendingKey} from "./src/descendingKey";
github d3 / d3-selection-multi / index.js View on Github external
import {selection} from "d3-selection";
import {transition} from "d3-transition";
import selection_attrs from "./src/selection/attrs";
import selection_styles from "./src/selection/styles";
import selection_properties from "./src/selection/properties";
import transition_attrs from "./src/transition/attrs";
import transition_styles from "./src/transition/styles";

selection.prototype.attrs = selection_attrs;
selection.prototype.styles = selection_styles;
selection.prototype.properties = selection_properties;
transition.prototype.attrs = transition_attrs;
transition.prototype.styles = transition_styles;
github quantmind / giotto / src / canvas / index.js View on Github external
import {CanvasElement} from './element';
import {default as canvasResolution} from './utils';


export {canvasResolution};
export {CanvasElement};

export default function (context, factor) {
    if (!factor) factor = canvasResolution();
    var s = selection();
    s._groups[0][0] = new CanvasElement(context, factor);
    return s;
}


const originalAttr = transition.prototype.attr;


export function tweenAttr (name, value) {
    var node = this.node();
    if (node instanceof CanvasElement && name === 'd')
        return transition.prototype.attrTween.call(this, name, value);
    else
        return originalAttr.call(this, name, value);
}

transition.prototype.attr = tweenAttr;
github 1wheel / d3-jetpack-module / index.js View on Github external
import tspans from "./src/tspans";
import appendMany from "./src/appendMany";
import at from "./src/at";
import st from "./src/st";

selection.prototype.translate = translateSelection;
transition.prototype.translate = translateSelection;
selection.prototype.append = append;
selection.prototype.parent = parent;
selection.prototype.selectAppend = selectAppend;
selection.prototype.tspans = tspans;
selection.prototype.appendMany = appendMany;
selection.prototype.at = at;
selection.prototype.st = st;
transition.prototype.at = at;
transition.prototype.st = st;
selection.prototype.prop = selection.prototype.property;

export {default as wordwrap} from "./src/wordwrap";
export {default as parseAttributes} from "./src/parseAttributes";
export {default as f} from "./src/f";
export {default as ascendingKey} from "./src/ascendingKey";
export {default as descendingKey} from "./src/descendingKey";
export {default as conventions} from "./src/conventions";
export {default as attachTooltip} from "./src/attachTooltip";
export {default as loadData} from "./src/loadData";
export {default as nestBy} from "./src/nestBy";
export {default as round} from "./src/round";
export {default as polygonClip} from "./src/polygonClip";
github quantmind / giotto / src / canvas / index.js View on Github external
export function tweenAttr (name, value) {
    var node = this.node();
    if (node instanceof CanvasElement && name === 'd')
        return transition.prototype.attrTween.call(this, name, value);
    else
        return originalAttr.call(this, name, value);
}
github gka / d3-jetpack / index.js View on Github external
import appendMany from "./src/appendMany";
import at from "./src/at";
import st from "./src/st";

selection.prototype.translate = translateSelection;
transition.prototype.translate = translateSelection;
selection.prototype.append = append;
selection.prototype.insert = insert;
selection.prototype.parent = parent;
selection.prototype.selectAppend = selectAppend;
selection.prototype.tspans = tspans;
selection.prototype.appendMany = appendMany;
selection.prototype.at = at;
selection.prototype.st = st;
transition.prototype.at = at;
transition.prototype.st = st;
selection.prototype.prop = selection.prototype.property;

export {default as wordwrap} from "./src/wordwrap";
export {default as parseAttributes} from "./src/parseAttributes";
export {default as f} from "./src/f";
export {default as ascendingKey} from "./src/ascendingKey";
export {default as descendingKey} from "./src/descendingKey";
export {default as conventions} from "./src/conventions";
export {default as drawAxis} from "./src/drawAxis";
export {default as attachTooltip} from "./src/attachTooltip";
export {default as loadData} from "./src/loadData";
export {default as nestBy} from "./src/nestBy";
export {default as round} from "./src/round";
export {default as clamp} from "./src/clamp";
export {default as polygonClip} from "./src/polygonClip";
export {default as timer} from "./src/timer";
github d3 / d3-selection-multi / index.js View on Github external
import {selection} from "d3-selection";
import {transition} from "d3-transition";
import selection_attrs from "./src/selection/attrs";
import selection_styles from "./src/selection/styles";
import selection_properties from "./src/selection/properties";
import transition_attrs from "./src/transition/attrs";
import transition_styles from "./src/transition/styles";

selection.prototype.attrs = selection_attrs;
selection.prototype.styles = selection_styles;
selection.prototype.properties = selection_properties;
transition.prototype.attrs = transition_attrs;
transition.prototype.styles = transition_styles;
github 1wheel / d3-jetpack-module / index.js View on Github external
import selectAppend from "./src/selectAppend";
import tspans from "./src/tspans";
import appendMany from "./src/appendMany";
import at from "./src/at";
import st from "./src/st";

selection.prototype.translate = translateSelection;
transition.prototype.translate = translateSelection;
selection.prototype.append = append;
selection.prototype.parent = parent;
selection.prototype.selectAppend = selectAppend;
selection.prototype.tspans = tspans;
selection.prototype.appendMany = appendMany;
selection.prototype.at = at;
selection.prototype.st = st;
transition.prototype.at = at;
transition.prototype.st = st;
selection.prototype.prop = selection.prototype.property;

export {default as wordwrap} from "./src/wordwrap";
export {default as parseAttributes} from "./src/parseAttributes";
export {default as f} from "./src/f";
export {default as ascendingKey} from "./src/ascendingKey";
export {default as descendingKey} from "./src/descendingKey";
export {default as conventions} from "./src/conventions";
export {default as attachTooltip} from "./src/attachTooltip";
export {default as loadData} from "./src/loadData";
export {default as nestBy} from "./src/nestBy";
export {default as round} from "./src/round";
export {default as polygonClip} from "./src/polygonClip";