Giter VIP home page Giter VIP logo

msagljs's Introduction

msagl-js

Test Status

MSAGLJS is a JavaScript implementation of advanced graph layout algorithms.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

msagljs's People

Contributors

alt-ellyse avatar demike avatar dependabot[bot] avatar levnach avatar mcwoodleamzn avatar microsoft-github-operations[bot] avatar microsoftopensource avatar pelikhan avatar pessimistress 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

msagljs's Issues

WebGL line quality very poor

The quality of the splines/lines when using the webgl rendering is very poor compared to the svg renderen.

WebGL:
image

SVG:
image

Seems anti-aliassing is missing. Using Edge on Windows.

CommonJS or AMD dependencies

Hello. Just found this library and is awesome. I'm using it in an angular project and I receive the following warnings:

Warning: D:\work\htdocs\hubtalk2-dashboard\node_modules\@msagl\core\dist\layout\layered\layerEdge.js depends on 'typescript-string-operations'. CommonJS or AMD dependencies can cause optimization bailouts.
Warning: D:\work\htdocs\hubtalk2-dashboard\node_modules\@msagl\core\dist\math\geometry\RTree\rectangleNode.js depends on 'stack-typescript'. CommonJS or AMD dependencies can cause optimization bailouts.
Warning: D:\work\htdocs\hubtalk2-dashboard\node_modules\@msagl\core\dist\structs\graph.js depends on 'queue-typescript'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

I know I can add exceptions for those libraries in angular.json, just wanted to notice this in case you want to move to other libraries that support es6 modules.

Is it possible to use Custom HTML / SVG as edges?

I want to use this library in my React.js app and would like to render my own React components as edges.
Even custom HTML or SVG could work.

Or If it's possible to praise the coordinates of edges, I can use that to draw the graph.

Is either of this possible?

Build problem on Windows

I have a build problem, which I do not know how to solve:
Could you please help me
Thank you
Giatgen

PS C:\Temp\Autolayout\msagljs-main> npm run build

[email protected] build C:\Temp\Autolayout\msagljs-main
rm -f modules//.tsbuildinfo && rm -rf moduls/*/dist && lerna run build

'rm' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: rm -f modules/*/*.tsbuildinfo && rm -rf moduls/*/dist && lerna run build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


and with "npm run publish" I get this error:

lerna ERR! yarn run build stderr:
error Command failed with exit code 1.
lerna ERR! yarn run build exited 1 in 'msagl-js'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] publish: lerna run build && lerna publish
npm ERR! Exit status 1

Test with Webpack and SSR

The packages somehow defeat Webpack when trying to compile msagljs into a MDX component in Docusaurus.

This might be due to some deckgl dependency.

SSR: server side rendering

Fix for spline PathOptimizer::getSleeve

Good day

I was playing around with this lib and stuck with error that on this line

if (t.containsPoint(this.poly.end)) {

t is undefined It's because method private getSleeve(sourceTriangle: Tr) gets sourceTriangle === undefined. Looking in code I found that this method used only ones

    const sleeve: FrontEdge[] = this.getSleeve(this.findSourceTriangle(localCdt))
    if (sleeve == null) {

so result of this method could be null or undefined and I decided to add check for sourceTriangle like

  private getSleeve(sourceTriangle: Tr): FrontEdge[] {
    if (!sourceTriangle) return;

and error gone

Why this.findSourceTriangle(localCdt) returns undefined I don't know, but I can give you my graph in json and code how I use it.

Split renderer

Separate svg vs deckgl packages so that a svg user does not get all the deckgl dependencies.

How do I listen to mouse events on a node in WebGL renderer?

I found node related events

// For debugging
// onClick: ({sourceLayer}) => {
// // @ts-ignore
// console.log(sourceLayer.props.tile.id, sourceLayer.props.tile.data)
// },
autoHighlight: true,
onHover: ({object, sourceLayer}) => {
if (!this._highlightedNodeId) {
if (object instanceof GeomNode) {
this._highlight(object.id)
} else {
this._highlight(null)
}
}
},

certainly need to emit some mouse events here

getFeedbackSetExternal not implemented in VerticalConstraintsForSugiyama

The docs are quite sparse so not sure if this is bug or just something that is not finished yet or maybe I am doing something wrong with the configuration.

When using VerticalConstraintsForSugiyama the layout code calls getFeedbackSetExternal on the constraints object:

: verticalConstraints.getFeedbackSetExternal(this.IntGraph, this.nodeIdToIndex)

As that call just throws

throw new Error('Method not implemented.')
it seems like this is not usable at all. Not sure if this is not supposed to be used or there is something else going on here.

Git & Windows issue

FYI

In the repo there are at least 4 files that cannot be created on windows (and ruin the git use of the repo as they can't be checked out or in) due to a : (Colon) in the filename. They seem to be checked in accidently.

Example is:
msagljs\website\static\img\undraw_start_building_re_xani.svg:Zone.Identifier

Building scripts on Windows

Not a bug/issue, but it might be useful info for others trying to get up & running with msagl.js usign VSCode on Windows. Maybe it's useful for an FAQ entry.

I found that with some modifications the main scripts and examples can be build on Windows using VSCode.

After installing Node.js on Windows you should be able to run the following commands to install the build tools globally:

npm install -g yarn
npm install -g lerna
npm install -g esbuild

In the various package.json files split the "build" command into a separate clean (the linux rm/rmdir command that won't work on Windows) and build command.

After this you can either run commands as 'npm run build' or (if present) use the VSCode npm command window. Note that some of the examples end up in the website folder instead of the examples folder.

PS 1) the clean commands use wildcards that are not compatible with Windows so one would need a batch file (and call in in the clean command) to clean the repo from previous output.

PS 2) if you want to disable minifiying the scripts (for debugging purposes), modify the 'esbuild.js' file and change all '.min.js' extensions in build scrips to just '.js'.

Dark mode theming

Is there a theming strategy for generated chats?

Could there be a builtin dark mode?

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.