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

Added Position #1403

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Added Position #1403

wants to merge 10 commits into from

Conversation

ataata107
Copy link

@ataata107 ataata107 commented Dec 30, 2019

Fixes #1402

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with npm test
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • ask @publiclab/is-reviewers for help, in a comment below
  • Insert-step functionality is working correct as expected.

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

pos

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
Please make sure to get at least two reviews before asking for merging the PR as that would make the PR more reliable on our part
Thanks!

@ataata107
Copy link
Author

@publiclab/is-reviewers

@codecov
Copy link

codecov bot commented Dec 30, 2019

Codecov Report

Merging #1403 into main will increase coverage by 10.17%.
The diff coverage is 63.45%.

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1403       +/-   ##
===========================================
+ Coverage   55.11%   65.29%   +10.17%     
===========================================
  Files         117      132       +15     
  Lines        2344     2746      +402     
  Branches      360      438       +78     
===========================================
+ Hits         1292     1793      +501     
+ Misses       1052      953       -99     
Impacted Files Coverage Δ
examples/lib/scopeQuery.js 18.51% <ø> (ø)
src/Modules.js 100.00% <ø> (ø)
src/modules/WebglDistort/Module.js 2.29% <0.00%> (ø)
src/ui/SetInputStep.js 12.90% <0.00%> (-1.39%) ⬇️
src/modules/ColorHalftone/Module.js 3.63% <3.63%> (ø)
examples/lib/defaultHtmlStepUi.js 11.05% <3.70%> (-1.15%) ⬇️
examples/lib/intermediateHtmlStepUi.js 11.11% <5.55%> (+0.94%) ⬆️
examples/lib/insertPreview.js 13.15% <20.00%> (-0.36%) ⬇️
src/util/getImageDimensions.js 20.00% <20.00%> (ø)
src/util/isGif.js 20.00% <20.00%> (ø)
... and 100 more

Copy link
Member

@anthony-zhou anthony-zhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing. This looks great! I bet this feature could be useful to lots of people, but displaying it in a different way might be even better. Please take a look at the comment I made in the code. The purpose of the change I suggested is to show information on the page only when it's useful (there's no need to show position = NULL when the mouse is not on the photo). What do you think?

@@ -45,7 +45,7 @@ function DefaultHtmlStepUi(_sequencer, options) {
<div class="panel-body cal collapse in">\
<div class="row step">\
<div class="col-md-4 details container-fluid">\
<div class="cal collapse in"><p>' +
<div class="cal collapse in"><p><p>POS_X= <span class="posx">NULL</span> POS_Y= <span class="posy">NULL</span></p>' +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of POS_X and POS_Y, can it be more descriptive like

Cursor Position: (x-coord, y-coord)

@ataata107
Copy link
Author

pos2

@ataata107
Copy link
Author

Yes @anthony-zhou we shouldn't display NULL when cursor moves away. I have also put the text on top-right. Kindly Review

Copy link
Member

@anthony-zhou anthony-zhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jywarren
Copy link
Member

jywarren commented Jan 2, 2020 via email

@rishabhshuklax
Copy link
Member

How about a crosshairs icon in the card header which when clicked will trigger the function after which when hovered over the image it will give x,y cordinates in the same way it is currently showing rgb channels?

@jywarren
Copy link
Member

jywarren commented Jan 6, 2020 via email

@rishabhshuklax
Copy link
Member

We don't need position data for all the modules this way we can keep both of the features (position and rgba channel on hover) and keep the UI clean and maybe we can also show the rgba data of image the same way by using a color-picker-icon...maybe?

@jywarren
Copy link
Member

jywarren commented Jan 6, 2020 via email

@ataata107
Copy link
Author

I will do the necessary changes and will commit by tomorrow.

@ataata107
Copy link
Author

@jywarren @blurry-x-face Added the crosshair icon. It looks really cool now,
By the way I guess it should always be triggered on because we can get the idea of the RGB value and crosscheck it with the current position our cursor.

@rishabhshuklax
Copy link
Member

@ataata107 Could you please attach a working GIF?

Copy link
Member

@harshkhandeparkar harshkhandeparkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's awesome! It even works with GIFs!

@ataata107
Copy link
Author

ezgif com-video-to-gif (7)

@gitpod-io
Copy link

gitpod-io bot commented Jul 7, 2020

@jywarren
Copy link
Member

jywarren commented Aug 5, 2020

Hi, just tested this out in GitPod and although it looks amazing! I did notice the placement was a bit odd:

image

Can we try putting it in the top bar of each card, like this?

image

That way it'll work no matter what the page width is.

Thank you!!!!

@harshkhandeparkar harshkhandeparkar requested a review from a team as a code owner October 15, 2020 19:49
@jywarren
Copy link
Member

Hi @ataata107 would you be interested in making this last change and then we can merge it? Thank you!!!

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

Successfully merging this pull request may close these issues.

[Feature Update] Display Position of cursor in image
5 participants