GithubHelp home page GithubHelp logo

[Feature]: support "table" shape about tldraw HOT 3 OPEN

xuanswe avatar xuanswe commented on June 19, 2024
[Feature]: support "table" shape

from tldraw.

Comments (3)

linear avatar linear commented on June 19, 2024

TLD-2486 [Feature]: convert a grid area to a shape

from tldraw.

xuanswe avatar xuanswe commented on June 19, 2024

I would try to give my proposal on how it could be implemented.

I think this should work similar to how we draw a Rectangle shape.

  1. Select shape Rectangle
  2. Drag the mouse
  3. The start point and the end point form the rectangle

For a Table shape, we can do the same

  1. Select shape Table
  2. Drag the mouse
  3. The start point and the end point form the rectangle area where we can create a table inside this area

image

  1. The rectangle area at step 3 covers a specific grid behind it and can create the table on top of that grid

image

Note that it could work even if the user doesn't enable "Preferences > Show grid."
The app knows about the grid even if it is not shown visually.
The user doesn't need to see the grid because we can show the table shape on the fly, so user knows what is the final shape before release the mouse.

After creating the table shape, the user can easily resize as usual to scale up/down for bigger/smaller cells.

from tldraw.

xuanswe avatar xuanswe commented on June 19, 2024

Maybe I over complicated this shape when relating it with the grid system.
An easier way is just having a normal table shape.
By knowing the drag area, we can compute the number of cells per row/col of the table.
User can resize the whole shape, which will resize the cells accordingly.

=> I updated the original title/description with this simplification.

from tldraw.

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.