ngneat / dag Goto Github PK
View Code? Open in Web Editor NEW๐ An Angular service for managing directed acyclic graphs
License: MIT License
๐ An Angular service for managing directed acyclic graphs
License: MIT License
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[x] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
The demo app uses Tailwind, but there are no purge paths set up to slim down the styles
The paths should be added so that webpack/tailwind can strip unused CSS from the site
The change should be added to the tailwind.config.js file in the purge attribute.
This will make the demo app a lot smaller than it currently is.
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[x] Other... Please describe:
The demo app should be deployed to Netlify and updated if necessary on pull request merges.
The deploy should be automatic so that nobody has to remember to do this.
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
There's no way to get the count of children for a given node currently
Providing a step ID should let you know how many children belong to that step
Some UI decisions may need to be made based off the number of children for a given node. This fixes that.
nodeChildrenCount(stepId: number) {
const items: Array = this.getSingleDimensionalArrayFromModel();
const childCount = items.filter((i) => i.parentIds.includes(stepId)).length;
return childCount;
}
// Tests
it('should return the proper number of children for a given node', () => {
const items = [
{ branchPath: 1, name: 'Step 1', parentStepIds: [0], stepId: 1 },
{ branchPath: 1, name: 'Step 2', parentStepIds: [1], stepId: 2 },
{ branchPath: 2, name: 'Step 3', parentStepIds: [1], stepId: 3 },
{ branchPath: 1, name: 'Step 4', parentStepIds: [2], stepId: 4 },
{ branchPath: 2, name: 'Step 5', parentStepIds: [2], stepId: 5 },
{ branchPath: 1, name: 'Step 6', parentStepIds: [5, 3], stepId: 6 },
];
service.setNewItemsArrayAsDagModel(items);
const result1 = service.nodeChildrenCount(1);
expect(result1).toBe(2);
const result3 = service.nodeChildrenCount(3);
expect(result3).toBe(1);
});
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
Add the service to manage a DAG model, by allowing to add and remove items and having the model update properly
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[X] Support request
[ ] Other... Please describe:
Is this primarily meant as a visualization tool or a data management solution?
I am looking for a tool to generate a topological sort for a dependency graph, to establish an order of execution for interdependent tasks, and I am not clear if this solution would be useful for my use case.
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
There is no function that supports dragging a node to a new position in the model, or moving an existing node from one location to another in the model
There should be a function that allows you to pass in a step ID for an existing step and its new location. The function would then rearrange the model with the node in the updated location. There could be an option to include its children when moving, or to only move the one node.
If the children are included, then every node that comes after the location that the node is moved to will have to be potentially updated as well. If it's just the one node, and its previous children stay, then the moving node and its previous children will have to be updated.
For example, let's say we want to move node 3:
1 โ 2 โ 3 would change to 1 โ 3 โ 2
Or
1 โ 2 โ 3 โ 4 would change to 1 โ 3 โ 2 โ 4 OR 1 โ 3 โ 4 โ 2
In the second example there, with the four nodes, the desired result depends on if the node's children should be moved or not as well.
This gets more complicated as branches are introduced. If a node is being moved:
Take this model:
1
2
3 4
If we are moving node 2 and its branched children up above 1, it should end like this:
2
3 4
1
In this case, node 1 is just updated to be a child of branchPath 1. If only node 2 is moved and not its children, then it would end up like this:
2
1
3 4
And nodes 3 and 4 should be updated to have node 1 be their parent Id, and not node 2.
Some UIs will want to implement drag and drop, and this will help enable it. The service itself won't implement the drag and drop necessarily, unless in the future a component that displays the model is provided and handles drag and drop and stuff like that.
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
If you have a graph like this:
ย ย 1
2ย ย 3
And you want to add a new step above 2, but make it still have a sibling of 3 (so, have step 4 replace step 2 and have step 2 be the child of step 4):
ย ย 1
4ย ย 3
2
The service currently can't do this. It puts 4 directly below 1 and as the parent of 2 and 3:
ย ย 1
ย ย 4
2ย ย 3
4 should replace 2 in the graph and 2 should be pushed down one spot
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[x] Feature request
[x] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
There are methods for checking if connecting two nodes would be valid, but no method to actually do the connection
Add the method that connects the two nodes, calling the check method before doing the connection and updating the observable. Should be one method that updates the observable, one that just returns the single dimensional array (same as addItem and addNewStep, etc).
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
There is no current demonstration of how to use the service.
A demo app should be added to the repo that can be deployed to Netlify showing how to use the service in a real app.
[ x ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ x ] Support request
[ ] Other... Please describe:
Not able to install the module/package with Angular v14.
Latest stable version should be installable and compatible with higher Angular versions (14 and above)
Install the package in a newly generated Angular 14 project.
Compatibility issues with higher stable versions of Angular (14 and above)
Angular version: `14.2.12`
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: `16.16.10`
- Platform: `Windows`
Others:
- Package Manager: `npm 9.2.0`
- OS Version: `Windows 10 x64`
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[x] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
None of the information for the package is in the package.json
There should be information about the package in the package.json that will show up in NPM
This will give better landing page experience in NPM for users
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[x] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
The logo.svg and demo.gif are broken on the NPM page
The two images should show up and not have broken images
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[x] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
No documentation for the service currently
Add full, well written documentation describing how to use the library and set it up properly, along with some examples.
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[x] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
Explain how the add/remove functions decide what to do so that it's clear what the result will be of an add/edit method being called
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[ ] Feature request
[x] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
The Netlify demo app doesn't have redirects set up
It should redirect properly so refreshing on a subpage doesn't produce a 404
Go to the demo app, click on the demo link, and refresh
[ ] Regression (a behavior that used to work and stopped working in a new release)
[X ] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:
given a graph with 2 levels, parent level with 3 nodes, child level with 3 nodes, each pointing to all 3 parents, will duplicate the children level nodes 3 times, producing 9 steps instead of 3.
only 3 nodes in child level
[
{
"stepId": 1,
"parentIds": [0]
},
{
"stepId": 2,
"parentIds": [0]
},
{
"stepId": 3,
"parentIds": [0]
},
{
"stepId": 4,
"parentIds": [0, 2, 3, 1]
},
{
"stepId": 5,
"parentIds": [0, 2, 3, 1]
},
{
"stepId": 6,
"parentIds": [0, 2, 3, 1]
},
{
"stepId": 7,
"parentIds": [0, 6, 5, 4]
}
]
Angular version: 13
Browser:
- [X] Chrome (desktop) version latest
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [X] Firefox version 101
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: 16.14.2
- Platform: Windows
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.