-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Histogram #888
Histogram #888
Conversation
The css and js file use the histogram code from https://bl.ocks.org/mbostock/3048450. THe viz.py extends from BaseViz to create chart data only for one histogram
The new css has been used from the d3 chart http://bl.ocks.org/mbostock/1933560
In response to Issue #714 posted and commented on earlier |
Coverage decreased (-0.7%) to 80.794% when pulling be55235e2e05630391cd4a6ee65d42154a9d1cf6 on shkr:histogram into 7c810db on airbnb:master. |
Coverage decreased (-0.6%) to 80.842% when pulling 65f88bdd2edd2b4ed8a9c6793a2e10dea6782628 on shkr:histogram into 7c810db on airbnb:master. |
@@ -7,7 +7,6 @@ | |||
from __future__ import division | |||
from __future__ import print_function | |||
from __future__ import unicode_literals | |||
|
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.
unrelated change
Coverage decreased (-0.8%) to 80.724% when pulling 04e7eac8c4426e1c47e09f7cda91eabb7045f4fb on shkr:histogram into 7c810db on airbnb:master. |
Coverage decreased (-0.6%) to 80.842% when pulling 04e7eac8c4426e1c47e09f7cda91eabb7045f4fb on shkr:histogram into 7c810db on airbnb:master. |
Coverage decreased (-0.6%) to 80.842% when pulling 1ffd4e789b56d35af7ad5d711b50cf7ddd2c4c16 on shkr:histogram into 7c810db on airbnb:master. |
Coverage decreased (-0.5%) to 80.962% when pulling 0c0f146038de324be26fffd860b015dba0d30e51 on shkr:histogram into 7c810db on airbnb:master. |
It takes as input no of bins. The histogram cycles through a set of colors for different lengths of the bar. It places a y axis coordinate on top or on the upper end of the bar whichever is suitable.
@xrmx i have fixed the issues you posted |
@@ -0,0 +1,24 @@ | |||
.bars rect {} |
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.
unused style rule, let's delete this
Coverage decreased (-0.5%) to 80.95% when pulling 6f6bec3a10ba1f73dc920c80978929db7ff4d268 on shkr:histogram into b0a1f07 on airbnb:master. |
Coverage decreased (-0.5%) to 80.95% when pulling c27c4e9bf572061c15a8faef5b533980063b3646 on shkr:histogram into b0a1f07 on airbnb:master. |
49fad96
to
017732e
Compare
Coverage decreased (-0.5%) to 80.95% when pulling 017732ecca8501e52a6ae21a1e727198ea32340c on shkr:histogram into b0a1f07 on airbnb:master. |
2 similar comments
Coverage decreased (-0.5%) to 80.95% when pulling 017732ecca8501e52a6ae21a1e727198ea32340c on shkr:histogram into b0a1f07 on airbnb:master. |
Coverage decreased (-0.5%) to 80.95% when pulling 017732ecca8501e52a6ae21a1e727198ea32340c on shkr:histogram into b0a1f07 on airbnb:master. |
Coverage decreased (-0.5%) to 80.95% when pulling 017732ecca8501e52a6ae21a1e727198ea32340c on shkr:histogram into b0a1f07 on airbnb:master. |
@mistercrunch I checked out the details for the code-quality all the changes recommended except 1 PEP302 violation, are out of scope for this PR |
@@ -1200,6 +1200,78 @@ def get_data(self): | |||
df.columns = ['x', 'y'] | |||
return df.to_dict(orient="records") | |||
|
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.
one more empty line here
@xrmx Changes made as recommended |
@shkr thanks, python side looks good to me! |
LGTM mergin' |
nice work, thx @shkr! |
I have implemented a Histogram chart using design from http://bl.ocks.org/mbostock/1933560.
It extends BaseViz. It draws a histogram using d3.layout.histogram method after querying a given numeric column from the db. It changes color for different bar lengths in the histogram. It takes as input the no of bins for the histogram.
(Updated Thumbnail!)