New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

d3plus-priestley

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3plus-priestley - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

2

es/index.js

@@ -1,1 +0,1 @@

export { default as Priestley } from "./src/Priestley";
export { default as Priestley } from "./src/Priestley.js";

@@ -1,27 +0,16 @@

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
/**

@@ -31,2 +20,3 @@ @external Viz

*/
import { min, max, range } from "d3-array";

@@ -39,2 +29,3 @@ import { nest } from "d3-collection";

import { Viz } from "d3plus-viz";
/**

@@ -45,8 +36,5 @@ @class Priestley

*/
var Priestley = /*#__PURE__*/function (_Viz) {
_inherits(Priestley, _Viz);
var _super = _createSuper(Priestley);
/**

@@ -59,5 +47,3 @@ @memberof Priestley

var _this;
_classCallCheck(this, Priestley);
_this = _super.call(this);

@@ -69,5 +55,3 @@ _this._axis = new Axis().align("end").orient("bottom");

_this._axisTest = new Axis().align("end").gridSize(0).orient("bottom");
_this.end("end");
_this._paddingInner = 0.05;

@@ -80,7 +64,6 @@ _this._paddingOuter = 0.05;

});
_this.start("start");
return _this;
}
/**

@@ -91,4 +74,2 @@ @memberof Priestley

*/
_createClass(Priestley, [{

@@ -98,7 +79,4 @@ key: "_draw",

var _this2 = this;
_get(_getPrototypeOf(Priestley.prototype), "_draw", this).call(this, callback);
if (!this._filteredData) return this;
var data = this._filteredData.map(function (data, i) {

@@ -118,8 +96,5 @@ return {

});
var nestedData;
if (this._groupBy.length > 1 && this._drawDepth > 0) {
var dataNest = nest();
var _loop = function _loop(i) {

@@ -130,7 +105,5 @@ dataNest.key(function (d) {

};
for (var i = 0; i < this._drawDepth; i++) {
_loop(i);
}
nestedData = dataNest.entries(data);

@@ -140,3 +113,2 @@ } else nestedData = [{

}];
var maxLane = 0;

@@ -150,3 +122,2 @@ nestedData.forEach(function (g) {

var i = track.indexOf(false);
if (i < 0) {

@@ -172,3 +143,2 @@ d.lane = maxLane + track.length;

var transform = "translate(".concat(this._margin.left, ", ").concat(this._margin.top, ")");
this._axisTest.config(axisConfig).config(this._axisConfig).select(elem("g.d3plus-priestley-axis-test", {

@@ -180,3 +150,2 @@ parent: this._select,

}).node()).render();
this._axis.config(axisConfig).config(this._axisConfig).select(elem("g.d3plus-priestley-axis", {

@@ -191,3 +160,2 @@ parent: this._select,

}).node()).render();
var axisPad = this._axisTest._padding;

@@ -197,3 +165,2 @@ var xScale = this._axis._d3Scale;

var bandWidth = yScale.bandwidth();
this._shapes.push(new Rect().data(data).duration(this._duration).height(bandWidth).label(function (d, i) {

@@ -211,5 +178,5 @@ return _this2._drawLabel(d.data, i);

}).config(configPrep.bind(this)(this._shapeConfig, "shape", "Rect")).render());
return this;
}
/**

@@ -221,3 +188,2 @@ @memberof Priestley

*/
}, {

@@ -228,2 +194,3 @@ key: "axisConfig",

}
/**

@@ -235,3 +202,2 @@ @memberof Priestley

*/
}, {

@@ -248,2 +214,3 @@ key: "end",

}
/**

@@ -255,3 +222,2 @@ @memberof Priestley

*/
}, {

@@ -262,2 +228,3 @@ key: "paddingInner",

}
/**

@@ -269,3 +236,2 @@ @memberof Priestley

*/
}, {

@@ -276,2 +242,3 @@ key: "paddingOuter",

}
/**

@@ -283,3 +250,2 @@ @memberof Priestley

*/
}, {

@@ -297,6 +263,4 @@ key: "start",

}]);
return Priestley;
}(Viz);
export { Priestley as default };
{
"name": "d3plus-priestley",
"version": "1.0.0",
"version": "1.1.0",
"description": "A reusable Priestley timeline built on D3.",
"main": "build/d3plus-priestley.js",
"main": "es/index.js",
"jsnext:main": "es/index",

@@ -27,9 +27,9 @@ "license": "MIT",

"dependencies": {
"d3-array": "^2.11.0",
"d3-array": "^3.2.2",
"d3-collection": "^1.0.7",
"d3-scale": "^3.2.3",
"d3plus-axis": "^1.0.0",
"d3plus-common": "^1.0.2",
"d3plus-shape": "^1.0.1",
"d3plus-viz": "^1.0.3"
"d3-scale": "^4.0.2",
"d3plus-axis": "^1.2.1",
"d3plus-common": "^1.2.4",
"d3plus-shape": "^1.1.0",
"d3plus-viz": "^1.3.0"
},

@@ -41,10 +41,9 @@ "scripts": {

"env": "d3plus-env",
"examples": "d3plus-examples",
"release": "d3plus-release",
"test": "d3plus-test"
"test": "eslint src test && mocha 'test/**/*-test.js'"
},
"devDependencies": {
"d3plus-dev": "^1.0.1"
"d3plus-dev": "^1.2.9"
},
"module": "es/index",
"module": "es/index.js",
"sideEffects": false,

@@ -57,3 +56,6 @@ "files": [

"es"
]
],
"jsdelivr": "build/d3plus-priestley.full.min.js",
"unpkg": "build/d3plus-priestley.full.min.js",
"type": "module"
}
# d3plus-priestley
[![NPM Release](http://img.shields.io/npm/v/d3plus-priestley.svg?style=flat)](https://www.npmjs.org/package/d3plus-priestley) [![Build Status](https://travis-ci.org/d3plus/d3plus-priestley.svg?branch=master)](https://travis-ci.org/d3plus/d3plus-priestley) [![Dependency Status](http://img.shields.io/david/d3plus/d3plus-priestley.svg?style=flat)](https://david-dm.org/d3plus/d3plus-priestley) [![Gitter](https://img.shields.io/badge/-chat_on_gitter-brightgreen.svg?style=flat&logo=gitter-white)](https://gitter.im/d3plus/)
A reusable Priestley timeline built on D3.

@@ -9,4 +7,10 @@

If you use NPM, `npm install d3plus-priestley`. Otherwise, download the [latest release](https://github.com/d3plus/d3plus-priestley/releases/latest). You can also load d3plus-priestley as a standalone library or as part of [D3plus](https://github.com/d3plus/d3plus). ES modules, AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3plus` global is exported:
If using npm, `npm install d3plus-priestley`. Otherwise, you can download the [latest release from GitHub](https://github.com/d3plus/d3plus-priestley/releases/latest) or load from a [CDN](https://cdn.jsdelivr.net/npm/d3plus-priestley@1).
```js
import modules from "d3plus-priestley";
```
d3plus-priestley can be loaded as a standalone library or bundled as part of [D3plus](https://github.com/d3plus/d3plus). ES modules, AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3plus` global is exported:
```html

@@ -19,33 +23,6 @@ <script src="https://cdn.jsdelivr.net/npm/d3plus-priestley@1"></script>

## Examples
## Simple Priestley Diagram
Live examples can be found on [d3plus.org](https://d3plus.org/), which includes a collection of example visualizations using [d3plus-react](https://github.com/d3plus/d3plus-react/). These examples are powered by the [d3plus-storybook](https://github.com/d3plus/d3plus-storybook/) repo, and PRs are always welcome. :beers:
Priestly Timelines (named after 18th-century English theologian [Joseph Priestly](https://en.wikipedia.org/wiki/Joseph_Priestley)), show the duration of multiple data points over time by stacking blocks to best fit. Given data with unique IDs and start and end dates:
```js
var data = [
{id: "alpha", start: 2004, end: 2007},
{id: "epsilon", start: 2007, end: 2012},
{id: "beta", start: 2005, end: 2010},
];
```
It's only requires a few lines of code to create a Priestly Timeline:
```js
new d3plus.Priestley()
.data(data)
.render();
```
[<kbd><img src="/example/getting-started.png" width="990px" /></kbd>](https://d3plus.org/examples/d3plus-priestley/getting-started/)
[Click here](https://d3plus.org/examples/d3plus-priestley/getting-started/) to view this example live on the web.
### More Examples
* [Grouping Priestley Bars into Lanes](http://d3plus.org/examples/d3plus-priestley/grouping/)
## API Reference

@@ -125,2 +102,2 @@

###### <sub>Documentation generated on Wed, 03 Feb 2021 14:23:14 GMT</sub>
###### <sub>Documentation generated on Wed, 25 Jan 2023 18:11:33 GMT</sub>

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc