umap icon indicating copy to clipboard operation
umap copied to clipboard

Support date and number properties in facet search

Open flammermann opened this issue 1 year ago • 9 comments

Implementation of https://github.com/umap-project/umap/issues/1489 and https://github.com/umap-project/umap/issues/1488

flammermann avatar Dec 27 '23 23:12 flammermann

For the record, here is what the date form looks like currently in the facet form on my computer:

image

yohanboniface avatar Dec 28 '23 15:12 yohanboniface

For the record, here is what the date form looks like currently in the facet form on my computer:

Same here, Firefox support is not ideal for the moment:

Capture d’écran, le 2023-12-28 à 12 57 18

davidbgk avatar Dec 28 '23 17:12 davidbgk

Sorry, for the late response. Thanks for all the comments, will look into them now. ;)

flammermann avatar Jan 02 '24 16:01 flammermann

For the record, here is what the date form looks like currently in the facet form on my computer:

image

Yes, I found that too during my testing. It's not optimal but the user can use the date picker to choose the date and the keyboard (numbers or arrows) to enter/change the time. Also, I would expect/hope that Firefox eventually fixes their implementation to fully support datetime-local. Thus, I went with it despite the lack of support from Firefox.

flammermann avatar Jan 02 '24 16:01 flammermann

I refactored the code according to your suggestions. Support for number properties is now also given. I think the PR is in pretty good shape now. Thanks for the help and review! :)

flammermann avatar Jan 04 '24 00:01 flammermann

Could you also add some basic integration tests (in umap/test/integration) ? I'd say one basic case and one case where the data does not match the facet key.

I've pushed as basic facet search test, so you can base new ones on this :)

yohanboniface avatar Jan 04 '24 12:01 yohanboniface

hey @flammermann any time/interest in finishing this PR ? :)

yohanboniface avatar Jan 30 '24 19:01 yohanboniface

hey @flammermann any time/interest in finishing this PR ? :)

Hi @yohanboniface, yes, I am still interested in finishing it. Unfortunately, my server crashed hard (harddrive/raid failure) shortly after my last comment/commit, so I could not continue. :/ But you got perfect timing, I finished recovery and rebuilding everything last Saturday and can now finally pick up this PR again. :)

Btw. I got lucky because I could export a lot of work on one of my maps that was not yet backed up properly from the still open browser tab. ;)

flammermann avatar Jan 30 '24 22:01 flammermann

Sounds good!

Ideally, we'd need:

  • some integrations tests for basic cases: in umap/tests/integration/test_facets_browser.py, then make test or py.test -xvv umap/tests/integration/test_facets_browser.py to run only this file; for debugging PWDEBUG=1 py.test… to make playwright run tests in a headfull browser
  • some js tests for the calculateStepFromNumber util, in umap/static/umap/test/Util.js, then make testjs

Do you have time/energy for that ? Otherwise I'll do it next week.

yohanboniface avatar Mar 04 '24 15:03 yohanboniface

Work continues in #1763

yohanboniface avatar Apr 17 '24 16:04 yohanboniface