Code Monkey home page Code Monkey logo

Comments (5)

mariusandra avatar mariusandra commented on July 28, 2024

Hey, that would be a cool feature, as long as it's disabled by default of course :).

For pointers on how to do it, look at http://interactjs.io/ . It's the library we currently use for all the resize/move/touch interactions. It also supports dropzones.

Good luck!

from react-calendar-timeline.

DanielRuf avatar DanielRuf commented on July 28, 2024

Also works with react-dnd without any issues. You need drag elements and wrap the target / drop element around the timeline. Get the offset of the dragged item over the timeline, calculate the start time using this information and push a new item to the state on drop.

from react-calendar-timeline.

foufee avatar foufee commented on July 28, 2024

In my clone of the repo is an initial attempt of this. I've added a bunch of callbacks on the Timeline props object that will allow a user to be notified when dropping a draggable on any of the groups, or when dropping a draggable from outside the timeline onto any of the horizontal lines in the timeline.
Also I added contextMenu, and selection callbacks for the timeline HLines and the groups.

The demo index.html shows most of the features off (a bit crudely at the moment though).

I feel a bit more cleaning up and refactoring could be done (a lot of the code is similar between HorizontalLine and Group), but I'm on a tight deadline and need to progress with other stuff at the moment (it's close enough at the moment for me)

I would be interested in any feedback you have.

Cheers

from react-calendar-timeline.

bkniffler avatar bkniffler commented on July 28, 2024

I'd be very interested in this @foufee and I imagine this could fit in great into this project, would you consider making this a PR?

from react-calendar-timeline.

mcMickJuice avatar mcMickJuice commented on July 28, 2024

Closing due to inactivity

from react-calendar-timeline.

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.