[Bug 845775] Replace KB article history charts with Rickshaw #1225

Closed
wants to merge 6 commits into
from

Conversation

Projects
None yet
2 participants
@mythmon
Member

mythmon commented Mar 22, 2013

s/highcharts/rickshaw/.

To test: Go to any KB article. Go to it's history. Click "Show Helpfulness Vote Chart." Play with it.

Of note:

  • Data is now grouped by week instead of by day.
  • No "minimap" below the scroll bar. This isn't built into Rickshaw, and I didn't want to build a new Rickshaw component for it.
  • The graph is technically a little less powerful, because of less UI elements, but I think it can do everything useful from the old version.
  • I also made some of the Rickshaw stuff I wrote before a little more reusable.

Apologies for the massive diff.

r?

mythmon added some commits Mar 22, 2013

[Bug 845775] Make KB helpful graphs use Rickshaw
This replaced Highcharts on the "Show Helpful Votes Chart" link in the
history of a KB article.
@mythmon

This comment has been minimized.

Show comment Hide comment
@mythmon

mythmon Mar 22, 2013

Member

Bah. tests. I'll fix the tests.

Member

mythmon commented Mar 22, 2013

Bah. tests. I'll fix the tests.

apps/wiki/templates/wiki/history.html
+ <div id="helpful-graph" data-url="{{ url('wiki.get_helpful_votes_async', document.slug) }}">
+ <div class="inline-controls">
+ <div>
+ <input type="radio" name="seriesset" value="percent">Percent</input>

This comment has been minimized.

Show comment Hide comment
@rlr

rlr Mar 23, 2013

Member

l10n gettext() missing

@rlr

rlr Mar 23, 2013

Member

l10n gettext() missing

@mythmon

This comment has been minimized.

Show comment Hide comment
@mythmon

mythmon Mar 25, 2013

Member

Tests and L10n^.

Member

mythmon commented Mar 25, 2013

Tests and L10n^.

media/less/wiki.less
@@ -497,6 +489,7 @@ article {
padding: 0 10px 0 0;
text-align: right;
}
+display: none;

This comment has been minimized.

Show comment Hide comment
@rlr

rlr Mar 25, 2013

Member

This seems out of place.

@rlr

rlr Mar 25, 2013

Member

This seems out of place.

@rlr

This comment has been minimized.

Show comment Hide comment
@rlr

rlr Mar 25, 2013

Member

Is it easy to change the hover to something like "week of yyyy-mm-dd"?

Member

rlr commented Mar 25, 2013

Is it easy to change the hover to something like "week of yyyy-mm-dd"?

media/js/historycharts.js
- chart.series[0].hide();
- chart.series[1].hide();
+
+ window.graphObjects = graphObjects;

This comment has been minimized.

Show comment Hide comment
@rlr

rlr Mar 25, 2013

Member

Is this for debugging?

@rlr

rlr Mar 25, 2013

Member

Is this for debugging?

media/js/historycharts.js
+ var lines = {};
+ var series = graphObjects.graph.series;
+ for (i=0; i<series.length; i++) {
+ var s = series[i];

This comment has been minimized.

Show comment Hide comment
@rlr

rlr Mar 25, 2013

Member

The end result isn't different, but it's better to declare the vars outside of the loop to avoid confusion. Same below around line 84.

@rlr

rlr Mar 25, 2013

Member

The end result isn't different, but it's better to declare the vars outside of the loop to avoid confusion. Same below around line 84.

@rlr

This comment has been minimized.

Show comment Hide comment
@rlr

rlr Mar 25, 2013

Member

(You probably know this) It looks like you can pass an xFormatter parameter to the HoverDetails thingy: https://github.com/shutterstock/rickshaw/blob/master/src/js/Rickshaw.Graph.HoverDetail.js#L9

Refactoring opportunities will be showing up quickly as we convert more graphs. I think this is a good first step though.

Member

rlr commented Mar 25, 2013

(You probably know this) It looks like you can pass an xFormatter parameter to the HoverDetails thingy: https://github.com/shutterstock/rickshaw/blob/master/src/js/Rickshaw.Graph.HoverDetail.js#L9

Refactoring opportunities will be showing up quickly as we convert more graphs. I think this is a good first step though.

@mythmon

This comment has been minimized.

Show comment Hide comment
@mythmon

mythmon Mar 25, 2013

Member

Feedback ^

Member

mythmon commented Mar 25, 2013

Feedback ^

@rlr

This comment has been minimized.

Show comment Hide comment
@rlr

rlr Mar 25, 2013

Wow, I didnt remember having k.dateFormat. nice

Wow, I didnt remember having k.dateFormat. nice

@mythmon

This comment has been minimized.

Show comment Hide comment
@mythmon

mythmon Mar 25, 2013

Member

Actually, I added k.dateFormat because I wanted it in the second commit.

Member

mythmon commented Mar 25, 2013

Actually, I added k.dateFormat because I wanted it in the second commit.

@rlr

This comment has been minimized.

Show comment Hide comment
@rlr

rlr Mar 25, 2013

Member

Oh, that makes sense. Awesome!

Member

rlr commented Mar 25, 2013

Oh, that makes sense. Awesome!

@rlr

This comment has been minimized.

Show comment Hide comment
@rlr

rlr Mar 25, 2013

Member

WFM, r+ :shipit:

Member

rlr commented Mar 25, 2013

WFM, r+ :shipit:

@mythmon

This comment has been minimized.

Show comment Hide comment
@mythmon

mythmon Mar 25, 2013

Member
Member

mythmon commented Mar 25, 2013

@mythmon mythmon closed this Mar 25, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment