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

Fix Bar Chart Stats and PieChart ToolTip #151

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jolavb
Copy link

@jolavb jolavb commented Feb 21, 2018

I noticed that the stats for the discriminatory phrase count were being parsed/calculated from the actual listing descriptions each time a query was run from /tools/stats. The discriminatory phrase count variable was being set by calling listing.check_phrase for each phrase rather than relying on the established discriminatory phrase_listings table. This seems redundant to me, is slow, and does not produce the same results as a join between the listings and phrases table (through phrase_listings). I believe the correct approach is to rely on data in the existing table, otherwise I'm not sure what the function of the phrase_listings table is.

I may be a bit confused, but it also appears that bin/rake classify_listings:initial_set sets discriminatory:true if listing.illegal? is true..but listing.illegal only returns true if listing.discriminatory
is true. It doesn't appear to actually classify listings as discriminatory?

jolavb added 3 commits February 21, 2018 14:32
1. Task classify_listings:check_stats prints:
  a. Total Number of Listings in DB
  b. Total Listings Flagged as Discriminatory
  c. Breakdown of discriminatory phrase counts.
1. Discriminatory_phrase_count was previously set based on the result
of running "check_phrase" (defined in listing model) on each phrase
for each listing. To my understanding this is slow and circumvents
the values already stored in phrase_listings.

2. Discriminatory_phrase_count is now set based on a join between the
Phrase and listings table and returns a grouped phrase count based
on the supplied start and end dates.
1. In the pie chart, the thousands place in the Non-Discriminatory
Listings tool tip was delimited by a space.

2. Added tooltip point format with 0 decimal places
to PieChart to remove the space.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant