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

Show a legend for barplot layers using length scaling #354

Closed
fedarko opened this issue Aug 26, 2020 · 0 comments · Fixed by #357
Closed

Show a legend for barplot layers using length scaling #354

fedarko opened this issue Aug 26, 2020 · 0 comments · Fixed by #357

Comments

@fedarko
Copy link
Collaborator

fedarko commented Aug 26, 2020

This would just show the min / max value of the field used for length scaling. It'd be a nice way to convey some extra information to the user, and could help with determining what an adequate min / max length for the visualization should be: for example, in the MP dataset Confidence field, the min value is ~0.688 (with the max being ~0.999), so it makes sense to set the minimum length to 69 if the max length is 100 (rather than using the default min length of 1).

I already have a demo of this ready on a branch continuing from #340 (see screenshot below). However, it required some refactoring, so I think it'd make sense to merge #340 in first and then add this in when it's ready in a few days.

fancyleg

@fedarko fedarko self-assigned this Aug 26, 2020
fedarko added a commit to fedarko/empress that referenced this issue Aug 26, 2020
(still gotta test and document the new code, ofc)
kwcantrell pushed a commit that referenced this issue Aug 31, 2020
…gth-scaling (#357)

* ENH: draw circular layout fm barplots! (hacky tho)

* BUG/ENH: correctly set "maxX" in c.bps+use 2 rects

* ENH: make s.m. barplots work in circular layout

how is this actually not that bad what

* DOC: upd8 comment

* DOC: update README re #297

* DOC: document polar -> Cartesian stuff

* DOC/PERF: mark some places to speed up cbarplots

since this kinda uh crashes the EMP tree LMAO

* PERF: reduce unnecessary work in c.barplot drawing

* PERF: chop out more work in c.sm.b. drawing

* MNT: abstract some more c. barplot drawing code

* DOC: document new util funcs for circ barplots

* DOC: clean up inner/outer radius terminology

* Typo fixes

* MNT: max X -> max displacement in bp drawing code

a more elegant way of representing this for circ barplots

* DOC: document precomputed y/angle stuff

* STY: pret

* MNT: shorten nodeAngleInfo var to just angleInfo

* MNT: Catch bad-layout case in _getNodeAngleInfo()

* ENH: Update "barplot unavail" msg re circ barplots

I would still like to add some tests to the coordinate functions,
but I think this is sufficient to close #297.

* PERF: don't draw barplots by dflt (close #343)

* DOC: punctuation

* TST: Test _getNodeAngleInfo()

* TST: add early addCircularBarCoords tst

* TST: finish x-coord circ bar coord test

just gotta test y-coords, with a similar switch stmt

* STY: prettify test

* TST: finish _addCircularBarCoords() test

* TST/MNT: abstract redundant test code

also add approxEqual func which I FEEL LIKE I ALREADY ADDED
but w/e

* TST/DOC: ref toFixedIfy et al in js layout tsts

* MNT: rm check for unsupported layouts in bpdrawing

* DOC: update comments in drawBarplots() start

* TST: Add more context/detail to circ bar comp tst

* DOC: clarify comment

* PERF: don't compute halfAngleRange w rect barplots

Makes things a bit more efficient.

* STY: prettify test error msg

* MNT: abstract rect coord-adding to sep func

* TST: test _addRectangularBarCoords()

* ENH: add length barplot legends; close #354

(still gotta test and document the new code, ofc)

* MNT: Simplify+doc layer drawing code re lenlegends

* TST: Clarify test util funcs

* DOC/TST: refurbish testing utilities docs

* TST: unbreak assignBarplotLengths() tests

* DOC/TST: polish up and test assignBarplotLengths

esp the new functionality. but also i apparently wasn't testing
non-numeric and numeric combos! that's wack. so now that's tested.

* TST: unbreak circ layout js tests

(since nodes are now just referred to by postorder positions)

* DOC: document more length legend stuff

* TST: test Legend.addLengthKey()

* STY: fix improperly named variable - jshint thing

* DOC: fix outdated comment

thanks @ElDeveloper!

* MNT: Simplify maxD computation in drawBarplots()

Thanks @ElDeveloper!

* DOC: fix old node desc in _getNodeAngleInfo()

thanks @kwcantrell!

* DOC: max displacement (not just x) in fm/sm coords

Forgot to update the docs. Thanks @kwcantrell for pointing this out.

Also changed a small block of code to just compute thisLayerMaxD
once and not like 3 times (?? why was I doing that lol)

* MNT: Compute max displacement in getLayoutInfo()

So that this is only done once per layout.

Addresses comment from @kwcantrell.

* STY: add missing semicolon

* TST: restructure approxDeepEqual funcs to use math

... and not stringification :P

Default epsilon is 1e-5, but for a few tests I only bothered writing
things out to 4 decimal places, so for these I use 1e-4.

* TST/STY: clean up utilities for testing

* DOC: tidy up max displacement wording

* BUG: Fix error when searching for invalid name

* DOC: update getNodesWithName() docs

* TST: fix approxDeepEqualMulti docs

thanks @ElDeveloper

* DOC: Update maxDisplacement description

thanks @kwcantrell

* MNT: add .gitattributes file marking vendored code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant