Giter Club home page Giter Club logo

Comments (9)

panthernet avatar panthernet commented on July 20, 2024

So you want to implement smth like virtual grid that can be turned on/off and vertices can be aligned to that grid on demand? Am i correct?

from graphx.

jorgensigvardsson avatar jorgensigvardsson commented on July 20, 2024

Yeah, exactly! If you have little time, I can give it a stab.

from graphx.

panthernet avatar panthernet commented on July 20, 2024

This can be a handy feature, you can try to implement it :) I think it's all about DragBehaviour class as it is responsible for vertex movement, but not sure how to handle grid visualization if you'll want to implement it.

from graphx.

jorgensigvardsson avatar jorgensigvardsson commented on July 20, 2024

I'll have a look at the drag behaviour class this evening (this rare unbooked evening!) 😆

I'll probably do it in three steps:

  1. Get snapping in place (both against virtual grid and neighbors)
  2. Get drawing of snap grid working
  3. Get drawing of "virtual snap lines" against neighbors working

Of course, these changes will have an effect on the API, but I think they'll add to it, rather than change and/or delete from it.

About snap grid: I will not let the user set a size for the grid. I will make it use multiples of some constant (say 5 pixels). That way, I can adapt the grid dynamically depending on the zoom factor. Since GraphX is not an "exact drawing program", I think a dynamic grid should suffice the needs of most users that only want to organize nodes on the screen. What do you think?

from graphx.

panthernet avatar panthernet commented on July 20, 2024

Yeah, i think there will be minimal breaking changes needed for an API. Overall this thing looks good and will represent nice feature for GraphX :) Dynamic grid should be the right solution as it seems casual for usage and pro to develope at the same time. If you need any help/questions please let me know, currently i'm quite busy with my main work but i'll try to help in any way.

from graphx.

birbilis avatar birbilis commented on July 20, 2024

Sometimes instead of drawing grid lines they draw dots in the background where grid lines would intersect

from graphx.

panthernet avatar panthernet commented on July 20, 2024

Thanks for the tip! This could be an option.

from graphx.

birbilis avatar birbilis commented on July 20, 2024

in fact, such dots could even be custom objects at an extreme (more optimal though is maybe to have the API accept an object that knows to size and draw the "dot" - then could even have a "drawer" implementation that accepts XAML or a UIElement, draws it into a buffer and just paints that image [with transparency] every time it as asked to)

from graphx.

panthernet avatar panthernet commented on July 20, 2024

Implemented in a basic variation

from graphx.

Related Issues (20)

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.