You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

brython-dragdrop

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brython-dragdrop

My package description

0.1.0
pipPyPI
Maintainers
1

Brython.Dragdrop

A library for your Brython apps to implement drag-and-drop UX (User Experience), without needing to deal with low level drag or drop event callbacks.

Usage

Here comes some high level description.

  • You create a board game's board using html tags, such as TABLE's TD.

  • You create individual pieces by using normal html tags, and then you combine them with brython_dragdrop.DraggableMixin. For example:

    class Card(brython_dragdrop.DraggableMixin, html.SPAN):
        pass
    

    Then create as many cards as you like, and make them visible in your UI.

  • You declare some area to be droppable, by defining rules. For example:

    brython_dragdrop.make_droppable(BOARD, rules={
        (Card, Card): brython_dragdrop.swap,
        (Card, html.TD): brython_dragdrop.occupy,
    })
    

    Predefined rules include:

    • swap which will swap two draggable pieces
    • join which will append dragged piece into the landing area, so that the landing area may contain more and more dragged pieces.
    • occupy which will swap the existing piece (if any) with dragged piece, or place dragged piece into the empty landing area. So that the landing area will contain up to one draggable piece.

Sample: todo.

Roadmap

  • More sophisticated API to support on-the-spot logic calculation before drop.

Keywords

brython

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.