question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

abstract tools UI from tools functions to allow for alternative UIs

See original GitHub issue

We have a general need to brainstorm new UI designs for tools as more tools are added. Maybe nested menus or a modal for more tools, as the menu runs out of space?

But to explore this, I’d like to propose that we separate the tools UI from the tool functions themselves.

By abstracting the tools UI from tools functions, we’d allow for alternative tools UIs to be attached instead of default Toolbar; an alternative to the above syntax might be to pass in the toolbar as a parameter, like:

var altToolsUI = new SomeOtherToolsUI();

img = new L.DistortableImageOverlay(
        'example.jpg', {
          tools: altToolsUI,
          corners: [
            new L.latLng(51.52,-0.10),
            new L.latLng(51.52,-0.14),
            new L.latLng(51.50,-0.10),
            new L.latLng(51.50,-0.14)
          ]
        }
).addTo(map);

…with the current toolbar as the default if it’s not set.

Or, we could do:

img = new L.DistortableImageOverlay(
        'example.jpg', {
          corners: [
            new L.latLng(51.52,-0.10),
            new L.latLng(51.52,-0.14),
            new L.latLng(51.50,-0.10),
            new L.latLng(51.50,-0.14)
          ]
        }
)
  .addTools(altToolsUI)
  .addTo(map);

Then, the actual functions like Scale and Rotate and others would remain in this file:

https://github.com/publiclab/Leaflet.DistortableImage/blob/0bce3c41ae2d598221f873b3d3d2866541a3e03d/src/edit/DistortableImage.Edit.js#L97

while the UI would bind to those functions in this default toolbar or another UI:

https://github.com/publiclab/Leaflet.DistortableImage/blob/0bce3c41ae2d598221f873b3d3d2866541a3e03d/src/edit/DistortableImage.EditToolbar.js#L73-L93

Ideas welcome here!

Relates to #112 which allows for separate Rotate/Scale tools.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
rexagodcommented, Mar 18, 2019

@jywarren @sashadev-sky I think we can migrate this over to #170 now. Please have a look!

Thanks!

1reaction
sashadev-skycommented, Mar 12, 2019

@jywarren Ok I am going to add this as another todo on the multiple image select PR I have open. That way when I finish implementing functionality I will remember to open the issue. Is that ok?

Read more comments on GitHub >

github_iconTop Results From Across the Web

The 6 best wireframe tools in 2022 - Zapier
Sketch, our pick for the best wireframe tool for detailed, ... Its interface is far simpler and more intuitive than vector design ...
Read more >
User Interface Tool - an overview | ScienceDirect Topics
Most software applications and many Web sites are built using graphical user interface (GUI) development tools. Such tools provide a set of controls—also...
Read more >
Authoring Tool Accessibility Guidelines (ATAG) 2.0 - W3C
The Authoring Tool Accessibility Guidelines (ATAG) 2.0 provides guidelines for designing web content authoring tools that are both more ...
Read more >
Usability 101: Introduction to Usability - Nielsen Norman Group
What — Definition of Usability · Learnability: How easy is it for users to accomplish basic tasks the first time they encounter the...
Read more >
Top 13 Tools for Researchers in 2022 - Bit Blog
All-in-all, Bit is a must-have writing tool for researchers and authors! Bit.ai Home Page CTA. Key Features of Bit: Workspaces to store different...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found