Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: leaving space between grid cells #15

Open
mfrasca opened this issue Apr 19, 2021 · 3 comments
Open

Feature Request: leaving space between grid cells #15

mfrasca opened this issue Apr 19, 2021 · 3 comments

Comments

@mfrasca
Copy link

mfrasca commented Apr 19, 2021

I met this tool thanks to two massive contributions in a new built area in Panamá. I asked the author how he had produced such massive amount of data, and he pointed me to a youtube video and to this plugin.

in the video you see that DressyPear4 performs a series of very repetitive actions, which could easily be performed by this plugin.

in practice: I would like this plugin to have settings for space to be left between columns and rows in the grid it produces, so that the objects are separated by that amount of space.

@jdhoek
Copy link
Collaborator

jdhoek commented Apr 22, 2021

It sounds like a reasonable request. It's not easy to set the amount of space to fixed units though; it would have to percentages to keep it manageable. Would that work for the envisioned use cases?

I won't be able to work on this for a while though, but patches are welcome. I'll keep this feature request in mind for future updates.

@mfrasca
Copy link
Author

mfrasca commented Apr 22, 2021

I'm sure that the best contributions come in patch form! 😉
with percentages, it would be less usable in the case I'm considering. ✂️
I hope you don't object on some implementation hints? ☺️

given the information:

  • initial rectangle ABCD,
  • amount of rows and padding: rows_no, rows_gap
  • amount of columns and padding: columns_no, columns_gap

I would construct the AB'C"D' rectangle, where

  • B' is shifted by columns_gap in the AB direction,
  • D' is shifted by rows_gap in the AD direction,
  • C'' is shifted in both directions by the two amounts.

now apply your procedure on the AB'C''D' rectangle,
then reduce each resulting cell by the two gaps, at the same end as where we expanded the initial ABCD rectangle.


the trouble being that I'm not familiar with writing JOSM plugins, I guess I can add functional elements to a non-working framework. for example: when the user increases rows and columns, the limit for the gaps would change, and we could turn a gap spinner red if the corresponding value exceeds the new maximum, and make the OK button non sensitive.

@jengelh
Copy link

jengelh commented Aug 8, 2023

Alternate proposal: offer specifying cell ratios, similar to how it was done with HTML4 framesets back in the day, or "flex layouts" in contemporary APIs for constructing UIs.

  1. Switch the UI from
  Grid size
      <spinctrl> x <spinctrl>

to

  Grid size
      <spinctrl> x <spinctrl>
      X ratios: <textfield>
      Y ratios: <textfield>
  1. A user can then choose e.g. 10x6 with xratio="" and yratio="10,15,10,10,15,10". That produces a grid suitable for a parking lot consisting of 10 parking spaces × 2 parking aisles (the aisles are 1.5 times as wide as an orthogonal parking space is long). The extraneous boxes can be deleted with the normal JOSM delete function, no need for Gridify to deal with it.
    Treat an empty ratio field as 1,1,1,1,1.. repeated sufficient times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants