property-graph
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -10,4 +10,2 @@ import { EventDispatcher, GraphEdgeEvent } from './event-dispatcher.js'; | ||
* although that reverse lookup can be done on the graph. | ||
* | ||
* @category Graph | ||
*/ | ||
@@ -14,0 +12,0 @@ export declare class GraphEdge<Parent extends GraphNode, Child extends GraphNode> extends EventDispatcher<GraphEdgeEvent> { |
@@ -14,4 +14,2 @@ import { LiteralKeys, Nullable, RefKeys, RefListKeys, RefMapKeys } from './constants.js'; | ||
* Represents a node in a {@link Graph}. | ||
* | ||
* @category Graph | ||
*/ | ||
@@ -124,4 +122,8 @@ export declare abstract class GraphNode<Attributes extends {} = {}> extends EventDispatcher<GraphNodeEvent> { | ||
*/ | ||
/** | ||
* Dispatches an event on the {@link GraphNode}, and on the associated | ||
* {@link Graph}. Event types on the graph are prefixed, `"node:[type]"`. | ||
*/ | ||
dispatchEvent(event: BaseEvent): this; | ||
} | ||
export {}; |
@@ -7,4 +7,2 @@ import { EventDispatcher, GraphEdgeEvent, GraphEvent, GraphNodeEvent } from './event-dispatcher.js'; | ||
* by {@link @Link} edges. | ||
* | ||
* @category Graph | ||
*/ | ||
@@ -37,2 +35,3 @@ export declare class Graph<T extends GraphNode> extends EventDispatcher<GraphEvent | GraphNodeEvent | GraphEdgeEvent> { | ||
*/ | ||
/** @hidden */ | ||
private _registerEdge; | ||
@@ -39,0 +38,0 @@ /** |
@@ -68,4 +68,2 @@ class EventDispatcher { | ||
* although that reverse lookup can be done on the graph. | ||
* | ||
* @category Graph | ||
*/ | ||
@@ -154,4 +152,2 @@ | ||
* by {@link @Link} edges. | ||
* | ||
* @category Graph | ||
*/ | ||
@@ -222,3 +218,5 @@ | ||
/** @hidden */ | ||
_registerEdge(edge) { | ||
@@ -283,4 +281,2 @@ this._edges.add(edge); | ||
* Represents a node in a {@link Graph}. | ||
* | ||
* @category Graph | ||
*/ | ||
@@ -521,6 +517,7 @@ | ||
ref.addEventListener('dispose', () => { | ||
const retained = refs.filter(l => l !== ref); | ||
refs.length = 0; | ||
let index; | ||
for (const retainedRef of retained) refs.push(retainedRef); | ||
while ((index = refs.indexOf(ref)) !== -1) { | ||
refs.splice(index, 1); | ||
} | ||
@@ -604,3 +601,8 @@ this.dispatchEvent({ | ||
/** | ||
* Dispatches an event on the {@link GraphNode}, and on the associated | ||
* {@link Graph}. Event types on the graph are prefixed, `"node:[type]"`. | ||
*/ | ||
dispatchEvent(event) { | ||
@@ -607,0 +609,0 @@ super.dispatchEvent({ ...event, |
@@ -68,4 +68,2 @@ class EventDispatcher { | ||
* although that reverse lookup can be done on the graph. | ||
* | ||
* @category Graph | ||
*/ | ||
@@ -150,4 +148,2 @@ | ||
* by {@link @Link} edges. | ||
* | ||
* @category Graph | ||
*/ | ||
@@ -218,3 +214,5 @@ | ||
/** @hidden */ | ||
_registerEdge(edge) { | ||
@@ -297,4 +295,2 @@ this._edges.add(edge); | ||
* Represents a node in a {@link Graph}. | ||
* | ||
* @category Graph | ||
*/ | ||
@@ -535,6 +531,7 @@ | ||
ref.addEventListener('dispose', () => { | ||
const retained = refs.filter(l => l !== ref); | ||
refs.length = 0; | ||
let index; | ||
for (const retainedRef of retained) refs.push(retainedRef); | ||
while ((index = refs.indexOf(ref)) !== -1) { | ||
refs.splice(index, 1); | ||
} | ||
@@ -618,3 +615,8 @@ this.dispatchEvent({ | ||
/** | ||
* Dispatches an event on the {@link GraphNode}, and on the associated | ||
* {@link Graph}. Event types on the graph are prefixed, `"node:[type]"`. | ||
*/ | ||
dispatchEvent(event) { | ||
@@ -621,0 +623,0 @@ super.dispatchEvent(_extends({}, event, { |
{ | ||
"name": "property-graph", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Base for creating objects that behave like a Property Graph.", | ||
@@ -36,14 +36,14 @@ "type": "module", | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "5.58.0", | ||
"@typescript-eslint/parser": "5.58.0", | ||
"@typescript-eslint/eslint-plugin": "5.60.0", | ||
"@typescript-eslint/parser": "5.60.0", | ||
"ava": "^5.2.0", | ||
"c8": "^7.13.0", | ||
"c8": "^8.0.0", | ||
"coveralls": "3.1.1", | ||
"eslint": "8.38.0", | ||
"eslint": "8.43.0", | ||
"eslint-config-prettier": "8.8.0", | ||
"microbundle": "0.15.1", | ||
"prettier": "2.8.7", | ||
"prettier": "2.8.8", | ||
"rimraf": "^5.0.0", | ||
"ts-node": "10.9.1", | ||
"typescript": "5.0.4" | ||
"typescript": "5.1.3" | ||
}, | ||
@@ -50,0 +50,0 @@ "files": [ |
# property-graph | ||
[![Latest NPM release](https://img.shields.io/npm/v/property-graph.svg)](https://www.npmjs.com/package/property-graph) | ||
[![Minzipped size](https://badgen.net/bundlephobia/minzip/property-graph)](https://bundlephobia.com/result?p=property-graph) | ||
[![npm bundle size](https://img.shields.io/bundlephobia/minzip/property-graph)](https://bundlephobia.com/package/property-graph) | ||
[![License](https://img.shields.io/badge/license-MIT-007ec6.svg)](https://github.com/donmccurdy/property-graph/blob/main/LICENSE) | ||
@@ -6,0 +6,0 @@ [![Build Status](https://github.com/donmccurdy/property-graph/workflows/build/badge.svg?branch=main&event=push)](https://github.com/donmccurdy/property-graph/actions?query=workflow%3Abuild) |
@@ -11,4 +11,2 @@ import { EventDispatcher, GraphEdgeEvent } from './event-dispatcher.js'; | ||
* although that reverse lookup can be done on the graph. | ||
* | ||
* @category Graph | ||
*/ | ||
@@ -15,0 +13,0 @@ export class GraphEdge<Parent extends GraphNode, Child extends GraphNode> extends EventDispatcher<GraphEdgeEvent> { |
@@ -28,4 +28,2 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
* Represents a node in a {@link Graph}. | ||
* | ||
* @category Graph | ||
*/ | ||
@@ -246,5 +244,6 @@ export abstract class GraphNode<Attributes extends {} = {}> extends EventDispatcher<GraphNodeEvent> { | ||
ref.addEventListener('dispose', () => { | ||
const retained = refs.filter((l) => l !== ref); | ||
refs.length = 0; | ||
for (const retainedRef of retained) refs.push(retainedRef); | ||
let index; | ||
while ((index = refs.indexOf(ref)) !== -1) { | ||
refs.splice(index, 1); | ||
} | ||
this.dispatchEvent({ type: 'change', attribute }); | ||
@@ -321,2 +320,6 @@ }); | ||
/** | ||
* Dispatches an event on the {@link GraphNode}, and on the associated | ||
* {@link Graph}. Event types on the graph are prefixed, `"node:[type]"`. | ||
*/ | ||
dispatchEvent(event: BaseEvent): this { | ||
@@ -323,0 +326,0 @@ super.dispatchEvent({ ...event, target: this }); |
@@ -8,4 +8,2 @@ import { EventDispatcher, GraphEdgeEvent, GraphEvent, GraphNodeEvent } from './event-dispatcher.js'; | ||
* by {@link @Link} edges. | ||
* | ||
* @category Graph | ||
*/ | ||
@@ -72,2 +70,3 @@ export class Graph<T extends GraphNode> extends EventDispatcher<GraphEvent | GraphNodeEvent | GraphEdgeEvent> { | ||
/** @hidden */ | ||
private _registerEdge(edge: GraphEdge<T, T>): GraphEdge<T, T> { | ||
@@ -74,0 +73,0 @@ this._edges.add(edge); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
188337
2279