Skip to content

[charts] Replace react-spring with d3-transition/CSS transitions #16945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/x-charts-vendor/d3-dispatch.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

// `x-charts-vendor/d3-dispatch` (TypeScript)
//
// Export the type definitions for this package:
export * from "d3-dispatch";
7 changes: 7 additions & 0 deletions packages/x-charts-vendor/d3-dispatch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

// `x-charts-vendor/d3-dispatch` (CommonJS)
// See upstream license: https://github.com/d3/d3-dispatch/blob/main/LICENSE
//
// This file only exists for tooling that doesn't work yet with package.json:exports
// by proxying through the CommonJS version.
module.exports = require("./lib/d3-dispatch");
5 changes: 5 additions & 0 deletions packages/x-charts-vendor/d3-ease.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

// `x-charts-vendor/d3-ease` (TypeScript)
//
// Export the type definitions for this package:
export * from "d3-ease";
7 changes: 7 additions & 0 deletions packages/x-charts-vendor/d3-ease.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

// `x-charts-vendor/d3-ease` (CommonJS)
// See upstream license: https://github.com/d3/d3-ease/blob/main/LICENSE
//
// This file only exists for tooling that doesn't work yet with package.json:exports
// by proxying through the CommonJS version.
module.exports = require("./lib/d3-ease");
5 changes: 5 additions & 0 deletions packages/x-charts-vendor/d3-selection.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

// `x-charts-vendor/d3-selection` (TypeScript)
//
// Export the type definitions for this package:
export * from "d3-selection";
7 changes: 7 additions & 0 deletions packages/x-charts-vendor/d3-selection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

// `x-charts-vendor/d3-selection` (CommonJS)
// See upstream license: https://github.com/d3/d3-selection/blob/main/LICENSE
//
// This file only exists for tooling that doesn't work yet with package.json:exports
// by proxying through the CommonJS version.
module.exports = require("./lib/d3-selection");
5 changes: 5 additions & 0 deletions packages/x-charts-vendor/d3-timer.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

// `x-charts-vendor/d3-timer` (TypeScript)
//
// Export the type definitions for this package:
export * from "d3-timer";
7 changes: 7 additions & 0 deletions packages/x-charts-vendor/d3-timer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

// `x-charts-vendor/d3-timer` (CommonJS)
// See upstream license: https://github.com/d3/d3-timer/blob/main/LICENSE
//
// This file only exists for tooling that doesn't work yet with package.json:exports
// by proxying through the CommonJS version.
module.exports = require("./lib/d3-timer");
5 changes: 5 additions & 0 deletions packages/x-charts-vendor/d3-transition.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

// `x-charts-vendor/d3-transition` (TypeScript)
//
// Export the type definitions for this package:
export * from "d3-transition";
7 changes: 7 additions & 0 deletions packages/x-charts-vendor/d3-transition.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

// `x-charts-vendor/d3-transition` (CommonJS)
// See upstream license: https://github.com/d3/d3-transition/blob/main/LICENSE
//
// This file only exists for tooling that doesn't work yet with package.json:exports
// by proxying through the CommonJS version.
module.exports = require("./lib/d3-transition");
6 changes: 6 additions & 0 deletions packages/x-charts-vendor/es/d3-dispatch.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

// `x-charts-vendor/d3-dispatch` (ESM)
// See upstream license: https://github.com/d3/d3-dispatch/blob/main/LICENSE
//
// Our ESM package uses the underlying installed dependencies of `node_modules/d3-dispatch`
export * from "d3-dispatch";
6 changes: 6 additions & 0 deletions packages/x-charts-vendor/es/d3-ease.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

// `x-charts-vendor/d3-ease` (ESM)
// See upstream license: https://github.com/d3/d3-ease/blob/main/LICENSE
//
// Our ESM package uses the underlying installed dependencies of `node_modules/d3-ease`
export * from "d3-ease";
6 changes: 6 additions & 0 deletions packages/x-charts-vendor/es/d3-selection.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

// `x-charts-vendor/d3-selection` (ESM)
// See upstream license: https://github.com/d3/d3-selection/blob/main/LICENSE
//
// Our ESM package uses the underlying installed dependencies of `node_modules/d3-selection`
export * from "d3-selection";
6 changes: 6 additions & 0 deletions packages/x-charts-vendor/es/d3-timer.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

// `x-charts-vendor/d3-timer` (ESM)
// See upstream license: https://github.com/d3/d3-timer/blob/main/LICENSE
//
// Our ESM package uses the underlying installed dependencies of `node_modules/d3-timer`
export * from "d3-timer";
6 changes: 6 additions & 0 deletions packages/x-charts-vendor/es/d3-transition.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

// `x-charts-vendor/d3-transition` (ESM)
// See upstream license: https://github.com/d3/d3-transition/blob/main/LICENSE
//
// Our ESM package uses the underlying installed dependencies of `node_modules/d3-transition`
export * from "d3-transition";
13 changes: 13 additions & 0 deletions packages/x-charts-vendor/lib-vendor/d3-dispatch/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2010-2021 Mike Bostock

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
91 changes: 91 additions & 0 deletions packages/x-charts-vendor/lib-vendor/d3-dispatch/src/dispatch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var noop = {
value: () => {}
};
function dispatch() {
for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {
if (!(t = arguments[i] + "") || t in _ || /[\s.]/.test(t)) throw new Error("illegal type: " + t);
_[t] = [];
}
return new Dispatch(_);
}
function Dispatch(_) {
this._ = _;
}
function parseTypenames(typenames, types) {
return typenames.trim().split(/^|\s+/).map(function (t) {
var name = "",
i = t.indexOf(".");
if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);
if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t);
return {
type: t,
name: name
};
});
}
Dispatch.prototype = dispatch.prototype = {
constructor: Dispatch,
on: function (typename, callback) {
var _ = this._,
T = parseTypenames(typename + "", _),
t,
i = -1,
n = T.length;

// If no callback was specified, return the callback of the given type and name.
if (arguments.length < 2) {
while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;
return;
}

// If a type was specified, set the callback for the given type and name.
// Otherwise, if a null callback was specified, remove callbacks of the given name.
if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback);
while (++i < n) {
if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);
}
return this;
},
copy: function () {
var copy = {},
_ = this._;
for (var t in _) copy[t] = _[t].slice();
return new Dispatch(copy);
},
call: function (type, that) {
if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];
if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);
},
apply: function (type, that, args) {
if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);
}
};
function get(type, name) {
for (var i = 0, n = type.length, c; i < n; ++i) {
if ((c = type[i]).name === name) {
return c.value;
}
}
}
function set(type, name, callback) {
for (var i = 0, n = type.length; i < n; ++i) {
if (type[i].name === name) {
type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));
break;
}
}
if (callback != null) type.push({
name: name,
value: callback
});
return type;
}
var _default = exports.default = dispatch;
13 changes: 13 additions & 0 deletions packages/x-charts-vendor/lib-vendor/d3-dispatch/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "dispatch", {
enumerable: true,
get: function () {
return _dispatch.default;
}
});
var _dispatch = _interopRequireDefault(require("./dispatch.js"));
28 changes: 28 additions & 0 deletions packages/x-charts-vendor/lib-vendor/d3-ease/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Copyright 2010-2021 Mike Bostock
Copyright 2001 Robert Penner
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the author nor the names of contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 changes: 31 additions & 0 deletions packages/x-charts-vendor/lib-vendor/d3-ease/src/back.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.backOut = exports.backInOut = exports.backIn = void 0;
var overshoot = 1.70158;
var backIn = exports.backIn = function custom(s) {
s = +s;
function backIn(t) {
return (t = +t) * t * (s * (t - 1) + t);
}
backIn.overshoot = custom;
return backIn;
}(overshoot);
var backOut = exports.backOut = function custom(s) {
s = +s;
function backOut(t) {
return --t * t * ((t + 1) * s + t) + 1;
}
backOut.overshoot = custom;
return backOut;
}(overshoot);
var backInOut = exports.backInOut = function custom(s) {
s = +s;
function backInOut(t) {
return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2;
}
backInOut.overshoot = custom;
return backInOut;
}(overshoot);
27 changes: 27 additions & 0 deletions packages/x-charts-vendor/lib-vendor/d3-ease/src/bounce.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.bounceIn = bounceIn;
exports.bounceInOut = bounceInOut;
exports.bounceOut = bounceOut;
var b1 = 4 / 11,
b2 = 6 / 11,
b3 = 8 / 11,
b4 = 3 / 4,
b5 = 9 / 11,
b6 = 10 / 11,
b7 = 15 / 16,
b8 = 21 / 22,
b9 = 63 / 64,
b0 = 1 / b1 / b1;
function bounceIn(t) {
return 1 - bounceOut(1 - t);
}
function bounceOut(t) {
return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;
}
function bounceInOut(t) {
return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;
}
17 changes: 17 additions & 0 deletions packages/x-charts-vendor/lib-vendor/d3-ease/src/circle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.circleIn = circleIn;
exports.circleInOut = circleInOut;
exports.circleOut = circleOut;
function circleIn(t) {
return 1 - Math.sqrt(1 - t * t);
}
function circleOut(t) {
return Math.sqrt(1 - --t * t);
}
function circleInOut(t) {
return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;
}
17 changes: 17 additions & 0 deletions packages/x-charts-vendor/lib-vendor/d3-ease/src/cubic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.cubicIn = cubicIn;
exports.cubicInOut = cubicInOut;
exports.cubicOut = cubicOut;
function cubicIn(t) {
return t * t * t;
}
function cubicOut(t) {
return --t * t * t + 1;
}
function cubicInOut(t) {
return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
}
Loading
Loading