ashendruk / comics

Gender representation in superhero comics
0 stars 1 forks source link

fix sort button on gender names chart #46

Closed ashendruk closed 7 years ago

ashendruk commented 7 years ago

Help!? I don't know why I can't figure this out. I feel like it should be easier than it is .... would you mind taking a quick look?

russellsamora commented 7 years ago

I have a lot of questions... like why are you loading the data every click? Also I'm pretty sure your sorting approach is not doing what you think it is, what is if(x.gender==2 && y.gender==2)?

ashendruk commented 7 years ago

I guess I thought I had to load the data each time ... or maybe I just started programming and forgot to take that part out. I don't remember "2" is the gender code. 2 and 1 (one is male, one is female — in the data)

russellsamora commented 7 years ago

ok for starters, you should ideally just load the data once and store it in a variable. Then when it is time to sort, simply sort it and use the sorted version to attach to dom + update. once that is working proper i can take a look again.

ashendruk commented 7 years ago

Ok. I'll give it a try again

ashendruk commented 7 years ago

Got it! But .... cannot for the life of me figure out why the text is not also moving. The text is classed ".dodo" (lol) and the transition lines are at 257 and 291 of the genNames_split.js file. See anything odd there? Thanks!

russellsamora commented 7 years ago

So you should really have all the elements grouped into a single group so you can resort based on either male or female, then transform the entire group, right now the pieces all seem to be disparate and animating on different timings (also why the text is probably not working).

ashendruk commented 7 years ago

Didn't need to restructure. It was a simple classing issue.