-
Notifications
You must be signed in to change notification settings - Fork 50
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
ENH: Adding vector visualization for biplots #352
Conversation
The test build for this pull request can be found here: http://emperor.colorado.edu/pull_352/make_emperor/ |
@@ -1,5 +1,5 @@ | |||
#!/usr/bin/env python | |||
# File created on 06 Jul 2012 | |||
# File reated on 06 Jul 2012 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup ... That was dumb ...
@@ -735,6 +736,7 @@ function colorChanged(catValue,color) { | |||
function colorChangedForTaxaSpheres(color){ | |||
for (index in g_plotTaxa){ | |||
g_plotTaxa[index].material.color.setHex(color) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this extra white-space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping on this and the other extra whitespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still this extra whitespace.
I like this a lot, thanks!!
👍 and I think we would need this as part of this PR (let me know if you need help, I'm super happy to Skpye/Hangouts), otherwise people who wanted to remove the vectors (and reproduce previous plots) would not be able to do it.
This is something we have discussed a lot. There's #59, #61 and #75. If you don't think what you mean would be covered by any of this issues, please feel free to add a new issue. Overall the PR looks great, I made a few minor comments and there's a few things that would be missing:
|
Also modified toggleBiplotVisitbility function to condense visibility functionality into a single function
"""Test correct formatting of the footer string""" | ||
# footer for a jackknifed pcoa plot without biplots | ||
out_string = format_emperor_html_footer_string(False, True) | ||
self.assertEqual(out_string, EXPECTED_FOOTER_A) | ||
self.assertItemsEqual(out_string.split('/'), EXPECTED_FOOTER_A.split('/')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand what this change is doing, would you mind elaborating?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its just a way to make debugging easier. Before, an entire HTML page would be dumped on the page. Using this will allow only portions of differing HTML to be displayed.
It isn't a big deal though - I can remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, this makes sense! A follow-up question, why did you choose '/'?
'\n' makes more sense to me, but then again, I haven't yet used this in
a real-case scenario.
On (Mar-04-15|15:37), mortonjt wrote:
"""Test correct formatting of the footer string""" # footer for a jackknifed pcoa plot without biplots out_string = format_emperor_html_footer_string(False, True)
self.assertEqual(out_string, EXPECTED_FOOTER_A)
self.assertItemsEqual(out_string.split('/'), EXPECTED_FOOTER_A.split('/'))
Its just a way to make debugging easier. Before, an entire HTML page would be dumped on the page. Using this will allow only portions of differing HTML to be displayed.
It isn't a big though - I can remove it.
Reply to this email directly or view it on GitHub:
https://github.com/biocore/emperor/pull/352/files#r25826331
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a random common letter ('/' occurs before every major html header). I think '\n' would work just as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer '\n' then. Also, since assertItemsEqual doesn't care
about the order of the elements, we would need to still have the
self.assertEqual check. The first would help developers identify the
lines that need to be updated and the second verifies there's a
consistently and correctly structured HTML string.
On (Mar-04-15|15:45), mortonjt wrote:
"""Test correct formatting of the footer string""" # footer for a jackknifed pcoa plot without biplots out_string = format_emperor_html_footer_string(False, True)
self.assertEqual(out_string, EXPECTED_FOOTER_A)
self.assertItemsEqual(out_string.split('/'), EXPECTED_FOOTER_A.split('/'))
Just a random common letter ('/' occurs before every major html header). I think '\n' would work just as well.
Reply to this email directly or view it on GitHub:
https://github.com/biocore/emperor/pull/352/files#r25826838
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Looks great, I think we are only missing adding a description about these arrows somewhere in make_emperor.py and it should be ready to be merged! |
Removing whitespace, adding semicolons and condensing toggle function Also updating the changelog and adding additional documentation in the main emperor script to ease interpretation of taxa vectors Updating test script to split by newline
@mortonjt, just a heads up, it seems like there's legitimate failures. |
...
|
function toggleBiplotVisibility(){ | ||
/* Turn on and off the spheres representing the biplots on screen | ||
If the toggleArrow variable is true, then only the visibility of the taxa vectors will be altered | ||
Otherwise, only the visibility of the */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this line?
While we don't have any guidelines on this, we try to keep the comments formatted in the following way:
/* Turn on and off the spheres representing the biplots on screen
If the toggleArrow variable is true, then only the visibility of the taxa vectors will be altered.
*/
I think that's good as is, unless I'm missing something. On (Mar-04-15|17:16), mortonjt wrote:
|
/* Turn on and off the spheres representing the biplots on screen | ||
|
||
If the toggleArrow variable is true, then only the visibility of the taxa vectors will be altered | ||
Otherwise, only the visibility of the */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should still be removed. And the line above should be aligned with the word Turn
that's at the beginning of this block of comments.
There's just one minor (nano-comment) comment and this is ready to be merged! |
g_mainScene.add(g_plotTaxa[index]) | ||
} | ||
} | ||
toggleArrow = typeof toggleArrow !== 'undefined' ? toggleArrow : false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh, well, I guess it didn't reduce the LOC, but at least the forloop is much simpler :)
Thanks @mortonjt, this is ready to be merged, though there are merge conflicts, would you mind solving them? |
I think that should do it |
ENH: Adding vector visualization for biplots
Thanks a lot @mortonjt!! |
Adding in basic vector visualization of taxa. This will ultimately allow easier
A couple of things will need to be addressed in the future