This commit is contained in:
github-actions-bot 2024-02-13 00:11:27 +00:00
parent ea99897717
commit f73869c875
4728 changed files with 12 additions and 1575185 deletions

View File

@ -361,4 +361,4 @@
window['STORIES'] = [{"titlePrefix":"","directory":"./stories","files":"**/*.stories.@(ts|tsx|mdx)","importPathMatcher":"^\\.[\\\\/](?:stories(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(ts|tsx|mdx))$"}];</script><script src="runtime~main.c197c38d.iframe.bundle.js"></script><script src="650.15cc3462.iframe.bundle.js"></script><script src="main.f1cc5400.iframe.bundle.js"></script></body></html>
window['STORIES'] = [{"titlePrefix":"","directory":"./stories","files":"**/*.stories.@(ts|tsx|mdx)","importPathMatcher":"^\\.[\\\\/](?:stories(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(ts|tsx|mdx))$"}];</script><script src="runtime~main.c197c38d.iframe.bundle.js"></script><script src="650.15cc3462.iframe.bundle.js"></script><script src="main.e0400c4b.iframe.bundle.js"></script></body></html>

File diff suppressed because one or more lines are too long

View File

@ -1,20 +0,0 @@
The MIT License (MIT)
Copyright (c) 2013 Steve
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,122 +0,0 @@
Angular Treeview
================
Pure [AngularJS](https://www.angularjs.org) based tree menu directive.
[![ScreenShot](https://github.com/eu81273/angular.treeview/raw/master/img/preview.png)](https://jsfiddle.net/eu81273/8LWUc/)
## Installation
Copy the script and css into your project and add a script and link tag to your page.
```html
<script type="text/javascript" src="/angular.treeview.js"></script>
<link rel="stylesheet" type="text/css" href="css/angular.treeview.css">
```
Add a dependency to your application module.
```javascript
angular.module('myApp', ['angularTreeview']);
```
Add a tree to your application. See [Usage](#usage).
## Usage
Attributes of angular treeview are below.
- angular-treeview: the treeview directive.
- tree-id : each tree's unique id.
- tree-model : the tree model on $scope.
- node-id : each node's id.
- node-label : each node's label.
- node-children: each node's children.
Here is a simple example.
```html
<div
data-angular-treeview="true"
data-tree-id="abc"
data-tree-model="treedata"
data-node-id="id"
data-node-label="label"
data-node-children="children" >
</div>
```
Example model:
```javascript
$scope.treedata =
[
{ "label" : "User", "id" : "role1", "children" : [
{ "label" : "subUser1", "id" : "role11", "children" : [] },
{ "label" : "subUser2", "id" : "role12", "children" : [
{ "label" : "subUser2-1", "id" : "role121", "children" : [
{ "label" : "subUser2-1-1", "id" : "role1211", "children" : [] },
{ "label" : "subUser2-1-2", "id" : "role1212", "children" : [] }
]}
]}
]},
{ "label" : "Admin", "id" : "role2", "children" : [] },
{ "label" : "Guest", "id" : "role3", "children" : [] }
];
```
## Selection
If tree node is selected, then that selected tree node is saved to $scope."TREE ID".currentNode. By using $watch, the controller can recognize the tree selection.
```javascript
$scope.$watch( 'abc.currentNode', function( newObj, oldObj ) {
if( $scope.abc && angular.isObject($scope.abc.currentNode) ) {
console.log( 'Node Selected!!' );
console.log( $scope.abc.currentNode );
}
}, false);
```
## Examples
#### Basic example
[![ScreenShot](https://github.com/eu81273/angular.treeview/raw/master/img/jsfiddle01.png)](https://jsfiddle.net/eu81273/8LWUc/)
[jsFiddle - http://jsfiddle.net/eu81273/8LWUc/](https://jsfiddle.net/eu81273/8LWUc/)
#### Multiple treeview example
[![ScreenShot](https://github.com/eu81273/angular.treeview/raw/master/img/jsfiddle02.png)](https://jsfiddle.net/eu81273/b9Pnw/)
[jsFiddle - http://jsfiddle.net/eu81273/b9Pnw/](https://jsfiddle.net/eu81273/b9Pnw/)
## Browser Compatibility
Same with AngularJS. Safari, Chrome, Firefox, Opera, IE8, IE9 and mobile browsers (Android, Chrome Mobile, iOS Safari).
## Changelogs
#### version 0.1.6
- Fixed the bug that 'null' string appears before each 'div' generated. (Thanks to Iaac)
#### version 0.1.5
- support multiple treeview. (Thanks to Axel Pesme)
#### version 0.1.4
- prevented memory leaks.
#### version 0.1.3
- removed unnecessary codes.
#### version 0.1.2
- removed some jQuery dependency. (Issue #2)
## License
The MIT License.
Copyright ⓒ 2013 AHN JAE-HA.
See [LICENSE](https://github.com/eu81273/angular.treeview/blob/master/LICENSE)

View File

@ -1,95 +0,0 @@
/*
@license Angular Treeview version 0.1.6
2013 AHN JAE-HA http://github.com/eu81273/angular.treeview
License: MIT
[TREE attribute]
angular-treeview: the treeview directive
tree-id : each tree's unique id.
tree-model : the tree model on $scope.
node-id : each node's id
node-label : each node's label
node-children: each node's children
<div
data-angular-treeview="true"
data-tree-id="tree"
data-tree-model="roleList"
data-node-id="roleId"
data-node-label="roleName"
data-node-children="children" >
</div>
*/
(function ( angular ) {
'use strict';
angular.module( 'angularTreeview', [] ).directive( 'treeModel', ['$compile', function( $compile ) {
return {
restrict: 'A',
link: function ( scope, element, attrs ) {
//tree id
var treeId = attrs.treeId;
//tree model
var treeModel = attrs.treeModel;
//node id
var nodeId = attrs.nodeId || 'id';
//node label
var nodeLabel = attrs.nodeLabel || 'label';
//children
var nodeChildren = attrs.nodeChildren || 'children';
//tree template
var template =
'<ul>' +
'<li data-ng-repeat="node in ' + treeModel + '">' +
'<i ng-class="getGroupClass(node)" data-ng-click="' + treeId + '.selectNodeHead(node)"></i>' +
'<span data-ng-class="getSelectedClass(node)" ng-dblclick="edit(node)" data-ng-click="' + treeId + '.selectNodeLabel(node)">{{node.' + nodeLabel + '}}</span>' +
'<div data-ng-hide="node.collapsed" data-tree-id="' + treeId + '" data-tree-model="node.' + nodeChildren + '" data-node-id=' + nodeId + ' data-node-label=' + nodeLabel + ' data-node-children=' + nodeChildren + '></div>' +
'</li>' +
'</ul>';
//check tree id, tree model
if( treeId && treeModel ) {
//root node
if( attrs.angularTreeview ) {
//create tree object if not exists
scope[treeId] = scope[treeId] || {};
//if node head clicks,
scope[treeId].selectNodeHead = scope[treeId].selectNodeHead || function( selectedNode ){
//Collapse or Expand
selectedNode.collapsed = !selectedNode.collapsed;
scope[treeId].selectNodeLabel(selectedNode);
};
//if node label clicks,
scope[treeId].selectNodeLabel = scope[treeId].selectNodeLabel || function( selectedNode ){
//remove highlight from previous node
if( scope[treeId].currentNode && scope[treeId].currentNode.selected ) {
scope[treeId].currentNode.selected = undefined;
}
//set highlight to selected node
selectedNode.selected = 'selected';
//set currentNode
scope[treeId].currentNode = selectedNode;
};
}
//Rendering template.
element.html('').append( $compile( template )( scope ) );
}
}
};
}]);
})( angular );

View File

@ -1,9 +0,0 @@
/*
@license Angular Treeview version 0.1.6
2013 AHN JAE-HA http://github.com/eu81273/angular.treeview
License: MIT
*/
(function(f){f.module("angularTreeview",[]).directive("treeModel",function($compile){return{restrict:"A",link:function(b,h,c){var a=c.treeId,g=c.treeModel,e=c.nodeLabel||"label",d=c.nodeChildren||"children",e='<ul><li data-ng-repeat="node in '+g+'"><i class="collapsed" data-ng-show="node.'+d+'.length && node.collapsed" data-ng-click="'+a+'.selectNodeHead(node)"></i><i class="expanded" data-ng-show="node.'+d+'.length && !node.collapsed" data-ng-click="'+a+'.selectNodeHead(node)"></i><i class="normal" data-ng-hide="node.'+
d+'.length"></i> <span data-ng-class="node.selected" data-ng-click="'+a+'.selectNodeLabel(node)">{{node.'+e+'}}</span><div data-ng-hide="node.collapsed" data-tree-id="'+a+'" data-tree-model="node.'+d+'" data-node-id='+(c.nodeId||"id")+" data-node-label="+e+" data-node-children="+d+"></div></li></ul>";a&&g&&(c.angularTreeview&&(b[a]=b[a]||{},b[a].selectNodeHead=b[a].selectNodeHead||function(a){a.collapsed=!a.collapsed},b[a].selectNodeLabel=b[a].selectNodeLabel||function(c){b[a].currentNode&&b[a].currentNode.selected&&
(b[a].currentNode.selected=void 0);c.selected="selected";b[a].currentNode=c}),h.html('').append($compile(e)(b)))}}})})(angular);

View File

@ -1,99 +0,0 @@
div[angular-treeview] {
/* prevent user selection */
-moz-user-select: -moz-none;
-khtml-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
/* default */
font-family: Tahoma;
font-size:13px;
color: #555;
text-decoration: none;
}
div[tree-model] ul {
margin: 0;
padding: 0;
list-style: none;
border: none;
overflow: hidden;
}
div[tree-model] li {
position: relative;
padding: 0 0 0 20px;
line-height: 20px;
}
div[tree-model] li .expanded {
padding: 1px 10px;
background-image: url("../img/folder.png");
background-repeat: no-repeat;
}
div[tree-model] li .collapsed {
padding: 1px 10px;
background-image: url("../img/folder-closed.png");
background-repeat: no-repeat;
}
div[tree-model] li .normal {
padding: 1px 10px;
background-image: url("../img/file.png");
background-repeat: no-repeat;
}
div[tree-model] li i, div[tree-model] li span {
cursor: pointer;
}
div[tree-model] li .selected {
background-color: #aaddff;
font-weight: bold;
padding: 1px 5px;
}
div[tree-model] li .cut {
font-weight: bold;
color: gray
}
/*
.angular-ui-tree-handle {
cursor: grab;
text-decoration: none;
font-weight: bold;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
min-height: 20px;
line-height: 20px;
}
*/
.angular-ui-tree-handle {
/* background: #f8faff; */
/*
color: #7c9eb2; */
border: 1px solid #dae2ea;
padding: 10px 10px;
cursor: pointer;
}
.expanded-folder {
padding: 1px 10px;
background-image: url("../img/folder.png");
background-repeat: no-repeat;
cursor: pointer;
}
.collapsed-folder {
padding: 1px 10px;
background-image: url("../img/folder-closed.png");
background-repeat: no-repeat;
cursor: pointer;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 289 B

View File

@ -1 +0,0 @@
{"raw":"v1.4.4","major":1,"minor":4,"patch":4,"prerelease":[],"build":[],"version":"1.4.4","codeName":"pylon-requirement","full":"1.4.4","branch":"v1.4.x","cdn":{"raw":"v1.4.3","major":1,"minor":4,"patch":3,"prerelease":[],"build":[],"version":"1.4.3","docsUrl":"http://code.angularjs.org/1.4.3/docs"}}

View File

@ -1,188 +0,0 @@
/* FileSaver.js
* A saveAs() FileSaver implementation.
* 1.3.2
* 2016-06-16 18:25:19
*
* By Eli Grey, http://eligrey.com
* License: MIT
* See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md
*/
/*global self */
/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
var saveAs = saveAs || (function(view) {
"use strict";
// IE <10 is explicitly unsupported
if (typeof view === "undefined" || typeof navigator !== "undefined" && /MSIE [1-9]\./.test(navigator.userAgent)) {
return;
}
var
doc = view.document
// only get URL when necessary in case Blob.js hasn't overridden it yet
, get_URL = function() {
return view.URL || view.webkitURL || view;
}
, save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a")
, can_use_save_link = "download" in save_link
, click = function(node) {
var event = new MouseEvent("click");
node.dispatchEvent(event);
}
, is_safari = /constructor/i.test(view.HTMLElement) || view.safari
, is_chrome_ios =/CriOS\/[\d]+/.test(navigator.userAgent)
, throw_outside = function(ex) {
(view.setImmediate || view.setTimeout)(function() {
throw ex;
}, 0);
}
, force_saveable_type = "application/octet-stream"
// the Blob API is fundamentally broken as there is no "downloadfinished" event to subscribe to
, arbitrary_revoke_timeout = 1000 * 40 // in ms
, revoke = function(file) {
var revoker = function() {
if (typeof file === "string") { // file is an object URL
get_URL().revokeObjectURL(file);
} else { // file is a File
file.remove();
}
};
setTimeout(revoker, arbitrary_revoke_timeout);
}
, dispatch = function(filesaver, event_types, event) {
event_types = [].concat(event_types);
var i = event_types.length;
while (i--) {
var listener = filesaver["on" + event_types[i]];
if (typeof listener === "function") {
try {
listener.call(filesaver, event || filesaver);
} catch (ex) {
throw_outside(ex);
}
}
}
}
, auto_bom = function(blob) {
// prepend BOM for UTF-8 XML and text/* types (including HTML)
// note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF
if (/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) {
return new Blob([String.fromCharCode(0xFEFF), blob], {type: blob.type});
}
return blob;
}
, FileSaver = function(blob, name, no_auto_bom) {
if (!no_auto_bom) {
blob = auto_bom(blob);
}
// First try a.download, then web filesystem, then object URLs
var
filesaver = this
, type = blob.type
, force = type === force_saveable_type
, object_url
, dispatch_all = function() {
dispatch(filesaver, "writestart progress write writeend".split(" "));
}
// on any filesys errors revert to saving with object URLs
, fs_error = function() {
if ((is_chrome_ios || (force && is_safari)) && view.FileReader) {
// Safari doesn't allow downloading of blob urls
var reader = new FileReader();
reader.onloadend = function() {
var url = is_chrome_ios ? reader.result : reader.result.replace(/^data:[^;]*;/, 'data:attachment/file;');
var popup = view.open(url, '_blank');
if(!popup) view.location.href = url;
url=undefined; // release reference before dispatching
filesaver.readyState = filesaver.DONE;
dispatch_all();
};
reader.readAsDataURL(blob);
filesaver.readyState = filesaver.INIT;
return;
}
// don't create more object URLs than needed
if (!object_url) {
object_url = get_URL().createObjectURL(blob);
}
if (force) {
view.location.href = object_url;
} else {
var opened = view.open(object_url, "_blank");
if (!opened) {
// Apple does not allow window.open, see https://developer.apple.com/library/safari/documentation/Tools/Conceptual/SafariExtensionGuide/WorkingwithWindowsandTabs/WorkingwithWindowsandTabs.html
view.location.href = object_url;
}
}
filesaver.readyState = filesaver.DONE;
dispatch_all();
revoke(object_url);
}
;
filesaver.readyState = filesaver.INIT;
if (can_use_save_link) {
object_url = get_URL().createObjectURL(blob);
setTimeout(function() {
save_link.href = object_url;
save_link.download = name;
click(save_link);
dispatch_all();
revoke(object_url);
filesaver.readyState = filesaver.DONE;
});
return;
}
fs_error();
}
, FS_proto = FileSaver.prototype
, saveAs = function(blob, name, no_auto_bom) {
return new FileSaver(blob, name || blob.name || "download", no_auto_bom);
}
;
// IE 10+ (native saveAs)
if (typeof navigator !== "undefined" && navigator.msSaveOrOpenBlob) {
return function(blob, name, no_auto_bom) {
name = name || blob.name || "download";
if (!no_auto_bom) {
blob = auto_bom(blob);
}
return navigator.msSaveOrOpenBlob(blob, name);
};
}
FS_proto.abort = function(){};
FS_proto.readyState = FS_proto.INIT = 0;
FS_proto.WRITING = 1;
FS_proto.DONE = 2;
FS_proto.error =
FS_proto.onwritestart =
FS_proto.onprogress =
FS_proto.onwrite =
FS_proto.onabort =
FS_proto.onerror =
FS_proto.onwriteend =
null;
return saveAs;
}(
typeof self !== "undefined" && self
|| typeof window !== "undefined" && window
|| this.content
));
// `self` is undefined in Firefox for Android content script context
// while `this` is nsIContentFrameMessageManager
// with an attribute `content` that corresponds to the window
if (typeof module !== "undefined" && module.exports) {
module.exports.saveAs = saveAs;
} else if ((typeof define !== "undefined" && define !== null) && (define.amd !== null)) {
define("FileSaver.js", function() {
return saveAs;
});
}

View File

@ -1,72 +0,0 @@
/**!
* FileAPI a set of tools for working with files
*
* @author RubaXa <trash@rubaxa.org>
* @build lib/canvas-to-blob lib/FileAPI.core lib/FileAPI.Image lib/FileAPI.Form lib/FileAPI.XHR lib/FileAPI.Flash
*/
(function(a){var k=a.HTMLCanvasElement&&a.HTMLCanvasElement.prototype,g;if(g=a.Blob)try{g=Boolean(new Blob)}catch(j){g=!1}var m=g;if(g=m)if(g=a.Uint8Array)try{g=100===(new Blob([new Uint8Array(100)])).size}catch(f){g=!1}var c=g,e=a.BlobBuilder||a.WebKitBlobBuilder||a.MozBlobBuilder||a.MSBlobBuilder,q=(m||e)&&a.atob&&a.ArrayBuffer&&a.Uint8Array&&function(a){var l,f,u,g;l=0<=a.split(",")[0].indexOf("base64")?atob(a.split(",")[1]):decodeURIComponent(a.split(",")[1]);f=new ArrayBuffer(l.length);u=new Uint8Array(f);
for(g=0;g<l.length;g+=1)u[g]=l.charCodeAt(g);a=a.split(",")[0].split(":")[1].split(";")[0];if(m)return new Blob([c?u:f],{type:a});u=new e;u.append(f);return u.getBlob(a)};a.HTMLCanvasElement&&!k.toBlob&&(k.mozGetAsFile?k.toBlob=function(a,c){a(this.mozGetAsFile("blob",c))}:k.toDataURL&&q&&(k.toBlob=function(a,c){a(q(this.toDataURL(c)))}));"function"===typeof define&&define.amd?define(function(){return q}):a.dataURLtoBlob=q})(this);
(function(a,k){function g(b,E,a){if(b)if(l(b))for(var d=0,c=b.length;d<c;d++)d in b&&E.call(a,b[d],d,b);else for(d in b)b.hasOwnProperty(d)&&E.call(a,b[d],d,b)}function j(b,d,a){if(b){var c=h.uid(b);D[c]||(D[c]={});g(d.split(/\s+/),function(d){n?n.event.add(b,d,a):(D[c][d]||(D[c][d]=[]),D[c][d].push(a),b.addEventListener?b.addEventListener(d,a,!1):b.attachEvent?b.attachEvent("on"+d,a):b["on"+d]=a)})}}function m(b,d,a){if(b){var c=h.uid(b),e=D[c]||{};g(d.split(/\s+/),function(d){if(n)n.event.remove(b,
d,a);else{for(var E=e[d]||[],c=E.length;c--;)if(E[c]===a){E.splice(c,1);break}b.addEventListener?b.removeEventListener(d,a,!1):b.detachEvent?b.detachEvent("on"+d,a):b["on"+d]=null}})}}function f(b,d,a){j(b,d,function P(c){m(b,d,P);a(c)})}function c(b,d,a,c,e){b={type:a.type||a,target:b,result:c};h.extend(b,e);d(b)}function e(b,d,a,e){if(h.isFile(b)&&p&&p.prototype["readAs"+a]){var n=new p;j(n,K,function Q(a){var e=a.type;"progress"==e?c(b,d,a,a.target.result,{loaded:a.loaded,total:a.total}):"loadend"==
e?(m(n,K,Q),n=null):c(b,d,a,a.target.result)});try{if(e)n["readAs"+a](e,b);else n["readAs"+a](b)}catch(l){c(b,d,"error",k,{error:l.toString()})}}else c(b,d,"error",k,{error:"filreader_not_support_"+a})}function q(b){var d;b.getAsEntry?d=b.getAsEntry():b.webkitGetAsEntry&&(d=b.webkitGetAsEntry());return d}function t(b,d){if(b)if(b.isFile)b.file(function(b){d(!1,[b])},function(){d("entry_file")});else if(b.isDirectory){var a=[];b.createReader().readEntries(function(b){h.afor(b,function(b,c){t(c,function(c,
e){c||(a=a.concat(e));b?b():d(!1,a)})})},function(){d("directory_reader")})}else t(q(b),d);else d("empty_entry")}function l(b){return"object"==typeof b&&b&&"length"in b}function A(b){b.target||(b.target=a.event&&a.event.srcElement||M);3===b.target.nodeType&&(b.target=event.target.parentNode);return b}var u=1,C=function(){},s=navigator.userAgent,y=a.createObjectURL&&a||a.URL&&URL.revokeObjectURL&&URL||a.webkitURL&&webkitURL,r=a.Blob,v=a.File,p=a.FileReader,w=a.FormData,d=a.XMLHttpRequest,n=a.jQuery,
x=!(!v||!p||!a.Uint8Array&&!w&&!d.prototype.sendAsBinary)&&!(/safari\//i.test(s)&&!/chrome\//i.test(s)&&/windows/i.test(s)),s=x&&"withCredentials"in new d,r=x&&!!r&&!(!r.prototype.webkitSlice&&!r.prototype.mozSlice&&!r.prototype.slice),M=a.document,F=a.dataURLtoBlob,T=/img/i,U=/canvas/i,V=/img|canvas/,L=/input/i,I=/^data:[^,]+,/,G=Math.pow,W=Math.round,z=Number,w=function(b){return W(b*this)},H=new z(1024),N=new z(G(H,2)),J=new z(G(H,3)),G=new z(G(H,4)),D={},O=[],K="abort progress error load loadend",
X="status statusText readyState response responseXML responseText responseBody".split(" "),h={version:"1.2.5",cors:!1,html5:!0,debug:!1,pingUrl:!1,withCredentials:!0,staticPath:"./",flashUrl:0,flashImageUrl:0,accept:{"image/*":"art bm bmp dwg dxf cbr cbz fif fpx gif ico iefs jfif jpe jpeg jpg jps jut mcf nap nif pbm pcx pgm pict pm png pnm qif qtif ras rast rf rp svf tga tif tiff xbm xbm xpm xwd","audio/*":"m4a flac aac rm mpa wav wma ogg mp3 mp2 m3u mod amf dmf dsm far gdm imf it m15 med okt s3m stm sfx ult uni xm sid ac3 dts cue aif aiff wpl ape mac mpc mpp shn wv nsf spc gym adplug adx dsp adp ymf ast afc hps xs",
"video/*":"m4v 3gp nsv ts ty strm rm rmvb m3u ifo mov qt divx xvid bivx vob nrg img iso pva wmv asf asx ogm m2v avi bin dat dvr-ms mpg mpeg mp4 mkv avc vp3 svq3 nuv viv dv fli flv wpl"},chunkSize:0,chunkUploadRetry:0,chunkNetworkDownRetryTimeout:2E3,KB:(H.from=w,H),MB:(N.from=w,N),GB:(J.from=w,J),TB:(G.from=w,G),expando:"fileapi"+(new Date).getTime(),uid:function(b){return b?b[h.expando]=b[h.expando]||h.uid():(++u,h.expando+u)},log:function(){h.debug&&(a.console&&console.log)&&(console.log.apply?
console.log.apply(console,arguments):console.log([].join.call(arguments," ")))},getXHR:function(){var b;if(d)b=new d;else if(a.ActiveXObject)try{b=new ActiveXObject("MSXML2.XMLHttp.3.0")}catch(c){b=new ActiveXObject("Microsoft.XMLHTTP")}return b},isArray:l,support:{dnd:s&&"ondrop"in M.createElement("div"),cors:s,html5:x,chunked:r,dataURI:!0},event:{on:j,off:m,one:f,fix:A},throttle:function(b,d){var c,e;return function(){e=arguments;c||(b.apply(a,e),c=setTimeout(function(){c=0;b.apply(a,e)},d))}},
F:function(){},parseJSON:function(b){return a.JSON&&JSON.parse?JSON.parse(b):(new Function("return ("+b.replace(/([\r\n])/g,"\\$1")+");"))()},trim:function(b){b=String(b);return b.trim?b.trim():b.replace(/^\s+|\s+$/g,"")},defer:function(){var b=[],d,a,c={resolve:function(e,n){c.resolve=C;a=e||!1;for(d=n;n=b.shift();)n(a,d)},then:function(c){a!==k?c(a,d):b.push(c)}};return c},queue:function(b){var d=0,a=0,c=!1,e=!1,n={inc:function(){a++},next:function(){d++;setTimeout(n.check,0)},check:function(){d>=
a&&!c&&n.end()},isFail:function(){return c},fail:function(){!c&&b(c=!0)},end:function(){e||(e=!0,b())}};return n},each:g,afor:function(b,d){var a=0,c=b.length;l(b)&&c--?function B(){d(c!=a&&B,b[a],a++)}():d(!1)},extend:function(b){g(arguments,function(d){g(d,function(d,a){b[a]=d})});return b},isFile:function(b){return x&&b&&b instanceof v},isCanvas:function(b){return b&&U.test(b.nodeName)},getFilesFilter:function(b){return(b="string"==typeof b?b:b.getAttribute&&b.getAttribute("accept")||"")?RegExp("("+
b.replace(/\./g,"\\.").replace(/,/g,"|")+")$","i"):/./},readAsDataURL:function(b,d){h.isCanvas(b)?c(b,d,"load",h.toDataURL(b)):e(b,d,"DataURL")},readAsBinaryString:function(b,d){p&&p.prototype.readAsBinaryString?e(b,d,"BinaryString"):e(b,function(b){if("load"==b.type)try{b.result=h.toBinaryString(b.result)}catch(a){b.type="error",b.message=a.toString()}d(b)},"DataURL")},readAsArrayBuffer:function(b,d){e(b,d,"ArrayBuffer")},readAsText:function(b,d,a){a||(a=d,d="utf-8");e(b,a,"Text",d)},toDataURL:function(b){if("string"==
typeof b)return b;if(b.toDataURL)return b.toDataURL("image/png")},toBinaryString:function(b){return a.atob(h.toDataURL(b).replace(I,""))},readAsImage:function(b,d,a){if(h.isFile(b))if(y){var e=y.createObjectURL(b);e===k?c(b,d,"error"):h.readAsImage(e,d,a)}else h.readAsDataURL(b,function(e){"load"==e.type?h.readAsImage(e.result,d,a):(a||"error"==e.type)&&c(b,d,e,null,{loaded:e.loaded,total:e.total})});else h.isCanvas(b)?c(b,d,"load",b):T.test(b.nodeName)?b.complete?c(b,d,"load",b):f(b,"error abort load",
function B(a){"load"==a.type&&y&&y.revokeObjectURL(b.src);m(b,"error abort load",B);c(b,d,a,b)}):b.iframe?c(b,d,{type:"error"}):(e=new Image,e.src=b.dataURL||b,h.readAsImage(e,d,a))},checkFileObj:function(b){var d={},a=h.accept;"object"==typeof b?d=b:d.name=(b+"").split(/\\|\//g).pop();null==d.type&&(d.type=d.name.split(".").pop());g(a,function(b,a){b=RegExp(b.replace(/\s/g,"|"),"i");b.test(d.type)&&(d.type=a.split("/")[0]+"/"+d.type)});return d},getDropFiles:function(b,d){var a=[],c=(b.originalEvent||
b||"").dataTransfer||{},e=l(c.items)&&c.items[0]&&q(c.items[0]),n=h.queue(function(){d(a)});g((e?c.items:c.files)||[],function(b){n.inc();if(e)t(b,function(b,d){!b&&a.push.apply(a,d);n.next()});else{var d=function(d){d&&a.push(b);n.next()};if(!b.type&&0==b.size%4096&&102400>=b.size)if(p)try{var c=new p;f(c,K,function(b){b="error"!=b.type;d(b);b&&c.abort()});c.readAsDataURL(b)}catch(l){d(!1)}else d(null);else d(!0)}});n.check()},getFiles:function(b,d,a){var c=[];if(a)return h.filterFiles(h.getFiles(b),
d,a),null;b.jquery&&(b.each(function(){c=c.concat(h.getFiles(this))}),b=c,c=[]);"string"==typeof d&&(d=h.getFilesFilter(d));b.originalEvent?b=A(b.originalEvent):b.srcElement&&(b=A(b));b.dataTransfer?b=b.dataTransfer:b.target&&(b=b.target);b.files?c=b.files:!x&&L.test(b&&b.tagName)?h.trim(b.value)&&(c=[h.checkFileObj(b.value)],c[0].blob=b,c[0].iframe=!0):l(b)&&(c=b);return h.filter(c,function(b){return!d||d.test(b.name)})},getInfo:function(b,d){var a={},c=O.concat();h.isFile(b)?function B(){var e=
c.shift();e?e.test(b.type)?e(b,function(b,c){b?d(b):(h.extend(a,c),B())}):B():d(!1,a)}():d("not_support",a)},addInfoReader:function(b,d){d.test=function(d){return b.test(d)};O.push(d)},filter:function(b,d){for(var a=[],c=0,e=b.length,n;c<e;c++)c in b&&(n=b[c],d.call(n,n,c,b)&&a.push(n));return a},filterFiles:function(b,d,a){if(b.length){var c=b.concat(),e,n=[],l=[];(function R(){c.length?(e=c.shift(),h.getInfo(e,function(b,a){(d(e,b?!1:a)?n:l).push(e);R()})):a(n,l)})()}else a([],b)},upload:function(b){b=
h.extend({prepare:h.F,beforeupload:h.F,upload:h.F,fileupload:h.F,fileprogress:h.F,filecomplete:h.F,progress:h.F,complete:h.F,pause:h.F,chunkSize:h.chunkSize,chunkUpoloadRetry:h.chunkUploadRetry},b);b.imageAutoOrientation&&!b.imageTransform&&(b.imageTransform={rotate:"auto"});var d=new h.XHR(b),a=this._getFilesDataArray(b.files),c=0,e=0,n=this,l,f=!1;g(a,function(b){c+=b.size});d.files=[];g(a,function(b){d.files.push(b.file)});d.total=c;d.loaded=0;b.beforeupload(d,b);(l=function S(){var l=a.shift(),
t=l&&l.file,x=!1,u={};g(b,function(b,d){b&&"object"===typeof b&&(b=h.extend({},b));u[d]=b});t&&t.name===h.expando&&(t=null,h.log("[warn] FileAPI.upload() \u2014 called without files"));("abort"!=d.statusText||d.current)&&l?(f=!1,(d.currentFile=t)&&b.prepare(t,u),this._getFormData(u,l,function(a){e||b.upload(d,b);var f=new h.XHR(h.extend({},u,{upload:t?function(){b.fileupload(t,f,u)}:C,progress:t?function(a){x||(b.fileprogress({type:"progress",total:l.total=a.total,loaded:l.loaded=a.loaded},t,f,u),
b.progress({type:"progress",total:c,loaded:d.loaded=e+l.size*(a.loaded/a.total)|0},t,f,u))}:C,complete:function(a){x=!0;g(X,function(b){d[b]=f[b]});t&&(l.loaded=l.total,this.progress(l),e+=l.size,d.loaded=e,b.filecomplete(a,f,t,u));S.call(n)}}));d.abort=function(b){this.current=b;f.abort()};f.send(a)})):(b.complete(200==d.status||201==d.status?!1:d.statusText||"error",d,b),f=!0)}).call(this);d.append=function(b,e){b=h._getFilesDataArray([].concat(b));g(b,function(b){c+=b.size;d.files.push(b.file);
e?a.unshift(b):a.push(b)});f&&l.call(n)};d.remove=function(b){var d=-1;g(a,function(c){d++;if(c.file==b)return a.splice(d,1)})};return d},_getFilesDataArray:function(b){var d=[],a={};if(L.test(b&&b.tagName)){var c=h.getFiles(b);a[b.name||"file"]=null!==b.getAttribute("multiple")?c:c[0]}else l(b)&&L.test(b[0]&&b[0].tagName)?g(b,function(b){a[b.name||"file"]=h.getFiles(b)}):a=b;g(a,function B(b,a){l(b)?g(b,function(b){B(b,a)}):b&&b.name&&d.push({name:a,file:b,size:b.size,total:b.size,loaded:0})});d.length||
d.push({file:{name:h.expando}});return d},_getFormData:function(b,d,a){var c=d.file,e=d.name,n=c.name,l=c.type;d=h.support.transform&&b.imageTransform;var f=new h.Form,t=h.queue(function(){a(f)}),x=d&&(0<parseInt(d.maxWidth||d.minWidth||d.width,10)||d.rotate);h.Image&&d&&(/image/.test(c.type)||V.test(c.nodeType))?(t.inc(),x&&(d=[d]),h.Image.transform(c,d,b.imageAutoOrientation,function(d,a){x&&!d?(!F&&!h.flashEngine&&(a[0]=h.toBinaryString(a[0]),f.multipart=!0),f.append(e,a[0],n,l)):(d||(g(a,function(b,
d){!F&&!h.flashEngine&&(b=h.toBinaryString(b),f.multipart=!0);f.append(e+"["+d+"]",b,n,l)}),e+="[original]"),(d||b.imageOriginal)&&f.append(e,c,n,l));t.next()})):n!==h.expando&&f.append(e,c,n);g(b.data,function Y(b,d){"object"==typeof b?g(b,function(b,a){Y(b,d+"["+a+"]")}):f.append(d,b)});t.check()},reset:function(b){var d,a;n?(a=n(b).clone(!0).insertBefore(b).val("")[0],n(b).remove()):(d=b.parentNode,a=d.insertBefore(b.cloneNode(!0),b),a.value="",d.removeChild(b),g(D[h.uid(b)],function(d,c){g(d,
function(d){m(b,c,d);j(a,c,d)})}));return a},load:function(b,d){var a=h.getXHR();a?(a.open("GET",b,!0),a.overrideMimeType&&a.overrideMimeType("text/plain; charset=x-user-defined"),j(a,"progress",function(b){b.lengthComputable&&d({type:b.type,loaded:b.loaded,total:b.total},a)}),a.onreadystatechange=function(){if(4==a.readyState)if(a.onreadystatechange=null,200==a.status){b=b.split("/");var c={name:b[b.length-1],size:a.getResponseHeader("Content-Length"),type:a.getResponseHeader("Content-Type")};c.dataURL=
"data:"+c.type+";base64,"+h.encode64(a.responseBody||a.responseText);d({type:"load",result:c})}else d({type:"error"})},a.send(null)):d({type:"error"});return a},encode64:function(b){var d="",a=0;for("string"!==typeof b&&(b=String(b));a<b.length;){var c=b.charCodeAt(a++)&255,e=b.charCodeAt(a++)&255,n=b.charCodeAt(a++)&255,l=c>>2,c=(c&3)<<4|e>>4;isNaN(e)?e=n=64:(e=(e&15)<<2|n>>6,n=isNaN(n)?64:n&63);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(c)+
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(n)}return d}};h.addInfoReader(/^image/,function(b,d){if(!b.__dimensions){var a=b.__dimensions=h.defer();h.readAsImage(b,function(b){var d=b.target;a.resolve("load"==b.type?!1:"error",{width:d.width,height:d.height})})}b.__dimensions.then(d)});h.event.dnd=function(b,d,a){var c,e;a||(a=d,d=h.F);p?(j(b,"dragenter dragleave dragover",function(b){for(var a=
((b.originalEvent||b||"").dataTransfer||{}).types,n=a&&a.length;n--;)~a[n].indexOf("File")&&(b.preventDefault(),e!==b.type&&(e=b.type,"dragleave"!=e&&d.call(b.currentTarget,!0,b),clearTimeout(c),c=setTimeout(function(){d.call(b.currentTarget,"dragleave"!=e,b)},50)))}),j(b,"drop",function(b){b.preventDefault();e=0;d.call(b.currentTarget,!1,b);h.getDropFiles(b,function(d){a.call(b.currentTarget,d,b)})})):h.log("Drag'n'Drop -- not supported")};n&&!n.fn.dnd&&(n.fn.dnd=function(b,d){return this.each(function(){h.event.dnd(this,
b,d)})});a.FileAPI=h.extend(h,a.FileAPI);h.flashUrl||(h.flashUrl=h.staticPath+"FileAPI.flash.swf");h.flashImageUrl||(h.flashImageUrl=h.staticPath+"FileAPI.flash.image.swf")})(window);
(function(a,k,g){function j(a,c){if(!(this instanceof j))return new j(a);this.file=a;this.better=!c;this.matrix={sx:0,sy:0,sw:0,sh:0,dx:0,dy:0,dw:0,dh:0,resize:0,deg:0}}var m=Math.min,f=Math.round,c=!1,e={8:270,3:180,6:90};try{c=-1<k.createElement("canvas").toDataURL("image/png").indexOf("data:image/png")}catch(q){}j.prototype={constructor:j,set:function(c){a.extend(this.matrix,c);return this},crop:function(a,c,e,f){e===g&&(e=a,f=c,a=c=0);return this.set({sx:a,sy:c,sw:e,sh:f||e})},resize:function(a,
c,e){"string"==typeof c&&(e=c,c=a);return this.set({dw:a,dh:c,resize:e})},preview:function(a,c){return this.set({dw:a,dh:c||a,resize:"preview"})},rotate:function(a){return this.set({deg:a})},_load:function(c,e){var f=this;a.readAsImage(c,function(a){e.call(f,"load"!=a.type,a.result)})},_apply:function(a,c){var e=k.createElement("canvas"),f=this.getMatrix(a),g=e.getContext("2d"),m=f.deg,q=f.dw,r=f.dh,v=a.width,p=a.height,j,d=a;if(this.better)for(;2<Math.min(v/q,p/r);)v=~~(v/2+0.5),p=~~(p/2+0.5),j=
k.createElement("canvas"),j.width=v,j.height=p,d!==a?(j.getContext("2d").drawImage(d,0,0,d.width,d.height,0,0,v,p),d=j):(d=j,d.getContext("2d").drawImage(a,f.sx,f.sy,f.sw,f.sh,0,0,v,p),f.sx=f.sy=f.sw=f.sh=0);e.width=!(m%180)?q:r;e.height=m%180?q:r;g.rotate(m*Math.PI/180);g.drawImage(d,f.sx,f.sy,f.sw||d.width,f.sh||d.height,180==m||270==m?-q:0,90==m||180==m?-r:0,q,r);c.call(this,!1,e)},getMatrix:function(c){var e=a.extend({},this.matrix),g=e.sw=e.sw||c.width;c=e.sh=e.sh||c.height;var q=e.dw=e.dw||
e.sw,k=e.dh=e.dh||e.sh,s=g/c,j=q/k,r=e.resize;if("preview"==r){if(q!=g||k!=c)if(j>=s?(s=g,r=s/j):(r=c,s=r*j),s!=g||r!=c)e.sx=~~((g-s)/2),e.sy=~~((c-r)/2),g=s,c=r}else r&&("min"==r?(q=f(s<j?m(g,q):k*s),k=f(s<j?q/s:m(c,k))):(q=f(s>=j?m(g,q):k*s),k=f(s>=j?q/s:m(c,k))));e.sw=g;e.sh=c;e.dw=q;e.dh=k;return e},_trans:function(a){this._load(this.file,function(c,e){c?a(c):this._apply(e,a)})},get:function(c){if(a.support.transform){var f=this;"auto"==f.matrix.deg?a.getInfo(this.file,function(a,g){f.matrix.deg=
e[g&&g.exif&&g.exif.Orientation]||0;f._trans(c)}):f._trans(c)}else c("not_support")},toData:function(a){this.get(a)}};j.exifOrientation=e;j.transform=function(c,e,f,q){a.getInfo(c,function(m,k){var y={},r=a.queue(function(a){q(a,y)});m?r.fail():a.each(e,function(a,e){if(!r.isFail()){var l=j(k.nodeType?k:c);if("function"==typeof a)a(k,l);else if(a.width)l[a.preview?"preview":"resize"](a.width,a.height,a.type);else a.maxWidth&&(k.width>a.maxWidth||k.height>a.maxHeight)&&l.resize(a.maxWidth,a.maxHeight,
"max");a.rotate===g&&f&&(a.rotate="auto");l.rotate(a.rotate);r.inc();l.toData(function(d,a){d?r.fail():(y[e]=a,r.next())})}})})};a.support.canvas=a.support.transform=c;a.Image=j})(FileAPI,document);
(function(a,k,g){var j=k.encodeURIComponent,m=k.FormData;k=function(){this.items=[]};k.prototype={append:function(a,c,e,g){this.items.push({name:a,blob:c&&c.blob||(void 0==c?"":c),file:c&&(e||c.name),type:c&&(g||c.type)})},each:function(a){for(var c=0,e=this.items.length;c<e;c++)a.call(this,this.items[c])},toData:function(f,c){c._chunked=a.support.chunked&&0<c.chunkSize&&1==a.filter(this.items,function(a){return a.file}).length;a.support.html5?this.multipart||!m?(a.log("FileAPI.Form.toMultipartData"),
this.toMultipartData(f)):c._chunked?(a.log("FileAPI.Form.toPlainData"),this.toPlainData(f)):(a.log("FileAPI.Form.toFormData"),this.toFormData(f)):(a.log("FileAPI.Form.toHtmlData"),this.toHtmlData(f))},_to:function(f,c,e,g){var m=a.queue(function(){c(f)});this.each(function(a){e(a,f,m,g)});m.check()},toHtmlData:function(f){this._to(g.createDocumentFragment(),f,function(c,e){var f=c.blob,m;c.file?(a.reset(f),f.name=c.name,e.appendChild(f)):(m=g.createElement("input"),m.name=c.name,m.type="hidden",m.value=
f,e.appendChild(m))})},toPlainData:function(a){this._to({},a,function(a,e,f){a.file&&(e.type=a.file);a.blob.toBlob?(f.inc(),a.blob.toBlob(function(g){e.name=a.name;e.file=g;e.size=g.length;e.type=a.type;f.next()},"image/png")):a.file?(e.name=a.blob.name,e.file=a.blob,e.size=a.blob.size,e.type=a.type):(e.params||(e.params=[]),e.params.push(encodeURIComponent(a.name)+"="+encodeURIComponent(a.blob)));e.start=-1;e.end=e.file.FileAPIReadPosition||-1;e.retry=0})},toFormData:function(a){this._to(new m,a,
function(a,e,f){a.file&&e.append("_"+a.name,a.file);a.blob&&a.blob.toBlob?(f.inc(),a.blob.toBlob(function(g){e.append(a.name,g,a.file);f.next()},"image/png")):a.file?e.append(a.name,a.blob,a.file):e.append(a.name,a.blob)})},toMultipartData:function(f){this._to([],f,function(c,e,f,g){var l=!!c.file,m=c.blob,k=function(a){e.push("--_"+g+('\r\nContent-Disposition: form-data; name="'+c.name+'"'+(l?'; filename="'+j(c.file)+'"':"")+(l?"\r\nContent-Type: "+(c.type||"application/octet-stream"):"")+"\r\n\r\n"+
(l?a:j(a))+"\r\n"));f.next()};f.inc();a.isFile(m)?a.readAsBinaryString(m,function(a){"load"==a.type&&k(a.result)}):k(m)},a.expando)}};a.Form=k})(FileAPI,window,document);
(function(a,k){var g=function(){},j=function(a){this.uid=k.uid();this.xhr={abort:g,getResponseHeader:g,getAllResponseHeaders:g};this.options=a};j.prototype={status:0,statusText:"",getResponseHeader:function(a){return this.xhr.getResponseHeader(a)},getAllResponseHeaders:function(){return this.xhr.getAllResponseHeaders()||{}},end:function(m,f){var c=this,e=c.options;c.end=c.abort=g;c.status=m;f&&(c.statusText=f);k.log("xhr.end:",m,f);e.complete(200==m||201==m?!1:c.statusText||"unknown",c);c.xhr&&c.xhr.node&&
setTimeout(function(){var e=c.xhr.node;try{e.parentNode.removeChild(e)}catch(f){}try{delete a[c.uid]}catch(g){}a[c.uid]=c.xhr.node=null},9)},abort:function(){this.end(0,"abort");this.xhr&&(this.xhr.aborted=!0,this.xhr.abort())},send:function(a){var f=this,c=this.options;a.toData(function(a){c.upload(c,f);f._send.call(f,c,a)},c)},_send:function(g,f){var c=this,e,q=c.uid,j=g.url;k.log("XHR._send:",f);j+=(~j.indexOf("?")?"&":"?")+k.uid();f.nodeName?(g.upload(g,c),e=document.createElement("div"),e.innerHTML=
'<form target="'+q+'" action="'+j+'" method="POST" enctype="multipart/form-data" style="position: absolute; top: -1000px; overflow: hidden; width: 1px; height: 1px;"><iframe name="'+q+'" src="javascript:false;"></iframe><input value="'+q+'" name="callback" type="hidden"/></form>',c.xhr.abort=function(){var a=e.getElementsByName("iframe")[0];if(a)try{a.stop?a.stop():a.contentWindow.stop?a.contentWindow.stop():a.contentWindow.document.execCommand("Stop")}catch(c){}e=null},j=e.getElementsByTagName("form")[0],
j.appendChild(f),k.log(j.parentNode.innerHTML),document.body.appendChild(e),c.xhr.node=e,a[q]=function(a,f,g){c.readyState=4;c.responseText=g;c.end(a,f);e=null},c.readyState=2,j.submit(),j=null):this.xhr&&this.xhr.aborted?k.log("Error: already aborted"):(e=c.xhr=k.getXHR(),f.params&&(j+=(0>j.indexOf("?")?"?":"&")+f.params.join("&")),e.open("POST",j,!0),k.withCredentials&&(e.withCredentials="true"),(!g.headers||!g.headers["X-Requested-With"])&&e.setRequestHeader("X-Requested-With","XMLHttpRequest"),
k.each(g.headers,function(a,c){e.setRequestHeader(c,a)}),g._chunked?(e.upload&&e.upload.addEventListener("progress",function(a){f.retry||g.progress({type:a.type,total:f.size,loaded:f.start+a.loaded,totalSize:f.size},c,g)},!1),e.onreadystatechange=function(){c.status=e.status;c.statusText=e.statusText;c.readyState=e.readyState;if(4==e.readyState){for(var a in{"":1,XML:1,Text:1,Body:1})c["response"+a]=e["response"+a];e.onreadystatechange=null;if(!e.status||0<e.status-201)if(k.log("Error: "+e.status),
(!e.status&&!e.aborted||500==e.status||416==e.status)&&++f.retry<=g.chunkUploadRetry){a=e.status?0:k.chunkNetworkDownRetryTimeout;g.pause(f.file,g);var j=parseInt(e.getResponseHeader("X-Last-Known-Byte"),10);k.log("X-Last-Known-Byte: "+j);f.end=j?j:f.start-1;setTimeout(function(){c._send(g,f)},a)}else c.end(e.status);else f.retry=0,f.end==f.size-1?c.end(e.status):(j=parseInt(e.getResponseHeader("X-Last-Known-Byte"),10),k.log("X-Last-Known-Byte: "+j),j&&(f.end=j),f.file.FileAPIReadPosition=f.end,setTimeout(function(){c._send(g,
f)},0));e=null}},f.start=f.end+1,f.end=Math.max(Math.min(f.start+g.chunkSize,f.size)-1,f.start),(q="slice")in f.file||(q="mozSlice")in f.file||(q="webkitSlice"),e.setRequestHeader("Content-Range","bytes "+f.start+"-"+f.end+"/"+f.size),e.setRequestHeader("Content-Disposition","attachment; filename="+encodeURIComponent(f.name)),e.setRequestHeader("Content-Type",f.type||"application/octet-stream"),q=f.file[q](f.start,f.end+1),e.send(q),q=null):(e.upload&&e.upload.addEventListener("progress",k.throttle(function(a){g.progress(a,
c,g)},100),!1),e.onreadystatechange=function(){c.status=e.status;c.statusText=e.statusText;c.readyState=e.readyState;if(4==e.readyState){for(var a in{"":1,XML:1,Text:1,Body:1})c["response"+a]=e["response"+a];e.onreadystatechange=null;c.end(e.status);e=null}},k.isArray(f)?(e.setRequestHeader("Content-Type","multipart/form-data; boundary=_"+k.expando),f=f.join("")+"--_"+k.expando+"--",e.sendAsBinary?e.sendAsBinary(f):(q=Array.prototype.map.call(f,function(a){return a.charCodeAt(0)&255}),e.send((new Uint8Array(q)).buffer))):
e.send(f)))}};k.XHR=j})(window,FileAPI);
(function(a,k,g){var j=a.support,m=k.navigator,f=m.mimeTypes,c=!1;if(m.plugins&&"object"==typeof m.plugins["Shockwave Flash"])c=m.plugins["Shockwave Flash"].description&&!(f&&f["application/x-shockwave-flash"]&&!f["application/x-shockwave-flash"].enabledPlugin);else try{c=!(!k.ActiveXObject||!new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))}catch(e){a.log("ShockwaveFlash.ShockwaveFlash -- does not supported.")}j.flash=c;if(a.support.flash&&(!a.html5||!a.support.html5||a.cors&&!a.support.cors)){var q=
function(a){return('<object id="#id#" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+(a.width||"100%")+'" height="'+(a.height||"100%")+'"><param name="movie" value="#src#" /><param name="flashvars" value="#flashvars#" /><param name="swliveconnect" value="true" /><param name="allowscriptaccess" value="always" /><param name="allownetworking" value="all" /><param name="menu" value="false" /><param name="wmode" value="#wmode#" /><embed flashvars="#flashvars#" swliveconnect="true" allownetworking="all" allowscriptaccess="always" name="#id#" src="#src#" width="'+
(a.width||"100%")+'" height="'+(a.height||"100%")+'" menu="false" wmode="transparent" type="application/x-shockwave-flash"></embed></object>').replace(/#(\w+)#/ig,function(c,e){return a[e]})},t=function(a,c){if(a&&a.style){var e,f;for(e in c){f=c[e];"number"==typeof f&&(f+="px");try{a.style[e]=f}catch(g){}}}},l=function(d,c){a.each(c,function(a,c){var e=d[c];d[c]=function(){this.parent=e;return a.apply(this,arguments)}})},A=function(d){var c=d.wid=a.uid();p._fn[c]=d;return"FileAPI.Flash._fn."+c},
u=function(a){try{p._fn[a.wid]=null,delete p._fn[a.wid]}catch(c){}},C=function(a,c){if(!v.test(a)){if(/^\.\//.test(a)||"/"!=a.charAt(0)){var e=location.pathname,e=e.substr(0,e.lastIndexOf("/"));a=(e+"/"+a).replace("/./","/")}"//"!=a.substr(0,2)&&(a="//"+location.host+a);v.test(a)||(a=location.protocol+a)}c&&(a+=(/\?/.test(a)?"&":"?")+c);return a},s=a.uid(),y=0,r={},v=/^https?:/i,p={_fn:{},init:function(){var d=g.body&&g.body.firstChild;if(d){do if(1==d.nodeType){a.log("FlashAPI.Flash.init...");var c=
g.createElement("div");t(c,{top:1,right:1,width:5,height:5,position:"absolute"});d.parentNode.insertBefore(c,d);p.publish(c,s);return}while(d=d.nextSibling)}10>y&&setTimeout(p.init,50*++y)},publish:function(d,c){d.innerHTML=q({id:c,src:C(a.flashUrl,"r="+a.version),wmode:"transparent",flashvars:"callback=FileAPI.Flash.event&flashId="+c+"&storeKey="+navigator.userAgent.match(/\d/ig).join("")+"_"+a.version+(p.isReady||(a.pingUrl?"&ping="+a.pingUrl:""))})},ready:function(){p.ready=a.F;p.isReady=!0;p.patch();
a.event.on(g,"mouseover",p.mouseover);a.event.on(g,"click",function(a){p.mouseover(a)&&(a.preventDefault?a.preventDefault():a.returnValue=!0)})},getWrapper:function(a){do if(/js-fileapi-wrapper/.test(a.className))return a;while((a=a.parentNode)&&a!==g.body)},mouseover:function(d){d=a.event.fix(d).target;if(/input/i.test(d.nodeName)&&"file"==d.type){var c=d.getAttribute(s);if("i"==c||"r"==c)return!1;if("p"!=c){d.setAttribute(s,"i");var c=g.createElement("div"),e=p.getWrapper(d);if(!e){a.log("flash.mouseover.error: js-fileapi-wrapper not found");
return}t(c,{top:0,left:0,width:d.offsetWidth+100,height:d.offsetHeight+100,zIndex:"1000000",position:"absolute"});e.appendChild(c);p.publish(c,a.uid());d.setAttribute(s,"p")}return!0}},event:function(d){var c=d.type;if("ready"==c){try{p.getInput(d.flashId).setAttribute(s,"r")}catch(e){}p.ready();setTimeout(function(){p.mouseenter(d)},50);return!0}"ping"===c?a.log("(flash -> js).ping:",[d.status,d.savedStatus],d.error):"log"===c?a.log("(flash -> js).log:",d.target):c in p&&setTimeout(function(){a.log("Flash.event."+
d.type+":",d);p[c](d)},1)},mouseenter:function(d){var c=p.getInput(d.flashId);if(c){p.cmd(d,"multiple",null!=c.getAttribute("multiple"));var e=[],f={};a.each((c.getAttribute("accept")||"").split(/,\s*/),function(d){a.accept[d]&&a.each(a.accept[d].split(" "),function(a){f[a]=1})});a.each(f,function(a,d){e.push(d)});p.cmd(d,"accept",e.length?e.join(",")+","+e.join(",").toUpperCase():"*")}},get:function(a){return g[a]||k[a]||g.embeds[a]},getInput:function(d){try{var c=p.getWrapper(p.get(d));if(c)return c.getElementsByTagName("input")[0]}catch(e){a.log('Can not find "input" by flashId:',
d,e)}},select:function(d){var c=p.getInput(d.flashId),e=a.uid(c);d=d.target.files;a.each(d,function(d){a.checkFileObj(d)});r[e]=d;g.createEvent?(e=g.createEvent("Event"),e.initEvent("change",!0,!1),c.dispatchEvent(e)):g.createEventObject&&(e=g.createEventObject(),c.fireEvent("onchange",e))},cmd:function(d,c,e,f){try{return a.log("(js -> flash)."+c+":",e),p.get(d.flashId||d).cmd(c,e)}catch(g){a.log("(js -> flash).onError:",g),f||setTimeout(function(){p.cmd(d,c,e,!0)},50)}},patch:function(){a.flashEngine=
a.support.transform=!0;l(a,{getFiles:function(d,c,e){if(e)return a.filterFiles(a.getFiles(d),c,e),null;var f=a.isArray(d)?d:r[a.uid(d.target||d.srcElement||d)];if(!f)return this.parent.apply(this,arguments);c&&(c=a.getFilesFilter(c),f=a.filter(f,function(a){return c.test(a.name)}));return f},getInfo:function(d,c){if(d&&!d.flashId)this.parent.apply(this,arguments);else{if(!d.__info){var e=d.__info=a.defer();p.cmd(d,"getFileInfo",{id:d.id,callback:A(function F(a,c){u(F);e.resolve(a,d.info=c)})})}d.__info.then(c)}}});
a.support.transform=!0;a.Image&&l(a.Image.prototype,{get:function(a,c){this.set({scaleMode:c||"noScale"});this.parent(a)},_load:function(d,c){a.log("FileAPI.Image._load:",d);if(d&&!d.flashId)this.parent.apply(this,arguments);else{var e=this;a.getInfo(d,function(a){c.call(e,a,d)})}},_apply:function(d,c){a.log("FileAPI.Image._apply:",d);if(d&&!d.flashId)this.parent.apply(this,arguments);else{var e=this.getMatrix(d.info);p.cmd(d,"imageTransform",{id:d.id,matrix:e,callback:A(function F(f,k){a.log("FileAPI.Image._apply.callback:",
f);u(F);if(f)c(f);else if(!a.support.dataURI||3E4<k.length){var j={width:!(e.deg%180)?e.dw:e.dh,height:e.deg%180?e.dw:e.dh,scale:e.scaleMode},l=c,m=function(){try{p.get(s).setImage(k)}catch(d){a.log('flash.setImage -- can not set "base64":',d)}},r,s=a.uid(),z=g.createElement("div");for(r in j)z.setAttribute("data-img-"+r,j[r]);t(z,j);z.innerHTML=q(a.extend({id:s,src:C(a.flashImageUrl,"r="+a.uid()),wmode:"opaque",flashvars:"scale="+j.scale+"&callback="+A(function J(){u(J);setTimeout(m,99);return!0})},
j));l(!1,z);z=null}else{var v=new Image;a.event.one(v,"error abort load",function(a){c("load"!=a.type&&a.type,v);v=null});v.src="data:"+d.type+";base64,"+k}})})}},toData:function(d){var c=this.file,e=c.info,f=this.getMatrix(e);c&&!c.flashId?this.parent.apply(this,arguments):("auto"==f.deg&&(f.deg=a.Image.exifOrientation[e&&e.exif&&e.exif.Orientation]||0),d.call(this,!c.info,{id:c.id,flashId:c.flashId,name:c.name,type:c.type,matrix:f}))}});l(a.Form.prototype,{toData:function(d){for(var c=this.items,
e=c.length;e--;)if(c[e].file&&c[e].blob&&!c[e].blob.flashId)return this.parent.apply(this,arguments);a.log("flash.Form.toData");d(c)}});l(a.XHR.prototype,{_send:function(c,e){if(e.nodeName||e.append&&a.support.html5||a.isArray(e)&&"string"===typeof e[0])return this.parent.apply(this,arguments);var f={},g={},j=this,k,l;a.each(e,function(a){a.file?(g[a.name]=a={id:a.blob.id,name:a.blob.name,matrix:a.blob.matrix,flashId:a.blob.flashId},l=a.id,k=a.flashId):f[a.name]=a.blob});if(!l&&!k)return this.parent.apply(this,
arguments);a.log("flash.XHR._send:",k,l,g);j.xhr={headers:{},abort:function(){p.cmd(k,"abort",{id:l})},getResponseHeader:function(a){return this.headers[a]},getAllResponseHeaders:function(){return this.headers}};var m=a.queue(function(){p.cmd(k,"upload",{url:C(c.url),data:f,files:g,headers:c.headers,callback:A(function I(e){var f=e.type,g=e.result;a.log("flash.upload."+f+":",e);if("progress"==f)e.loaded=Math.min(e.loaded,e.total),e.lengthComputable=!0,c.progress(e);else if("complete"==f)u(I),"string"==
typeof g&&(j.responseText=g.replace(/%22/g,'"').replace(/%5c/g,"\\").replace(/%26/g,"&").replace(/%25/g,"%")),j.end(e.status||200);else if("abort"==f||"error"==f)j.end(e.status||0,e.message),u(I)})})});a.each(g,function(c){m.inc();a.getInfo(c,m.next)});m.check()}})}};a.Flash=p;var w=new Image;a.event.one(w,"error load",function(){a.support.dataURI=!(1!=w.width||1!=w.height);w=null;p.init()});w.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=="}})(FileAPI,window,document);
"undefined"!==typeof ajs&&ajs.loaded&&ajs.loaded("{fileapi}FileAPI.min");"function"===typeof define&&define.amd&&define("FileAPI",[],function(){return window.FileAPI||{}});

View File

@ -1,25 +0,0 @@
/**!
* AngularJS file upload shim for angular XHR HTML5 browsers
* @author Danial <danial.farid@gmail.com>
* @version 1.1.10
*/
if (window.XMLHttpRequest) {
if (window.FormData) {
// allow access to Angular XHR private field: https://github.com/angular/angular.js/issues/1934
XMLHttpRequest = (function(origXHR) {
return function() {
var xhr = new origXHR();
xhr.send = (function(orig) {
return function() {
if (arguments[0] instanceof FormData && arguments[0].__setXHR_) {
var formData = arguments[0];
formData.__setXHR_(xhr);
}
orig.apply(xhr, arguments);
}
})(xhr.send);
return xhr;
}
})(XMLHttpRequest);
}
}

View File

@ -1,2 +0,0 @@
/*! 1.1.10 */
window.XMLHttpRequest&&window.FormData&&(XMLHttpRequest=function(a){return function(){var b=new a;return b.send=function(a){return function(){if(arguments[0]instanceof FormData&&arguments[0].__setXHR_){var c=arguments[0];c.__setXHR_(b)}a.apply(b,arguments)}}(b.send),b}}(XMLHttpRequest));

View File

@ -1,215 +0,0 @@
/**!
* AngularJS file upload shim for HTML5 FormData
* @author Danial <danial.farid@gmail.com>
* @version 1.1.10
*/
(function() {
if (window.XMLHttpRequest) {
if (window.FormData) {
// allow access to Angular XHR private field: https://github.com/angular/angular.js/issues/1934
XMLHttpRequest = (function(origXHR) {
return function() {
var xhr = new origXHR();
xhr.send = (function(orig) {
return function() {
if (arguments[0] instanceof FormData && arguments[0].__setXHR_) {
var formData = arguments[0];
formData.__setXHR_(xhr);
}
orig.apply(xhr, arguments);
}
})(xhr.send);
return xhr;
}
})(XMLHttpRequest);
} else {
XMLHttpRequest = (function(origXHR) {
return function() {
var xhr = new origXHR();
var origSend = xhr.send;
xhr.__requestHeaders = [];
xhr.open = (function(orig) {
xhr.upload = {
addEventListener: function(t, fn, b) {
if (t == 'progress') {
xhr.__progress = fn;
}
}
};
return function(m, url, b) {
orig.apply(xhr, [m, url, b]);
xhr.__url = url;
}
})(xhr.open);
xhr.getResponseHeader = (function(orig) {
return function(h) {
return xhr.__fileApiXHR ? xhr.__fileApiXHR.getResponseHeader(h) : orig.apply(xhr, [h]);
}
})(xhr.getResponseHeader);
xhr.getAllResponseHeaders = (function(orig) {
return function() {
return xhr.__fileApiXHR ? xhr.__fileApiXHR.getAllResponseHeaders() : orig.apply(xhr);
}
})(xhr.getAllResponseHeaders);
xhr.abort = (function(orig) {
return function() {
return xhr.__fileApiXHR ? xhr.__fileApiXHR.abort() : (orig == null ? null : orig.apply(xhr));
}
})(xhr.abort);
xhr.send = function() {
if (arguments[0] != null && arguments[0].__isShim && arguments[0].__setXHR_) {
var formData = arguments[0];
if (arguments[0].__setXHR_) {
var formData = arguments[0];
formData.__setXHR_(xhr);
}
var config = {
url: xhr.__url,
complete: function(err, fileApiXHR) {
Object.defineProperty(xhr, 'status', {get: function() {return fileApiXHR.status}});
Object.defineProperty(xhr, 'statusText', {get: function() {return fileApiXHR.statusText}});
Object.defineProperty(xhr, 'readyState', {get: function() {return 4}});
Object.defineProperty(xhr, 'response', {get: function() {return fileApiXHR.response}});
Object.defineProperty(xhr, 'responseText', {get: function() {return fileApiXHR.responseText}});
xhr.__fileApiXHR = fileApiXHR;
xhr.onreadystatechange();
},
progress: function(e) {
xhr.__progress(e);
},
headers: xhr.__requestHeaders
}
config.data = {};
config.files = {}
for (var i = 0; i < formData.data.length; i++) {
var item = formData.data[i];
if (item.val != null && item.val.name != null && item.val.size != null && item.val.type != null) {
config.files[item.key] = item.val;
} else {
config.data[item.key] = item.val;
}
}
setTimeout(function() {
xhr.__fileApiXHR = FileAPI.upload(config);
}, 1);
} else {
origSend.apply(xhr, arguments);
}
}
return xhr;
}
})(XMLHttpRequest);
}
}
if (!window.FormData) {
var hasFlash = false;
try {
var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
if (fo) hasFlash = true;
} catch(e) {
if (navigator.mimeTypes["application/x-shockwave-flash"] != undefined) hasFlash = true;
}
var wrapFileApi = function(elem) {
if (!elem.__isWrapped && (elem.getAttribute('ng-file-select') != null || elem.getAttribute('data-ng-file-select') != null)) {
var wrap = document.createElement('div');
wrap.innerHTML = '<div class="js-fileapi-wrapper" style="position:relative; overflow:hidden"></div>';
wrap = wrap.firstChild;
var parent = elem.parentNode;
parent.insertBefore(wrap, elem);
parent.removeChild(elem);
wrap.appendChild(elem);
if (!hasFlash) {
wrap.appendChild(document.createTextNode('Flash is required'));
}
elem.__isWrapped = true;
}
};
var changeFnWrapper = function(fn) {
return function(evt) {
var files = FileAPI.getFiles(evt);
if (!evt.target) {
evt.target = {};
}
evt.target.files = files;
evt.target.files.item = function(i) {
return evt.target.files[i] || null;
}
fn(evt);
};
};
var isFileChange = function(elem, e) {
return (e.toLowerCase() === 'change' || e.toLowerCase() === 'onchange') && elem.getAttribute('type') == 'file';
}
if (HTMLInputElement.prototype.addEventListener) {
HTMLInputElement.prototype.addEventListener = (function(origAddEventListener) {
return function(e, fn, b, d) {
if (isFileChange(this, e)) {
wrapFileApi(this);
origAddEventListener.apply(this, [e, changeFnWrapper(fn), b, d]);
} else {
origAddEventListener.apply(this, [e, fn, b, d]);
}
}
})(HTMLInputElement.prototype.addEventListener);
}
if (HTMLInputElement.prototype.attachEvent) {
HTMLInputElement.prototype.attachEvent = (function(origAttachEvent) {
return function(e, fn) {
if (isFileChange(this, e)) {
wrapFileApi(this);
origAttachEvent.apply(this, [e, changeFnWrapper(fn)]);
} else {
origAttachEvent.apply(this, [e, fn]);
}
}
})(HTMLInputElement.prototype.attachEvent);
}
window.FormData = FormData = function() {
return {
append: function(key, val, name) {
this.data.push({
key: key,
val: val,
name: name
});
},
data: [],
__isShim: true
};
};
(function () {
//load FileAPI
if (!window.FileAPI || !FileAPI.upload) {
var base = '', script = document.createElement('script'), allScripts = document.getElementsByTagName('script'), i, index, src;
if (window.FileAPI && window.FileAPI.jsPath) {
base = window.FileAPI.jsPath;
} else {
for (i = 0; i < allScripts.length; i++) {
src = allScripts[i].src;
index = src.indexOf('angular-file-upload-shim.js')
if (index == -1) {
index = src.indexOf('angular-file-upload-shim.min.js');
}
if (index > -1) {
base = src.substring(0, index);
break;
}
}
}
if (!window.FileAPI || FileAPI.staticPath == null) {
FileAPI = {
staticPath: base
}
}
script.setAttribute('src', base + "FileAPI.min.js");
document.getElementsByTagName('head')[0].appendChild(script);
}
})();
}})();

View File

@ -1,2 +0,0 @@
/*! 1.1.10 */
!function(){if(window.XMLHttpRequest&&(XMLHttpRequest=window.FormData?function(a){return function(){var b=new a;return b.send=function(a){return function(){if(arguments[0]instanceof FormData&&arguments[0].__setXHR_){var c=arguments[0];c.__setXHR_(b)}a.apply(b,arguments)}}(b.send),b}}(XMLHttpRequest):function(a){return function(){var b=new a,c=b.send;return b.__requestHeaders=[],b.open=function(a){return b.upload={addEventListener:function(a,c){"progress"==a&&(b.__progress=c)}},function(c,d,e){a.apply(b,[c,d,e]),b.__url=d}}(b.open),b.getResponseHeader=function(a){return function(c){return b.__fileApiXHR?b.__fileApiXHR.getResponseHeader(c):a.apply(b,[c])}}(b.getResponseHeader),b.getAllResponseHeaders=function(a){return function(){return b.__fileApiXHR?b.__fileApiXHR.getAllResponseHeaders():a.apply(b)}}(b.getAllResponseHeaders),b.abort=function(a){return function(){return b.__fileApiXHR?b.__fileApiXHR.abort():null==a?null:a.apply(b)}}(b.abort),b.send=function(){if(null!=arguments[0]&&arguments[0].__isShim&&arguments[0].__setXHR_){var a=arguments[0];if(arguments[0].__setXHR_){var a=arguments[0];a.__setXHR_(b)}var d={url:b.__url,complete:function(a,c){Object.defineProperty(b,"status",{get:function(){return c.status}}),Object.defineProperty(b,"statusText",{get:function(){return c.statusText}}),Object.defineProperty(b,"readyState",{get:function(){return 4}}),Object.defineProperty(b,"response",{get:function(){return c.response}}),Object.defineProperty(b,"responseText",{get:function(){return c.responseText}}),b.__fileApiXHR=c,b.onreadystatechange()},progress:function(a){b.__progress(a)},headers:b.__requestHeaders};d.data={},d.files={};for(var e=0;e<a.data.length;e++){var f=a.data[e];null!=f.val&&null!=f.val.name&&null!=f.val.size&&null!=f.val.type?d.files[f.key]=f.val:d.data[f.key]=f.val}setTimeout(function(){b.__fileApiXHR=FileAPI.upload(d)},1)}else c.apply(b,arguments)},b}}(XMLHttpRequest)),!window.FormData){var a=!1;try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");b&&(a=!0)}catch(c){void 0!=navigator.mimeTypes["application/x-shockwave-flash"]&&(a=!0)}var d=function(b){if(!b.__isWrapped&&(null!=b.getAttribute("ng-file-select")||null!=b.getAttribute("data-ng-file-select"))){var c=document.createElement("div");c.innerHTML='<div class="js-fileapi-wrapper" style="position:relative; overflow:hidden"></div>',c=c.firstChild;var d=b.parentNode;d.insertBefore(c,b),d.removeChild(b),c.appendChild(b),a||c.appendChild(document.createTextNode("Flash is required")),b.__isWrapped=!0}},e=function(a){return function(b){var c=FileAPI.getFiles(b);b.target||(b.target={}),b.target.files=c,b.target.files.item=function(a){return b.target.files[a]||null},a(b)}},f=function(a,b){return("change"===b.toLowerCase()||"onchange"===b.toLowerCase())&&"file"==a.getAttribute("type")};HTMLInputElement.prototype.addEventListener&&(HTMLInputElement.prototype.addEventListener=function(a){return function(b,c,g,h){f(this,b)?(d(this),a.apply(this,[b,e(c),g,h])):a.apply(this,[b,c,g,h])}}(HTMLInputElement.prototype.addEventListener)),HTMLInputElement.prototype.attachEvent&&(HTMLInputElement.prototype.attachEvent=function(a){return function(b,c){f(this,b)?(d(this),a.apply(this,[b,e(c)])):a.apply(this,[b,c])}}(HTMLInputElement.prototype.attachEvent)),window.FormData=FormData=function(){return{append:function(a,b,c){this.data.push({key:a,val:b,name:c})},data:[],__isShim:!0}},function(){if(!window.FileAPI||!FileAPI.upload){var a,b,c,d="",e=document.createElement("script"),f=document.getElementsByTagName("script");if(window.FileAPI&&window.FileAPI.jsPath)d=window.FileAPI.jsPath;else for(a=0;a<f.length;a++)if(c=f[a].src,b=c.indexOf("angular-file-upload-shim.js"),-1==b&&(b=c.indexOf("angular-file-upload-shim.min.js")),b>-1){d=c.substring(0,b);break}window.FileAPI&&null!=FileAPI.staticPath||(FileAPI={staticPath:d}),e.setAttribute("src",d+"FileAPI.min.js"),document.getElementsByTagName("head")[0].appendChild(e)}}()}}();

View File

@ -1,156 +0,0 @@
/**!
* AngularJS file upload/drop directive with http post and progress
* @author Danial <danial.farid@gmail.com>
* @version 1.1.10
*/
(function() {
var angularFileUpload = angular.module('angularFileUpload', []);
angularFileUpload.service('$upload', ['$http', '$rootScope', '$timeout', function($http, $rootScope, $timeout) {
this.upload = function(config) {
config.method = config.method || 'POST';
config.headers = config.headers || {};
config.headers['Content-Type'] = undefined;
config.transformRequest = config.transformRequest || $http.defaults.transformRequest;
var formData = new FormData();
if (config.data) {
for (var key in config.data) {
var val = config.data[key];
if (!config.formDataAppender) {
if (typeof config.transformRequest == 'function') {
val = config.transformRequest(val);
} else {
for (var i = 0; i < config.transformRequest.length; i++) {
var fn = config.transformRequest[i];
if (typeof fn == 'function') {
val = fn(val);
}
}
}
formData.append(key, val);
} else {
config.formDataAppender(formData, key, val);
}
}
}
config.transformRequest = angular.identity;
formData.append(config.fileFormDataName || 'file', config.file, config.file.name);
formData['__setXHR_'] = function(xhr) {
config.__XHR = xhr;
xhr.upload.addEventListener('progress', function(e) {
if (config.progress) {
$timeout(function() {
config.progress(e);
});
}
}, false);
//fix for firefox not firing upload progress end
xhr.upload.addEventListener('load', function(e) {
if (e.lengthComputable) {
$timeout(function() {
config.progress(e);
});
}
}, false);
};
config.data = formData;
var promise = $http(config);
promise.progress = function(fn) {
config.progress = fn;
return promise;
};
promise.abort = function() {
if (config.__XHR) {
$timeout(function() {
config.__XHR.abort();
});
}
return promise;
};
promise.then = (function(promise, origThen) {
return function(s, e, p) {
config.progress = p || config.progress;
origThen.apply(promise, [s, e, p]);
return promise;
};
})(promise, promise.then);
return promise;
};
}]);
angularFileUpload.directive('ngFileSelect', [ '$parse', '$http', '$timeout', function($parse, $http, $timeout) {
return function(scope, elem, attr) {
var fn = $parse(attr['ngFileSelect']);
elem.bind('change', function(evt) {
var files = [], fileList, i;
fileList = evt.target.files;
if (fileList != null) {
for (i = 0; i < fileList.length; i++) {
files.push(fileList.item(i));
}
}
$timeout(function() {
fn(scope, {
$files : files,
$event : evt
});
});
});
elem.bind('click', function(){
this.value = null;
});
};
} ]);
angularFileUpload.directive('ngFileDropAvailable', [ '$parse', '$http', '$timeout', function($parse, $http, $timeout) {
return function(scope, elem, attr) {
if ('draggable' in document.createElement('span')) {
var fn = $parse(attr['ngFileDropAvailable']);
$timeout(function() {
fn(scope);
});
}
};
} ]);
angularFileUpload.directive('ngFileDrop', [ '$parse', '$http', '$timeout', function($parse, $http, $timeout) {
return function(scope, elem, attr) {
if ('draggable' in document.createElement('span')) {
var fn = $parse(attr['ngFileDrop']);
elem[0].addEventListener("dragover", function(evt) {
evt.stopPropagation();
evt.preventDefault();
elem.addClass(attr['ngFileDragOverClass'] || "dragover");
}, false);
elem[0].addEventListener("dragleave", function(evt) {
elem.removeClass(attr['ngFileDragOverClass'] || "dragover");
}, false);
elem[0].addEventListener("drop", function(evt) {
evt.stopPropagation();
evt.preventDefault();
elem.removeClass(attr['ngFileDragOverClass'] || "dragover");
var files = [], fileList = evt.dataTransfer.files, i;
if (fileList != null) {
for (i = 0; i < fileList.length; i++) {
files.push(fileList.item(i));
}
}
$timeout(function() {
fn(scope, {
$files : files,
$event : evt
});
});
}, false);
}
};
} ]);
})();

View File

@ -1,2 +0,0 @@
/*! 1.1.10 */
!function(){var a=angular.module("angularFileUpload",[]);a.service("$upload",["$http","$rootScope","$timeout",function(a,b,c){this.upload=function(b){b.method=b.method||"POST",b.headers=b.headers||{},b.headers["Content-Type"]=void 0,b.transformRequest=b.transformRequest||a.defaults.transformRequest;var d=new FormData;if(b.data)for(var e in b.data){var f=b.data[e];if(b.formDataAppender)b.formDataAppender(d,e,f);else{if("function"==typeof b.transformRequest)f=b.transformRequest(f);else for(var g=0;g<b.transformRequest.length;g++){var h=b.transformRequest[g];"function"==typeof h&&(f=h(f))}d.append(e,f)}}b.transformRequest=angular.identity,d.append(b.fileFormDataName||"file",b.file,b.file.name),d.__setXHR_=function(a){b.__XHR=a,a.upload.addEventListener("progress",function(a){b.progress&&c(function(){b.progress(a)})},!1),a.upload.addEventListener("load",function(a){a.lengthComputable&&c(function(){b.progress(a)})},!1)},b.data=d;var i=a(b);return i.progress=function(a){return b.progress=a,i},i.abort=function(){return b.__XHR&&c(function(){b.__XHR.abort()}),i},i.then=function(a,c){return function(d,e,f){return b.progress=f||b.progress,c.apply(a,[d,e,f]),a}}(i,i.then),i}}]),a.directive("ngFileSelect",["$parse","$http","$timeout",function(a,b,c){return function(b,d,e){var f=a(e.ngFileSelect);d.bind("change",function(a){var d,e,g=[];if(d=a.target.files,null!=d)for(e=0;e<d.length;e++)g.push(d.item(e));c(function(){f(b,{$files:g,$event:a})})}),d.bind("click",function(){this.value=null})}}]),a.directive("ngFileDropAvailable",["$parse","$http","$timeout",function(a,b,c){return function(b,d,e){if("draggable"in document.createElement("span")){var f=a(e.ngFileDropAvailable);c(function(){f(b)})}}}]),a.directive("ngFileDrop",["$parse","$http","$timeout",function(a,b,c){return function(b,d,e){if("draggable"in document.createElement("span")){var f=a(e.ngFileDrop);d[0].addEventListener("dragover",function(a){a.stopPropagation(),a.preventDefault(),d.addClass(e.ngFileDragOverClass||"dragover")},!1),d[0].addEventListener("dragleave",function(){d.removeClass(e.ngFileDragOverClass||"dragover")},!1),d[0].addEventListener("drop",function(a){a.stopPropagation(),a.preventDefault(),d.removeClass(e.ngFileDragOverClass||"dragover");var g,h=[],i=a.dataTransfer.files;if(null!=i)for(g=0;g<i.length;g++)h.push(i.item(g));c(function(){f(b,{$files:h,$event:a})})},!1)}}}])}();

View File

@ -1,21 +0,0 @@
/*!
* This folder contains updated PatternFly4 icons (version 2020.13).
* After the PF4 transition is finished this folder will be deleted.
*/
@font-face {
font-family: "pficon-tmp";
src: url("./pficon.woff2") format("woff2"), url("./pficon.woff") format("woff"); }
.pf-icon-openshift:before {
font-family: "pficon-tmp";
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-style: normal;
font-variant: normal;
font-weight: normal;
text-decoration: none;
text-transform: none; }
.pf-icon-openshift:before {
content: ""; }

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/c3`
# Summary
This package contains type definitions for C3js ( http://c3js.org/ ).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/c3
Additional Details
* Last updated: Wed, 03 Apr 2019 18:23:30 GMT
* Dependencies: @types/d3
* Global values: c3
# Credits
These definitions were written by Marc Climent <https://github.com/mcliment>, Gerin Jacob <https://github.com/gerinjacob>, Bernd Hacker <https://github.com/denyo>, Dzmitry Shyndzin <https://github.com/dmitryshindin>, Tim Niemueller <https://github.com/timn>.

File diff suppressed because it is too large Load Diff

View File

@ -1,46 +0,0 @@
{
"name": "@types/c3",
"version": "0.6.4",
"description": "TypeScript definitions for C3js",
"license": "MIT",
"contributors": [
{
"name": "Marc Climent",
"url": "https://github.com/mcliment",
"githubUsername": "mcliment"
},
{
"name": "Gerin Jacob",
"url": "https://github.com/gerinjacob",
"githubUsername": "gerinjacob"
},
{
"name": "Bernd Hacker",
"url": "https://github.com/denyo",
"githubUsername": "denyo"
},
{
"name": "Dzmitry Shyndzin",
"url": "https://github.com/dmitryshindin",
"githubUsername": "dmitryshindin"
},
{
"name": "Tim Niemueller",
"url": "https://github.com/timn",
"githubUsername": "timn"
}
],
"main": "",
"types": "index",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/c3"
},
"scripts": {},
"dependencies": {
"@types/d3": "^4"
},
"typesPublisherContentHash": "fe3729442d39e79b6e8fff8ca24536b059b47c2dbcb085fd8a160c732c3dacac",
"typeScriptVersion": "2.3"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/d3-array`
# Summary
This package contains type definitions for D3JS d3-array module (https://github.com/d3/d3-array).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-array/v1.
### Additional Details
* Last updated: Sat, 26 Jun 2021 11:31:26 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [Tom Wanzek](https://github.com/tomwanzek), [denisname](https://github.com/denisname), [Hugues Stefanski](https://github.com/ledragon), and [Nathan Bierema](https://github.com/Methuselah96).

View File

@ -1,548 +0,0 @@
// Type definitions for D3JS d3-array module 1.2
// Project: https://github.com/d3/d3-array
// Definitions by: Alex Ford <https://github.com/gustavderdrache>
// Boris Yankov <https://github.com/borisyankov>
// Tom Wanzek <https://github.com/tomwanzek>
// denisname <https://github.com/denisname>
// Hugues Stefanski <https://github.com/ledragon>
// Nathan Bierema <https://github.com/Methuselah96>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// Last module patch version validated against: 1.2.1
// --------------------------------------------------------------------------
// Shared Types and Interfaces
// --------------------------------------------------------------------------
/**
* Administrivia: JavaScript primitive types and Date
*/
export type Primitive = number | string | boolean | Date;
/**
* Administrivia: anything with a valueOf(): number method is comparable, so we allow it in numeric operations
*/
export interface Numeric {
valueOf(): number;
}
// --------------------------------------------------------------------------------------
// Descriptive Statistics
// --------------------------------------------------------------------------------------
/**
* Return the maximum value in the array of strings using natural order.
*/
export function max(array: ArrayLike<string>): string | undefined;
/**
* Return the maximum value in the array of numbers using natural order.
*/
export function max<T extends Numeric>(array: ArrayLike<T>): T | undefined;
/**
* Return the maximum value in the array using natural order and a projection function to map values to strings.
*/
export function max<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => string | undefined | null): string | undefined;
/**
* Return the maximum value in the array using natural order and a projection function to map values to easily-sorted values.
*/
export function max<T, U extends Numeric>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => U | undefined | null): U | undefined;
/**
* Return the minimum value in the array using natural order.
*/
export function min(array: ArrayLike<string>): string | undefined;
/**
* Return the minimum value in the array using natural order.
*/
export function min<T extends Numeric>(array: ArrayLike<T>): T | undefined;
/**
* Return the minimum value in the array using natural order.
*/
export function min<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => string | undefined | null): string | undefined;
/**
* Return the minimum value in the array using natural order.
*/
export function min<T, U extends Numeric>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => U | undefined | null): U | undefined;
/**
* Return the min and max simultaneously.
*/
export function extent(array: ArrayLike<string>): [string, string] | [undefined, undefined];
/**
* Return the min and max simultaneously.
*/
export function extent<T extends Numeric>(array: ArrayLike<T>): [T, T] | [undefined, undefined];
/**
* Return the min and max simultaneously.
*/
export function extent<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => string | undefined | null): [string, string] | [undefined, undefined];
/**
* Return the min and max simultaneously.
*/
export function extent<T, U extends Numeric>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => U | undefined | null): [U, U] | [undefined, undefined];
/**
* Return the mean of an array of numbers
*/
export function mean<T extends Numeric>(array: ArrayLike<T | undefined | null>): number | undefined;
/**
* Return the mean of an array of numbers
*/
export function mean<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => number | undefined | null): number | undefined;
/**
* Return the median of an array of numbers
*/
export function median<T extends Numeric>(array: ArrayLike<T | undefined | null>): number | undefined;
/**
* Return the median of an array of numbers
*/
export function median<T>(array: ArrayLike<T>, accessor: (element: T, i: number, array: ArrayLike<T>) => number | undefined | null): number | undefined;
/**
* Returns the p-quantile of an array of numbers
*/
export function quantile<T extends Numeric>(array: ArrayLike<T | undefined | null>, p: number): number | undefined;
export function quantile<T>(array: ArrayLike<T>, p: number, accessor: (element: T, i: number, array: ArrayLike<T>) => number | undefined | null): number | undefined;
/**
* Compute the sum of an array of numbers.
*/
export function sum<T extends Numeric>(array: ArrayLike<T | undefined | null>): number;
/**
* Compute the sum of an array, using the given accessor to convert values to numbers.
*/
export function sum<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => number | undefined | null): number;
/**
* Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array of numbers.
*/
export function deviation<T extends Numeric>(array: ArrayLike<T | undefined | null>): number | undefined;
/**
* Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array,
* using the given accessor to convert values to numbers.
*/
export function deviation<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => number | undefined | null): number | undefined;
/**
* Compute an unbiased estimator of the population variance of the given array of numbers.
*/
export function variance<T extends Numeric>(array: ArrayLike<T | undefined | null>): number | undefined;
/**
* Compute an unbiased estimator of the population variance of the given array,
* using the given accessor to convert values to numbers.
*/
export function variance<T>(array: ArrayLike<T>, accessor: (datum: T, index: number, array: ArrayLike<T>) => number | undefined | null): number | undefined;
// --------------------------------------------------------------------------------------
// Searching Arrays
// --------------------------------------------------------------------------------------
export function scan(array: ArrayLike<number>, comparator?: (a: number, b: number) => number): number | undefined;
export function scan<T>(array: ArrayLike<T>, comparator: (a: T, b: T) => number): number | undefined;
export function bisectLeft(array: ArrayLike<number>, x: number, lo?: number, hi?: number): number;
export function bisectLeft(array: ArrayLike<string>, x: string, lo?: number, hi?: number): number;
export function bisectLeft(array: ArrayLike<Date>, x: Date, lo?: number, hi?: number): number;
export function bisectRight(array: ArrayLike<number>, x: number, lo?: number, hi?: number): number;
export function bisectRight(array: ArrayLike<string>, x: string, lo?: number, hi?: number): number;
export function bisectRight(array: ArrayLike<Date>, x: Date, lo?: number, hi?: number): number;
export const bisect: typeof bisectRight;
export interface Bisector<T, U> {
left(array: ArrayLike<T>, x: U, lo?: number, hi?: number): number;
right(array: ArrayLike<T>, x: U, lo?: number, hi?: number): number;
}
export function bisector<T, U>(comparator: (a: T, b: U) => number): Bisector<T, U>;
export function bisector<T, U>(accessor: (x: T) => U): Bisector<T, U>;
/**
* Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right].
*
* @param array The array to partially sort (in place).
* @param k The middle index for partial sorting.
*/
export function quickselect<T>(array: ArrayLike<T>, k: number): T[];
/**
* Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right].
*
* @param array The array to partially sort (in place).
* @param k The middle index for partial sorting.
* @param left The left index of the range to sort.
*/
export function quickselect<T>(array: ArrayLike<T>, k: number, left: number): T[];
/**
* Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right].
*
* @param array The array to partially sort (in place).
* @param k The middle index for partial sorting.
* @param left The left index of the range to sort.
* @param right The right index.
*/
export function quickselect<T>(array: ArrayLike<T>, k: number, left: number, right: number): T[];
/**
* Rearranges items so that all items in the [left, k] are the smallest. The k-th element will have the (k - left + 1)-th smallest value in [left, right].
*
* @param array The array to partially sort (in place).
* @param k The middle index for partial sorting.
* @param left The left index of the range to sort.
* @param right The right index.
* @param compare The compare function.
*/
export function quickselect<T>(array: ArrayLike<T>, k: number, left: number, right: number, compare: (a: Primitive | undefined, b: Primitive | undefined) => number): T[];
// NB. this is limited to primitive values due to D3's use of the <, >, and >= operators. Results get weird for object instances.
/**
* Compares two primitive values for sorting (in ascending order).
*/
export function ascending(a: Primitive | undefined, b: Primitive | undefined): number;
// NB. this is limited to primitive values due to D3's use of the <, >, and >= operators. Results get weird for object instances.
/**
* Compares two primitive values for sorting (in ascending order).
*/
export function descending(a: Primitive | undefined, b: Primitive | undefined): number;
// --------------------------------------------------------------------------------------
// Transforming Arrays
// --------------------------------------------------------------------------------------
/**
* Groups the specified array of values into a Map from key to array of value.
* @param a The array to group.
* @param key The key function.
*/
export function group<TObject, TKey>(a: ArrayLike<TObject>, key: (value: TObject) => TKey): Map<TKey, TObject[]>;
/**
* Groups and reduces the specified array of values into a Map from key to value.
*
* @param a The array to group.
* @param reduce The reduce function.
* @param key The key function.
*/
export function rollup<TObject, TKey, TReduce>(a: ArrayLike<TObject>, reduce: (value: TObject[]) => TReduce, key: (value: TObject) => TKey): Map<TKey, TReduce>;
/**
* Returns the Cartesian product of the two arrays a and b.
* For each element i in the specified array a and each element j in the specified array b, in order,
* it creates a two-element array for each pair.
*
* @param a First input array.
* @param b Second input array.
*/
export function cross<S, T>(a: ArrayLike<S>, b: ArrayLike<T>): Array<[S, T]>;
/**
* Returns the Cartesian product of the two arrays a and b.
* For each element i in the specified array a and each element j in the specified array b, in order,
* invokes the specified reducer function passing the element i and element j.
*
* @param a First input array.
* @param b Second input array.
* @param reducer A reducer function taking as input an element from "a" and "b" and returning a reduced value.
*/
export function cross<S, T, U>(a: ArrayLike<S>, b: ArrayLike<T>, reducer: (a: S, b: T) => U): U[];
/**
* Merges the specified arrays into a single array.
*/
export function merge<T>(arrays: ArrayLike<ArrayLike<T>>): T[];
/**
* For each adjacent pair of elements in the specified array, returns a new array of tuples of elements i and i - 1.
* Returns the empty array if the input array has fewer than two elements.
*
* @param array Array of input elements
*/
export function pairs<T>(array: ArrayLike<T>): Array<[T, T]>;
/**
* For each adjacent pair of elements in the specified array, in order, invokes the specified reducer function passing the element i and element i - 1.
* Returns the resulting array of pair-wise reduced elements.
* Returns the empty array if the input array has fewer than two elements.
*
* @param array Array of input elements
* @param reducer A reducer function taking as input to adjacent elements of the input array and returning a reduced value.
*/
export function pairs<T, U>(array: ArrayLike<T>, reducer: (a: T, b: T) => U): U[];
/**
* Returns a permutation of the specified array using the specified array of indexes.
* The returned array contains the corresponding element in array for each index in indexes, in order.
* For example, `permute(["a", "b", "c"], [1, 2, 0]) // ["b", "c", "a"]`
*/
export function permute<T>(array: { [key: number]: T }, keys: ArrayLike<number>): T[];
/**
* Extract the values from an object into an array with a stable order. For example:
* `var object = {yield: 27, year: 1931, site: "University Farm"};`
* `d3.permute(object, ["site", "yield"]); // ["University Farm", 27]`
*/
export function permute<T, K extends keyof T>(object: T, keys: ArrayLike<K>): Array<T[K]>;
/**
* Generates a 0-based numeric sequence. The output range does not include 'stop'.
*/
export function range(stop: number): number[];
/**
* Generates a numeric sequence starting from the given start and stop values. 'step' defaults to 1. The output range does not include 'stop'.
*/
export function range(start: number, stop: number, step?: number): number[];
/**
* Randomizes the order of the specified array using the FisherYates shuffle.
*/
export function shuffle<T>(array: T[], lo?: number, hi?: number): T[];
export function shuffle(array: Int8Array, lo?: number, hi?: number): Int8Array;
export function shuffle(array: Uint8Array, lo?: number, hi?: number): Uint8Array;
export function shuffle(array: Uint8ClampedArray, lo?: number, hi?: number): Uint8ClampedArray;
export function shuffle(array: Int16Array, lo?: number, hi?: number): Int16Array;
export function shuffle(array: Uint16Array, lo?: number, hi?: number): Uint16Array;
export function shuffle(array: Int32Array, lo?: number, hi?: number): Int32Array;
export function shuffle(array: Uint32Array, lo?: number, hi?: number): Uint32Array;
export function shuffle(array: Float32Array, lo?: number, hi?: number): Float32Array;
export function shuffle(array: Float64Array, lo?: number, hi?: number): Float64Array;
/**
* Generate an array of approximately count + 1 uniformly-spaced, nicely-rounded values between start and stop (inclusive).
* Each value is a power of ten multiplied by 1, 2 or 5. See also d3.tickIncrement, d3.tickStep and linear.ticks.
*
* Ticks are inclusive in the sense that they may include the specified start and stop values if (and only if) they are exact,
* nicely-rounded values consistent with the inferred step. More formally, each returned tick t satisfies start t and t stop.
*
* @param start Start value for ticks
* @param stop Stop value for ticks
* @param count count + 1 is the approximate number of ticks to be returned by d3.ticks.
*/
export function ticks(start: number, stop: number, count: number): number[];
/**
* Returns the difference between adjacent tick values if the same arguments were passed to d3.ticks:
* a nicely-rounded value that is a power of ten multiplied by 1, 2 or 5.
*
* Like d3.tickStep, except requires that start is always less than or equal to step, and if the tick step for the given start,
* stop and count would be less than one, returns the negative inverse tick step instead.
*
* This method is always guaranteed to return an integer, and is used by d3.ticks to avoid guarantee that the returned tick values
* are represented as precisely as possible in IEEE 754 floating point.
*
* @param start Start value for ticks
* @param stop Stop value for ticks
* @param count count + 1 is the approximate number of ticks to be returned by d3.ticks.
*/
export function tickIncrement(start: number, stop: number, count: number): number;
/**
* Returns the difference between adjacent tick values if the same arguments were passed to d3.ticks:
* a nicely-rounded value that is a power of ten multiplied by 1, 2 or 5.
*
* Note that due to the limited precision of IEEE 754 floating point, the returned value may not be exact decimals;
* use d3-format to format numbers for human consumption.
*
* @param start Start value for ticks
* @param stop Stop value for ticks
* @param count count + 1 is the approximate number of ticks to be returned by d3.ticks.
*/
export function tickStep(start: number, stop: number, count: number): number;
/**
* Transpose a matrix provided in Array of Arrays format.
*/
export function transpose<T>(matrix: ArrayLike<ArrayLike<T>>): T[][];
/**
* Returns an array of arrays, where the ith array contains the ith element from each of the argument arrays.
* The returned array is truncated in length to the shortest array in arrays. If arrays contains only a single array, the returned array
* contains one-element arrays. With no arguments, the returned array is empty.
*/
export function zip<T>(...arrays: Array<ArrayLike<T>>): T[][];
// --------------------------------------------------------------------------------------
// Histogram
// --------------------------------------------------------------------------------------
export interface Bin<Datum, Value extends number | Date | undefined> extends Array<Datum> {
x0: Value | undefined;
x1: Value | undefined;
}
/**
* Type definition for threshold generator which returns the count of recommended thresholds
*/
export type ThresholdCountGenerator<Value extends number | undefined = number | undefined> =
(values: ArrayLike<Value>, min: number, max: number) => number;
/**
* Type definition for threshold generator which returns an array of recommended numbers thresholds
*/
export type ThresholdNumberArrayGenerator<Value extends number | undefined> =
(values: ArrayLike<Value>, min: number, max: number) => Value[];
/**
* Type definition for threshold generator which returns an array of recommended dates thresholds
*/
export type ThresholdDateArrayGenerator<Value extends Date | undefined> =
(values: ArrayLike<Value>, min: Date, max: Date) => Value[];
/**
* @deprecated Use ThresholdNumberArrayGenerator or ThresholdDateArrayGenerator.
*/
export type ThresholdArrayGenerator = ThresholdNumberArrayGenerator<number>;
/**
* @deprecated Use `HistogramGeneratorNumber<Datum, Value>` for `number` values and `HistogramGeneratorDate<Datum, Value> for `Date` values.
*/
export interface HistogramGenerator<Datum, Value extends number | Date | undefined> {
(data: ArrayLike<Datum>): Array<Bin<Datum, Value>>;
value(): (d: Datum, i: number, data: ArrayLike<Datum>) => Value;
value(valueAccessor: (d: Datum, i: number, data: ArrayLike<Datum>) => Value): this;
domain(): (values: ArrayLike<Value>) => [Value, Value] | [undefined, undefined];
domain(domain: [Value, Value]): this;
domain(domainAccessor: (values: ArrayLike<Value>) => [Value, Value] | [undefined, undefined]): this;
/**
* Set the array of values to be used as thresholds in determining the bins.
*
* Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value,
* and the last bin.x1 is always equal to the maximum domain value.
*
* @param thresholds Array of threshold values used for binning. The elements must
* be of the same type as the materialized values of the histogram.
*/
thresholds(thresholds: ArrayLike<Value>): this;
}
export interface HistogramCommon<Datum, Value extends number | Date | undefined> {
(data: ArrayLike<Datum>): Array<Bin<Datum, Value>>;
value(): (d: Datum, i: number, data: ArrayLike<Datum>) => Value;
value(valueAccessor: (d: Datum, i: number, data: ArrayLike<Datum>) => Value): this;
}
export interface HistogramGeneratorDate<Datum, Value extends Date | undefined> extends HistogramCommon<Datum, Date> {
domain(): (values: ArrayLike<Value>) => [Date, Date];
domain(domain: [Date, Date]): this;
domain(domainAccessor: (values: ArrayLike<Value>) => [Date, Date]): this;
thresholds(): ThresholdDateArrayGenerator<Value>;
/**
* Set the array of values to be used as thresholds in determining the bins.
*
* Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value,
* and the last bin.x1 is always equal to the maximum domain value.
*
* @param thresholds Array of threshold values used for binning. The elements must
* be of the same type as the materialized values of the histogram.
*/
thresholds(thresholds: ArrayLike<Value>): this;
/**
* Set a threshold accessor function, which returns the array of values to be used as
* thresholds in determining the bins.
*
* Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value,
* and the last bin.x1 is always equal to the maximum domain value.
*
* @param thresholds A function which accepts as arguments the array of materialized values, and
* optionally the domain minimum and maximum. The function calculates and returns the array of values to be used as
* thresholds in determining the bins.
*/
thresholds(thresholds: ThresholdDateArrayGenerator<Value>): this;
}
export interface HistogramGeneratorNumber<Datum, Value extends number | undefined> extends HistogramCommon<Datum, Value> {
domain(): (values: ArrayLike<Value>) => [number, number] | [undefined, undefined];
domain(domain: [number, number]): this;
domain(domainAccessor: (values: ArrayLike<Value>) => [number, number] | [undefined, undefined]): this;
thresholds(): ThresholdCountGenerator<Value> | ThresholdNumberArrayGenerator<Value>;
/**
* Divide the domain uniformly into approximately count bins. IMPORTANT: This threshold
* setting approach only works, when the materialized values are numbers!
*
* Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value,
* and the last bin.x1 is always equal to the maximum domain value.
*
* @param count The desired number of uniform bins.
*/
thresholds(count: number): this;
/**
* Set a threshold accessor function, which returns the desired number of bins.
* Divides the domain uniformly into approximately count bins. IMPORTANT: This threshold
* setting approach only works, when the materialized values are numbers!
*
* Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value,
* and the last bin.x1 is always equal to the maximum domain value.
*
* @param count A function which accepts as arguments the array of materialized values, and
* optionally the domain minimum and maximum. The function calculates and returns the suggested
* number of bins.
*/
thresholds(count: ThresholdCountGenerator<Value>): this;
/**
* Set the array of values to be used as thresholds in determining the bins.
*
* Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value,
* and the last bin.x1 is always equal to the maximum domain value.
*
* @param thresholds Array of threshold values used for binning. The elements must
* be of the same type as the materialized values of the histogram.
*/
thresholds(thresholds: ArrayLike<Value>): this;
/**
* Set a threshold accessor function, which returns the array of values to be used as
* thresholds in determining the bins.
*
* Any threshold values outside the domain are ignored. The first bin.x0 is always equal to the minimum domain value,
* and the last bin.x1 is always equal to the maximum domain value.
*
* @param thresholds A function which accepts as arguments the array of materialized values, and
* optionally the domain minimum and maximum. The function calculates and returns the array of values to be used as
* thresholds in determining the bins.
*/
thresholds(thresholds: ThresholdNumberArrayGenerator<Value>): this;
}
export function histogram(): HistogramGeneratorNumber<number, number>;
export function histogram<Datum, Value extends number | undefined>(): HistogramGeneratorNumber<Datum, Value>;
export function histogram<Datum, Value extends Date | undefined>(): HistogramGeneratorDate<Datum, Value>;
/**
* @deprecated Do not use Value generic which mixes number and Date types. Use either number or Date
* (in combination with undefined, as applicable) to obtain a type-specific histogram generator.
*/
export function histogram<Datum, Value extends number | Date | undefined>(): HistogramGenerator<Datum, Value>;
// --------------------------------------------------------------------------------------
// Histogram Thresholds
// --------------------------------------------------------------------------------------
export function thresholdFreedmanDiaconis(values: ArrayLike<number | undefined>, min: number, max: number): number; // of type ThresholdCountGenerator
export function thresholdScott(values: ArrayLike<number | undefined>, min: number, max: number): number; // of type ThresholdCountGenerator
export function thresholdSturges(values: ArrayLike<number | undefined>): number; // of type ThresholdCountGenerator

View File

@ -1,50 +0,0 @@
{
"name": "@types/d3-array",
"version": "1.2.9",
"description": "TypeScript definitions for D3JS d3-array module",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-array",
"license": "MIT",
"contributors": [
{
"name": "Alex Ford",
"url": "https://github.com/gustavderdrache",
"githubUsername": "gustavderdrache"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov",
"githubUsername": "borisyankov"
},
{
"name": "Tom Wanzek",
"url": "https://github.com/tomwanzek",
"githubUsername": "tomwanzek"
},
{
"name": "denisname",
"url": "https://github.com/denisname",
"githubUsername": "denisname"
},
{
"name": "Hugues Stefanski",
"url": "https://github.com/ledragon",
"githubUsername": "ledragon"
},
{
"name": "Nathan Bierema",
"url": "https://github.com/Methuselah96",
"githubUsername": "Methuselah96"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/d3-array"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "548677321160290bd4713af3e1edda8ad3c8b57c147f848791d29cb7258c64c9",
"typeScriptVersion": "3.6"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/d3-axis`
# Summary
This package contains type definitions for D3JS d3-axis module (https://github.com/d3/d3-axis/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-axis/v1.
### Additional Details
* Last updated: Sat, 26 Jun 2021 11:31:26 GMT
* Dependencies: [@types/d3-selection](https://npmjs.com/package/@types/d3-selection)
* Global values: none
# Credits
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), and [Nathan Bierema](https://github.com/Methuselah96).

View File

@ -1,335 +0,0 @@
// Type definitions for D3JS d3-axis module 1.0
// Project: https://github.com/d3/d3-axis/, https://d3js.org/d3-axis
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>
// Alex Ford <https://github.com/gustavderdrache>
// Boris Yankov <https://github.com/borisyankov>
// denisname <https://github.com/denisname>
// Nathan Bierema <https://github.com/Methuselah96>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// Last module patch version validated against: 1.0.12
import { Selection, TransitionLike } from 'd3-selection';
// --------------------------------------------------------------------------
// Shared Types and Interfaces
// --------------------------------------------------------------------------
/**
* A helper type to alias elements which can serve as a domain for an axis.
*/
export type AxisDomain = number | string | Date | { valueOf(): number};
/**
* A helper interface to describe the minimal contract to be met by a time interval
* which can be passed into the Axis.ticks(...) or Axis.tickArguments(...) methods when
* creating time series axes. Under normal circumstances the argument will be of type
* TimeInterval or CountableTimeInterval as defined in d3-time.
* NB: This helper interface has been created to avoid tight coupling of d3-axis to
* d3-time at the level of definition files. I.e. d3-time is not a
* dependency of d3-axis in the D3 Javascript implementation. This minimal contract
* is based on an analysis of how d3-axis passes a time interval argument into a time scale,
* if a time scale was set using Axis.scale(...). And in turn on how a time scale uses
* the time interval when creating ticks from it.
*/
export interface AxisTimeInterval {
range(start: Date, stop: Date, step?: number): Date[];
}
/**
* A helper interface to which a scale passed into axis must conform (at a minimum)
* for axis to use the scale without error.
*/
export interface AxisScale<Domain> {
(x: Domain): number | undefined;
domain(): Domain[];
range(): number[];
copy(): this;
bandwidth?(): number;
// TODO: Reconsider the below, note that the compiler does not differentiate the overloads w.r.t. optionality
// ticks?(count?: number): Domain[];
// ticks?(count?: AxisTimeInterval): Date[];
// tickFormat?(count?: number, specifier?: string): ((d: number) => string);
// tickFormat?(count?: number | AxisTimeInterval, specifier?: string): ((d: Date) => string);
}
/**
* A helper type to alias elements which can serve as a container for an axis.
*/
export type AxisContainerElement = SVGSVGElement | SVGGElement;
/**
* Interface defining an axis generator. The generic <Domain> is the type of the axis domain.
*/
export interface Axis<Domain> {
/**
* Render the axis to the given context.
*
* @param context A selection of SVG containers (either SVG or G elements).
*/
(context: Selection<SVGSVGElement, any, any, any> | Selection<SVGGElement, any, any, any>): void;
/**
* Render the axis to the given context.
*
* @param context A transition defined on SVG containers (either SVG or G elements).
*/
(context: TransitionLike<SVGSVGElement, any> | TransitionLike<SVGGElement, any>): void;
/**
* Gets the current scale underlying the axis.
*/
scale<A extends AxisScale<Domain>>(): A;
/**
* Sets the scale and returns the axis.
*
* @param scale The scale to be used for axis generation.
*/
scale(scale: AxisScale<Domain>): this;
/**
* Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.
*
* This method has no effect if the scale does not implement scale.ticks, as with band and point scales.
*
* This method is also a convenience function for axis.tickArguments.
*
* @param count Number of ticks that should be rendered.
* @param specifier An optional format specifier to customize how the tick values are formatted.
*/
ticks(count: number, specifier?: string): this;
/**
* Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.
* Use with a TIME SCALE ONLY.
*
* This method is also a convenience function for axis.tickArguments.
*
* @param interval A time interval used to generate date-based ticks. This is typically a TimeInterval/CountableTimeInterval as defined
* in d3-time. E.g. as obtained by passing in d3.timeMinute.every(15).
* @param specifier An optional format specifier to customize how the tick values are formatted.
*/
ticks(interval: AxisTimeInterval, specifier?: string): this;
/**
* Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.
*
* The meaning of the arguments depends on the axis scale type: most commonly, the arguments are a suggested count for the number of ticks
* (or a time interval for time scales), and an optional format specifier to customize how the tick values are formatted.
*
* This method has no effect if the scale does not implement scale.ticks, as with band and point scales.
*
* To set the tick values explicitly, use axis.tickValues. To set the tick format explicitly, use axis.tickFormat.
*
* This method is also a convenience function for axis.tickArguments.
*/
ticks(arg0: any, ...args: any[]): this;
/**
* Get an array containing the currently set arguments to be passed into scale.ticks and scale.tickFormat, which defaults to the empty array.
*/
tickArguments(): any[];
/**
* Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.
*
* This method has no effect if the scale does not implement scale.ticks, as with band and point scales.
* To set the tick values explicitly, use axis.tickValues. To set the tick format explicitly, use axis.tickFormat.
*
* See also axis.ticks.
*
* @param args An array containing a single element representing the count, i.e. number of ticks to be rendered.
*/
tickArguments(args: [number]): this;
/**
* Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.
*
* This method has no effect if the scale does not implement scale.ticks, as with band and point scales.
* To set the tick values explicitly, use axis.tickValues. To set the tick format explicitly, use axis.tickFormat.
*
* See also axis.ticks.
*
* @param args An array containing two elements. The first element represents the count, i.e. number of ticks to be rendered. The second
* element is a string representing the format specifier to customize how the tick values are formatted.
*/
tickArguments(args: [number, string]): this;
/**
* Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.
* Use with a TIME SCALE ONLY.
*
* See also axis.ticks.
*
* @param args An array containing a single element representing a time interval used to generate date-based ticks.
* This is typically a TimeInterval/CountableTimeInterval as defined in d3-time. E.g. as obtained by passing in d3.timeMinute.every(15).
*/
tickArguments(args: [AxisTimeInterval]): this;
/**
* Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.
* Use with a TIME SCALE ONLY.
*
* See also axis.ticks.
*
* @param args An array containing two elements. The first element represents a time interval used to generate date-based ticks.
* This is typically a TimeInterval/CountableTimeInterval as defined in d3-time. E.g. as obtained by passing in d3.timeMinute.every(15).
* The second element is a string representing the format specifier to customize how the tick values are formatted.
*/
tickArguments(args: [AxisTimeInterval, string]): this;
/**
* Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator.
*
* This method has no effect if the scale does not implement scale.ticks, as with band and point scales.
* To set the tick values explicitly, use axis.tickValues. To set the tick format explicitly, use axis.tickFormat.
*
* See also axis.ticks.
*
* @param args An array with arguments suitable for the scale to be used for tick generation.
*/
tickArguments(args: any[]): this;
/**
* Returns the current tick values, which defaults to null.
*/
tickValues(): Domain[] | null;
/**
* Specified values to be used for ticks rather than using the scales automatic tick generator.
* The explicit tick values take precedent over the tick arguments set by axis.tickArguments.
* However, any tick arguments will still be passed to the scales tickFormat function if a
* tick format is not also set.
*
* @param values An array with values from the Domain of the scale underlying the axis.
*/
tickValues(values: Domain[]): this;
/**
* Clears any previously-set explicit tick values and reverts back to the scales tick generator.
*
* @param values null
*/
tickValues(values: null): this;
/**
* Returns the currently set tick format function, which defaults to null.
*/
tickFormat(): ((domainValue: Domain, index: number) => string) | null;
/**
* Sets the tick format function and returns the axis.
*
* @param format A function mapping a value from the axis Domain to a formatted string
* for display purposes. When invoked, the format function is also passed a second argument representing the zero-based index
* of the tick label in the array of generated tick labels.
*/
tickFormat(format: (domainValue: Domain, index: number) => string): this;
/**
* Reset the tick format function. A null format indicates that the scales
* default formatter should be used, which is generated by calling scale.tickFormat.
* In this case, the arguments specified by axis.tickArguments
* are likewise passed to scale.tickFormat.
*
* @param format null
*/
tickFormat(format: null): this;
/**
* Get the current inner tick size, which defaults to 6.
*/
tickSize(): number;
/**
* Set the inner and outer tick size to the specified value and return the axis.
*
* @param size Tick size in pixels (Default is 6).
*/
tickSize(size: number): this;
/**
* Get the current inner tick size, which defaults to 6.
* The inner tick size controls the length of the tick lines,
* offset from the native position of the axis.
*/
tickSizeInner(): number;
/**
* Set the inner tick size to the specified value and return the axis.
* The inner tick size controls the length of the tick lines,
* offset from the native position of the axis.
*
* @param size Tick size in pixels (Default is 6).
*/
tickSizeInner(size: number): this;
/**
* Get the current outer tick size, which defaults to 6.
* The outer tick size controls the length of the square ends of the domain path,
* offset from the native position of the axis. Thus, the outer ticks are not actually
* ticks but part of the domain path, and their position is determined by the associated
* scales domain extent. Thus, outer ticks may overlap with the first or last inner tick.
* An outer tick size of 0 suppresses the square ends of the domain path,
* instead producing a straight line.
*/
tickSizeOuter(): number;
/**
* Set the current outer tick size and return the axis.
* The outer tick size controls the length of the square ends of the domain path,
* offset from the native position of the axis. Thus, the outer ticks are not actually
* ticks but part of the domain path, and their position is determined by the associated
* scales domain extent. Thus, outer ticks may overlap with the first or last inner tick.
* An outer tick size of 0 suppresses the square ends of the domain path,
* instead producing a straight line.
*
* @param size Tick size in pixels (Default is 6).
*/
tickSizeOuter(size: number): this;
/**
* Get the current padding, which defaults to 3.
*/
tickPadding(): number;
/**
* Set the current padding and return the axis.
*
* @param padding Padding in pixels (Default is 3).
*/
tickPadding(padding: number): this;
}
/**
* Constructs a new top-oriented axis generator for the given scale, with empty tick arguments,
* a tick size of 6 and padding of 3. In this orientation, ticks are drawn above the horizontal domain path.
*
* @param scale The scale to be used for axis generation.
*/
export function axisTop<Domain extends AxisDomain>(scale: AxisScale<Domain>): Axis<Domain>;
/**
* Constructs a new right-oriented axis generator for the given scale, with empty tick arguments,
* a tick size of 6 and padding of 3. In this orientation, ticks are drawn to the right of the vertical domain path.
*
* @param scale The scale to be used for axis generation.
*/
export function axisRight<Domain extends AxisDomain>(scale: AxisScale<Domain>): Axis<Domain>;
/**
* Constructs a new bottom-oriented axis generator for the given scale, with empty tick arguments,
* a tick size of 6 and padding of 3. In this orientation, ticks are drawn below the horizontal domain path.
*
* @param scale The scale to be used for axis generation.
*/
export function axisBottom<Domain extends AxisDomain>(scale: AxisScale<Domain>): Axis<Domain>;
/**
* Constructs a new left-oriented axis generator for the given scale, with empty tick arguments,
* a tick size of 6 and padding of 3. In this orientation, ticks are drawn to the left of the vertical domain path.
*
* @param scale The scale to be used for axis generation.
*/
export function axisLeft<Domain extends AxisDomain>(scale: AxisScale<Domain>): Axis<Domain>;

View File

@ -1,47 +0,0 @@
{
"name": "@types/d3-axis",
"version": "1.0.16",
"description": "TypeScript definitions for D3JS d3-axis module",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-axis",
"license": "MIT",
"contributors": [
{
"name": "Tom Wanzek",
"url": "https://github.com/tomwanzek",
"githubUsername": "tomwanzek"
},
{
"name": "Alex Ford",
"url": "https://github.com/gustavderdrache",
"githubUsername": "gustavderdrache"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov",
"githubUsername": "borisyankov"
},
{
"name": "denisname",
"url": "https://github.com/denisname",
"githubUsername": "denisname"
},
{
"name": "Nathan Bierema",
"url": "https://github.com/Methuselah96",
"githubUsername": "Methuselah96"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/d3-axis"
},
"scripts": {},
"dependencies": {
"@types/d3-selection": "^1"
},
"typesPublisherContentHash": "3192f7d9c6a048a3ee8adf6512b19618fbca7d7b4c3f0e13801855c5edc5592a",
"typeScriptVersion": "3.6"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/d3-brush`
# Summary
This package contains type definitions for D3JS d3-brush module (https://github.com/d3/d3-brush/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-brush/v1.
### Additional Details
* Last updated: Sat, 26 Jun 2021 11:31:26 GMT
* Dependencies: [@types/d3-selection](https://npmjs.com/package/@types/d3-selection)
* Global values: none
# Credits
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), and [Nathan Bierema](https://github.com/Methuselah96).

View File

@ -1,302 +0,0 @@
// Type definitions for D3JS d3-brush module 1.1
// Project: https://github.com/d3/d3-brush/, https://d3js.org/d3-brush
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>
// Alex Ford <https://github.com/gustavderdrache>
// Boris Yankov <https://github.com/borisyankov>
// Nathan Bierema <https://github.com/Methuselah96>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// Last module patch version validated against: 1.1.6
import { Selection, TransitionLike, ValueFn } from 'd3-selection';
/**
* Type alias for a BrushSelection. For a two-dimensional brush, it must be defined as [[x0, y0], [x1, y1]],
* where x0 is the minimum x-value, y0 is the minimum y-value, x1 is the maximum x-value, and y1 is the maximum y-value.
* For an x-brush, it must be defined as [x0, x1]; for a y-brush, it must be defined as [y0, y1].
*/
export type BrushSelection = [[number, number], [number, number]] | [number, number];
/**
* A D3 brush behavior
*
* The generic refers to the type of the datum for the group element on which brush behavior is defined.
*/
export interface BrushBehavior<Datum> {
/**
* Applies the brush to the specified group, which must be a selection of SVG G elements.
* This function is typically not invoked directly, and is instead invoked via selection.call.
*
* For details see: {@link https://github.com/d3/d3-brush#_brush}
*
* @param group A D3 selection of SVG G elements.
* @param args Optional arguments to be passed in.
*/
(group: Selection<SVGGElement, Datum, any, any>, ...args: any[]): void;
/**
* Clear the active selection of the brush on the specified SVG G element(s) selection.
*
* @param group A D3 selection of SVG G elements.
* @param selection Use null to clear the active brush selection.
*/
move(group: Selection<SVGGElement, Datum, any, any>, selection: null): void;
/**
* Sets the active selection of the brush on the specified SVG G element(s) selection
* to the provided array.
*
* @param group A D3 selection of SVG G elements.
* @param selection An array specifying the new active brush selection. For a two-dimensional brush,
* it must be defined as [[x0, y0], [x1, y1]], where x0 is the minimum x-value, y0 is the minimum y-value,
* x1 is the maximum x-value, and y1 is the maximum y-value. For an x-brush, it must be defined as [x0, x1];
* for a y-brush, it must be defined as [y0, y1].
*/
move(group: Selection<SVGGElement, Datum, any, any>, selection: BrushSelection): void;
/**
* Sets the active selection of the brush on the specified SVG G element(s) selection
* based on the array returned by a value function invoked for each selection element.
*
* @param group A D3 selection of SVG G elements.
* @param selection A selection value function which is evaluated for each selected element,
* in order, being passed the current datum (d), the current index (i), and the current group (nodes),
* with this as the current DOM element. The function returns an array specifying the new active brush selection.
* For a two-dimensional brush, it must be defined as [[x0, y0], [x1, y1]], where x0 is the minimum x-value, y0 is the minimum y-value,
* x1 is the maximum x-value, and y1 is the maximum y-value. For an x-brush, it must be defined as [x0, x1];
* for a y-brush, it must be defined as [y0, y1].
*/
move(group: Selection<SVGGElement, Datum, any, any>, selection: ValueFn<SVGGElement, Datum, BrushSelection>): void;
/**
* Clear the active selection of the brush on the specified SVG G element(s) transition.
*
* @param group A D3 transition on SVG G elements.
* @param selection Use null to clear the active brush selection.
*/
move(group: Selection<SVGGElement, Datum, any, any>, selection: null): void;
/**
* Sets the active selection of the brush on the specified SVG G element(s) transition
* to the provided array.
*
* @param group A D3 transition on SVG G elements.
* @param selection An array specifying the new active brush selection. For a two-dimensional brush,
* it must be defined as [[x0, y0], [x1, y1]], where x0 is the minimum x-value, y0 is the minimum y-value,
* x1 is the maximum x-value, and y1 is the maximum y-value. For an x-brush, it must be defined as [x0, x1];
* for a y-brush, it must be defined as [y0, y1].
*/
move(group: TransitionLike<SVGGElement, Datum>, selection: BrushSelection): void;
/**
* Sets the active selection of the brush on the specified SVG G element(s) transition
* based on the array returned by a value function invoked for each transitioning element.
*
* @param group A D3 transition on SVG G elements.
* @param selection A selection value function which is evaluated for each selected element,
* in order, being passed the current datum (d), the current index (i), and the current group (nodes),
* with this as the current DOM element. The function returns an array specifying the new active brush selection.
* For a two-dimensional brush, it must be defined as [[x0, y0], [x1, y1]], where x0 is the minimum x-value, y0 is the minimum y-value,
* x1 is the maximum x-value, and y1 is the maximum y-value. For an x-brush, it must be defined as [x0, x1];
* for a y-brush, it must be defined as [y0, y1].
*/
move(group: TransitionLike<SVGGElement, Datum>, selection: ValueFn<SVGGElement, Datum, BrushSelection>): void;
/**
* Clear the active selection of the brush on the specified SVG G element(s) selection.
*
* @param group A D3 selection of SVG G elements.
*/
clear(group: Selection<SVGGElement, Datum, any, any>): void;
/**
* Returns the current extent accessor.
*/
extent(): ValueFn<SVGGElement, Datum, [[number, number], [number, number]]>;
/**
* Set the brushable extent to the specified array of points and returns this brush.
*
* The brush extent determines the size of the invisible overlay and also constrains the brush selection;
* the brush selection cannot go outside the brush extent.
*
* @param extent array of points [[x0, y0], [x1, y1]], where [x0, y0] is the top-left corner
* and [x1, y1] is the bottom-right corner.
*/
extent(extent: [[number, number], [number, number]]): this;
/**
* Set the brushable extent to the specified array of points returned by the accessor function
* evaluated for each element in the selection/transition and returns this brush.
*
* The brush extent determines the size of the invisible overlay and also constrains the brush selection;
* the brush selection cannot go outside the brush extent.
*
* @param extent An extent accessor function which is evaluated for each selected element,
* in order, being passed the current datum (d), the current index (i), and the current group (nodes),
* with this as the current DOM element. The function returns an array of points [[x0, y0], [x1, y1]],
* where [x0, y0] is the top-left corner and [x1, y1] is the bottom-right corner.
*/
extent(extent: ValueFn<SVGGElement, Datum, [[number, number], [number, number]]>): this;
/**
* Returns the current filter function.
*/
filter(): ValueFn<SVGGElement, Datum, boolean>;
/**
* Sets the filter to the specified filter function and returns the brush.
*
* If the filter returns falsey, the initiating event is ignored and no brush gesture is started.
* Thus, the filter determines which input events are ignored. The default filter ignores mousedown events on secondary buttons,
* since those buttons are typically intended for other purposes, such as the context menu.
*
* @param filterFn A filter function which is evaluated for each selected element,
* in order, being passed the current datum (d), the current index (i), and the current group (nodes),
* with this as the current DOM element. The function returns a boolean value.
*/
filter(filterFn: ValueFn<SVGGElement, Datum, boolean>): this;
/**
* Returns the current touch support detector, which defaults to a function returning true,
* if the "ontouchstart" event is supported on the current element.
*/
touchable(): ValueFn<SVGGElement, Datum, boolean>;
/**
* Sets the touch support detector to the specified boolean value and returns the brush.
*
* Touch event listeners are only registered if the detector returns truthy for the corresponding element when the brush is applied.
* The default detector works well for most browsers that are capable of touch input, but not all; Chromes mobile device emulator, for example,
* fails detection.
*
* @param touchable A boolean value. true when touch event listeners should be applied to the corresponding element, otherwise false.
*/
touchable(touchable: boolean): this;
/**
* Sets the touch support detector to the specified function and returns the drag behavior.
*
* Touch event listeners are only registered if the detector returns truthy for the corresponding element when the brush is applied.
* The default detector works well for most browsers that are capable of touch input, but not all; Chromes mobile device emulator, for example,
* fails detection.
*
* @param touchable A touch support detector function, which returns true when touch event listeners should be applied to the corresponding element.
* The function is evaluated for each selected element to which the brush was applied, in order, being passed the current datum (d),
* the current index (i), and the current group (nodes), with this as the current DOM element. The function returns a boolean value.
*/
touchable(touchable: ValueFn<SVGGElement, Datum, boolean>): this;
/**
* Returns the current key modifiers flag.
*/
keyModifiers(): boolean;
/**
* Sets the key modifiers flag and returns the brush.
*
* The key modifiers flag determines whether the brush listens to key events during brushing.
* The default value is true.
*
* @param modifiers New value for key modifiers flag.
*/
keyModifiers(modifiers: boolean): this;
/**
* Returns the current handle size, which defaults to six.
*/
handleSize(): number;
/**
* Sets the size of the brush handles to the specified number and returns the brush.
*
* This method must be called before applying the brush to a selection;
* changing the handle size does not affect brushes that were previously rendered.
* The default size is 6.
*
* @param size Size of the handle.
*/
handleSize(size: number): this;
/**
* Returns the first currently-assigned listener matching the specified typenames, if any.
*
* @param typenames The typenames is a string containing one or more typename separated by whitespace.
* Each typename is a type, optionally followed by a period (.) and a name, such as "brush.foo"" and "brush.bar";
* the name allows multiple listeners to be registered for the same type. The type must be one of the following:
* start (at the start of a brush gesture, such as on mousedown), brush (when the brush moves, such as on mousemove), or
* end (at the end of a brush gesture, such as on mouseup.)
*/
on(typenames: string): ValueFn<SVGGElement, Datum, void> | undefined;
/**
* Removes the current event listeners for the specified typenames, if any.
*
* @param typenames The typenames is a string containing one or more typename separated by whitespace.
* Each typename is a type, optionally followed by a period (.) and a name, such as "brush.foo"" and "brush.bar";
* the name allows multiple listeners to be registered for the same type. The type must be one of the following:
* start (at the start of a brush gesture, such as on mousedown), brush (when the brush moves, such as on mousemove), or
* end (at the end of a brush gesture, such as on mouseup.)
* @param listener Use null to remove the listener.
*/
on(typenames: string, listener: null): this;
/**
* Sets the event listener for the specified typenames and returns the brush.
* If an event listener was already registered for the same type and name,
* the existing listener is removed before the new listener is added.
* When a specified event is dispatched, each listener will be invoked with the same context and arguments as selection.on listeners.
*
* @param typenames The typenames is a string containing one or more typename separated by whitespace.
* Each typename is a type, optionally followed by a period (.) and a name, such as "brush.foo"" and "brush.bar";
* the name allows multiple listeners to be registered for the same type. The type must be one of the following:
* start (at the start of a brush gesture, such as on mousedown), brush (when the brush moves, such as on mousemove), or
* end (at the end of a brush gesture, such as on mouseup.)
* @param listener An event listener function which is evaluated for each selected element,
* in order, being passed the current datum (d), the current index (i), and the current group (nodes),
* with this as the current DOM element.
*/
on(typenames: string, listener: ValueFn<SVGGElement, Datum, void>): this;
}
/**
* Create a new two-dimensional brush.
*
* The generic "Datum" refers to the type of the data of the selected svg:g element to
* which the returned BrushBehavior will be applied.
*/
export function brush<Datum>(): BrushBehavior<Datum>;
/**
* Creates a new one-dimensional brush along the x-dimension.
*
* The generic "Datum" refers to the type of the data of the selected svg:g element to
* which the returned BrushBehavior will be applied.
*/
export function brushX<Datum>(): BrushBehavior<Datum>;
/**
* Creates a new one-dimensional brush along the y-dimension.
*
* The generic "Datum" refers to the type of the data of the selected svg:g element to
* which the returned BrushBehavior will be applied.
*/
export function brushY<Datum>(): BrushBehavior<Datum>;
/**
* Return the current brush selection for the specified node. Internally, an elements brush state is stored as element.__brush;
* however, you should use this method rather than accessing it directly. If the given node has no selection, returns null.
* Otherwise, the selection is defined as an array of numbers.
*
* @param node The node for which the brush selection should be returned.
*/
export function brushSelection(node: SVGGElement): BrushSelection | null;
/**
* D3 brush event
*
* The generic refers to the type of the datum for the group element on which brush was defined.
*/
export interface D3BrushEvent<Datum> {
/**
* The BrushBehavior associated with the event
*/
target: BrushBehavior<Datum>;
/**
* The event type for the BrushEvent
*/
type: 'start' | 'brush' | 'end' | string; // Leave failsafe string type for cases like 'brush.foo'
/**
* The current brush selection associated with the event.
* This is null when the selection is empty.
*/
selection: BrushSelection | null;
/**
* The underlying input event, such as mousemove or touchmove.
*/
sourceEvent: any;
}

View File

@ -1,42 +0,0 @@
{
"name": "@types/d3-brush",
"version": "1.1.5",
"description": "TypeScript definitions for D3JS d3-brush module",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-brush",
"license": "MIT",
"contributors": [
{
"name": "Tom Wanzek",
"url": "https://github.com/tomwanzek",
"githubUsername": "tomwanzek"
},
{
"name": "Alex Ford",
"url": "https://github.com/gustavderdrache",
"githubUsername": "gustavderdrache"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov",
"githubUsername": "borisyankov"
},
{
"name": "Nathan Bierema",
"url": "https://github.com/Methuselah96",
"githubUsername": "Methuselah96"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/d3-brush"
},
"scripts": {},
"dependencies": {
"@types/d3-selection": "^1"
},
"typesPublisherContentHash": "5e1ea045d1373c2c269d1e896e327a228612fa9ab2da55c3ea2574e220663383",
"typeScriptVersion": "3.6"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/d3-chord`
# Summary
This package contains type definitions for D3JS d3-chord module (https://github.com/d3/d3-chord/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-chord/v1.
### Additional Details
* Last updated: Sat, 26 Jun 2021 11:31:27 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), and [Nathan Bierema](https://github.com/Methuselah96).

View File

@ -1,408 +0,0 @@
// Type definitions for D3JS d3-chord module 1.0
// Project: https://github.com/d3/d3-chord/, https://d3js.org/d3-chord
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>
// Alex Ford <https://github.com/gustavderdrache>
// Boris Yankov <https://github.com/borisyankov>
// Nathan Bierema <https://github.com/Methuselah96>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// Last module patch version validated against: 1.0.6
// ---------------------------------------------------------------------
// Chord
// ---------------------------------------------------------------------
/**
* A chord subgroup serving as source or target of a chord between two nodes i an j (where i may be equal to j).
*/
export interface ChordSubgroup {
/**
* Start angle of the chord subgroup in radians
*/
startAngle: number;
/***
* End angle of the chord subgroup in radians
*/
endAngle: number;
/**
* The flow value in matrix[i][j] from node i to node j
*/
value: number;
/**
* The node index i
*/
index: number;
/**
* The node index j
*/
subindex: number;
}
/**
* A chord represents the combined bidirectional flow between two nodes i and j (where i may be equal to j)
*/
export interface Chord {
/**
* Chord subgroup constituting the source of Chord
*/
source: ChordSubgroup;
/**
* Chord subgroup constituting the Target of Chord
*/
target: ChordSubgroup;
}
/**
* A chord group for a given node i representing the combined outflow for node i,
* corresponding to the elements matrix[i][0 n - 1].
*/
export interface ChordGroup {
/**
* The start angle of the chord group in radians
*/
startAngle: number;
/**
* The end angle of the chord group in radians
*/
endAngle: number;
/**
* The total outgoing flow value for node i
*/
value: number;
/**
* The node index i
*/
index: number;
}
/**
* An array of chords, where each chord represents the combined bidirectional flow between two nodes i and j (where i may be equal to j).
* The chords are based on a (n x n) matrix of flows between nodes.
*
* The chords are typically passed to d3.ribbon to display the network relationships.
* The returned array includes only chord objects for which the value matrix[i][j] or matrix[j][i] is non-zero.
* Furthermore, the returned array only contains unique chords: a given chord ij represents the bidirectional flow from i to j and from j to i,
* and does not contain a duplicate chord ji; i and j are chosen such that the chords source always represents the larger of matrix[i][j] and matrix[j][i].
* In other words, chord.source.index equals chord.target.subindex, chord.source.subindex equals chord.target.index,
* chord.source.value is greater than or equal to chord.target.value, and chord.source.value is always greater than zero.
*/
export interface Chords extends Array<Chord> {
/**
* An array of length n, where each group represents the combined outflow for node i,
* corresponding to the elements matrix[i][0 n - 1]
*/
groups: ChordGroup[];
}
/**
* A D3 chord diagram Layout to visualize relationships or network flow with an aesthetically-pleasing circular layout.
*
* The relationships are represented as a square matrix of size n×n, where the matrix represents the directed flow amongst a network (a complete digraph) of n nodes.
*/
export interface ChordLayout {
/**
* Computes the chord layout for the specified square matrix of size n×n, where the matrix represents the directed flow amongst a network (a complete digraph) of n nodes.
*
* @param matrix An (n x n) matrix representing the directed flow amongst a network (a complete digraph) of n nodes.The given matrix must be an array of length n,
* where each element matrix[i] is an array of n numbers, where each matrix[i][j] represents the flow from the ith node in the network to the jth node.
* Each number matrix[i][j] must be nonnegative, though it can be zero if there is no flow from node i to node j.
*/
(matrix: number[][]): Chords;
/**
* Returns the current pad angle in radians, which defaults to zero.
*/
padAngle(): number;
/**
* Sets the pad angle between adjacent groups to the specified number in radians and returns this chord layout.
*
* The default is zero.
*
* @param angle Pad angle between adjacent groups in radians.
*/
padAngle(angle: number): this;
/**
* Returns the current group comparator, which defaults to null.
*/
sortGroups(): ((a: number, b: number) => number) | null;
/**
* Removes the current group comparator and returns this chord layout.
*
* @param compare Use null to remove the current comparator function, if any.
*/
sortGroups(compare: null): this;
/**
* Sets the group comparator to the specified function and returns this chord layout.
*
* If the group comparator is non-null, it is used to sort the groups by their total outflow. See also d3.ascending and d3.descending.
*
* @param compare A comparator function, e.g. d3.ascending or d3.descending.
*/
sortGroups(compare: (a: number, b: number) => number): this;
/**
* Returns the current subgroup comparator, which defaults to null.
*/
sortSubgroups(): ((a: number, b: number) => number) | null;
/**
* Removes the current subgroup comparator and returns this chord layout.
*
* @param compare Use null to remove the current comparator function, if any.
*/
sortSubgroups(compare: null): this;
/**
* Sets the subgroup comparator to the specified function and returns this chord layout.
*
* If the subgroup comparator is non-null, it is used to sort the subgroups corresponding to matrix[i][0 n - 1]
* for a given group i by their total outflow. See also d3.ascending and d3.descending.
*
* @param compare A comparator function, e.g. d3.ascending or d3.descending.
*/
sortSubgroups(compare: (a: number, b: number) => number): this;
/**
* Returns the current chord comparator, which defaults to null.
*/
sortChords(): ((a: number, b: number) => number) | null;
/**
* Removes the current chord comparator and returns this chord layout.
*
* @param compare Use null to remove the current comparator function, if any.
*/
sortChords(compare: null): this;
/**
* Sets the chord comparator to the specified function and returns this chord layout.
*
* If the chord comparator is non-null, it is used to sort the chords by their combined flow; this only affects the z-order of the chords.
* See also d3.ascending and d3.descending.
*
* @param compare A comparator function, e.g. d3.ascending or d3.descending.
*/
sortChords(compare: (a: number, b: number) => number): this;
}
/**
* Constructs a new chord diagram layout with the default settings.
*/
export function chord(): ChordLayout;
// ---------------------------------------------------------------------
// Ribbon
// ---------------------------------------------------------------------
/**
* A minimal interface to support the default accessors used by RibbonGenerator for properties of
* source and target objects of a Ribbon.
*
* (Corresponds to ChordSubgroup)
*/
export interface RibbonSubgroup {
/**
* Start angle of the ribbon subgroup in radians
*/
startAngle: number;
/**
* End angle of the ribbon subgroup in radians
*/
endAngle: number;
/**
* Radius of the ribbon subgroup
*/
radius: number;
}
/**
* A minimal interface to support the default source and target accessors used by RibbonGenerator.
* (Corresponds to Chord)
*/
export interface Ribbon {
/**
* Ribbon subgroup constituting the source of the Ribbon
*/
source: RibbonSubgroup;
/**
* Ribbon subgroup constituting the target of the Ribbon
*/
target: RibbonSubgroup;
}
/**
*
* A ribbon generator to support rendering of chords in a chord diagram.
*
* The first generic corresponds to the type of the "this" context within which the ribbon generator and its accessor functions will be invoked.
*
* The second generic corresponds to the datum type representing a chord for which the ribbon is to be generated. The default type is Ribbon.
*
* The third generic corresponds to the datum type of the chord subgroup, i.e. source or target of the cord. The default type is RibbonSubgroup.
*/
export interface RibbonGenerator<This, RibbonDatum, RibbonSubgroupDatum> {
/**
* Generates a ribbon for the given arguments.
*
* IMPORTANT: If the ribbon generator has been configured with a rendering context,
* then the ribbon is rendered to this context as a sequence of path method calls and this function returns void.
*
* The "this" context within which this function is invoked, will be the context within which the accessor methods of the generator are invoked.
* All arguments passed into this function, will be passed to the accessor functions of the generator.
*
* @param d The datum representing the chord for which the ribbon is to be generated.
*/
(this: This, d: RibbonDatum, ...args: any[]): void;
/**
* Generates a ribbon for the given arguments.
*
* IMPORTANT: If the rendering context of the ribbon generator is null,
* then the ribbon is returned as a path data string.
*
* The "this" context within which this function is invoked, will be the context within which the accessor methods of the generator are invoked.
* All arguments passed into this function, will be passed to the accessor functions of the generator.
*
* @param d The datum representing the chord for which the ribbon is to be generated.
*/
(this: This, d: RibbonDatum, ...args: any[]): string | null;
/**
* Returns the current source accessor, which defaults to a function returning the "source" property of the first argument passed into the accessor.
*/
source(): (this: This, d: RibbonDatum, ...args: any[]) => RibbonSubgroupDatum;
/**
* Sets the source accessor to the specified function and returns this ribbon generator.
*
* @param source An accessor function returning the source datum of the chord. The accessor function is invoked in the same "this" context as the generator was invoked in and
* receives the same arguments that were passed into the ribbon generator.
*/
source(source: (this: This, d: RibbonDatum, ...args: any[]) => RibbonSubgroupDatum): this;
/**
* Returns the current target accessor, which defaults to a function returning the "target" property of the first argument passed into the accessor.
*/
target(): (this: This, d: RibbonDatum, ...args: any[]) => RibbonSubgroupDatum;
/**
* Sets the target accessor to the specified function and returns this ribbon generator.
*
* @param target An accessor function returning the target datum of the chord. The accessor function is invoked in the same "this" context as the generator was invoked in and
* receives the same arguments that were passed into the ribbon generator.
*/
target(target: (this: This, d: RibbonDatum, ...args: any[]) => RibbonSubgroupDatum): this;
/**
* Returns the current radius accessor, which defaults to a function returning the "radius" property (assumed to be a number) of the source or
* target object returned by the source or target accessor, respectively.
*/
radius(): (this: This, d: RibbonSubgroupDatum, ...args: any[]) => number;
/**
* Sets the radius to a fixed number and returns this ribbon generator.
*
* @param radius A fixed numeric value for the radius.
*/
radius(radius: number): this;
/**
* Sets the radius accessor to the specified function and returns this ribbon generator.
*
* @param radius An accessor function which is invoked for the source and target of the chord. The accessor function is invoked in the same "this" context as the generator was invoked in and
* receives as the first argument the source or target object returned by the respective source or target accessor function of the generator.
* It is also passed any additional arguments that were passed into the generator, with the exception of the first element representing the chord datum itself.
* The function returns the radius value.
*/
radius(radius: (this: This, d: RibbonSubgroupDatum, ...args: any[]) => number): this;
/**
* Returns the current start angle accessor, which defaults to a function returning the "startAngle" property (assumed to be a number in radians) of the source or
* target object returned by the source or target accessor, respectively.
*/
startAngle(): (this: This, d: RibbonSubgroupDatum, ...args: any[]) => number;
/**
* Sets the start angle to a fixed number in radians and returns this ribbon generator.
*
* @param angle A fixed numeric value for the start angle in radians.
*/
startAngle(angle: number): this;
/**
* Sets the start angle accessor to the specified function and returns this ribbon generator.
*
* @param angle An accessor function which is invoked for the source and target of the chord. The accessor function is invoked in the same "this" context as the generator was invoked in and
* receives as the first argument the source or target object returned by the respective source or target accessor function of the generator.
* It is also passed any additional arguments that were passed into the generator, with the exception of the first element representing the chord datum itself.
* The function returns the start angle in radians.
*/
startAngle(angle: (this: This, d: RibbonSubgroupDatum, ...args: any[]) => number): this;
/**
* Returns the current end angle accessor, which defaults to a function returning the "endAngle" property (assumed to be a number in radians) of the source or
* target object returned by the source or target accessor, respectively.
*/
endAngle(): (this: This, d: RibbonSubgroupDatum, ...args: any[]) => number;
/**
* Sets the end angle to a fixed number in radians and returns this ribbon generator.
*
* @param angle A fixed numeric value for the end angle in radians.
*/
endAngle(angle: number): this;
/**
* Sets the end angle accessor to the specified function and returns this ribbon generator.
*
* @param angle An accessor function which is invoked for the source and target of the chord. The accessor function is invoked in the same "this" context as the generator was invoked in and
* receives as the first argument the source or target object returned by the respective source or target accessor function of the generator.
* It is also passed any additional arguments that were passed into the generator, with the exception of the first element representing the chord datum itself.
* The function returns the end angle in radians.
*/
endAngle(angle: (this: This, d: RibbonSubgroupDatum, ...args: any[]) => number): this;
/**
* Returns the current rendering context, which defaults to null.
*/
context(): CanvasRenderingContext2D | null;
/**
* Sets the rendering context and returns this ribbon generator.
*
* If the context is not null, then the generated ribbon is rendered to this context as a sequence of path method calls.
*
* @param context The rendering context.
*/
context(context: CanvasRenderingContext2D): this;
/**
* Sets the rendering context to null and returns this ribbon generator.
*
* A path data string representing the generated ribbon will be returned when the generator is invoked with data. See also d3-path.
*
* @param context null, to remove rendering context.
*/
context(context: null): this;
}
/**
* Creates a new ribbon generator with the default settings.
*/
export function ribbon(): RibbonGenerator<any, Ribbon, RibbonSubgroup>;
/**
* Creates a new ribbon generator with the default settings.
*
* Accessor functions must be configured for the ribbon generator, should the datum types differ from the defaults.
*
* The first generic corresponds to the datum type representing a chord for which the ribbon is to be generated. The default type is Chord.
*
* The second generic corresponds to the datum type of the chord subgroup, i.e. source or target of the cord. The default type is ChordSubgroup.
*/
export function ribbon<Datum, SubgroupDatum>(): RibbonGenerator<any, Datum, SubgroupDatum>;
/**
* Creates a new ribbon generator with the default settings.
*
* Accessor functions must be configured for the ribbon generator, should the datum types differ from the defaults.
*
* The first generic corresponds to the type of the "this" context within which the ribbon generator and its accessor functions will be invoked.
*
* The second generic corresponds to the datum type representing a chord for which the ribbon is to be generated. The default type is Chord.
*
* The third generic corresponds to the datum type of the chord subgroup, i.e. source or target of the cord. The default type is ChordSubgroup.
*/
export function ribbon<This, Datum, SubgroupDatum>(): RibbonGenerator<This, Datum, SubgroupDatum>;

View File

@ -1,40 +0,0 @@
{
"name": "@types/d3-chord",
"version": "1.0.11",
"description": "TypeScript definitions for D3JS d3-chord module",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-chord",
"license": "MIT",
"contributors": [
{
"name": "Tom Wanzek",
"url": "https://github.com/tomwanzek",
"githubUsername": "tomwanzek"
},
{
"name": "Alex Ford",
"url": "https://github.com/gustavderdrache",
"githubUsername": "gustavderdrache"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov",
"githubUsername": "borisyankov"
},
{
"name": "Nathan Bierema",
"url": "https://github.com/Methuselah96",
"githubUsername": "Methuselah96"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/d3-chord"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "3f3e2a190b79c5096e705d2083f50544d42239b7df50cb3dc71336a7d476d165",
"typeScriptVersion": "3.6"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/d3-collection`
# Summary
This package contains type definitions for D3JS d3-collection module (https://github.com/d3/d3-collection/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-collection.
### Additional Details
* Last updated: Wed, 28 Oct 2020 18:21:13 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), and [Boris Yankov](https://github.com/borisyankov).

View File

@ -1,481 +0,0 @@
// Type definitions for D3JS d3-collection module 1.0
// Project: https://github.com/d3/d3-collection/, https://d3js.org/d3-collection
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// Last module patch version validated against: 1.0.7
/**
* Reference type things that can be coerced to string implicitly
*/
export interface Stringifiable {
toString(): string;
}
// ---------------------------------------------------------------------
// Objects
// ---------------------------------------------------------------------
/**
* Returns an array containing the property names of the specified object (an associative array).
* The order of the returned array is undefined.
*
* @param obj An object.
*/
export function keys(obj: object): string[];
/**
* Returns an array containing the property values of the specified object (an associative array).
* The order of the returned array is undefined.
*
* The generic refers to the data type of the values.
*
* @param obj An object.
*/
export function values<T>(obj: { [key: string]: T } | ArrayLike<T>): T[];
/**
* Returns an array containing the property values of the specified object (an associative array).
* The order of the returned array is undefined.
*
* @param obj An object.
*/
export function values(obj: object): any[];
/**
* Returns an array containing the property keys and values of the specified object (an associative array).
* Each entry is an object with a key and value attribute.The order of the returned array is undefined.
*
* The generic refers to the data type of the values.
*
* @param obj An object.
*/
export function entries<T>(obj: { [key: string]: T } | ArrayLike<T>): Array<{ key: string, value: T }>;
/**
* Returns an array containing the property keys and values of the specified object (an associative array).
* Each entry is an object with a key and value attribute.The order of the returned array is undefined.
*
* @param obj An object.
*/
export function entries(obj: object): Array<{ key: string, value: any }>;
// ---------------------------------------------------------------------
// map / Map
// ---------------------------------------------------------------------
/**
* A data structure similar to ES6 Maps, but with a few differences:
* - Keys are coerced to strings.
* - map.each, not map.forEach. (Also, no thisArg.)
* - map.remove, not map.delete.
* - map.entries returns an array of {key, value} objects, not an iterator of [key, value].
* - map.size is a method, not a property; also, theres map.empty.
*
* The generic refers to the data type of the map entry values.
*/
export interface Map<T> {
/**
* Returns true if and only if this map has an entry for the specified key string.
* Note: the value may be null or undefined.
*
* @param key Key of map entry to access.
*/
has(key: string): boolean;
/**
* Returns the value for the specified key string.
* If the map does not have an entry for the specified key, returns undefined.
*
* @param key Key of map entry to access.
*/
get(key: string): T | undefined;
/**
* Sets the value for the specified key string and returns the updated map.
* If the map previously had an entry for the same key string, the old entry is replaced with the new value.
*
* @param key Key of map entry to access.
* @param value Value to set for entry at key.
*/
set(key: string, value: T): this;
/**
* If the map has an entry for the specified key string, removes the entry and returns true.
* Otherwise, this method does nothing and returns false.
*
* @param key Map key for which to remove the entry.
*/
remove(key: string): boolean;
/**
* Removes all entries from this map.
*/
clear(): void;
/**
* Returns an array of string keys for every entry in this map.
* The order of the returned keys is arbitrary.
*/
keys(): string[];
/**
* Returns an array of values for every entry in this map.
* The order of the returned values is arbitrary.
*/
values(): T[];
/**
* Returns an array of key-value objects for each entry in this map. The order of the returned entries is arbitrary.
* Each entrys key is a string, but the value can have arbitrary type.
*/
entries(): Array<{ key: string, value: T }>;
/**
* Calls the specified function for each entry in this map and returns undefined.
* The iteration order is arbitrary.
*
* @param func Function to call for each entry. The function is passed the entrys value and key as arguments,
* followed by the map itself.
*/
each(func: (value: T, key: string, map: Map<T>) => void): void;
/**
* Returns true if and only if this map has zero entries.
*/
empty(): boolean;
/**
* Returns the number of entries in this map.
*/
size(): number;
}
/**
* Constructs a new empty map.
*
* The generic refers to the data type of the map entry values.
*/
export function map<T = any>(): Map<T>;
/**
* Constructs a new map by copying another map.
*
* The generic refers to the data type of the map entry values.
*
* @param d3Map A D3 Map.
*/
export function map<T>(d3Map: Map<T>): Map<T>;
/**
* Constructs a new map by copying all enumerable properties from the specified object into this map.
*
* The generic refers to the data type of the map entry values.
*
* @param obj Object to construct the map from.
*/
export function map<T>(obj: { [key: string]: T }): Map<T>;
/**
* Constructs a new map by copying all enumerable properties from the specified object into this map.
*
* The generic refers to the data type of the map entry values.
*
* @param obj Object to construct the map from.
*/
export function map<T>(obj: { [key: number]: T }): Map<T>;
/**
* Constructs a new map from the elements of an array.
* An optional key function may be specified to compute the key for each value in the array.
*
* The generic refers to the data type of the map entry values.
*
* @param array Array to convert into a map
* @param key An optional key function. The functions is invoked for each element in the array being passed
* the element's value , it's zero-based index in the array, and the array itself. The function must return a unique string
* to be used as the map entry's key.
*/
export function map<T>(array: T[], key?: (value: T, i?: number, array?: T[]) => string): Map<T>;
/**
* Constructs a new map by copying all enumerable properties from the specified object into this map.
*
* @param obj Object to construct the map from.
*/
export function map(obj: object): Map<any>;
// ---------------------------------------------------------------------
// set / Set
// ---------------------------------------------------------------------
/**
* A data structure similar to ES6 Sets, but with a few differences:
*
* - Values are coerced to strings.
* - set.each, not set.forEach. (Also, no thisArg.)
* - set.remove, not set.delete.
* - set.size is a method, not a property; also, theres set.empty.
*/
export interface Set {
/**
* Returns true if and only if this set has an entry for the specified value string.
*
* @param value Value whose membership in the class to test.
*/
has(value: string | Stringifiable): boolean;
/**
* Adds the specified value string to this set and returns the set.
*
* @param value Value to add to set.
*/
add(value: string | Stringifiable): this;
/**
* If the set contains the specified value string, removes it and returns true.
* Otherwise, this method does nothing and returns false.
*
* @param value Value to remove from set.
*/
remove(value: string | Stringifiable): boolean;
/**
* Removes all values from this set.
*/
clear(): void;
/**
* Returns an array of the string values in this set. The order of the returned values is arbitrary.
* Can be used as a convenient way of computing the unique values for a set of strings.
*/
values(): string[];
/**
* Calls the specified function for each value in this set, passing the value as the first two arguments (for symmetry with map.each),
* followed by the set itself. Returns undefined.
* The iteration order is arbitrary.
*
* @param func Function to call for each set element. The first and second argument of the function are both passed
* the 'value' of the set entry for consistency with the map.each(...) signature, as a third argument the entire set is passed in.
*/
each(func: (value: string, valueRepeat: string, set: Set) => void): void;
/**
* Returns true if and only if this set has zero values.
*/
empty(): boolean;
/**
* Returns the number of values in this set.
*/
size(): number;
}
/**
* Constructs a new empty set.
*/
export function set(): Set;
/**
* Constructs a new set by copying an existing set.
*
* @param set A D3 set.
*/
export function set(d3Set: Set): Set;
/**
* Constructs a new set by adding the given array of string values to the returned set.
*
* @param array An array of strings of values which can be implicitly converted to strings.
*/
export function set(array: Array<string | Stringifiable>): Set;
/**
* Constructs a new set from an array, adds an array of mapped string values to the returned set.
* The specified accessor function is invoked equivalent to calling array.map(accessor) before constructing the set.
*
* The generic refers to the data type of the array elements.
*
* @param array An Array of values to map and add as set elements.
* @param key An accessor function used to map the original array elements to string elements to be added to the set.
* The function is invoked for each array element, being passed the element's value, it's zero-based index in the array, and the array itself.
*/
export function set<T>(array: T[], key: (value: T, index: number, array: T[]) => string): Set;
// ---------------------------------------------------------------------
// nest / Nest
// ---------------------------------------------------------------------
/**
* A more formal definition of the nested array returned by Nest.entries(...). This data structure is intended as a reference only.
*
* As the union types cannot be ex ante simplified without knowledge
* of the nesting level (number of key(...) operations) and whether the data were rolled-up, this data structure becomes cumbersome
* to use in practice. This is particularly true for discrimination of array element types.
* The use of the rollup function, or lack thereof, also determines whether NestedArray has the 'values' property
* with an array of type Datum at leaf level, or has a rolled-up 'value' property.
*/
export interface NestedArray<Datum, RollupType> extends Array<{ key: string, values: NestedArray<Datum, RollupType> | Datum[] | undefined, value: RollupType | undefined }> { }
/**
* A more formal definition of the nested array returned by Nest.map(...). This data structure is intended as a reference only.
*
* As the union types cannot be ex ante simplified without knowledge
* of the nesting level (number of key(...) operations) and whether the data were rolled-up, this data structure becomes cumbersome
* to use in practice.
*/
export interface NestedMap<Datum, RollupType> extends Map<NestedMap<Datum, RollupType> | Datum[] | RollupType> { }
/**
* A more formal definition of the nested array returned by Nest.object(...). This data structure is intended as a reference only.
*
* As the union types cannot be ex ante simplified without knowledge
* of the nesting level (number of key(...) operations) and whether the data were rolled-up, this data structure becomes cumbersome
* to use in practice.
*/
export interface NestedObject<Datum, RollupType> {
[key: string]: NestedObject<Datum, RollupType> | Datum[] | RollupType;
}
/**
* A nest operator for generating nested data structures from arrays.
*
* Nesting allows elements in an array to be grouped into a hierarchical tree structure;
* think of it like the GROUP BY operator in SQL, except you can have multiple levels of grouping, and the resulting output is a tree rather than a flat table.
* The levels in the tree are specified by key functions. The leaf nodes of the tree can be sorted by value, while the internal nodes can be sorted by key.
* An optional rollup function will collapse the elements in each leaf node using a summary function.
* The nest operator is reusable, and does not retain any references to the data that is nested.
*
* The first generic refers to the data type of the array elements on which the nest operator will
* be invoked.
*
* The second generic refers to the data type returned by the roll-up function to be used with the
* nest operator.
*/
export interface Nest<Datum, RollupType> {
/**
* Registers a new key function and returns this nest operator.
* The key function will be invoked for each element in the input array and must return a string identifier to assign the element to its group.
* Most often, the function is a simple accessor. (Keys functions are not passed the input array index.)
*
* Each time a key is registered, it is pushed onto the end of the internal array of keys,
* and the nest operator applies an additional level of nesting.
*
* @param func A key accessor function being invoked for each element.
*/
key(func: (datum: Datum) => string): this;
/**
* Sorts key values for the current key using the specified comparator function, such as d3.ascending or d3.descending.
*
* If no comparator is specified for the current key, the order in which keys will be returned is undefined.
*
* Note that this only affects the result of nest.entries;
* the order of keys returned by nest.map and nest.object is always undefined, regardless of comparator.
*
* @param comparator A comparator function which returns a negative value if, according to the sorting criterion,
* a is less than b, or a positive value if a is greater than b, or 0 if the two values are the same under the sorting criterion.
*/
sortKeys(comparator: (a: string, b: string) => number): this;
/**
* Sorts leaf elements using the specified comparator function, such as d3.ascending or d3.descending.
* This is roughly equivalent to sorting the input array before applying the nest operator;
* however it is typically more efficient as the size of each group is smaller.
*
* If no value comparator is specified, elements will be returned in the order they appeared in the input array.
* This applies to nest.map, nest.entries and nest.object.
*
* @param comparator A comparator function which returns a negative value if, according to the sorting criterion,
* a is less than b, or a positive value if a is greater than b, or 0 if the two values are the same under the sorting criterion.
*/
sortValues(comparator: (a: Datum, b: Datum) => number): this;
/**
* Specifies a rollup function to be applied on each group of leaf elements and returns this nest operator.
* The return value of the rollup function will replace the array of leaf values in either the associative array returned by nest.map or nest.object;
* for nest.entries, it replaces the leaf entry.values with entry.value.
*
* If a leaf comparator is specified, the leaf elements are sorted prior to invoking the rollup function.
*
* @param func A function computing the rollup value for a group of leaf elements.
*/
rollup(func: (values: Datum[]) => RollupType): this;
/**
* Applies the nest operator to the specified array, returning a nested map.
*
* Each entry in the returned map corresponds to a distinct key value returned by the first key function.
* The entry value depends on the number of registered key functions: if there is an additional key, the value is another map;
* otherwise, the value is the array of elements filtered from the input array that have the given key value.
*
* NOTE:
*
* Strictly speaking the return type of this method is:
*
* (1) NestedMap<Datum, RollupType>, if at least one key function was defined,
*
* (2) Datum[], if neither a key nor a rollup function were defined, and
*
* (3) RollupType, if no keys, but a rollup function were defined.
*
* Since (2) and (3) are edge cases with little to no practical relevance, they have been omitted in favour of ease-of-use.
*
* Should you determine that this simplification creates an issue in practice, please file an issue on
* https://github.com/DefinitelyTyped/DefinitelyTyped.
*
* The formal, generalized return type under (1) is cumbersome to work with in practice. The recommended approach
* is to define the type of the variable being assigned the return value using knowledge specific to the use-case at hand.
* I.e. making use of knowing how many keys are applied, and the nature of any roll-up function will make working with
* the variable more meaningful, despite the compromise in type-safety.
*
* @param array An array to create a nested data structure from.
*/
map(array: Datum[]): Map<any>;
/**
* Applies the nest operator to the specified array, returning a nested object.
* Each entry in the returned associative array corresponds to a distinct key value returned by the first key function.
* The entry value depends on the number of registered key functions: if there is an additional key, the value is another associative array;
* otherwise, the value is the array of elements filtered from the input array that have the given key value.
*
* WARNING: this method is unsafe if any of the keys conflict with built-in JavaScript properties, such as __proto__.
* If you cannot guarantee that the keys will be safe, you should use nest.map instead.
*
* NOTE:
*
* Strictly speaking the return type of this method is:
*
* (1) NestedObject<Datum, RollupType>, if at least one key function was defined,
*
* (2) Datum[], if neither a key nor a rollup function were defined, and
*
* (3) RollupType, if no keys, but a rollup function were defined.
*
* Since (2) and (3) are edge cases with little to no practical relevance, they have been omitted in favour of ease-of-use.
*
* Should you determine that this simplification creates an issue in practice, please file an issue on
* https://github.com/DefinitelyTyped/DefinitelyTyped.
*
* The formal, generalized return type under (1) is cumbersome to work with in practice. The recommended approach
* is to define the type of the variable being assigned the return value using knowledge specific to the use-case at hand.
* I.e. making use of knowing how many keys are applied, and the nature of any roll-up function will make working with
* the variable more meaningful, despite the compromise in type-safety.
*
* @param array An array to create a nested data structure from.
*/
object(array: Datum[]): { [key: string]: any };
/**
* Applies the nest operator to the specified array, returning an array of key-values entries.
* Conceptually, this is similar to applying map.entries to the associative array returned by nest.map,
* but it applies to every level of the hierarchy rather than just the first (outermost) level.
* Each entry in the returned array corresponds to a distinct key value returned by the first key function.
* The entry value depends on the number of registered key functions: if there is an additional key, the value is another nested array of entries;
* otherwise, the value is the array of elements filtered from the input array that have the given key value.
*
* NOTE:
*
* Strictly speaking the return type of this method is:
*
* (1) NestedArray<Datum, RollupType>, if at least one key function was defined,
*
* (2) Datum[], if neither a key nor a rollup function were defined, and
*
* (3) RollupType, if no keys, but a rollup function were defined.
*
* Since (2) and (3) are edge cases with little to no practical relevance, they have been omitted in favour of ease-of-use.
*
* Should you determine that this simplification creates an issue in practice, please file an issue on
* https://github.com/DefinitelyTyped/DefinitelyTyped.
*
* The formal, generalized return type under (1) is cumbersome to work with in practice. The recommended approach
* is to define the type of the variable being assigned the return value using knowledge specific to the use-case at hand.
* I.e. making use of knowing how many keys are applied, and the nature of any roll-up function will make working with
* the variable more meaningful, despite the compromise in type-safety.
*
* @param array An array to create a nested data structure from.
*/
entries(array: Datum[]): Array<{ key: string; values: any; value: RollupType | undefined }>;
}
/**
* Creates a new nest operator.
*
* The first generic refers to the data type of the array elements on which the nest operator will
* be invoked.
*
* The second generic refers to the data type returned by the roll-up function to be used with the
* nest operator. If not explicitly set, this generic parameter defaults to undefined, implying that
* no rollup function will be applied.
*/
export function nest<Datum, RollupType = undefined>(): Nest<Datum, RollupType>;

View File

@ -1,34 +0,0 @@
{
"name": "@types/d3-collection",
"version": "1.0.10",
"description": "TypeScript definitions for D3JS d3-collection module",
"license": "MIT",
"contributors": [
{
"name": "Tom Wanzek",
"url": "https://github.com/tomwanzek",
"githubUsername": "tomwanzek"
},
{
"name": "Alex Ford",
"url": "https://github.com/gustavderdrache",
"githubUsername": "gustavderdrache"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov",
"githubUsername": "borisyankov"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/d3-collection"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "f2becbefd216f0bf1a7ca0c259314a02857447360e7a2f8aa8cb78b2b0c63ea3",
"typeScriptVersion": "3.2"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/d3-color`
# Summary
This package contains type definitions for D3JS d3-color module (https://github.com/d3/d3-color/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-color/v1.
### Additional Details
* Last updated: Tue, 06 Jul 2021 20:32:37 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), [Hugues Stefanski](https://github.com/ledragon), and [Nathan Bierema](https://github.com/Methuselah96).

View File

@ -1,623 +0,0 @@
// Type definitions for D3JS d3-color module 1.4
// Project: https://github.com/d3/d3-color/, https://d3js.org/d3-color
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>
// Alex Ford <https://github.com/gustavderdrache>
// Boris Yankov <https://github.com/borisyankov>
// denisname <https://github.com/denisname>
// Hugues Stefanski <https://github.com/ledragon>
// Nathan Bierema <https://github.com/Methuselah96>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Last module patch version validated against: 1.4.1
// ---------------------------------------------------------------------------
// Shared Type Definitions and Interfaces
// ---------------------------------------------------------------------------
/**
* Type allowing for color objects from a specified color space
*/
export type ColorSpaceObject = RGBColor | HSLColor | LabColor | HCLColor | CubehelixColor;
/**
* A helper interface of methods common to color objects (including colors defined outside the d3-color standard module,
* e.g. in d3-hsv). This interface
*/
export interface ColorCommonInstance {
/**
* Returns true if and only if the color is displayable on standard hardware.
* For example, this returns false for an RGB color if any channel value is less than zero or greater than 255, or if the opacity is not in the range [0, 1].
*/
displayable(): boolean;
/**
* Returns a string representing this color according to the CSS Object Model specification,
* such as rgb(247, 234, 186) or rgba(247, 234, 186, 0.2).
* If this color is not displayable, a suitable displayable color is returned instead.
* For example, RGB channel values greater than 255 are clamped to 255.
*/
toString(): string;
/**
* Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be.
* If k is not specified, it defaults to 1. The behavior of this method is dependent on the implementing color space.
*
* @param k A color space dependent number to determine, how much brighter the returned color should be.
*/
brighter(k?: number): this;
/**
* Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be.
* If k is not specified, it defaults to 1. The behavior of this method is dependent on the implementing color space.
*
* @param k A color space dependent number to determine, how much darker the returned color should be.
*/
darker(k?: number): this;
/**
* Returns the RGB equivalent of this color. For RGB colors, thats "this".
*/
rgb(): RGBColor;
/**
* Returns a hexadecimal string representing this color.
* If this color is not displayable, a suitable displayable color is returned instead.
* For example, RGB channel values greater than 255 are clamped to 255.
*/
hex(): string;
}
/**
* A Color object which serves as a base class for
* colorspace-specific sub-class implementations.
*/
export interface Color {
/**
* Returns true if and only if the color is displayable on standard hardware.
* For example, this returns false for an RGB color if any channel value is less than zero or greater than 255, or if the opacity is not in the range [0, 1].
*/
displayable(): boolean; // Note: While this method is used in prototyping for colors of specific colorspaces, it should not be called directly, as 'this.rgb' would not be implemented on Color
/**
* Returns a string representing this color according to the CSS Object Model specification,
* such as rgb(247, 234, 186) or rgba(247, 234, 186, 0.2).
* If this color is not displayable, a suitable displayable color is returned instead.
* For example, RGB channel values greater than 255 are clamped to 255.
*/
toString(): string; // Note: While this method is used in prototyping for colors of specific colorspaces, it should not be called directly, as 'this.rgb' would not be implemented on Color
/**
* Returns a hexadecimal string representing this color in RGB space, such as #f7eaba.
* If this color is not displayable, a suitable displayable color is returned instead.
* For example, RGB channel values greater than 255 are clamped to 255.
*/
formatHex(): string;
/**
* Returns a string representing this color according to the CSS Color Module Level 3 specification, such as hsl(257, 50%, 80%) or hsla(257, 50%, 80%, 0.2).
* If this color is not displayable, a suitable displayable color is returned instead by clamping S and L channel values to the interval [0, 100].
*/
formatHsl(): string;
/**
* Returns a string representing this color according to the CSS Object Model specification, such as rgb(247, 234, 186) or rgba(247, 234, 186, 0.2).
* If this color is not displayable, a suitable displayable color is returned instead by clamping RGB channel values to the interval [0, 255].
*/
formatRgb(): string;
/**
* @deprecated Use color.formatHex.
*/
hex(): string;
}
/**
* A Color factory object, which may also be used with instanceof to test if an object is a color instance.
*/
export interface ColorFactory extends Function {
/**
* Parses the specified CSS Color Module Level 3 specifier string, returning an RGB or HSL color.
* If the specifier was not valid, null is returned.
*
* @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
*/
(cssColorSpecifier: string): RGBColor | HSLColor | null;
/**
* Converts the provided color instance and returns an RGB or HSL color.
*
* @param color A permissible color space instance.
*/
(color: ColorSpaceObject | ColorCommonInstance): RGBColor | HSLColor;
/**
* Prototype of the factory, which can be used for instanceof testing
*/
readonly prototype: Color;
}
/**
* An RGB color object.
*/
export interface RGBColor extends Color {
/**
* Value of red channel
*/
r: number;
/**
* Value of green channel
*/
g: number;
/**
* Value of blue channel
*/
b: number;
/**
* Opacity value
*/
opacity: number;
/**
* Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be.
* If k is not specified, it defaults to 1.
*
* @param k A color space dependent number to determine, how much brighter the returned color should be.
*/
brighter(k?: number): this;
/**
* Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be.
* If k is not specified, it defaults to 1.
*
* @param k A color space dependent number to determine, how much darker the returned color should be.
*/
darker(k?: number): this;
/**
* Returns the RGB equivalent of this color.
*/
rgb(): this;
/**
* Returns a copy of this color.
*
* @param values If values is specified, any enumerable own properties of values are assigned to the new returned color.
*/
copy(values?: { r?: number | undefined; g?: number | undefined; b?: number | undefined; opacity?: number | undefined }): this;
}
/**
* An RGB color factory object, which may also be used with instanceof to test if an object
* is an RGB color instance.
*/
export interface RGBColorFactory extends Function {
/**
* Constructs a new RGB color based on the specified channel values and opacity.
*
* @param r Red channel value.
* @param g Green channel value.
* @param b Blue channel value.
* @param opacity Optional opacity value, defaults to 1.
*/
(r: number, g: number, b: number, opacity?: number): RGBColor;
/**
* Parses the specified CSS Color Module Level 3 specifier string, returning an RGB color.
* If the specifier was not valid, null is returned.
*
* @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
*/
(cssColorSpecifier: string): RGBColor;
/**
* Converts the provided color instance and returns an RGB color. The color instance is converted to the RGB color space using color.rgb.
* Note that unlike color.rgb this method always returns a new instance, even if color is already an RGB color.
*
* @param color A permissible color space instance.
*/
(color: ColorSpaceObject | ColorCommonInstance): RGBColor;
/**
* Prototype of the factory, which can be used for instanceof testing
*/
readonly prototype: RGBColor;
}
/**
* An HSL color object.
*/
export interface HSLColor extends Color {
/**
* Hue channel value.
*/
h: number;
/**
* Saturation channel value.
*/
s: number;
/**
* Lightness channel value.
*/
l: number;
/**
* Opacity value.
*/
opacity: number;
/**
* Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be.
* If k is not specified, it defaults to 1.
*
* @param k A color space dependent number to determine, how much brighter the returned color should be.
*/
brighter(k?: number): this;
/**
* Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be.
* If k is not specified, it defaults to 1.
*
* @param k A color space dependent number to determine, how much darker the returned color should be.
*/
darker(k?: number): this;
/**
* Returns the RGB color equivalent of this color.
*/
rgb(): RGBColor;
/**
* Returns a copy of this color.
*
* @param values If values is specified, any enumerable own properties of values are assigned to the new returned color.
*/
copy(values?: { h?: number | undefined; s?: number | undefined; l?: number | undefined; opacity?: number | undefined }): this;
}
/**
* An HSL color factory object, which may also be used with instanceof to test if an object
* is an HSL color instance.
*/
export interface HSLColorFactory extends Function {
/**
* Constructs a new HSL color based on the specified channel values and opacity.
*
* @param h Hue channel value.
* @param s Saturation channel value.
* @param l Lightness channel value.
* @param opacity Optional opacity value, defaults to 1.
*/
(h: number, s: number, l: number, opacity?: number): HSLColor;
/**
* Parses the specified CSS Color Module Level 3 specifier string, returning an HSL color.
* If the specifier was not valid, null is returned.
*
* @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
*/
(cssColorSpecifier: string): HSLColor;
/**
* Converts the provided color instance and returns an HSL color.
* The color instance is converted to the RGB color space using color.rgb and then converted to HSL.
* (Colors already in the HSL color space skip the conversion to RGB.)
*
* @param color A permissible color space instance.
*/
(color: ColorSpaceObject | ColorCommonInstance): HSLColor;
/**
* Prototype of the factory, which can be used for instanceof testing
*/
readonly prototype: HSLColor;
}
/**
* A Lab (CIELAB) color object.
*/
export interface LabColor extends Color {
/**
* Lightness typically in the range [0, 100].
*/
l: number;
/**
* Position between red/magenta and green typically in [-160, +160].
*/
a: number;
/**
* Position between yellow and blue typically in [-160, +160].
*/
b: number;
/**
* Opacity value
*/
opacity: number;
/**
* Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be.
* If k is not specified, it defaults to 1.
*
* @param k A color space dependent number to determine, how much brighter the returned color should be.
*/
brighter(k?: number): this;
/**
* Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be.
* If k is not specified, it defaults to 1.
*
* @param k A color space dependent number to determine, how much darker the returned color should be.
*/
darker(k?: number): this;
/**
* Returns the RGB color equivalent of this color.
*/
rgb(): RGBColor;
/**
* Returns a copy of this color.
*
* @param values If values is specified, any enumerable own properties of values are assigned to the new returned color.
*/
copy(values?: { l?: number | undefined; a?: number | undefined; b?: number | undefined; opacity?: number | undefined }): this;
}
/**
* A Lab (CIELAB) color factory object, which may also be used with instanceof to test if an object
* is a Lab color instance.
*/
export interface LabColorFactory extends Function {
/**
* Constructs a new CIELAB color based on the specified channel values and opacity.
*
* @param l Lightness typically in the range [0, 100].
* @param a Position between red/magenta and green typically in [-160, +160].
* @param b Position between yellow and blue typically in [-160, +160].
* @param opacity Optional opacity value, defaults to 1.
*/
(l: number, a: number, b: number, opacity?: number): LabColor;
/**
* Parses the specified CSS Color Module Level 3 specifier string, returning a Lab color.
* If the specifier was not valid, null is returned.
*
* @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
*/
(cssColorSpecifier: string): LabColor;
/**
* Converts the provided color instance and returns a Lab color.
* The color instance is converted to the RGB color space using color.rgb and then converted to CIELAB.
* (Colors already in the Lab color space skip the conversion to RGB,
* and colors in the HCL color space are converted directly to CIELAB.)
*
* @param color A permissible color space instance.
*/
(color: ColorSpaceObject | ColorCommonInstance): LabColor;
/**
* Prototype of the factory, which can be used for instanceof testing
*/
readonly prototype: LabColor;
}
/**
* A gray color factory for Lab (CIELAB) colors.
*/
export type GrayColorFactory =
/**
* Constructs a new CIELAB color with the specified l value and a = b = 0.
*
* @param l Lightness typically in the range [0, 100].
* @param opacity Optional opacity value, defaults to 1.
*/
(l: number, opacity?: number) => LabColor;
/**
* An HCL (CIELCH) color object.
*/
export interface HCLColor extends Color {
/**
* Hue channel value typically in [0, 360).
*/
h: number;
/**
* Chroma channel value typically in [0, 230].
*/
c: number;
/**
* Luminance channel value typically in the range [0, 100].
*/
l: number;
/**
* Opacity value
*/
opacity: number;
/**
* Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be.
* If k is not specified, it defaults to 1.
*
* @param k A color space dependent number to determine, how much brighter the returned color should be.
*/
brighter(k?: number): this;
/**
* Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be.
* If k is not specified, it defaults to 1.
*
* @param k A color space dependent number to determine, how much darker the returned color should be.
*/
darker(k?: number): this;
/**
* Returns the RGB color equivalent of this color.
*/
rgb(): RGBColor;
/**
* Returns a copy of this color.
*
* @param values If values is specified, any enumerable own properties of values are assigned to the new returned color.
*/
copy(values?: { h?: number | undefined; c?: number | undefined; l?: number | undefined; opacity?: number | undefined }): this;
}
/**
* An HCL (CIELCH) color factory object, which may also be used with instanceof to test if an object
* is an HCL color instance.
*/
export interface HCLColorFactory extends Function {
/**
* Constructs a new HCL color based on the specified channel values and opacity.
*
* @param h Hue channel value typically in [0, 360).
* @param c Chroma channel value typically in [0, 230].
* @param l Luminance channel value typically in the range [0, 100].
* @param opacity Optional opacity value, defaults to 1.
*/
(h: number, l: number, c: number, opacity?: number): HCLColor;
/**
* Parses the specified CSS Color Module Level 3 specifier string, returning an HCL color.
* If the specifier was not valid, null is returned.
*
* @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
*/
(cssColorSpecifier: string): HCLColor;
/**
* Converts the provided color instance and returns an HCL color.
* The color instance is converted to the RGB color space using color.rgb and then converted to HCL.
* (Colors already in the HCL color space skip the conversion to RGB,
* and colors in the Lab color space are converted directly to HCL.)
*
* @param color A permissible color space instance.
*/
(color: ColorSpaceObject | ColorCommonInstance): HCLColor;
/**
* Prototype of the factory, which can be used for instanceof testing
*/
readonly prototype: HCLColor;
}
/**
* An LCH (CIELCH) color factory function to create an HCL color object.
*/
export interface LCHColorFactory {
/**
* Constructs a new HCL color based on the specified channel values and opacity.
*
* @param l Luminance channel value typically in the range [0, 100].
* @param c Chroma channel value typically in [0, 230].
* @param h Hue channel value typically in [0, 360).
* @param opacity Optional opacity value, defaults to 1.
*/
(l: number, c: number, h: number, opacity?: number): HCLColor;
/**
* Parses the specified CSS Color Module Level 3 specifier string, returning an HCL color.
* If the specifier was not valid, null is returned.
*
* @param cssColorSpecifier A CSS color Module Level 3 specifier string.
*/
(cssColorSpecifier: string): HCLColor;
/**
* Converts the provided color instance and returns an HCL color.
* The color instance is converted to the RGB color space using color.rgb and then converted to HCL.
* (Colors already in the HCL color space skip the conversion to RGB,
* and colors in the Lab color space are converted directly to HCL.)
*
* @param color A permissible color space instance.
*/
(color: ColorSpaceObject | ColorCommonInstance): HCLColor;
}
/**
* Dave Greens Cubehelix color object.
*/
export interface CubehelixColor extends Color {
/**
* Hue channel value.
*/
h: number;
/**
* Saturation channel value.
*/
s: number;
/**
* Lightness channel value.
*/
l: number;
/**
* Opacity value.
*/
opacity: number;
/**
* Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be.
* If k is not specified, it defaults to 1.
*
* @param k A color space dependent number to determine, how much brighter the returned color should be.
*/
brighter(k?: number): this;
/**
* Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be.
* If k is not specified, it defaults to 1.
*
* @param k A color space dependent number to determine, how much darker the returned color should be.
*/
darker(k?: number): this;
/**
* Returns the RGB color equivalent of this color.
*/
rgb(): RGBColor;
/**
* Returns a copy of this color.
*
* @param values If values is specified, any enumerable own properties of values are assigned to the new returned color.
*/
copy(values?: { h?: number | undefined; s?: number | undefined; l?: number | undefined; opacity?: number | undefined }): this;
}
/**
* A color factory object for Dave Green's Cubehelix colors, which may also be used with instanceof to test if an object
* is a Cubehelix color instance.
*/
export interface CubehelixColorFactory extends Function {
/**
* Constructs a new Cubehelix color based on the specified channel values and opacity.
*
* @param h Hue channel value.
* @param s Saturation channel value.
* @param l Lightness channel value.
* @param opacity Optional opacity value, defaults to 1.
*/
(h: number, s: number, l: number, opacity?: number): CubehelixColor;
/**
* Parses the specified CSS Color Module Level 3 specifier string, returning an Cubehelix color.
* If the specifier was not valid, null is returned.
*
* @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
*/
(cssColorSpecifier: string): CubehelixColor;
/**
* Converts the provided color instance and returns a Cubehelix color.
* The color instance is specified, it is converted to the RGB color space using color.rgb and then converted to Cubehelix.
* (Colors already in the Cubehelix color space skip the conversion to RGB.)
*
* @param color A permissible color space instance.
*/
(color: ColorSpaceObject | ColorCommonInstance): CubehelixColor;
/**
* Prototype of the factory, which can be used for instanceof testing
*/
readonly prototype: CubehelixColor;
}
// --------------------------------------------------------------------------
// Color object factories
// --------------------------------------------------------------------------
/**
* A Color factory object, which may also be used with instanceof to test if an object is a color instance.
*/
export const color: ColorFactory;
/**
* An RGB color factory object, which may also be used with instanceof to test if an object
* is an RGB color instance.
*/
export const rgb: RGBColorFactory;
/**
* An HSL color factory object, which may also be used with instanceof to test if an object
* is an HSL color instance.
*/
export const hsl: HSLColorFactory;
/**
* A Lab (CIELAB) color factory object, which may also be used with instanceof to test if an object
* is a Lab color instance.
*/
export const lab: LabColorFactory;
/**
* A gray color factory for Lab (CIELAB) colors.
*/
export const gray: GrayColorFactory;
/**
* An HCL (CIELCH) color factory object, which may also be used with instanceof to test if an object
* is an HCL color instance.
*/
export const hcl: HCLColorFactory;
/**
* An LCH (CIELCH) color factory function to create an HCL color object.
*/
export const lch: LCHColorFactory;
/**
* A color factory object for Dave Green's Cubehelix colors, which may also be used with instanceof to test if an object
* is a Cubehelix color instance.
*/
export const cubehelix: CubehelixColorFactory;

View File

@ -1,50 +0,0 @@
{
"name": "@types/d3-color",
"version": "1.4.2",
"description": "TypeScript definitions for D3JS d3-color module",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-color",
"license": "MIT",
"contributors": [
{
"name": "Tom Wanzek",
"url": "https://github.com/tomwanzek",
"githubUsername": "tomwanzek"
},
{
"name": "Alex Ford",
"url": "https://github.com/gustavderdrache",
"githubUsername": "gustavderdrache"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov",
"githubUsername": "borisyankov"
},
{
"name": "denisname",
"url": "https://github.com/denisname",
"githubUsername": "denisname"
},
{
"name": "Hugues Stefanski",
"url": "https://github.com/ledragon",
"githubUsername": "ledragon"
},
{
"name": "Nathan Bierema",
"url": "https://github.com/Methuselah96",
"githubUsername": "Methuselah96"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/d3-color"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "4dac1f02b6ff9b2aa3cc14faea26a6d5458a903e03f121d0394006ed1302efda",
"typeScriptVersion": "3.6"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/d3-dispatch`
# Summary
This package contains type definitions for D3JS d3-dispatch module (https://github.com/d3/d3-dispatch/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-dispatch/v1.
### Additional Details
* Last updated: Wed, 30 Sep 2020 21:08:21 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), and [Nathan Bierema](https://github.com/Methuselah96).

View File

@ -1,75 +0,0 @@
// Type definitions for D3JS d3-dispatch module 1.0
// Project: https://github.com/d3/d3-dispatch/, https://d3js.org/d3-dispatch
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>
// Alex Ford <https://github.com/gustavderdrache>
// Boris Yankov <https://github.com/borisyankov>
// denisname <https://github.com/denisname>
// Nathan Bierema <https://github.com/Methuselah96>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Last module patch version validated against: 1.0.6
export interface Dispatch<T extends object> {
/**
* Like `function.apply`, invokes each registered callback for the specified type,
* passing the callback the specified arguments, with `that` as the `this` context.
*
* @param type A specified event type.
* @param that The `this` context for the callback.
* @param args Additional arguments to be passed to the callback.
* @throws "unknown type" on unknown event type.
*/
apply(type: string, that?: T, args?: any[]): void;
/**
* Like `function.call`, invokes each registered callback for the specified type,
* passing the callback the specified arguments, with `that` as the `this` context.
* See dispatch.apply for more information.
*
* @param type A specified event type.
* @param that The `this` context for the callback.
* @param args Additional arguments to be passed to the callback.
* @throws "unknown type" on unknown event type.
*/
call(type: string, that?: T, ...args: any[]): void;
/**
* Returns a copy of this dispatch object.
* Changes to this dispatch do not affect the returned copy and vice versa.
*/
copy(): Dispatch<T>;
/**
* Returns the callback for the specified typenames, if any.
* If multiple typenames are specified, the first matching callback is returned.
*
* @param types An event typename.
* @param callback A callback.
*/
on(typenames: string): ((this: T, ...args: any[]) => void) | undefined;
/**
* Removes the callback for the specified typenames.
* To remove all callbacks for a given name `foo`, say `dispatch.on(".foo", null).`
*
* @param types An event typename.
*/
on(typenames: string, callback: null): this;
/**
* Adds the callback for the specified typenames.
* The callback is registered for the specified (fully-qualified) typenames.
* If a callback was already registered for the given typenames,
* the existing callback is removed before the new callback is added.
*
* @param types An event typename.
* @param callback A callback.
*/
on(typenames: string, callback: (this: T, ...args: any[]) => void): this;
}
/**
* Creates a new dispatch for the specified event types. Each type is a string, such as "start" or "end".
*
* @param types The event types.
* @throws "illegal type" on empty string or duplicated event types.
*/
export function dispatch<T extends object>(...types: string[]): Dispatch<T>;

View File

@ -1,44 +0,0 @@
{
"name": "@types/d3-dispatch",
"version": "1.0.9",
"description": "TypeScript definitions for D3JS d3-dispatch module",
"license": "MIT",
"contributors": [
{
"name": "Tom Wanzek",
"url": "https://github.com/tomwanzek",
"githubUsername": "tomwanzek"
},
{
"name": "Alex Ford",
"url": "https://github.com/gustavderdrache",
"githubUsername": "gustavderdrache"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov",
"githubUsername": "borisyankov"
},
{
"name": "denisname",
"url": "https://github.com/denisname",
"githubUsername": "denisname"
},
{
"name": "Nathan Bierema",
"url": "https://github.com/Methuselah96",
"githubUsername": "Methuselah96"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/d3-dispatch"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "26bcf02a4cf4b37b7be5f4e690a01b591e95b4143044712159c093c46bd764e1",
"typeScriptVersion": "3.2"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/d3-drag`
# Summary
This package contains type definitions for D3JS d3-drag module (https://github.com/d3/d3-drag/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-drag/v1.
### Additional Details
* Last updated: Wed, 30 Sep 2020 21:08:21 GMT
* Dependencies: [@types/d3-selection](https://npmjs.com/package/@types/d3-selection)
* Global values: none
# Credits
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), and [Nathan Bierema](https://github.com/Methuselah96).

View File

@ -1,406 +0,0 @@
// Type definitions for D3JS d3-drag module 1.2
// Project: https://github.com/d3/d3-drag/, https://d3js.org/d3-drag
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>
// Alex Ford <https://github.com/gustavderdrache>
// Boris Yankov <https://github.com/borisyankov>
// Nathan Bierema <https://github.com/Methuselah96>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// Last module patch version validated against: 1.2.5
import { Selection, ValueFn } from 'd3-selection';
// --------------------------------------------------------------------------
// Shared Type Definitions and Interfaces
// --------------------------------------------------------------------------
/**
* DraggedElementBaseType serves as an alias for the 'minimal' data type which can be selected
* without 'd3-drag' (and related code in 'd3-selection') trying to use properties internally which would otherwise not
* be supported.
*/
export type DraggedElementBaseType = Element;
/**
* Container element type usable for mouse/touch functions
*/
export type DragContainerElement = HTMLElement | SVGSVGElement | SVGGElement; // HTMLElement includes HTMLCanvasElement
/**
* The subject datum should at a minimum expose x and y properties, so that the relative position
* of the subject and the pointer can be preserved during the drag gesture.
*/
export interface SubjectPosition {
/**
* x-coordinate
*/
x: number;
/**
* y-coordinate
*/
y: number;
}
/**
* A D3 Drag Behavior
*
* The first generic refers to the type of element to be dragged.
* The second generic refers to the type of the datum of the dragged element.
* The third generic refers to the type of the drag behavior subject.
*
* The subject of a drag gesture represents the thing being dragged.
* It is computed when an initiating input event is received,
* such as a mousedown or touchstart, immediately before the drag gesture starts.
* The subject is then exposed as event.subject on subsequent drag events for this gesture.
*
* The default subject is the datum of the element in the originating selection (see drag)
* that received the initiating input event; if this datum is undefined,
* an object representing the coordinates of the pointer is created.
* When dragging circle elements in SVG, the default subject is thus the datum of the circle being dragged.
* With Canvas, the default subject is the canvas elements datum (regardless of where on the canvas you click).
* In this case, a custom subject accessor would be more appropriate,
* such as one that picks the closest circle to the mouse within a given search radius.
*/
export interface DragBehavior<GElement extends DraggedElementBaseType, Datum, Subject> extends Function {
/**
* Applies the drag behavior to the selected elements.
* This function is typically not invoked directly, and is instead invoked via selection.call.
*
* For details see: {@link https://github.com/d3/d3-drag#_drag}
*
* @param selection A D3 selection of elements.
* @param args Optional arguments to be passed in.
*/
(selection: Selection<GElement, Datum, any, any>, ...args: any[]): void;
/**
* Returns the current container accessor function.
*/
container(): ValueFn<GElement, Datum, DragContainerElement>;
/**
* Sets the container accessor to the specified function and returns the drag behavior.
*
* The container of a drag gesture determines the coordinate system of subsequent drag events,
* affecting event.x and event.y. The element returned by the container accessor is subsequently
* passed to d3.mouse or d3.touch, as appropriate, to determine the local coordinates of the pointer.
*
* The default container accessor returns the parent node of the element in the originating selection (see drag)
* that received the initiating input event. This is often appropriate when dragging SVG or HTML elements,
* since those elements are typically positioned relative to a parent. For dragging graphical elements with a Canvas,
* however, you may want to redefine the container as the initiating element itself, using "this" in the accessor
* function.
*
* @param accessor A container accessor function which is evaluated for each selected element,
* in order, being passed the current datum (d), the current index (i), and the current group (nodes),
* with this as the current DOM element. The function returns the container element.
*/
container(accessor: ValueFn<GElement, Datum, DragContainerElement>): this;
/**
* Sets the container accessor to the specified object and returns the drag behavior.
*
* The container of a drag gesture determines the coordinate system of subsequent drag events,
* affecting event.x and event.y. The element returned by the container accessor is subsequently
* passed to d3.mouse or d3.touch, as appropriate, to determine the local coordinates of the pointer.
*
* The default container accessor returns the parent node of the element in the originating selection (see drag)
* that received the initiating input event. This is often appropriate when dragging SVG or HTML elements,
* since those elements are typically positioned relative to a parent. For dragging graphical elements with a Canvas,
* however, you may want to redefine the container as the initiating element itself, such as drag.container(canvas).
*
* @param container Container element for the drag gesture.
*/
container(container: DragContainerElement): this;
/**
* Returns the current filter function.
*/
filter(): ValueFn<GElement, Datum, boolean>;
/**
* Sets the filter to the specified filter function and returns the drag behavior.
*
* If the filter returns falsey, the initiating event is ignored and no drag gesture is started.
* Thus, the filter determines which input events are ignored. The default filter ignores mousedown events on secondary buttons,
* since those buttons are typically intended for other purposes, such as the context menu.
*
* @param filterFn A filter function which is evaluated for each selected element,
* in order, being passed the current datum (d), the current index (i), and the current group (nodes),
* with this as the current DOM element. The function returns a boolean value.
*/
filter(filterFn: ValueFn<GElement, Datum, boolean>): this;
/**
* Returns the current touch support detector, which defaults to a function returning true,
* if the "ontouchstart" event is supported on the current element.
*/
touchable(): ValueFn<GElement, Datum, boolean>;
/**
* Sets the touch support detector to the specified boolean value and returns the drag behavior.
*
* Touch event listeners are only registered if the detector returns truthy for the corresponding element when the drag behavior is applied.
* The default detector works well for most browsers that are capable of touch input, but not all; Chromes mobile device emulator, for example,
* fails detection.
*
* @param touchable A boolean value. true when touch event listeners should be applied to the corresponding element, otherwise false.
*/
touchable(touchable: boolean): this;
/**
* Sets the touch support detector to the specified function and returns the drag behavior.
*
* Touch event listeners are only registered if the detector returns truthy for the corresponding element when the drag behavior is applied.
* The default detector works well for most browsers that are capable of touch input, but not all; Chromes mobile device emulator, for example,
* fails detection.
*
* @param touchable A touch support detector function, which returns true when touch event listeners should be applied to the corresponding element.
* The function is evaluated for each selected element to which the drag behavior was applied, in order, being passed the current datum (d),
* the current index (i), and the current group (nodes), with this as the current DOM element. The function returns a boolean value.
*/
touchable(touchable: ValueFn<GElement, Datum, boolean>): this;
/**
* Returns the current subject accessor functions.
*/
subject(): ValueFn<GElement, Datum, Subject>;
/**
* Sets the subject accessor to the specified function and returns the drag behavior.
*
* The subject of a drag gesture represents the thing being dragged.
* It is computed when an initiating input event is received,
* such as a mousedown or touchstart, immediately before the drag gesture starts.
* The subject is then exposed as event.subject on subsequent drag events for this gesture.
*
* The default subject is the datum of the element in the originating selection (see drag)
* that received the initiating input event; if this datum is undefined,
* an object representing the coordinates of the pointer is created.
* When dragging circle elements in SVG, the default subject is thus the datum of the circle being dragged.
* With Canvas, the default subject is the canvas elements datum (regardless of where on the canvas you click).
* In this case, a custom subject accessor would be more appropriate,
* such as one that picks the closest circle to the mouse within a given search radius.
*
*
*
* The subject of a drag gesture may not be changed after the gesture starts.
*
* During the evaluation of the subject accessor, d3.event is a beforestart drag event.
* Use event.sourceEvent to access the initiating input event and event.identifier to
* access the touch identifier. The event.x and event.y are relative to the container,
* and are computed using d3.mouse or d3.touch as appropriate.
*
* @param accessor An extent accessor function which is evaluated for each selected element,
* in order, being passed the current datum (d), the current index (i), and the current group (nodes),
* with this as the current DOM element.The returned subject should be an object that exposes x and y properties,
* so that the relative position of the subject and the pointer can be preserved during the drag gesture.
* If the subject is null or undefined, no drag gesture is started for this pointer;
* however, other starting touches may yet start drag gestures.
*/
subject(accessor: ValueFn<GElement, Datum, Subject>): this;
/**
* Return the current click distance threshold, which defaults to zero.
*/
clickDistance(): number;
/**
* Set the maximum distance that the mouse can move between mousedown and mouseup that will trigger
* a subsequent click event. If at any point between mousedown and mouseup the mouse is greater than or equal to
* distance from its position on mousedown, the click event following mouseup will be suppressed.
*
* @param distance The distance threshold between mousedown and mouseup measured in client coordinates (event.clientX and event.clientY).
* The default is zero.
*/
clickDistance(distance: number): this;
/**
* Return the first currently-assigned listener matching the specified typenames, if any.
*
* @param typenames The typenames is a string containing one or more typename separated by whitespace.
* Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar";
* the name allows multiple listeners to be registered for the same type. The type must be one of the following:
* start (after a new pointer becomes active [on mousedown or touchstart]), drag (after an active pointer moves [on mousemove or touchmove], or
* end (after an active pointer becomes inactive [on mouseup, touchend or touchcancel].)
*/
on(typenames: string): ValueFn<GElement, Datum, void> | undefined;
/**
* Remove the current event listeners for the specified typenames, if any, return the drag behavior.
*
* @param typenames The typenames is a string containing one or more typename separated by whitespace.
* Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar";
* the name allows multiple listeners to be registered for the same type. The type must be one of the following:
* start (after a new pointer becomes active [on mousedown or touchstart]), drag (after an active pointer moves [on mousemove or touchmove], or
* end (after an active pointer becomes inactive [on mouseup, touchend or touchcancel].)
* @param listener Use null to remove the listener.
*/
on(typenames: string, listener: null): this;
/**
* Set the event listener for the specified typenames and return the drag behavior.
* If an event listener was already registered for the same type and name,
* the existing listener is removed before the new listener is added.
* When a specified event is dispatched, each listener will be invoked with the same context and arguments as selection.on listeners.
*
* Changes to registered listeners via drag.on during a drag gesture do not affect the current drag gesture.
* Instead, you must use event.on, which also allows you to register temporary event listeners for the current drag gesture.
* Separate events are dispatched for each active pointer during a drag gesture.
* For example, if simultaneously dragging multiple subjects with multiple fingers, a start event is dispatched for each finger,
* even if both fingers start touching simultaneously.
*
* @param typenames The typenames is a string containing one or more typename separated by whitespace.
* Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar";
* the name allows multiple listeners to be registered for the same type. The type must be one of the following:
* start (after a new pointer becomes active [on mousedown or touchstart]), drag (after an active pointer moves [on mousemove or touchmove], or
* end (after an active pointer becomes inactive [on mouseup, touchend or touchcancel].)
* @param listener An event listener function which is evaluated for each selected element,
* in order, being passed the current datum (d), the current index (i), and the current group (nodes),
* with this as the current DOM element.
*/
on(typenames: string, listener: ValueFn<GElement, Datum, void>): this;
}
/**
* Creates a new drag behavior. The returned behavior, drag, is both an object and a function, and is
* typically applied to selected elements via selection.call.
*
* Use this signature when using the default subject accessor.
*
* The first generic refers to the type of element to be dragged.
* The second generic refers to the type of the datum of the dragged element.
*/
export function drag<GElement extends DraggedElementBaseType, Datum>(): DragBehavior<GElement, Datum, Datum | SubjectPosition>;
/**
* Creates a new drag behavior. The returned behavior, drag, is both an object and a function, and is
* typically applied to selected elements via selection.call.
*
* Use this signature when using a custom subject accessor.
*
* The first generic refers to the type of element to be dragged.
* The second generic refers to the type of the datum of the dragged element.
* The third generic refers to the type of the drag behavior subject.
*/
export function drag<GElement extends DraggedElementBaseType, Datum, Subject>(): DragBehavior<GElement, Datum, Subject>;
/**
* D3 Drag event
*
* The first generic refers to the type of element to be dragged.
* The second generic refers to the type of the datum of the dragged element.
* The third generic refers to the type of the drag behavior subject.
*/
export interface D3DragEvent<GElement extends DraggedElementBaseType, Datum, Subject> {
/**
* The DragBehavior associated with the event
*/
target: DragBehavior<GElement, Datum, Subject>;
/**
* The event type for the DragEvent
*/
type: 'start' | 'drag' | 'end' | string; // Leave failsafe string type for cases like 'drag.foo'
/**
* The drag subject, defined by drag.subject.
*/
subject: Subject;
/**
* The new x-coordinate of the subject, relative to the container
*/
x: number;
/**
* The new y-coordinate of the subject, relative to the container
*/
y: number;
/**
* The change in x-coordinate since the previous drag event.
*/
dx: number;
/**
* The change in y-coordinate since the previous drag event.
*/
dy: number;
/**
* The string mouse, or a numeric touch identifier.
*/
identifier: 'mouse' | number;
/**
* The number of currently active drag gestures (on start and end, not including this one).
*
* The event.active field is useful for detecting the first start event and the last end event
* in a sequence of concurrent drag gestures: it is zero when the first drag gesture starts,
* and zero when the last drag gesture ends.
*/
active: number;
/**
* The underlying input event, such as mousemove or touchmove.
*/
sourceEvent: any;
/**
* Return the first currently-assigned listener matching the specified typenames, if any.
*
* Equivalent to drag.on, but only applies to the current drag gesture. Before the drag gesture starts,
* a copy of the current drag event listeners is made. This copy is bound to the current drag gesture
* and modified by event.on. This is useful for temporary listeners that only receive events for the current drag gesture.
*
* @param typenames The typenames is a string containing one or more typename separated by whitespace.
* Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar";
* the name allows multiple listeners to be registered for the same type. The type must be one of the following:
* start (after a new pointer becomes active [on mousedown or touchstart]), drag (after an active pointer moves [on mousemove or touchmove], or
* end (after an active pointer becomes inactive [on mouseup, touchend or touchcancel].)
*/
on(typenames: string): ValueFn<GElement, Datum, void> | undefined;
/**
* Remove the current event listeners for the specified typenames, if any, return the drag behavior.
*
* Equivalent to drag.on, but only applies to the current drag gesture. Before the drag gesture starts,
* a copy of the current drag event listeners is made. This copy is bound to the current drag gesture
* and modified by event.on. This is useful for temporary listeners that only receive events for the current drag gesture.
*
* @param typenames The typenames is a string containing one or more typename separated by whitespace.
* Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar";
* the name allows multiple listeners to be registered for the same type. The type must be one of the following:
* start (after a new pointer becomes active [on mousedown or touchstart]), drag (after an active pointer moves [on mousemove or touchmove], or
* end (after an active pointer becomes inactive [on mouseup, touchend or touchcancel].)
* @param listener Use null to remove the listener.
*/
on(typenames: string, listener: null): this;
/**
* Set the event listener for the specified typenames and return the drag behavior.
* If an event listener was already registered for the same type and name,
* the existing listener is removed before the new listener is added.
* When a specified event is dispatched, each listener will be invoked with the same context and arguments as selection.on listeners.
*
* Equivalent to drag.on, but only applies to the current drag gesture. Before the drag gesture starts,
* a copy of the current drag event listeners is made. This copy is bound to the current drag gesture
* and modified by event.on. This is useful for temporary listeners that only receive events for the current drag gesture.
*
* @param typenames The typenames is a string containing one or more typename separated by whitespace.
* Each typename is a type, optionally followed by a period (.) and a name, such as "drag.foo"" and "drag.bar";
* the name allows multiple listeners to be registered for the same type. The type must be one of the following:
* start (after a new pointer becomes active [on mousedown or touchstart]), drag (after an active pointer moves [on mousemove or touchmove], or
* end (after an active pointer becomes inactive [on mouseup, touchend or touchcancel].)
* @param listener An event listener function which is evaluated for each selected element,
* in order, being passed the current datum (d), the current index (i), and the current group (nodes),
* with this as the current DOM element.
*/
on(typenames: string, listener: ValueFn<GElement, Datum, void>): this;
}
/**
* Prevents native drag-and-drop and text selection on the specified window.
* As an alternative to preventing the default action of mousedown events,
* this method prevents undesirable default actions following mousedown. In supported browsers,
* this means capturing dragstart and selectstart events, preventing the associated default actions,
* and immediately stopping their propagation. In browsers that do not support selection events,
* the user-select CSS property is set to none on the document element.
* This method is intended to be called on mousedown, followed by d3.dragEnable on mouseup.
*
* @param window The window for which drag should be disabled.
*/
export function dragDisable(window: Window): void;
/**
* Allows native drag-and-drop and text selection on the specified window; undoes the effect of d3.dragDisable.
* This method is intended to be called on mouseup, preceded by d3.dragDisable on mousedown.
* If noclick is true, this method also temporarily suppresses click events.
* The suppression of click events expires after a zero-millisecond timeout,
* such that it only suppress the click event that would immediately follow the current mouseup event, if any.
*
* @param window The window for which drag should be (re-)enabled.
* @param noClick An optional flag. If noclick is true, this method also temporarily suppresses click events.
*/
export function dragEnable(window: Window, noClick?: boolean): void;

View File

@ -1,41 +0,0 @@
{
"name": "@types/d3-drag",
"version": "1.2.5",
"description": "TypeScript definitions for D3JS d3-drag module",
"license": "MIT",
"contributors": [
{
"name": "Tom Wanzek",
"url": "https://github.com/tomwanzek",
"githubUsername": "tomwanzek"
},
{
"name": "Alex Ford",
"url": "https://github.com/gustavderdrache",
"githubUsername": "gustavderdrache"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov",
"githubUsername": "borisyankov"
},
{
"name": "Nathan Bierema",
"url": "https://github.com/Methuselah96",
"githubUsername": "Methuselah96"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/d3-drag"
},
"scripts": {},
"dependencies": {
"@types/d3-selection": "^1"
},
"typesPublisherContentHash": "5a720db904c003be82bed71ead495e3c5247e5b6f6556236d615afcc0ecd40ed",
"typeScriptVersion": "3.2"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/d3-dsv`
# Summary
This package contains type definitions for D3JS d3-dsv module (https://github.com/d3/d3-dsv/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-dsv/v1.
### Additional Details
* Last updated: Thu, 01 Oct 2020 04:14:56 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), and [Nathan Bierema](https://github.com/Methuselah96).

View File

@ -1,483 +0,0 @@
// Type definitions for D3JS d3-dsv module 1.2
// Project: https://github.com/d3/d3-dsv/, https://d3js.org/d3-dsv
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>
// Alex Ford <https://github.com/gustavderdrache>
// Boris Yankov <https://github.com/borisyankov>
// denisname <https://github.com/denisname>
// Nathan Bierema <https://github.com/Methuselah96>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// Last module patch version validated against: 1.2.0
// ------------------------------------------------------------------------------------------
// Shared Types and Interfaces
// ------------------------------------------------------------------------------------------
/**
* An object representing a DSV parsed row with values represented as strings.
* When the DSV content is not well-structured and some column-values are missing, `undefined` is used as value.
*/
export type DSVRowString<Columns extends string = string> = {
[key in Columns]: string | undefined;
};
/**
* An object in raw format before parsing, that is with only string values.
* When the DSV content is not well-structured and some column-values are missing, `undefined` is used as value.
*/
export type DSVRaw<T extends object> = {
[key in keyof T]: string | undefined;
};
/**
* An object representing a DSV parsed row with values represented as an arbitrary datatype, depending
* on the performed parsed row mapping.
*
* @deprecated Use `object` instead.
*/
export interface DSVRowAny {
[key: string]: any;
}
/**
* An array object representing all deserialized rows. The array is enhanced with a property listing
* the names of the parsed columns.
*/
export interface DSVRowArray<Columns extends string = string> extends Array<DSVRowString<Columns>> {
/**
* List of column names.
*/
columns: Columns[];
}
/**
* An array object representing all parsed rows. The array is enhanced with a property listing
* the names of the parsed columns.
*/
export interface DSVParsedArray<T> extends Array<T> {
/**
* List of column names.
*/
columns: Array<keyof T>;
}
// ------------------------------------------------------------------------------------------
// CSV Parsers and Formatters
// ------------------------------------------------------------------------------------------
// csvParse(...) ============================================================================
/**
* Parses the specified string, which must be in the comma-separated values format, returning an array of objects representing the parsed rows.
*
* Unlike csvParseRows, this method requires that the first line of the CSV content contains a comma-separated list of column names;
* these column names become the attributes on the returned objects.
*
* The returned array also exposes a columns property containing the column names in input order (in contrast to Object.keys, whose iteration order is arbitrary).
*
* Equivalent to `dsvFormat(",").parse`.
*
* @param csvString A string, which must be in the comma-separated values format.
*/
// tslint:disable-next-line:no-unnecessary-generics
export function csvParse<Columns extends string>(csvString: string): DSVRowArray<Columns>;
/**
* Parses the specified string, which must be in the comma-separated values format, returning an array of objects representing the parsed rows.
*
* Unlike csvParseRows, this method requires that the first line of the CSV content contains a comma-separated list of column names;
* these column names become the attributes on the returned objects.
*
* The returned array also exposes a columns property containing the column names in input order (in contrast to Object.keys, whose iteration order is arbitrary).
*
* Equivalent to `dsvFormat(",").parse`.
*
* @param csvString A string, which must be in the comma-separated values format.
* @param row A row conversion function which is invoked for each row, being passed an object representing the current row (d),
* the index (i) starting at zero for the first non-header row, and the array of column names. If the returned value is null or undefined,
* the row is skipped and will be omitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object.
* In effect, row is similar to applying a map and filter operator to the returned rows.
*/
export function csvParse<ParsedRow extends object, Columns extends string>(
csvString: string,
row: (rawRow: DSVRowString<Columns>, index: number, columns: Columns[]) => ParsedRow | undefined | null
): DSVParsedArray<ParsedRow>;
// csvParseRows(...) ========================================================================
/**
* Parses the specified string, which must be in the comma-separated values format, returning an array of arrays representing the parsed rows.
*
* Unlike csvParse, this method treats the header line as a standard row, and should be used whenever CSV content does not contain a header.
* Each row is represented as an array rather than an object. Rows may have variable length.
*
* If a row conversion function is not specified, field values are strings. For safety, there is no automatic conversion to numbers, dates, or other types.
* In some cases, JavaScript may coerce strings to numbers for you automatically (for example, using the + operator), but better is to specify a row conversion function.
*
* Equivalent to `dsvFormat(",").parseRows`.
*
* @param csvString A string, which must be in the comma-separated values format.
*/
export function csvParseRows(csvString: string): string[][];
/**
* Parses the specified string, which must be in the comma-separated values format, returning an array of arrays representing the parsed rows.
*
* Unlike csvParse, this method treats the header line as a standard row, and should be used whenever CSV content does not contain a header.
* Each row is represented as an array rather than an object. Rows may have variable length.
*
* Equivalent to `dsvFormat(",").parseRows`.
*
* @param csvString A string, which must be in the comma-separated values format.
* @param row A row conversion function which is invoked for each row, being passed an array representing the current row (d), the index (i)
* starting at zero for the first row, and the array of column names. If the returned value is null or undefined,
* the row is skipped and will be omitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object.
* In effect, row is similar to applying a map and filter operator to the returned rows.
*/
export function csvParseRows<ParsedRow extends object>(
csvString: string,
row: (rawRow: string[], index: number) => ParsedRow | undefined | null
): ParsedRow[];
// csvFormat(...) ============================================================================
/**
* Formats the specified array of object rows as comma-separated values, returning a string.
* This operation is the inverse of csvParse. Each row will be separated by a newline (\n),
* and each column within each row will be separated by the comma-delimiter.
* Values that contain either the comma-delimiter, a double-quote (") or a newline will be escaped using double-quotes.
*
* If columns is not specified, the list of column names that forms the header row is determined by the union of all properties on all objects in rows;
* the order of columns is nondeterministic.
*
* Equivalent to `dsvFormat(",").format`.
*
* @param rows Array of object rows.
* @param columns An array of strings representing the column names.
*/
export function csvFormat<T extends object>(rows: T[], columns?: Array<keyof T>): string;
// csvFormatBody(...) ============================================================================
/**
* Equivalent to dsvFormat(",").formatBody.
*
* @param rows Array of object rows.
* @param columns An array of strings representing the column names.
*/
export function csvFormatBody<T extends object>(rows: T[], columns?: Array<keyof T>): string;
// csvFormatRows(...) ========================================================================
/**
* Formats the specified array of array of string rows as comma-separated values, returning a string.
* This operation is the reverse of csvParseRows. Each row will be separated by a newline (\n),
* and each column within each row will be separated by the comma-delimiter.
* Values that contain either the comma-delimiter, a double-quote (") or a newline will be escaped using double-quotes.
*
* To convert an array of objects to an array of arrays while explicitly specifying the columns, use array.map.
* If you like, you can also array.concat this result with an array of column names to generate the first row.
*
* Equivalent to `dsvFormat(",").formatRows`.
*
* @param rows An array of array of string rows.
*/
export function csvFormatRows(rows: string[][]): string;
// csvFormatRow(...) ========================================================================
/**
* Equivalent to dsvFormat(",").formatRow.
*
* @param row An array of strings representing a row.
*/
export function csvFormatRow(row: string[]): string;
// csvFormatValue(...) ========================================================================
/**
* Equivalent to dsvFormat(",").formatValue.
*
* @param value A value.
*/
export function csvFormatValue(value: string): string;
// ------------------------------------------------------------------------------------------
// TSV Parsers and Formatters
// ------------------------------------------------------------------------------------------
// tsvParse(...) ============================================================================
/**
* Parses the specified string, which must be in the tab-separated values format, returning an array of objects representing the parsed rows.
*
* Unlike tsvParseRows, this method requires that the first line of the TSV content contains a tab-separated list of column names;
* these column names become the attributes on the returned objects.
*
* The returned array also exposes a columns property containing the column names in input order (in contrast to Object.keys, whose iteration order is arbitrary).
*
* Equivalent to `dsvFormat("\t").parse`.
*
* @param tsvString A string, which must be in the tab-separated values format.
*/
// tslint:disable-next-line:no-unnecessary-generics
export function tsvParse<Columns extends string>(tsvString: string): DSVRowArray<Columns>;
/**
* Parses the specified string, which must be in the tab-separated values format, returning an array of objects representing the parsed rows.
*
* Unlike tsvParseRows, this method requires that the first line of the TSV content contains a tab-separated list of column names;
* these column names become the attributes on the returned objects.
*
* The returned array also exposes a columns property containing the column names in input order (in contrast to Object.keys, whose iteration order is arbitrary).
*
* Equivalent to `dsvFormat("\t").parse`.
*
* @param tsvString A string, which must be in the tab-separated values format.
* @param row A row conversion function which is invoked for each row, being passed an object representing the current row (d),
* the index (i) starting at zero for the first non-header row, and the array of column names. If the returned value is null or undefined,
* the row is skipped and will be omitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object.
* In effect, row is similar to applying a map and filter operator to the returned rows.
*/
export function tsvParse<ParsedRow extends object, Columns extends string>(
tsvString: string,
row: (rawRow: DSVRowString<Columns>, index: number, columns: Columns[]) => ParsedRow | undefined | null
): DSVParsedArray<ParsedRow>;
// tsvParseRows(...) ========================================================================
/**
* Parses the specified string, which must be in the tab-separated values format, returning an array of arrays representing the parsed rows.
*
* Unlike tsvParse, this method treats the header line as a standard row, and should be used whenever TSV content does not contain a header.
* Each row is represented as an array rather than an object. Rows may have variable length.
*
* If a row conversion function is not specified, field values are strings. For safety, there is no automatic conversion to numbers, dates, or other types.
* In some cases, JavaScript may coerce strings to numbers for you automatically (for example, using the + operator), but better is to specify a row conversion function.
*
* Equivalent to `dsvFormat("\t").parseRows`.
*
* @param tsvString A string, which must be in the tab-separated values format.
*/
export function tsvParseRows(tsvString: string): string[][];
/**
* Parses the specified string, which must be in the tab-separated values format, returning an array of arrays representing the parsed rows.
*
* Unlike tsvParse, this method treats the header line as a standard row, and should be used whenever TSV content does not contain a header.
* Each row is represented as an array rather than an object. Rows may have variable length.
*
* Equivalent to `dsvFormat("\t").parseRows`.
*
* @param tsvString A string, which must be in the tab-separated values format.
* @param row A row conversion function which is invoked for each row, being passed an array representing the current row (d), the index (i)
* starting at zero for the first row, and the array of column names. If the returned value is null or undefined,
* the row is skipped and will be omitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object.
* In effect, row is similar to applying a map and filter operator to the returned rows.
*/
export function tsvParseRows<ParsedRow extends object>(
tsvString: string,
row: (rawRow: string[], index: number) => ParsedRow | undefined | null
): ParsedRow[];
// tsvFormat(...) ============================================================================
/**
* Formats the specified array of object rows as tab-separated values, returning a string.
* This operation is the inverse of tsvParse. Each row will be separated by a newline (\n),
* and each column within each row will be separated by the tab-delimiter.
* Values that contain either the tab-delimiter, a double-quote (") or a newline will be escaped using double-quotes.
*
* If columns is not specified, the list of column names that forms the header row is determined by the union of all properties on all objects in rows;
* the order of columns is nondeterministic.
*
* Equivalent to `dsvFormat("\t").format`.
*
* @param rows Array of object rows.
* @param columns An array of strings representing the column names.
*/
export function tsvFormat<T extends object>(rows: T[], columns?: Array<keyof T>): string;
// tsvFormatBody(...) ============================================================================
/**
* Equivalent to dsvFormat("\t").formatBody.
*
* @param rows Array of object rows.
* @param columns An array of strings representing the column names.
*/
export function tsvFormatBody<T extends object>(rows: T[], columns?: Array<keyof T>): string;
// tsvFormatRows(...) ========================================================================
/**
* Formats the specified array of array of string rows as tab-separated values, returning a string.
* This operation is the reverse of tsvParseRows. Each row will be separated by a newline (\n),
* and each column within each row will be separated by the tab-delimiter.
* Values that contain either the tab-delimiter, a double-quote (") or a newline will be escaped using double-quotes.
*
* To convert an array of objects to an array of arrays while explicitly specifying the columns, use array.map.
* If you like, you can also array.concat this result with an array of column names to generate the first row.
*
* Equivalent to `dsvFormat("\t").formatRows`.
*
* @param rows An array of array of string rows.
*/
export function tsvFormatRows(rows: string[][]): string;
// tsvFormatRow(...) ========================================================================
/**
* Equivalent to dsvFormat("\t").formatRow.
*
* @param row An array of strings representing a row.
*/
export function tsvFormatRow(row: string[]): string;
// tsvFormatValue(...) ========================================================================
/**
* Equivalent to dsvFormat("\t").formatValue.
*
* @param value A value.
*/
export function tsvFormatValue(value: string): string;
// ------------------------------------------------------------------------------------------
// DSV Generalized Parsers and Formatters
// ------------------------------------------------------------------------------------------
/**
* A DSV parser and formatter
*/
export interface DSV {
/**
* Parses the specified string, which must be in the delimiter-separated values format with the appropriate delimiter, returning an array of objects representing the parsed rows.
*
* Unlike dsv.parseRows, this method requires that the first line of the DSV content contains a delimiter-separated list of column names;
* these column names become the attributes on the returned objects.
*
* The returned array also exposes a columns property containing the column names in input order (in contrast to Object.keys, whose iteration order is arbitrary).
*
* @param dsvString A string, which must be in the delimiter-separated values format with the appropriate delimiter.
*/
// tslint:disable-next-line:no-unnecessary-generics
parse<Columns extends string>(dsvString: string): DSVRowArray<Columns>;
/**
* Parses the specified string, which must be in the delimiter-separated values format with the appropriate delimiter, returning an array of objects representing the parsed rows.
*
* Unlike dsv.parseRows, this method requires that the first line of the DSV content contains a delimiter-separated list of column names;
* these column names become the attributes on the returned objects.
*
* The returned array also exposes a columns property containing the column names in input order (in contrast to Object.keys, whose iteration order is arbitrary).
*
* @param dsvString A string, which must be in the delimiter-separated values format with the appropriate delimiter.
* @param row A row conversion function which is invoked for each row, being passed an object representing the current row (d),
* the index (i) starting at zero for the first non-header row, and the array of column names. If the returned value is null or undefined,
* the row is skipped and will be omitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object.
* In effect, row is similar to applying a map and filter operator to the returned rows.
*/
parse<ParsedRow extends object, Columns extends string>(
dsvString: string,
row: (rawRow: DSVRowString<Columns>, index: number, columns: Columns[]) => ParsedRow | undefined | null
): DSVParsedArray<ParsedRow>;
/**
* Parses the specified string, which must be in the delimiter-separated values format with the appropriate delimiter, returning an array of arrays representing the parsed rows.
*
* Unlike dsv.parse, this method treats the header line as a standard row, and should be used whenever DSV content does not contain a header.
* Each row is represented as an array rather than an object. Rows may have variable length.
*
* If a row conversion function is not specified, field values are strings. For safety, there is no automatic conversion to numbers, dates, or other types.
* In some cases, JavaScript may coerce strings to numbers for you automatically (for example, using the + operator), but better is to specify a row conversion function.
*
* @param dsvString A string, which must be in the delimiter-separated values format with the appropriate delimiter.
*/
parseRows(dsvString: string): string[][];
/**
* Parses the specified string, which must be in the delimiter-separated values format with the appropriate delimiter, returning an array of arrays representing the parsed rows.
*
* Unlike dsv.parse, this method treats the header line as a standard row, and should be used whenever DSV content does not contain a header.
* Each row is represented as an array rather than an object. Rows may have variable length.
*
* @param dsvString A string, which must be in the delimiter-separated values format with the appropriate delimiter.
* @param row A row conversion function which is invoked for each row, being passed an array representing the current row (d), the index (i)
* starting at zero for the first row, and the array of column names. If the returned value is null or undefined,
* the row is skipped and will be omitted from the array returned by dsv.parse; otherwise, the returned value defines the corresponding row object.
* In effect, row is similar to applying a map and filter operator to the returned rows.
*/
parseRows<ParsedRow extends object>(
dsvString: string,
row: (rawRow: string[], index: number) => ParsedRow | undefined | null
): ParsedRow[];
/**
* Formats the specified array of object rows as delimiter-separated values, returning a string.
* This operation is the inverse of dsv.parse. Each row will be separated by a newline (\n),
* and each column within each row will be separated by the delimiter (such as a comma, ,).
* Values that contain either the delimiter, a double-quote (") or a newline will be escaped using double-quotes.
*
* If columns is not specified, the list of column names that forms the header row is determined by the union of all properties on all objects in rows;
* the order of columns is nondeterministic.
*
* @param rows Array of object rows.
* @param columns An array of strings representing the column names.
*/
format<T extends object>(rows: T[], columns?: Array<keyof T>): string;
/**
* Equivalent to dsv.format, but omits the header row.
* This is useful, for example, when appending rows to an existing file.
*
* @param rows Array of object rows.
* @param columns An array of strings representing the column names.
*/
formatBody<T extends object>(rows: T[], columns?: Array<keyof T>): string;
/**
* Formats the specified array of array of string rows as delimiter-separated values, returning a string.
* This operation is the reverse of dsv.parseRows. Each row will be separated by a newline (\n),
* and each column within each row will be separated by the delimiter (such as a comma, ,).
* Values that contain either the delimiter, a double-quote (") or a newline will be escaped using double-quotes.
*
* To convert an array of objects to an array of arrays while explicitly specifying the columns, use array.map.
* If you like, you can also array.concat this result with an array of column names to generate the first row.
*
* @param rows An array of array of string rows.
*/
formatRows(rows: string[][]): string;
/**
* Formats a single array row of strings as delimiter-separated values, returning a string.
* Each column within the row will be separated by the delimiter (such as a comma, ,).
* Values that contain either the delimiter, a double-quote (") or a newline will be escaped using double-quotes.
*
* @param row An array of strings representing a row.
*/
formatRow(row: string[]): string;
/**
* Format a single value or string as a delimiter-separated value, returning a string.
* A value that contains either the delimiter, a double-quote (") or a newline will be escaped using double-quotes.
*
* @param value A value.
*/
formatValue(value: string): string;
}
/**
* Constructs a new DSV parser and formatter for the specified delimiter.
*
* @param delimiter A delimiter character. The delimiter must be a single character (i.e., a single 16-bit code unit);
* so, ASCII delimiters are fine, but emoji delimiters are not.
*/
export function dsvFormat(delimiter: string): DSV;
/**
* Infers the types of values on the object and coerces them accordingly, returning the mutated object.
* This function is intended to be used as a row accessor function in conjunction with dsv.parse and dsv.parseRows.
*
* @param object An object (or array) representing a parsed row
*/
export function autoType<ParsedRow extends object | undefined | null, Columns extends string>(
// tslint:disable-next-line:no-unnecessary-generics
object: DSVRowString<Columns> | string[]
// tslint:disable-next-line:no-unnecessary-generics
): ParsedRow;

View File

@ -1,44 +0,0 @@
{
"name": "@types/d3-dsv",
"version": "1.2.1",
"description": "TypeScript definitions for D3JS d3-dsv module",
"license": "MIT",
"contributors": [
{
"name": "Tom Wanzek",
"url": "https://github.com/tomwanzek",
"githubUsername": "tomwanzek"
},
{
"name": "Alex Ford",
"url": "https://github.com/gustavderdrache",
"githubUsername": "gustavderdrache"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov",
"githubUsername": "borisyankov"
},
{
"name": "denisname",
"url": "https://github.com/denisname",
"githubUsername": "denisname"
},
{
"name": "Nathan Bierema",
"url": "https://github.com/Methuselah96",
"githubUsername": "Methuselah96"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/d3-dsv"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "7f3152d2dc9fb70617c80b224b42a658272ddb4b1421272a481949d378fcac98",
"typeScriptVersion": "3.2"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/d3-ease`
# Summary
This package contains type definitions for D3JS d3-ease module (https://github.com/d3/d3-ease/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-ease/v1.
### Additional Details
* Last updated: Thu, 23 Dec 2021 23:34:27 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), and [Boris Yankov](https://github.com/borisyankov).

View File

@ -1,323 +0,0 @@
// Type definitions for D3JS d3-ease module 1.0
// Project: https://github.com/d3/d3-ease/, https://d3js.org/d3-ease
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>
// Alex Ford <https://github.com/gustavderdrache>
// Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Last module patch version validated against: 1.0.7
// --------------------------------------------------------------------------
// Easing Functions
// --------------------------------------------------------------------------
/**
* Linear easing; the identity function; linear(t) returns t.
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeLinear(normalizedTime: number): number;
/**
* Symmetric quadratic easing; scales quadIn for t in [0, 0.5] and quadOut for t in [0.5, 1]. Also equivalent to poly.exponent(2).
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeQuad(normalizedTime: number): number;
/**
* Quadratic easing; equivalent to polyIn.exponent(2).
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeQuadIn(normalizedTime: number): number;
/**
* Reverse quadratic easing; equivalent to 1 - quadIn(1 - t). Also equivalent to polyOut.exponent(2).
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeQuadOut(normalizedTime: number): number;
/**
* Symmetric quadratic easing; scales quadIn for t in [0, 0.5] and quadOut for t in [0.5, 1]. Also equivalent to poly.exponent(2).
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeQuadInOut(normalizedTime: number): number;
/**
* Symmetric cubic easing; scales cubicIn for t in [0, 0.5] and cubicOut for t in [0.5, 1]. Also equivalent to poly.exponent(3).
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeCubic(normalizedTime: number): number;
/**
* Cubic easing; equivalent to polyIn.exponent(3).
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeCubicIn(normalizedTime: number): number;
/**
* Reverse cubic easing; equivalent to 1 - cubicIn(1 - t). Also equivalent to polyOut.exponent(3).
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeCubicOut(normalizedTime: number): number;
/**
* Symmetric cubic easing; scales cubicIn for t in [0, 0.5] and cubicOut for t in [0.5, 1]. Also equivalent to poly.exponent(3).
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeCubicInOut(normalizedTime: number): number;
/**
* Polynomial easing function factory
*/
export interface PolynomialEasingFactory {
/**
* Calculate eased time.
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
(normalizedTime: number): number;
/**
* Returns a new polynomial easing with the specified exponent e.
* If the exponent is not specified, it defaults to 3, equivalent to cubic.
*
* @param e Exponent for polynomial easing.
*/
exponent(e: number): PolynomialEasingFactory;
}
/**
* Symmetric polynomial easing/easing factory; scales polyIn for t in [0, 0.5] and polyOut for t in [0.5, 1].
* If the exponent is not specified, it defaults to 3, equivalent to cubic.
*/
export const easePoly: PolynomialEasingFactory;
/**
* Polynomial easing/easing factory; raises t to the specified exponent.
* If the exponent is not specified, it defaults to 3, equivalent to cubicIn.
*/
export const easePolyIn: PolynomialEasingFactory;
/**
* Reverse polynomial easing/easing factory; equivalent to 1 - polyIn(1 - t).
* If the exponent is not specified, it defaults to 3, equivalent to cubicOut.
*/
export const easePolyOut: PolynomialEasingFactory;
/**
* Symmetric polynomial easing/easing factory; scales polyIn for t in [0, 0.5] and polyOut for t in [0.5, 1].
* If the exponent is not specified, it defaults to 3, equivalent to cubic.
*/
export const easePolyInOut: PolynomialEasingFactory;
/**
* Symmetric sinusoidal easing; scales sinIn for t in [0, 0.5] and sinOut for t in [0.5, 1].
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeSin(normalizedTime: number): number;
/**
* Sinusoidal easing; returns sin(t).
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeSinIn(normalizedTime: number): number;
/**
* Reverse sinusoidal easing; equivalent to 1 - sinIn(1 - t).
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeSinOut(normalizedTime: number): number;
/**
* Symmetric sinusoidal easing; scales sinIn for t in [0, 0.5] and sinOut for t in [0.5, 1].
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeSinInOut(normalizedTime: number): number;
/**
* Symmetric exponential easing; scales expIn for t in [0, 0.5] and expOut for t in [0.5, 1].
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeExp(normalizedTime: number): number;
/**
* Exponential easing; raises 2 to the exponent 10 * (t - 1).
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeExpIn(normalizedTime: number): number;
/**
* Reverse exponential easing; equivalent to 1 - expIn(1 - t).
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeExpOut(normalizedTime: number): number;
/**
* Symmetric exponential easing; scales expIn for t in [0, 0.5] and expOut for t in [0.5, 1].
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeExpInOut(normalizedTime: number): number;
/**
* Symmetric circular easing; scales circleIn for t in [0, 0.5] and circleOut for t in [0.5, 1].
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeCircle(normalizedTime: number): number;
/**
* Circular easing.
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeCircleIn(normalizedTime: number): number;
/**
* Reverse circular easing; equivalent to 1 - circleIn(1 - t).
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeCircleOut(normalizedTime: number): number;
/**
* Symmetric circular easing; scales circleIn for t in [0, 0.5] and circleOut for t in [0.5, 1].
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeCircleInOut(normalizedTime: number): number;
/**
* Reverse bounce easing; equivalent to 1 - bounceIn(1 - t).
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeBounce(normalizedTime: number): number;
/**
* Bounce easing, like a rubber ball.
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeBounceIn(normalizedTime: number): number;
/**
* Reverse bounce easing; equivalent to 1 - bounceIn(1 - t).
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeBounceOut(normalizedTime: number): number;
/**
* Symmetric bounce easing; scales bounceIn for t in [0, 0.5] and bounceOut for t in [0.5, 1].
*
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
export function easeBounceInOut(normalizedTime: number): number;
/**
* Anticipatory easing function factory
*/
export interface BackEasingFactory {
/**
* Calculate eased time.
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
(normalizedTime: number): number;
/**
* Returns a new back easing with the specified overshoot s.
* The degree of overshoot is configurable; if not specified, it defaults to 1.70158.
*
* @param s Overshoot parameter
*/
overshoot(s: number): BackEasingFactory;
}
/**
* Symmetric anticipatory easing; scales backIn for t in [0, 0.5] and backOut for t in [0.5, 1].
* The degree of overshoot is configurable; it not specified, it defaults to 1.70158.
*/
export const easeBack: BackEasingFactory;
/**
* Anticipatory easing, like a dancer bending their knees before jumping off the floor.
* The degree of overshoot is configurable; it not specified, it defaults to 1.70158.
*/
export const easeBackIn: BackEasingFactory;
/**
* Reverse anticipatory easing; equivalent to 1 - backIn(1 - t).
* The degree of overshoot is configurable; it not specified, it defaults to 1.70158.
*/
export const easeBackOut: BackEasingFactory;
/**
* Symmetric anticipatory easing; scales backIn for t in [0, 0.5] and backOut for t in [0.5, 1].
* The degree of overshoot is configurable; it not specified, it defaults to 1.70158.
*/
export const easeBackInOut: BackEasingFactory;
/**
* Elastic easing function factory
*/
export interface ElasticEasingFactory {
/**
* Calculate eased time.
* @param normalizedTime Normalized time typically in the range [0, 1]
*/
(normalizedTime: number): number;
/**
* Returns a new elastic easing with the specified amplitude a.
* Defaults to 1,if not specified.
*
* @param a Amplitude for elastic easing.
*/
amplitude(a: number): ElasticEasingFactory;
/**
* Returns a new elastic easing with the specified amplitude a.
* Defaults to 0.3,if not specified.
*
* @param p Period for elastic easing.
*/
period(p: number): ElasticEasingFactory;
}
/**
* Reverse elastic easing; equivalent to 1 - elasticIn(1 - t).
* The amplitude and period of the oscillation are configurable;
* if not specified, they default to 1 and 0.3, respectively.
*/
export const easeElastic: ElasticEasingFactory;
/**
* Elastic easing, like a rubber band.
* The amplitude and period of the oscillation are configurable;
* if not specified, they default to 1 and 0.3, respectively.
*/
export const easeElasticIn: ElasticEasingFactory;
/**
* Reverse elastic easing; equivalent to 1 - elasticIn(1 - t).
* The amplitude and period of the oscillation are configurable;
* if not specified, they default to 1 and 0.3, respectively.
*/
export const easeElasticOut: ElasticEasingFactory;
/**
* Symmetric elastic easing; scales elasticIn for t in [0, 0.5] and elasticOut for t in [0.5, 1].
* The amplitude and period of the oscillation are configurable;
* if not specified, they default to 1 and 0.3, respectively.
*/
export const easeElasticInOut: ElasticEasingFactory;

View File

@ -1,35 +0,0 @@
{
"name": "@types/d3-ease",
"version": "1.0.11",
"description": "TypeScript definitions for D3JS d3-ease module",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-ease",
"license": "MIT",
"contributors": [
{
"name": "Tom Wanzek",
"url": "https://github.com/tomwanzek",
"githubUsername": "tomwanzek"
},
{
"name": "Alex Ford",
"url": "https://github.com/gustavderdrache",
"githubUsername": "gustavderdrache"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov",
"githubUsername": "borisyankov"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/d3-ease"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "d7ce0a2ed08d076ffc2374bbe2f610998b8f2f00bd5925582c2a8f6af07644fb",
"typeScriptVersion": "3.8"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/d3-force`
# Summary
This package contains type definitions for D3JS d3-force module (https://github.com/d3/d3-force/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-force/v1.
### Additional Details
* Last updated: Tue, 13 Jul 2021 11:31:27 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), and [Nathan Bierema](https://github.com/Methuselah96).

View File

@ -1,45 +0,0 @@
{
"name": "@types/d3-force",
"version": "1.2.4",
"description": "TypeScript definitions for D3JS d3-force module",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-force",
"license": "MIT",
"contributors": [
{
"name": "Tom Wanzek",
"url": "https://github.com/tomwanzek",
"githubUsername": "tomwanzek"
},
{
"name": "Alex Ford",
"url": "https://github.com/gustavderdrache",
"githubUsername": "gustavderdrache"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov",
"githubUsername": "borisyankov"
},
{
"name": "denisname",
"url": "https://github.com/denisname",
"githubUsername": "denisname"
},
{
"name": "Nathan Bierema",
"url": "https://github.com/Methuselah96",
"githubUsername": "Methuselah96"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/d3-force"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "48ffe9a4f011271c644d63acfa3ee6af564d0826495f288872efdddca76d2162",
"typeScriptVersion": "3.6"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/d3-format`
# Summary
This package contains type definitions for D3JS d3-format module (https://github.com/d3/d3-format/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-format/v1.
### Additional Details
* Last updated: Tue, 06 Jul 2021 20:32:38 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), and [Nathan Bierema](https://github.com/Methuselah96).

View File

@ -1,348 +0,0 @@
// Type definitions for D3JS d3-format module 1.4
// Project: https://github.com/d3/d3-format/, https://d3js.org/d3-format
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>
// Alex Ford <https://github.com/gustavderdrache>
// Boris Yankov <https://github.com/borisyankov>
// denisname <https://github.com/denisname>
// Nathan Bierema <https://github.com/Methuselah96>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Last module patch version validated against: 1.4.5
/**
* Specification of locale to use when creating a new FormatLocaleObject
*/
export interface FormatLocaleDefinition {
/**
* The decimal point (e.g., ".")
*/
decimal: string;
/**
* The group separator (e.g., ","). Note that the thousands property is a misnomer, as\
* the grouping definition allows groups other than thousands.
*/
thousands: string;
/**
* The array of group sizes (e.g., [3]), cycled as needed.
*/
grouping: number[];
/**
* The currency prefix and suffix (e.g., ["$", ""]).
*/
currency: [string, string];
/**
* An optional array of ten strings to replace the numerals 0-9.
*/
numerals?: string[] | undefined;
/**
* An optional symbol to replace the `percent` suffix; the percent suffix (defaults to "%").
*/
percent?: string | undefined;
/**
* Optional; the minus sign (defaults to hyphen-minus, "-").
*/
minus?: string | undefined;
/**
* Optional; the not-a-number value (defaults `"NaN"`).
*/
nan?: string | undefined;
}
/**
* A Format Locale Object
*/
export interface FormatLocaleObject {
/**
* Returns a new format function for the given string specifier. The returned function
* takes a number as the only argument, and returns a string representing the formatted number.
*
* @param specifier A Specifier string.
* @throws Error on invalid format specifier.
*/
format(specifier: string): (n: number | { valueOf(): number }) => string;
/**
* Returns a new format function for the given string specifier. The returned function
* takes a number as the only argument, and returns a string representing the formatted number.
* The returned function will convert values to the units of the appropriate SI prefix for the
* specified numeric reference value before formatting in fixed point notation.
*
* @param specifier A Specifier string.
* @param value The reference value to determine the appropriate SI prefix.
* @throws Error on invalid format specifier.
*/
formatPrefix(specifier: string, value: number): (n: number | { valueOf(): number }) => string;
}
/**
* A Format Specifier
*
* For details see: {@link https://github.com/d3/d3-format#locale_format}
*/
export interface FormatSpecifierObject {
/**
* fill can be any character. The presence of a fill character is signaled by the align character following it.
*/
fill?: string | undefined;
/**
* Alignment used for format, as set by choosing one of the following:
*
* '>' - Forces the field to be right-aligned within the available space. (Default behavior).
* '<' - Forces the field to be left-aligned within the available space.
* '^' - Forces the field to be centered within the available space.
* '=' - Like '>', but with any sign and symbol to the left of any padding.
*/
align?: string | undefined;
/**
* The sign can be:
*
* '-' - nothing for positive and a minus sign for negative. (Default behavior.)
* '+' - a plus sign for positive and a minus sign for negative.
* '(' - nothing for positive and parentheses for negative.
* ' ' (space) - a space for positive and a minus sign for negative.
*
*/
sign?: string | undefined;
/**
* The symbol can be:
*
* '$' - apply currency symbols per the locale definition.
* '#' - for binary, octal, or hexadecimal notation, prefix by 0b, 0o, or 0x, respectively.
* '' (none) - no symbol. (Default behavior.)
*/
symbol?: string | undefined;
/**
* The zero (0) option enables zero-padding; this implicitly sets fill to 0 and align to =.
*/
zero?: string | undefined;
/**
* The width defines the minimum field width;
* if not specified, then the width will be determined by the content.
*/
width?: string | undefined;
/**
* The comma (,) option enables the use of a group separator, such as a comma for thousands.
*/
comma?: string | undefined;
/**
* Depending on the type, the precision either indicates the number of digits that follow the decimal point (types 'f' and '%'),
* or the number of significant digits (types '' (none), 'e', 'g', 'r', 's' and 'p'). If the precision is not specified,
* it defaults to 6 for all types except '' (none), which defaults to 12.
* Precision is ignored for integer formats (types 'b', 'o', 'd', 'x', 'X' and 'c').
*
* See precisionFixed and precisionRound for help picking an appropriate precision.
*/
precision?: string | undefined;
/**
* The '~' option trims insignificant trailing zeros across all format types.
* This is most commonly used in conjunction with types 'r', 'e', 's' and '%'.
*/
trim?: string | undefined;
/**
* The available type values are:
*
* 'e' - exponent notation.
* 'f' - fixed point notation.
* 'g' - either decimal or exponent notation, rounded to significant digits.
* 'r' - decimal notation, rounded to significant digits.
* 's' - decimal notation with an SI prefix, rounded to significant digits.
* '%' - multiply by 100, and then decimal notation with a percent sign.
* 'p' - multiply by 100, round to significant digits, and then decimal notation with a percent sign.
* 'b' - binary notation, rounded to integer.
* 'o' - octal notation, rounded to integer.
* 'd' - decimal notation, rounded to integer.
* 'x' - hexadecimal notation, using lower-case letters, rounded to integer.
* 'X' - hexadecimal notation, using upper-case letters, rounded to integer.
* 'c' - converts the integer to the corresponding unicode character before printing.
*
* The type '' (none) is also supported as shorthand for '~g' (with a default precision of 12 instead of 6), and
* the type 'n' is shorthand for ',g'. For the 'g', 'n' and '' (none) types,
* decimal notation is used if the resulting string would have precision or fewer digits; otherwise, exponent notation is used.
*/
type?: string | undefined;
}
/**
* Create a new locale-based object which exposes format(...) and formatPrefix(...)
* methods for the specified locale.
*
* @param locale A Format locale definition.
*/
export function formatLocale(locale: FormatLocaleDefinition): FormatLocaleObject;
/**
* Create a new locale-based object which exposes format(...) and formatPrefix(...)
* methods for the specified locale definition. The specified locale definition will be
* set as the new default locale definition.
*
* @param defaultLocale A Format locale definition to be used as default.
*/
export function formatDefaultLocale(defaultLocale: FormatLocaleDefinition): FormatLocaleObject;
/**
* Returns a new format function for the given string specifier. The returned function
* takes a number as the only argument, and returns a string representing the formatted number.
*
* Uses the current default locale.
*
* The general form of a specifier is [[fill]align][sign][symbol][0][width][,][.precision][~][type].
* For reference, an explanation of the segments of the specifier string, refer to the FormatSpecifier interface properties.
*
* @param specifier A Specifier string.
* @throws Error on invalid format specifier.
*/
export function format(specifier: string): (n: number | { valueOf(): number }) => string;
/**
* Returns a new format function for the given string specifier. The returned function
* takes a number as the only argument, and returns a string representing the formatted number.
* The returned function will convert values to the units of the appropriate SI prefix for the
* specified numeric reference value before formatting in fixed point notation.
*
* Uses the current default locale.
*
* The general form of a specifier is [[fill]align][sign][symbol][0][width][,][.precision][~][type].
* For reference, an explanation of the segments of the specifier string, refer to the FormatSpecifier interface properties.
*
* @param specifier A Specifier string.
* @param value The reference value to determine the appropriate SI prefix.
* @throws Error on invalid format specifier.
*/
export function formatPrefix(specifier: string, value: number): (n: number | { valueOf(): number }) => string;
/**
* A Format Specifier
*
* For details see: {@link https://github.com/d3/d3-format#locale_format}
*/
export class FormatSpecifier {
/**
* Given the specified specifier object, returning an object with exposed fields that correspond to the format specification mini-language and a toString method that reconstructs the specifier.
* @param specifier A specifier object.
*/
constructor(specifier: FormatSpecifierObject);
/**
* fill can be any character. The presence of a fill character is signaled by the align character following it.
*/
fill: string;
/**
* Alignment used for format, as set by choosing one of the following:
*
* '>' - Forces the field to be right-aligned within the available space. (Default behavior).
* '<' - Forces the field to be left-aligned within the available space.
* '^' - Forces the field to be centered within the available space.
* '=' - Like '>', but with any sign and symbol to the left of any padding.
*/
align: '>' | '<' | '^' | '=';
/**
* The sign can be:
*
* '-' - nothing for positive and a minus sign for negative. (Default behavior.)
* '+' - a plus sign for positive and a minus sign for negative.
* '(' - nothing for positive and parentheses for negative.
* ' ' (space) - a space for positive and a minus sign for negative.
*
*/
sign: '-' | '+' | '(' | ' ';
/**
* The symbol can be:
*
* '$' - apply currency symbols per the locale definition.
* '#' - for binary, octal, or hexadecimal notation, prefix by 0b, 0o, or 0x, respectively.
* '' (none) - no symbol. (Default behavior.)
*/
symbol: '$' | '#' | '';
/**
* The zero (0) option enables zero-padding; this implicitly sets fill to 0 and align to =.
*/
zero: boolean;
/**
* The width defines the minimum field width;
* if not specified, then the width will be determined by the content.
*/
width: number | undefined;
/**
* The comma (,) option enables the use of a group separator, such as a comma for thousands.
*/
comma: boolean;
/**
* Depending on the type, the precision either indicates the number of digits that follow the decimal point (types 'f' and '%'),
* or the number of significant digits (types '' (none), 'e', 'g', 'r', 's' and 'p'). If the precision is not specified,
* it defaults to 6 for all types except '' (none), which defaults to 12.
* Precision is ignored for integer formats (types 'b', 'o', 'd', 'x', 'X' and 'c').
*
* See precisionFixed and precisionRound for help picking an appropriate precision.
*/
precision: number | undefined;
/**
* The '~' option trims insignificant trailing zeros across all format types.
* This is most commonly used in conjunction with types 'r', 'e', 's' and '%'.
*/
trim: boolean;
/**
* The available type values are:
*
* 'e' - exponent notation.
* 'f' - fixed point notation.
* 'g' - either decimal or exponent notation, rounded to significant digits.
* 'r' - decimal notation, rounded to significant digits.
* 's' - decimal notation with an SI prefix, rounded to significant digits.
* '%' - multiply by 100, and then decimal notation with a percent sign.
* 'p' - multiply by 100, round to significant digits, and then decimal notation with a percent sign.
* 'b' - binary notation, rounded to integer.
* 'o' - octal notation, rounded to integer.
* 'd' - decimal notation, rounded to integer.
* 'x' - hexadecimal notation, using lower-case letters, rounded to integer.
* 'X' - hexadecimal notation, using upper-case letters, rounded to integer.
* 'c' - converts the integer to the corresponding unicode character before printing.
*
* The type '' (none) is also supported as shorthand for '~g' (with a default precision of 12 instead of 6), and
* the type 'n' is shorthand for ',g'. For the 'g', 'n' and '' (none) types,
* decimal notation is used if the resulting string would have precision or fewer digits; otherwise, exponent notation is used.
*/
type: 'e' | 'f' | 'g' | 'r' | 's' | '%' | 'p' | 'b' | 'o' | 'd' | 'x' | 'X' | 'c' | '' | 'n';
/**
* Return the object as a specifier string.
*/
toString(): string;
}
/**
* Parses the specified specifier, returning an object with exposed fields that correspond to the
* format specification mini-language and a toString method that reconstructs the specifier.
*
* The general form of a specifier is [[fill]align][sign][symbol][0][width][,][.precision][~][type].
* For reference, an explanation of the segments of the specifier string, refer to the FormatSpecifier interface properties.
*
* @param specifier A specifier string.
* @throws Error on invalid format specifier.
*/
export function formatSpecifier(specifier: string): FormatSpecifier;
/**
* Returns a suggested decimal precision for fixed point notation given the specified numeric step value.
*
* @param step The step represents the minimum absolute difference between values that will be formatted.
* (This assumes that the values to be formatted are also multiples of step.)
*/
export function precisionFixed(step: number): number;
/**
* Returns a suggested decimal precision for use with locale.formatPrefix given the specified
* numeric step and reference value.
*
* @param step The step represents the minimum absolute difference between values that will be formatted.
* (This assumes that the values to be formatted are also multiples of step.)
* @param value Reference value determines which SI prefix will be used.
*/
export function precisionPrefix(step: number, value: number): number;
/**
* Returns a suggested decimal precision for format types that round to significant digits
* given the specified numeric step and max values.
*
* @param step The step represents the minimum absolute difference between values that will be formatted.
* (This assumes that the values to be formatted are also multiples of step.)
* @param max max represents the largest absolute value that will be formatted.
*/
export function precisionRound(step: number, max: number): number;

View File

@ -1,45 +0,0 @@
{
"name": "@types/d3-format",
"version": "1.4.2",
"description": "TypeScript definitions for D3JS d3-format module",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-format",
"license": "MIT",
"contributors": [
{
"name": "Tom Wanzek",
"url": "https://github.com/tomwanzek",
"githubUsername": "tomwanzek"
},
{
"name": "Alex Ford",
"url": "https://github.com/gustavderdrache",
"githubUsername": "gustavderdrache"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov",
"githubUsername": "borisyankov"
},
{
"name": "denisname",
"url": "https://github.com/denisname",
"githubUsername": "denisname"
},
{
"name": "Nathan Bierema",
"url": "https://github.com/Methuselah96",
"githubUsername": "Methuselah96"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/d3-format"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "2c662d50439378bce5e079fef292443184e4d0b3992aacd6db937ebb5bc3e12a",
"typeScriptVersion": "3.6"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/d3-geo`
# Summary
This package contains type definitions for D3JS d3-geo module (https://github.com/d3/d3-geo/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-geo/v1.
### Additional Details
* Last updated: Tue, 06 Jul 2021 20:32:39 GMT
* Dependencies: [@types/geojson](https://npmjs.com/package/@types/geojson)
* Global values: none
# Credits
These definitions were written by [Hugues Stefanski](https://github.com/ledragon), [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), and [Nathan Bierema](https://github.com/Methuselah96).

File diff suppressed because it is too large Load Diff

View File

@ -1,47 +0,0 @@
{
"name": "@types/d3-geo",
"version": "1.12.3",
"description": "TypeScript definitions for D3JS d3-geo module",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-geo",
"license": "MIT",
"contributors": [
{
"name": "Hugues Stefanski",
"url": "https://github.com/ledragon",
"githubUsername": "ledragon"
},
{
"name": "Tom Wanzek",
"url": "https://github.com/tomwanzek",
"githubUsername": "tomwanzek"
},
{
"name": "Alex Ford",
"url": "https://github.com/gustavderdrache",
"githubUsername": "gustavderdrache"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov",
"githubUsername": "borisyankov"
},
{
"name": "Nathan Bierema",
"url": "https://github.com/Methuselah96",
"githubUsername": "Methuselah96"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/d3-geo"
},
"scripts": {},
"dependencies": {
"@types/geojson": "*"
},
"typesPublisherContentHash": "4db978e892edef21f1c53ed22315982514578d7dd03309c9731e640be01ab28c",
"typeScriptVersion": "3.6"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/d3-hierarchy`
# Summary
This package contains type definitions for D3JS d3-hierarchy module (https://github.com/d3/d3-hierarchy/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-hierarchy/v1.
### Additional Details
* Last updated: Tue, 06 Jul 2021 20:32:40 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), and [Nathan Bierema](https://github.com/Methuselah96).

View File

@ -1,858 +0,0 @@
// Type definitions for D3JS d3-hierarchy module 1.1
// Project: https://github.com/d3/d3-hierarchy/, https://d3js.org/d3-hierarchy
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>
// Alex Ford <https://github.com/gustavderdrache>
// Boris Yankov <https://github.com/borisyankov>
// denisname <https://github.com/denisname>
// Nathan Bierema <https://github.com/Methuselah96>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Last module patch version validated against: 1.1.9
// -----------------------------------------------------------------------
// Hierarchy
// -----------------------------------------------------------------------
export interface HierarchyLink<Datum> {
/**
* The source of the link.
*/
source: HierarchyNode<Datum>;
/**
* The target of the link.
*/
target: HierarchyNode<Datum>;
}
export interface HierarchyNode<Datum> {
/**
* The associated data, as specified to the constructor.
*/
data: Datum;
/**
* Zero for the root node, and increasing by one for each descendant generation.
*/
readonly depth: number;
/**
* Zero for leaf nodes, and the greatest distance from any descendant leaf for internal nodes.
*/
readonly height: number;
/**
* The parent node, or null for the root node.
*/
parent: this | null;
/**
* An array of child nodes, if any; undefined for leaf nodes.
*/
children?: this[] | undefined;
/**
* Aggregated numeric value as calculated by `sum(value)` or `count()`, if previously invoked.
*/
readonly value?: number | undefined;
/**
* Optional node id string set by `StratifyOperator`, if hierarchical data was created from tabular data using stratify().
*/
readonly id?: string | undefined;
/**
* Returns the array of ancestors nodes, starting with this node, then followed by each parent up to the root.
*/
ancestors(): this[];
/**
* Returns the array of descendant nodes, starting with this node, then followed by each child in topological order.
*/
descendants(): this[];
/**
* Returns the array of leaf nodes in traversal order; leaves are nodes with no children.
*/
leaves(): this[];
/**
* Returns the shortest path through the hierarchy from this node to the specified target node.
* The path starts at this node, ascends to the least common ancestor of this node and the target node, and then descends to the target node.
*
* @param target The target node.
*/
path(target: this): this[];
/**
* Returns an array of links for this node, where each link is an object that defines source and target properties.
* The source of each link is the parent node, and the target is a child node.
*/
links(): Array<HierarchyLink<Datum>>;
/**
* Evaluates the specified value function for this node and each descendant in post-order traversal, and returns this node.
* The `node.value` property of each node is set to the numeric value returned by the specified function plus the combined value of all descendants.
*
* @param value The value function is passed the nodes data, and must return a non-negative number.
*/
sum(value: (d: Datum) => number): this;
/**
* Computes the number of leaves under this node and assigns it to `node.value`, and similarly for every descendant of node.
* If this node is a leaf, its count is one. Returns this node.
*/
count(): this;
/**
* Sorts the children of this node, if any, and each of this nodes descendants children,
* in pre-order traversal using the specified compare function, and returns this node.
*
* @param compare The compare function is passed two nodes a and b to compare.
* If a should be before b, the function must return a value less than zero;
* if b should be before a, the function must return a value greater than zero;
* otherwise, the relative order of a and b are not specified. See `array.sort` for more.
*/
sort(compare: (a: this, b: this) => number): this;
/**
* Invokes the specified function for node and each descendant in breadth-first order,
* such that a given node is only visited if all nodes of lesser depth have already been visited,
* as well as all preceding nodes of the same depth.
*
* @param func The specified function is passed the current node.
*/
each(func: (node: this) => void): this;
/**
* Invokes the specified function for node and each descendant in post-order traversal,
* such that a given node is only visited after all of its descendants have already been visited.
*
* @param func The specified function is passed the current node.
*/
eachAfter(func: (node: this) => void): this;
/**
* Invokes the specified function for node and each descendant in pre-order traversal,
* such that a given node is only visited after all of its ancestors have already been visited.
*
* @param func The specified function is passed the current node.
*/
eachBefore(func: (node: this) => void): this;
/**
* Return a deep copy of the subtree starting at this node. The returned deep copy shares the same data, however.
* The returned node is the root of a new tree; the returned nodes parent is always null and its depth is always zero.
*/
copy(): this;
}
/**
* Constructs a root node from the specified hierarchical data.
*
* @param data The root specified data.
* @param children The specified children accessor function invoked for each datum, starting with the root data.
* Must return an array of data representing the children, and return null or undefined if the current datum has no children.
* If children is not specified, it defaults to: `(d) => d.children`.
*/
export function hierarchy<Datum>(data: Datum, children?: (d: Datum) => (Datum[] | null | undefined)): HierarchyNode<Datum>;
// -----------------------------------------------------------------------
// Stratify
// -----------------------------------------------------------------------
export interface StratifyOperator<Datum> {
/**
* Generates a new hierarchy from the specified tabular data. Each node in the returned object has a shallow copy of the properties
* from the corresponding data object, excluding the following reserved properties: id, parentId, children.
*
* @param data The root specified data.
* @throws Error on missing id, ambiguous id, cycle, multiple roots or no root.
*/
(data: Datum[]): HierarchyNode<Datum>;
/**
* Returns the current id accessor, which defaults to: `(d) => d.id`.
*/
id(): (d: Datum, i: number, data: Datum[]) => (string | null | '' | undefined);
/**
* Sets the id accessor to the given function.
* The id accessor is invoked for each element in the input data passed to the stratify operator.
* The returned string is then used to identify the node's relationships in conjunction with the parent id.
* For leaf nodes, the id may be undefined, null or the empty string; otherwise, the id must be unique.
*
* @param id The id accessor.
*/
id(id: (d: Datum, i: number, data: Datum[]) => (string | null | '' | undefined)): this;
/**
* Returns the current parent id accessor, which defaults to: `(d) => d.parentId`.
*/
parentId(): (d: Datum, i: number, data: Datum[]) => (string | null | '' | undefined);
/**
* Sets the parent id accessor to the given function.
* The parent id accessor is invoked for each element in the input data passed to the stratify operator.
* The returned string is then used to identify the node's relationships in conjunction with the id.
* For the root node, the parent id should be undefined, null or the empty string.
* There must be exactly one root node in the input data, and no circular relationships.
*
* @param parentId The parent id accessor.
*/
parentId(parentId: (d: Datum, i: number, data: Datum[]) => (string | null | '' | undefined)): this;
}
/**
* Constructs a new stratify operator with the default settings.
*/
export function stratify<Datum>(): StratifyOperator<Datum>;
// -----------------------------------------------------------------------
// Cluster
// -----------------------------------------------------------------------
export interface HierarchyPointLink<Datum> {
/**
* The source of the link.
*/
source: HierarchyPointNode<Datum>;
/**
* The target of the link.
*/
target: HierarchyPointNode<Datum>;
}
export interface HierarchyPointNode<Datum> extends HierarchyNode<Datum> {
/**
* The x-coordinate of the node.
*/
x: number;
/**
* The y-coordinate of the node.
*/
y: number;
/**
* Returns an array of links for this node, where each link is an object that defines source and target properties.
* The source of each link is the parent node, and the target is a child node.
*/
links(): Array<HierarchyPointLink<Datum>>;
}
export interface ClusterLayout<Datum> {
/**
* Lays out the specified root hierarchy.
* You may want to call `root.sort` before passing the hierarchy to the cluster layout.
*
* @param root The specified root hierarchy.
*/
(root: HierarchyNode<Datum>): HierarchyPointNode<Datum>;
/**
* Returns the current layout size, which defaults to [1, 1]. A layout size of null indicates that a node size will be used instead.
*/
size(): [number, number] | null;
/**
* Sets this cluster layouts size to the specified [width, height] array and returns the cluster layout.
* The size represent an arbitrary coordinate system; for example, to produce a radial layout,
* a size of [360, radius] corresponds to a breadth of 360° and a depth of radius.
*
* @param size The specified two-element size array.
*/
size(size: [number, number]): this;
/**
* Returns the current node size, which defaults to null. A node size of null indicates that a layout size will be used instead.
*/
nodeSize(): [number, number] | null;
/**
* Sets this cluster layouts node size to the specified [width, height] array and returns this cluster layout.
* When a node size is specified, the root node is always positioned at <0, 0>.
*
* @param size The specified two-element size array.
*/
nodeSize(size: [number, number]): this;
/**
* Returns the current separation accessor, which defaults to: `(a, b) => a.parent == b.parent ? 1 : 2`.
*/
separation(): (a: HierarchyPointNode<Datum>, b: HierarchyPointNode<Datum>) => number;
/**
* Sets the separation accessor to the specified function and returns this cluster layout.
* The separation accessor is used to separate neighboring leaves.
*
* @param separation The separation function is passed two leaves a and b, and must return the desired separation.
* The nodes are typically siblings, though the nodes may be more distantly related if the layout decides to place such nodes adjacent.
*/
separation(separation: (a: HierarchyPointNode<Datum>, b: HierarchyPointNode<Datum>) => number): this;
}
/**
* Creates a new cluster layout with default settings.
*/
export function cluster<Datum>(): ClusterLayout<Datum>;
// -----------------------------------------------------------------------
// Tree
// -----------------------------------------------------------------------
export interface TreeLayout<Datum> {
/**
* Lays out the specified root hierarchy.
* You may want to call `root.sort` before passing the hierarchy to the tree layout.
*
* @param root The specified root hierarchy.
*/
(root: HierarchyNode<Datum>): HierarchyPointNode<Datum>;
/**
* Returns the current layout size, which defaults to [1, 1]. A layout size of null indicates that a node size will be used instead.
*/
size(): [number, number] | null;
/**
* Sets this tree layouts size to the specified [width, height] array and returns the tree layout.
* The size represent an arbitrary coordinate system; for example, to produce a radial layout,
* a size of [360, radius] corresponds to a breadth of 360° and a depth of radius.
*
* @param size The specified two-element size array.
*/
size(size: [number, number]): this;
/**
* Returns the current node size, which defaults to null. A node size of null indicates that a layout size will be used instead.
*/
nodeSize(): [number, number] | null;
/**
* Sets this tree layouts node size to the specified [width, height] array and returns this tree layout.
* When a node size is specified, the root node is always positioned at <0, 0>.
*
* @param size The specified two-element size array.
*/
nodeSize(size: [number, number]): this;
/**
* Returns the current separation accessor, which defaults to: `(a, b) => a.parent == b.parent ? 1 : 2`.
*/
separation(): (a: HierarchyPointNode<Datum>, b: HierarchyPointNode<Datum>) => number;
/**
* Sets the separation accessor to the specified function and returns this tree layout.
* The separation accessor is used to separate neighboring nodes.
*
* @param separation The separation function is passed two nodes a and b, and must return the desired separation.
* The nodes are typically siblings, though the nodes may be more distantly related if the layout decides to place such nodes adjacent.
*/
separation(separation: (a: HierarchyPointNode<Datum>, b: HierarchyPointNode<Datum>) => number): this;
}
/**
* Creates a new tree layout with default settings.
*/
export function tree<Datum>(): TreeLayout<Datum>;
// -----------------------------------------------------------------------
// Treemap
// -----------------------------------------------------------------------
export interface HierarchyRectangularLink<Datum> {
/**
* The source of the link.
*/
source: HierarchyRectangularNode<Datum>;
/**
* The target of the link.
*/
target: HierarchyRectangularNode<Datum>;
}
export interface HierarchyRectangularNode<Datum> extends HierarchyNode<Datum> {
/**
* The left edge of the rectangle.
*/
x0: number;
/**
* The top edge of the rectangle
*/
y0: number;
/**
* The right edge of the rectangle.
*/
x1: number;
/**
* The bottom edge of the rectangle.
*/
y1: number;
/**
* Returns an array of links for this node, where each link is an object that defines source and target properties.
* The source of each link is the parent node, and the target is a child node.
*/
links(): Array<HierarchyRectangularLink<Datum>>;
}
export interface TreemapLayout<Datum> {
/**
* Lays out the specified root hierarchy.
* You must call `root.sum` before passing the hierarchy to the treemap layout.
* You probably also want to call `root.sort` to order the hierarchy before computing the layout.
*
* @param root The specified root hierarchy.
*/
(root: HierarchyNode<Datum>): HierarchyRectangularNode<Datum>;
/**
* Returns the current tiling method, which defaults to `d3.treemapSquarify` with the golden ratio.
*/
tile(): (node: HierarchyRectangularNode<Datum>, x0: number, y0: number, x1: number, y1: number) => void;
/**
* Sets the tiling method to the specified function and returns this treemap layout.
*
* @param tile The specified tiling function.
*/
tile(tile: (node: HierarchyRectangularNode<Datum>, x0: number, y0: number, x1: number, y1: number) => void): this;
/**
* Returns the current size, which defaults to [1, 1].
*/
size(): [number, number];
/**
* Sets this treemap layouts size to the specified [width, height] array and returns this treemap layout.
*
* @param size The specified two-element size array.
*/
size(size: [number, number]): this;
/**
* Returns the current rounding state, which defaults to false.
*/
round(): boolean;
/**
* Enables or disables rounding according to the given boolean and returns this treemap layout.
*
* @param round The specified boolean flag.
*/
round(round: boolean): this;
/**
* Returns the current inner padding function.
*/
padding(): (node: HierarchyRectangularNode<Datum>) => number;
/**
* Sets the inner and outer padding to the specified number and returns this treemap layout.
*
* @param padding The specified padding value.
*/
padding(padding: number): this;
/**
* Sets the inner and outer padding to the specified function and returns this treemap layout.
*
* @param padding The specified padding function.
*/
padding(padding: (node: HierarchyRectangularNode<Datum>) => number): this;
/**
* Returns the current inner padding function, which defaults to the constant zero.
*/
paddingInner(): (node: HierarchyRectangularNode<Datum>) => number;
/**
* Sets the inner padding to the specified number and returns this treemap layout.
* The inner padding is used to separate a nodes adjacent children.
*
* @param padding The specified inner padding value.
*/
paddingInner(padding: number): this;
/**
* Sets the inner padding to the specified function and returns this treemap layout.
* The function is invoked for each node with children, being passed the current node.
* The inner padding is used to separate a nodes adjacent children.
*
* @param padding The specified inner padding function.
*/
paddingInner(padding: (node: HierarchyRectangularNode<Datum>) => number): this;
/**
* Returns the current top padding function.
*/
paddingOuter(): (node: HierarchyRectangularNode<Datum>) => number;
/**
* Sets the top, right, bottom and left padding to the specified function and returns this treemap layout.
*
* @param padding The specified padding outer value.
*/
paddingOuter(padding: number): this;
/**
* Sets the top, right, bottom and left padding to the specified function and returns this treemap layout.
*
* @param padding The specified padding outer function.
*/
paddingOuter(padding: (node: HierarchyRectangularNode<Datum>) => number): this;
/**
* Returns the current top padding function, which defaults to the constant zero.
*/
paddingTop(): (node: HierarchyRectangularNode<Datum>) => number;
/**
* Sets the top padding to the specified number and returns this treemap layout.
* The top padding is used to separate the top edge of a node from its children.
*
* @param padding The specified top padding value.
*/
paddingTop(padding: number): this;
/**
* Sets the top padding to the specified function and returns this treemap layout.
* The function is invoked for each node with children, being passed the current node.
* The top padding is used to separate the top edge of a node from its children.
*
* @param padding The specified top padding function.
*/
paddingTop(padding: (node: HierarchyRectangularNode<Datum>) => number): this;
/**
* Returns the current right padding function, which defaults to the constant zero.
*/
paddingRight(): (node: HierarchyRectangularNode<Datum>) => number;
/**
* Sets the right padding to the specified number and returns this treemap layout.
* The right padding is used to separate the right edge of a node from its children.
*
* @param padding The specified right padding value.
*/
paddingRight(padding: number): this;
/**
* Sets the right padding to the specified function and returns this treemap layout.
* The function is invoked for each node with children, being passed the current node.
* The right padding is used to separate the right edge of a node from its children.
*
* @param padding The specified right padding function.
*/
paddingRight(padding: (node: HierarchyRectangularNode<Datum>) => number): this;
/**
* Returns the current bottom padding function, which defaults to the constant zero.
*/
paddingBottom(): (node: HierarchyRectangularNode<Datum>) => number;
/**
* Sets the bottom padding to the specified number and returns this treemap layout.
* The bottom padding is used to separate the bottom edge of a node from its children.
*
* @param padding The specified bottom padding value.
*/
paddingBottom(padding: number): this;
/**
* Sets the bottom padding to the specified function and returns this treemap layout.
* The function is invoked for each node with children, being passed the current node.
* The bottom padding is used to separate the bottom edge of a node from its children.
*
* @param padding The specified bottom padding function.
*/
paddingBottom(padding: (node: HierarchyRectangularNode<Datum>) => number): this;
/**
* Returns the current left padding function, which defaults to the constant zero.
*/
paddingLeft(): (node: HierarchyRectangularNode<Datum>) => number;
/**
* Sets the left padding to the specified number and returns this treemap layout.
* The left padding is used to separate the left edge of a node from its children.
*
* @param padding The specified left padding value.
*/
paddingLeft(padding: number): this;
/**
* Sets the left padding to the specified function and returns this treemap layout.
* The function is invoked for each node with children, being passed the current node.
* The left padding is used to separate the left edge of a node from its children.
*
* @param padding The specified left padding function.
*/
paddingLeft(padding: (node: HierarchyRectangularNode<Datum>) => number): this;
}
/**
* Creates a new treemap layout with default settings.
*/
export function treemap<Datum>(): TreemapLayout<Datum>;
// Tiling functions ------------------------------------------------------
/**
* Recursively partitions the specified nodes into an approximately-balanced binary tree,
* choosing horizontal partitioning for wide rectangles and vertical partitioning for tall rectangles.
*/
export function treemapBinary(node: HierarchyRectangularNode<any>, x0: number, y0: number, x1: number, y1: number): void;
/**
* Divides the rectangular area specified by x0, y0, x1, y1 horizontally according the value of each of the specified nodes children.
* The children are positioned in order, starting with the left edge (x0) of the given rectangle.
* If the sum of the childrens values is less than the specified nodes value (i.e., if the specified node has a non-zero internal value),
* the remaining empty space will be positioned on the right edge (x1) of the given rectangle.
*/
export function treemapDice(node: HierarchyRectangularNode<any>, x0: number, y0: number, x1: number, y1: number): void;
/**
* Divides the rectangular area specified by x0, y0, x1, y1 vertically according the value of each of the specified nodes children.
* The children are positioned in order, starting with the top edge (y0) of the given rectangle.
* If the sum of the childrens values is less than the specified nodes value (i.e., if the specified node has a non-zero internal value),
* the remaining empty space will be positioned on the bottom edge (y1) of the given rectangle.
*/
export function treemapSlice(node: HierarchyRectangularNode<any>, x0: number, y0: number, x1: number, y1: number): void;
/**
* If the specified node has odd depth, delegates to treemapSlice; otherwise delegates to treemapDice.
*/
export function treemapSliceDice(node: HierarchyRectangularNode<any>, x0: number, y0: number, x1: number, y1: number): void;
// TODO: Test Factory code
export interface RatioSquarifyTilingFactory {
(node: HierarchyRectangularNode<any>, x0: number, y0: number, x1: number, y1: number): void;
/**
* Specifies the desired aspect ratio of the generated rectangles.
* Note that the orientation of the generated rectangles (tall or wide) is not implied by the ratio.
* Furthermore, the rectangles ratio are not guaranteed to have the exact specified aspect ratio.
* If not specified, the aspect ratio defaults to the golden ratio, φ = (1 + sqrt(5)) / 2, per Kong et al.
*
* @param ratio The specified ratio value greater than or equal to one.
*/
ratio(ratio: number): RatioSquarifyTilingFactory;
}
/**
* Implements the squarified treemap algorithm by Bruls et al., which seeks to produce rectangles of a given aspect ratio.
*/
export const treemapSquarify: RatioSquarifyTilingFactory;
/**
* Like `d3.treemapSquarify`, except preserves the topology (node adjacencies) of the previous layout computed by `d3.treemapResquarify`,
* if there is one and it used the same target aspect ratio. This tiling method is good for animating changes to treemaps because
* it only changes node sizes and not their relative positions, thus avoiding distracting shuffling and occlusion.
* The downside of a stable update, however, is a suboptimal layout for subsequent updates: only the first layout uses the Bruls et al. squarified algorithm.
*/
export const treemapResquarify: RatioSquarifyTilingFactory;
// -----------------------------------------------------------------------
// Partition
// -----------------------------------------------------------------------
export interface PartitionLayout<Datum> {
/**
* Lays out the specified root hierarchy.
* You must call `root.sum` before passing the hierarchy to the partition layout.
* You probably also want to call `root.sort` to order the hierarchy before computing the layout.
*
* @param root The specified root hierarchy.
*/
(root: HierarchyNode<Datum>): HierarchyRectangularNode<Datum>;
/**
* Returns the current size, which defaults to [1, 1].
*/
size(): [number, number];
/**
* Sets this partition layouts size to the specified [width, height] array and returns this partition layout.
*
* @param size The specified two-element size array.
*/
size(size: [number, number]): this;
/**
* Returns the current rounding state, which defaults to false.
*/
round(): boolean;
/**
* Enables or disables rounding according to the given boolean and returns this partition layout.
*
* @param round The specified boolean flag.
*/
round(round: boolean): this;
/**
* Returns the current padding, which defaults to zero.
*/
padding(): number;
/**
* Sets the padding to the specified number and returns this partition layout.
* The padding is used to separate a nodes adjacent children.
*
* @param padding The specified padding value.
*/
padding(padding: number): this;
}
/**
* Creates a new partition layout with the default settings.
*/
export function partition<Datum>(): PartitionLayout<Datum>;
// -----------------------------------------------------------------------
// Pack
// -----------------------------------------------------------------------
export interface HierarchyCircularLink<Datum> {
/**
* The source of the link.
*/
source: HierarchyCircularNode<Datum>;
/**
* The target of the link.
*/
target: HierarchyCircularNode<Datum>;
}
export interface HierarchyCircularNode<Datum> extends HierarchyNode<Datum> {
/**
* The x-coordinate of the circles center.
*/
x: number;
/**
* The y-coordinate of the circles center.
*/
y: number;
/**
* The radius of the circle.
*/
r: number;
/**
* Returns an array of links for this node, where each link is an object that defines source and target properties.
* The source of each link is the parent node, and the target is a child node.
*/
links(): Array<HierarchyCircularLink<Datum>>;
}
export interface PackLayout<Datum> {
/**
* Lays out the specified root hierarchy.
* You must call `root.sum` before passing the hierarchy to the pack layout.
* You probably also want to call `root.sort` to order the hierarchy before computing the layout.
*
* @param root The specified root hierarchy.
*/
(root: HierarchyNode<Datum>): HierarchyCircularNode<Datum>;
/**
* Returns the current radius accessor, which defaults to null.
*/
radius(): null | ((node: HierarchyCircularNode<Datum>) => number);
/**
* Sets the pack layouts radius accessor to the specified function and returns this pack layout.
* If the radius accessor is null, the radius of each leaf circle is derived from the leaf `node.value` (computed by `node.sum`);
* the radii are then scaled proportionally to fit the layout size.
* If the radius accessor is not null, the radius of each leaf circle is specified exactly by the function.
*
* @param radius The specified radius accessor.
*/
radius(radius: null | ((node: HierarchyCircularNode<Datum>) => number)): this;
/**
* Returns the current size, which defaults to [1, 1].
*/
size(): [number, number];
/**
* Sets this pack layouts size to the specified [width, height] array and returns this pack layout.
*
* @param size The specified two-element size array.
*/
size(size: [number, number]): this;
/**
* Returns the current padding accessor, which defaults to the constant zero.
*/
padding(): (node: HierarchyCircularNode<Datum>) => number;
/**
* Sets this pack layouts padding accessor to the specified number and returns this pack layout.
* Returns the current padding accessor, which defaults to the constant zero.
*
* When siblings are packed, tangent siblings will be separated by approximately the specified padding;
* the enclosing parent circle will also be separated from its children by approximately the specified padding.
* If an explicit radius is not specified, the padding is approximate because a two-pass algorithm
* is needed to fit within the layout size: the circles are first packed without padding;
* a scaling factor is computed and applied to the specified padding; and lastly the circles are re-packed with padding.
*
* @param padding The specified padding value.
*/
padding(padding: number): this;
/**
* Sets this pack layouts padding accessor to the specified function and returns this pack layout.
* Returns the current padding accessor, which defaults to the constant zero.
*
* When siblings are packed, tangent siblings will be separated by approximately the specified padding;
* the enclosing parent circle will also be separated from its children by approximately the specified padding.
* If an explicit radius is not specified, the padding is approximate because a two-pass algorithm
* is needed to fit within the layout size: the circles are first packed without padding;
* a scaling factor is computed and applied to the specified padding; and lastly the circles are re-packed with padding.
*
* @param padding The specified padding function.
*/
padding(padding: (node: HierarchyCircularNode<Datum>) => number): this;
}
/**
* Creates a new pack layout with the default settings.
*/
export function pack<Datum>(): PackLayout<Datum>;
// -----------------------------------------------------------------------
// Pack Siblings and Enclosure
// -----------------------------------------------------------------------
export interface PackRadius {
/**
* The radius of the circle.
*/
r: number;
/**
* The x-coordinate of the circles center.
*/
x?: number | undefined;
/**
* The y-coordinate of the circles center.
*/
y?: number | undefined;
}
export interface PackCircle {
/**
* The radius of the circle.
*/
r: number;
/**
* The x-coordinate of the circles center.
*/
x: number;
/**
* The y-coordinate of the circles center.
*/
y: number;
}
// TODO: Since packSiblings manipulates the circles array in place, technically the x and y properties
// are optional on invocation, but will be created after execution for each entry.
/**
* Packs the specified array of circles, each of which must have a `circle.r` property specifying the circles radius.
* The circles are positioned according to the front-chain packing algorithm by Wang et al.
*
* @param circles The specified array of circles to pack.
*/
export function packSiblings<Datum extends PackRadius>(circles: Datum[]): Array<Datum & PackCircle>;
/**
* Computes the smallest circle that encloses the specified array of circles, each of which must have
* a `circle.r` property specifying the circles radius, and `circle.x` and `circle.y` properties specifying the circles center.
* The enclosing circle is computed using the Matoušek-Sharir-Welzl algorithm. (See also Apollonius Problem.)
*
* @param circles The specified array of circles to pack.
*/
export function packEnclose<Datum extends PackCircle>(circles: Datum[]): PackCircle;

View File

@ -1,45 +0,0 @@
{
"name": "@types/d3-hierarchy",
"version": "1.1.8",
"description": "TypeScript definitions for D3JS d3-hierarchy module",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-hierarchy",
"license": "MIT",
"contributors": [
{
"name": "Tom Wanzek",
"url": "https://github.com/tomwanzek",
"githubUsername": "tomwanzek"
},
{
"name": "Alex Ford",
"url": "https://github.com/gustavderdrache",
"githubUsername": "gustavderdrache"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov",
"githubUsername": "borisyankov"
},
{
"name": "denisname",
"url": "https://github.com/denisname",
"githubUsername": "denisname"
},
{
"name": "Nathan Bierema",
"url": "https://github.com/Methuselah96",
"githubUsername": "Methuselah96"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/d3-hierarchy"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "950b84ceb2c0135b9679587961dbc4ccdd6afd8576a9aa8f19b67e4d318a2342",
"typeScriptVersion": "3.6"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/d3-interpolate`
# Summary
This package contains type definitions for D3JS d3-interpolate module (https://github.com/d3/d3-interpolate/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-interpolate/v1.
### Additional Details
* Last updated: Thu, 01 Oct 2020 22:50:46 GMT
* Dependencies: [@types/d3-color](https://npmjs.com/package/@types/d3-color)
* Global values: none
# Credits
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), and [Nathan Bierema](https://github.com/Methuselah96).

View File

@ -1,339 +0,0 @@
// Type definitions for D3JS d3-interpolate module 1.4
// Project: https://github.com/d3/d3-interpolate/, https://d3js.org/d3-interpolate
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>
// Alex Ford <https://github.com/gustavderdrache>
// Boris Yankov <https://github.com/borisyankov>
// denisname <https://github.com/denisname>
// Nathan Bierema <https://github.com/Methuselah96>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// Last module patch version validated against: 1.4.0
import { ColorCommonInstance } from 'd3-color';
// ---------------------------------------------------------------------------
// Shared Type Definitions and Interfaces
// ---------------------------------------------------------------------------
export interface ZoomInterpolator extends Function {
(t: number): ZoomView;
/**
* Recommended duration of zoom transition in milliseconds.
*/
duration: number;
}
export interface ColorGammaInterpolationFactory extends Function {
(a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string);
/**
* Returns a new interpolator factory of the same type using the specified *gamma*.
* For example, to interpolate from purple to orange with a gamma of 2.2 in RGB space: `d3.interpolateRgb.gamma(2.2)("purple", "orange")`.
* See Eric Brasseurs article, [Gamma error in picture scaling](https://web.archive.org/web/20160112115812/http://www.4p8.com/eric.brasseur/gamma.html), for more on gamma correction.
*/
gamma(g: number): ColorGammaInterpolationFactory;
}
/**
* Type zoomView is used to represent a numeric array with three elements.
* In order of appearance the elements correspond to:
* - cx: *x*-coordinate of the center of the viewport
* - cy: *y*-coordinate of the center of the viewport
* - width: size of the viewport
*/
export type ZoomView = [number, number, number];
export type TypedArray =
| Int8Array
| Uint8Array
| Int16Array
| Uint16Array
| Int32Array
| Uint32Array
| Uint8ClampedArray
| Float32Array
| Float64Array;
export type NumberArray = TypedArray | DataView;
// ---------------------------------------------------------------------------
// Interpolation Function Factories
// ---------------------------------------------------------------------------
/**
* Returns an `null` constant interpolator.
*/
export function interpolate(a: any, b: null): ((t: number) => null);
/**
* Returns an boolean constant interpolator of value `b`.
*/
export function interpolate(a: any, b: boolean): ((t: number) => boolean);
/**
* Returns a `interpolateNumber` interpolator.
*/
export function interpolate(a: number | { valueOf(): number }, b: number): ((t: number) => number);
/**
* Returns a `interpolateRgb` interpolator.
*/
export function interpolate(a: string | ColorCommonInstance, b: ColorCommonInstance): ((t: number) => string);
/**
* Returns a `interpolateDate` interpolator.
*/
export function interpolate(a: Date, b: Date): ((t: number) => Date);
/**
* Returns a `interpolateNumberArray` interpolator.
*/
export function interpolate<T extends NumberArray>(a: NumberArray | number[], b: T): ((t: number) => T);
/**
* Returns a `interpolateString` interpolator. If `b` is a string coercible to a color use use `interpolateRgb`.
*/
export function interpolate(a: string | { toString(): string }, b: string): ((t: number) => string);
/**
* Returns a `interpolateArray` interpolator.
*/
export function interpolate<U extends any[]>(a: any[], b: U): ((t: number) => U);
/**
* Returns a `interpolateNumber` interpolator.
*/
export function interpolate(a: number | { valueOf(): number }, b: { valueOf(): number }): ((t: number) => number);
/**
* Returns a `interpolateObject` interpolator.
*/
export function interpolate<U extends object>(a: any, b: U): ((t: number) => U);
/**
* Returns an interpolator between the two numbers `a` and `b`.
* The returned interpolator is equivalent to: `(t) => a * (1 - t) + b * t`.
*/
export function interpolateNumber(a: number | { valueOf(): number }, b: number | { valueOf(): number }): ((t: number) => number);
/**
* Returns an interpolator between the two numbers `a` and `b`; the interpolator is similar to `interpolateNumber`,
* except it will round the resulting value to the nearest integer.
*/
export function interpolateRound(a: number | { valueOf(): number }, b: number | { valueOf(): number }): ((t: number) => number);
/**
* Returns an interpolator between the two strings `a` and `b`.
* The string interpolator finds numbers embedded in `a` and `b`, where each number is of the form understood by JavaScript.
* A few examples of numbers that will be detected within a string: `-1`, `42`, `3.14159`, and `6.0221413e+23`.
*
* For each number embedded in `b`, the interpolator will attempt to find a corresponding number in `a`.
* If a corresponding number is found, a numeric interpolator is created using `interpolateNumber`.
* The remaining parts of the string `b` are used as a template.
*
* For example, if `a` is `"300 12px sans-serif"`, and `b` is `"500 36px Comic-Sans"`, two embedded numbers are found.
* The remaining static parts (of string `b`) are a space between the two numbers (`" "`), and the suffix (`"px Comic-Sans"`).
* The result of the interpolator at `t` = 0.5 is `"400 24px Comic-Sans"`.
*/
export function interpolateString(a: string | { toString(): string }, b: string | { toString(): string }): ((t: number) => string);
/**
* Returns an interpolator between the two dates `a` and `b`.
*
* Note: *no defensive copy* of the returned date is created; the same Date instance is returned for every evaluation of the interpolator.
* No copy is made for performance reasons; interpolators are often part of the inner loop of animated transitions.
*/
export function interpolateDate(a: Date, b: Date): ((t: number) => Date);
export type ArrayInterpolator<A extends any[]> = ((t: number) => A);
/**
* Returns an interpolator between the two arrays `a` and `b`. Internally, an array template is created that is the same length in `b`.
* For each element in `b`, if there exists a corresponding element in `a`, a generic interpolator is created for the two elements using `interpolate`.
* If there is no such element, the static value from `b` is used in the template.
* Then, for the given parameter `t`, the templates embedded interpolators are evaluated. The updated array template is then returned.
*
* For example, if `a` is the array `[0, 1]` and `b` is the array `[1, 10, 100]`, then the result of the interpolator for `t = 0.5` is the array `[0.5, 5.5, 100]`.
*
* Note: *no defensive copy* of the template array is created; modifications of the returned array may adversely affect subsequent evaluation of the interpolator.
* No copy is made for performance reasons; interpolators are often part of the inner loop of animated transitions.
*/
export function interpolateArray<A extends any[]>(a: any[], b: A): ArrayInterpolator<A>;
/**
* interpolateNumberArray is called
*/
export function interpolateArray<T extends NumberArray>(a: NumberArray | number[], b: T): ((t: number) => T);
/**
* Returns an interpolator between the two arrays of numbers a and b.
* Internally, an array template is created that is the same type and length as b.
* For each element in b, if there exists a corresponding element in a, the values are directly interpolated in the array template.
* If there is no such element, the static value from b is copied.
* The updated array template is then returned.
*
* Note: For performance reasons, no defensive copy is made of the template array and the arguments a and b; modifications of these arrays may affect subsequent evaluation of the interpolator.
*/
export function interpolateNumberArray<T extends NumberArray | number[]>(a: NumberArray | number[], b: T): ((t: number) => T);
/**
* Returns an interpolator between the two objects `a` and `b`. Internally, an object template is created that has the same properties as `b`.
* For each property in `b`, if there exists a corresponding property in `a`, a generic interpolator is created for the two elements using `interpolate`.
* If there is no such property, the static value from `b` is used in the template.
* Then, for the given parameter `t`, the template's embedded interpolators are evaluated and the updated object template is then returned.
*
* For example, if `a` is the object `{x: 0, y: 1}` and `b` is the object `{x: 1, y: 10, z: 100}`, the result of the interpolator for `t = 0.5` is the object `{x: 0.5, y: 5.5, z: 100}`.
*
* Note: *no defensive copy* of the template object is created; modifications of the returned object may adversely affect subsequent evaluation of the interpolator.
* No copy is made for performance reasons; interpolators are often part of the inner loop of animated transitions.
*/
export function interpolateObject<U extends object>(a: any, b: U): ((t: number) => U);
/**
* Returns an interpolator between the two 2D CSS transforms represented by `a` and `b`.
* Each transform is decomposed to a standard representation of translate, rotate, *x*-skew and scale; these component transformations are then interpolated.
* This behavior is standardized by CSS: see [matrix decomposition for animation](http://www.w3.org/TR/css3-2d-transforms/#matrix-decomposition).
*/
export function interpolateTransformCss(a: string, b: string): ((t: number) => string);
/**
* Returns an interpolator between the two 2D SVG transforms represented by `a` and `b`.
* Each transform is decomposed to a standard representation of translate, rotate, *x*-skew and scale; these component transformations are then interpolated.
* This behavior is standardized by CSS: see [matrix decomposition for animation](http://www.w3.org/TR/css3-2d-transforms/#matrix-decomposition).
*/
export function interpolateTransformSvg(a: string, b: string): ((t: number) => string);
/**
* Returns an interpolator between the two views `a` and `b` of a two-dimensional plane,
* based on [Smooth and efficient zooming and panning](http://www.win.tue.nl/~vanwijk/zoompan.pdf).
* Each view is defined as an array of three numbers: *cx*, *cy* and *width*.
* The first two coordinates *cx*, *cy* represent the center of the viewport; the last coordinate *width* represents the size of the viewport.
*
* The returned interpolator exposes a *duration* property which encodes the recommended transition duration in milliseconds.
* This duration is based on the path length of the curved trajectory through *x,y* space.
* If you want to a slower or faster transition, multiply this by an arbitrary scale factor (*V* as described in the original paper).
*/
export function interpolateZoom(a: ZoomView, b: ZoomView): ZoomInterpolator;
/**
* Returns a discrete interpolator for the given array of values. The returned interpolator maps `t` in `[0, 1 / n)` to values[0],
* `t` in `[1 / n, 2 / n)` to `values[1]`, and so on, where `n = values.length`. In effect, this is a lightweight quantize scale with a fixed domain of [0, 1].
*/
export function interpolateDiscrete<T>(values: T[]): ((t: number) => T);
// Sampling ------------------------------------------------------------------
/**
* Returns `n` uniformly-spaced samples from the specified `interpolator`, where `n` is an integer greater than one.
* The first sample is always at `t = 0`, and the last sample is always at `t = 1`.
* This can be useful in generating a fixed number of samples from a given interpolator,
* such as to derive the range of a [quantize scale](https://github.com/d3/d3-scale#quantize-scales) from a [continuous interpolator](https://github.com/d3/d3-scale#interpolateWarm).
*
* Caution: this method will not work with interpolators that do not return defensive copies of their output,
* such as `d3.interpolateArray`, `d3.interpolateDate` and `d3.interpolateObject`. For those interpolators, you must wrap the interpolator and create a copy for each returned value.
*/
export function quantize<T>(interpolator: ((t: number) => T), n: number): T[];
// Color Spaces
/**
* Returns an RGB color space interpolator between the two colors `a` and `b` with a configurable gamma. If the gamma is not specified, it defaults to 1.0.
* The colors `a` and `b` need not be in RGB; they will be converted to RGB using [`d3.rgb`](https://github.com/d3/d3-color#rgb). The return value of the interpolator is an RGB string.
*/
export const interpolateRgb: ColorGammaInterpolationFactory;
/**
* Returns a uniform nonrational B-spline interpolator through the specified array of *colors*, which are converted to RGB color space.
* Implicit control points are generated such that the interpolator returns `colors[0]` at `t = 0` and `colors[colors.length - 1]` at `t = 1`.
* Opacity interpolation is not currently supported. See also `d3.interpolateBasis`, and see [d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic) for examples.
*/
export function interpolateRgbBasis(colors: Array<string | ColorCommonInstance>): ((t: number) => string);
/**
* Returns a uniform nonrational B-spline interpolator through the specified array of colors, which are converted to RGB color space.
* The control points are implicitly repeated such that the resulting spline has cyclical C² continuity when repeated around `t` in [0,1];
* this is useful, for example, to create cyclical color scales. Opacity interpolation is not currently supported.
* See also `d3.interpolateBasisClosed, and see [d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic) for examples.
*/
export function interpolateRgbBasisClosed(colors: Array<string | ColorCommonInstance>): ((t: number) => string);
/**
* Returns an HSL color space interpolator between the two colors *a* and *b*. The colors *a* and *b* need not be in HSL;
* they will be converted to HSL using `d3.hsl`. If either colors hue or saturation is NaN, the opposing colors channel value is used.
* The shortest path between hues is used. The return value of the interpolator is an RGB string.
*/
export function interpolateHsl(a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string);
/**
* Like `interpolateHsl`, but does not use the shortest path between hues.
*/
export function interpolateHslLong(a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string);
/**
* Returns a Lab color space interpolator between the two colors *a* and *b*. The colors *a* and *b* need not be in Lab;
* they will be converted to Lab using `d3.lab`. The return value of the interpolator is an RGB string.
*/
export function interpolateLab(a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string);
/**
* Returns an HCL color space interpolator between the two colors `a` and `b`. The colors `a` and `b` need not be in HCL;
* they will be converted to HCL using `d3.hcl`. If either colors hue or chroma is NaN, the opposing colors channel value is used.
* The shortest path between hues is used. The return value of the interpolator is an RGB string.
*/
export function interpolateHcl(a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string);
/**
* Like `interpolateHcl`, but does not use the shortest path between hues.
*/
export function interpolateHclLong(a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string);
/**
* Returns a Cubehelix color space interpolator between the two colors `a` and `b` using a configurable `gamma`.
* If the gamma is not specified, it defaults to 1.0. The colors `a` and `b` need not be in Cubehelix;
* they will be converted to Cubehelix using [`d3.cubehelix`](https://github.com/d3/d3-color#cubehelix).
* If either colors hue or saturation is NaN, the opposing colors channel value is used. The shortest path between hues is used. The return value of the interpolator is an RGB string.
*/
export const interpolateCubehelix: ColorGammaInterpolationFactory;
/**
* Like `interpolateCubehelix`, but does not use the shortest path between hues.
*/
export const interpolateCubehelixLong: ColorGammaInterpolationFactory;
/**
* Returns an interpolator between the two hue angles `a` and `b`. If either hue is NaN, the opposing value is used.
* The shortest path between hues is used. The return value of the interpolator is a number in `[0, 360)`.
*/
export function interpolateHue(a: number, b: number): ((t: number) => number);
// Splines -------------------------------------------------------------------
/**
* Returns a uniform nonrational B-spline interpolator through the specified array of `values`, which must be numbers.
* Implicit control points are generated such that the interpolator returns `values[0]` at `t` = 0 and `values[values.length - 1]` at `t` = 1.
* See also [`d3.curveBasis`](https://github.com/d3/d3-shape#curveBasis).
*/
export function interpolateBasis(splineNodes: number[]): ((t: number) => number);
/**
* Returns a uniform nonrational B-spline interpolator through the specified array of `values`, which must be numbers.
* The control points are implicitly repeated such that the resulting one-dimensional spline has cyclical C² continuity when repeated around `t` in [0,1].
* See also [`d3.curveBasisClosed`](https://github.com/d3/d3-shape#curveBasisClosed).
*/
export function interpolateBasisClosed(splineNodes: number[]): ((t: number) => number);
// Piecewise -----------------------------------------------------------------
/**
* Returns a piecewise zoom interpolator, composing zoom interpolators for each adjacent pair of zoom view.
* The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`,
* and so on, where `n = values.length`. In effect, this is a lightweight linear scale.
* For example, to blend through three different zoom views: `d3.piecewise(d3.interpolateZoom, [[0, 0, 1], [0, 0, 10], [0, 0, 15]])`.
*/
export function piecewise(interpolate: (a: ZoomView, b: ZoomView) => ZoomInterpolator, values: ZoomView[]): ZoomInterpolator;
/**
* Returns a piecewise array interpolator, composing array interpolators for each adjacent pair of arrays.
* The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`,
* and so on, where `n = values.length`. In effect, this is a lightweight linear scale.
* For example, to blend through three different arrays: `d3.piecewise(d3.interpolateArray, [[0, 0, 1], [0, 0, 10], [0, 0, 15]])`.
*/
export function piecewise<A extends any[]>(interpolate: (a: any[], b: A) => ArrayInterpolator<A>, values: A[]): ArrayInterpolator<A>;
/**
* Returns a piecewise interpolator, composing interpolators for each adjacent pair of values.
* The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`,
* and so on, where `n = values.length`. In effect, this is a lightweight linear scale.
* For example, to blend through red, green and blue: `d3.piecewise(d3.interpolateRgb.gamma(2.2), ["red", "green", "blue"])`.
*/
export function piecewise<TData, Interpolator>(interpolate: (a: TData, b: TData) => Interpolator, values: TData[]): (t: number) => any;

View File

@ -1,46 +0,0 @@
{
"name": "@types/d3-interpolate",
"version": "1.4.2",
"description": "TypeScript definitions for D3JS d3-interpolate module",
"license": "MIT",
"contributors": [
{
"name": "Tom Wanzek",
"url": "https://github.com/tomwanzek",
"githubUsername": "tomwanzek"
},
{
"name": "Alex Ford",
"url": "https://github.com/gustavderdrache",
"githubUsername": "gustavderdrache"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov",
"githubUsername": "borisyankov"
},
{
"name": "denisname",
"url": "https://github.com/denisname",
"githubUsername": "denisname"
},
{
"name": "Nathan Bierema",
"url": "https://github.com/Methuselah96",
"githubUsername": "Methuselah96"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/d3-interpolate"
},
"scripts": {},
"dependencies": {
"@types/d3-color": "^1"
},
"typesPublisherContentHash": "f9c99f31f2c51b5a61886d5d876b93ee19364914515acdcc8c3c1158cc9099bb",
"typeScriptVersion": "3.2"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/d3-path`
# Summary
This package contains type definitions for D3JS d3-path module (https://github.com/d3/d3-path/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-path/v1.
### Additional Details
* Last updated: Tue, 29 Sep 2020 22:54:46 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), and [Nathan Bierema](https://github.com/Methuselah96).

View File

@ -1,109 +0,0 @@
// Type definitions for D3JS d3-path module 1.0
// Project: https://github.com/d3/d3-path/, https://d3js.org/d3-path
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>
// Alex Ford <https://github.com/gustavderdrache>
// Boris Yankov <https://github.com/borisyankov>
// Nathan Bierema <https://github.com/Methuselah96>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Last module patch version validated against: 1.0.9
/**
* A D3 path serializer implementing CanvasPathMethods
*/
export interface Path {
/**
* Move to the specified point x, y. Equivalent to context.moveTo and SVGs moveto command.
*
* @param x x-Coordinate of point to move to
* @param y y-Coordinate of point to move to
*/
moveTo(x: number, y: number): void;
/**
* Ends the current subpath and causes an automatic straight line to be drawn from the current point to the initial point of the current subpath.
* Equivalent to context.closePath and SVGs closepath command.
*/
closePath(): void;
/**
* Draws a straight line from the current point to the specified point x, y.
* Equivalent to context.lineTo and SVGs lineto command.
*
* @param x x-Coordinate of point to draw the line to
* @param y y-Coordinate of point to draw the line to
*/
lineTo(x: number, y: number): void;
/**
* Draws a quadratic Bézier segment from the current point to the specified point x, y, with the specified control point cpx, cpy.
* Equivalent to context.quadraticCurveTo and SVGs quadratic Bézier curve commands.
*
* @param cpx x-Coordinate of the control point for the quadratic Bézier curve
* @param cpy y-Coordinate of the control point for the quadratic Bézier curve
* @param x x-Coordinate of point to draw the curve to
* @param y y-Coordinate of point to draw the curve to
*/
quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
/**
* Draws a cubic Bézier segment from the current point to the specified point x, y, with the specified control points cpx1, cpy1 and cpx2, cpy2.
* Equivalent to context.bezierCurveTo and SVGs cubic Bézier curve commands.
*
* @param cpx1 x-Coordinate of the first control point for the Bézier curve
* @param cpy1 y-Coordinate of the first control point for the Bézier curve
* @param cpx2 x-Coordinate of the second control point for the Bézier curve
* @param cpy2 y-Coordinate of the second control point for the Bézier curve
* @param x x-Coordinate of point to draw the curve to
* @param y y-Coordinate of point to draw the curve to
*/
bezierCurveTo(cpx1: number, cpy1: number, cpx2: number, cpy2: number, x: number, y: number): void;
/**
* Draws a circular arc segment with the specified radius that starts tangent to the line between the current point and the specified point x1, y1
* and ends tangent to the line between the specified points x1, y1 and x2, y2. If the first tangent point is not equal to the current point,
* a straight line is drawn between the current point and the first tangent point. Equivalent to context.arcTo and uses SVGs elliptical arc curve commands.
*
* @param x1 x-Coordinate of the first tangent point
* @param y1 y-Coordinate of the first tangent point
* @param x2 x-Coordinate of the second tangent point
* @param y2 y-Coordinate of the second tangent point
* @param r Radius of the arc segment
*/
arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
/**
* Draws a circular arc segment with the specified center x, y, radius, startAngle and endAngle. If anticlockwise is true,
* the arc is drawn in the anticlockwise direction; otherwise, it is drawn in the clockwise direction.
* If the current point is not equal to the starting point of the arc, a straight line is drawn from the current point to the start of the arc.
* Equivalent to context.arc and uses SVGs elliptical arc curve commands.
*
* @param x x-Coordinate of the center point of the arc segment
* @param y y-Coordinate of the center point of the arc segment
* @param startAngle Start angle of arc segment
* @param endAngle End angle of arc segment
* @param anticlockwise Flag indicating directionality (true = anti-clockwise, false = clockwise)
*/
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
/**
* Creates a new subpath containing just the four points x, y, x + w, y, x + w, y + h, x, y + h,
* with those four points connected by straight lines, and then marks the subpath as closed. Equivalent to context.rect and uses SVGs lineto commands.
*
* @param x x-Coordinate of starting point for drawing the rectangle
* @param y y-Coordinate of starting point for drawing the rectangle
* @param w Width of rectangle
* @param h Height of rectangle
*/
rect(x: number, y: number, w: number, h: number): void;
/**
* Returns the string representation of this path according to SVGs path data specification.
*/
toString(): string;
}
/**
* Construct a D3 Path serializer
*/
export function path(): Path;

View File

@ -1,39 +0,0 @@
{
"name": "@types/d3-path",
"version": "1.0.9",
"description": "TypeScript definitions for D3JS d3-path module",
"license": "MIT",
"contributors": [
{
"name": "Tom Wanzek",
"url": "https://github.com/tomwanzek",
"githubUsername": "tomwanzek"
},
{
"name": "Alex Ford",
"url": "https://github.com/gustavderdrache",
"githubUsername": "gustavderdrache"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov",
"githubUsername": "borisyankov"
},
{
"name": "Nathan Bierema",
"url": "https://github.com/Methuselah96",
"githubUsername": "Methuselah96"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/d3-path"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "812d4aa372c835aa1f5e6f30e0119ce014ea5c2f42fe6dd3b0fcfc5ec97d6d38",
"typeScriptVersion": "3.2"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/d3-polygon`
# Summary
This package contains type definitions for D3JS d3-polygon module (https://github.com/d3/d3-polygon/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-polygon/v1.
### Additional Details
* Last updated: Tue, 29 Sep 2020 22:54:47 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), and [Nathan Bierema](https://github.com/Methuselah96).

View File

@ -1,49 +0,0 @@
// Type definitions for D3JS d3-polygon module 1.0
// Project: https://github.com/d3/d3-polygon/, https://d3js.org/d3-polygon
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>
// Alex Ford <https://github.com/gustavderdrache>
// Boris Yankov <https://github.com/borisyankov>
// Nathan Bierema <https://github.com/Methuselah96>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Last module patch version validated against: 1.0.6
/**
* Returns the signed area of the specified polygon. If the vertices of the polygon are in counterclockwise order
* (assuming a coordinate system where the origin <0,0> is in the top-left corner), the returned area is positive;
* otherwise it is negative, or zero.
*
* @param polygon Array of coordinates <x0, y0>, <x1, y1> and so on.
*/
export function polygonArea(polygon: Array<[number, number]>): number;
/**
* Returns the centroid of the specified polygon.
*
* @param polygon Array of coordinates <x0, y0>, <x1, y1> and so on.
*/
export function polygonCentroid(polygon: Array<[number, number]>): [number, number];
/**
* Returns the convex hull of the specified points using Andrews monotone chain algorithm.
* The returned hull is represented as an array containing a subset of the input points arranged in
* counterclockwise order. Returns null if points has fewer than three elements.
*
* @param points Array of coordinates <x0, y0>, <x1, y1> and so on.
*/
export function polygonHull(points: Array<[number, number]>): Array<[number, number]> | null;
/**
* Returns true if and only if the specified point is inside the specified polygon.
*
* @param polygon Array of coordinates <x0, y0>, <x1, y1> and so on.
* @param point Coordinates of point <x, y>.
*/
export function polygonContains(polygon: Array<[number, number]>, point: [number, number]): boolean;
/**
* Returns the length of the perimeter of the specified polygon.
*
* @param polygon Array of coordinates <x0, y0>, <x1, y1> and so on.
*/
export function polygonLength(polygon: Array<[number, number]>): number;

View File

@ -1,39 +0,0 @@
{
"name": "@types/d3-polygon",
"version": "1.0.8",
"description": "TypeScript definitions for D3JS d3-polygon module",
"license": "MIT",
"contributors": [
{
"name": "Tom Wanzek",
"url": "https://github.com/tomwanzek",
"githubUsername": "tomwanzek"
},
{
"name": "Alex Ford",
"url": "https://github.com/gustavderdrache",
"githubUsername": "gustavderdrache"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov",
"githubUsername": "borisyankov"
},
{
"name": "Nathan Bierema",
"url": "https://github.com/Methuselah96",
"githubUsername": "Methuselah96"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/d3-polygon"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "d31fa81dac1b4b1e8697b565f277e9596934771d2c101d64623cd4a35c2e85e4",
"typeScriptVersion": "3.2"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View File

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/d3-quadtree`
# Summary
This package contains type definitions for D3JS d3-quadtree module (https://github.com/d3/d3-quadtree/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-quadtree/v1.
### Additional Details
* Last updated: Tue, 06 Jul 2021 20:32:40 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), and [Nathan Bierema](https://github.com/Methuselah96).

View File

@ -1,209 +0,0 @@
// Type definitions for D3JS d3-quadtree module 1.0
// Project: https://github.com/d3/d3-quadtree/, https://d3js.org/d3-quadtree
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>
// Alex Ford <https://github.com/gustavderdrache>
// Boris Yankov <https://github.com/borisyankov>
// denisname <https://github.com/denisname>
// Nathan Bierema <https://github.com/Methuselah96>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// Last module patch version validated against: 1.0.7
/**
* Leaf node of the quadtree.
*/
export interface QuadtreeLeaf<T> {
/**
* The data associated with this point, as passed to quadtree.add.
*/
data: T;
/**
* The next datum in this leaf, if any.
*/
next?: QuadtreeLeaf<T> | undefined;
/**
* The length property may be used to distinguish leaf nodes from internal nodes: it is undefined for leaf nodes, and 4 for internal nodes.
*/
length?: undefined;
}
/**
* Internal nodes of the quadtree are represented as four-element arrays in left-to-right, top-to-bottom order:
*
* 0 - the top-left quadrant, if any.
* 1 - the top-right quadrant, if any.
* 2 - the bottom-left quadrant, if any.
* 3 - the bottom-right quadrant, if any.
*
* A child quadrant may be undefined if it is empty.
*/
export interface QuadtreeInternalNode<T> extends Array<QuadtreeInternalNode<T> | QuadtreeLeaf<T> | undefined> {
/**
* The length property may be used to distinguish leaf nodes from internal nodes: it is undefined for leaf nodes, and 4 for internal nodes.
*/
length: 4;
}
export interface Quadtree<T> {
/**
* Returns the current x-accessor, which defaults to: `x(d) => d[0]`.
*/
x(): (d: T) => number;
/**
* Sets the current x-coordinate accessor and returns the quadtree.
* The x-accessors must be consistent, returning the same value given the same input.
*
* @param x The x-coordinate accessor.
*/
x(x: (d: T) => number): this;
/**
* Returns the current y-accessor, which defaults to: `y(d) => d[1]`.
*/
y(): (d: T) => number;
/**
* Sets the current y-coordinate accessor and returns the quadtree.
* The y-accessors must be consistent, returning the same value given the same input.
*
* @param y The y-coordinate accessor.
*/
y(y: (d: T) => number): this;
/**
* Returns the quadtree's current extent `[[x0, y0], [x1, y1]]`,
* where `x0` and `y0` are the inclusive lower bounds and `x1` and `y1` are the inclusive upper bounds,
* or `undefined` if the quadtree has no extent.
*/
extent(): [[number, number], [number, number]] | undefined;
/**
* Expands the quadtree to cover the specified points `[[x0, y0], [x1, y1]]` and returns the quadtree.
* The extent may also be expanded by calling `quadtree.cover` or `quadtree.add`.
*
* @param extend The specified points to cover.
*/
extent(extend: [[number, number], [number, number]]): this;
/**
* Expands the quadtree to cover the specified point x,y, and returns the quadtree.
* * If the quadtrees extent already covers the specified point, this method does nothing.
* * If the quadtree has an extent, the extent is repeatedly doubled to cover the specified point, wrapping the root node as necessary.
* * If the quadtree is empty, the extent is initialized to the extent `[[⌊x⌋, ⌊y⌋], [⌈x⌉, ⌈y⌉]]`.
* Rounding is necessary such that if the extent is later doubled, the boundaries of existing quadrants do not change due to floating point error.
*
* @param x The x-coordinate for the specified point to cover.
* @param y The y-coordinate for the specified point to cover.
*/
cover(x: number, y: number): this;
/**
* Adds the specified datum to the quadtree, deriving its coordinates x,y using the current x- and y-accessors, and returns the quadtree.
* If the new point is outside the current extent of the quadtree, the quadtree is automatically expanded to cover the new point.
*
* @param datum The specified datum to add.
*/
add(datum: T): this;
/**
* Adds the specified array of data to the quadtree, deriving each elements coordinates x,y using the current x- and y-accessors, and return this quadtree.
* This is approximately equivalent to calling quadtree.add repeatedly.
* However, this method results in a more compact quadtree because the extent of the data is computed first before adding the data.
*
* @param data The specified array of data to add.
*/
addAll(data: T[]): this;
/**
* Removes the specified datum to the quadtree, deriving its coordinates x,y using the current x- and y-accessors, and returns the quadtree.
* If the specified datum does not exist in this quadtree, this method does nothing.
*
* @param datum The specified datum to remove.
*/
remove(datum: T): this;
/**
* Removes the specified data to the quadtree, deriving their coordinates x,y using the current x- and y-accessors, and returns the quadtree.
* If a specified datum does not exist in this quadtree, it is ignored.
*
* @param data The specified array of data to remove.
*/
removeAll(data: T[]): this;
/**
* Returns a copy of the quadtree. All nodes in the returned quadtree are identical copies of the corresponding node in the quadtree;
* however, any data in the quadtree is shared by reference and not copied.
*/
copy(): Quadtree<T>;
/**
* Returns the root node of the quadtree.
*/
root(): QuadtreeInternalNode<T> | QuadtreeLeaf<T>;
/**
* Returns an array of all data in the quadtree.
*/
data(): T[];
/**
* Returns the total number of data in the quadtree.
*/
size(): number;
/**
* Returns the datum closest to the position x,y with the given search radius. If radius is not specified, it defaults to infinity.
* If there is no datum within the search area, returns undefined.
*
* @param x The x-coordinate for the search position.
* @param y The y-coordinate for the search position.
* @param radius The optional search radius.
*/
find(x: number, y: number, radius?: number): T | undefined;
/**
* Visits each node in the quadtree in pre-order traversal, invoking the specified callback with arguments `node`, `x0`, `y0`, `x1`, `y1` for each node,
* where `node` is the node being visited, x0, y0 are the lower bounds of the node, and x1, y1 are the upper bounds, and returns the quadtree.
*
* If the callback returns true for a given node, then the children of that node are not visited; otherwise, all child nodes are visited.
* This can be used to quickly visit only parts of the tree.
* Note, however, that child quadrants are always visited in sibling order: top-left, top-right, bottom-left, bottom-right.
* In cases such as search, visiting siblings in a specific order may be faster.
*
* @param callback The callback invoked for each node.
*/
visit(callback: (node: QuadtreeInternalNode<T> | QuadtreeLeaf<T>, x0: number, y0: number, x1: number, y1: number) => void | boolean): this;
/**
* Visits each node in the quadtree in post-order traversal, invoking the specified callback with arguments `node`, `x0`, `y0`, `x1`, `y1` for each node,
* where `node` is the node being visited, x0, y0 are the lower bounds of the node, and x1, y1 are the upper bounds, and returns the quadtree.
*
* @param callback The callback invoked for each node.
*/
visitAfter(callback: (node: QuadtreeInternalNode<T> | QuadtreeLeaf<T>, x0: number, y0: number, x1: number, y1: number) => void): this;
}
/**
* Creates a new, empty quadtree with an empty extent and the default x- and y-accessors.
*
* The generic refers to the data type. If omitted, the default setting assumes that,
* the data used with the quadtree are two-element arrays.
* The first element corresponds to the x-dimension, the second to the y-dimension.
* When using another type, The x- and y-accessors must be specified.
*/
export function quadtree<T = [number, number]>(): Quadtree<T>;
/**
* Creates a new quadtree with the specified array of data.
* If `x` and `y` are also specified, sets the x- and y- accessors to the specified functions before adding the specified array of data to the quadtree, otherwise use the default x- and y-accessors.
*
* The generic refers to the data type. If omitted, the default setting assumes that,
* the data used with the quadtree are two-element arrays.
* The first element corresponds to the x-dimension, the second to the y-dimension.
* When using another type, The x- and y-accessors must be specified.
*
* @param data The specified array of data to add.
* @param x The x-coordinate accessor.
* @param y The y-coordinate accessor.
*/
export function quadtree<T = [number, number]>(data: T[], x?: (d: T) => number, y?: (d: T) => number): Quadtree<T>;

View File

@ -1,45 +0,0 @@
{
"name": "@types/d3-quadtree",
"version": "1.0.9",
"description": "TypeScript definitions for D3JS d3-quadtree module",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-quadtree",
"license": "MIT",
"contributors": [
{
"name": "Tom Wanzek",
"url": "https://github.com/tomwanzek",
"githubUsername": "tomwanzek"
},
{
"name": "Alex Ford",
"url": "https://github.com/gustavderdrache",
"githubUsername": "gustavderdrache"
},
{
"name": "Boris Yankov",
"url": "https://github.com/borisyankov",
"githubUsername": "borisyankov"
},
{
"name": "denisname",
"url": "https://github.com/denisname",
"githubUsername": "denisname"
},
{
"name": "Nathan Bierema",
"url": "https://github.com/Methuselah96",
"githubUsername": "Methuselah96"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/d3-quadtree"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "41ada56196a34116d04194a407da801bea10cb2137bb5321771f513dd2b1e388",
"typeScriptVersion": "3.6"
}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

Some files were not shown because too many files have changed in this diff Show More