GithubHelp home page GithubHelp logo

visjs / vis-data Goto Github PK

View Code? Open in Web Editor NEW
92.0 5.0 20.0 42.3 MB

🗄️ Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.

Home Page: https://visjs.github.io/vis-data/

JavaScript 19.69% HTML 1.67% TypeScript 78.61% Shell 0.03%

vis-data's Introduction

vis-data's People

Contributors

alexdm0 avatar bradh avatar brendon1982 avatar btmills avatar cdituri avatar cdjackson avatar ckane avatar dependabot[bot] avatar dturkenk avatar dude9177 avatar eymiha avatar felixhayashi avatar gillingham avatar greenkeeper[bot] avatar hansmaulwurf23 avatar jimmed avatar josdejong avatar kannonboy avatar lewisjb avatar ludost avatar macleodbroad-wf avatar mdxs avatar mojoaxel avatar renovate[bot] avatar thomaash avatar tzfx avatar vukk avatar wimrijnders avatar yotamberk avatar zacbrownband avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vis-data's Issues

[BUG] Update inside forEach not working

Hi. I'm currently facing an unusual behavior while updating the items of a dataset. I'm using the peer build of the vis.js network in combination with the datasets.
My edge objects that I store inside the dataset look like this (an example of one edge):

{ 
id: 185, 
from: 75, 
to: 65, 
label: '',
arrows: "to", 
color: "#FA0000", 
communicationtype: "Test", 
communicationcostValue: "1" 
}

I have an option (just a checkbox) to display the communicationcostValue at the edges. My solution is simple: I just update all edges. Here is the corresponding code (which causes the issue):

function costAtEdges(enable)
{
    if (enable)
    {
        edges.forEach(function(item, id)
        {
            item.label = item.communicationcostValue;
            edges.updateOnly(item);
        });
    } else {
        edges.forEach(function(item, id)
        {
            item.label = ' ';
            edges.updateOnly(item);
        });
    }
}

This will end in an endless loop which is eventually terminated by the browser.
I've also tried this (works fine):

var test = edges.get(44);
test.label = 'HALLO';
edges.updateOnly(test);
alert(edges.get(44).label);

Also using just forEach (without updating) also works fine
So, I assume that there is a problem with updating inside a forEach function.
I didn't try out if the map function of a dataset also causes such an issue.

Have a nice day

  • Jannis

An in-range update of prettier is breaking the build 🚨

The devDependency prettier was updated from 1.18.2 to 1.19.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: prepare: Your tests passed on CircleCI! (Details).
  • ci/circleci: test: Your tests passed on CircleCI! (Details).
  • ci/circleci: lint: Your tests failed on CircleCI (Details).
  • ci/circleci: type_check: Your tests passed on CircleCI! (Details).
  • ci/circleci: build: Your tests passed on CircleCI! (Details).

Release Notes for Prettier 1.19: Long awaited Vue option, TypeScript 3.7 and new JavaScript features

diff

🔗 Release Notes

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of typedoc is breaking the build 🚨

The devDependency typedoc was updated from 0.15.2 to 0.15.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

typedoc is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: prepare: Your tests failed on CircleCI (Details).

Release Notes for v0.15.3 - Bug fixes

Fixed 🐛

  • #1137 - <wbr> helper inserted within html character escapes
  • Upgraded handlebars to avoid arbitrary code execution vulnerability

Thanks 👏

Commits

The new version differs by 4 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet.
We recommend using:

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

An in-range update of babel7 is breaking the build 🚨

There have been updates to the babel7 monorepo:

    • The devDependency @babel/core was updated from 7.6.4 to 7.7.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

babel7 is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: prepare: Your tests passed on CircleCI! (Details).
  • ci/circleci: type_check: Your tests passed on CircleCI! (Details).
  • ci/circleci: lint: Your tests passed on CircleCI! (Details).
  • ci/circleci: test: Your tests failed on CircleCI (Details).
  • ci/circleci: build: Your tests passed on CircleCI! (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Feature request: Add a destroy method to the dataset

Hi guys, I've been working on a project with the vis-timeline and the dataset in a react environment. When the component gets removed, I'd like to destroy the datasets along with the timeline.

The timeline (and other vis components) have a destroy method, which removes all data and event listeners.

Sure, the timeline destroy will remove the event listeners it has on the dataset. If I remove the datasets first (clear(), flush()?) first, this would trigger a redraw of the timeline, which is also in the process of being destroyed. This introduces a race condition I could solve, but ideally would want to sidestep by a destroy method on the dataset itself.

What do you guys think?

postinstall

The most recent postinstall fix is not in vis-data 6.1.0.
The consequence is that when I npm install vis-timeline or vis-network I get the following error:
npm ERR! Failed at the [email protected] postinstall script.
Help! :-)

update method is not reactive

Hello. The second issue which I found. This issue is related to the timeline. See original visjs/vis-timeline#1562 (comment)

If you want to update items in real-time on the timeline, you can't to do this by update method.

For example. This code updates group but not reactively. Timelines will remain unchanged

const task = this.getTask(taskId)

task.group = newGroupId

// tasks.updateOnly(task) - doesn't work at all. See https://github.com/visjs/vis-data/issues/1014
tasks.update(task)

But if you use add/remove like this then behaviour will be expected: timeline items will be updated in real-time

const task = this.getTask(taskId)

tasks.remove(task)

task.group = newGroupId

tasks.add(task)

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet.
We recommend using:

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)

updateOnly method doesn't work properly when using Date object

See details visjs/vis-timeline#1562

update method works properly, but updateOnly loses Date object and reset it to empty object {}

p.s. Don't pay attention to vue-visjs name of package, I use wrapper for vue. It is ok, I checked it on just vis-data

vue-visjs.esm.js:15300 Uncaught TypeError: Cannot convert object of type Object to type Date
    at convert (vue-visjs.esm.js:15300:181)
    at vue-visjs.esm.js:15334:238
    at Array.reduce (<anonymous>)
    at vue-visjs.esm.js:15334:210
    at Array.map (<anonymous>)
    at vue-visjs.esm.js:11424:44
    at vue-visjs.esm.js:11341:14
    at Array.reduce (<anonymous>)
    at SimpleDataPipe._transformItems (vue-visjs.esm.js:11340:31)
    at SimpleDataPipe._update (vue-visjs.esm.js:11366:30)

Remove Shapes4FREE icons

These icons are never used and atop of that their license doesn't allow redistribution. They should be removed from the codebase.

These icons are in docs/img/external-link-icons.

Compile error in data-interface.d.ts

When trying to compile vis-data, the following errors appear on the terminal.

Component: vis-data
vis-data Version: 7.1.4
Typescript: 4.8.3
Angular: 14
NPM: 8.19.2
Node: 18.1.0
Created Bug Report on OS and Browser: Microsoft 10 Enterprise, Microsoft Edge

ERRORS:

Error: node_modules/vis-data/declarations/data-interface.d.ts:62:23 - error TS2344: Type 'Item' does not satisfy the constraint
'Partial<Record<IdProp, OptId>>'.

62 oldData: FullItem<Item, IdProp>[];
~~~~

node_modules/vis-data/declarations/data-interface.d.ts:58:37
58 export interface UpdateEventPayload<Item, IdProp extends string> {
~~~~
This type parameter might need an extends Partial<Record<IdProp, OptId>> constraint.

Error: node_modules/vis-data/declarations/data-interface.d.ts:68:20 - error TS2344: Type 'Item' does not satisfy the constraint
'Partial<Record<IdProp, OptId>>'.

68 data: FullItem<Item, IdProp>[];
~~~~

node_modules/vis-data/declarations/data-interface.d.ts:58:37
58 export interface UpdateEventPayload<Item, IdProp extends string> {
~~~~
This type parameter might need an extends Partial<Record<IdProp, OptId>> constraint.

Error: node_modules/vis-data/declarations/data-interface.d.ts:75:23 - error TS2344: Type 'Item' does not satisfy the constraint
'Partial<Record<IdProp, OptId>>'.

75 oldData: FullItem<Item, IdProp>[];
~~~~

node_modules/vis-data/declarations/data-interface.d.ts:71:37
71 export interface RemoveEventPayload<Item, IdProp extends string> {
~~~~
This type parameter might need an extends Partial<Record<IdProp, OptId>> constraint.

Error: node_modules/vis-data/declarations/data-set-part.d.ts:8:102 - error TS2344: Type 'Item' does not satisfy the constraint
'Partial<Record<IdProp, OptId>>'.

8 export declare abstract class DataSetPart<Item, IdProp extends string> implements Pick<DataInterface<Item, IdProp>, "on" > | "off"> {
~~~~

node_modules/vis-data/declarations/data-set-part.d.ts:8:43
8 export declare abstract class DataSetPart<Item, IdProp extends string> implements Pick<DataInterface<Item, IdProp>, "on" |
"off"> {

This type parameter might need an extends Partial<Record<IdProp, OptId>> constraint.

tsconfig.json

{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2017",
"module": "es2020",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2020",
"dom"
]
},
"angularCompilerOptions": {
// "enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true,
"fullTemplateTypeCheck": true,
"strictPropertyInitialization": false
}
}

Unmet Peer Dependency

I just upgraded to vis-data v6.5.0.

When I run npm install, it displays this warning message:
npm WARN [email protected] requires a peer of vis-util@^2.1.0 but none is installed. You must install peer dependencies yourself.

Looking at the package.json of vis-data (v6.5.0), it shows vis-util@^2.1.0 as a peerDependency and [email protected] as a devDependency. My app runs fine if I just use [email protected], but I wanted to see if this is a mistake or if I'm really supposed to have vis-util@^2.1.0 installed to support [email protected].

A similar issue seems to be present in [email protected] (I know they have a different repo, but figured I would mention it here).

Thanks!

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet.
We recommend using:

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency rimraf to v5.0.7
  • chore(deps): update dependency eslint to v8.57.0
  • chore(deps): update dependency mocha to v10.4.0
  • chore(deps): update dependency eslint to v9
  • chore(deps): update dependency sinon to v18
  • chore(deps): update node.js to v22
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

circleci
.circleci/config.yml
  • cimg/node 21.2.0-browsers
  • cimg/node 21.2.0-browsers
  • cimg/node 21.2.0-browsers
npm
package.json
  • @babel/plugin-proposal-object-rest-spread 7.20.7
  • @egjs/hammerjs 2.0.17
  • @types/chai 4.3.11
  • @types/mocha 10.0.6
  • @types/node ^20.9.0
  • @types/sinon 17.0.2
  • @types/uuid 9.0.7
  • component-emitter 2.0.0
  • eslint 8.55.0
  • git-authors-cli 1.0.47
  • husky 8.0.3
  • lint-staged 15.2.0
  • mocha 10.2.0
  • nyc 15.1.0
  • rimraf 5.0.5
  • sazerac 2.0.0
  • sinon 17.0.1
  • snap-shot-it 7.9.10
  • typedoc 0.25.4
  • uuid 9.0.1
  • vis-dev-utils 4.0.41
  • vis-util 5.0.7
  • uuid ^3.4.0 || ^7.0.0 || ^8.0.0 || ^9.0.0
  • vis-util ^5.0.1

  • Check this box to trigger a request for Renovate to run again on this repository

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot 📦🚀

Update dependency uuid to version 9

Hello ✋,

There is an active pull request for the update of the dependency uuid to version 9.
It is not a breaking change and it is a good idea to merge it because it creates an error to merge the vis-timeline project.

🔗 visjs/vis-timeline#1518

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/uuid
npm ERR!   dev uuid@"9.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer uuid@"^7.0.0 || ^8.0.0" from [email protected]
npm ERR! node_modules/vis-data
npm ERR!   dev vis-data@"7.1.4" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/uuid
npm ERR!   peer uuid@"^7.0.0 || ^8.0.0" from [email protected]
npm ERR!   node_modules/vis-data
npm ERR!     dev vis-data@"7.1.4" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /tmp/renovate-cache/others/npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/renovate-cache/others/npm/_logs/2022-10-10T14_38_12_681Z-debug-0.log

Dataset.Max | Dataset.Min not working with dates/moment

vis-component: [email protected]

The new dataset implementation of max/min does not work with dates/moments

A short example showing the issue:
var dataset = new vis.DataSet(); var items = [{id : 1, date: moment("1995-12-25")}, {id : 2, date: moment("2000-12-25")}, {id : 3, date: moment("2019-12-25")}] dataset.add(items) dataset.max("date"); // returns null --> expected {id : 3, date: moment("2019-12-25")} dataset.max("id"); // returns {id : 3, date: moment("2019-12-25")}

[BUG] updateOnly will delete arrows

Hi. After my last issue I faced a funny one.
The updateOnly function of the dataset will remove the arrows property of an object. The update function works fine. This is typically not an issue because the arrows will still get drawn after updating. To really reload the data the network needs to be destroyed and then restarted. So I guess that no one ever noticed this issue.

Here is the code that I used:

<!DOCTYPE html>

<html>
	<head>
		<script type="text/javascript" src="https://unpkg.com/vis-data@latest/peer/umd/vis-data.min.js"></script>
		<script type="text/javascript" src="https://unpkg.com/vis-network@latest/peer/umd/vis-network.min.js"></script>
		<link rel="stylesheet" type="text/css" href="https://unpkg.com/vis-network/styles/vis-network.min.css" />
	</head>
	<body></body>
</html>

<script type="text/javascript">
var myData = new vis.DataSet([
  { id: 1, from: 1, to: 3, arrows: 'to' },
]);

alert(myData.get(1).arrows);

var item = myData.get(1);
myData.updateOnly(item);

alert(myData.get(1).arrows);
</script>

The first alert says "to". The second one "undefined".

I also logged the entire dataset into the console. The arrows property is simply gone. All other properties are still there.

The update function by the way works fine. If you replace "updateOnly" with "update" inside the code above, the first and second altert says "to" and when logging the entire dataset into console, the arrows property is still there.

Have a nice day

  • Jannis

#private declaration in dts messes up es5 builds

Hi,
In versions >= 7.0.0, the added #private declaration breaks es5 builds.

ERROR in node_modules/vis-data/declarations/queue.d.ts:40:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.

40     #private;
       ~~~~~~~~
node_modules/vis-data/declarations/data-set-part.d.ts:9:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.

9     #private;
      ~~~~~~~~
node_modules/vis-data/declarations/data-stream.d.ts:13:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.

13     #private;
       ~~~~~~~~
node_modules/vis-data/declarations/data-set.d.ts:92:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.

92     #private;
       ~~~~~~~~
node_modules/vis-data/declarations/data-pipe.d.ts:75:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.

75     #private;
       ~~~~~~~~
node_modules/vis-data/declarations/data-view.d.ts:65:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.

65     #private;
       ~~~~~~~~

Not sure if this is something that is expected, or if you are to support es5 builds. Alternatively, how should one proceed to fix this issue?

Vis-data failing on newest typescript

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/vis-data/declarations/data-interface.d.ts b/node_modules/vis-data/declarations/data-interface.d.ts
index 6646376..1d80495 100644
--- a/node_modules/vis-data/declarations/data-interface.d.ts
+++ b/node_modules/vis-data/declarations/data-interface.d.ts
@@ -55,7 +55,7 @@ export interface AddEventPayload {
     items: Id[];
 }
 /** Update event payload. */
-export interface UpdateEventPayload<Item, IdProp extends string> {
+export interface UpdateEventPayload<Item extends Partial<Record<IdProp, OptId>>, IdProp extends string> {
     /** Ids of updated items. */
     items: Id[];
     /** Items as they were before this update. */
@@ -68,7 +68,7 @@ export interface UpdateEventPayload<Item, IdProp extends string> {
     data: FullItem<Item, IdProp>[];
 }
 /** Remove event payload. */
-export interface RemoveEventPayload<Item, IdProp extends string> {
+export interface RemoveEventPayload<Item extends Partial<Record<IdProp, OptId>>, IdProp extends string> {
     /** Ids of removed items. */
     items: Id[];
     /** Items as they were before their removal. */
@@ -80,7 +80,7 @@ export interface RemoveEventPayload<Item, IdProp extends string> {
  * @typeParam Item - Item type that may or may not have an id.
  * @typeParam IdProp - Name of the property that contains the id.
  */
-export interface EventPayloads<Item, IdProp extends string> {
+export interface EventPayloads<Item extends Partial<Record<IdProp, OptId>>, IdProp extends string> {
     add: AddEventPayload;
     update: UpdateEventPayload<Item, IdProp>;
     remove: RemoveEventPayload<Item, IdProp>;
@@ -91,7 +91,7 @@ export interface EventPayloads<Item, IdProp extends string> {
  * @typeParam Item - Item type that may or may not have an id.
  * @typeParam IdProp - Name of the property that contains the id.
  */
-export interface EventPayloadsWithAny<Item, IdProp extends string> extends EventPayloads<Item, IdProp> {
+export interface EventPayloadsWithAny<Item extends Partial<Record<IdProp, OptId>>, IdProp extends string> extends EventPayloads<Item, IdProp> {
     "*": ValueOf<EventPayloads<Item, IdProp>>;
 }
 /**
@@ -100,7 +100,7 @@ export interface EventPayloadsWithAny<Item, IdProp extends string> extends Event
  * @typeParam Item - Item type that may or may not have an id.
  * @typeParam IdProp - Name of the property that contains the id.
  */
-export interface EventCallbacks<Item, IdProp extends string> {
+export interface EventCallbacks<Item extends Partial<Record<IdProp, OptId>>, IdProp extends string> {
     /**
      * @param name - The name of the event ([[EventName]]).
      * @param payload - Data about the items affected by this event.
@@ -126,7 +126,7 @@ export interface EventCallbacks<Item, IdProp extends string> {
  * @typeParam Item - Item type that may or may not have an id.
  * @typeParam IdProp - Name of the property that contains the id.
  */
-export interface EventCallbacksWithAny<Item, IdProp extends string> extends EventCallbacks<Item, IdProp> {
+export interface EventCallbacksWithAny<Item extends Partial<Record<IdProp, OptId>>, IdProp extends string> extends EventCallbacks<Item, IdProp> {
     /**
      * @param name - The name of the event ([[EventName]]).
      * @param payload - Data about the items affected by this event.
diff --git a/node_modules/vis-data/declarations/data-set-part.d.ts b/node_modules/vis-data/declarations/data-set-part.d.ts
index ffb28f9..55b1c10 100644
--- a/node_modules/vis-data/declarations/data-set-part.d.ts
+++ b/node_modules/vis-data/declarations/data-set-part.d.ts
@@ -1,11 +1,11 @@
-import { DataInterface, EventCallbacksWithAny, EventPayloads, Id } from "./data-interface";
+import { DataInterface, EventCallbacksWithAny, EventPayloads, Id, OptId } from "./data-interface";
 /**
  * [[DataSet]] code that can be reused in [[DataView]] or other similar implementations of [[DataInterface]].
  *
  * @typeParam Item - Item type that may or may not have an id.
  * @typeParam IdProp - Name of the property that contains the id.
  */
-export declare abstract class DataSetPart<Item, IdProp extends string> implements Pick<DataInterface<Item, IdProp>, "on" | "off"> {
+export declare abstract class DataSetPart<Item extends Partial<Record<IdProp, OptId>>, IdProp extends string> implements Pick<DataInterface<Item, IdProp>, "on" | "off"> {
     private readonly _subscribers;
     protected _trigger(event: "add", payload: EventPayloads<Item, IdProp>["add"], senderId?: Id | null): void;
     protected _trigger(event: "update", payload: EventPayloads<Item, IdProp>["update"], senderId?: Id | null): void;

This issue body was partially generated by patch-package.

An in-range update of rollup is breaking the build 🚨

The devDependency rollup was updated from 1.27.6 to 1.27.7.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rollup is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: prepare: Your tests failed on CircleCI (Details).

Release Notes for v1.27.7

2019-12-01

Bug Fixes

  • Fix a scenario where a reassignments to computed properties were not tracked (#3267)

Pull Requests

Commits

The new version differs by 4 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Release 7.1.1 breaks Storybook / Webpack 4

We tried to update to release 7.1.1 and get the following webpack error when trying to build our storybook-sample

ERROR in .../node_modules/vis-data/esnext/esm/vis-data.js 1239:29
Module parse failed: Unexpected token (1239:29)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|             if (id != null) {
|                 // a single item
>                 return item ?? null;
|             }
|             else {

The reason is that webpack 4 does support this ES2020 syntax.

ES5 not supported

vis-data Due to some ES6 syntax not supporting lower versions of Vue2, a compilation error occurred. The ES6 syntax reported in the error is:??

uglify-js.minify failure in vis-data\peer\umd 7.1.9

I use uglify.js to squelch all my third-party components into a single file. I recently upgraded vis-data to 7.1.9. uglify.js now reports an error in ...\node_modules\vis-data\peer\umd.

This is the error as reported in WebStorm debug (file13.js being vis-data/peer/umd/vis-data.js):

{
  "message": "Unexpected token: operator (?)",
  "filename": "file13.js",
  "line": 4453,
  "col": 50,
  "pos": 152249
}

and indeed if you browse there your see a double question mark:
Screenshot - 19_12_2023 , 13_01_09

issue removing values using update()

Let's say you just updated a node:
nodes.update({ id: 1, title: 'my title' })

and than try to remove it (you can't):
nodes.update({ id: 1, title: undefined })
nodes.update({ id: 1, title: null })
nodes.update({ id: 1, title: '' })

A workaround is to use:
nodes.update({ id: 1, title: ' ' }) // space added

An in-range update of @typescript-eslint/eslint-plugin is breaking the build 🚨

The devDependency @typescript-eslint/eslint-plugin was updated from 2.9.0 to 2.10.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@typescript-eslint/eslint-plugin is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: prepare: Your tests passed on CircleCI! (Details).
  • ci/circleci: test: Your tests passed on CircleCI! (Details).
  • ci/circleci: lint: Your tests failed on CircleCI (Details).
  • ci/circleci: type_check: CircleCI is running your tests (Details).
  • ci/circleci: build: CircleCI is running your tests (Details).

Release Notes for v2.10.0

2.10.0 (2019-12-02)

Bug Fixes

  • eslint-plugin: [no-empty-function] add missed node types (#1271) (e9d44f5)
  • eslint-plugin: [no-untyped-pub-sig] ignore set return (#1264) (6daff10)
  • eslint-plugin: [no-unused-expressions] ignore directives (#1285) (ce4c803)
  • eslint-plugin: [prefer-optional-chain] allow $ in identifiers (c72c3c1)
  • eslint-plugin: [prefer-optional-chain] handle more cases (#1261) (57ddba3)
  • eslint-plugin: [return-await] allow Any and Unknown (#1270) (ebf5e0a)
  • eslint-plugin: [strict-bool-expr] allow nullish coalescing (#1275) (3b39340)
  • typescript-estree: make FunctionDeclaration.body non-null (#1288) (dc73510)

Features

  • eslint-plugin: [no-empty-func] private/protected construct (#1267) (3b931ac)
  • eslint-plugin: [no-non-null-assert] add suggestion fixer (#1260) (e350a21)
  • eslint-plugin: [no-unnec-cond] support nullish coalescing (#1148) (96ef1e7)
  • eslint-plugin: [prefer-null-coal] opt for suggestion fixer (#1272) (f84eb96)
  • experimental-utils: add isSpaceBetween declaration to Sou… (#1268) (f83f04b)
Commits

The new version differs by 16 commits.

  • 5adb8a2 chore: publish v2.10.0
  • 065393b docs(eslint-plugin): typo in the configs README (#1295)
  • 96ef1e7 feat(eslint-plugin): [no-unnec-cond] support nullish coalescing (#1148)
  • e350a21 feat(eslint-plugin): [no-non-null-assert] add suggestion fixer (#1260)
  • ce4c803 fix(eslint-plugin): [no-unused-expressions] ignore directives (#1285)
  • f84eb96 feat(eslint-plugin): [prefer-null-coal] opt for suggestion fixer (#1272)
  • dc73510 fix(typescript-estree): make FunctionDeclaration.body non-null (#1288)
  • 3b39340 fix(eslint-plugin): [strict-bool-expr] allow nullish coalescing (#1275)
  • ebf5e0a fix(eslint-plugin): [return-await] allow Any and Unknown (#1270)
  • e9d44f5 fix(eslint-plugin): [no-empty-function] add missed node types (#1271)
  • 3b931ac feat(eslint-plugin): [no-empty-func] private/protected construct (#1267)
  • c72c3c1 fix(eslint-plugin): [prefer-optional-chain] allow $ in identifiers
  • f83f04b feat(experimental-utils): add isSpaceBetween declaration to Sou… (#1268)
  • 57ddba3 fix(eslint-plugin): [prefer-optional-chain] handle more cases (#1261)
  • 6daff10 fix(eslint-plugin): [no-untyped-pub-sig] ignore set return (#1264)

There are 16 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Typescript compile error in data-interface.ts

I'm trying to use this along with vis-network for a project with typescript, but I keep getting the following error:

export type DeepPartial<T> = T extends any[] | Function | Node

node_modules/vis-data/declarations/data-interface.d.ts:33:67 - error TS2304: Cannot find name 'Node'.

33 export declare type DeepPartial<T> = T extends any[] | Function | Node ? T : T extends object ? {
                                                                     ~~~~

Removing Node seems to fix the issue, but I'm not sure if it won't break something else.

Remove props from items in data sets

import { expect } from "chai";
import { DataSet, DELETE } from "vis-data/peer";

const ds = new DataSet<Item, "id">(
  [{ id: 7, foo: "7", bar: true }],
  { fieldId: "id" }
);

ds.updateOnly({ id: 7, foo: DELETE });

expect(gs.get(7)).to.deep.equal({
  id: 7,
  bar: true,
});

Closes visjs/vis-network#739.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.